From 0dfc7fffff68b0bfafd30a86fb322073daf7fc0e Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 23 Feb 2016 00:57:50 +0100 Subject: Removed a couple of TODOs --- src/gestures.c | 2 -- src/rlgl.c | 1 - 2 files changed, 3 deletions(-) (limited to 'src') diff --git a/src/gestures.c b/src/gestures.c index 3638f23e..e615c06d 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -155,8 +155,6 @@ void ProcessGestureEvent(GestureEvent event) dragDistance = Vector2Distance(touchDownPosition, touchUpPosition); dragIntensity = dragDistance/(float)((GetCurrentTime() - swipeTime)); - // TODO: Make getures detection resolution independant - startMoving = false; // Detect GESTURE_SWIPE diff --git a/src/rlgl.c b/src/rlgl.c index 5f8a5ea1..8ea7d0f2 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1611,7 +1611,6 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) } // Get world coordinates from screen coordinates -// TODO: It doesn't work! It drives me crazy! // NOTE: Using global variables: screenWidth, screenHeight Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view) { -- cgit v1.2.3 From 04caf1c26285ecbb3321e9b06a216bef83731eeb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Mar 2016 15:36:45 +0100 Subject: Corrected memory leak --- src/rlgl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 8ea7d0f2..7616c1a4 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1892,9 +1892,9 @@ void rlglGenerateMipmaps(Texture2D texture) void *data = rlglReadTexturePixels(texture); // NOTE: data size is reallocated to fit mipmaps data + // NOTE: CPU mipmap generation only supports RGBA 32bit data int mipmapCount = GenerateMipmaps(data, texture.width, texture.height); - // TODO: Adjust mipmap size depending on texture format! int size = texture.width*texture.height*4; // RGBA 32bit only int offset = size; @@ -1915,6 +1915,9 @@ void rlglGenerateMipmaps(Texture2D texture) TraceLog(WARNING, "[TEX ID %i] Mipmaps generated manually on CPU side", texture.id); + // NOTE: Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data + free(data): + #elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically TraceLog(INFO, "[TEX ID %i] Mipmaps generated automatically", texture.id); @@ -1924,7 +1927,7 @@ void rlglGenerateMipmaps(Texture2D texture) #endif } else TraceLog(WARNING, "[TEX ID %i] Mipmaps can not be generated", texture.id); - + glBindTexture(GL_TEXTURE_2D, 0); } @@ -3106,7 +3109,7 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) int mipmapCount = 1; // Required mipmap levels count (including base level) int width = baseWidth; int height = baseHeight; - int size = baseWidth*baseHeight*4; // Size in bytes (will include mipmaps...) + int size = baseWidth*baseHeight*4; // Size in bytes (will include mipmaps...), RGBA only // Count mipmap levels required while ((width != 1) && (height != 1)) -- cgit v1.2.3 From 8ca6f8c6ec0630c27ce5df646ca12859b74ad980 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Mar 2016 15:37:01 +0100 Subject: Do not free model mesh --- src/models.c | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 8a36c279..fc1bb483 100644 --- a/src/models.c +++ b/src/models.c @@ -575,7 +575,7 @@ Model LoadModel(const char *fileName) // NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel() model = rlglLoadModel(mesh); // Upload vertex data to GPU - // Now that vertex data is uploaded to GPU, we can free arrays + // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM // NOTE 1: We don't need CPU vertex data on OpenGL 3.3 or ES2... for static meshes... // NOTE 2: ...but we could keep CPU vertex data in case we need to update the mesh @@ -718,15 +718,8 @@ Model LoadHeightmap(Image heightmap, Vector3 size) Model model = rlglLoadModel(mesh); - // Now that vertex data is uploaded to GPU, we can free arrays - // NOTE: We don't need CPU vertex data on OpenGL 3.3 or ES2 - if (rlGetVersion() != OPENGL_11) - { - free(mesh.vertices); - free(mesh.texcoords); - free(mesh.normals); - free(mesh.colors); - } + // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM... + // ...but we keep CPU RAM vertex data in case we need to update the mesh return model; } @@ -1093,15 +1086,8 @@ Model LoadCubicmap(Image cubicmap) Model model = rlglLoadModel(mesh); - // Now that vertex data is uploaded to GPU, we can free arrays - // NOTE: We don't need CPU vertex data on OpenGL 3.3 or ES2 - if (rlGetVersion() != OPENGL_11) - { - free(mesh.vertices); - free(mesh.texcoords); - free(mesh.normals); - free(mesh.colors); - } + // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM... + // ...but we keep CPU RAM vertex data in case we need to update the mesh return model; } @@ -1109,16 +1095,20 @@ Model LoadCubicmap(Image cubicmap) // Unload 3d model from memory void UnloadModel(Model model) { - if (rlGetVersion() == OPENGL_11) - { - free(model.mesh.vertices); - free(model.mesh.texcoords); - free(model.mesh.normals); - } - - rlDeleteBuffers(model.mesh.vboId[0]); - rlDeleteBuffers(model.mesh.vboId[1]); - rlDeleteBuffers(model.mesh.vboId[2]); + // Unload mesh data + free(model.mesh.vertices); + free(model.mesh.texcoords); + free(model.mesh.normals); + if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); + if (model.mesh.tangents != NULL) free(model.mesh.tangents); + if (model.mesh.colors != NULL) free(model.mesh.colors); + + rlDeleteBuffers(model.mesh.vboId[0]); // vertex + rlDeleteBuffers(model.mesh.vboId[1]); // texcoords + rlDeleteBuffers(model.mesh.vboId[2]); // normals + rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 + rlDeleteBuffers(model.mesh.vboId[4]); // tangents + rlDeleteBuffers(model.mesh.vboId[5]); // colors rlDeleteVertexArrays(model.mesh.vaoId); -- cgit v1.2.3 From 1674465bdc17f522013c5552bd154f04254d8e74 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Mar 2016 19:00:12 +0100 Subject: Adjust buffers usage - Removed DrawQuad() function - DrawBillboard() uses DrawBillboardRec() - DrawPlane() uses RL_TRIANGLES - DrawRectangleV() uses RL_TRIANGLES, that way, [shapes] module uses only TRIANGLES buffers. --- src/models.c | 86 ++++++++++++------------------------------------------------ src/raylib.h | 1 - src/shapes.c | 45 +++++++------------------------ 3 files changed, 26 insertions(+), 106 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index fc1bb483..4eb2e104 100644 --- a/src/models.c +++ b/src/models.c @@ -446,41 +446,24 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl // Draw a plane void DrawPlane(Vector3 centerPos, Vector2 size, Color color) { - // NOTE: QUADS usage require defining a texture on OpenGL 3.3+ - if (rlGetVersion() != OPENGL_11) rlEnableTexture(whiteTexture); // Default white texture - // NOTE: Plane is always created on XZ ground rlPushMatrix(); rlTranslatef(centerPos.x, centerPos.y, centerPos.z); rlScalef(size.x, 1.0f, size.y); - rlBegin(RL_QUADS); + rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); rlNormal3f(0.0f, 1.0f, 0.0f); - rlTexCoord2f(0.0f, 0.0f); rlVertex3f(-0.5f, 0.0f, -0.5f); - rlTexCoord2f(1.0f, 0.0f); rlVertex3f(-0.5f, 0.0f, 0.5f); - rlTexCoord2f(1.0f, 1.0f); rlVertex3f(0.5f, 0.0f, 0.5f); - rlTexCoord2f(0.0f, 1.0f); rlVertex3f(0.5f, 0.0f, -0.5f); - rlEnd(); - rlPopMatrix(); - if (rlGetVersion() != OPENGL_11) rlDisableTexture(); -} + rlVertex3f(0.5f, 0.0f, -0.5f); + rlVertex3f(-0.5f, 0.0f, -0.5f); + rlVertex3f(-0.5f, 0.0f, 0.5f); -// Draw a quad -void DrawQuad(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Color color) -{ - // TODO: Calculate normals from vertex position - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); - //rlNormal3f(0.0f, 0.0f, 0.0f); - - rlVertex3f(v1.x, v1.y, v1.z); - rlVertex3f(v2.x, v2.y, v2.z); - rlVertex3f(v3.x, v3.y, v3.z); - rlVertex3f(v4.x, v4.y, v4.z); - rlEnd(); + rlVertex3f(-0.5f, 0.0f, 0.5f); + rlVertex3f(0.5f, 0.0f, 0.5f); + rlVertex3f(0.5f, 0.0f, -0.5f); + rlEnd(); + rlPopMatrix(); } // Draw a ray line @@ -1167,60 +1150,25 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float // Draw a billboard void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint) { - // NOTE: Billboard size will maintain texture aspect ratio, size will be billboard width - Vector2 sizeRatio = { size, size * (float)texture.height/texture.width }; - - Matrix viewMatrix = MatrixLookAt(camera.position, camera.target, camera.up); - MatrixTranspose(&viewMatrix); - - Vector3 right = { viewMatrix.m0, viewMatrix.m4, viewMatrix.m8 }; - //Vector3 up = { viewMatrix.m1, viewMatrix.m5, viewMatrix.m9 }; + Rectangle sourceRec = { 0, 0, texture.width, texture.height }; - // NOTE: Billboard locked to axis-Y - Vector3 up = { 0.0f, 1.0f, 0.0f }; -/* - a-------b - | | - | * | - | | - d-------c -*/ - VectorScale(&right, sizeRatio.x/2); - VectorScale(&up, sizeRatio.y/2); - - Vector3 p1 = VectorAdd(right, up); - Vector3 p2 = VectorSubtract(right, up); - - Vector3 a = VectorSubtract(center, p2); - Vector3 b = VectorAdd(center, p1); - Vector3 c = VectorAdd(center, p2); - Vector3 d = VectorSubtract(center, p1); - - rlEnableTexture(texture.id); - - rlBegin(RL_QUADS); - rlColor4ub(tint.r, tint.g, tint.b, tint.a); - - rlTexCoord2f(0.0f, 0.0f); rlVertex3f(a.x, a.y, a.z); - rlTexCoord2f(0.0f, 1.0f); rlVertex3f(d.x, d.y, d.z); - rlTexCoord2f(1.0f, 1.0f); rlVertex3f(c.x, c.y, c.z); - rlTexCoord2f(1.0f, 0.0f); rlVertex3f(b.x, b.y, b.z); - rlEnd(); - - rlDisableTexture(); + DrawBillboardRec(camera, texture, sourceRec, center, size, tint); } // Draw a billboard (part of a texture defined by a rectangle) void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint) { // NOTE: Billboard size will maintain sourceRec aspect ratio, size will represent billboard width - Vector2 sizeRatio = { size, size * (float)sourceRec.height/sourceRec.width }; + Vector2 sizeRatio = { size, size*(float)sourceRec.height/sourceRec.width }; Matrix viewMatrix = MatrixLookAt(camera.position, camera.target, camera.up); MatrixTranspose(&viewMatrix); Vector3 right = { viewMatrix.m0, viewMatrix.m4, viewMatrix.m8 }; - Vector3 up = { viewMatrix.m1, viewMatrix.m5, viewMatrix.m9 }; + //Vector3 up = { viewMatrix.m1, viewMatrix.m5, viewMatrix.m9 }; + + // NOTE: Billboard locked on axis-Y + Vector3 up = { 0.0f, 1.0f, 0.0f }; /* a-------b | | @@ -1702,7 +1650,7 @@ static Mesh LoadOBJ(const char *fileName) // First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles // NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition) - // NOTE: faces MUST be defined as TRIANGLES, not QUADS + // NOTE: faces MUST be defined as TRIANGLES (3 vertex per face) while(!feof(objFile)) { fscanf(objFile, "%c", &dataType); diff --git a/src/raylib.h b/src/raylib.h index c598ec30..36ca216d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -740,7 +740,6 @@ void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Col void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -void DrawQuad(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Color color); // Draw a quad void DrawRay(Ray ray, Color color); // Draw a ray line void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) void DrawGizmo(Vector3 position); // Draw simple gizmo diff --git a/src/shapes.c b/src/shapes.c index 65e3621b..51730a05 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -180,44 +180,17 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo // Draw a color-filled rectangle (Vector version) void DrawRectangleV(Vector2 position, Vector2 size, Color color) { - if (rlGetVersion() == OPENGL_11) - { - rlBegin(RL_TRIANGLES); - rlColor4ub(color.r, color.g, color.b, color.a); - - rlVertex2i(position.x, position.y); - rlVertex2i(position.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y + size.y); - - rlVertex2i(position.x, position.y); - rlVertex2i(position.x + size.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y); - rlEnd(); - } - else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) - { - // NOTE: This shape uses QUADS to avoid drawing order issues (view rlglDraw) - rlEnableTexture(whiteTexture); // Default white texture - - rlBegin(RL_QUADS); - rlColor4ub(color.r, color.g, color.b, color.a); - rlNormal3f(0.0f, 0.0f, 1.0f); - - rlTexCoord2f(0.0f, 0.0f); - rlVertex2f(position.x, position.y); - - rlTexCoord2f(0.0f, 1.0f); - rlVertex2f(position.x, position.y + size.y); - - rlTexCoord2f(1.0f, 1.0f); - rlVertex2f(position.x + size.x, position.y + size.y); + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(1.0f, 0.0f); - rlVertex2f(position.x + size.x, position.y); - rlEnd(); + rlVertex2i(position.x, position.y); + rlVertex2i(position.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y + size.y); - rlDisableTexture(); - } + rlVertex2i(position.x, position.y); + rlVertex2i(position.x + size.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y); + rlEnd(); } // Draw rectangle outline -- cgit v1.2.3 From 6106ab8a2eda76454b0cd3ff46a079896a90eee8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Mar 2016 20:26:01 +0100 Subject: Added color to DrawBoundigBox() --- src/models.c | 4 ++-- src/raylib.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 4eb2e104..a3649a07 100644 --- a/src/models.c +++ b/src/models.c @@ -1213,7 +1213,7 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec } // Draw a bounding box with wires -void DrawBoundingBox(BoundingBox box) +void DrawBoundingBox(BoundingBox box, Color color) { Vector3 size; @@ -1223,7 +1223,7 @@ void DrawBoundingBox(BoundingBox box) Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f }; - DrawCubeWires(center, size.x, size.y, size.z, GREEN); + DrawCubeWires(center, size.x, size.y, size.z, color); } // Detect collision between two spheres diff --git a/src/raylib.h b/src/raylib.h index 36ca216d..73f92fc2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -760,7 +760,7 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint); void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set) void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -void DrawBoundingBox(BoundingBox box); // Draw bounding box (wires) +void DrawBoundingBox(BoundingBox box, Color color) // Draw bounding box (wires) void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec -- cgit v1.2.3 From 4011c13d4b0b7a684def27bac29f084085bf87a5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Mar 2016 20:54:02 +0100 Subject: Updated BoundingBox collision detections --- src/models.c | 48 ++++++++++++++++++++---------------------------- src/raylib.h | 10 +++++----- 2 files changed, 25 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a3649a07..fc95f58d 100644 --- a/src/models.c +++ b/src/models.c @@ -1244,14 +1244,14 @@ bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, floa // Detect collision between two boxes // NOTE: Boxes are defined by two points minimum and maximum -bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2) +bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2) { bool collision = true; - if ((maxBBox1.x >= minBBox2.x) && (minBBox1.x <= maxBBox2.x)) + if ((box1.max.x >= box2.min.x) && (box1.min.x <= box2.max.x)) { - if ((maxBBox1.y < minBBox2.y) || (minBBox1.y > maxBBox2.y)) collision = false; - if ((maxBBox1.z < minBBox2.z) || (minBBox1.z > maxBBox2.z)) collision = false; + if ((box1.max.y < box2.min.y) || (box1.min.y > box2.max.y)) collision = false; + if ((box1.max.z < box2.min.z) || (box1.min.z > box2.max.z)) collision = false; } else collision = false; @@ -1259,30 +1259,22 @@ bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, V } // Detect collision between box and sphere -bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere) +bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere) { bool collision = false; - if ((centerSphere.x - minBBox.x > radiusSphere) && (centerSphere.y - minBBox.y > radiusSphere) && (centerSphere.z - minBBox.z > radiusSphere) && - (maxBBox.x - centerSphere.x > radiusSphere) && (maxBBox.y - centerSphere.y > radiusSphere) && (maxBBox.z - centerSphere.z > radiusSphere)) - { - collision = true; - } - else - { - float dmin = 0; + float dmin = 0; - if (centerSphere.x - minBBox.x <= radiusSphere) dmin += (centerSphere.x - minBBox.x)*(centerSphere.x - minBBox.x); - else if (maxBBox.x - centerSphere.x <= radiusSphere) dmin += (centerSphere.x - maxBBox.x)*(centerSphere.x - maxBBox.x); + if (centerSphere.x < box.min.x) dmin += pow(centerSphere.x - box.min.x, 2); + else if (centerSphere.x > box.max.x) dmin += pow(centerSphere.x - box.max.x, 2); - if (centerSphere.y - minBBox.y <= radiusSphere) dmin += (centerSphere.y - minBBox.y)*(centerSphere.y - minBBox.y); - else if (maxBBox.y - centerSphere.y <= radiusSphere) dmin += (centerSphere.y - maxBBox.y)*(centerSphere.y - maxBBox.y); + if (centerSphere.y < box.min.y) dmin += pow(centerSphere.y - box.min.y, 2); + else if (centerSphere.y > box.max.y) dmin += pow(centerSphere.y - box.max.y, 2); - if (centerSphere.z - minBBox.z <= radiusSphere) dmin += (centerSphere.z - minBBox.z)*(centerSphere.z - minBBox.z); - else if (maxBBox.z - centerSphere.z <= radiusSphere) dmin += (centerSphere.z - maxBBox.z)*(centerSphere.z - maxBBox.z); + if (centerSphere.z < box.min.z) dmin += pow(centerSphere.z - box.min.z, 2); + else if (centerSphere.z > box.max.z) dmin += pow(centerSphere.z - box.max.z, 2); - if (dmin <= radiusSphere*radiusSphere) collision = true; - } + if (dmin <= (radiusSphere*radiusSphere)) collision = true; return collision; } @@ -1333,17 +1325,17 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadi } // Detect collision between ray and bounding box -bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox) +bool CheckCollisionRayBox(Ray ray, BoundingBox box) { bool collision = false; float t[8]; - t[0] = (minBBox.x - ray.position.x)/ray.direction.x; - t[1] = (maxBBox.x - ray.position.x)/ray.direction.x; - t[2] = (minBBox.y - ray.position.y)/ray.direction.y; - t[3] = (maxBBox.y - ray.position.y)/ray.direction.y; - t[4] = (minBBox.z - ray.position.z)/ray.direction.z; - t[5] = (maxBBox.z - ray.position.z)/ray.direction.z; + t[0] = (box.min.x - ray.position.x)/ray.direction.x; + t[1] = (box.max.x - ray.position.x)/ray.direction.x; + t[2] = (box.min.y - ray.position.y)/ray.direction.y; + t[3] = (box.max.y - ray.position.y)/ray.direction.y; + t[4] = (box.min.z - ray.position.z)/ray.direction.z; + t[5] = (box.max.z - ray.position.z)/ray.direction.z; t[6] = fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5])); t[7] = fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5])); diff --git a/src/raylib.h b/src/raylib.h index 73f92fc2..b7dc1a8c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -760,18 +760,18 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint); void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set) void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -void DrawBoundingBox(BoundingBox box, Color color) // Draw bounding box (wires) +void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec -BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits +BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres -bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2); // Detect collision between two boxes -bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere +bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes +bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection -bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox); // Detect collision between ray and box +bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap // NOTE: Return the normal vector of the impacted surface //------------------------------------------------------------------------------------ -- cgit v1.2.3 From 4476a9e241b952f631afb6c8c3f3c69a481219e3 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 2 Mar 2016 17:13:31 +0100 Subject: Review rlglUnproject() system --- src/core.c | 42 +++++++++++++++++++++--------------------- src/raylib.h | 1 + src/raymath.h | 2 +- src/rlgl.c | 54 ++++++++++++------------------------------------------ 4 files changed, 35 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index dbcfa6bc..1589439e 100644 --- a/src/core.c +++ b/src/core.c @@ -612,11 +612,11 @@ void Begin3dMode(Camera camera) // Setup perspective projection float aspect = (float)screenWidth/(float)screenHeight; - double top = 0.1*tan(45.0*PI/360.0); + double top = 0.01*tan(45.0*PI/360.0); double right = top*aspect; // NOTE: zNear and zFar values are important when computing depth buffer values - rlFrustum(-right, right, -top, top, 0.1f, 1000.0f); + rlFrustum(-right, right, -top, top, 0.01, 1000.0); rlMatrixMode(RL_MODELVIEW); // Switch back to modelview matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -867,16 +867,8 @@ int StorageLoadValue(int position) } // Returns a ray trace from mouse position -//http://www.songho.ca/opengl/gl_transform.html -//http://www.songho.ca/opengl/gl_matrix.html -//http://www.sjbaker.org/steve/omniv/matrices_can_be_your_friends.html -//https://www.opengl.org/archives/resources/faq/technical/transformations.htm Ray GetMouseRay(Vector2 mousePosition, Camera camera) -{ - // Tutorial used: https://mkonrad.net/2014/08/07/simple-opengl-object-picking-in-3d.html - // Similar to http://antongerdelan.net, the problem is maybe in MatrixPerspective vs MatrixFrustum - // or matrix order (transpose it or not... that's the question) - +{ Ray ray; // Calculate normalized device coordinates @@ -886,40 +878,48 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) float z = 1.0f; // Store values in a vector - Vector3 deviceCoords = {x, y, z}; + Vector3 deviceCoords = { x, y, z }; - // Device debug message - TraceLog(INFO, "device(%f, %f, %f)", deviceCoords.x, deviceCoords.y, deviceCoords.z); + TraceLog(DEBUG, "Device coordinates: (%f, %f, %f)", deviceCoords.x, deviceCoords.y, deviceCoords.z); - // Calculate projection matrix (from perspective instead of frustum - Matrix matProj = MatrixPerspective(45.0f, (float)((float)GetScreenWidth() / (float)GetScreenHeight()), 0.01f, 1000.0f); + // Calculate projection matrix (from perspective instead of frustum) + Matrix matProj = MatrixPerspective(45.0, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0); // Calculate view matrix from camera look at Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); // Do I need to transpose it? It seems that yes... - // NOTE: matrix order is maybe incorrect... In OpenGL to get world position from + // NOTE: matrix order may be incorrect... In OpenGL to get world position from // camera view it just needs to get inverted, but here we need to transpose it too. // For example, if you get view matrix, transpose and inverted and you transform it // to a vector, you will get its 3d world position coordinates (camera.position). // If you don't transpose, final position will be wrong. MatrixTranspose(&matView); +//#define USE_RLGL_UNPROJECT +#if defined(USE_RLGL_UNPROJECT) // OPTION 1: Use rlglUnproject() + + Vector3 nearPoint = rlglUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 0.0f }, matProj, matView); + Vector3 farPoint = rlglUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView); + +#else // OPTION 2: Compute unprojection directly here + // Calculate unproject matrix (multiply projection matrix and view matrix) and invert it Matrix matProjView = MatrixMultiply(matProj, matView); MatrixInvert(&matProjView); // Calculate far and near points - Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f}; - Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f}; + Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; + Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; // Multiply points by unproject matrix QuaternionTransform(&near, matProjView); QuaternionTransform(&far, matProjView); // Calculate normalized world points in vectors - Vector3 nearPoint = {near.x / near.w, near.y / near.w, near.z / near.w}; - Vector3 farPoint = {far.x / far.w, far.y / far.w, far.z / far.w}; + Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w}; + Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w}; +#endif // Calculate normalized direction vector Vector3 direction = VectorSubtract(farPoint, nearPoint); diff --git a/src/raylib.h b/src/raylib.h index b7dc1a8c..4f36e203 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -312,6 +312,7 @@ typedef struct Camera { Vector3 position; Vector3 target; Vector3 up; + //float fovy; // Field-Of-View apperture in Y (degrees) } Camera; // Bounding box type diff --git a/src/raymath.h b/src/raymath.h index 35cee39f..52e92b50 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -803,7 +803,7 @@ RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top, // Returns perspective projection matrix RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double far) { - double top = near*tanf(fovy*PI/360.0f); + double top = near*tan(fovy*PI/360.0); double right = top*aspect; return MatrixFrustum(-right, right, -top, top, near, far); diff --git a/src/rlgl.c b/src/rlgl.c index 7616c1a4..e1949274 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1611,54 +1611,24 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) } // Get world coordinates from screen coordinates -// NOTE: Using global variables: screenWidth, screenHeight Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view) { - Vector3 result = { 0.0f, 0.0f, 0.0f }; // Object coordinates + Vector3 result = { 0.0f, 0.0f, 0.0f }; - //GLint viewport[4]; - //glGetIntegerv(GL_VIEWPORT, viewport); // Not available on OpenGL ES 2.0 - - // Viewport data - int x = 0; // viewport[0] - int y = 0; // viewport[1] - int width = screenWidth; // viewport[2] - int height = screenHeight; // viewport[3] + // Calculate unproject matrix (multiply projection matrix and view matrix) and invert it + Matrix matProjView = MatrixMultiply(proj, view); + MatrixInvert(&matProjView); - Matrix modelviewprojection = MatrixMultiply(view, proj); - MatrixInvert(&modelviewprojection); -/* - // NOTE: Compute unproject using Vector3 - - // Transformation of normalized coordinates between -1 and 1 - result.x = ((source.x - (float)x)/(float)width)*2.0f - 1.0f; - result.y = ((source.y - (float)y)/(float)height)*2.0f - 1.0f; - result.z = source.z*2.0f - 1.0f; - - // Object coordinates (multiply vector by matrix) - VectorTransform(&result, modelviewprojection); -*/ - - // NOTE: Compute unproject using Quaternion (Vector4) - Quaternion quat; + // Create quaternion from source point + Quaternion quat = { source.x, source.y, source.z, 1.0f }; - quat.x = ((source.x - (float)x)/(float)width)*2.0f - 1.0f; - quat.y = ((source.y - (float)y)/(float)height)*2.0f - 1.0f; - quat.z = source.z*2.0f - 1.0f; - quat.w = 1.0f; + // Multiply quat point by unproject matrix + QuaternionTransform(&quat, matProjView); - QuaternionTransform(&quat, modelviewprojection); - - if (quat.w != 0.0f) - { - quat.x /= quat.w; - quat.y /= quat.w; - quat.z /= quat.w; - } - - result.x = quat.x; - result.y = quat.y; - result.z = quat.z; + // Normalized world points in vectors + result.x = quat.x/quat.w; + result.y = quat.y/quat.w; + result.z = quat.z/quat.w; return result; } -- cgit v1.2.3 From a167067cbd1a330d435dbe652c2ecbeda5e1f35d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 2 Mar 2016 18:35:30 +0100 Subject: Security check for unsupported BMFonts - Check if first character is the expected Space char (32) - Check if characters are ordered in definition file (.fnt) --- src/text.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index e4c7bbf3..f89d5e4e 100644 --- a/src/text.c +++ b/src/text.c @@ -819,11 +819,17 @@ static SpriteFont LoadBMFont(const char *fileName) int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; + bool unorderedChars = false; + int firstChar = 0; + for (int i = 0; i < numChars; i++) { fgets(buffer, MAX_BUFFER_SIZE, fntFile); sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", &charId, &charX, &charY, &charWidth, &charHeight, &charOffsetX, &charOffsetY, &charAdvanceX); + + if (i == 0) firstChar = charId; + else if (i != (charId - firstChar)) unorderedChars = true; // Save data properly in sprite font font.charValues[i] = charId; @@ -832,14 +838,20 @@ static SpriteFont LoadBMFont(const char *fileName) font.charAdvanceX[i] = charAdvanceX; } - // TODO: Font data could be not ordered by charId: 32,33,34,35... review charValues and charRecs order - fclose(fntFile); - - TraceLog(INFO, "[%s] SpriteFont loaded successfully", fileName); + + if (firstChar != FONT_FIRST_CHAR) TraceLog(WARNING, "BMFont not supported: expected SPACE(32) as first character, falling back to default font"); + else if (unorderedChars) TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); + + // NOTE: Font data could be not ordered by charId: 32,33,34,35... raylib does not support unordered BMFonts + if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars)) + { + UnloadSpriteFont(font); + font = GetDefaultFont(); + } + else TraceLog(INFO, "[%s] SpriteFont loaded successfully", fileName); return font; - } // Generate a sprite font from TTF file data (font size required) -- cgit v1.2.3 From fffbf48dec317d55262de62f8bab757a31d0eebd Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 2 Mar 2016 19:22:55 +0100 Subject: Added support for Nearest-Neighbor image scaling Specially useful on default font scaling --- src/raylib.h | 1 + src/textures.c | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 4f36e203..f8f1683e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -691,6 +691,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) +void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) diff --git a/src/textures.c b/src/textures.c index 36819daf..cb3113dc 100644 --- a/src/textures.c +++ b/src/textures.c @@ -919,6 +919,39 @@ void ImageResize(Image *image, int newWidth, int newHeight) free(pixels); } +// Resize and image to new size using Nearest-Neighbor scaling algorithm +void ImageResizeNN(Image *image,int newWidth,int newHeight) +{ + Color *pixels = GetImageData(*image); + Color *output = (Color *)malloc(newWidth*newHeight*sizeof(Color)); + + // EDIT: added +1 to account for an early rounding problem + int x_ratio = (int)((image->width<<16)/newWidth) + 1; + int y_ratio = (int)((image->height<<16)/newHeight) + 1; + + int x2, y2; + for (int i = 0; i < newHeight; i++) + { + for (int j = 0; j < newWidth; j++) + { + x2 = ((j*x_ratio) >> 16); + y2 = ((i*y_ratio) >> 16); + + output[(i*newWidth) + j] = pixels[(y2*image->width) + x2] ; + } + } + + int format = image->format; + + UnloadImage(*image); + + *image = LoadImageEx(output, newWidth, newHeight); + ImageFormat(image, format); // Reformat 32bit RGBA image to original format + + free(output); + free(pixels); +} + // Draw an image (source) within an image (destination) void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) { @@ -1046,8 +1079,9 @@ Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, float scaleFactor = (float)fontSize/imSize.y; TraceLog(INFO, "Scalefactor: %f", scaleFactor); - // TODO: Allow nearest-neighbor scaling algorithm - ImageResize(&imText, (int)(imSize.x*scaleFactor), (int)(imSize.y*scaleFactor)); + // Using nearest-neighbor scaling algorithm for default font + if (font.texture.id == GetDefaultFont().texture.id) ImageResizeNN(&imText, (int)(imSize.x*scaleFactor), (int)(imSize.y*scaleFactor)); + else ImageResize(&imText, (int)(imSize.x*scaleFactor), (int)(imSize.y*scaleFactor)); } free(pixels); -- cgit v1.2.3 From dcbf2a0e0c904870ac3ac59a3623a3954ab0243f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 3 Mar 2016 13:24:56 +0100 Subject: Replaced tabs by spaces --- src/core.c | 12 ++++++------ src/raylib.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 1589439e..259e1f29 100644 --- a/src/core.c +++ b/src/core.c @@ -1752,8 +1752,8 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int // Normalize gestureEvent.position[0] for screenWidth and screenHeight gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures system for processing + + // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); #endif } @@ -1890,7 +1890,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // TODO: GPU assets reload in case of lost focus (lost context) // NOTE: This problem has been solved just unbinding and rebinding context from display - /* + /* if (assetsReloadRequired) { for (int i = 0; i < assetsCount; i++) @@ -2471,9 +2471,9 @@ static void *GamepadThread(void *arg) const int joystickAxisY = 1; // Read gamepad event - struct js_event gamepadEvent; + struct js_event gamepadEvent; - while (1) + while (1) { if (read(gamepadStream, &gamepadEvent, sizeof(struct js_event)) == (int)sizeof(struct js_event)) { @@ -2507,7 +2507,7 @@ static void *GamepadThread(void *arg) */ } } - } + } return NULL; } diff --git a/src/raylib.h b/src/raylib.h index f8f1683e..00afb4f3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -385,7 +385,7 @@ typedef struct Model { Matrix transform; Texture2D texture; // Only for OpenGL 1.1, on newer versions this should be in the shader Shader shader; - //Material material; + //Material material; } Model; // Ray type (useful for raycast) -- cgit v1.2.3 From d8bd8634ab7d5179cb1481206176af1f8e592e75 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 5 Mar 2016 13:05:45 +0100 Subject: 3d Camera: Added support for field-of-view Y --- src/camera.c | 8 +++++++- src/camera.h | 1 + src/core.c | 20 ++++++++++---------- src/models.c | 28 +++++++++------------------- src/raylib.h | 9 +++++---- 5 files changed, 32 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/camera.c b/src/camera.c index 517e4a2b..8e5c527e 100644 --- a/src/camera.c +++ b/src/camera.c @@ -84,7 +84,7 @@ typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_D //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Camera internalCamera = {{ 2.0f, 0.0f, 2.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }}; +static Camera internalCamera = {{ 2.0f, 0.0f, 2.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; static Vector2 cameraAngle = { 0.0f, 0.0f }; static float cameraTargetDistance = 5.0f; static Vector2 cameraMousePosition = { 0.0f, 0.0f }; @@ -212,6 +212,12 @@ void SetCameraTarget(Vector3 target) cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); } +// Set internal camera fovy +void SetCameraFovy(float fovy) +{ + internalCamera.fovy = fovy; +} + // Set camera pan key to combine with mouse movement (free camera) void SetCameraPanControl(int panKey) { diff --git a/src/camera.h b/src/camera.h index 9ad09c6f..8d8029af 100644 --- a/src/camera.h +++ b/src/camera.h @@ -81,6 +81,7 @@ void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and void SetCameraPosition(Vector3 position); // Set internal camera position void SetCameraTarget(Vector3 target); // Set internal camera target +void SetCameraFovy(float fovy); // Set internal camera field-of-view-y void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) diff --git a/src/core.c b/src/core.c index 259e1f29..a8cc593a 100644 --- a/src/core.c +++ b/src/core.c @@ -609,10 +609,10 @@ void Begin3dMode(Camera camera) rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection rlLoadIdentity(); // Reset current matrix (PROJECTION) - + // Setup perspective projection float aspect = (float)screenWidth/(float)screenHeight; - double top = 0.01*tan(45.0*PI/360.0); + double top = 0.01*tan(camera.fovy*PI/360.0); double right = top*aspect; // NOTE: zNear and zFar values are important when computing depth buffer values @@ -883,7 +883,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) TraceLog(DEBUG, "Device coordinates: (%f, %f, %f)", deviceCoords.x, deviceCoords.y, deviceCoords.z); // Calculate projection matrix (from perspective instead of frustum) - Matrix matProj = MatrixPerspective(45.0, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0); + Matrix matProj = MatrixPerspective(camera.fovy, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0); // Calculate view matrix from camera look at Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); @@ -936,7 +936,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) Vector2 WorldToScreen(Vector3 position, Camera camera) { // Calculate projection matrix (from perspective instead of frustum - Matrix matProj = MatrixPerspective(45.0f, (float)((float)GetScreenWidth() / (float)GetScreenHeight()), 0.01f, 1000.0f); + Matrix matProj = MatrixPerspective(camera.fovy, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0); // Calculate view matrix from camera look at (and transpose it) Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); @@ -1752,8 +1752,8 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int // Normalize gestureEvent.position[0] for screenWidth and screenHeight gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures system for processing + + // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); #endif } @@ -1890,7 +1890,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // TODO: GPU assets reload in case of lost focus (lost context) // NOTE: This problem has been solved just unbinding and rebinding context from display - /* + /* if (assetsReloadRequired) { for (int i = 0; i < assetsCount; i++) @@ -2471,9 +2471,9 @@ static void *GamepadThread(void *arg) const int joystickAxisY = 1; // Read gamepad event - struct js_event gamepadEvent; + struct js_event gamepadEvent; - while (1) + while (1) { if (read(gamepadStream, &gamepadEvent, sizeof(struct js_event)) == (int)sizeof(struct js_event)) { @@ -2507,7 +2507,7 @@ static void *GamepadThread(void *arg) */ } } - } + } return NULL; } diff --git a/src/models.c b/src/models.c index fc95f58d..a0b0e656 100644 --- a/src/models.c +++ b/src/models.c @@ -558,19 +558,9 @@ Model LoadModel(const char *fileName) // NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel() model = rlglLoadModel(mesh); // Upload vertex data to GPU - // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM - // NOTE 1: We don't need CPU vertex data on OpenGL 3.3 or ES2... for static meshes... - // NOTE 2: ...but we could keep CPU vertex data in case we need to update the mesh - - /* - if (rlGetVersion() != OPENGL_11) - { - free(mesh.vertices); - free(mesh.texcoords); - free(mesh.normals); - free(mesh.colors); - } - */ + // NOTE: Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM + // We don't need CPU vertex data on OpenGL 3.3 or ES2... for static meshes... + // ...but we could keep CPU vertex data in case we need to update the mesh } return model; @@ -1082,16 +1072,16 @@ void UnloadModel(Model model) free(model.mesh.vertices); free(model.mesh.texcoords); free(model.mesh.normals); - if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); - if (model.mesh.tangents != NULL) free(model.mesh.tangents); - if (model.mesh.colors != NULL) free(model.mesh.colors); + free(model.mesh.colors); + //if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); // Not used + //if (model.mesh.tangents != NULL) free(model.mesh.tangents); // Not used rlDeleteBuffers(model.mesh.vboId[0]); // vertex rlDeleteBuffers(model.mesh.vboId[1]); // texcoords rlDeleteBuffers(model.mesh.vboId[2]); // normals - rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 - rlDeleteBuffers(model.mesh.vboId[4]); // tangents - rlDeleteBuffers(model.mesh.vboId[5]); // colors + //rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[4]); // tangents (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[5]); // colors (NOT USED) rlDeleteVertexArrays(model.mesh.vaoId); diff --git a/src/raylib.h b/src/raylib.h index 00afb4f3..b6cf98fe 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -309,10 +309,10 @@ typedef struct SpriteFont { // Camera type, defines a camera position/orientation in 3d space typedef struct Camera { - Vector3 position; - Vector3 target; - Vector3 up; - //float fovy; // Field-Of-View apperture in Y (degrees) + Vector3 position; // Camera position + Vector3 target; // Camera target it looks-at + Vector3 up; // Camera up vector (rotation over its axis) + float fovy; // Field-Of-View apperture in Y (degrees) } Camera; // Bounding box type @@ -630,6 +630,7 @@ void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and void SetCameraPosition(Vector3 position); // Set internal camera position void SetCameraTarget(Vector3 target); // Set internal camera target +void SetCameraFovy(float fovy); // Set internal camera field-of-view-y void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) -- cgit v1.2.3 From 5ea18b9426823e92f1fc16e686702f2caadf83c9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 5 Mar 2016 15:40:08 +0100 Subject: Support 2d camera system -IN PROGRESS- --- src/core.c | 21 +++++++++++++++++++-- src/raylib.h | 11 ++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index a8cc593a..870ca3b4 100644 --- a/src/core.c +++ b/src/core.c @@ -560,8 +560,25 @@ void BeginDrawing(void) // NOTE: Not required with OpenGL 3.3+ } -// Setup drawing canvas with extended parameters -void BeginDrawingEx(int blendMode, Shader shader, Matrix transform) +// Setup drawing canvas with 2d camera +void BeginDrawingEx(Camera2D camera) +{ + BeginDrawing(); + + // TODO: Consider origin offset on position, rotation, scaling + + Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); + Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); + Matrix matTranslation = MatrixTranslate(camera.position.x, camera.position.y, 0.0f); + Matrix matOrigin = MatrixTranslate(-camera.origin.x, -camera.origin.y, 0.0f); + + Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); + + rlMultMatrixf(MatrixToFloat(matTransform)); +} + +// Setup drawing canvas with pro parameters +void BeginDrawingPro(int blendMode, Shader shader, Matrix transform) { BeginDrawing(); diff --git a/src/raylib.h b/src/raylib.h index b6cf98fe..7173a556 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -315,6 +315,14 @@ typedef struct Camera { float fovy; // Field-Of-View apperture in Y (degrees) } Camera; +// Camera2D type, defines a 2d camera +typedef struct Camera2D { + Vector2 position; // Camera position + Vector2 origin; // Camera origin (for rotation and zoom) + float rotation; // Camera rotation in degrees + float zoom; // Camera zoom (scaling), should be 1.0f by default +} Camera2D; + // Bounding box type typedef struct BoundingBox { Vector3 min; @@ -528,7 +536,8 @@ int GetScreenHeight(void); // Get current scree void ClearBackground(Color color); // Sets Background Color void BeginDrawing(void); // Setup drawing canvas to start drawing -void BeginDrawingEx(int blendMode, Shader shader, Matrix transform); // Setup drawing canvas with extended parameters +void BeginDrawingEx(Camera2D camera); // Setup drawing canvas with 2d camera +void BeginDrawingPro(int blendMode, Shader shader, Matrix transform); // Setup drawing canvas with pro parameters void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) -- cgit v1.2.3 From 0d911127d759e3f507b598c1666da1635c863e51 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 5 Mar 2016 16:17:54 +0100 Subject: Split mesh generation from model loading --- src/models.c | 138 ++++++++++++++++++++++++++++++----------------------------- src/raylib.h | 2 +- 2 files changed, 71 insertions(+), 69 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a0b0e656..ee5e57c7 100644 --- a/src/models.c +++ b/src/models.c @@ -56,6 +56,8 @@ extern unsigned int whiteTexture; // Module specific Functions Declaration //---------------------------------------------------------------------------------- static Mesh LoadOBJ(const char *fileName); +static Mesh GenMeshHeightmap(Image image, Vector3 size); +static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); //---------------------------------------------------------------------------------- // Module Functions Definition @@ -582,6 +584,63 @@ Model LoadModelEx(Mesh data) // Load a heightmap image as a 3d model // NOTE: model map size is defined in generic units Model LoadHeightmap(Image heightmap, Vector3 size) +{ + Mesh mesh = GenMeshHeightmap(heightmap, size); + Model model = rlglLoadModel(mesh); + + return model; +} + +// Load a map image as a 3d model (cubes based) +Model LoadCubicmap(Image cubicmap) +{ + Mesh mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0, 1.0, 1.5f }); + Model model = rlglLoadModel(mesh); + + return model; +} + +// Unload 3d model from memory +void UnloadModel(Model model) +{ + // Unload mesh data + free(model.mesh.vertices); + free(model.mesh.texcoords); + free(model.mesh.normals); + free(model.mesh.colors); + //if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); // Not used + //if (model.mesh.tangents != NULL) free(model.mesh.tangents); // Not used + + rlDeleteBuffers(model.mesh.vboId[0]); // vertex + rlDeleteBuffers(model.mesh.vboId[1]); // texcoords + rlDeleteBuffers(model.mesh.vboId[2]); // normals + //rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[4]); // tangents (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[5]); // colors (NOT USED) + + rlDeleteVertexArrays(model.mesh.vaoId); + + if (model.mesh.vaoId > 0) TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vaoId); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vboId[0], model.mesh.vboId[1], model.mesh.vboId[2]); +} + +// Link a texture to a model +void SetModelTexture(Model *model, Texture2D texture) +{ + if (texture.id <= 0) + { + // Use default white texture (use mesh color) + model->texture.id = whiteTexture; // OpenGL 1.1 + model->shader.texDiffuseId = whiteTexture; // OpenGL 3.3 / ES 2.0 + } + else + { + model->texture = texture; + model->shader.texDiffuseId = texture.id; + } +} + +static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { #define GRAY_VALUE(c) ((c.r+c.g+c.b)/3) @@ -687,27 +746,17 @@ Model LoadHeightmap(Image heightmap, Vector3 size) // NOTE: Not used any more... just one plain color defined at DrawModel() for (int i = 0; i < (4*mesh.vertexCount); i++) mesh.colors[i] = 255; - // NOTE: At this point we have all vertex, texcoord, normal data for the model in mesh struct - - Model model = rlglLoadModel(mesh); - - // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM... - // ...but we keep CPU RAM vertex data in case we need to update the mesh - - return model; + return mesh; } -// Load a map image as a 3d model (cubes based) -Model LoadCubicmap(Image cubicmap) +static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) { Mesh mesh; Color *cubicmapPixels = GetImageData(cubicmap); - // Map cube size will be 1.0 - float mapCubeSide = 1.0f; - int mapWidth = cubicmap.width*(int)mapCubeSide; - int mapHeight = cubicmap.height*(int)mapCubeSide; + int mapWidth = cubicmap.width*(int)cubeSize.x; + int mapHeight = cubicmap.height*(int)cubeSize.z; // NOTE: Max possible number of triangles numCubes * (12 triangles by cube) int maxTriangles = cubicmap.width*cubicmap.height*12; @@ -716,9 +765,9 @@ Model LoadCubicmap(Image cubicmap) int tcCounter = 0; // Used to count texcoords int nCounter = 0; // Used to count normals - float w = mapCubeSide; - float h = mapCubeSide; - float h2 = mapCubeSide*1.5f; // TODO: Review walls height... + float w = cubeSize.x; + float h = cubeSize.z; + float h2 = cubeSize.y; Vector3 *mapVertices = (Vector3 *)malloc(maxTriangles*3*sizeof(Vector3)); Vector2 *mapTexcoords = (Vector2 *)malloc(maxTriangles*3*sizeof(Vector2)); @@ -747,9 +796,9 @@ Model LoadCubicmap(Image cubicmap) RectangleF topTexUV = { 0.0f, 0.5f, 0.5f, 0.5f }; RectangleF bottomTexUV = { 0.5f, 0.5f, 0.5f, 0.5f }; - for (int z = 0; z < mapHeight; z += mapCubeSide) + for (int z = 0; z < mapHeight; z += cubeSize.z) { - for (int x = 0; x < mapWidth; x += mapCubeSide) + for (int x = 0; x < mapWidth; x += cubeSize.x) { // Define the 8 vertex of the cube, we will combine them accordingly later... Vector3 v1 = { x - w/2, h2, z - h/2 }; @@ -1053,56 +1102,9 @@ Model LoadCubicmap(Image cubicmap) free(mapNormals); free(mapTexcoords); - free(cubicmapPixels); - - // NOTE: At this point we have all vertex, texcoord, normal data for the model in mesh struct - - Model model = rlglLoadModel(mesh); - - // Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM... - // ...but we keep CPU RAM vertex data in case we need to update the mesh - - return model; -} - -// Unload 3d model from memory -void UnloadModel(Model model) -{ - // Unload mesh data - free(model.mesh.vertices); - free(model.mesh.texcoords); - free(model.mesh.normals); - free(model.mesh.colors); - //if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); // Not used - //if (model.mesh.tangents != NULL) free(model.mesh.tangents); // Not used + free(cubicmapPixels); // Free image pixel data - rlDeleteBuffers(model.mesh.vboId[0]); // vertex - rlDeleteBuffers(model.mesh.vboId[1]); // texcoords - rlDeleteBuffers(model.mesh.vboId[2]); // normals - //rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 (NOT USED) - //rlDeleteBuffers(model.mesh.vboId[4]); // tangents (NOT USED) - //rlDeleteBuffers(model.mesh.vboId[5]); // colors (NOT USED) - - rlDeleteVertexArrays(model.mesh.vaoId); - - if (model.mesh.vaoId > 0) TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vaoId); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vboId[0], model.mesh.vboId[1], model.mesh.vboId[2]); -} - -// Link a texture to a model -void SetModelTexture(Model *model, Texture2D texture) -{ - if (texture.id <= 0) - { - // Use default white texture (use mesh color) - model->texture.id = whiteTexture; // OpenGL 1.1 - model->shader.texDiffuseId = whiteTexture; // OpenGL 3.3 / ES 2.0 - } - else - { - model->texture = texture; - model->shader.texDiffuseId = texture.id; - } + return mesh; } // Draw a model (with texture if set) diff --git a/src/raylib.h b/src/raylib.h index 7173a556..9545f96d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -761,7 +761,7 @@ void DrawGizmo(Vector3 position); // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) -Model LoadModelEx(Mesh data); // Load a 3d model (from vertex data) +Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data) //Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource) Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) -- cgit v1.2.3 From 305efcf5ad715305ccb33b0e1d2d9baf4a34976a Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 5 Mar 2016 17:05:02 +0100 Subject: Redesigned physics module (IN PROGRESS) physac modules is being redesigned. Physics base behaviour is done and it is composed by three steps: apply physics, resolve collisions and fix overlapping. A basic example is currently in progress. The next steps are try to add torque and unoriented physic collisions and implement physics basic functions to add forces. Rigidbody grounding state is automatically calculated and has a perfect result. Rigidbodies interacts well with each others. To achieve physics accuracy, UpdatePhysics() is called a number of times per frame. In a future, it should be changed to another thread and call it without any target frame restriction. Basic physics example has been redone (not finished) using the new module functions. Forces examples will be redone so I removed it from branch. --- src/physac.c | 532 ++++++++++++++++++++++++++++++----------------------------- src/physac.h | 58 +++---- src/raylib.h | 49 +++--- 3 files changed, 325 insertions(+), 314 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index 4c50dd41..13247117 100644 --- a/src/physac.c +++ b/src/physac.c @@ -1,6 +1,6 @@ /********************************************************************************************** * -* [physac] raylib physics engine module - Basic functions to apply physics to 2D objects +* [physac] raylib physics module - Basic functions to apply physics to 2D objects * * Copyright (c) 2015 Victor Fisac and Ramon Santamaria * @@ -29,329 +29,343 @@ #include "raylib.h" #endif -#include -#include // Required for: malloc(), free() +#include // Declares malloc() and free() for memory management +#include // abs() and fminf() //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define DECIMAL_FIX 0.26f // Decimal margin for collision checks (avoid rigidbodies shake) +#define MAX_PHYSIC_OBJECTS 256 +#define PHYSICS_GRAVITY -9.81f/2 +#define PHYSICS_STEPS 450 +#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) +#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix //---------------------------------------------------------------------------------- // Types and Structures Definition +// NOTE: Below types are required for PHYSAC_STANDALONE usage //---------------------------------------------------------------------------------- // ... //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Collider *colliders; // Colliders array, dynamically allocated at runtime -static Rigidbody *rigidbodies; // Rigitbody array, dynamically allocated at runtime -static bool collisionChecker; - -static int maxElements; // Max physic elements to compute -static bool enabled; // Physics enabled? (true by default) -static Vector2 gravity; // Gravity value used for physic calculations +static PhysicObject *physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool +static int physicObjectsCount; // Counts current enabled physic objects //---------------------------------------------------------------------------------- -// Module specific Functions Declarations +// Module specific Functions Declaration //---------------------------------------------------------------------------------- -static float Vector2Length(Vector2 vector); -static float Vector2Distance(Vector2 a, Vector2 b); -static void Vector2Normalize(Vector2 *vector); +static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 //---------------------------------------------------------------------------------- -// Module Functions Definitions +// Module Functions Definition //---------------------------------------------------------------------------------- -void InitPhysics(int maxPhysicElements) -{ - maxElements = maxPhysicElements; - - colliders = (Collider *)malloc(maxElements*sizeof(Collider)); - rigidbodies = (Rigidbody *)malloc(maxElements*sizeof(Rigidbody)); - - for (int i = 0; i < maxElements; i++) - { - colliders[i].enabled = false; - colliders[i].bounds = (Rectangle){ 0, 0, 0, 0 }; - colliders[i].radius = 0; - - rigidbodies[i].enabled = false; - rigidbodies[i].mass = 0.0f; - rigidbodies[i].velocity = (Vector2){ 0.0f, 0.0f }; - rigidbodies[i].acceleration = (Vector2){ 0.0f, 0.0f }; - rigidbodies[i].isGrounded = false; - rigidbodies[i].isContact = false; - rigidbodies[i].friction = 0.0f; - } - - collisionChecker = false; - enabled = true; - - // NOTE: To get better results, gravity needs to be 1:10 from original parameter - gravity = (Vector2){ 0.0f, -9.81f/10.0f }; // By default, standard gravity -} - -void UnloadPhysics() -{ - free(colliders); - free(rigidbodies); -} - -void AddCollider(int index, Collider collider) -{ - colliders[index] = collider; -} -void AddRigidbody(int index, Rigidbody rigidbody) +// Initializes pointers array (just pointers, fixed size) +void InitPhysics() { - rigidbodies[index] = rigidbody; + // Initialize physics variables + physicObjectsCount = 0; } -void ApplyPhysics(int index, Vector2 *position) +// Update physic objects, calculating physic behaviours and collisions detection +void UpdatePhysics() { - if (rigidbodies[index].enabled) + // Reset all physic objects is grounded state + for(int i = 0; i < physicObjectsCount; i++) { - // Apply friction to acceleration - if (rigidbodies[index].acceleration.x > DECIMAL_FIX) - { - rigidbodies[index].acceleration.x -= rigidbodies[index].friction; - } - else if (rigidbodies[index].acceleration.x < -DECIMAL_FIX) - { - rigidbodies[index].acceleration.x += rigidbodies[index].friction; - } - else - { - rigidbodies[index].acceleration.x = 0; - } - - if (rigidbodies[index].acceleration.y > DECIMAL_FIX / 2) - { - rigidbodies[index].acceleration.y -= rigidbodies[index].friction; - } - else if (rigidbodies[index].acceleration.y < -DECIMAL_FIX / 2) - { - rigidbodies[index].acceleration.y += rigidbodies[index].friction; - } - else - { - rigidbodies[index].acceleration.y = 0; - } - - // Apply friction to velocity - if (rigidbodies[index].isGrounded) - { - if (rigidbodies[index].velocity.x > DECIMAL_FIX) - { - rigidbodies[index].velocity.x -= rigidbodies[index].friction; - } - else if (rigidbodies[index].velocity.x < -DECIMAL_FIX) - { - rigidbodies[index].velocity.x += rigidbodies[index].friction; - } - else - { - rigidbodies[index].velocity.x = 0; - } - } - - if (rigidbodies[index].velocity.y > DECIMAL_FIX / 2) - { - rigidbodies[index].velocity.y -= rigidbodies[index].friction; - } - else if (rigidbodies[index].velocity.y < -DECIMAL_FIX / 2) - { - rigidbodies[index].velocity.y += rigidbodies[index].friction; - } - else - { - rigidbodies[index].velocity.y = 0; - } - - // Apply gravity - rigidbodies[index].velocity.y += gravity.y; - rigidbodies[index].velocity.x += gravity.x; - - // Apply acceleration - rigidbodies[index].velocity.y += rigidbodies[index].acceleration.y; - rigidbodies[index].velocity.x += rigidbodies[index].acceleration.x; - - // Update position vector - position->x += rigidbodies[index].velocity.x; - position->y -= rigidbodies[index].velocity.y; - - // Update collider bounds - colliders[index].bounds.x = position->x; - colliders[index].bounds.y = position->y; - - // Check collision with other colliders - collisionChecker = false; - rigidbodies[index].isContact = false; - for (int j = 0; j < maxElements; j++) + if(physicObjects[i]->rigidbody.enabled) physicObjects[i]->rigidbody.isGrounded = false; + } + + for(int steps = 0; steps < PHYSICS_STEPS; steps++) + { + for(int i = 0; i < physicObjectsCount; i++) { - if (index != j) + if(physicObjects[i]->enabled) { - if (colliders[index].enabled && colliders[j].enabled) + // Update physic behaviour + if(physicObjects[i]->rigidbody.enabled) { - if (colliders[index].type == COLLIDER_RECTANGLE) + // Apply friction to acceleration in X axis + if (physicObjects[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicObjects[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else physicObjects[i]->rigidbody.acceleration.x = 0.0f; + + // Apply friction to velocity in X axis + if (physicObjects[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicObjects[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else physicObjects[i]->rigidbody.velocity.x = 0.0f; + + // Apply gravity to velocity + if (physicObjects[i]->rigidbody.applyGravity) physicObjects[i]->rigidbody.velocity.y += PHYSICS_GRAVITY/PHYSICS_STEPS; + + // Apply acceleration to velocity + physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.acceleration.x/PHYSICS_STEPS; + physicObjects[i]->rigidbody.velocity.y += physicObjects[i]->rigidbody.acceleration.y/PHYSICS_STEPS; + + // Apply velocity to position + physicObjects[i]->transform.position.x += physicObjects[i]->rigidbody.velocity.x/PHYSICS_STEPS; + physicObjects[i]->transform.position.y -= physicObjects[i]->rigidbody.velocity.y/PHYSICS_STEPS; + } + + // Update collision detection + if (physicObjects[i]->collider.enabled) + { + // Update collider bounds + physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); + + // Check collision with other colliders + for (int k = 0; k < physicObjectsCount; k++) { - if (colliders[j].type == COLLIDER_RECTANGLE) + if (physicObjects[k]->collider.enabled && i != k) { - if (CheckCollisionRecs(colliders[index].bounds, colliders[j].bounds)) + // Check if colliders are overlapped + if (CheckCollisionRecs(physicObjects[i]->collider.bounds, physicObjects[k]->collider.bounds)) { - collisionChecker = true; + // Resolve physic collision + // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) + // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) + + // 1. Calculate collision normal + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Define collision ontact normal + Vector2 contactNormal = { 0.0f, 0.0f }; + + // Calculate direction vector from i to k + Vector2 direction; + direction.x = (physicObjects[k]->transform.position.x + physicObjects[k]->transform.scale.x/2) - (physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2); + direction.y = (physicObjects[k]->transform.position.y + physicObjects[k]->transform.scale.y/2) - (physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2); + + // Define overlapping and penetration attributes + Vector2 overlap; + float penetrationDepth = 0.0f; - if ((colliders[index].bounds.y + colliders[index].bounds.height <= colliders[j].bounds.y) == false) + // Calculate overlap on X axis + overlap.x = (physicObjects[i]->transform.scale.x + physicObjects[k]->transform.scale.x)/2 - abs(direction.x); + + // SAT test on X axis + if (overlap.x > 0.0f) { - rigidbodies[index].isContact = true; + // Calculate overlap on Y axis + overlap.y = (physicObjects[i]->transform.scale.y + physicObjects[k]->transform.scale.y)/2 - abs(direction.y); + + // SAT test on Y axis + if (overlap.y > 0.0f) + { + // Find out which axis is axis of least penetration + if (overlap.y > overlap.x) + { + // Point towards k knowing that direction points from i to k + if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; + else contactNormal = (Vector2){ 1.0f, 0.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.x; + } + else + { + // Point towards k knowing that direction points from i to k + if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; + else contactNormal = (Vector2){ 0.0f, -1.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.y; + } + } + } + + // Update rigidbody grounded state + if (physicObjects[i]->rigidbody.enabled) + { + if (contactNormal.y < 0.0f) physicObjects[i]->rigidbody.isGrounded = true; + } + + // 2. Calculate collision impulse + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Calculate relative velocity + Vector2 relVelocity = { physicObjects[k]->rigidbody.velocity.x - physicObjects[i]->rigidbody.velocity.x, physicObjects[k]->rigidbody.velocity.y - physicObjects[i]->rigidbody.velocity.y }; + + // Calculate relative velocity in terms of the normal direction + float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); + + // Dot not resolve if velocities are separating + if (velAlongNormal <= 0.0f) + { + // Calculate minimum bounciness value from both objects + float e = fminf(physicObjects[i]->rigidbody.bounciness, physicObjects[k]->rigidbody.bounciness); + + // Calculate impulse scalar value + float j = -(1.0f + e) * velAlongNormal; + j /= 1.0f/physicObjects[i]->rigidbody.mass + 1.0f/physicObjects[k]->rigidbody.mass; + + // Calculate final impulse vector + Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; + + // Calculate collision mass ration + float massSum = physicObjects[i]->rigidbody.mass + physicObjects[k]->rigidbody.mass; + float ratio = 0.0f; + + // Apply impulse to current rigidbodies velocities if they are enabled + if (physicObjects[i]->rigidbody.enabled) + { + // Calculate inverted mass ration + ratio = physicObjects[i]->rigidbody.mass/massSum; + + // Apply impulse direction to velocity + physicObjects[i]->rigidbody.velocity.x -= impulse.x*ratio; + physicObjects[i]->rigidbody.velocity.y -= impulse.y*ratio; + } + + if (physicObjects[k]->rigidbody.enabled) + { + // Calculate inverted mass ration + ratio = physicObjects[k]->rigidbody.mass/massSum; + + // Apply impulse direction to velocity + physicObjects[k]->rigidbody.velocity.x += impulse.x*ratio; + physicObjects[k]->rigidbody.velocity.y += impulse.y*ratio; + } + + // 3. Correct colliders overlaping (transform position) + // --------------------------------------------------------------------------------------------------------------------------------- + + // Calculate transform position penetration correction + Vector2 posCorrection; + posCorrection.x = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; + posCorrection.y = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; + + // Fix transform positions + if (physicObjects[i]->rigidbody.enabled) + { + // Fix physic objects transform position + physicObjects[i]->transform.position.x -= 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.x; + physicObjects[i]->transform.position.y += 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.y; + + // Update collider bounds + physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); + + if (physicObjects[k]->rigidbody.enabled) + { + // Fix physic objects transform position + physicObjects[k]->transform.position.x += 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.x; + physicObjects[k]->transform.position.y -= 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.y; + + // Update collider bounds + physicObjects[k]->collider.bounds = TransformToRectangle(physicObjects[k]->transform); + } + } } - } - } - else - { - if (CheckCollisionCircleRec((Vector2){colliders[j].bounds.x, colliders[j].bounds.y}, colliders[j].radius, colliders[index].bounds)) - { - collisionChecker = true; - } - } - } - else - { - if (colliders[j].type == COLLIDER_RECTANGLE) - { - if (CheckCollisionCircleRec((Vector2){colliders[index].bounds.x, colliders[index].bounds.y}, colliders[index].radius, colliders[j].bounds)) - { - collisionChecker = true; - } - } - else - { - if (CheckCollisionCircles((Vector2){colliders[j].bounds.x, colliders[j].bounds.y}, colliders[j].radius, (Vector2){colliders[index].bounds.x, colliders[index].bounds.y}, colliders[index].radius)) - { - collisionChecker = true; } } } } } } - - // Update grounded rigidbody state - rigidbodies[index].isGrounded = collisionChecker; - - // Set grounded state if needed (fix overlap and set y velocity) - if (collisionChecker && rigidbodies[index].velocity.y != 0) - { - position->y += rigidbodies[index].velocity.y; - rigidbodies[index].velocity.y = -rigidbodies[index].velocity.y * rigidbodies[index].bounciness; - } - - if (rigidbodies[index].isContact) - { - position->x -= rigidbodies[index].velocity.x; - rigidbodies[index].velocity.x = rigidbodies[index].velocity.x; - } } } -void SetRigidbodyEnabled(int index, bool state) -{ - rigidbodies[index].enabled = state; -} - -void SetRigidbodyVelocity(int index, Vector2 velocity) -{ - rigidbodies[index].velocity.x = velocity.x; - rigidbodies[index].velocity.y = velocity.y; -} - -void SetRigidbodyAcceleration(int index, Vector2 acceleration) +// Unitialize all physic objects and empty the objects pool +void ClosePhysics() { - rigidbodies[index].acceleration.x = acceleration.x; - rigidbodies[index].acceleration.y = acceleration.y; + // Free all dynamic memory allocations + for (int i = 0; i < physicObjectsCount; i++) free(physicObjects[i]); + + // Reset enabled physic objects count + physicObjectsCount = 0; } -void AddRigidbodyForce(int index, Vector2 force) +// Create a new physic object dinamically, initialize it and add to pool +PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale) { - rigidbodies[index].acceleration.x = force.x / rigidbodies[index].mass; - rigidbodies[index].acceleration.y = force.y / rigidbodies[index].mass; + // Allocate dynamic memory + PhysicObject *obj = (PhysicObject *)malloc(sizeof(PhysicObject)); + + // Initialize physic object values with generic values + obj->id = physicObjectsCount; + obj->enabled = true; + + obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; + + obj->rigidbody.enabled = false; + obj->rigidbody.mass = 1.0f; + obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.applyGravity = false; + obj->rigidbody.isGrounded = false; + obj->rigidbody.friction = 0.0f; + obj->rigidbody.bounciness = 0.0f; + + obj->collider.enabled = false; + obj->collider.type = COLLIDER_RECTANGLE; + obj->collider.bounds = TransformToRectangle(obj->transform); + obj->collider.radius = 0.0f; + + // Add new physic object to the pointers array + physicObjects[physicObjectsCount] = obj; + + // Increase enabled physic objects count + physicObjectsCount++; + + return obj; } -void AddForceAtPosition(Vector2 position, float intensity, float radius) +// Destroy a specific physic object and take it out of the list +void DestroyPhysicObject(PhysicObject *pObj) { - for(int i = 0; i < maxElements; i++) + // Free dynamic memory allocation + free(physicObjects[pObj->id]); + + // Remove *obj from the pointers array + for (int i = pObj->id; i < physicObjectsCount; i++) { - if(rigidbodies[i].enabled) + // Resort all the following pointers of the array + if ((i + 1) < physicObjectsCount) { - // Get position from its collider - Vector2 pos = {colliders[i].bounds.x, colliders[i].bounds.y}; - - // Get distance between rigidbody position and target position - float distance = Vector2Distance(position, pos); - - if(distance <= radius) - { - // Calculate force based on direction - Vector2 force = {colliders[i].bounds.x - position.x, colliders[i].bounds.y - position.y}; - - // Normalize the direction vector - Vector2Normalize(&force); - - // Invert y value - force.y *= -1; - - // Apply intensity and distance - force = (Vector2){force.x * intensity / distance, force.y * intensity / distance}; - - // Add calculated force to the rigidbodies - AddRigidbodyForce(i, force); - } + physicObjects[i] = physicObjects[i + 1]; + physicObjects[i]->id = physicObjects[i + 1]->id; } + else free(physicObjects[i]); } + + // Decrease enabled physic objects count + physicObjectsCount--; } -void SetColliderEnabled(int index, bool state) -{ - colliders[index].enabled = state; -} - -Collider GetCollider(int index) +// Convert Transform data type to Rectangle (position and scale) +Rectangle TransformToRectangle(Transform transform) { - return colliders[index]; + return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; } -Rigidbody GetRigidbody(int index) +// Draw physic object information at screen position +void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize) { - return rigidbodies[index]; + // Draw physic object ID + DrawText(FormatText("PhysicObject ID: %i - Enabled: %i", pObj->id, pObj->enabled), position.x, position.y, fontSize, BLACK); + + // Draw physic object transform values + DrawText(FormatText("\nTRANSFORM\nPosition: %f, %f\nRotation: %f\nScale: %f, %f", pObj->transform.position.x, pObj->transform.position.y, pObj->transform.rotation, pObj->transform.scale.x, pObj->transform.scale.y), position.x, position.y, fontSize, BLACK); + + // Draw physic object rigidbody values + DrawText(FormatText("\n\n\n\n\n\nRIGIDBODY\nEnabled: %i\nMass: %f\nAcceleration: %f, %f\nVelocity: %f, %f\nApplyGravity: %i\nIsGrounded: %i\nFriction: %f\nBounciness: %f", pObj->rigidbody.enabled, pObj->rigidbody.mass, pObj->rigidbody.acceleration.x, pObj->rigidbody.acceleration.y, + pObj->rigidbody.velocity.x, pObj->rigidbody.velocity.y, pObj->rigidbody.applyGravity, pObj->rigidbody.isGrounded, pObj->rigidbody.friction, pObj->rigidbody.bounciness), position.x, position.y, fontSize, BLACK); + + DrawText(FormatText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCOLLIDER\nEnabled: %i\nBounds: %i, %i, %i, %i\nRadius: %i", pObj->collider.enabled, pObj->collider.bounds.x, pObj->collider.bounds.y, pObj->collider.bounds.width, pObj->collider.bounds.height, pObj->collider.radius), position.x, position.y, fontSize, BLACK); } //---------------------------------------------------------------------------------- -// Module specific Functions Definitions +// Module specific Functions Definition //---------------------------------------------------------------------------------- -static float Vector2Length(Vector2 vector) -{ - return sqrt((vector.x * vector.x) + (vector.y * vector.y)); -} -static float Vector2Distance(Vector2 a, Vector2 b) +// Returns the dot product of two Vector2 +static float Vector2DotProduct(Vector2 v1, Vector2 v2) { - Vector2 vector = {b.x - a.x, b.y - a.y}; - return sqrt((vector.x * vector.x) + (vector.y * vector.y)); -} + float result; -static void Vector2Normalize(Vector2 *vector) -{ - float length = Vector2Length(*vector); - - if (length != 0.0f) - { - vector->x /= length; - vector->y /= length; - } - else - { - vector->x = 0.0f; - vector->y = 0.0f; - } + result = v1.x*v2.x + v1.y*v2.y; + + return result; } diff --git a/src/physac.h b/src/physac.h index 9e1b0b88..b948e4ce 100644 --- a/src/physac.h +++ b/src/physac.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* [physac] raylib physics engine module - Basic functions to apply physics to 2D objects +* [physac] raylib physics module - Basic functions to apply physics to 2D objects * * Copyright (c) 2015 Victor Fisac and Ramon Santamaria * @@ -31,62 +31,64 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition +// NOTE: Below types are required for PHYSAC_STANDALONE usage //---------------------------------------------------------------------------------- -// Collider types + +// Vector2 type +typedef struct Vector2 { + float x; + float y; +} Vector2; + typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType; -// Transform struct typedef struct Transform { Vector2 position; float rotation; Vector2 scale; } Transform; -// Rigidbody struct typedef struct Rigidbody { - bool enabled; + bool enabled; // Acts as kinematic state (collisions are calculated anyway) float mass; Vector2 acceleration; Vector2 velocity; - bool isGrounded; - bool isContact; // Avoid freeze player when touching floor bool applyGravity; - float friction; // 0.0f to 1.0f - float bounciness; // 0.0f to 1.0f + bool isGrounded; + float friction; // Normalized value + float bounciness; // Normalized value } Rigidbody; -// Collider struct typedef struct Collider { bool enabled; ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE - int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE + Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE + int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE } Collider; +typedef struct PhysicObject { + unsigned int id; + Transform transform; + Rigidbody rigidbody; + Collider collider; + bool enabled; +} PhysicObject; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif //---------------------------------------------------------------------------------- -// Module Functions Declarations +// Module Functions Declaration //---------------------------------------------------------------------------------- -void InitPhysics(int maxPhysicElements); // Initialize all internal physics values -void UnloadPhysics(); // Unload physic elements arrays - -void AddRigidbody(int index, Rigidbody rigidbody); // Initialize a new rigidbody with parameters to internal index slot -void AddCollider(int index, Collider collider); // Initialize a new Collider with parameters to internal index slot - -void ApplyPhysics(int index, Vector2 *position); // Apply physics to internal rigidbody, physics calculations are applied to position pointer parameter -void SetRigidbodyEnabled(int index, bool state); // Set enabled state to a defined rigidbody -void SetRigidbodyVelocity(int index, Vector2 velocity); // Set velocity of rigidbody (without considering of mass value) -void SetRigidbodyAcceleration(int index, Vector2 acceleration); // Set acceleration of rigidbody (without considering of mass value) -void AddRigidbodyForce(int index, Vector2 force); // Set rigidbody force (considering mass value) -void AddForceAtPosition(Vector2 position, float intensity, float radius); // Add a force to all enabled rigidbodies at a position +void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection +void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -void SetColliderEnabled(int index, bool state); // Set enabled state to a defined collider +PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool +void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list -Rigidbody GetRigidbody(int index); // Returns the internal rigidbody data defined by index parameter -Collider GetCollider(int index); // Returns the internal collider data defined by index parameter +Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) +void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index c598ec30..b9cf05a4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -465,37 +465,40 @@ typedef struct { // Camera system modes typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; -// Collider types typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType; -// Transform struct typedef struct Transform { Vector2 position; float rotation; Vector2 scale; } Transform; -// Rigidbody struct typedef struct Rigidbody { - bool enabled; + bool enabled; // Acts as kinematic state (collisions are calculated anyway) float mass; Vector2 acceleration; Vector2 velocity; - bool isGrounded; - bool isContact; // Avoid freeze player when touching floor bool applyGravity; - float friction; // 0.0f to 1.0f - float bounciness; // 0.0f to 1.0f + bool isGrounded; + float friction; // Normalized value + float bounciness; // Normalized value } Rigidbody; -// Collider struct typedef struct Collider { bool enabled; ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE - int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE + Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE + int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE } Collider; +typedef struct PhysicObject { + unsigned int id; + Transform transform; + Rigidbody rigidbody; + Collider collider; + bool enabled; +} PhysicObject; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -800,25 +803,17 @@ void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textur void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) //---------------------------------------------------------------------------------- -// Physics System Functions (engine-module: physac) +// Physics System Functions (Module: physac) //---------------------------------------------------------------------------------- -void InitPhysics(int maxPhysicElements); // Initialize all internal physics values -void UnloadPhysics(); // Unload physic elements arrays - -void AddRigidbody(int index, Rigidbody rigidbody); // Initialize a new rigidbody with parameters to internal index slot -void AddCollider(int index, Collider collider); // Initialize a new Collider with parameters to internal index slot - -void ApplyPhysics(int index, Vector2 *position); // Apply physics to internal rigidbody, physics calculations are applied to position pointer parameter -void SetRigidbodyEnabled(int index, bool state); // Set enabled state to a defined rigidbody -void SetRigidbodyVelocity(int index, Vector2 velocity); // Set velocity of rigidbody (without considering of mass value) -void SetRigidbodyAcceleration(int index, Vector2 acceleration); // Set acceleration of rigidbody (without considering of mass value) -void AddRigidbodyForce(int index, Vector2 force); // Set rigidbody force (considering mass value) -void AddForceAtPosition(Vector2 position, float intensity, float radius); // Add a force to all enabled rigidbodies at a position +void InitPhysics(); // Initializes pointers array (just pointers, fixed size) +void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection +void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -void SetColliderEnabled(int index, bool state); // Set enabled state to a defined collider +PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool +void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list -Rigidbody GetRigidbody(int index); // Returns the internal rigidbody data defined by index parameter -Collider GetCollider(int index); // Returns the internal collider data defined by index parameter +Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) +void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) -- cgit v1.2.3 From 78e4772f21cda45c219ce88a713708b6b0680e8f Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 5 Mar 2016 19:36:40 +0100 Subject: Fixed physac header little mistake --- src/physac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index b948e4ce..fc5502c4 100644 --- a/src/physac.h +++ b/src/physac.h @@ -81,6 +81,7 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- +void InitPhysics(); // Initializes pointers array (just pointers, fixed size) void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -- cgit v1.2.3 From c9d22c7a14a84b24a94f876c9e438c621b4bf420 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 6 Mar 2016 02:05:16 +0100 Subject: Redesign to use Material type -IN PROGRESS- Requires Shader access functions review --- src/models.c | 18 +---- src/raylib.h | 40 ++++------ src/rlgl.c | 240 +++++++++++++---------------------------------------------- src/rlgl.h | 24 ++++-- 4 files changed, 89 insertions(+), 233 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index ee5e57c7..a1590424 100644 --- a/src/models.c +++ b/src/models.c @@ -551,10 +551,7 @@ Model LoadModel(const char *fileName) // NOTE: At this point we have all vertex, texcoord, normal data for the model in mesh struct - if (mesh.vertexCount == 0) - { - TraceLog(WARNING, "Model could not be loaded"); - } + if (mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); else { // NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel() @@ -627,17 +624,8 @@ void UnloadModel(Model model) // Link a texture to a model void SetModelTexture(Model *model, Texture2D texture) { - if (texture.id <= 0) - { - // Use default white texture (use mesh color) - model->texture.id = whiteTexture; // OpenGL 1.1 - model->shader.texDiffuseId = whiteTexture; // OpenGL 3.3 / ES 2.0 - } - else - { - model->texture = texture; - model->shader.texDiffuseId = texture.id; - } + if (texture.id <= 0) model->material.texDiffuse.id = whiteTexture; // Use default white texture + else model->material.texDiffuse = texture; } static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) diff --git a/src/raylib.h b/src/raylib.h index 83e41ac7..f448487e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -347,12 +347,7 @@ typedef struct Mesh { // Shader type (generic shader) typedef struct Shader { - unsigned int id; // Shader program id - - // TODO: This should be Texture2D objects - unsigned int texDiffuseId; // Diffuse texture id - unsigned int texNormalId; // Normal texture id - unsigned int texSpecularId; // Specular texture id + unsigned int id; // Shader program id // Variable attributes int vertexLoc; // Vertex attribute location point (vertex shader) @@ -370,20 +365,19 @@ typedef struct Shader { } Shader; // Material type -// TODO: Redesign material-shaders-textures system typedef struct Material { - //Shader shader; + Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) - //Texture2D texDiffuse; // Diffuse texture - //Texture2D texNormal; // Normal texture - //Texture2D texSpecular; // Specular texture + Texture2D texDiffuse; // Diffuse texture + Texture2D texNormal; // Normal texture + Texture2D texSpecular; // Specular texture - Color colDiffuse; - Color colAmbient; - Color colSpecular; + Color colDiffuse; // Diffuse color + Color colAmbient; // Ambient color + Color colSpecular; // Specular color - float glossiness; - float normalDepth; + float glossiness; // Glossiness level + float normalDepth; // Normal map depth } Material; // 3d Model type @@ -391,9 +385,7 @@ typedef struct Material { typedef struct Model { Mesh mesh; Matrix transform; - Texture2D texture; // Only for OpenGL 1.1, on newer versions this should be in the shader - Shader shader; - //Material material; + Material material; } Model; // Ray type (useful for raycast) @@ -774,7 +766,7 @@ void SetModelTexture(Model *model, Texture2D texture); void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set) -void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture @@ -806,10 +798,10 @@ int GetShaderLocation(Shader shader, const char *uniformName); void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -void SetShaderMapDiffuse(Shader *shader, Texture2D texture); // Default diffuse shader map texture assignment -void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture); // Normal map texture shader assignment -void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture); // Specular map texture shader assignment -void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textureUnit); // TODO: Generic shader map assignment +//void SetShaderMapDiffuse(Shader *shader, Texture2D texture); // Default diffuse shader map texture assignment +//void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture); // Normal map texture shader assignment +//void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture); // Specular map texture shader assignment +//void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textureUnit); // TODO: Generic shader map assignment void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) diff --git a/src/rlgl.c b/src/rlgl.c index e1949274..d9761732 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1421,7 +1421,7 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro #if defined(GRAPHICS_API_OPENGL_11) glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, model.texture.id); + glBindTexture(GL_TEXTURE_2D, model.material.texDiffuse.id); // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array @@ -1452,7 +1452,7 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(model.shader.id); + glUseProgram(model.material.shader.id); // At this point the modelview matrix just contains the view matrix (camera) // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() @@ -1476,28 +1476,30 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates // Send combined model-view-projection matrix to shader - glUniformMatrix4fv(model.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + glUniformMatrix4fv(model.material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); // Apply color tinting to model // NOTE: Just update one uniform on fragment shader float vColor[4] = { (float)color.r/255, (float)color.g/255, (float)color.b/255, (float)color.a/255 }; - glUniform4fv(model.shader.tintColorLoc, 1, vColor); + glUniform4fv(model.material.shader.tintColorLoc, 1, vColor); // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, model.shader.texDiffuseId); - glUniform1i(model.shader.mapDiffuseLoc, 0); - - if (model.shader.texNormalId != 0) + glBindTexture(GL_TEXTURE_2D, model.material.texDiffuse.id); + glUniform1i(model.material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 + + if (model.material.texNormal.id != 0) { glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, model.shader.texNormalId); + glBindTexture(GL_TEXTURE_2D, model.material.texNormal.id); + glUniform1i(model.material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 } - if (model.shader.texSpecularId != 0) + if (model.material.texSpecular.id != 0) { glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, model.shader.texSpecularId); + glBindTexture(GL_TEXTURE_2D, model.material.texSpecular.id); + glUniform1i(model.material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 } if (vaoSupported) @@ -1508,19 +1510,19 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro { // Bind model VBOs data glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[0]); - glVertexAttribPointer(model.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.vertexLoc); + glVertexAttribPointer(model.material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.vertexLoc); glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[1]); - glVertexAttribPointer(model.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.texcoordLoc); + glVertexAttribPointer(model.material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.texcoordLoc); // Add normals support - if (model.shader.normalLoc != -1) + if (model.material.shader.normalLoc != -1) { glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[2]); - glVertexAttribPointer(model.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.normalLoc); + glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.normalLoc); } } @@ -1531,13 +1533,13 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro //glDisableVertexAttribArray(model.shader.texcoordLoc); //if (model.shader.normalLoc != -1) glDisableVertexAttribArray(model.shader.normalLoc); - if (model.shader.texNormalId != 0) + if (model.material.texNormal.id != 0) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, 0); } - if (model.shader.texSpecularId != 0) + if (model.material.texSpecular.id != 0) { glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, 0); @@ -1907,22 +1909,29 @@ Model rlglLoadModel(Mesh mesh) Model model; model.mesh = mesh; - model.transform = MatrixIdentity(); model.mesh.vaoId = 0; // Vertex Array Object - model.mesh.vboId[0] = 0; // Vertex position VBO - model.mesh.vboId[1] = 0; // Texcoords VBO - model.mesh.vboId[2] = 0; // Normals VBO + model.mesh.vboId[0] = 0; // Vertex positions VBO + model.mesh.vboId[1] = 0; // Vertex texcoords VBO + model.mesh.vboId[2] = 0; // Vertex normals VBO + + model.transform = MatrixIdentity(); #if defined(GRAPHICS_API_OPENGL_11) - model.texture.id = 0; // No texture required - model.shader.id = 0; // No shader used + model.material.texDiffuse.id = 0; // No texture required + model.material.shader.id = 0; // No shader used #elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - model.texture.id = whiteTexture; // Default whiteTexture - model.texture.width = 1; // Default whiteTexture width - model.texture.height = 1; // Default whiteTexture height - model.texture.format = UNCOMPRESSED_R8G8B8A8; // Default whiteTexture format - model.shader = simpleShader; // Default model shader + model.material.shader = simpleShader; // Default model shader + + model.material.texDiffuse.id = whiteTexture; // Default whiteTexture + model.material.texDiffuse.width = 1; // Default whiteTexture width + model.material.texDiffuse.height = 1; // Default whiteTexture height + model.material.texDiffuse.format = UNCOMPRESSED_R8G8B8A8; // Default whiteTexture format + + model.material.texNormal.id = 0; // By default, no normal texture + model.material.texSpecular.id = 0; // By default, no specular texture + + // TODO: Fill default material properties (color, glossiness...) GLuint vaoModel = 0; // Vertex Array Objects (VAO) GLuint vertexBuffer[3]; // Vertex Buffer Objects (VBO) @@ -1940,20 +1949,20 @@ Model rlglLoadModel(Mesh mesh) // Enable vertex attributes: position glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh.vertexCount, mesh.vertices, GL_STATIC_DRAW); - glVertexAttribPointer(model.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.vertexLoc); + glVertexAttribPointer(model.material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.vertexLoc); // Enable vertex attributes: texcoords glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh.vertexCount, mesh.texcoords, GL_STATIC_DRAW); - glVertexAttribPointer(model.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.texcoordLoc); + glVertexAttribPointer(model.material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.texcoordLoc); // Enable vertex attributes: normals glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[2]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh.vertexCount, mesh.normals, GL_STATIC_DRAW); - glVertexAttribPointer(model.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.shader.normalLoc); + glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(model.material.shader.normalLoc); model.mesh.vboId[0] = vertexBuffer[0]; // Vertex position VBO model.mesh.vboId[1] = vertexBuffer[1]; // Texcoords VBO @@ -2153,11 +2162,6 @@ Shader LoadShader(char *vsFileName, char *fsFileName) if (shader.id != 0) { TraceLog(INFO, "[SHDR ID %i] Custom shader loaded successfully", shader.id); - - // Set shader textures ids (all 0 by default) - shader.texDiffuseId = 0; - shader.texNormalId = 0; - shader.texSpecularId = 0; // Get handles to GLSL input attibute locations //------------------------------------------------------------------- @@ -2314,28 +2318,7 @@ void SetCustomShader(Shader shader) if (currentShader.id != shader.id) { rlglDraw(); - currentShader = shader; -/* - if (vaoSupported) glBindVertexArray(vaoQuads); - - // Enable vertex attributes: position - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); - glEnableVertexAttribArray(currentShader.vertexLoc); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - - // Enable vertex attributes: texcoords - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); - glEnableVertexAttribArray(currentShader.texcoordLoc); - glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - - // Enable vertex attributes: colors - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); - glEnableVertexAttribArray(currentShader.colorLoc); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - - if (vaoSupported) glBindVertexArray(0); // Unbind VAO -*/ } #endif } @@ -2358,7 +2341,7 @@ void SetPostproShader(Shader shader) texture.width = screenWidth; texture.height = screenHeight; - SetShaderMapDiffuse(&postproQuad.shader, texture); + postproQuad.material.texDiffuse = texture; //TraceLog(DEBUG, "Postproquad texture id: %i", postproQuad.texture.id); //TraceLog(DEBUG, "Postproquad shader diffuse map id: %i", postproQuad.shader.texDiffuseId); @@ -2386,7 +2369,7 @@ void SetDefaultShader(void) void SetModelShader(Model *model, Shader shader) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - model->shader = shader; + model->material.shader = shader; if (vaoSupported) glBindVertexArray(model->mesh.vaoId); @@ -2406,9 +2389,7 @@ void SetModelShader(Model *model, Shader shader) glVertexAttribPointer(shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); if (vaoSupported) glBindVertexArray(0); // Unbind VAO - - // NOTE: If SetModelTexture() is called previously, texture is not assigned to new shader - if (model->texture.id > 0) model->shader.texDiffuseId = model->texture.id; + #elif (GRAPHICS_API_OPENGL_11) TraceLog(WARNING, "Shaders not supported on OpenGL 1.1"); #endif @@ -2480,104 +2461,6 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) #endif } -// Default diffuse shader map texture assignment -void SetShaderMapDiffuse(Shader *shader, Texture2D texture) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - shader->texDiffuseId = texture.id; - - glUseProgram(shader->id); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, shader->texDiffuseId); - - glUniform1i(shader->mapDiffuseLoc, 0); // Texture fits in active texture unit 0 - - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTexture(GL_TEXTURE0); - glUseProgram(0); -#endif -} - -// Normal map texture shader assignment -void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - shader->mapNormalLoc = glGetUniformLocation(shader->id, uniformName); - - if (shader->mapNormalLoc == -1) TraceLog(WARNING, "[SHDR ID %i] Shader location for %s could not be found", shader->id, uniformName); - else - { - shader->texNormalId = texture.id; - - glUseProgram(shader->id); - - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, shader->texNormalId); - - glUniform1i(shader->mapNormalLoc, 1); // Texture fits in active texture unit 1 - - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTexture(GL_TEXTURE0); - glUseProgram(0); - } -#endif -} - -// Specular map texture shader assignment -void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - shader->mapSpecularLoc = glGetUniformLocation(shader->id, uniformName); - - if (shader->mapSpecularLoc == -1) TraceLog(WARNING, "[SHDR ID %i] Shader location for %s could not be found", shader->id, uniformName); - else - { - shader->texSpecularId = texture.id; - - glUseProgram(shader->id); - - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, shader->texSpecularId); - - glUniform1i(shader->mapSpecularLoc, 2); // Texture fits in active texture unit 2 - - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTexture(GL_TEXTURE0); - glUseProgram(0); - } -#endif -} - -// Generic shader maps assignment -// TODO: Trying to find a generic shader to allow any kind of map -// NOTE: mapLocation should be retrieved by user with GetShaderLocation() -// ISSUE: mapTextureId: Shader should contain a reference to map texture and corresponding textureUnit, -// so it can be automatically checked and used in rlglDrawModel() -void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textureUnit) -{ -/* -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (mapLocation == -1) TraceLog(WARNING, "[SHDR ID %i] Map location could not be found", shader->id); - else - { - shader->mapTextureId = texture.id; - - glUseProgram(shader->id); - - glActiveTexture(GL_TEXTURE0 + textureUnit); - glBindTexture(GL_TEXTURE_2D, shader->mapTextureId); - - glUniform1i(mapLocation, textureUnit); // Texture fits in active textureUnit - - glBindTexture(GL_TEXTURE_2D, 0); - glActiveTexture(GL_TEXTURE0); - glUseProgram(0); - } -#endif -*/ -} - // Set blending mode (alpha, additive, multiplied) // NOTE: Only 3 blending modes predefined void SetBlendMode(int mode) @@ -2652,15 +2535,11 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in } // Load Shader (Vertex and Fragment) -// NOTE: This shader program is used only for batch buffers (lines, triangles, quads) +// NOTE: This shader program is used for batch buffers (lines, triangles, quads) static Shader LoadDefaultShader(void) { Shader shader; - // NOTE: Shaders are written using GLSL 110 (desktop), that is equivalent to GLSL 100 on ES2 - // NOTE: Detected an error on ATI cards if defined #version 110 while OpenGL 3.3+ - // Just defined #version 330 despite shader is #version 110 - // Vertex shader directly defined, no external file required #if defined(GRAPHICS_API_OPENGL_33) char vShaderStr[] = "#version 330 \n" @@ -2668,7 +2547,7 @@ static Shader LoadDefaultShader(void) "in vec2 vertexTexCoord; \n" "in vec4 vertexColor; \n" "out vec2 fragTexCoord; \n" - "out vec4 fragTintColor; \n" + "out vec4 fragTintColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char vShaderStr[] = "#version 100 \n" "attribute vec3 vertexPosition; \n" @@ -2677,7 +2556,7 @@ static Shader LoadDefaultShader(void) "varying vec2 fragTexCoord; \n" "varying vec4 fragTintColor; \n" #endif - "uniform mat4 mvpMatrix; \n" + "uniform mat4 mvpMatrix; \n" "void main() \n" "{ \n" " fragTexCoord = vertexTexCoord; \n" @@ -2689,7 +2568,7 @@ static Shader LoadDefaultShader(void) #if defined(GRAPHICS_API_OPENGL_33) char fShaderStr[] = "#version 330 \n" "in vec2 fragTexCoord; \n" - "in vec4 fragTintColor; \n" + "in vec4 fragTintColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char fShaderStr[] = "#version 100 \n" "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) @@ -2724,10 +2603,6 @@ static Shader LoadDefaultShader(void) shader.mapDiffuseLoc = glGetUniformLocation(shader.id, "texture0"); shader.mapNormalLoc = -1; // It can be set later shader.mapSpecularLoc = -1; // It can be set later - - shader.texDiffuseId = whiteTexture; // Default white texture - shader.texNormalId = 0; - shader.texSpecularId = 0; //-------------------------------------------------------------------- return shader; @@ -2739,10 +2614,6 @@ static Shader LoadSimpleShader(void) { Shader shader; - // NOTE: Shaders are written using GLSL 110 (desktop), that is equivalent to GLSL 100 on ES2 - // NOTE: Detected an error on ATI cards if defined #version 110 while OpenGL 3.3+ - // Just defined #version 330 despite shader is #version 110 - // Vertex shader directly defined, no external file required #if defined(GRAPHICS_API_OPENGL_33) char vShaderStr[] = "#version 330 \n" @@ -2802,10 +2673,6 @@ static Shader LoadSimpleShader(void) shader.mapDiffuseLoc = glGetUniformLocation(shader.id, "texture0"); shader.mapNormalLoc = -1; // It can be set later shader.mapSpecularLoc = -1; // It can be set later - - shader.texDiffuseId = whiteTexture; // Default white texture - shader.texNormalId = 0; - shader.texSpecularId = 0; //-------------------------------------------------------------------- return shader; @@ -2878,7 +2745,6 @@ static void InitializeBuffers(void) quads.indices = (unsigned short *)malloc(sizeof(short)*6*MAX_QUADS_BATCH); // 6 int by quad (indices) #endif - for (int i = 0; i < (3*4*MAX_QUADS_BATCH); i++) quads.vertices[i] = 0.0f; for (int i = 0; i < (2*4*MAX_QUADS_BATCH); i++) quads.texcoords[i] = 0.0f; for (int i = 0; i < (4*4*MAX_QUADS_BATCH); i++) quads.colors[i] = 0; diff --git a/src/rlgl.h b/src/rlgl.h index 9e0aaaaa..69640feb 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -154,11 +154,6 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; typedef struct Shader { unsigned int id; // Shader program id - // TODO: This should be Texture2D objects - unsigned int texDiffuseId; // Diffuse texture id - unsigned int texNormalId; // Normal texture id - unsigned int texSpecularId; // Specular texture id - // Variable attributes int vertexLoc; // Vertex attribute location point (vertex shader) int texcoordLoc; // Texcoord attribute location point (vertex shader) @@ -184,12 +179,27 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; int format; // Data format (TextureFormat) } Texture2D; + // Material type + typedef struct Material { + Shader shader; + + Texture2D texDiffuse; // Diffuse texture + Texture2D texNormal; // Normal texture + Texture2D texSpecular; // Specular texture + + Color colDiffuse; + Color colAmbient; + Color colSpecular; + + float glossiness; + float normalDepth; + } Material; + // 3d Model type typedef struct Model { Mesh mesh; Matrix transform; - Texture2D texture; - Shader shader; + Material material; } Model; // Color blending modes (pre-defined) -- cgit v1.2.3 From 7053724fd6209682f203b188c6f309214880b84f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 6 Mar 2016 12:24:44 +0100 Subject: Default style tweak --- src/raygui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c index 60df2121..3d7a67ec 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -59,16 +59,16 @@ static int style[NUM_PROPERTIES] = { 1, // GLOBAL_BORDER_WIDTH 0xf5f5f5ff, // BACKGROUND_COLOR 1, // LABEL_BORDER_WIDTH - 0x000000ff, // LABEL_TEXT_COLOR + 0x4d4d4dff, // LABEL_TEXT_COLOR 20, // LABEL_TEXT_PADDING 2, // BUTTON_BORDER_WIDTH 20, // BUTTON_TEXT_PADDING 0x828282ff, // BUTTON_DEFAULT_BORDER_COLOR 0xc8c8c8ff, // BUTTON_DEFAULT_INSIDE_COLOR - 0x000000ff, // BUTTON_DEFAULT_TEXT_COLOR + 0x4d4d4dff, // BUTTON_DEFAULT_TEXT_COLOR 0xc8c8c8ff, // BUTTON_HOVER_BORDER_COLOR 0xffffffff, // BUTTON_HOVER_INSIDE_COLOR - 0x000000ff, // BUTTON_HOVER_TEXT_COLOR + 0x353535ff, // BUTTON_HOVER_TEXT_COLOR 0x7bb0d6ff, // BUTTON_PRESSED_BORDER_COLOR 0xbcecffff, // BUTTON_PRESSED_INSIDE_COLOR 0x5f9aa7ff, // BUTTON_PRESSED_TEXT_COLOR @@ -120,7 +120,7 @@ static int style[NUM_PROPERTIES] = { 0x000000ff, // SPINNER_PRESSED_TEXT_COLOR 1, // COMBOBOX_PADDING 30, // COMBOBOX_BUTTON_WIDTH - 30, // COMBOBOX_BUTTON_HEIGHT + 20, // COMBOBOX_BUTTON_HEIGHT 1, // COMBOBOX_BORDER_WIDTH 0x828282ff, // COMBOBOX_DEFAULT_BORDER_COLOR 0xc8c8c8ff, // COMBOBOX_DEFAULT_INSIDE_COLOR -- cgit v1.2.3 From d0e7195a16c50b23fd82e7ca7869cc07773ddba2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 6 Mar 2016 19:28:58 +0100 Subject: Added new functions to draw text on image --- src/raylib.h | 4 +++- src/textures.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index f448487e..527d0cb9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -697,9 +697,11 @@ Image ImageCopy(Image image); void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) +void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image +void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) +void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) void ImageFlipVertical(Image *image); // Flip image vertically void ImageFlipHorizontal(Image *image); // Flip image horizontally void ImageColorTint(Image *image, Color color); // Modify image color: tint diff --git a/src/textures.c b/src/textures.c index cb3113dc..e649df57 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1090,6 +1090,25 @@ Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, return imText; } +// Draw text (default font) within an image (destination) +void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color) +{ + ImageDrawTextEx(dst, position, GetDefaultFont(), text, fontSize, 0, color); +} + +// Draw text (custom sprite font) within an image (destination) +void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color) +{ + Image imText = ImageTextEx(font, text, fontSize, spacing, color); + + Rectangle srcRec = { 0, 0, imText.width, imText.height }; + Rectangle dstRec = { (int)position.x, (int)position.y, imText.width, imText.height }; + + ImageDraw(dst, imText, srcRec, dstRec); + + UnloadImage(imText); +} + // Flip image vertically void ImageFlipVertical(Image *image) { -- cgit v1.2.3 From 6ee5718b2e65c69fca695fdf999fa1838c63aa0b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 6 Mar 2016 19:30:16 +0100 Subject: Improved function GetKeyPressed() To support multiple keys (including function keys) --- src/core.c | 9 +++++---- src/raygui.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 870ca3b4..6b2321c2 100644 --- a/src/core.c +++ b/src/core.c @@ -1735,10 +1735,11 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i TakeScreenshot(); } #endif - else currentKeyState[key] = action; - - // TODO: Review (and remove) this HACK for GuiTextBox, to deteck back key - if ((key == 259) && (action == GLFW_PRESS)) lastKeyPressed = 3; + else + { + currentKeyState[key] = action; + if (action == GLFW_PRESS) lastKeyPressed = key; + } } // GLFW3 Mouse Button Callback, runs on mouse button pressed diff --git a/src/raygui.c b/src/raygui.c index 3d7a67ec..e66c33b5 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -789,11 +789,11 @@ int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) // NOTE: Requires static variables: framesCounter - ERROR! char *GuiTextBox(Rectangle bounds, char *text) { - #define MAX_CHARS_LENGTH 20 - #define KEY_BACKSPACE_TEXT 3 + #define MAX_CHARS_LENGTH 20 + #define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256 int initPos = bounds.x + 4; - char letter = -1; + int letter = -1; static int framesCounter = 0; Vector2 mousePoint = GetMousePosition(); @@ -822,12 +822,15 @@ char *GuiTextBox(Rectangle bounds, char *text) } else { - for (int i = 0; i < MAX_CHARS_LENGTH; i++) + if ((letter >= 32) && (letter < 127)) { - if (text[i] == '\0') + for (int i = 0; i < MAX_CHARS_LENGTH; i++) { - text[i] = letter; - break; + if (text[i] == '\0') + { + text[i] = (char)letter; + break; + } } } } -- cgit v1.2.3 From 18a13679fd4d9257d7328a5d4d55eefaf7558d6a Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 7 Mar 2016 09:38:55 +0100 Subject: Review GuiToggleButton() --- src/raygui.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c index e66c33b5..95cea0b6 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -258,15 +258,28 @@ bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle) //-------------------------------------------------------------------- if (toggleButton.width < textWidth) toggleButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; if (toggleButton.height < textHeight) toggleButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; + + if (toggle) toggleState = TOGGLE_ACTIVE; + else toggleState = TOGGLE_UNACTIVE; + if (CheckCollisionPointRec(mousePoint, toggleButton)) { if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) toggleState = TOGGLE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) toggleState = TOGGLE_ACTIVE; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + { + if (toggle) + { + toggle = false; + toggleState = TOGGLE_UNACTIVE; + } + else + { + toggle = true; + toggleState = TOGGLE_ACTIVE; + } + } else toggleState = TOGGLE_HOVER; } - - if (toggleState == TOGGLE_ACTIVE && !toggle) toggle = true; - if (toggle) toggleState = TOGGLE_ACTIVE; //-------------------------------------------------------------------- // Draw control -- cgit v1.2.3 From dcabb49244ba4da0d0ccdda7fce61103c814b086 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 9 Mar 2016 10:15:28 +0100 Subject: GESTURE SWIPE change name variable --- src/gestures.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gestures.c b/src/gestures.c index e615c06d..583b77cd 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -72,7 +72,7 @@ static Vector2 moveDownPosition2 = { 0.0f, 0.0f }; static int numTap = 0; static int pointCount = 0; -static int touchId = -1; +static int firstTouchId = -1; static double eventTime = 0.0; static double swipeTime = 0.0; @@ -120,9 +120,7 @@ void ProcessGestureEvent(GestureEvent event) pointCount = event.pointCount; // Required on UpdateGestures() if (pointCount < 2) - { - touchId = event.pointerId[0]; - + { if (event.touchAction == TOUCH_DOWN) { numTap++; // Tap counter @@ -145,6 +143,8 @@ void ProcessGestureEvent(GestureEvent event) touchUpPosition = touchDownPosition; eventTime = GetCurrentTime(); + firstTouchId = event.pointerId[0]; + dragVector = (Vector2){ 0.0f, 0.0f }; } else if (event.touchAction == TOUCH_UP) @@ -158,7 +158,7 @@ void ProcessGestureEvent(GestureEvent event) startMoving = false; // Detect GESTURE_SWIPE - if ((dragIntensity > FORCE_TO_SWIPE) && (touchId == 0)) // RAY: why check (touchId == 0)??? + if ((dragIntensity > FORCE_TO_SWIPE) && firstTouchId == event.pointerId[0]) { // NOTE: Angle should be inverted in Y dragAngle = 360.0f - Vector2Angle(touchDownPosition, touchUpPosition); -- cgit v1.2.3 From 2e3e62a413d35eb8d8a64f6ed68881701bfb9bd9 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 12 Mar 2016 20:01:46 +0100 Subject: Raname all makefile files to "Makefile" I've renamed all makefile files to "Makefile" because they appear in the first files. --- src/Makefile | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/makefile | 187 ----------------------------------------------------------- 2 files changed, 187 insertions(+), 187 deletions(-) create mode 100644 src/Makefile delete mode 100644 src/makefile (limited to 'src') diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..cab2ced0 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,187 @@ +#************************************************************************************************** +# +# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) +# +# Copyright (c) 2014 Ramon Santamaria (@raysan5) +# +# This software is provided "as-is", without any express or implied warranty. In no event +# will the authors be held liable for any damages arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, including commercial +# applications, and to alter it and redistribute it freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not claim that you +# wrote the original software. If you use this software in a product, an acknowledgment +# in the product documentation would be appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be misrepresented +# as being the original software. +# +# 3. This notice may not be removed or altered from any source distribution. +# +#************************************************************************************************** + +# define raylib platform to compile for +# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB +PLATFORM ?= PLATFORM_DESKTOP + +# determine PLATFORM_OS in case PLATFORM_DESKTOP selected +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows + ifeq ($(OS),Windows_NT) + PLATFORM_OS=WINDOWS + else + UNAMEOS:=$(shell uname) + ifeq ($(UNAMEOS),Linux) + PLATFORM_OS=LINUX + else + ifeq ($(UNAMEOS),Darwin) + PLATFORM_OS=OSX + endif + endif + endif +endif + +# define raylib graphics api depending on selected platform +ifeq ($(PLATFORM),PLATFORM_RPI) + # define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used) + GRAPHICS = GRAPHICS_API_OPENGL_ES2 +else + # define raylib graphics api to use (OpenGL 1.1 by default) + GRAPHICS ?= GRAPHICS_API_OPENGL_11 + #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + GRAPHICS = GRAPHICS_API_OPENGL_ES2 +endif + +# NOTE: makefiles targets require tab indentation + +# define compiler: gcc for C program, define as g++ for C++ +ifeq ($(PLATFORM),PLATFORM_WEB) + # define emscripten compiler + CC = emcc +else + # define default gcc compiler + CC = gcc +endif + +# define compiler flags: +# -O1 defines optimization level +# -Wall turns on most, but not all, compiler warnings +# -std=c99 defines C language mode (standard C from 1999 revision) +# -std=gnu99 defines C language mode (GNU C from 1999 revision) +# -fgnu89-inline declaring inline functions support (GCC optimized, faster) +CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline + +#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes + +# define any directories containing required header files +ifeq ($(PLATFORM),PLATFORM_RPI) + INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads +else + INCLUDES = -I. -I../src +# external libraries headers +# GLFW3 + INCLUDES += -I../external/glfw3/include +# GLEW + INCLUDES += -I../external/glew/include +# OpenAL Soft + INCLUDES += -I../external/openal_soft/include +endif + +# define all object files required +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + OBJS = core.o rlgl.o glad.o shapes.o text.o textures.o models.o audio.o utils.o camera.o gestures.o stb_vorbis.o +else + #GLAD only required on desktop platform + OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o stb_vorbis.o utils.o camera.o gestures.o +endif + + +# typing 'make' will invoke the first target entry in the file, +# in this case, the 'default' target entry is raylib +default: raylib + +# compile raylib library +raylib: $(OBJS) +ifeq ($(PLATFORM),PLATFORM_WEB) + emcc -O1 $(OBJS) -o libraylib.bc +else + ar rcs libraylib.a $(OBJS) +endif + +# compile core module +# emcc core.c -o core.bc -DPLATFORM_DESKTOP +core.o: core.c + $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile rlgl module +rlgl.o: rlgl.c + $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile glad module +glad.o: glad.c + $(CC) -c glad.c $(CFLAGS) $(INCLUDES) + +# compile shapes module +shapes.o: shapes.c + $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile textures module +textures.o: textures.c + $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile text module +text.o: text.c + $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile models module +models.o: models.c + $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +# compile audio module +audio.o: audio.c + $(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +# compile stb_vorbis library +stb_vorbis.o: stb_vorbis.c + $(CC) -c stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) + +# compile utils module +utils.o: utils.c + $(CC) -c utils.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +# compile camera module +camera.o: camera.c + $(CC) -c camera.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +# compile gestures module +gestures.o: gestures.c + $(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +# clean everything +clean: +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),OSX) + rm -f *.o libraylib.a + else + ifeq ($(PLATFORM_OS),LINUX) + find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + else + del *.o libraylib.a + endif + endif +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + rm -f *.o libraylib.a +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + del *.o libraylib.bc +endif + @echo Cleaning done + +# instead of defining every module one by one, we can define a pattern +# this pattern below will automatically compile every module defined on $(OBJS) +#%.o : %.c +# $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) diff --git a/src/makefile b/src/makefile deleted file mode 100644 index cab2ced0..00000000 --- a/src/makefile +++ /dev/null @@ -1,187 +0,0 @@ -#************************************************************************************************** -# -# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) -# -# Copyright (c) 2014 Ramon Santamaria (@raysan5) -# -# This software is provided "as-is", without any express or implied warranty. In no event -# will the authors be held liable for any damages arising from the use of this software. -# -# Permission is granted to anyone to use this software for any purpose, including commercial -# applications, and to alter it and redistribute it freely, subject to the following restrictions: -# -# 1. The origin of this software must not be misrepresented; you must not claim that you -# wrote the original software. If you use this software in a product, an acknowledgment -# in the product documentation would be appreciated but is not required. -# -# 2. Altered source versions must be plainly marked as such, and must not be misrepresented -# as being the original software. -# -# 3. This notice may not be removed or altered from any source distribution. -# -#************************************************************************************************** - -# define raylib platform to compile for -# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB -PLATFORM ?= PLATFORM_DESKTOP - -# determine PLATFORM_OS in case PLATFORM_DESKTOP selected -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows - ifeq ($(OS),Windows_NT) - PLATFORM_OS=WINDOWS - else - UNAMEOS:=$(shell uname) - ifeq ($(UNAMEOS),Linux) - PLATFORM_OS=LINUX - else - ifeq ($(UNAMEOS),Darwin) - PLATFORM_OS=OSX - endif - endif - endif -endif - -# define raylib graphics api depending on selected platform -ifeq ($(PLATFORM),PLATFORM_RPI) - # define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used) - GRAPHICS = GRAPHICS_API_OPENGL_ES2 -else - # define raylib graphics api to use (OpenGL 1.1 by default) - GRAPHICS ?= GRAPHICS_API_OPENGL_11 - #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - GRAPHICS = GRAPHICS_API_OPENGL_ES2 -endif - -# NOTE: makefiles targets require tab indentation - -# define compiler: gcc for C program, define as g++ for C++ -ifeq ($(PLATFORM),PLATFORM_WEB) - # define emscripten compiler - CC = emcc -else - # define default gcc compiler - CC = gcc -endif - -# define compiler flags: -# -O1 defines optimization level -# -Wall turns on most, but not all, compiler warnings -# -std=c99 defines C language mode (standard C from 1999 revision) -# -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -fgnu89-inline declaring inline functions support (GCC optimized, faster) -CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline - -#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes - -# define any directories containing required header files -ifeq ($(PLATFORM),PLATFORM_RPI) - INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -else - INCLUDES = -I. -I../src -# external libraries headers -# GLFW3 - INCLUDES += -I../external/glfw3/include -# GLEW - INCLUDES += -I../external/glew/include -# OpenAL Soft - INCLUDES += -I../external/openal_soft/include -endif - -# define all object files required -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - OBJS = core.o rlgl.o glad.o shapes.o text.o textures.o models.o audio.o utils.o camera.o gestures.o stb_vorbis.o -else - #GLAD only required on desktop platform - OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o stb_vorbis.o utils.o camera.o gestures.o -endif - - -# typing 'make' will invoke the first target entry in the file, -# in this case, the 'default' target entry is raylib -default: raylib - -# compile raylib library -raylib: $(OBJS) -ifeq ($(PLATFORM),PLATFORM_WEB) - emcc -O1 $(OBJS) -o libraylib.bc -else - ar rcs libraylib.a $(OBJS) -endif - -# compile core module -# emcc core.c -o core.bc -DPLATFORM_DESKTOP -core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile rlgl module -rlgl.o: rlgl.c - $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile glad module -glad.o: glad.c - $(CC) -c glad.c $(CFLAGS) $(INCLUDES) - -# compile shapes module -shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile textures module -textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile text module -text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile models module -models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile audio module -audio.o: audio.c - $(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile stb_vorbis library -stb_vorbis.o: stb_vorbis.c - $(CC) -c stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) - -# compile utils module -utils.o: utils.c - $(CC) -c utils.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile camera module -camera.o: camera.c - $(CC) -c camera.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile gestures module -gestures.o: gestures.c - $(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# clean everything -clean: -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),OSX) - rm -f *.o libraylib.a - else - ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f - else - del *.o libraylib.a - endif - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - rm -f *.o libraylib.a -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - del *.o libraylib.bc -endif - @echo Cleaning done - -# instead of defining every module one by one, we can define a pattern -# this pattern below will automatically compile every module defined on $(OBJS) -#%.o : %.c -# $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) -- cgit v1.2.3 From 7128ef686d9c09d0ec3b413c07bb1cc24f03d219 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Wed, 16 Mar 2016 12:45:01 +0100 Subject: physac module redesign (2/3) physac module base almost finished. All collisions are now resolved properly and some force functions was added. COLLIDER_CAPSULE removed for now because in 2D everything is composed by rectangle and circle colliders... The last step is move physics update loop into another thread and update it in a fixed time step based on fps. --- src/physac.c | 494 +++++++++++++++++++++++++++++++++++++++++++---------------- src/physac.h | 9 +- 2 files changed, 371 insertions(+), 132 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index 13247117..718a06bb 100644 --- a/src/physac.c +++ b/src/physac.c @@ -36,10 +36,9 @@ // Defines and Macros //---------------------------------------------------------------------------------- #define MAX_PHYSIC_OBJECTS 256 -#define PHYSICS_GRAVITY -9.81f/2 #define PHYSICS_STEPS 450 -#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) -#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix +#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) +#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -52,53 +51,70 @@ //---------------------------------------------------------------------------------- static PhysicObject *physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool static int physicObjectsCount; // Counts current enabled physic objects +static Vector2 gravityForce; // Gravity force //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 +static float Vector2Length(Vector2 v); // Returns the length of a Vector2 //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- // Initializes pointers array (just pointers, fixed size) -void InitPhysics() +void InitPhysics(Vector2 gravity) { // Initialize physics variables physicObjectsCount = 0; + gravityForce = gravity; } // Update physic objects, calculating physic behaviours and collisions detection void UpdatePhysics() { // Reset all physic objects is grounded state - for(int i = 0; i < physicObjectsCount; i++) + for (int i = 0; i < physicObjectsCount; i++) { - if(physicObjects[i]->rigidbody.enabled) physicObjects[i]->rigidbody.isGrounded = false; + if (physicObjects[i]->rigidbody.enabled) physicObjects[i]->rigidbody.isGrounded = false; } - for(int steps = 0; steps < PHYSICS_STEPS; steps++) + for (int steps = 0; steps < PHYSICS_STEPS; steps++) { - for(int i = 0; i < physicObjectsCount; i++) + for (int i = 0; i < physicObjectsCount; i++) { - if(physicObjects[i]->enabled) + if (physicObjects[i]->enabled) { // Update physic behaviour - if(physicObjects[i]->rigidbody.enabled) + if (physicObjects[i]->rigidbody.enabled) { // Apply friction to acceleration in X axis if (physicObjects[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; else if (physicObjects[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; else physicObjects[i]->rigidbody.acceleration.x = 0.0f; + // Apply friction to acceleration in Y axis + if (physicObjects[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.y -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicObjects[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.y += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else physicObjects[i]->rigidbody.acceleration.y = 0.0f; + // Apply friction to velocity in X axis if (physicObjects[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; else if (physicObjects[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; else physicObjects[i]->rigidbody.velocity.x = 0.0f; + // Apply friction to velocity in Y axis + if (physicObjects[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.y -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicObjects[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.y += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; + else physicObjects[i]->rigidbody.velocity.y = 0.0f; + // Apply gravity to velocity - if (physicObjects[i]->rigidbody.applyGravity) physicObjects[i]->rigidbody.velocity.y += PHYSICS_GRAVITY/PHYSICS_STEPS; + if (physicObjects[i]->rigidbody.applyGravity) + { + physicObjects[i]->rigidbody.velocity.x += gravityForce.x/PHYSICS_STEPS; + physicObjects[i]->rigidbody.velocity.y += gravityForce.y/PHYSICS_STEPS; + } // Apply acceleration to velocity physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.acceleration.x/PHYSICS_STEPS; @@ -120,142 +136,314 @@ void UpdatePhysics() { if (physicObjects[k]->collider.enabled && i != k) { - // Check if colliders are overlapped - if (CheckCollisionRecs(physicObjects[i]->collider.bounds, physicObjects[k]->collider.bounds)) + // Resolve physic collision + // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) + // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) + + // 1. Calculate collision normal + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Define collision contact normal, direction and penetration depth + Vector2 contactNormal = { 0.0f, 0.0f }; + Vector2 direction = { 0.0f, 0.0f }; + float penetrationDepth = 0.0f; + + switch(physicObjects[i]->collider.type) { - // Resolve physic collision - // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) - // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) - - // 1. Calculate collision normal - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Define collision ontact normal - Vector2 contactNormal = { 0.0f, 0.0f }; + case COLLIDER_RECTANGLE: + { + switch(physicObjects[k]->collider.type) + { + case COLLIDER_RECTANGLE: + { + // Check if colliders are overlapped + if (CheckCollisionRecs(physicObjects[i]->collider.bounds, physicObjects[k]->collider.bounds)) + { + // Calculate direction vector from i to k + direction.x = (physicObjects[k]->transform.position.x + physicObjects[k]->transform.scale.x/2) - (physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2); + direction.y = (physicObjects[k]->transform.position.y + physicObjects[k]->transform.scale.y/2) - (physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2); + + // Define overlapping and penetration attributes + Vector2 overlap; + + // Calculate overlap on X axis + overlap.x = (physicObjects[i]->transform.scale.x + physicObjects[k]->transform.scale.x)/2 - abs(direction.x); + + // SAT test on X axis + if (overlap.x > 0.0f) + { + // Calculate overlap on Y axis + overlap.y = (physicObjects[i]->transform.scale.y + physicObjects[k]->transform.scale.y)/2 - abs(direction.y); + + // SAT test on Y axis + if (overlap.y > 0.0f) + { + // Find out which axis is axis of least penetration + if (overlap.y > overlap.x) + { + // Point towards k knowing that direction points from i to k + if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; + else contactNormal = (Vector2){ 1.0f, 0.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.x; + } + else + { + // Point towards k knowing that direction points from i to k + if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; + else contactNormal = (Vector2){ 0.0f, -1.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.y; + } + } + } + } + } break; + case COLLIDER_CIRCLE: + { + if (CheckCollisionCircleRec(physicObjects[k]->transform.position, physicObjects[k]->collider.radius, physicObjects[i]->collider.bounds)) + { + // Calculate direction vector between circles + direction.x = physicObjects[k]->transform.position.x - physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2; + direction.y = physicObjects[k]->transform.position.y - physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicObjects[i]->collider.bounds.x + physicObjects[i]->collider.bounds.width; + else closestPoint.x = physicObjects[i]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicObjects[i]->collider.bounds.y + physicObjects[i]->collider.bounds.height; + else closestPoint.y = physicObjects[i]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicObjects[k]->transform.position, physicObjects[k]->collider.radius)) + { + // Recalculate direction based on closest point position + direction.x = physicObjects[k]->transform.position.x - closestPoint.x; + direction.y = physicObjects[k]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); + + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + + // Calculate penetration depth + penetrationDepth = physicObjects[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) + { + // Calculate final contact normal + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicObjects[i]->collider.bounds.y - physicObjects[k]->transform.position.y - physicObjects[k]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicObjects[i]->collider.bounds.y - physicObjects[k]->transform.position.y + physicObjects[k]->collider.radius); + } + } + else + { + // Calculate final contact normal + if (direction.x > 0.0f) + { + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicObjects[k]->transform.position.x + physicObjects[k]->collider.radius - physicObjects[i]->collider.bounds.x); + } + else + { + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicObjects[i]->collider.bounds.x + physicObjects[i]->collider.bounds.width - physicObjects[k]->transform.position.x - physicObjects[k]->collider.radius); + } + } + } + } + } break; + } + } break; + case COLLIDER_CIRCLE: + { + switch(physicObjects[k]->collider.type) + { + case COLLIDER_RECTANGLE: + { + if (CheckCollisionCircleRec(physicObjects[i]->transform.position, physicObjects[i]->collider.radius, physicObjects[k]->collider.bounds)) + { + // Calculate direction vector between circles + direction.x = physicObjects[k]->transform.position.x + physicObjects[i]->transform.scale.x/2 - physicObjects[i]->transform.position.x; + direction.y = physicObjects[k]->transform.position.y + physicObjects[i]->transform.scale.y/2 - physicObjects[i]->transform.position.y; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicObjects[k]->collider.bounds.x + physicObjects[k]->collider.bounds.width; + else closestPoint.x = physicObjects[k]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicObjects[k]->collider.bounds.y + physicObjects[k]->collider.bounds.height; + else closestPoint.y = physicObjects[k]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicObjects[i]->transform.position, physicObjects[i]->collider.radius)) + { + // Recalculate direction based on closest point position + direction.x = physicObjects[i]->transform.position.x - closestPoint.x; + direction.y = physicObjects[i]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); + + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + + // Calculate penetration depth + penetrationDepth = physicObjects[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) + { + // Calculate final contact normal + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicObjects[k]->collider.bounds.y - physicObjects[i]->transform.position.y - physicObjects[i]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicObjects[k]->collider.bounds.y - physicObjects[i]->transform.position.y + physicObjects[i]->collider.radius); + } + } + else + { + // Calculate final contact normal and penetration depth + if (direction.x > 0.0f) + { + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicObjects[i]->transform.position.x + physicObjects[i]->collider.radius - physicObjects[k]->collider.bounds.x); + } + else + { + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicObjects[k]->collider.bounds.x + physicObjects[k]->collider.bounds.width - physicObjects[i]->transform.position.x - physicObjects[i]->collider.radius); + } + } + } + } + } break; + case COLLIDER_CIRCLE: + { + // Check if colliders are overlapped + if (CheckCollisionCircles(physicObjects[i]->transform.position, physicObjects[i]->collider.radius, physicObjects[k]->transform.position, physicObjects[k]->collider.radius)) + { + // Calculate direction vector between circles + direction.x = physicObjects[k]->transform.position.x - physicObjects[i]->transform.position.x; + direction.y = physicObjects[k]->transform.position.y - physicObjects[i]->transform.position.y; + + // Calculate distance between circles + float distance = Vector2Length(direction); + + // Check if circles are not completely overlapped + if (distance != 0.0f) + { + // Calculate contact normal direction (Y axis needs to be flipped) + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + } + else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values + } + } break; + default: break; + } + } break; + default: break; + } + + // Update rigidbody grounded state + if (physicObjects[i]->rigidbody.enabled) + { + if (contactNormal.y < 0.0f) physicObjects[i]->rigidbody.isGrounded = true; + } + + // 2. Calculate collision impulse + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Calculate relative velocity + Vector2 relVelocity = { 0.0f, 0.0f }; + relVelocity.x = physicObjects[k]->rigidbody.velocity.x - physicObjects[i]->rigidbody.velocity.x; + relVelocity.y = physicObjects[k]->rigidbody.velocity.y - physicObjects[i]->rigidbody.velocity.y; + + // Calculate relative velocity in terms of the normal direction + float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); + + // Dot not resolve if velocities are separating + if (velAlongNormal <= 0.0f) + { + // Calculate minimum bounciness value from both objects + float e = fminf(physicObjects[i]->rigidbody.bounciness, physicObjects[k]->rigidbody.bounciness); - // Calculate direction vector from i to k - Vector2 direction; - direction.x = (physicObjects[k]->transform.position.x + physicObjects[k]->transform.scale.x/2) - (physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2); - direction.y = (physicObjects[k]->transform.position.y + physicObjects[k]->transform.scale.y/2) - (physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2); + // Calculate impulse scalar value + float j = -(1.0f + e)*velAlongNormal; + j /= 1.0f/physicObjects[i]->rigidbody.mass + 1.0f/physicObjects[k]->rigidbody.mass; - // Define overlapping and penetration attributes - Vector2 overlap; - float penetrationDepth = 0.0f; + // Calculate final impulse vector + Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; - // Calculate overlap on X axis - overlap.x = (physicObjects[i]->transform.scale.x + physicObjects[k]->transform.scale.x)/2 - abs(direction.x); + // Calculate collision mass ration + float massSum = physicObjects[i]->rigidbody.mass + physicObjects[k]->rigidbody.mass; + float ratio = 0.0f; - // SAT test on X axis - if (overlap.x > 0.0f) + // Apply impulse to current rigidbodies velocities if they are enabled + if (physicObjects[i]->rigidbody.enabled) { - // Calculate overlap on Y axis - overlap.y = (physicObjects[i]->transform.scale.y + physicObjects[k]->transform.scale.y)/2 - abs(direction.y); + // Calculate inverted mass ration + ratio = physicObjects[i]->rigidbody.mass/massSum; - // SAT test on Y axis - if (overlap.y > 0.0f) - { - // Find out which axis is axis of least penetration - if (overlap.y > overlap.x) - { - // Point towards k knowing that direction points from i to k - if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; - else contactNormal = (Vector2){ 1.0f, 0.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.x; - } - else - { - // Point towards k knowing that direction points from i to k - if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; - else contactNormal = (Vector2){ 0.0f, -1.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.y; - } - } + // Apply impulse direction to velocity + physicObjects[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); + physicObjects[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); } - // Update rigidbody grounded state - if (physicObjects[i]->rigidbody.enabled) + if (physicObjects[k]->rigidbody.enabled) { - if (contactNormal.y < 0.0f) physicObjects[i]->rigidbody.isGrounded = true; + // Calculate inverted mass ration + ratio = physicObjects[k]->rigidbody.mass/massSum; + + // Apply impulse direction to velocity + physicObjects[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); + physicObjects[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); } - // 2. Calculate collision impulse - // ------------------------------------------------------------------------------------------------------------------------------------- + // 3. Correct colliders overlaping (transform position) + // --------------------------------------------------------------------------------------------------------------------------------- - // Calculate relative velocity - Vector2 relVelocity = { physicObjects[k]->rigidbody.velocity.x - physicObjects[i]->rigidbody.velocity.x, physicObjects[k]->rigidbody.velocity.y - physicObjects[i]->rigidbody.velocity.y }; - - // Calculate relative velocity in terms of the normal direction - float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); - - // Dot not resolve if velocities are separating - if (velAlongNormal <= 0.0f) - { - // Calculate minimum bounciness value from both objects - float e = fminf(physicObjects[i]->rigidbody.bounciness, physicObjects[k]->rigidbody.bounciness); - - // Calculate impulse scalar value - float j = -(1.0f + e) * velAlongNormal; - j /= 1.0f/physicObjects[i]->rigidbody.mass + 1.0f/physicObjects[k]->rigidbody.mass; - - // Calculate final impulse vector - Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; - - // Calculate collision mass ration - float massSum = physicObjects[i]->rigidbody.mass + physicObjects[k]->rigidbody.mass; - float ratio = 0.0f; + // Calculate transform position penetration correction + Vector2 posCorrection; + posCorrection.x = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; + posCorrection.y = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; + + // Fix transform positions + if (physicObjects[i]->rigidbody.enabled) + { + // Fix physic objects transform position + physicObjects[i]->transform.position.x -= 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.x; + physicObjects[i]->transform.position.y += 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.y; - // Apply impulse to current rigidbodies velocities if they are enabled - if (physicObjects[i]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicObjects[i]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicObjects[i]->rigidbody.velocity.x -= impulse.x*ratio; - physicObjects[i]->rigidbody.velocity.y -= impulse.y*ratio; - } + // Update collider bounds + physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); - if (physicObjects[k]->rigidbody.enabled) + if (physicObjects[k]->rigidbody.enabled) { - // Calculate inverted mass ration - ratio = physicObjects[k]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicObjects[k]->rigidbody.velocity.x += impulse.x*ratio; - physicObjects[k]->rigidbody.velocity.y += impulse.y*ratio; - } - - // 3. Correct colliders overlaping (transform position) - // --------------------------------------------------------------------------------------------------------------------------------- - - // Calculate transform position penetration correction - Vector2 posCorrection; - posCorrection.x = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; - posCorrection.y = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; - - // Fix transform positions - if (physicObjects[i]->rigidbody.enabled) - { // Fix physic objects transform position - physicObjects[i]->transform.position.x -= 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.x; - physicObjects[i]->transform.position.y += 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.y; + physicObjects[k]->transform.position.x += 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.x; + physicObjects[k]->transform.position.y -= 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.y; // Update collider bounds - physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); - - if (physicObjects[k]->rigidbody.enabled) - { - // Fix physic objects transform position - physicObjects[k]->transform.position.x += 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.x; - physicObjects[k]->transform.position.y -= 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicObjects[k]->collider.bounds = TransformToRectangle(physicObjects[k]->transform); - } + physicObjects[k]->collider.bounds = TransformToRectangle(physicObjects[k]->transform); } } } @@ -298,7 +486,7 @@ PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale obj->rigidbody.friction = 0.0f; obj->rigidbody.bounciness = 0.0f; - obj->collider.enabled = false; + obj->collider.enabled = true; obj->collider.type = COLLIDER_RECTANGLE; obj->collider.bounds = TransformToRectangle(obj->transform); obj->collider.radius = 0.0f; @@ -334,6 +522,45 @@ void DestroyPhysicObject(PhysicObject *pObj) physicObjectsCount--; } +// Apply directional force to a physic object +void ApplyForce(PhysicObject *pObj, Vector2 force) +{ + if (pObj->rigidbody.enabled) + { + pObj->rigidbody.velocity.x += force.x/pObj->rigidbody.mass; + pObj->rigidbody.velocity.y += force.y/pObj->rigidbody.mass; + } +} + +// Apply radial force to all physic objects in range +void ApplyForceAtPosition(Vector2 position, float force, float radius) +{ + for(int i = 0; i < physicObjectsCount; i++) + { + // Calculate direction and distance between force and physic object pposition + Vector2 distance = (Vector2){ physicObjects[i]->transform.position.x - position.x, physicObjects[i]->transform.position.y - position.y }; + + if(physicObjects[i]->collider.type == COLLIDER_RECTANGLE) + { + distance.x += physicObjects[i]->transform.scale.x/2; + distance.y += physicObjects[i]->transform.scale.y/2; + } + + float distanceLength = Vector2Length(distance); + + // Check if physic object is in force range + if(distanceLength <= radius) + { + // Normalize force direction + distance.x /= distanceLength; + distance.y /= -distanceLength; + + // Apply force to the physic object + ApplyForce(physicObjects[i], (Vector2){ distance.x*force, distance.y*force }); + } + } +} + // Convert Transform data type to Rectangle (position and scale) Rectangle TransformToRectangle(Transform transform) { @@ -369,3 +596,12 @@ static float Vector2DotProduct(Vector2 v1, Vector2 v2) return result; } + +static float Vector2Length(Vector2 v) +{ + float result; + + result = sqrt(v.x*v.x + v.y*v.y); + + return result; +} diff --git a/src/physac.h b/src/physac.h index fc5502c4..852a7e4a 100644 --- a/src/physac.h +++ b/src/physac.h @@ -40,7 +40,7 @@ typedef struct Vector2 { float y; } Vector2; -typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType; +typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; typedef struct Transform { Vector2 position; @@ -56,7 +56,7 @@ typedef struct Rigidbody { bool applyGravity; bool isGrounded; float friction; // Normalized value - float bounciness; // Normalized value + float bounciness; } Rigidbody; typedef struct Collider { @@ -81,13 +81,16 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -void InitPhysics(); // Initializes pointers array (just pointers, fixed size) +void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection void ClosePhysics(); // Unitialize all physic objects and empty the objects pool PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list +void ApplyForce(PhysicObject *pObj, Vector2 force); // Apply directional force to a physic object +void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range + Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position -- cgit v1.2.3 From 0caf925d5dc32e03852e3bf3d5fc5e31bc065f03 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Wed, 16 Mar 2016 12:48:30 +0100 Subject: Updated headers --- src/physac.h | 4 ++-- src/raylib.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index 852a7e4a..c70dbbe2 100644 --- a/src/physac.h +++ b/src/physac.h @@ -62,8 +62,8 @@ typedef struct Rigidbody { typedef struct Collider { bool enabled; ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE - int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE + Rectangle bounds; // Used for COLLIDER_RECTANGLE + int radius; // Used for COLLIDER_CIRCLE } Collider; typedef struct PhysicObject { diff --git a/src/raylib.h b/src/raylib.h index 527d0cb9..ddfccea7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -466,7 +466,7 @@ typedef struct { // Camera system modes typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; -typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE, COLLIDER_CAPSULE } ColliderType; +typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; typedef struct Transform { Vector2 position; @@ -482,14 +482,14 @@ typedef struct Rigidbody { bool applyGravity; bool isGrounded; float friction; // Normalized value - float bounciness; // Normalized value + float bounciness; } Rigidbody; typedef struct Collider { bool enabled; ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE and COLLIDER_CAPSULE - int radius; // Used for COLLIDER_CIRCLE and COLLIDER_CAPSULE + Rectangle bounds; // Used for COLLIDER_RECTANGLE + int radius; // Used for COLLIDER_CIRCLE } Collider; typedef struct PhysicObject { @@ -810,13 +810,16 @@ void SetBlendMode(int mode); // Set blend //---------------------------------------------------------------------------------- // Physics System Functions (Module: physac) //---------------------------------------------------------------------------------- -void InitPhysics(); // Initializes pointers array (just pointers, fixed size) +void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection void ClosePhysics(); // Unitialize all physic objects and empty the objects pool PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list +void ApplyForce(PhysicObject *pObj, Vector2 force); // Apply directional force to a physic object +void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range + Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position -- cgit v1.2.3 From ee52b13ae63f098c4e26a9812b2088f80fcbe7cc Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 16 Mar 2016 17:50:51 +0100 Subject: Corrected bug on GetCollisionRec() --- src/shapes.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 51730a05..46095d11 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -429,9 +429,24 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) retRec.height = rec2.height - dyy; } } - - if (retRec.width >= rec2.width) retRec.width = rec2.width; - if (retRec.height >= rec2.height) retRec.height = rec2.height; + + if (rec1.width > rec2.width) + { + if (retRec.width >= rec2.width) retRec.width = rec2.width; + } + else + { + if (retRec.width >= rec1.width) retRec.width = rec1.width; + } + + if (rec1.height > rec2.height) + { + if (retRec.height >= rec2.height) retRec.height = rec2.height; + } + else + { + if (retRec.height >= rec1.height) retRec.height = rec1.height; + } } return retRec; -- cgit v1.2.3 From d6bc7b887721de660917125eddd53372be1bf3f8 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 16 Mar 2016 17:51:21 +0100 Subject: Reset pointCount for gestures --- src/gestures.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gestures.c b/src/gestures.c index 583b77cd..b0a80084 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -179,6 +179,7 @@ void ProcessGestureEvent(GestureEvent event) } touchDownDragPosition = (Vector2){ 0.0f, 0.0f }; + pointCount = 0; } else if (event.touchAction == TOUCH_MOVE) { @@ -257,6 +258,7 @@ void ProcessGestureEvent(GestureEvent event) pinchDistance = 0.0f; pinchAngle = 0.0f; pinchVector = (Vector2){ 0.0f, 0.0f }; + pointCount = 0; currentGesture = GESTURE_NONE; } -- cgit v1.2.3 From db4585b3e23cd3c5aa87da21aedc36fd8be21739 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 16 Mar 2016 17:52:09 +0100 Subject: Improved gamepad support Now it works ok also in RaspberryPi --- src/core.c | 46 ++++++++++++++-------------------------------- src/raylib.h | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 6b2321c2..5bb59faa 100644 --- a/src/core.c +++ b/src/core.c @@ -127,6 +127,7 @@ #define MOUSE_SENSITIVITY 0.8f #define MAX_GAMEPAD_BUTTONS 11 + #define MAX_GAMEPAD_AXIS 5 #endif //---------------------------------------------------------------------------------- @@ -168,8 +169,7 @@ static bool gamepadReady = false; // Flag to know if gamepad is re pthread_t gamepadThreadId; // Gamepad reading thread id int gamepadButtons[MAX_GAMEPAD_BUTTONS]; -int gamepadAxisX = 0; -int gamepadAxisY = 0; +float gamepadAxisValues[MAX_GAMEPAD_AXIS]; #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1177,30 +1177,22 @@ bool IsGamepadAvailable(int gamepad) } // Return axis movement vector for a gamepad -Vector2 GetGamepadMovement(int gamepad) +float GetGamepadAxisMovement(int gamepad, int axis) { - Vector2 vec = { 0, 0 }; - - const float *axes; - int axisCount = 0; + float value = 0; #if defined(PLATFORM_RPI) - // TODO: Get gamepad axis information - // Use gamepadAxisX, gamepadAxisY + if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisValues[axis]; #else + const float *axes; + int axisCount = 0; + axes = glfwGetJoystickAxes(gamepad, &axisCount); -#endif - if (axisCount >= 2) - { - vec.x = axes[0]; // Left joystick X - vec.y = axes[1]; // Left joystick Y - - //vec.x = axes[2]; // Right joystick X - //vec.x = axes[3]; // Right joystick Y - } + if (axis < axisCount) value = axes[axis]; +#endif - return vec; + return value; } // Detect if a gamepad button has been pressed once @@ -2484,10 +2476,6 @@ static void *GamepadThread(void *arg) unsigned char number; // event axis/button number }; - // These values are sensible on Logitech Dual Action Rumble and Xbox360 controller - const int joystickAxisX = 0; - const int joystickAxisY = 1; - // Read gamepad event struct js_event gamepadEvent; @@ -2512,17 +2500,11 @@ static void *GamepadThread(void *arg) { TraceLog(DEBUG, "Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); - if (gamepadEvent.number == joystickAxisX) gamepadAxisX = (int)gamepadEvent.value; - if (gamepadEvent.number == joystickAxisY) gamepadAxisY = (int)gamepadEvent.value; - /* - switch (gamepadEvent.number) + if (gamepadEvent.number < MAX_GAMEPAD_AXIS) { - case 0: // 1st Axis X - case 1: // 1st Axis Y - case 2: // 2st Axis X - case 3: // 2st Axis Y + // NOTE: Scaling of gamepadEvent.value to get values between -1..1 + gamepadAxisValues[gamepadEvent.number] = (float)gamepadEvent.value/32768; } - */ } } } diff --git a/src/raylib.h b/src/raylib.h index ddfccea7..d891467e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -190,7 +190,35 @@ #define GAMEPAD_BUTTON_SELECT 9 #define GAMEPAD_BUTTON_START 10 -// TODO: Review Xbox360 USB Controller Buttons +// Xbox360 USB Controller Buttons +#define GAMEPAD_XBOX_BUTTON_A 0 +#define GAMEPAD_XBOX_BUTTON_B 1 +#define GAMEPAD_XBOX_BUTTON_X 2 +#define GAMEPAD_XBOX_BUTTON_Y 3 +#define GAMEPAD_XBOX_BUTTON_LB 4 +#define GAMEPAD_XBOX_BUTTON_RB 5 +#define GAMEPAD_XBOX_BUTTON_SELECT 6 +#define GAMEPAD_XBOX_BUTTON_START 7 + +#if defined(PLATFORM_RPI) + #define GAMEPAD_XBOX_AXIS_DPAD_X 32 + #define GAMEPAD_XBOX_AXIS_DPAD_Y 64 + #define GAMEPAD_XBOX_AXIS_RIGHT_X 3 + #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 + #define GAMEPAD_XBOX_AXIS_LT 2 + #define GAMEPAD_XBOX_AXIS_RT 5 +#else + #define GAMEPAD_XBOX_BUTTON_UP 10 + #define GAMEPAD_XBOX_BUTTON_DOWN 12 + #define GAMEPAD_XBOX_BUTTON_LEFT 13 + #define GAMEPAD_XBOX_BUTTON_RIGHT 11 + #define GAMEPAD_XBOX_AXIS_RIGHT_X 4 + #define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 + #define GAMEPAD_XBOX_AXIS_LT_RT 2 +#endif + +#define GAMEPAD_XBOX_AXIS_LEFT_X 0 +#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 // Android Physic Buttons #define ANDROID_BACK 4 @@ -592,7 +620,7 @@ void DisableCursor(void); // Disables cursor bool IsCursorHidden(void); // Returns true if cursor is not visible bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available -Vector2 GetGamepadMovement(int gamepad); // Return axis movement vector for a gamepad +float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once -- cgit v1.2.3 From 95c1bf954423f00a4fb8c6dc72820c2174d62dfa Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 16 Mar 2016 19:10:19 +0100 Subject: Removed previous change that introduced a bug --- src/shapes.c | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 46095d11..7e3b5634 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -180,17 +180,44 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo // Draw a color-filled rectangle (Vector version) void DrawRectangleV(Vector2 position, Vector2 size, Color color) { - rlBegin(RL_TRIANGLES); - rlColor4ub(color.r, color.g, color.b, color.a); + if (rlGetVersion() == OPENGL_11) + { + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(position.x, position.y); - rlVertex2i(position.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y + size.y); + rlVertex2i(position.x, position.y); + rlVertex2i(position.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y + size.y); - rlVertex2i(position.x, position.y); - rlVertex2i(position.x + size.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y); - rlEnd(); + rlVertex2i(position.x, position.y); + rlVertex2i(position.x + size.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y); + rlEnd(); + } + else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + { + // NOTE: This shape uses QUADS to avoid drawing order issues (view rlglDraw) + rlEnableTexture(whiteTexture); // Default white texture + + rlBegin(RL_QUADS); + rlColor4ub(color.r, color.g, color.b, color.a); + rlNormal3f(0.0f, 0.0f, 1.0f); + + rlTexCoord2f(0.0f, 0.0f); + rlVertex2f(position.x, position.y); + + rlTexCoord2f(0.0f, 1.0f); + rlVertex2f(position.x, position.y + size.y); + + rlTexCoord2f(1.0f, 1.0f); + rlVertex2f(position.x + size.x, position.y + size.y); + + rlTexCoord2f(1.0f, 0.0f); + rlVertex2f(position.x + size.x, position.y); + rlEnd(); + + rlDisableTexture(); + } } // Draw rectangle outline -- cgit v1.2.3 From 49df957058b2f602c7e6873fec0007fcd7a4dc4c Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 17 Mar 2016 12:54:36 +0100 Subject: Add support for multiple gamepads on RPI --- src/core.c | 102 +++++++++++++++++++++++++++++++++++------------------------ src/raylib.h | 8 ++--- 2 files changed, 65 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 5bb59faa..7d229324 100644 --- a/src/core.c +++ b/src/core.c @@ -116,9 +116,9 @@ #if defined(PLATFORM_RPI) // Old device inputs system - #define DEFAULT_KEYBOARD_DEV STDIN_FILENO // Standard input - #define DEFAULT_MOUSE_DEV "/dev/input/mouse0" - #define DEFAULT_GAMEPAD_DEV "/dev/input/js0" + #define DEFAULT_KEYBOARD_DEV STDIN_FILENO // Standard input + #define DEFAULT_MOUSE_DEV "/dev/input/mouse0" // Mouse input + #define DEFAULT_GAMEPAD_DEV "/dev/input/js" // Gamepad input (base dev for all gamepads: js0, js1, ...) // New device input events (evdev) (must be detected) //#define DEFAULT_KEYBOARD_DEV "/dev/input/eventN" @@ -126,8 +126,10 @@ //#define DEFAULT_GAMEPAD_DEV "/dev/input/eventN" #define MOUSE_SENSITIVITY 0.8f - #define MAX_GAMEPAD_BUTTONS 11 - #define MAX_GAMEPAD_AXIS 5 + + #define MAX_GAMEPADS 2 // Max number of gamepads supported + #define MAX_GAMEPAD_BUTTONS 11 // Max bumber of buttons supported (per gamepad) + #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) #endif //---------------------------------------------------------------------------------- @@ -164,12 +166,12 @@ static bool mouseReady = false; // Flag to know if mouse is read pthread_t mouseThreadId; // Mouse reading thread id // Gamepad input variables -static int gamepadStream = -1; // Gamepad device file descriptor -static bool gamepadReady = false; // Flag to know if gamepad is ready -pthread_t gamepadThreadId; // Gamepad reading thread id +static int gamepadStream[MAX_GAMEPADS] = { -1 }; // Gamepad device file descriptor (two gamepads supported) +static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready (two gamepads supported) +pthread_t gamepadThreadId; // Gamepad reading thread id -int gamepadButtons[MAX_GAMEPAD_BUTTONS]; -float gamepadAxisValues[MAX_GAMEPAD_AXIS]; +int gamepadButtons[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Gamepad buttons state +float gamepadAxisValues[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1168,7 +1170,7 @@ bool IsGamepadAvailable(int gamepad) bool result = false; #if defined(PLATFORM_RPI) - if (gamepadReady && (gamepad == 0)) result = true; + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true; #else if (glfwJoystickPresent(gamepad) == 1) result = true; #endif @@ -1182,7 +1184,10 @@ float GetGamepadAxisMovement(int gamepad, int axis) float value = 0; #if defined(PLATFORM_RPI) - if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisValues[axis]; + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) + { + if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisValues[gamepad][axis]; + } #else const float *axes; int axisCount = 0; @@ -1219,7 +1224,7 @@ bool IsGamepadButtonDown(int gamepad, int button) #if defined(PLATFORM_RPI) // Get gamepad buttons information - if ((gamepad == 0) && (gamepadButtons[button] == 1)) result = true; + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (gamepadButtons[gamepad][button] == 1)) result = true; else result = false; #else const unsigned char *buttons; @@ -1258,7 +1263,7 @@ bool IsGamepadButtonUp(int gamepad, int button) #if defined(PLATFORM_RPI) // Get gamepad buttons information - if ((gamepad == 0) && (gamepadButtons[button] == 0)) result = true; + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (gamepadButtons[gamepad][button] == 0)) result = true; else result = false; #else const unsigned char *buttons; @@ -2447,19 +2452,31 @@ static void *MouseThread(void *arg) // Init gamepad system static void InitGamepad(void) { - if ((gamepadStream = open(DEFAULT_GAMEPAD_DEV, O_RDONLY|O_NONBLOCK)) < 0) - { - TraceLog(WARNING, "Gamepad device could not be opened, no gamepad available"); - } - else + char gamepadDev[128] = ""; + + for (int i = 0; i < MAX_GAMEPADS; i++) { - gamepadReady = true; + sprintf(gamepadDev, "%s%i", DEFAULT_GAMEPAD_DEV, i); + + if ((gamepadStream[i] = open(gamepadDev, O_RDONLY|O_NONBLOCK)) < 0) + { + // NOTE: Only show message for first gamepad + if (i == 0) TraceLog(WARNING, "Gamepad device could not be opened, no gamepad available"); + } + else + { + gamepadReady[i] = true; - int error = pthread_create(&gamepadThreadId, NULL, &GamepadThread, NULL); + // NOTE: Only create one thread + if (i == 0) + { + int error = pthread_create(&gamepadThreadId, NULL, &GamepadThread, NULL); - if (error != 0) TraceLog(WARNING, "Error creating gamepad input event thread"); - else TraceLog(INFO, "Gamepad device initialized successfully"); - } + if (error != 0) TraceLog(WARNING, "Error creating gamepad input event thread"); + else TraceLog(INFO, "Gamepad device initialized successfully"); + } + } + } } // Process Gamepad (/dev/input/js0) @@ -2481,29 +2498,32 @@ static void *GamepadThread(void *arg) while (1) { - if (read(gamepadStream, &gamepadEvent, sizeof(struct js_event)) == (int)sizeof(struct js_event)) + for (int i = 0; i < MAX_GAMEPADS; i++) { - gamepadEvent.type &= ~JS_EVENT_INIT; // Ignore synthetic events - - // Process gamepad events by type - if (gamepadEvent.type == JS_EVENT_BUTTON) + if (read(gamepadStream[i], &gamepadEvent, sizeof(struct js_event)) == (int)sizeof(struct js_event)) { - TraceLog(DEBUG, "Gamepad button: %i, value: %i", gamepadEvent.number, gamepadEvent.value); + gamepadEvent.type &= ~JS_EVENT_INIT; // Ignore synthetic events - if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) + // Process gamepad events by type + if (gamepadEvent.type == JS_EVENT_BUTTON) { - // 1 - button pressed, 0 - button released - gamepadButtons[gamepadEvent.number] = (int)gamepadEvent.value; + TraceLog(DEBUG, "Gamepad button: %i, value: %i", gamepadEvent.number, gamepadEvent.value); + + if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) + { + // 1 - button pressed, 0 - button released + gamepadButtons[i][gamepadEvent.number] = (int)gamepadEvent.value; + } } - } - else if (gamepadEvent.type == JS_EVENT_AXIS) - { - TraceLog(DEBUG, "Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); - - if (gamepadEvent.number < MAX_GAMEPAD_AXIS) + else if (gamepadEvent.type == JS_EVENT_AXIS) { - // NOTE: Scaling of gamepadEvent.value to get values between -1..1 - gamepadAxisValues[gamepadEvent.number] = (float)gamepadEvent.value/32768; + TraceLog(DEBUG, "Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); + + if (gamepadEvent.number < MAX_GAMEPAD_AXIS) + { + // NOTE: Scaling of gamepadEvent.value to get values between -1..1 + gamepadAxisValues[i][gamepadEvent.number] = (float)gamepadEvent.value/32768; + } } } } diff --git a/src/raylib.h b/src/raylib.h index d891467e..a87b58da 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -174,8 +174,8 @@ // Gamepad Number #define GAMEPAD_PLAYER1 0 #define GAMEPAD_PLAYER2 1 -#define GAMEPAD_PLAYER3 2 -#define GAMEPAD_PLAYER4 3 +#define GAMEPAD_PLAYER3 2 // Not supported +#define GAMEPAD_PLAYER4 3 // Not supported // Gamepad Buttons // NOTE: Adjusted for a PS3 USB Controller @@ -201,8 +201,8 @@ #define GAMEPAD_XBOX_BUTTON_START 7 #if defined(PLATFORM_RPI) - #define GAMEPAD_XBOX_AXIS_DPAD_X 32 - #define GAMEPAD_XBOX_AXIS_DPAD_Y 64 + #define GAMEPAD_XBOX_AXIS_DPAD_X 7 + #define GAMEPAD_XBOX_AXIS_DPAD_Y 6 #define GAMEPAD_XBOX_AXIS_RIGHT_X 3 #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 #define GAMEPAD_XBOX_AXIS_LT 2 -- cgit v1.2.3 From e2ba22ec596757d62f8b22cf8b722d68040f23d3 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 17 Mar 2016 13:51:48 +0100 Subject: Improved 2D-3D drawing Depth test disabled for 2D and only used on 3D; consequently LINES vs TRIANGLES vs QUADS buffers drawing order maters... but blending also works ok. --- src/core.c | 4 +++ src/rlgl.c | 14 ++++++++++- src/rlgl.h | 2 ++ src/shapes.c | 80 +++++++++++++++++++++++++++++++++++++++++++----------------- 4 files changed, 76 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 7d229324..d27a031b 100644 --- a/src/core.c +++ b/src/core.c @@ -643,6 +643,8 @@ void Begin3dMode(Camera camera) // Setup Camera view Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); rlMultMatrixf(MatrixToFloat(matView)); // Multiply MODELVIEW matrix by view matrix (camera) + + rlEnableDepthTest(); // Enable DEPTH_TEST for 3D } // Ends 3D mode and returns to default 2D orthographic mode @@ -657,6 +659,8 @@ void End3dMode(void) rlLoadIdentity(); // Reset current matrix (MODELVIEW) //rlTranslatef(0.375, 0.375, 0); // HACK to ensure pixel-perfect drawing on OpenGL (after exiting 3D mode) + + rlDisableDepthTest(); // Disable DEPTH_TEST for 2D } // Set target FPS for the game diff --git a/src/rlgl.c b/src/rlgl.c index d9761732..f9722eda 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -780,6 +780,18 @@ void rlDisableTexture(void) #endif } +// Enable depth test +void rlEnableDepthTest(void) +{ + glEnable(GL_DEPTH_TEST); +} + +// Disable depth test +void rlDisableDepthTest(void) +{ + glDisable(GL_DEPTH_TEST); +} + // Unload texture from GPU memory void rlDeleteTextures(unsigned int id) { @@ -1579,7 +1591,7 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) //glClearDepth(1.0f); // Clear depth buffer (default) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear used buffers, depth buffer is used for 3D - glEnable(GL_DEPTH_TEST); // Enables depth testing (required for 3D) + glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) glDepthFunc(GL_LEQUAL); // Type of depth testing to apply glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) diff --git a/src/rlgl.h b/src/rlgl.h index 69640feb..7d50b67a 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -244,6 +244,8 @@ void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) //------------------------------------------------------------------------------------ void rlEnableTexture(unsigned int id); // Enable texture usage void rlDisableTexture(void); // Disable texture usage +void rlEnableDepthTest(void); // Enable depth test +void rlDisableDepthTest(void); // Disable depth test void rlDeleteTextures(unsigned int id); // Delete OpenGL texture from GPU void rlDeleteShader(unsigned int id); // Delete OpenGL shader program from GPU void rlDeleteVertexArrays(unsigned int id); // Unload vertex data (VAO) from GPU memory diff --git a/src/shapes.c b/src/shapes.c index 7e3b5634..14d11315 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -98,7 +98,7 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) // Draw a color-filled circle void DrawCircle(int centerX, int centerY, float radius, Color color) { - DrawPoly((Vector2){ centerX, centerY }, 36, radius, 0, color); + DrawCircleV((Vector2){ centerX, centerY }, radius, color); } // Draw a gradient-filled circle @@ -119,17 +119,40 @@ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Co } // Draw a color-filled circle (Vector version) +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) void DrawCircleV(Vector2 center, float radius, Color color) { - rlBegin(RL_TRIANGLES); - for (int i = 0; i < 360; i += 10) - { - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(center.x, center.y); - rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 10)) * radius, center.y + cos(DEG2RAD*(i + 10)) * radius); - } - rlEnd(); + if (rlGetVersion() == OPENGL_11) + { + rlBegin(RL_TRIANGLES); + for (int i = 0; i < 360; i += 10) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2i(center.x, center.y); + rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 10)) * radius, center.y + cos(DEG2RAD*(i + 10)) * radius); + } + rlEnd(); + } + else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + { + rlEnableTexture(whiteTexture); // Default white texture + + rlBegin(RL_QUADS); + for (int i = 0; i < 360; i += 20) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex2i(center.x, center.y); + rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 10)) * radius, center.y + cos(DEG2RAD*(i + 10)) * radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 20)) * radius, center.y + cos(DEG2RAD*(i + 20)) * radius); + } + rlEnd(); + + rlDisableTexture(); + } } // Draw circle outline @@ -178,6 +201,7 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo } // Draw a color-filled rectangle (Vector version) +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) void DrawRectangleV(Vector2 position, Vector2 size, Color color) { if (rlGetVersion() == OPENGL_11) @@ -196,7 +220,6 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color) } else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { - // NOTE: This shape uses QUADS to avoid drawing order issues (view rlglDraw) rlEnableTexture(whiteTexture); // Default white texture rlBegin(RL_QUADS); @@ -221,22 +244,33 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color) } // Draw rectangle outline +// NOTE: On OpenGL 3.3 and ES2 we use QUADS to avoid drawing order issues (view rlglDraw) void DrawRectangleLines(int posX, int posY, int width, int height, Color color) -{ - rlBegin(RL_LINES); - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(posX + 1, posY + 1); - rlVertex2i(posX + width, posY + 1); +{ + if (rlGetVersion() == OPENGL_11) + { + rlBegin(RL_LINES); + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2i(posX + 1, posY + 1); + rlVertex2i(posX + width, posY + 1); - rlVertex2i(posX + width, posY + 1); - rlVertex2i(posX + width, posY + height); + rlVertex2i(posX + width, posY + 1); + rlVertex2i(posX + width, posY + height); - rlVertex2i(posX + width, posY + height); - rlVertex2i(posX + 1, posY + height); + rlVertex2i(posX + width, posY + height); + rlVertex2i(posX + 1, posY + height); - rlVertex2i(posX + 1, posY + height); - rlVertex2i(posX + 1, posY + 1); - rlEnd(); + rlVertex2i(posX + 1, posY + height); + rlVertex2i(posX + 1, posY + 1); + rlEnd(); + } + else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + { + DrawRectangle(posX, posY, width, 1, color); + DrawRectangle(posX + width - 1, posY + 1, 1, height - 2, color); + DrawRectangle(posX, posY + height - 1, width, 1, color); + DrawRectangle(posX, posY + 1, 1, height - 2, color); + } } // Draw a triangle -- cgit v1.2.3 From 5e45c3c824b61abd94525c1dcd08abc5a10dc613 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 Mar 2016 13:39:27 +0100 Subject: Redesign to work as standalone Redesigned to work as standalone and support fordward-compatible context (shaders review) --- src/rlgl.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- src/rlgl.h | 6 +++++- 2 files changed, 52 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index f9722eda..b6a179d6 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -32,7 +32,9 @@ #include // Declares malloc() and free() for memory management, rand() #include // Declares strcmp(), strlen(), strtok() -#include "raymath.h" // Required for Vector3 and Matrix functions +#ifndef RLGL_STANDALONE + #include "raymath.h" // Required for Vector3 and Matrix functions +#endif #if defined(GRAPHICS_API_OPENGL_11) #ifdef __APPLE__ // OpenGL include for OSX @@ -298,6 +300,7 @@ static pixel *GenNextMipmap(pixel *srcData, int srcWidth, int srcHeight); #if defined(RLGL_STANDALONE) static void TraceLog(int msgType, const char *text, ...); +float *MatrixToFloat(Matrix mat); // Converts Matrix to float array #endif #if defined(GRAPHICS_API_OPENGL_ES2) @@ -2581,6 +2584,7 @@ static Shader LoadDefaultShader(void) char fShaderStr[] = "#version 330 \n" "in vec2 fragTexCoord; \n" "in vec4 fragTintColor; \n" + "out vec4 fragColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char fShaderStr[] = "#version 100 \n" "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) @@ -2590,8 +2594,13 @@ static Shader LoadDefaultShader(void) "uniform sampler2D texture0; \n" "void main() \n" "{ \n" - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0, use texture() instead - " gl_FragColor = texelColor*fragTintColor; \n" +#if defined(GRAPHICS_API_OPENGL_33) + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " fragColor = texelColor*fragTintColor; \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 + " gl_FragColor = texelColor*fragTintColor; \n" +#endif "} \n"; shader.id = LoadShaderProgram(vShaderStr, fShaderStr); @@ -2651,6 +2660,7 @@ static Shader LoadSimpleShader(void) #if defined(GRAPHICS_API_OPENGL_33) char fShaderStr[] = "#version 330 \n" "in vec2 fragTexCoord; \n" + "out vec4 fragColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char fShaderStr[] = "#version 100 \n" "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) @@ -2660,8 +2670,13 @@ static Shader LoadSimpleShader(void) "uniform vec4 fragTintColor; \n" "void main() \n" "{ \n" - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0, use texture() instead +#if defined(GRAPHICS_API_OPENGL_33) + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " fragColor = texelColor*fragTintColor; \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" " gl_FragColor = texelColor*fragTintColor; \n" +#endif "} \n"; shader.id = LoadShaderProgram(vShaderStr, fShaderStr); @@ -3102,4 +3117,32 @@ static void TraceLog(int msgType, const char *text, ...) if (msgType == ERROR) exit(1); } + +// Converts Matrix to float array +// NOTE: Returned vector is a transposed version of the Matrix struct, +// it should be this way because, despite raymath use OpenGL column-major convention, +// Matrix struct memory alignment and variables naming are not coherent +float *MatrixToFloat(Matrix mat) +{ + static float buffer[16]; + + buffer[0] = mat.m0; + buffer[1] = mat.m4; + buffer[2] = mat.m8; + buffer[3] = mat.m12; + buffer[4] = mat.m1; + buffer[5] = mat.m5; + buffer[6] = mat.m9; + buffer[7] = mat.m13; + buffer[8] = mat.m2; + buffer[9] = mat.m6; + buffer[10] = mat.m10; + buffer[11] = mat.m14; + buffer[12] = mat.m3; + buffer[13] = mat.m7; + buffer[14] = mat.m11; + buffer[15] = mat.m15; + + return buffer; +} #endif diff --git a/src/rlgl.h b/src/rlgl.h index 7d50b67a..1a5260eb 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -36,7 +36,11 @@ #include "utils.h" // Required for function TraceLog() #endif -#include "raymath.h" +#ifdef RLGL_STANDALONE + #define RAYMATH_STANDALONE +#endif + +#include "raymath.h" // Required for types: Vector3, Matrix // Select desired OpenGL version // NOTE: Those preprocessor defines are only used on rlgl module, -- cgit v1.2.3 From ebc2b9a286b07f551689f13fc82367c93e7c3ade Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 Mar 2016 14:20:42 +0100 Subject: Improved windows resizing system... ...despite not being enabled on GLFW3 --- src/core.c | 17 ++++++++++------- src/rlgl.c | 15 +++++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index d27a031b..c8d78133 100644 --- a/src/core.c +++ b/src/core.c @@ -1488,11 +1488,11 @@ static void InitDisplay(int width, int height) TraceLog(INFO, "Viewport offsets: %i, %i", renderOffsetX, renderOffsetY); } - glfwSetWindowSizeCallback(window, WindowSizeCallback); + glfwSetWindowSizeCallback(window, WindowSizeCallback); // NOTE: Resizing not allowed by default! glfwSetCursorEnterCallback(window, CursorEnterCallback); glfwSetKeyCallback(window, KeyCallback); glfwSetMouseButtonCallback(window, MouseButtonCallback); - glfwSetCursorPosCallback(window, MouseCursorPosCallback); // Track mouse position changes + glfwSetCursorPosCallback(window, MouseCursorPosCallback); // Track mouse position changes glfwSetCharCallback(window, CharCallback); glfwSetScrollCallback(window, ScrollCallback); glfwSetWindowIconifyCallback(window, WindowIconifyCallback); @@ -1818,16 +1818,19 @@ static void CursorEnterCallback(GLFWwindow *window, int enter) } // GLFW3 WindowSize Callback, runs when window is resized +// NOTE: Window resizing not allowed by default static void WindowSizeCallback(GLFWwindow *window, int width, int height) { // If window is resized, graphics device is re-initialized (but only ortho mode) - rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); + rlglInitGraphics(0, 0, width, height); // Window size must be updated to be used on 3D mode to get new aspect ratio (Begin3dMode()) - //screenWidth = width; - //screenHeight = height; - - // TODO: Update render size? + screenWidth = width; + screenHeight = height; + renderWidth = width; + renderHeight = height; + + // NOTE: Postprocessing texture is not scaled to new size // Background must be also re-cleared ClearBackground(RAYWHITE); diff --git a/src/rlgl.c b/src/rlgl.c index b6a179d6..fc14a0af 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -188,6 +188,8 @@ typedef struct { // Framebuffer Object type typedef struct { GLuint id; + int width; + int height; GLuint colorTextureId; GLuint depthTextureId; } FBO; @@ -1071,8 +1073,8 @@ void rlglInitPostpro(void) quad.vertexCount = 6; - float w = (float)screenWidth; - float h = (float)screenHeight; + float w = (float)postproFbo.width; + float h = (float)postproFbo.height; float quadPositions[6*3] = { w, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, h, 0.0f, 0.0f, h, 0.0f, w, h, 0.0f, w, 0.0f, 0.0f }; float quadTexcoords[6*2] = { 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f }; @@ -1096,6 +1098,8 @@ FBO rlglLoadFBO(int width, int height) { FBO fbo; fbo.id = 0; + fbo.width = width; + fbo.height = height; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Create the texture that will serve as the color attachment for the framebuffer @@ -2339,22 +2343,21 @@ void SetCustomShader(Shader shader) } // Set postprocessing shader -// NOTE: Uses global variables screenWidth and screenHeight void SetPostproShader(Shader shader) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (!enabledPostpro) { enabledPostpro = true; - rlglInitPostpro(); + rlglInitPostpro(); // Lazy initialization on postprocessing usage } SetModelShader(&postproQuad, shader); Texture2D texture; texture.id = postproFbo.colorTextureId; - texture.width = screenWidth; - texture.height = screenHeight; + texture.width = postproFbo.width; + texture.height = postproFbo.height; postproQuad.material.texDiffuse = texture; -- cgit v1.2.3 From fa78023aa427e0c6e5a25e82102b296c51c24fe4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 Mar 2016 16:28:59 +0100 Subject: Understand mouse as touch in web --- src/core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index c8d78133..609da64e 100644 --- a/src/core.c +++ b/src/core.c @@ -1793,6 +1793,8 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) // Register touch points position, only one point registered gestureEvent.position[0] = (Vector2){ (float)x, (float)y }; + touchPosition[0] = gestureEvent.position[0]; + // Normalize gestureEvent.position[0] for screenWidth and screenHeight gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); -- cgit v1.2.3 From 584e74c6765b63cf6b618f3c38214c3d49322cc2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 20 Mar 2016 16:48:23 +0100 Subject: Corrected bug on touch position --- src/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 609da64e..37d4a0bf 100644 --- a/src/core.c +++ b/src/core.c @@ -193,9 +193,7 @@ static int renderOffsetY = 0; // Offset Y from render area (must b static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size) -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen -#endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... @@ -1786,6 +1784,9 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) GestureEvent gestureEvent; gestureEvent.touchAction = TOUCH_MOVE; + + // Assign a pointer ID + gestureEvent.pointerId[0] = 0; // Register touch points count gestureEvent.pointCount = 1; -- cgit v1.2.3 From 269b120104f468df5f0f00ac3a173770aa5bf09f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 21 Mar 2016 20:15:11 +0100 Subject: Review Android button inputs --- src/core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 37d4a0bf..c05de93b 100644 --- a/src/core.c +++ b/src/core.c @@ -146,10 +146,12 @@ static bool windowMinimized = false; #elif defined(PLATFORM_ANDROID) static struct android_app *app; // Android activity static struct android_poll_source *source; // Android events polling source -static int ident, events; +static int ident, events; // Android ALooper_pollAll() variables + static bool windowReady = false; // Used to detect display initialization static bool appEnabled = true; // Used to detec if app is active static bool contextRebindRequired = false; // Used to know context rebind required + static int previousButtonState[128] = { 1 }; // Required to check if button pressed/released once static int currentButtonState[128] = { 1 }; // Required to check if button pressed/released once #elif defined(PLATFORM_RPI) @@ -401,13 +403,6 @@ void InitWindow(int width, int height, struct android_app *state) TraceLog(INFO, "Android app initialized successfully"); - // Init button states values (default up) - for(int i = 0; i < 128; i++) - { - currentButtonState[i] = 1; - previousButtonState[i] = 1; - } - // Wait for window to be initialized (display and context) while (!windowReady) { -- cgit v1.2.3 From 60223a358b691c2769c362597c49e124b045209c Mon Sep 17 00:00:00 2001 From: victorfisac Date: Wed, 23 Mar 2016 15:50:41 +0100 Subject: Physac redesign (3/3) Finally, physics update is handled in main thread using steps to get accuracy in collisions detection instead of moving it to a new thread. Examples are finished as simple and clear as I could. Finally, physac module is MORE simpler than in the first version, calculation everything by the same way for both types of physic objects. I tryed to add rotated physics a couple of times but I didn't get anything good to get a base to improve it. Maybe for the next version... No bugs or strange behaviours found during testing. --- src/physac.c | 49 ++++++++++++++++++++++++++----------------------- src/physac.h | 6 +++--- src/raylib.h | 4 ++-- 3 files changed, 31 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index 718a06bb..e3f956ba 100644 --- a/src/physac.c +++ b/src/physac.c @@ -2,7 +2,7 @@ * * [physac] raylib physics module - Basic functions to apply physics to 2D objects * -* Copyright (c) 2015 Victor Fisac and Ramon Santamaria +* Copyright (c) 2016 Victor Fisac and Ramon Santamaria * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -75,10 +75,7 @@ void InitPhysics(Vector2 gravity) void UpdatePhysics() { // Reset all physic objects is grounded state - for (int i = 0; i < physicObjectsCount; i++) - { - if (physicObjects[i]->rigidbody.enabled) physicObjects[i]->rigidbody.isGrounded = false; - } + for (int i = 0; i < physicObjectsCount; i++) physicObjects[i]->rigidbody.isGrounded = false; for (int steps = 0; steps < PHYSICS_STEPS; steps++) { @@ -537,26 +534,32 @@ void ApplyForceAtPosition(Vector2 position, float force, float radius) { for(int i = 0; i < physicObjectsCount; i++) { - // Calculate direction and distance between force and physic object pposition - Vector2 distance = (Vector2){ physicObjects[i]->transform.position.x - position.x, physicObjects[i]->transform.position.y - position.y }; - - if(physicObjects[i]->collider.type == COLLIDER_RECTANGLE) + if(physicObjects[i]->rigidbody.enabled) { - distance.x += physicObjects[i]->transform.scale.x/2; - distance.y += physicObjects[i]->transform.scale.y/2; - } - - float distanceLength = Vector2Length(distance); - - // Check if physic object is in force range - if(distanceLength <= radius) - { - // Normalize force direction - distance.x /= distanceLength; - distance.y /= -distanceLength; + // Calculate direction and distance between force and physic object pposition + Vector2 distance = (Vector2){ physicObjects[i]->transform.position.x - position.x, physicObjects[i]->transform.position.y - position.y }; + + if(physicObjects[i]->collider.type == COLLIDER_RECTANGLE) + { + distance.x += physicObjects[i]->transform.scale.x/2; + distance.y += physicObjects[i]->transform.scale.y/2; + } + + float distanceLength = Vector2Length(distance); - // Apply force to the physic object - ApplyForce(physicObjects[i], (Vector2){ distance.x*force, distance.y*force }); + // Check if physic object is in force range + if(distanceLength <= radius) + { + // Normalize force direction + distance.x /= distanceLength; + distance.y /= -distanceLength; + + // Calculate final force + Vector2 finalForce = { distance.x*force, distance.y*force }; + + // Apply force to the physic object + ApplyForce(physicObjects[i], finalForce); + } } } } diff --git a/src/physac.h b/src/physac.h index c70dbbe2..37544686 100644 --- a/src/physac.h +++ b/src/physac.h @@ -2,7 +2,7 @@ * * [physac] raylib physics module - Basic functions to apply physics to 2D objects * -* Copyright (c) 2015 Victor Fisac and Ramon Santamaria +* Copyright (c) 2016 Victor Fisac and Ramon Santamaria * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -44,8 +44,8 @@ typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; typedef struct Transform { Vector2 position; - float rotation; - Vector2 scale; + float rotation; // Radians (not used) + Vector2 scale; // Just for rectangle physic objects, for circle physic objects use collider radius and keep scale as { 0, 0 } } Transform; typedef struct Rigidbody { diff --git a/src/raylib.h b/src/raylib.h index a87b58da..1782fef3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -498,8 +498,8 @@ typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; typedef struct Transform { Vector2 position; - float rotation; - Vector2 scale; + float rotation; // Radians (not used) + Vector2 scale; // Just for rectangle physic objects, for circle physic objects use collider radius and keep scale as { 0, 0 } } Transform; typedef struct Rigidbody { -- cgit v1.2.3 From ea7afc8ec835040d84d79ae318f7aebb9f1e189c Mon Sep 17 00:00:00 2001 From: victorfisac Date: Wed, 23 Mar 2016 22:47:39 +0100 Subject: Fix spacing and some comments --- src/physac.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index e3f956ba..ed707474 100644 --- a/src/physac.c +++ b/src/physac.c @@ -30,13 +30,13 @@ #endif #include // Declares malloc() and free() for memory management -#include // abs() and fminf() +#include // Declares cos(), sin(), abs() and fminf() for math operations //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_PHYSIC_OBJECTS 256 -#define PHYSICS_STEPS 450 +#define MAX_PHYSIC_OBJECTS 256 // Maximum available physic object slots in objects pool +#define PHYSICS_STEPS 450 // Physics update steps number (divided calculations in steps per frame) to get more accurately collisions detections #define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) #define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix @@ -145,11 +145,11 @@ void UpdatePhysics() Vector2 direction = { 0.0f, 0.0f }; float penetrationDepth = 0.0f; - switch(physicObjects[i]->collider.type) + switch (physicObjects[i]->collider.type) { case COLLIDER_RECTANGLE: { - switch(physicObjects[k]->collider.type) + switch (physicObjects[k]->collider.type) { case COLLIDER_RECTANGLE: { @@ -266,7 +266,7 @@ void UpdatePhysics() } break; case COLLIDER_CIRCLE: { - switch(physicObjects[k]->collider.type) + switch (physicObjects[k]->collider.type) { case COLLIDER_RECTANGLE: { @@ -532,14 +532,14 @@ void ApplyForce(PhysicObject *pObj, Vector2 force) // Apply radial force to all physic objects in range void ApplyForceAtPosition(Vector2 position, float force, float radius) { - for(int i = 0; i < physicObjectsCount; i++) + for (int i = 0; i < physicObjectsCount; i++) { - if(physicObjects[i]->rigidbody.enabled) + if (physicObjects[i]->rigidbody.enabled) { // Calculate direction and distance between force and physic object pposition Vector2 distance = (Vector2){ physicObjects[i]->transform.position.x - position.x, physicObjects[i]->transform.position.y - position.y }; - if(physicObjects[i]->collider.type == COLLIDER_RECTANGLE) + if (physicObjects[i]->collider.type == COLLIDER_RECTANGLE) { distance.x += physicObjects[i]->transform.scale.x/2; distance.y += physicObjects[i]->transform.scale.y/2; @@ -548,7 +548,7 @@ void ApplyForceAtPosition(Vector2 position, float force, float radius) float distanceLength = Vector2Length(distance); // Check if physic object is in force range - if(distanceLength <= radius) + if (distanceLength <= radius) { // Normalize force direction distance.x /= distanceLength; -- cgit v1.2.3 From 8b7ca8b670a0f338fef85125311522833b945bf7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 27 Mar 2016 18:32:36 +0200 Subject: Review comments --- src/raylib.h | 20 ++++++++++---------- src/textures.c | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 1782fef3..2b65df9e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib 1.4.0 (www.raylib.com) +* raylib 1.5.0 (www.raylib.com) * * A simple and easy-to-use library to learn videogames programming * @@ -345,8 +345,8 @@ typedef struct Camera { // Camera2D type, defines a 2d camera typedef struct Camera2D { - Vector2 position; // Camera position - Vector2 origin; // Camera origin (for rotation and zoom) + Vector2 offset; // Camera offset (displacement from target) + Vector2 target; // Camera target (for rotation and zoom) float rotation; // Camera rotation in degrees float zoom; // Camera zoom (scaling), should be 1.0f by default } Camera2D; @@ -375,7 +375,7 @@ typedef struct Mesh { // Shader type (generic shader) typedef struct Shader { - unsigned int id; // Shader program id + unsigned int id; // Shader program id // Variable attributes int vertexLoc; // Vertex attribute location point (vertex shader) @@ -411,9 +411,9 @@ typedef struct Material { // 3d Model type // TODO: Replace shader/testure by material typedef struct Model { - Mesh mesh; - Matrix transform; - Material material; + Mesh mesh; // Vertex data buffers (RAM and VRAM) + Matrix transform; // Local transform matrix + Material material; // Shader and textures data } Model; // Ray type (useful for raycast) @@ -432,8 +432,8 @@ typedef struct Sound { typedef struct Wave { void *data; // Buffer data pointer unsigned int dataSize; // Data size in bytes - unsigned int sampleRate; - short bitsPerSample; + unsigned int sampleRate; // Samples per second to be played + short bitsPerSample; // Sample size in bits short channels; } Wave; @@ -484,7 +484,7 @@ typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction; // Gesture events // NOTE: MAX_TOUCH_POINTS fixed to 2 -typedef struct { +typedef struct GestureEvent { int touchAction; int pointCount; int pointerId[MAX_TOUCH_POINTS]; diff --git a/src/textures.c b/src/textures.c index e649df57..9d0d13b6 100644 --- a/src/textures.c +++ b/src/textures.c @@ -29,21 +29,21 @@ #include "raylib.h" -#include // Declares malloc() and free() for memory management -#include // Required for strcmp(), strrchr(), strncmp() +#include // Declares malloc() and free() for memory management +#include // Required for strcmp(), strrchr(), strncmp() -#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2 - // Required: rlglLoadTexture() rlDeleteTextures(), - // rlglGenerateMipmaps(), some funcs for DrawTexturePro() +#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2 + // Required: rlglLoadTexture() rlDeleteTextures(), + // rlglGenerateMipmaps(), some funcs for DrawTexturePro() -#include "utils.h" // rRES data decompression utility function - // NOTE: Includes Android fopen function map +#include "utils.h" // rRES data decompression utility function + // NOTE: Includes Android fopen function map #define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" // Used to read image data (multiple formats support) +#include "stb_image.h" // Used to read image data (multiple formats support) #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "stb_image_resize.h" +#include "stb_image_resize.h" // Used on image scaling function: ImageResize() //---------------------------------------------------------------------------------- // Defines and Macros @@ -130,6 +130,7 @@ Image LoadImage(const char *fileName) } // Load image data from Color array data (RGBA - 32bit) +// NOTE: Creates a copy of pixels data array Image LoadImageEx(Color *pixels, int width, int height) { Image image; -- cgit v1.2.3 From 956a6e6f7713a19e746497efb9e909ba88be9c3d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 27 Mar 2016 18:33:30 +0200 Subject: Corrected bug and comments on model unloading --- src/models.c | 5 ++--- src/rlgl.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a1590424..52c68f9b 100644 --- a/src/models.c +++ b/src/models.c @@ -608,6 +608,8 @@ void UnloadModel(Model model) //if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); // Not used //if (model.mesh.tangents != NULL) free(model.mesh.tangents); // Not used + TraceLog(INFO, "Unloaded model data from RAM (CPU)"); + rlDeleteBuffers(model.mesh.vboId[0]); // vertex rlDeleteBuffers(model.mesh.vboId[1]); // texcoords rlDeleteBuffers(model.mesh.vboId[2]); // normals @@ -616,9 +618,6 @@ void UnloadModel(Model model) //rlDeleteBuffers(model.mesh.vboId[5]); // colors (NOT USED) rlDeleteVertexArrays(model.mesh.vaoId); - - if (model.mesh.vaoId > 0) TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vaoId); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Unloaded model data from VRAM (GPU)", model.mesh.vboId[0], model.mesh.vboId[1], model.mesh.vboId[2]); } // Link a texture to a model diff --git a/src/rlgl.c b/src/rlgl.c index fc14a0af..39a34095 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -823,7 +823,11 @@ void rlDeleteShader(unsigned int id) void rlDeleteVertexArrays(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (vaoSupported) glDeleteVertexArrays(1, &id); + if (vaoSupported) + { + glDeleteVertexArrays(1, &id); + TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", id); + } #endif } @@ -832,6 +836,8 @@ void rlDeleteBuffers(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glDeleteBuffers(1, &id); + + if (!vaoSupported) TraceLog(INFO, "[VBO ID %i] Unloaded model vertex data from VRAM (GPU)", id); #endif } @@ -1139,7 +1145,7 @@ FBO rlglLoadFBO(int width, int height) GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - if (status != GL_FRAMEBUFFER_COMPLETE) + if (status != GL_FRAMEBUFFER_COMPLETE) { TraceLog(WARNING, "Framebuffer object could not be created..."); @@ -1238,12 +1244,6 @@ void rlglClose(void) rlglUnloadFBO(postproFbo); // Unload postpro quad model data -#if defined(GRAPHICS_API_OPENGL_11) - free(postproQuad.mesh.vertices); - free(postproQuad.mesh.texcoords); - free(postproQuad.mesh.normals); -#endif - rlDeleteBuffers(postproQuad.mesh.vboId[0]); rlDeleteBuffers(postproQuad.mesh.vboId[1]); rlDeleteBuffers(postproQuad.mesh.vboId[2]); @@ -1907,7 +1907,7 @@ void rlglGenerateMipmaps(Texture2D texture) TraceLog(WARNING, "[TEX ID %i] Mipmaps generated manually on CPU side", texture.id); // NOTE: Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data - free(data): + free(data); #elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically -- cgit v1.2.3 From a3f16c84594a4811219892e444350d7d3441a6ae Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 27 Mar 2016 18:33:54 +0200 Subject: Improved 2d camera system -IN PROGRESS- --- src/core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index c05de93b..2ab39ab0 100644 --- a/src/core.c +++ b/src/core.c @@ -560,14 +560,14 @@ void BeginDrawingEx(Camera2D camera) { BeginDrawing(); - // TODO: Consider origin offset on position, rotation, scaling - + // Camera rotation and scaling is always relative to target + Matrix matOrigin = MatrixTranslate(-camera.target.x, -camera.target.y, 0.0f); Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); - Matrix matTranslation = MatrixTranslate(camera.position.x, camera.position.y, 0.0f); - Matrix matOrigin = MatrixTranslate(-camera.origin.x, -camera.origin.y, 0.0f); + + Matrix matTranslation = MatrixTranslate(camera.offset.x + camera.target.x, camera.offset.y + camera.target.y, 0.0f); - Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); + Matrix matTransform = MatrixMultiply(MatrixMultiply(matOrigin, MatrixMultiply(matScale, matRotation)), matTranslation); rlMultMatrixf(MatrixToFloat(matTransform)); } -- cgit v1.2.3 From 136408d8b8b096f23953aba3d81b3fbeccdc2680 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 27 Mar 2016 19:42:57 +0200 Subject: Corrected bug on bounding box if mesh is not loaded properly it breaks the game! --- src/models.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 52c68f9b..a515dd86 100644 --- a/src/models.c +++ b/src/models.c @@ -1328,13 +1328,19 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box) BoundingBox CalculateBoundingBox(Mesh mesh) { // Get min and max vertex to construct bounds (AABB) - Vector3 minVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; - Vector3 maxVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; + Vector3 minVertex = { 0 }; + Vector3 maxVertex = { 0 }; - for (int i = 1; i < mesh.vertexCount; i++) + if (mesh.vertices != NULL) { - minVertex = VectorMin(minVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); - maxVertex = VectorMax(maxVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); + minVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; + maxVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; + + for (int i = 1; i < mesh.vertexCount; i++) + { + minVertex = VectorMin(minVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); + maxVertex = VectorMax(maxVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); + } } // Create the bounding box -- cgit v1.2.3 From 1136d4222f81524c10b2319b325fcf1282bc6ec1 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 28 Mar 2016 01:18:40 +0200 Subject: Setting up for raylib 1.5.0 --- src/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 2ab39ab0..5150389c 100644 --- a/src/core.c +++ b/src/core.c @@ -304,7 +304,7 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent // Initialize Window and Graphics Context (OpenGL) void InitWindow(int width, int height, const char *title) { - TraceLog(INFO, "Initializing raylib (v1.4.0)"); + TraceLog(INFO, "Initializing raylib (v1.5.0)"); // Store window title (could be useful...) windowTitle = title; @@ -360,7 +360,7 @@ void InitWindow(int width, int height, const char *title) // Android activity initialization void InitWindow(int width, int height, struct android_app *state) { - TraceLog(INFO, "Initializing raylib (v1.4.0)"); + TraceLog(INFO, "Initializing raylib (v1.5.0)"); app_dummy(); -- cgit v1.2.3 From 66b096d97848eb096a043781f1f305e7189f2a00 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 30 Mar 2016 20:09:16 +0200 Subject: Added support for render to texture (use RenderTexture2D) Now it's possible to render to texture, old postprocessing system will be removed on next raylib version. --- src/core.c | 22 ++++++++++- src/raylib.h | 11 ++++++ src/rlgl.c | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/rlgl.h | 11 ++++++ src/textures.c | 19 ++++++++++ 5 files changed, 179 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 5150389c..5a794376 100644 --- a/src/core.c +++ b/src/core.c @@ -545,7 +545,7 @@ void BeginDrawing(void) if (IsPosproShaderEnabled()) rlEnablePostproFBO(); - rlClearScreenBuffers(); + rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -656,6 +656,26 @@ void End3dMode(void) rlDisableDepthTest(); // Disable DEPTH_TEST for 2D } +// Initializes render texture for drawing +void BeginTextureMode(RenderTexture2D target) +{ + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + rlEnableRenderTexture(target.id); + + rlClearScreenBuffers(); // Clear render texture buffers + + rlLoadIdentity(); // Reset current matrix (MODELVIEW) +} + +// Ends drawing to render texture +void EndTextureMode(void) +{ + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + rlDisableRenderTexture(); +} + // Set target FPS for the game void SetTargetFPS(int fps) { diff --git a/src/raylib.h b/src/raylib.h index 2b65df9e..c8f2c2a2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -324,6 +324,13 @@ typedef struct Texture2D { int format; // Data format (TextureFormat) } Texture2D; +// RenderTexture2D type, for texture rendering +typedef struct RenderTexture2D { + unsigned int id; // Render texture (fbo) id + Texture2D texture; // Color buffer attachment texture + Texture2D depth; // Depth buffer attachment texture +} RenderTexture2D; + // SpriteFont type, includes texture and charSet array data typedef struct SpriteFont { Texture2D texture; // Font texture @@ -565,6 +572,8 @@ void EndDrawing(void); // End canvas drawin void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode +void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing +void EndTextureMode(void); // Ends drawing to render texture Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position Vector2 WorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position @@ -714,8 +723,10 @@ Texture2D LoadTexture(const char *fileName); Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); // Load a texture from raw data into GPU memory Texture2D LoadTextureFromRES(const char *rresName, int resId); // Load an image as texture from rRES file (raylib Resource) Texture2D LoadTextureFromImage(Image image); // Load a texture from image data +RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering void UnloadImage(Image image); // Unload image from CPU memory (RAM) void UnloadTexture(Texture2D texture); // Unload texture from GPU memory +void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory Color *GetImageData(Image image); // Get pixel data from image as a Color struct array Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) diff --git a/src/rlgl.c b/src/rlgl.c index 39a34095..2153221e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -785,6 +785,20 @@ void rlDisableTexture(void) #endif } +void rlEnableRenderTexture(unsigned int id) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindFramebuffer(GL_FRAMEBUFFER, id); +#endif +} + +void rlDisableRenderTexture(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif +} + // Enable depth test void rlEnableDepthTest(void) { @@ -803,6 +817,16 @@ void rlDeleteTextures(unsigned int id) glDeleteTextures(1, &id); } +// Unload render texture from GPU memory +void rlDeleteRenderTextures(RenderTexture2D target) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glDeleteFramebuffers(1, &target.id); + glDeleteTextures(1, &target.texture.id); + glDeleteTextures(1, &target.depth.id); +#endif +} + // Enable rendering to postprocessing FBO void rlEnablePostproFBO() { @@ -1163,7 +1187,7 @@ FBO rlglLoadFBO(int width, int height) glDeleteTextures(1, &fbo.colorTextureId); glDeleteTextures(1, &fbo.depthTextureId); } - else TraceLog(INFO, "[FBO ID %i] Framebuffer object created successfully", fbo); + else TraceLog(INFO, "[FBO ID %i] Framebuffer object created successfully", fbo.id); glBindFramebuffer(GL_FRAMEBUFFER, 0); #endif @@ -1833,6 +1857,98 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma return id; } +// Load a texture to be used for rendering (fbo with color and depth attachments) +RenderTexture2D rlglLoadRenderTexture(int width, int height) +{ + RenderTexture2D target; + + target.id = 0; + + target.texture.id = 0; + target.texture.width = width; + target.texture.height = height; + target.texture.format = UNCOMPRESSED_R8G8B8; + target.texture.mipmaps = 1; + + target.depth.id = 0; + target.depth.width = width; + target.depth.height = height; + target.depth.format = 19; //DEPTH_COMPONENT_16BIT + target.depth.mipmaps = 1; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + // Create the texture that will serve as the color attachment for the framebuffer + glGenTextures(1, &target.texture.id); + glBindTexture(GL_TEXTURE_2D, target.texture.id); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + glBindTexture(GL_TEXTURE_2D, 0); + +#define USE_DEPTH_RENDERBUFFER +#if defined(USE_DEPTH_RENDERBUFFER) + // Create the renderbuffer that will serve as the depth attachment for the framebuffer. + glGenRenderbuffers(1, &target.depth.id); + glBindRenderbuffer(GL_RENDERBUFFER, target.depth.id); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height); + +#elif defined(USE_DEPTH_TEXTURE) + // NOTE: We can also use a texture for depth buffer (GL_ARB_depth_texture/GL_OES_depth_texture extension required) + // A renderbuffer is simpler than a texture and could offer better performance on embedded devices + glGenTextures(1, &target.depth.id); + glBindTexture(GL_TEXTURE_2D, target.depth.id); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); + glBindTexture(GL_TEXTURE_2D, 0); +#endif + + // Create the framebuffer object + glGenFramebuffers(1, &target.id); + glBindFramebuffer(GL_FRAMEBUFFER, target.id); + + // Attach color texture and depth renderbuffer to FBO + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, target.texture.id, 0); +#if defined(USE_DEPTH_RENDERBUFFER) + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, target.depth.id); +#elif defined(USE_DEPTH_TEXTURE) + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, target.depth.id, 0); +#endif + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + + if (status != GL_FRAMEBUFFER_COMPLETE) + { + TraceLog(WARNING, "Framebuffer object could not be created..."); + + switch(status) + { + case GL_FRAMEBUFFER_UNSUPPORTED: TraceLog(WARNING, "Framebuffer is unsupported"); break; + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete attachment"); break; +#if defined(GRAPHICS_API_OPENGL_ES2) + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: TraceLog(WARNING, "Framebuffer incomplete dimensions"); break; +#endif + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete missing attachment"); break; + default: break; + } + + glDeleteTextures(1, &target.texture.id); + glDeleteTextures(1, &target.depth.id); + glDeleteFramebuffers(1, &target.id); + } + else TraceLog(INFO, "[FBO ID %i] Framebuffer object created successfully", target.id); + + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif + + return target; +} + +// Update already loaded texture in GPU with new data void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data) { glBindTexture(GL_TEXTURE_2D, id); diff --git a/src/rlgl.h b/src/rlgl.h index 1a5260eb..679cb590 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -183,6 +183,13 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; int format; // Data format (TextureFormat) } Texture2D; + // RenderTexture2D type, for texture rendering + typedef struct RenderTexture2D { + unsigned int id; // Render texture (fbo) id + Texture2D texture; // Color buffer attachment texture + Texture2D depth; // Depth buffer attachment texture + } RenderTexture2D; + // Material type typedef struct Material { Shader shader; @@ -248,9 +255,12 @@ void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) //------------------------------------------------------------------------------------ void rlEnableTexture(unsigned int id); // Enable texture usage void rlDisableTexture(void); // Disable texture usage +void rlEnableRenderTexture(unsigned int id); // Enable render texture (fbo) +void rlDisableRenderTexture(void); // Disable render texture (fbo), return to default framebuffer void rlEnableDepthTest(void); // Enable depth test void rlDisableDepthTest(void); // Disable depth test void rlDeleteTextures(unsigned int id); // Delete OpenGL texture from GPU +void rlDeleteRenderTextures(RenderTexture2D target); // Delete render textures (fbo) from GPU void rlDeleteShader(unsigned int id); // Delete OpenGL shader program from GPU void rlDeleteVertexArrays(unsigned int id); // Unload vertex data (VAO) from GPU memory void rlDeleteBuffers(unsigned int id); // Unload vertex data (VBO) from GPU memory @@ -268,6 +278,7 @@ void rlglDraw(void); // Draw VAO/VBO void rlglInitGraphics(int offsetX, int offsetY, int width, int height); // Initialize Graphics (OpenGL stuff) unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU +RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data void rlglGenerateMipmaps(Texture2D texture); // Generate mipmap data for selected texture diff --git a/src/textures.c b/src/textures.c index 9d0d13b6..67264afb 100644 --- a/src/textures.c +++ b/src/textures.c @@ -389,6 +389,14 @@ Texture2D LoadTextureFromImage(Image image) return texture; } +// Load a texture to be used for rendering +RenderTexture2D LoadRenderTexture(int width, int height) +{ + RenderTexture2D target = rlglLoadRenderTexture(width, height); + + return target; +} + // Unload image from CPU memory (RAM) void UnloadImage(Image image) { @@ -409,6 +417,17 @@ void UnloadTexture(Texture2D texture) } } +// Unload render texture from GPU memory +void UnloadRenderTexture(RenderTexture2D target) +{ + if (target.id != 0) + { + rlDeleteRenderTextures(target); + + TraceLog(INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); + } +} + // Get pixel data from image in the form of Color struct array Color *GetImageData(Image image) { -- cgit v1.2.3 From 06a8d7eb06e1573d5cce991ca39f6cb1067ea6fb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 1 Apr 2016 10:39:33 +0200 Subject: Remove old postprocessing system --- src/core.c | 9 +-- src/raylib.h | 2 - src/rlgl.c | 244 ++--------------------------------------------------------- src/rlgl.h | 6 -- 4 files changed, 9 insertions(+), 252 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 5a794376..ae6f4cad 100644 --- a/src/core.c +++ b/src/core.c @@ -543,12 +543,8 @@ void BeginDrawing(void) updateTime = currentTime - previousTime; previousTime = currentTime; - if (IsPosproShaderEnabled()) rlEnablePostproFBO(); - rlClearScreenBuffers(); // Clear current framebuffers - rlLoadIdentity(); // Reset current matrix (MODELVIEW) - rlMultMatrixf(MatrixToFloat(downscaleView)); // If downscale required, apply it here //rlTranslatef(0.375, 0.375, 0); // HACK to have 2D pixel-perfect drawing on OpenGL 1.1 @@ -578,7 +574,7 @@ void BeginDrawingPro(int blendMode, Shader shader, Matrix transform) BeginDrawing(); SetBlendMode(blendMode); - SetPostproShader(shader); + SetCustomShader(shader); rlMultMatrixf(MatrixToFloat(transform)); } @@ -588,12 +584,11 @@ void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - if (IsPosproShaderEnabled()) rlglDrawPostpro(); // Draw postprocessing effect (shader) - SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events + // Frame time control system currentTime = GetTime(); drawTime = currentTime - previousTime; previousTime = currentTime; diff --git a/src/raylib.h b/src/raylib.h index c8f2c2a2..22fcb4ac 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -829,11 +829,9 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shaders strings and return program id void UnloadShader(Shader shader); // Unload a custom shader from memory -void SetPostproShader(Shader shader); // Set fullscreen postproduction shader void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw void SetDefaultShader(void); // Set default shader to be used in batch draw void SetModelShader(Model *model, Shader shader); // Link a shader to a model -bool IsPosproShaderEnabled(void); // Check if postprocessing shader is enabled int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) diff --git a/src/rlgl.c b/src/rlgl.c index 2153221e..809077e3 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -176,24 +176,6 @@ typedef struct { // TODO: Store draw state -> blending mode, shader } DrawCall; -// pixel type (same as Color type) -// NOTE: Used exclusively in mipmap generation functions -typedef struct { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} pixel; - -// Framebuffer Object type -typedef struct { - GLuint id; - int width; - int height; - GLuint colorTextureId; - GLuint depthTextureId; -} FBO; - #if defined(RLGL_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif @@ -248,13 +230,6 @@ static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support - -// Framebuffer object and texture -static FBO postproFbo; -static Model postproQuad; - -// Shaders related variables -static bool enabledPostpro = false; #endif // Compressed textures support flags @@ -269,9 +244,6 @@ static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; //static PFNGLISVERTEXARRAYOESPROC glIsVertexArray; // NOTE: Fails in WebGL, omitted #endif -// Save screen size data (render size), required for postpro quad -static int screenWidth, screenHeight; - static int blendMode = 0; // White texture useful for plain color polys (required by shader) @@ -290,14 +262,11 @@ static void UpdateBuffers(void); static char *TextFileRead(char *fn); static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat); - -FBO rlglLoadFBO(int width, int height); -void rlglUnloadFBO(FBO fbo); #endif #if defined(GRAPHICS_API_OPENGL_11) static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight); -static pixel *GenNextMipmap(pixel *srcData, int srcWidth, int srcHeight); +static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); #endif #if defined(RLGL_STANDALONE) @@ -827,14 +796,6 @@ void rlDeleteRenderTextures(RenderTexture2D target) #endif } -// Enable rendering to postprocessing FBO -void rlEnablePostproFBO() -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindFramebuffer(GL_FRAMEBUFFER, postproFbo.id); -#endif -} - // Unload shader from GPU memory void rlDeleteShader(unsigned int id) { @@ -1088,125 +1049,6 @@ void rlglInit(void) #endif } -// Init postpro system -// NOTE: Uses global variables screenWidth and screenHeight -// Modifies global variables: postproFbo, postproQuad -void rlglInitPostpro(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - postproFbo = rlglLoadFBO(screenWidth, screenHeight); - - if (postproFbo.id > 0) - { - // Create a simple quad model to render fbo texture - Mesh quad; - - quad.vertexCount = 6; - - float w = (float)postproFbo.width; - float h = (float)postproFbo.height; - - float quadPositions[6*3] = { w, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, h, 0.0f, 0.0f, h, 0.0f, w, h, 0.0f, w, 0.0f, 0.0f }; - float quadTexcoords[6*2] = { 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f }; - float quadNormals[6*3] = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }; - unsigned char quadColors[6*4] = { 255 }; - - quad.vertices = quadPositions; - quad.texcoords = quadTexcoords; - quad.normals = quadNormals; - quad.colors = quadColors; - - postproQuad = rlglLoadModel(quad); - - // NOTE: postproFbo.colorTextureId must be assigned to postproQuad model shader - } -#endif -} - -// Load a framebuffer object -FBO rlglLoadFBO(int width, int height) -{ - FBO fbo; - fbo.id = 0; - fbo.width = width; - fbo.height = height; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Create the texture that will serve as the color attachment for the framebuffer - glGenTextures(1, &fbo.colorTextureId); - glBindTexture(GL_TEXTURE_2D, fbo.colorTextureId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); - glBindTexture(GL_TEXTURE_2D, 0); - - // Create the renderbuffer that will serve as the depth attachment for the framebuffer. - glGenRenderbuffers(1, &fbo.depthTextureId); - glBindRenderbuffer(GL_RENDERBUFFER, fbo.depthTextureId); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height); - - // NOTE: We can also use a texture for depth buffer (GL_ARB_depth_texture/GL_OES_depth_texture extensions) - // A renderbuffer is simpler than a texture and could offer better performance on embedded devices -/* - glGenTextures(1, &fbo.depthTextureId); - glBindTexture(GL_TEXTURE_2D, fbo.depthTextureId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); - glBindTexture(GL_TEXTURE_2D, 0); -*/ - // Create the framebuffer object - glGenFramebuffers(1, &fbo.id); - glBindFramebuffer(GL_FRAMEBUFFER, fbo.id); - - // Attach color texture and depth renderbuffer to FBO - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.colorTextureId, 0); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo.depthTextureId); - - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - - if (status != GL_FRAMEBUFFER_COMPLETE) - { - TraceLog(WARNING, "Framebuffer object could not be created..."); - - switch(status) - { - case GL_FRAMEBUFFER_UNSUPPORTED: TraceLog(WARNING, "Framebuffer is unsupported"); break; - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete attachment"); break; -#if defined(GRAPHICS_API_OPENGL_ES2) - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: TraceLog(WARNING, "Framebuffer incomplete dimensions"); break; -#endif - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete missing attachment"); break; - default: break; - } - - glDeleteTextures(1, &fbo.colorTextureId); - glDeleteTextures(1, &fbo.depthTextureId); - } - else TraceLog(INFO, "[FBO ID %i] Framebuffer object created successfully", fbo.id); - - glBindFramebuffer(GL_FRAMEBUFFER, 0); -#endif - - return fbo; -} - -// Unload framebuffer object -void rlglUnloadFBO(FBO fbo) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteFramebuffers(1, &fbo.id); - glDeleteTextures(1, &fbo.colorTextureId); - glDeleteTextures(1, &fbo.depthTextureId); - - TraceLog(INFO, "[FBO ID %i] Unloaded framebuffer object successfully", fbo.id); -#endif -} - // Vertex Buffer Object deinitialization (memory free) void rlglClose(void) { @@ -1263,20 +1105,6 @@ void rlglClose(void) glDeleteTextures(1, &whiteTexture); TraceLog(INFO, "[TEX ID %i] Unloaded texture data (base white texture) from VRAM", whiteTexture); - if (postproFbo.id != 0) - { - rlglUnloadFBO(postproFbo); - - // Unload postpro quad model data - rlDeleteBuffers(postproQuad.mesh.vboId[0]); - rlDeleteBuffers(postproQuad.mesh.vboId[1]); - rlDeleteBuffers(postproQuad.mesh.vboId[2]); - - rlDeleteVertexArrays(postproQuad.mesh.vaoId); - - TraceLog(INFO, "Unloaded postprocessing data"); - } - free(draws); #endif } @@ -1443,16 +1271,6 @@ void rlglDraw(void) #endif } -// Draw with postprocessing shader -void rlglDrawPostpro(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - rlglDrawModel(postproQuad, (Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, 0.0f, 0.0f }, 0.0f, (Vector3){1.0f, 1.0f, 1.0f}, (Color){ 255, 255, 255, 255 }, false); -#endif -} - // Draw a 3d model // NOTE: Model transform can come within model struct void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color, bool wires) @@ -1606,12 +1424,7 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro // Initialize Graphics Device (OpenGL stuff) // NOTE: Stores global variables screenWidth and screenHeight void rlglInitGraphics(int offsetX, int offsetY, int width, int height) -{ - // Save screen size data (global vars), required on postpro quad - // NOTE: Size represents render size, it could differ from screen size! - screenWidth = width; - screenHeight = height; - +{ // NOTE: Required! viewport must be recalculated if screen resized! glViewport(offsetX/2, offsetY/2, width - offsetX, height - offsetY); // Set viewport width and height @@ -2458,44 +2271,11 @@ void SetCustomShader(Shader shader) #endif } -// Set postprocessing shader -void SetPostproShader(Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (!enabledPostpro) - { - enabledPostpro = true; - rlglInitPostpro(); // Lazy initialization on postprocessing usage - } - - SetModelShader(&postproQuad, shader); - - Texture2D texture; - texture.id = postproFbo.colorTextureId; - texture.width = postproFbo.width; - texture.height = postproFbo.height; - - postproQuad.material.texDiffuse = texture; - - //TraceLog(DEBUG, "Postproquad texture id: %i", postproQuad.texture.id); - //TraceLog(DEBUG, "Postproquad shader diffuse map id: %i", postproQuad.shader.texDiffuseId); - //TraceLog(DEBUG, "Shader diffuse map id: %i", shader.texDiffuseId); -#elif defined(GRAPHICS_API_OPENGL_11) - TraceLog(WARNING, "Shaders not supported on OpenGL 1.1"); -#endif -} - // Set default shader to be used in batch draw void SetDefaultShader(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) SetCustomShader(defaultShader); - - if (enabledPostpro) - { - SetPostproShader(defaultShader); - enabledPostpro = false; - } #endif } @@ -2529,16 +2309,6 @@ void SetModelShader(Model *model, Shader shader) #endif } -// Check if postprocessing is enabled (used in module: core) -bool IsPosproShaderEnabled(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return enabledPostpro; -#elif defined(GRAPHICS_API_OPENGL_11) - return false; -#endif -} - // Get shader uniform location int GetShaderLocation(Shader shader, const char *uniformName) { @@ -3120,8 +2890,8 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) // Generate mipmaps // NOTE: Every mipmap data is stored after data - pixel *image = (pixel *)malloc(width*height*sizeof(pixel)); - pixel *mipmap = NULL; + Color *image = (Color *)malloc(width*height*sizeof(Color)); + Color *mipmap = NULL; int offset = 0; int j = 0; @@ -3169,15 +2939,15 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight) } // Manual mipmap generation (basic scaling algorithm) -static pixel *GenNextMipmap(pixel *srcData, int srcWidth, int srcHeight) +static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) { int x2, y2; - pixel prow, pcol; + Color prow, pcol; int width = srcWidth/2; int height = srcHeight/2; - pixel *mipmap = (pixel *)malloc(width*height*sizeof(pixel)); + Color *mipmap = (Color *)malloc(width*height*sizeof(Color)); // Scaling algorithm works perfectly (box-filter) for (int y = 0; y < height; y++) diff --git a/src/rlgl.h b/src/rlgl.h index 679cb590..714961e1 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -267,7 +267,6 @@ void rlDeleteBuffers(unsigned int id); // Unload vertex data (VBO) from void rlClearColor(byte r, byte g, byte b, byte a); // Clear color buffer with color void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth) int rlGetVersion(void); // Returns current OpenGL version -void rlEnablePostproFBO(void); // Enable rendering to postprocessing FBO //------------------------------------------------------------------------------------ // Functions Declaration - rlgl functionality @@ -285,9 +284,6 @@ void rlglGenerateMipmaps(Texture2D texture); // Gene // NOTE: There is a set of shader related functions that are available to end user, // to avoid creating function wrappers through core module, they have been directly declared in raylib.h -void rlglInitPostpro(void); // Initialize postprocessing system -void rlglDrawPostpro(void); // Draw with postprocessing shader - Model rlglLoadModel(Mesh mesh); // Upload vertex data into GPU and provided VAO/VBO ids void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color, bool wires); @@ -309,11 +305,9 @@ void PrintModelviewMatrix(void); // DEBUG: Print modelview matrix Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shader strings and return program id void UnloadShader(Shader shader); // Unload a custom shader from memory -void SetPostproShader(Shader shader); // Set fullscreen postproduction shader void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw void SetDefaultShader(void); // Set default shader to be used in batch draw void SetModelShader(Model *model, Shader shader); // Link a shader to a model -bool IsPosproShaderEnabled(void); // Check if postprocessing shader is enabled int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) -- cgit v1.2.3 From f2f4079411472e835263a7a59ed58dba380ecca6 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 3 Apr 2016 16:05:23 +0200 Subject: Remove recipes of GLEW from Makefile (not used any more) --- src/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index cab2ced0..8aeb00d7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -84,8 +84,6 @@ else # external libraries headers # GLFW3 INCLUDES += -I../external/glfw3/include -# GLEW - INCLUDES += -I../external/glew/include # OpenAL Soft INCLUDES += -I../external/openal_soft/include endif @@ -143,7 +141,7 @@ models.o: models.c # compile audio module audio.o: audio.c $(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - + # compile stb_vorbis library stb_vorbis.o: stb_vorbis.c $(CC) -c stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) -- cgit v1.2.3 From a04a7b6ea53ed291a742baf764bd604d9fc7b70e Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 3 Apr 2016 16:07:44 +0200 Subject: Fix cleaning recipies for GNU/Linux --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 8aeb00d7..76dbfc67 100644 --- a/src/Makefile +++ b/src/Makefile @@ -165,7 +165,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) rm -f *.o libraylib.a else ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + rm -f *.o libraylib.a else del *.o libraylib.a endif -- cgit v1.2.3 From a66c8531d69569b0c5173c71a8ed28565c1b5214 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 3 Apr 2016 18:31:42 +0200 Subject: Some code simplifications --- src/models.c | 1 + src/rlgl.c | 84 +++++++++++++++++++----------------------------------------- 2 files changed, 27 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a515dd86..0bb2b8d6 100644 --- a/src/models.c +++ b/src/models.c @@ -627,6 +627,7 @@ void SetModelTexture(Model *model, Texture2D texture) else model->material.texDiffuse = texture; } +// Generate a mesh from heightmap static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { #define GRAY_VALUE(c) ((c.r+c.g+c.b)/3) diff --git a/src/rlgl.c b/src/rlgl.c index 809077e3..cf9fe17b 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -256,6 +256,7 @@ unsigned int whiteTexture; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) static Shader LoadDefaultShader(void); static Shader LoadSimpleShader(void); +static void GetShaderDefaultLocations(Shader *shader); static void InitializeBuffers(void); static void InitializeBuffersGPU(void); static void UpdateBuffers(void); @@ -1369,22 +1370,25 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro } else { - // Bind model VBOs data + // Bind model VBO data: vertex position glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[0]); glVertexAttribPointer(model.material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(model.material.shader.vertexLoc); + // Bind model VBO data: vertex texcoords glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[1]); glVertexAttribPointer(model.material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(model.material.shader.texcoordLoc); - // Add normals support + // Bind model VBO data: vertex normals (if available) if (model.material.shader.normalLoc != -1) { glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[2]); glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(model.material.shader.normalLoc); } + + // TODO: Bind model VBO data: colors, tangents, texcoords2 (if available) } // Draw call! @@ -2094,9 +2098,7 @@ void *rlglReadTexturePixels(Texture2D texture) // Load a custom shader and bind default locations Shader LoadShader(char *vsFileName, char *fsFileName) { - Shader shader; - - shader.id = 0; // Default value in case of loading failure + Shader shader = { 0 }; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Shaders loading from external text file @@ -2107,28 +2109,7 @@ Shader LoadShader(char *vsFileName, char *fsFileName) { shader.id = LoadShaderProgram(vShaderStr, fShaderStr); - if (shader.id != 0) - { - TraceLog(INFO, "[SHDR ID %i] Custom shader loaded successfully", shader.id); - - // Get handles to GLSL input attibute locations - //------------------------------------------------------------------- - shader.vertexLoc = glGetAttribLocation(shader.id, "vertexPosition"); - shader.texcoordLoc = glGetAttribLocation(shader.id, "vertexTexCoord"); - shader.normalLoc = glGetAttribLocation(shader.id, "vertexNormal"); - // NOTE: custom shader does not use colorLoc - shader.colorLoc = -1; - - // Get handles to GLSL uniform locations (vertex shader) - shader.mvpLoc = glGetUniformLocation(shader.id, "mvpMatrix"); - - // Get handles to GLSL uniform locations (fragment shader) - shader.tintColorLoc = glGetUniformLocation(shader.id, "fragTintColor"); - shader.mapDiffuseLoc = glGetUniformLocation(shader.id, "texture0"); - shader.mapNormalLoc = -1; // It can be set later - shader.mapSpecularLoc = -1; // It can be set later - //-------------------------------------------------------------------- - } + if (shader.id != 0) GetShaderDefaultLocations(&shader); else { TraceLog(WARNING, "Custom shader could not be loaded"); @@ -2497,23 +2478,7 @@ static Shader LoadDefaultShader(void) if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Default shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Default shader could not be loaded", shader.id); - // Get handles to GLSL input attibute locations - //------------------------------------------------------------------- - shader.vertexLoc = glGetAttribLocation(shader.id, "vertexPosition"); - shader.texcoordLoc = glGetAttribLocation(shader.id, "vertexTexCoord"); - shader.colorLoc = glGetAttribLocation(shader.id, "vertexColor"); - // NOTE: default shader does not use normalLoc - shader.normalLoc = -1; - - // Get handles to GLSL uniform locations (vertex shader) - shader.mvpLoc = glGetUniformLocation(shader.id, "mvpMatrix"); - - // Get handles to GLSL uniform locations (fragment shader) - shader.tintColorLoc = -1; - shader.mapDiffuseLoc = glGetUniformLocation(shader.id, "texture0"); - shader.mapNormalLoc = -1; // It can be set later - shader.mapSpecularLoc = -1; // It can be set later - //-------------------------------------------------------------------- + GetShaderDefaultLocations(&shader); return shader; } @@ -2573,25 +2538,28 @@ static Shader LoadSimpleShader(void) if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Simple shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Simple shader could not be loaded", shader.id); + GetShaderDefaultLocations(&shader); + + return shader; +} + +// Get location handlers to for shader attributes and uniforms +static void GetShaderDefaultLocations(Shader *shader) +{ // Get handles to GLSL input attibute locations - //------------------------------------------------------------------- - shader.vertexLoc = glGetAttribLocation(shader.id, "vertexPosition"); - shader.texcoordLoc = glGetAttribLocation(shader.id, "vertexTexCoord"); - shader.normalLoc = glGetAttribLocation(shader.id, "vertexNormal"); - // NOTE: simple shader does not use colorLoc - shader.colorLoc = -1; + shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); + shader->texcoordLoc = glGetAttribLocation(shader->id, "vertexTexCoord"); + shader->normalLoc = glGetAttribLocation(shader->id, "vertexNormal"); + shader->colorLoc = glGetAttribLocation(shader->id, "vertexColor"); // -1 if not found // Get handles to GLSL uniform locations (vertex shader) - shader.mvpLoc = glGetUniformLocation(shader.id, "mvpMatrix"); + shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); // Get handles to GLSL uniform locations (fragment shader) - shader.tintColorLoc = glGetUniformLocation(shader.id, "fragTintColor"); - shader.mapDiffuseLoc = glGetUniformLocation(shader.id, "texture0"); - shader.mapNormalLoc = -1; // It can be set later - shader.mapSpecularLoc = -1; // It can be set later - //-------------------------------------------------------------------- - - return shader; + shader->tintColorLoc = glGetUniformLocation(shader->id, "fragTintColor"); + shader->mapDiffuseLoc = glGetUniformLocation(shader->id, "texture0"); + shader->mapNormalLoc = glGetUniformLocation(shader->id, "texture1"); // -1 if not found + shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); // -1 if not found } // Read text file -- cgit v1.2.3 From b6cec214bd8cd557a92edeb6a53311eb192b56d4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 3 Apr 2016 20:14:07 +0200 Subject: Unified internal shader to only one Only defaultShader required, set default value for vertex color attribute if not enabled and fragColor uniform --- src/rlgl.c | 121 +++++++++++++++++-------------------------------------------- 1 file changed, 33 insertions(+), 88 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index cf9fe17b..e08847b9 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -202,7 +202,7 @@ static VertexPositionColorBuffer triangles; // No texture support static VertexPositionColorTextureIndexBuffer quads; // Shader Programs -static Shader defaultShader, simpleShader; +static Shader defaultShader; static Shader currentShader; // By default, defaultShader // Vertex Array Objects (VAO) @@ -255,8 +255,7 @@ unsigned int whiteTexture; //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) static Shader LoadDefaultShader(void); -static Shader LoadSimpleShader(void); -static void GetShaderDefaultLocations(Shader *shader); +static void LoadDefaultShaderLocations(Shader *shader); static void InitializeBuffers(void); static void InitializeBuffersGPU(void); static void UpdateBuffers(void); @@ -1021,9 +1020,8 @@ void rlglInit(void) if (whiteTexture != 0) TraceLog(INFO, "[TEX ID %i] Base white texture loaded successfully", whiteTexture); else TraceLog(WARNING, "Base white texture could not be loaded"); - // Init default Shader (Custom for GL 3.3 and ES2) + // Init default Shader (customized for GL 3.3 and ES2) defaultShader = LoadDefaultShader(); - simpleShader = LoadSimpleShader(); //customShader = LoadShader("custom.vs", "custom.fs"); // Works ok currentShader = defaultShader; @@ -1083,12 +1081,11 @@ void rlglClose(void) glDeleteVertexArrays(1, &vaoQuads); } - //glDetachShader(defaultShaderProgram, v); - //glDetachShader(defaultShaderProgram, f); - //glDeleteShader(v); - //glDeleteShader(f); + //glDetachShader(defaultShaderProgram, vertexShader); + //glDetachShader(defaultShaderProgram, fragmentShader); + //glDeleteShader(vertexShader); // Already deleted on shader compilation + //glDeleteShader(fragmentShader); // Already deleted on sahder compilation glDeleteProgram(defaultShader.id); - glDeleteProgram(simpleShader.id); // Free vertex arrays memory free(lines.vertices); @@ -1124,6 +1121,7 @@ void rlglDraw(void) glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); glUniform1i(currentShader.mapDiffuseLoc, 0); + glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); } // NOTE: We draw in this order: lines, triangles, quads @@ -1866,6 +1864,8 @@ Model rlglLoadModel(Mesh mesh) model.mesh.vboId[1] = 0; // Vertex texcoords VBO model.mesh.vboId[2] = 0; // Vertex normals VBO + // TODO: Consider attributes: color, texcoords2, tangents (if available) + model.transform = MatrixIdentity(); #if defined(GRAPHICS_API_OPENGL_11) @@ -1873,7 +1873,7 @@ Model rlglLoadModel(Mesh mesh) model.material.shader.id = 0; // No shader used #elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - model.material.shader = simpleShader; // Default model shader + model.material.shader = defaultShader; // Default model shader model.material.texDiffuse.id = whiteTexture; // Default whiteTexture model.material.texDiffuse.width = 1; // Default whiteTexture width @@ -1896,7 +1896,7 @@ Model rlglLoadModel(Mesh mesh) } // Create buffers for our vertex data (positions, texcoords, normals) - glGenBuffers(3, vertexBuffer); + glGenBuffers(4, vertexBuffer); // Enable vertex attributes: position glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[0]); @@ -1915,7 +1915,10 @@ Model rlglLoadModel(Mesh mesh) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh.vertexCount, mesh.normals, GL_STATIC_DRAW); glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(model.material.shader.normalLoc); - + + glVertexAttrib4f(model.material.shader.colorLoc, 1.0f, 1.0f, 1.0f, 1.0f); // Color vertex attribute set to default: WHITE + glDisableVertexAttribArray(model.material.shader.colorLoc); + model.mesh.vboId[0] = vertexBuffer[0]; // Vertex position VBO model.mesh.vboId[1] = vertexBuffer[1]; // Texcoords VBO model.mesh.vboId[2] = vertexBuffer[2]; // Normals VBO @@ -2068,7 +2071,7 @@ void *rlglReadTexturePixels(Texture2D texture) Model quad; //quad.mesh = GenMeshQuad(width, height); quad.transform = MatrixIdentity(); - quad.shader = simpleShader; + quad.shader = defaultShader; DrawModel(quad, (Vector3){ 0.0f, 0.0f, 0.0f }, 1.0f, WHITE); @@ -2109,11 +2112,12 @@ Shader LoadShader(char *vsFileName, char *fsFileName) { shader.id = LoadShaderProgram(vShaderStr, fShaderStr); - if (shader.id != 0) GetShaderDefaultLocations(&shader); + // After shader loading, we try to load default location names + if (shader.id != 0) LoadDefaultShaderLocations(&shader); else { TraceLog(WARNING, "Custom shader could not be loaded"); - shader = simpleShader; + shader = defaultShader; } // Shader strings must be freed @@ -2123,7 +2127,7 @@ Shader LoadShader(char *vsFileName, char *fsFileName) else { TraceLog(WARNING, "Custom shader could not be loaded"); - shader = simpleShader; + shader = defaultShader; } #endif @@ -2432,20 +2436,20 @@ static Shader LoadDefaultShader(void) "in vec2 vertexTexCoord; \n" "in vec4 vertexColor; \n" "out vec2 fragTexCoord; \n" - "out vec4 fragTintColor; \n" + "out vec4 fragColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char vShaderStr[] = "#version 100 \n" "attribute vec3 vertexPosition; \n" "attribute vec2 vertexTexCoord; \n" "attribute vec4 vertexColor; \n" "varying vec2 fragTexCoord; \n" - "varying vec4 fragTintColor; \n" + "varying vec4 fragColor; \n" #endif "uniform mat4 mvpMatrix; \n" "void main() \n" "{ \n" " fragTexCoord = vertexTexCoord; \n" - " fragTintColor = vertexColor; \n" + " fragColor = vertexColor; \n" " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" "} \n"; @@ -2453,23 +2457,24 @@ static Shader LoadDefaultShader(void) #if defined(GRAPHICS_API_OPENGL_33) char fShaderStr[] = "#version 330 \n" "in vec2 fragTexCoord; \n" - "in vec4 fragTintColor; \n" - "out vec4 fragColor; \n" + "in vec4 fragColor; \n" + "out vec4 finalColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) char fShaderStr[] = "#version 100 \n" "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) "varying vec2 fragTexCoord; \n" - "varying vec4 fragTintColor; \n" + "varying vec4 fragColor; \n" #endif "uniform sampler2D texture0; \n" + "uniform vec4 fragTintColor; \n" "void main() \n" "{ \n" #if defined(GRAPHICS_API_OPENGL_33) - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " fragColor = texelColor*fragTintColor; \n" + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " finalColor = texelColor*fragTintColor*fragColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 - " gl_FragColor = texelColor*fragTintColor; \n" + " gl_FragColor = texelColor*fragTintColor*fragColor; \n" #endif "} \n"; @@ -2478,73 +2483,13 @@ static Shader LoadDefaultShader(void) if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Default shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Default shader could not be loaded", shader.id); - GetShaderDefaultLocations(&shader); - - return shader; -} - -// Load Simple Shader (Vertex and Fragment) -// NOTE: This shader program is used to render models -static Shader LoadSimpleShader(void) -{ - Shader shader; - - // Vertex shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char vShaderStr[] = "#version 330 \n" - "in vec3 vertexPosition; \n" - "in vec2 vertexTexCoord; \n" - "in vec3 vertexNormal; \n" - "out vec2 fragTexCoord; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - char vShaderStr[] = "#version 100 \n" - "attribute vec3 vertexPosition; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec3 vertexNormal; \n" - "varying vec2 fragTexCoord; \n" -#endif - "uniform mat4 mvpMatrix; \n" - "void main() \n" - "{ \n" - " fragTexCoord = vertexTexCoord; \n" - " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" - "} \n"; - - // Fragment shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char fShaderStr[] = "#version 330 \n" - "in vec2 fragTexCoord; \n" - "out vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - char fShaderStr[] = "#version 100 \n" - "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) - "varying vec2 fragTexCoord; \n" -#endif - "uniform sampler2D texture0; \n" - "uniform vec4 fragTintColor; \n" - "void main() \n" - "{ \n" -#if defined(GRAPHICS_API_OPENGL_33) - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " fragColor = texelColor*fragTintColor; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" - " gl_FragColor = texelColor*fragTintColor; \n" -#endif - "} \n"; - - shader.id = LoadShaderProgram(vShaderStr, fShaderStr); - - if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Simple shader loaded successfully", shader.id); - else TraceLog(WARNING, "[SHDR ID %i] Simple shader could not be loaded", shader.id); - - GetShaderDefaultLocations(&shader); + LoadDefaultShaderLocations(&shader); return shader; } // Get location handlers to for shader attributes and uniforms -static void GetShaderDefaultLocations(Shader *shader) +static void LoadDefaultShaderLocations(Shader *shader) { // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); -- cgit v1.2.3 From 0133917bf93fd3efd9580db6ff31126c58bf38f4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Apr 2016 01:15:43 +0200 Subject: Correct detail --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index e08847b9..b2a36351 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1896,7 +1896,7 @@ Model rlglLoadModel(Mesh mesh) } // Create buffers for our vertex data (positions, texcoords, normals) - glGenBuffers(4, vertexBuffer); + glGenBuffers(3, vertexBuffer); // Enable vertex attributes: position glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[0]); -- cgit v1.2.3 From 93616157862ab9557c42494e23fc96d9d4de21d1 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Wed, 6 Apr 2016 13:21:29 +0200 Subject: Fix Makefile files I've added .PHONY targets and fixed "clean" recipe. --- src/Makefile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 76dbfc67..12f4609b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,6 +21,8 @@ # #************************************************************************************************** +.PHONY: all clean + # define raylib platform to compile for # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP @@ -97,9 +99,9 @@ else endif -# typing 'make' will invoke the first target entry in the file, -# in this case, the 'default' target entry is raylib -default: raylib +# typing 'make' will invoke the default target entry called 'all', +# in this case, the 'default' target entry is basic_game +all: raylib # compile raylib library raylib: $(OBJS) @@ -161,21 +163,21 @@ gestures.o: gestures.c # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),OSX) - rm -f *.o libraylib.a + ifeq ($(PLATFORM_OS),WINDOWS) + del *.o libraylib.a else - ifeq ($(PLATFORM_OS),LINUX) rm -f *.o libraylib.a - else - del *.o libraylib.a endif +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + ifeq ($(PLATFORM_OS),WINDOWS) + del *.o libraylib.bc + else + rm -f *.o libraylib.bc endif endif ifeq ($(PLATFORM),PLATFORM_RPI) rm -f *.o libraylib.a -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - del *.o libraylib.bc endif @echo Cleaning done -- cgit v1.2.3 From 3b67a4cfba7d3b5dca805b1d1718fd2c9db64e99 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 6 Apr 2016 17:45:25 +0200 Subject: Update stb libs to latest version --- src/stb_image.h | 263 ++++++++++++++++++++++++++++++++++++++----------- src/stb_image_resize.h | 110 ++++++++++----------- src/stb_image_write.h | 14 ++- src/stb_rect_pack.h | 26 +++-- src/stb_truetype.h | 52 ++++++---- src/stb_vorbis.c | 112 +++++---------------- src/stb_vorbis.h | 20 ++-- 7 files changed, 349 insertions(+), 248 deletions(-) (limited to 'src') diff --git a/src/stb_image.h b/src/stb_image.h index c28b5286..ce87646d 100644 --- a/src/stb_image.h +++ b/src/stb_image.h @@ -1,4 +1,4 @@ -/* stb_image - v2.09 - public domain image loader - http://nothings.org/stb_image.h +/* stb_image - v2.12 - public domain image loader - http://nothings.org/stb_image.h no warranty implied; use at your own risk Do this: @@ -146,6 +146,12 @@ Latest revision history: + 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes + 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 + RGB-format JPEG; remove white matting in PSD; + allocate large structures on the stack; + correct channel count for PNG & BMP + 2.10 (2016-01-22) avoid warning introduced in 2.09 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA 2.07 (2015-09-13) partial animated GIF support @@ -166,10 +172,6 @@ STBI_MALLOC,STBI_REALLOC,STBI_FREE STBI_NO_*, STBI_ONLY_* GIF bugfix - 1.48 (2014-12-14) fix incorrectly-named assert() - 1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted) - optimize PNG - fix bug in interlaced PNG with user-specified channel count See end of file for full revision history. @@ -200,17 +202,17 @@ Janez Zemva John Bartholomew Michal Cichon svdijk@github Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson Laurent Gomila Cort Stratton Sergio Gonzalez romigrou@github - Aruelien Pocheville Thibault Reuille Cass Everitt - Ryamond Barbiero Paul Du Bois Engin Manap + Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan + Ryamond Barbiero Paul Du Bois Engin Manap snagar@github + Michaelangel007@github Oriol Ferrer Mesia socks-the-fox Blazej Dariusz Roszkowski - Michaelangel007@github LICENSE -This software is in the public domain. Where that dedication is not -recognized, you are granted a perpetual, irrevocable license to copy, -distribute, and modify this file as you see fit. +This software is dual-licensed to the public domain and under the following +license: you are granted a perpetual, irrevocable license to copy, modify, +publish, and distribute this file as you see fit. */ @@ -679,7 +681,7 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; #define STBI_NO_SIMD #endif -#if !defined(STBI_NO_SIMD) && defined(STBI__X86_TARGET) +#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) #define STBI_SSE2 #include @@ -1513,6 +1515,7 @@ typedef struct int succ_high; int succ_low; int eob_run; + int rgb; int scan_n, order[4]; int restart_interval, todo; @@ -2724,11 +2727,17 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG"); + z->rgb = 0; for (i=0; i < s->img_n; ++i) { + static unsigned char rgb[3] = { 'R', 'G', 'B' }; z->img_comp[i].id = stbi__get8(s); if (z->img_comp[i].id != i+1) // JFIF requires - if (z->img_comp[i].id != i) // some version of jpegtran outputs non-JFIF-compliant files! - return stbi__err("bad component ID","Corrupt JPEG"); + if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files! + // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format) + if (z->img_comp[i].id != rgb[i]) + return stbi__err("bad component ID","Corrupt JPEG"); + ++z->rgb; + } q = stbi__get8(s); z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG"); z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG"); @@ -3390,7 +3399,17 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp if (n >= 3) { stbi_uc *y = coutput[0]; if (z->s->img_n == 3) { - z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); + if (z->rgb == 3) { + for (i=0; i < z->s->img_x; ++i) { + out[0] = y[i]; + out[1] = coutput[1][i]; + out[2] = coutput[2][i]; + out[3] = 255; + out += n; + } + } else { + z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); + } } else for (i=0; i < z->s->img_x; ++i) { out[0] = out[1] = out[2] = y[i]; @@ -3415,10 +3434,13 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { - stbi__jpeg j; - j.s = s; - stbi__setup_jpeg(&j); - return load_jpeg_image(&j, x,y,comp,req_comp); + unsigned char* result; + stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); + j->s = s; + stbi__setup_jpeg(j); + result = load_jpeg_image(j, x,y,comp,req_comp); + STBI_FREE(j); + return result; } static int stbi__jpeg_test(stbi__context *s) @@ -3446,9 +3468,12 @@ static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp) static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) { - stbi__jpeg j; - j.s = s; - return stbi__jpeg_info_raw(&j, x, y, comp); + int result; + stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); + j->s = s; + result = stbi__jpeg_info_raw(j, x, y, comp); + STBI_FREE(j); + return result; } #endif @@ -3629,6 +3654,7 @@ static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room while (cur + n > limit) limit *= 2; q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); + STBI_NOTUSED(old_limit); if (q == NULL) return stbi__err("outofmem", "Out of memory"); z->zout_start = q; z->zout = q + cur; @@ -3738,7 +3764,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) return 1; } -static int stbi__parse_uncomperssed_block(stbi__zbuf *a) +static int stbi__parse_uncompressed_block(stbi__zbuf *a) { stbi_uc header[4]; int len,nlen,k; @@ -3804,7 +3830,7 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) final = stbi__zreceive(a,1); type = stbi__zreceive(a,2); if (type == 0) { - if (!stbi__parse_uncomperssed_block(a)) return 0; + if (!stbi__parse_uncompressed_block(a)) return 0; } else if (type == 3) { return 0; } else { @@ -3946,6 +3972,7 @@ typedef struct { stbi__context *s; stbi_uc *idata, *expanded, *out; + int depth; } stbi__png; @@ -3985,14 +4012,19 @@ static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x0 // create the png data from post-deflated data static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { + int bytes = (depth == 16? 2 : 1); stbi__context *s = a->s; - stbi__uint32 i,j,stride = x*out_n; + stbi__uint32 i,j,stride = x*out_n*bytes; stbi__uint32 img_len, img_width_bytes; int k; int img_n = s->img_n; // copy it into a local for later + int output_bytes = out_n*bytes; + int filter_bytes = img_n*bytes; + int width = x; + STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); - a->out = (stbi_uc *) stbi__malloc(x * y * out_n); // extra bytes to write off the end into + a->out = (stbi_uc *) stbi__malloc(x * y * output_bytes); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); @@ -4007,8 +4039,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r stbi_uc *cur = a->out + stride*j; stbi_uc *prior = cur - stride; int filter = *raw++; - int filter_bytes = img_n; - int width = x; + if (filter > 4) return stbi__err("invalid filter","Corrupt PNG"); @@ -4041,6 +4072,14 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r raw += img_n; cur += out_n; prior += out_n; + } else if (depth == 16) { + if (img_n != out_n) { + cur[filter_bytes] = 255; // first pixel top byte + cur[filter_bytes+1] = 255; // first pixel bottom byte + } + raw += filter_bytes; + cur += output_bytes; + prior += output_bytes; } else { raw += 1; cur += 1; @@ -4049,7 +4088,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // this is a little gross, so that we don't switch per-pixel or per-component if (depth < 8 || img_n == out_n) { - int nk = (width - 1)*img_n; + int nk = (width - 1)*filter_bytes; #define CASE(f) \ case f: \ for (k=0; k < nk; ++k) @@ -4069,18 +4108,27 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r STBI_ASSERT(img_n+1 == out_n); #define CASE(f) \ case f: \ - for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \ - for (k=0; k < img_n; ++k) + for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ + for (k=0; k < filter_bytes; ++k) switch (filter) { CASE(STBI__F_none) cur[k] = raw[k]; break; - CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break; + CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break; - CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break; - CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break; - CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break; + CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; + CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; + CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; + CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; } #undef CASE + + // the loop above sets the high byte of the pixels' alpha, but for + // 16 bit png files we also need the low byte set. we'll do that here. + if (depth == 16) { + cur = a->out + stride*j; // start at the beginning of the row again + for (i=0; i < x; ++i,cur+=output_bytes) { + cur[filter_bytes+1] = 255; + } + } } } @@ -4156,6 +4204,17 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r } } } + } else if (depth == 16) { + // force the image data from big-endian to platform-native. + // this is done in a separate pass due to the decoding relying + // on the data being untouched, but could probably be done + // per-line during decode if care is taken. + stbi_uc *cur = a->out; + stbi__uint16 *cur16 = (stbi__uint16*)cur; + + for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { + *cur16 = (cur[0] << 8) | cur[1]; + } } return 1; @@ -4228,6 +4287,31 @@ static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) return 1; } +static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi__uint16 *p = (stbi__uint16*) z->out; + + // compute color-based transparency, assuming we've + // already got 65535 as the alpha value in the output + STBI_ASSERT(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i = 0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 65535); + p += 2; + } + } else { + for (i = 0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) { stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; @@ -4265,6 +4349,26 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int return 1; } +static int stbi__reduce_png(stbi__png *p) +{ + int i; + int img_len = p->s->img_x * p->s->img_y * p->s->img_out_n; + stbi_uc *reduced; + stbi__uint16 *orig = (stbi__uint16*)p->out; + + if (p->depth != 16) return 1; // don't need to do anything if not 16-bit data + + reduced = (stbi_uc *)stbi__malloc(img_len); + if (p == NULL) return stbi__err("outofmem", "Out of memory"); + + for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is a decent approx of 16->8 bit scaling + + p->out = reduced; + STBI_FREE(orig); + + return 1; +} + static int stbi__unpremultiply_on_load = 0; static int stbi__de_iphone_flag = 0; @@ -4326,8 +4430,9 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) { stbi_uc palette[1024], pal_img_n=0; stbi_uc has_trans=0, tc[3]; + stbi__uint16 tc16[3]; stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; - int first=1,k,interlace=0, color=0, depth=0, is_iphone=0; + int first=1,k,interlace=0, color=0, is_iphone=0; stbi__context *s = z->s; z->expanded = NULL; @@ -4352,8 +4457,9 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); - depth = stbi__get8(s); if (depth != 1 && depth != 2 && depth != 4 && depth != 8) return stbi__err("1/2/4/8-bit only","PNG not supported: 1/2/4/8-bit only"); + z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); + if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); @@ -4401,8 +4507,11 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); has_trans = 1; - for (k=0; k < s->img_n; ++k) - tc[k] = (stbi_uc) (stbi__get16be(s) & 255) * stbi__depth_scale_table[depth]; // non 8-bit images will be larger + if (z->depth == 16) { + for (k = 0; k < s->img_n; ++k) tc16[k] = stbi__get16be(s); // copy the values as-is + } else { + for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger + } } break; } @@ -4418,6 +4527,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; while (ioff + c.length > idata_limit) idata_limit *= 2; + STBI_NOTUSED(idata_limit_old); p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); z->idata = p; } @@ -4432,7 +4542,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) if (scan != STBI__SCAN_load) return 1; if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); // initial guess for decoded data size to avoid unnecessary reallocs - bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component + bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); if (z->expanded == NULL) return 0; // zlib should set error @@ -4441,9 +4551,14 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) s->img_out_n = s->img_n+1; else s->img_out_n = s->img_n; - if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, depth, color, interlace)) return 0; - if (has_trans) - if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; + if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; + if (has_trans) { + if (z->depth == 16) { + if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; + } else { + if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; + } + } if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) stbi__de_iphone(z); if (pal_img_n) { @@ -4485,6 +4600,11 @@ static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req unsigned char *result=NULL; if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { + if (p->depth == 16) { + if (!stbi__reduce_png(p)) { + return result; + } + } result = p->out; p->out = NULL; if (req_comp && req_comp != p->s->img_out_n) { @@ -4494,7 +4614,7 @@ static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req } *x = p->s->img_x; *y = p->s->img_y; - if (n) *n = p->s->img_out_n; + if (n) *n = p->s->img_n; } STBI_FREE(p->out); p->out = NULL; STBI_FREE(p->expanded); p->expanded = NULL; @@ -4619,6 +4739,7 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) stbi__get16le(s); // discard reserved info->offset = stbi__get32le(s); info->hsz = hsz = stbi__get32le(s); + info->mr = info->mg = info->mb = info->ma = 0; if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); if (hsz == 12) { @@ -4647,7 +4768,6 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) stbi__get32le(s); } if (info->bpp == 16 || info->bpp == 32) { - info->mr = info->mg = info->mb = 0; if (compress == 0) { if (info->bpp == 32) { info->mr = 0xffu << 16; @@ -5342,6 +5462,21 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int } } + if (channelCount >= 4) { + for (i=0; i < w*h; ++i) { + unsigned char *pixel = out + 4*i; + if (pixel[3] != 0 && pixel[3] != 255) { + // remove weird white matte from PSD + float a = pixel[3] / 255.0f; + float ra = 1.0f / a; + float inv_a = 255.0f * (1 - ra); + pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); + pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); + pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); + } + } + } + if (req_comp && req_comp != 4) { out = stbi__convert_format(out, 4, req_comp, w, h); if (out == NULL) return out; // stbi__convert_format frees input on failure @@ -5654,13 +5789,15 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) { - stbi__gif g; - if (!stbi__gif_header(s, &g, comp, 1)) { + stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); + if (!stbi__gif_header(s, g, comp, 1)) { + STBI_FREE(g); stbi__rewind( s ); return 0; } - if (x) *x = g.w; - if (y) *y = g.h; + if (x) *x = g->w; + if (y) *y = g->h; + STBI_FREE(g); return 1; } @@ -5913,20 +6050,20 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) { stbi_uc *u = 0; - stbi__gif g; - memset(&g, 0, sizeof(g)); + stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); + memset(g, 0, sizeof(*g)); - u = stbi__gif_load_next(s, &g, comp, req_comp); + u = stbi__gif_load_next(s, g, comp, req_comp); if (u == (stbi_uc *) s) u = 0; // end of animated gif marker if (u) { - *x = g.w; - *y = g.h; + *x = g->w; + *y = g->h; if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g.w, g.h); + u = stbi__convert_format(u, 4, req_comp, g->w, g->h); } - else if (g.out) - STBI_FREE(g.out); - + else if (g->out) + STBI_FREE(g->out); + STBI_FREE(g); return u; } @@ -6464,6 +6601,14 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int /* revision history: + 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes + 2.11 (2016-04-02) allocate large structures on the stack + remove white matting for transparent PSD + fix reported channel count for PNG & BMP + re-enable SSE2 in non-gcc 64-bit + support RGB-formatted JPEG + read 16-bit PNGs (only as 8-bit) + 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED 2.09 (2016-01-16) allow comments in PNM files 16-bit-per-pixel TGA (not bit-per-component) info() for TGA could break due to .hdr handling diff --git a/src/stb_image_resize.h b/src/stb_image_resize.h index 4ce7ddbf..4cabe540 100644 --- a/src/stb_image_resize.h +++ b/src/stb_image_resize.h @@ -1,4 +1,4 @@ -/* stb_image_resize - v0.90 - public domain image resizing +/* stb_image_resize - v0.91 - public domain image resizing by Jorge L Rodriguez (@VinoBS) - 2014 http://github.com/nothings/stb @@ -156,13 +156,14 @@ Sean Barrett: API design, optimizations REVISIONS + 0.91 (2016-04-02) fix warnings; fix handling of subpixel regions 0.90 (2014-09-17) first released version LICENSE - This software is in the public domain. Where that dedication is not - recognized, you are granted a perpetual, irrevocable license to copy, - distribute, and modify this file as you see fit. + This software is dual-licensed to the public domain and under the following + license: you are granted a perpetual, irrevocable license to copy, modify, + publish, and distribute this file as you see fit. TODO Don't decode all of the image data when only processing a partial tile @@ -383,15 +384,6 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int #define STBIR_ASSERT(x) assert(x) #endif -#ifdef STBIR_DEBUG -#define STBIR__DEBUG_ASSERT STBIR_ASSERT -#else -#define STBIR__DEBUG_ASSERT -#endif - -// If you hit this it means I haven't done it yet. -#define STBIR__UNIMPLEMENTED(x) STBIR_ASSERT(!(x)) - // For memset #include @@ -758,7 +750,7 @@ static float stbir__filter_trapezoid(float x, float scale) { float halfscale = scale / 2; float t = 0.5f + halfscale; - STBIR__DEBUG_ASSERT(scale <= 1); + STBIR_ASSERT(scale <= 1); x = (float)fabs(x); @@ -776,7 +768,7 @@ static float stbir__filter_trapezoid(float x, float scale) static float stbir__support_trapezoid(float scale) { - STBIR__DEBUG_ASSERT(scale <= 1); + STBIR_ASSERT(scale <= 1); return 0.5f + scale / 2; } @@ -990,7 +982,7 @@ static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max) return n; // NOTREACHED default: - STBIR__UNIMPLEMENTED("Unimplemented edge type"); + STBIR_ASSERT(!"Unimplemented edge type"); return 0; } } @@ -1039,12 +1031,12 @@ static void stbir__calculate_coefficients_upsample(stbir__info* stbir_info, stbi float total_filter = 0; float filter_scale; - STBIR__DEBUG_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. + STBIR_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. contributor->n0 = in_first_pixel; contributor->n1 = in_last_pixel; - STBIR__DEBUG_ASSERT(contributor->n1 >= contributor->n0); + STBIR_ASSERT(contributor->n1 >= contributor->n0); for (i = 0; i <= in_last_pixel - in_first_pixel; i++) { @@ -1062,10 +1054,10 @@ static void stbir__calculate_coefficients_upsample(stbir__info* stbir_info, stbi total_filter += coefficient_group[i]; } - STBIR__DEBUG_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); + STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); - STBIR__DEBUG_ASSERT(total_filter > 0.9); - STBIR__DEBUG_ASSERT(total_filter < 1.1f); // Make sure it's not way off. + STBIR_ASSERT(total_filter > 0.9); + STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. // Make sure the sum of all coefficients is 1. filter_scale = 1 / total_filter; @@ -1087,12 +1079,12 @@ static void stbir__calculate_coefficients_downsample(stbir__info* stbir_info, st { int i; - STBIR__DEBUG_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. + STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. contributor->n0 = out_first_pixel; contributor->n1 = out_last_pixel; - STBIR__DEBUG_ASSERT(contributor->n1 >= contributor->n0); + STBIR_ASSERT(contributor->n1 >= contributor->n0); for (i = 0; i <= out_last_pixel - out_first_pixel; i++) { @@ -1101,7 +1093,7 @@ static void stbir__calculate_coefficients_downsample(stbir__info* stbir_info, st coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; } - STBIR__DEBUG_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); + STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); for (i = out_last_pixel - out_first_pixel; i >= 0; i--) { @@ -1136,8 +1128,8 @@ static void stbir__normalize_downsample_coefficients(stbir__info* stbir_info, st break; } - STBIR__DEBUG_ASSERT(total > 0.9f); - STBIR__DEBUG_ASSERT(total < 1.1f); + STBIR_ASSERT(total > 0.9f); + STBIR_ASSERT(total < 1.1f); scale = 1 / total; @@ -1364,7 +1356,7 @@ static void stbir__decode_scanline(stbir__info* stbir_info, int n) break; default: - STBIR__UNIMPLEMENTED("Unknown type/colorspace/channels combination."); + STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); break; } @@ -1425,7 +1417,7 @@ static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n) else { ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline) + 1) % stbir_info->vertical_filter_pixel_width; - STBIR__DEBUG_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index); + STBIR_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index); } ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float)); @@ -1457,11 +1449,11 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, int coefficient_group = coefficient_width * x; int coefficient_counter = 0; - STBIR__DEBUG_ASSERT(n1 >= n0); - STBIR__DEBUG_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR__DEBUG_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR__DEBUG_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); - STBIR__DEBUG_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n1 >= n0); + STBIR_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); switch (channels) { case 1: @@ -1469,7 +1461,7 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, { int in_pixel_index = k * 1; float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; } break; @@ -1478,7 +1470,7 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, { int in_pixel_index = k * 2; float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; } @@ -1488,7 +1480,7 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, { int in_pixel_index = k * 3; float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1499,7 +1491,7 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, { int in_pixel_index = k * 4; float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1512,7 +1504,7 @@ static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, int in_pixel_index = k * channels; float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; int c; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); for (c = 0; c < channels; c++) output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; } @@ -1535,7 +1527,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin; int max_x = input_w + filter_pixel_margin * 2; - STBIR__DEBUG_ASSERT(!stbir__use_width_upsampling(stbir_info)); + STBIR_ASSERT(!stbir__use_width_upsampling(stbir_info)); switch (channels) { case 1: @@ -1553,7 +1545,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n { int out_pixel_index = k * 1; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; } } @@ -1574,7 +1566,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n { int out_pixel_index = k * 2; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; } @@ -1596,7 +1588,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n { int out_pixel_index = k * 3; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1619,7 +1611,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n { int out_pixel_index = k * 4; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; @@ -1644,7 +1636,7 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n int c; int out_pixel_index = k * channels; float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR__DEBUG_ASSERT(coefficient != 0); + STBIR_ASSERT(coefficient != 0); for (c = 0; c < channels; c++) output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; } @@ -1856,7 +1848,7 @@ static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixels, void break; default: - STBIR__UNIMPLEMENTED("Unknown type/colorspace/channels combination."); + STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); break; } } @@ -1893,7 +1885,7 @@ static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n, in output_row_start = n * stbir_info->output_stride_bytes; - STBIR__DEBUG_ASSERT(stbir__use_height_upsampling(stbir_info)); + STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); memset(encode_buffer, 0, output_w * sizeof(float) * channels); @@ -2003,7 +1995,7 @@ static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n, n0 = vertical_contributors[contributor].n0; n1 = vertical_contributors[contributor].n1; - STBIR__DEBUG_ASSERT(!stbir__use_height_upsampling(stbir_info)); + STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); for (k = n0; k <= n1; k++) { @@ -2068,7 +2060,7 @@ static void stbir__buffer_loop_upsample(stbir__info* stbir_info) float scale_ratio = stbir_info->vertical_scale; float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio; - STBIR__DEBUG_ASSERT(stbir__use_height_upsampling(stbir_info)); + STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); for (y = 0; y < stbir_info->output_h; y++) { @@ -2077,7 +2069,7 @@ static void stbir__buffer_loop_upsample(stbir__info* stbir_info) stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out); - STBIR__DEBUG_ASSERT(in_last_scanline - in_first_scanline <= stbir_info->vertical_filter_pixel_width); + STBIR_ASSERT(in_last_scanline - in_first_scanline <= stbir_info->vertical_filter_pixel_width); if (stbir_info->ring_buffer_begin_index >= 0) { @@ -2169,7 +2161,7 @@ static void stbir__buffer_loop_downsample(stbir__info* stbir_info) int pixel_margin = stbir_info->vertical_filter_pixel_margin; int max_y = stbir_info->input_h + pixel_margin; - STBIR__DEBUG_ASSERT(!stbir__use_height_upsampling(stbir_info)); + STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); for (y = -pixel_margin; y < max_y; y++) { @@ -2178,7 +2170,7 @@ static void stbir__buffer_loop_downsample(stbir__info* stbir_info) stbir__calculate_sample_range_downsample(y, in_pixels_radius, scale_ratio, stbir_info->vertical_shift, &out_first_scanline, &out_last_scanline, &out_center_of_in); - STBIR__DEBUG_ASSERT(out_last_scanline - out_first_scanline <= stbir_info->vertical_filter_pixel_width); + STBIR_ASSERT(out_last_scanline - out_first_scanline <= stbir_info->vertical_filter_pixel_width); if (out_last_scanline < 0 || out_first_scanline >= output_h) continue; @@ -2229,8 +2221,8 @@ static void stbir__calculate_transform(stbir__info *info, float s0, float t0, fl info->horizontal_scale = ((float)info->output_w / info->input_w) / (s1 - s0); info->vertical_scale = ((float)info->output_h / info->input_h) / (t1 - t0); - info->horizontal_shift = s0 * info->input_w / (s1 - s0); - info->vertical_shift = t0 * info->input_h / (t1 - t0); + info->horizontal_shift = s0 * info->output_w / (s1 - s0); + info->vertical_shift = t0 * info->output_h / (t1 - t0); } } @@ -2380,7 +2372,7 @@ static int stbir__resize_allocated(stbir__info *info, info->ring_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); info->encode_buffer = STBIR__NEXT_MEMPTR(info->ring_buffer, float); - STBIR__DEBUG_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); + STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); } else { @@ -2388,7 +2380,7 @@ static int stbir__resize_allocated(stbir__info *info, info->ring_buffer = STBIR__NEXT_MEMPTR(info->horizontal_buffer, float); info->encode_buffer = NULL; - STBIR__DEBUG_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); + STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); } #undef STBIR__NEXT_MEMPTR @@ -2409,10 +2401,10 @@ static int stbir__resize_allocated(stbir__info *info, STBIR_PROGRESS_REPORT(1); #ifdef STBIR_DEBUG_OVERWRITE_TEST - STBIR__DEBUG_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR__DEBUG_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0); - STBIR__DEBUG_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR__DEBUG_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0); #endif return 1; diff --git a/src/stb_image_write.h b/src/stb_image_write.h index 98fa4103..4319c0de 100644 --- a/src/stb_image_write.h +++ b/src/stb_image_write.h @@ -1,4 +1,4 @@ -/* stb_image_write - v1.01 - public domain - http://nothings.org/stb/stb_image_write.h +/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 no warranty implied; use at your own risk @@ -102,12 +102,13 @@ CREDITS: Sergio Gonzalez Jonas Karlsson Filip Wasil + Thatcher Ulrich LICENSE -This software is in the public domain. Where that dedication is not -recognized, you are granted a perpetual, irrevocable license to copy, -distribute, and modify this file as you see fit. +This software is dual-licensed to the public domain and under the following +license: you are granted a perpetual, irrevocable license to copy, modify, +publish, and distribute this file as you see fit. */ @@ -736,7 +737,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l unsigned int bitbuf=0; int i,j, bitcount=0; unsigned char *out = NULL; - unsigned char **hash_table[stbiw__ZHASH]; // 64KB on the stack! + unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); if (quality < 5) quality = 5; stbiw__sbpush(out, 0x78); // DEFLATE 32K window @@ -808,6 +809,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l for (i=0; i < stbiw__ZHASH; ++i) (void) stbiw__sbfree(hash_table[i]); + STBIW_FREE(hash_table); { // compute adler32 on input @@ -1015,6 +1017,8 @@ STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, #endif // STB_IMAGE_WRITE_IMPLEMENTATION /* Revision history + 1.02 (2016-04-02) + avoid allocating large structures on the stack 1.01 (2016-01-16) STBIW_REALLOC_SIZED: support allocators with no realloc support avoid race-condition in crc initialization diff --git a/src/stb_rect_pack.h b/src/stb_rect_pack.h index 63a5b159..bd1cfc60 100644 --- a/src/stb_rect_pack.h +++ b/src/stb_rect_pack.h @@ -1,4 +1,4 @@ -// stb_rect_pack.h - v0.06 - public domain - rectangle packing +// stb_rect_pack.h - v0.08 - public domain - rectangle packing // Sean Barrett 2014 // // Useful for e.g. packing rectangular textures into an atlas. @@ -28,14 +28,22 @@ // Minor features // Martins Mozeiko // Bugfixes / warning fixes -// [your name could be here] +// Jeremy Jaussaud // // Version history: // +// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) +// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort // 0.05: added STBRP_ASSERT to allow replacing assert // 0.04: fixed minor bug in STBRP_LARGE_RECTS support // 0.01: initial release +// +// LICENSE +// +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. ////////////////////////////////////////////////////////////////////////////// // @@ -541,12 +549,16 @@ STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int n STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); for (i=0; i < num_rects; ++i) { - stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); - if (fr.prev_link) { - rects[i].x = (stbrp_coord) fr.x; - rects[i].y = (stbrp_coord) fr.y; + if (rects[i].w == 0 || rects[i].h == 0) { + rects[i].x = rects[i].y = 0; // empty rect needs no space } else { - rects[i].x = rects[i].y = STBRP__MAXVAL; + stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); + if (fr.prev_link) { + rects[i].x = (stbrp_coord) fr.x; + rects[i].y = (stbrp_coord) fr.y; + } else { + rects[i].x = rects[i].y = STBRP__MAXVAL; + } } } diff --git a/src/stb_truetype.h b/src/stb_truetype.h index bfb1841f..d360d609 100644 --- a/src/stb_truetype.h +++ b/src/stb_truetype.h @@ -1,4 +1,4 @@ -// stb_truetype.h - v1.09 - public domain +// stb_truetype.h - v1.11 - public domain // authored from 2009-2015 by Sean Barrett / RAD Game Tools // // This library processes TrueType files: @@ -21,6 +21,10 @@ // Mikko Mononen: compound shape support, more cmap formats // Tor Andersson: kerning, subpixel rendering // +// Misc other: +// Ryan Gordon +// Simon Glass +// // Bug/warning reports/fixes: // "Zer" on mollyrocket (with fix) // Cass Everitt @@ -45,11 +49,10 @@ // Thomas Fields // Derek Vinyard // -// Misc other: -// Ryan Gordon -// // VERSION HISTORY // +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; @@ -68,9 +71,9 @@ // // LICENSE // -// This software is in the public domain. Where that dedication is not -// recognized, you are granted a perpetual, irrevocable license to copy, -// distribute, and modify this file as you see fit. +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. // // USAGE // @@ -406,6 +409,11 @@ int main(int arg, char **argv) #define STBTT_sqrt(x) sqrt(x) #endif + #ifndef STBTT_fabs + #include + #define STBTT_fabs(x) fabs(x) + #endif + // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h #ifndef STBTT_malloc #include @@ -629,7 +637,7 @@ STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); // The following structure is defined publically so you can declare one on // the stack or as a global or etc, but you should treat it as opaque. -typedef struct stbtt_fontinfo +struct stbtt_fontinfo { void * userdata; unsigned char * data; // pointer to .ttf file @@ -640,7 +648,7 @@ typedef struct stbtt_fontinfo int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf int index_map; // a cmap mapping for our chosen character encoding int indexToLocFormat; // format needed to map from glyph index to glyph -} stbtt_fontinfo; +}; STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); // Given an offset into the file that defines a font, this function builds @@ -942,6 +950,12 @@ typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERS #define STBTT_RASTERIZER_VERSION 2 #endif +#ifdef _MSC_VER +#define STBTT__NOTUSED(v) (void)(v) +#else +#define STBTT__NOTUSED(v) (void)sizeof(v) +#endif + ////////////////////////////////////////////////////////////////////////// // // accessors to parse data from file @@ -1993,7 +2007,7 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, } y_crossing += dy * (x2 - (x1+1)); - STBTT_assert(fabs(area) <= 1.01f); + STBTT_assert(STBTT_fabs(area) <= 1.01f); scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); @@ -2071,6 +2085,8 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int y,j=0, i; float scanline_data[129], *scanline, *scanline2; + STBTT__NOTUSED(vsubsample); + if (result->w > 64) scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); else @@ -2129,7 +2145,7 @@ static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int m; sum += scanline2[i]; k = scanline[i] + sum; - k = (float) fabs(k)*255 + 0.5f; + k = (float) STBTT_fabs(k)*255 + 0.5f; m = (int) k; if (m > 255) m = 255; result->pixels[j*result->stride + i] = (unsigned char) m; @@ -2430,7 +2446,10 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info if (scale_x == 0) scale_x = scale_y; if (scale_y == 0) { - if (scale_x == 0) return NULL; + if (scale_x == 0) { + STBTT_free(vertices, info->userdata); + return NULL; + } scale_y = scale_x; } @@ -2586,11 +2605,6 @@ STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int // #ifndef STB_RECT_PACK_VERSION -#ifdef _MSC_VER -#define STBTT__NOTUSED(v) (void)(v) -#else -#define STBTT__NOTUSED(v) (void)sizeof(v) -#endif typedef int stbrp_coord; @@ -3205,6 +3219,10 @@ STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const // FULL VERSION HISTORY // +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) allow user-defined fabs() replacement +// fix memory leak if fontsize=0.0 +// fix warning from duplicate typedef // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges // 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges // 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; diff --git a/src/stb_vorbis.c b/src/stb_vorbis.c index 0510edc7..07d79318 100644 --- a/src/stb_vorbis.c +++ b/src/stb_vorbis.c @@ -168,6 +168,9 @@ #include #if !(defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)) #include +#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) +#include +#endif #endif #else // STB_VORBIS_NO_CRT #define NULL 0 @@ -1484,85 +1487,6 @@ static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **out return TRUE; } -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK -static int codebook_decode_deinterleave_repeat_2(vorb *f, Codebook *c, float **outputs, int *c_inter_p, int *p_inter_p, int len, int total_decode) -{ - int c_inter = *c_inter_p; - int p_inter = *p_inter_p; - int i,z, effective = c->dimensions; - - // type 0 is only legal in a scalar context - if (c->lookup_type == 0) return error(f, VORBIS_invalid_stream); - - while (total_decode > 0) { - float last = CODEBOOK_ELEMENT_BASE(c); - DECODE_VQ(z,f,c); - - if (z < 0) { - if (!f->bytes_in_seg) - if (f->last_seg) return FALSE; - return error(f, VORBIS_invalid_stream); - } - - // if this will take us off the end of the buffers, stop short! - // we check by computing the length of the virtual interleaved - // buffer (len*ch), our current offset within it (p_inter*ch)+(c_inter), - // and the length we'll be using (effective) - if (c_inter + p_inter*2 + effective > len * 2) { - effective = len*2 - (p_inter*2 - c_inter); - } - - { - z *= c->dimensions; - if (c->sequence_p) { - // haven't optimized this case because I don't have any examples - for (i=0; i < effective; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == 2) { c_inter = 0; ++p_inter; } - last = val; - } - } else { - i=0; - if (c_inter == 1 && i < effective) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - c_inter = 0; ++p_inter; - ++i; - } - { - float *z0 = outputs[0]; - float *z1 = outputs[1]; - for (; i+1 < effective;) { - float v0 = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - float v1 = CODEBOOK_ELEMENT_FAST(c,z+i+1) + last; - if (z0) - z0[p_inter] += v0; - if (z1) - z1[p_inter] += v1; - ++p_inter; - i += 2; - } - } - if (i < effective) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == 2) { c_inter = 0; ++p_inter; } - } - } - } - - total_decode -= effective; - } - *c_inter_p = c_inter; - *p_inter_p = p_inter; - return TRUE; -} -#endif - static int predict_point(int x, int x0, int x1, int y0, int y1) { int dy = y1 - y0; @@ -1941,6 +1865,11 @@ static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int } done: CHECK(f); + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + temp_free(f,part_classdata); + #else + temp_free(f,classifications); + #endif temp_alloc_restore(f,temp_alloc_point); } @@ -2586,6 +2515,7 @@ static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) } } + temp_free(f,buf2); temp_alloc_restore(f,save_point); } @@ -3499,7 +3429,6 @@ static int start_decoder(vorb *f) } } } - setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); c->lookup_type = 2; } else @@ -3515,11 +3444,11 @@ static int start_decoder(vorb *f) if (c->sequence_p) last = val; } - setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); } #ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK skip:; #endif + setup_temp_free(f, mults, sizeof(mults[0])*c->lookup_values); CHECK(f); } @@ -4045,7 +3974,7 @@ int stb_vorbis_decode_frame_pushdata( while (get8_packet(f) != EOP) if (f->eof) break; *samples = 0; - return f->stream - data; + return (int) (f->stream - data); } if (error == VORBIS_continued_packet_flag_invalid) { if (f->previous_length == 0) { @@ -4055,7 +3984,7 @@ int stb_vorbis_decode_frame_pushdata( while (get8_packet(f) != EOP) if (f->eof) break; *samples = 0; - return f->stream - data; + return (int) (f->stream - data); } } // if we get an error while parsing, what to do? @@ -4075,7 +4004,7 @@ int stb_vorbis_decode_frame_pushdata( if (channels) *channels = f->channels; *samples = len; *output = f->outputs; - return f->stream - data; + return (int) (f->stream - data); } stb_vorbis *stb_vorbis_open_pushdata( @@ -4098,7 +4027,7 @@ stb_vorbis *stb_vorbis_open_pushdata( f = vorbis_alloc(&p); if (f) { *f = p; - *data_used = f->stream - data; + *data_used = (int) (f->stream - data); *error = 0; return f; } else { @@ -4113,9 +4042,9 @@ unsigned int stb_vorbis_get_file_offset(stb_vorbis *f) #ifndef STB_VORBIS_NO_PUSHDATA_API if (f->push_mode) return 0; #endif - if (USE_MEMORY(f)) return f->stream - f->stream_start; + if (USE_MEMORY(f)) return (unsigned int) (f->stream - f->stream_start); #ifndef STB_VORBIS_NO_STDIO - return ftell(f->f) - f->f_start; + return (unsigned int) (ftell(f->f) - f->f_start); #endif } @@ -4611,7 +4540,7 @@ stb_vorbis * stb_vorbis_open_file_section(FILE *file, int close_on_free, int *er stb_vorbis *f, p; vorbis_init(&p, alloc); p.f = file; - p.f_start = ftell(file); + p.f_start = (uint32) ftell(file); p.stream_len = length; p.close_on_free = close_on_free; if (start_decoder(&p)) { @@ -4630,9 +4559,9 @@ stb_vorbis * stb_vorbis_open_file_section(FILE *file, int close_on_free, int *er stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc) { unsigned int len, start; - start = ftell(file); + start = (unsigned int) ftell(file); fseek(file, 0, SEEK_END); - len = ftell(file) - start; + len = (unsigned int) (ftell(file) - start); fseek(file, start, SEEK_SET); return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len); } @@ -5027,6 +4956,9 @@ int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, in #endif // STB_VORBIS_NO_PULLDATA_API /* Version history + 1.09 - 2016/04/04 - back out 'avoid discarding last frame' fix from previous version + 1.08 - 2016/04/02 - fixed multiple warnings; fix setup memory leaks; + avoid discarding last frame of audio data 1.07 - 2015/01/16 - fixed some warnings, fix mingw, const-correct API some more crash fixes when out of memory or with corrupt files 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) diff --git a/src/stb_vorbis.h b/src/stb_vorbis.h index bd318972..624ce4bc 100644 --- a/src/stb_vorbis.h +++ b/src/stb_vorbis.h @@ -1,4 +1,4 @@ -// Ogg Vorbis audio decoder - v1.07 - public domain +// Ogg Vorbis audio decoder - v1.09 - public domain // http://nothings.org/stb_vorbis/ // // Original version written by Sean Barrett in 2007. @@ -9,9 +9,9 @@ // // LICENSE // -// This software is in the public domain. Where that dedication is not -// recognized, you are granted a perpetual, irrevocable license to copy, -// distribute, and modify this file as you see fit. +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. // // No warranty for any purpose is expressed or implied by the author (nor // by RAD Game Tools). Report bugs and send enhancements to the author. @@ -31,11 +31,14 @@ // Terje Mathisen Niklas Frykholm Andy Hill // Casey Muratori John Bolton Gargaj // Laurent Gomila Marc LeBlanc Ronny Chevalier -// Bernhard Wodo Evan Balster "alxprd"@github +// Bernhard Wodo Evan Balster alxprd@github // Tom Beaumont Ingo Leitgeb Nicolas Guillemot -// Phillip Bennefall Rohit +// Phillip Bennefall Rohit Thiago Goulart +// manxorist@github saga musix // // Partial history: +// 1.09 - 2016/04/04 - back out 'truncation of last frame' fix from previous version +// 1.08 - 2016/04/02 - warnings; setup memory leaks; truncation of last frame // 1.07 - 2015/01/16 - fixes for crashes on invalid files; warning fixes; const // 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) // some crash fixes when out of memory or with corrupt files @@ -72,11 +75,6 @@ #include "utils.h" // Android fopen function map #endif -// RaySan: Added for Linux -#ifdef __linux - #include -#endif - #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3 From aa22d979834eeddb849f45bba7c0f467b575e6db Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 7 Apr 2016 13:31:53 +0200 Subject: Simplified texture flip and added comments --- src/rlgl.c | 10 +++++++--- src/textures.c | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index b2a36351..f0acf124 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1897,6 +1897,9 @@ Model rlglLoadModel(Mesh mesh) // Create buffers for our vertex data (positions, texcoords, normals) glGenBuffers(3, vertexBuffer); + + // NOTE: Default shader is assigned to model, so vbo buffers are properly linked to vertex attribs + // If model shader is changed, vbo buffers must be re-assigned to new location points (previously loaded) // Enable vertex attributes: position glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[0]); @@ -2489,13 +2492,14 @@ static Shader LoadDefaultShader(void) } // Get location handlers to for shader attributes and uniforms +// NOTE: If any location is not found, loc point becomes -1 static void LoadDefaultShaderLocations(Shader *shader) { // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); shader->texcoordLoc = glGetAttribLocation(shader->id, "vertexTexCoord"); shader->normalLoc = glGetAttribLocation(shader->id, "vertexNormal"); - shader->colorLoc = glGetAttribLocation(shader->id, "vertexColor"); // -1 if not found + shader->colorLoc = glGetAttribLocation(shader->id, "vertexColor"); // Get handles to GLSL uniform locations (vertex shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); @@ -2503,8 +2507,8 @@ static void LoadDefaultShaderLocations(Shader *shader) // Get handles to GLSL uniform locations (fragment shader) shader->tintColorLoc = glGetUniformLocation(shader->id, "fragTintColor"); shader->mapDiffuseLoc = glGetUniformLocation(shader->id, "texture0"); - shader->mapNormalLoc = glGetUniformLocation(shader->id, "texture1"); // -1 if not found - shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); // -1 if not found + shader->mapNormalLoc = glGetUniformLocation(shader->id, "texture1"); + shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); } // Read text file diff --git a/src/textures.c b/src/textures.c index 67264afb..79047ab7 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1385,6 +1385,10 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float sc void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint) { Rectangle destRec = { (int)position.x, (int)position.y, abs(sourceRec.width), abs(sourceRec.height) }; + + if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; + if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; + Vector2 origin = { 0, 0 }; DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint); -- cgit v1.2.3 From c1e49d2b13c75da2c532079d454fad32f9ceccd4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 8 Apr 2016 12:00:29 +0200 Subject: Removed function I decided it is redundant and could be confusing (when mixed with 3D drawing). It's not KISS. --- src/core.c | 11 ----------- src/raylib.h | 1 - 2 files changed, 12 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index ae6f4cad..e01f3969 100644 --- a/src/core.c +++ b/src/core.c @@ -568,17 +568,6 @@ void BeginDrawingEx(Camera2D camera) rlMultMatrixf(MatrixToFloat(matTransform)); } -// Setup drawing canvas with pro parameters -void BeginDrawingPro(int blendMode, Shader shader, Matrix transform) -{ - BeginDrawing(); - - SetBlendMode(blendMode); - SetCustomShader(shader); - - rlMultMatrixf(MatrixToFloat(transform)); -} - // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void) { diff --git a/src/raylib.h b/src/raylib.h index 22fcb4ac..52a5e73c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -567,7 +567,6 @@ int GetScreenHeight(void); // Get current scree void ClearBackground(Color color); // Sets Background Color void BeginDrawing(void); // Setup drawing canvas to start drawing void BeginDrawingEx(Camera2D camera); // Setup drawing canvas with 2d camera -void BeginDrawingPro(int blendMode, Shader shader, Matrix transform); // Setup drawing canvas with pro parameters void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) -- cgit v1.2.3 From 284eaf157692469e061782fbf3753e22ee5eb861 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 10 Apr 2016 19:38:57 +0200 Subject: Use Depth Texture on OpenGL 3.3 --- src/rlgl.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index f0acf124..b659577a 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1688,7 +1688,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) target.depth.id = 0; target.depth.width = width; target.depth.height = height; - target.depth.format = 19; //DEPTH_COMPONENT_16BIT + target.depth.format = 19; //DEPTH_COMPONENT_24BIT target.depth.mipmaps = 1; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -1701,14 +1701,18 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); - -#define USE_DEPTH_RENDERBUFFER + +#if defined(GRAPHICS_API_OPENGL_33) + #define USE_DEPTH_TEXTURE +#else + #define USE_DEPTH_RENDERBUFFER +#endif + #if defined(USE_DEPTH_RENDERBUFFER) // Create the renderbuffer that will serve as the depth attachment for the framebuffer. glGenRenderbuffers(1, &target.depth.id); glBindRenderbuffer(GL_RENDERBUFFER, target.depth.id); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height); - #elif defined(USE_DEPTH_TEXTURE) // NOTE: We can also use a texture for depth buffer (GL_ARB_depth_texture/GL_OES_depth_texture extension required) // A renderbuffer is simpler than a texture and could offer better performance on embedded devices @@ -1718,7 +1722,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glBindTexture(GL_TEXTURE_2D, 0); #endif -- cgit v1.2.3 From 6b5e18e6bfe9940987cc38dcf40e2e903fe3b235 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Apr 2016 11:19:32 +0200 Subject: Make mouse inputs available on Android for... ... easy code porting, transalating them to touches and gestures internally. Removed function SetCustomCursor(), it can be managed by the user. --- src/core.c | 245 ++++++++++++++++++++++++++++++++--------------------------- src/raylib.h | 35 ++++----- 2 files changed, 148 insertions(+), 132 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index e01f3969..294936fb 100644 --- a/src/core.c +++ b/src/core.c @@ -195,26 +195,19 @@ static int renderOffsetY = 0; // Offset Y from render area (must b static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size) -static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... - -static bool customCursor = false; // Tracks if custom cursor has been set static bool cursorOnScreen = false; // Tracks if cursor is inside client area -static Texture2D cursor; // Cursor texture - -static Vector2 mousePosition; // Mouse position on screen static char previousKeyState[512] = { 0 }; // Required to check if key pressed/released once static char currentKeyState[512] = { 0 }; // Required to check if key pressed/released once -static char previousMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once -static char currentMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once - static char previousGamepadState[32] = {0}; // Required to check if gamepad btn pressed/released once static char currentGamepadState[32] = {0}; // Required to check if gamepad btn pressed/released once +static char previousMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once +static char currentMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once + static int previousMouseWheelY = 0; // Required to track mouse wheel variation static int currentMouseWheelY = 0; // Required to track mouse wheel variation @@ -224,6 +217,9 @@ static int lastKeyPressed = -1; // Register last key pressed static bool cursorHidden; // Track if cursor is hidden #endif +static Vector2 mousePosition; // Mouse position on screen +static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen + #if defined(PLATFORM_DESKTOP) static char **dropFilesPath; // Store dropped files paths as strings static int dropFilesCount = 0; // Count stored strings @@ -494,29 +490,6 @@ void ToggleFullscreen(void) #endif } -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) -// Set a custom cursor icon/image -void SetCustomCursor(const char *cursorImage) -{ - if (customCursor) UnloadTexture(cursor); - - cursor = LoadTexture(cursorImage); - -#if defined(PLATFORM_DESKTOP) - // NOTE: emscripten not implemented - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -#endif - customCursor = true; -} - -// Set a custom key to exit program -// NOTE: default exitKey is ESCAPE -void SetExitKey(int key) -{ - exitKey = key; -} -#endif - // Get current screen width int GetScreenWidth(void) { @@ -1032,78 +1005,11 @@ int GetKeyPressed(void) return lastKeyPressed; } -// Detect if a mouse button has been pressed once -bool IsMouseButtonPressed(int button) -{ - bool pressed = false; - - if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true; - else pressed = false; - - return pressed; -} - -// Detect if a mouse button is being pressed -bool IsMouseButtonDown(int button) -{ - if (GetMouseButtonStatus(button) == 1) return true; - else return false; -} - -// Detect if a mouse button has been released once -bool IsMouseButtonReleased(int button) -{ - bool released = false; - - if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 0)) released = true; - else released = false; - - return released; -} - -// Detect if a mouse button is NOT being pressed -bool IsMouseButtonUp(int button) -{ - if (GetMouseButtonStatus(button) == 0) return true; - else return false; -} - -// Returns mouse position X -int GetMouseX(void) -{ - return (int)mousePosition.x; -} - -// Returns mouse position Y -int GetMouseY(void) -{ - return (int)mousePosition.y; -} - -// Returns mouse position XY -Vector2 GetMousePosition(void) -{ - return mousePosition; -} - -// Set mouse position XY -void SetMousePosition(Vector2 position) -{ - mousePosition = position; -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - // NOTE: emscripten not implemented - glfwSetCursorPos(window, position.x, position.y); -#endif -} - -// Returns mouse wheel movement Y -int GetMouseWheelMove(void) +// Set a custom key to exit program +// NOTE: default exitKey is ESCAPE +void SetExitKey(int key) { -#if defined(PLATFORM_WEB) - return previousMouseWheelY/100; -#else - return previousMouseWheelY; -#endif + exitKey = key; } // Hide mouse cursor @@ -1280,6 +1186,111 @@ bool IsGamepadButtonUp(int gamepad, int button) } #endif //defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) + +// Detect if a mouse button has been pressed once +bool IsMouseButtonPressed(int button) +{ + bool pressed = false; + +#if defined(PLATFORM_ANDROID) + if (IsGestureDetected() && (GetGestureType() == GESTURE_TAP)) pressed = true; +#else + if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true; +#endif + + return pressed; +} + +// Detect if a mouse button is being pressed +bool IsMouseButtonDown(int button) +{ + bool down = false; + +#if defined(PLATFORM_ANDROID) + if (IsGestureDetected() && (GetGestureType() == GESTURE_HOLD)) down = true; +#else + if (GetMouseButtonStatus(button) == 1) down = true; +#endif + + return down; +} + +// Detect if a mouse button has been released once +bool IsMouseButtonReleased(int button) +{ + bool released = false; + +#if !defined(PLATFORM_ANDROID) + if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 0)) released = true; +#endif + + return released; +} + +// Detect if a mouse button is NOT being pressed +bool IsMouseButtonUp(int button) +{ + bool up = false; + +#if !defined(PLATFORM_ANDROID) + if (GetMouseButtonStatus(button) == 0) up = true; +#endif + + return up; +} + +// Returns mouse position X +int GetMouseX(void) +{ +#if defined(PLATFORM_ANDROID) + return (int)touchPosition[0].x; +#else + return (int)mousePosition.x; +#endif +} + +// Returns mouse position Y +int GetMouseY(void) +{ +#if defined(PLATFORM_ANDROID) + return (int)touchPosition[0].x; +#else + return (int)mousePosition.y; +#endif +} + +// Returns mouse position XY +Vector2 GetMousePosition(void) +{ +#if defined(PLATFORM_ANDROID) + return GetTouchPosition(0); +#else + return mousePosition; +#endif +} + +// Set mouse position XY +void SetMousePosition(Vector2 position) +{ + mousePosition = position; +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + // NOTE: emscripten not implemented + glfwSetCursorPos(window, position.x, position.y); +#endif +} + +// Returns mouse wheel movement Y +int GetMouseWheelMove(void) +{ +#if defined(PLATFORM_ANDROID) + return 0; +#elif defined(PLATFORM_WEB) + return previousMouseWheelY/100; +#else + return previousMouseWheelY; +#endif +} + // Returns touch position X int GetTouchX(void) { @@ -1376,7 +1387,7 @@ static void InitDisplay(int width, int height) // Downscale matrix is required in case desired screen area is bigger than display area downscaleView = MatrixIdentity(); - + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSetErrorCallback(ErrorCallback); @@ -1393,10 +1404,12 @@ static void InitDisplay(int width, int height) // Screen size security check if (screenWidth <= 0) screenWidth = displayWidth; if (screenHeight <= 0) screenHeight = displayHeight; -#elif defined(PLATFORM_WEB) +#endif // defined(PLATFORM_DESKTOP) + +#if defined(PLATFORM_WEB) displayWidth = screenWidth; displayHeight = screenHeight; -#endif +#endif // defined(PLATFORM_WEB) glfwDefaultWindowHints(); // Set default windows hints @@ -1447,7 +1460,7 @@ static void InitDisplay(int width, int height) // TODO: Check modes[i]->width; // TODO: Check modes[i]->height; } - + window = glfwCreateWindow(screenWidth, screenHeight, windowTitle, glfwGetPrimaryMonitor(), NULL); } else @@ -1543,8 +1556,9 @@ static void InitDisplay(int width, int height) } //glfwGetFramebufferSize(window, &renderWidth, &renderHeight); // Get framebuffer size of current window +#endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) fullscreen = true; // Screen size security check @@ -1629,8 +1643,9 @@ static void InitDisplay(int width, int height) //ANativeWindow_setBuffersGeometry(app->window, 0, 0, displayFormat); // Force use of native display size surface = eglCreateWindowSurface(display, config, app->window, NULL); +#endif // defined(PLATFORM_ANDROID) -#elif defined(PLATFORM_RPI) +#if defined(PLATFORM_RPI) graphics_get_display_size(0, &displayWidth, &displayHeight); // At this point we need to manage render size vs screen size @@ -1668,7 +1683,7 @@ static void InitDisplay(int width, int height) surface = eglCreateWindowSurface(display, config, &nativeWindow, NULL); //--------------------------------------------------------------------------------- -#endif +#endif // defined(PLATFORM_RPI) // There must be at least one frame displayed before the buffers are swapped //eglSwapInterval(display, 1); @@ -1688,13 +1703,17 @@ static void InitDisplay(int width, int height) TraceLog(INFO, "Screen size: %i x %i", screenWidth, screenHeight); TraceLog(INFO, "Viewport offsets: %i, %i", renderOffsetX, renderOffsetY); } -#endif +#endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) } // Initialize OpenGL graphics static void InitGraphics(void) { rlglInit(); // Init rlgl + +#if defined(PLATFORM_OCULUS) + //rlglInitOculus(); // Init rlgl for Oculus Rift (required textures) +#endif rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) @@ -2153,7 +2172,7 @@ static bool GetMouseButtonStatus(int button) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetMouseButton(window, button); #elif defined(PLATFORM_ANDROID) - // TODO: Check for virtual keyboard + // TODO: Check for virtual mouse return false; #elif defined(PLATFORM_RPI) // NOTE: Mouse buttons states are filled in PollInputEvents() diff --git a/src/raylib.h b/src/raylib.h index 52a5e73c..2fe29cc8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -557,13 +557,15 @@ void CloseWindow(void); // Close Window and bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP) -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -void SetCustomCursor(const char *cursorImage); // Set a custom cursor icon/image -void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -#endif int GetScreenWidth(void); // Get current screen width int GetScreenHeight(void); // Get current screen height +void ShowCursor(void); // Shows cursor +void HideCursor(void); // Hides cursor +bool IsCursorHidden(void); // Returns true if cursor is not visible +void EnableCursor(void); // Enables cursor +void DisableCursor(void); // Disables cursor + void ClearBackground(Color color); // Sets Background Color void BeginDrawing(void); // Setup drawing canvas to start drawing void BeginDrawingEx(Camera2D camera); // Setup drawing canvas with 2d camera @@ -610,6 +612,15 @@ bool IsKeyDown(int key); // Detect if a key is be bool IsKeyReleased(int key); // Detect if a key has been released once bool IsKeyUp(int key); // Detect if a key is NOT being pressed int GetKeyPressed(void); // Get latest key pressed +void SetExitKey(int key); // Set a custom key to exit program (default is ESC) + +bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once +bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed +bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once +bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed +#endif bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed @@ -621,20 +632,6 @@ Vector2 GetMousePosition(void); // Returns mouse positio void SetMousePosition(Vector2 position); // Set mouse position XY int GetMouseWheelMove(void); // Returns mouse wheel movement Y -void ShowCursor(void); // Shows cursor -void HideCursor(void); // Hides cursor -void EnableCursor(void); // Enables cursor -void DisableCursor(void); // Disables cursor -bool IsCursorHidden(void); // Returns true if cursor is not visible - -bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available -float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis -bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once -bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed -bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once -bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed -#endif - int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) @@ -649,7 +646,7 @@ bool IsButtonReleased(int button); // Detect if an android // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures -void UpdateGestures(void); // Update gestures detected (must be called every frame) +void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents()) bool IsGestureDetected(void); // Check if a gesture have been detected int GetGestureType(void); // Get latest detected gesture void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -- cgit v1.2.3 From 2e5d898443767e027f0e1deab7ed3060085b62fd Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Apr 2016 11:25:04 +0200 Subject: Corrected bug with old FBO struct --- src/rlgl.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index b659577a..06efd777 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1712,7 +1712,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) // Create the renderbuffer that will serve as the depth attachment for the framebuffer. glGenRenderbuffers(1, &target.depth.id); glBindRenderbuffer(GL_RENDERBUFFER, target.depth.id); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height); // GL_DEPTH_COMPONENT24 not supported on Android #elif defined(USE_DEPTH_TEXTURE) // NOTE: We can also use a texture for depth buffer (GL_ARB_depth_texture/GL_OES_depth_texture extension required) // A renderbuffer is simpler than a texture and could offer better performance on embedded devices @@ -2032,8 +2032,9 @@ void *rlglReadTexturePixels(Texture2D texture) #endif #if defined(GRAPHICS_API_OPENGL_ES2) - FBO fbo = rlglLoadFBO(texture.width, texture.height); - + + RenderTexture2D fbo = rlglLoadRenderTexture(texture.width, texture.height); + // NOTE: Two possible Options: // 1 - Bind texture to color fbo attachment and glReadPixels() // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() @@ -2054,7 +2055,7 @@ void *rlglReadTexturePixels(Texture2D texture) glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); // Re-attach internal FBO color texture before deleting it - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.colorTextureId, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.texture.id, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -2093,7 +2094,8 @@ void *rlglReadTexturePixels(Texture2D texture) #endif // GET_TEXTURE_FBO_OPTION // Clean up temporal fbo - rlglUnloadFBO(fbo); + rlDeleteRenderTextures(fbo); + #endif return pixels; -- cgit v1.2.3 From 17eefed08fa052b39c9ee4c4cb486794a8551c92 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Apr 2016 11:36:40 +0200 Subject: Improved gestures system --- src/core.c | 4 ++-- src/gestures.c | 6 +++--- src/gestures.h | 4 ++-- src/raylib.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 294936fb..7b1d5960 100644 --- a/src/core.c +++ b/src/core.c @@ -1193,7 +1193,7 @@ bool IsMouseButtonPressed(int button) bool pressed = false; #if defined(PLATFORM_ANDROID) - if (IsGestureDetected() && (GetGestureType() == GESTURE_TAP)) pressed = true; + if (IsGestureDetected(GESTURE_TAP)) pressed = true; #else if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 1)) pressed = true; #endif @@ -1207,7 +1207,7 @@ bool IsMouseButtonDown(int button) bool down = false; #if defined(PLATFORM_ANDROID) - if (IsGestureDetected() && (GetGestureType() == GESTURE_HOLD)) down = true; + if (IsGestureDetected(GESTURE_HOLD)) down = true; #else if (GetMouseButtonStatus(button) == 1) down = true; #endif diff --git a/src/gestures.c b/src/gestures.c index b0a80084..d72aaf4e 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -292,14 +292,14 @@ void UpdateGestures(void) } // Check if a gesture have been detected -bool IsGestureDetected(void) +bool IsGestureDetected(int gesture) { - if ((enabledGestures & currentGesture) != GESTURE_NONE) return true; + if ((enabledGestures & currentGesture) == gesture) return true; else return false; } // Check gesture type -int GetGestureType(void) +int GetGestureDetected(void) { // Get current gesture only if enabled return (enabledGestures & currentGesture); diff --git a/src/gestures.h b/src/gestures.h index 5468eb54..f2bdaba4 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -92,8 +92,8 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures void UpdateGestures(void); // Update gestures detected (must be called every frame) -bool IsGestureDetected(void); // Check if a gesture have been detected -int GetGestureType(void); // Get latest detected gesture +bool IsGestureDetected(int gesture); // Check if a gesture have been detected +int GetGestureDetected(void); // Get latest detected gesture void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags int GetTouchPointsCount(void); // Get touch points count diff --git a/src/raylib.h b/src/raylib.h index 2fe29cc8..0c80b957 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -647,8 +647,8 @@ bool IsButtonReleased(int button); // Detect if an android //------------------------------------------------------------------------------------ void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents()) -bool IsGestureDetected(void); // Check if a gesture have been detected -int GetGestureType(void); // Get latest detected gesture +bool IsGestureDetected(int gesture); // Check if a gesture have been detected +int GetGestureDetected(void); // Get latest detected gesture void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags int GetTouchPointsCount(void); // Get touch points count -- cgit v1.2.3 From 9639b14e1bbfb9065d788dd6341527c93ad55e88 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Apr 2016 14:48:20 +0200 Subject: Reduce PCM buffer size for Android to avoid stalls --- src/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 260f6778..75383385 100644 --- a/src/audio.c +++ b/src/audio.c @@ -57,8 +57,8 @@ //---------------------------------------------------------------------------------- #define MUSIC_STREAM_BUFFERS 2 -#if defined(PLATFORM_RPI) - // NOTE: On RPI should be lower to avoid frame-stalls +#if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) + // NOTE: On RPI and Android should be lower to avoid frame-stalls #define MUSIC_BUFFER_SIZE 4096*2 // PCM data buffer (short) - 16Kb (RPI) #else // NOTE: On HTML5 (emscripten) this is allocated on heap, by default it's only 16MB!...just take care... -- cgit v1.2.3 From ec2cbaa5eb5c4bca059c5592932746369e1e293d Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 24 Apr 2016 15:25:48 -0700 Subject: Added proto version of jar_xm This is an early draft, needs lots of work. Still need to figure out way to calculate total length of song. This is hard because xm tracks stream out zeros when done, only position in track can be found. Position does not give any direct value of how much more time is left. I think that by setting the loop count to 1 and seeking until the end I can total up the number of samples and come up with a length. --- src/audio.c | 81 +- src/jar_xm.h | 2647 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2712 insertions(+), 16 deletions(-) create mode 100644 src/jar_xm.h (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 75383385..9baa2222 100644 --- a/src/audio.c +++ b/src/audio.c @@ -42,6 +42,8 @@ #include // Required for strcmp() #include // Used for .WAV loading +#include "jar_xm.h" // For playing .xm files + #if defined(AUDIO_STANDALONE) #include // Used for functions with variable number of parameters (TraceLog()) #else @@ -73,6 +75,7 @@ // NOTE: Anything longer than ~10 seconds should be streamed... typedef struct Music { stb_vorbis *stream; + jar_xm_context_t *chipctx; // Stores jar_xm context ALuint buffers[MUSIC_STREAM_BUFFERS]; ALuint source; @@ -82,7 +85,7 @@ typedef struct Music { int sampleRate; int totalSamplesLeft; bool loop; - + bool chipTune; // True if chiptune is loaded } Music; #if defined(AUDIO_STANDALONE) @@ -564,6 +567,22 @@ void PlayMusicStream(char *fileName) currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; } } + else if (strcmp(GetExtension(fileName),"xm") == 0) + { + currentMusic.chipTune = true; + currentMusic.channels = 2; + currentMusic.sampleRate = 48000; + currentMusic.loop = true; + + // only stereo/float is supported for xm + if(info.channels == 2 && !jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) + { + currentMusic.format = AL_FORMAT_STEREO_FLOAT32; + jar_xm_set_max_loop_count(currentMusic.chipctx, 0); //infinite number of loops + //currentMusic.totalSamplesLeft = ; // Unsure of how to calculate this + musicEnabled = true; + } + } else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); } @@ -572,14 +591,19 @@ void StopMusicStream(void) { if (musicEnabled) { - alSourceStop(currentMusic.source); - - EmptyMusicStream(); // Empty music buffers - - alDeleteSources(1, ¤tMusic.source); - alDeleteBuffers(2, currentMusic.buffers); - - stb_vorbis_close(currentMusic.stream); + alSourceStop(currentMusic.source); + EmptyMusicStream(); // Empty music buffers + alDeleteSources(1, ¤tMusic.source); + alDeleteBuffers(2, currentMusic.buffers); + + if (currentMusic.chipTune) + { + jar_xm_free_context(currentMusic.chipctx); + } + else + { + stb_vorbis_close(currentMusic.stream); + } } musicEnabled = false; @@ -633,7 +657,15 @@ void SetMusicVolume(float volume) // Get current music time length (in seconds) float GetMusicTimeLength(void) { - float totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); + float totalSeconds; + if (currentMusic.chipTune) + { + //totalSeconds = (float)samples; // Need to figure out how toget this + } + else + { + totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); + } return totalSeconds; } @@ -641,11 +673,20 @@ float GetMusicTimeLength(void) // Get current music time played (in seconds) float GetMusicTimePlayed(void) { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; - - int samplesPlayed = totalSamples - currentMusic.totalSamplesLeft; - - float secondsPlayed = (float)samplesPlayed / (currentMusic.sampleRate * currentMusic.channels); + float secondsPlayed; + if (currentMusic.chipTune) + { + uint64_t* samples; + jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, samples); // Unsure if this is the desired value + secondsPlayed = (float)samples; + } + else + { + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; + int samplesPlayed = totalSamples - currentMusic.totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (currentMusic.sampleRate * currentMusic.channels); + } + return secondsPlayed; } @@ -668,7 +709,15 @@ static bool BufferMusicStream(ALuint buffer) { while (size < MUSIC_BUFFER_SIZE) { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); + if (currentMusic.chipTune) + { + jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size)/2); + streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + } + else + { + streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); + } if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); else break; diff --git a/src/jar_xm.h b/src/jar_xm.h new file mode 100644 index 00000000..2f102cf8 --- /dev/null +++ b/src/jar_xm.h @@ -0,0 +1,2647 @@ +// jar_xm.h - v0.01 - public domain - Joshua Reisenauer, MAR 2016 +// +// HISTORY: +// +// v0.01 2016-02-22 Setup +// +// +// USAGE: +// +// In ONE source file, put: +// +// #define JAR_XM_IMPLEMENTATION +// #include "jar_xm.h" +// +// Other source files should just include jar_xm.h +// +// SAMPLE CODE: +// +// jar_xm_context_t *musicptr; +// float musicBuffer[48000 / 60]; +// int intro_load(void) +// { +// jar_xm_create_context_from_file(&musicptr, 48000, "Song.XM"); +// return 1; +// } +// int intro_unload(void) +// { +// jar_xm_free_context(musicptr); +// return 1; +// } +// int intro_tick(long counter) +// { +// jar_xm_generate_samples(musicptr, musicBuffer, (48000 / 60) / 2); +// if(IsKeyDown(KEY_ENTER)) +// return 1; +// return 0; +// } +// +// +// LISCENSE - FOR LIBXM: +// +// Author: Romain "Artefact2" Dalmaso +// Contributor: Dan Spencer +// Repackaged into jar_xm.h By: Joshua Adam Reisenauer +// This program is free software. It comes without any warranty, to the +// extent permitted by applicable law. You can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To Public +// License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/wtfpl/COPYING for more details. + +#ifndef INCLUDE_JAR_XM_H +#define INCLUDE_JAR_XM_H + +#define JAR_XM_DEBUG 0 +#define JAR_XM_LINEAR_INTERPOLATION 1 // speed increase with decrease in quality +#define JAR_XM_DEFENSIVE 1 +#define JAR_XM_RAMPING 1 + +#include +#include +#include +#include +#include +#include + +//------------------------------------------------------------------------------- +#ifdef __cplusplus +extern "C" { +#endif + +struct jar_xm_context_s; +typedef struct jar_xm_context_s jar_xm_context_t; + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + * @returns 3 unable to open input file + * @returns 4 fseek() failed + * @returns 5 fread() failed + * @returns 6 unkown error + * + * @deprecated This function is unsafe! + * @see jar_xm_create_context_safe() + */ +int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename); + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + * + * @deprecated This function is unsafe! + * @see jar_xm_create_context_safe() + */ +int jar_xm_create_context(jar_xm_context_t**, const char* moddata, uint32_t rate); + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param moddata_length the length of the contents of the module, in bytes + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + */ +int jar_xm_create_context_safe(jar_xm_context_t**, const char* moddata, size_t moddata_length, uint32_t rate); + +/** Free a XM context created by jar_xm_create_context(). */ +void jar_xm_free_context(jar_xm_context_t*); + +/** Play the module and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples(jar_xm_context_t*, float* output, size_t numsamples); + +/** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) +{ + float* musicBuffer = malloc((2*numsamples)*sizeof(float)); + short* musicBuffer2 = malloc((2*numsamples)*sizeof(short)); + + jar_xm_generate_samples(ctx, musicBuffer, numsamples); + + int x; + for(x=0;x<2*numsamples;x++) + musicBuffer2[x] = musicBuffer[x] * SHRT_MAX; + + memcpy(output, musicBuffer2, (2*numsamples)*sizeof(short)); + free(musicBuffer); + free(musicBuffer2); +} + +/** Play the module, resample from 32 bit to 8 bit, and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) +{ + float* musicBuffer = malloc((2*numsamples)*sizeof(float)); + char* musicBuffer2 = malloc((2*numsamples)*sizeof(char)); + + jar_xm_generate_samples(ctx, musicBuffer, numsamples); + + int x; + for(x=0;x<2*numsamples;x++) + musicBuffer2[x] = musicBuffer[x] * CHAR_MAX; + + memcpy(output, musicBuffer2, (2*numsamples)*sizeof(char)); + free(musicBuffer); + free(musicBuffer2); +} + + + +/** Set the maximum number of times a module can loop. After the + * specified number of loops, calls to jar_xm_generate_samples will only + * generate silence. You can control the current number of loops with + * jar_xm_get_loop_count(). + * + * @param loopcnt maximum number of loops. Use 0 to loop + * indefinitely. */ +void jar_xm_set_max_loop_count(jar_xm_context_t*, uint8_t loopcnt); + +/** Get the loop count of the currently playing module. This value is + * 0 when the module is still playing, 1 when the module has looped + * once, etc. */ +uint8_t jar_xm_get_loop_count(jar_xm_context_t*); + + + +/** Mute or unmute a channel. + * + * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). + * + * @return whether the channel was muted. + */ +bool jar_xm_mute_channel(jar_xm_context_t*, uint16_t, bool); + +/** Mute or unmute an instrument. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + * + * @return whether the instrument was muted. + */ +bool jar_xm_mute_instrument(jar_xm_context_t*, uint16_t, bool); + + + +/** Get the module name as a NUL-terminated string. */ +const char* jar_xm_get_module_name(jar_xm_context_t*); + +/** Get the tracker name as a NUL-terminated string. */ +const char* jar_xm_get_tracker_name(jar_xm_context_t*); + + + +/** Get the number of channels. */ +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t*); + +/** Get the module length (in patterns). */ +uint16_t jar_xm_get_module_length(jar_xm_context_t*); + +/** Get the number of patterns. */ +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t*); + +/** Get the number of rows of a pattern. + * + * @note Pattern numbers go from 0 to + * jar_xm_get_number_of_patterns(...)-1. + */ +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t*, uint16_t); + +/** Get the number of instruments. */ +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t*); + +/** Get the number of samples of an instrument. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + */ +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t*, uint16_t); + + + +/** Get the current module speed. + * + * @param bpm will receive the current BPM + * @param tempo will receive the current tempo (ticks per line) + */ +void jar_xm_get_playing_speed(jar_xm_context_t*, uint16_t* bpm, uint16_t* tempo); + +/** Get the current position in the module being played. + * + * @param pattern_index if not NULL, will receive the current pattern + * index in the POT (pattern order table) + * + * @param pattern if not NULL, will receive the current pattern number + * + * @param row if not NULL, will receive the current row + * + * @param samples if not NULL, will receive the total number of + * generated samples (divide by sample rate to get seconds of + * generated audio) + */ +void jar_xm_get_position(jar_xm_context_t*, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); + +/** Get the latest time (in number of generated samples) when a + * particular instrument was triggered in any channel. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + */ +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t*, uint16_t); + +/** Get the latest time (in number of generated samples) when a + * particular sample was triggered in any channel. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + * + * @note Sample numbers go from 0 to + * jar_xm_get_nubmer_of_samples(...,instr)-1. + */ +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t*, uint16_t instr, uint16_t sample); + +/** Get the latest time (in number of generated samples) when any + * instrument was triggered in a given channel. + * + * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). + */ +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t*, uint16_t); + +#ifdef __cplusplus +} +#endif +//------------------------------------------------------------------------------- + + + + + + +//Function Definitions----------------------------------------------------------- +#ifdef JAR_XM_IMPLEMENTATION + +#include +#include + +#if JAR_XM_DEBUG +#include +#define DEBUG(fmt, ...) do { \ + fprintf(stderr, "%s(): " fmt "\n", __func__, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) +#else +#define DEBUG(...) +#endif + +#if jar_xm_BIG_ENDIAN +#error "Big endian platforms are not yet supported, sorry" +/* Make sure the compiler stops, even if #error is ignored */ +extern int __fail[-1]; +#endif + +/* ----- XM constants ----- */ + +#define SAMPLE_NAME_LENGTH 22 +#define INSTRUMENT_NAME_LENGTH 22 +#define MODULE_NAME_LENGTH 20 +#define TRACKER_NAME_LENGTH 20 +#define PATTERN_ORDER_TABLE_LENGTH 256 +#define NUM_NOTES 96 +#define NUM_ENVELOPE_POINTS 12 +#define MAX_NUM_ROWS 256 + +#if JAR_XM_RAMPING +#define jar_xm_SAMPLE_RAMPING_POINTS 0x20 +#endif + +/* ----- Data types ----- */ + +enum jar_xm_waveform_type_e { + jar_xm_SINE_WAVEFORM = 0, + jar_xm_RAMP_DOWN_WAVEFORM = 1, + jar_xm_SQUARE_WAVEFORM = 2, + jar_xm_RANDOM_WAVEFORM = 3, + jar_xm_RAMP_UP_WAVEFORM = 4, +}; +typedef enum jar_xm_waveform_type_e jar_xm_waveform_type_t; + +enum jar_xm_loop_type_e { + jar_xm_NO_LOOP, + jar_xm_FORWARD_LOOP, + jar_xm_PING_PONG_LOOP, +}; +typedef enum jar_xm_loop_type_e jar_xm_loop_type_t; + +enum jar_xm_frequency_type_e { + jar_xm_LINEAR_FREQUENCIES, + jar_xm_AMIGA_FREQUENCIES, +}; +typedef enum jar_xm_frequency_type_e jar_xm_frequency_type_t; + +struct jar_xm_envelope_point_s { + uint16_t frame; + uint16_t value; +}; +typedef struct jar_xm_envelope_point_s jar_xm_envelope_point_t; + +struct jar_xm_envelope_s { + jar_xm_envelope_point_t points[NUM_ENVELOPE_POINTS]; + uint8_t num_points; + uint8_t sustain_point; + uint8_t loop_start_point; + uint8_t loop_end_point; + bool enabled; + bool sustain_enabled; + bool loop_enabled; +}; +typedef struct jar_xm_envelope_s jar_xm_envelope_t; + +struct jar_xm_sample_s { + char name[SAMPLE_NAME_LENGTH + 1]; + int8_t bits; /* Either 8 or 16 */ + + uint32_t length; + uint32_t loop_start; + uint32_t loop_length; + uint32_t loop_end; + float volume; + int8_t finetune; + jar_xm_loop_type_t loop_type; + float panning; + int8_t relative_note; + uint64_t latest_trigger; + + float* data; + }; + typedef struct jar_xm_sample_s jar_xm_sample_t; + + struct jar_xm_instrument_s { + char name[INSTRUMENT_NAME_LENGTH + 1]; + uint16_t num_samples; + uint8_t sample_of_notes[NUM_NOTES]; + jar_xm_envelope_t volume_envelope; + jar_xm_envelope_t panning_envelope; + jar_xm_waveform_type_t vibrato_type; + uint8_t vibrato_sweep; + uint8_t vibrato_depth; + uint8_t vibrato_rate; + uint16_t volume_fadeout; + uint64_t latest_trigger; + bool muted; + + jar_xm_sample_t* samples; + }; + typedef struct jar_xm_instrument_s jar_xm_instrument_t; + + struct jar_xm_pattern_slot_s { + uint8_t note; /* 1-96, 97 = Key Off note */ + uint8_t instrument; /* 1-128 */ + uint8_t volume_column; + uint8_t effect_type; + uint8_t effect_param; + }; + typedef struct jar_xm_pattern_slot_s jar_xm_pattern_slot_t; + + struct jar_xm_pattern_s { + uint16_t num_rows; + jar_xm_pattern_slot_t* slots; /* Array of size num_rows * num_channels */ + }; + typedef struct jar_xm_pattern_s jar_xm_pattern_t; + + struct jar_xm_module_s { + char name[MODULE_NAME_LENGTH + 1]; + char trackername[TRACKER_NAME_LENGTH + 1]; + uint16_t length; + uint16_t restart_position; + uint16_t num_channels; + uint16_t num_patterns; + uint16_t num_instruments; + jar_xm_frequency_type_t frequency_type; + uint8_t pattern_table[PATTERN_ORDER_TABLE_LENGTH]; + + jar_xm_pattern_t* patterns; + jar_xm_instrument_t* instruments; /* Instrument 1 has index 0, + * instrument 2 has index 1, etc. */ + }; + typedef struct jar_xm_module_s jar_xm_module_t; + + struct jar_xm_channel_context_s { + float note; + float orig_note; /* The original note before effect modifications, as read in the pattern. */ + jar_xm_instrument_t* instrument; /* Could be NULL */ + jar_xm_sample_t* sample; /* Could be NULL */ + jar_xm_pattern_slot_t* current; + + float sample_position; + float period; + float frequency; + float step; + bool ping; /* For ping-pong samples: true is -->, false is <-- */ + + float volume; /* Ideally between 0 (muted) and 1 (loudest) */ + float panning; /* Between 0 (left) and 1 (right); 0.5 is centered */ + + uint16_t autovibrato_ticks; + + bool sustained; + float fadeout_volume; + float volume_envelope_volume; + float panning_envelope_panning; + uint16_t volume_envelope_frame_count; + uint16_t panning_envelope_frame_count; + + float autovibrato_note_offset; + + bool arp_in_progress; + uint8_t arp_note_offset; + uint8_t volume_slide_param; + uint8_t fine_volume_slide_param; + uint8_t global_volume_slide_param; + uint8_t panning_slide_param; + uint8_t portamento_up_param; + uint8_t portamento_down_param; + uint8_t fine_portamento_up_param; + uint8_t fine_portamento_down_param; + uint8_t extra_fine_portamento_up_param; + uint8_t extra_fine_portamento_down_param; + uint8_t tone_portamento_param; + float tone_portamento_target_period; + uint8_t multi_retrig_param; + uint8_t note_delay_param; + uint8_t pattern_loop_origin; /* Where to restart a E6y loop */ + uint8_t pattern_loop_count; /* How many loop passes have been done */ + bool vibrato_in_progress; + jar_xm_waveform_type_t vibrato_waveform; + bool vibrato_waveform_retrigger; /* True if a new note retriggers the waveform */ + uint8_t vibrato_param; + uint16_t vibrato_ticks; /* Position in the waveform */ + float vibrato_note_offset; + jar_xm_waveform_type_t tremolo_waveform; + bool tremolo_waveform_retrigger; + uint8_t tremolo_param; + uint8_t tremolo_ticks; + float tremolo_volume; + uint8_t tremor_param; + bool tremor_on; + + uint64_t latest_trigger; + bool muted; + +#if JAR_XM_RAMPING + /* These values are updated at the end of each tick, to save + * a couple of float operations on every generated sample. */ + float target_panning; + float target_volume; + + unsigned long frame_count; + float end_of_previous_sample[jar_xm_SAMPLE_RAMPING_POINTS]; +#endif + + float actual_panning; + float actual_volume; + }; + typedef struct jar_xm_channel_context_s jar_xm_channel_context_t; + + struct jar_xm_context_s { + void* allocated_memory; + jar_xm_module_t module; + uint32_t rate; + + uint16_t tempo; + uint16_t bpm; + float global_volume; + float amplification; + +#if JAR_XM_RAMPING + /* How much is a channel final volume allowed to change per + * sample; this is used to avoid abrubt volume changes which + * manifest as "clicks" in the generated sound. */ + float volume_ramp; + float panning_ramp; /* Same for panning. */ +#endif + + uint8_t current_table_index; + uint8_t current_row; + uint16_t current_tick; /* Can go below 255, with high tempo and a pattern delay */ + float remaining_samples_in_tick; + uint64_t generated_samples; + + bool position_jump; + bool pattern_break; + uint8_t jump_dest; + uint8_t jump_row; + + /* Extra ticks to be played before going to the next row - + * Used for EEy effect */ + uint16_t extra_ticks; + + uint8_t* row_loop_count; /* Array of size MAX_NUM_ROWS * module_length */ + uint8_t loop_count; + uint8_t max_loop_count; + + jar_xm_channel_context_t* channels; +}; + +/* ----- Internal API ----- */ + +#if JAR_XM_DEFENSIVE + +/** Check the module data for errors/inconsistencies. + * + * @returns 0 if everything looks OK. Module should be safe to load. + */ +int jar_xm_check_sanity_preload(const char*, size_t); + +/** Check a loaded module for errors/inconsistencies. + * + * @returns 0 if everything looks OK. + */ +int jar_xm_check_sanity_postload(jar_xm_context_t*); + +#endif + +/** Get the number of bytes needed to store the module data in a + * dynamically allocated blank context. + * + * Things that are dynamically allocated: + * - sample data + * - sample structures in instruments + * - pattern data + * - row loop count arrays + * - pattern structures in module + * - instrument structures in module + * - channel contexts + * - context structure itself + + * @returns 0 if everything looks OK. + */ +size_t jar_xm_get_memory_needed_for_context(const char*, size_t); + +/** Populate the context from module data. + * + * @returns pointer to the memory pool + */ +char* jar_xm_load_module(jar_xm_context_t*, const char*, size_t, char*); + +int jar_xm_create_context(jar_xm_context_t** ctxp, const char* moddata, uint32_t rate) { + return jar_xm_create_context_safe(ctxp, moddata, SIZE_MAX, rate); +} + +int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, size_t moddata_length, uint32_t rate) { +#if JAR_XM_DEFENSIVE + int ret; +#endif + size_t bytes_needed; + char* mempool; + jar_xm_context_t* ctx; + +#if JAR_XM_DEFENSIVE + if((ret = jar_xm_check_sanity_preload(moddata, moddata_length))) { + DEBUG("jar_xm_check_sanity_preload() returned %i, module is not safe to load", ret); + return 1; + } +#endif + + bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length); + mempool = malloc(bytes_needed); + if(mempool == NULL && bytes_needed > 0) { + /* malloc() failed, trouble ahead */ + DEBUG("call to malloc() failed, returned %p", (void*)mempool); + return 2; + } + + /* Initialize most of the fields to 0, 0.f, NULL or false depending on type */ + memset(mempool, 0, bytes_needed); + + ctx = (*ctxp = (jar_xm_context_t*)mempool); + ctx->allocated_memory = mempool; /* Keep original pointer for free() */ + mempool += sizeof(jar_xm_context_t); + + ctx->rate = rate; + mempool = jar_xm_load_module(ctx, moddata, moddata_length, mempool); + + ctx->channels = (jar_xm_channel_context_t*)mempool; + mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t); + + ctx->global_volume = 1.f; + ctx->amplification = .25f; /* XXX: some bad modules may still clip. Find out something better. */ + +#if JAR_XM_RAMPING + ctx->volume_ramp = (1.f / 128.f); + ctx->panning_ramp = (1.f / 128.f); +#endif + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + ch->ping = true; + ch->vibrato_waveform = jar_xm_SINE_WAVEFORM; + ch->vibrato_waveform_retrigger = true; + ch->tremolo_waveform = jar_xm_SINE_WAVEFORM; + ch->tremolo_waveform_retrigger = true; + + ch->volume = ch->volume_envelope_volume = ch->fadeout_volume = 1.0f; + ch->panning = ch->panning_envelope_panning = .5f; + ch->actual_volume = .0f; + ch->actual_panning = .5f; + } + + ctx->row_loop_count = (uint8_t*)mempool; + mempool += MAX_NUM_ROWS * sizeof(uint8_t); + +#if JAR_XM_DEFENSIVE + if((ret = jar_xm_check_sanity_postload(ctx))) { + DEBUG("jar_xm_check_sanity_postload() returned %i, module is not safe to play", ret); + jar_xm_free_context(ctx); + return 1; + } +#endif + + return 0; +} + +void jar_xm_free_context(jar_xm_context_t* context) { + free(context->allocated_memory); +} + +void jar_xm_set_max_loop_count(jar_xm_context_t* context, uint8_t loopcnt) { + context->max_loop_count = loopcnt; +} + +uint8_t jar_xm_get_loop_count(jar_xm_context_t* context) { + return context->loop_count; +} + + + +bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t channel, bool mute) { + bool old = ctx->channels[channel - 1].muted; + ctx->channels[channel - 1].muted = mute; + return old; +} + +bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t instr, bool mute) { + bool old = ctx->module.instruments[instr - 1].muted; + ctx->module.instruments[instr - 1].muted = mute; + return old; +} + + + +const char* jar_xm_get_module_name(jar_xm_context_t* ctx) { + return ctx->module.name; +} + +const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx) { + return ctx->module.trackername; +} + + + +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx) { + return ctx->module.num_channels; +} + +uint16_t jar_xm_get_module_length(jar_xm_context_t* ctx) { + return ctx->module.length; +} + +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx) { + return ctx->module.num_patterns; +} + +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t pattern) { + return ctx->module.patterns[pattern].num_rows; +} + +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx) { + return ctx->module.num_instruments; +} + +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t instrument) { + return ctx->module.instruments[instrument - 1].num_samples; +} + + + +void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo) { + if(bpm) *bpm = ctx->bpm; + if(tempo) *tempo = ctx->tempo; +} + +void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples) { + if(pattern_index) *pattern_index = ctx->current_table_index; + if(pattern) *pattern = ctx->module.pattern_table[ctx->current_table_index]; + if(row) *row = ctx->current_row; + if(samples) *samples = ctx->generated_samples; +} + +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t instr) { + return ctx->module.instruments[instr - 1].latest_trigger; +} + +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample) { + return ctx->module.instruments[instr - 1].samples[sample].latest_trigger; +} + +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t chn) { + return ctx->channels[chn - 1].latest_trigger; +} + +/* .xm files are little-endian. (XXX: Are they really?) */ + +/* Bounded reader macros. + * If we attempt to read the buffer out-of-bounds, pretend that the buffer is + * infinitely padded with zeroes. + */ +#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0) +#define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8)) +#define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16)) +#define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset) + +static inline void memcpy_pad(void* dst, size_t dst_len, const void* src, size_t src_len, size_t offset) { + uint8_t* dst_c = dst; + const uint8_t* src_c = src; + + /* how many bytes can be copied without overrunning `src` */ + size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0; + copy_bytes = copy_bytes > dst_len ? dst_len : copy_bytes; + + memcpy(dst_c, src_c + offset, copy_bytes); + /* padded bytes */ + memset(dst_c + copy_bytes, 0, dst_len - copy_bytes); +} + +#if JAR_XM_DEFENSIVE + +int jar_xm_check_sanity_preload(const char* module, size_t module_length) { + if(module_length < 60) { + return 4; + } + + if(memcmp("Extended Module: ", module, 17) != 0) { + return 1; + } + + if(module[37] != 0x1A) { + return 2; + } + + if(module[59] != 0x01 || module[58] != 0x04) { + /* Not XM 1.04 */ + return 3; + } + + return 0; +} + +int jar_xm_check_sanity_postload(jar_xm_context_t* ctx) { + /* @todo: plenty of stuff to do here… */ + + /* Check the POT */ + for(uint8_t i = 0; i < ctx->module.length; ++i) { + if(ctx->module.pattern_table[i] >= ctx->module.num_patterns) { + if(i+1 == ctx->module.length && ctx->module.length > 1) { + /* Cheap fix */ + --ctx->module.length; + DEBUG("trimming invalid POT at pos %X", i); + } else { + DEBUG("module has invalid POT, pos %X references nonexistent pattern %X", + i, + ctx->module.pattern_table[i]); + return 1; + } + } + } + + return 0; +} + +#endif + +size_t jar_xm_get_memory_needed_for_context(const char* moddata, size_t moddata_length) { + size_t memory_needed = 0; + size_t offset = 60; /* Skip the first header */ + uint16_t num_channels; + uint16_t num_patterns; + uint16_t num_instruments; + + /* Read the module header */ + + num_channels = READ_U16(offset + 8); + num_channels = READ_U16(offset + 8); + + num_patterns = READ_U16(offset + 10); + memory_needed += num_patterns * sizeof(jar_xm_pattern_t); + + num_instruments = READ_U16(offset + 12); + memory_needed += num_instruments * sizeof(jar_xm_instrument_t); + + memory_needed += MAX_NUM_ROWS * READ_U16(offset + 4) * sizeof(uint8_t); /* Module length */ + + /* Header size */ + offset += READ_U32(offset); + + /* Read pattern headers */ + for(uint16_t i = 0; i < num_patterns; ++i) { + uint16_t num_rows; + + num_rows = READ_U16(offset + 5); + memory_needed += num_rows * num_channels * sizeof(jar_xm_pattern_slot_t); + + /* Pattern header length + packed pattern data size */ + offset += READ_U32(offset) + READ_U16(offset + 7); + } + + /* Read instrument headers */ + for(uint16_t i = 0; i < num_instruments; ++i) { + uint16_t num_samples; + uint32_t sample_header_size = 0; + uint32_t sample_size_aggregate = 0; + + num_samples = READ_U16(offset + 27); + memory_needed += num_samples * sizeof(jar_xm_sample_t); + + if(num_samples > 0) { + sample_header_size = READ_U32(offset + 29); + } + + /* Instrument header size */ + offset += READ_U32(offset); + + for(uint16_t j = 0; j < num_samples; ++j) { + uint32_t sample_size; + uint8_t flags; + + sample_size = READ_U32(offset); + flags = READ_U8(offset + 14); + sample_size_aggregate += sample_size; + + if(flags & (1 << 4)) { + /* 16 bit sample */ + memory_needed += sample_size * (sizeof(float) >> 1); + } else { + /* 8 bit sample */ + memory_needed += sample_size * sizeof(float); + } + + offset += sample_header_size; + } + + offset += sample_size_aggregate; + } + + memory_needed += num_channels * sizeof(jar_xm_channel_context_t); + memory_needed += sizeof(jar_xm_context_t); + + return memory_needed; +} + +char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t moddata_length, char* mempool) { + size_t offset = 0; + jar_xm_module_t* mod = &(ctx->module); + + /* Read XM header */ + READ_MEMCPY(mod->name, offset + 17, MODULE_NAME_LENGTH); + READ_MEMCPY(mod->trackername, offset + 38, TRACKER_NAME_LENGTH); + offset += 60; + + /* Read module header */ + uint32_t header_size = READ_U32(offset); + + mod->length = READ_U16(offset + 4); + mod->restart_position = READ_U16(offset + 6); + mod->num_channels = READ_U16(offset + 8); + mod->num_patterns = READ_U16(offset + 10); + mod->num_instruments = READ_U16(offset + 12); + + mod->patterns = (jar_xm_pattern_t*)mempool; + mempool += mod->num_patterns * sizeof(jar_xm_pattern_t); + + mod->instruments = (jar_xm_instrument_t*)mempool; + mempool += mod->num_instruments * sizeof(jar_xm_instrument_t); + + uint16_t flags = READ_U32(offset + 14); + mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES; + + ctx->tempo = READ_U16(offset + 16); + ctx->bpm = READ_U16(offset + 18); + + READ_MEMCPY(mod->pattern_table, offset + 20, PATTERN_ORDER_TABLE_LENGTH); + offset += header_size; + + /* Read patterns */ + for(uint16_t i = 0; i < mod->num_patterns; ++i) { + uint16_t packed_patterndata_size = READ_U16(offset + 7); + jar_xm_pattern_t* pat = mod->patterns + i; + + pat->num_rows = READ_U16(offset + 5); + + pat->slots = (jar_xm_pattern_slot_t*)mempool; + mempool += mod->num_channels * pat->num_rows * sizeof(jar_xm_pattern_slot_t); + + /* Pattern header length */ + offset += READ_U32(offset); + + if(packed_patterndata_size == 0) { + /* No pattern data is present */ + memset(pat->slots, 0, sizeof(jar_xm_pattern_slot_t) * pat->num_rows * mod->num_channels); + } else { + /* This isn't your typical for loop */ + for(uint16_t j = 0, k = 0; j < packed_patterndata_size; ++k) { + uint8_t note = READ_U8(offset + j); + jar_xm_pattern_slot_t* slot = pat->slots + k; + + if(note & (1 << 7)) { + /* MSB is set, this is a compressed packet */ + ++j; + + if(note & (1 << 0)) { + /* Note follows */ + slot->note = READ_U8(offset + j); + ++j; + } else { + slot->note = 0; + } + + if(note & (1 << 1)) { + /* Instrument follows */ + slot->instrument = READ_U8(offset + j); + ++j; + } else { + slot->instrument = 0; + } + + if(note & (1 << 2)) { + /* Volume column follows */ + slot->volume_column = READ_U8(offset + j); + ++j; + } else { + slot->volume_column = 0; + } + + if(note & (1 << 3)) { + /* Effect follows */ + slot->effect_type = READ_U8(offset + j); + ++j; + } else { + slot->effect_type = 0; + } + + if(note & (1 << 4)) { + /* Effect parameter follows */ + slot->effect_param = READ_U8(offset + j); + ++j; + } else { + slot->effect_param = 0; + } + } else { + /* Uncompressed packet */ + slot->note = note; + slot->instrument = READ_U8(offset + j + 1); + slot->volume_column = READ_U8(offset + j + 2); + slot->effect_type = READ_U8(offset + j + 3); + slot->effect_param = READ_U8(offset + j + 4); + j += 5; + } + } + } + + offset += packed_patterndata_size; + } + + /* Read instruments */ + for(uint16_t i = 0; i < ctx->module.num_instruments; ++i) { + uint32_t sample_header_size = 0; + jar_xm_instrument_t* instr = mod->instruments + i; + + READ_MEMCPY(instr->name, offset + 4, INSTRUMENT_NAME_LENGTH); + instr->num_samples = READ_U16(offset + 27); + + if(instr->num_samples > 0) { + /* Read extra header properties */ + sample_header_size = READ_U32(offset + 29); + READ_MEMCPY(instr->sample_of_notes, offset + 33, NUM_NOTES); + + instr->volume_envelope.num_points = READ_U8(offset + 225); + instr->panning_envelope.num_points = READ_U8(offset + 226); + + for(uint8_t j = 0; j < instr->volume_envelope.num_points; ++j) { + instr->volume_envelope.points[j].frame = READ_U16(offset + 129 + 4 * j); + instr->volume_envelope.points[j].value = READ_U16(offset + 129 + 4 * j + 2); + } + + for(uint8_t j = 0; j < instr->panning_envelope.num_points; ++j) { + instr->panning_envelope.points[j].frame = READ_U16(offset + 177 + 4 * j); + instr->panning_envelope.points[j].value = READ_U16(offset + 177 + 4 * j + 2); + } + + instr->volume_envelope.sustain_point = READ_U8(offset + 227); + instr->volume_envelope.loop_start_point = READ_U8(offset + 228); + instr->volume_envelope.loop_end_point = READ_U8(offset + 229); + + instr->panning_envelope.sustain_point = READ_U8(offset + 230); + instr->panning_envelope.loop_start_point = READ_U8(offset + 231); + instr->panning_envelope.loop_end_point = READ_U8(offset + 232); + + uint8_t flags = READ_U8(offset + 233); + instr->volume_envelope.enabled = flags & (1 << 0); + instr->volume_envelope.sustain_enabled = flags & (1 << 1); + instr->volume_envelope.loop_enabled = flags & (1 << 2); + + flags = READ_U8(offset + 234); + instr->panning_envelope.enabled = flags & (1 << 0); + instr->panning_envelope.sustain_enabled = flags & (1 << 1); + instr->panning_envelope.loop_enabled = flags & (1 << 2); + + instr->vibrato_type = READ_U8(offset + 235); + if(instr->vibrato_type == 2) { + instr->vibrato_type = 1; + } else if(instr->vibrato_type == 1) { + instr->vibrato_type = 2; + } + instr->vibrato_sweep = READ_U8(offset + 236); + instr->vibrato_depth = READ_U8(offset + 237); + instr->vibrato_rate = READ_U8(offset + 238); + instr->volume_fadeout = READ_U16(offset + 239); + + instr->samples = (jar_xm_sample_t*)mempool; + mempool += instr->num_samples * sizeof(jar_xm_sample_t); + } else { + instr->samples = NULL; + } + + /* Instrument header size */ + offset += READ_U32(offset); + + for(uint16_t j = 0; j < instr->num_samples; ++j) { + /* Read sample header */ + jar_xm_sample_t* sample = instr->samples + j; + + sample->length = READ_U32(offset); + sample->loop_start = READ_U32(offset + 4); + sample->loop_length = READ_U32(offset + 8); + sample->loop_end = sample->loop_start + sample->loop_length; + sample->volume = (float)READ_U8(offset + 12) / (float)0x40; + sample->finetune = (int8_t)READ_U8(offset + 13); + + uint8_t flags = READ_U8(offset + 14); + if((flags & 3) == 0) { + sample->loop_type = jar_xm_NO_LOOP; + } else if((flags & 3) == 1) { + sample->loop_type = jar_xm_FORWARD_LOOP; + } else { + sample->loop_type = jar_xm_PING_PONG_LOOP; + } + + sample->bits = (flags & (1 << 4)) ? 16 : 8; + + sample->panning = (float)READ_U8(offset + 15) / (float)0xFF; + sample->relative_note = (int8_t)READ_U8(offset + 16); + READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH); + sample->data = (float*)mempool; + + if(sample->bits == 16) { + /* 16 bit sample */ + mempool += sample->length * (sizeof(float) >> 1); + sample->loop_start >>= 1; + sample->loop_length >>= 1; + sample->loop_end >>= 1; + sample->length >>= 1; + } else { + /* 8 bit sample */ + mempool += sample->length * sizeof(float); + } + + offset += sample_header_size; + } + + for(uint16_t j = 0; j < instr->num_samples; ++j) { + /* Read sample data */ + jar_xm_sample_t* sample = instr->samples + j; + uint32_t length = sample->length; + + if(sample->bits == 16) { + int16_t v = 0; + for(uint32_t k = 0; k < length; ++k) { + v = v + (int16_t)READ_U16(offset + (k << 1)); + sample->data[k] = (float)v / (float)(1 << 15); + } + offset += sample->length << 1; + } else { + int8_t v = 0; + for(uint32_t k = 0; k < length; ++k) { + v = v + (int8_t)READ_U8(offset + k); + sample->data[k] = (float)v / (float)(1 << 7); + } + offset += sample->length; + } + } + } + + return mempool; +} + +//------------------------------------------------------------------------------- +//THE FOLLOWING IS FOR PLAYING +//------------------------------------------------------------------------------- + +/* ----- Static functions ----- */ + +static float jar_xm_waveform(jar_xm_waveform_type_t, uint8_t); +static void jar_xm_autovibrato(jar_xm_context_t*, jar_xm_channel_context_t*); +static void jar_xm_vibrato(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_tremolo(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_arpeggio(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_tone_portamento(jar_xm_context_t*, jar_xm_channel_context_t*); +static void jar_xm_pitch_slide(jar_xm_context_t*, jar_xm_channel_context_t*, float); +static void jar_xm_panning_slide(jar_xm_channel_context_t*, uint8_t); +static void jar_xm_volume_slide(jar_xm_channel_context_t*, uint8_t); + +static float jar_xm_envelope_lerp(jar_xm_envelope_point_t*, jar_xm_envelope_point_t*, uint16_t); +static void jar_xm_envelope_tick(jar_xm_channel_context_t*, jar_xm_envelope_t*, uint16_t*, float*); +static void jar_xm_envelopes(jar_xm_channel_context_t*); + +static float jar_xm_linear_period(float); +static float jar_xm_linear_frequency(float); +static float jar_xm_amiga_period(float); +static float jar_xm_amiga_frequency(float); +static float jar_xm_period(jar_xm_context_t*, float); +static float jar_xm_frequency(jar_xm_context_t*, float, float); +static void jar_xm_update_frequency(jar_xm_context_t*, jar_xm_channel_context_t*); + +static void jar_xm_handle_note_and_instrument(jar_xm_context_t*, jar_xm_channel_context_t*, jar_xm_pattern_slot_t*); +static void jar_xm_trigger_note(jar_xm_context_t*, jar_xm_channel_context_t*, unsigned int flags); +static void jar_xm_cut_note(jar_xm_channel_context_t*); +static void jar_xm_key_off(jar_xm_channel_context_t*); + +static void jar_xm_post_pattern_change(jar_xm_context_t*); +static void jar_xm_row(jar_xm_context_t*); +static void jar_xm_tick(jar_xm_context_t*); + +static float jar_xm_next_of_sample(jar_xm_channel_context_t*); +static void jar_xm_sample(jar_xm_context_t*, float*, float*); + +/* ----- Other oddities ----- */ + +#define jar_xm_TRIGGER_KEEP_VOLUME (1 << 0) +#define jar_xm_TRIGGER_KEEP_PERIOD (1 << 1) +#define jar_xm_TRIGGER_KEEP_SAMPLE_POSITION (1 << 2) + +static const uint16_t amiga_frequencies[] = { + 1712, 1616, 1525, 1440, /* C-2, C#2, D-2, D#2 */ + 1357, 1281, 1209, 1141, /* E-2, F-2, F#2, G-2 */ + 1077, 1017, 961, 907, /* G#2, A-2, A#2, B-2 */ + 856, /* C-3 */ +}; + +static const float multi_retrig_add[] = { + 0.f, -1.f, -2.f, -4.f, /* 0, 1, 2, 3 */ + -8.f, -16.f, 0.f, 0.f, /* 4, 5, 6, 7 */ + 0.f, 1.f, 2.f, 4.f, /* 8, 9, A, B */ + 8.f, 16.f, 0.f, 0.f /* C, D, E, F */ +}; + +static const float multi_retrig_multiply[] = { + 1.f, 1.f, 1.f, 1.f, /* 0, 1, 2, 3 */ + 1.f, 1.f, .6666667f, .5f, /* 4, 5, 6, 7 */ + 1.f, 1.f, 1.f, 1.f, /* 8, 9, A, B */ + 1.f, 1.f, 1.5f, 2.f /* C, D, E, F */ +}; + +#define jar_xm_CLAMP_UP1F(vol, limit) do { \ + if((vol) > (limit)) (vol) = (limit); \ + } while(0) +#define jar_xm_CLAMP_UP(vol) jar_xm_CLAMP_UP1F((vol), 1.f) + +#define jar_xm_CLAMP_DOWN1F(vol, limit) do { \ + if((vol) < (limit)) (vol) = (limit); \ + } while(0) +#define jar_xm_CLAMP_DOWN(vol) jar_xm_CLAMP_DOWN1F((vol), .0f) + +#define jar_xm_CLAMP2F(vol, up, down) do { \ + if((vol) > (up)) (vol) = (up); \ + else if((vol) < (down)) (vol) = (down); \ + } while(0) +#define jar_xm_CLAMP(vol) jar_xm_CLAMP2F((vol), 1.f, .0f) + +#define jar_xm_SLIDE_TOWARDS(val, goal, incr) do { \ + if((val) > (goal)) { \ + (val) -= (incr); \ + jar_xm_CLAMP_DOWN1F((val), (goal)); \ + } else if((val) < (goal)) { \ + (val) += (incr); \ + jar_xm_CLAMP_UP1F((val), (goal)); \ + } \ + } while(0) + +#define jar_xm_LERP(u, v, t) ((u) + (t) * ((v) - (u))) +#define jar_xm_INVERSE_LERP(u, v, lerp) (((lerp) - (u)) / ((v) - (u))) + +#define HAS_TONE_PORTAMENTO(s) ((s)->effect_type == 3 \ + || (s)->effect_type == 5 \ + || ((s)->volume_column >> 4) == 0xF) +#define HAS_ARPEGGIO(s) ((s)->effect_type == 0 \ + && (s)->effect_param != 0) +#define HAS_VIBRATO(s) ((s)->effect_type == 4 \ + || (s)->effect_param == 6 \ + || ((s)->volume_column >> 4) == 0xB) +#define NOTE_IS_VALID(n) ((n) > 0 && (n) < 97) + +/* ----- Function definitions ----- */ + +static float jar_xm_waveform(jar_xm_waveform_type_t waveform, uint8_t step) { + static unsigned int next_rand = 24492; + step %= 0x40; + + switch(waveform) { + + case jar_xm_SINE_WAVEFORM: + /* Why not use a table? For saving space, and because there's + * very very little actual performance gain. */ + return -sinf(2.f * 3.141592f * (float)step / (float)0x40); + + case jar_xm_RAMP_DOWN_WAVEFORM: + /* Ramp down: 1.0f when step = 0; -1.0f when step = 0x40 */ + return (float)(0x20 - step) / 0x20; + + case jar_xm_SQUARE_WAVEFORM: + /* Square with a 50% duty */ + return (step >= 0x20) ? 1.f : -1.f; + + case jar_xm_RANDOM_WAVEFORM: + /* Use the POSIX.1-2001 example, just to be deterministic + * across different machines */ + next_rand = next_rand * 1103515245 + 12345; + return (float)((next_rand >> 16) & 0x7FFF) / (float)0x4000 - 1.f; + + case jar_xm_RAMP_UP_WAVEFORM: + /* Ramp up: -1.f when step = 0; 1.f when step = 0x40 */ + return (float)(step - 0x20) / 0x20; + + default: + break; + + } + + return .0f; +} + +static void jar_xm_autovibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + if(ch->instrument == NULL || ch->instrument->vibrato_depth == 0) return; + jar_xm_instrument_t* instr = ch->instrument; + float sweep = 1.f; + + if(ch->autovibrato_ticks < instr->vibrato_sweep) { + /* No idea if this is correct, but it sounds close enough… */ + sweep = jar_xm_LERP(0.f, 1.f, (float)ch->autovibrato_ticks / (float)instr->vibrato_sweep); + } + + unsigned int step = ((ch->autovibrato_ticks++) * instr->vibrato_rate) >> 2; + ch->autovibrato_note_offset = .25f * jar_xm_waveform(instr->vibrato_type, step) + * (float)instr->vibrato_depth / (float)0xF * sweep; + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_vibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { + unsigned int step = pos * (param >> 4); + ch->vibrato_note_offset = + 2.f + * jar_xm_waveform(ch->vibrato_waveform, step) + * (float)(param & 0x0F) / (float)0xF; + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_tremolo(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { + unsigned int step = pos * (param >> 4); + /* Not so sure about this, it sounds correct by ear compared with + * MilkyTracker, but it could come from other bugs */ + ch->tremolo_volume = -1.f * jar_xm_waveform(ch->tremolo_waveform, step) + * (float)(param & 0x0F) / (float)0xF; +} + +static void jar_xm_arpeggio(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t tick) { + switch(tick % 3) { + case 0: + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + break; + case 2: + ch->arp_in_progress = true; + ch->arp_note_offset = param >> 4; + break; + case 1: + ch->arp_in_progress = true; + ch->arp_note_offset = param & 0x0F; + break; + } + + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_tone_portamento(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + /* 3xx called without a note, wait until we get an actual + * target note. */ + if(ch->tone_portamento_target_period == 0.f) return; + + if(ch->period != ch->tone_portamento_target_period) { + jar_xm_SLIDE_TOWARDS(ch->period, + ch->tone_portamento_target_period, + (ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES ? + 4.f : 1.f) * ch->tone_portamento_param + ); + jar_xm_update_frequency(ctx, ch); + } +} + +static void jar_xm_pitch_slide(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, float period_offset) { + /* Don't ask about the 4.f coefficient. I found mention of it + * nowhere. Found by ear™. */ + if(ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES) { + period_offset *= 4.f; + } + + ch->period += period_offset; + jar_xm_CLAMP_DOWN(ch->period); + /* XXX: upper bound of period ? */ + + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_panning_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { + float f; + + if((rawval & 0xF0) && (rawval & 0x0F)) { + /* Illegal state */ + return; + } + + if(rawval & 0xF0) { + /* Slide right */ + f = (float)(rawval >> 4) / (float)0xFF; + ch->panning += f; + jar_xm_CLAMP_UP(ch->panning); + } else { + /* Slide left */ + f = (float)(rawval & 0x0F) / (float)0xFF; + ch->panning -= f; + jar_xm_CLAMP_DOWN(ch->panning); + } +} + +static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { + float f; + + if((rawval & 0xF0) && (rawval & 0x0F)) { + /* Illegal state */ + return; + } + + if(rawval & 0xF0) { + /* Slide up */ + f = (float)(rawval >> 4) / (float)0x40; + ch->volume += f; + jar_xm_CLAMP_UP(ch->volume); + } else { + /* Slide down */ + f = (float)(rawval & 0x0F) / (float)0x40; + ch->volume -= f; + jar_xm_CLAMP_DOWN(ch->volume); + } +} + +static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* restrict a, jar_xm_envelope_point_t* restrict b, uint16_t pos) { + /* Linear interpolation between two envelope points */ + if(pos <= a->frame) return a->value; + else if(pos >= b->frame) return b->value; + else { + float p = (float)(pos - a->frame) / (float)(b->frame - a->frame); + return a->value * (1 - p) + b->value * p; + } +} + +static void jar_xm_post_pattern_change(jar_xm_context_t* ctx) { + /* Loop if necessary */ + if(ctx->current_table_index >= ctx->module.length) { + ctx->current_table_index = ctx->module.restart_position; + } +} + +static float jar_xm_linear_period(float note) { + return 7680.f - note * 64.f; +} + +static float jar_xm_linear_frequency(float period) { + return 8363.f * powf(2.f, (4608.f - period) / 768.f); +} + +static float jar_xm_amiga_period(float note) { + unsigned int intnote = note; + uint8_t a = intnote % 12; + int8_t octave = note / 12.f - 2; + uint16_t p1 = amiga_frequencies[a], p2 = amiga_frequencies[a + 1]; + + if(octave > 0) { + p1 >>= octave; + p2 >>= octave; + } else if(octave < 0) { + p1 <<= (-octave); + p2 <<= (-octave); + } + + return jar_xm_LERP(p1, p2, note - intnote); +} + +static float jar_xm_amiga_frequency(float period) { + if(period == .0f) return .0f; + + /* This is the PAL value. No reason to choose this one over the + * NTSC value. */ + return 7093789.2f / (period * 2.f); +} + +static float jar_xm_period(jar_xm_context_t* ctx, float note) { + switch(ctx->module.frequency_type) { + case jar_xm_LINEAR_FREQUENCIES: + return jar_xm_linear_period(note); + case jar_xm_AMIGA_FREQUENCIES: + return jar_xm_amiga_period(note); + } + return .0f; +} + +static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_offset) { + uint8_t a; + int8_t octave; + float note; + uint16_t p1, p2; + + switch(ctx->module.frequency_type) { + + case jar_xm_LINEAR_FREQUENCIES: + return jar_xm_linear_frequency(period - 64.f * note_offset); + + case jar_xm_AMIGA_FREQUENCIES: + if(note_offset == 0) { + /* A chance to escape from insanity */ + return jar_xm_amiga_frequency(period); + } + + /* FIXME: this is very crappy at best */ + a = octave = 0; + + /* Find the octave of the current period */ + if(period > amiga_frequencies[0]) { + --octave; + while(period > (amiga_frequencies[0] << (-octave))) --octave; + } else if(period < amiga_frequencies[12]) { + ++octave; + while(period < (amiga_frequencies[12] >> octave)) ++octave; + } + + /* Find the smallest note closest to the current period */ + for(uint8_t i = 0; i < 12; ++i) { + p1 = amiga_frequencies[i], p2 = amiga_frequencies[i + 1]; + + if(octave > 0) { + p1 >>= octave; + p2 >>= octave; + } else if(octave < 0) { + p1 <<= (-octave); + p2 <<= (-octave); + } + + if(p2 <= period && period <= p1) { + a = i; + break; + } + } + + if(JAR_XM_DEBUG && (p1 < period || p2 > period)) { + DEBUG("%i <= %f <= %i should hold but doesn't, this is a bug", p2, period, p1); + } + + note = 12.f * (octave + 2) + a + jar_xm_INVERSE_LERP(p1, p2, period); + + return jar_xm_amiga_frequency(jar_xm_amiga_period(note + note_offset)); + + } + + return .0f; +} + +static void jar_xm_update_frequency(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + ch->frequency = jar_xm_frequency( + ctx, ch->period, + (ch->arp_note_offset > 0 ? ch->arp_note_offset : ( + ch->vibrato_note_offset + ch->autovibrato_note_offset + )) + ); + ch->step = ch->frequency / ctx->rate; +} + +static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, + jar_xm_pattern_slot_t* s) { + if(s->instrument > 0) { + if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) { + /* Tone portamento in effect, unclear stuff happens */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_PERIOD | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); + } else if(s->instrument > ctx->module.num_instruments) { + /* Invalid instrument, Cut current note */ + jar_xm_cut_note(ch); + ch->instrument = NULL; + ch->sample = NULL; + } else { + ch->instrument = ctx->module.instruments + (s->instrument - 1); + if(s->note == 0 && ch->sample != NULL) { + /* Ghost instrument, trigger note */ + /* Sample position is kept, but envelopes are reset */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); + } + } + } + + if(NOTE_IS_VALID(s->note)) { + /* Yes, the real note number is s->note -1. Try finding + * THAT in any of the specs! :-) */ + + jar_xm_instrument_t* instr = ch->instrument; + + if(HAS_TONE_PORTAMENTO(ch->current) && instr != NULL && ch->sample != NULL) { + /* Tone portamento in effect */ + ch->note = s->note + ch->sample->relative_note + ch->sample->finetune / 128.f - 1.f; + ch->tone_portamento_target_period = jar_xm_period(ctx, ch->note); + } else if(instr == NULL || ch->instrument->num_samples == 0) { + /* Bad instrument */ + jar_xm_cut_note(ch); + } else { + if(instr->sample_of_notes[s->note - 1] < instr->num_samples) { +#if JAR_XM_RAMPING + for(unsigned int z = 0; z < jar_xm_SAMPLE_RAMPING_POINTS; ++z) { + ch->end_of_previous_sample[z] = jar_xm_next_of_sample(ch); + } + ch->frame_count = 0; +#endif + ch->sample = instr->samples + instr->sample_of_notes[s->note - 1]; + ch->orig_note = ch->note = s->note + ch->sample->relative_note + + ch->sample->finetune / 128.f - 1.f; + if(s->instrument > 0) { + jar_xm_trigger_note(ctx, ch, 0); + } else { + /* Ghost note: keep old volume */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_VOLUME); + } + } else { + /* Bad sample */ + jar_xm_cut_note(ch); + } + } + } else if(s->note == 97) { + /* Key Off */ + jar_xm_key_off(ch); + } + + switch(s->volume_column >> 4) { + + case 0x5: + if(s->volume_column > 0x50) break; + case 0x1: + case 0x2: + case 0x3: + case 0x4: + /* Set volume */ + ch->volume = (float)(s->volume_column - 0x10) / (float)0x40; + break; + + case 0x8: /* Fine volume slide down */ + jar_xm_volume_slide(ch, s->volume_column & 0x0F); + break; + + case 0x9: /* Fine volume slide up */ + jar_xm_volume_slide(ch, s->volume_column << 4); + break; + + case 0xA: /* Set vibrato speed */ + ch->vibrato_param = (ch->vibrato_param & 0x0F) | ((s->volume_column & 0x0F) << 4); + break; + + case 0xC: /* Set panning */ + ch->panning = (float)( + ((s->volume_column & 0x0F) << 4) | (s->volume_column & 0x0F) + ) / (float)0xFF; + break; + + case 0xF: /* Tone portamento */ + if(s->volume_column & 0x0F) { + ch->tone_portamento_param = ((s->volume_column & 0x0F) << 4) + | (s->volume_column & 0x0F); + } + break; + + default: + break; + + } + + switch(s->effect_type) { + + case 1: /* 1xx: Portamento up */ + if(s->effect_param > 0) { + ch->portamento_up_param = s->effect_param; + } + break; + + case 2: /* 2xx: Portamento down */ + if(s->effect_param > 0) { + ch->portamento_down_param = s->effect_param; + } + break; + + case 3: /* 3xx: Tone portamento */ + if(s->effect_param > 0) { + ch->tone_portamento_param = s->effect_param; + } + break; + + case 4: /* 4xy: Vibrato */ + if(s->effect_param & 0x0F) { + /* Set vibrato depth */ + ch->vibrato_param = (ch->vibrato_param & 0xF0) | (s->effect_param & 0x0F); + } + if(s->effect_param >> 4) { + /* Set vibrato speed */ + ch->vibrato_param = (s->effect_param & 0xF0) | (ch->vibrato_param & 0x0F); + } + break; + + case 5: /* 5xy: Tone portamento + Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 6: /* 6xy: Vibrato + Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 7: /* 7xy: Tremolo */ + if(s->effect_param & 0x0F) { + /* Set tremolo depth */ + ch->tremolo_param = (ch->tremolo_param & 0xF0) | (s->effect_param & 0x0F); + } + if(s->effect_param >> 4) { + /* Set tremolo speed */ + ch->tremolo_param = (s->effect_param & 0xF0) | (ch->tremolo_param & 0x0F); + } + break; + + case 8: /* 8xx: Set panning */ + ch->panning = (float)s->effect_param / (float)0xFF; + break; + + case 9: /* 9xx: Sample offset */ + if(ch->sample != NULL && NOTE_IS_VALID(s->note)) { + uint32_t final_offset = s->effect_param << (ch->sample->bits == 16 ? 7 : 8); + if(final_offset >= ch->sample->length) { + /* Pretend the sample dosen't loop and is done playing */ + ch->sample_position = -1; + break; + } + ch->sample_position = final_offset; + } + break; + + case 0xA: /* Axy: Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 0xB: /* Bxx: Position jump */ + if(s->effect_param < ctx->module.length) { + ctx->position_jump = true; + ctx->jump_dest = s->effect_param; + } + break; + + case 0xC: /* Cxx: Set volume */ + ch->volume = (float)((s->effect_param > 0x40) + ? 0x40 : s->effect_param) / (float)0x40; + break; + + case 0xD: /* Dxx: Pattern break */ + /* Jump after playing this line */ + ctx->pattern_break = true; + ctx->jump_row = (s->effect_param >> 4) * 10 + (s->effect_param & 0x0F); + break; + + case 0xE: /* EXy: Extended command */ + switch(s->effect_param >> 4) { + + case 1: /* E1y: Fine portamento up */ + if(s->effect_param & 0x0F) { + ch->fine_portamento_up_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, -ch->fine_portamento_up_param); + break; + + case 2: /* E2y: Fine portamento down */ + if(s->effect_param & 0x0F) { + ch->fine_portamento_down_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, ch->fine_portamento_down_param); + break; + + case 4: /* E4y: Set vibrato control */ + ch->vibrato_waveform = s->effect_param & 3; + ch->vibrato_waveform_retrigger = !((s->effect_param >> 2) & 1); + break; + + case 5: /* E5y: Set finetune */ + if(NOTE_IS_VALID(ch->current->note) && ch->sample != NULL) { + ch->note = ch->current->note + ch->sample->relative_note + + (float)(((s->effect_param & 0x0F) - 8) << 4) / 128.f - 1.f; + ch->period = jar_xm_period(ctx, ch->note); + jar_xm_update_frequency(ctx, ch); + } + break; + + case 6: /* E6y: Pattern loop */ + if(s->effect_param & 0x0F) { + if((s->effect_param & 0x0F) == ch->pattern_loop_count) { + /* Loop is over */ + ch->pattern_loop_count = 0; + break; + } + + /* Jump to the beginning of the loop */ + ch->pattern_loop_count++; + ctx->position_jump = true; + ctx->jump_row = ch->pattern_loop_origin; + ctx->jump_dest = ctx->current_table_index; + } else { + /* Set loop start point */ + ch->pattern_loop_origin = ctx->current_row; + /* Replicate FT2 E60 bug */ + ctx->jump_row = ch->pattern_loop_origin; + } + break; + + case 7: /* E7y: Set tremolo control */ + ch->tremolo_waveform = s->effect_param & 3; + ch->tremolo_waveform_retrigger = !((s->effect_param >> 2) & 1); + break; + + case 0xA: /* EAy: Fine volume slide up */ + if(s->effect_param & 0x0F) { + ch->fine_volume_slide_param = s->effect_param & 0x0F; + } + jar_xm_volume_slide(ch, ch->fine_volume_slide_param << 4); + break; + + case 0xB: /* EBy: Fine volume slide down */ + if(s->effect_param & 0x0F) { + ch->fine_volume_slide_param = s->effect_param & 0x0F; + } + jar_xm_volume_slide(ch, ch->fine_volume_slide_param); + break; + + case 0xD: /* EDy: Note delay */ + /* XXX: figure this out better. EDx triggers + * the note even when there no note and no + * instrument. But ED0 acts like like a ghost + * note, EDx (x ≠ 0) does not. */ + if(s->note == 0 && s->instrument == 0) { + unsigned int flags = jar_xm_TRIGGER_KEEP_VOLUME; + + if(ch->current->effect_param & 0x0F) { + ch->note = ch->orig_note; + jar_xm_trigger_note(ctx, ch, flags); + } else { + jar_xm_trigger_note( + ctx, ch, + flags + | jar_xm_TRIGGER_KEEP_PERIOD + | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION + ); + } + } + break; + + case 0xE: /* EEy: Pattern delay */ + ctx->extra_ticks = (ch->current->effect_param & 0x0F) * ctx->tempo; + break; + + default: + break; + + } + break; + + case 0xF: /* Fxx: Set tempo/BPM */ + if(s->effect_param > 0) { + if(s->effect_param <= 0x1F) { + ctx->tempo = s->effect_param; + } else { + ctx->bpm = s->effect_param; + } + } + break; + + case 16: /* Gxx: Set global volume */ + ctx->global_volume = (float)((s->effect_param > 0x40) + ? 0x40 : s->effect_param) / (float)0x40; + break; + + case 17: /* Hxy: Global volume slide */ + if(s->effect_param > 0) { + ch->global_volume_slide_param = s->effect_param; + } + break; + + case 21: /* Lxx: Set envelope position */ + ch->volume_envelope_frame_count = s->effect_param; + ch->panning_envelope_frame_count = s->effect_param; + break; + + case 25: /* Pxy: Panning slide */ + if(s->effect_param > 0) { + ch->panning_slide_param = s->effect_param; + } + break; + + case 27: /* Rxy: Multi retrig note */ + if(s->effect_param > 0) { + if((s->effect_param >> 4) == 0) { + /* Keep previous x value */ + ch->multi_retrig_param = (ch->multi_retrig_param & 0xF0) | (s->effect_param & 0x0F); + } else { + ch->multi_retrig_param = s->effect_param; + } + } + break; + + case 29: /* Txy: Tremor */ + if(s->effect_param > 0) { + /* Tremor x and y params do not appear to be separately + * kept in memory, unlike Rxy */ + ch->tremor_param = s->effect_param; + } + break; + + case 33: /* Xxy: Extra stuff */ + switch(s->effect_param >> 4) { + + case 1: /* X1y: Extra fine portamento up */ + if(s->effect_param & 0x0F) { + ch->extra_fine_portamento_up_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, -1.0f * ch->extra_fine_portamento_up_param); + break; + + case 2: /* X2y: Extra fine portamento down */ + if(s->effect_param & 0x0F) { + ch->extra_fine_portamento_down_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, ch->extra_fine_portamento_down_param); + break; + + default: + break; + + } + break; + + default: + break; + + } +} + +static void jar_xm_trigger_note(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, unsigned int flags) { + if(!(flags & jar_xm_TRIGGER_KEEP_SAMPLE_POSITION)) { + ch->sample_position = 0.f; + ch->ping = true; + } + + if(ch->sample != NULL) { + if(!(flags & jar_xm_TRIGGER_KEEP_VOLUME)) { + ch->volume = ch->sample->volume; + } + + ch->panning = ch->sample->panning; + } + + ch->sustained = true; + ch->fadeout_volume = ch->volume_envelope_volume = 1.0f; + ch->panning_envelope_panning = .5f; + ch->volume_envelope_frame_count = ch->panning_envelope_frame_count = 0; + ch->vibrato_note_offset = 0.f; + ch->tremolo_volume = 0.f; + ch->tremor_on = false; + + ch->autovibrato_ticks = 0; + + if(ch->vibrato_waveform_retrigger) { + ch->vibrato_ticks = 0; /* XXX: should the waveform itself also + * be reset to sine? */ + } + if(ch->tremolo_waveform_retrigger) { + ch->tremolo_ticks = 0; + } + + if(!(flags & jar_xm_TRIGGER_KEEP_PERIOD)) { + ch->period = jar_xm_period(ctx, ch->note); + jar_xm_update_frequency(ctx, ch); + } + + ch->latest_trigger = ctx->generated_samples; + if(ch->instrument != NULL) { + ch->instrument->latest_trigger = ctx->generated_samples; + } + if(ch->sample != NULL) { + ch->sample->latest_trigger = ctx->generated_samples; + } +} + +static void jar_xm_cut_note(jar_xm_channel_context_t* ch) { + /* NB: this is not the same as Key Off */ + ch->volume = .0f; +} + +static void jar_xm_key_off(jar_xm_channel_context_t* ch) { + /* Key Off */ + ch->sustained = false; + + /* If no volume envelope is used, also cut the note */ + if(ch->instrument == NULL || !ch->instrument->volume_envelope.enabled) { + jar_xm_cut_note(ch); + } +} + +static void jar_xm_row(jar_xm_context_t* ctx) { + if(ctx->position_jump) { + ctx->current_table_index = ctx->jump_dest; + ctx->current_row = ctx->jump_row; + ctx->position_jump = false; + ctx->pattern_break = false; + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } else if(ctx->pattern_break) { + ctx->current_table_index++; + ctx->current_row = ctx->jump_row; + ctx->pattern_break = false; + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } + + jar_xm_pattern_t* cur = ctx->module.patterns + ctx->module.pattern_table[ctx->current_table_index]; + bool in_a_loop = false; + + /* Read notes… */ + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_pattern_slot_t* s = cur->slots + ctx->current_row * ctx->module.num_channels + i; + jar_xm_channel_context_t* ch = ctx->channels + i; + + ch->current = s; + + if(s->effect_type != 0xE || s->effect_param >> 4 != 0xD) { + jar_xm_handle_note_and_instrument(ctx, ch, s); + } else { + ch->note_delay_param = s->effect_param & 0x0F; + } + + if(!in_a_loop && ch->pattern_loop_count > 0) { + in_a_loop = true; + } + } + + if(!in_a_loop) { + /* No E6y loop is in effect (or we are in the first pass) */ + ctx->loop_count = (ctx->row_loop_count[MAX_NUM_ROWS * ctx->current_table_index + ctx->current_row]++); + } + + ctx->current_row++; /* Since this is an uint8, this line can + * increment from 255 to 0, in which case it + * is still necessary to go the next + * pattern. */ + if(!ctx->position_jump && !ctx->pattern_break && + (ctx->current_row >= cur->num_rows || ctx->current_row == 0)) { + ctx->current_table_index++; + ctx->current_row = ctx->jump_row; /* This will be 0 most of + * the time, except when E60 + * is used */ + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } +} + +static void jar_xm_envelope_tick(jar_xm_channel_context_t* ch, + jar_xm_envelope_t* env, + uint16_t* counter, + float* outval) { + if(env->num_points < 2) { + /* Don't really know what to do… */ + if(env->num_points == 1) { + /* XXX I am pulling this out of my ass */ + *outval = (float)env->points[0].value / (float)0x40; + if(*outval > 1) { + *outval = 1; + } + } + + return; + } else { + uint8_t j; + + if(env->loop_enabled) { + uint16_t loop_start = env->points[env->loop_start_point].frame; + uint16_t loop_end = env->points[env->loop_end_point].frame; + uint16_t loop_length = loop_end - loop_start; + + if(*counter >= loop_end) { + *counter -= loop_length; + } + } + + for(j = 0; j < (env->num_points - 2); ++j) { + if(env->points[j].frame <= *counter && + env->points[j+1].frame >= *counter) { + break; + } + } + + *outval = jar_xm_envelope_lerp(env->points + j, env->points + j + 1, *counter) / (float)0x40; + + /* Make sure it is safe to increment frame count */ + if(!ch->sustained || !env->sustain_enabled || + *counter != env->points[env->sustain_point].frame) { + (*counter)++; + } + } +} + +static void jar_xm_envelopes(jar_xm_channel_context_t* ch) { + if(ch->instrument != NULL) { + if(ch->instrument->volume_envelope.enabled) { + if(!ch->sustained) { + ch->fadeout_volume -= (float)ch->instrument->volume_fadeout / 65536.f; + jar_xm_CLAMP_DOWN(ch->fadeout_volume); + } + + jar_xm_envelope_tick(ch, + &(ch->instrument->volume_envelope), + &(ch->volume_envelope_frame_count), + &(ch->volume_envelope_volume)); + } + + if(ch->instrument->panning_envelope.enabled) { + jar_xm_envelope_tick(ch, + &(ch->instrument->panning_envelope), + &(ch->panning_envelope_frame_count), + &(ch->panning_envelope_panning)); + } + } +} + +static void jar_xm_tick(jar_xm_context_t* ctx) { + if(ctx->current_tick == 0) { + jar_xm_row(ctx); + } + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + jar_xm_envelopes(ch); + jar_xm_autovibrato(ctx, ch); + + if(ch->arp_in_progress && !HAS_ARPEGGIO(ch->current)) { + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + jar_xm_update_frequency(ctx, ch); + } + if(ch->vibrato_in_progress && !HAS_VIBRATO(ch->current)) { + ch->vibrato_in_progress = false; + ch->vibrato_note_offset = 0.f; + jar_xm_update_frequency(ctx, ch); + } + + switch(ch->current->volume_column >> 4) { + + case 0x6: /* Volume slide down */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->current->volume_column & 0x0F); + break; + + case 0x7: /* Volume slide up */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->current->volume_column << 4); + break; + + case 0xB: /* Vibrato */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = false; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + break; + + case 0xD: /* Panning slide left */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->current->volume_column & 0x0F); + break; + + case 0xE: /* Panning slide right */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->current->volume_column << 4); + break; + + case 0xF: /* Tone portamento */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + break; + + default: + break; + + } + + switch(ch->current->effect_type) { + + case 0: /* 0xy: Arpeggio */ + if(ch->current->effect_param > 0) { + char arp_offset = ctx->tempo % 3; + switch(arp_offset) { + case 2: /* 0 -> x -> 0 -> y -> x -> … */ + if(ctx->current_tick == 1) { + ch->arp_in_progress = true; + ch->arp_note_offset = ch->current->effect_param >> 4; + jar_xm_update_frequency(ctx, ch); + break; + } + /* No break here, this is intended */ + case 1: /* 0 -> 0 -> y -> x -> … */ + if(ctx->current_tick == 0) { + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + jar_xm_update_frequency(ctx, ch); + break; + } + /* No break here, this is intended */ + case 0: /* 0 -> y -> x -> … */ + jar_xm_arpeggio(ctx, ch, ch->current->effect_param, ctx->current_tick - arp_offset); + default: + break; + } + } + break; + + case 1: /* 1xx: Portamento up */ + if(ctx->current_tick == 0) break; + jar_xm_pitch_slide(ctx, ch, -ch->portamento_up_param); + break; + + case 2: /* 2xx: Portamento down */ + if(ctx->current_tick == 0) break; + jar_xm_pitch_slide(ctx, ch, ch->portamento_down_param); + break; + + case 3: /* 3xx: Tone portamento */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + break; + + case 4: /* 4xy: Vibrato */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = true; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + break; + + case 5: /* 5xy: Tone portamento + Volume slide */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 6: /* 6xy: Vibrato + Volume slide */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = true; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 7: /* 7xy: Tremolo */ + if(ctx->current_tick == 0) break; + jar_xm_tremolo(ctx, ch, ch->tremolo_param, ch->tremolo_ticks++); + break; + + case 0xA: /* Axy: Volume slide */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 0xE: /* EXy: Extended command */ + switch(ch->current->effect_param >> 4) { + + case 0x9: /* E9y: Retrigger note */ + if(ctx->current_tick != 0 && ch->current->effect_param & 0x0F) { + if(!(ctx->current_tick % (ch->current->effect_param & 0x0F))) { + jar_xm_trigger_note(ctx, ch, 0); + jar_xm_envelopes(ch); + } + } + break; + + case 0xC: /* ECy: Note cut */ + if((ch->current->effect_param & 0x0F) == ctx->current_tick) { + jar_xm_cut_note(ch); + } + break; + + case 0xD: /* EDy: Note delay */ + if(ch->note_delay_param == ctx->current_tick) { + jar_xm_handle_note_and_instrument(ctx, ch, ch->current); + jar_xm_envelopes(ch); + } + break; + + default: + break; + + } + break; + + case 17: /* Hxy: Global volume slide */ + if(ctx->current_tick == 0) break; + if((ch->global_volume_slide_param & 0xF0) && + (ch->global_volume_slide_param & 0x0F)) { + /* Illegal state */ + break; + } + if(ch->global_volume_slide_param & 0xF0) { + /* Global slide up */ + float f = (float)(ch->global_volume_slide_param >> 4) / (float)0x40; + ctx->global_volume += f; + jar_xm_CLAMP_UP(ctx->global_volume); + } else { + /* Global slide down */ + float f = (float)(ch->global_volume_slide_param & 0x0F) / (float)0x40; + ctx->global_volume -= f; + jar_xm_CLAMP_DOWN(ctx->global_volume); + } + break; + + case 20: /* Kxx: Key off */ + /* Most documentations will tell you the parameter has no + * use. Don't be fooled. */ + if(ctx->current_tick == ch->current->effect_param) { + jar_xm_key_off(ch); + } + break; + + case 25: /* Pxy: Panning slide */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->panning_slide_param); + break; + + case 27: /* Rxy: Multi retrig note */ + if(ctx->current_tick == 0) break; + if(((ch->multi_retrig_param) & 0x0F) == 0) break; + if((ctx->current_tick % (ch->multi_retrig_param & 0x0F)) == 0) { + float v = ch->volume * multi_retrig_multiply[ch->multi_retrig_param >> 4] + + multi_retrig_add[ch->multi_retrig_param >> 4]; + jar_xm_CLAMP(v); + jar_xm_trigger_note(ctx, ch, 0); + ch->volume = v; + } + break; + + case 29: /* Txy: Tremor */ + if(ctx->current_tick == 0) break; + ch->tremor_on = ( + (ctx->current_tick - 1) % ((ch->tremor_param >> 4) + (ch->tremor_param & 0x0F) + 2) + > + (ch->tremor_param >> 4) + ); + break; + + default: + break; + + } + + float panning, volume; + + panning = ch->panning + + (ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; + + if(ch->tremor_on) { + volume = .0f; + } else { + volume = ch->volume + ch->tremolo_volume; + jar_xm_CLAMP(volume); + volume *= ch->fadeout_volume * ch->volume_envelope_volume; + } + +#if JAR_XM_RAMPING + ch->target_panning = panning; + ch->target_volume = volume; +#else + ch->actual_panning = panning; + ch->actual_volume = volume; +#endif + } + + ctx->current_tick++; + if(ctx->current_tick >= ctx->tempo + ctx->extra_ticks) { + ctx->current_tick = 0; + ctx->extra_ticks = 0; + } + + /* FT2 manual says number of ticks / second = BPM * 0.4 */ + ctx->remaining_samples_in_tick += (float)ctx->rate / ((float)ctx->bpm * 0.4f); +} + +static float jar_xm_next_of_sample(jar_xm_channel_context_t* ch) { + if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { +#if JAR_XM_RAMPING + if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], .0f, + (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } +#endif + return .0f; + } + if(ch->sample->length == 0) { + return .0f; + } + + float u, v, t; + uint32_t a, b; + a = (uint32_t)ch->sample_position; /* This cast is fine, + * sample_position will not + * go above integer + * ranges */ + if(JAR_XM_LINEAR_INTERPOLATION) { + b = a + 1; + t = ch->sample_position - a; /* Cheaper than fmodf(., 1.f) */ + } + u = ch->sample->data[a]; + + switch(ch->sample->loop_type) { + + case jar_xm_NO_LOOP: + if(JAR_XM_LINEAR_INTERPOLATION) { + v = (b < ch->sample->length) ? ch->sample->data[b] : .0f; + } + ch->sample_position += ch->step; + if(ch->sample_position >= ch->sample->length) { + ch->sample_position = -1; + } + break; + + case jar_xm_FORWARD_LOOP: + if(JAR_XM_LINEAR_INTERPOLATION) { + v = ch->sample->data[ + (b == ch->sample->loop_end) ? ch->sample->loop_start : b + ]; + } + ch->sample_position += ch->step; + while(ch->sample_position >= ch->sample->loop_end) { + ch->sample_position -= ch->sample->loop_length; + } + break; + + case jar_xm_PING_PONG_LOOP: + if(ch->ping) { + ch->sample_position += ch->step; + } else { + ch->sample_position -= ch->step; + } + /* XXX: this may not work for very tight ping-pong loops + * (ie switches direction more than once per sample */ + if(ch->ping) { + if(JAR_XM_LINEAR_INTERPOLATION) { + v = (b >= ch->sample->loop_end) ? ch->sample->data[a] : ch->sample->data[b]; + } + if(ch->sample_position >= ch->sample->loop_end) { + ch->ping = false; + ch->sample_position = (ch->sample->loop_end << 1) - ch->sample_position; + } + /* sanity checking */ + if(ch->sample_position >= ch->sample->length) { + ch->ping = false; + ch->sample_position -= ch->sample->length - 1; + } + } else { + if(JAR_XM_LINEAR_INTERPOLATION) { + v = u; + u = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[a] : ch->sample->data[b - 2]; + } + if(ch->sample_position <= ch->sample->loop_start) { + ch->ping = true; + ch->sample_position = (ch->sample->loop_start << 1) - ch->sample_position; + } + /* sanity checking */ + if(ch->sample_position <= .0f) { + ch->ping = true; + ch->sample_position = .0f; + } + } + break; + + default: + v = .0f; + break; + } + + float endval = JAR_XM_LINEAR_INTERPOLATION ? jar_xm_LERP(u, v, t) : u; + +#if JAR_XM_RAMPING + if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + /* Smoothly transition between old and new sample. */ + return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], endval, + (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } +#endif + + return endval; +} + +static void jar_xm_sample(jar_xm_context_t* ctx, float* left, float* right) { + if(ctx->remaining_samples_in_tick <= 0) { + jar_xm_tick(ctx); + } + ctx->remaining_samples_in_tick--; + + *left = 0.f; + *right = 0.f; + + if(ctx->max_loop_count > 0 && ctx->loop_count >= ctx->max_loop_count) { + return; + } + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { + continue; + } + + const float fval = jar_xm_next_of_sample(ch); + + if(!ch->muted && !ch->instrument->muted) { + *left += fval * ch->actual_volume * (1.f - ch->actual_panning); + *right += fval * ch->actual_volume * ch->actual_panning; + } + +#if JAR_XM_RAMPING + ch->frame_count++; + jar_xm_SLIDE_TOWARDS(ch->actual_volume, ch->target_volume, ctx->volume_ramp); + jar_xm_SLIDE_TOWARDS(ch->actual_panning, ch->target_panning, ctx->panning_ramp); +#endif + } + + const float fgvol = ctx->global_volume * ctx->amplification; + *left *= fgvol; + *right *= fgvol; + +#if JAR_XM_DEBUG + if(fabs(*left) > 1 || fabs(*right) > 1) { + DEBUG("clipping frame: %f %f, this is a bad module or a libxm bug", *left, *right); + } +#endif +} + +void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples) { + if(ctx && output) { + ctx->generated_samples += numsamples; + for(size_t i = 0; i < numsamples; i++) { + jar_xm_sample(ctx, output + (2 * i), output + (2 * i + 1)); + } + } +} + + + + + + + +//-------------------------------------------- +//FILE LOADER - TODO - NEEDS TO BE CLEANED UP +//-------------------------------------------- + + + +#undef DEBUG +#define DEBUG(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) + +#define DEBUG_ERR(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) + +#define FATAL(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + exit(1); \ + } while(0) + +#define FATAL_ERR(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + exit(1); \ + } while(0) + + +int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename) { + FILE* xmf; + int size; + + xmf = fopen(filename, "rb"); + if(xmf == NULL) { + DEBUG_ERR("Could not open input file"); + *ctx = NULL; + return 3; + } + + fseek(xmf, 0, SEEK_END); + size = ftell(xmf); + rewind(xmf); + if(size == -1) { + fclose(xmf); + DEBUG_ERR("fseek() failed"); + *ctx = NULL; + return 4; + } + + char* data = malloc(size + 1); + if(fread(data, 1, size, xmf) < size) { + fclose(xmf); + DEBUG_ERR("fread() failed"); + *ctx = NULL; + return 5; + } + + fclose(xmf); + + switch(jar_xm_create_context_safe(ctx, data, size, rate)) { + case 0: + break; + + case 1: + DEBUG("could not create context: module is not sane\n"); + *ctx = NULL; + return 1; + break; + + case 2: + FATAL("could not create context: malloc failed\n"); + return 2; + break; + + default: + FATAL("could not create context: unknown error\n"); + return 6; + break; + + } + + return 0; +} + + + + +#endif//end of JAR_XM_IMPLEMENTATION +//------------------------------------------------------------------------------- + + + + +#endif//end of INCLUDE_JAR_XM_H -- cgit v1.2.3 From cb05c51911fdc885c8e91e51cbaa2ab32e114c7b Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 24 Apr 2016 18:18:18 -0700 Subject: tabs to spaces fix --- src/audio.c | 124 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 9baa2222..e5bd6819 100644 --- a/src/audio.c +++ b/src/audio.c @@ -75,7 +75,7 @@ // NOTE: Anything longer than ~10 seconds should be streamed... typedef struct Music { stb_vorbis *stream; - jar_xm_context_t *chipctx; // Stores jar_xm context + jar_xm_context_t *chipctx; // Stores jar_xm context ALuint buffers[MUSIC_STREAM_BUFFERS]; ALuint source; @@ -85,7 +85,7 @@ typedef struct Music { int sampleRate; int totalSamplesLeft; bool loop; - bool chipTune; // True if chiptune is loaded + bool chipTune; // True if chiptune is loaded } Music; #if defined(AUDIO_STANDALONE) @@ -567,22 +567,22 @@ void PlayMusicStream(char *fileName) currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; } } - else if (strcmp(GetExtension(fileName),"xm") == 0) - { - currentMusic.chipTune = true; - currentMusic.channels = 2; - currentMusic.sampleRate = 48000; - currentMusic.loop = true; - - // only stereo/float is supported for xm - if(info.channels == 2 && !jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) - { - currentMusic.format = AL_FORMAT_STEREO_FLOAT32; - jar_xm_set_max_loop_count(currentMusic.chipctx, 0); //infinite number of loops - //currentMusic.totalSamplesLeft = ; // Unsure of how to calculate this - musicEnabled = true; - } - } + else if (strcmp(GetExtension(fileName),"xm") == 0) + { + currentMusic.chipTune = true; + currentMusic.channels = 2; + currentMusic.sampleRate = 48000; + currentMusic.loop = true; + + // only stereo/float is supported for xm + if(info.channels == 2 && !jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) + { + currentMusic.format = AL_FORMAT_STEREO_FLOAT32; + jar_xm_set_max_loop_count(currentMusic.chipctx, 0); //infinite number of loops + //currentMusic.totalSamplesLeft = ; // Unsure of how to calculate this + musicEnabled = true; + } + } else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); } @@ -591,19 +591,19 @@ void StopMusicStream(void) { if (musicEnabled) { - alSourceStop(currentMusic.source); - EmptyMusicStream(); // Empty music buffers - alDeleteSources(1, ¤tMusic.source); - alDeleteBuffers(2, currentMusic.buffers); - - if (currentMusic.chipTune) - { - jar_xm_free_context(currentMusic.chipctx); - } - else - { - stb_vorbis_close(currentMusic.stream); - } + alSourceStop(currentMusic.source); + EmptyMusicStream(); // Empty music buffers + alDeleteSources(1, ¤tMusic.source); + alDeleteBuffers(2, currentMusic.buffers); + + if (currentMusic.chipTune) + { + jar_xm_free_context(currentMusic.chipctx); + } + else + { + stb_vorbis_close(currentMusic.stream); + } } musicEnabled = false; @@ -657,15 +657,15 @@ void SetMusicVolume(float volume) // Get current music time length (in seconds) float GetMusicTimeLength(void) { - float totalSeconds; - if (currentMusic.chipTune) - { - //totalSeconds = (float)samples; // Need to figure out how toget this - } - else - { - totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); - } + float totalSeconds; + if (currentMusic.chipTune) + { + //totalSeconds = (float)samples; // Need to figure out how toget this + } + else + { + totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); + } return totalSeconds; } @@ -673,19 +673,19 @@ float GetMusicTimeLength(void) // Get current music time played (in seconds) float GetMusicTimePlayed(void) { - float secondsPlayed; - if (currentMusic.chipTune) - { - uint64_t* samples; - jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, samples); // Unsure if this is the desired value - secondsPlayed = (float)samples; - } - else - { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; - int samplesPlayed = totalSamples - currentMusic.totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic.sampleRate * currentMusic.channels); - } + float secondsPlayed; + if (currentMusic.chipTune) + { + uint64_t* samples; + jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, samples); // Unsure if this is the desired value + secondsPlayed = (float)samples; + } + else + { + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; + int samplesPlayed = totalSamples - currentMusic.totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (currentMusic.sampleRate * currentMusic.channels); + } return secondsPlayed; @@ -709,15 +709,15 @@ static bool BufferMusicStream(ALuint buffer) { while (size < MUSIC_BUFFER_SIZE) { - if (currentMusic.chipTune) - { - jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size)/2); - streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. - } - else - { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); - } + if (currentMusic.chipTune) + { + jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size)/2); + streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + } + else + { + streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); + } if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); else break; -- cgit v1.2.3 From 1c370f5a179ab956d90d80e5a3b566ab14027557 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 24 Apr 2016 22:00:40 -0700 Subject: cleaned up calculations --- src/audio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index e5bd6819..b8657336 100644 --- a/src/audio.c +++ b/src/audio.c @@ -676,9 +676,9 @@ float GetMusicTimePlayed(void) float secondsPlayed; if (currentMusic.chipTune) { - uint64_t* samples; - jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, samples); // Unsure if this is the desired value - secondsPlayed = (float)samples; + uint64_t samples; + jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, &samples); // Unsure if this is the desired value + secondsPlayed = (float)samples / (currentMusic.sampleRate * currentMusic.channels); } else { @@ -711,7 +711,7 @@ static bool BufferMusicStream(ALuint buffer) { if (currentMusic.chipTune) { - jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size)/2); + jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2); streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. } else -- cgit v1.2.3 From 89a84a621bb5bd3a6f17ebc788e143c2874cd55b Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 24 Apr 2016 22:04:31 -0700 Subject: implement --- src/audio.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index b8657336..93b83599 100644 --- a/src/audio.c +++ b/src/audio.c @@ -42,6 +42,7 @@ #include // Required for strcmp() #include // Used for .WAV loading +#define JAR_XM_IMPLEMENTATION #include "jar_xm.h" // For playing .xm files #if defined(AUDIO_STANDALONE) -- cgit v1.2.3 From 62087d21cc9c3ab166fd0e4e54401c907374a46a Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 24 Apr 2016 23:44:49 -0700 Subject: updated jar_xm --- src/jar_xm.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/jar_xm.h b/src/jar_xm.h index 2f102cf8..4fda948b 100644 --- a/src/jar_xm.h +++ b/src/jar_xm.h @@ -288,6 +288,13 @@ uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t*, uint16_t instr, */ uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t*, uint16_t); +/** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. + * + * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. + * @note This function is very slow and should only be run once, if at all. + */ +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t*); + #ifdef __cplusplus } #endif @@ -2543,7 +2550,22 @@ void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsam } } - +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) +{ + uint64_t total = 0; + uint8_t currentLoopCount = jar_xm_get_loop_count(ctx); + jar_xm_set_max_loop_count(ctx, 0); + + while(jar_xm_get_loop_count(ctx) == currentLoopCount) + { + total += ctx->remaining_samples_in_tick; + ctx->remaining_samples_in_tick = 0; + jar_xm_tick(ctx); + } + + ctx->loop_count = currentLoopCount; + return total; +} -- cgit v1.2.3 From f12754b01f107913b722c80f0d957bdcdfb68c81 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 25 Apr 2016 18:40:19 -0700 Subject: quick fix Boolean errors --- src/audio.c | 20 ++++++++++---------- src/jar_xm.h | 3 ++- src/raylib.h | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 93b83599..5953cd40 100644 --- a/src/audio.c +++ b/src/audio.c @@ -42,9 +42,6 @@ #include // Required for strcmp() #include // Used for .WAV loading -#define JAR_XM_IMPLEMENTATION -#include "jar_xm.h" // For playing .xm files - #if defined(AUDIO_STANDALONE) #include // Used for functions with variable number of parameters (TraceLog()) #else @@ -53,7 +50,10 @@ #endif //#define STB_VORBIS_HEADER_ONLY -#include "stb_vorbis.h" // OGG loading functions +#include "stb_vorbis.h" // OGG loading functions + +#define JAR_XM_IMPLEMENTATION +#include "jar_xm.h" // For playing .xm files //---------------------------------------------------------------------------------- // Defines and Macros @@ -576,11 +576,11 @@ void PlayMusicStream(char *fileName) currentMusic.loop = true; // only stereo/float is supported for xm - if(info.channels == 2 && !jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) + if(!jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) { - currentMusic.format = AL_FORMAT_STEREO_FLOAT32; - jar_xm_set_max_loop_count(currentMusic.chipctx, 0); //infinite number of loops - //currentMusic.totalSamplesLeft = ; // Unsure of how to calculate this + currentMusic.format = AL_FORMAT_STEREO16; // AL_FORMAT_STEREO_FLOAT32; + jar_xm_set_max_loop_count(currentMusic.chipctx, 0); // infinite number of loops + currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); musicEnabled = true; } } @@ -712,8 +712,8 @@ static bool BufferMusicStream(ALuint buffer) { if (currentMusic.chipTune) { - jar_xm_generate_samples(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2); - streamedBytes = (MUSIC_BUFFER_SIZE - size)/2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2); + streamedBytes = (MUSIC_BUFFER_SIZE - size) * 2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. } else { diff --git a/src/jar_xm.h b/src/jar_xm.h index 4fda948b..062b88da 100644 --- a/src/jar_xm.h +++ b/src/jar_xm.h @@ -59,10 +59,11 @@ #include #include #include -#include #include #include + + //------------------------------------------------------------------------------- #ifdef __cplusplus extern "C" { diff --git a/src/raylib.h b/src/raylib.h index 0c80b957..de157087 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -261,7 +261,8 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type -typedef enum { false, true } bool; +#include +//typedef enum { false, true } bool; #endif // byte type -- cgit v1.2.3 From 04d9deac92dc9dc041ee31b0d9535d0d535d4040 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 25 Apr 2016 20:05:03 -0700 Subject: setting up openal --- src/audio.c | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 5953cd40..b46c2c20 100644 --- a/src/audio.c +++ b/src/audio.c @@ -85,6 +85,7 @@ typedef struct Music { int channels; int sampleRate; int totalSamplesLeft; + float totalLengthSeconds; bool loop; bool chipTune; // True if chiptune is loaded } Music; @@ -575,13 +576,26 @@ void PlayMusicStream(char *fileName) currentMusic.sampleRate = 48000; currentMusic.loop = true; - // only stereo/float is supported for xm + // only stereo is supported for xm if(!jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) { currentMusic.format = AL_FORMAT_STEREO16; // AL_FORMAT_STEREO_FLOAT32; jar_xm_set_max_loop_count(currentMusic.chipctx, 0); // infinite number of loops currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); + currentMusic.totalLengthSeconds = currentMusic.totalSamplesLeft / (currentMusic.sampleRate * currentMusic.channels); musicEnabled = true; + + // Set up OpenAL + alGenSources(1, ¤tMusic.source); + alSourcef(currentMusic.source, AL_PITCH, 1); + alSourcef(currentMusic.source, AL_GAIN, 1); + alSource3f(currentMusic.source, AL_POSITION, 0, 0, 0); + alSource3f(currentMusic.source, AL_VELOCITY, 0, 0, 0); + alGenBuffers(2, currentMusic.buffers); + BufferMusicStream(currentMusic.buffers[0]); + BufferMusicStream(currentMusic.buffers[1]); + alSourceQueueBuffers(currentMusic.source, 2, currentMusic.buffers); + alSourcePlay(currentMusic.source); } } else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); @@ -661,7 +675,7 @@ float GetMusicTimeLength(void) float totalSeconds; if (currentMusic.chipTune) { - //totalSeconds = (float)samples; // Need to figure out how toget this + totalSeconds = currentMusic.totalLengthSeconds; // Not sure if this is the correct value } else { @@ -678,8 +692,8 @@ float GetMusicTimePlayed(void) if (currentMusic.chipTune) { uint64_t samples; - jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, &samples); // Unsure if this is the desired value - secondsPlayed = (float)samples / (currentMusic.sampleRate * currentMusic.channels); + jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (currentMusic.sampleRate * currentMusic.channels); // Not sure if this is the correct value } else { @@ -710,10 +724,11 @@ static bool BufferMusicStream(ALuint buffer) { while (size < MUSIC_BUFFER_SIZE) { - if (currentMusic.chipTune) + if (currentMusic.chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm + size, (MUSIC_BUFFER_SIZE - size) / 2); - streamedBytes = (MUSIC_BUFFER_SIZE - size) * 2; // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + int readlen = (MUSIC_BUFFER_SIZE - size) / 2; + jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm + size, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location + streamedBytes = readlen * 4; // Not sure if this is what it needs } else { @@ -781,9 +796,15 @@ void UpdateMusicStream(void) // If no more data to stream, restart music (if loop) if ((!active) && (currentMusic.loop)) { - stb_vorbis_seek_start(currentMusic.stream); - currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream)*currentMusic.channels; - + if(currentMusic.chipTune) + { + currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); + } + else + { + stb_vorbis_seek_start(currentMusic.stream); + currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream)*currentMusic.channels; + } active = BufferMusicStream(buffer); } -- cgit v1.2.3 From 3104d3d6cd3c29b6e240198628110b21882a8fb0 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 25 Apr 2016 22:18:49 -0700 Subject: small fix for streaming There is still an issue where audio will cut off after a brief moment --- src/audio.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index b46c2c20..9472cef6 100644 --- a/src/audio.c +++ b/src/audio.c @@ -567,10 +567,15 @@ void PlayMusicStream(char *fileName) // NOTE: Regularly, we must check if a buffer has been processed and refill it: UpdateMusicStream() currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; + currentMusic.totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); } } else if (strcmp(GetExtension(fileName),"xm") == 0) { + // Stop current music, clean buffers, unload current stream + StopMusicStream(); + + // new song settings for xm chiptune currentMusic.chipTune = true; currentMusic.channels = 2; currentMusic.sampleRate = 48000; @@ -714,39 +719,37 @@ float GetMusicTimePlayed(void) static bool BufferMusicStream(ALuint buffer) { short pcm[MUSIC_BUFFER_SIZE]; - + int size = 0; // Total size of data steamed (in bytes) - int streamedBytes = 0; // Bytes of data obtained in one samples get - + int streamedBytes = 0; // samples of data obtained, channels are not included in calculation bool active = true; // We can get more data from stream (not finished) if (musicEnabled) { - while (size < MUSIC_BUFFER_SIZE) + if (currentMusic.chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - if (currentMusic.chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. - { - int readlen = (MUSIC_BUFFER_SIZE - size) / 2; - jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm + size, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location - streamedBytes = readlen * 4; // Not sure if this is what it needs - } - else + int readlen = MUSIC_BUFFER_SIZE / 2; + jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location + size += readlen * currentMusic.channels; // Not sure if this is what it needs + } + else + { + while (size < MUSIC_BUFFER_SIZE) { streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); + if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); + else break; } - - if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); - else break; } - - //TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); + TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); } if (size > 0) { alBufferData(buffer, currentMusic.format, pcm, size*sizeof(short), currentMusic.sampleRate); - currentMusic.totalSamplesLeft -= size; + + if(currentMusic.totalSamplesLeft <= 0) active = false; // end if no more samples left } else { -- cgit v1.2.3 From 299ae7a4bdcddc31281b1e2d0cd2df476755fb79 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Tue, 26 Apr 2016 16:50:07 -0700 Subject: new trace logs and optimizations --- src/audio.c | 14 ++++++++++---- src/jar_xm.h | 30 +++++++++++++----------------- 2 files changed, 23 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 9472cef6..2b8c6d48 100644 --- a/src/audio.c +++ b/src/audio.c @@ -584,12 +584,15 @@ void PlayMusicStream(char *fileName) // only stereo is supported for xm if(!jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) { - currentMusic.format = AL_FORMAT_STEREO16; // AL_FORMAT_STEREO_FLOAT32; + currentMusic.format = AL_FORMAT_STEREO16; jar_xm_set_max_loop_count(currentMusic.chipctx, 0); // infinite number of loops currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); - currentMusic.totalLengthSeconds = currentMusic.totalSamplesLeft / (currentMusic.sampleRate * currentMusic.channels); + currentMusic.totalLengthSeconds = ((float)currentMusic.totalSamplesLeft) / ((float)currentMusic.sampleRate); musicEnabled = true; + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic.totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic.totalLengthSeconds); + // Set up OpenAL alGenSources(1, ¤tMusic.source); alSourcef(currentMusic.source, AL_PITCH, 1); @@ -601,7 +604,10 @@ void PlayMusicStream(char *fileName) BufferMusicStream(currentMusic.buffers[1]); alSourceQueueBuffers(currentMusic.source, 2, currentMusic.buffers); alSourcePlay(currentMusic.source); + + // NOTE: Regularly, we must check if a buffer has been processed and refill it: UpdateMusicStream() } + else TraceLog(WARNING, "[%s] XM file could not be opened", fileName); } else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); } @@ -680,7 +686,7 @@ float GetMusicTimeLength(void) float totalSeconds; if (currentMusic.chipTune) { - totalSeconds = currentMusic.totalLengthSeconds; // Not sure if this is the correct value + totalSeconds = currentMusic.totalLengthSeconds; } else { @@ -801,7 +807,7 @@ void UpdateMusicStream(void) { if(currentMusic.chipTune) { - currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); + currentMusic.totalSamplesLeft = currentMusic.totalLengthSeconds * currentMusic.sampleRate; } else { diff --git a/src/jar_xm.h b/src/jar_xm.h index 062b88da..f9ddb511 100644 --- a/src/jar_xm.h +++ b/src/jar_xm.h @@ -121,51 +121,47 @@ void jar_xm_free_context(jar_xm_context_t*); /** Play the module and put the sound samples in an output buffer. * - * @param output buffer of 2*numsamples elements + * @param output buffer of 2*numsamples elements (A left and right value for each sample) * @param numsamples number of samples to generate */ void jar_xm_generate_samples(jar_xm_context_t*, float* output, size_t numsamples); /** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. * - * @param output buffer of 2*numsamples elements + * @param output buffer of 2*numsamples elements (A left and right value for each sample) * @param numsamples number of samples to generate */ void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) { float* musicBuffer = malloc((2*numsamples)*sizeof(float)); - short* musicBuffer2 = malloc((2*numsamples)*sizeof(short)); - jar_xm_generate_samples(ctx, musicBuffer, numsamples); - int x; - for(x=0;x<2*numsamples;x++) - musicBuffer2[x] = musicBuffer[x] * SHRT_MAX; + if(output){ + int x; + for(x=0;x<2*numsamples;x++) + output[x] = musicBuffer[x] * SHRT_MAX; + } - memcpy(output, musicBuffer2, (2*numsamples)*sizeof(short)); free(musicBuffer); - free(musicBuffer2); } /** Play the module, resample from 32 bit to 8 bit, and put the sound samples in an output buffer. * - * @param output buffer of 2*numsamples elements + * @param output buffer of 2*numsamples elements (A left and right value for each sample) * @param numsamples number of samples to generate */ void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) { float* musicBuffer = malloc((2*numsamples)*sizeof(float)); - char* musicBuffer2 = malloc((2*numsamples)*sizeof(char)); - jar_xm_generate_samples(ctx, musicBuffer, numsamples); - int x; - for(x=0;x<2*numsamples;x++) - musicBuffer2[x] = musicBuffer[x] * CHAR_MAX; + if(output){ + int x; + for(x=0;x<2*numsamples;x++) + output[x] = musicBuffer[x] * CHAR_MAX; + } - memcpy(output, musicBuffer2, (2*numsamples)*sizeof(char)); free(musicBuffer); - free(musicBuffer2); } -- cgit v1.2.3 From f707c1ca468ef3243808ec87a0b6a891f6c6a130 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 27 Apr 2016 00:02:11 -0700 Subject: this should work --- src/audio.c | 2 +- src/raylib.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2b8c6d48..0be257d9 100644 --- a/src/audio.c +++ b/src/audio.c @@ -820,7 +820,7 @@ void UpdateMusicStream(void) // Add refilled buffer to queue again... don't let the music stop! alSourceQueueBuffers(currentMusic.source, 1, &buffer); - if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Ogg playing, error buffering data..."); + if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); processed--; } diff --git a/src/raylib.h b/src/raylib.h index de157087..699fbbdb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -261,8 +261,9 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type -#include -//typedef enum { false, true } bool; + #ifndef true + typedef enum { false, true } bool; + #endif #endif // byte type -- cgit v1.2.3 From 91f1f324c0ee3bd57ed778b39fd54d97330dba32 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Fri, 29 Apr 2016 23:00:12 -0700 Subject: First stage of audio API update Look over changes and give feedback please. --- src/audio.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- src/audio.h | 25 +++++++++++++++++++++++-- src/raylib.h | 19 +++++++++++++++++++ 3 files changed, 92 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 0be257d9..ededf4ae 100644 --- a/src/audio.c +++ b/src/audio.c @@ -97,9 +97,10 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- +static bool mixChannelsActive_g[4]; // What mix channels are currently active static bool musicEnabled = false; -static Music currentMusic; // Current music loaded - // NOTE: Only one music file playing at a time +static Music currentMusic; // Current music loaded + // NOTE: Only one music file playing at a time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -164,6 +165,53 @@ void CloseAudioDevice(void) alcCloseDevice(device); } +// True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet +bool AudioDeviceReady(void) +{ + ALCcontext *context = alcGetCurrentContext(); + if (context == NULL) return false; + else{ + ALCdevice *device = alcGetContextsDevice(context); + if (device == NULL) return false; + else return true; + } +} + +//---------------------------------------------------------------------------------- +// Module Functions Definition - Custom audio output +//---------------------------------------------------------------------------------- + +// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing +// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, mixA, stereo); +AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels) +{ + if(!AudioDeviceReady()) InitAudioDevice(); + else StopMusicStream(); + + if(!mixChannelsActive_g[mixChannel]){ + AudioContext *ac = malloc(sizeof(AudioContext)); + ac->sampleRate = sampleRate; + ac->bitsPerSample = bitsPerSample; + ac->mixChannel = mixChannel; + ac->channels = channels; + mixChannelsActive_g[mixChannel] = true; + return ac; + } + return NULL; +} + +// Frees buffer in audio context +void CloseAudioContext(AudioContext *ctx) +{ + if(ctx){ + mixChannelsActive_g[ctx->mixChannel] = false; + free(ctx); + } +} + + + //---------------------------------------------------------------------------------- // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- diff --git a/src/audio.h b/src/audio.h index ed156532..401edc3e 100644 --- a/src/audio.h +++ b/src/audio.h @@ -41,8 +41,12 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type -typedef enum { false, true } bool; + #ifndef true + typedef enum { false, true } bool; + #endif #endif +typedef enum { silence, mono, stereo } channel_t; +typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio streams // Sound source type typedef struct Sound { @@ -59,6 +63,16 @@ typedef struct Wave { short channels; } Wave; +// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be +// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to +// a dedicated mix channel. +typedef struct AudioContext { + unsigned short sampleRate; // default is 48000 + unsigned char bitsPerSample; // 16 is default + mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream + channel_t channels; // 1=mono, 2=stereo +} AudioContext; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -73,6 +87,13 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) +bool AudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet + +// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing +// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, mixA, stereo); +AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +void CloseAudioContext(AudioContext *ctx); // Frees audio context Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data @@ -92,7 +113,7 @@ void PauseMusicStream(void); // Pause music p void ResumeMusicStream(void); // Resume playing paused music bool MusicIsPlaying(void); // Check if music is playing void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) -float GetMusicTimeLength(void); // Get current music time length (in seconds) +float GetMusicTimeLength(void); // Get music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) #ifdef __cplusplus diff --git a/src/raylib.h b/src/raylib.h index 699fbbdb..1721c009 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -265,6 +265,8 @@ typedef enum { false, true } bool; #endif #endif +typedef enum { silence, mono, stereo } channel_t; +typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio streams // byte type typedef unsigned char byte; @@ -446,6 +448,16 @@ typedef struct Wave { short channels; } Wave; +// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be +// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to +// a dedicated mix channel. +typedef struct AudioContext { + unsigned short sampleRate; // default is 48000 + unsigned char bitsPerSample; // 16 is default + mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream + channel_t channels; // 1=mono, 2=stereo +} AudioContext; + // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { @@ -863,6 +875,13 @@ void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); //------------------------------------------------------------------------------------ void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) +bool AudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet + +// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing +// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, mixA, stereo); +AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +void CloseAudioContext(AudioContext *ctx); // Frees audio context Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From 5f1e8b827822ded6d24d71f75e1f1d0d301dbb2d Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Fri, 29 Apr 2016 23:43:21 -0700 Subject: hide struct from user Hiding the struct from user should protect from accidentally modifying the mix channel. This could cause serious errors down the road. --- src/audio.c | 37 +++++++++++++++++++++++++++---------- src/audio.h | 12 ++++-------- src/raylib.h | 12 ++++-------- 3 files changed, 35 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index ededf4ae..2c0ed3de 100644 --- a/src/audio.c +++ b/src/audio.c @@ -90,6 +90,16 @@ typedef struct Music { bool chipTune; // True if chiptune is loaded } Music; +// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be +// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to +// a dedicated mix channel. +typedef struct AudioContext_t { + unsigned short sampleRate; // default is 48000 + unsigned char bitsPerSample; // 16 is default + mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream + channel_t channels; // 1=mono, 2=stereo +} AudioContext_t; + #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif @@ -97,10 +107,10 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static bool mixChannelsActive_g[4]; // What mix channels are currently active +static AudioContext_t* mixChannelsActive_g[4]; // What mix channels are currently active static bool musicEnabled = false; -static Music currentMusic; // Current music loaded - // NOTE: Only one music file playing at a time +static Music currentMusic; // Current music loaded + // NOTE: Only one music file playing at a time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -184,32 +194,39 @@ bool AudioDeviceReady(void) // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. // exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels) +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels) { if(!AudioDeviceReady()) InitAudioDevice(); else StopMusicStream(); if(!mixChannelsActive_g[mixChannel]){ - AudioContext *ac = malloc(sizeof(AudioContext)); + AudioContext_t *ac = malloc(sizeof(AudioContext_t)); ac->sampleRate = sampleRate; ac->bitsPerSample = bitsPerSample; ac->mixChannel = mixChannel; ac->channels = channels; - mixChannelsActive_g[mixChannel] = true; + mixChannelsActive_g[mixChannel] = ac; return ac; } return NULL; } // Frees buffer in audio context -void CloseAudioContext(AudioContext *ctx) +void CloseAudioContext(AudioContext ctx) { - if(ctx){ - mixChannelsActive_g[ctx->mixChannel] = false; - free(ctx); + AudioContext_t *context = (AudioContext_t*)ctx; + if(context){ + mixChannelsActive_g[context->mixChannel] = NULL; + free(context); } } +// Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in +void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength) +{ + ; +} + //---------------------------------------------------------------------------------- diff --git a/src/audio.h b/src/audio.h index 401edc3e..cadf2bc1 100644 --- a/src/audio.h +++ b/src/audio.h @@ -66,12 +66,7 @@ typedef struct Wave { // Audio Context, used to create custom audio streams that are not bound to a sound file. There can be // no more than 4 concurrent audio contexts in use. This is due to each active context being tied to // a dedicated mix channel. -typedef struct AudioContext { - unsigned short sampleRate; // default is 48000 - unsigned char bitsPerSample; // 16 is default - mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - channel_t channels; // 1=mono, 2=stereo -} AudioContext; +typedef void* AudioContext; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -92,8 +87,9 @@ bool AudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. // exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); -void CloseAudioContext(AudioContext *ctx); // Frees audio context +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +void CloseAudioContext(AudioContext ctx); // Frees audio context +void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data diff --git a/src/raylib.h b/src/raylib.h index 1721c009..5b7b34fd 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -451,12 +451,7 @@ typedef struct Wave { // Audio Context, used to create custom audio streams that are not bound to a sound file. There can be // no more than 4 concurrent audio contexts in use. This is due to each active context being tied to // a dedicated mix channel. -typedef struct AudioContext { - unsigned short sampleRate; // default is 48000 - unsigned char bitsPerSample; // 16 is default - mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - channel_t channels; // 1=mono, 2=stereo -} AudioContext; +typedef void* AudioContext; // Texture formats // NOTE: Support depends on OpenGL version and platform @@ -880,8 +875,9 @@ bool AudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. // exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext* InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); -void CloseAudioContext(AudioContext *ctx); // Frees audio context +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +void CloseAudioContext(AudioContext ctx); // Frees audio context +void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From a1038f61b60ad21c936af783facc91fe01607be3 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sat, 30 Apr 2016 15:41:46 -0700 Subject: BPS type added to ensure consistency --- src/audio.c | 42 ++++++++++++++++++++++++++++++++++++++---- src/audio.h | 7 ++++--- src/raylib.h | 7 ++++--- 3 files changed, 46 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2c0ed3de..9d1aa014 100644 --- a/src/audio.c +++ b/src/audio.c @@ -95,9 +95,12 @@ typedef struct Music { // a dedicated mix channel. typedef struct AudioContext_t { unsigned short sampleRate; // default is 48000 - unsigned char bitsPerSample; // 16 is default + BPS bitsPerSample; // 16 is default mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream channel_t channels; // 1=mono, 2=stereo + ALenum alFormat; // openAL format specifier + ALuint alSource; // openAL source + ALuint alBuffer[2]; // openAL sample buffer } AudioContext_t; #if defined(AUDIO_STANDALONE) @@ -193,8 +196,8 @@ bool AudioDeviceReady(void) // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels) +// exmple usage is InitAudioContext(48000, sixteenBPS, mixA, stereo); +AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels) { if(!AudioDeviceReady()) InitAudioDevice(); else StopMusicStream(); @@ -206,6 +209,30 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSa ac->mixChannel = mixChannel; ac->channels = channels; mixChannelsActive_g[mixChannel] = ac; + + // setup openAL format + if (channels == mono) + { + if (bitsPerSample == eightBPS ) ac->alFormat = AL_FORMAT_MONO8; + else if (bitsPerSample == sixteenBPS) ac->alFormat = AL_FORMAT_MONO16; + } + else if (channels == stereo) + { + if (bitsPerSample == eightBPS ) ac->alFormat = AL_FORMAT_STEREO8; + else if (bitsPerSample == sixteenBPS) ac->alFormat = AL_FORMAT_STEREO16; + } + + // Create an audio source + alGenSources(1, &ac->alSource); + alSourcef(ac->alSource, AL_PITCH, 1); + alSourcef(ac->alSource, AL_GAIN, 1); + alSource3f(ac->alSource, AL_POSITION, 0, 0, 0); + alSource3f(ac->alSource, AL_VELOCITY, 0, 0, 0); + + // Create Buffer + alGenBuffers(2, &ac->alBuffer); + + return ac; } return NULL; @@ -216,15 +243,22 @@ void CloseAudioContext(AudioContext ctx) { AudioContext_t *context = (AudioContext_t*)ctx; if(context){ + alDeleteSources(1, &context->alSource); + alDeleteBuffers(2, &context->alBuffer); mixChannelsActive_g[context->mixChannel] = NULL; free(context); + ctx = NULL; } } // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength) { - ; + AudioContext_t *context = (AudioContext_t*)ctx; + if(!musicEnabled && context && mixChannelsActive_g[context->mixChannel] == context) + { + ; + } } diff --git a/src/audio.h b/src/audio.h index cadf2bc1..28fe4b3c 100644 --- a/src/audio.h +++ b/src/audio.h @@ -45,8 +45,9 @@ typedef enum { false, true } bool; #endif #endif -typedef enum { silence, mono, stereo } channel_t; -typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio streams +typedef enum { silence, mono, stereo } channel_t; // number of audio sources per sample +typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio samples +typedef enum { eightBPS, sixteenBPS } BPS; // Either 8 or 16 bit quality samples // Sound source type typedef struct Sound { @@ -87,7 +88,7 @@ bool AudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. // exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels); void CloseAudioContext(AudioContext ctx); // Frees audio context void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in diff --git a/src/raylib.h b/src/raylib.h index 5b7b34fd..83f58a51 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -265,8 +265,9 @@ typedef enum { false, true } bool; #endif #endif -typedef enum { silence, mono, stereo } channel_t; -typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio streams +typedef enum { silence, mono, stereo } channel_t; // number of audio sources per sample +typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio samples +typedef enum { eightBPS, sixteenBPS } BPS; // Either 8 or 16 bit quality samples // byte type typedef unsigned char byte; @@ -875,7 +876,7 @@ bool AudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. // exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, mix_t mixChannel, channel_t channels); +AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels); void CloseAudioContext(AudioContext ctx); // Frees audio context void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in -- cgit v1.2.3 From 34e5fcf47e99deecc9954fd848130c61119e2e93 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sat, 30 Apr 2016 16:05:43 -0700 Subject: removed enums --- src/audio.c | 36 +++++++++++++++++++----------------- src/audio.h | 13 +++++-------- src/raylib.h | 13 +++++-------- 3 files changed, 29 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 9d1aa014..8a8ca4ef 100644 --- a/src/audio.c +++ b/src/audio.c @@ -59,6 +59,7 @@ // Defines and Macros //---------------------------------------------------------------------------------- #define MUSIC_STREAM_BUFFERS 2 +#define MAX_AUDIO_CONTEXTS 4 #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) // NOTE: On RPI and Android should be lower to avoid frame-stalls @@ -95,9 +96,9 @@ typedef struct Music { // a dedicated mix channel. typedef struct AudioContext_t { unsigned short sampleRate; // default is 48000 - BPS bitsPerSample; // 16 is default - mix_t mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - channel_t channels; // 1=mono, 2=stereo + unsigned char bitsPerSample; // 16 is default + unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream + unsigned char channels; // 1=mono, 2=stereo ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source ALuint alBuffer[2]; // openAL sample buffer @@ -110,10 +111,10 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static AudioContext_t* mixChannelsActive_g[4]; // What mix channels are currently active +static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active static bool musicEnabled = false; -static Music currentMusic; // Current music loaded - // NOTE: Only one music file playing at a time +static Music currentMusic; // Current music loaded + // NOTE: Only one music file playing at a time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -179,7 +180,7 @@ void CloseAudioDevice(void) } // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet -bool AudioDeviceReady(void) +bool IsAudioDeviceReady(void) { ALCcontext *context = alcGetCurrentContext(); if (context == NULL) return false; @@ -195,11 +196,12 @@ bool AudioDeviceReady(void) //---------------------------------------------------------------------------------- // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing -// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, sixteenBPS, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels) +// The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels) { - if(!AudioDeviceReady()) InitAudioDevice(); + if(mixChannel > MAX_AUDIO_CONTEXTS) return NULL; + if(!IsAudioDeviceReady()) InitAudioDevice(); else StopMusicStream(); if(!mixChannelsActive_g[mixChannel]){ @@ -211,15 +213,15 @@ AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_ mixChannelsActive_g[mixChannel] = ac; // setup openAL format - if (channels == mono) + if (channels == 1) { - if (bitsPerSample == eightBPS ) ac->alFormat = AL_FORMAT_MONO8; - else if (bitsPerSample == sixteenBPS) ac->alFormat = AL_FORMAT_MONO16; + if (bitsPerSample == 8 ) ac->alFormat = AL_FORMAT_MONO8; + else if (bitsPerSample == 16) ac->alFormat = AL_FORMAT_MONO16; } - else if (channels == stereo) + else if (channels == 2) { - if (bitsPerSample == eightBPS ) ac->alFormat = AL_FORMAT_STEREO8; - else if (bitsPerSample == sixteenBPS) ac->alFormat = AL_FORMAT_STEREO16; + if (bitsPerSample == 8 ) ac->alFormat = AL_FORMAT_STEREO8; + else if (bitsPerSample == 16) ac->alFormat = AL_FORMAT_STEREO16; } // Create an audio source diff --git a/src/audio.h b/src/audio.h index 28fe4b3c..9c681044 100644 --- a/src/audio.h +++ b/src/audio.h @@ -45,9 +45,6 @@ typedef enum { false, true } bool; #endif #endif -typedef enum { silence, mono, stereo } channel_t; // number of audio sources per sample -typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio samples -typedef enum { eightBPS, sixteenBPS } BPS; // Either 8 or 16 bit quality samples // Sound source type typedef struct Sound { @@ -83,13 +80,13 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool AudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet +bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing -// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels); -void CloseAudioContext(AudioContext ctx); // Frees audio context +// The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels); +void CloseAudioContext(AudioContext ctx); // Frees audio context void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in Sound LoadSound(char *fileName); // Load sound to memory diff --git a/src/raylib.h b/src/raylib.h index 83f58a51..8390d176 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -265,9 +265,6 @@ typedef enum { false, true } bool; #endif #endif -typedef enum { silence, mono, stereo } channel_t; // number of audio sources per sample -typedef enum { mixA, mixB, mixC, mixD } mix_t; // Used for mixing/muxing up to four diferent audio samples -typedef enum { eightBPS, sixteenBPS } BPS; // Either 8 or 16 bit quality samples // byte type typedef unsigned char byte; @@ -871,13 +868,13 @@ void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); //------------------------------------------------------------------------------------ void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool AudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet +bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing -// The mix_t is what mix channel you want to operate on, mixA->mixD are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, mixA, stereo); -AudioContext InitAudioContext(unsigned short sampleRate, BPS bitsPerSample, mix_t mixChannel, channel_t channels); -void CloseAudioContext(AudioContext ctx); // Frees audio context +// The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. +// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels); +void CloseAudioContext(AudioContext ctx); // Frees audio context void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in Sound LoadSound(char *fileName); // Load sound to memory -- cgit v1.2.3 From 1fb874cdc5be59c510b46fd8b1a10b458ad3fb45 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 1 May 2016 01:09:48 +0200 Subject: Check for WebGL/Webkit extensions Improve DXT-ETC1 support on HTML5 --- src/rlgl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 06efd777..5b181a86 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -969,10 +969,12 @@ void rlglInit(void) // DDS texture compression support if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_s3tc") == 0) || (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) texCompDXTSupported = true; // ETC1 texture compression support - if (strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) texCompETC1Supported = true; + if ((strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) || + (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_etc1") == 0)) texCompETC1Supported = true; // ETC2/EAC texture compression support if (strcmp(extList[i], (const char *)"GL_ARB_ES3_compatibility") == 0) texCompETC2Supported = true; -- cgit v1.2.3 From 0e6d1cb272435c670a991169f413c98516dce15d Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 2 May 2016 00:16:32 +0200 Subject: Working on materials system... --- src/raylib.h | 21 +++++++++------------ src/rlgl.c | 14 +++++--------- 2 files changed, 14 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 8390d176..8af13cb4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -355,7 +355,7 @@ typedef struct Camera { // Camera2D type, defines a 2d camera typedef struct Camera2D { Vector2 offset; // Camera offset (displacement from target) - Vector2 target; // Camera target (for rotation and zoom) + Vector2 target; // Camera target (rotation and zoom origin) float rotation; // Camera rotation in degrees float zoom; // Camera zoom (scaling), should be 1.0f by default } Camera2D; @@ -386,16 +386,17 @@ typedef struct Mesh { typedef struct Shader { unsigned int id; // Shader program id - // Variable attributes + // Variable attributes locations int vertexLoc; // Vertex attribute location point (vertex shader) int texcoordLoc; // Texcoord attribute location point (vertex shader) int normalLoc; // Normal attribute location point (vertex shader) int colorLoc; // Color attibute location point (vertex shader) - // Uniforms + // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Color uniform location point (fragment shader) + // Texture map locations int mapDiffuseLoc; // Diffuse map texture uniform location point (fragment shader) int mapNormalLoc; // Normal map texture uniform location point (fragment shader) int mapSpecularLoc; // Specular map texture uniform location point (fragment shader) @@ -832,18 +833,14 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shaders strings and return program id void UnloadShader(Shader shader); // Unload a custom shader from memory -void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw void SetDefaultShader(void); // Set default shader to be used in batch draw +void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw void SetModelShader(Model *model, Shader shader); // Link a shader to a model -int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) -void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) -void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -//void SetShaderMapDiffuse(Shader *shader, Texture2D texture); // Default diffuse shader map texture assignment -//void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture); // Normal map texture shader assignment -//void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture); // Specular map texture shader assignment -//void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textureUnit); // TODO: Generic shader map assignment +int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) +void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) +void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) diff --git a/src/rlgl.c b/src/rlgl.c index 5b181a86..b1b020ec 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1350,14 +1350,14 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro glBindTexture(GL_TEXTURE_2D, model.material.texDiffuse.id); glUniform1i(model.material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 - if (model.material.texNormal.id != 0) + if ((model.material.texNormal.id != 0) && (model.material.shader.mapNormalLoc != -1)) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, model.material.texNormal.id); glUniform1i(model.material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 } - if (model.material.texSpecular.id != 0) + if ((model.material.texSpecular.id != 0) && (model.material.shader.mapSpecularLoc != -1)) { glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, model.material.texSpecular.id); @@ -2125,17 +2125,13 @@ Shader LoadShader(char *vsFileName, char *fsFileName) // After shader loading, we try to load default location names if (shader.id != 0) LoadDefaultShaderLocations(&shader); - else - { - TraceLog(WARNING, "Custom shader could not be loaded"); - shader = defaultShader; - } // Shader strings must be freed free(vShaderStr); free(fShaderStr); } - else + + if (shader.id == 0) { TraceLog(WARNING, "Custom shader could not be loaded"); shader = defaultShader; @@ -2494,7 +2490,7 @@ static Shader LoadDefaultShader(void) if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Default shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Default shader could not be loaded", shader.id); - LoadDefaultShaderLocations(&shader); + if (shader.id != 0) LoadDefaultShaderLocations(&shader); return shader; } -- cgit v1.2.3 From fa98289ddb5fc190a100249c667d5e9814f4d864 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 2 May 2016 00:37:33 +0200 Subject: Added 2D camera mode functions Removed BeginDrawingEx() Added Begin2dMode() and End2dMode() --- src/core.c | 44 +++++++++++++++++++++++++++----------------- src/raylib.h | 3 ++- 2 files changed, 29 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 7b1d5960..dd904692 100644 --- a/src/core.c +++ b/src/core.c @@ -524,23 +524,6 @@ void BeginDrawing(void) // NOTE: Not required with OpenGL 3.3+ } -// Setup drawing canvas with 2d camera -void BeginDrawingEx(Camera2D camera) -{ - BeginDrawing(); - - // Camera rotation and scaling is always relative to target - Matrix matOrigin = MatrixTranslate(-camera.target.x, -camera.target.y, 0.0f); - Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); - Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); - - Matrix matTranslation = MatrixTranslate(camera.offset.x + camera.target.x, camera.offset.y + camera.target.y, 0.0f); - - Matrix matTransform = MatrixMultiply(MatrixMultiply(matOrigin, MatrixMultiply(matScale, matRotation)), matTranslation); - - rlMultMatrixf(MatrixToFloat(matTransform)); -} - // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void) { @@ -569,6 +552,33 @@ void EndDrawing(void) } } +// Initialize 2D mode with custom camera +void Begin2dMode(Camera2D camera) +{ + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + rlLoadIdentity(); // Reset current matrix (MODELVIEW) + + // Camera rotation and scaling is always relative to target + Matrix matOrigin = MatrixTranslate(-camera.target.x, -camera.target.y, 0.0f); + Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); + Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); + + Matrix matTranslation = MatrixTranslate(camera.offset.x + camera.target.x, camera.offset.y + camera.target.y, 0.0f); + + Matrix matTransform = MatrixMultiply(MatrixMultiply(matOrigin, MatrixMultiply(matScale, matRotation)), matTranslation); + + rlMultMatrixf(MatrixToFloat(matTransform)); +} + +// Ends 2D mode custom camera usage +void End2dMode(void) +{ + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + rlLoadIdentity(); // Reset current matrix (MODELVIEW) +} + // Initializes 3D mode for drawing (Camera setup) void Begin3dMode(Camera camera) { diff --git a/src/raylib.h b/src/raylib.h index 8af13cb4..337b9813 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -576,9 +576,10 @@ void DisableCursor(void); // Disables cursor void ClearBackground(Color color); // Sets Background Color void BeginDrawing(void); // Setup drawing canvas to start drawing -void BeginDrawingEx(Camera2D camera); // Setup drawing canvas with 2d camera void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) +void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera +void End2dMode(void); // Ends 2D mode custom camera usage void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing -- cgit v1.2.3 From 17732fa9c493bffb8e05cb5db45d998d2b151cb9 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 2 May 2016 00:38:01 +0200 Subject: Corrected warning with array --- src/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 8a8ca4ef..39d1ee8b 100644 --- a/src/audio.c +++ b/src/audio.c @@ -232,7 +232,7 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSa alSource3f(ac->alSource, AL_VELOCITY, 0, 0, 0); // Create Buffer - alGenBuffers(2, &ac->alBuffer); + alGenBuffers(2, ac->alBuffer); return ac; @@ -246,7 +246,7 @@ void CloseAudioContext(AudioContext ctx) AudioContext_t *context = (AudioContext_t*)ctx; if(context){ alDeleteSources(1, &context->alSource); - alDeleteBuffers(2, &context->alBuffer); + alDeleteBuffers(2, context->alBuffer); mixChannelsActive_g[context->mixChannel] = NULL; free(context); ctx = NULL; -- cgit v1.2.3 From a2a3d3aeb60dd117b02fc8c7c85ec428175a5f83 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 1 May 2016 18:53:40 -0700 Subject: new silence generator --- src/audio.c | 74 ++++++++++++++++++++++++++++++++++++++++++------------------ src/audio.h | 7 +++--- src/raylib.h | 7 +++--- 3 files changed, 60 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 8a8ca4ef..7100a6c1 100644 --- a/src/audio.c +++ b/src/audio.c @@ -37,6 +37,7 @@ #include "AL/al.h" // OpenAL basic header #include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) +#include "AL/alext.h" // extensions for other format types #include // Declares malloc() and free() for memory management #include // Required for strcmp() @@ -93,12 +94,10 @@ typedef struct Music { // Audio Context, used to create custom audio streams that are not bound to a sound file. There can be // no more than 4 concurrent audio contexts in use. This is due to each active context being tied to -// a dedicated mix channel. +// a dedicated mix channel. All audio is 32bit floating point in stereo. typedef struct AudioContext_t { unsigned short sampleRate; // default is 48000 - unsigned char bitsPerSample; // 16 is default unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - unsigned char channels; // 1=mono, 2=stereo ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source ALuint alBuffer[2]; // openAL sample buffer @@ -126,6 +125,9 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(ALuint buffer); // Fill music buffers with data static void EmptyMusicStream(void); // Empty music buffers +// fill buffer with zeros +static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer); + #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message (INFO, ERROR, WARNING) @@ -197,8 +199,9 @@ bool IsAudioDeviceReady(void) // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels) +// exmple usage is InitAudioContext(48000, 0); // mixchannel 1, 48khz +// all samples are floating point stereo by default +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel) { if(mixChannel > MAX_AUDIO_CONTEXTS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); @@ -207,22 +210,11 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSa if(!mixChannelsActive_g[mixChannel]){ AudioContext_t *ac = malloc(sizeof(AudioContext_t)); ac->sampleRate = sampleRate; - ac->bitsPerSample = bitsPerSample; ac->mixChannel = mixChannel; - ac->channels = channels; mixChannelsActive_g[mixChannel] = ac; // setup openAL format - if (channels == 1) - { - if (bitsPerSample == 8 ) ac->alFormat = AL_FORMAT_MONO8; - else if (bitsPerSample == 16) ac->alFormat = AL_FORMAT_MONO16; - } - else if (channels == 2) - { - if (bitsPerSample == 8 ) ac->alFormat = AL_FORMAT_STEREO8; - else if (bitsPerSample == 16) ac->alFormat = AL_FORMAT_STEREO16; - } + ac->alFormat = AL_FORMAT_STEREO_FLOAT32; // Create an audio source alGenSources(1, &ac->alSource); @@ -232,7 +224,14 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSa alSource3f(ac->alSource, AL_VELOCITY, 0, 0, 0); // Create Buffer - alGenBuffers(2, &ac->alBuffer); + alGenBuffers(2, ac->alBuffer); + + //fill buffers + FillAlBufferWithSilence(ac, ac->alBuffer[0]); + FillAlBufferWithSilence(ac, ac->alBuffer[1]); + alSourceQueueBuffers(ac->alSource, 2, ac->alBuffer); + alSourcei(ac->alSource, AL_LOOPING, AL_FALSE); // this could cause errors + alSourcePlay(ac->alSource); return ac; @@ -245,8 +244,20 @@ void CloseAudioContext(AudioContext ctx) { AudioContext_t *context = (AudioContext_t*)ctx; if(context){ + alSourceStop(context->alSource); + + //flush out all queued buffers + ALuint buffer = 0; + int queued = 0; + alGetSourcei(context->alSource, AL_BUFFERS_QUEUED, &queued); + while (queued > 0) + { + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + queued--; + } + alDeleteSources(1, &context->alSource); - alDeleteBuffers(2, &context->alBuffer); + alDeleteBuffers(2, context->alBuffer); mixChannelsActive_g[context->mixChannel] = NULL; free(context); ctx = NULL; @@ -254,15 +265,34 @@ void CloseAudioContext(AudioContext ctx) } // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in -void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength) +// Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio +void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) { AudioContext_t *context = (AudioContext_t*)ctx; - if(!musicEnabled && context && mixChannelsActive_g[context->mixChannel] == context) + if (context && mixChannelsActive_g[context->mixChannel] == context) { - ; + ALint processed = 0; + ALuint buffer = 0; + alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) + + if (!data || !dataLength)// play silence + while (processed > 0) + { + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + FillAlBufferWithSilence(context, buffer); + alSourceQueueBuffers(context->alSource, 1, &buffer); + processed--; + } } } +// fill buffer with zeros +static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer) +{ + float pcm[MUSIC_BUFFER_SIZE] = {0.f}; + alBufferData(buffer, ac->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), ac->sampleRate); +} + //---------------------------------------------------------------------------------- diff --git a/src/audio.h b/src/audio.h index 9c681044..9037a843 100644 --- a/src/audio.h +++ b/src/audio.h @@ -84,10 +84,11 @@ bool IsAudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels); +// exmple usage is InitAudioContext(48000, 0); // mixchannel 1, 48khz +// all samples are floating point stereo by default +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel); void CloseAudioContext(AudioContext ctx); // Frees audio context -void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in +void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data diff --git a/src/raylib.h b/src/raylib.h index 8390d176..f4ea875e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -872,10 +872,11 @@ bool IsAudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 16, 0, 2); // stereo, mixchannel 1, 16bit, 48khz -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char bitsPerSample, unsigned char mixChannel, unsigned char channels); +// exmple usage is InitAudioContext(48000, 0); // mixchannel 1, 48khz +// all samples are floating point stereo by default +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel); void CloseAudioContext(AudioContext ctx); // Frees audio context -void UpdateAudioContext(AudioContext ctx, void *data, unsigned short *dataLength); // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in +void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From 790bc7280685d714ddce3e1ee0afa11cee0c5e06 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 1 May 2016 23:07:02 -0700 Subject: bool return for failed update --- src/audio.c | 9 +++++++-- src/audio.h | 2 +- src/raylib.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 7100a6c1..7b42b089 100644 --- a/src/audio.c +++ b/src/audio.c @@ -256,6 +256,7 @@ void CloseAudioContext(AudioContext ctx) queued--; } + //delete source and buffers alDeleteSources(1, &context->alSource); alDeleteBuffers(2, context->alBuffer); mixChannelsActive_g[context->mixChannel] = NULL; @@ -266,7 +267,8 @@ void CloseAudioContext(AudioContext ctx) // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in // Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio -void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) +// Returns true if data was pushed onto queue, otherwise if queue is full then no data is added and false is returned +bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) { AudioContext_t *context = (AudioContext_t*)ctx; if (context && mixChannelsActive_g[context->mixChannel] == context) @@ -274,7 +276,9 @@ void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength ALint processed = 0; ALuint buffer = 0; alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) - + + if(!processed) return false;//nothing to process, queue is still full + if (!data || !dataLength)// play silence while (processed > 0) { @@ -283,6 +287,7 @@ void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength alSourceQueueBuffers(context->alSource, 1, &buffer); processed--; } + return true; } } diff --git a/src/audio.h b/src/audio.h index 9037a843..4a198c59 100644 --- a/src/audio.h +++ b/src/audio.h @@ -88,7 +88,7 @@ bool IsAudioDeviceReady(void); // True if call // all samples are floating point stereo by default AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel); void CloseAudioContext(AudioContext ctx); // Frees audio context -void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data diff --git a/src/raylib.h b/src/raylib.h index ade581d3..9c5a8258 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -874,7 +874,7 @@ bool IsAudioDeviceReady(void); // True if call // all samples are floating point stereo by default AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel); void CloseAudioContext(AudioContext ctx); // Frees audio context -void UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From 9ef0240e99e7e6a626fdb8fee4f8a81eea21f3e2 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 2 May 2016 01:24:24 -0700 Subject: resamples added Ease of use considered in api and channels are more convenient as unsigned char type. --- src/audio.c | 49 +++++++++++++++++++++++++++++++++++++++++++------ src/audio.h | 6 +++--- src/raylib.h | 6 +++--- 3 files changed, 49 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 7b42b089..d935b6c7 100644 --- a/src/audio.c +++ b/src/audio.c @@ -97,6 +97,7 @@ typedef struct Music { // a dedicated mix channel. All audio is 32bit floating point in stereo. typedef struct AudioContext_t { unsigned short sampleRate; // default is 48000 + unsigned char channels; // 1=mono,2=stereo unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source @@ -125,8 +126,9 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(ALuint buffer); // Fill music buffers with data static void EmptyMusicStream(void); // Empty music buffers -// fill buffer with zeros -static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer); +static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer);// fill buffer with zeros +static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in +static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // pass two arrays of same length in #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -199,9 +201,9 @@ bool IsAudioDeviceReady(void) // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0); // mixchannel 1, 48khz -// all samples are floating point stereo by default -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel) +// exmple usage is InitAudioContext(48000, 0, 2); // mixchannel 1, 48khz, stereo +// all samples are floating point by default +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels) { if(mixChannel > MAX_AUDIO_CONTEXTS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); @@ -210,11 +212,15 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChanne if(!mixChannelsActive_g[mixChannel]){ AudioContext_t *ac = malloc(sizeof(AudioContext_t)); ac->sampleRate = sampleRate; + ac->channels = channels; ac->mixChannel = mixChannel; mixChannelsActive_g[mixChannel] = ac; // setup openAL format - ac->alFormat = AL_FORMAT_STEREO_FLOAT32; + if(channels == 1) + ac->alFormat = AL_FORMAT_MONO_FLOAT32; + else + ac->alFormat = AL_FORMAT_STEREO_FLOAT32; // Create an audio source alGenSources(1, &ac->alSource); @@ -289,6 +295,7 @@ bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength } return true; } + return false; } // fill buffer with zeros @@ -298,6 +305,36 @@ static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer) alBufferData(buffer, ac->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), ac->sampleRate); } +// example usage: +// short sh[3] = {1,2,3};float fl[3]; +// ResampleShortToFloat(sh,fl,3); +static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len) +{ + int x; + for(x=0;x Date: Mon, 2 May 2016 14:11:42 +0200 Subject: Removed debug functions --- src/rlgl.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index b1b020ec..e021e726 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2377,18 +2377,6 @@ void SetBlendMode(int mode) } } -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -void PrintProjectionMatrix(void) -{ - PrintMatrix(projection); -} - -void PrintModelviewMatrix(void) -{ - PrintMatrix(modelview); -} -#endif - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- -- cgit v1.2.3 From f2152aa3915be867907c569667828d10d2f1bdd6 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 2 May 2016 14:11:57 +0200 Subject: Reorganize functions --- src/core.c | 853 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 426 insertions(+), 427 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index dd904692..b27712a7 100644 --- a/src/core.c +++ b/src/core.c @@ -244,23 +244,16 @@ extern void UnloadDefaultFont(void); // [Module: text] Unloads defaul //---------------------------------------------------------------------------------- static void InitDisplay(int width, int height); // Initialize display device and framebuffer static void InitGraphics(void); // Initialize OpenGL graphics +static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer static double GetTime(void); // Returns time since InitTimer() was run static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed -static void SwapBuffers(void); // Copy back buffer to front buffers static void PollInputEvents(void); // Register user events +static void SwapBuffers(void); // Copy back buffer to front buffers static void LogoAnimation(void); // Plays raylib logo appearing animation -static void SetupFramebufferSize(int displayWidth, int displayHeight); - -#if defined(PLATFORM_RPI) -static void InitKeyboard(void); // Init raw keyboard system (standard input reading) -static void ProcessKeyboard(void); // Process keyboard events -static void RestoreKeyboard(void); // Restore keyboard system -static void InitMouse(void); // Mouse initialization (including mouse thread) -static void *MouseThread(void *arg); // Mouse reading thread -static void InitGamepad(void); // Init raw gamepad input -static void *GamepadThread(void *arg); // Mouse reading thread +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +static void TakeScreenshot(void); // Takes a screenshot and saves it in the same folder as executable #endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -279,10 +272,6 @@ static void WindowIconifyCallback(GLFWwindow *window, int iconified); static void WindowDropCallback(GLFWwindow *window, int count, const char **paths); // GLFW3 Window Drop Callback, runs when drop files into window #endif -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -static void TakeScreenshot(void); // Takes a screenshot and saves it in the same folder as executable -#endif - #if defined(PLATFORM_ANDROID) static void AndroidCommandCallback(struct android_app *app, int32_t cmd); // Process Android activity lifecycle commands static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event); // Process Android inputs @@ -293,6 +282,16 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData); #endif +#if defined(PLATFORM_RPI) +static void InitKeyboard(void); // Init raw keyboard system (standard input reading) +static void ProcessKeyboard(void); // Process keyboard events +static void RestoreKeyboard(void); // Restore keyboard system +static void InitMouse(void); // Mouse initialization (including mouse thread) +static void *MouseThread(void *arg); // Mouse reading thread +static void InitGamepad(void); // Init raw gamepad input +static void *GamepadThread(void *arg); // Mouse reading thread +#endif + //---------------------------------------------------------------------------------- // Module Functions Definition - Window and OpenGL Context Functions //---------------------------------------------------------------------------------- @@ -1734,143 +1733,376 @@ static void InitGraphics(void) #endif } -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) -// GLFW3 Error Callback, runs on GLFW3 error -static void ErrorCallback(int error, const char *description) +// Compute framebuffer size relative to screen size and display size +// NOTE: Global variables renderWidth/renderHeight can be modified +static void SetupFramebufferSize(int displayWidth, int displayHeight) { - TraceLog(WARNING, "[GLFW3 Error] Code: %i Decription: %s", error, description); -} + // TODO: SetupFramebufferSize() does not consider properly display video modes. + // It setups a renderWidth/renderHeight with black bars that could not match a valid video mode, + // and so, framebuffer is not scaled properly to some monitors. + + // Calculate renderWidth and renderHeight, we have the display size (input params) and the desired screen size (global var) + if ((screenWidth > displayWidth) || (screenHeight > displayHeight)) + { + TraceLog(WARNING, "DOWNSCALING: Required screen size (%ix%i) is bigger than display size (%ix%i)", screenWidth, screenHeight, displayWidth, displayHeight); -// GLFW3 Srolling Callback, runs on mouse wheel -static void ScrollCallback(GLFWwindow *window, double xoffset, double yoffset) -{ - currentMouseWheelY = (int)yoffset; -} + // Downscaling to fit display with border-bars + float widthRatio = (float)displayWidth/(float)screenWidth; + float heightRatio = (float)displayHeight/(float)screenHeight; -// GLFW3 Keyboard Callback, runs on key pressed -static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) -{ - if (key == exitKey && action == GLFW_PRESS) - { - glfwSetWindowShouldClose(window, GL_TRUE); + if (widthRatio <= heightRatio) + { + renderWidth = displayWidth; + renderHeight = (int)round((float)screenHeight*widthRatio); + renderOffsetX = 0; + renderOffsetY = (displayHeight - renderHeight); + } + else + { + renderWidth = (int)round((float)screenWidth*heightRatio); + renderHeight = displayHeight; + renderOffsetX = (displayWidth - renderWidth); + renderOffsetY = 0; + } - // NOTE: Before closing window, while loop must be left! + // NOTE: downscale matrix required! + float scaleRatio = (float)renderWidth/(float)screenWidth; + + downscaleView = MatrixScale(scaleRatio, scaleRatio, scaleRatio); + + // NOTE: We render to full display resolution! + // We just need to calculate above parameters for downscale matrix and offsets + renderWidth = displayWidth; + renderHeight = displayHeight; + + TraceLog(WARNING, "Downscale matrix generated, content will be rendered at: %i x %i", renderWidth, renderHeight); } -#if defined(PLATFORM_DESKTOP) - else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) + else if ((screenWidth < displayWidth) || (screenHeight < displayHeight)) { - TakeScreenshot(); + // Required screen size is smaller than display size + TraceLog(INFO, "UPSCALING: Required screen size: %i x %i -> Display size: %i x %i", screenWidth, screenHeight, displayWidth, displayHeight); + + // Upscaling to fit display with border-bars + float displayRatio = (float)displayWidth/(float)displayHeight; + float screenRatio = (float)screenWidth/(float)screenHeight; + + if (displayRatio <= screenRatio) + { + renderWidth = screenWidth; + renderHeight = (int)round((float)screenWidth/displayRatio); + renderOffsetX = 0; + renderOffsetY = (renderHeight - screenHeight); + } + else + { + renderWidth = (int)round((float)screenHeight*displayRatio); + renderHeight = screenHeight; + renderOffsetX = (renderWidth - screenWidth); + renderOffsetY = 0; + } } -#endif - else + else // screen == display { - currentKeyState[key] = action; - if (action == GLFW_PRESS) lastKeyPressed = key; + renderWidth = screenWidth; + renderHeight = screenHeight; + renderOffsetX = 0; + renderOffsetY = 0; } } -// GLFW3 Mouse Button Callback, runs on mouse button pressed -static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) +// Initialize hi-resolution timer +static void InitTimer(void) { - currentMouseState[button] = action; - -#define ENABLE_MOUSE_GESTURES -#if defined(ENABLE_MOUSE_GESTURES) - // Process mouse events as touches to be able to use mouse-gestures - GestureEvent gestureEvent; - - // Register touch actions - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_DOWN; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_UP; - - // NOTE: TOUCH_MOVE event is registered in MouseCursorPosCallback() - - // Assign a pointer ID - gestureEvent.pointerId[0] = 0; - - // Register touch points count - gestureEvent.pointCount = 1; - - // Register touch points position, only one point registered - gestureEvent.position[0] = GetMousePosition(); - - // Normalize gestureEvent.position[0] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); - gestureEvent.position[0].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures system for processing - ProcessGestureEvent(gestureEvent); + srand(time(NULL)); // Initialize random seed + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec now; + + if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success + { + baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + } + else TraceLog(WARNING, "No hi-resolution timer available"); #endif + + previousTime = GetTime(); // Get time as double } -// GLFW3 Cursor Position Callback, runs on mouse move -static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) +// Get current time measure (in seconds) since InitTimer() +static double GetTime(void) { -#define ENABLE_MOUSE_GESTURES -#if defined(ENABLE_MOUSE_GESTURES) - // Process mouse events as touches to be able to use mouse-gestures - GestureEvent gestureEvent; - - gestureEvent.touchAction = TOUCH_MOVE; - - // Assign a pointer ID - gestureEvent.pointerId[0] = 0; - - // Register touch points count - gestureEvent.pointCount = 1; - - // Register touch points position, only one point registered - gestureEvent.position[0] = (Vector2){ (float)x, (float)y }; - - touchPosition[0] = gestureEvent.position[0]; - - // Normalize gestureEvent.position[0] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); - gestureEvent.position[0].y /= (float)GetScreenHeight(); +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + return glfwGetTime(); +#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; - // Gesture data is sent to gestures system for processing - ProcessGestureEvent(gestureEvent); + return (double)(time - baseTime)*1e-9; #endif } -// GLFW3 Char Key Callback, runs on key pressed (get char value) -static void CharCallback(GLFWwindow *window, unsigned int key) +// Get one key state +static bool GetKeyStatus(int key) { - lastKeyPressed = key; - - //TraceLog(INFO, "Char Callback Key pressed: %i\n", key); +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + return glfwGetKey(window, key); +#elif defined(PLATFORM_ANDROID) + // TODO: Check for virtual keyboard + return false; +#elif defined(PLATFORM_RPI) + // NOTE: Keys states are filled in PollInputEvents() + if (key < 0 || key > 511) return false; + else return currentKeyState[key]; +#endif } -// GLFW3 CursorEnter Callback, when cursor enters the window -static void CursorEnterCallback(GLFWwindow *window, int enter) +// Get one mouse button state +static bool GetMouseButtonStatus(int button) { - if (enter == true) cursorOnScreen = true; - else cursorOnScreen = false; +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + return glfwGetMouseButton(window, button); +#elif defined(PLATFORM_ANDROID) + // TODO: Check for virtual mouse + return false; +#elif defined(PLATFORM_RPI) + // NOTE: Mouse buttons states are filled in PollInputEvents() + return currentMouseState[button]; +#endif } -// GLFW3 WindowSize Callback, runs when window is resized -// NOTE: Window resizing not allowed by default -static void WindowSizeCallback(GLFWwindow *window, int width, int height) +// Poll (store) all input events +static void PollInputEvents(void) { - // If window is resized, graphics device is re-initialized (but only ortho mode) - rlglInitGraphics(0, 0, width, height); - - // Window size must be updated to be used on 3D mode to get new aspect ratio (Begin3dMode()) - screenWidth = width; - screenHeight = height; - renderWidth = width; - renderHeight = height; + // NOTE: Gestures update must be called every frame to reset gestures correctly + // because ProcessGestureEvent() is just called on an event, not every frame + UpdateGestures(); - // NOTE: Postprocessing texture is not scaled to new size +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + // Mouse input polling + double mouseX; + double mouseY; - // Background must be also re-cleared - ClearBackground(RAYWHITE); -} + glfwGetCursorPos(window, &mouseX, &mouseY); -// GLFW3 WindowIconify Callback, runs when window is minimized/restored -static void WindowIconifyCallback(GLFWwindow* window, int iconified) -{ - if (iconified) windowMinimized = true; // The window was iconified + mousePosition.x = (float)mouseX; + mousePosition.y = (float)mouseY; + + // Keyboard input polling (automatically managed by GLFW3 through callback) + lastKeyPressed = -1; + + // Register previous keys states + for (int i = 0; i < 512; i++) previousKeyState[i] = currentKeyState[i]; + + // Register previous mouse states + for (int i = 0; i < 3; i++) previousMouseState[i] = currentMouseState[i]; + + previousMouseWheelY = currentMouseWheelY; + currentMouseWheelY = 0; + + glfwPollEvents(); // Register keyboard/mouse events... and window events! +#elif defined(PLATFORM_ANDROID) + + // Register previous keys states + for (int i = 0; i < 128; i++) previousButtonState[i] = currentButtonState[i]; + + // Poll Events (registered events) + // NOTE: Activity is paused if not enabled (appEnabled) + while ((ident = ALooper_pollAll(appEnabled ? 0 : -1, NULL, &events,(void**)&source)) >= 0) + { + // Process this event + if (source != NULL) source->process(app, source); + + // NOTE: Never close window, native activity is controlled by the system! + if (app->destroyRequested != 0) + { + //TraceLog(INFO, "Closing Window..."); + //windowShouldClose = true; + //ANativeActivity_finish(app->activity); + } + } +#elif defined(PLATFORM_RPI) + + // NOTE: Mouse input events polling is done asynchonously in another pthread - MouseThread() + + // NOTE: Keyboard reading could be done using input_event(s) reading or just read from stdin, + // we use method 2 (stdin) but maybe in a future we should change to method 1... + ProcessKeyboard(); + + // NOTE: Gamepad (Joystick) input events polling is done asynchonously in another pthread - GamepadThread() + +#endif +} + +// Copy back buffer to front buffers +static void SwapBuffers(void) +{ +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + glfwSwapBuffers(window); +#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + eglSwapBuffers(display, surface); +#endif +} + +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +// Takes a screenshot and saves it in the same folder as executable +static void TakeScreenshot(void) +{ + static int shotNum = 0; // Screenshot number, increments every screenshot take during program execution + char buffer[20]; // Buffer to store file name + + unsigned char *imgData = rlglReadScreenPixels(renderWidth, renderHeight); + + sprintf(buffer, "screenshot%03i.png", shotNum); + + // Save image as PNG + WritePNG(buffer, imgData, renderWidth, renderHeight, 4); + + free(imgData); + + shotNum++; + + TraceLog(INFO, "[%s] Screenshot taken!", buffer); +} +#endif + +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) +// GLFW3 Error Callback, runs on GLFW3 error +static void ErrorCallback(int error, const char *description) +{ + TraceLog(WARNING, "[GLFW3 Error] Code: %i Decription: %s", error, description); +} + +// GLFW3 Srolling Callback, runs on mouse wheel +static void ScrollCallback(GLFWwindow *window, double xoffset, double yoffset) +{ + currentMouseWheelY = (int)yoffset; +} + +// GLFW3 Keyboard Callback, runs on key pressed +static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) +{ + if (key == exitKey && action == GLFW_PRESS) + { + glfwSetWindowShouldClose(window, GL_TRUE); + + // NOTE: Before closing window, while loop must be left! + } +#if defined(PLATFORM_DESKTOP) + else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) + { + TakeScreenshot(); + } +#endif + else + { + currentKeyState[key] = action; + if (action == GLFW_PRESS) lastKeyPressed = key; + } +} + +// GLFW3 Mouse Button Callback, runs on mouse button pressed +static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) +{ + currentMouseState[button] = action; + +#define ENABLE_MOUSE_GESTURES +#if defined(ENABLE_MOUSE_GESTURES) + // Process mouse events as touches to be able to use mouse-gestures + GestureEvent gestureEvent; + + // Register touch actions + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_DOWN; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_UP; + + // NOTE: TOUCH_MOVE event is registered in MouseCursorPosCallback() + + // Assign a pointer ID + gestureEvent.pointerId[0] = 0; + + // Register touch points count + gestureEvent.pointCount = 1; + + // Register touch points position, only one point registered + gestureEvent.position[0] = GetMousePosition(); + + // Normalize gestureEvent.position[0] for screenWidth and screenHeight + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + + // Gesture data is sent to gestures system for processing + ProcessGestureEvent(gestureEvent); +#endif +} + +// GLFW3 Cursor Position Callback, runs on mouse move +static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) +{ +#define ENABLE_MOUSE_GESTURES +#if defined(ENABLE_MOUSE_GESTURES) + // Process mouse events as touches to be able to use mouse-gestures + GestureEvent gestureEvent; + + gestureEvent.touchAction = TOUCH_MOVE; + + // Assign a pointer ID + gestureEvent.pointerId[0] = 0; + + // Register touch points count + gestureEvent.pointCount = 1; + + // Register touch points position, only one point registered + gestureEvent.position[0] = (Vector2){ (float)x, (float)y }; + + touchPosition[0] = gestureEvent.position[0]; + + // Normalize gestureEvent.position[0] for screenWidth and screenHeight + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + + // Gesture data is sent to gestures system for processing + ProcessGestureEvent(gestureEvent); +#endif +} + +// GLFW3 Char Key Callback, runs on key pressed (get char value) +static void CharCallback(GLFWwindow *window, unsigned int key) +{ + lastKeyPressed = key; + + //TraceLog(INFO, "Char Callback Key pressed: %i\n", key); +} + +// GLFW3 CursorEnter Callback, when cursor enters the window +static void CursorEnterCallback(GLFWwindow *window, int enter) +{ + if (enter == true) cursorOnScreen = true; + else cursorOnScreen = false; +} + +// GLFW3 WindowSize Callback, runs when window is resized +// NOTE: Window resizing not allowed by default +static void WindowSizeCallback(GLFWwindow *window, int width, int height) +{ + // If window is resized, graphics device is re-initialized (but only ortho mode) + rlglInitGraphics(0, 0, width, height); + + // Window size must be updated to be used on 3D mode to get new aspect ratio (Begin3dMode()) + screenWidth = width; + screenHeight = height; + renderWidth = width; + renderHeight = height; + + // NOTE: Postprocessing texture is not scaled to new size + + // Background must be also re-cleared + ClearBackground(RAYWHITE); +} + +// GLFW3 WindowIconify Callback, runs when window is minimized/restored +static void WindowIconifyCallback(GLFWwindow* window, int iconified) +{ + if (iconified) windowMinimized = true; // The window was iconified else windowMinimized = false; // The window was restored } #endif @@ -2107,151 +2339,95 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) } #endif -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -// Takes a screenshot and saves it in the same folder as executable -static void TakeScreenshot(void) +#if defined(PLATFORM_WEB) +static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) { - static int shotNum = 0; // Screenshot number, increments every screenshot take during program execution - char buffer[20]; // Buffer to store file name - - unsigned char *imgData = rlglReadScreenPixels(renderWidth, renderHeight); - - sprintf(buffer, "screenshot%03i.png", shotNum); + //isFullscreen: int e->isFullscreen + //fullscreenEnabled: int e->fullscreenEnabled + //fs element nodeName: (char *) e->nodeName + //fs element id: (char *) e->id + //Current element size: (int) e->elementWidth, (int) e->elementHeight + //Screen size:(int) e->screenWidth, (int) e->screenHeight - // Save image as PNG - WritePNG(buffer, imgData, renderWidth, renderHeight, 4); - - free(imgData); - - shotNum++; - - TraceLog(INFO, "[%s] Screenshot taken!", buffer); -} -#endif - -// Initialize hi-resolution timer -static void InitTimer(void) -{ - srand(time(NULL)); // Initialize random seed - -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec now; - - if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success + if (e->isFullscreen) { - baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + TraceLog(INFO, "Canvas scaled to fullscreen. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); + } + else + { + TraceLog(INFO, "Canvas scaled to windowed. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); } - else TraceLog(WARNING, "No hi-resolution timer available"); -#endif - - previousTime = GetTime(); // Get time as double -} - -// Get current time measure (in seconds) since InitTimer() -static double GetTime(void) -{ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - return glfwGetTime(); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; - - return (double)(time - baseTime)*1e-9; -#endif -} - -// Get one key state -static bool GetKeyStatus(int key) -{ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - return glfwGetKey(window, key); -#elif defined(PLATFORM_ANDROID) - // TODO: Check for virtual keyboard - return false; -#elif defined(PLATFORM_RPI) - // NOTE: Keys states are filled in PollInputEvents() - if (key < 0 || key > 511) return false; - else return currentKeyState[key]; -#endif -} - -// Get one mouse button state -static bool GetMouseButtonStatus(int button) -{ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - return glfwGetMouseButton(window, button); -#elif defined(PLATFORM_ANDROID) - // TODO: Check for virtual mouse - return false; -#elif defined(PLATFORM_RPI) - // NOTE: Mouse buttons states are filled in PollInputEvents() - return currentMouseState[button]; -#endif -} - -// Poll (store) all input events -static void PollInputEvents(void) -{ - // NOTE: Gestures update must be called every frame to reset gestures correctly - // because ProcessGestureEvent() is just called on an event, not every frame - UpdateGestures(); -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - // Mouse input polling - double mouseX; - double mouseY; - - glfwGetCursorPos(window, &mouseX, &mouseY); - - mousePosition.x = (float)mouseX; - mousePosition.y = (float)mouseY; - - // Keyboard input polling (automatically managed by GLFW3 through callback) - lastKeyPressed = -1; - - // Register previous keys states - for (int i = 0; i < 512; i++) previousKeyState[i] = currentKeyState[i]; + // TODO: Depending on scaling factor (screen vs element), calculate factor to scale mouse/touch input - // Register previous mouse states - for (int i = 0; i < 3; i++) previousMouseState[i] = currentMouseState[i]; + return 0; +} - previousMouseWheelY = currentMouseWheelY; - currentMouseWheelY = 0; +// Web: Get input events +static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) +{ + /* + for (int i = 0; i < touchEvent->numTouches; i++) + { + long x, y, id; - glfwPollEvents(); // Register keyboard/mouse events... and window events! -#elif defined(PLATFORM_ANDROID) + if (!touchEvent->touches[i].isChanged) continue; - // Register previous keys states - for (int i = 0; i < 128; i++) previousButtonState[i] = currentButtonState[i]; + id = touchEvent->touches[i].identifier; + x = touchEvent->touches[i].canvasX; + y = touchEvent->touches[i].canvasY; + } + + printf("%s, numTouches: %d %s%s%s%s\n", emscripten_event_type_to_string(eventType), event->numTouches, + event->ctrlKey ? " CTRL" : "", event->shiftKey ? " SHIFT" : "", event->altKey ? " ALT" : "", event->metaKey ? " META" : ""); - // Poll Events (registered events) - // NOTE: Activity is paused if not enabled (appEnabled) - while ((ident = ALooper_pollAll(appEnabled ? 0 : -1, NULL, &events,(void**)&source)) >= 0) + for(int i = 0; i < event->numTouches; ++i) { - // Process this event - if (source != NULL) source->process(app, source); - - // NOTE: Never close window, native activity is controlled by the system! - if (app->destroyRequested != 0) - { - //TraceLog(INFO, "Closing Window..."); - //windowShouldClose = true; - //ANativeActivity_finish(app->activity); - } + const EmscriptenTouchPoint *t = &event->touches[i]; + + printf(" %ld: screen: (%ld,%ld), client: (%ld,%ld), page: (%ld,%ld), isChanged: %d, onTarget: %d, canvas: (%ld, %ld)\n", + t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY); } -#elif defined(PLATFORM_RPI) + */ + + GestureEvent gestureEvent; - // NOTE: Mouse input events polling is done asynchonously in another pthread - MouseThread() + // Register touch actions + if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) gestureEvent.touchAction = TOUCH_DOWN; + else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) gestureEvent.touchAction = TOUCH_UP; + else if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) gestureEvent.touchAction = TOUCH_MOVE; + + // Register touch points count + gestureEvent.pointCount = touchEvent->numTouches; + + // Register touch points id + gestureEvent.pointerId[0] = touchEvent->touches[0].identifier; + gestureEvent.pointerId[1] = touchEvent->touches[1].identifier; + + // Register touch points position + // NOTE: Only two points registered + // TODO: Touch data should be scaled accordingly! + //gestureEvent.position[0] = (Vector2){ touchEvent->touches[0].canvasX, touchEvent->touches[0].canvasY }; + //gestureEvent.position[1] = (Vector2){ touchEvent->touches[1].canvasX, touchEvent->touches[1].canvasY }; + gestureEvent.position[0] = (Vector2){ touchEvent->touches[0].targetX, touchEvent->touches[0].targetY }; + gestureEvent.position[1] = (Vector2){ touchEvent->touches[1].targetX, touchEvent->touches[1].targetY }; - // NOTE: Keyboard reading could be done using input_event(s) reading or just read from stdin, - // we use method 2 (stdin) but maybe in a future we should change to method 1... - ProcessKeyboard(); + touchPosition[0] = gestureEvent.position[0]; + touchPosition[1] = gestureEvent.position[1]; + + // Normalize gestureEvent.position[x] for screenWidth and screenHeight + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + + gestureEvent.position[1].x /= (float)GetScreenWidth(); + gestureEvent.position[1].y /= (float)GetScreenHeight(); - // NOTE: Gamepad (Joystick) input events polling is done asynchonously in another pthread - GamepadThread() + // Gesture data is sent to gestures system for processing + ProcessGestureEvent(gestureEvent); // Process obtained gestures data -#endif + return 1; } +#endif #if defined(PLATFORM_RPI) // Initialize Keyboard system (using standard input) @@ -2571,183 +2747,6 @@ static void *GamepadThread(void *arg) } #endif -// Copy back buffer to front buffers -static void SwapBuffers(void) -{ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - glfwSwapBuffers(window); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - eglSwapBuffers(display, surface); -#endif -} - -// Compute framebuffer size relative to screen size and display size -// NOTE: Global variables renderWidth/renderHeight can be modified -static void SetupFramebufferSize(int displayWidth, int displayHeight) -{ - // TODO: SetupFramebufferSize() does not consider properly display video modes. - // It setups a renderWidth/renderHeight with black bars that could not match a valid video mode, - // and so, framebuffer is not scaled properly to some monitors. - - // Calculate renderWidth and renderHeight, we have the display size (input params) and the desired screen size (global var) - if ((screenWidth > displayWidth) || (screenHeight > displayHeight)) - { - TraceLog(WARNING, "DOWNSCALING: Required screen size (%ix%i) is bigger than display size (%ix%i)", screenWidth, screenHeight, displayWidth, displayHeight); - - // Downscaling to fit display with border-bars - float widthRatio = (float)displayWidth/(float)screenWidth; - float heightRatio = (float)displayHeight/(float)screenHeight; - - if (widthRatio <= heightRatio) - { - renderWidth = displayWidth; - renderHeight = (int)round((float)screenHeight*widthRatio); - renderOffsetX = 0; - renderOffsetY = (displayHeight - renderHeight); - } - else - { - renderWidth = (int)round((float)screenWidth*heightRatio); - renderHeight = displayHeight; - renderOffsetX = (displayWidth - renderWidth); - renderOffsetY = 0; - } - - // NOTE: downscale matrix required! - float scaleRatio = (float)renderWidth/(float)screenWidth; - - downscaleView = MatrixScale(scaleRatio, scaleRatio, scaleRatio); - - // NOTE: We render to full display resolution! - // We just need to calculate above parameters for downscale matrix and offsets - renderWidth = displayWidth; - renderHeight = displayHeight; - - TraceLog(WARNING, "Downscale matrix generated, content will be rendered at: %i x %i", renderWidth, renderHeight); - } - else if ((screenWidth < displayWidth) || (screenHeight < displayHeight)) - { - // Required screen size is smaller than display size - TraceLog(INFO, "UPSCALING: Required screen size: %i x %i -> Display size: %i x %i", screenWidth, screenHeight, displayWidth, displayHeight); - - // Upscaling to fit display with border-bars - float displayRatio = (float)displayWidth/(float)displayHeight; - float screenRatio = (float)screenWidth/(float)screenHeight; - - if (displayRatio <= screenRatio) - { - renderWidth = screenWidth; - renderHeight = (int)round((float)screenWidth/displayRatio); - renderOffsetX = 0; - renderOffsetY = (renderHeight - screenHeight); - } - else - { - renderWidth = (int)round((float)screenHeight*displayRatio); - renderHeight = screenHeight; - renderOffsetX = (renderWidth - screenWidth); - renderOffsetY = 0; - } - } - else // screen == display - { - renderWidth = screenWidth; - renderHeight = screenHeight; - renderOffsetX = 0; - renderOffsetY = 0; - } -} - -#if defined(PLATFORM_WEB) -static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) -{ - //isFullscreen: int e->isFullscreen - //fullscreenEnabled: int e->fullscreenEnabled - //fs element nodeName: (char *) e->nodeName - //fs element id: (char *) e->id - //Current element size: (int) e->elementWidth, (int) e->elementHeight - //Screen size:(int) e->screenWidth, (int) e->screenHeight - - if (e->isFullscreen) - { - TraceLog(INFO, "Canvas scaled to fullscreen. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); - } - else - { - TraceLog(INFO, "Canvas scaled to windowed. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); - } - - // TODO: Depending on scaling factor (screen vs element), calculate factor to scale mouse/touch input - - return 0; -} - -// Web: Get input events -static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) -{ - /* - for (int i = 0; i < touchEvent->numTouches; i++) - { - long x, y, id; - - if (!touchEvent->touches[i].isChanged) continue; - - id = touchEvent->touches[i].identifier; - x = touchEvent->touches[i].canvasX; - y = touchEvent->touches[i].canvasY; - } - - printf("%s, numTouches: %d %s%s%s%s\n", emscripten_event_type_to_string(eventType), event->numTouches, - event->ctrlKey ? " CTRL" : "", event->shiftKey ? " SHIFT" : "", event->altKey ? " ALT" : "", event->metaKey ? " META" : ""); - - for(int i = 0; i < event->numTouches; ++i) - { - const EmscriptenTouchPoint *t = &event->touches[i]; - - printf(" %ld: screen: (%ld,%ld), client: (%ld,%ld), page: (%ld,%ld), isChanged: %d, onTarget: %d, canvas: (%ld, %ld)\n", - t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY); - } - */ - - GestureEvent gestureEvent; - - // Register touch actions - if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) gestureEvent.touchAction = TOUCH_DOWN; - else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) gestureEvent.touchAction = TOUCH_UP; - else if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) gestureEvent.touchAction = TOUCH_MOVE; - - // Register touch points count - gestureEvent.pointCount = touchEvent->numTouches; - - // Register touch points id - gestureEvent.pointerId[0] = touchEvent->touches[0].identifier; - gestureEvent.pointerId[1] = touchEvent->touches[1].identifier; - - // Register touch points position - // NOTE: Only two points registered - // TODO: Touch data should be scaled accordingly! - //gestureEvent.position[0] = (Vector2){ touchEvent->touches[0].canvasX, touchEvent->touches[0].canvasY }; - //gestureEvent.position[1] = (Vector2){ touchEvent->touches[1].canvasX, touchEvent->touches[1].canvasY }; - gestureEvent.position[0] = (Vector2){ touchEvent->touches[0].targetX, touchEvent->touches[0].targetY }; - gestureEvent.position[1] = (Vector2){ touchEvent->touches[1].targetX, touchEvent->touches[1].targetY }; - - touchPosition[0] = gestureEvent.position[0]; - touchPosition[1] = gestureEvent.position[1]; - - // Normalize gestureEvent.position[x] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); - gestureEvent.position[0].y /= (float)GetScreenHeight(); - - gestureEvent.position[1].x /= (float)GetScreenWidth(); - gestureEvent.position[1].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures system for processing - ProcessGestureEvent(gestureEvent); // Process obtained gestures data - - return 1; -} -#endif - // Plays raylib logo appearing animation static void LogoAnimation(void) { -- cgit v1.2.3 From 4636e3367cdf3d2e1adab3a08667c34631f94837 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 2 May 2016 14:37:00 -0700 Subject: number remaining buffer transfer for updateAudioContext updateAudioContext is almost done --- src/audio.c | 39 +++++++++++++++++++++++++++++++-------- src/audio.h | 2 +- src/raylib.h | 2 +- 3 files changed, 33 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index d935b6c7..ff4f2858 100644 --- a/src/audio.c +++ b/src/audio.c @@ -273,17 +273,20 @@ void CloseAudioContext(AudioContext ctx) // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in // Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio -// Returns true if data was pushed onto queue, otherwise if queue is full then no data is added and false is returned -bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) +// Returns number of floats that where processed +unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) { + unsigned short numberProcessed = 0; + unsigned short numberRemaining = dataLength; AudioContext_t *context = (AudioContext_t*)ctx; + if (context && mixChannelsActive_g[context->mixChannel] == context) { ALint processed = 0; ALuint buffer = 0; alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) - if(!processed) return false;//nothing to process, queue is still full + if(!processed) return 0;//nothing to process, queue is still full if (!data || !dataLength)// play silence while (processed > 0) @@ -292,17 +295,37 @@ bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength FillAlBufferWithSilence(context, buffer); alSourceQueueBuffers(context->alSource, 1, &buffer); processed--; + numberProcessed+=MUSIC_BUFFER_SIZE; + } + if(numberRemaining)// buffer data stream in increments of MUSIC_BUFFER_SIZE + while (processed > 0) + { + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + if(numberRemaining >= MUSIC_BUFFER_SIZE) + { + float pcm[MUSIC_BUFFER_SIZE]; + memcpy(pcm, &data[numberProcessed], MUSIC_BUFFER_SIZE); + alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), context->sampleRate); + alSourceQueueBuffers(context->alSource, 1, &buffer); + numberProcessed+=MUSIC_BUFFER_SIZE; + numberRemaining-=MUSIC_BUFFER_SIZE; + } + else // less than MUSIC_BUFFER_SIZE number of samples left to buffer, the remaining data is padded with zeros + { + float pcm[MUSIC_BUFFER_SIZE] = {0.f}; // pad with zeros + } + + processed--; } - return true; } - return false; + return numberProcessed; } // fill buffer with zeros -static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer) +static void FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer) { float pcm[MUSIC_BUFFER_SIZE] = {0.f}; - alBufferData(buffer, ac->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), ac->sampleRate); + alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), context->sampleRate); } // example usage: @@ -322,7 +345,7 @@ static void ResampleShortToFloat(short *shorts, float *floats, unsigned short le // example usage: // char ch[3] = {1,2,3};float fl[3]; -// ResampleShortToFloat(ch,fl,3); +// ResampleByteToFloat(ch,fl,3); static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) { int x; diff --git a/src/audio.h b/src/audio.h index d723ef1b..2b36b3f0 100644 --- a/src/audio.h +++ b/src/audio.h @@ -88,7 +88,7 @@ bool IsAudioDeviceReady(void); // True if call // all samples are floating point by default AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels); void CloseAudioContext(AudioContext ctx); // Frees audio context -bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data diff --git a/src/raylib.h b/src/raylib.h index 3fa20116..5c727b61 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -874,7 +874,7 @@ bool IsAudioDeviceReady(void); // True if call // all samples are floating point by default AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels); void CloseAudioContext(AudioContext ctx); // Frees audio context -bool UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From 9d09ada33b26704a7f5d285d2f0d115e41df41bf Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 2 May 2016 21:59:55 -0700 Subject: new boolean floatingPoint option Now floating point is either on or off. This simplifies the use of 16bit vs float. --- src/audio.c | 132 +++++++++++++++++++++++++++++++++++++---------------------- src/audio.h | 7 ++-- src/raylib.h | 7 ++-- 3 files changed, 88 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index ff4f2858..dc063796 100644 --- a/src/audio.c +++ b/src/audio.c @@ -59,15 +59,17 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MUSIC_STREAM_BUFFERS 2 -#define MAX_AUDIO_CONTEXTS 4 +#define MAX_STREAM_BUFFERS 2 +#define MAX_AUDIO_CONTEXTS 4 // Number of open AL sources #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) // NOTE: On RPI and Android should be lower to avoid frame-stalls - #define MUSIC_BUFFER_SIZE 4096*2 // PCM data buffer (short) - 16Kb (RPI) + #define MUSIC_BUFFER_SIZE_SHORT 4096*2 // PCM data buffer (short) - 16Kb (RPI) + #define MUSIC_BUFFER_SIZE_FLOAT 4096 // PCM data buffer (float) - 16Kb (RPI) #else // NOTE: On HTML5 (emscripten) this is allocated on heap, by default it's only 16MB!...just take care... - #define MUSIC_BUFFER_SIZE 4096*8 // PCM data buffer (short) - 64Kb + #define MUSIC_BUFFER_SIZE_SHORT 4096*8 // PCM data buffer (short) - 64Kb + #define MUSIC_BUFFER_SIZE_FLOAT 4096*4 // PCM data buffer (float) - 64Kb #endif //---------------------------------------------------------------------------------- @@ -80,7 +82,7 @@ typedef struct Music { stb_vorbis *stream; jar_xm_context_t *chipctx; // Stores jar_xm context - ALuint buffers[MUSIC_STREAM_BUFFERS]; + ALuint buffers[MAX_STREAM_BUFFERS]; ALuint source; ALenum format; @@ -96,12 +98,13 @@ typedef struct Music { // no more than 4 concurrent audio contexts in use. This is due to each active context being tied to // a dedicated mix channel. All audio is 32bit floating point in stereo. typedef struct AudioContext_t { - unsigned short sampleRate; // default is 48000 - unsigned char channels; // 1=mono,2=stereo - unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - ALenum alFormat; // openAL format specifier - ALuint alSource; // openAL source - ALuint alBuffer[2]; // openAL sample buffer + unsigned short sampleRate; // default is 48000 + unsigned char channels; // 1=mono,2=stereo + unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream + bool floatingPoint; // if false then the short datatype is used instead + ALenum alFormat; // openAL format specifier + ALuint alSource; // openAL source + ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer } AudioContext_t; #if defined(AUDIO_STANDALONE) @@ -126,7 +129,7 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(ALuint buffer); // Fill music buffers with data static void EmptyMusicStream(void); // Empty music buffers -static void FillAlBufferWithSilence(AudioContext_t *ac, ALuint buffer);// fill buffer with zeros +static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer);// fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // pass two arrays of same length in @@ -201,11 +204,10 @@ bool IsAudioDeviceReady(void) // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0, 2); // mixchannel 1, 48khz, stereo -// all samples are floating point by default -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels) +// exmple usage is InitAudioContext(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint) { - if(mixChannel > MAX_AUDIO_CONTEXTS) return NULL; + if(mixChannel >= MAX_AUDIO_CONTEXTS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); else StopMusicStream(); @@ -214,13 +216,24 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChanne ac->sampleRate = sampleRate; ac->channels = channels; ac->mixChannel = mixChannel; + ac->floatingPoint = floatingPoint; mixChannelsActive_g[mixChannel] = ac; // setup openAL format if(channels == 1) - ac->alFormat = AL_FORMAT_MONO_FLOAT32; - else - ac->alFormat = AL_FORMAT_STEREO_FLOAT32; + { + if(floatingPoint) + ac->alFormat = AL_FORMAT_MONO_FLOAT32; + else + ac->alFormat = AL_FORMAT_MONO16; + } + else if(channels == 2) + { + if(floatingPoint) + ac->alFormat = AL_FORMAT_STEREO_FLOAT32; + else + ac->alFormat = AL_FORMAT_STEREO16; + } // Create an audio source alGenSources(1, &ac->alSource); @@ -230,16 +243,17 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChanne alSource3f(ac->alSource, AL_VELOCITY, 0, 0, 0); // Create Buffer - alGenBuffers(2, ac->alBuffer); + alGenBuffers(MAX_STREAM_BUFFERS, ac->alBuffer); //fill buffers - FillAlBufferWithSilence(ac, ac->alBuffer[0]); - FillAlBufferWithSilence(ac, ac->alBuffer[1]); - alSourceQueueBuffers(ac->alSource, 2, ac->alBuffer); + int x; + for(x=0;xalBuffer[x]); + + alSourceQueueBuffers(ac->alSource, MAX_STREAM_BUFFERS, ac->alBuffer); alSourcei(ac->alSource, AL_LOOPING, AL_FALSE); // this could cause errors alSourcePlay(ac->alSource); - return ac; } return NULL; @@ -264,20 +278,22 @@ void CloseAudioContext(AudioContext ctx) //delete source and buffers alDeleteSources(1, &context->alSource); - alDeleteBuffers(2, context->alBuffer); + alDeleteBuffers(MAX_STREAM_BUFFERS, context->alBuffer); mixChannelsActive_g[context->mixChannel] = NULL; free(context); ctx = NULL; } } -// Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in -// Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio -// Returns number of floats that where processed -unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength) +// Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in. +// Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio. +// @Returns number of samples that where processed. +// All data streams should be of a length that is evenly divisible by MUSIC_BUFFER_SIZE, +// otherwise the remaining data will not be pushed. +unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements) { unsigned short numberProcessed = 0; - unsigned short numberRemaining = dataLength; + unsigned short numberRemaining = numberElements; AudioContext_t *context = (AudioContext_t*)ctx; if (context && mixChannelsActive_g[context->mixChannel] == context) @@ -288,44 +304,60 @@ unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short if(!processed) return 0;//nothing to process, queue is still full - if (!data || !dataLength)// play silence + if (!data || !numberElements)// play silence + { while (processed > 0) { alSourceUnqueueBuffers(context->alSource, 1, &buffer); - FillAlBufferWithSilence(context, buffer); + numberProcessed += FillAlBufferWithSilence(context, buffer); alSourceQueueBuffers(context->alSource, 1, &buffer); processed--; - numberProcessed+=MUSIC_BUFFER_SIZE; } + } if(numberRemaining)// buffer data stream in increments of MUSIC_BUFFER_SIZE + { while (processed > 0) { - alSourceUnqueueBuffers(context->alSource, 1, &buffer); - if(numberRemaining >= MUSIC_BUFFER_SIZE) + if(context->floatingPoint && numberRemaining >= MUSIC_BUFFER_SIZE_FLOAT) // process float buffers { - float pcm[MUSIC_BUFFER_SIZE]; - memcpy(pcm, &data[numberProcessed], MUSIC_BUFFER_SIZE); - alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), context->sampleRate); + float *ptr = (float*)data; + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), context->sampleRate); alSourceQueueBuffers(context->alSource, 1, &buffer); - numberProcessed+=MUSIC_BUFFER_SIZE; - numberRemaining-=MUSIC_BUFFER_SIZE; + numberProcessed+=MUSIC_BUFFER_SIZE_FLOAT; + numberRemaining-=MUSIC_BUFFER_SIZE_FLOAT; } - else // less than MUSIC_BUFFER_SIZE number of samples left to buffer, the remaining data is padded with zeros + else if(!context->floatingPoint && numberRemaining >= MUSIC_BUFFER_SIZE_SHORT) // process short buffers { - float pcm[MUSIC_BUFFER_SIZE] = {0.f}; // pad with zeros + short *ptr = (short*)data; + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_SHORT*sizeof(short), context->sampleRate); + alSourceQueueBuffers(context->alSource, 1, &buffer); + numberProcessed+=MUSIC_BUFFER_SIZE_SHORT; + numberRemaining-=MUSIC_BUFFER_SIZE_SHORT; } processed--; } + } } return numberProcessed; } -// fill buffer with zeros -static void FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer) +// fill buffer with zeros, returns number processed +static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer) { - float pcm[MUSIC_BUFFER_SIZE] = {0.f}; - alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE*sizeof(float), context->sampleRate); + if(context->floatingPoint){ + float pcm[MUSIC_BUFFER_SIZE_FLOAT] = {0.f}; + alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), context->sampleRate); + return MUSIC_BUFFER_SIZE_FLOAT; + } + else + { + short pcm[MUSIC_BUFFER_SIZE_SHORT] = {0}; + alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), context->sampleRate); + return MUSIC_BUFFER_SIZE_SHORT; + } } // example usage: @@ -920,7 +952,7 @@ float GetMusicTimePlayed(void) // Fill music buffers with new data from music stream static bool BufferMusicStream(ALuint buffer) { - short pcm[MUSIC_BUFFER_SIZE]; + short pcm[MUSIC_BUFFER_SIZE_SHORT]; int size = 0; // Total size of data steamed (in bytes) int streamedBytes = 0; // samples of data obtained, channels are not included in calculation @@ -930,15 +962,15 @@ static bool BufferMusicStream(ALuint buffer) { if (currentMusic.chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - int readlen = MUSIC_BUFFER_SIZE / 2; + int readlen = MUSIC_BUFFER_SIZE_SHORT / 2; jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location size += readlen * currentMusic.channels; // Not sure if this is what it needs } else { - while (size < MUSIC_BUFFER_SIZE) + while (size < MUSIC_BUFFER_SIZE_SHORT) { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE - size); + streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE_SHORT - size); if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); else break; } diff --git a/src/audio.h b/src/audio.h index 2b36b3f0..9d6fa5d0 100644 --- a/src/audio.h +++ b/src/audio.h @@ -84,11 +84,10 @@ bool IsAudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0, 2); // mixchannel 1, 48khz, stereo -// all samples are floating point by default -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels); +// exmple usage is InitAudioContext(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); void CloseAudioContext(AudioContext ctx); // Frees audio context -unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data diff --git a/src/raylib.h b/src/raylib.h index 5c727b61..c9ba5b38 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -870,11 +870,10 @@ bool IsAudioDeviceReady(void); // True if call // Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing // The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0, 2); // mixchannel 1, 48khz, stereo -// all samples are floating point by default -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels); +// exmple usage is InitAudioContext(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point +AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); void CloseAudioContext(AudioContext ctx); // Frees audio context -unsigned short UpdateAudioContext(AudioContext ctx, float *data, unsigned short dataLength); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played +unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -- cgit v1.2.3 From d6feeb14ffc11e54a82f51dbbe899f720d6997e8 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Tue, 3 May 2016 02:52:45 -0700 Subject: pause on no data --- src/audio.c | 31 +++++++++++++++---------------- src/easings.h | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index dc063796..a46aa00a 100644 --- a/src/audio.c +++ b/src/audio.c @@ -114,11 +114,10 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active +static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active static bool musicEnabled = false; static Music currentMusic; // Current music loaded // NOTE: Only one music file playing at a time - //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -286,34 +285,34 @@ void CloseAudioContext(AudioContext ctx) } // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in. -// Call "UpdateAudioContext(ctx, NULL, 0)" every game tick if you want to pause the audio. +// Call "UpdateAudioContext(ctx, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. // All data streams should be of a length that is evenly divisible by MUSIC_BUFFER_SIZE, // otherwise the remaining data will not be pushed. unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements) { - unsigned short numberProcessed = 0; - unsigned short numberRemaining = numberElements; AudioContext_t *context = (AudioContext_t*)ctx; + if(context && context->channels == 2 && numberElements % 2 != 0) return 0; // when there is two channels there must be an even number of samples + + if (!data || !numberElements) alSourcePause(context->alSource); // pauses audio until data is given + else{ // restart audio otherwise + ALint state; + alGetSourcei(context->alSource, AL_SOURCE_STATE, &state); + if (state != AL_PLAYING) alSourcePlay(context->alSource); + } + if (context && mixChannelsActive_g[context->mixChannel] == context) { ALint processed = 0; ALuint buffer = 0; - alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) + unsigned short numberProcessed = 0; + unsigned short numberRemaining = numberElements; + + alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) if(!processed) return 0;//nothing to process, queue is still full - if (!data || !numberElements)// play silence - { - while (processed > 0) - { - alSourceUnqueueBuffers(context->alSource, 1, &buffer); - numberProcessed += FillAlBufferWithSilence(context, buffer); - alSourceQueueBuffers(context->alSource, 1, &buffer); - processed--; - } - } if(numberRemaining)// buffer data stream in increments of MUSIC_BUFFER_SIZE { while (processed > 0) diff --git a/src/easings.h b/src/easings.h index a198be4d..e1e5465a 100644 --- a/src/easings.h +++ b/src/easings.h @@ -7,6 +7,23 @@ * This header uses: * #define EASINGS_STATIC_INLINE // Inlines all functions code, so it runs faster. * // This requires lots of memory on system. +* How to use: +* The four inputs t,b,c,d are defined as follows: +* t = current time in milliseconds +* b = starting position in only one dimension [X || Y || Z] your choice +* c = the total change in value of b that needs to occur +* d = total time it should take to complete +* +* Example: +* float speed = 1.f; +* float currentTime = 0.f; +* float currentPos[2] = {0,0}; +* float newPos[2] = {1,1}; +* float tempPosition[2] = currentPos;//x,y positions +* while(currentPos[0] < newPos[0]) +* currentPos[0] = EaseSineIn(currentTime, tempPosition[0], tempPosition[0]-newPos[0], speed); +* currentPos[1] = EaseSineIn(currentTime, tempPosition[1], tempPosition[1]-newPos[0], speed); +* currentTime += diffTime(); * * A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/) * -- cgit v1.2.3 From e94acf86f8125edfb6534a45c86493be298fea68 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 3 May 2016 17:54:50 +0200 Subject: Reorganized internal funcs --- src/text.c | 98 ++++++++++++++++++++++++++------------------------------------ 1 file changed, 41 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index f89d5e4e..7bb06f44 100644 --- a/src/text.c +++ b/src/text.c @@ -69,8 +69,7 @@ static SpriteFont defaultFont; // Default font provided by raylib //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static bool PixelIsMagenta(Color p); // Check if a pixel is magenta -static int ParseImageData(Image image, int **charValues, Rectangle **charSet); // Parse image pixel data to obtain characters data +static SpriteFont LoadImageFont(Image image, Color key, int firstChar); // Load a Image font file (XNA style) static SpriteFont LoadRBMF(const char *fileName); // Load a rBMF font file (raylib BitMap Font) static SpriteFont LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) static SpriteFont LoadTTF(const char *fileName, int fontSize); // Generate a sprite font image from TTF data (font size required) @@ -210,7 +209,7 @@ extern void LoadDefaultFont(void) if (testPosX >= defaultFont.texture.width) { currentLine++; - currentPosX = 2 * charsDivisor + charsWidth[i]; + currentPosX = 2*charsDivisor + charsWidth[i]; testPosX = currentPosX; defaultFont.charRecs[i].x = charsDivisor; @@ -246,7 +245,7 @@ SpriteFont GetDefaultFont() // Load a SpriteFont image into GPU memory SpriteFont LoadSpriteFont(const char *fileName) { - SpriteFont spriteFont; + SpriteFont spriteFont = { 0 }; // Check file extension if (strcmp(GetExtension(fileName),"rbmf") == 0) spriteFont = LoadRBMF(fileName); @@ -255,36 +254,7 @@ SpriteFont LoadSpriteFont(const char *fileName) else { Image image = LoadImage(fileName); - - if (image.data != NULL) - { - // Process bitmap font pixel data to get characters measures - // spriteFont chars data is filled inside the function and memory is allocated! - int numChars = ParseImageData(image, &spriteFont.charValues, &spriteFont.charRecs); - - TraceLog(DEBUG, "[%s] SpriteFont data parsed correctly", fileName); - TraceLog(DEBUG, "[%s] SpriteFont num chars detected: %i", fileName, numChars); - - spriteFont.numChars = numChars; - spriteFont.texture = LoadTextureFromImage(image); // Convert loaded image to OpenGL texture - spriteFont.size = spriteFont.charRecs[0].height; - - spriteFont.charOffsets = (Vector2 *)malloc(spriteFont.numChars*sizeof(Vector2)); - spriteFont.charAdvanceX = (int *)malloc(spriteFont.numChars*sizeof(int)); - - for (int i = 0; i < spriteFont.numChars; i++) - { - // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) - spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; - spriteFont.charAdvanceX[i] = 0; - } - } - else - { - TraceLog(WARNING, "[%s] SpriteFont could not be loaded, using default font", fileName); - spriteFont = GetDefaultFont(); - } - + if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, 32); UnloadImage(image); } @@ -309,7 +279,7 @@ void UnloadSpriteFont(SpriteFont spriteFont) free(spriteFont.charOffsets); free(spriteFont.charAdvanceX); - TraceLog(INFO, "Unloaded sprite font data"); + TraceLog(DEBUG, "Unloaded sprite font data"); } } @@ -517,15 +487,11 @@ void DrawFPS(int posX, int posY) // Module specific Functions Definition //---------------------------------------------------------------------------------- -// Check if a pixel is magenta -static bool PixelIsMagenta(Color p) -{ - return ((p.r == 255) && (p.g == 0) && (p.b == 255) && (p.a == 255)); -} - -// Parse image pixel data to obtain characters data (measures) -static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) +// Load a Image font file (XNA style) +static SpriteFont LoadImageFont(Image image, Color key, int firstChar) { + #define COLOR_EQUAL(col1, col2) ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) + int charSpacing = 0; int lineSpacing = 0; @@ -539,13 +505,14 @@ static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) Color *pixels = GetImageData(image); + // Parse image data to get charSpacing and lineSpacing for(y = 0; y < image.height; y++) { for(x = 0; x < image.width; x++) { - if (!PixelIsMagenta(pixels[y*image.width + x])) break; + if (!COLOR_EQUAL(pixels[y*image.width + x], key)) break; } - if (!PixelIsMagenta(pixels[y*image.width + x])) break; + if (!COLOR_EQUAL(pixels[y*image.width + x], key)) break; } charSpacing = x; @@ -554,7 +521,7 @@ static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) int charHeight = 0; int j = 0; - while(!PixelIsMagenta(pixels[(lineSpacing + j)*image.width + charSpacing])) j++; + while(!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++; charHeight = j; @@ -563,12 +530,13 @@ static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) int lineToRead = 0; int xPosToRead = charSpacing; + // Parse image data to get rectangle sizes while((lineSpacing + lineToRead * (charHeight + lineSpacing)) < image.height) { while((xPosToRead < image.width) && - !PixelIsMagenta((pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead]))) + !COLOR_EQUAL((pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead]), key)) { - tempCharValues[index] = FONT_FIRST_CHAR + index; + tempCharValues[index] = firstChar + index; tempCharRecs[index].x = xPosToRead; tempCharRecs[index].y = lineSpacing + lineToRead * (charHeight + lineSpacing); @@ -576,7 +544,7 @@ static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) int charWidth = 0; - while(!PixelIsMagenta(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth])) charWidth++; + while(!COLOR_EQUAL(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++; tempCharRecs[index].width = charWidth; @@ -590,20 +558,35 @@ static int ParseImageData(Image image, int **charValues, Rectangle **charRecs) } free(pixels); + + TraceLog(DEBUG, "SpriteFont data parsed correctly from image"); + + // Create spritefont with all data parsed from image + SpriteFont spriteFont = { 0 }; + + spriteFont.texture = LoadTextureFromImage(image); // Convert loaded image to OpenGL texture + spriteFont.numChars = index; // We got tempCharValues and tempCharsRecs populated with chars data - // Now we move temp data to sized charValues and charRecs arrays (passed as parameter to the function) - // NOTE: This memory should be freed! - (*charRecs) = (Rectangle *)malloc(index*sizeof(Rectangle)); - (*charValues) = (int *)malloc(index*sizeof(int)); + // Now we move temp data to sized charValues and charRecs arrays + spriteFont.charRecs = (Rectangle *)malloc(spriteFont.numChars*sizeof(Rectangle)); + spriteFont.charValues = (int *)malloc(spriteFont.numChars*sizeof(int)); + spriteFont.charOffsets = (Vector2 *)malloc(spriteFont.numChars*sizeof(Vector2)); + spriteFont.charAdvanceX = (int *)malloc(spriteFont.numChars*sizeof(int)); - for (int i = 0; i < index; i++) + for (int i = 0; i < spriteFont.numChars; i++) { - (*charValues)[i] = tempCharValues[i]; - (*charRecs)[i] = tempCharRecs[i]; + spriteFont.charValues[i] = tempCharValues[i]; + spriteFont.charRecs[i] = tempCharRecs[i]; + + // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) + spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; + spriteFont.charAdvanceX[i] = 0; } + + spriteFont.size = spriteFont.charRecs[0].height; - return index; + return spriteFont; } // Load a rBMF font file (raylib BitMap Font) @@ -687,6 +670,7 @@ static SpriteFont LoadRBMF(const char *fileName) TraceLog(DEBUG, "[%s] Image reconstructed correctly, now converting it to texture", fileName); + // Create spritefont with all data read from rbmf file spriteFont.texture = LoadTextureFromImage(image); UnloadImage(image); // Unload image data -- cgit v1.2.3 From 5f73850fa675530d6933d85a6d80684106beff69 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 3 May 2016 18:04:21 +0200 Subject: Renamed functions for consistency --- src/audio.c | 4 ++-- src/audio.h | 4 ++-- src/raylib.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 39d1ee8b..09c91785 100644 --- a/src/audio.c +++ b/src/audio.c @@ -585,7 +585,7 @@ void StopSound(Sound sound) } // Check if a sound is playing -bool SoundIsPlaying(Sound sound) +bool IsSoundPlaying(Sound sound) { bool playing = false; ALint state; @@ -764,7 +764,7 @@ void ResumeMusicStream(void) } // Check if music is playing -bool MusicIsPlaying(void) +bool IsMusicPlaying(void) { bool playing = false; ALint state; diff --git a/src/audio.h b/src/audio.h index 9c681044..73f60ab1 100644 --- a/src/audio.h +++ b/src/audio.h @@ -96,7 +96,7 @@ void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound void StopSound(Sound sound); // Stop playing a sound -bool SoundIsPlaying(Sound sound); // Check if a sound is currently playing +bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) @@ -105,7 +105,7 @@ void UpdateMusicStream(void); // Updates buffe void StopMusicStream(void); // Stop music playing (close stream) void PauseMusicStream(void); // Pause music playing void ResumeMusicStream(void); // Resume playing paused music -bool MusicIsPlaying(void); // Check if music is playing +bool IsMusicPlaying(void); // Check if music is playing void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) diff --git a/src/raylib.h b/src/raylib.h index 337b9813..bc98181b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -882,7 +882,7 @@ void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound void StopSound(Sound sound); // Stop playing a sound -bool SoundIsPlaying(Sound sound); // Check if a sound is currently playing +bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) @@ -891,7 +891,7 @@ void UpdateMusicStream(void); // Updates buffe void StopMusicStream(void); // Stop music playing (close stream) void PauseMusicStream(void); // Pause music playing void ResumeMusicStream(void); // Resume playing paused music -bool MusicIsPlaying(void); // Check if music is playing +bool IsMusicPlaying(void); // Check if music is playing void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get current music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) -- cgit v1.2.3 From 8301980ba8f917dd445b346332c48ec3b2447511 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 3 May 2016 19:20:25 +0200 Subject: Clean up and consistency review - Renamed some functions for consistency (default buffers) - Removed mystrdup() function (implemented inline) - Renamed TextFileRead() to ReadTextFile() --- src/rlgl.c | 299 +++++++++++++++++++++++++++++++------------------------------ src/rlgl.h | 16 +--- 2 files changed, 158 insertions(+), 157 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index e021e726..9112e47e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -196,23 +196,20 @@ static DrawMode currentDrawMode; static float currentDepth = -1.0f; -// Vertex arrays for lines, triangles and quads +// Default vertex buffers for lines, triangles and quads static VertexPositionColorBuffer lines; // No texture support static VertexPositionColorBuffer triangles; // No texture support static VertexPositionColorTextureIndexBuffer quads; -// Shader Programs -static Shader defaultShader; -static Shader currentShader; // By default, defaultShader - -// Vertex Array Objects (VAO) +// Default vertex buffers VAOs (if supported) static GLuint vaoLines, vaoTriangles, vaoQuads; -// Vertex Buffer Objects (VBO) -static GLuint linesBuffer[2]; -static GLuint trianglesBuffer[2]; -static GLuint quadsBuffer[4]; +// Default vertex buffers VBOs +static GLuint linesBuffer[2]; // Lines buffers (position, color) +static GLuint trianglesBuffer[2]; // Triangles buffers (position, color) +static GLuint quadsBuffer[4]; // Quads buffers (position, texcoord, color, index) +// Default buffers draw calls static DrawCall *draws; static int drawsCounter; @@ -221,11 +218,14 @@ static Vector3 *tempBuffer; static int tempBufferCount = 0; static bool useTempBuffer = false; +// Shader Programs +static Shader defaultShader; +static Shader currentShader; // By default, defaultShader + // Flags for supported extensions static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) // Compressed textures support flags -//static bool texCompDXTSupported = false; // DDS texture compression support static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support @@ -233,8 +233,8 @@ static bool texCompASTCSupported = false; // ASTC texture compression support #endif // Compressed textures support flags -static bool texCompDXTSupported = false; // DDS texture compression support -static bool npotSupported = false; // NPOT textures full support +static bool texCompDXTSupported = false; // DDS texture compression support +static bool npotSupported = false; // NPOT textures full support #if defined(GRAPHICS_API_OPENGL_ES2) // NOTE: VAO functionality is exposed through extensions (OES) @@ -254,14 +254,17 @@ unsigned int whiteTexture; // Module specific Functions Declaration //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat); + static Shader LoadDefaultShader(void); static void LoadDefaultShaderLocations(Shader *shader); -static void InitializeBuffers(void); -static void InitializeBuffersGPU(void); -static void UpdateBuffers(void); -static char *TextFileRead(char *fn); +static void UnloadDefaultShader(void); -static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat); +static void LoadDefaultBuffers(void); +static void UpdateDefaultBuffers(void); +static void UnloadDefaultBuffers(void); + +static char *ReadTextFile(const char *fileName); #endif #if defined(GRAPHICS_API_OPENGL_11) @@ -274,20 +277,6 @@ static void TraceLog(int msgType, const char *text, ...); float *MatrixToFloat(Matrix mat); // Converts Matrix to float array #endif -#if defined(GRAPHICS_API_OPENGL_ES2) -// NOTE: strdup() functions replacement (not C99, POSIX function, not available on emscripten) -// Duplicates a string, returning an identical malloc'd string -char *mystrdup(const char *str) -{ - size_t len = strlen(str) + 1; - void *newstr = malloc(len); - - if (newstr == NULL) return NULL; - - return (char *)memcpy(newstr, str, len); -} -#endif - //---------------------------------------------------------------------------------- // Module Functions Definition - Matrix operations //---------------------------------------------------------------------------------- @@ -919,13 +908,18 @@ void rlglInit(void) // NOTE: We have to duplicate string because glGetString() returns a const value // If not duplicated, it fails in some systems (Raspberry Pi) - char *extensionsDup = mystrdup(extensions); + // Equivalent to function: char *strdup(const char *str) + char *extensionsDup; + size_t len = strlen(extensions) + 1; + void *newstr = malloc(len); + if (newstr == NULL) extensionsDup = NULL; + extensionsDup = (char *)memcpy(newstr, extensions, len); // NOTE: String could be splitted using strtok() function (string.h) // NOTE: strtok() modifies the received string, it can not be const char *extList[512]; // Allocate 512 strings pointers (2 KB) - + extList[numExt] = strtok(extensionsDup, " "); while (extList[numExt] != NULL) @@ -1024,12 +1018,9 @@ void rlglInit(void) // Init default Shader (customized for GL 3.3 and ES2) defaultShader = LoadDefaultShader(); - //customShader = LoadShader("custom.vs", "custom.fs"); // Works ok - currentShader = defaultShader; - InitializeBuffers(); // Init vertex arrays - InitializeBuffersGPU(); // Init VBO and VAO + LoadDefaultBuffers(); // Initialize default vertex arrays buffers (lines, triangles, quads) // Init temp vertex buffer, used when transformation required (translate, rotate, scale) tempBuffer = (Vector3 *)malloc(sizeof(Vector3)*TEMP_VERTEX_BUFFER_SIZE); @@ -1054,54 +1045,10 @@ void rlglInit(void) void rlglClose(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Unbind everything - if (vaoSupported) glBindVertexArray(0); - glDisableVertexAttribArray(0); - glDisableVertexAttribArray(1); - glDisableVertexAttribArray(2); - glDisableVertexAttribArray(3); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - - glUseProgram(0); - - // Delete VBOs - glDeleteBuffers(1, &linesBuffer[0]); - glDeleteBuffers(1, &linesBuffer[1]); - glDeleteBuffers(1, &trianglesBuffer[0]); - glDeleteBuffers(1, &trianglesBuffer[1]); - glDeleteBuffers(1, &quadsBuffer[0]); - glDeleteBuffers(1, &quadsBuffer[1]); - glDeleteBuffers(1, &quadsBuffer[2]); - glDeleteBuffers(1, &quadsBuffer[3]); - - if (vaoSupported) - { - // Delete VAOs - glDeleteVertexArrays(1, &vaoLines); - glDeleteVertexArrays(1, &vaoTriangles); - glDeleteVertexArrays(1, &vaoQuads); - } - - //glDetachShader(defaultShaderProgram, vertexShader); - //glDetachShader(defaultShaderProgram, fragmentShader); - //glDeleteShader(vertexShader); // Already deleted on shader compilation - //glDeleteShader(fragmentShader); // Already deleted on sahder compilation - glDeleteProgram(defaultShader.id); - - // Free vertex arrays memory - free(lines.vertices); - free(lines.colors); - - free(triangles.vertices); - free(triangles.colors); - - free(quads.vertices); - free(quads.texcoords); - free(quads.colors); - free(quads.indices); - - // Free GPU texture + UnloadDefaultShader(); + UnloadDefaultBuffers(); + + // Delete default white texture glDeleteTextures(1, &whiteTexture); TraceLog(INFO, "[TEX ID %i] Unloaded texture data (base white texture) from VRAM", whiteTexture); @@ -1113,7 +1060,7 @@ void rlglClose(void) void rlglDraw(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - UpdateBuffers(); + UpdateDefaultBuffers(); if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) { @@ -1846,7 +1793,9 @@ void rlglGenerateMipmaps(Texture2D texture) // NOTE: Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data free(data); -#elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +#endif + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically TraceLog(INFO, "[TEX ID %i] Mipmaps generated automatically", texture.id); @@ -2116,8 +2065,8 @@ Shader LoadShader(char *vsFileName, char *fsFileName) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Shaders loading from external text file - char *vShaderStr = TextFileRead(vsFileName); - char *fShaderStr = TextFileRead(fsFileName); + char *vShaderStr = ReadTextFile(vsFileName); + char *fShaderStr = ReadTextFile(fsFileName); if ((vShaderStr != NULL) && (fShaderStr != NULL)) { @@ -2418,7 +2367,7 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in } } -// Load Shader (Vertex and Fragment) +// Load default shader (Vertex and Fragment) // NOTE: This shader program is used for batch buffers (lines, triangles, quads) static Shader LoadDefaultShader(void) { @@ -2503,43 +2452,24 @@ static void LoadDefaultShaderLocations(Shader *shader) shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); } -// Read text file -// NOTE: text chars array should be freed manually -static char *TextFileRead(char *fileName) +// Unload default shader +static void UnloadDefaultShader(void) { - FILE *textFile; - char *text = NULL; - - int count = 0; - - if (fileName != NULL) - { - textFile = fopen(fileName,"rt"); - - if (textFile != NULL) - { - fseek(textFile, 0, SEEK_END); - count = ftell(textFile); - rewind(textFile); - - if (count > 0) - { - text = (char *)malloc(sizeof(char)*(count + 1)); - count = fread(text, sizeof(char), count, textFile); - text[count] = '\0'; - } - - fclose(textFile); - } - else TraceLog(WARNING, "[%s] Text file could not be opened", fileName); - } + glUseProgram(0); - return text; + //glDetachShader(defaultShaderProgram, vertexShader); + //glDetachShader(defaultShaderProgram, fragmentShader); + //glDeleteShader(vertexShader); // Already deleted on shader compilation + //glDeleteShader(fragmentShader); // Already deleted on sahder compilation + glDeleteProgram(defaultShader.id); } -// Allocate and initialize float array buffers to store vertex data (lines, triangles, quads) -static void InitializeBuffers(void) +// Load default internal buffers (lines, triangles, quads) +static void LoadDefaultBuffers(void) { + // [CPU] Allocate and initialize float array buffers to store vertex data (lines, triangles, quads) + //-------------------------------------------------------------------------------------------- + // Initialize lines arrays (vertex position and color data) lines.vertices = (float *)malloc(sizeof(float)*3*2*MAX_LINES_BATCH); // 3 float by vertex, 2 vertex by line lines.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*2*MAX_LINES_BATCH); // 4 float by color, 2 colors by line @@ -2593,13 +2523,14 @@ static void InitializeBuffers(void) quads.tcCounter = 0; quads.cCounter = 0; - TraceLog(INFO, "CPU buffers (lines, triangles, quads) initialized successfully"); -} - -// Initialize Vertex Array Objects (Contain VBO) -// NOTE: lines, triangles and quads buffers use currentShader -static void InitializeBuffersGPU(void) -{ + TraceLog(INFO, "Default buffers initialized successfully in CPU (lines, triangles, quads)"); + //-------------------------------------------------------------------------------------------- + + // [GPU] Upload vertex data and initialize VAOs/VBOs (lines, triangles, quads) + // NOTE: Default buffers are linked to use currentShader (defaultShader) + //-------------------------------------------------------------------------------------------- + + // Upload and link lines vertex buffers if (vaoSupported) { // Initialize Lines VAO @@ -2622,10 +2553,10 @@ static void InitializeBuffersGPU(void) glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Lines VAO initialized successfully", vaoLines); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Lines VBOs initialized successfully", linesBuffer[0], linesBuffer[1]); - //-------------------------------------------------------------- + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (lines) VAO initialized successfully", vaoLines); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers (lines) VBOs initialized successfully", linesBuffer[0], linesBuffer[1]); + // Upload and link triangles vertex buffers if (vaoSupported) { // Initialize Triangles VAO @@ -2647,10 +2578,10 @@ static void InitializeBuffersGPU(void) glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Triangles VAO initialized successfully", vaoTriangles); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Triangles VBOs initialized successfully", trianglesBuffer[0], trianglesBuffer[1]); - //-------------------------------------------------------------- + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (triangles) VAO initialized successfully", vaoTriangles); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers (triangles) VBOs initialized successfully", trianglesBuffer[0], trianglesBuffer[1]); + // Upload and link quads vertex buffers if (vaoSupported) { // Initialize Quads VAO @@ -2685,18 +2616,20 @@ static void InitializeBuffersGPU(void) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(short)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW); #endif - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Quads VAO initialized successfully", vaoQuads); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Quads VBOs initialized successfully", quadsBuffer[0], quadsBuffer[1], quadsBuffer[2], quadsBuffer[3]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (quads) VAO initialized successfully", vaoQuads); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Default buffers (quads) VBOs initialized successfully", quadsBuffer[0], quadsBuffer[1], quadsBuffer[2], quadsBuffer[3]); // Unbind the current VAO if (vaoSupported) glBindVertexArray(0); + //-------------------------------------------------------------------------------------------- } -// Update VBOs with vertex array data +// Update default buffers (VAOs/VBOs) with vertex array data // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) -// TODO: If no data changed on the CPU arrays --> No need to update GPU arrays (change flag required) -static void UpdateBuffers(void) +// TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) +static void UpdateDefaultBuffers(void) { + // Update lines vertex buffers if (lines.vCounter > 0) { // Activate Lines VAO @@ -2712,8 +2645,8 @@ static void UpdateBuffers(void) //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*2*MAX_LINES_BATCH, lines.colors, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*lines.cCounter, lines.colors); } - //-------------------------------------------------------------- + // Update triangles vertex buffers if (triangles.vCounter > 0) { // Activate Triangles VAO @@ -2729,8 +2662,8 @@ static void UpdateBuffers(void) //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*3*MAX_TRIANGLES_BATCH, triangles.colors, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*triangles.cCounter, triangles.colors); } - //-------------------------------------------------------------- + // Update quads vertex buffers if (quads.vCounter > 0) { // Activate Quads VAO @@ -2752,7 +2685,7 @@ static void UpdateBuffers(void) glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*quads.vCounter, quads.colors); // Another option would be using buffer mapping... - //triangles.vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); + //quads.vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); // Now we can modify vertices //glUnmapBuffer(GL_ARRAY_BUFFER); } @@ -2761,6 +2694,83 @@ static void UpdateBuffers(void) // Unbind the current VAO if (vaoSupported) glBindVertexArray(0); } + +// Unload default buffers vertex data from CPU and GPU +static void UnloadDefaultBuffers(void) +{ + // Unbind everything + if (vaoSupported) glBindVertexArray(0); + glDisableVertexAttribArray(0); + glDisableVertexAttribArray(1); + glDisableVertexAttribArray(2); + glDisableVertexAttribArray(3); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + // Delete VBOs from GPU (VRAM) + glDeleteBuffers(1, &linesBuffer[0]); + glDeleteBuffers(1, &linesBuffer[1]); + glDeleteBuffers(1, &trianglesBuffer[0]); + glDeleteBuffers(1, &trianglesBuffer[1]); + glDeleteBuffers(1, &quadsBuffer[0]); + glDeleteBuffers(1, &quadsBuffer[1]); + glDeleteBuffers(1, &quadsBuffer[2]); + glDeleteBuffers(1, &quadsBuffer[3]); + + if (vaoSupported) + { + // Delete VAOs from GPU (VRAM) + glDeleteVertexArrays(1, &vaoLines); + glDeleteVertexArrays(1, &vaoTriangles); + glDeleteVertexArrays(1, &vaoQuads); + } + + // Free vertex arrays memory from CPU (RAM) + free(lines.vertices); + free(lines.colors); + + free(triangles.vertices); + free(triangles.colors); + + free(quads.vertices); + free(quads.texcoords); + free(quads.colors); + free(quads.indices); +} + +// Read text data from file +// NOTE: text chars array should be freed manually +static char *ReadTextFile(const char *fileName) +{ + FILE *textFile; + char *text = NULL; + + int count = 0; + + if (fileName != NULL) + { + textFile = fopen(fileName,"rt"); + + if (textFile != NULL) + { + fseek(textFile, 0, SEEK_END); + count = ftell(textFile); + rewind(textFile); + + if (count > 0) + { + text = (char *)malloc(sizeof(char)*(count + 1)); + count = fread(text, sizeof(char), count, textFile); + text[count] = '\0'; + } + + fclose(textFile); + } + else TraceLog(WARNING, "[%s] Text file could not be opened", fileName); + } + + return text; +} #endif //defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_11) @@ -2891,7 +2901,6 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) #endif #if defined(RLGL_STANDALONE) - // Output a trace log message // NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning static void TraceLog(int msgType, const char *text, ...) diff --git a/src/rlgl.h b/src/rlgl.h index 714961e1..cd8e6d1d 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -292,11 +292,6 @@ Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view); // Get world unsigned char *rlglReadScreenPixels(int width, int height); // Read screen pixel data (color buffer) void *rlglReadTexturePixels(Texture2D texture); // Read texture pixel data -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -void PrintProjectionMatrix(void); // DEBUG: Print projection matrix -void PrintModelviewMatrix(void); // DEBUG: Print modelview matrix -#endif - #if defined(RLGL_STANDALONE) //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) @@ -309,13 +304,10 @@ void SetCustomShader(Shader shader); // Set custo void SetDefaultShader(void); // Set default shader to be used in batch draw void SetModelShader(Model *model, Shader shader); // Link a shader to a model -int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) -void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) -void SetShaderMapDiffuse(Shader *shader, Texture2D texture); // Default diffuse shader map texture assignment -void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture); // Normal map texture shader assignment -void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture); // Specular map texture shader assignment -void SetShaderMap(Shader *shader, int mapLocation, Texture2D texture, int textureUnit); // TODO: Generic shader map assignment +int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) +void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) +void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) #endif -- cgit v1.2.3 From fd67e31f630476980eb09e49177958703db5b3d3 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 3 May 2016 19:27:06 +0200 Subject: Renamed function for consistency --- src/core.c | 4 ++-- src/raylib.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index b27712a7..669010f9 100644 --- a/src/core.c +++ b/src/core.c @@ -905,7 +905,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) Vector3 farPoint = rlglUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView); #else // OPTION 2: Compute unprojection directly here - + // Calculate unproject matrix (multiply projection matrix and view matrix) and invert it Matrix matProjView = MatrixMultiply(matProj, matView); MatrixInvert(&matProjView); @@ -935,7 +935,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) } // Returns the screen space position from a 3d world space position -Vector2 WorldToScreen(Vector3 position, Camera camera) +Vector2 GetWorldToScreen(Vector3 position, Camera camera) { // Calculate projection matrix (from perspective instead of frustum Matrix matProj = MatrixPerspective(camera.fovy, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0); diff --git a/src/raylib.h b/src/raylib.h index bc98181b..8af7d2fb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -586,7 +586,7 @@ void BeginTextureMode(RenderTexture2D target); // Initializes rende void EndTextureMode(void); // Ends drawing to render texture Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position -Vector2 WorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position +Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) void SetTargetFPS(int fps); // Set target FPS (maximum) -- cgit v1.2.3 From ec72a8868e61507a3dfdc83bfe30c7110fc3051f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 7 May 2016 18:04:22 +0200 Subject: Comment tweak --- src/core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index 669010f9..54d42f83 100644 --- a/src/core.c +++ b/src/core.c @@ -1448,6 +1448,7 @@ static void InitDisplay(int width, int height) glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! + //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); } if (fullscreen) -- cgit v1.2.3 From 7ab008878afa202b4f2e579567be7a7d87242661 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 7 May 2016 18:07:15 +0200 Subject: Library redesign to accomodate materials system --- src/models.c | 164 ++++++++-- src/raylib.h | 31 +- src/rlgl.c | 989 +++++++++++++++++++++++++++++------------------------------ src/rlgl.h | 15 +- 4 files changed, 641 insertions(+), 558 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 0bb2b8d6..9b139120 100644 --- a/src/models.c +++ b/src/models.c @@ -55,7 +55,9 @@ extern unsigned int whiteTexture; //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static Mesh LoadOBJ(const char *fileName); +static Mesh LoadOBJ(const char *fileName); // Load OBJ mesh data +static Material LoadMTL(const char *fileName); // Load MTL material data + static Mesh GenMeshHeightmap(Image image, Vector3 size); static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); @@ -542,24 +544,19 @@ void DrawGizmo(Vector3 position) Model LoadModel(const char *fileName) { Model model = { 0 }; - Mesh mesh = { 0 }; - // NOTE: Initialize default data for model in case loading fails, maybe a cube? + // TODO: Initialize default data for model in case loading fails, maybe a cube? - if (strcmp(GetExtension(fileName),"obj") == 0) mesh = LoadOBJ(fileName); + if (strcmp(GetExtension(fileName),"obj") == 0) model.mesh = LoadOBJ(fileName); else TraceLog(WARNING, "[%s] Model extension not recognized, it can't be loaded", fileName); - // NOTE: At this point we have all vertex, texcoord, normal data for the model in mesh struct - - if (mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); + if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); else { - // NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel() - model = rlglLoadModel(mesh); // Upload vertex data to GPU - - // NOTE: Now that vertex data is uploaded to GPU VRAM, we can free arrays from CPU RAM - // We don't need CPU vertex data on OpenGL 3.3 or ES2... for static meshes... - // ...but we could keep CPU vertex data in case we need to update the mesh + rlglLoadMesh(&model.mesh); // Upload vertex data to GPU + + model.transform = MatrixIdentity(); + model.material = LoadDefaultMaterial(); } return model; @@ -568,12 +565,12 @@ Model LoadModel(const char *fileName) // Load a 3d model (from vertex data) Model LoadModelEx(Mesh data) { - Model model; + Model model = { 0 }; - // NOTE: model properties (transform, texture, shader) are initialized inside rlglLoadModel() - model = rlglLoadModel(data); // Upload vertex data to GPU + rlglLoadMesh(&data); // Upload vertex data to GPU - // NOTE: Vertex data is managed externally, must be deallocated manually + model.transform = MatrixIdentity(); + model.material = LoadDefaultMaterial(); return model; } @@ -582,8 +579,14 @@ Model LoadModelEx(Mesh data) // NOTE: model map size is defined in generic units Model LoadHeightmap(Image heightmap, Vector3 size) { - Mesh mesh = GenMeshHeightmap(heightmap, size); - Model model = rlglLoadModel(mesh); + Model model = { 0 }; + + model.mesh = GenMeshHeightmap(heightmap, size); + + rlglLoadMesh(&model.mesh); + + model.transform = MatrixIdentity(); + model.material = LoadDefaultMaterial(); return model; } @@ -591,8 +594,14 @@ Model LoadHeightmap(Image heightmap, Vector3 size) // Load a map image as a 3d model (cubes based) Model LoadCubicmap(Image cubicmap) { - Mesh mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0, 1.0, 1.5f }); - Model model = rlglLoadModel(mesh); + Model model = { 0 }; + + model.mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0, 1.0, 1.5f }); + + rlglLoadMesh(&model.mesh); + + model.transform = MatrixIdentity(); + model.material = LoadDefaultMaterial(); return model; } @@ -613,13 +622,44 @@ void UnloadModel(Model model) rlDeleteBuffers(model.mesh.vboId[0]); // vertex rlDeleteBuffers(model.mesh.vboId[1]); // texcoords rlDeleteBuffers(model.mesh.vboId[2]); // normals - //rlDeleteBuffers(model.mesh.vboId[3]); // texcoords2 (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[3]); // colors (NOT USED) //rlDeleteBuffers(model.mesh.vboId[4]); // tangents (NOT USED) - //rlDeleteBuffers(model.mesh.vboId[5]); // colors (NOT USED) + //rlDeleteBuffers(model.mesh.vboId[5]); // texcoords2 (NOT USED) rlDeleteVertexArrays(model.mesh.vaoId); } +// Load material data (from file) +Material LoadMaterial(const char *fileName) +{ + Material material = { 0 }; + + if (strcmp(GetExtension(fileName),"mtl") == 0) material = LoadMTL(fileName); + else TraceLog(WARNING, "[%s] Material extension not recognized, it can't be loaded", fileName); + + return material; +} + +// Load default material (uses default models shader) +Material LoadDefaultMaterial(void) +{ + Material material = { 0 }; + + material.shader = GetDefaultShader(); + material.texDiffuse = GetDefaultTexture(); // White texture (1x1 pixel) + //material.texNormal; // NOTE: By default, not set + //material.texSpecular; // NOTE: By default, not set + + material.colDiffuse = WHITE; // Diffuse color + material.colAmbient = WHITE; // Ambient color + material.colSpecular = WHITE; // Specular color + + material.glossiness = 100.0f; // Glossiness level + material.normalDepth = 1.0f; // Normal map depth + + return material; +} + // Link a texture to a model void SetModelTexture(Model *model, Texture2D texture) { @@ -1100,31 +1140,59 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint) { Vector3 vScale = { scale, scale, scale }; Vector3 rotationAxis = { 0.0f, 0.0f, 0.0f }; - + DrawModelEx(model, position, rotationAxis, 0.0f, vScale, tint); } // Draw a model with extended parameters void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { - // NOTE: Rotation must be provided in degrees, it's converted to radians inside rlglDrawModel() - rlglDrawModel(model, position, rotationAxis, rotationAngle, scale, tint, false); + // Calculate transformation matrix from function parameters + // Get transform matrix (rotation -> scale -> translation) + Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); + Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); + Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); + + // Combine model transformation matrix (model.transform) with matrix generated by function parameters (matTransform) + //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates + + model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); + model.material.colDiffuse = tint; + + rlglDrawEx(model.mesh, model.material, model.transform, false); } // Draw a model wires (with texture if set) -void DrawModelWires(Model model, Vector3 position, float scale, Color color) +void DrawModelWires(Model model, Vector3 position, float scale, Color tint) { Vector3 vScale = { scale, scale, scale }; Vector3 rotationAxis = { 0.0f, 0.0f, 0.0f }; - rlglDrawModel(model, position, rotationAxis, 0.0f, vScale, color, true); + // Calculate transformation matrix from function parameters + // Get transform matrix (rotation -> scale -> translation) + Matrix matRotation = MatrixRotate(rotationAxis, 0.0f); + Matrix matScale = MatrixScale(vScale.x, vScale.y, vScale.z); + Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); + + model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); + model.material.colDiffuse = tint; + + rlglDrawEx(model.mesh, model.material, model.transform, true); } // Draw a model wires (with texture if set) with extended parameters void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { - // NOTE: Rotation must be provided in degrees, it's converted to radians inside rlglDrawModel() - rlglDrawModel(model, position, rotationAxis, rotationAngle, scale, tint, true); + // Calculate transformation matrix from function parameters + // Get transform matrix (rotation -> scale -> translation) + Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); + Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); + Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); + + model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); + model.material.colDiffuse = tint; + + rlglDrawEx(model.mesh, model.material, model.transform, true); } // Draw a billboard @@ -1856,3 +1924,39 @@ static Mesh LoadOBJ(const char *fileName) return mesh; } + +// Load MTL material data +static Material LoadMTL(const char *fileName) +{ + Material material = { 0 }; + + // TODO: Load mtl file + + char dataType; + char comments[200]; + + FILE *mtlFile; + + mtlFile = fopen(fileName, "rt"); + + if (mtlFile == NULL) + { + TraceLog(WARNING, "[%s] MTL file could not be opened", fileName); + return material; + } + + // First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles + // NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition) + // NOTE: faces MUST be defined as TRIANGLES (3 vertex per face) + while(!feof(mtlFile)) + { + fscanf(mtlFile, "%c", &dataType); + } + + fclose(mtlFile); + + // NOTE: At this point we have all material data + TraceLog(INFO, "[%s] Material loaded successfully", fileName); + + return material; +} diff --git a/src/raylib.h b/src/raylib.h index 8af7d2fb..c88a60f4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -387,10 +387,10 @@ typedef struct Shader { unsigned int id; // Shader program id // Variable attributes locations - int vertexLoc; // Vertex attribute location point (vertex shader) - int texcoordLoc; // Texcoord attribute location point (vertex shader) - int normalLoc; // Normal attribute location point (vertex shader) - int colorLoc; // Color attibute location point (vertex shader) + int vertexLoc; // Vertex attribute location point (default-location = 0) + int texcoordLoc; // Texcoord attribute location point (default-location = 1) + int normalLoc; // Normal attribute location point (default-location = 2) + int colorLoc; // Color attibute location point (default-location = 3) // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) @@ -801,17 +801,20 @@ void DrawGizmo(Vector3 position); //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ -Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) -Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data) -//Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource) -Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model -Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) -void UnloadModel(Model model); // Unload 3d model from memory -void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model +Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) +Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data) +//Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource) +Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model +Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) +void UnloadModel(Model model); // Unload 3d model from memory +void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model + +Material LoadMaterial(const char *fileName); // Load material data (from file) +Material LoadDefaultMaterial(void); // Load default material (uses default models shader) void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set) +void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) @@ -832,11 +835,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations -unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shaders strings and return program id void UnloadShader(Shader shader); // Unload a custom shader from memory void SetDefaultShader(void); // Set default shader to be used in batch draw void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw -void SetModelShader(Model *model, Shader shader); // Link a shader to a model +Shader GetDefaultShader(void); // Get default shader +Texture2D GetDefaultTexture(void); // Get default texture int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) diff --git a/src/rlgl.c b/src/rlgl.c index 9112e47e..02649e30 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -255,14 +255,16 @@ unsigned int whiteTexture; //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat); +static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shader strings and return program id -static Shader LoadDefaultShader(void); -static void LoadDefaultShaderLocations(Shader *shader); -static void UnloadDefaultShader(void); +static Shader LoadDefaultShader(void); // Load default shader (just vertex positioning and texture coloring) +static void LoadDefaultShaderLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) +static void UnloadDefaultShader(void); // Unload default shader -static void LoadDefaultBuffers(void); -static void UpdateDefaultBuffers(void); -static void UnloadDefaultBuffers(void); +static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) +static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data +static void DrawDefaultBuffers(void); // Draw default internal buffers vertex data +static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU static char *ReadTextFile(const char *fileName); #endif @@ -1061,167 +1063,12 @@ void rlglDraw(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) UpdateDefaultBuffers(); - - if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) - { - glUseProgram(currentShader.id); - - Matrix matMVP = MatrixMultiply(modelview, projection); // Create modelview-projection matrix - - glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - glUniform1i(currentShader.mapDiffuseLoc, 0); - glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); - } - - // NOTE: We draw in this order: lines, triangles, quads - - if (lines.vCounter > 0) - { - glBindTexture(GL_TEXTURE_2D, whiteTexture); - - if (vaoSupported) - { - glBindVertexArray(vaoLines); - } - else - { - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - if (currentShader.colorLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); - } - } - - glDrawArrays(GL_LINES, 0, lines.vCounter); - - if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindTexture(GL_TEXTURE_2D, 0); - } - - if (triangles.vCounter > 0) - { - glBindTexture(GL_TEXTURE_2D, whiteTexture); - - if (vaoSupported) - { - glBindVertexArray(vaoTriangles); - } - else - { - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - if (currentShader.colorLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); - } - } - - glDrawArrays(GL_TRIANGLES, 0, triangles.vCounter); - - if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindTexture(GL_TEXTURE_2D, 0); - } - - if (quads.vCounter > 0) - { - int quadsCount = 0; - int numIndicesToProcess = 0; - int indicesOffset = 0; - - if (vaoSupported) - { - glBindVertexArray(vaoQuads); - } - else - { - // Enable vertex attributes - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); - glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.texcoordLoc); - - if (currentShader.colorLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); - } - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); - } - - //TraceLog(DEBUG, "Draws required per frame: %i", drawsCounter); - - for (int i = 0; i < drawsCounter; i++) - { - quadsCount = draws[i].vertexCount/4; - numIndicesToProcess = quadsCount*6; // Get number of Quads * 6 index by Quad - - //TraceLog(DEBUG, "Quads to render: %i - Vertex Count: %i", quadsCount, draws[i].vertexCount); - - glBindTexture(GL_TEXTURE_2D, draws[i].textureId); - - // NOTE: The final parameter tells the GPU the offset in bytes from the start of the index buffer to the location of the first index to process -#if defined(GRAPHICS_API_OPENGL_33) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid*) (sizeof(GLuint) * indicesOffset)); -#elif defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid*) (sizeof(GLushort) * indicesOffset)); -#endif - //GLenum err; - //if ((err = glGetError()) != GL_NO_ERROR) TraceLog(INFO, "OpenGL error: %i", (int)err); //GL_INVALID_ENUM! - - indicesOffset += draws[i].vertexCount/4*6; - } - - if (!vaoSupported) - { - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } - - glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures - } - - if (vaoSupported) glBindVertexArray(0); // Unbind VAO - - glUseProgram(0); // Unbind shader program - - // Reset draws counter - drawsCounter = 1; - draws[0].textureId = whiteTexture; - draws[0].vertexCount = 0; - - // Reset vertex counters for next frame - lines.vCounter = 0; - lines.cCounter = 0; - - triangles.vCounter = 0; - triangles.cCounter = 0; - - quads.vCounter = 0; - quads.tcCounter = 0; - quads.cCounter = 0; - - // Reset depth for next draw - currentDepth = -1.0f; + DrawDefaultBuffers(); #endif } -// Draw a 3d model -// NOTE: Model transform can come within model struct -void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color, bool wires) +// Draw a 3d mesh with material and transform +void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) { #if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) // NOTE: glPolygonMode() not available on OpenGL ES @@ -1230,27 +1077,21 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro #if defined(GRAPHICS_API_OPENGL_11) glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, model.material.texDiffuse.id); + glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array - glVertexPointer(3, GL_FLOAT, 0, model.mesh.vertices); // Pointer to vertex coords array - glTexCoordPointer(2, GL_FLOAT, 0, model.mesh.texcoords); // Pointer to texture coords array - glNormalPointer(GL_FLOAT, 0, model.mesh.normals); // Pointer to normals array - //glColorPointer(4, GL_UNSIGNED_BYTE, 0, model.mesh.colors); // Pointer to colors array (NOT USED) + glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array + glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array + glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array + //glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array (NOT USED) - rlPushMatrix(); - rlTranslatef(position.x, position.y, position.z); - rlScalef(scale.x, scale.y, scale.z); - rlRotatef(rotationAngle, rotationAxis.x, rotationAxis.y, rotationAxis.z); - - rlColor4ub(color.r, color.g, color.b, color.a); - - glDrawArrays(GL_TRIANGLES, 0, model.mesh.vertexCount); - rlPopMatrix(); + rlMultMatrixf(MatrixToFloat(transform)); + + glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array @@ -1261,97 +1102,83 @@ void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float ro #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(model.material.shader.id); + glUseProgram(material.shader.id); // At this point the modelview matrix just contains the view matrix (camera) // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() Matrix matView = modelview; // View matrix (camera) Matrix matProjection = projection; // Projection matrix (perspective) - - // Calculate transformation matrix from function parameters - // Get transform matrix (rotation -> scale -> translation) - Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); - Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); - Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); - Matrix matTransform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - - // Combine model internal transformation matrix (model.transform) with matrix generated by function parameters (matTransform) - Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates - + // Calculate model-view matrix combining matModel and matView - Matrix matModelView = MatrixMultiply(matModel, matView); // Transform to camera-space coordinates + Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates // Calculate model-view-projection matrix (MVP) Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates // Send combined model-view-projection matrix to shader - glUniformMatrix4fv(model.material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - // Apply color tinting to model + // Apply color tinting (material.colDiffuse) // NOTE: Just update one uniform on fragment shader - float vColor[4] = { (float)color.r/255, (float)color.g/255, (float)color.b/255, (float)color.a/255 }; - glUniform4fv(model.material.shader.tintColorLoc, 1, vColor); + float vColor[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; + glUniform4fv(material.shader.tintColorLoc, 1, vColor); // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, model.material.texDiffuse.id); - glUniform1i(model.material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 + glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); + glUniform1i(material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 - if ((model.material.texNormal.id != 0) && (model.material.shader.mapNormalLoc != -1)) + if ((material.texNormal.id != 0) && (material.shader.mapNormalLoc != -1)) { glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, model.material.texNormal.id); - glUniform1i(model.material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 + glBindTexture(GL_TEXTURE_2D, material.texNormal.id); + glUniform1i(material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 } - if ((model.material.texSpecular.id != 0) && (model.material.shader.mapSpecularLoc != -1)) + if ((material.texSpecular.id != 0) && (material.shader.mapSpecularLoc != -1)) { glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, model.material.texSpecular.id); - glUniform1i(model.material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 + glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); + glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 } if (vaoSupported) { - glBindVertexArray(model.mesh.vaoId); + glBindVertexArray(mesh.vaoId); } else { - // Bind model VBO data: vertex position - glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[0]); - glVertexAttribPointer(model.material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.vertexLoc); + // Bind mesh VBO data: vertex position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + glVertexAttribPointer(material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.vertexLoc); - // Bind model VBO data: vertex texcoords - glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[1]); - glVertexAttribPointer(model.material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.texcoordLoc); + // Bind mesh VBO data: vertex texcoords (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); + glVertexAttribPointer(material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.texcoordLoc); - // Bind model VBO data: vertex normals (if available) - if (model.material.shader.normalLoc != -1) + // Bind mesh VBO data: vertex normals (shader-location = 2, if available) + if (material.shader.normalLoc != -1) { - glBindBuffer(GL_ARRAY_BUFFER, model.mesh.vboId[2]); - glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.normalLoc); + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); + glVertexAttribPointer(material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.normalLoc); } - // TODO: Bind model VBO data: colors, tangents, texcoords2 (if available) + // TODO: Bind mesh VBO data: colors, tangents, texcoords2 (if available) } // Draw call! - glDrawArrays(GL_TRIANGLES, 0, model.mesh.vertexCount); - - //glDisableVertexAttribArray(model.shader.vertexLoc); - //glDisableVertexAttribArray(model.shader.texcoordLoc); - //if (model.shader.normalLoc != -1) glDisableVertexAttribArray(model.shader.normalLoc); + glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); - if (model.material.texNormal.id != 0) + if (material.texNormal.id != 0) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, 0); } - if (model.material.texSpecular.id != 0) + if (material.texSpecular.id != 0) { glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, 0); @@ -1808,95 +1635,75 @@ void rlglGenerateMipmaps(Texture2D texture) glBindTexture(GL_TEXTURE_2D, 0); } -// Load vertex data into a VAO (if supported) and VBO -Model rlglLoadModel(Mesh mesh) +// Upload vertex data into a VAO (if supported) and VBO +void rlglLoadMesh(Mesh *mesh) { - Model model; - - model.mesh = mesh; - model.mesh.vaoId = 0; // Vertex Array Object - model.mesh.vboId[0] = 0; // Vertex positions VBO - model.mesh.vboId[1] = 0; // Vertex texcoords VBO - model.mesh.vboId[2] = 0; // Vertex normals VBO + mesh->vaoId = 0; // Vertex Array Object + mesh->vboId[0] = 0; // Vertex positions VBO + mesh->vboId[1] = 0; // Vertex texcoords VBO + mesh->vboId[2] = 0; // Vertex normals VBO + mesh->vboId[3] = 0; // Vertex color VBO + mesh->vboId[4] = 0; // Vertex tangent VBO + mesh->vboId[5] = 0; // Vertex texcoord2 VBO // TODO: Consider attributes: color, texcoords2, tangents (if available) - model.transform = MatrixIdentity(); - -#if defined(GRAPHICS_API_OPENGL_11) - model.material.texDiffuse.id = 0; // No texture required - model.material.shader.id = 0; // No shader used - -#elif defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - model.material.shader = defaultShader; // Default model shader - - model.material.texDiffuse.id = whiteTexture; // Default whiteTexture - model.material.texDiffuse.width = 1; // Default whiteTexture width - model.material.texDiffuse.height = 1; // Default whiteTexture height - model.material.texDiffuse.format = UNCOMPRESSED_R8G8B8A8; // Default whiteTexture format - - model.material.texNormal.id = 0; // By default, no normal texture - model.material.texSpecular.id = 0; // By default, no specular texture - - // TODO: Fill default material properties (color, glossiness...) - - GLuint vaoModel = 0; // Vertex Array Objects (VAO) - GLuint vertexBuffer[3]; // Vertex Buffer Objects (VBO) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + GLuint vaoId = 0; // Vertex Array Objects (VAO) + GLuint vboId[3]; // Vertex Buffer Objects (VBOs) if (vaoSupported) { // Initialize Quads VAO (Buffer A) - glGenVertexArrays(1, &vaoModel); - glBindVertexArray(vaoModel); + glGenVertexArrays(1, &vaoId); + glBindVertexArray(vaoId); } // Create buffers for our vertex data (positions, texcoords, normals) - glGenBuffers(3, vertexBuffer); - - // NOTE: Default shader is assigned to model, so vbo buffers are properly linked to vertex attribs - // If model shader is changed, vbo buffers must be re-assigned to new location points (previously loaded) - - // Enable vertex attributes: position - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh.vertexCount, mesh.vertices, GL_STATIC_DRAW); - glVertexAttribPointer(model.material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.vertexLoc); - - // Enable vertex attributes: texcoords - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[1]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh.vertexCount, mesh.texcoords, GL_STATIC_DRAW); - glVertexAttribPointer(model.material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.texcoordLoc); - - // Enable vertex attributes: normals - glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh.vertexCount, mesh.normals, GL_STATIC_DRAW); - glVertexAttribPointer(model.material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(model.material.shader.normalLoc); - - glVertexAttrib4f(model.material.shader.colorLoc, 1.0f, 1.0f, 1.0f, 1.0f); // Color vertex attribute set to default: WHITE - glDisableVertexAttribArray(model.material.shader.colorLoc); + glGenBuffers(3, vboId); + + // NOTE: Attributes must be uploaded considering default locations points + + // Enable vertex attributes: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, vboId[0]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->vertices, GL_STATIC_DRAW); + glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(0); + + // Enable vertex attributes: texcoords (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, vboId[1]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords, GL_STATIC_DRAW); + glVertexAttribPointer(1, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(1); + + // Enable vertex attributes: normals (shader-location = 2) + glBindBuffer(GL_ARRAY_BUFFER, vboId[2]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->normals, GL_STATIC_DRAW); + glVertexAttribPointer(2, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(2); + + // Default color vertex attribute (shader-location = 3) + glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); // Color vertex attribute set to default: WHITE + glDisableVertexAttribArray(3); - model.mesh.vboId[0] = vertexBuffer[0]; // Vertex position VBO - model.mesh.vboId[1] = vertexBuffer[1]; // Texcoords VBO - model.mesh.vboId[2] = vertexBuffer[2]; // Normals VBO + mesh->vboId[0] = vboId[0]; // Vertex position VBO + mesh->vboId[1] = vboId[1]; // Texcoords VBO + mesh->vboId[2] = vboId[2]; // Normals VBO if (vaoSupported) { - if (vaoModel > 0) + if (vaoId > 0) { - model.mesh.vaoId = vaoModel; - TraceLog(INFO, "[VAO ID %i] Model uploaded successfully to VRAM (GPU)", vaoModel); + mesh->vaoId = vaoId; + TraceLog(INFO, "[VAO ID %i] Mesh uploaded successfully to VRAM (GPU)", mesh->vaoId); } - else TraceLog(WARNING, "Model could not be uploaded to VRAM (GPU)"); + else TraceLog(WARNING, "Mesh could not be uploaded to VRAM (GPU)"); } else { - TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Model uploaded successfully to VRAM (GPU)", model.mesh.vboId[0], model.mesh.vboId[1], model.mesh.vboId[2]); + TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Mesh uploaded successfully to VRAM (GPU)", mesh->vboId[0], mesh->vboId[1], mesh->vboId[2]); } #endif - - return model; } // Read screen pixel data (color buffer) @@ -2090,36 +1897,202 @@ Shader LoadShader(char *vsFileName, char *fsFileName) return shader; } -// Load custom shader strings and return program id -unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) +// Unload a custom shader from memory +void UnloadShader(Shader shader) +{ + if (shader.id != 0) + { + rlDeleteShader(shader.id); + TraceLog(INFO, "[SHDR ID %i] Unloaded shader program data", shader.id); + } +} + +// Set custom shader to be used on batch draw +void SetCustomShader(Shader shader) { - unsigned int program = 0; - #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - GLuint vertexShader; - GLuint fragmentShader; + if (currentShader.id != shader.id) + { + rlglDraw(); + currentShader = shader; + } +#endif +} - vertexShader = glCreateShader(GL_VERTEX_SHADER); - fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); +// Set default shader to be used in batch draw +void SetDefaultShader(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + SetCustomShader(defaultShader); +#endif +} - const char *pvs = vShaderStr; - const char *pfs = fShaderStr; +// Get default shader +Shader GetDefaultShader(void) +{ + return defaultShader; +} - glShaderSource(vertexShader, 1, &pvs, NULL); - glShaderSource(fragmentShader, 1, &pfs, NULL); +// Get shader uniform location +int GetShaderLocation(Shader shader, const char *uniformName) +{ + int location = -1; +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + location = glGetUniformLocation(shader.id, uniformName); + + if (location == -1) TraceLog(WARNING, "[SHDR ID %i] Shader location for %s could not be found", shader.id, uniformName); +#endif + return location; +} - GLint success = 0; +// Set shader uniform value (float) +void SetShaderValue(Shader shader, int uniformLoc, float *value, int size) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glUseProgram(shader.id); - glCompileShader(vertexShader); + if (size == 1) glUniform1fv(uniformLoc, 1, value); // Shader uniform type: float + else if (size == 2) glUniform2fv(uniformLoc, 1, value); // Shader uniform type: vec2 + else if (size == 3) glUniform3fv(uniformLoc, 1, value); // Shader uniform type: vec3 + else if (size == 4) glUniform4fv(uniformLoc, 1, value); // Shader uniform type: vec4 + else TraceLog(WARNING, "Shader value float array size not supported"); + + glUseProgram(0); +#endif +} - glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success); +// Set shader uniform value (int) +void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glUseProgram(shader.id); - if (success != GL_TRUE) - { - TraceLog(WARNING, "[VSHDR ID %i] Failed to compile vertex shader...", vertexShader); + if (size == 1) glUniform1iv(uniformLoc, 1, value); // Shader uniform type: int + else if (size == 2) glUniform2iv(uniformLoc, 1, value); // Shader uniform type: ivec2 + else if (size == 3) glUniform3iv(uniformLoc, 1, value); // Shader uniform type: ivec3 + else if (size == 4) glUniform4iv(uniformLoc, 1, value); // Shader uniform type: ivec4 + else TraceLog(WARNING, "Shader value int array size not supported"); + + glUseProgram(0); +#endif +} - int maxLength = 0; - int length; +// Set shader uniform value (matrix 4x4) +void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glUseProgram(shader.id); + + glUniformMatrix4fv(uniformLoc, 1, false, MatrixToFloat(mat)); + + glUseProgram(0); +#endif +} + +// Set blending mode (alpha, additive, multiplied) +// NOTE: Only 3 blending modes predefined +void SetBlendMode(int mode) +{ + if ((blendMode != mode) && (mode < 3)) + { + rlglDraw(); + + switch (mode) + { + case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); break; + case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); break; // Alternative: glBlendFunc(GL_ONE, GL_ONE); + case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); break; + default: break; + } + + blendMode = mode; + } +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +// Convert image data to OpenGL texture (returns OpenGL valid Id) +// NOTE: Expected compressed image data and POT image +static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat) +{ + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + int blockSize = 0; // Bytes every block + int offset = 0; + + if ((compressedFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT) || + (compressedFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) || +#if defined(GRAPHICS_API_OPENGL_ES2) + (compressedFormat == GL_ETC1_RGB8_OES) || +#endif + (compressedFormat == GL_COMPRESSED_RGB8_ETC2)) blockSize = 8; + else blockSize = 16; + + // Load the mipmap levels + for (int level = 0; level < mipmapCount && (width || height); level++) + { + unsigned int size = 0; + + size = ((width + 3)/4)*((height + 3)/4)*blockSize; + + glCompressedTexImage2D(GL_TEXTURE_2D, level, compressedFormat, width, height, 0, size, data + offset); + + offset += size; + width /= 2; + height /= 2; + + // Security check for NPOT textures + if (width < 1) width = 1; + if (height < 1) height = 1; + } +} + +Texture2D GetDefaultTexture(void) +{ + Texture2D texture; + + texture.id = whiteTexture; + texture.width = 1; + texture.height = 1; + texture.mipmaps = 1; + texture.format = UNCOMPRESSED_R8G8B8A8; + + return texture; +} + +// Load custom shader strings and return program id +static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) +{ + unsigned int program = 0; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + GLuint vertexShader; + GLuint fragmentShader; + + vertexShader = glCreateShader(GL_VERTEX_SHADER); + fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); + + const char *pvs = vShaderStr; + const char *pfs = fShaderStr; + + glShaderSource(vertexShader, 1, &pvs, NULL); + glShaderSource(fragmentShader, 1, &pfs, NULL); + + GLint success = 0; + + glCompileShader(vertexShader); + + glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success); + + if (success != GL_TRUE) + { + TraceLog(WARNING, "[VSHDR ID %i] Failed to compile vertex shader...", vertexShader); + + int maxLength = 0; + int length; glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &maxLength); @@ -2156,7 +2129,17 @@ unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) glAttachShader(program, vertexShader); glAttachShader(program, fragmentShader); - + + // NOTE: Default attribute shader locations must be binded before linking + glBindAttribLocation(program, 0, "vertexPosition"); + glBindAttribLocation(program, 1, "vertexTexCoord"); + glBindAttribLocation(program, 2, "vertexNormal"); + glBindAttribLocation(program, 3, "vertexColor"); + glBindAttribLocation(program, 4, "vertexTangent"); + glBindAttribLocation(program, 5, "vertexTexCoord2"); + + // NOTE: If some attrib name is no found on the shader, it locations becomes -1 + glLinkProgram(program); // NOTE: All uniform variables are intitialised to 0 when a program links @@ -2190,184 +2173,8 @@ unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) return program; } -// Unload a custom shader from memory -void UnloadShader(Shader shader) -{ - if (shader.id != 0) - { - rlDeleteShader(shader.id); - TraceLog(INFO, "[SHDR ID %i] Unloaded shader program data", shader.id); - } -} - -// Set custom shader to be used on batch draw -void SetCustomShader(Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (currentShader.id != shader.id) - { - rlglDraw(); - currentShader = shader; - } -#endif -} - -// Set default shader to be used in batch draw -void SetDefaultShader(void) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - SetCustomShader(defaultShader); -#endif -} - -// Link shader to model -void SetModelShader(Model *model, Shader shader) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - model->material.shader = shader; - - if (vaoSupported) glBindVertexArray(model->mesh.vaoId); - - // Enable vertex attributes: position - glBindBuffer(GL_ARRAY_BUFFER, model->mesh.vboId[0]); - glEnableVertexAttribArray(shader.vertexLoc); - glVertexAttribPointer(shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - - // Enable vertex attributes: texcoords - glBindBuffer(GL_ARRAY_BUFFER, model->mesh.vboId[1]); - glEnableVertexAttribArray(shader.texcoordLoc); - glVertexAttribPointer(shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - - // Enable vertex attributes: normals - glBindBuffer(GL_ARRAY_BUFFER, model->mesh.vboId[2]); - glEnableVertexAttribArray(shader.normalLoc); - glVertexAttribPointer(shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - - if (vaoSupported) glBindVertexArray(0); // Unbind VAO - -#elif (GRAPHICS_API_OPENGL_11) - TraceLog(WARNING, "Shaders not supported on OpenGL 1.1"); -#endif -} - -// Get shader uniform location -int GetShaderLocation(Shader shader, const char *uniformName) -{ - int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - location = glGetUniformLocation(shader.id, uniformName); - - if (location == -1) TraceLog(WARNING, "[SHDR ID %i] Shader location for %s could not be found", shader.id, uniformName); -#endif - return location; -} - -// Set shader uniform value (float) -void SetShaderValue(Shader shader, int uniformLoc, float *value, int size) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - if (size == 1) glUniform1fv(uniformLoc, 1, value); // Shader uniform type: float - else if (size == 2) glUniform2fv(uniformLoc, 1, value); // Shader uniform type: vec2 - else if (size == 3) glUniform3fv(uniformLoc, 1, value); // Shader uniform type: vec3 - else if (size == 4) glUniform4fv(uniformLoc, 1, value); // Shader uniform type: vec4 - else TraceLog(WARNING, "Shader value float array size not supported"); - - glUseProgram(0); -#endif -} - -// Set shader uniform value (int) -void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - if (size == 1) glUniform1iv(uniformLoc, 1, value); // Shader uniform type: int - else if (size == 2) glUniform2iv(uniformLoc, 1, value); // Shader uniform type: ivec2 - else if (size == 3) glUniform3iv(uniformLoc, 1, value); // Shader uniform type: ivec3 - else if (size == 4) glUniform4iv(uniformLoc, 1, value); // Shader uniform type: ivec4 - else TraceLog(WARNING, "Shader value int array size not supported"); - - glUseProgram(0); -#endif -} - -// Set shader uniform value (matrix 4x4) -void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) -{ -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(shader.id); - - glUniformMatrix4fv(uniformLoc, 1, false, MatrixToFloat(mat)); - - glUseProgram(0); -#endif -} - -// Set blending mode (alpha, additive, multiplied) -// NOTE: Only 3 blending modes predefined -void SetBlendMode(int mode) -{ - if ((blendMode != mode) && (mode < 3)) - { - rlglDraw(); - - switch (mode) - { - case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); break; - case BLEND_ADDITIVE: glBlendFunc(GL_SRC_ALPHA, GL_ONE); break; // Alternative: glBlendFunc(GL_ONE, GL_ONE); - case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); break; - default: break; - } - - blendMode = mode; - } -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -// Convert image data to OpenGL texture (returns OpenGL valid Id) -// NOTE: Expected compressed image data and POT image -static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat) -{ - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - int blockSize = 0; // Bytes every block - int offset = 0; - - if ((compressedFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT) || - (compressedFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) || -#if defined(GRAPHICS_API_OPENGL_ES2) - (compressedFormat == GL_ETC1_RGB8_OES) || -#endif - (compressedFormat == GL_COMPRESSED_RGB8_ETC2)) blockSize = 8; - else blockSize = 16; - - // Load the mipmap levels - for (int level = 0; level < mipmapCount && (width || height); level++) - { - unsigned int size = 0; - - size = ((width + 3)/4)*((height + 3)/4)*blockSize; - - glCompressedTexImage2D(GL_TEXTURE_2D, level, compressedFormat, width, height, 0, size, data + offset); - offset += size; - width /= 2; - height /= 2; - - // Security check for NPOT textures - if (width < 1) width = 1; - if (height < 1) height = 1; - } -} - -// Load default shader (Vertex and Fragment) +// Load default shader (just vertex positioning and texture coloring) // NOTE: This shader program is used for batch buffers (lines, triangles, quads) static Shader LoadDefaultShader(void) { @@ -2436,6 +2243,12 @@ static Shader LoadDefaultShader(void) // NOTE: If any location is not found, loc point becomes -1 static void LoadDefaultShaderLocations(Shader *shader) { + // NOTE: Default shader attrib locations have been fixed before linking: + // vertex position location = 0 + // vertex texcoord location = 1 + // vertex normal location = 2 + // vertex color location = 3 + // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); shader->texcoordLoc = glGetAttribLocation(shader->id, "vertexTexCoord"); @@ -2470,7 +2283,7 @@ static void LoadDefaultBuffers(void) // [CPU] Allocate and initialize float array buffers to store vertex data (lines, triangles, quads) //-------------------------------------------------------------------------------------------- - // Initialize lines arrays (vertex position and color data) + // Lines - Initialize arrays (vertex position and color data) lines.vertices = (float *)malloc(sizeof(float)*3*2*MAX_LINES_BATCH); // 3 float by vertex, 2 vertex by line lines.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*2*MAX_LINES_BATCH); // 4 float by color, 2 colors by line @@ -2480,7 +2293,7 @@ static void LoadDefaultBuffers(void) lines.vCounter = 0; lines.cCounter = 0; - // Initialize triangles arrays (vertex position and color data) + // Triangles - Initialize arrays (vertex position and color data) triangles.vertices = (float *)malloc(sizeof(float)*3*3*MAX_TRIANGLES_BATCH); // 3 float by vertex, 3 vertex by triangle triangles.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*3*MAX_TRIANGLES_BATCH); // 4 float by color, 3 colors by triangle @@ -2490,7 +2303,7 @@ static void LoadDefaultBuffers(void) triangles.vCounter = 0; triangles.cCounter = 0; - // Initialize quads arrays (vertex position, texcoord and color data... and indexes) + // Quads - Initialize arrays (vertex position, texcoord, color data and indexes) quads.vertices = (float *)malloc(sizeof(float)*3*4*MAX_QUADS_BATCH); // 3 float by vertex, 4 vertex by quad quads.texcoords = (float *)malloc(sizeof(float)*2*4*MAX_QUADS_BATCH); // 2 float by texcoord, 4 texcoord by quad quads.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*4*MAX_QUADS_BATCH); // 4 float by color, 4 colors by quad @@ -2523,7 +2336,7 @@ static void LoadDefaultBuffers(void) quads.tcCounter = 0; quads.cCounter = 0; - TraceLog(INFO, "Default buffers initialized successfully in CPU (lines, triangles, quads)"); + TraceLog(INFO, "[CPU] Default buffers initialized successfully (lines, triangles, quads)"); //-------------------------------------------------------------------------------------------- // [GPU] Upload vertex data and initialize VAOs/VBOs (lines, triangles, quads) @@ -2541,20 +2354,21 @@ static void LoadDefaultBuffers(void) // Create buffers for our vertex data glGenBuffers(2, linesBuffer); - // Lines - Vertex positions buffer binding and attributes enable + // Lines - Vertex buffers binding and attributes enable + // Vertex position buffer (shader-location = 0) glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*2*MAX_LINES_BATCH, lines.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - // Lines - colors buffer + // Vertex color buffer (shader-location = 3) glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*2*MAX_LINES_BATCH, lines.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (lines) VAO initialized successfully", vaoLines); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers (lines) VBOs initialized successfully", linesBuffer[0], linesBuffer[1]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (lines)", vaoLines); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (lines)", linesBuffer[0], linesBuffer[1]); // Upload and link triangles vertex buffers if (vaoSupported) @@ -2567,19 +2381,21 @@ static void LoadDefaultBuffers(void) // Create buffers for our vertex data glGenBuffers(2, trianglesBuffer); - // Enable vertex attributes + // Triangles - Vertex buffers binding and attributes enable + // Vertex position buffer (shader-location = 0) glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*3*MAX_TRIANGLES_BATCH, triangles.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + // Vertex color buffer (shader-location = 3) glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*3*MAX_TRIANGLES_BATCH, triangles.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (triangles) VAO initialized successfully", vaoTriangles); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers (triangles) VBOs initialized successfully", trianglesBuffer[0], trianglesBuffer[1]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (triangles)", vaoTriangles); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully(triangles)", trianglesBuffer[0], trianglesBuffer[1]); // Upload and link quads vertex buffers if (vaoSupported) @@ -2592,17 +2408,20 @@ static void LoadDefaultBuffers(void) // Create buffers for our vertex data glGenBuffers(4, quadsBuffer); - // Enable vertex attributes + // Quads - Vertex buffers binding and attributes enable + // Vertex position buffer (shader-location = 0) glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*MAX_QUADS_BATCH, quads.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + // Vertex texcoord buffer (shader-location = 1) glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*MAX_QUADS_BATCH, quads.texcoords, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.texcoordLoc); glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + // Vertex color buffer (shader-location = 3) glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*4*MAX_QUADS_BATCH, quads.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); @@ -2616,15 +2435,15 @@ static void LoadDefaultBuffers(void) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(short)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW); #endif - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers (quads) VAO initialized successfully", vaoQuads); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Default buffers (quads) VBOs initialized successfully", quadsBuffer[0], quadsBuffer[1], quadsBuffer[2], quadsBuffer[3]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (quads)", vaoQuads); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (quads)", quadsBuffer[0], quadsBuffer[1], quadsBuffer[2], quadsBuffer[3]); // Unbind the current VAO if (vaoSupported) glBindVertexArray(0); //-------------------------------------------------------------------------------------------- } -// Update default buffers (VAOs/VBOs) with vertex array data +// Update default internal buffers (VAOs/VBOs) with vertex array data // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) static void UpdateDefaultBuffers(void) @@ -2695,7 +2514,165 @@ static void UpdateDefaultBuffers(void) if (vaoSupported) glBindVertexArray(0); } -// Unload default buffers vertex data from CPU and GPU +// Draw default internal buffers vertex data +// NOTE: We draw in this order: lines, triangles, quads +static void DrawDefaultBuffers(void) +{ + // Set current shader and upload current MVP matrix + if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) + { + glUseProgram(currentShader.id); + + // Create modelview-projection matrix + Matrix matMVP = MatrixMultiply(modelview, projection); + + glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + glUniform1i(currentShader.mapDiffuseLoc, 0); + glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); + } + + // Draw lines buffers + if (lines.vCounter > 0) + { + glBindTexture(GL_TEXTURE_2D, whiteTexture); + + if (vaoSupported) + { + glBindVertexArray(vaoLines); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + } + + glDrawArrays(GL_LINES, 0, lines.vCounter); + + if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindTexture(GL_TEXTURE_2D, 0); + } + + // Draw triangles buffers + if (triangles.vCounter > 0) + { + glBindTexture(GL_TEXTURE_2D, whiteTexture); + + if (vaoSupported) + { + glBindVertexArray(vaoTriangles); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + } + + glDrawArrays(GL_TRIANGLES, 0, triangles.vCounter); + + if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindTexture(GL_TEXTURE_2D, 0); + } + + // Draw quads buffers + if (quads.vCounter > 0) + { + int quadsCount = 0; + int numIndicesToProcess = 0; + int indicesOffset = 0; + + if (vaoSupported) + { + glBindVertexArray(vaoQuads); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: texcoord (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); + glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.texcoordLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); + } + + //TraceLog(DEBUG, "Draws required per frame: %i", drawsCounter); + + for (int i = 0; i < drawsCounter; i++) + { + quadsCount = draws[i].vertexCount/4; + numIndicesToProcess = quadsCount*6; // Get number of Quads * 6 index by Quad + + //TraceLog(DEBUG, "Quads to render: %i - Vertex Count: %i", quadsCount, draws[i].vertexCount); + + glBindTexture(GL_TEXTURE_2D, draws[i].textureId); + + // NOTE: The final parameter tells the GPU the offset in bytes from the start of the index buffer to the location of the first index to process +#if defined(GRAPHICS_API_OPENGL_33) + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid*) (sizeof(GLuint) * indicesOffset)); +#elif defined(GRAPHICS_API_OPENGL_ES2) + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid*) (sizeof(GLushort) * indicesOffset)); +#endif + //GLenum err; + //if ((err = glGetError()) != GL_NO_ERROR) TraceLog(INFO, "OpenGL error: %i", (int)err); //GL_INVALID_ENUM! + + indicesOffset += draws[i].vertexCount/4*6; + } + + if (!vaoSupported) + { + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + + glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures + } + + if (vaoSupported) glBindVertexArray(0); // Unbind VAO + + glUseProgram(0); // Unbind shader program + + // Reset draws counter + drawsCounter = 1; + draws[0].textureId = whiteTexture; + draws[0].vertexCount = 0; + + // Reset vertex counters for next frame + lines.vCounter = 0; + lines.cCounter = 0; + triangles.vCounter = 0; + triangles.cCounter = 0; + quads.vCounter = 0; + quads.tcCounter = 0; + quads.cCounter = 0; + + // Reset depth for next draw + currentDepth = -1.0f; +} + +// Unload default internal buffers vertex data from CPU and GPU static void UnloadDefaultBuffers(void) { // Unbind everything diff --git a/src/rlgl.h b/src/rlgl.h index cd8e6d1d..afc2ab96 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -280,29 +280,28 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data void rlglGenerateMipmaps(Texture2D texture); // Generate mipmap data for selected texture - -// NOTE: There is a set of shader related functions that are available to end user, -// to avoid creating function wrappers through core module, they have been directly declared in raylib.h - -Model rlglLoadModel(Mesh mesh); // Upload vertex data into GPU and provided VAO/VBO ids -void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color, bool wires); +void rlglLoadMesh(Mesh *mesh); // Upload vertex data into GPU and provided VAO/VBO ids +void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires); Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view); // Get world coordinates from screen coordinates unsigned char *rlglReadScreenPixels(int width, int height); // Read screen pixel data (color buffer) void *rlglReadTexturePixels(Texture2D texture); // Read texture pixel data +// NOTE: There is a set of shader related functions that are available to end user, +// to avoid creating function wrappers through core module, they have been directly declared in raylib.h + #if defined(RLGL_STANDALONE) //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations -unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shader strings and return program id void UnloadShader(Shader shader); // Unload a custom shader from memory void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw void SetDefaultShader(void); // Set default shader to be used in batch draw -void SetModelShader(Model *model, Shader shader); // Link a shader to a model +Shader GetDefaultShader(void); // Get default shader +Texture2D GetDefaultTexture(void); // Get default texture int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) -- cgit v1.2.3 From eeb151586f12f8694cccaecf12d92af7842338b5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 7 May 2016 18:28:40 +0200 Subject: Corrected issues with OpenGL 1.1 backend --- src/rlgl.c | 58 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 02649e30..462ccdec 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1080,22 +1080,24 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model - glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array - glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array - glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array + glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array + glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array + glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array - glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array - glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array - glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array + glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array + glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array + glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array //glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array (NOT USED) - rlMultMatrixf(MatrixToFloat(transform)); - - glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + rlPushMatrix(); + rlMultMatrixf(MatrixToFloat(transform)); + rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); + glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + rlPopMatrix(); - glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array - glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array - glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array + glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array + glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array + glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); @@ -1865,6 +1867,20 @@ void *rlglReadTexturePixels(Texture2D texture) // NOTE: Those functions are exposed directly to the user in raylib.h //---------------------------------------------------------------------------------- +// Get default internal texture (white texture) +Texture2D GetDefaultTexture(void) +{ + Texture2D texture; + + texture.id = whiteTexture; + texture.width = 1; + texture.height = 1; + texture.mipmaps = 1; + texture.format = UNCOMPRESSED_R8G8B8A8; + + return texture; +} + // Load a custom shader and bind default locations Shader LoadShader(char *vsFileName, char *fsFileName) { @@ -1930,7 +1946,12 @@ void SetDefaultShader(void) // Get default shader Shader GetDefaultShader(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) return defaultShader; +#else + Shader shader = { 0 }; + return shader; +#endif } // Get shader uniform location @@ -2050,19 +2071,6 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in } } -Texture2D GetDefaultTexture(void) -{ - Texture2D texture; - - texture.id = whiteTexture; - texture.width = 1; - texture.height = 1; - texture.mipmaps = 1; - texture.format = UNCOMPRESSED_R8G8B8A8; - - return texture; -} - // Load custom shader strings and return program id static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) { -- cgit v1.2.3 From 0bcb873cbb3758d67b1d263fafb6be818ddbf067 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 8 May 2016 15:24:02 +0200 Subject: Improved mesh support Depending on mesh data, it can be loaded and default vertex attribute location points are set, including colors, tangents and texcoords2 --- src/models.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++------------- src/raylib.h | 6 +-- src/rlgl.c | 90 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 171 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 9b139120..4aff7216 100644 --- a/src/models.c +++ b/src/models.c @@ -575,6 +575,89 @@ Model LoadModelEx(Mesh data) return model; } +// Load a 3d model from rRES file (raylib Resource) +Model LoadModelFromRES(const char *rresName, int resId) +{ + Model model = { 0 }; + bool found = false; + + char id[4]; // rRES file identifier + unsigned char version; // rRES file version and subversion + char useless; // rRES header reserved data + short numRes; + + ResInfoHeader infoHeader; + + FILE *rresFile = fopen(rresName, "rb"); + + if (rresFile == NULL) + { + TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); + } + else + { + // Read rres file (basic file check - id) + fread(&id[0], sizeof(char), 1, rresFile); + fread(&id[1], sizeof(char), 1, rresFile); + fread(&id[2], sizeof(char), 1, rresFile); + fread(&id[3], sizeof(char), 1, rresFile); + fread(&version, sizeof(char), 1, rresFile); + fread(&useless, sizeof(char), 1, rresFile); + + if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) + { + TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); + } + else + { + // Read number of resources embedded + fread(&numRes, sizeof(short), 1, rresFile); + + for (int i = 0; i < numRes; i++) + { + fread(&infoHeader, sizeof(ResInfoHeader), 1, rresFile); + + if (infoHeader.id == resId) + { + found = true; + + // Check data is of valid MODEL type + if (infoHeader.type == 8) + { + // TODO: Load model data + } + else + { + TraceLog(WARNING, "[%s] Required resource do not seem to be a valid MODEL resource", rresName); + } + } + else + { + // Depending on type, skip the right amount of parameters + switch (infoHeader.type) + { + case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters + case 1: fseek(rresFile, 6, SEEK_CUR); break; // SOUND: Jump 6 bytes of parameters + case 2: fseek(rresFile, 5, SEEK_CUR); break; // MODEL: Jump 5 bytes of parameters (TODO: Review) + case 3: break; // TEXT: No parameters + case 4: break; // RAW: No parameters + default: break; + } + + // Jump DATA to read next infoHeader + fseek(rresFile, infoHeader.size, SEEK_CUR); + } + } + } + + fclose(rresFile); + } + + if (!found) TraceLog(WARNING, "[%s] Required resource id [%i] could not be found in the raylib resource file", rresName, resId); + + return model; +} + // Load a heightmap image as a 3d model // NOTE: model map size is defined in generic units Model LoadHeightmap(Image heightmap, Vector3 size) @@ -613,18 +696,18 @@ void UnloadModel(Model model) free(model.mesh.vertices); free(model.mesh.texcoords); free(model.mesh.normals); - free(model.mesh.colors); - //if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); // Not used - //if (model.mesh.tangents != NULL) free(model.mesh.tangents); // Not used + if (model.mesh.colors != NULL) free(model.mesh.colors); + if (model.mesh.tangents != NULL) free(model.mesh.tangents); + if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); TraceLog(INFO, "Unloaded model data from RAM (CPU)"); rlDeleteBuffers(model.mesh.vboId[0]); // vertex rlDeleteBuffers(model.mesh.vboId[1]); // texcoords rlDeleteBuffers(model.mesh.vboId[2]); // normals - //rlDeleteBuffers(model.mesh.vboId[3]); // colors (NOT USED) - //rlDeleteBuffers(model.mesh.vboId[4]); // tangents (NOT USED) - //rlDeleteBuffers(model.mesh.vboId[5]); // texcoords2 (NOT USED) + rlDeleteBuffers(model.mesh.vboId[3]); // colors + rlDeleteBuffers(model.mesh.vboId[4]); // tangents + rlDeleteBuffers(model.mesh.vboId[5]); // texcoords2 rlDeleteVertexArrays(model.mesh.vaoId); } @@ -672,7 +755,7 @@ static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { #define GRAY_VALUE(c) ((c.r+c.g+c.b)/3) - Mesh mesh; + Mesh mesh = { 0 }; int mapX = heightmap.width; int mapZ = heightmap.height; @@ -687,7 +770,7 @@ static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) mesh.vertices = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.normals = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.texcoords = (float *)malloc(mesh.vertexCount*2*sizeof(float)); - mesh.colors = (unsigned char *)malloc(mesh.vertexCount*4*sizeof(unsigned char)); // Not used... + mesh.colors = NULL; int vCounter = 0; // Used to count vertices float by float int tcCounter = 0; // Used to count texcoords float by float @@ -770,16 +853,12 @@ static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) free(pixels); - // Fill color data - // NOTE: Not used any more... just one plain color defined at DrawModel() - for (int i = 0; i < (4*mesh.vertexCount); i++) mesh.colors[i] = 255; - return mesh; } static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) { - Mesh mesh; + Mesh mesh = { 0 }; Color *cubicmapPixels = GetImageData(cubicmap); @@ -1088,11 +1167,7 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) mesh.vertices = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.normals = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.texcoords = (float *)malloc(mesh.vertexCount*2*sizeof(float)); - mesh.colors = (unsigned char *)malloc(mesh.vertexCount*4*sizeof(unsigned char)); // Not used... - - // Fill color data - // NOTE: Not used any more... just one plain color defined at DrawModel() - for (int i = 0; i < (4*mesh.vertexCount); i++) mesh.colors[i] = 255; + mesh.colors = NULL; int fCounter = 0; @@ -1810,7 +1885,7 @@ static Mesh LoadOBJ(const char *fileName) mesh.vertices = (float *)malloc(mesh.vertexCount*3*sizeof(float)); mesh.texcoords = (float *)malloc(mesh.vertexCount*2*sizeof(float)); mesh.normals = (float *)malloc(mesh.vertexCount*3*sizeof(float)); - mesh.colors = (unsigned char *)malloc(mesh.vertexCount*4*sizeof(unsigned char)); + mesh.colors = NULL; int vCounter = 0; // Used to count vertices float by float int tcCounter = 0; // Used to count texcoords float by float @@ -1909,10 +1984,6 @@ static Mesh LoadOBJ(const char *fileName) // Security check, just in case no normals or no texcoords defined in OBJ if (numTexCoords == 0) for (int i = 0; i < (2*mesh.vertexCount); i++) mesh.texcoords[i] = 0.0f; - - // NOTE: We set all vertex colors to white - // NOTE: Not used any more... just one plain color defined at DrawModel() - for (int i = 0; i < (4*mesh.vertexCount); i++) mesh.colors[i] = 255; // Now we can free temp mid* arrays free(midVertices); @@ -1945,9 +2016,6 @@ static Material LoadMTL(const char *fileName) return material; } - // First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles - // NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition) - // NOTE: faces MUST be defined as TRIANGLES (3 vertex per face) while(!feof(mtlFile)) { fscanf(mtlFile, "%c", &dataType); diff --git a/src/raylib.h b/src/raylib.h index c88a60f4..60384444 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -386,7 +386,7 @@ typedef struct Mesh { typedef struct Shader { unsigned int id; // Shader program id - // Variable attributes locations + // Vertex attributes locations (default locations) int vertexLoc; // Vertex attribute location point (default-location = 0) int texcoordLoc; // Texcoord attribute location point (default-location = 1) int normalLoc; // Normal attribute location point (default-location = 2) @@ -803,14 +803,14 @@ void DrawGizmo(Vector3 position); //------------------------------------------------------------------------------------ Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data) -//Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource) +Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) void UnloadModel(Model model); // Unload 3d model from memory void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model Material LoadMaterial(const char *fileName); // Load material data (from file) -Material LoadDefaultMaterial(void); // Load default material (uses default models shader) +Material LoadDefaultMaterial(void); // Load default material (uses default models shader) void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters diff --git a/src/rlgl.c b/src/rlgl.c index 462ccdec..6ffcb8a5 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -811,9 +811,11 @@ void rlDeleteVertexArrays(unsigned int id) void rlDeleteBuffers(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteBuffers(1, &id); - - if (!vaoSupported) TraceLog(INFO, "[VBO ID %i] Unloaded model vertex data from VRAM (GPU)", id); + if (id != 0) + { + glDeleteBuffers(1, &id); + if (!vaoSupported) TraceLog(INFO, "[VBO ID %i] Unloaded model vertex data from VRAM (GPU)", id); + } #endif } @@ -1638,6 +1640,7 @@ void rlglGenerateMipmaps(Texture2D texture) } // Upload vertex data into a VAO (if supported) and VBO +// TODO: Consider attributes: color, texcoords2, tangents (if available) void rlglLoadMesh(Mesh *mesh) { mesh->vaoId = 0; // Vertex Array Object @@ -1648,11 +1651,10 @@ void rlglLoadMesh(Mesh *mesh) mesh->vboId[4] = 0; // Vertex tangent VBO mesh->vboId[5] = 0; // Vertex texcoord2 VBO - // TODO: Consider attributes: color, texcoords2, tangents (if available) - + #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vaoId = 0; // Vertex Array Objects (VAO) - GLuint vboId[3]; // Vertex Buffer Objects (VBOs) + GLuint vboId[6]; // Vertex Buffer Objects (VBOs) if (vaoSupported) { @@ -1661,36 +1663,92 @@ void rlglLoadMesh(Mesh *mesh) glBindVertexArray(vaoId); } - // Create buffers for our vertex data (positions, texcoords, normals) - glGenBuffers(3, vboId); - // NOTE: Attributes must be uploaded considering default locations points // Enable vertex attributes: position (shader-location = 0) + glGenBuffers(1, &vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, vboId[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->vertices, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(0); // Enable vertex attributes: texcoords (shader-location = 1) + glGenBuffers(1, &vboId[1]); glBindBuffer(GL_ARRAY_BUFFER, vboId[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords, GL_STATIC_DRAW); glVertexAttribPointer(1, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(1); // Enable vertex attributes: normals (shader-location = 2) - glBindBuffer(GL_ARRAY_BUFFER, vboId[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->normals, GL_STATIC_DRAW); - glVertexAttribPointer(2, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(2); + if (mesh->normals != NULL) + { + glGenBuffers(1, &vboId[2]); + glBindBuffer(GL_ARRAY_BUFFER, vboId[2]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->normals, GL_STATIC_DRAW); + glVertexAttribPointer(2, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(2); + } + else + { + // Default color vertex attribute set to WHITE + glVertexAttrib3f(2, 1.0f, 1.0f, 1.0f); + glDisableVertexAttribArray(2); + } // Default color vertex attribute (shader-location = 3) - glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); // Color vertex attribute set to default: WHITE - glDisableVertexAttribArray(3); + if (mesh->colors != NULL) + { + glGenBuffers(1, &vboId[3]); + glBindBuffer(GL_ARRAY_BUFFER, vboId[3]); + glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*mesh->vertexCount, mesh->colors, GL_STATIC_DRAW); + glVertexAttribPointer(3, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(3); + } + else + { + // Default color vertex attribute set to WHITE + glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); + glDisableVertexAttribArray(3); + } + + // Default tangent vertex attribute (shader-location = 4) + if (mesh->tangents != NULL) + { + glGenBuffers(1, &vboId[4]); + glBindBuffer(GL_ARRAY_BUFFER, vboId[4]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->tangents, GL_STATIC_DRAW); + glVertexAttribPointer(4, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(4); + } + else + { + // Default tangents vertex attribute + glVertexAttrib3f(4, 0.0f, 0.0f, 0.0f); + glDisableVertexAttribArray(4); + } + + // Default texcoord2 vertex attribute (shader-location = 5) + if (mesh->texcoords2 != NULL) + { + glGenBuffers(1, &vboId[5]); + glBindBuffer(GL_ARRAY_BUFFER, vboId[5]); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords2, GL_STATIC_DRAW); + glVertexAttribPointer(5, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(5); + } + else + { + // Default tangents vertex attribute + glVertexAttrib2f(5, 0.0f, 0.0f); + glDisableVertexAttribArray(5); + } mesh->vboId[0] = vboId[0]; // Vertex position VBO mesh->vboId[1] = vboId[1]; // Texcoords VBO mesh->vboId[2] = vboId[2]; // Normals VBO + mesh->vboId[3] = vboId[3]; // Colors VBO + mesh->vboId[4] = vboId[4]; // Tangents VBO + mesh->vboId[5] = vboId[5]; // Texcoords2 VBO if (vaoSupported) { @@ -1703,7 +1761,7 @@ void rlglLoadMesh(Mesh *mesh) } else { - TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i] Mesh uploaded successfully to VRAM (GPU)", mesh->vboId[0], mesh->vboId[1], mesh->vboId[2]); + TraceLog(INFO, "[VBOs] Mesh uploaded successfully to VRAM (GPU)"); } #endif } -- cgit v1.2.3 From f7d4951165e8bece5ae58cd4c92b08e4f29cbef7 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 8 May 2016 23:50:35 +0200 Subject: Improved vertex attribs support for models --- src/models.c | 2 +- src/raylib.h | 14 ++++++++------ src/rlgl.c | 45 ++++++++++++++++++++++++++++++++++++--------- 3 files changed, 45 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 4aff7216..ee04b449 100644 --- a/src/models.c +++ b/src/models.c @@ -695,7 +695,7 @@ void UnloadModel(Model model) // Unload mesh data free(model.mesh.vertices); free(model.mesh.texcoords); - free(model.mesh.normals); + if (model.mesh.normals != NULL) free(model.mesh.normals); if (model.mesh.colors != NULL) free(model.mesh.colors); if (model.mesh.tangents != NULL) free(model.mesh.tangents); if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); diff --git a/src/raylib.h b/src/raylib.h index 60384444..1258bffc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -369,12 +369,12 @@ typedef struct BoundingBox { // Vertex data definning a mesh typedef struct Mesh { int vertexCount; // num vertices - float *vertices; // vertex position (XYZ - 3 components per vertex) - float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) - float *texcoords2; // vertex second texture coordinates (useful for lightmaps) - float *normals; // vertex normals (XYZ - 3 components per vertex) - float *tangents; // vertex tangents (XYZ - 3 components per vertex) - unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) + float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) + unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) BoundingBox bounds; // mesh limits defined by min and max points @@ -391,6 +391,8 @@ typedef struct Shader { int texcoordLoc; // Texcoord attribute location point (default-location = 1) int normalLoc; // Normal attribute location point (default-location = 2) int colorLoc; // Color attibute location point (default-location = 3) + int tangentLoc; // Tangent attribute location point (default-location = 4) + int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) diff --git a/src/rlgl.c b/src/rlgl.c index 6ffcb8a5..2e4601df 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1084,12 +1084,13 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array - glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array + if (mesh.normals != NULL) glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array + if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array - glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array - //glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array (NOT USED) + if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array + if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array rlPushMatrix(); rlMultMatrixf(MatrixToFloat(transform)); @@ -1099,7 +1100,8 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array - glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array + if (mesh.normals != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array + if (mesh.colors != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable colors array glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); @@ -1170,7 +1172,29 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glEnableVertexAttribArray(material.shader.normalLoc); } - // TODO: Bind mesh VBO data: colors, tangents, texcoords2 (if available) + // Bind mesh VBO data: vertex colors (shader-location = 3, if available) , tangents, texcoords2 (if available) + if (material.shader.colorLoc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); + glVertexAttribPointer(material.shader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(material.shader.colorLoc); + } + + // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) + if (material.shader.tangentLoc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); + glVertexAttribPointer(material.shader.tangentLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.tangentLoc); + } + + // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) + if (material.shader.texcoord2Loc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); + glVertexAttribPointer(material.shader.texcoord2Loc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.texcoord2Loc); + } } // Draw call! @@ -1640,16 +1664,15 @@ void rlglGenerateMipmaps(Texture2D texture) } // Upload vertex data into a VAO (if supported) and VBO -// TODO: Consider attributes: color, texcoords2, tangents (if available) void rlglLoadMesh(Mesh *mesh) { mesh->vaoId = 0; // Vertex Array Object mesh->vboId[0] = 0; // Vertex positions VBO mesh->vboId[1] = 0; // Vertex texcoords VBO mesh->vboId[2] = 0; // Vertex normals VBO - mesh->vboId[3] = 0; // Vertex color VBO - mesh->vboId[4] = 0; // Vertex tangent VBO - mesh->vboId[5] = 0; // Vertex texcoord2 VBO + mesh->vboId[3] = 0; // Vertex colors VBO + mesh->vboId[4] = 0; // Vertex tangents VBO + mesh->vboId[5] = 0; // Vertex texcoords2 VBO #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -2314,12 +2337,16 @@ static void LoadDefaultShaderLocations(Shader *shader) // vertex texcoord location = 1 // vertex normal location = 2 // vertex color location = 3 + // vertex tangent location = 4 + // vertex texcoord2 location = 5 // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); shader->texcoordLoc = glGetAttribLocation(shader->id, "vertexTexCoord"); shader->normalLoc = glGetAttribLocation(shader->id, "vertexNormal"); shader->colorLoc = glGetAttribLocation(shader->id, "vertexColor"); + shader->tangentLoc = glGetAttribLocation(shader->id, "vertexTangent"); + shader->texcoord2Loc = glGetAttribLocation(shader->id, "vertexTexCoord2"); // Get handles to GLSL uniform locations (vertex shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); -- cgit v1.2.3 From dc4d5dabcdf8f35f32acb9c5b48a24b1141c460f Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 May 2016 01:18:46 +0200 Subject: Added MTL loading info --- src/models.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index ee04b449..7b6deb5c 100644 --- a/src/models.c +++ b/src/models.c @@ -2001,7 +2001,26 @@ static Material LoadMTL(const char *fileName) { Material material = { 0 }; - // TODO: Load mtl file + // TODO: Load mtl file (multiple variations of .mtl format) + /* + newmtl string Material newmtl (material name). Begins a new material description. + Ka float float float Ambient color Ka (red) (green) (blue) + Kd float float float Diffuse color Kd (red) (green) (blue) + Ks float float float Specular color Ks (red) (green) (blue) + Ke float float float Emmisive color + d float Tr float Dissolve factor. Transparency Tr (alpha). d is inverse of Tr + Ns int Shininess Ns (specular power). Ranges from 0 to 1000. Specular exponent. + Ni int Refraction index. + illum int Illumination model illum (1 / 2); 1 if specular disabled, 2 if specular enabled (lambertian model) + map_Kd string Texture map_Kd (filename) + map_Kd string Diffuse color texture map. + map_Ks string Specular color texture map. + map_Ka string Ambient color texture map. + map_Bump string Bump texture map. Alternative: bump string / map_bump string + map_d string Opacity texture map. + disp string Displacement map + refl Reflection type and map + */ char dataType; char comments[200]; -- cgit v1.2.3 From 3d0208223ad5b79cb4c3d6cd367d39f9d4e51662 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 May 2016 12:40:59 +0200 Subject: First implementation of MTL loading Not tested yet --- src/models.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 132 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 7b6deb5c..dff6b224 100644 --- a/src/models.c +++ b/src/models.c @@ -1997,33 +1997,16 @@ static Mesh LoadOBJ(const char *fileName) } // Load MTL material data +// NOTE: Texture map parameters are not supported static Material LoadMTL(const char *fileName) { - Material material = { 0 }; + #define MAX_BUFFER_SIZE 128 - // TODO: Load mtl file (multiple variations of .mtl format) - /* - newmtl string Material newmtl (material name). Begins a new material description. - Ka float float float Ambient color Ka (red) (green) (blue) - Kd float float float Diffuse color Kd (red) (green) (blue) - Ks float float float Specular color Ks (red) (green) (blue) - Ke float float float Emmisive color - d float Tr float Dissolve factor. Transparency Tr (alpha). d is inverse of Tr - Ns int Shininess Ns (specular power). Ranges from 0 to 1000. Specular exponent. - Ni int Refraction index. - illum int Illumination model illum (1 / 2); 1 if specular disabled, 2 if specular enabled (lambertian model) - map_Kd string Texture map_Kd (filename) - map_Kd string Diffuse color texture map. - map_Ks string Specular color texture map. - map_Ka string Ambient color texture map. - map_Bump string Bump texture map. Alternative: bump string / map_bump string - map_d string Opacity texture map. - disp string Displacement map - refl Reflection type and map - */ + Material material = { 0 }; // LoadDefaultMaterial(); - char dataType; - char comments[200]; + char buffer[MAX_BUFFER_SIZE]; + Vector3 color = { 1.0f, 1.0f, 1.0f }; + char *mapFileName; FILE *mtlFile; @@ -2037,7 +2020,132 @@ static Material LoadMTL(const char *fileName) while(!feof(mtlFile)) { - fscanf(mtlFile, "%c", &dataType); + fgets(buffer, MAX_BUFFER_SIZE, mtlFile); + + switch (buffer[0]) + { + case 'n': // newmtl string Material name. Begins a new material description. + { + // TODO: Support multiple materials in a single .mtl + sscanf(buffer, "newmtl %s", mapFileName); + + TraceLog(INFO, "[%s] Loading material...", mapFileName); + } + case 'i': // illum int Illumination model + { + // illum = 1 if specular disabled + // illum = 2 if specular enabled (lambertian model) + // ... + } + case 'K': // Ka, Kd, Ks, Ke + { + switch (buffer[1]) + { + case 'a': // Ka float float float Ambient color (RGB) + { + sscanf(buffer, "Ka %f %f %f", &color.x, &color.y, &color.z); + material.colAmbient.r = (unsigned char)(color.x*255); + material.colAmbient.g = (unsigned char)(color.y*255); + material.colAmbient.b = (unsigned char)(color.z*255); + } break; + case 'd': // Kd float float float Diffuse color (RGB) + { + sscanf(buffer, "Kd %f %f %f", &color.x, &color.y, &color.z); + material.colDiffuse.r = (unsigned char)(color.x*255); + material.colDiffuse.g = (unsigned char)(color.y*255); + material.colDiffuse.b = (unsigned char)(color.z*255); + } break; + case 's': // Ks float float float Specular color (RGB) + { + sscanf(buffer, "Ks %f %f %f", &color.x, &color.y, &color.z); + material.colSpecular.r = (unsigned char)(color.x*255); + material.colSpecular.g = (unsigned char)(color.y*255); + material.colSpecular.b = (unsigned char)(color.z*255); + } break; + case 'e': // Ke float float float Emmisive color (RGB) + { + // TODO: Support Ke ? + } break; + default: break; + } + } break; + case 'N': // Ns, Ni + { + if (buffer[1] == 's') // Ns int Shininess (specular exponent). Ranges from 0 to 1000. + { + sscanf(buffer, "Ns %i", &material.glossiness); + } + else if (buffer[1] == 'i') // Ni int Refraction index. + { + // Not supported... + } + } break; + case 'm': // map_Kd, map_Ks, map_Ka, map_Bump, map_d + { + switch (buffer[4]) + { + case 'K': // Color texture maps + { + if (buffer[5] == 'd') // map_Kd string Diffuse color texture map. + { + sscanf(buffer, "map_Kd %s", mapFileName); + if (mapFileName != NULL) material.texDiffuse = LoadTexture(mapFileName); + } + else if (buffer[5] == 's') // map_Ks string Specular color texture map. + { + sscanf(buffer, "map_Ks %s", mapFileName); + if (mapFileName != NULL) material.texSpecular = LoadTexture(mapFileName); + } + else if (buffer[5] == 'a') // map_Ka string Ambient color texture map. + { + // Not supported... + } + } break; + case 'B': // map_Bump string Bump texture map. + { + sscanf(buffer, "map_Bump %s", mapFileName); + if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + } break; + case 'b': // map_bump string Bump texture map. + { + sscanf(buffer, "map_bump %s", mapFileName); + if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + } break; + case 'd': // map_d string Opacity texture map. + { + // Not supported... + } break; + default: break; + } + } break; + case 'd': // d, disp + { + if (buffer[1] == ' ') // d float Dissolve factor. d is inverse of Tr + { + float alpha = 1.0f; + sscanf(buffer, "d %f", &alpha); + material.colDiffuse.a = (unsigned char)(alpha*255); + } + else if (buffer[1] == 'i') // disp string Displacement map + { + // Not supported... + } + } break; + case 'b': // bump string Bump texture map + { + sscanf(buffer, "bump %s", mapFileName); + if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + } break; + case 'T': // Tr float Transparency Tr (alpha). Tr is inverse of d + { + float ialpha = 0.0f; + sscanf(buffer, "Tr %f", &ialpha); + material.colDiffuse.a = (unsigned char)((1.0f - ialpha)*255); + + } break; + case 'r': // refl string Reflection texture map + default: break; + } } fclose(mtlFile); -- cgit v1.2.3 From c85cd290491baa7be2b107bdb72c4b039dfd8cb3 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 May 2016 12:41:53 +0200 Subject: Added defines for default shader names --- src/rlgl.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 2e4601df..33f12deb 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -115,6 +115,15 @@ #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif + +// Default vertex attribute names on shader to set location points +#define DEFAULT_ATTRIB_POSITION_NAME "vertexPosition" // shader-location = 0 +#define DEFAULT_ATTRIB_TEXCOORD_NAME "vertexTexCoord" // shader-location = 1 +#define DEFAULT_ATTRIB_NORMAL_NAME "vertexNormal" // shader-location = 2 +#define DEFAULT_ATTRIB_COLOR_NAME "vertexColor" // shader-location = 3 +#define DEFAULT_ATTRIB_TANGENT_NAME "vertexTangent" // shader-location = 4 +#define DEFAULT_ATTRIB_TEXCOORD2_NAME "vertexTexCoord2" // shader-location = 5 + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -2220,12 +2229,12 @@ static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) glAttachShader(program, fragmentShader); // NOTE: Default attribute shader locations must be binded before linking - glBindAttribLocation(program, 0, "vertexPosition"); - glBindAttribLocation(program, 1, "vertexTexCoord"); - glBindAttribLocation(program, 2, "vertexNormal"); - glBindAttribLocation(program, 3, "vertexColor"); - glBindAttribLocation(program, 4, "vertexTangent"); - glBindAttribLocation(program, 5, "vertexTexCoord2"); + glBindAttribLocation(program, 0, DEFAULT_ATTRIB_POSITION_NAME); + glBindAttribLocation(program, 1, DEFAULT_ATTRIB_TEXCOORD_NAME); + glBindAttribLocation(program, 2, DEFAULT_ATTRIB_NORMAL_NAME); + glBindAttribLocation(program, 3, DEFAULT_ATTRIB_COLOR_NAME); + glBindAttribLocation(program, 4, DEFAULT_ATTRIB_TANGENT_NAME); + glBindAttribLocation(program, 5, DEFAULT_ATTRIB_TEXCOORD2_NAME); // NOTE: If some attrib name is no found on the shader, it locations becomes -1 -- cgit v1.2.3 From ac44db26a2a2bed901c7e75d96e215fa09bd3705 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 May 2016 13:16:44 +0200 Subject: Added reference --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index dff6b224..7d24e383 100644 --- a/src/models.c +++ b/src/models.c @@ -1996,7 +1996,7 @@ static Mesh LoadOBJ(const char *fileName) return mesh; } -// Load MTL material data +// Load MTL material data (specs: http://paulbourke.net/dataformats/mtl/) // NOTE: Texture map parameters are not supported static Material LoadMTL(const char *fileName) { -- cgit v1.2.3 From b7f8e97b0384ae37bff110a2ef42cc42cfa09228 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Tue, 10 May 2016 01:54:20 -0700 Subject: final fix for audiocontext system now it works --- src/audio.c | 74 ++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 8f6431f6..fbf53df6 100644 --- a/src/audio.c +++ b/src/audio.c @@ -102,6 +102,7 @@ typedef struct AudioContext_t { unsigned char channels; // 1=mono,2=stereo unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream bool floatingPoint; // if false then the short datatype is used instead + bool playing; ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer @@ -211,7 +212,7 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChanne else StopMusicStream(); if(!mixChannelsActive_g[mixChannel]){ - AudioContext_t *ac = malloc(sizeof(AudioContext_t)); + AudioContext_t *ac = (AudioContext_t*)malloc(sizeof(AudioContext_t)); ac->sampleRate = sampleRate; ac->channels = channels; ac->mixChannel = mixChannel; @@ -250,8 +251,8 @@ AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChanne FillAlBufferWithSilence(ac, ac->alBuffer[x]); alSourceQueueBuffers(ac->alSource, MAX_STREAM_BUFFERS, ac->alBuffer); - alSourcei(ac->alSource, AL_LOOPING, AL_FALSE); // this could cause errors alSourcePlay(ac->alSource); + ac->playing = true; return ac; } @@ -264,6 +265,7 @@ void CloseAudioContext(AudioContext ctx) AudioContext_t *context = (AudioContext_t*)ctx; if(context){ alSourceStop(context->alSource); + context->playing = false; //flush out all queued buffers ALuint buffer = 0; @@ -287,22 +289,29 @@ void CloseAudioContext(AudioContext ctx) // Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in. // Call "UpdateAudioContext(ctx, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. -// All data streams should be of a length that is evenly divisible by MUSIC_BUFFER_SIZE, -// otherwise the remaining data will not be pushed. unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements) { AudioContext_t *context = (AudioContext_t*)ctx; - if(context && context->channels == 2 && numberElements % 2 != 0) return 0; // when there is two channels there must be an even number of samples + if(!context || (context->channels == 2 && numberElements % 2 != 0)) return 0; // when there is two channels there must be an even number of samples - if (!data || !numberElements) alSourcePause(context->alSource); // pauses audio until data is given - else{ // restart audio otherwise + if (!data || !numberElements) + { // pauses audio until data is given + alSourcePause(context->alSource); + context->playing = false; + return 0; + } + else + { // restart audio otherwise ALint state; alGetSourcei(context->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING) alSourcePlay(context->alSource); + if (state != AL_PLAYING){ + alSourcePlay(context->alSource); + context->playing = true; + } } - if (context && mixChannelsActive_g[context->mixChannel] == context) + if (context && context->playing && mixChannelsActive_g[context->mixChannel] == context) { ALint processed = 0; ALuint buffer = 0; @@ -311,36 +320,55 @@ unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short n alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) - if(!processed) return 0;//nothing to process, queue is still full + if(!processed) return 0; // nothing to process, queue is still full + - if(numberRemaining)// buffer data stream in increments of MUSIC_BUFFER_SIZE + while (processed > 0) { - while (processed > 0) + if(context->floatingPoint) // process float buffers { - if(context->floatingPoint && numberRemaining >= MUSIC_BUFFER_SIZE_FLOAT) // process float buffers + float *ptr = (float*)data; + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + if(numberRemaining >= MUSIC_BUFFER_SIZE_FLOAT) { - float *ptr = (float*)data; - alSourceUnqueueBuffers(context->alSource, 1, &buffer); alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), context->sampleRate); - alSourceQueueBuffers(context->alSource, 1, &buffer); numberProcessed+=MUSIC_BUFFER_SIZE_FLOAT; numberRemaining-=MUSIC_BUFFER_SIZE_FLOAT; } - else if(!context->floatingPoint && numberRemaining >= MUSIC_BUFFER_SIZE_SHORT) // process short buffers + else { - short *ptr = (short*)data; - alSourceUnqueueBuffers(context->alSource, 1, &buffer); - alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_SHORT*sizeof(short), context->sampleRate); - alSourceQueueBuffers(context->alSource, 1, &buffer); + alBufferData(buffer, context->alFormat, &ptr[numberProcessed], numberRemaining*sizeof(float), context->sampleRate); + numberProcessed+=numberRemaining; + numberRemaining=0; + } + alSourceQueueBuffers(context->alSource, 1, &buffer); + processed--; + } + else if(!context->floatingPoint) // process short buffers + { + short *ptr = (short*)data; + alSourceUnqueueBuffers(context->alSource, 1, &buffer); + if(numberRemaining >= MUSIC_BUFFER_SIZE_SHORT) + { + alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_FLOAT*sizeof(short), context->sampleRate); numberProcessed+=MUSIC_BUFFER_SIZE_SHORT; numberRemaining-=MUSIC_BUFFER_SIZE_SHORT; } - + else + { + alBufferData(buffer, context->alFormat, &ptr[numberProcessed], numberRemaining*sizeof(short), context->sampleRate); + numberProcessed+=numberRemaining; + numberRemaining=0; + } + alSourceQueueBuffers(context->alSource, 1, &buffer); processed--; } + else + break; } + return numberProcessed; } - return numberProcessed; + return 0; } // fill buffer with zeros, returns number processed -- cgit v1.2.3 From 1ddf594d15f31f1502eeb18f0f0c8039799fff01 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 10 May 2016 18:24:28 +0200 Subject: Added support for indexed mesh data --- src/models.c | 21 +++++++++++++++++---- src/raylib.h | 7 +++++-- src/rlgl.c | 39 ++++++++++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 7d24e383..41150179 100644 --- a/src/models.c +++ b/src/models.c @@ -553,7 +553,7 @@ Model LoadModel(const char *fileName) if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); else { - rlglLoadMesh(&model.mesh); // Upload vertex data to GPU + rlglLoadMesh(&model.mesh); // Upload vertex data to GPU model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -567,7 +567,9 @@ Model LoadModelEx(Mesh data) { Model model = { 0 }; - rlglLoadMesh(&data); // Upload vertex data to GPU + model.mesh = data; + + rlglLoadMesh(&model.mesh); // Upload vertex data to GPU model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -693,12 +695,13 @@ Model LoadCubicmap(Image cubicmap) void UnloadModel(Model model) { // Unload mesh data - free(model.mesh.vertices); - free(model.mesh.texcoords); + if (model.mesh.vertices != NULL) free(model.mesh.vertices); + if (model.mesh.texcoords != NULL) free(model.mesh.texcoords); if (model.mesh.normals != NULL) free(model.mesh.normals); if (model.mesh.colors != NULL) free(model.mesh.colors); if (model.mesh.tangents != NULL) free(model.mesh.tangents); if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); + if (model.mesh.indices != NULL) free(model.mesh.indices); TraceLog(INFO, "Unloaded model data from RAM (CPU)"); @@ -708,8 +711,11 @@ void UnloadModel(Model model) rlDeleteBuffers(model.mesh.vboId[3]); // colors rlDeleteBuffers(model.mesh.vboId[4]); // tangents rlDeleteBuffers(model.mesh.vboId[5]); // texcoords2 + rlDeleteBuffers(model.mesh.vboId[6]); // indices rlDeleteVertexArrays(model.mesh.vaoId); + + UnloadMaterial(model.material); } // Load material data (from file) @@ -743,6 +749,13 @@ Material LoadDefaultMaterial(void) return material; } +void UnloadMaterial(Material material) +{ + rlDeleteTextures(material.texDiffuse.id); + rlDeleteTextures(material.texNormal.id); + rlDeleteTextures(material.texSpecular.id); +} + // Link a texture to a model void SetModelTexture(Model *model, Texture2D texture) { diff --git a/src/raylib.h b/src/raylib.h index 1258bffc..05463325 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -368,18 +368,20 @@ typedef struct BoundingBox { // Vertex data definning a mesh typedef struct Mesh { - int vertexCount; // num vertices + int vertexCount; // number of vertices stored in arrays float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices; // vertex indices (in case vertex data comes indexed) + int trianglesCount; // number of triangles to draw BoundingBox bounds; // mesh limits defined by min and max points unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[6]; // OpenGL Vertex Buffer Objects id (6 types of vertex data) + unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) } Mesh; // Shader type (generic shader) @@ -813,6 +815,7 @@ void SetModelTexture(Model *model, Texture2D texture); // Link a textur Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) +void UnloadMaterial(Material material); // Unload material textures from VRAM void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters diff --git a/src/rlgl.c b/src/rlgl.c index 33f12deb..8364c4f1 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -783,16 +783,16 @@ void rlDisableDepthTest(void) // Unload texture from GPU memory void rlDeleteTextures(unsigned int id) { - glDeleteTextures(1, &id); + if (id != 0) glDeleteTextures(1, &id); } // Unload render texture from GPU memory void rlDeleteRenderTextures(RenderTexture2D target) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteFramebuffers(1, &target.id); - glDeleteTextures(1, &target.texture.id); - glDeleteTextures(1, &target.depth.id); + if (target.id != 0) glDeleteFramebuffers(1, &target.id); + if (target.texture.id != 0) glDeleteTextures(1, &target.texture.id); + if (target.depth.id != 0) glDeleteTextures(1, &target.depth.id); #endif } @@ -800,7 +800,7 @@ void rlDeleteRenderTextures(RenderTexture2D target) void rlDeleteShader(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glDeleteProgram(id); + if (id != 0) glDeleteProgram(id); #endif } @@ -810,7 +810,7 @@ void rlDeleteVertexArrays(unsigned int id) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (vaoSupported) { - glDeleteVertexArrays(1, &id); + if (id != 0) glDeleteVertexArrays(1, &id); TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", id); } #endif @@ -1204,10 +1204,13 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glVertexAttribPointer(material.shader.texcoord2Loc, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(material.shader.texcoord2Loc); } + + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); } // Draw call! - glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.trianglesCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw + else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); if (material.texNormal.id != 0) { @@ -1225,7 +1228,11 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures if (vaoSupported) glBindVertexArray(0); // Unbind VAO - else glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind VBOs + else + { + glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind VBOs + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } glUseProgram(0); // Unbind shader program #endif @@ -1682,11 +1689,12 @@ void rlglLoadMesh(Mesh *mesh) mesh->vboId[3] = 0; // Vertex colors VBO mesh->vboId[4] = 0; // Vertex tangents VBO mesh->vboId[5] = 0; // Vertex texcoords2 VBO + mesh->vboId[6] = 0; // Vertex indices VBO #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vaoId = 0; // Vertex Array Objects (VAO) - GLuint vboId[6]; // Vertex Buffer Objects (VBOs) + GLuint vboId[7]; // Vertex Buffer Objects (VBOs) if (vaoSupported) { @@ -1775,12 +1783,21 @@ void rlglLoadMesh(Mesh *mesh) glDisableVertexAttribArray(5); } + if (mesh->indices != NULL) + { + glGenBuffers(1, &vboId[6]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboId[6]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short)*mesh->trianglesCount*3, mesh->indices, GL_STATIC_DRAW); + } + + mesh->vboId[0] = vboId[0]; // Vertex position VBO mesh->vboId[1] = vboId[1]; // Texcoords VBO mesh->vboId[2] = vboId[2]; // Normals VBO mesh->vboId[3] = vboId[3]; // Colors VBO mesh->vboId[4] = vboId[4]; // Tangents VBO mesh->vboId[5] = vboId[5]; // Texcoords2 VBO + mesh->vboId[6] = vboId[6]; // Indices VBO if (vaoSupported) { @@ -2733,9 +2750,9 @@ static void DrawDefaultBuffers(void) // NOTE: The final parameter tells the GPU the offset in bytes from the start of the index buffer to the location of the first index to process #if defined(GRAPHICS_API_OPENGL_33) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid*) (sizeof(GLuint) * indicesOffset)); + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid *)(sizeof(GLuint)*indicesOffset)); #elif defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid*) (sizeof(GLushort) * indicesOffset)); + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid *)(sizeof(GLushort)*indicesOffset)); #endif //GLenum err; //if ((err = glGetError()) != GL_NO_ERROR) TraceLog(INFO, "OpenGL error: %i", (int)err); //GL_INVALID_ENUM! -- cgit v1.2.3 From aee5d9a39026d7cff2536806c1f10e25ccc57dcc Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 10 May 2016 19:24:05 +0200 Subject: Code tweak --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 41150179..066b919e 100644 --- a/src/models.c +++ b/src/models.c @@ -2019,7 +2019,7 @@ static Material LoadMTL(const char *fileName) char buffer[MAX_BUFFER_SIZE]; Vector3 color = { 1.0f, 1.0f, 1.0f }; - char *mapFileName; + char *mapFileName = NULL; FILE *mtlFile; -- cgit v1.2.3 From 5c112ff5425356a81920d907caf25a40c9ba71df Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 10 May 2016 19:24:25 +0200 Subject: Corrected tipo --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 05463325..ecfce9fc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -376,7 +376,7 @@ typedef struct Mesh { float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) unsigned short *indices; // vertex indices (in case vertex data comes indexed) - int trianglesCount; // number of triangles to draw + int triangleCount; // number of triangles to draw BoundingBox bounds; // mesh limits defined by min and max points -- cgit v1.2.3 From 6acfda599e5353b1c90bb11329ce50632851b1f5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 10 May 2016 19:25:06 +0200 Subject: Support indexed mesh data on OpenGL 1.1 path Keep asking myself why I maintain this rendering path... -___- --- src/rlgl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 8364c4f1..3c0d9e79 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1094,7 +1094,7 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array if (mesh.normals != NULL) glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array - if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array + if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array @@ -1104,7 +1104,9 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) rlPushMatrix(); rlMultMatrixf(MatrixToFloat(transform)); rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); - glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, mesh.indices); + else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); rlPopMatrix(); glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array @@ -1209,7 +1211,7 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) } // Draw call! - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.trianglesCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); if (material.texNormal.id != 0) @@ -1787,7 +1789,7 @@ void rlglLoadMesh(Mesh *mesh) { glGenBuffers(1, &vboId[6]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboId[6]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short)*mesh->trianglesCount*3, mesh->indices, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short)*mesh->triangleCount*3, mesh->indices, GL_STATIC_DRAW); } -- cgit v1.2.3 From 6db44500b75097a581587cba15ce703963d2ced8 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 11 May 2016 00:37:10 -0700 Subject: adding multiple music streams --- src/audio.c | 181 ++++++++++++++++++++++++++--------------------------------- src/audio.h | 9 +-- src/raylib.h | 9 +-- 3 files changed, 91 insertions(+), 108 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index fbf53df6..39be4eeb 100644 --- a/src/audio.c +++ b/src/audio.c @@ -61,6 +61,7 @@ //---------------------------------------------------------------------------------- #define MAX_STREAM_BUFFERS 2 #define MAX_AUDIO_CONTEXTS 4 // Number of open AL sources +#define MAX_MUSIC_STREAMS 2 #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) // NOTE: On RPI and Android should be lower to avoid frame-stalls @@ -81,13 +82,8 @@ typedef struct Music { stb_vorbis *stream; jar_xm_context_t *chipctx; // Stores jar_xm context - - ALuint buffers[MAX_STREAM_BUFFERS]; - ALuint source; - ALenum format; - - int channels; - int sampleRate; + AudioContext_t *ctx; // audio context + int totalSamplesLeft; float totalLengthSeconds; bool loop; @@ -117,8 +113,8 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active static bool musicEnabled = false; -static Music currentMusic; // Current music loaded - // NOTE: Only one music file playing at a time +static Music currentMusic[2]; // Current music loaded, up to two can play at the same time + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -769,151 +765,129 @@ void SetSoundPitch(Sound sound, float pitch) // Start music playing (open stream) void PlayMusicStream(char *fileName) { + int musicIndex; + int mixIndex; + for(musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot + { + if(currentMusic[musicIndex].stream == NULL && !currentMusic[musicIndex].chipTune) break; + else if(musicIndex = MAX_MUSIC_STREAMS - 1) return; + } + for(mixIndex = 0; mixIndex < MAX_AUDIO_CONTEXTS; mixIndex++) // find empty mix channel slot + { + if(mixChannelsActive_g[mixIndex] == NULL) break; + else if(musicIndex = MAX_AUDIO_CONTEXTS - 1) return; + } + + if (strcmp(GetExtension(fileName),"ogg") == 0) { - // Stop current music, clean buffers, unload current stream - StopMusicStream(); - // Open audio stream - currentMusic.stream = stb_vorbis_open_filename(fileName, NULL, NULL); + currentMusic[musicIndex].stream = stb_vorbis_open_filename(fileName, NULL, NULL); - if (currentMusic.stream == NULL) + if (currentMusic[musicIndex].stream == NULL) { TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); } else { // Get file info - stb_vorbis_info info = stb_vorbis_get_info(currentMusic.stream); - - currentMusic.channels = info.channels; - currentMusic.sampleRate = info.sample_rate; + stb_vorbis_info info = stb_vorbis_get_info(currentMusic[musicIndex].stream); TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); - if (info.channels == 2) currentMusic.format = AL_FORMAT_STEREO16; - else currentMusic.format = AL_FORMAT_MONO16; + if (info.channels == 2){ + currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 2, false); + } + else{ + currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 1, false); + } - currentMusic.loop = true; // We loop by default + currentMusic[musicIndex].loop = true; // We loop by default musicEnabled = true; - // Create an audio source - alGenSources(1, ¤tMusic.source); // Generate pointer to audio source - - alSourcef(currentMusic.source, AL_PITCH, 1); - alSourcef(currentMusic.source, AL_GAIN, 1); - alSource3f(currentMusic.source, AL_POSITION, 0, 0, 0); - alSource3f(currentMusic.source, AL_VELOCITY, 0, 0, 0); - //alSourcei(currentMusic.source, AL_LOOPING, AL_TRUE); // ERROR: Buffers do not queue! - - // Generate two OpenAL buffers - alGenBuffers(2, currentMusic.buffers); - - // Fill buffers with music... - BufferMusicStream(currentMusic.buffers[0]); - BufferMusicStream(currentMusic.buffers[1]); - - // Queue buffers and start playing - alSourceQueueBuffers(currentMusic.source, 2, currentMusic.buffers); - alSourcePlay(currentMusic.source); - - // NOTE: Regularly, we must check if a buffer has been processed and refill it: UpdateMusicStream() - - currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; - currentMusic.totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); + currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * currentMusic[musicIndex].channels; + currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); } } else if (strcmp(GetExtension(fileName),"xm") == 0) { - // Stop current music, clean buffers, unload current stream - StopMusicStream(); - - // new song settings for xm chiptune - currentMusic.chipTune = true; - currentMusic.channels = 2; - currentMusic.sampleRate = 48000; - currentMusic.loop = true; - // only stereo is supported for xm - if(!jar_xm_create_context_from_file(¤tMusic.chipctx, currentMusic.sampleRate, fileName)) + if(!jar_xm_create_context_from_file(¤tMusic[musicIndex].chipctx, 48000, fileName)) { - currentMusic.format = AL_FORMAT_STEREO16; - jar_xm_set_max_loop_count(currentMusic.chipctx, 0); // infinite number of loops - currentMusic.totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic.chipctx); - currentMusic.totalLengthSeconds = ((float)currentMusic.totalSamplesLeft) / ((float)currentMusic.sampleRate); + currentMusic[musicIndex].chipTune = true; + currentMusic[musicIndex].loop = true; + jar_xm_set_max_loop_count(currentMusic[musicIndex].chipctx, 0); // infinite number of loops + currentMusic[musicIndex].totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic[musicIndex].chipctx); + currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / ((float)currentMusic[musicIndex].sampleRate); musicEnabled = true; - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic.totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic.totalLengthSeconds); - - // Set up OpenAL - alGenSources(1, ¤tMusic.source); - alSourcef(currentMusic.source, AL_PITCH, 1); - alSourcef(currentMusic.source, AL_GAIN, 1); - alSource3f(currentMusic.source, AL_POSITION, 0, 0, 0); - alSource3f(currentMusic.source, AL_VELOCITY, 0, 0, 0); - alGenBuffers(2, currentMusic.buffers); - BufferMusicStream(currentMusic.buffers[0]); - BufferMusicStream(currentMusic.buffers[1]); - alSourceQueueBuffers(currentMusic.source, 2, currentMusic.buffers); - alSourcePlay(currentMusic.source); + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); - // NOTE: Regularly, we must check if a buffer has been processed and refill it: UpdateMusicStream() + currentMusic[musicIndex].ctx = InitAudioContext(48000, mixIndex, 2, true); } else TraceLog(WARNING, "[%s] XM file could not be opened", fileName); } else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); } -// Stop music playing (close stream) -void StopMusicStream(void) +// Stop music playing for individual music index of currentMusic array (close stream) +void StopMusicStream(int index) { - if (musicEnabled) + if (index < MAX_MUSIC_STREAMS && currentMusic[index].ctx) { - alSourceStop(currentMusic.source); - EmptyMusicStream(); // Empty music buffers - alDeleteSources(1, ¤tMusic.source); - alDeleteBuffers(2, currentMusic.buffers); + CloseAudioContext(currentMusic[index].ctx); - if (currentMusic.chipTune) + if (currentMusic[index].chipTune) { - jar_xm_free_context(currentMusic.chipctx); + jar_xm_free_context(currentMusic[index].chipctx); } else { - stb_vorbis_close(currentMusic.stream); + stb_vorbis_close(currentMusic[index].stream); } + + if(!getMusicStreamCount()) musicEnabled = false; } +} - musicEnabled = false; +//get number of music channels active at this time, this does not mean they are playing +int getMusicStreamCount(void) +{ + int musicCount; + for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot + if(currentMusic[musicIndex].stream != NULL || currentMusic[musicIndex].chipTune) musicCount++; + + return musicCount; } // Pause music playing -void PauseMusicStream(void) +void PauseMusicStream(int index) { // Pause music stream if music available! if (musicEnabled) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(currentMusic.source); + UpdateAudioContext(currentMusic[index].ctx, NULL, 0); // pushing null data auto pauses stream musicEnabled = false; } } // Resume music playing -void ResumeMusicStream(void) +void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - alGetSourcei(currentMusic.source, AL_SOURCE_STATE, &state); - - if (state == AL_PAUSED) - { - TraceLog(INFO, "Resuming music stream"); - alSourcePlay(currentMusic.source); - musicEnabled = true; + if(currentMusic[musicIndex].ctx){ + alGetSourcei(currentMusic[musicIndex].ctx->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PAUSED) + { + TraceLog(INFO, "Resuming music stream"); + alSourcePlay(currentMusic[musicIndex].ctx->alSource); + musicEnabled = true; + } } } @@ -922,17 +896,24 @@ bool IsMusicPlaying(void) { bool playing = false; ALint state; - - alGetSourcei(currentMusic.source, AL_SOURCE_STATE, &state); - if (state == AL_PLAYING) playing = true; + + for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) + { + if(currentMusic[musicIndex].ctx){ + alGetSourcei(currentMusic[musicIndex].ctx->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PLAYING) playing = true; + } + } return playing; } // Set volume for music -void SetMusicVolume(float volume) +void SetMusicVolume(int index, float volume) { - alSourcef(currentMusic.source, AL_GAIN, volume); + if(currentMusic[musicIndex].ctx){ + alSourcef(currentMusic[musicIndex].ctx->alSource, AL_GAIN, volume); + } } // Get current music time length (in seconds) diff --git a/src/audio.h b/src/audio.h index afd881b7..a1602bd9 100644 --- a/src/audio.h +++ b/src/audio.h @@ -102,13 +102,14 @@ void SetSoundPitch(Sound sound, float pitch); // Set pitch for void PlayMusicStream(char *fileName); // Start music playing (open stream) void UpdateMusicStream(void); // Updates buffers for music streaming -void StopMusicStream(void); // Stop music playing (close stream) -void PauseMusicStream(void); // Pause music playing -void ResumeMusicStream(void); // Resume playing paused music +void StopMusicStream(int index); // Stop music playing (close stream) +void PauseMusicStream(int index); // Pause music playing +void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(void); // Check if music is playing -void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) +void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) +int getMusicStreamCount(void); #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index d464c8e9..0c49a085 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -893,13 +893,14 @@ void SetSoundPitch(Sound sound, float pitch); // Set pitch for void PlayMusicStream(char *fileName); // Start music playing (open stream) void UpdateMusicStream(void); // Updates buffers for music streaming -void StopMusicStream(void); // Stop music playing (close stream) -void PauseMusicStream(void); // Pause music playing -void ResumeMusicStream(void); // Resume playing paused music +void StopMusicStream(int index); // Stop music playing (close stream) +void PauseMusicStream(int index); // Pause music playing +void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(void); // Check if music is playing -void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) +void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get current music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) +int getMusicStreamCount(void); #ifdef __cplusplus } -- cgit v1.2.3 From 4d78d27bd956f7f7592a9efc453b954436d57297 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 11 May 2016 19:25:51 +0200 Subject: Updated structs Mesh and Shader --- src/rlgl.h | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/rlgl.h b/src/rlgl.h index afc2ab96..6e694dae 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -137,37 +137,41 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; Vector3 max; } BoundingBox; - // Mesh with vertex data type - // NOTE: If using OpenGL 1.1, data loaded in CPU; if OpenGL 3.3+ data loaded in GPU (vaoId) + // Vertex data definning a mesh typedef struct Mesh { - int vertexCount; // num vertices - float *vertices; // vertex position (XYZ - 3 components per vertex) - float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) - float *texcoords2; // vertex second texture coordinates (useful for lightmaps) - float *normals; // vertex normals (XYZ - 3 components per vertex) - float *tangents; // vertex tangents (XYZ - 3 components per vertex) - unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) + int vertexCount; // number of vertices stored in arrays + float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) + unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices; // vertex indices (in case vertex data comes indexed) + int triangleCount; // number of triangles to draw BoundingBox bounds; // mesh limits defined by min and max points unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[6]; // OpenGL Vertex Buffer Objects id (6 types of vertex data) + unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) } Mesh; - // Shader type + // Shader type (generic shader) typedef struct Shader { - unsigned int id; // Shader program id - - // Variable attributes - int vertexLoc; // Vertex attribute location point (vertex shader) - int texcoordLoc; // Texcoord attribute location point (vertex shader) - int normalLoc; // Normal attribute location point (vertex shader) - int colorLoc; // Color attibute location point (vertex shader) - - // Uniforms + unsigned int id; // Shader program id + + // Vertex attributes locations (default locations) + int vertexLoc; // Vertex attribute location point (default-location = 0) + int texcoordLoc; // Texcoord attribute location point (default-location = 1) + int normalLoc; // Normal attribute location point (default-location = 2) + int colorLoc; // Color attibute location point (default-location = 3) + int tangentLoc; // Tangent attribute location point (default-location = 4) + int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) + + // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Color uniform location point (fragment shader) + // Texture map locations int mapDiffuseLoc; // Diffuse map texture uniform location point (fragment shader) int mapNormalLoc; // Normal map texture uniform location point (fragment shader) int mapSpecularLoc; // Specular map texture uniform location point (fragment shader) @@ -205,13 +209,6 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; float glossiness; float normalDepth; } Material; - - // 3d Model type - typedef struct Model { - Mesh mesh; - Matrix transform; - Material material; - } Model; // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; -- cgit v1.2.3 From ad3d270c429844462f3fd62fa12257760fac24b5 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 11 May 2016 18:14:59 -0700 Subject: added set pitch for music streams --- src/audio.c | 40 ++++++++++++++++++++++------------------ src/audio.h | 3 ++- src/raylib.h | 3 ++- 3 files changed, 26 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 39be4eeb..f89be8bf 100644 --- a/src/audio.c +++ b/src/audio.c @@ -113,7 +113,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active static bool musicEnabled = false; -static Music currentMusic[2]; // Current music loaded, up to two can play at the same time +static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -797,18 +797,18 @@ void PlayMusicStream(char *fileName) TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); + currentMusic[musicIndex].loop = true; // We loop by default + musicEnabled = true; + + currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * info.channels; + currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); + if (info.channels == 2){ currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 2, false); } else{ currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 1, false); } - - currentMusic[musicIndex].loop = true; // We loop by default - musicEnabled = true; - - currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * currentMusic[musicIndex].channels; - currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); } } else if (strcmp(GetExtension(fileName),"xm") == 0) @@ -820,7 +820,7 @@ void PlayMusicStream(char *fileName) currentMusic[musicIndex].loop = true; jar_xm_set_max_loop_count(currentMusic[musicIndex].chipctx, 0); // infinite number of loops currentMusic[musicIndex].totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic[musicIndex].chipctx); - currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / ((float)currentMusic[musicIndex].sampleRate); + currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled = true; TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); @@ -891,18 +891,15 @@ void ResumeMusicStream(int index) } } -// Check if music is playing -bool IsMusicPlaying(void) +// Check if any music is playing +bool IsMusicPlaying(int index) { bool playing = false; ALint state; - for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) - { - if(currentMusic[musicIndex].ctx){ - alGetSourcei(currentMusic[musicIndex].ctx->alSource, AL_SOURCE_STATE, &state); - if (state == AL_PLAYING) playing = true; - } + if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ + alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PLAYING) playing = true; } return playing; @@ -911,8 +908,15 @@ bool IsMusicPlaying(void) // Set volume for music void SetMusicVolume(int index, float volume) { - if(currentMusic[musicIndex].ctx){ - alSourcef(currentMusic[musicIndex].ctx->alSource, AL_GAIN, volume); + if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ + alSourcef(currentMusic[index].ctx->alSource, AL_GAIN, volume); + } +} + +void SetMusicPitch(int index, float pitch) +{ + if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ + alSourcef(currentMusic[index].ctx->alSource, AL_PITCH, pitch); } } diff --git a/src/audio.h b/src/audio.h index a1602bd9..fef85b4f 100644 --- a/src/audio.h +++ b/src/audio.h @@ -105,11 +105,12 @@ void UpdateMusicStream(void); // Updates buffe void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing void ResumeMusicStream(int index); // Resume playing paused music -bool IsMusicPlaying(void); // Check if music is playing +bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) int getMusicStreamCount(void); +void SetMusicPitch(int index, float pitch); #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index 0c49a085..b9390d31 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -896,11 +896,12 @@ void UpdateMusicStream(void); // Updates buffe void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing void ResumeMusicStream(int index); // Resume playing paused music -bool IsMusicPlaying(void); // Check if music is playing +bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(void); // Get current music time length (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds) int getMusicStreamCount(void); +void SetMusicPitch(int index, float pitch); #ifdef __cplusplus } -- cgit v1.2.3 From 9737c58054d5d0cc636fca0c998b31a69d501970 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 11 May 2016 20:15:37 -0700 Subject: PlayMusicStream now uses index --- src/audio.c | 29 +++++++++++++++++++---------- src/audio.h | 2 +- src/raylib.h | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index f89be8bf..6a8d251e 100644 --- a/src/audio.c +++ b/src/audio.c @@ -763,19 +763,18 @@ void SetSoundPitch(Sound sound, float pitch) //---------------------------------------------------------------------------------- // Start music playing (open stream) -void PlayMusicStream(char *fileName) +// returns 0 on success +int PlayMusicStream(int musicIndex, char *fileName) { - int musicIndex; + int musicIndex = index; int mixIndex; - for(musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot - { - if(currentMusic[musicIndex].stream == NULL && !currentMusic[musicIndex].chipTune) break; - else if(musicIndex = MAX_MUSIC_STREAMS - 1) return; - } + + if(currentMusic[musicIndex].stream != NULL || currentMusic[musicIndex].chipTune) return 1; // error + for(mixIndex = 0; mixIndex < MAX_AUDIO_CONTEXTS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(musicIndex = MAX_AUDIO_CONTEXTS - 1) return; + else if(musicIndex = MAX_AUDIO_CONTEXTS - 1) return 2; // error } @@ -787,6 +786,7 @@ void PlayMusicStream(char *fileName) if (currentMusic[musicIndex].stream == NULL) { TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); + return 3; // error } else { @@ -828,9 +828,18 @@ void PlayMusicStream(char *fileName) currentMusic[musicIndex].ctx = InitAudioContext(48000, mixIndex, 2, true); } - else TraceLog(WARNING, "[%s] XM file could not be opened", fileName); + else + { + TraceLog(WARNING, "[%s] XM file could not be opened", fileName); + return 4; // error + } + } + else + { + TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); + return 5; // error } - else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); + return 0; // normal return } // Stop music playing for individual music index of currentMusic array (close stream) diff --git a/src/audio.h b/src/audio.h index fef85b4f..d09c4acc 100644 --- a/src/audio.h +++ b/src/audio.h @@ -100,7 +100,7 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -void PlayMusicStream(char *fileName); // Start music playing (open stream) +int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) void UpdateMusicStream(void); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing diff --git a/src/raylib.h b/src/raylib.h index a6507906..cb17aa78 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -894,7 +894,7 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -void PlayMusicStream(char *fileName); // Start music playing (open stream) +int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) void UpdateMusicStream(void); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing -- cgit v1.2.3 From f0ada8c40d7887654d05c62f980a0a5473c1d8a7 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 11 May 2016 22:37:53 -0700 Subject: apply index to remaining functions --- src/audio.c | 108 +++++++++++++++++++++++++++++++---------------------------- src/audio.h | 6 ++-- src/raylib.h | 6 ++-- 3 files changed, 62 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 6a8d251e..94729566 100644 --- a/src/audio.c +++ b/src/audio.c @@ -118,12 +118,12 @@ static Music currentMusic[MAX_MUSIC_STREAMS]; // Current //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static Wave LoadWAV(const char *fileName); // Load WAV file -static Wave LoadOGG(char *fileName); // Load OGG file -static void UnloadWave(Wave wave); // Unload wave data +static Wave LoadWAV(const char *fileName); // Load WAV file +static Wave LoadOGG(char *fileName); // Load OGG file +static void UnloadWave(Wave wave); // Unload wave data -static bool BufferMusicStream(ALuint buffer); // Fill music buffers with data -static void EmptyMusicStream(void); // Empty music buffers +static bool BufferMusicStream(int index, ALuint buffer); // Fill music buffers with data +static void EmptyMusicStream(int index); // Empty music buffers static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer);// fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in @@ -766,7 +766,6 @@ void SetSoundPitch(Sound sound, float pitch) // returns 0 on success int PlayMusicStream(int musicIndex, char *fileName) { - int musicIndex = index; int mixIndex; if(currentMusic[musicIndex].stream != NULL || currentMusic[musicIndex].chipTune) return 1; // error @@ -930,36 +929,36 @@ void SetMusicPitch(int index, float pitch) } // Get current music time length (in seconds) -float GetMusicTimeLength(void) +float GetMusicTimeLength(int index) { float totalSeconds; - if (currentMusic.chipTune) + if (currentMusic[index].chipTune) { - totalSeconds = currentMusic.totalLengthSeconds; + totalSeconds = currentMusic[index].totalLengthSeconds; } else { - totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic.stream); + totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[index].stream); } return totalSeconds; } // Get current music time played (in seconds) -float GetMusicTimePlayed(void) +float GetMusicTimePlayed(int index) { float secondsPlayed; - if (currentMusic.chipTune) + if (currentMusic[index].chipTune) { uint64_t samples; - jar_xm_get_position(currentMusic.chipctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (currentMusic.sampleRate * currentMusic.channels); // Not sure if this is the correct value + jar_xm_get_position(currentMusic[index].chipctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000 * currentMusic[index].ctx->channels); // Not sure if this is the correct value } else { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic.stream) * currentMusic.channels; - int samplesPlayed = totalSamples - currentMusic.totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic.sampleRate * currentMusic.channels); + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; + int samplesPlayed = totalSamples - currentMusic[index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (currentMusic[index].ctx->sampleRate * currentMusic[index].ctx->channels); } @@ -971,9 +970,10 @@ float GetMusicTimePlayed(void) //---------------------------------------------------------------------------------- // Fill music buffers with new data from music stream -static bool BufferMusicStream(ALuint buffer) +static bool BufferMusicStream(int index, ALuint buffer) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; + float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; int size = 0; // Total size of data steamed (in bytes) int streamedBytes = 0; // samples of data obtained, channels are not included in calculation @@ -981,93 +981,97 @@ static bool BufferMusicStream(ALuint buffer) if (musicEnabled) { - if (currentMusic.chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - int readlen = MUSIC_BUFFER_SIZE_SHORT / 2; - jar_xm_generate_samples_16bit(currentMusic.chipctx, pcm, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location - size += readlen * currentMusic.channels; // Not sure if this is what it needs + int readlen = MUSIC_BUFFER_SIZE_FLOAT / 2; + jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location + size += readlen * currentMusic[index].ctx->channels; // Not sure if this is what it needs + + alBufferData(buffer, currentMusic[index].ctx->alFormat, pcmf, size*sizeof(float), 48000); + currentMusic[index].totalSamplesLeft -= size; + if(currentMusic[index].totalSamplesLeft <= 0) active = false; } else { while (size < MUSIC_BUFFER_SIZE_SHORT) { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic.stream, currentMusic.channels, pcm + size, MUSIC_BUFFER_SIZE_SHORT - size); - if (streamedBytes > 0) size += (streamedBytes*currentMusic.channels); + streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm + size, MUSIC_BUFFER_SIZE_SHORT - size); + if (streamedBytes > 0) size += (streamedBytes*currentMusic[index].ctx->channels); else break; } + + if (size > 0) + { + alBufferData(buffer, currentMusic[index].ctx->alFormat, pcm, size*sizeof(short), currentMusic[index].ctx->sampleRate); + currentMusic[index].totalSamplesLeft -= size; + + if(currentMusic[index].totalSamplesLeft <= 0) active = false; // end if no more samples left + } + else + { + active = false; + TraceLog(WARNING, "No more data obtained from stream"); + } } TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); } - if (size > 0) - { - alBufferData(buffer, currentMusic.format, pcm, size*sizeof(short), currentMusic.sampleRate); - currentMusic.totalSamplesLeft -= size; - - if(currentMusic.totalSamplesLeft <= 0) active = false; // end if no more samples left - } - else - { - active = false; - TraceLog(WARNING, "No more data obtained from stream"); - } - return active; } // Empty music buffers -static void EmptyMusicStream(void) +static void EmptyMusicStream(int index) { ALuint buffer = 0; int queued = 0; - alGetSourcei(currentMusic.source, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(currentMusic[index].source, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(currentMusic.source, 1, &buffer); + alSourceUnqueueBuffers(currentMusic[index].source, 1, &buffer); queued--; } } // Update (re-fill) music buffers if data already processed -void UpdateMusicStream(void) +void UpdateMusicStream(int index) { ALuint buffer = 0; ALint processed = 0; bool active = true; - if (musicEnabled) + if (index < MAX_MUSIC_STREAMS && musicEnabled) { // Get the number of already processed buffers (if any) - alGetSourcei(currentMusic.source, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(currentMusic[index].source, AL_BUFFERS_PROCESSED, &processed); while (processed > 0) { // Recover processed buffer for refill - alSourceUnqueueBuffers(currentMusic.source, 1, &buffer); + alSourceUnqueueBuffers(currentMusic[index].source, 1, &buffer); // Refill buffer active = BufferMusicStream(buffer); // If no more data to stream, restart music (if loop) - if ((!active) && (currentMusic.loop)) + if ((!active) && (currentMusic[index].loop)) { - if(currentMusic.chipTune) + if(currentMusic[index].chipTune) { - currentMusic.totalSamplesLeft = currentMusic.totalLengthSeconds * currentMusic.sampleRate; + currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * currentMusic[index].ctx->sampleRate; } else { - stb_vorbis_seek_start(currentMusic.stream); - currentMusic.totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic.stream)*currentMusic.channels; + stb_vorbis_seek_start(currentMusic[index].stream); + currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream)*currentMusic[index].ctx->channels; } active = BufferMusicStream(buffer); } // Add refilled buffer to queue again... don't let the music stop! - alSourceQueueBuffers(currentMusic.source, 1, &buffer); + alSourceQueueBuffers(currentMusic[index].source, 1, &buffer); if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); @@ -1075,9 +1079,9 @@ void UpdateMusicStream(void) } ALenum state; - alGetSourcei(currentMusic.source, AL_SOURCE_STATE, &state); + alGetSourcei(currentMusic[index].source, AL_SOURCE_STATE, &state); - if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic.source); + if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].source); if (!active) StopMusicStream(); } diff --git a/src/audio.h b/src/audio.h index d09c4acc..63c1c136 100644 --- a/src/audio.h +++ b/src/audio.h @@ -101,14 +101,14 @@ void SetSoundVolume(Sound sound, float volume); // Set volume fo void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) -void UpdateMusicStream(void); // Updates buffers for music streaming +void UpdateMusicStream(int index); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) -float GetMusicTimeLength(void); // Get music time length (in seconds) -float GetMusicTimePlayed(void); // Get current music time played (in seconds) +float GetMusicTimeLength(int index); // Get music time length (in seconds) +float GetMusicTimePlayed(int index); // Get current music time played (in seconds) int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); diff --git a/src/raylib.h b/src/raylib.h index cb17aa78..05c945f7 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -895,14 +895,14 @@ void SetSoundVolume(Sound sound, float volume); // Set volume fo void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) -void UpdateMusicStream(void); // Updates buffers for music streaming +void UpdateMusicStream(int index); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) -float GetMusicTimeLength(void); // Get current music time length (in seconds) -float GetMusicTimePlayed(void); // Get current music time played (in seconds) +float GetMusicTimeLength(int index); // Get current music time length (in seconds) +float GetMusicTimePlayed(int index); // Get current music time played (in seconds) int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); -- cgit v1.2.3 From 075f51e0a3abfd9ebdfc66ee862f933a993105ca Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 12 May 2016 12:20:23 +0200 Subject: Simplified internal (default) dynamic buffers --- src/raylib.h | 2 +- src/rlgl.c | 200 ++++++++++++++++++++++++----------------------------------- src/rlgl.h | 2 +- 3 files changed, 84 insertions(+), 120 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 634ab143..911fd8b5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -376,7 +376,7 @@ typedef struct Mesh { float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) unsigned short *indices; // vertex indices (in case vertex data comes indexed) - int triangleCount; // number of triangles to draw + int triangleCount; // number of triangles stored (indexed or not) BoundingBox bounds; // mesh limits defined by min and max points diff --git a/src/rlgl.c b/src/rlgl.c index 3c0d9e79..0c0da221 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -128,54 +128,23 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -// Vertex buffer (position + color arrays) -// NOTE: Used for lines and triangles VAOs +// Dynamic vertex buffers (position + texcoords + colors + indices arrays) typedef struct { - int vCounter; - int cCounter; - float *vertices; // 3 components per vertex - unsigned char *colors; // 4 components per vertex -} VertexPositionColorBuffer; - -// Vertex buffer (position + texcoords + color arrays) -// NOTE: Not used -typedef struct { - int vCounter; - int tcCounter; - int cCounter; - float *vertices; // 3 components per vertex - float *texcoords; // 2 components per vertex - unsigned char *colors; // 4 components per vertex -} VertexPositionColorTextureBuffer; - -// Vertex buffer (position + texcoords + normals arrays) -// NOTE: Not used -typedef struct { - int vCounter; - int tcCounter; - int nCounter; - float *vertices; // 3 components per vertex - float *texcoords; // 2 components per vertex - float *normals; // 3 components per vertex - //short *normals; // NOTE: Less data load... but padding issues and normalizing required! -} VertexPositionTextureNormalBuffer; - -// Vertex buffer (position + texcoords + colors + indices arrays) -// NOTE: Used for quads VAO -typedef struct { - int vCounter; - int tcCounter; - int cCounter; - float *vertices; // 3 components per vertex - float *texcoords; // 2 components per vertex - unsigned char *colors; // 4 components per vertex + int vCounter; // vertex position counter to process (and draw) from full buffer + int tcCounter; // vertex texcoord counter to process (and draw) from full buffer + int cCounter; // vertex color counter to process (and draw) from full buffer + float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - unsigned int *indices; // 6 indices per quad (could be int) + unsigned int *indices; // vertex indices (in case vertex data comes indexed) (6 indices per quad) #elif defined(GRAPHICS_API_OPENGL_ES2) - unsigned short *indices; // 6 indices per quad (must be short) + unsigned short *indices; // vertex indices (in case vertex data comes indexed) (6 indices per quad) // NOTE: 6*2 byte = 12 byte, not alignment problem! #endif -} VertexPositionColorTextureIndexBuffer; + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int vboId[4]; // OpenGL Vertex Buffer Objects id (4 types of vertex data) +} DynamicBuffer; // Draw call type // NOTE: Used to track required draw-calls, organized by texture @@ -205,18 +174,9 @@ static DrawMode currentDrawMode; static float currentDepth = -1.0f; -// Default vertex buffers for lines, triangles and quads -static VertexPositionColorBuffer lines; // No texture support -static VertexPositionColorBuffer triangles; // No texture support -static VertexPositionColorTextureIndexBuffer quads; - -// Default vertex buffers VAOs (if supported) -static GLuint vaoLines, vaoTriangles, vaoQuads; - -// Default vertex buffers VBOs -static GLuint linesBuffer[2]; // Lines buffers (position, color) -static GLuint trianglesBuffer[2]; // Triangles buffers (position, color) -static GLuint quadsBuffer[4]; // Quads buffers (position, texcoord, color, index) +static DynamicBuffer lines; +static DynamicBuffer triangles; +static DynamicBuffer quads; // Default buffers draw calls static DrawCall *draws; @@ -1207,7 +1167,7 @@ void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) glEnableVertexAttribArray(material.shader.texcoord2Loc); } - if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } // Draw call! @@ -1692,7 +1652,6 @@ void rlglLoadMesh(Mesh *mesh) mesh->vboId[4] = 0; // Vertex tangents VBO mesh->vboId[5] = 0; // Vertex texcoords2 VBO mesh->vboId[6] = 0; // Vertex indices VBO - #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vaoId = 0; // Vertex Array Objects (VAO) @@ -2407,22 +2366,28 @@ static void LoadDefaultBuffers(void) // Lines - Initialize arrays (vertex position and color data) lines.vertices = (float *)malloc(sizeof(float)*3*2*MAX_LINES_BATCH); // 3 float by vertex, 2 vertex by line lines.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*2*MAX_LINES_BATCH); // 4 float by color, 2 colors by line + lines.texcoords = NULL; + lines.indices = NULL; for (int i = 0; i < (3*2*MAX_LINES_BATCH); i++) lines.vertices[i] = 0.0f; for (int i = 0; i < (4*2*MAX_LINES_BATCH); i++) lines.colors[i] = 0; lines.vCounter = 0; lines.cCounter = 0; + lines.tcCounter = 0; // Triangles - Initialize arrays (vertex position and color data) triangles.vertices = (float *)malloc(sizeof(float)*3*3*MAX_TRIANGLES_BATCH); // 3 float by vertex, 3 vertex by triangle triangles.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*3*MAX_TRIANGLES_BATCH); // 4 float by color, 3 colors by triangle + triangles.texcoords = NULL; + triangles.indices = NULL; for (int i = 0; i < (3*3*MAX_TRIANGLES_BATCH); i++) triangles.vertices[i] = 0.0f; for (int i = 0; i < (4*3*MAX_TRIANGLES_BATCH); i++) triangles.colors[i] = 0; triangles.vCounter = 0; triangles.cCounter = 0; + triangles.tcCounter = 0; // Quads - Initialize arrays (vertex position, texcoord, color data and indexes) quads.vertices = (float *)malloc(sizeof(float)*3*4*MAX_QUADS_BATCH); // 3 float by vertex, 4 vertex by quad @@ -2468,96 +2433,95 @@ static void LoadDefaultBuffers(void) if (vaoSupported) { // Initialize Lines VAO - glGenVertexArrays(1, &vaoLines); - glBindVertexArray(vaoLines); + glGenVertexArrays(1, &lines.vaoId); + glBindVertexArray(lines.vaoId); } - // Create buffers for our vertex data - glGenBuffers(2, linesBuffer); - // Lines - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); + glGenBuffers(2, &lines.vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*2*MAX_LINES_BATCH, lines.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); // Vertex color buffer (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); + glGenBuffers(2, &lines.vboId[1]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*2*MAX_LINES_BATCH, lines.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (lines)", vaoLines); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (lines)", linesBuffer[0], linesBuffer[1]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (lines)", lines.vaoId); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (lines)", lines.vboId[0], lines.vboId[1]); // Upload and link triangles vertex buffers if (vaoSupported) { // Initialize Triangles VAO - glGenVertexArrays(1, &vaoTriangles); - glBindVertexArray(vaoTriangles); + glGenVertexArrays(1, &triangles.vaoId); + glBindVertexArray(triangles.vaoId); } - // Create buffers for our vertex data - glGenBuffers(2, trianglesBuffer); - // Triangles - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); + glGenBuffers(1, &triangles.vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*3*MAX_TRIANGLES_BATCH, triangles.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); // Vertex color buffer (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); + glGenBuffers(1, &triangles.vboId[1]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*3*MAX_TRIANGLES_BATCH, triangles.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (triangles)", vaoTriangles); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully(triangles)", trianglesBuffer[0], trianglesBuffer[1]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (triangles)", triangles.vaoId); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully(triangles)", triangles.vboId[0], triangles.vboId[1]); // Upload and link quads vertex buffers if (vaoSupported) { // Initialize Quads VAO - glGenVertexArrays(1, &vaoQuads); - glBindVertexArray(vaoQuads); + glGenVertexArrays(1, &quads.vaoId); + glBindVertexArray(quads.vaoId); } - // Create buffers for our vertex data - glGenBuffers(4, quadsBuffer); - // Quads - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); + glGenBuffers(1, &quads.vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*MAX_QUADS_BATCH, quads.vertices, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.vertexLoc); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); // Vertex texcoord buffer (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); + glGenBuffers(1, &quads.vboId[1]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*MAX_QUADS_BATCH, quads.texcoords, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.texcoordLoc); glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); // Vertex color buffer (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); + glGenBuffers(1, &quads.vboId[2]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*4*MAX_QUADS_BATCH, quads.colors, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(currentShader.colorLoc); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); // Fill index buffer - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); + glGenBuffers(1, &quads.vboId[3]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); #if defined(GRAPHICS_API_OPENGL_33) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW); #elif defined(GRAPHICS_API_OPENGL_ES2) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(short)*6*MAX_QUADS_BATCH, quads.indices, GL_STATIC_DRAW); #endif - if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (quads)", vaoQuads); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (quads)", quadsBuffer[0], quadsBuffer[1], quadsBuffer[2], quadsBuffer[3]); + if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (quads)", quads.vaoId); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i][VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (quads)", quads.vboId[0], quads.vboId[1], quads.vboId[2], quads.vboId[3]); // Unbind the current VAO if (vaoSupported) glBindVertexArray(0); @@ -2573,15 +2537,15 @@ static void UpdateDefaultBuffers(void) if (lines.vCounter > 0) { // Activate Lines VAO - if (vaoSupported) glBindVertexArray(vaoLines); + if (vaoSupported) glBindVertexArray(lines.vaoId); // Lines - vertex positions buffer - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*2*MAX_LINES_BATCH, lines.vertices, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*lines.vCounter, lines.vertices); // target - offset (in bytes) - size (in bytes) - data pointer // Lines - colors buffer - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*2*MAX_LINES_BATCH, lines.colors, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*lines.cCounter, lines.colors); } @@ -2590,15 +2554,15 @@ static void UpdateDefaultBuffers(void) if (triangles.vCounter > 0) { // Activate Triangles VAO - if (vaoSupported) glBindVertexArray(vaoTriangles); + if (vaoSupported) glBindVertexArray(triangles.vaoId); // Triangles - vertex positions buffer - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*3*MAX_TRIANGLES_BATCH, triangles.vertices, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*triangles.vCounter, triangles.vertices); // Triangles - colors buffer - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*3*MAX_TRIANGLES_BATCH, triangles.colors, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*triangles.cCounter, triangles.colors); } @@ -2607,20 +2571,20 @@ static void UpdateDefaultBuffers(void) if (quads.vCounter > 0) { // Activate Quads VAO - if (vaoSupported) glBindVertexArray(vaoQuads); + if (vaoSupported) glBindVertexArray(quads.vaoId); // Quads - vertex positions buffer - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*4*MAX_QUADS_BATCH, quads.vertices, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*quads.vCounter, quads.vertices); // Quads - texture coordinates buffer - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[1]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*4*MAX_QUADS_BATCH, quads.texcoords, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*2*quads.vCounter, quads.texcoords); // Quads - colors buffer - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); //glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*4*MAX_QUADS_BATCH, quads.colors, GL_DYNAMIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*quads.vCounter, quads.colors); @@ -2659,17 +2623,17 @@ static void DrawDefaultBuffers(void) if (vaoSupported) { - glBindVertexArray(vaoLines); + glBindVertexArray(lines.vaoId); } else { // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(currentShader.vertexLoc); // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, linesBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); glEnableVertexAttribArray(currentShader.colorLoc); } @@ -2687,17 +2651,17 @@ static void DrawDefaultBuffers(void) if (vaoSupported) { - glBindVertexArray(vaoTriangles); + glBindVertexArray(triangles.vaoId); } else { // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(currentShader.vertexLoc); // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, trianglesBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); glEnableVertexAttribArray(currentShader.colorLoc); } @@ -2717,26 +2681,26 @@ static void DrawDefaultBuffers(void) if (vaoSupported) { - glBindVertexArray(vaoQuads); + glBindVertexArray(quads.vaoId); } else { // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[0]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(currentShader.vertexLoc); // Bind vertex attrib: texcoord (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[1]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[1]); glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(currentShader.texcoordLoc); // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, quadsBuffer[2]); + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); glEnableVertexAttribArray(currentShader.colorLoc); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quadsBuffer[3]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } //TraceLog(DEBUG, "Draws required per frame: %i", drawsCounter); @@ -2806,21 +2770,21 @@ static void UnloadDefaultBuffers(void) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); // Delete VBOs from GPU (VRAM) - glDeleteBuffers(1, &linesBuffer[0]); - glDeleteBuffers(1, &linesBuffer[1]); - glDeleteBuffers(1, &trianglesBuffer[0]); - glDeleteBuffers(1, &trianglesBuffer[1]); - glDeleteBuffers(1, &quadsBuffer[0]); - glDeleteBuffers(1, &quadsBuffer[1]); - glDeleteBuffers(1, &quadsBuffer[2]); - glDeleteBuffers(1, &quadsBuffer[3]); + glDeleteBuffers(1, &lines.vboId[0]); + glDeleteBuffers(1, &lines.vboId[1]); + glDeleteBuffers(1, &triangles.vboId[0]); + glDeleteBuffers(1, &triangles.vboId[1]); + glDeleteBuffers(1, &quads.vboId[0]); + glDeleteBuffers(1, &quads.vboId[1]); + glDeleteBuffers(1, &quads.vboId[2]); + glDeleteBuffers(1, &quads.vboId[3]); if (vaoSupported) { // Delete VAOs from GPU (VRAM) - glDeleteVertexArrays(1, &vaoLines); - glDeleteVertexArrays(1, &vaoTriangles); - glDeleteVertexArrays(1, &vaoQuads); + glDeleteVertexArrays(1, &lines.vaoId); + glDeleteVertexArrays(1, &triangles.vaoId); + glDeleteVertexArrays(1, &quads.vaoId); } // Free vertex arrays memory from CPU (RAM) diff --git a/src/rlgl.h b/src/rlgl.h index 6e694dae..7b88bc9e 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -147,7 +147,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) unsigned short *indices; // vertex indices (in case vertex data comes indexed) - int triangleCount; // number of triangles to draw + int triangleCount; // number of triangles stored (indexed or not) BoundingBox bounds; // mesh limits defined by min and max points -- cgit v1.2.3 From e060944b34f11978392f5c24282c95781caae63e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 12 May 2016 13:02:04 +0200 Subject: Added QuaternionInvert() --- src/raymath.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/raymath.h b/src/raymath.h index 52e92b50..59d66e56 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -158,6 +158,7 @@ RMDEF void PrintMatrix(Matrix m); // Print matrix ut //------------------------------------------------------------------------------------ RMDEF float QuaternionLength(Quaternion quat); // Compute the length of a quaternion RMDEF void QuaternionNormalize(Quaternion *q); // Normalize provided quaternion +RMDEF void QuaternionInvert(Quaternion *quat); // Invert provided quaternion RMDEF Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2); // Calculate two quaternion multiplication RMDEF Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float slerp); // Calculates spherical linear interpolation between two quaternions RMDEF Quaternion QuaternionFromMatrix(Matrix matrix); // Returns a quaternion for a given rotation matrix @@ -908,6 +909,23 @@ RMDEF void QuaternionNormalize(Quaternion *q) q->w *= ilength; } +// Invert provided quaternion +RMDEF void QuaternionInvert(Quaternion *quat) +{ + float length = QuaternionLength(*quat); + float lengthSq = length*length; + + if (lengthSq != 0.0) + { + float i = 1.0f/lengthSq; + + quat->x *= -i; + quat->y *= -i; + quat->z *= -i; + quat->w *= i; + } +} + // Calculate two quaternion multiplication RMDEF Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2) { -- cgit v1.2.3 From 83dbc076507b7025aa0a1315e409ff46f75c1e0b Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 12 May 2016 16:02:23 -0700 Subject: buffering of music now uses update audio context --- src/audio.c | 94 ++++++++++++++++++++--------------------------------------- src/easings.h | 10 +++---- 2 files changed, 37 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 94729566..cc964cd1 100644 --- a/src/audio.c +++ b/src/audio.c @@ -118,12 +118,12 @@ static Music currentMusic[MAX_MUSIC_STREAMS]; // Current //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static Wave LoadWAV(const char *fileName); // Load WAV file -static Wave LoadOGG(char *fileName); // Load OGG file -static void UnloadWave(Wave wave); // Unload wave data +static Wave LoadWAV(const char *fileName); // Load WAV file +static Wave LoadOGG(char *fileName); // Load OGG file +static void UnloadWave(Wave wave); // Unload wave data -static bool BufferMusicStream(int index, ALuint buffer); // Fill music buffers with data -static void EmptyMusicStream(int index); // Empty music buffers +static bool BufferMusicStream(int index); // Fill music buffers with data +static void EmptyMusicStream(int index); // Empty music buffers static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer);// fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in @@ -970,7 +970,7 @@ float GetMusicTimePlayed(int index) //---------------------------------------------------------------------------------- // Fill music buffers with new data from music stream -static bool BufferMusicStream(int index, ALuint buffer) +static bool BufferMusicStream(int index) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; @@ -985,33 +985,17 @@ static bool BufferMusicStream(int index, ALuint buffer) { int readlen = MUSIC_BUFFER_SIZE_FLOAT / 2; jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location + UpdateAudioContext(currentMusic[index].ctx, pcmf, MUSIC_BUFFER_SIZE_FLOAT); size += readlen * currentMusic[index].ctx->channels; // Not sure if this is what it needs - - alBufferData(buffer, currentMusic[index].ctx->alFormat, pcmf, size*sizeof(float), 48000); currentMusic[index].totalSamplesLeft -= size; if(currentMusic[index].totalSamplesLeft <= 0) active = false; } else { - while (size < MUSIC_BUFFER_SIZE_SHORT) - { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm + size, MUSIC_BUFFER_SIZE_SHORT - size); - if (streamedBytes > 0) size += (streamedBytes*currentMusic[index].ctx->channels); - else break; - } - - if (size > 0) - { - alBufferData(buffer, currentMusic[index].ctx->alFormat, pcm, size*sizeof(short), currentMusic[index].ctx->sampleRate); - currentMusic[index].totalSamplesLeft -= size; - - if(currentMusic[index].totalSamplesLeft <= 0) active = false; // end if no more samples left - } - else - { - active = false; - TraceLog(WARNING, "No more data obtained from stream"); - } + streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm, MUSIC_BUFFER_SIZE_SHORT); + UpdateAudioContext(currentMusic[index].ctx, pcm, MUSIC_BUFFER_SIZE_SHORT); + currentMusic[index].totalSamplesLeft -= MUSIC_BUFFER_SIZE_SHORT; + if(currentMusic[index].totalSamplesLeft <= 0) active = false; } TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); } @@ -1038,53 +1022,39 @@ static void EmptyMusicStream(int index) // Update (re-fill) music buffers if data already processed void UpdateMusicStream(int index) { - ALuint buffer = 0; - ALint processed = 0; + ALenum state; bool active = true; if (index < MAX_MUSIC_STREAMS && musicEnabled) { - // Get the number of already processed buffers (if any) - alGetSourcei(currentMusic[index].source, AL_BUFFERS_PROCESSED, &processed); - - while (processed > 0) + active = BufferMusicStream(index); + + if ((!active) && (currentMusic[index].loop)) { - // Recover processed buffer for refill - alSourceUnqueueBuffers(currentMusic[index].source, 1, &buffer); - - // Refill buffer - active = BufferMusicStream(buffer); - - // If no more data to stream, restart music (if loop) - if ((!active) && (currentMusic[index].loop)) + if(currentMusic[index].chipTune) { - if(currentMusic[index].chipTune) - { - currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * currentMusic[index].ctx->sampleRate; - } - else - { - stb_vorbis_seek_start(currentMusic[index].stream); - currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream)*currentMusic[index].ctx->channels; - } - active = BufferMusicStream(buffer); + currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * currentMusic[index].ctx->sampleRate; } + else + { + stb_vorbis_seek_start(currentMusic[index].stream); + currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream)*currentMusic[index].ctx->channels; + } + active = BufferMusicStream(index); + } + - // Add refilled buffer to queue again... don't let the music stop! - alSourceQueueBuffers(currentMusic[index].source, 1, &buffer); - - if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); + if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - processed--; - } + processed--; + } - ALenum state; - alGetSourcei(currentMusic[index].source, AL_SOURCE_STATE, &state); + + alGetSourcei(currentMusic[index].source, AL_SOURCE_STATE, &state); - if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].source); + if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].source); - if (!active) StopMusicStream(); - } + if (!active) StopMusicStream(); } // Load WAV file into Wave structure diff --git a/src/easings.h b/src/easings.h index e1e5465a..a8178f4a 100644 --- a/src/easings.h +++ b/src/easings.h @@ -18,11 +18,11 @@ * float speed = 1.f; * float currentTime = 0.f; * float currentPos[2] = {0,0}; -* float newPos[2] = {1,1}; -* float tempPosition[2] = currentPos;//x,y positions -* while(currentPos[0] < newPos[0]) -* currentPos[0] = EaseSineIn(currentTime, tempPosition[0], tempPosition[0]-newPos[0], speed); -* currentPos[1] = EaseSineIn(currentTime, tempPosition[1], tempPosition[1]-newPos[0], speed); +* float finalPos[2] = {1,1}; +* float startPosition[2] = currentPos;//x,y positions +* while(currentPos[0] < finalPos[0]) +* currentPos[0] = EaseSineIn(currentTime, startPosition[0], startPosition[0]-finalPos[0], speed); +* currentPos[1] = EaseSineIn(currentTime, startPosition[1], startPosition[1]-finalPos[0], speed); * currentTime += diffTime(); * * A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/) -- cgit v1.2.3 From 5107a2dc40330623f61205ee70f067d24afb0af8 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 12 May 2016 21:14:02 -0700 Subject: bug fixes --- src/audio.c | 69 +++++++++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index cc964cd1..d19d3306 100644 --- a/src/audio.c +++ b/src/audio.c @@ -77,19 +77,6 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -// Music type (file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed... -typedef struct Music { - stb_vorbis *stream; - jar_xm_context_t *chipctx; // Stores jar_xm context - AudioContext_t *ctx; // audio context - - int totalSamplesLeft; - float totalLengthSeconds; - bool loop; - bool chipTune; // True if chiptune is loaded -} Music; - // Audio Context, used to create custom audio streams that are not bound to a sound file. There can be // no more than 4 concurrent audio contexts in use. This is due to each active context being tied to // a dedicated mix channel. All audio is 32bit floating point in stereo. @@ -104,6 +91,19 @@ typedef struct AudioContext_t { ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer } AudioContext_t; +// Music type (file streaming from memory) +// NOTE: Anything longer than ~10 seconds should be streamed... +typedef struct Music { + stb_vorbis *stream; + jar_xm_context_t *chipctx; // Stores jar_xm context + AudioContext_t *ctx; // audio context + + int totalSamplesLeft; + float totalLengthSeconds; + bool loop; + bool chipTune; // True if chiptune is loaded +} Music; + #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif @@ -168,7 +168,10 @@ void InitAudioDevice(void) // Close the audio device for the current context, and destroys the context void CloseAudioDevice(void) { - StopMusicStream(); // Stop music streaming and close current stream + for(int index=0; index= MAX_AUDIO_CONTEXTS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); - else StopMusicStream(); if(!mixChannelsActive_g[mixChannel]){ AudioContext_t *ac = (AudioContext_t*)malloc(sizeof(AudioContext_t)); @@ -776,7 +778,6 @@ int PlayMusicStream(int musicIndex, char *fileName) else if(musicIndex = MAX_AUDIO_CONTEXTS - 1) return 2; // error } - if (strcmp(GetExtension(fileName),"ogg") == 0) { // Open audio stream @@ -888,12 +889,12 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(currentMusic[musicIndex].ctx){ - alGetSourcei(currentMusic[musicIndex].ctx->alSource, AL_SOURCE_STATE, &state); + if(currentMusic[index].ctx){ + alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(currentMusic[musicIndex].ctx->alSource); + alSourcePlay(currentMusic[index].ctx->alSource); musicEnabled = true; } } @@ -976,9 +977,8 @@ static bool BufferMusicStream(int index) float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; int size = 0; // Total size of data steamed (in bytes) - int streamedBytes = 0; // samples of data obtained, channels are not included in calculation bool active = true; // We can get more data from stream (not finished) - + if (musicEnabled) { if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. @@ -992,12 +992,12 @@ static bool BufferMusicStream(int index) } else { - streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm, MUSIC_BUFFER_SIZE_SHORT); - UpdateAudioContext(currentMusic[index].ctx, pcm, MUSIC_BUFFER_SIZE_SHORT); - currentMusic[index].totalSamplesLeft -= MUSIC_BUFFER_SIZE_SHORT; + int streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm, MUSIC_BUFFER_SIZE_SHORT); + UpdateAudioContext(currentMusic[index].ctx, pcm, streamedBytes); + currentMusic[index].totalSamplesLeft -= streamedBytes*currentMusic[index].ctx->channels; if(currentMusic[index].totalSamplesLeft <= 0) active = false; } - TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); + // TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); } return active; @@ -1009,11 +1009,11 @@ static void EmptyMusicStream(int index) ALuint buffer = 0; int queued = 0; - alGetSourcei(currentMusic[index].source, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(currentMusic[index].ctx->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(currentMusic[index].source, 1, &buffer); + alSourceUnqueueBuffers(currentMusic[index].ctx->alSource, 1, &buffer); queued--; } @@ -1045,16 +1045,17 @@ void UpdateMusicStream(int index) if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); + + alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); - processed--; - } - - - alGetSourcei(currentMusic[index].source, AL_SOURCE_STATE, &state); + if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].ctx->alSource); - if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].source); + if (!active) StopMusicStream(index); + + } + else + return; - if (!active) StopMusicStream(); } // Load WAV file into Wave structure -- cgit v1.2.3 From b46a8005979bb626f4e7a7199932c4b85e9efb3a Mon Sep 17 00:00:00 2001 From: Chris Hemingway Date: Sat, 14 May 2016 01:10:05 +0100 Subject: Make GRAPHICS_API_OPENGL_33 work on OSX, closes #113 --- src/core.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index 54d42f83..a94ad48d 100644 --- a/src/core.c +++ b/src/core.c @@ -1447,7 +1447,11 @@ static void InitDisplay(int width, int height) glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE +#ifdef __APPLE__ + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires +#else glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! +#endif //glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); } -- cgit v1.2.3 From ea4b5552c2b4ff8a907dd1fefc084317187af168 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sat, 14 May 2016 00:25:40 -0700 Subject: corrected typos --- src/audio.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index d19d3306..c53d6318 100644 --- a/src/audio.c +++ b/src/audio.c @@ -85,7 +85,7 @@ typedef struct AudioContext_t { unsigned char channels; // 1=mono,2=stereo unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream bool floatingPoint; // if false then the short datatype is used instead - bool playing; + bool playing; // false if paused ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer @@ -165,13 +165,14 @@ void InitAudioDevice(void) alListener3f(AL_ORIENTATION, 0, 0, -1); } -// Close the audio device for the current context, and destroys the context +// Close the audio device for all contexts void CloseAudioDevice(void) { for(int index=0; indexplaying = true; currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * info.channels; currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); @@ -822,6 +824,7 @@ int PlayMusicStream(int musicIndex, char *fileName) currentMusic[musicIndex].totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic[musicIndex].chipctx); currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled = true; + currentMusic[musicIndex].ctx->playing = true; TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); @@ -859,16 +862,21 @@ void StopMusicStream(int index) } if(!getMusicStreamCount()) musicEnabled = false; + if(currentMusic[index].stream || currentMusic[index].chipctx) + { + currentMusic[index].stream = NULL; + currentMusic[index].chipctx = NULL; + } } } //get number of music channels active at this time, this does not mean they are playing int getMusicStreamCount(void) { - int musicCount; + int musicCount = 0; for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot if(currentMusic[musicIndex].stream != NULL || currentMusic[musicIndex].chipTune) musicCount++; - + return musicCount; } @@ -876,11 +884,11 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (musicEnabled) + if (currentMusic[index].ctx && musicEnabled) { TraceLog(INFO, "Pausing music stream"); - UpdateAudioContext(currentMusic[index].ctx, NULL, 0); // pushing null data auto pauses stream - musicEnabled = false; + alSourcePause(currentMusic[index].ctx->alSource); + currentMusic[index].ctx->playing = false; } } @@ -895,7 +903,7 @@ void ResumeMusicStream(int index) { TraceLog(INFO, "Resuming music stream"); alSourcePlay(currentMusic[index].ctx->alSource); - musicEnabled = true; + currentMusic[index].ctx->playing = true; } } } @@ -981,13 +989,17 @@ static bool BufferMusicStream(int index) if (musicEnabled) { + if(!currentMusic[index].ctx->playing) + { + UpdateAudioContext(currentMusic[index].ctx, NULL, 0); + return false; + } + if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - int readlen = MUSIC_BUFFER_SIZE_FLOAT / 2; - jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, readlen); // reads 2*readlen shorts and moves them to buffer+size memory location + jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, MUSIC_BUFFER_SIZE_FLOAT / 2); // reads 2*readlen shorts and moves them to buffer+size memory location UpdateAudioContext(currentMusic[index].ctx, pcmf, MUSIC_BUFFER_SIZE_FLOAT); - size += readlen * currentMusic[index].ctx->channels; // Not sure if this is what it needs - currentMusic[index].totalSamplesLeft -= size; + currentMusic[index].totalSamplesLeft -= MUSIC_BUFFER_SIZE_FLOAT; if(currentMusic[index].totalSamplesLeft <= 0) active = false; } else @@ -997,7 +1009,7 @@ static bool BufferMusicStream(int index) currentMusic[index].totalSamplesLeft -= streamedBytes*currentMusic[index].ctx->channels; if(currentMusic[index].totalSamplesLeft <= 0) active = false; } - // TraceLog(DEBUG, "Streaming music data to buffer. Bytes streamed: %i", size); + TraceLog(DEBUG, "Buffering index:%i, chiptune:%i", index, (int)currentMusic[index].chipTune); } return active; -- cgit v1.2.3 From 8c5d403dda7a7070dc58204bb10539b3646f183b Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sat, 14 May 2016 15:26:17 -0700 Subject: new function to check if music stream is ready _g naming convention for globals, new error exit numbers. --- src/audio.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index c53d6318..0fd1bb13 100644 --- a/src/audio.c +++ b/src/audio.c @@ -112,7 +112,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; // Global Variables Definition //---------------------------------------------------------------------------------- static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active -static bool musicEnabled = false; +static bool musicEnabled_g = false; static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time //---------------------------------------------------------------------------------- @@ -126,8 +126,9 @@ static bool BufferMusicStream(int index); // Fill music buffers with da static void EmptyMusicStream(int index); // Empty music buffers static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer);// fill buffer with zeros, returns number processed -static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in -static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // pass two arrays of same length in +static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in +static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // pass two arrays of same length in +static bool isMusicStreamReady(int index); // Checks if music buffer is ready to be refilled #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -799,18 +800,21 @@ int PlayMusicStream(int musicIndex, char *fileName) TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); currentMusic[musicIndex].loop = true; // We loop by default - musicEnabled = true; - currentMusic[musicIndex].ctx->playing = true; + musicEnabled_g = true; + currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * info.channels; currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); if (info.channels == 2){ currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 2, false); + currentMusic[musicIndex].ctx->playing = true; } else{ currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 1, false); + currentMusic[musicIndex].ctx->playing = true; } + if(!currentMusic[musicIndex].ctx) return 4; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) @@ -823,24 +827,25 @@ int PlayMusicStream(int musicIndex, char *fileName) jar_xm_set_max_loop_count(currentMusic[musicIndex].chipctx, 0); // infinite number of loops currentMusic[musicIndex].totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic[musicIndex].chipctx); currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; - musicEnabled = true; - currentMusic[musicIndex].ctx->playing = true; + musicEnabled_g = true; TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); currentMusic[musicIndex].ctx = InitAudioContext(48000, mixIndex, 2, true); + if(!currentMusic[musicIndex].ctx) return 5; // error + currentMusic[musicIndex].ctx->playing = true; } else { TraceLog(WARNING, "[%s] XM file could not be opened", fileName); - return 4; // error + return 6; // error } } else { TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); - return 5; // error + return 7; // error } return 0; // normal return } @@ -861,7 +866,7 @@ void StopMusicStream(int index) stb_vorbis_close(currentMusic[index].stream); } - if(!getMusicStreamCount()) musicEnabled = false; + if(!getMusicStreamCount()) musicEnabled_g = false; if(currentMusic[index].stream || currentMusic[index].chipctx) { currentMusic[index].stream = NULL; @@ -884,7 +889,7 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (currentMusic[index].ctx && musicEnabled) + if (currentMusic[index].ctx && musicEnabled_g) { TraceLog(INFO, "Pausing music stream"); alSourcePause(currentMusic[index].ctx->alSource); @@ -987,7 +992,7 @@ static bool BufferMusicStream(int index) int size = 0; // Total size of data steamed (in bytes) bool active = true; // We can get more data from stream (not finished) - if (musicEnabled) + if (musicEnabled_g) { if(!currentMusic[index].ctx->playing) { @@ -1031,13 +1036,25 @@ static void EmptyMusicStream(int index) } } +//determine if a music stream is ready to be written to +static bool isMusicStreamReady(int index) +{ + ALint processed = 0; + alGetSourcei(currentMusic[index].ctx->alSource, AL_BUFFERS_PROCESSED, &processed); + + if(processed) + return true; + + return false; +} + // Update (re-fill) music buffers if data already processed void UpdateMusicStream(int index) { ALenum state; bool active = true; - if (index < MAX_MUSIC_STREAMS && musicEnabled) + if (index < MAX_MUSIC_STREAMS && musicEnabled_g && isMusicStreamReady(index)) { active = BufferMusicStream(index); -- cgit v1.2.3 From d38d7a1bedadf7c4824c9bb1d4a9ecd3f0935b9c Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sat, 14 May 2016 16:30:32 -0700 Subject: clean up on buffering and preconditions --- src/audio.c | 89 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 0fd1bb13..30e2343f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -889,7 +889,7 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (currentMusic[index].ctx && musicEnabled_g) + if (index < MAX_MUSIC_STREAMS && currentMusic[index].ctx && musicEnabled_g) { TraceLog(INFO, "Pausing music stream"); alSourcePause(currentMusic[index].ctx->alSource); @@ -902,7 +902,7 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(currentMusic[index].ctx){ + if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { @@ -962,17 +962,20 @@ float GetMusicTimeLength(int index) float GetMusicTimePlayed(int index) { float secondsPlayed; - if (currentMusic[index].chipTune) - { - uint64_t samples; - jar_xm_get_position(currentMusic[index].chipctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000 * currentMusic[index].ctx->channels); // Not sure if this is the correct value - } - else + if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx) { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; - int samplesPlayed = totalSamples - currentMusic[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic[index].ctx->sampleRate * currentMusic[index].ctx->channels); + if (currentMusic[index].chipTune) + { + uint64_t samples; + jar_xm_get_position(currentMusic[index].chipctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000 * currentMusic[index].ctx->channels); // Not sure if this is the correct value + } + else + { + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; + int samplesPlayed = totalSamples - currentMusic[index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (currentMusic[index].ctx->sampleRate * currentMusic[index].ctx->channels); + } } @@ -989,33 +992,42 @@ static bool BufferMusicStream(int index) short pcm[MUSIC_BUFFER_SIZE_SHORT]; float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; - int size = 0; // Total size of data steamed (in bytes) + int size = 0; // Total size of data steamed in L+R samples bool active = true; // We can get more data from stream (not finished) - if (musicEnabled_g) + + if(!currentMusic[index].ctx->playing && currentMusic[index].totalSamplesLeft > 0) { - if(!currentMusic[index].ctx->playing) - { - UpdateAudioContext(currentMusic[index].ctx, NULL, 0); - return false; - } - - if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. - { - jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, MUSIC_BUFFER_SIZE_FLOAT / 2); // reads 2*readlen shorts and moves them to buffer+size memory location - UpdateAudioContext(currentMusic[index].ctx, pcmf, MUSIC_BUFFER_SIZE_FLOAT); - currentMusic[index].totalSamplesLeft -= MUSIC_BUFFER_SIZE_FLOAT; - if(currentMusic[index].totalSamplesLeft <= 0) active = false; - } + UpdateAudioContext(currentMusic[index].ctx, NULL, 0); + return true; // it is still active, only it is paused + } + + + if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + { + if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT / 2) + size = MUSIC_BUFFER_SIZE_FLOAT / 2; else - { - int streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm, MUSIC_BUFFER_SIZE_SHORT); - UpdateAudioContext(currentMusic[index].ctx, pcm, streamedBytes); - currentMusic[index].totalSamplesLeft -= streamedBytes*currentMusic[index].ctx->channels; - if(currentMusic[index].totalSamplesLeft <= 0) active = false; - } - TraceLog(DEBUG, "Buffering index:%i, chiptune:%i", index, (int)currentMusic[index].chipTune); + size = currentMusic[index].totalSamplesLeft / 2; + + jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location + UpdateAudioContext(currentMusic[index].ctx, pcmf, size * 2); + currentMusic[index].totalSamplesLeft -= size * 2; } + else + { + if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) + size = MUSIC_BUFFER_SIZE_SHORT; + else + size = currentMusic[index].totalSamplesLeft; + + int streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic[index].stream, currentMusic[index].ctx->channels, pcm, size); + UpdateAudioContext(currentMusic[index].ctx, pcm, streamedBytes * currentMusic[index].ctx->channels); + currentMusic[index].totalSamplesLeft -= streamedBytes * currentMusic[index].ctx->channels; + } + + TraceLog(DEBUG, "Buffering index:%i, chiptune:%i", index, (int)currentMusic[index].chipTune); + if(currentMusic[index].totalSamplesLeft <= 0) active = false; return active; } @@ -1042,8 +1054,7 @@ static bool isMusicStreamReady(int index) ALint processed = 0; alGetSourcei(currentMusic[index].ctx->alSource, AL_BUFFERS_PROCESSED, &processed); - if(processed) - return true; + if(processed) return true; return false; } @@ -1054,11 +1065,11 @@ void UpdateMusicStream(int index) ALenum state; bool active = true; - if (index < MAX_MUSIC_STREAMS && musicEnabled_g && isMusicStreamReady(index)) + if (index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic[index].ctx && isMusicStreamReady(index)) { active = BufferMusicStream(index); - if ((!active) && (currentMusic[index].loop)) + if (!active && currentMusic[index].loop && currentMusic[index].ctx->playing) { if(currentMusic[index].chipTune) { @@ -1067,7 +1078,7 @@ void UpdateMusicStream(int index) else { stb_vorbis_seek_start(currentMusic[index].stream); - currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream)*currentMusic[index].ctx->channels; + currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; } active = BufferMusicStream(index); } -- cgit v1.2.3 From 86fbf4fd8f0cd5301259b2115125c45c9872c02a Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 15 May 2016 02:09:57 -0700 Subject: logic bug fix --- src/audio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 30e2343f..cc5ca1a2 100644 --- a/src/audio.c +++ b/src/audio.c @@ -996,10 +996,10 @@ static bool BufferMusicStream(int index) bool active = true; // We can get more data from stream (not finished) - if(!currentMusic[index].ctx->playing && currentMusic[index].totalSamplesLeft > 0) + if (!currentMusic[index].ctx->playing && currentMusic[index].totalSamplesLeft > 0) { UpdateAudioContext(currentMusic[index].ctx, NULL, 0); - return true; // it is still active, only it is paused + return true; // it is still active but it is paused } @@ -1071,7 +1071,7 @@ void UpdateMusicStream(int index) if (!active && currentMusic[index].loop && currentMusic[index].ctx->playing) { - if(currentMusic[index].chipTune) + if (currentMusic[index].chipTune) { currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * currentMusic[index].ctx->sampleRate; } @@ -1080,7 +1080,7 @@ void UpdateMusicStream(int index) stb_vorbis_seek_start(currentMusic[index].stream); currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; } - active = BufferMusicStream(index); + active = true; } @@ -1088,7 +1088,7 @@ void UpdateMusicStream(int index) alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); - if ((state != AL_PLAYING) && active) alSourcePlay(currentMusic[index].ctx->alSource); + if (state != AL_PLAYING && active && currentMusic[index].ctx->playing) alSourcePlay(currentMusic[index].ctx->alSource); if (!active) StopMusicStream(index); -- cgit v1.2.3 From 76ff4d220ee735b8b86bd4dae776665cf68e4fb4 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Sun, 15 May 2016 19:37:15 -0700 Subject: renamed everything so it is obvious what it does --- src/audio.c | 380 ++++++++++++++++++++++++++++------------------------------- src/audio.h | 15 +-- src/raylib.h | 15 +-- 3 files changed, 190 insertions(+), 220 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index cc5ca1a2..584d3ad1 100644 --- a/src/audio.c +++ b/src/audio.c @@ -77,10 +77,10 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be -// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to -// a dedicated mix channel. All audio is 32bit floating point in stereo. -typedef struct AudioContext_t { +// Used to create custom audio streams that are not bound to a specific file. There can be +// no more than 4 concurrent mixchannels in use. This is due to each active mixc being tied to +// a dedicated mix channel. +typedef struct MixChannel_t { unsigned short sampleRate; // default is 48000 unsigned char channels; // 1=mono,2=stereo unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream @@ -89,14 +89,14 @@ typedef struct AudioContext_t { ALenum alFormat; // openAL format specifier ALuint alSource; // openAL source ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer -} AudioContext_t; +} MixChannel_t; // Music type (file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed... +// NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... typedef struct Music { stb_vorbis *stream; - jar_xm_context_t *chipctx; // Stores jar_xm context - AudioContext_t *ctx; // audio context + jar_xm_context_t *chipctx; // Stores jar_xm mixc + MixChannel_t *mixc; // mix channel int totalSamplesLeft; float totalLengthSeconds; @@ -111,9 +111,9 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static AudioContext_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active +static MixChannel_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active static bool musicEnabled_g = false; -static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -122,13 +122,17 @@ static Wave LoadWAV(const char *fileName); // Load WAV file static Wave LoadOGG(char *fileName); // Load OGG file static void UnloadWave(Wave wave); // Unload wave data -static bool BufferMusicStream(int index); // Fill music buffers with data -static void EmptyMusicStream(int index); // Empty music buffers +static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data +static void EmptyMusicStream(int index); // Empty music buffers -static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer);// fill buffer with zeros, returns number processed -static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // pass two arrays of the same legnth in -static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // pass two arrays of same length in -static bool isMusicStreamReady(int index); // Checks if music buffer is ready to be refilled + +static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. +static void CloseMixChannel(MixChannel_t* mixc); // Frees mix channel +static unsigned short BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses +static unsigned short FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed +static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in +static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in +static int IsMusicStreamReadyForBuffering(int index); // Checks if music buffer is ready to be refilled #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -139,7 +143,7 @@ void TraceLog(int msgType, const char *text, ...); // Outputs a trace log messa // Module Functions Definition - Audio Device initialization and Closing //---------------------------------------------------------------------------------- -// Initialize audio device and context +// Initialize audio device and mixc void InitAudioDevice(void) { // Open and initialize a device with default settings @@ -155,7 +159,7 @@ void InitAudioDevice(void) alcCloseDevice(device); - TraceLog(ERROR, "Could not setup audio context"); + TraceLog(ERROR, "Could not setup mix channel"); } TraceLog(INFO, "Audio device and context initialized successfully: %s", alcGetString(device, ALC_DEVICE_SPECIFIER)); @@ -171,14 +175,14 @@ void CloseAudioDevice(void) { for(int index=0; index= MAX_AUDIO_CONTEXTS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); if(!mixChannelsActive_g[mixChannel]){ - AudioContext_t *ac = (AudioContext_t*)malloc(sizeof(AudioContext_t)); - ac->sampleRate = sampleRate; - ac->channels = channels; - ac->mixChannel = mixChannel; - ac->floatingPoint = floatingPoint; - mixChannelsActive_g[mixChannel] = ac; + MixChannel_t *mixc = (MixChannel_t*)malloc(sizeof(MixChannel_t)); + mixc->sampleRate = sampleRate; + mixc->channels = channels; + mixc->mixChannel = mixChannel; + mixc->floatingPoint = floatingPoint; + mixChannelsActive_g[mixChannel] = mixc; // setup openAL format if(channels == 1) { if(floatingPoint) - ac->alFormat = AL_FORMAT_MONO_FLOAT32; + mixc->alFormat = AL_FORMAT_MONO_FLOAT32; else - ac->alFormat = AL_FORMAT_MONO16; + mixc->alFormat = AL_FORMAT_MONO16; } else if(channels == 2) { if(floatingPoint) - ac->alFormat = AL_FORMAT_STEREO_FLOAT32; + mixc->alFormat = AL_FORMAT_STEREO_FLOAT32; else - ac->alFormat = AL_FORMAT_STEREO16; + mixc->alFormat = AL_FORMAT_STEREO16; } // Create an audio source - alGenSources(1, &ac->alSource); - alSourcef(ac->alSource, AL_PITCH, 1); - alSourcef(ac->alSource, AL_GAIN, 1); - alSource3f(ac->alSource, AL_POSITION, 0, 0, 0); - alSource3f(ac->alSource, AL_VELOCITY, 0, 0, 0); + alGenSources(1, &mixc->alSource); + alSourcef(mixc->alSource, AL_PITCH, 1); + alSourcef(mixc->alSource, AL_GAIN, 1); + alSource3f(mixc->alSource, AL_POSITION, 0, 0, 0); + alSource3f(mixc->alSource, AL_VELOCITY, 0, 0, 0); // Create Buffer - alGenBuffers(MAX_STREAM_BUFFERS, ac->alBuffer); + alGenBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); //fill buffers int x; for(x=0;xalBuffer[x]); + FillAlBufferWithSilence(mixc, mixc->alBuffer[x]); - alSourceQueueBuffers(ac->alSource, MAX_STREAM_BUFFERS, ac->alBuffer); - alSourcePlay(ac->alSource); - ac->playing = true; + alSourceQueueBuffers(mixc->alSource, MAX_STREAM_BUFFERS, mixc->alBuffer); + mixc->playing = true; + alSourcePlay(mixc->alSource); - return ac; + return mixc; } return NULL; } -// Frees buffer in audio context -void CloseAudioContext(AudioContext ctx) +// Frees buffer in mix channel +static void CloseMixChannel(MixChannel_t* mixc) { - AudioContext_t *context = (AudioContext_t*)ctx; - if(context){ - alSourceStop(context->alSource); - context->playing = false; + if(mixc){ + alSourceStop(mixc->alSource); + mixc->playing = false; //flush out all queued buffers ALuint buffer = 0; int queued = 0; - alGetSourcei(context->alSource, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(mixc->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(context->alSource, 1, &buffer); + alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); queued--; } //delete source and buffers - alDeleteSources(1, &context->alSource); - alDeleteBuffers(MAX_STREAM_BUFFERS, context->alBuffer); - mixChannelsActive_g[context->mixChannel] = NULL; - free(context); - ctx = NULL; + alDeleteSources(1, &mixc->alSource); + alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); + mixChannelsActive_g[mixc->mixChannel] = NULL; + free(mixc); + mixc = NULL; } } -// Pushes more audio data into context mix channel, if none are ever pushed then zeros are fed in. -// Call "UpdateAudioContext(ctx, NULL, 0)" if you want to pause the audio. +// Pushes more audio data into mixc mix channel, only one buffer per call +// Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. -unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements) +static unsigned short BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) { - AudioContext_t *context = (AudioContext_t*)ctx; - - if(!context || (context->channels == 2 && numberElements % 2 != 0)) return 0; // when there is two channels there must be an even number of samples + if(!mixc || mixChannelsActive_g[mixc->mixChannel] != mixc) return 0; // when there is two channels there must be an even number of samples if (!data || !numberElements) { // pauses audio until data is given - alSourcePause(context->alSource); - context->playing = false; + if(mixc->playing){ + alSourcePause(mixc->alSource); + mixc->playing = false; + } return 0; } - else + else if(!mixc->playing) { // restart audio otherwise - ALint state; - alGetSourcei(context->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING){ - alSourcePlay(context->alSource); - context->playing = true; - } + alSourcePlay(mixc->alSource); + mixc->playing = true; } - if (context && context->playing && mixChannelsActive_g[context->mixChannel] == context) + + ALuint buffer = 0; + + alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); + if(!buffer) return 0; + if(mixc->floatingPoint) // process float buffers { - ALint processed = 0; - ALuint buffer = 0; - unsigned short numberProcessed = 0; - unsigned short numberRemaining = numberElements; - - - alGetSourcei(context->alSource, AL_BUFFERS_PROCESSED, &processed); // Get the number of already processed buffers (if any) - if(!processed) return 0; // nothing to process, queue is still full - - - while (processed > 0) - { - if(context->floatingPoint) // process float buffers - { - float *ptr = (float*)data; - alSourceUnqueueBuffers(context->alSource, 1, &buffer); - if(numberRemaining >= MUSIC_BUFFER_SIZE_FLOAT) - { - alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), context->sampleRate); - numberProcessed+=MUSIC_BUFFER_SIZE_FLOAT; - numberRemaining-=MUSIC_BUFFER_SIZE_FLOAT; - } - else - { - alBufferData(buffer, context->alFormat, &ptr[numberProcessed], numberRemaining*sizeof(float), context->sampleRate); - numberProcessed+=numberRemaining; - numberRemaining=0; - } - alSourceQueueBuffers(context->alSource, 1, &buffer); - processed--; - } - else if(!context->floatingPoint) // process short buffers - { - short *ptr = (short*)data; - alSourceUnqueueBuffers(context->alSource, 1, &buffer); - if(numberRemaining >= MUSIC_BUFFER_SIZE_SHORT) - { - alBufferData(buffer, context->alFormat, &ptr[numberProcessed], MUSIC_BUFFER_SIZE_FLOAT*sizeof(short), context->sampleRate); - numberProcessed+=MUSIC_BUFFER_SIZE_SHORT; - numberRemaining-=MUSIC_BUFFER_SIZE_SHORT; - } - else - { - alBufferData(buffer, context->alFormat, &ptr[numberProcessed], numberRemaining*sizeof(short), context->sampleRate); - numberProcessed+=numberRemaining; - numberRemaining=0; - } - alSourceQueueBuffers(context->alSource, 1, &buffer); - processed--; - } - else - break; - } - return numberProcessed; + float *ptr = (float*)data; + alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(float), mixc->sampleRate); + } + else // process short buffers + { + short *ptr = (short*)data; + alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(short), mixc->sampleRate); } - return 0; + alSourceQueueBuffers(mixc->alSource, 1, &buffer); + + return numberElements; } // fill buffer with zeros, returns number processed -static unsigned short FillAlBufferWithSilence(AudioContext_t *context, ALuint buffer) +static unsigned short FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) { - if(context->floatingPoint){ + if(mixc->floatingPoint){ float pcm[MUSIC_BUFFER_SIZE_FLOAT] = {0.f}; - alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), context->sampleRate); + alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), mixc->sampleRate); return MUSIC_BUFFER_SIZE_FLOAT; } else { short pcm[MUSIC_BUFFER_SIZE_SHORT] = {0}; - alBufferData(buffer, context->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), context->sampleRate); + alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); return MUSIC_BUFFER_SIZE_SHORT; } } @@ -417,6 +376,28 @@ static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) } } +// used to output raw audio streams, returns negative numbers on error +RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint) +{ + int mixIndex; + for(mixIndex = 0; mixIndex < MAX_AUDIO_CONTEXTS; mixIndex++) // find empty mix channel slot + { + if(mixChannelsActive_g[mixIndex] == NULL) break; + else if(mixIndex = MAX_AUDIO_CONTEXTS - 1) return -1; // error + } + + if(InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) + return mixIndex; + else + return -2; // error +} + +void CloseRawAudioContext(RawAudioContext ctx) +{ + if(mixChannelsActive_g[ctx]) + CloseMixChannel(mixChannelsActive_g[ctx]); +} + //---------------------------------------------------------------------------------- @@ -807,14 +788,14 @@ int PlayMusicStream(int musicIndex, char *fileName) currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); if (info.channels == 2){ - currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 2, false); - currentMusic[musicIndex].ctx->playing = true; + currentMusic[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + currentMusic[musicIndex].mixc->playing = true; } else{ - currentMusic[musicIndex].ctx = InitAudioContext(info.sample_rate, mixIndex, 1, false); - currentMusic[musicIndex].ctx->playing = true; + currentMusic[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + currentMusic[musicIndex].mixc->playing = true; } - if(!currentMusic[musicIndex].ctx) return 4; // error + if(!currentMusic[musicIndex].mixc) return 4; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) @@ -832,9 +813,9 @@ int PlayMusicStream(int musicIndex, char *fileName) TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); - currentMusic[musicIndex].ctx = InitAudioContext(48000, mixIndex, 2, true); - if(!currentMusic[musicIndex].ctx) return 5; // error - currentMusic[musicIndex].ctx->playing = true; + currentMusic[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); + if(!currentMusic[musicIndex].mixc) return 5; // error + currentMusic[musicIndex].mixc->playing = true; } else { @@ -853,9 +834,9 @@ int PlayMusicStream(int musicIndex, char *fileName) // Stop music playing for individual music index of currentMusic array (close stream) void StopMusicStream(int index) { - if (index < MAX_MUSIC_STREAMS && currentMusic[index].ctx) + if (index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) { - CloseAudioContext(currentMusic[index].ctx); + CloseMixChannel(currentMusic[index].mixc); if (currentMusic[index].chipTune) { @@ -889,11 +870,11 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && currentMusic[index].ctx && musicEnabled_g) + if (index < MAX_MUSIC_STREAMS && currentMusic[index].mixc && musicEnabled_g) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(currentMusic[index].ctx->alSource); - currentMusic[index].ctx->playing = false; + alSourcePause(currentMusic[index].mixc->alSource); + currentMusic[index].mixc->playing = false; } } @@ -902,13 +883,13 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ - alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ + alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(currentMusic[index].ctx->alSource); - currentMusic[index].ctx->playing = true; + alSourcePlay(currentMusic[index].mixc->alSource); + currentMusic[index].mixc->playing = true; } } } @@ -919,8 +900,8 @@ bool IsMusicPlaying(int index) bool playing = false; ALint state; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ - alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ + alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PLAYING) playing = true; } @@ -930,15 +911,15 @@ bool IsMusicPlaying(int index) // Set volume for music void SetMusicVolume(int index, float volume) { - if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ - alSourcef(currentMusic[index].ctx->alSource, AL_GAIN, volume); + if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ + alSourcef(currentMusic[index].mixc->alSource, AL_GAIN, volume); } } void SetMusicPitch(int index, float pitch) { - if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx){ - alSourcef(currentMusic[index].ctx->alSource, AL_PITCH, pitch); + if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ + alSourcef(currentMusic[index].mixc->alSource, AL_PITCH, pitch); } } @@ -962,19 +943,19 @@ float GetMusicTimeLength(int index) float GetMusicTimePlayed(int index) { float secondsPlayed; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].ctx) + if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) { if (currentMusic[index].chipTune) { uint64_t samples; jar_xm_get_position(currentMusic[index].chipctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000 * currentMusic[index].ctx->channels); // Not sure if this is the correct value + secondsPlayed = (float)samples / (48000 * currentMusic[index].mixc->channels); // Not sure if this is the correct value } else { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].mixc->channels; int samplesPlayed = totalSamples - currentMusic[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic[index].ctx->sampleRate * currentMusic[index].ctx->channels); + secondsPlayed = (float)samplesPlayed / (currentMusic[index].mixc->sampleRate * currentMusic[index].mixc->channels); } } @@ -987,32 +968,32 @@ float GetMusicTimePlayed(int index) //---------------------------------------------------------------------------------- // Fill music buffers with new data from music stream -static bool BufferMusicStream(int index) +static bool BufferMusicStream(int index, int numBuffers) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; - int size = 0; // Total size of data steamed in L+R samples + int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - - - if (!currentMusic[index].ctx->playing && currentMusic[index].totalSamplesLeft > 0) - { - UpdateAudioContext(currentMusic[index].ctx, NULL, 0); - return true; // it is still active but it is paused - } - if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT / 2) - size = MUSIC_BUFFER_SIZE_FLOAT / 2; + if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) + size = MUSIC_BUFFER_SIZE_SHORT / 2; else size = currentMusic[index].totalSamplesLeft / 2; - - jar_xm_generate_samples(currentMusic[index].chipctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location - UpdateAudioContext(currentMusic[index].ctx, pcmf, size * 2); - currentMusic[index].totalSamplesLeft -= size * 2; + + for(int x=0; xchannels, pcm, size); - UpdateAudioContext(currentMusic[index].ctx, pcm, streamedBytes * currentMusic[index].ctx->channels); - currentMusic[index].totalSamplesLeft -= streamedBytes * currentMusic[index].ctx->channels; + for(int x=0; xchannels, pcm, size); + BufferMixChannel(currentMusic[index].mixc, pcm, streamedBytes * currentMusic[index].mixc->channels); + currentMusic[index].totalSamplesLeft -= streamedBytes * currentMusic[index].mixc->channels; + if(currentMusic[index].totalSamplesLeft <= 0) + { + active = false; + break; + } + } } - - TraceLog(DEBUG, "Buffering index:%i, chiptune:%i", index, (int)currentMusic[index].chipTune); - if(currentMusic[index].totalSamplesLeft <= 0) active = false; return active; } @@ -1038,25 +1024,22 @@ static void EmptyMusicStream(int index) ALuint buffer = 0; int queued = 0; - alGetSourcei(currentMusic[index].ctx->alSource, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(currentMusic[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(currentMusic[index].ctx->alSource, 1, &buffer); + alSourceUnqueueBuffers(currentMusic[index].mixc->alSource, 1, &buffer); queued--; } } //determine if a music stream is ready to be written to -static bool isMusicStreamReady(int index) +static int IsMusicStreamReadyForBuffering(int index) { ALint processed = 0; - alGetSourcei(currentMusic[index].ctx->alSource, AL_BUFFERS_PROCESSED, &processed); - - if(processed) return true; - - return false; + alGetSourcei(currentMusic[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + return processed; } // Update (re-fill) music buffers if data already processed @@ -1064,21 +1047,22 @@ void UpdateMusicStream(int index) { ALenum state; bool active = true; - - if (index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic[index].ctx && isMusicStreamReady(index)) + int numBuffers = IsMusicStreamReadyForBuffering(index); + + if (currentMusic[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic[index].mixc && numBuffers) { - active = BufferMusicStream(index); + active = BufferMusicStream(index, numBuffers); - if (!active && currentMusic[index].loop && currentMusic[index].ctx->playing) + if (!active && currentMusic[index].loop) { if (currentMusic[index].chipTune) { - currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * currentMusic[index].ctx->sampleRate; + currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * 48000; } else { stb_vorbis_seek_start(currentMusic[index].stream); - currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].ctx->channels; + currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].mixc->channels; } active = true; } @@ -1086,9 +1070,9 @@ void UpdateMusicStream(int index) if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - alGetSourcei(currentMusic[index].ctx->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING && active && currentMusic[index].ctx->playing) alSourcePlay(currentMusic[index].ctx->alSource); + if (state != AL_PLAYING && active) alSourcePlay(currentMusic[index].mixc->alSource); if (!active) StopMusicStream(index); diff --git a/src/audio.h b/src/audio.h index 63c1c136..d3276bf6 100644 --- a/src/audio.h +++ b/src/audio.h @@ -61,10 +61,7 @@ typedef struct Wave { short channels; } Wave; -// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be -// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to -// a dedicated mix channel. -typedef void* AudioContext; +typedef int RawAudioContext; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -82,13 +79,6 @@ void InitAudioDevice(void); // Initialize au void CloseAudioDevice(void); // Close the audio device and context (and music stream) bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet -// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing -// The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); -void CloseAudioContext(AudioContext ctx); // Frees audio context -unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played - Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) @@ -112,6 +102,9 @@ float GetMusicTimePlayed(int index); // Get current m int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); +RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); +void CloseRawAudioContext(RawAudioContext ctx); + #ifdef __cplusplus } #endif diff --git a/src/raylib.h b/src/raylib.h index ea9fbfcb..6efde710 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -451,10 +451,7 @@ typedef struct Wave { short channels; } Wave; -// Audio Context, used to create custom audio streams that are not bound to a sound file. There can be -// no more than 4 concurrent audio contexts in use. This is due to each active context being tied to -// a dedicated mix channel. -typedef void* AudioContext; +typedef int RawAudioContext; // Texture formats // NOTE: Support depends on OpenGL version and platform @@ -876,13 +873,6 @@ void InitAudioDevice(void); // Initialize au void CloseAudioDevice(void); // Close the audio device and context (and music stream) bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet -// Audio contexts are for outputing custom audio waveforms, This will shut down any other sound sources currently playing -// The mixChannel is what mix channel you want to operate on, 0-3 are the ones available. Each mix channel can only be used one at a time. -// exmple usage is InitAudioContext(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point -AudioContext InitAudioContext(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); -void CloseAudioContext(AudioContext ctx); // Frees audio context -unsigned short UpdateAudioContext(AudioContext ctx, void *data, unsigned short numberElements); // Pushes more audio data into context mix channel, if NULL is passed to data then zeros are played - Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) @@ -906,6 +896,9 @@ float GetMusicTimePlayed(int index); // Get current m int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); +RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); // used to output raw audio streams, returns negative numbers on error +void CloseRawAudioContext(RawAudioContext ctx); + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 037edbaa1322a2174d91c7aeacc9170f5b6913cb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 18 May 2016 13:22:14 +0200 Subject: Reorganize data for consistency --- src/models.c | 54 ++------ src/rlgl.c | 431 ++++++++++++++++++++++++++++++++++++----------------------- src/rlgl.h | 9 +- 3 files changed, 283 insertions(+), 211 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 066b919e..bb2d56c2 100644 --- a/src/models.c +++ b/src/models.c @@ -691,31 +691,14 @@ Model LoadCubicmap(Image cubicmap) return model; } -// Unload 3d model from memory +// Unload 3d model from memory (mesh and material) void UnloadModel(Model model) { - // Unload mesh data - if (model.mesh.vertices != NULL) free(model.mesh.vertices); - if (model.mesh.texcoords != NULL) free(model.mesh.texcoords); - if (model.mesh.normals != NULL) free(model.mesh.normals); - if (model.mesh.colors != NULL) free(model.mesh.colors); - if (model.mesh.tangents != NULL) free(model.mesh.tangents); - if (model.mesh.texcoords2 != NULL) free(model.mesh.texcoords2); - if (model.mesh.indices != NULL) free(model.mesh.indices); - - TraceLog(INFO, "Unloaded model data from RAM (CPU)"); - - rlDeleteBuffers(model.mesh.vboId[0]); // vertex - rlDeleteBuffers(model.mesh.vboId[1]); // texcoords - rlDeleteBuffers(model.mesh.vboId[2]); // normals - rlDeleteBuffers(model.mesh.vboId[3]); // colors - rlDeleteBuffers(model.mesh.vboId[4]); // tangents - rlDeleteBuffers(model.mesh.vboId[5]); // texcoords2 - rlDeleteBuffers(model.mesh.vboId[6]); // indices - - rlDeleteVertexArrays(model.mesh.vaoId); - + rlglUnloadMesh(&model.mesh); + UnloadMaterial(model.material); + + TraceLog(INFO, "Unloaded model data from RAM and VRAM"); } // Load material data (from file) @@ -1247,40 +1230,27 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); model.material.colDiffuse = tint; - rlglDrawEx(model.mesh, model.material, model.transform, false); + rlglDrawMesh(model.mesh, model.material, model.transform); } // Draw a model wires (with texture if set) void DrawModelWires(Model model, Vector3 position, float scale, Color tint) { - Vector3 vScale = { scale, scale, scale }; - Vector3 rotationAxis = { 0.0f, 0.0f, 0.0f }; - - // Calculate transformation matrix from function parameters - // Get transform matrix (rotation -> scale -> translation) - Matrix matRotation = MatrixRotate(rotationAxis, 0.0f); - Matrix matScale = MatrixScale(vScale.x, vScale.y, vScale.z); - Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); + rlEnableWireMode(); - model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - model.material.colDiffuse = tint; + DrawModel(model, position, scale, tint); - rlglDrawEx(model.mesh, model.material, model.transform, true); + rlDisableWireMode(); } // Draw a model wires (with texture if set) with extended parameters void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { - // Calculate transformation matrix from function parameters - // Get transform matrix (rotation -> scale -> translation) - Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); - Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); - Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); + rlEnableWireMode(); - model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - model.material.colDiffuse = tint; + DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint); - rlglDrawEx(model.mesh, model.material, model.transform, true); + rlDisableWireMode(); } // Draw a billboard diff --git a/src/rlgl.c b/src/rlgl.c index 0c0da221..8e725521 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -740,6 +740,24 @@ void rlDisableDepthTest(void) glDisable(GL_DEPTH_TEST); } +// Enable wire mode +void rlEnableWireMode(void) +{ +#if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) + // NOTE: glPolygonMode() not available on OpenGL ES + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif +} + +// Disable wire mode +void rlDisableWireMode(void) +{ +#if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) + // NOTE: glPolygonMode() not available on OpenGL ES + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif +} + // Unload texture from GPU memory void rlDeleteTextures(unsigned int id) { @@ -1033,175 +1051,15 @@ void rlglClose(void) void rlglDraw(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - UpdateDefaultBuffers(); - DrawDefaultBuffers(); -#endif -} - -// Draw a 3d mesh with material and transform -void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires) -{ -#if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - // NOTE: glPolygonMode() not available on OpenGL ES - if (wires) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); -#endif - -#if defined(GRAPHICS_API_OPENGL_11) - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); - - // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model - glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array - glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array - if (mesh.normals != NULL) glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array - if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array - - glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array - glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array - if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array - if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array - - rlPushMatrix(); - rlMultMatrixf(MatrixToFloat(transform)); - rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); - - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, mesh.indices); - else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); - rlPopMatrix(); - - glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array - glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array - if (mesh.normals != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array - if (mesh.colors != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable colors array - - glDisable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, 0); -#endif - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - glUseProgram(material.shader.id); - - // At this point the modelview matrix just contains the view matrix (camera) - // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() - Matrix matView = modelview; // View matrix (camera) - Matrix matProjection = projection; // Projection matrix (perspective) - - // Calculate model-view matrix combining matModel and matView - Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates - - // Calculate model-view-projection matrix (MVP) - Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates - - // Send combined model-view-projection matrix to shader - glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - - // Apply color tinting (material.colDiffuse) - // NOTE: Just update one uniform on fragment shader - float vColor[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; - glUniform4fv(material.shader.tintColorLoc, 1, vColor); - - // Set shader textures (diffuse, normal, specular) - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); - glUniform1i(material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 - - if ((material.texNormal.id != 0) && (material.shader.mapNormalLoc != -1)) - { - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, material.texNormal.id); - glUniform1i(material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 - } - - if ((material.texSpecular.id != 0) && (material.shader.mapSpecularLoc != -1)) - { - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); - glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 - } - - if (vaoSupported) - { - glBindVertexArray(mesh.vaoId); - } - else - { - // Bind mesh VBO data: vertex position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); - glVertexAttribPointer(material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.vertexLoc); - - // Bind mesh VBO data: vertex texcoords (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); - glVertexAttribPointer(material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.texcoordLoc); - - // Bind mesh VBO data: vertex normals (shader-location = 2, if available) - if (material.shader.normalLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); - glVertexAttribPointer(material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.normalLoc); - } - - // Bind mesh VBO data: vertex colors (shader-location = 3, if available) , tangents, texcoords2 (if available) - if (material.shader.colorLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); - glVertexAttribPointer(material.shader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(material.shader.colorLoc); - } - - // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) - if (material.shader.tangentLoc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); - glVertexAttribPointer(material.shader.tangentLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.tangentLoc); - } - - // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) - if (material.shader.texcoord2Loc != -1) - { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); - glVertexAttribPointer(material.shader.texcoord2Loc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(material.shader.texcoord2Loc); - } - - if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); - } - - // Draw call! - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw - else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); - - if (material.texNormal.id != 0) - { - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, 0); - } - - if (material.texSpecular.id != 0) - { - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, 0); - } - - glActiveTexture(GL_TEXTURE0); // Set shader active texture to default 0 - glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures - - if (vaoSupported) glBindVertexArray(0); // Unbind VAO - else +/* + for (int i = 0; i < modelsCount; i++) { - glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind VBOs - if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + rlglDrawMesh(models[i]->mesh, models[i]->material, models[i]->transform); } - - glUseProgram(0); // Unbind shader program -#endif - -#if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) - // NOTE: glPolygonMode() not available on OpenGL ES - if (wires) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +*/ + // NOTE: Default buffers always drawn at the end + UpdateDefaultBuffers(); + DrawDefaultBuffers(); #endif } @@ -1776,6 +1634,245 @@ void rlglLoadMesh(Mesh *mesh) #endif } +// Update vertex data on GPU (upload new data to one buffer) +void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) +{ + // Activate mesh VAO + if (vaoSupported) glBindVertexArray(mesh.vaoId); + + switch (buffer) + { + case 0: // Update vertices (vertex position) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.vertices, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.vertices); + + } break; + case 1: // Update texcoords (vertex texture coordinates) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*numVertex, mesh.texcoords, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*2*numVertex, mesh.texcoords); + + } break; + case 2: // Update normals (vertex normals) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.normals, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.normals); + + } break; + case 3: // Update colors (vertex colors) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*numVertex, mesh.colors, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*numVertex, mesh.colors); + + } break; + case 4: // Update tangents (vertex tangents) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.tangents, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.tangents); + } break; + case 5: // Update texcoords2 (vertex second texture coordinates) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); + if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*numVertex, mesh.texcoords2, GL_DYNAMIC_DRAW); + else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*2*numVertex, mesh.texcoords2); + } break; + default: break; + } + + // Unbind the current VAO + if (vaoSupported) glBindVertexArray(0); + + // Another option would be using buffer mapping... + //mesh.vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); + // Now we can modify vertices + //glUnmapBuffer(GL_ARRAY_BUFFER); +} + +// Draw a 3d mesh with material and transform +void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) +{ +#if defined(GRAPHICS_API_OPENGL_11) + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); + + // NOTE: On OpenGL 1.1 we use Vertex Arrays to draw model + glEnableClientState(GL_VERTEX_ARRAY); // Enable vertex array + glEnableClientState(GL_TEXTURE_COORD_ARRAY); // Enable texture coords array + if (mesh.normals != NULL) glEnableClientState(GL_NORMAL_ARRAY); // Enable normals array + if (mesh.colors != NULL) glEnableClientState(GL_COLOR_ARRAY); // Enable colors array + + glVertexPointer(3, GL_FLOAT, 0, mesh.vertices); // Pointer to vertex coords array + glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array + if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array + if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array + + rlPushMatrix(); + rlMultMatrixf(MatrixToFloat(transform)); + rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); + + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, mesh.indices); + else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + rlPopMatrix(); + + glDisableClientState(GL_VERTEX_ARRAY); // Disable vertex array + glDisableClientState(GL_TEXTURE_COORD_ARRAY); // Disable texture coords array + if (mesh.normals != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable normals array + if (mesh.colors != NULL) glDisableClientState(GL_NORMAL_ARRAY); // Disable colors array + + glDisable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, 0); +#endif + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + glUseProgram(material.shader.id); + + // At this point the modelview matrix just contains the view matrix (camera) + // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() + Matrix matView = modelview; // View matrix (camera) + Matrix matProjection = projection; // Projection matrix (perspective) + + // Calculate model-view matrix combining matModel and matView + Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates + + // Calculate model-view-projection matrix (MVP) + Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates + + // Send combined model-view-projection matrix to shader + glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + + // Apply color tinting (material.colDiffuse) + // NOTE: Just update one uniform on fragment shader + float vColor[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; + glUniform4fv(material.shader.tintColorLoc, 1, vColor); + + // Set shader textures (diffuse, normal, specular) + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); + glUniform1i(material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 + + if ((material.texNormal.id != 0) && (material.shader.mapNormalLoc != -1)) + { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, material.texNormal.id); + glUniform1i(material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 + } + + if ((material.texSpecular.id != 0) && (material.shader.mapSpecularLoc != -1)) + { + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); + glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 + } + + if (vaoSupported) + { + glBindVertexArray(mesh.vaoId); + } + else + { + // Bind mesh VBO data: vertex position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + glVertexAttribPointer(material.shader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.vertexLoc); + + // Bind mesh VBO data: vertex texcoords (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); + glVertexAttribPointer(material.shader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.texcoordLoc); + + // Bind mesh VBO data: vertex normals (shader-location = 2, if available) + if (material.shader.normalLoc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); + glVertexAttribPointer(material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.normalLoc); + } + + // Bind mesh VBO data: vertex colors (shader-location = 3, if available) , tangents, texcoords2 (if available) + if (material.shader.colorLoc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); + glVertexAttribPointer(material.shader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(material.shader.colorLoc); + } + + // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) + if (material.shader.tangentLoc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); + glVertexAttribPointer(material.shader.tangentLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.tangentLoc); + } + + // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) + if (material.shader.texcoord2Loc != -1) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); + glVertexAttribPointer(material.shader.texcoord2Loc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(material.shader.texcoord2Loc); + } + + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); + } + + // Draw call! + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw + else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + + if (material.texNormal.id != 0) + { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, 0); + } + + if (material.texSpecular.id != 0) + { + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, 0); + } + + glActiveTexture(GL_TEXTURE0); // Set shader active texture to default 0 + glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures + + if (vaoSupported) glBindVertexArray(0); // Unbind VAO + else + { + glBindBuffer(GL_ARRAY_BUFFER, 0); // Unbind VBOs + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + + glUseProgram(0); // Unbind shader program +#endif +} + +// Unload mesh data from CPU and GPU +void rlglUnloadMesh(Mesh *mesh) +{ + if (mesh->vertices != NULL) free(mesh->vertices); + if (mesh->texcoords != NULL) free(mesh->texcoords); + if (mesh->normals != NULL) free(mesh->normals); + if (mesh->colors != NULL) free(mesh->colors); + if (mesh->tangents != NULL) free(mesh->tangents); + if (mesh->texcoords2 != NULL) free(mesh->texcoords2); + if (mesh->indices != NULL) free(mesh->indices); + + rlDeleteBuffers(mesh->vboId[0]); // vertex + rlDeleteBuffers(mesh->vboId[1]); // texcoords + rlDeleteBuffers(mesh->vboId[2]); // normals + rlDeleteBuffers(mesh->vboId[3]); // colors + rlDeleteBuffers(mesh->vboId[4]); // tangents + rlDeleteBuffers(mesh->vboId[5]); // texcoords2 + rlDeleteBuffers(mesh->vboId[6]); // indices + + rlDeleteVertexArrays(mesh->vaoId); +} + // Read screen pixel data (color buffer) unsigned char *rlglReadScreenPixels(int width, int height) { diff --git a/src/rlgl.h b/src/rlgl.h index 7b88bc9e..a33e3a0a 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -256,6 +256,8 @@ void rlEnableRenderTexture(unsigned int id); // Enable render texture (fbo) void rlDisableRenderTexture(void); // Disable render texture (fbo), return to default framebuffer void rlEnableDepthTest(void); // Enable depth test void rlDisableDepthTest(void); // Disable depth test +void rlEnableWireMode(void); // Enable wire mode +void rlDisableWireMode(void); // Disable wire mode void rlDeleteTextures(unsigned int id); // Delete OpenGL texture from GPU void rlDeleteRenderTextures(RenderTexture2D target); // Delete render textures (fbo) from GPU void rlDeleteShader(unsigned int id); // Delete OpenGL shader program from GPU @@ -277,8 +279,11 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data void rlglGenerateMipmaps(Texture2D texture); // Generate mipmap data for selected texture -void rlglLoadMesh(Mesh *mesh); // Upload vertex data into GPU and provided VAO/VBO ids -void rlglDrawEx(Mesh mesh, Material material, Matrix transform, bool wires); + +void rlglLoadMesh(Mesh *mesh); // Upload vertex data into GPU and provided VAO/VBO ids +void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex); // Update vertex data on GPU (upload new data to one buffer) +void rlglDrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform +void rlglUnloadMesh(Mesh *mesh); // Unload mesh data from CPU and GPU Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view); // Get world coordinates from screen coordinates -- cgit v1.2.3 From 8bbbe8cd76d93bc85810fd13a6cb6c4df18bd30d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 19 May 2016 13:50:29 +0200 Subject: Corrected namings --- src/rlgl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 8e725521..888a9313 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2425,12 +2425,12 @@ static void LoadDefaultShaderLocations(Shader *shader) // vertex texcoord2 location = 5 // Get handles to GLSL input attibute locations - shader->vertexLoc = glGetAttribLocation(shader->id, "vertexPosition"); - shader->texcoordLoc = glGetAttribLocation(shader->id, "vertexTexCoord"); - shader->normalLoc = glGetAttribLocation(shader->id, "vertexNormal"); - shader->colorLoc = glGetAttribLocation(shader->id, "vertexColor"); - shader->tangentLoc = glGetAttribLocation(shader->id, "vertexTangent"); - shader->texcoord2Loc = glGetAttribLocation(shader->id, "vertexTexCoord2"); + shader->vertexLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_POSITION_NAME); + shader->texcoordLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD_NAME); + shader->normalLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_NORMAL_NAME); + shader->colorLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_COLOR_NAME); + shader->tangentLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TANGENT_NAME); + shader->texcoord2Loc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD2_NAME); // Get handles to GLSL uniform locations (vertex shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); @@ -2447,8 +2447,8 @@ static void UnloadDefaultShader(void) { glUseProgram(0); - //glDetachShader(defaultShaderProgram, vertexShader); - //glDetachShader(defaultShaderProgram, fragmentShader); + //glDetachShader(defaultShader, vertexShader); + //glDetachShader(defaultShader, fragmentShader); //glDeleteShader(vertexShader); // Already deleted on shader compilation //glDeleteShader(fragmentShader); // Already deleted on sahder compilation glDeleteProgram(defaultShader.id); -- cgit v1.2.3 From b10425492ac692d7c53001290e3d0b678df634b0 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 19 May 2016 15:22:12 -0700 Subject: name correction --- src/audio.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 584d3ad1..6d8f876c 100644 --- a/src/audio.c +++ b/src/audio.c @@ -59,9 +59,9 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_STREAM_BUFFERS 2 -#define MAX_AUDIO_CONTEXTS 4 // Number of open AL sources -#define MAX_MUSIC_STREAMS 2 +#define MAX_STREAM_BUFFERS 2 // Number of buffers for each alSource +#define MAX_MIX_CHANNELS 4 // Number of open AL sources +#define MAX_MUSIC_STREAMS 2 // Number of simultanious music sources #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) // NOTE: On RPI and Android should be lower to avoid frame-stalls @@ -96,12 +96,12 @@ typedef struct MixChannel_t { typedef struct Music { stb_vorbis *stream; jar_xm_context_t *chipctx; // Stores jar_xm mixc - MixChannel_t *mixc; // mix channel + MixChannel_t *mixc; // mix channel int totalSamplesLeft; float totalLengthSeconds; bool loop; - bool chipTune; // True if chiptune is loaded + bool chipTune; // True if chiptune is loaded } Music; #if defined(AUDIO_STANDALONE) @@ -111,7 +111,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static MixChannel_t* mixChannelsActive_g[MAX_AUDIO_CONTEXTS]; // What mix channels are currently active +static MixChannel_t* mixChannelsActive_g[MAX_MIX_CHANNELS]; // What mix channels are currently active static bool musicEnabled_g = false; static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time @@ -123,7 +123,7 @@ static Wave LoadOGG(char *fileName); // Load OGG file static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data -static void EmptyMusicStream(int index); // Empty music buffers +static void EmptyMusicStream(int index); // Empty music buffers static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. @@ -212,7 +212,7 @@ bool IsAudioDeviceReady(void) // exmple usage is InitMixChannel(48000, 0, 2, true); // mixchannel 1, 48khz, stereo, floating point static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint) { - if(mixChannel >= MAX_AUDIO_CONTEXTS) return NULL; + if(mixChannel >= MAX_MIX_CHANNELS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); if(!mixChannelsActive_g[mixChannel]){ @@ -380,10 +380,10 @@ static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint) { int mixIndex; - for(mixIndex = 0; mixIndex < MAX_AUDIO_CONTEXTS; mixIndex++) // find empty mix channel slot + for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_AUDIO_CONTEXTS - 1) return -1; // error + else if(mixIndex = MAX_MIX_CHANNELS - 1) return -1; // error } if(InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) @@ -755,10 +755,10 @@ int PlayMusicStream(int musicIndex, char *fileName) if(currentMusic[musicIndex].stream || currentMusic[musicIndex].chipctx) return 1; // error - for(mixIndex = 0; mixIndex < MAX_AUDIO_CONTEXTS; mixIndex++) // find empty mix channel slot + for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_AUDIO_CONTEXTS - 1) return 2; // error + else if(mixIndex = MAX_MIX_CHANNELS - 1) return 2; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) -- cgit v1.2.3 From 41c5f3a0178027e9b74e563ab102f603a53e35bf Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 19 May 2016 20:44:09 -0700 Subject: Buffer for raw audio --- src/audio.c | 22 ++++++++++++++++++---- src/audio.h | 4 ++++ src/raylib.h | 6 +++++- 3 files changed, 27 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 6d8f876c..43e8be14 100644 --- a/src/audio.c +++ b/src/audio.c @@ -128,8 +128,8 @@ static void EmptyMusicStream(int index); // Empty music buffers static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. static void CloseMixChannel(MixChannel_t* mixc); // Frees mix channel -static unsigned short BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses -static unsigned short FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed +static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses +static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in static int IsMusicStreamReadyForBuffering(int index); // Checks if music buffer is ready to be refilled @@ -292,7 +292,7 @@ static void CloseMixChannel(MixChannel_t* mixc) // Pushes more audio data into mixc mix channel, only one buffer per call // Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. -static unsigned short BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) +static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) { if(!mixc || mixChannelsActive_g[mixc->mixChannel] != mixc) return 0; // when there is two channels there must be an even number of samples @@ -331,7 +331,7 @@ static unsigned short BufferMixChannel(MixChannel_t* mixc, void *data, int numbe } // fill buffer with zeros, returns number processed -static unsigned short FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) +static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) { if(mixc->floatingPoint){ float pcm[MUSIC_BUFFER_SIZE_FLOAT] = {0.f}; @@ -377,6 +377,7 @@ static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) } // used to output raw audio streams, returns negative numbers on error +// if floating point is false the data size is 16bit short, otherwise it is float 32bit RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint) { int mixIndex; @@ -398,6 +399,19 @@ void CloseRawAudioContext(RawAudioContext ctx) CloseMixChannel(mixChannelsActive_g[ctx]); } +int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements) +{ + int numBuffered = 0; + if(ctx >= 0) + { + MixChannel_t* mixc = mixChannelsActive_g[ctx]; + numBuffered = BufferMixChannel(mixc, data, numberElements); + } + return numBuffered; +} + + + //---------------------------------------------------------------------------------- diff --git a/src/audio.h b/src/audio.h index d3276bf6..1140a60a 100644 --- a/src/audio.h +++ b/src/audio.h @@ -102,8 +102,12 @@ float GetMusicTimePlayed(int index); // Get current m int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); +// used to output raw audio streams, returns negative numbers on error +// if floating point is false the data size is 16bit short, otherwise it is float 32bit RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); + void CloseRawAudioContext(RawAudioContext ctx); +int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements); // returns number of elements buffered #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index 6efde710..986dc7bf 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -896,8 +896,12 @@ float GetMusicTimePlayed(int index); // Get current m int getMusicStreamCount(void); void SetMusicPitch(int index, float pitch); -RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); // used to output raw audio streams, returns negative numbers on error +// used to output raw audio streams, returns negative numbers on error +// if floating point is false the data size is 16bit short, otherwise it is float 32bit +RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); + void CloseRawAudioContext(RawAudioContext ctx); +int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements); // returns number of elements buffered #ifdef __cplusplus } -- cgit v1.2.3 From 179f2f9e4fd9ad43e120f186484a78984a2ac063 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 19 May 2016 20:56:38 -0700 Subject: windows automated compile Only works when raylib is installed on windows system. --- src/windows_compile.bat | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/windows_compile.bat (limited to 'src') diff --git a/src/windows_compile.bat b/src/windows_compile.bat new file mode 100644 index 00000000..f1d0fb29 --- /dev/null +++ b/src/windows_compile.bat @@ -0,0 +1,2 @@ +set PATH=C:\raylib\MinGW\bin;%PATH% +mingw32-make \ No newline at end of file -- cgit v1.2.3 From 7d1d9ff143cd7c6c55d3fd891b43e143431ea15f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 09:36:02 +0200 Subject: Support DYNAMIC_DRAW mesh loading --- src/models.c | 10 +++++----- src/raylib.h | 2 +- src/rlgl.c | 17 ++++++++++------- src/rlgl.h | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index bb2d56c2..6d72d1e3 100644 --- a/src/models.c +++ b/src/models.c @@ -553,7 +553,7 @@ Model LoadModel(const char *fileName) if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); else { - rlglLoadMesh(&model.mesh); // Upload vertex data to GPU + rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -563,13 +563,13 @@ Model LoadModel(const char *fileName) } // Load a 3d model (from vertex data) -Model LoadModelEx(Mesh data) +Model LoadModelEx(Mesh data, bool dynamic) { Model model = { 0 }; model.mesh = data; - rlglLoadMesh(&model.mesh); // Upload vertex data to GPU + rlglLoadMesh(&model.mesh, dynamic); // Upload vertex data to GPU model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -668,7 +668,7 @@ Model LoadHeightmap(Image heightmap, Vector3 size) model.mesh = GenMeshHeightmap(heightmap, size); - rlglLoadMesh(&model.mesh); + rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -683,7 +683,7 @@ Model LoadCubicmap(Image cubicmap) model.mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0, 1.0, 1.5f }); - rlglLoadMesh(&model.mesh); + rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); diff --git a/src/raylib.h b/src/raylib.h index 986dc7bf..8a46ec35 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -803,7 +803,7 @@ void DrawGizmo(Vector3 position); // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) -Model LoadModelEx(Mesh data); // Load a 3d model (from mesh data) +Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) diff --git a/src/rlgl.c b/src/rlgl.c index 888a9313..cc2b8942 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1500,7 +1500,7 @@ void rlglGenerateMipmaps(Texture2D texture) } // Upload vertex data into a VAO (if supported) and VBO -void rlglLoadMesh(Mesh *mesh) +void rlglLoadMesh(Mesh *mesh, bool dynamic) { mesh->vaoId = 0; // Vertex Array Object mesh->vboId[0] = 0; // Vertex positions VBO @@ -1510,6 +1510,9 @@ void rlglLoadMesh(Mesh *mesh) mesh->vboId[4] = 0; // Vertex tangents VBO mesh->vboId[5] = 0; // Vertex texcoords2 VBO mesh->vboId[6] = 0; // Vertex indices VBO + + int drawHint = GL_STATIC_DRAW; + if (dynamic) drawHint = GL_DYNAMIC_DRAW; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vaoId = 0; // Vertex Array Objects (VAO) @@ -1527,14 +1530,14 @@ void rlglLoadMesh(Mesh *mesh) // Enable vertex attributes: position (shader-location = 0) glGenBuffers(1, &vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, vboId[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->vertices, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->vertices, drawHint); glVertexAttribPointer(0, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(0); // Enable vertex attributes: texcoords (shader-location = 1) glGenBuffers(1, &vboId[1]); glBindBuffer(GL_ARRAY_BUFFER, vboId[1]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords, drawHint); glVertexAttribPointer(1, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(1); @@ -1543,7 +1546,7 @@ void rlglLoadMesh(Mesh *mesh) { glGenBuffers(1, &vboId[2]); glBindBuffer(GL_ARRAY_BUFFER, vboId[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->normals, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->normals, drawHint); glVertexAttribPointer(2, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(2); } @@ -1559,7 +1562,7 @@ void rlglLoadMesh(Mesh *mesh) { glGenBuffers(1, &vboId[3]); glBindBuffer(GL_ARRAY_BUFFER, vboId[3]); - glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*mesh->vertexCount, mesh->colors, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(unsigned char)*4*mesh->vertexCount, mesh->colors, drawHint); glVertexAttribPointer(3, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); glEnableVertexAttribArray(3); } @@ -1575,7 +1578,7 @@ void rlglLoadMesh(Mesh *mesh) { glGenBuffers(1, &vboId[4]); glBindBuffer(GL_ARRAY_BUFFER, vboId[4]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->tangents, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*mesh->vertexCount, mesh->tangents, drawHint); glVertexAttribPointer(4, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(4); } @@ -1591,7 +1594,7 @@ void rlglLoadMesh(Mesh *mesh) { glGenBuffers(1, &vboId[5]); glBindBuffer(GL_ARRAY_BUFFER, vboId[5]); - glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords2, GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*mesh->vertexCount, mesh->texcoords2, drawHint); glVertexAttribPointer(5, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(5); } diff --git a/src/rlgl.h b/src/rlgl.h index a33e3a0a..a557ffa2 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -280,7 +280,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a textur void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data void rlglGenerateMipmaps(Texture2D texture); // Generate mipmap data for selected texture -void rlglLoadMesh(Mesh *mesh); // Upload vertex data into GPU and provided VAO/VBO ids +void rlglLoadMesh(Mesh *mesh, bool dynamic); // Upload vertex data into GPU and provided VAO/VBO ids void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex); // Update vertex data on GPU (upload new data to one buffer) void rlglDrawMesh(Mesh mesh, Material material, Matrix transform); // Draw a 3d mesh with material and transform void rlglUnloadMesh(Mesh *mesh); // Unload mesh data from CPU and GPU -- cgit v1.2.3 From 03cc031d00ab97ab46b61b66a6281a175c33541f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 09:40:48 +0200 Subject: Remove TODO comments (already done) --- src/raylib.h | 1 - src/shapes.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 8a46ec35..32cd54a6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -423,7 +423,6 @@ typedef struct Material { } Material; // 3d Model type -// TODO: Replace shader/testure by material typedef struct Model { Mesh mesh; // Vertex data buffers (RAM and VRAM) Matrix transform; // Local transform matrix diff --git a/src/shapes.c b/src/shapes.c index 14d11315..5b66e5ef 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -446,7 +446,6 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) } // Get collision rectangle for two rectangles collision -// TODO: Depending on rec1 and rec2 order, it fails -> Review! Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) { Rectangle retRec = { 0, 0, 0, 0 }; -- cgit v1.2.3 From c9e30f77540e9693ddecffc353964eb71e854842 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 10:53:31 +0200 Subject: Review struct typedef to avoid pointers for users --- src/physac.c | 12 ++++++------ src/raylib.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index ed707474..181488ac 100644 --- a/src/physac.c +++ b/src/physac.c @@ -49,7 +49,7 @@ //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static PhysicObject *physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool +static PhysicObject physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool static int physicObjectsCount; // Counts current enabled physic objects static Vector2 gravityForce; // Gravity force @@ -463,10 +463,10 @@ void ClosePhysics() } // Create a new physic object dinamically, initialize it and add to pool -PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale) +PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale) { // Allocate dynamic memory - PhysicObject *obj = (PhysicObject *)malloc(sizeof(PhysicObject)); + PhysicObject obj = (PhysicObject)malloc(sizeof(PhysicObjectData)); // Initialize physic object values with generic values obj->id = physicObjectsCount; @@ -498,7 +498,7 @@ PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale } // Destroy a specific physic object and take it out of the list -void DestroyPhysicObject(PhysicObject *pObj) +void DestroyPhysicObject(PhysicObject pObj) { // Free dynamic memory allocation free(physicObjects[pObj->id]); @@ -520,7 +520,7 @@ void DestroyPhysicObject(PhysicObject *pObj) } // Apply directional force to a physic object -void ApplyForce(PhysicObject *pObj, Vector2 force) +void ApplyForce(PhysicObject pObj, Vector2 force) { if (pObj->rigidbody.enabled) { @@ -571,7 +571,7 @@ Rectangle TransformToRectangle(Transform transform) } // Draw physic object information at screen position -void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize) +void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize) { // Draw physic object ID DrawText(FormatText("PhysicObject ID: %i - Enabled: %i", pObj->id, pObj->enabled), position.x, position.y, fontSize, BLACK); diff --git a/src/raylib.h b/src/raylib.h index 32cd54a6..fc1914bb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -535,13 +535,13 @@ typedef struct Collider { int radius; // Used for COLLIDER_CIRCLE } Collider; -typedef struct PhysicObject { +typedef struct PhysicObjectData { unsigned int id; Transform transform; Rigidbody rigidbody; Collider collider; bool enabled; -} PhysicObject; +} PhysicObjectData, *PhysicObject; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -856,14 +856,14 @@ void InitPhysics(Vector2 gravity); void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool -void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list +PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool +void DestroyPhysicObject(PhysicObject pObj); // Destroy a specific physic object and take it out of the list -void ApplyForce(PhysicObject *pObj, Vector2 force); // Apply directional force to a physic object +void ApplyForce(PhysicObject pObj, Vector2 force); // Apply directional force to a physic object void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) -void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position +void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize); // Draw physic object information at screen position //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) -- cgit v1.2.3 From af890cf21021e4a306bf3f6e4397496b95c1c93a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 10:53:58 +0200 Subject: Updated to avoid pointers --- src/physac.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index 37544686..6cef480a 100644 --- a/src/physac.h +++ b/src/physac.h @@ -66,13 +66,13 @@ typedef struct Collider { int radius; // Used for COLLIDER_CIRCLE } Collider; -typedef struct PhysicObject { +typedef struct PhysicObjectData { unsigned int id; Transform transform; Rigidbody rigidbody; Collider collider; bool enabled; -} PhysicObject; +} PhysicObjectData, *PhysicObject; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -85,14 +85,14 @@ void InitPhysics(Vector2 gravity); void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool -void DestroyPhysicObject(PhysicObject *pObj); // Destroy a specific physic object and take it out of the list +PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool +void DestroyPhysicObject(PhysicObject pObj); // Destroy a specific physic object and take it out of the list -void ApplyForce(PhysicObject *pObj, Vector2 force); // Apply directional force to a physic object +void ApplyForce(PhysicObject pObj, Vector2 force); // Apply directional force to a physic object void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) -void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize); // Draw physic object information at screen position +void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize); // Draw physic object information at screen position #ifdef __cplusplus } -- cgit v1.2.3 From dcf5f45f687f2a534286aecd5e6471a0440b0c21 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 12:28:07 +0200 Subject: Add lighting system -IN PROGRESS- Improved materials --- src/models.c | 12 +++++ src/raylib.h | 30 ++++++++++- src/rlgl.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/rlgl.h | 25 +++++++++ 4 files changed, 228 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 6d72d1e3..44e30390 100644 --- a/src/models.c +++ b/src/models.c @@ -732,6 +732,18 @@ Material LoadDefaultMaterial(void) return material; } +// Load standard material (uses standard models shader) +// NOTE: Standard shader supports multiple maps and lights +Material LoadStandardMaterial(void) +{ + Material material = LoadDefaultMaterial(); + + //material.shader = GetStandardShader(); + + return material; +} + +// Unload material from memory void UnloadMaterial(Material material) { rlDeleteTextures(material.texDiffuse.id); diff --git a/src/raylib.h b/src/raylib.h index fc1914bb..d98a0797 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -422,13 +422,38 @@ typedef struct Material { float normalDepth; // Normal map depth } Material; -// 3d Model type +// Model type typedef struct Model { Mesh mesh; // Vertex data buffers (RAM and VRAM) Matrix transform; // Local transform matrix Material material; // Shader and textures data } Model; +// Light type +// TODO: Review contained data to support different light types and features +typedef struct LightData { + int id; + int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; + + Vector3 position; + Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction) + float attenuation; // Lost of light intensity with distance (use radius?) + + Color diffuse; // Use Vector3 diffuse (including intensities)? + float intensity; + + Color specular; + //float specFactor; // Specular intensity ? + + //Color ambient; // Required? + + float coneAngle; // SpotLight +} LightData, *Light; + +// Light types +typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; + // Ray type (useful for raycast) typedef struct Ray { Vector3 position; @@ -849,6 +874,9 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // S void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) +Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +void DestroyLight(Light light); // Destroy a light and take it out of the list + //---------------------------------------------------------------------------------- // Physics System Functions (Module: physac) //---------------------------------------------------------------------------------- diff --git a/src/rlgl.c b/src/rlgl.c index cc2b8942..e971d747 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -71,6 +71,8 @@ #define MAX_DRAWS_BY_TEXTURE 256 // Draws are organized by texture changes #define TEMP_VERTEX_BUFFER_SIZE 4096 // Temporal Vertex Buffer (required for vertex-transformations) // NOTE: Every vertex are 3 floats (12 bytes) + +#define MAX_LIGHTS 8 // Max lights supported by standard shader #ifndef GL_SHADING_LANGUAGE_VERSION #define GL_SHADING_LANGUAGE_VERSION 0x8B8C @@ -199,6 +201,10 @@ static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support + +// Lighting data +static Light lights[MAX_LIGHTS]; // Lights pool +static int lightsCount; // Counts current enabled physic objects #endif // Compressed textures support flags @@ -227,6 +233,7 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shader strings and return program id static Shader LoadDefaultShader(void); // Load default shader (just vertex positioning and texture coloring) +static Shader LoadStandardShader(void); // Load standard shader (support materials and lighting) static void LoadDefaultShaderLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) static void UnloadDefaultShader(void); // Unload default shader @@ -235,6 +242,8 @@ static void UpdateDefaultBuffers(void); // Update default internal buffers ( static void DrawDefaultBuffers(void); // Draw default internal buffers vertex data static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU +static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array + static char *ReadTextFile(const char *fileName); #endif @@ -1749,11 +1758,19 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Send combined model-view-projection matrix to shader glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - // Apply color tinting (material.colDiffuse) - // NOTE: Just update one uniform on fragment shader - float vColor[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; - glUniform4fv(material.shader.tintColorLoc, 1, vColor); - + // Setup shader uniforms for material related data + // TODO: Check if using standard shader to get location points + + // Upload to shader material.colDiffuse + float vColorDiffuse[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; + glUniform4fv(material.shader.tintColorLoc, 1, vColorDiffuse); + + // TODO: Upload to shader material.colAmbient + // glUniform4f(???, (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); + + // TODO: Upload to shader material.colSpecular + // glUniform4f(???, (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); + // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); @@ -1764,6 +1781,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, material.texNormal.id); glUniform1i(material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 + + // TODO: Upload to shader normalDepth + //glUniform1f(???, material.normalDepth); } if ((material.texSpecular.id != 0) && (material.shader.mapSpecularLoc != -1)) @@ -1771,7 +1791,13 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 + + // TODO: Upload to shader glossiness + //glUniform1f(???, material.glossiness); } + + // Setup shader uniforms for lights + SetShaderLights(material.shader); if (vaoSupported) { @@ -2198,6 +2224,55 @@ void SetBlendMode(int mode) } } +// Create a new light, initialize it and add to pool +// TODO: Review creation parameters (only generic ones) +Light CreateLight(int type, Vector3 position, Color diffuse) +{ + // Allocate dynamic memory + Light light = (Light)malloc(sizeof(LightData)); + + // Initialize light values with generic values + light->id = lightsCount; + light->type = type; + light->enabled = true; + + light->position = position; + light->direction = (Vector3){ 0.0f, 0.0f, 0.0f }; + light->intensity = 1.0f; + light->diffuse = diffuse; + light->specular = WHITE; + + // Add new light to the array + lights[lightsCount] = light; + + // Increase enabled lights count + lightsCount++; + + return light; +} + +// Destroy a light and take it out of the list +void DestroyLight(Light light) +{ + // Free dynamic memory allocation + free(lights[light->id]); + + // Remove *obj from the pointers array + for (int i = light->id; i < lightsCount; i++) + { + // Resort all the following pointers of the array + if ((i + 1) < lightsCount) + { + lights[i] = lights[i + 1]; + lights[i]->id = lights[i + 1]->id; + } + else free(lights[i]); + } + + // Decrease enabled physic objects count + lightsCount--; +} + //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- @@ -2415,6 +2490,32 @@ static Shader LoadDefaultShader(void) return shader; } +// Load standard shader +// NOTE: This shader supports: +// - Up to 3 different maps: diffuse, normal, specular +// - Material properties: colDiffuse, colAmbient, colSpecular, glossiness, normalDepth +// - Up to 8 lights: Point, Directional or Spot +static Shader LoadStandardShader(void) +{ + Shader shader; + + char *vShaderStr; + char *fShaderStr; + + // TODO: Implement standard uber-shader, supporting all features (GLSL 100 / GLSL 330) + + // NOTE: Shader could be quite extensive so it could be implemented in external files (standard.vs/standard.fs) + + shader.id = LoadShaderProgram(vShaderStr, fShaderStr); + + if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); + else TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded", shader.id); + + if (shader.id != 0) LoadDefaultShaderLocations(&shader); // TODO: Review locations fetching + + return shader; +} + // Get location handlers to for shader attributes and uniforms // NOTE: If any location is not found, loc point becomes -1 static void LoadDefaultShaderLocations(Shader *shader) @@ -2900,6 +3001,62 @@ static void UnloadDefaultBuffers(void) free(quads.indices); } +// Sets shader uniform values for lights array +// NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0f +// TODO: Review memcpy() and parameters pass +static void SetShaderLights(Shader shader) +{ + /* + // NOTE: Standard Shader must include the following data: + + // Shader Light struct + struct Light { + vec3 position; + vec3 direction; + + vec3 diffuse; + float intensity; + } + + const int maxLights = 8; + uniform int lightsCount; // Number of lights + uniform Light lights[maxLights]; + */ + + int locPoint; + char locName[32] = "lights[x].position\0"; + + glUseProgram(shader.id); + + locPoint = glGetUniformLocation(shader.id, "lightsCount"); + glUniform1i(locPoint, lightsCount); + + for (int i = 0; i < lightsCount; i++) + { + locName[7] = '0' + i; + + memcpy(&locName[10], "position\0", strlen("position\0")); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + + memcpy(&locName[10], "direction\0", strlen("direction\0")); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform3f(locPoint, lights[i]->direction.x, lights[i]->direction.y, lights[i]->direction.z); + + memcpy(&locName[10], "diffuse\0", strlen("diffuse\0")); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255 ); + + memcpy(&locName[10], "intensity\0", strlen("intensity\0")); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform1f(locPoint, lights[i]->intensity); + + // TODO: Pass to the shader any other required data from LightData struct + } + + glUseProgram(0); +} + // Read text data from file // NOTE: text chars array should be freed manually static char *ReadTextFile(const char *fileName) diff --git a/src/rlgl.h b/src/rlgl.h index a557ffa2..39941b33 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -209,6 +209,28 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; float glossiness; float normalDepth; } Material; + + // Light type + // TODO: Review contained data to support different light types and features + typedef struct LightData { + int id; + int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; + + Vector3 position; + Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction) + float attenuation; // Lost of light intensity with distance (use radius?) + + Color diffuse; // Use Vector3 diffuse (including intensities)? + float intensity; + + Color specular; + //float specFactor; // Specular intensity ? + + //Color ambient; // Required? + + float coneAngle; // SpotLight + } LightData, *Light; // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; @@ -311,6 +333,9 @@ void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // S void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) + +Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +void DestroyLight(Light light); // Destroy a light and take it out of the list #endif #ifdef __cplusplus -- cgit v1.2.3 From 90c62c4cc0bc79ea51ae114467757a8d80c38fa6 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Fri, 20 May 2016 14:07:50 +0200 Subject: Fix small warning Material glossiness is a float type value... --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 44e30390..0e59242b 100644 --- a/src/models.c +++ b/src/models.c @@ -2068,7 +2068,7 @@ static Material LoadMTL(const char *fileName) { if (buffer[1] == 's') // Ns int Shininess (specular exponent). Ranges from 0 to 1000. { - sscanf(buffer, "Ns %i", &material.glossiness); + sscanf(buffer, "Ns %f", &material.glossiness); } else if (buffer[1] == 'i') // Ni int Refraction index. { -- cgit v1.2.3 From 3fa6fdacf2be438cfc81d3ae5ef2b58801aecce6 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Fri, 20 May 2016 14:24:53 +0200 Subject: Improved MTL loading shininess value --- src/models.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 0e59242b..414f6716 100644 --- a/src/models.c +++ b/src/models.c @@ -2068,7 +2068,11 @@ static Material LoadMTL(const char *fileName) { if (buffer[1] == 's') // Ns int Shininess (specular exponent). Ranges from 0 to 1000. { - sscanf(buffer, "Ns %f", &material.glossiness); + int shininess = 0; + sscanf(buffer, "Ns %i", &shininess); + + // Normalize shininess value to material glossiness attribute + material.glossiness = (float)shininess/1000; } else if (buffer[1] == 'i') // Ni int Refraction index. { -- cgit v1.2.3 From 6dac1efefef137ae487fa9f4c782b80538f784ba Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 20 May 2016 15:01:36 +0200 Subject: Comented buggy code to avoid problems... ...on model drawing --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index e971d747..c5048aff 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1797,7 +1797,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) } // Setup shader uniforms for lights - SetShaderLights(material.shader); + //SetShaderLights(material.shader); if (vaoSupported) { -- cgit v1.2.3 From 30c8058fca39e4d6566b2fc06ae2498c48c00717 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Fri, 20 May 2016 17:18:07 +0200 Subject: Add standard lighting (1/3) - Ambient and lambert lighting added. - Ambient and diffuse colors linked to standard shader. - Single light linked to standard shader. - LoadStandardMaterial() and depending functions added. --- src/models.c | 6 +-- src/raylib.h | 9 ++-- src/rlgl.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 131 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 414f6716..2629dffd 100644 --- a/src/models.c +++ b/src/models.c @@ -732,13 +732,13 @@ Material LoadDefaultMaterial(void) return material; } -// Load standard material (uses standard models shader) +// Load standard material (uses material attributes and lighting shader) // NOTE: Standard shader supports multiple maps and lights Material LoadStandardMaterial(void) { Material material = LoadDefaultMaterial(); - //material.shader = GetStandardShader(); + material.shader = GetStandardShader(); return material; } @@ -1240,7 +1240,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - model.material.colDiffuse = tint; + // model.material.colDiffuse = tint; rlglDrawMesh(model.mesh, model.material, model.transform); } diff --git a/src/raylib.h b/src/raylib.h index d98a0797..48534fd6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -398,7 +398,7 @@ typedef struct Shader { // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) - int tintColorLoc; // Color uniform location point (fragment shader) + int tintColorLoc; // Diffuse color uniform location point (fragment shader) // Texture map locations int mapDiffuseLoc; // Diffuse map texture uniform location point (fragment shader) @@ -444,11 +444,8 @@ typedef struct LightData { float intensity; Color specular; - //float specFactor; // Specular intensity ? - - //Color ambient; // Required? - float coneAngle; // SpotLight + float coneAngle; // SpotLight } LightData, *Light; // Light types @@ -836,6 +833,7 @@ void SetModelTexture(Model *model, Texture2D texture); // Link a textur Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) +Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) void UnloadMaterial(Material material); // Unload material textures from VRAM void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -865,6 +863,7 @@ void UnloadShader(Shader shader); // Unload a void SetDefaultShader(void); // Set default shader to be used in batch draw void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw Shader GetDefaultShader(void); // Get default shader +Shader GetStandardShader(void); // Get default shader Texture2D GetDefaultTexture(void); // Get default texture int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location diff --git a/src/rlgl.c b/src/rlgl.c index c5048aff..e2195e4d 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -191,6 +191,7 @@ static bool useTempBuffer = false; // Shader Programs static Shader defaultShader; +static Shader standardShader; static Shader currentShader; // By default, defaultShader // Flags for supported extensions @@ -236,6 +237,7 @@ static Shader LoadDefaultShader(void); // Load default shader (just vertex static Shader LoadStandardShader(void); // Load standard shader (support materials and lighting) static void LoadDefaultShaderLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) static void UnloadDefaultShader(void); // Unload default shader +static void UnloadStandardShader(void); // Unload standard shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data @@ -1018,6 +1020,7 @@ void rlglInit(void) // Init default Shader (customized for GL 3.3 and ES2) defaultShader = LoadDefaultShader(); + standardShader = LoadStandardShader(); currentShader = defaultShader; LoadDefaultBuffers(); // Initialize default vertex arrays buffers (lines, triangles, quads) @@ -1046,6 +1049,7 @@ void rlglClose(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) UnloadDefaultShader(); + UnloadStandardShader(); UnloadDefaultBuffers(); // Delete default white texture @@ -1757,19 +1761,30 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Send combined model-view-projection matrix to shader glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - - // Setup shader uniforms for material related data - // TODO: Check if using standard shader to get location points // Upload to shader material.colDiffuse float vColorDiffuse[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; glUniform4fv(material.shader.tintColorLoc, 1, vColorDiffuse); + + // Check if using standard shader to get location points + // NOTE: standard shader specific locations are got at render time to keep Shader struct as simple as possible (with just default shader locations) + if(material.shader.id == standardShader.id) + { + // Send model transformations matrix to shader + glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transform)); + + // Setup shader uniforms for lights + SetShaderLights(material.shader); + + // Upload to shader material.colAmbient + glUniform4f(glGetUniformLocation(material.shader.id, "colAmbient"), (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); + + // Upload to shader material.colSpecular + glUniform4f(glGetUniformLocation(material.shader.id, "colSpecular"), (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); - // TODO: Upload to shader material.colAmbient - // glUniform4f(???, (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); - - // TODO: Upload to shader material.colSpecular - // glUniform4f(???, (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); + // TODO: Upload to shader glossiness + //glUniform1f(???, material.glossiness); + } // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); @@ -1791,13 +1806,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 - - // TODO: Upload to shader glossiness - //glUniform1f(???, material.glossiness); } - - // Setup shader uniforms for lights - //SetShaderLights(material.shader); if (vaoSupported) { @@ -2148,6 +2157,17 @@ Shader GetDefaultShader(void) #endif } +// Get default shader +Shader GetStandardShader(void) +{ +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + return standardShader; +#else + Shader shader = { 0 }; + return shader; +#endif +} + // Get shader uniform location int GetShaderLocation(Shader shader, const char *uniformName) { @@ -2499,13 +2519,75 @@ static Shader LoadStandardShader(void) { Shader shader; - char *vShaderStr; - char *fShaderStr; - - // TODO: Implement standard uber-shader, supporting all features (GLSL 100 / GLSL 330) - - // NOTE: Shader could be quite extensive so it could be implemented in external files (standard.vs/standard.fs) - + // Vertex shader directly defined, no external file required +#if defined(GRAPHICS_API_OPENGL_33) + char vShaderStr[] = "#version 330 \n" + "in vec3 vertexPosition; \n" + "in vec3 vertexNormal; \n" + "in vec2 vertexTexCoord; \n" + "in vec4 vertexColor; \n" + "out vec2 fragTexCoord; \n" + "out vec4 fragColor; \n" + "out vec3 fragNormal; \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) + char vShaderStr[] = "#version 100 \n" + "attribute vec3 vertexPosition; \n" + "attribute vec3 vertexNormal; \n" + "attribute vec2 vertexTexCoord; \n" + "attribute vec4 vertexColor; \n" + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" + "varying vec3 fragNormal; \n" +#endif + "uniform mat4 mvpMatrix; \n" + "uniform mat4 modelMatrix; \n" + "void main() \n" + "{ \n" + " fragTexCoord = vertexTexCoord; \n" + " fragColor = vertexColor; \n" + " mat3 normalMatrix = transpose(inverse(mat3(modelMatrix))); \n" + " fragNormal = normalize(normalMatrix*vertexNormal); \n" + " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" + "} \n"; + + // TODO: add specular calculation, multi-lights structs and light type calculations (directional, point, spot) + // Fragment shader directly defined, no external file required +#if defined(GRAPHICS_API_OPENGL_33) + char fShaderStr[] = "#version 330 \n" + "in vec2 fragTexCoord; \n" + "in vec4 fragColor; \n" + "in vec3 fragNormal; \n" + "out vec4 finalColor; \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) + char fShaderStr[] = "#version 100 \n" + "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" + "varying vec3 fragNormal; \n" +#endif + "uniform sampler2D texture0; \n" + "uniform vec4 fragTintColor; \n" + "uniform vec4 colAmbient; \n" + "uniform vec4 colSpecular; \n" + "uniform vec3 lightDir; \n" + "vec3 LambertLighting(in vec3 n, in vec3 l) \n" + "{ \n" + " return clamp(dot(n, l), 0, 1)*fragTintColor.rgb; \n" + "} \n" + + "void main() \n" + "{ \n" + " vec3 n = normalize(fragNormal); \n" + " vec3 l = normalize(lightDir); \n" +#if defined(GRAPHICS_API_OPENGL_33) + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " finalColor = vec4(texelColor.rgb*(colAmbient.rgb + LambertLighting(n, l)) - colSpecular.rgb + colSpecular.rgb, texelColor.a*fragTintColor.a); \n" // Stupid specular color operation to avoid shader location errors +#elif defined(GRAPHICS_API_OPENGL_ES2) + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 + " gl_FragColor = texelColor*fragTintColor*fragColor; \n" +#endif + "} \n"; + shader.id = LoadShaderProgram(vShaderStr, fShaderStr); if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); @@ -2554,10 +2636,23 @@ static void UnloadDefaultShader(void) //glDetachShader(defaultShader, vertexShader); //glDetachShader(defaultShader, fragmentShader); //glDeleteShader(vertexShader); // Already deleted on shader compilation - //glDeleteShader(fragmentShader); // Already deleted on sahder compilation + //glDeleteShader(fragmentShader); // Already deleted on shader compilation glDeleteProgram(defaultShader.id); } +// Unload standard shader +static void UnloadStandardShader(void) +{ + glUseProgram(0); + + //glDetachShader(defaultShader, vertexShader); + //glDetachShader(defaultShader, fragmentShader); + //glDeleteShader(vertexShader); // Already deleted on shader compilation + //glDeleteShader(fragmentShader); // Already deleted on shader compilation + glDeleteProgram(standardShader.id); +} + + // Load default internal buffers (lines, triangles, quads) static void LoadDefaultBuffers(void) { @@ -3006,6 +3101,9 @@ static void UnloadDefaultBuffers(void) // TODO: Review memcpy() and parameters pass static void SetShaderLights(Shader shader) { + // Note: currently working with one light (index 0) + // TODO: add multi-lights feature (http://www.learnopengl.com/#!Lighting/Multiple-lights) + /* // NOTE: Standard Shader must include the following data: @@ -3023,7 +3121,7 @@ static void SetShaderLights(Shader shader) uniform Light lights[maxLights]; */ - int locPoint; + /*int locPoint; char locName[32] = "lights[x].position\0"; glUseProgram(shader.id); @@ -3052,9 +3150,10 @@ static void SetShaderLights(Shader shader) glUniform1f(locPoint, lights[i]->intensity); // TODO: Pass to the shader any other required data from LightData struct - } + }*/ - glUseProgram(0); + int locPoint = GetShaderLocation(shader, "lightDir"); + glUniform3f(locPoint, lights[0]->position.x, lights[0]->position.y, lights[0]->position.z); } // Read text data from file -- cgit v1.2.3 From cf71e1242e593de5b77d6ff219569e8c0d2c7fd9 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 21 May 2016 18:08:09 +0200 Subject: Fix some audio module compile warnings --- src/audio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 43e8be14..0c61c0fa 100644 --- a/src/audio.c +++ b/src/audio.c @@ -384,7 +384,7 @@ RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingP for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_MIX_CHANNELS - 1) return -1; // error + else if(mixIndex == MAX_MIX_CHANNELS - 1) return -1; // error } if(InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) @@ -772,7 +772,7 @@ int PlayMusicStream(int musicIndex, char *fileName) for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex = MAX_MIX_CHANNELS - 1) return 2; // error + else if(mixIndex == MAX_MIX_CHANNELS - 1) return 2; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) @@ -956,7 +956,7 @@ float GetMusicTimeLength(int index) // Get current music time played (in seconds) float GetMusicTimePlayed(int index) { - float secondsPlayed; + float secondsPlayed = 0.0f; if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) { if (currentMusic[index].chipTune) @@ -972,7 +972,6 @@ float GetMusicTimePlayed(int index) secondsPlayed = (float)samplesPlayed / (currentMusic[index].mixc->sampleRate * currentMusic[index].mixc->channels); } } - return secondsPlayed; } -- cgit v1.2.3 From 30941c0dd1f7904b5a0b50c05ec17265f8d69baa Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 21 May 2016 18:10:06 +0200 Subject: Add Draw3DLine function and fixed MLT glossiness import value In standard shader, material glossiness is a value from 0 to 1000 like in MLT files. So, it doesn't need to be normalized. --- src/models.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 2629dffd..aef79626 100644 --- a/src/models.c +++ b/src/models.c @@ -65,6 +65,16 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Module Functions Definition //---------------------------------------------------------------------------------- +// Draw a line in 3D world space +void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color) +{ + rlBegin(RL_LINES); + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex3f(startPos.x, startPos.y, startPos.z); + rlVertex3f(endPos.x, endPos.y, endPos.z); + rlEnd(); +} + // Draw cube // NOTE: Cube position is the center position void DrawCube(Vector3 position, float width, float height, float length, Color color) @@ -2071,8 +2081,7 @@ static Material LoadMTL(const char *fileName) int shininess = 0; sscanf(buffer, "Ns %i", &shininess); - // Normalize shininess value to material glossiness attribute - material.glossiness = (float)shininess/1000; + material.glossiness = (float)shininess; } else if (buffer[1] == 'i') // Ni int Refraction index. { -- cgit v1.2.3 From c320a21f2b0e96f7605624e84048ccab9700b516 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 21 May 2016 18:16:39 +0200 Subject: Add standard lighting (2/3) - 3 light types added (point, directional, spot). - DrawLights() function added using line shapes. - Standard lighting example added. - Removed useless struct variables from material and light. - Fixed light attributes dynamic locations errors. - Standard vertex and fragment shaders temporally added until rewrite it as char pointers in rlgl. TODO: - Add normal and specular maps calculations in standard shader. - Add control structs to handle which attributes needs to be calculated (textures, specular...). - Adapt standard shader to version 110. - Rewrite standard shader as char pointers in rlgl. --- src/raylib.h | 15 ++--- src/rlgl.c | 213 +++++++++++++++++++++++++---------------------------------- src/rlgl.h | 32 ++++----- 3 files changed, 111 insertions(+), 149 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 48534fd6..9cd02fd8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -418,7 +418,7 @@ typedef struct Material { Color colAmbient; // Ambient color Color colSpecular; // Specular color - float glossiness; // Glossiness level + float glossiness; // Glossiness level (Ranges from 0 to 1000) float normalDepth; // Normal map depth } Material; @@ -430,22 +430,19 @@ typedef struct Model { } Model; // Light type -// TODO: Review contained data to support different light types and features typedef struct LightData { int id; int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT bool enabled; Vector3 position; - Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction) - float attenuation; // Lost of light intensity with distance (use radius?) + Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float attenuation; // Lost of light intensity with distance (world distance) - Color diffuse; // Use Vector3 diffuse (including intensities)? + Color diffuse; // Use Vector3 diffuse float intensity; - Color specular; - - float coneAngle; // SpotLight + float coneAngle; // Spot light max angle } LightData, *Light; // Light types @@ -805,6 +802,7 @@ const char *SubText(const char *text, int position, int length); //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ +void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires @@ -874,6 +872,7 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // S void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +void DrawLights(void); // Draw all created lights in 3D world void DestroyLight(Light light); // Destroy a light and take it out of the list //---------------------------------------------------------------------------------- diff --git a/src/rlgl.c b/src/rlgl.c index e2195e4d..55677f3e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1773,6 +1773,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Send model transformations matrix to shader glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transform)); + // Send view transformation matrix to shader. View matrix 8, 9 and 10 are view direction vector axis values (target - position) + glUniform3f(glGetUniformLocation(material.shader.id, "viewDir"), matView.m8, matView.m9, matView.m10); + // Setup shader uniforms for lights SetShaderLights(material.shader); @@ -1782,8 +1785,8 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Upload to shader material.colSpecular glUniform4f(glGetUniformLocation(material.shader.id, "colSpecular"), (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); - // TODO: Upload to shader glossiness - //glUniform1f(???, material.glossiness); + // Upload to shader glossiness + glUniform1f(glGetUniformLocation(material.shader.id, "glossiness"), material.glossiness); } // Set shader textures (diffuse, normal, specular) @@ -2245,7 +2248,6 @@ void SetBlendMode(int mode) } // Create a new light, initialize it and add to pool -// TODO: Review creation parameters (only generic ones) Light CreateLight(int type, Vector3 position, Color diffuse) { // Allocate dynamic memory @@ -2257,10 +2259,9 @@ Light CreateLight(int type, Vector3 position, Color diffuse) light->enabled = true; light->position = position; - light->direction = (Vector3){ 0.0f, 0.0f, 0.0f }; + light->target = (Vector3){ 0.0f, 0.0f, 0.0f }; light->intensity = 1.0f; light->diffuse = diffuse; - light->specular = WHITE; // Add new light to the array lights[lightsCount] = light; @@ -2271,6 +2272,31 @@ Light CreateLight(int type, Vector3 position, Color diffuse) return light; } +// Draw all created lights in 3D world +void DrawLights(void) +{ + for (int i = 0; i < lightsCount; i++) + { + switch (lights[i]->type) + { + case LIGHT_POINT: DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); break; + case LIGHT_DIRECTIONAL: + { + Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + DrawCubeWires(lights[i]->target, 0.3f, 0.3f, 0.3f, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + } + case LIGHT_SPOT: + { + Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + DrawCylinderWires(lights[i]->position, 0.0f, 0.3f*lights[i]->coneAngle/50, 0.6f, 5, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + DrawCubeWires(lights[i]->target, 0.3f, 0.3f, 0.3f, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + } break; + default: break; + } + } +} + // Destroy a light and take it out of the list void DestroyLight(Light light) { @@ -2488,15 +2514,15 @@ static Shader LoadDefaultShader(void) "varying vec4 fragColor; \n" #endif "uniform sampler2D texture0; \n" - "uniform vec4 fragTintColor; \n" + "uniform vec4 colDiffuse; \n" "void main() \n" "{ \n" #if defined(GRAPHICS_API_OPENGL_33) " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " finalColor = texelColor*fragTintColor*fragColor; \n" + " finalColor = texelColor*colDiffuse*fragColor; \n" #elif defined(GRAPHICS_API_OPENGL_ES2) " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 - " gl_FragColor = texelColor*fragTintColor*fragColor; \n" + " gl_FragColor = texelColor*colDiffuse*fragColor; \n" #endif "} \n"; @@ -2513,87 +2539,17 @@ static Shader LoadDefaultShader(void) // Load standard shader // NOTE: This shader supports: // - Up to 3 different maps: diffuse, normal, specular -// - Material properties: colDiffuse, colAmbient, colSpecular, glossiness, normalDepth +// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness, normalDepth // - Up to 8 lights: Point, Directional or Spot static Shader LoadStandardShader(void) { - Shader shader; - - // Vertex shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char vShaderStr[] = "#version 330 \n" - "in vec3 vertexPosition; \n" - "in vec3 vertexNormal; \n" - "in vec2 vertexTexCoord; \n" - "in vec4 vertexColor; \n" - "out vec2 fragTexCoord; \n" - "out vec4 fragColor; \n" - "out vec3 fragNormal; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - char vShaderStr[] = "#version 100 \n" - "attribute vec3 vertexPosition; \n" - "attribute vec3 vertexNormal; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec4 vertexColor; \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" - "varying vec3 fragNormal; \n" -#endif - "uniform mat4 mvpMatrix; \n" - "uniform mat4 modelMatrix; \n" - "void main() \n" - "{ \n" - " fragTexCoord = vertexTexCoord; \n" - " fragColor = vertexColor; \n" - " mat3 normalMatrix = transpose(inverse(mat3(modelMatrix))); \n" - " fragNormal = normalize(normalMatrix*vertexNormal); \n" - " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" - "} \n"; - - // TODO: add specular calculation, multi-lights structs and light type calculations (directional, point, spot) - // Fragment shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char fShaderStr[] = "#version 330 \n" - "in vec2 fragTexCoord; \n" - "in vec4 fragColor; \n" - "in vec3 fragNormal; \n" - "out vec4 finalColor; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - char fShaderStr[] = "#version 100 \n" - "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" - "varying vec3 fragNormal; \n" -#endif - "uniform sampler2D texture0; \n" - "uniform vec4 fragTintColor; \n" - "uniform vec4 colAmbient; \n" - "uniform vec4 colSpecular; \n" - "uniform vec3 lightDir; \n" - "vec3 LambertLighting(in vec3 n, in vec3 l) \n" - "{ \n" - " return clamp(dot(n, l), 0, 1)*fragTintColor.rgb; \n" - "} \n" - - "void main() \n" - "{ \n" - " vec3 n = normalize(fragNormal); \n" - " vec3 l = normalize(lightDir); \n" -#if defined(GRAPHICS_API_OPENGL_33) - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " finalColor = vec4(texelColor.rgb*(colAmbient.rgb + LambertLighting(n, l)) - colSpecular.rgb + colSpecular.rgb, texelColor.a*fragTintColor.a); \n" // Stupid specular color operation to avoid shader location errors -#elif defined(GRAPHICS_API_OPENGL_ES2) - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 - " gl_FragColor = texelColor*fragTintColor*fragColor; \n" -#endif - "} \n"; - - shader.id = LoadShaderProgram(vShaderStr, fShaderStr); + // Load standard shader (TODO: rewrite as char pointers) + Shader shader = LoadShader("resources/shaders/standard.vs", "resources/shaders/standard.fs"); if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded", shader.id); - if (shader.id != 0) LoadDefaultShaderLocations(&shader); // TODO: Review locations fetching + if (shader.id != 0) LoadDefaultShaderLocations(&shader); return shader; } @@ -2622,7 +2578,7 @@ static void LoadDefaultShaderLocations(Shader *shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); // Get handles to GLSL uniform locations (fragment shader) - shader->tintColorLoc = glGetUniformLocation(shader->id, "fragTintColor"); + shader->tintColorLoc = glGetUniformLocation(shader->id, "colDiffuse"); shader->mapDiffuseLoc = glGetUniformLocation(shader->id, "texture0"); shader->mapNormalLoc = glGetUniformLocation(shader->id, "texture1"); shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); @@ -3098,62 +3054,75 @@ static void UnloadDefaultBuffers(void) // Sets shader uniform values for lights array // NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0f -// TODO: Review memcpy() and parameters pass static void SetShaderLights(Shader shader) { - // Note: currently working with one light (index 0) - // TODO: add multi-lights feature (http://www.learnopengl.com/#!Lighting/Multiple-lights) - - /* - // NOTE: Standard Shader must include the following data: - - // Shader Light struct - struct Light { - vec3 position; - vec3 direction; - - vec3 diffuse; - float intensity; - } - - const int maxLights = 8; - uniform int lightsCount; // Number of lights - uniform Light lights[maxLights]; - */ + int locPoint = glGetUniformLocation(shader.id, "lightsCount"); + glUniform1i(locPoint, lightsCount); - /*int locPoint; char locName[32] = "lights[x].position\0"; - - glUseProgram(shader.id); - - locPoint = glGetUniformLocation(shader.id, "lightsCount"); - glUniform1i(locPoint, lightsCount); for (int i = 0; i < lightsCount; i++) { locName[7] = '0' + i; - memcpy(&locName[10], "position\0", strlen("position\0")); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform1i(locPoint, lights[i]->enabled); - memcpy(&locName[10], "direction\0", strlen("direction\0")); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform3f(locPoint, lights[i]->direction.x, lights[i]->direction.y, lights[i]->direction.z); - - memcpy(&locName[10], "diffuse\0", strlen("diffuse\0")); + memcpy(&locName[10], "type\0", strlen("type\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform1i(locPoint, lights[i]->type); + + memcpy(&locName[10], "diffuse\0", strlen("diffuse\0") + 2); locPoint = glGetUniformLocation(shader.id, locName); - glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255 ); + glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); memcpy(&locName[10], "intensity\0", strlen("intensity\0")); locPoint = glGetUniformLocation(shader.id, locName); glUniform1f(locPoint, lights[i]->intensity); + switch(lights[i]->type) + { + case LIGHT_POINT: + { + memcpy(&locName[10], "position\0", strlen("position\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + + memcpy(&locName[10], "attenuation\0", strlen("attenuation\0")); + locPoint = GetShaderLocation(shader, locName); + glUniform1f(locPoint, lights[i]->attenuation); + } break; + case LIGHT_DIRECTIONAL: + { + memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); + locPoint = GetShaderLocation(shader, locName); + Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + VectorNormalize(&direction); + glUniform3f(locPoint, direction.x, direction.y, direction.z); + } break; + case LIGHT_SPOT: + { + memcpy(&locName[10], "position\0", strlen("position\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + + memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); + locPoint = GetShaderLocation(shader, locName); + + Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + VectorNormalize(&direction); + glUniform3f(locPoint, direction.x, direction.y, direction.z); + + memcpy(&locName[10], "coneAngle\0", strlen("coneAngle\0")); + locPoint = GetShaderLocation(shader, locName); + glUniform1f(locPoint, lights[i]->coneAngle); + } break; + default: break; + } + // TODO: Pass to the shader any other required data from LightData struct - }*/ - - int locPoint = GetShaderLocation(shader, "lightDir"); - glUniform3f(locPoint, lights[0]->position.x, lights[0]->position.y, lights[0]->position.z); + } } // Read text data from file diff --git a/src/rlgl.h b/src/rlgl.h index 39941b33..0765a8a7 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -196,40 +196,34 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; // Material type typedef struct Material { - Shader shader; + Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) - Texture2D texDiffuse; // Diffuse texture - Texture2D texNormal; // Normal texture - Texture2D texSpecular; // Specular texture + Texture2D texDiffuse; // Diffuse texture + Texture2D texNormal; // Normal texture + Texture2D texSpecular; // Specular texture - Color colDiffuse; - Color colAmbient; - Color colSpecular; + Color colDiffuse; // Diffuse color + Color colAmbient; // Ambient color + Color colSpecular; // Specular color - float glossiness; - float normalDepth; + float glossiness; // Glossiness level (Ranges from 0 to 1000) + float normalDepth; // Normal map depth } Material; // Light type - // TODO: Review contained data to support different light types and features typedef struct LightData { int id; int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT bool enabled; Vector3 position; - Vector3 direction; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction) - float attenuation; // Lost of light intensity with distance (use radius?) + Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float attenuation; // Lost of light intensity with distance (world distance) - Color diffuse; // Use Vector3 diffuse (including intensities)? + Color diffuse; // Use Vector3 diffuse float intensity; - Color specular; - //float specFactor; // Specular intensity ? - - //Color ambient; // Required? - - float coneAngle; // SpotLight + float coneAngle; // Spot light max angle } LightData, *Light; // Color blending modes (pre-defined) -- cgit v1.2.3 From dcd6942ed1ab703625f5c7072cbcfd823c681db7 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 21 May 2016 18:22:15 +0200 Subject: Fix small bug and spacing --- src/models.c | 46 +++++++++++++++++++++++----------------------- src/rlgl.c | 10 +++++----- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index aef79626..07dee720 100644 --- a/src/models.c +++ b/src/models.c @@ -302,9 +302,9 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); - for(int i = 0; i < (rings + 2); i++) + for (int i = 0; i < (rings + 2); i++) { - for(int j = 0; j < slices; j++) + for (int j = 0; j < slices; j++) { rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), @@ -341,9 +341,9 @@ void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Col rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - for(int i = 0; i < (rings + 2); i++) + for (int i = 0; i < (rings + 2); i++) { - for(int j = 0; j < slices; j++) + for (int j = 0; j < slices; j++) { rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), @@ -386,7 +386,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h if (radiusTop > 0) { // Draw Body ------------------------------------------------------------------------------------- - for(int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); //Bottom Left rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); //Bottom Right @@ -398,7 +398,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h } // Draw Cap -------------------------------------------------------------------------------------- - for(int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); rlVertex3f(sin(DEG2RAD*i) * radiusTop, height, cos(DEG2RAD*i) * radiusTop); @@ -408,7 +408,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h else { // Draw Cone ------------------------------------------------------------------------------------- - for(int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); @@ -417,7 +417,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h } // Draw Base ----------------------------------------------------------------------------------------- - for(int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, 0, 0); rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); @@ -431,7 +431,7 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h // NOTE: It could be also used for pyramid and cone void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int sides, Color color) { - if(sides < 3) sides = 3; + if (sides < 3) sides = 3; rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); @@ -439,7 +439,7 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); - for(int i = 0; i < 360; i += 360/sides) + for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); @@ -500,7 +500,7 @@ void DrawGrid(int slices, float spacing) int halfSlices = slices / 2; rlBegin(RL_LINES); - for(int i = -halfSlices; i <= halfSlices; i++) + for (int i = -halfSlices; i <= halfSlices; i++) { if (i == 0) { @@ -798,9 +798,9 @@ static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) Vector3 scaleFactor = { size.x/mapX, size.y/255.0f, size.z/mapZ }; - for(int z = 0; z < mapZ-1; z++) + for (int z = 0; z < mapZ-1; z++) { - for(int x = 0; x < mapX-1; x++) + for (int x = 0; x < mapX-1; x++) { // Fill vertices array with data //---------------------------------------------------------- @@ -1417,7 +1417,7 @@ bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius float vector = VectorDotProduct(raySpherePos, ray.direction); float d = sphereRadius*sphereRadius - (distance*distance - vector*vector); - if(d >= 0.0f) collision = true; + if (d >= 0.0f) collision = true; return collision; } @@ -1432,14 +1432,14 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadi float vector = VectorDotProduct(raySpherePos, ray.direction); float d = sphereRadius*sphereRadius - (distance*distance - vector*vector); - if(d >= 0.0f) collision = true; + if (d >= 0.0f) collision = true; // Calculate collision point Vector3 offset = ray.direction; float collisionDistance = 0; // Check if ray origin is inside the sphere to calculate the correct collision point - if(distance < sphereRadius) collisionDistance = vector + sqrt(d); + if (distance < sphereRadius) collisionDistance = vector + sqrt(d); else collisionDistance = vector - sqrt(d); VectorScale(&offset, collisionDistance); @@ -1777,11 +1777,11 @@ static Mesh LoadOBJ(const char *fileName) // First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles // NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition) // NOTE: faces MUST be defined as TRIANGLES (3 vertex per face) - while(!feof(objFile)) + while (!feof(objFile)) { fscanf(objFile, "%c", &dataType); - switch(dataType) + switch (dataType) { case '#': // Comments case 'o': // Object name (One OBJ file can contain multible named meshes) @@ -1842,11 +1842,11 @@ static Mesh LoadOBJ(const char *fileName) // Second reading pass: Get vertex data to fill intermediate arrays // NOTE: This second pass is required in case of multiple meshes defined in same OBJ // TODO: Consider that different meshes can have different vertex data available (position, texcoords, normals) - while(!feof(objFile)) + while (!feof(objFile)) { fscanf(objFile, "%c", &dataType); - switch(dataType) + switch (dataType) { case '#': case 'o': case 'g': case 's': case 'm': case 'u': case 'f': fgets(comments, 200, objFile); break; case 'v': @@ -1903,11 +1903,11 @@ static Mesh LoadOBJ(const char *fileName) if (numNormals == 0) TraceLog(INFO, "[%s] No normals data on OBJ, normals will be generated from faces data", fileName); // Third reading pass: Get faces (triangles) data and fill VertexArray - while(!feof(objFile)) + while (!feof(objFile)) { fscanf(objFile, "%c", &dataType); - switch(dataType) + switch (dataType) { case '#': case 'o': case 'g': case 's': case 'm': case 'u': case 'v': fgets(comments, 200, objFile); break; case 'f': @@ -2023,7 +2023,7 @@ static Material LoadMTL(const char *fileName) return material; } - while(!feof(mtlFile)) + while (!feof(mtlFile)) { fgets(buffer, MAX_BUFFER_SIZE, mtlFile); diff --git a/src/rlgl.c b/src/rlgl.c index 55677f3e..85c0cae2 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1397,7 +1397,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) { TraceLog(WARNING, "Framebuffer object could not be created..."); - switch(status) + switch (status) { case GL_FRAMEBUFFER_UNSUPPORTED: TraceLog(WARNING, "Framebuffer is unsupported"); break; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete attachment"); break; @@ -1768,7 +1768,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Check if using standard shader to get location points // NOTE: standard shader specific locations are got at render time to keep Shader struct as simple as possible (with just default shader locations) - if(material.shader.id == standardShader.id) + if (material.shader.id == standardShader.id) { // Send model transformations matrix to shader glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transform)); @@ -2285,7 +2285,7 @@ void DrawLights(void) Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); DrawCubeWires(lights[i]->target, 0.3f, 0.3f, 0.3f, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - } + } break; case LIGHT_SPOT: { Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); @@ -3081,7 +3081,7 @@ static void SetShaderLights(Shader shader) locPoint = glGetUniformLocation(shader.id, locName); glUniform1f(locPoint, lights[i]->intensity); - switch(lights[i]->type) + switch (lights[i]->type) { case LIGHT_POINT: { @@ -3295,7 +3295,7 @@ static void TraceLog(int msgType, const char *text, ...) va_list args; va_start(args, text); - switch(msgType) + switch (msgType) { case INFO: fprintf(stdout, "INFO: "); break; case ERROR: fprintf(stdout, "ERROR: "); break; -- cgit v1.2.3 From f74791ed7bcb3585c576f40766bf4e22b0923a7e Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 23 May 2016 02:12:22 -0700 Subject: better build system --- src/windows_compile.bat | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/windows_compile.bat (limited to 'src') diff --git a/src/windows_compile.bat b/src/windows_compile.bat deleted file mode 100644 index f1d0fb29..00000000 --- a/src/windows_compile.bat +++ /dev/null @@ -1,2 +0,0 @@ -set PATH=C:\raylib\MinGW\bin;%PATH% -mingw32-make \ No newline at end of file -- cgit v1.2.3 From d53b6f4381485785f7ece3c8004449c20b60ae03 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 25 May 2016 16:19:57 +0200 Subject: Renamed shader variables (more generic names) Now shader maps use a generic naming convention for any kind of texture maps (not only diffuse, normal or specular). Useful for custom shaders. --- src/rlgl.c | 24 +++++++++++++----------- src/rlgl.h | 8 ++++---- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 85c0cae2..d319119f 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1792,23 +1792,23 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); - glUniform1i(material.shader.mapDiffuseLoc, 0); // Texture fits in active texture unit 0 + glUniform1i(material.shader.mapTexture0Loc, 0); // Diffuse texture fits in active texture unit 0 - if ((material.texNormal.id != 0) && (material.shader.mapNormalLoc != -1)) + if ((material.texNormal.id != 0) && (material.shader.mapTexture1Loc != -1)) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, material.texNormal.id); - glUniform1i(material.shader.mapNormalLoc, 1); // Texture fits in active texture unit 1 + glUniform1i(material.shader.mapTexture1Loc, 1); // Normal texture fits in active texture unit 1 // TODO: Upload to shader normalDepth //glUniform1f(???, material.normalDepth); } - if ((material.texSpecular.id != 0) && (material.shader.mapSpecularLoc != -1)) + if ((material.texSpecular.id != 0) && (material.shader.mapTexture2Loc != -1)) { glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); - glUniform1i(material.shader.mapSpecularLoc, 2); // Texture fits in active texture unit 2 + glUniform1i(material.shader.mapTexture2Loc, 2); // Specular texture fits in active texture unit 2 } if (vaoSupported) @@ -2569,19 +2569,19 @@ static void LoadDefaultShaderLocations(Shader *shader) // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_POSITION_NAME); shader->texcoordLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD_NAME); + shader->texcoord2Loc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD2_NAME); shader->normalLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_NORMAL_NAME); - shader->colorLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_COLOR_NAME); shader->tangentLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TANGENT_NAME); - shader->texcoord2Loc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD2_NAME); + shader->colorLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_COLOR_NAME); // Get handles to GLSL uniform locations (vertex shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); // Get handles to GLSL uniform locations (fragment shader) shader->tintColorLoc = glGetUniformLocation(shader->id, "colDiffuse"); - shader->mapDiffuseLoc = glGetUniformLocation(shader->id, "texture0"); - shader->mapNormalLoc = glGetUniformLocation(shader->id, "texture1"); - shader->mapSpecularLoc = glGetUniformLocation(shader->id, "texture2"); + shader->mapTexture0Loc = glGetUniformLocation(shader->id, "texture0"); + shader->mapTexture1Loc = glGetUniformLocation(shader->id, "texture1"); + shader->mapTexture2Loc = glGetUniformLocation(shader->id, "texture2"); } // Unload default shader @@ -2864,8 +2864,10 @@ static void DrawDefaultBuffers(void) Matrix matMVP = MatrixMultiply(modelview, projection); glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - glUniform1i(currentShader.mapDiffuseLoc, 0); glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); + glUniform1i(currentShader.mapTexture0Loc, 0); + + // NOTE: Additional map textures not considered for default buffers drawing } // Draw lines buffers diff --git a/src/rlgl.h b/src/rlgl.h index 0765a8a7..fa35dbc6 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -171,10 +171,10 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Color uniform location point (fragment shader) - // Texture map locations - int mapDiffuseLoc; // Diffuse map texture uniform location point (fragment shader) - int mapNormalLoc; // Normal map texture uniform location point (fragment shader) - int mapSpecularLoc; // Specular map texture uniform location point (fragment shader) + // Texture map locations (generic for any kind of map) + int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) + int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) + int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) } Shader; // Texture2D type -- cgit v1.2.3 From 3d6696f6c981a7a8f523d631926380eced475733 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 25 May 2016 16:21:13 +0200 Subject: Renamed shader variables (more generic names) --- src/raylib.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 9cd02fd8..d0231be2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -369,6 +369,7 @@ typedef struct BoundingBox { // Vertex data definning a mesh typedef struct Mesh { int vertexCount; // number of vertices stored in arrays + int triangleCount; // number of triangles stored (indexed or not) float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) @@ -376,8 +377,7 @@ typedef struct Mesh { float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) unsigned short *indices; // vertex indices (in case vertex data comes indexed) - int triangleCount; // number of triangles stored (indexed or not) - + BoundingBox bounds; // mesh limits defined by min and max points unsigned int vaoId; // OpenGL Vertex Array Object id @@ -389,30 +389,30 @@ typedef struct Shader { unsigned int id; // Shader program id // Vertex attributes locations (default locations) - int vertexLoc; // Vertex attribute location point (default-location = 0) - int texcoordLoc; // Texcoord attribute location point (default-location = 1) - int normalLoc; // Normal attribute location point (default-location = 2) - int colorLoc; // Color attibute location point (default-location = 3) - int tangentLoc; // Tangent attribute location point (default-location = 4) + int vertexLoc; // Vertex attribute location point (default-location = 0) + int texcoordLoc; // Texcoord attribute location point (default-location = 1) int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) + int normalLoc; // Normal attribute location point (default-location = 2) + int tangentLoc; // Tangent attribute location point (default-location = 4) + int colorLoc; // Color attibute location point (default-location = 3) // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Diffuse color uniform location point (fragment shader) - // Texture map locations - int mapDiffuseLoc; // Diffuse map texture uniform location point (fragment shader) - int mapNormalLoc; // Normal map texture uniform location point (fragment shader) - int mapSpecularLoc; // Specular map texture uniform location point (fragment shader) + // Texture map locations (generic for any kind of map) + int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) + int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) + int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) } Shader; // Material type typedef struct Material { - Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) + Shader shader; // Standard shader (supports 3 map textures) - Texture2D texDiffuse; // Diffuse texture - Texture2D texNormal; // Normal texture - Texture2D texSpecular; // Specular texture + Texture2D texDiffuse; // Diffuse texture (binded to shader mapTexture0Loc) + Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) + Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color @@ -439,8 +439,8 @@ typedef struct LightData { Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) float attenuation; // Lost of light intensity with distance (world distance) - Color diffuse; // Use Vector3 diffuse - float intensity; + Color diffuse; // Light color + float intensity; // Light intensity level float coneAngle; // Spot light max angle } LightData, *Light; -- cgit v1.2.3 From ea5b00528b0cb1e5cc1e7169a195b75915c8607a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 29 May 2016 11:49:13 +0200 Subject: Improved render to texture Support render texture size different than screen size --- src/core.c | 36 +++++++++++++++++++++++++++++++----- src/rlgl.c | 14 ++++++++++++++ src/rlgl.h | 1 + src/textures.c | 7 +++---- 4 files changed, 49 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index a94ad48d..08f9a7e2 100644 --- a/src/core.c +++ b/src/core.c @@ -562,9 +562,8 @@ void Begin2dMode(Camera2D camera) Matrix matOrigin = MatrixTranslate(-camera.target.x, -camera.target.y, 0.0f); Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); - Matrix matTranslation = MatrixTranslate(camera.offset.x + camera.target.x, camera.offset.y + camera.target.y, 0.0f); - + Matrix matTransform = MatrixMultiply(MatrixMultiply(matOrigin, MatrixMultiply(matScale, matRotation)), matTranslation); rlMultMatrixf(MatrixToFloat(matTransform)); @@ -627,11 +626,24 @@ void BeginTextureMode(RenderTexture2D target) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - rlEnableRenderTexture(target.id); - + rlEnableRenderTexture(target.id); // Enable render target + rlClearScreenBuffers(); // Clear render texture buffers + + // Set viewport to framebuffer size + rlViewport(0, 0, target.texture.width, target.texture.height); + + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix + rlLoadIdentity(); // Reset current matrix (PROJECTION) + // Set orthographic projection to current framebuffer size + // NOTE: Configured top-left corner as (0, 0) + rlOrtho(0, target.texture.width, target.texture.height, 0, 0.0f, 1.0f); + + rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) + + //rlScalef(0.0f, -1.0f, 0.0f); // Flip Y-drawing (?) } // Ends drawing to render texture @@ -639,7 +651,21 @@ void EndTextureMode(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - rlDisableRenderTexture(); + rlDisableRenderTexture(); // Disable render target + + // Set viewport to default framebuffer size (screen size) + // TODO: consider possible viewport offsets + rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix + rlLoadIdentity(); // Reset current matrix (PROJECTION) + + // Set orthographic projection to current framebuffer size + // NOTE: Configured top-left corner as (0, 0) + rlOrtho(0, GetScreenWidth(), GetScreenHeight(), 0, 0.0f, 1.0f); + + rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix + rlLoadIdentity(); // Reset current matrix (MODELVIEW) } // Set target FPS for the game diff --git a/src/rlgl.c b/src/rlgl.c index d319119f..cc4c4c2f 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -404,6 +404,12 @@ void rlOrtho(double left, double right, double bottom, double top, double near, #endif +// Set the viewport area (trasnformation from normalized device coordinates to window coordinates) +void rlViewport(int x, int y, int width, int height) +{ + glViewport(x, y, width, height); +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Vertex level operations //---------------------------------------------------------------------------------- @@ -725,17 +731,25 @@ void rlDisableTexture(void) #endif } +// Enable rendering to texture (fbo) void rlEnableRenderTexture(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glBindFramebuffer(GL_FRAMEBUFFER, id); + + //glDisable(GL_CULL_FACE); // Allow double side drawing for texture flipping + //glCullFace(GL_FRONT); #endif } +// Disable rendering to texture void rlDisableRenderTexture(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) glBindFramebuffer(GL_FRAMEBUFFER, 0); + + //glEnable(GL_CULL_FACE); + //glCullFace(GL_BACK); #endif } diff --git a/src/rlgl.h b/src/rlgl.h index fa35dbc6..a3ba6cd5 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -247,6 +247,7 @@ void rlScalef(float x, float y, float z); // Multiply the current matrix b void rlMultMatrixf(float *mat); // Multiply the current matrix by another matrix void rlFrustum(double left, double right, double bottom, double top, double near, double far); void rlOrtho(double left, double right, double bottom, double top, double near, double far); +void rlViewport(int x, int y, int width, int height); // Set the viewport area //------------------------------------------------------------------------------------ // Functions Declaration - Vertex level operations diff --git a/src/textures.c b/src/textures.c index 79047ab7..439311f6 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1385,10 +1385,6 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float sc void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint) { Rectangle destRec = { (int)position.x, (int)position.y, abs(sourceRec.width), abs(sourceRec.height) }; - - if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; - if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; - Vector2 origin = { 0, 0 }; DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint); @@ -1398,6 +1394,9 @@ void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Co // NOTE: origin is relative to destination rectangle size void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint) { + if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; + if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; + rlEnableTexture(texture.id); rlPushMatrix(); -- cgit v1.2.3 From 2e26ce235d00fdc633559f9404ddd8ec70c96df7 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Mon, 30 May 2016 19:18:11 +0200 Subject: Add Draw3DCircle function and update raylib and rlgl header Draw3DCircle is useful to draw point lights radius. --- src/models.c | 19 +++++++++++++++++++ src/raylib.h | 3 ++- src/rlgl.h | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 07dee720..6ffb561e 100644 --- a/src/models.c +++ b/src/models.c @@ -75,6 +75,25 @@ void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color) rlEnd(); } +// Draw a circle in 3D world space +void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color) +{ + rlPushMatrix(); + rlTranslatef(center.x, center.y, center.z); + rlRotatef(rotationAngle, rotation.x, rotation.y, rotation.z); + + rlBegin(RL_LINES); + for (int i = 0; i < 360; i += 10) + { + rlColor4ub(color.r, color.g, color.b, color.a); + + rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f); + rlVertex3f(sin(DEG2RAD*(i + 10)) * radius, cos(DEG2RAD*(i + 10)) * radius, 0.0f); + } + rlEnd(); + rlPopMatrix(); +} + // Draw cube // NOTE: Cube position is the center position void DrawCube(Vector3 position, float width, float height, float length, Color color) diff --git a/src/raylib.h b/src/raylib.h index d0231be2..0af7ef31 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -437,7 +437,7 @@ typedef struct LightData { Vector3 position; Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float attenuation; // Lost of light intensity with distance (world distance) + float radius; // Lost of light intensity with distance (world distance) Color diffuse; // Light color float intensity; // Light intensity level @@ -803,6 +803,7 @@ const char *SubText(const char *text, int position, int length); // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires diff --git a/src/rlgl.h b/src/rlgl.h index a3ba6cd5..d4a2dabe 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -218,7 +218,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; Vector3 position; Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float attenuation; // Lost of light intensity with distance (world distance) + float radius; // Lost of light intensity with distance (world distance) Color diffuse; // Use Vector3 diffuse float intensity; -- cgit v1.2.3 From 64f6c74c9aafc00b727c0f959a64d43f7e6bfab0 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Mon, 30 May 2016 19:18:55 +0200 Subject: Add normal and specular maps to draw model process --- src/rlgl.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index cc4c4c2f..d781b755 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -204,8 +204,8 @@ static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support // Lighting data -static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount; // Counts current enabled physic objects +static Light lights[MAX_LIGHTS]; // Lights pool +static int lightsCount; // Counts current enabled physic objects #endif // Compressed textures support flags @@ -1810,6 +1810,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if ((material.texNormal.id != 0) && (material.shader.mapTexture1Loc != -1)) { + // Upload to shader specular map flag + glUniform1i(glGetUniformLocation(material.shader.id, "useNormal"), 1); + glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, material.texNormal.id); glUniform1i(material.shader.mapTexture1Loc, 1); // Normal texture fits in active texture unit 1 @@ -1820,6 +1823,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if ((material.texSpecular.id != 0) && (material.shader.mapTexture2Loc != -1)) { + // Upload to shader specular map flag + glUniform1i(glGetUniformLocation(material.shader.id, "useSpecular"), 1); + glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); glUniform1i(material.shader.mapTexture2Loc, 2); // Specular texture fits in active texture unit 2 @@ -2293,7 +2299,13 @@ void DrawLights(void) { switch (lights[i]->type) { - case LIGHT_POINT: DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); break; + case LIGHT_POINT: + { + DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + Draw3DCircle(lights[i]->position, lights[i]->radius, 0.0f, (Vector3){ 0, 0, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + Draw3DCircle(lights[i]->position, lights[i]->radius, 90.0f, (Vector3){ 1, 0, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + Draw3DCircle(lights[i]->position, lights[i]->radius, 90.0f, (Vector3){ 0, 1, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); + } break; case LIGHT_DIRECTIONAL: { Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); @@ -3105,9 +3117,9 @@ static void SetShaderLights(Shader shader) locPoint = GetShaderLocation(shader, locName); glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - memcpy(&locName[10], "attenuation\0", strlen("attenuation\0")); + memcpy(&locName[10], "radius\0", strlen("radius\0") + 2); locPoint = GetShaderLocation(shader, locName); - glUniform1f(locPoint, lights[i]->attenuation); + glUniform1f(locPoint, lights[i]->radius); } break; case LIGHT_DIRECTIONAL: { -- cgit v1.2.3 From f2d61d4043850e89b2d2cb7bacffe628aef0b981 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Mon, 30 May 2016 19:43:35 +0200 Subject: Remove normal depth Scaling normal depth (y axis) makes disappear the specular of fragments... So I think it can be removed, it is not a very useful/important attribute. --- src/models.c | 1 - src/raylib.h | 1 - src/rlgl.c | 5 +---- src/rlgl.h | 1 - 4 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 6ffb561e..90b752fd 100644 --- a/src/models.c +++ b/src/models.c @@ -756,7 +756,6 @@ Material LoadDefaultMaterial(void) material.colSpecular = WHITE; // Specular color material.glossiness = 100.0f; // Glossiness level - material.normalDepth = 1.0f; // Normal map depth return material; } diff --git a/src/raylib.h b/src/raylib.h index 0af7ef31..73a36a16 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -419,7 +419,6 @@ typedef struct Material { Color colSpecular; // Specular color float glossiness; // Glossiness level (Ranges from 0 to 1000) - float normalDepth; // Normal map depth } Material; // Model type diff --git a/src/rlgl.c b/src/rlgl.c index d781b755..b4569207 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1816,9 +1816,6 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, material.texNormal.id); glUniform1i(material.shader.mapTexture1Loc, 1); // Normal texture fits in active texture unit 1 - - // TODO: Upload to shader normalDepth - //glUniform1f(???, material.normalDepth); } if ((material.texSpecular.id != 0) && (material.shader.mapTexture2Loc != -1)) @@ -2565,7 +2562,7 @@ static Shader LoadDefaultShader(void) // Load standard shader // NOTE: This shader supports: // - Up to 3 different maps: diffuse, normal, specular -// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness, normalDepth +// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness // - Up to 8 lights: Point, Directional or Spot static Shader LoadStandardShader(void) { diff --git a/src/rlgl.h b/src/rlgl.h index d4a2dabe..dc16e807 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -207,7 +207,6 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; Color colSpecular; // Specular color float glossiness; // Glossiness level (Ranges from 0 to 1000) - float normalDepth; // Normal map depth } Material; // Light type -- cgit v1.2.3 From b0a0c5d4312d05d460cdd12f6af12321b0a55e66 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Mon, 30 May 2016 19:55:13 +0200 Subject: Added tint color attribute to material data type It tints all fragments, ignores lighting. Useful for some features like feedback (damage color, ...). --- src/models.c | 3 ++- src/raylib.h | 1 + src/rlgl.c | 3 +++ src/rlgl.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 90b752fd..092a43fc 100644 --- a/src/models.c +++ b/src/models.c @@ -751,6 +751,7 @@ Material LoadDefaultMaterial(void) //material.texNormal; // NOTE: By default, not set //material.texSpecular; // NOTE: By default, not set + material.colTint = WHITE; // Tint color material.colDiffuse = WHITE; // Diffuse color material.colAmbient = WHITE; // Ambient color material.colSpecular = WHITE; // Specular color @@ -1268,7 +1269,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - // model.material.colDiffuse = tint; + model.material.colTint = tint; rlglDrawMesh(model.mesh, model.material, model.transform); } diff --git a/src/raylib.h b/src/raylib.h index 73a36a16..dfec956d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -414,6 +414,7 @@ typedef struct Material { Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) + Color colTint; // Tint color Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color diff --git a/src/rlgl.c b/src/rlgl.c index b4569207..0f68953e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1793,6 +1793,9 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Setup shader uniforms for lights SetShaderLights(material.shader); + // Upload to shader material.colSpecular + glUniform4f(glGetUniformLocation(material.shader.id, "colTint"), (float)material.colTint.r/255, (float)material.colTint.g/255, (float)material.colTint.b/255, (float)material.colTint.a/255); + // Upload to shader material.colAmbient glUniform4f(glGetUniformLocation(material.shader.id, "colAmbient"), (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); diff --git a/src/rlgl.h b/src/rlgl.h index dc16e807..23ad29fb 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -202,6 +202,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; Texture2D texNormal; // Normal texture Texture2D texSpecular; // Specular texture + Color colTint; // Tint color Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color -- cgit v1.2.3 From 8a4e28f81db16c034274e5d78dddfe33824e59fe Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 31 May 2016 00:01:19 +0200 Subject: Support Android internal data storage Useful to save small data files (configuration and so) For bigger files, external data storage should be used (SDCard) --- src/core.c | 26 +++++++++++++++++++++++--- src/utils.c | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 08f9a7e2..70dfa7a5 100644 --- a/src/core.c +++ b/src/core.c @@ -147,6 +147,7 @@ static bool windowMinimized = false; static struct android_app *app; // Android activity static struct android_poll_source *source; // Android events polling source static int ident, events; // Android ALooper_pollAll() variables +static const char *internalDataPath; // Android internal data path to write data (/data/data//files) static bool windowReady = false; // Used to detect display initialization static bool appEnabled = true; // Used to detec if app is active @@ -363,6 +364,7 @@ void InitWindow(int width, int height, struct android_app *state) screenHeight = height; app = state; + internalDataPath = app->activity->internalDataPath; // Set desired windows flags before initializing anything ANativeActivity_setWindowFlags(app->activity, AWINDOW_FLAG_FULLSCREEN, 0); //AWINDOW_FLAG_SCALED, AWINDOW_FLAG_DITHER @@ -838,12 +840,21 @@ void ClearDroppedFiles(void) void StorageSaveValue(int position, int value) { FILE *storageFile = NULL; + + char path[128]; +#if defined(PLATFORM_ANDROID) + strcpy(path, internalDataPath); + strcat(path, "/"); + strcat(path, STORAGE_FILENAME); +#else + strcpy(path, STORAGE_FILENAME); +#endif // Try open existing file to append data - storageFile = fopen(STORAGE_FILENAME, "rb+"); + storageFile = fopen(path, "rb+"); // If file doesn't exist, create a new storage data file - if (!storageFile) storageFile = fopen(STORAGE_FILENAME, "wb"); + if (!storageFile) storageFile = fopen(path, "wb"); if (!storageFile) TraceLog(WARNING, "Storage data file could not be created"); else @@ -870,8 +881,17 @@ int StorageLoadValue(int position) { int value = 0; + char path[128]; +#if defined(PLATFORM_ANDROID) + strcpy(path, internalDataPath); + strcat(path, "/"); + strcat(path, STORAGE_FILENAME); +#else + strcpy(path, STORAGE_FILENAME); +#endif + // Try open existing file to append data - FILE *storageFile = fopen(STORAGE_FILENAME, "rb"); + FILE *storageFile = fopen(path, "rb"); if (!storageFile) TraceLog(WARNING, "Storage data file could not be found"); else diff --git a/src/utils.c b/src/utils.c index 974088f3..f0ccf3e2 100644 --- a/src/utils.c +++ b/src/utils.c @@ -247,7 +247,7 @@ FILE *android_fopen(const char *fileName, const char *mode) AAsset *asset = AAssetManager_open(assetManager, fileName, 0); - if(!asset) return NULL; + if (!asset) return NULL; return funopen(asset, android_read, android_write, android_seek, android_close); } -- cgit v1.2.3 From 9f2fc81df2ad6731b521bd7dfd523ee10f63be90 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Mon, 30 May 2016 15:34:29 -0700 Subject: update to openal --- src/audio.c | 2 +- src/audio.h | 2 +- src/raylib.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 0c61c0fa..c72b32aa 100644 --- a/src/audio.c +++ b/src/audio.c @@ -399,7 +399,7 @@ void CloseRawAudioContext(RawAudioContext ctx) CloseMixChannel(mixChannelsActive_g[ctx]); } -int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements) +int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements) { int numBuffered = 0; if(ctx >= 0) diff --git a/src/audio.h b/src/audio.h index 1140a60a..ec00f7b5 100644 --- a/src/audio.h +++ b/src/audio.h @@ -107,7 +107,7 @@ void SetMusicPitch(int index, float pitch); RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); void CloseRawAudioContext(RawAudioContext ctx); -int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements); // returns number of elements buffered +int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements); // returns number of elements buffered #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index d0231be2..a0cfc7a0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -926,7 +926,7 @@ void SetMusicPitch(int index, float pitch); RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); void CloseRawAudioContext(RawAudioContext ctx); -int BufferRawAudioContext(RawAudioContext ctx, void *data, int numberElements); // returns number of elements buffered +int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements); // returns number of elements buffered #ifdef __cplusplus } -- cgit v1.2.3 From caa7bc366b949310fbb9c7eafbb9fa7050e1514a Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 31 May 2016 00:51:55 +0200 Subject: Reviewed DrawLight() function and some tweaks --- src/models.c | 29 +++++++++++++++++++++++++++++ src/raylib.h | 18 +++++++++--------- src/rlgl.c | 38 +++++++------------------------------- 3 files changed, 45 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 092a43fc..8c5ed914 100644 --- a/src/models.c +++ b/src/models.c @@ -569,6 +569,35 @@ void DrawGizmo(Vector3 position) rlPopMatrix(); } + +// Draw light in 3D world +void DrawLight(Light light) +{ + switch (light->type) + { + case LIGHT_POINT: + { + DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); + } break; + case LIGHT_DIRECTIONAL: + { + Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + } break; + case LIGHT_SPOT: + { + Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : BLACK)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + } break; + default: break; + } +} + // Load a 3d model (from file) Model LoadModel(const char *fileName) { diff --git a/src/raylib.h b/src/raylib.h index dfec956d..cba73e52 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -431,18 +431,18 @@ typedef struct Model { // Light type typedef struct LightData { - int id; - int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - bool enabled; + unsigned int id; // Light id + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; // Light enabled - Vector3 position; - Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Lost of light intensity with distance (world distance) + Vector3 position; // Light position + Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float radius; // Light attenuation radius light intensity reduced with distance (world distance) - Color diffuse; // Light color + Color diffuse; // Light diffuse color float intensity; // Light intensity level - float coneAngle; // Spot light max angle + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; // Light types @@ -817,6 +817,7 @@ void DrawPlane(Vector3 centerPos, Vector2 size, Color color); void DrawRay(Ray ray, Color color); // Draw a ray line void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) void DrawGizmo(Vector3 position); // Draw simple gizmo +void DrawLight(Light light); // Draw light in 3D world //DrawTorus(), DrawTeapot() are useless... //------------------------------------------------------------------------------------ @@ -873,7 +874,6 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // S void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool -void DrawLights(void); // Draw all created lights in 3D world void DestroyLight(Light light); // Destroy a light and take it out of the list //---------------------------------------------------------------------------------- diff --git a/src/rlgl.c b/src/rlgl.c index 0f68953e..97a92a4d 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1069,6 +1069,13 @@ void rlglClose(void) // Delete default white texture glDeleteTextures(1, &whiteTexture); TraceLog(INFO, "[TEX ID %i] Unloaded texture data (base white texture) from VRAM", whiteTexture); + + // Unload lights + if (lightsCount > 0) + { + for (int i = 0; i < lightsCount; i++) free(lights[i]); + lightsCount = 0; + } free(draws); #endif @@ -2292,37 +2299,6 @@ Light CreateLight(int type, Vector3 position, Color diffuse) return light; } -// Draw all created lights in 3D world -void DrawLights(void) -{ - for (int i = 0; i < lightsCount; i++) - { - switch (lights[i]->type) - { - case LIGHT_POINT: - { - DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - Draw3DCircle(lights[i]->position, lights[i]->radius, 0.0f, (Vector3){ 0, 0, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - Draw3DCircle(lights[i]->position, lights[i]->radius, 90.0f, (Vector3){ 1, 0, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - Draw3DCircle(lights[i]->position, lights[i]->radius, 90.0f, (Vector3){ 0, 1, 0 }, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - } break; - case LIGHT_DIRECTIONAL: - { - Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - DrawSphereWires(lights[i]->position, 0.3f*lights[i]->intensity, 4, 8, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - DrawCubeWires(lights[i]->target, 0.3f, 0.3f, 0.3f, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - } break; - case LIGHT_SPOT: - { - Draw3DLine(lights[i]->position, lights[i]->target, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - DrawCylinderWires(lights[i]->position, 0.0f, 0.3f*lights[i]->coneAngle/50, 0.6f, 5, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - DrawCubeWires(lights[i]->target, 0.3f, 0.3f, 0.3f, (lights[i]->enabled ? lights[i]->diffuse : BLACK)); - } break; - default: break; - } - } -} - // Destroy a light and take it out of the list void DestroyLight(Light light) { -- cgit v1.2.3 From cac2a66debd0f2d3ef8195940f8e2744d539d19a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 31 May 2016 17:11:02 +0200 Subject: Improved library consistency Functions renamed to improve library consistency --- src/raylib.h | 8 +++++--- src/rlgl.c | 18 ++++++++++++------ src/rlgl.h | 9 ++++++--- 3 files changed, 23 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index cba73e52..5bef3698 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -860,8 +860,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p //------------------------------------------------------------------------------------ Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations void UnloadShader(Shader shader); // Unload a custom shader from memory -void SetDefaultShader(void); // Set default shader to be used in batch draw -void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw + Shader GetDefaultShader(void); // Get default shader Shader GetStandardShader(void); // Get default shader Texture2D GetDefaultTexture(void); // Get default texture @@ -871,7 +870,10 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // S void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) +void BeginShaderMode(Shader shader); // Begin custom shader drawing +void EndShaderMode(void); // End custom shader drawing (use default shader) +void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) +void EndBlendMode(void); // End blending mode (reset to default: alpha blending) Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool void DestroyLight(Light light); // Destroy a light and take it out of the list diff --git a/src/rlgl.c b/src/rlgl.c index 97a92a4d..5c4c9c01 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2157,7 +2157,7 @@ void UnloadShader(Shader shader) } // Set custom shader to be used on batch draw -void SetCustomShader(Shader shader) +void BeginShaderMode(Shader shader) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (currentShader.id != shader.id) @@ -2169,10 +2169,10 @@ void SetCustomShader(Shader shader) } // Set default shader to be used in batch draw -void SetDefaultShader(void) +void EndShaderMode(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - SetCustomShader(defaultShader); + BeginShaderMode(defaultShader); #endif } @@ -2254,9 +2254,9 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) #endif } -// Set blending mode (alpha, additive, multiplied) -// NOTE: Only 3 blending modes predefined -void SetBlendMode(int mode) +// Begin blending mode (alpha, additive, multiplied) +// NOTE: Only 3 blending modes supported, default blend mode is alpha +void BeginBlendMode(int mode) { if ((blendMode != mode) && (mode < 3)) { @@ -2274,6 +2274,12 @@ void SetBlendMode(int mode) } } +// End blending mode (reset to default: alpha blending) +void EndBlendMode(void) +{ + BeginBlendMode(BLEND_ALPHA); +} + // Create a new light, initialize it and add to pool Light CreateLight(int type, Vector3 position, Color diffuse) { diff --git a/src/rlgl.h b/src/rlgl.h index 23ad29fb..ccf2b36a 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -317,9 +317,9 @@ void *rlglReadTexturePixels(Texture2D texture); // Read text //------------------------------------------------------------------------------------ Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations void UnloadShader(Shader shader); // Unload a custom shader from memory -void SetCustomShader(Shader shader); // Set custom shader to be used in batch draw -void SetDefaultShader(void); // Set default shader to be used in batch draw + Shader GetDefaultShader(void); // Get default shader +Shader GetStandardShader(void); // Get default shader Texture2D GetDefaultTexture(void); // Get default texture int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location @@ -327,7 +327,10 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // S void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -void SetBlendMode(int mode); // Set blending mode (alpha, additive, multiplied) +void BeginShaderMode(Shader shader); // Begin custom shader drawing +void EndShaderMode(void); // End custom shader drawing (use default shader) +void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) +void EndBlendMode(void); // End blending mode (reset to default: alpha blending) Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool void DestroyLight(Light light); // Destroy a light and take it out of the list -- cgit v1.2.3 From 302ec438dd8a5483e4fcf81d4bd80ac7d09e6a61 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 31 May 2016 18:15:53 +0200 Subject: Removed colTint, tint color is colDiffuse Tint color could be applied to colDiffuse... but what's the best way? Replace it? Multiply by? A point to think about... --- src/models.c | 5 ++--- src/raylib.h | 1 - src/rlgl.c | 3 --- src/rlgl.h | 21 ++++++++++----------- 4 files changed, 12 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 8c5ed914..962a6470 100644 --- a/src/models.c +++ b/src/models.c @@ -779,8 +779,7 @@ Material LoadDefaultMaterial(void) material.texDiffuse = GetDefaultTexture(); // White texture (1x1 pixel) //material.texNormal; // NOTE: By default, not set //material.texSpecular; // NOTE: By default, not set - - material.colTint = WHITE; // Tint color + material.colDiffuse = WHITE; // Diffuse color material.colAmbient = WHITE; // Ambient color material.colSpecular = WHITE; // Specular color @@ -1298,7 +1297,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); - model.material.colTint = tint; + model.material.colDiffuse = tint; // TODO: Multiply tint color by diffuse color? rlglDrawMesh(model.mesh, model.material, model.transform); } diff --git a/src/raylib.h b/src/raylib.h index 5bef3698..271c0e42 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -414,7 +414,6 @@ typedef struct Material { Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) - Color colTint; // Tint color Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color diff --git a/src/rlgl.c b/src/rlgl.c index 5c4c9c01..6a2adeb2 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1800,9 +1800,6 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Setup shader uniforms for lights SetShaderLights(material.shader); - // Upload to shader material.colSpecular - glUniform4f(glGetUniformLocation(material.shader.id, "colTint"), (float)material.colTint.r/255, (float)material.colTint.g/255, (float)material.colTint.b/255, (float)material.colTint.a/255); - // Upload to shader material.colAmbient glUniform4f(glGetUniformLocation(material.shader.id, "colAmbient"), (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); diff --git a/src/rlgl.h b/src/rlgl.h index ccf2b36a..336f6019 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -201,8 +201,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; Texture2D texDiffuse; // Diffuse texture Texture2D texNormal; // Normal texture Texture2D texSpecular; // Specular texture - - Color colTint; // Tint color + Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color @@ -212,18 +211,18 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; // Light type typedef struct LightData { - int id; - int type; // LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - bool enabled; + unsigned int id; // Light id + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; // Light enabled - Vector3 position; - Vector3 target; // Used on LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Lost of light intensity with distance (world distance) + Vector3 position; // Light position + Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float radius; // Light attenuation radius light intensity reduced with distance (world distance) - Color diffuse; // Use Vector3 diffuse - float intensity; + Color diffuse; // Light diffuse color + float intensity; // Light intensity level - float coneAngle; // Spot light max angle + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; // Color blending modes (pre-defined) -- cgit v1.2.3 From d17a0cee1aa53978387e68be58d901bffd1ac0a9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 31 May 2016 19:12:37 +0200 Subject: Review text formatting (spacing, tabs...) --- src/core.c | 18 +++++----- src/raylib.h | 96 +++++++++++++++++++++++++++--------------------------- src/raymath.h | 2 +- src/rlgl.c | 2 +- src/rlgl.h | 103 ++++++++++++++++++++++++++++++---------------------------- src/shapes.c | 2 +- 6 files changed, 112 insertions(+), 111 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 70dfa7a5..7bd44c81 100644 --- a/src/core.c +++ b/src/core.c @@ -2078,10 +2078,10 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int gestureEvent.position[0] = GetMousePosition(); // Normalize gestureEvent.position[0] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); - - // Gesture data is sent to gestures system for processing + + // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); #endif } @@ -2223,10 +2223,10 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // Load default font for convenience // NOTE: External function (defined in module: text) LoadDefaultFont(); - + // TODO: GPU assets reload in case of lost focus (lost context) // NOTE: This problem has been solved just unbinding and rebinding context from display - /* + /* if (assetsReloadRequired) { for (int i = 0; i < assetsCount; i++) @@ -2759,9 +2759,9 @@ static void *GamepadThread(void *arg) }; // Read gamepad event - struct js_event gamepadEvent; + struct js_event gamepadEvent; - while (1) + while (1) { for (int i = 0; i < MAX_GAMEPADS; i++) { @@ -2792,8 +2792,8 @@ static void *GamepadThread(void *arg) } } } - } - + } + return NULL; } #endif diff --git a/src/raylib.h b/src/raylib.h index 271c0e42..1ef0a98e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -349,7 +349,7 @@ typedef struct Camera { Vector3 position; // Camera position Vector3 target; // Camera target it looks-at Vector3 up; // Camera up vector (rotation over its axis) - float fovy; // Field-Of-View apperture in Y (degrees) + float fovy; // Camera field-of-view apperture in Y (degrees) } Camera; // Camera2D type, defines a 2d camera @@ -362,86 +362,84 @@ typedef struct Camera2D { // Bounding box type typedef struct BoundingBox { - Vector3 min; - Vector3 max; + Vector3 min; // minimum vertex box-corner + Vector3 max; // maximum vertex box-corner } BoundingBox; // Vertex data definning a mesh typedef struct Mesh { - int vertexCount; // number of vertices stored in arrays - int triangleCount; // number of triangles stored (indexed or not) - float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) - unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices; // vertex indices (in case vertex data comes indexed) - - BoundingBox bounds; // mesh limits defined by min and max points - - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) + int vertexCount; // number of vertices stored in arrays + int triangleCount; // number of triangles stored (indexed or not) + float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) + unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices;// vertex indices (in case vertex data comes indexed) + + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) } Mesh; // Shader type (generic shader) typedef struct Shader { - unsigned int id; // Shader program id + unsigned int id; // Shader program id // Vertex attributes locations (default locations) - int vertexLoc; // Vertex attribute location point (default-location = 0) - int texcoordLoc; // Texcoord attribute location point (default-location = 1) - int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) - int normalLoc; // Normal attribute location point (default-location = 2) - int tangentLoc; // Tangent attribute location point (default-location = 4) - int colorLoc; // Color attibute location point (default-location = 3) + int vertexLoc; // Vertex attribute location point (default-location = 0) + int texcoordLoc; // Texcoord attribute location point (default-location = 1) + int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) + int normalLoc; // Normal attribute location point (default-location = 2) + int tangentLoc; // Tangent attribute location point (default-location = 4) + int colorLoc; // Color attibute location point (default-location = 3) // Uniform locations - int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) - int tintColorLoc; // Diffuse color uniform location point (fragment shader) + int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) + int tintColorLoc; // Diffuse color uniform location point (fragment shader) // Texture map locations (generic for any kind of map) - int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) - int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) - int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) + int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) + int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) + int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) } Shader; // Material type typedef struct Material { - Shader shader; // Standard shader (supports 3 map textures) + Shader shader; // Standard shader (supports 3 map textures) - Texture2D texDiffuse; // Diffuse texture (binded to shader mapTexture0Loc) - Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) - Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) + Texture2D texDiffuse; // Diffuse texture (binded to shader mapTexture0Loc) + Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) + Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) - Color colDiffuse; // Diffuse color - Color colAmbient; // Ambient color - Color colSpecular; // Specular color + Color colDiffuse; // Diffuse color + Color colAmbient; // Ambient color + Color colSpecular; // Specular color - float glossiness; // Glossiness level (Ranges from 0 to 1000) + float glossiness; // Glossiness level (Ranges from 0 to 1000) } Material; // Model type typedef struct Model { - Mesh mesh; // Vertex data buffers (RAM and VRAM) - Matrix transform; // Local transform matrix - Material material; // Shader and textures data + Mesh mesh; // Vertex data buffers (RAM and VRAM) + Matrix transform; // Local transform matrix + Material material; // Shader and textures data } Model; // Light type typedef struct LightData { - unsigned int id; // Light id - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - bool enabled; // Light enabled + unsigned int id; // Light unique id + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; // Light enabled - Vector3 position; // Light position - Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Light attenuation radius light intensity reduced with distance (world distance) + Vector3 position; // Light position + Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float radius; // Light attenuation radius light intensity reduced with distance (world distance) - Color diffuse; // Light diffuse color - float intensity; // Light intensity level + Color diffuse; // Light diffuse color + float intensity; // Light intensity level - float coneAngle; // Light cone max angle: LIGHT_SPOT + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; // Light types diff --git a/src/raymath.h b/src/raymath.h index 59d66e56..2e055e9f 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -73,7 +73,7 @@ //---------------------------------------------------------------------------------- #if defined(RAYMATH_STANDALONE) - // Vector2 type + // Vector2 type typedef struct Vector2 { float x; float y; diff --git a/src/rlgl.c b/src/rlgl.c index 6a2adeb2..89361f46 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2369,7 +2369,7 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) { unsigned int program = 0; - + #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vertexShader; GLuint fragmentShader; diff --git a/src/rlgl.h b/src/rlgl.h index 336f6019..e8e754b4 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -130,51 +130,43 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; COMPRESSED_ASTC_4x4_RGBA, // 8 bpp COMPRESSED_ASTC_8x8_RGBA // 2 bpp } TextureFormat; - - // Bounding box type - typedef struct BoundingBox { - Vector3 min; - Vector3 max; - } BoundingBox; // Vertex data definning a mesh typedef struct Mesh { - int vertexCount; // number of vertices stored in arrays - float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) - float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) - float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) - float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) - float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) - unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) - unsigned short *indices; // vertex indices (in case vertex data comes indexed) - int triangleCount; // number of triangles stored (indexed or not) - - BoundingBox bounds; // mesh limits defined by min and max points - - unsigned int vaoId; // OpenGL Vertex Array Object id - unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) + int vertexCount; // number of vertices stored in arrays + int triangleCount; // number of triangles stored (indexed or not) + float *vertices; // vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // vertex tangents (XYZ - 3 components per vertex) (shader-location = 4) + unsigned char *colors; // vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices;// vertex indices (in case vertex data comes indexed) + + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int vboId[7]; // OpenGL Vertex Buffer Objects id (7 types of vertex data) } Mesh; // Shader type (generic shader) typedef struct Shader { - unsigned int id; // Shader program id + unsigned int id; // Shader program id // Vertex attributes locations (default locations) - int vertexLoc; // Vertex attribute location point (default-location = 0) - int texcoordLoc; // Texcoord attribute location point (default-location = 1) - int normalLoc; // Normal attribute location point (default-location = 2) - int colorLoc; // Color attibute location point (default-location = 3) - int tangentLoc; // Tangent attribute location point (default-location = 4) - int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) + int vertexLoc; // Vertex attribute location point (default-location = 0) + int texcoordLoc; // Texcoord attribute location point (default-location = 1) + int normalLoc; // Normal attribute location point (default-location = 2) + int colorLoc; // Color attibute location point (default-location = 3) + int tangentLoc; // Tangent attribute location point (default-location = 4) + int texcoord2Loc; // Texcoord2 attribute location point (default-location = 5) // Uniform locations - int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) - int tintColorLoc; // Color uniform location point (fragment shader) + int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) + int tintColorLoc; // Color uniform location point (fragment shader) // Texture map locations (generic for any kind of map) - int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) - int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) - int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) + int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) + int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) + int mapTexture2Loc; // Map texture uniform location point (default-texture-unit = 2) } Shader; // Texture2D type @@ -196,35 +188,46 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; // Material type typedef struct Material { - Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) + Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) - Texture2D texDiffuse; // Diffuse texture - Texture2D texNormal; // Normal texture - Texture2D texSpecular; // Specular texture + Texture2D texDiffuse; // Diffuse texture + Texture2D texNormal; // Normal texture + Texture2D texSpecular; // Specular texture - Color colDiffuse; // Diffuse color - Color colAmbient; // Ambient color - Color colSpecular; // Specular color + Color colDiffuse; // Diffuse color + Color colAmbient; // Ambient color + Color colSpecular; // Specular color - float glossiness; // Glossiness level (Ranges from 0 to 1000) + float glossiness; // Glossiness level (Ranges from 0 to 1000) } Material; + // Camera type, defines a camera position/orientation in 3d space + typedef struct Camera { + Vector3 position; // Camera position + Vector3 target; // Camera target it looks-at + Vector3 up; // Camera up vector (rotation over its axis) + float fovy; // Camera field-of-view apperture in Y (degrees) + } Camera; + // Light type typedef struct LightData { - unsigned int id; // Light id - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - bool enabled; // Light enabled + unsigned int id; // Light unique id + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + bool enabled; // Light enabled - Vector3 position; // Light position - Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Light attenuation radius light intensity reduced with distance (world distance) + Vector3 position; // Light position + Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + float radius; // Light attenuation radius light intensity reduced with distance (world distance) - Color diffuse; // Light diffuse color - float intensity; // Light intensity level + Color diffuse; // Light diffuse color + float intensity; // Light intensity level - float coneAngle; // Light cone max angle: LIGHT_SPOT + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; - + + // Light types + typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; + // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; #endif diff --git a/src/shapes.c b/src/shapes.c index 5b66e5ef..7129ac17 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -489,7 +489,7 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) retRec.height = rec2.height - dyy; } } - + if (rec1.width > rec2.width) { if (retRec.width >= rec2.width) retRec.width = rec2.width; -- cgit v1.2.3 From 897179a06c3e62d11fec98d3f7fed3c1fa6d167a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 1 Jun 2016 12:37:51 +0200 Subject: Corrected some issues on OpenGL 1.1 --- src/rlgl.c | 21 ++++++++++++++++----- src/textures.c | 56 ++++++++++++++++++++++++++++++-------------------------- 2 files changed, 46 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 89361f46..aa536e2a 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -237,7 +237,7 @@ static Shader LoadDefaultShader(void); // Load default shader (just vertex static Shader LoadStandardShader(void); // Load standard shader (support materials and lighting) static void LoadDefaultShaderLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) static void UnloadDefaultShader(void); // Unload default shader -static void UnloadStandardShader(void); // Unload standard shader +static void UnloadStandardShader(void); // Unload standard shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data @@ -256,7 +256,7 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); #if defined(RLGL_STANDALONE) static void TraceLog(int msgType, const char *text, ...); -float *MatrixToFloat(Matrix mat); // Converts Matrix to float array +float *MatrixToFloat(Matrix mat); // Converts Matrix to float array #endif //---------------------------------------------------------------------------------- @@ -1545,10 +1545,10 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) mesh->vboId[5] = 0; // Vertex texcoords2 VBO mesh->vboId[6] = 0; // Vertex indices VBO +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) int drawHint = GL_STATIC_DRAW; if (dynamic) drawHint = GL_DYNAMIC_DRAW; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) GLuint vaoId = 0; // Vertex Array Objects (VAO) GLuint vboId[7]; // Vertex Buffer Objects (VBOs) @@ -1674,6 +1674,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) // Update vertex data on GPU (upload new data to one buffer) void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Activate mesh VAO if (vaoSupported) glBindVertexArray(mesh.vaoId); @@ -1729,6 +1730,7 @@ void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) //mesh.vertices = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE); // Now we can modify vertices //glUnmapBuffer(GL_ARRAY_BUFFER); +#endif } // Draw a 3d mesh with material and transform @@ -2280,8 +2282,11 @@ void EndBlendMode(void) // Create a new light, initialize it and add to pool Light CreateLight(int type, Vector3 position, Color diffuse) { + Light light = NULL; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Allocate dynamic memory - Light light = (Light)malloc(sizeof(LightData)); + light = (Light)malloc(sizeof(LightData)); // Initialize light values with generic values light->id = lightsCount; @@ -2298,13 +2303,18 @@ Light CreateLight(int type, Vector3 position, Color diffuse) // Increase enabled lights count lightsCount++; - +#else + // TODO: Support OpenGL 1.1 lighting system + TraceLog(WARNING, "Lighting currently not supported on OpenGL 1.1"); +#endif + return light; } // Destroy a light and take it out of the list void DestroyLight(Light light) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Free dynamic memory allocation free(lights[light->id]); @@ -2322,6 +2332,7 @@ void DestroyLight(Light light) // Decrease enabled physic objects count lightsCount--; +#endif } //---------------------------------------------------------------------------------- diff --git a/src/textures.c b/src/textures.c index 439311f6..8c59f3f2 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1394,39 +1394,43 @@ void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Co // NOTE: origin is relative to destination rectangle size void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint) { - if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; - if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; - - rlEnableTexture(texture.id); + // Check if texture is valid + if (texture.id != 0) + { + if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; + if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; + + rlEnableTexture(texture.id); - rlPushMatrix(); - rlTranslatef(destRec.x, destRec.y, 0); - rlRotatef(rotation, 0, 0, 1); - rlTranslatef(-origin.x, -origin.y, 0); + rlPushMatrix(); + rlTranslatef(destRec.x, destRec.y, 0); + rlRotatef(rotation, 0, 0, 1); + rlTranslatef(-origin.x, -origin.y, 0); - rlBegin(RL_QUADS); - rlColor4ub(tint.r, tint.g, tint.b, tint.a); - rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer + rlBegin(RL_QUADS); + rlColor4ub(tint.r, tint.g, tint.b, tint.a); + rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer - // Bottom-left corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)sourceRec.y / texture.height); - rlVertex2f(0.0f, 0.0f); + // Bottom-left corner for texture and quad + rlTexCoord2f((float)sourceRec.x / texture.width, (float)sourceRec.y / texture.height); + rlVertex2f(0.0f, 0.0f); - // Bottom-right corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); - rlVertex2f(0.0f, destRec.height); + // Bottom-right corner for texture and quad + rlTexCoord2f((float)sourceRec.x / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlVertex2f(0.0f, destRec.height); - // Top-right corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); - rlVertex2f(destRec.width, destRec.height); + // Top-right corner for texture and quad + rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlVertex2f(destRec.width, destRec.height); - // Top-left corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)sourceRec.y / texture.height); - rlVertex2f(destRec.width, 0.0f); - rlEnd(); - rlPopMatrix(); + // Top-left corner for texture and quad + rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)sourceRec.y / texture.height); + rlVertex2f(destRec.width, 0.0f); + rlEnd(); + rlPopMatrix(); - rlDisableTexture(); + rlDisableTexture(); + } } //---------------------------------------------------------------------------------- -- cgit v1.2.3 From 3e88156817d5de5cc413acf67f0fd0a39a69acb2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 1 Jun 2016 12:38:06 +0200 Subject: Ignore invalid warning --- src/Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 12f4609b..244675e2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -69,12 +69,13 @@ else endif # define compiler flags: -# -O1 defines optimization level -# -Wall turns on most, but not all, compiler warnings -# -std=c99 defines C language mode (standard C from 1999 revision) -# -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -fgnu89-inline declaring inline functions support (GCC optimized, faster) -CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline +# -O1 defines optimization level +# -Wall turns on most, but not all, compiler warnings +# -std=c99 defines C language mode (standard C from 1999 revision) +# -std=gnu99 defines C language mode (GNU C from 1999 revision) +# -fgnu89-inline declaring inline functions support (GCC optimized, faster) +# -Wno-missing-braces ignore invalid warning (GCC bug 53119) +CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes -- cgit v1.2.3 From 0a27525a4ba2ca9f8f6c4e723b50411549d6c558 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 1 Jun 2016 14:01:35 +0200 Subject: Dependencies review Checking some files to be converted to header-only --- src/camera.c | 2 +- src/gestures.c | 10 +++---- src/physac.c | 4 +-- src/raygui.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- src/raygui.h | 43 ++++++++++++++++++++++++++-- 5 files changed, 130 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/camera.c b/src/camera.c index 8e5c527e..11571cca 100644 --- a/src/camera.c +++ b/src/camera.c @@ -30,7 +30,7 @@ #include "raylib.h" #endif -#include +#include // Required for: sqrt(), sin(), cos() //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/gestures.c b/src/gestures.c index d72aaf4e..d3b85d12 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -28,19 +28,19 @@ #if defined(GESTURES_STANDALONE) #include "gestures.h" #else - #include "raylib.h" // Required for typedef(s): Vector2, Gestures + #include "raylib.h" // Required for: Vector2, Gestures #endif -#include // Used for: atan2(), sqrt() -#include // Defines int32_t, int64_t +#include // Required for: atan2(), sqrt() +#include // Required for: uint64_t #if defined(_WIN32) // Functions required to query time on Windows int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); #elif defined(__linux) - #include // Declares storage size of ‘now’ - #include // Used for clock functions + #include // Required for: timespec + #include // Required for: clock_gettime() #endif //---------------------------------------------------------------------------------- diff --git a/src/physac.c b/src/physac.c index 181488ac..eed2f26e 100644 --- a/src/physac.c +++ b/src/physac.c @@ -29,8 +29,8 @@ #include "raylib.h" #endif -#include // Declares malloc() and free() for memory management -#include // Declares cos(), sin(), abs() and fminf() for math operations +#include // Required for: malloc(), free() +#include // Required for: cos(), sin(), abs(), fminf() //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/raygui.c b/src/raygui.c index 95cea0b6..40d7b265 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -5,6 +5,13 @@ * Initial design by Kevin Gato and Daniel Nicolás * Reviewed by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria (@raysan5) * +* The following functions from raylib are required for drawing and input reading: + GetColor(), GetHexValue() --> Used on SetStyleProperty() + MeasureText(), GetDefaultFont() + DrawRectangleRec(), DrawRectangle(), DrawText(), DrawLine() + GetMousePosition(), (), IsMouseButtonDown(), IsMouseButtonReleased() + 'FormatText(), IsKeyDown(), 'IsMouseButtonUp() +* * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. * @@ -22,12 +29,20 @@ * **********************************************************************************************/ -#include "raygui.h" +#define RAYGUI_STANDALONE // NOTE: To use the raygui module as standalone lib, just uncomment this line + // NOTE: Some external funtions are required for drawing and input management + +#if defined(RAYGUI_STANDALONE) + #include "raygui.h" +#else + #include "raylib.h" +#endif -#include -#include -#include // Required for malloc(), free() -#include // Required for strcmp() +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() + // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() + +#include // Required for: malloc(), free() +#include // Required for: strcmp() //---------------------------------------------------------------------------------- // Defines and Macros @@ -157,6 +172,21 @@ static int style[NUM_PROPERTIES] = { //---------------------------------------------------------------------------------- static Color ColorMultiply(Color baseColor, float value); +#if defined RAYGUI_STANDALONE +static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value +static int GetHexValue(Color color); // Returns hexadecimal value for a Color +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle + +// NOTE: raygui depend on some raylib input and drawing functions +// TODO: Set your own input functions (used in ProcessCamera()) +static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } +static int IsMouseButtonDown(int button) { return 0; } +static int IsMouseButtonPressed(int button) { return 0; } +static int IsMouseButtonReleased(int button) { return 0; } +static int IsMouseButtonUp(int button) { return 0; } +static int IsKeyDown(int key) { return 0; } +#endif + //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- @@ -164,7 +194,7 @@ static Color ColorMultiply(Color baseColor, float value); // Label element, show text void GuiLabel(Rectangle bounds, const char *text) { - GuiLabelEx(bounds,text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); + GuiLabelEx(bounds, text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); } // Label element extended, configurable colors @@ -1051,4 +1081,48 @@ static Color ColorMultiply(Color baseColor, float value) multColor.b += (255 - multColor.b)*value; return multColor; -} \ No newline at end of file +} + +#if defined (RAYGUI_STANDALONE) +// Returns a Color struct from hexadecimal value +static Color GetColor(int hexValue) +{ + Color color; + + color.r = (unsigned char)(hexValue >> 24) & 0xFF; + color.g = (unsigned char)(hexValue >> 16) & 0xFF; + color.b = (unsigned char)(hexValue >> 8) & 0xFF; + color.a = (unsigned char)hexValue & 0xFF; + + return color; +} + +// Returns hexadecimal value for a Color +static int GetHexValue(Color color) +{ + return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); +} + +// Check if point is inside rectangle +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) +{ + bool collision = false; + + if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; + + return collision; +} + +// Formatting of text with variables to 'embed' +static const char *FormatText(const char *text, ...) +{ + static char buffer[MAX_FORMATTEXT_LENGTH]; + + va_list args; + va_start(args, text); + vsprintf(buffer, text, args); + va_end(args); + + return buffer; +} +#endif \ No newline at end of file diff --git a/src/raygui.h b/src/raygui.h index 6906eca7..3951e087 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -23,16 +23,55 @@ #ifndef RAYGUI_H #define RAYGUI_H -#include "raylib.h" +//#include "raylib.h" //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define NUM_PROPERTIES 98 +#define NUM_PROPERTIES 98 + +#define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) + +#define KEY_LEFT 263 +#define KEY_RIGHT 262 + +#define MOUSE_LEFT_BUTTON 0 + //---------------------------------------------------------------------------------- // Types and Structures Definition +// NOTE: Some types are required for RAYGUI_STANDALONE usage //---------------------------------------------------------------------------------- +#ifndef __cplusplus +// Boolean type + #ifndef true + typedef enum { false, true } bool; + #endif +#endif + +// Vector2 type +typedef struct Vector2 { + float x; + float y; +} Vector2; + +// Color type, RGBA (32bit) +typedef struct Color { + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; +} Color; + +// Rectangle type +typedef struct Rectangle { + int x; + int y; + int width; + int height; +} Rectangle; + +// Gui properties enumeration typedef enum GuiProperty { GLOBAL_BASE_COLOR = 0, GLOBAL_BORDER_COLOR, -- cgit v1.2.3 From 7afa0b09ab00b610ad084026022df788fb787229 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 2 Jun 2016 01:24:27 +0200 Subject: Support raygui as standalone library --- src/raygui.c | 57 ++++++++++++++++++++++++++++++++++----------------------- src/raygui.h | 58 ++++++++++++++++++++++++++-------------------------------- 2 files changed, 60 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c index 40d7b265..266ecc6a 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -5,13 +5,6 @@ * Initial design by Kevin Gato and Daniel Nicolás * Reviewed by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria (@raysan5) * -* The following functions from raylib are required for drawing and input reading: - GetColor(), GetHexValue() --> Used on SetStyleProperty() - MeasureText(), GetDefaultFont() - DrawRectangleRec(), DrawRectangle(), DrawText(), DrawLine() - GetMousePosition(), (), IsMouseButtonDown(), IsMouseButtonReleased() - 'FormatText(), IsKeyDown(), 'IsMouseButtonUp() -* * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. * @@ -29,25 +22,30 @@ * **********************************************************************************************/ -#define RAYGUI_STANDALONE // NOTE: To use the raygui module as standalone lib, just uncomment this line +//#define RAYGUI_STANDALONE // To use the raygui module as standalone lib, just uncomment this line // NOTE: Some external funtions are required for drawing and input management -#if defined(RAYGUI_STANDALONE) - #include "raygui.h" -#else +#if !defined(RAYGUI_STANDALONE) #include "raylib.h" #endif +#include "raygui.h" + #include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() #include // Required for: malloc(), free() #include // Required for: strcmp() +#include // Required for: va_list, va_start(), vfprintf(), va_end() //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -//... +#if defined(RAYGUI_STANDALONE) + #define KEY_LEFT 263 + #define KEY_RIGHT 262 + #define MOUSE_LEFT_BUTTON 0 +#endif //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -65,7 +63,7 @@ typedef enum { SLIDER_DEFAULT, SLIDER_HOVER, SLIDER_ACTIVE } SliderState; // Global Variables Definition //---------------------------------------------------------------------------------- -//Current GUI style (default light) +// Current GUI style (default light) static int style[NUM_PROPERTIES] = { 0xf5f5f5ff, // GLOBAL_BASE_COLOR, 0xf5f5f5ff, // GLOBAL_BORDER_COLOR, @@ -176,15 +174,24 @@ static Color ColorMultiply(Color baseColor, float value); static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value static int GetHexValue(Color color); // Returns hexadecimal value for a Color static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' // NOTE: raygui depend on some raylib input and drawing functions -// TODO: Set your own input functions (used in ProcessCamera()) +// TODO: Set your own functions static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } static int IsMouseButtonDown(int button) { return 0; } static int IsMouseButtonPressed(int button) { return 0; } static int IsMouseButtonReleased(int button) { return 0; } static int IsMouseButtonUp(int button) { return 0; } -static int IsKeyDown(int key) { return 0; } + +static int GetKeyPressed(void) { return 0; } // NOTE: Only used by GuiTextBox() +static int IsKeyDown(int key) { return 0; } // NOTE: Only used by GuiSpinner() + +static int MeasureText(const char *text, int fontSize) { return 0; } +static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } +static void DrawRectangleRec(Rectangle rec, Color color) { } +static void DrawRectangle(int posX, int posY, int width, int height, Color color) { DrawRectangleRec((Rectangle){ posX, posY, width, height }, color); } + #endif //---------------------------------------------------------------------------------- @@ -194,6 +201,8 @@ static int IsKeyDown(int key) { return 0; } // Label element, show text void GuiLabel(Rectangle bounds, const char *text) { + #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) + GuiLabelEx(bounds, text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); } @@ -203,7 +212,7 @@ void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color borde // Update control //-------------------------------------------------------------------- int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = GetDefaultFont().size; + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; if (bounds.width < textWidth) bounds.width = textWidth + style[LABEL_TEXT_PADDING]; if (bounds.height < textHeight) bounds.height = textHeight + style[LABEL_TEXT_PADDING]/2; @@ -224,7 +233,7 @@ bool GuiButton(Rectangle bounds, const char *text) Vector2 mousePoint = GetMousePosition(); int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = GetDefaultFont().size; + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Update control //-------------------------------------------------------------------- @@ -282,7 +291,7 @@ bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle) Vector2 mousePoint = GetMousePosition(); int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = GetDefaultFont().size; + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Update control //-------------------------------------------------------------------- @@ -367,7 +376,7 @@ int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActiv Rectangle click = { bounds.x + bounds.width + style[COMBOBOX_PADDING], bounds.y, style[COMBOBOX_BUTTON_WIDTH], style[COMBOBOX_BUTTON_HEIGHT] }; Vector2 mousePoint = GetMousePosition(); - int textHeight = GetDefaultFont().size; + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; for (int i = 0; i < comboNum; i++) { @@ -657,9 +666,8 @@ int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) Rectangle rightButtonBound = { bounds.x + bounds.width - bounds.width/4 + 1, bounds.y, bounds.width/4, bounds.height }; Vector2 mousePoint = GetMousePosition(); - int textHeight = GetDefaultFont().size; - int textWidth = MeasureText(FormatText("%i", value), style[GLOBAL_TEXT_FONTSIZE]); + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; int buttonSide = 0; @@ -894,10 +902,11 @@ char *GuiTextBox(Rectangle bounds, char *text) DrawText(FormatText("%c", text[i]), initPos, bounds.y + style[TEXTBOX_TEXT_FONTSIZE], style[TEXTBOX_TEXT_FONTSIZE], GetColor(style[TEXTBOX_TEXT_COLOR])); - initPos += ((GetDefaultFont().charRecs[(int)text[i] - 32].width + 2)); + initPos += (MeasureText(FormatText("%c", text[i]), style[GLOBAL_TEXT_FONTSIZE]) + 2); + //initPos += ((GetDefaultFont().charRecs[(int)text[i] - 32].width + 2)); } - if ((framesCounter/20)%2 && CheckCollisionPointRec(mousePoint, bounds)) DrawLine(initPos + 2, bounds.y + 5, initPos + 2, bounds.y + 10 + 15, GetColor(style[TEXTBOX_LINE_COLOR])); + if ((framesCounter/20)%2 && CheckCollisionPointRec(mousePoint, bounds)) DrawRectangle(initPos + 2, bounds.y + 5, 1, 20, GetColor(style[TEXTBOX_LINE_COLOR])); //-------------------------------------------------------------------- return text; @@ -1116,6 +1125,8 @@ static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) // Formatting of text with variables to 'embed' static const char *FormatText(const char *text, ...) { + #define MAX_FORMATTEXT_LENGTH 64 + static char buffer[MAX_FORMATTEXT_LENGTH]; va_list args; diff --git a/src/raygui.h b/src/raygui.h index 3951e087..61741254 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -30,46 +30,40 @@ //---------------------------------------------------------------------------------- #define NUM_PROPERTIES 98 -#define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) - -#define KEY_LEFT 263 -#define KEY_RIGHT 262 - -#define MOUSE_LEFT_BUTTON 0 - - //---------------------------------------------------------------------------------- // Types and Structures Definition // NOTE: Some types are required for RAYGUI_STANDALONE usage //---------------------------------------------------------------------------------- -#ifndef __cplusplus -// Boolean type - #ifndef true - typedef enum { false, true } bool; +#if defined(RAYGUI_STANDALONE) + #ifndef __cplusplus + // Boolean type + #ifndef true + typedef enum { false, true } bool; + #endif #endif -#endif -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; + // Vector2 type + typedef struct Vector2 { + float x; + float y; + } Vector2; -// Color type, RGBA (32bit) -typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; -} Color; + // Color type, RGBA (32bit) + typedef struct Color { + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; + } Color; -// Rectangle type -typedef struct Rectangle { - int x; - int y; - int width; - int height; -} Rectangle; + // Rectangle type + typedef struct Rectangle { + int x; + int y; + int width; + int height; + } Rectangle; +#endif // Gui properties enumeration typedef enum GuiProperty { -- cgit v1.2.3 From 17878550b1e2dde44fcd1e668c92ca2d96680a28 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 2 Jun 2016 01:26:44 +0200 Subject: Review heades usage This is a first step toward a bigger project. Some modules could be ported to header-only to be used as standalone. --- src/audio.c | 16 ++++++++-------- src/models.c | 18 +++++++++--------- src/rlgl.c | 30 +++++++++++++++--------------- src/rlgl.h | 6 +++--- src/text.c | 12 ++++++------ src/textures.c | 10 ++++++---- src/utils.c | 10 +++++----- src/utils.h | 4 ++-- 8 files changed, 54 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 0c61c0fa..a884303c 100644 --- a/src/audio.c +++ b/src/audio.c @@ -37,24 +37,24 @@ #include "AL/al.h" // OpenAL basic header #include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) -#include "AL/alext.h" // extensions for other format types +#include "AL/alext.h" // OpenAL extensions for other format types -#include // Declares malloc() and free() for memory management -#include // Required for strcmp() -#include // Used for .WAV loading +#include // Required for: malloc(), free() +#include // Required for: strcmp(), strncmp() +#include // Required for: FILE, fopen(), fclose(), fread() #if defined(AUDIO_STANDALONE) - #include // Used for functions with variable number of parameters (TraceLog()) + #include // Required for: va_list, va_start(), vfprintf(), va_end() #else - #include "utils.h" // rRES data decompression utility function - // NOTE: Includes Android fopen function map + #include "utils.h" // Required for: DecompressData() + // NOTE: Includes Android fopen() function map #endif //#define STB_VORBIS_HEADER_ONLY #include "stb_vorbis.h" // OGG loading functions #define JAR_XM_IMPLEMENTATION -#include "jar_xm.h" // For playing .xm files +#include "jar_xm.h" // XM loading functions //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/models.c b/src/models.c index 962a6470..15565c98 100644 --- a/src/models.c +++ b/src/models.c @@ -26,16 +26,16 @@ #include "raylib.h" #if defined(PLATFORM_ANDROID) - #include "utils.h" // Android fopen function map + #include "utils.h" // Android fopen function map #endif -#include // Standard input/output functions, used to read model files data -#include // Declares malloc() and free() for memory management -#include // Required for strcmp() -#include // Used for sin, cos, tan +#include // Required for: FILE, fopen(), fclose(), fscanf(), feof(), rewind(), fgets() +#include // Required for: malloc(), free() +#include // Required for: strcmp() +#include // Required for: sin(), cos() -#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 -#include "raymath.h" // Required for data type Matrix and Matrix functions +#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 +#include "raymath.h" // Matrix data type and Matrix functions //---------------------------------------------------------------------------------- // Defines and Macros @@ -605,7 +605,7 @@ Model LoadModel(const char *fileName) // TODO: Initialize default data for model in case loading fails, maybe a cube? - if (strcmp(GetExtension(fileName),"obj") == 0) model.mesh = LoadOBJ(fileName); + if (strcmp(GetExtension(fileName), "obj") == 0) model.mesh = LoadOBJ(fileName); else TraceLog(WARNING, "[%s] Model extension not recognized, it can't be loaded", fileName); if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); @@ -764,7 +764,7 @@ Material LoadMaterial(const char *fileName) { Material material = { 0 }; - if (strcmp(GetExtension(fileName),"mtl") == 0) material = LoadMTL(fileName); + if (strcmp(GetExtension(fileName), "mtl") == 0) material = LoadMTL(fileName); else TraceLog(WARNING, "[%s] Material extension not recognized, it can't be loaded", fileName); return material; diff --git a/src/rlgl.c b/src/rlgl.c index aa536e2a..cca48ba2 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -28,41 +28,41 @@ #include "rlgl.h" -#include // Standard input / output lib -#include // Declares malloc() and free() for memory management, rand() -#include // Declares strcmp(), strlen(), strtok() +#include // Standard input / output lib +#include // Required for: malloc(), free(), rand() +#include // Required for: strcmp(), strlen(), strtok() #ifndef RLGL_STANDALONE - #include "raymath.h" // Required for Vector3 and Matrix functions + #include "raymath.h" // Required for Vector3 and Matrix functions #endif #if defined(GRAPHICS_API_OPENGL_11) - #ifdef __APPLE__ // OpenGL include for OSX - #include + #ifdef __APPLE__ + #include // OpenGL 1.1 library for OSX #else - #include // Basic OpenGL include + #include // OpenGL 1.1 library #endif #endif #if defined(GRAPHICS_API_OPENGL_33) - #ifdef __APPLE__ // OpenGL include for OSX - #include + #ifdef __APPLE__ + #include // OpenGL 3 library for OSX #else //#define GLEW_STATIC //#include // GLEW header, includes OpenGL headers - #include "glad.h" // glad header, includes OpenGL headers + #include "glad.h" // GLAD library, includes OpenGL headers #endif #endif #if defined(GRAPHICS_API_OPENGL_ES2) - #include - #include - #include + #include // EGL library + #include // OpenGL ES 2.0 library + #include // OpenGL ES 2.0 extensions library #endif #if defined(RLGL_STANDALONE) - #include // Used for functions with variable number of parameters (TraceLog()) -#endif + #include // Required for: va_list, va_start(), vfprintf(), va_end() +#endif // NOTE: Used on TraceLog() //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/rlgl.h b/src/rlgl.h index e8e754b4..00482d2e 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -32,15 +32,15 @@ //#define RLGL_STANDALONE // NOTE: To use rlgl as standalone lib, just uncomment this line #ifndef RLGL_STANDALONE - #include "raylib.h" // Required for typedef(s): Model, Shader, Texture2D - #include "utils.h" // Required for function TraceLog() + #include "raylib.h" // Required for: Model, Shader, Texture2D + #include "utils.h" // Required for: TraceLog() #endif #ifdef RLGL_STANDALONE #define RAYMATH_STANDALONE #endif -#include "raymath.h" // Required for types: Vector3, Matrix +#include "raymath.h" // Required for: Vector3, Matrix // Select desired OpenGL version // NOTE: Those preprocessor defines are only used on rlgl module, diff --git a/src/text.c b/src/text.c index 7bb06f44..cef0ebcb 100644 --- a/src/text.c +++ b/src/text.c @@ -25,16 +25,16 @@ #include "raylib.h" -#include // Declares malloc() and free() for memory management -#include // String management functions (just strlen() is used) -#include // Used for functions with variable number of parameters (FormatText()) -#include // Standard input / output lib +#include // Required for: malloc(), free() +#include // Required for: strlen() +#include // Required for: va_list, va_start(), vfprintf(), va_end() +#include // Required for: FILE, fopen(), fclose(), fscanf(), feof(), rewind(), fgets() -#include "utils.h" // Required for function GetExtension() +#include "utils.h" // Required for: GetExtension() // Following libs are used on LoadTTF() #define STB_TRUETYPE_IMPLEMENTATION -#include "stb_truetype.h" +#include "stb_truetype.h" // Required for: stbtt_BakeFontBitmap() // Rectangle packing functions (not used at the moment) //#define STB_RECT_PACK_IMPLEMENTATION diff --git a/src/textures.c b/src/textures.c index 8c59f3f2..432d3426 100644 --- a/src/textures.c +++ b/src/textures.c @@ -29,8 +29,8 @@ #include "raylib.h" -#include // Declares malloc() and free() for memory management -#include // Required for strcmp(), strrchr(), strncmp() +#include // Required for: malloc(), free() +#include // Required for: strcmp(), strrchr(), strncmp() #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2 // Required: rlglLoadTexture() rlDeleteTextures(), @@ -40,10 +40,12 @@ // NOTE: Includes Android fopen function map #define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" // Used to read image data (multiple formats support) +#include "stb_image.h" // Required for: stbi_load() + // NOTE: Used to read image data (multiple formats support) #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "stb_image_resize.h" // Used on image scaling function: ImageResize() +#include "stb_image_resize.h" // Required for: stbir_resize_uint8() + // NOTE: Used for image scaling on ImageResize() //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/utils.c b/src/utils.c index f0ccf3e2..97561ee6 100644 --- a/src/utils.c +++ b/src/utils.c @@ -35,14 +35,14 @@ #include #endif -#include // malloc(), free() -#include // printf(), fprintf() -#include // Used for functions with variable number of parameters (TraceLog()) -//#include // String management functions: strlen(), strrchr(), strcmp() +#include // Required for: malloc(), free() +#include // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen() +#include // Required for: va_list, va_start(), vfprintf(), va_end() +//#include // Required for: strlen(), strrchr(), strcmp() #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) #define STB_IMAGE_WRITE_IMPLEMENTATION - #include "stb_image_write.h" // Create PNG file + #include "stb_image_write.h" // Required for: stbi_write_png() #endif #include "tinfl.c" diff --git a/src/utils.h b/src/utils.h index 77909ba6..899cf583 100644 --- a/src/utils.h +++ b/src/utils.h @@ -27,8 +27,8 @@ #define UTILS_H #if defined(PLATFORM_ANDROID) - #include // Defines FILE struct - #include // defines AAssetManager struct + #include // Required for: FILE + #include // Required for: AAssetManager #endif //---------------------------------------------------------------------------------- -- cgit v1.2.3 From 90e1ed2b5e54a9b6c69be3dd2b71d1e4f3632c33 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 1 Jun 2016 20:09:00 -0700 Subject: mod player added --- src/audio.c | 85 +++- src/audio.h | 3 +- src/jar_mod.h | 1583 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/raylib.h | 3 +- 4 files changed, 1652 insertions(+), 22 deletions(-) create mode 100644 src/jar_mod.h (limited to 'src') diff --git a/src/audio.c b/src/audio.c index c72b32aa..ceec5577 100644 --- a/src/audio.c +++ b/src/audio.c @@ -56,6 +56,9 @@ #define JAR_XM_IMPLEMENTATION #include "jar_xm.h" // For playing .xm files +#define JAR_MOD_IMPLEMENTATION +#include "jar_mod.h" // For playing .mod files + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -95,10 +98,11 @@ typedef struct MixChannel_t { // NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... typedef struct Music { stb_vorbis *stream; - jar_xm_context_t *chipctx; // Stores jar_xm mixc + jar_xm_context_t *xmctx; // Stores jar_xm mixc, XM chiptune context + modcontext modctx; // Stores mod chiptune context MixChannel_t *mixc; // mix channel - int totalSamplesLeft; + unsigned int totalSamplesLeft; float totalLengthSeconds; bool loop; bool chipTune; // True if chiptune is loaded @@ -399,6 +403,8 @@ void CloseRawAudioContext(RawAudioContext ctx) CloseMixChannel(mixChannelsActive_g[ctx]); } +// if 0 is returned, the buffers are still full and you need to keep trying with same data until a number is returned. +// any other number returned is the number that was processed and passed into buffer. int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements) { int numBuffered = 0; @@ -767,7 +773,7 @@ int PlayMusicStream(int musicIndex, char *fileName) { int mixIndex; - if(currentMusic[musicIndex].stream || currentMusic[musicIndex].chipctx) return 1; // error + if(currentMusic[musicIndex].stream || currentMusic[musicIndex].xmctx) return 1; // error for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { @@ -798,7 +804,7 @@ int PlayMusicStream(int musicIndex, char *fileName) musicEnabled_g = true; - currentMusic[musicIndex].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * info.channels; + currentMusic[musicIndex].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(currentMusic[musicIndex].stream) * info.channels; currentMusic[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[musicIndex].stream); if (info.channels == 2){ @@ -815,12 +821,12 @@ int PlayMusicStream(int musicIndex, char *fileName) else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if(!jar_xm_create_context_from_file(¤tMusic[musicIndex].chipctx, 48000, fileName)) + if(!jar_xm_create_context_from_file(¤tMusic[musicIndex].xmctx, 48000, fileName)) { currentMusic[musicIndex].chipTune = true; currentMusic[musicIndex].loop = true; - jar_xm_set_max_loop_count(currentMusic[musicIndex].chipctx, 0); // infinite number of loops - currentMusic[musicIndex].totalSamplesLeft = jar_xm_get_remaining_samples(currentMusic[musicIndex].chipctx); + jar_xm_set_max_loop_count(currentMusic[musicIndex].xmctx, 0); // infinite number of loops + currentMusic[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(currentMusic[musicIndex].xmctx); currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled_g = true; @@ -837,10 +843,34 @@ int PlayMusicStream(int musicIndex, char *fileName) return 6; // error } } + else if (strcmp(GetExtension(fileName),"mod") == 0) + { + jar_mod_init(¤tMusic[musicIndex].modctx); + if(jar_mod_load_file(¤tMusic[musicIndex].modctx, fileName)) + { + currentMusic[musicIndex].chipTune = true; + currentMusic[musicIndex].loop = true; + currentMusic[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(¤tMusic[musicIndex].modctx); + currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; + musicEnabled_g = true; + + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); + + currentMusic[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); + if(!currentMusic[musicIndex].mixc) return 7; // error + currentMusic[musicIndex].mixc->playing = true; + } + else + { + TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); + return 8; // error + } + } else { TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); - return 7; // error + return 9; // error } return 0; // normal return } @@ -852,9 +882,14 @@ void StopMusicStream(int index) { CloseMixChannel(currentMusic[index].mixc); - if (currentMusic[index].chipTune) + if (currentMusic[index].chipTune && currentMusic[index].xmctx) { - jar_xm_free_context(currentMusic[index].chipctx); + jar_xm_free_context(currentMusic[index].xmctx); + currentMusic[index].xmctx = 0; + } + else if(currentMusic[index].chipTune && currentMusic[index].modctx.mod_loaded) + { + jar_mod_unload(¤tMusic[index].modctx); } else { @@ -862,10 +897,10 @@ void StopMusicStream(int index) } if(!getMusicStreamCount()) musicEnabled_g = false; - if(currentMusic[index].stream || currentMusic[index].chipctx) + if(currentMusic[index].stream || currentMusic[index].xmctx) { currentMusic[index].stream = NULL; - currentMusic[index].chipctx = NULL; + currentMusic[index].xmctx = NULL; } } } @@ -937,13 +972,13 @@ void SetMusicPitch(int index, float pitch) } } -// Get current music time length (in seconds) +// Get music time length (in seconds) float GetMusicTimeLength(int index) { float totalSeconds; if (currentMusic[index].chipTune) { - totalSeconds = currentMusic[index].totalLengthSeconds; + totalSeconds = (float)currentMusic[index].totalLengthSeconds; } else { @@ -959,11 +994,16 @@ float GetMusicTimePlayed(int index) float secondsPlayed = 0.0f; if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) { - if (currentMusic[index].chipTune) + if (currentMusic[index].chipTune && currentMusic[index].xmctx) { uint64_t samples; - jar_xm_get_position(currentMusic[index].chipctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000 * currentMusic[index].mixc->channels); // Not sure if this is the correct value + jar_xm_get_position(currentMusic[index].xmctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000.f * currentMusic[index].mixc->channels); // Not sure if this is the correct value + } + else if(currentMusic[index].chipTune && currentMusic[index].modctx.mod_loaded) + { + long numsamp = jar_mod_current_samples(¤tMusic[index].modctx); + secondsPlayed = (float)numsamp / (48000.f); } else { @@ -984,7 +1024,7 @@ float GetMusicTimePlayed(int index) static bool BufferMusicStream(int index, int numBuffers) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; - float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; + //float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) @@ -998,9 +1038,13 @@ static bool BufferMusicStream(int index, int numBuffers) for(int x=0; x free.fr> +// Adapted to jar_mod by: Joshua Adam Reisenauer +// This program is free software. It comes without any warranty, to the +// extent permitted by applicable law. You can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To Public +// License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/wtfpl/COPYING for more details. +/////////////////////////////////////////////////////////////////////////////////// +// HxCMOD Core API: +// ------------------------------------------- +// int jar_mod_init(modcontext * modctx) +// +// - Initialize the modcontext buffer. Must be called before doing anything else. +// Return 1 if success. 0 in case of error. +// ------------------------------------------- +// mulong jar_mod_load_file(modcontext * modctx, char* filename) +// +// - "Load" a MOD from file, context must already be initialized. +// Return size of file in bytes. +// ------------------------------------------- +// void jar_mod_fillbuffer( modcontext * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +// +// - Generate and return the next samples chunk to outbuffer. +// nbsample specify the number of stereo 16bits samples you want. +// The output format is by default signed 48000Hz 16-bit Stereo PCM samples, otherwise it is changed with jar_mod_setcfg(). +// The output buffer size in bytes must be equal to ( nbsample * 2 * channels ). +// The optional trkbuf parameter can be used to get detailed status of the player. Put NULL/0 is unused. +// ------------------------------------------- +// void jar_mod_unload( modcontext * modctx ) +// - "Unload" / clear the player status. +// ------------------------------------------- +/////////////////////////////////////////////////////////////////////////////////// + + +#ifndef INCLUDE_JAR_MOD_H +#define INCLUDE_JAR_MOD_H + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// Basic type +typedef unsigned char muchar; +typedef unsigned short muint; +typedef short mint; +typedef unsigned long mulong; + +#define NUMMAXCHANNELS 32 +#define MAXNOTES 12*12 +#define DEFAULT_SAMPLE_RATE 48000 +// +// MOD file structures +// + +#pragma pack(1) + +typedef struct { + muchar name[22]; + muint length; + muchar finetune; + muchar volume; + muint reppnt; + muint replen; +} sample; + +typedef struct { + muchar sampperiod; + muchar period; + muchar sampeffect; + muchar effect; +} note; + +typedef struct { + muchar title[20]; + sample samples[31]; + muchar length; // length of tablepos + muchar protracker; + muchar patterntable[128]; + muchar signature[4]; + muchar speed; +} module; + +#pragma pack() + +// +// HxCMod Internal structures +// +typedef struct { + char* sampdata; + muint sampnum; + muint length; + muint reppnt; + muint replen; + mulong samppos; + muint period; + muchar volume; + mulong ticks; + muchar effect; + muchar parameffect; + muint effect_code; + mint decalperiod; + mint portaspeed; + mint portaperiod; + mint vibraperiod; + mint Arpperiods[3]; + muchar ArpIndex; + mint oldk; + muchar volumeslide; + muchar vibraparam; + muchar vibrapointeur; + muchar finetune; + muchar cut_param; + muint patternloopcnt; + muint patternloopstartpoint; +} channel; + +typedef struct { + module song; + char* sampledata[31]; + note* patterndata[128]; + + mulong playrate; + muint tablepos; + muint patternpos; + muint patterndelay; + muint jump_loop_effect; + muchar bpm; + mulong patternticks; + mulong patterntickse; + mulong patternticksaim; + mulong sampleticksconst; + mulong samplenb; + channel channels[NUMMAXCHANNELS]; + muint number_of_channels; + muint fullperiod[MAXNOTES * 8]; + muint mod_loaded; + mint last_r_sample; + mint last_l_sample; + mint stereo; + mint stereo_separation; + mint bits; + mint filter; + + muchar *modfile; // the raw mod file + mulong modfilesize; + muint loopcount; +} modcontext; + +// +// Player states structures +// +typedef struct track_state_ +{ + unsigned char instrument_number; + unsigned short cur_period; + unsigned char cur_volume; + unsigned short cur_effect; + unsigned short cur_parameffect; +}track_state; + +typedef struct tracker_state_ +{ + int number_of_tracks; + int bpm; + int speed; + int cur_pattern; + int cur_pattern_pos; + int cur_pattern_table_pos; + unsigned int buf_index; + track_state tracks[32]; +}tracker_state; + +typedef struct tracker_state_instrument_ +{ + char name[22]; + int active; +}tracker_state_instrument; + +typedef struct jar_mod_tracker_buffer_state_ +{ + int nb_max_of_state; + int nb_of_state; + int cur_rd_index; + int sample_step; + char name[64]; + tracker_state_instrument instruments[31]; + tracker_state * track_state_buf; +}jar_mod_tracker_buffer_state; + + + +bool jar_mod_init(modcontext * modctx); +bool jar_mod_setcfg(modcontext * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); +void jar_mod_fillbuffer(modcontext * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); +void jar_mod_unload(modcontext * modctx); +mulong jar_mod_load_file(modcontext * modctx, char* filename); +mulong jar_mod_current_samples(modcontext * modctx); +mulong jar_mod_max_samples(modcontext * modctx); +void jar_mod_seek_start(modcontext * ctx); + +#ifdef __cplusplus +} +#endif +//-------------------------------------------------------------------- + + + +//------------------------------------------------------------------------------- +#ifdef JAR_MOD_IMPLEMENTATION + +// Effects list +#define EFFECT_ARPEGGIO 0x0 // Supported +#define EFFECT_PORTAMENTO_UP 0x1 // Supported +#define EFFECT_PORTAMENTO_DOWN 0x2 // Supported +#define EFFECT_TONE_PORTAMENTO 0x3 // Supported +#define EFFECT_VIBRATO 0x4 // Supported +#define EFFECT_VOLSLIDE_TONEPORTA 0x5 // Supported +#define EFFECT_VOLSLIDE_VIBRATO 0x6 // Supported +#define EFFECT_VOLSLIDE_TREMOLO 0x7 // - TO BE DONE - +#define EFFECT_SET_PANNING 0x8 // - TO BE DONE - +#define EFFECT_SET_OFFSET 0x9 // Supported +#define EFFECT_VOLUME_SLIDE 0xA // Supported +#define EFFECT_JUMP_POSITION 0xB // Supported +#define EFFECT_SET_VOLUME 0xC // Supported +#define EFFECT_PATTERN_BREAK 0xD // Supported + +#define EFFECT_EXTENDED 0xE +#define EFFECT_E_FINE_PORTA_UP 0x1 // Supported +#define EFFECT_E_FINE_PORTA_DOWN 0x2 // Supported +#define EFFECT_E_GLISSANDO_CTRL 0x3 // - TO BE DONE - +#define EFFECT_E_VIBRATO_WAVEFORM 0x4 // - TO BE DONE - +#define EFFECT_E_SET_FINETUNE 0x5 // - TO BE DONE - +#define EFFECT_E_PATTERN_LOOP 0x6 // Supported +#define EFFECT_E_TREMOLO_WAVEFORM 0x7 // - TO BE DONE - +#define EFFECT_E_SET_PANNING_2 0x8 // - TO BE DONE - +#define EFFECT_E_RETRIGGER_NOTE 0x9 // - TO BE DONE - +#define EFFECT_E_FINE_VOLSLIDE_UP 0xA // Supported +#define EFFECT_E_FINE_VOLSLIDE_DOWN 0xB // Supported +#define EFFECT_E_NOTE_CUT 0xC // Supported +#define EFFECT_E_NOTE_DELAY 0xD // - TO BE DONE - +#define EFFECT_E_PATTERN_DELAY 0xE // Supported +#define EFFECT_E_INVERT_LOOP 0xF // - TO BE DONE - +#define EFFECT_SET_SPEED 0xF0 // Supported +#define EFFECT_SET_TEMPO 0xF2 // Supported + +#define PERIOD_TABLE_LENGTH MAXNOTES +#define FULL_PERIOD_TABLE_LENGTH ( PERIOD_TABLE_LENGTH * 8 ) + +static const short periodtable[]= +{ + 27392, 25856, 24384, 23040, 21696, 20480, 19328, 18240, 17216, 16256, 15360, 14496, + 13696, 12928, 12192, 11520, 10848, 10240, 9664, 9120, 8606, 8128, 7680, 7248, + 6848, 6464, 6096, 5760, 5424, 5120, 4832, 4560, 4304, 4064, 3840, 3624, + 3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812, + 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906, + 856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453, + 428, 404, 381, 360, 339, 320, 302, 285, 269, 254, 240, 226, + 214, 202, 190, 180, 170, 160, 151, 143, 135, 127, 120, 113, + 107, 101, 95, 90, 85, 80, 75, 71, 67, 63, 60, 56, + 53, 50, 47, 45, 42, 40, 37, 35, 33, 31, 30, 28, + 27, 25, 24, 22, 21, 20, 19, 18, 17, 16, 15, 14, + 13, 13, 12, 11, 11, 10, 9, 9, 8, 8, 7, 7 +}; + +static const short sintable[]={ + 0, 24, 49, 74, 97, 120, 141,161, + 180, 197, 212, 224, 235, 244, 250,253, + 255, 253, 250, 244, 235, 224, 212,197, + 180, 161, 141, 120, 97, 74, 49, 24 +}; + +typedef struct modtype_ +{ + unsigned char signature[5]; + int numberofchannels; +}modtype; + +modtype modlist[]= +{ + { "M!K!",4}, + { "M.K.",4}, + { "FLT4",4}, + { "FLT8",8}, + { "4CHN",4}, + { "6CHN",6}, + { "8CHN",8}, + { "10CH",10}, + { "12CH",12}, + { "14CH",14}, + { "16CH",16}, + { "18CH",18}, + { "20CH",20}, + { "22CH",22}, + { "24CH",24}, + { "26CH",26}, + { "28CH",28}, + { "30CH",30}, + { "32CH",32}, + { "",0} +}; + +/////////////////////////////////////////////////////////////////////////////////// + +static void memcopy( void * dest, void *source, unsigned long size ) +{ + unsigned long i; + unsigned char * d,*s; + + d=(unsigned char*)dest; + s=(unsigned char*)source; + for(i=0;i= mod->fullperiod[i]) + { + return i; + } + } + + return MAXNOTES; +} + +static void worknote( note * nptr, channel * cptr, char t, modcontext * mod ) +{ + muint sample, period, effect, operiod; + muint curnote, arpnote; + + sample = (nptr->sampperiod & 0xF0) | (nptr->sampeffect >> 4); + period = ((nptr->sampperiod & 0xF) << 8) | nptr->period; + effect = ((nptr->sampeffect & 0xF) << 8) | nptr->effect; + + operiod = cptr->period; + + if ( period || sample ) + { + if( sample && sample < 32 ) + { + cptr->sampnum = sample - 1; + } + + if( period || sample ) + { + cptr->sampdata = (char *) mod->sampledata[cptr->sampnum]; + cptr->length = mod->song.samples[cptr->sampnum].length; + cptr->reppnt = mod->song.samples[cptr->sampnum].reppnt; + cptr->replen = mod->song.samples[cptr->sampnum].replen; + + cptr->finetune = (mod->song.samples[cptr->sampnum].finetune)&0xF; + + if(effect>>8!=4 && effect>>8!=6) + { + cptr->vibraperiod=0; + cptr->vibrapointeur=0; + } + } + + if( (sample != 0) && ( (effect>>8) != EFFECT_VOLSLIDE_TONEPORTA ) ) + { + cptr->volume = mod->song.samples[cptr->sampnum].volume; + cptr->volumeslide = 0; + } + + if( ( (effect>>8) != EFFECT_TONE_PORTAMENTO && (effect>>8)!=EFFECT_VOLSLIDE_TONEPORTA) ) + { + if (period!=0) + cptr->samppos = 0; + } + + cptr->decalperiod = 0; + if( period ) + { + if(cptr->finetune) + { + if( cptr->finetune <= 7 ) + { + period = mod->fullperiod[getnote(mod,period,0) + cptr->finetune]; + } + else + { + period = mod->fullperiod[getnote(mod,period,0) - (16 - (cptr->finetune)) ]; + } + } + + cptr->period = period; + } + + } + + cptr->effect = 0; + cptr->parameffect = 0; + cptr->effect_code = effect; + + switch (effect >> 8) + { + case EFFECT_ARPEGGIO: + /* + [0]: Arpeggio + Where [0][x][y] means "play note, note+x semitones, note+y + semitones, then return to original note". The fluctuations are + carried out evenly spaced in one pattern division. They are usually + used to simulate chords, but this doesn't work too well. They are + also used to produce heavy vibrato. A major chord is when x=4, y=7. + A minor chord is when x=3, y=7. + */ + + if(effect&0xff) + { + cptr->effect = EFFECT_ARPEGGIO; + cptr->parameffect = effect&0xff; + + cptr->ArpIndex = 0; + + curnote = getnote(mod,cptr->period,cptr->finetune); + + cptr->Arpperiods[0] = cptr->period; + + arpnote = curnote + (((cptr->parameffect>>4)&0xF)*8); + if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) + arpnote = FULL_PERIOD_TABLE_LENGTH - 1; + + cptr->Arpperiods[1] = mod->fullperiod[arpnote]; + + arpnote = curnote + (((cptr->parameffect)&0xF)*8); + if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) + arpnote = FULL_PERIOD_TABLE_LENGTH - 1; + + cptr->Arpperiods[2] = mod->fullperiod[arpnote]; + } + break; + + case EFFECT_PORTAMENTO_UP: + /* + [1]: Slide up + Where [1][x][y] means "smoothly decrease the period of current + sample by x*16+y after each tick in the division". The + ticks/division are set with the 'set speed' effect (see below). If + the period of the note being played is z, then the final period + will be z - (x*16 + y)*(ticks - 1). As the slide rate depends on + the speed, changing the speed will change the slide. You cannot + slide beyond the note B3 (period 113). + */ + + cptr->effect = EFFECT_PORTAMENTO_UP; + cptr->parameffect = effect&0xff; + break; + + case EFFECT_PORTAMENTO_DOWN: + /* + [2]: Slide down + Where [2][x][y] means "smoothly increase the period of current + sample by x*16+y after each tick in the division". Similar to [1], + but lowers the pitch. You cannot slide beyond the note C1 (period + 856). + */ + + cptr->effect = EFFECT_PORTAMENTO_DOWN; + cptr->parameffect = effect&0xff; + break; + + case EFFECT_TONE_PORTAMENTO: + /* + [3]: Slide to note + Where [3][x][y] means "smoothly change the period of current sample + by x*16+y after each tick in the division, never sliding beyond + current period". The period-length in this channel's division is a + parameter to this effect, and hence is not played. Sliding to a + note is similar to effects [1] and [2], but the slide will not go + beyond the given period, and the direction is implied by that + period. If x and y are both 0, then the old slide will continue. + */ + + cptr->effect = EFFECT_TONE_PORTAMENTO; + if( (effect&0xff) != 0 ) + { + cptr->portaspeed = (short)(effect&0xff); + } + + if(period!=0) + { + cptr->portaperiod = period; + cptr->period = operiod; + } + break; + + case EFFECT_VIBRATO: + /* + [4]: Vibrato + Where [4][x][y] means "oscillate the sample pitch using a + particular waveform with amplitude y/16 semitones, such that (x * + ticks)/64 cycles occur in the division". The waveform is set using + effect [14][4]. By placing vibrato effects on consecutive + divisions, the vibrato effect can be maintained. If either x or y + are 0, then the old vibrato values will be used. + */ + + cptr->effect = EFFECT_VIBRATO; + if( ( effect & 0x0F ) != 0 ) // Depth continue or change ? + cptr->vibraparam = (cptr->vibraparam & 0xF0) | ( effect & 0x0F ); + if( ( effect & 0xF0 ) != 0 ) // Speed continue or change ? + cptr->vibraparam = (cptr->vibraparam & 0x0F) | ( effect & 0xF0 ); + + break; + + case EFFECT_VOLSLIDE_TONEPORTA: + /* + [5]: Continue 'Slide to note', but also do Volume slide + Where [5][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1), at the same time as continuing + the last 'Slide to note'". It is illegal for both x and y to be + non-zero. You cannot slide outside the volume range 0..64. The + period-length in this channel's division is a parameter to this + effect, and hence is not played. + */ + + if( period != 0 ) + { + cptr->portaperiod = period; + cptr->period = operiod; + } + + cptr->effect = EFFECT_VOLSLIDE_TONEPORTA; + if( ( effect & 0xFF ) != 0 ) + cptr->volumeslide = ( effect & 0xFF ); + + break; + + case EFFECT_VOLSLIDE_VIBRATO: + /* + [6]: Continue 'Vibrato', but also do Volume slide + Where [6][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1), at the same time as continuing + the last 'Vibrato'". It is illegal for both x and y to be non-zero. + You cannot slide outside the volume range 0..64. + */ + + cptr->effect = EFFECT_VOLSLIDE_VIBRATO; + if( (effect & 0xFF) != 0 ) + cptr->volumeslide = (effect & 0xFF); + break; + + case EFFECT_SET_OFFSET: + /* + [9]: Set sample offset + Where [9][x][y] means "play the sample from offset x*4096 + y*256". + The offset is measured in words. If no sample is given, yet one is + still playing on this channel, it should be retriggered to the new + offset using the current volume. + */ + + cptr->samppos = ((effect>>4) * 4096) + ((effect&0xF)*256); + + break; + + case EFFECT_VOLUME_SLIDE: + /* + [10]: Volume slide + Where [10][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1)". If both x and y are non-zero, + then the y value is ignored (assumed to be 0). You cannot slide + outside the volume range 0..64. + */ + + cptr->effect = EFFECT_VOLUME_SLIDE; + cptr->volumeslide = (effect & 0xFF); + break; + + case EFFECT_JUMP_POSITION: + /* + [11]: Position Jump + Where [11][x][y] means "stop the pattern after this division, and + continue the song at song-position x*16+y". This shifts the + 'pattern-cursor' in the pattern table (see above). Legal values for + x*16+y are from 0 to 127. + */ + + mod->tablepos = (effect & 0xFF); + if(mod->tablepos >= mod->song.length) + { + mod->tablepos = 0; + } + mod->patternpos = 0; + mod->jump_loop_effect = 1; + + break; + + case EFFECT_SET_VOLUME: + /* + [12]: Set volume + Where [12][x][y] means "set current sample's volume to x*16+y". + Legal volumes are 0..64. + */ + + cptr->volume = (effect & 0xFF); + break; + + case EFFECT_PATTERN_BREAK: + /* + [13]: Pattern Break + Where [13][x][y] means "stop the pattern after this division, and + continue the song at the next pattern at division x*10+y" (the 10 + is not a typo). Legal divisions are from 0 to 63 (note Protracker + exception above). + */ + + mod->patternpos = ( ((effect>>4)&0xF)*10 + (effect&0xF) ) * mod->number_of_channels; + mod->jump_loop_effect = 1; + mod->tablepos++; + if(mod->tablepos >= mod->song.length) + { + mod->tablepos = 0; + } + + break; + + case EFFECT_EXTENDED: + switch( (effect>>4) & 0xF ) + { + case EFFECT_E_FINE_PORTA_UP: + /* + [14][1]: Fineslide up + Where [14][1][x] means "decrement the period of the current sample + by x". The incrementing takes place at the beginning of the + division, and hence there is no actual sliding. You cannot slide + beyond the note B3 (period 113). + */ + + cptr->period -= (effect & 0xF); + if( cptr->period < 113 ) + cptr->period = 113; + break; + + case EFFECT_E_FINE_PORTA_DOWN: + /* + [14][2]: Fineslide down + Where [14][2][x] means "increment the period of the current sample + by x". Similar to [14][1] but shifts the pitch down. You cannot + slide beyond the note C1 (period 856). + */ + + cptr->period += (effect & 0xF); + if( cptr->period > 856 ) + cptr->period = 856; + break; + + case EFFECT_E_FINE_VOLSLIDE_UP: + /* + [14][10]: Fine volume slide up + Where [14][10][x] means "increment the volume of the current sample + by x". The incrementing takes place at the beginning of the + division, and hence there is no sliding. You cannot slide beyond + volume 64. + */ + + cptr->volume += (effect & 0xF); + if( cptr->volume>64 ) + cptr->volume = 64; + break; + + case EFFECT_E_FINE_VOLSLIDE_DOWN: + /* + [14][11]: Fine volume slide down + Where [14][11][x] means "decrement the volume of the current sample + by x". Similar to [14][10] but lowers volume. You cannot slide + beyond volume 0. + */ + + cptr->volume -= (effect & 0xF); + if( cptr->volume > 200 ) + cptr->volume = 0; + break; + + case EFFECT_E_PATTERN_LOOP: + /* + [14][6]: Loop pattern + Where [14][6][x] means "set the start of a loop to this division if + x is 0, otherwise after this division, jump back to the start of a + loop and play it another x times before continuing". If the start + of the loop was not set, it will default to the start of the + current pattern. Hence 'loop pattern' cannot be performed across + multiple patterns. Note that loops do not support nesting, and you + may generate an infinite loop if you try to nest 'loop pattern's. + */ + + if( effect & 0xF ) + { + if( cptr->patternloopcnt ) + { + cptr->patternloopcnt--; + if( cptr->patternloopcnt ) + { + mod->patternpos = cptr->patternloopstartpoint; + mod->jump_loop_effect = 1; + } + else + { + cptr->patternloopstartpoint = mod->patternpos ; + } + } + else + { + cptr->patternloopcnt = (effect & 0xF); + mod->patternpos = cptr->patternloopstartpoint; + mod->jump_loop_effect = 1; + } + } + else // Start point + { + cptr->patternloopstartpoint = mod->patternpos; + } + + break; + + case EFFECT_E_PATTERN_DELAY: + /* + [14][14]: Delay pattern + Where [14][14][x] means "after this division there will be a delay + equivalent to the time taken to play x divisions after which the + pattern will be resumed". The delay only relates to the + interpreting of new divisions, and all effects and previous notes + continue during delay. + */ + + mod->patterndelay = (effect & 0xF); + break; + + case EFFECT_E_NOTE_CUT: + /* + [14][12]: Cut sample + Where [14][12][x] means "after the current sample has been played + for x ticks in this division, its volume will be set to 0". This + implies that if x is 0, then you will not hear any of the sample. + If you wish to insert "silence" in a pattern, it is better to use a + "silence"-sample (see above) due to the lack of proper support for + this effect. + */ + cptr->effect = EFFECT_E_NOTE_CUT; + cptr->cut_param = (effect & 0xF); + if(!cptr->cut_param) + cptr->volume = 0; + break; + + default: + + break; + } + break; + + case 0xF: + /* + [15]: Set speed + Where [15][x][y] means "set speed to x*16+y". Though it is nowhere + near that simple. Let z = x*16+y. Depending on what values z takes, + different units of speed are set, there being two: ticks/division + and beats/minute (though this one is only a label and not strictly + true). If z=0, then what should technically happen is that the + module stops, but in practice it is treated as if z=1, because + there is already a method for stopping the module (running out of + patterns). If z<=32, then it means "set ticks/division to z" + otherwise it means "set beats/minute to z" (convention says that + this should read "If z<32.." but there are some composers out there + that defy conventions). Default values are 6 ticks/division, and + 125 beats/minute (4 divisions = 1 beat). The beats/minute tag is + only meaningful for 6 ticks/division. To get a more accurate view + of how things work, use the following formula: + 24 * beats/minute + divisions/minute = ----------------- + ticks/division + Hence divisions/minute range from 24.75 to 6120, eg. to get a value + of 2000 divisions/minute use 3 ticks/division and 250 beats/minute. + If multiple "set speed" effects are performed in a single division, + the ones on higher-numbered channels take precedence over the ones + on lower-numbered channels. This effect has a large number of + different implementations, but the one described here has the + widest usage. + */ + + if( (effect&0xFF) < 0x21 ) + { + if( effect&0xFF ) + { + mod->song.speed = effect&0xFF; + mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); + } + } + + if( (effect&0xFF) >= 0x21 ) + { + /// HZ = 2 * BPM / 5 + mod->bpm = effect&0xFF; + mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); + } + + break; + + default: + // Unsupported effect + break; + + } + +} + +static void workeffect( note * nptr, channel * cptr ) +{ + switch(cptr->effect) + { + case EFFECT_ARPEGGIO: + + if( cptr->parameffect ) + { + cptr->decalperiod = cptr->period - cptr->Arpperiods[cptr->ArpIndex]; + + cptr->ArpIndex++; + if( cptr->ArpIndex>2 ) + cptr->ArpIndex = 0; + } + break; + + case EFFECT_PORTAMENTO_UP: + + if(cptr->period) + { + cptr->period -= cptr->parameffect; + + if( cptr->period < 113 || cptr->period > 20000 ) + cptr->period = 113; + } + + break; + + case EFFECT_PORTAMENTO_DOWN: + + if(cptr->period) + { + cptr->period += cptr->parameffect; + + if( cptr->period > 20000 ) + cptr->period = 20000; + } + + break; + + case EFFECT_VOLSLIDE_TONEPORTA: + case EFFECT_TONE_PORTAMENTO: + + if( cptr->period && ( cptr->period != cptr->portaperiod ) && cptr->portaperiod ) + { + if( cptr->period > cptr->portaperiod ) + { + if( cptr->period - cptr->portaperiod >= cptr->portaspeed ) + { + cptr->period -= cptr->portaspeed; + } + else + { + cptr->period = cptr->portaperiod; + } + } + else + { + if( cptr->portaperiod - cptr->period >= cptr->portaspeed ) + { + cptr->period += cptr->portaspeed; + } + else + { + cptr->period = cptr->portaperiod; + } + } + + if( cptr->period == cptr->portaperiod ) + { + // If the slide is over, don't let it to be retriggered. + cptr->portaperiod = 0; + } + } + + if( cptr->effect == EFFECT_VOLSLIDE_TONEPORTA ) + { + if( cptr->volumeslide > 0x0F ) + { + cptr->volume = cptr->volume + (cptr->volumeslide>>4); + + if(cptr->volume>63) + cptr->volume = 63; + } + else + { + cptr->volume = cptr->volume - (cptr->volumeslide); + + if(cptr->volume>63) + cptr->volume=0; + } + } + break; + + case EFFECT_VOLSLIDE_VIBRATO: + case EFFECT_VIBRATO: + + cptr->vibraperiod = ( (cptr->vibraparam&0xF) * sintable[cptr->vibrapointeur&0x1F] )>>7; + + if( cptr->vibrapointeur > 31 ) + cptr->vibraperiod = -cptr->vibraperiod; + + cptr->vibrapointeur = (cptr->vibrapointeur+(((cptr->vibraparam>>4))&0xf)) & 0x3F; + + if( cptr->effect == EFFECT_VOLSLIDE_VIBRATO ) + { + if( cptr->volumeslide > 0xF ) + { + cptr->volume = cptr->volume+(cptr->volumeslide>>4); + + if( cptr->volume > 64 ) + cptr->volume = 64; + } + else + { + cptr->volume = cptr->volume - cptr->volumeslide; + + if( cptr->volume > 64 ) + cptr->volume = 0; + } + } + + break; + + case EFFECT_VOLUME_SLIDE: + + if( cptr->volumeslide > 0xF ) + { + cptr->volume += (cptr->volumeslide>>4); + + if( cptr->volume > 64 ) + cptr->volume = 64; + } + else + { + cptr->volume -= (cptr->volumeslide&0xf); + + if( cptr->volume > 64 ) + cptr->volume = 0; + } + break; + + case EFFECT_E_NOTE_CUT: + if(cptr->cut_param) + cptr->cut_param--; + + if(!cptr->cut_param) + cptr->volume = 0; + break; + + default: + break; + + } + +} + +/////////////////////////////////////////////////////////////////////////////////// +bool jar_mod_init(modcontext * modctx) +{ + muint i,j; + + if( modctx ) + { + memclear(modctx,0,sizeof(modcontext)); + modctx->playrate = DEFAULT_SAMPLE_RATE; + modctx->stereo = 1; + modctx->stereo_separation = 1; + modctx->bits = 16; + modctx->filter = 1; + modctx->loopcount = 0; + + for(i=0;ifullperiod[(i*8) + j] = periodtable[i] - ((( periodtable[i] - periodtable[i+1] ) / 8) * j); + } + } + + return 1; + } + + return 0; +} + +bool jar_mod_setcfg(modcontext * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter) +{ + if( modctx ) + { + modctx->playrate = samplerate; + + if( stereo ) + modctx->stereo = 1; + else + modctx->stereo = 0; + + if(stereo_separation < 4) + { + modctx->stereo_separation = stereo_separation; + } + + if( bits == 8 || bits == 16 ) + modctx->bits = bits; + else + modctx->bits = 16; + + if( filter ) + modctx->filter = 1; + else + modctx->filter = 0; + + return 1; + } + + return 0; +} + +// make certain that mod_data stays in memory while playing +static bool jar_mod_load( modcontext * modctx, void * mod_data, int mod_data_size ) +{ + muint i, max; + unsigned short t; + sample *sptr; + unsigned char * modmemory,* endmodmemory; + + modmemory = (unsigned char *)mod_data; + endmodmemory = modmemory + mod_data_size; + + + + if(modmemory) + { + if( modctx ) + { + memcopy(&(modctx->song.title),modmemory,1084); + + i = 0; + modctx->number_of_channels = 0; + while(modlist[i].numberofchannels) + { + if(memcompare(modctx->song.signature,modlist[i].signature,4)) + { + modctx->number_of_channels = modlist[i].numberofchannels; + } + + i++; + } + + if( !modctx->number_of_channels ) + { + // 15 Samples modules support + // Shift the whole datas to make it look likes a standard 4 channels mod. + memcopy(&(modctx->song.signature), "M.K.", 4); + memcopy(&(modctx->song.length), &(modctx->song.samples[15]), 130); + memclear(&(modctx->song.samples[15]), 0, 480); + modmemory += 600; + modctx->number_of_channels = 4; + } + else + { + modmemory += 1084; + } + + if( modmemory >= endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + + // Patterns loading + for (i = max = 0; i < 128; i++) + { + while (max <= modctx->song.patterntable[i]) + { + modctx->patterndata[max] = (note*)modmemory; + modmemory += (256*modctx->number_of_channels); + max++; + + if( modmemory >= endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + } + } + + for (i = 0; i < 31; i++) + modctx->sampledata[i]=0; + + // Samples loading + for (i = 0, sptr = modctx->song.samples; i <31; i++, sptr++) + { + t= (sptr->length &0xFF00)>>8 | (sptr->length &0xFF)<<8; + sptr->length = t*2; + + t= (sptr->reppnt &0xFF00)>>8 | (sptr->reppnt &0xFF)<<8; + sptr->reppnt = t*2; + + t= (sptr->replen &0xFF00)>>8 | (sptr->replen &0xFF)<<8; + sptr->replen = t*2; + + + if (sptr->length == 0) continue; + + modctx->sampledata[i] = (char*)modmemory; + modmemory += sptr->length; + + if (sptr->replen + sptr->reppnt > sptr->length) + sptr->replen = sptr->length - sptr->reppnt; + + if( modmemory > endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + } + + // States init + + modctx->tablepos = 0; + modctx->patternpos = 0; + modctx->song.speed = 6; + modctx->bpm = 125; + modctx->samplenb = 0; + + modctx->patternticks = (((long)modctx->song.speed * modctx->playrate * 5)/ (2 * modctx->bpm)) + 1; + modctx->patternticksaim = ((long)modctx->song.speed * modctx->playrate * 5) / (2 * modctx->bpm); + + modctx->sampleticksconst = 3546894UL / modctx->playrate; //8448*428/playrate; + + for(i=0; i < modctx->number_of_channels; i++) + { + modctx->channels[i].volume = 0; + modctx->channels[i].period = 0; + } + + modctx->mod_loaded = 1; + + return 1; + } + } + + return 0; +} + +void jar_mod_fillbuffer( modcontext * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +{ + unsigned long i, j; + unsigned long k; + unsigned char c; + unsigned int state_remaining_steps; + int l,r; + int ll,lr; + int tl,tr; + short finalperiod; + note *nptr; + channel *cptr; + + if( modctx && outbuffer ) + { + if(modctx->mod_loaded) + { + state_remaining_steps = 0; + + if( trkbuf ) + { + trkbuf->cur_rd_index = 0; + + memcopy(trkbuf->name,modctx->song.title,sizeof(modctx->song.title)); + + for(i=0;i<31;i++) + { + memcopy(trkbuf->instruments[i].name,modctx->song.samples[i].name,sizeof(trkbuf->instruments[i].name)); + } + } + + ll = modctx->last_l_sample; + lr = modctx->last_r_sample; + + for (i = 0; i < nbsample; i++) + { + //--------------------------------------- + if( modctx->patternticks++ > modctx->patternticksaim ) + { + if( !modctx->patterndelay ) + { + nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; + nptr = nptr + modctx->patternpos; + cptr = modctx->channels; + + modctx->patternticks = 0; + modctx->patterntickse = 0; + + for(c=0;cnumber_of_channels;c++) + { + worknote((note*)(nptr+c), (channel*)(cptr+c),(char)(c+1),modctx); + } + + if( !modctx->jump_loop_effect ) + modctx->patternpos += modctx->number_of_channels; + else + modctx->jump_loop_effect = 0; + + if( modctx->patternpos == 64*modctx->number_of_channels ) + { + modctx->tablepos++; + modctx->patternpos = 0; + if(modctx->tablepos >= modctx->song.length) + { + modctx->tablepos = 0; + modctx->loopcount++; // count next loop + } + } + } + else + { + modctx->patterndelay--; + modctx->patternticks = 0; + modctx->patterntickse = 0; + } + + } + + if( modctx->patterntickse++ > (modctx->patternticksaim/modctx->song.speed) ) + { + nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; + nptr = nptr + modctx->patternpos; + cptr = modctx->channels; + + for(c=0;cnumber_of_channels;c++) + { + workeffect(nptr+c, cptr+c); + } + + modctx->patterntickse = 0; + } + + //--------------------------------------- + + if( trkbuf && !state_remaining_steps ) + { + if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) + { + memclear(&trkbuf->track_state_buf[trkbuf->nb_of_state], 0, sizeof(tracker_state)); + } + } + + l=0; + r=0; + + for(j =0, cptr = modctx->channels; j < modctx->number_of_channels ; j++, cptr++) + { + if( cptr->period != 0 ) + { + finalperiod = cptr->period - cptr->decalperiod - cptr->vibraperiod; + if( finalperiod ) + { + cptr->samppos += ( (modctx->sampleticksconst<<10) / finalperiod ); + } + + cptr->ticks++; + + if( cptr->replen<=2 ) + { + if( (cptr->samppos>>10) >= (cptr->length) ) + { + cptr->length = 0; + cptr->reppnt = 0; + + if( cptr->length ) + cptr->samppos = cptr->samppos % (((unsigned long)cptr->length)<<10); + else + cptr->samppos = 0; + } + } + else + { + if( (cptr->samppos>>10) >= (unsigned long)(cptr->replen+cptr->reppnt) ) + { + cptr->samppos = ((unsigned long)(cptr->reppnt)<<10) + (cptr->samppos % ((unsigned long)(cptr->replen+cptr->reppnt)<<10)); + } + } + + k = cptr->samppos >> 10; + + if( cptr->sampdata!=0 && ( ((j&3)==1) || ((j&3)==2) ) ) + { + r += ( cptr->sampdata[k] * cptr->volume ); + } + + if( cptr->sampdata!=0 && ( ((j&3)==0) || ((j&3)==3) ) ) + { + l += ( cptr->sampdata[k] * cptr->volume ); + } + + if( trkbuf && !state_remaining_steps ) + { + if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) + { + trkbuf->track_state_buf[trkbuf->nb_of_state].number_of_tracks = modctx->number_of_channels; + trkbuf->track_state_buf[trkbuf->nb_of_state].buf_index = i; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern = modctx->song.patterntable[modctx->tablepos]; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_pos = modctx->patternpos / modctx->number_of_channels; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_table_pos = modctx->tablepos; + trkbuf->track_state_buf[trkbuf->nb_of_state].bpm = modctx->bpm; + trkbuf->track_state_buf[trkbuf->nb_of_state].speed = modctx->song.speed; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_effect = cptr->effect_code; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_parameffect = cptr->parameffect; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_period = finalperiod; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_volume = cptr->volume; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].instrument_number = (unsigned char)cptr->sampnum; + } + } + } + } + + if( trkbuf && !state_remaining_steps ) + { + state_remaining_steps = trkbuf->sample_step; + + if(trkbuf->nb_of_state < trkbuf->nb_max_of_state) + trkbuf->nb_of_state++; + } + else + { + state_remaining_steps--; + } + + tl = (short)l; + tr = (short)r; + + if ( modctx->filter ) + { + // Filter + l = (l+ll)>>1; + r = (r+lr)>>1; + } + + if ( modctx->stereo_separation == 1 ) + { + // Left & Right Stereo panning + l = (l+(r>>1)); + r = (r+(l>>1)); + } + + // Level limitation + if( l > 32767 ) l = 32767; + if( l < -32768 ) l = -32768; + if( r > 32767 ) r = 32767; + if( r < -32768 ) r = -32768; + + // Store the final sample. + outbuffer[(i*2)] = l; + outbuffer[(i*2)+1] = r; + + ll = tl; + lr = tr; + + } + + modctx->last_l_sample = ll; + modctx->last_r_sample = lr; + + modctx->samplenb = modctx->samplenb+nbsample; + } + else + { + for (i = 0; i < nbsample; i++) + { + // Mod not loaded. Return blank buffer. + outbuffer[(i*2)] = 0; + outbuffer[(i*2)+1] = 0; + } + + if(trkbuf) + { + trkbuf->nb_of_state = 0; + trkbuf->cur_rd_index = 0; + trkbuf->name[0] = 0; + memclear(trkbuf->track_state_buf, 0, sizeof(tracker_state) * trkbuf->nb_max_of_state); + memclear(trkbuf->instruments, 0, sizeof(trkbuf->instruments)); + } + } + } +} + +void jar_mod_unload( modcontext * modctx) +{ + if(modctx) + { + if(modctx->modfile) + { + free(modctx->modfile); + modctx->modfile = 0; + } + memclear(&modctx->song, 0, sizeof(modctx->song)); + memclear(&modctx->sampledata, 0, sizeof(modctx->sampledata)); + memclear(&modctx->patterndata, 0, sizeof(modctx->patterndata)); + modctx->tablepos = 0; + modctx->patternpos = 0; + modctx->patterndelay = 0; + modctx->jump_loop_effect = 0; + modctx->bpm = 0; + modctx->patternticks = 0; + modctx->patterntickse = 0; + modctx->patternticksaim = 0; + modctx->sampleticksconst = 0; + modctx->loopcount = 0; + + modctx->samplenb = 0; + + memclear(modctx->channels, 0, sizeof(modctx->channels)); + + modctx->number_of_channels = 0; + + modctx->mod_loaded = 0; + + modctx->last_r_sample = 0; + modctx->last_l_sample = 0; + } +} + +mulong jar_mod_load_file(modcontext * modctx, char* filename) +{ + mulong fsize = 0; + if(modctx->modfile) + { + free(modctx->modfile); + modctx->modfile = 0; + } + + FILE *f = fopen(filename, "rb"); + if(f) + { + fseek(f,0,SEEK_END); + fsize = ftell(f); + fseek(f,0,SEEK_SET); + + if(fsize && fsize < 32*1024*1024) + { + modctx->modfile = malloc(fsize); + modctx->modfilesize = fsize; + memset(modctx->modfile, 0, fsize); + fread(modctx->modfile, fsize, 1, f); + fclose(f); + + if(!jar_mod_load(modctx, (void*)modctx->modfile, fsize)) fsize = 0; + } else fsize = 0; + } + return fsize; +} + +mulong jar_mod_current_samples(modcontext * modctx) +{ + if(modctx) + return modctx->samplenb; + + return 0; +} + +// Works, however it is very slow, this data should be cached to ensure it is run only once per file +mulong jar_mod_max_samples(modcontext * ctx) +{ + modcontext tmpctx; + jar_mod_init(&tmpctx); + if(!jar_mod_load(&tmpctx, (void*)ctx->modfile, ctx->modfilesize)) return 0; + + muint buff[2]; + mulong lastcount = tmpctx.loopcount; + + while(1){ + jar_mod_fillbuffer( &tmpctx, buff, 1, 0 ); + if(tmpctx.loopcount > lastcount) break; + } + return tmpctx.samplenb; +} + +// move seek_val to sample index, 0 -> jar_mod_max_samples is the range +void jar_mod_seek_start(modcontext * ctx) +{ + if(ctx) + { + char* tmpmodfile = ctx->modfile; + long size = ctx->modfilesize; + jar_mod_init(ctx); + jar_mod_load(ctx, tmpmodfile, size); + ctx->modfilesize = size; + ctx->modfile = tmpmodfile; + } +} + +#endif // end of JAR_MOD_IMPLEMENTATION +//------------------------------------------------------------------------------- + + +#endif //end of header file \ No newline at end of file diff --git a/src/raylib.h b/src/raylib.h index 456f427d..59266a0c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -261,8 +261,9 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type - #ifndef true + #if !defined(_STDBOOL_H) typedef enum { false, true } bool; + #define _STDBOOL_H #endif #endif -- cgit v1.2.3 From 21a01ec870d04116b70e206950f69c1cf9d24897 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Wed, 1 Jun 2016 20:36:54 -0700 Subject: simplified mod --- src/jar_mod.h | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/jar_mod.h b/src/jar_mod.h index 93185773..2066ef07 100644 --- a/src/jar_mod.h +++ b/src/jar_mod.h @@ -1057,7 +1057,7 @@ bool jar_mod_init(modcontext * modctx) if( modctx ) { - memclear(modctx,0,sizeof(modcontext)); + memclear(modctx, 0, sizeof(modcontext)); modctx->playrate = DEFAULT_SAMPLE_RATE; modctx->stereo = 1; modctx->stereo_separation = 1; @@ -1065,9 +1065,9 @@ bool jar_mod_init(modcontext * modctx) modctx->filter = 1; modctx->loopcount = 0; - for(i=0;ifullperiod[(i*8) + j] = periodtable[i] - ((( periodtable[i] - periodtable[i+1] ) / 8) * j); } @@ -1471,15 +1471,11 @@ void jar_mod_fillbuffer( modcontext * modctx, short * outbuffer, unsigned long n } } -void jar_mod_unload( modcontext * modctx) +//resets internals for mod context +static void jar_mod_reset( modcontext * modctx) { if(modctx) { - if(modctx->modfile) - { - free(modctx->modfile); - modctx->modfile = 0; - } memclear(&modctx->song, 0, sizeof(modctx->song)); memclear(&modctx->sampledata, 0, sizeof(modctx->sampledata)); memclear(&modctx->patterndata, 0, sizeof(modctx->patterndata)); @@ -1493,20 +1489,32 @@ void jar_mod_unload( modcontext * modctx) modctx->patternticksaim = 0; modctx->sampleticksconst = 0; modctx->loopcount = 0; - modctx->samplenb = 0; - memclear(modctx->channels, 0, sizeof(modctx->channels)); - modctx->number_of_channels = 0; - modctx->mod_loaded = 0; - modctx->last_r_sample = 0; modctx->last_l_sample = 0; + + jar_mod_init(modctx); + } +} + +void jar_mod_unload( modcontext * modctx) +{ + if(modctx) + { + if(modctx->modfile) + { + free(modctx->modfile); + modctx->modfile = 0; + } + jar_mod_reset(modctx); } } + + mulong jar_mod_load_file(modcontext * modctx, char* filename) { mulong fsize = 0; @@ -1567,12 +1575,8 @@ void jar_mod_seek_start(modcontext * ctx) { if(ctx) { - char* tmpmodfile = ctx->modfile; - long size = ctx->modfilesize; - jar_mod_init(ctx); - jar_mod_load(ctx, tmpmodfile, size); - ctx->modfilesize = size; - ctx->modfile = tmpmodfile; + jar_mod_reset(ctx); + jar_mod_load(ctx, ctx->modfile, ctx->modfilesize); } } -- cgit v1.2.3 From 05f8e83ba970c45c40df570510e82b30e2b92687 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 2 Jun 2016 00:03:00 -0700 Subject: cleanup --- src/audio.c | 226 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 117 insertions(+), 109 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2302d6e1..d9a527ee 100644 --- a/src/audio.c +++ b/src/audio.c @@ -117,7 +117,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- static MixChannel_t* mixChannelsActive_g[MAX_MIX_CHANNELS]; // What mix channels are currently active static bool musicEnabled_g = false; -static Music currentMusic[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static Music currentMusic_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -179,7 +179,7 @@ void CloseAudioDevice(void) { for(int index=0; indexplaying = true; + currentMusic_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + currentMusic_g[musicIndex].mixc->playing = true; } else{ - currentMusic[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - currentMusic[musicIndex].mixc->playing = true; + currentMusic_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + currentMusic_g[musicIndex].mixc->playing = true; } - if(!currentMusic[musicIndex].mixc) return 4; // error + if(!currentMusic_g[musicIndex].mixc) return 4; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if(!jar_xm_create_context_from_file(¤tMusic[musicIndex].xmctx, 48000, fileName)) + if(!jar_xm_create_context_from_file(¤tMusic_g[musicIndex].xmctx, 48000, fileName)) { - currentMusic[musicIndex].chipTune = true; - currentMusic[musicIndex].loop = true; - jar_xm_set_max_loop_count(currentMusic[musicIndex].xmctx, 0); // infinite number of loops - currentMusic[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(currentMusic[musicIndex].xmctx); - currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; + currentMusic_g[musicIndex].chipTune = true; + currentMusic_g[musicIndex].loop = true; + jar_xm_set_max_loop_count(currentMusic_g[musicIndex].xmctx, 0); // infinite number of loops + currentMusic_g[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(currentMusic_g[musicIndex].xmctx); + currentMusic_g[musicIndex].totalLengthSeconds = ((float)currentMusic_g[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic_g[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic_g[musicIndex].totalLengthSeconds); - currentMusic[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); - if(!currentMusic[musicIndex].mixc) return 5; // error - currentMusic[musicIndex].mixc->playing = true; + currentMusic_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, true); + if(!currentMusic_g[musicIndex].mixc) return 5; // error + currentMusic_g[musicIndex].mixc->playing = true; } else { @@ -845,21 +846,21 @@ int PlayMusicStream(int musicIndex, char *fileName) } else if (strcmp(GetExtension(fileName),"mod") == 0) { - jar_mod_init(¤tMusic[musicIndex].modctx); - if(jar_mod_load_file(¤tMusic[musicIndex].modctx, fileName)) + jar_mod_init(¤tMusic_g[musicIndex].modctx); + if(jar_mod_load_file(¤tMusic_g[musicIndex].modctx, fileName)) { - currentMusic[musicIndex].chipTune = true; - currentMusic[musicIndex].loop = true; - currentMusic[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(¤tMusic[musicIndex].modctx); - currentMusic[musicIndex].totalLengthSeconds = ((float)currentMusic[musicIndex].totalSamplesLeft) / 48000.f; + currentMusic_g[musicIndex].chipTune = true; + currentMusic_g[musicIndex].loop = true; + currentMusic_g[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(¤tMusic_g[musicIndex].modctx); + currentMusic_g[musicIndex].totalLengthSeconds = ((float)currentMusic_g[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, currentMusic[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, currentMusic[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, currentMusic_g[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, currentMusic_g[musicIndex].totalLengthSeconds); - currentMusic[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); - if(!currentMusic[musicIndex].mixc) return 7; // error - currentMusic[musicIndex].mixc->playing = true; + currentMusic_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); + if(!currentMusic_g[musicIndex].mixc) return 7; // error + currentMusic_g[musicIndex].mixc->playing = true; } else { @@ -875,32 +876,32 @@ int PlayMusicStream(int musicIndex, char *fileName) return 0; // normal return } -// Stop music playing for individual music index of currentMusic array (close stream) +// Stop music playing for individual music index of currentMusic_g array (close stream) void StopMusicStream(int index) { - if (index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) + if (index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc) { - CloseMixChannel(currentMusic[index].mixc); + CloseMixChannel(currentMusic_g[index].mixc); - if (currentMusic[index].chipTune && currentMusic[index].xmctx) + if (currentMusic_g[index].chipTune && currentMusic_g[index].xmctx) { - jar_xm_free_context(currentMusic[index].xmctx); - currentMusic[index].xmctx = 0; + jar_xm_free_context(currentMusic_g[index].xmctx); + currentMusic_g[index].xmctx = 0; } - else if(currentMusic[index].chipTune && currentMusic[index].modctx.mod_loaded) + else if(currentMusic_g[index].chipTune && currentMusic_g[index].modctx.mod_loaded) { - jar_mod_unload(¤tMusic[index].modctx); + jar_mod_unload(¤tMusic_g[index].modctx); } else { - stb_vorbis_close(currentMusic[index].stream); + stb_vorbis_close(currentMusic_g[index].stream); } if(!getMusicStreamCount()) musicEnabled_g = false; - if(currentMusic[index].stream || currentMusic[index].xmctx) + if(currentMusic_g[index].stream || currentMusic_g[index].xmctx) { - currentMusic[index].stream = NULL; - currentMusic[index].xmctx = NULL; + currentMusic_g[index].stream = NULL; + currentMusic_g[index].xmctx = NULL; } } } @@ -910,7 +911,7 @@ int getMusicStreamCount(void) { int musicCount = 0; for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot - if(currentMusic[musicIndex].stream != NULL || currentMusic[musicIndex].chipTune) musicCount++; + if(currentMusic_g[musicIndex].stream != NULL || currentMusic_g[musicIndex].chipTune) musicCount++; return musicCount; } @@ -919,11 +920,11 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && currentMusic[index].mixc && musicEnabled_g) + if (index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc && musicEnabled_g) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(currentMusic[index].mixc->alSource); - currentMusic[index].mixc->playing = false; + alSourcePause(currentMusic_g[index].mixc->alSource); + currentMusic_g[index].mixc->playing = false; } } @@ -932,13 +933,13 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ - alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ + alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(currentMusic[index].mixc->alSource); - currentMusic[index].mixc->playing = true; + alSourcePlay(currentMusic_g[index].mixc->alSource); + currentMusic_g[index].mixc->playing = true; } } } @@ -949,8 +950,8 @@ bool IsMusicPlaying(int index) bool playing = false; ALint state; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ - alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ + alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PLAYING) playing = true; } @@ -960,15 +961,15 @@ bool IsMusicPlaying(int index) // Set volume for music void SetMusicVolume(int index, float volume) { - if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ - alSourcef(currentMusic[index].mixc->alSource, AL_GAIN, volume); + if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ + alSourcef(currentMusic_g[index].mixc->alSource, AL_GAIN, volume); } } void SetMusicPitch(int index, float pitch) { - if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc){ - alSourcef(currentMusic[index].mixc->alSource, AL_PITCH, pitch); + if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ + alSourcef(currentMusic_g[index].mixc->alSource, AL_PITCH, pitch); } } @@ -976,13 +977,13 @@ void SetMusicPitch(int index, float pitch) float GetMusicTimeLength(int index) { float totalSeconds; - if (currentMusic[index].chipTune) + if (currentMusic_g[index].chipTune) { - totalSeconds = (float)currentMusic[index].totalLengthSeconds; + totalSeconds = (float)currentMusic_g[index].totalLengthSeconds; } else { - totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic[index].stream); + totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic_g[index].stream); } return totalSeconds; @@ -992,24 +993,24 @@ float GetMusicTimeLength(int index) float GetMusicTimePlayed(int index) { float secondsPlayed = 0.0f; - if(index < MAX_MUSIC_STREAMS && currentMusic[index].mixc) + if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc) { - if (currentMusic[index].chipTune && currentMusic[index].xmctx) + if (currentMusic_g[index].chipTune && currentMusic_g[index].xmctx) { uint64_t samples; - jar_xm_get_position(currentMusic[index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000.f * currentMusic[index].mixc->channels); // Not sure if this is the correct value + jar_xm_get_position(currentMusic_g[index].xmctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000.f * currentMusic_g[index].mixc->channels); // Not sure if this is the correct value } - else if(currentMusic[index].chipTune && currentMusic[index].modctx.mod_loaded) + else if(currentMusic_g[index].chipTune && currentMusic_g[index].modctx.mod_loaded) { - long numsamp = jar_mod_current_samples(¤tMusic[index].modctx); + long numsamp = jar_mod_current_samples(¤tMusic_g[index].modctx); secondsPlayed = (float)numsamp / (48000.f); } else { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].mixc->channels; - int samplesPlayed = totalSamples - currentMusic[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic[index].mixc->sampleRate * currentMusic[index].mixc->channels); + int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic_g[index].stream) * currentMusic_g[index].mixc->channels; + int samplesPlayed = totalSamples - currentMusic_g[index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (currentMusic_g[index].mixc->sampleRate * currentMusic_g[index].mixc->channels); } } @@ -1024,28 +1025,35 @@ float GetMusicTimePlayed(int index) static bool BufferMusicStream(int index, int numBuffers) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; - //float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; + float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - if (currentMusic[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + if (currentMusic_g[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) - size = MUSIC_BUFFER_SIZE_SHORT / 2; - else - size = currentMusic[index].totalSamplesLeft / 2; - for(int x=0; x= MUSIC_BUFFER_SIZE_SHORT) + size = MUSIC_BUFFER_SIZE_SHORT / 2; + else + size = currentMusic_g[index].totalSamplesLeft / 2; + jar_mod_fillbuffer(¤tMusic_g[index].modctx, pcm, size, 0 ); + BufferMixChannel(currentMusic_g[index].mixc, pcm, size * 2); + } + else if(currentMusic_g[index].xmctx){ + if(currentMusic_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) + size = MUSIC_BUFFER_SIZE_FLOAT / 2; + else + size = currentMusic_g[index].totalSamplesLeft / 2; + jar_xm_generate_samples(currentMusic_g[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location + BufferMixChannel(currentMusic_g[index].mixc, pcmf, size * 2); + } - BufferMixChannel(currentMusic[index].mixc, pcm, size * 2); - currentMusic[index].totalSamplesLeft -= size; - if(currentMusic[index].totalSamplesLeft <= 0) + + currentMusic_g[index].totalSamplesLeft -= size; + if(currentMusic_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1054,17 +1062,17 @@ static bool BufferMusicStream(int index, int numBuffers) } else { - if(currentMusic[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) + if(currentMusic_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; else - size = currentMusic[index].totalSamplesLeft; + size = currentMusic_g[index].totalSamplesLeft; for(int x=0; xchannels, pcm, size); - BufferMixChannel(currentMusic[index].mixc, pcm, streamedBytes * currentMusic[index].mixc->channels); - currentMusic[index].totalSamplesLeft -= streamedBytes * currentMusic[index].mixc->channels; - if(currentMusic[index].totalSamplesLeft <= 0) + int streamedBytes = stb_vorbis_get_samples_short_interleaved(currentMusic_g[index].stream, currentMusic_g[index].mixc->channels, pcm, size); + BufferMixChannel(currentMusic_g[index].mixc, pcm, streamedBytes * currentMusic_g[index].mixc->channels); + currentMusic_g[index].totalSamplesLeft -= streamedBytes * currentMusic_g[index].mixc->channels; + if(currentMusic_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1081,11 +1089,11 @@ static void EmptyMusicStream(int index) ALuint buffer = 0; int queued = 0; - alGetSourcei(currentMusic[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(currentMusic_g[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(currentMusic[index].mixc->alSource, 1, &buffer); + alSourceUnqueueBuffers(currentMusic_g[index].mixc->alSource, 1, &buffer); queued--; } @@ -1095,7 +1103,7 @@ static void EmptyMusicStream(int index) static int IsMusicStreamReadyForBuffering(int index) { ALint processed = 0; - alGetSourcei(currentMusic[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(currentMusic_g[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); return processed; } @@ -1106,21 +1114,21 @@ void UpdateMusicStream(int index) bool active = true; int numBuffers = IsMusicStreamReadyForBuffering(index); - if (currentMusic[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic[index].mixc && numBuffers) + if (currentMusic_g[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic_g[index].mixc && numBuffers) { active = BufferMusicStream(index, numBuffers); - if (!active && currentMusic[index].loop) + if (!active && currentMusic_g[index].loop) { - if (currentMusic[index].chipTune) + if (currentMusic_g[index].chipTune) { - if(currentMusic[index].modctx.mod_loaded) jar_mod_seek_start(¤tMusic[index].modctx); - currentMusic[index].totalSamplesLeft = currentMusic[index].totalLengthSeconds * 48000; + if(currentMusic_g[index].modctx.mod_loaded) jar_mod_seek_start(¤tMusic_g[index].modctx); + currentMusic_g[index].totalSamplesLeft = currentMusic_g[index].totalLengthSeconds * 48000; } else { - stb_vorbis_seek_start(currentMusic[index].stream); - currentMusic[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic[index].stream) * currentMusic[index].mixc->channels; + stb_vorbis_seek_start(currentMusic_g[index].stream); + currentMusic_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic_g[index].stream) * currentMusic_g[index].mixc->channels; } active = true; } @@ -1128,9 +1136,9 @@ void UpdateMusicStream(int index) if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - alGetSourcei(currentMusic[index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING && active) alSourcePlay(currentMusic[index].mixc->alSource); + if (state != AL_PLAYING && active) alSourcePlay(currentMusic_g[index].mixc->alSource); if (!active) StopMusicStream(index); -- cgit v1.2.3 From af1eb5453acc2772afbc316375c403b31a742626 Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 2 Jun 2016 02:02:23 -0700 Subject: I added audio errors The only thing I did not change was the _g for globals. Is there any other way we can mark globals? --- src/audio.c | 254 ++++++++++++++++++++++++++++++---------------------------- src/audio.h | 20 +++++ src/jar_mod.h | 58 +++++++------- src/raylib.h | 21 +++++ 4 files changed, 200 insertions(+), 153 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index d9a527ee..452459ef 100644 --- a/src/audio.c +++ b/src/audio.c @@ -99,7 +99,7 @@ typedef struct MixChannel_t { typedef struct Music { stb_vorbis *stream; jar_xm_context_t *xmctx; // Stores jar_xm mixc, XM chiptune context - modcontext modctx; // Stores mod chiptune context + jar_mod_context_t modctx; // Stores mod chiptune context MixChannel_t *mixc; // mix channel unsigned int totalSamplesLeft; @@ -115,9 +115,9 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static MixChannel_t* mixChannelsActive_g[MAX_MIX_CHANNELS]; // What mix channels are currently active +static MixChannel_t* mixChannels_g[MAX_MIX_CHANNELS]; // What mix channels are currently active static bool musicEnabled_g = false; -static Music currentMusic_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static Music musicChannels_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -179,7 +179,7 @@ void CloseAudioDevice(void) { for(int index=0; index= MAX_MIX_CHANNELS) return NULL; if(!IsAudioDeviceReady()) InitAudioDevice(); - if(!mixChannelsActive_g[mixChannel]){ + if(!mixChannels_g[mixChannel]){ MixChannel_t *mixc = (MixChannel_t*)malloc(sizeof(MixChannel_t)); mixc->sampleRate = sampleRate; mixc->channels = channels; mixc->mixChannel = mixChannel; mixc->floatingPoint = floatingPoint; - mixChannelsActive_g[mixChannel] = mixc; + mixChannels_g[mixChannel] = mixc; // setup openAL format if(channels == 1) @@ -287,7 +287,7 @@ static void CloseMixChannel(MixChannel_t* mixc) //delete source and buffers alDeleteSources(1, &mixc->alSource); alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - mixChannelsActive_g[mixc->mixChannel] = NULL; + mixChannels_g[mixc->mixChannel] = NULL; free(mixc); mixc = NULL; } @@ -298,7 +298,7 @@ static void CloseMixChannel(MixChannel_t* mixc) // @Returns number of samples that where processed. static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) { - if(!mixc || mixChannelsActive_g[mixc->mixChannel] != mixc) return 0; // when there is two channels there must be an even number of samples + if(!mixc || mixChannels_g[mixc->mixChannel] != mixc) return 0; // when there is two channels there must be an even number of samples if (!data || !numberElements) { // pauses audio until data is given @@ -387,20 +387,20 @@ RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingP int mixIndex; for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { - if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex == MAX_MIX_CHANNELS - 1) return -1; // error + if(mixChannels_g[mixIndex] == NULL) break; + else if(mixIndex == MAX_MIX_CHANNELS - 1) return ERROR_OUT_OF_MIX_CHANNELS; // error } if(InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) return mixIndex; else - return -2; // error + return ERROR_RAW_CONTEXT_CREATION; // error } void CloseRawAudioContext(RawAudioContext ctx) { - if(mixChannelsActive_g[ctx]) - CloseMixChannel(mixChannelsActive_g[ctx]); + if(mixChannels_g[ctx]) + CloseMixChannel(mixChannels_g[ctx]); } // if 0 is returned, the buffers are still full and you need to keep trying with the same data until a + number is returned. @@ -411,7 +411,7 @@ int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short number int numBuffered = 0; if(ctx >= 0) { - MixChannel_t* mixc = mixChannelsActive_g[ctx]; + MixChannel_t* mixc = mixChannels_g[ctx]; numBuffered = BufferMixChannel(mixc, data, numberElements); } return numBuffered; @@ -438,7 +438,10 @@ Sound LoadSound(char *fileName) if (strcmp(GetExtension(fileName),"wav") == 0) wave = LoadWAV(fileName); else if (strcmp(GetExtension(fileName),"ogg") == 0) wave = LoadOGG(fileName); - else TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); + else{ + TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); + sound.error = ERROR_EXTENSION_NOT_RECOGNIZED; //error + } if (wave.data != NULL) { @@ -565,6 +568,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) if (rresFile == NULL) { TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); + sound.error = ERROR_UNABLE_TO_OPEN_RRES_FILE; //error } else { @@ -579,6 +583,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) { TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); + sound.error = ERROR_INVALID_RRES_FILE; } else { @@ -669,6 +674,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) else { TraceLog(WARNING, "[%s] Required resource do not seem to be a valid SOUND resource", rresName); + sound.error = ERROR_INVALID_RRES_RESOURCE; } } else @@ -774,134 +780,134 @@ int PlayMusicStream(int musicIndex, char *fileName) { int mixIndex; - if(currentMusic_g[musicIndex].stream || currentMusic_g[musicIndex].xmctx) return 1; // error + if(musicChannels_g[musicIndex].stream || musicChannels_g[musicIndex].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { - if(mixChannelsActive_g[mixIndex] == NULL) break; - else if(mixIndex == MAX_MIX_CHANNELS - 1) return 2; // error + if(mixChannels_g[mixIndex] == NULL) break; + else if(mixIndex == MAX_MIX_CHANNELS - 1) return ERROR_OUT_OF_MIX_CHANNELS; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) { // Open audio stream - currentMusic_g[musicIndex].stream = stb_vorbis_open_filename(fileName, NULL, NULL); + musicChannels_g[musicIndex].stream = stb_vorbis_open_filename(fileName, NULL, NULL); - if (currentMusic_g[musicIndex].stream == NULL) + if (musicChannels_g[musicIndex].stream == NULL) { TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); - return 3; // error + return ERROR_LOADING_OGG; // error } else { // Get file info - stb_vorbis_info info = stb_vorbis_get_info(currentMusic_g[musicIndex].stream); + stb_vorbis_info info = stb_vorbis_get_info(musicChannels_g[musicIndex].stream); TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); - currentMusic_g[musicIndex].loop = true; // We loop by default + musicChannels_g[musicIndex].loop = true; // We loop by default musicEnabled_g = true; - currentMusic_g[musicIndex].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(currentMusic_g[musicIndex].stream) * info.channels; - currentMusic_g[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(currentMusic_g[musicIndex].stream); + musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[musicIndex].stream) * info.channels; + musicChannels_g[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[musicIndex].stream); if (info.channels == 2){ - currentMusic_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); - currentMusic_g[musicIndex].mixc->playing = true; + musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + musicChannels_g[musicIndex].mixc->playing = true; } else{ - currentMusic_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - currentMusic_g[musicIndex].mixc->playing = true; + musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + musicChannels_g[musicIndex].mixc->playing = true; } - if(!currentMusic_g[musicIndex].mixc) return 4; // error + if(!musicChannels_g[musicIndex].mixc) return ERROR_LOADING_OGG; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if(!jar_xm_create_context_from_file(¤tMusic_g[musicIndex].xmctx, 48000, fileName)) + if(!jar_xm_create_context_from_file(&musicChannels_g[musicIndex].xmctx, 48000, fileName)) { - currentMusic_g[musicIndex].chipTune = true; - currentMusic_g[musicIndex].loop = true; - jar_xm_set_max_loop_count(currentMusic_g[musicIndex].xmctx, 0); // infinite number of loops - currentMusic_g[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(currentMusic_g[musicIndex].xmctx); - currentMusic_g[musicIndex].totalLengthSeconds = ((float)currentMusic_g[musicIndex].totalSamplesLeft) / 48000.f; + musicChannels_g[musicIndex].chipTune = true; + musicChannels_g[musicIndex].loop = true; + jar_xm_set_max_loop_count(musicChannels_g[musicIndex].xmctx, 0); // infinite number of loops + musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicChannels_g[musicIndex].xmctx); + musicChannels_g[musicIndex].totalLengthSeconds = ((float)musicChannels_g[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, currentMusic_g[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, currentMusic_g[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicChannels_g[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); - currentMusic_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, true); - if(!currentMusic_g[musicIndex].mixc) return 5; // error - currentMusic_g[musicIndex].mixc->playing = true; + musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, true); + if(!musicChannels_g[musicIndex].mixc) return ERROR_XM_CONTEXT_CREATION; // error + musicChannels_g[musicIndex].mixc->playing = true; } else { TraceLog(WARNING, "[%s] XM file could not be opened", fileName); - return 6; // error + return ERROR_LOADING_XM; // error } } else if (strcmp(GetExtension(fileName),"mod") == 0) { - jar_mod_init(¤tMusic_g[musicIndex].modctx); - if(jar_mod_load_file(¤tMusic_g[musicIndex].modctx, fileName)) + jar_mod_init(&musicChannels_g[musicIndex].modctx); + if(jar_mod_load_file(&musicChannels_g[musicIndex].modctx, fileName)) { - currentMusic_g[musicIndex].chipTune = true; - currentMusic_g[musicIndex].loop = true; - currentMusic_g[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(¤tMusic_g[musicIndex].modctx); - currentMusic_g[musicIndex].totalLengthSeconds = ((float)currentMusic_g[musicIndex].totalSamplesLeft) / 48000.f; + musicChannels_g[musicIndex].chipTune = true; + musicChannels_g[musicIndex].loop = true; + musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicChannels_g[musicIndex].modctx); + musicChannels_g[musicIndex].totalLengthSeconds = ((float)musicChannels_g[musicIndex].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, currentMusic_g[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, currentMusic_g[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicChannels_g[musicIndex].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); - currentMusic_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); - if(!currentMusic_g[musicIndex].mixc) return 7; // error - currentMusic_g[musicIndex].mixc->playing = true; + musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); + if(!musicChannels_g[musicIndex].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + musicChannels_g[musicIndex].mixc->playing = true; } else { TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); - return 8; // error + return ERROR_LOADING_MOD; // error } } else { TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); - return 9; // error + return ERROR_EXTENSION_NOT_RECOGNIZED; // error } return 0; // normal return } -// Stop music playing for individual music index of currentMusic_g array (close stream) +// Stop music playing for individual music index of musicChannels_g array (close stream) void StopMusicStream(int index) { - if (index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) { - CloseMixChannel(currentMusic_g[index].mixc); + CloseMixChannel(musicChannels_g[index].mixc); - if (currentMusic_g[index].chipTune && currentMusic_g[index].xmctx) + if (musicChannels_g[index].chipTune && musicChannels_g[index].xmctx) { - jar_xm_free_context(currentMusic_g[index].xmctx); - currentMusic_g[index].xmctx = 0; + jar_xm_free_context(musicChannels_g[index].xmctx); + musicChannels_g[index].xmctx = 0; } - else if(currentMusic_g[index].chipTune && currentMusic_g[index].modctx.mod_loaded) + else if(musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) { - jar_mod_unload(¤tMusic_g[index].modctx); + jar_mod_unload(&musicChannels_g[index].modctx); } else { - stb_vorbis_close(currentMusic_g[index].stream); + stb_vorbis_close(musicChannels_g[index].stream); } if(!getMusicStreamCount()) musicEnabled_g = false; - if(currentMusic_g[index].stream || currentMusic_g[index].xmctx) + if(musicChannels_g[index].stream || musicChannels_g[index].xmctx) { - currentMusic_g[index].stream = NULL; - currentMusic_g[index].xmctx = NULL; + musicChannels_g[index].stream = NULL; + musicChannels_g[index].xmctx = NULL; } } } @@ -911,7 +917,7 @@ int getMusicStreamCount(void) { int musicCount = 0; for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot - if(currentMusic_g[musicIndex].stream != NULL || currentMusic_g[musicIndex].chipTune) musicCount++; + if(musicChannels_g[musicIndex].stream != NULL || musicChannels_g[musicIndex].chipTune) musicCount++; return musicCount; } @@ -920,11 +926,11 @@ int getMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc && musicEnabled_g) + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc && musicEnabled_g) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(currentMusic_g[index].mixc->alSource); - currentMusic_g[index].mixc->playing = false; + alSourcePause(musicChannels_g[index].mixc->alSource); + musicChannels_g[index].mixc->playing = false; } } @@ -933,13 +939,13 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ - alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(currentMusic_g[index].mixc->alSource); - currentMusic_g[index].mixc->playing = true; + alSourcePlay(musicChannels_g[index].mixc->alSource); + musicChannels_g[index].mixc->playing = true; } } } @@ -950,8 +956,8 @@ bool IsMusicPlaying(int index) bool playing = false; ALint state; - if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ - alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PLAYING) playing = true; } @@ -961,15 +967,15 @@ bool IsMusicPlaying(int index) // Set volume for music void SetMusicVolume(int index, float volume) { - if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ - alSourcef(currentMusic_g[index].mixc->alSource, AL_GAIN, volume); + if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + alSourcef(musicChannels_g[index].mixc->alSource, AL_GAIN, volume); } } void SetMusicPitch(int index, float pitch) { - if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc){ - alSourcef(currentMusic_g[index].mixc->alSource, AL_PITCH, pitch); + if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + alSourcef(musicChannels_g[index].mixc->alSource, AL_PITCH, pitch); } } @@ -977,13 +983,13 @@ void SetMusicPitch(int index, float pitch) float GetMusicTimeLength(int index) { float totalSeconds; - if (currentMusic_g[index].chipTune) + if (musicChannels_g[index].chipTune) { - totalSeconds = (float)currentMusic_g[index].totalLengthSeconds; + totalSeconds = (float)musicChannels_g[index].totalLengthSeconds; } else { - totalSeconds = stb_vorbis_stream_length_in_seconds(currentMusic_g[index].stream); + totalSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); } return totalSeconds; @@ -993,24 +999,24 @@ float GetMusicTimeLength(int index) float GetMusicTimePlayed(int index) { float secondsPlayed = 0.0f; - if(index < MAX_MUSIC_STREAMS && currentMusic_g[index].mixc) + if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) { - if (currentMusic_g[index].chipTune && currentMusic_g[index].xmctx) + if (musicChannels_g[index].chipTune && musicChannels_g[index].xmctx) { uint64_t samples; - jar_xm_get_position(currentMusic_g[index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000.f * currentMusic_g[index].mixc->channels); // Not sure if this is the correct value + jar_xm_get_position(musicChannels_g[index].xmctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000.f * musicChannels_g[index].mixc->channels); // Not sure if this is the correct value } - else if(currentMusic_g[index].chipTune && currentMusic_g[index].modctx.mod_loaded) + else if(musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) { - long numsamp = jar_mod_current_samples(¤tMusic_g[index].modctx); + long numsamp = jar_mod_current_samples(&musicChannels_g[index].modctx); secondsPlayed = (float)numsamp / (48000.f); } else { - int totalSamples = stb_vorbis_stream_length_in_samples(currentMusic_g[index].stream) * currentMusic_g[index].mixc->channels; - int samplesPlayed = totalSamples - currentMusic_g[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (currentMusic_g[index].mixc->sampleRate * currentMusic_g[index].mixc->channels); + int totalSamples = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; + int samplesPlayed = totalSamples - musicChannels_g[index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (musicChannels_g[index].mixc->sampleRate * musicChannels_g[index].mixc->channels); } } @@ -1030,30 +1036,30 @@ static bool BufferMusicStream(int index, int numBuffers) int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - if (currentMusic_g[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + if (musicChannels_g[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { for(int x=0; x= MUSIC_BUFFER_SIZE_SHORT) + if(musicChannels_g[index].modctx.mod_loaded){ + if(musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT / 2; else - size = currentMusic_g[index].totalSamplesLeft / 2; - jar_mod_fillbuffer(¤tMusic_g[index].modctx, pcm, size, 0 ); - BufferMixChannel(currentMusic_g[index].mixc, pcm, size * 2); + size = musicChannels_g[index].totalSamplesLeft / 2; + jar_mod_fillbuffer(&musicChannels_g[index].modctx, pcm, size, 0 ); + BufferMixChannel(musicChannels_g[index].mixc, pcm, size * 2); } - else if(currentMusic_g[index].xmctx){ - if(currentMusic_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) + else if(musicChannels_g[index].xmctx){ + if(musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT / 2; else - size = currentMusic_g[index].totalSamplesLeft / 2; - jar_xm_generate_samples(currentMusic_g[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location - BufferMixChannel(currentMusic_g[index].mixc, pcmf, size * 2); + size = musicChannels_g[index].totalSamplesLeft / 2; + jar_xm_generate_samples(musicChannels_g[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location + BufferMixChannel(musicChannels_g[index].mixc, pcmf, size * 2); } - currentMusic_g[index].totalSamplesLeft -= size; - if(currentMusic_g[index].totalSamplesLeft <= 0) + musicChannels_g[index].totalSamplesLeft -= size; + if(musicChannels_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1062,17 +1068,17 @@ static bool BufferMusicStream(int index, int numBuffers) } else { - if(currentMusic_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) + if(musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; else - size = currentMusic_g[index].totalSamplesLeft; + size = musicChannels_g[index].totalSamplesLeft; for(int x=0; xchannels, pcm, size); - BufferMixChannel(currentMusic_g[index].mixc, pcm, streamedBytes * currentMusic_g[index].mixc->channels); - currentMusic_g[index].totalSamplesLeft -= streamedBytes * currentMusic_g[index].mixc->channels; - if(currentMusic_g[index].totalSamplesLeft <= 0) + int streamedBytes = stb_vorbis_get_samples_short_interleaved(musicChannels_g[index].stream, musicChannels_g[index].mixc->channels, pcm, size); + BufferMixChannel(musicChannels_g[index].mixc, pcm, streamedBytes * musicChannels_g[index].mixc->channels); + musicChannels_g[index].totalSamplesLeft -= streamedBytes * musicChannels_g[index].mixc->channels; + if(musicChannels_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1089,11 +1095,11 @@ static void EmptyMusicStream(int index) ALuint buffer = 0; int queued = 0; - alGetSourcei(currentMusic_g[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(musicChannels_g[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(currentMusic_g[index].mixc->alSource, 1, &buffer); + alSourceUnqueueBuffers(musicChannels_g[index].mixc->alSource, 1, &buffer); queued--; } @@ -1103,7 +1109,7 @@ static void EmptyMusicStream(int index) static int IsMusicStreamReadyForBuffering(int index) { ALint processed = 0; - alGetSourcei(currentMusic_g[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(musicChannels_g[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); return processed; } @@ -1114,21 +1120,21 @@ void UpdateMusicStream(int index) bool active = true; int numBuffers = IsMusicStreamReadyForBuffering(index); - if (currentMusic_g[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && currentMusic_g[index].mixc && numBuffers) + if (musicChannels_g[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && musicChannels_g[index].mixc && numBuffers) { active = BufferMusicStream(index, numBuffers); - if (!active && currentMusic_g[index].loop) + if (!active && musicChannels_g[index].loop) { - if (currentMusic_g[index].chipTune) + if (musicChannels_g[index].chipTune) { - if(currentMusic_g[index].modctx.mod_loaded) jar_mod_seek_start(¤tMusic_g[index].modctx); - currentMusic_g[index].totalSamplesLeft = currentMusic_g[index].totalLengthSeconds * 48000; + if(musicChannels_g[index].modctx.mod_loaded) jar_mod_seek_start(&musicChannels_g[index].modctx); + musicChannels_g[index].totalSamplesLeft = musicChannels_g[index].totalLengthSeconds * 48000; } else { - stb_vorbis_seek_start(currentMusic_g[index].stream); - currentMusic_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(currentMusic_g[index].stream) * currentMusic_g[index].mixc->channels; + stb_vorbis_seek_start(musicChannels_g[index].stream); + musicChannels_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; } active = true; } @@ -1136,9 +1142,9 @@ void UpdateMusicStream(int index) if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - alGetSourcei(currentMusic_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING && active) alSourcePlay(currentMusic_g[index].mixc->alSource); + if (state != AL_PLAYING && active) alSourcePlay(musicChannels_g[index].mixc->alSource); if (!active) StopMusicStream(index); diff --git a/src/audio.h b/src/audio.h index ca56032e..4baa30df 100644 --- a/src/audio.h +++ b/src/audio.h @@ -47,10 +47,29 @@ #endif #endif +typedef enum { + ERROR_RAW_CONTEXT_CREATION = -20, + ERROR_XM_CONTEXT_CREATION, + ERROR_MOD_CONTEXT_CREATION, + ERROR_MIX_CHANNEL_CREATION, + ERROR_MUSIC_CHANNEL_CREATION, + ERROR_LOADING_XM, + ERROR_LOADING_MOD, + ERROR_LOADING_WAV, + ERROR_LOADING_OGG, + ERROR_OUT_OF_MIX_CHANNELS, + ERROR_EXTENSION_NOT_RECOGNIZED, + ERROR_UNABLE_TO_OPEN_RRES_FILE, + ERROR_INVALID_RRES_FILE, + ERROR_INVALID_RRES_RESOURCE, + ERROR_UNINITIALIZED_CHANNELS +} AudioError; + // Sound source type typedef struct Sound { unsigned int source; unsigned int buffer; + AudioError error; // if there was any error during the creation or use of this Sound } Sound; // Wave type, defines audio wave data @@ -64,6 +83,7 @@ typedef struct Wave { typedef int RawAudioContext; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif diff --git a/src/jar_mod.h b/src/jar_mod.h index 2066ef07..2ddc61d1 100644 --- a/src/jar_mod.h +++ b/src/jar_mod.h @@ -15,7 +15,7 @@ // Other source files should just include jar_mod.h // // SAMPLE CODE: -// modcontext modctx; +// jar_mod_context_t modctx; // short samplebuff[4096]; // bool bufferFull = false; // int intro_load(void) @@ -54,17 +54,17 @@ /////////////////////////////////////////////////////////////////////////////////// // HxCMOD Core API: // ------------------------------------------- -// int jar_mod_init(modcontext * modctx) +// int jar_mod_init(jar_mod_context_t * modctx) // -// - Initialize the modcontext buffer. Must be called before doing anything else. +// - Initialize the jar_mod_context_t buffer. Must be called before doing anything else. // Return 1 if success. 0 in case of error. // ------------------------------------------- -// mulong jar_mod_load_file(modcontext * modctx, char* filename) +// mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) // // - "Load" a MOD from file, context must already be initialized. // Return size of file in bytes. // ------------------------------------------- -// void jar_mod_fillbuffer( modcontext * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +// void jar_mod_fillbuffer( jar_mod_context_t * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) // // - Generate and return the next samples chunk to outbuffer. // nbsample specify the number of stereo 16bits samples you want. @@ -72,7 +72,7 @@ // The output buffer size in bytes must be equal to ( nbsample * 2 * channels ). // The optional trkbuf parameter can be used to get detailed status of the player. Put NULL/0 is unused. // ------------------------------------------- -// void jar_mod_unload( modcontext * modctx ) +// void jar_mod_unload( jar_mod_context_t * modctx ) // - "Unload" / clear the player status. // ------------------------------------------- /////////////////////////////////////////////////////////////////////////////////// @@ -198,7 +198,7 @@ typedef struct { muchar *modfile; // the raw mod file mulong modfilesize; muint loopcount; -} modcontext; +} jar_mod_context_t; // // Player states structures @@ -243,14 +243,14 @@ typedef struct jar_mod_tracker_buffer_state_ -bool jar_mod_init(modcontext * modctx); -bool jar_mod_setcfg(modcontext * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); -void jar_mod_fillbuffer(modcontext * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); -void jar_mod_unload(modcontext * modctx); -mulong jar_mod_load_file(modcontext * modctx, char* filename); -mulong jar_mod_current_samples(modcontext * modctx); -mulong jar_mod_max_samples(modcontext * modctx); -void jar_mod_seek_start(modcontext * ctx); +bool jar_mod_init(jar_mod_context_t * modctx); +bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); +void jar_mod_fillbuffer(jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); +void jar_mod_unload(jar_mod_context_t * modctx); +mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename); +mulong jar_mod_current_samples(jar_mod_context_t * modctx); +mulong jar_mod_max_samples(jar_mod_context_t * modctx); +void jar_mod_seek_start(jar_mod_context_t * ctx); #ifdef __cplusplus } @@ -398,7 +398,7 @@ static int memcompare( unsigned char * buf1, unsigned char * buf2, unsigned int return 1; } -static int getnote( modcontext * mod, unsigned short period, int finetune ) +static int getnote( jar_mod_context_t * mod, unsigned short period, int finetune ) { int i; @@ -413,7 +413,7 @@ static int getnote( modcontext * mod, unsigned short period, int finetune ) return MAXNOTES; } -static void worknote( note * nptr, channel * cptr, char t, modcontext * mod ) +static void worknote( note * nptr, channel * cptr, char t, jar_mod_context_t * mod ) { muint sample, period, effect, operiod; muint curnote, arpnote; @@ -1051,13 +1051,13 @@ static void workeffect( note * nptr, channel * cptr ) } /////////////////////////////////////////////////////////////////////////////////// -bool jar_mod_init(modcontext * modctx) +bool jar_mod_init(jar_mod_context_t * modctx) { muint i,j; if( modctx ) { - memclear(modctx, 0, sizeof(modcontext)); + memclear(modctx, 0, sizeof(jar_mod_context_t)); modctx->playrate = DEFAULT_SAMPLE_RATE; modctx->stereo = 1; modctx->stereo_separation = 1; @@ -1079,7 +1079,7 @@ bool jar_mod_init(modcontext * modctx) return 0; } -bool jar_mod_setcfg(modcontext * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter) +bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter) { if( modctx ) { @@ -1112,7 +1112,7 @@ bool jar_mod_setcfg(modcontext * modctx, int samplerate, int bits, int stereo, i } // make certain that mod_data stays in memory while playing -static bool jar_mod_load( modcontext * modctx, void * mod_data, int mod_data_size ) +static bool jar_mod_load( jar_mod_context_t * modctx, void * mod_data, int mod_data_size ) { muint i, max; unsigned short t; @@ -1230,7 +1230,7 @@ static bool jar_mod_load( modcontext * modctx, void * mod_data, int mod_data_siz return 0; } -void jar_mod_fillbuffer( modcontext * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +void jar_mod_fillbuffer( jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) { unsigned long i, j; unsigned long k; @@ -1472,7 +1472,7 @@ void jar_mod_fillbuffer( modcontext * modctx, short * outbuffer, unsigned long n } //resets internals for mod context -static void jar_mod_reset( modcontext * modctx) +static void jar_mod_reset( jar_mod_context_t * modctx) { if(modctx) { @@ -1500,7 +1500,7 @@ static void jar_mod_reset( modcontext * modctx) } } -void jar_mod_unload( modcontext * modctx) +void jar_mod_unload( jar_mod_context_t * modctx) { if(modctx) { @@ -1515,7 +1515,7 @@ void jar_mod_unload( modcontext * modctx) -mulong jar_mod_load_file(modcontext * modctx, char* filename) +mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) { mulong fsize = 0; if(modctx->modfile) @@ -1545,7 +1545,7 @@ mulong jar_mod_load_file(modcontext * modctx, char* filename) return fsize; } -mulong jar_mod_current_samples(modcontext * modctx) +mulong jar_mod_current_samples(jar_mod_context_t * modctx) { if(modctx) return modctx->samplenb; @@ -1554,9 +1554,9 @@ mulong jar_mod_current_samples(modcontext * modctx) } // Works, however it is very slow, this data should be cached to ensure it is run only once per file -mulong jar_mod_max_samples(modcontext * ctx) +mulong jar_mod_max_samples(jar_mod_context_t * ctx) { - modcontext tmpctx; + jar_mod_context_t tmpctx; jar_mod_init(&tmpctx); if(!jar_mod_load(&tmpctx, (void*)ctx->modfile, ctx->modfilesize)) return 0; @@ -1571,7 +1571,7 @@ mulong jar_mod_max_samples(modcontext * ctx) } // move seek_val to sample index, 0 -> jar_mod_max_samples is the range -void jar_mod_seek_start(modcontext * ctx) +void jar_mod_seek_start(jar_mod_context_t * ctx) { if(ctx) { diff --git a/src/raylib.h b/src/raylib.h index 47dd5d5b..a280b09e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -452,10 +452,29 @@ typedef struct Ray { Vector3 direction; } Ray; +typedef enum { + ERROR_RAW_CONTEXT_CREATION = -20, + ERROR_XM_CONTEXT_CREATION, + ERROR_MOD_CONTEXT_CREATION, + ERROR_MIX_CHANNEL_CREATION, + ERROR_MUSIC_CHANNEL_CREATION, + ERROR_LOADING_XM, + ERROR_LOADING_MOD, + ERROR_LOADING_WAV, + ERROR_LOADING_OGG, + ERROR_OUT_OF_MIX_CHANNELS, + ERROR_EXTENSION_NOT_RECOGNIZED, + ERROR_UNABLE_TO_OPEN_RRES_FILE, + ERROR_INVALID_RRES_FILE, + ERROR_INVALID_RRES_RESOURCE, + ERROR_UNINITIALIZED_CHANNELS +} AudioError; + // Sound source type typedef struct Sound { unsigned int source; unsigned int buffer; + AudioError error; // if there was any error during the creation or use of this Sound } Sound; // Wave type, defines audio wave data @@ -469,6 +488,8 @@ typedef struct Wave { typedef int RawAudioContext; + + // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { -- cgit v1.2.3 From cf2975d062a991d69fde60c3cdc043a8a39a09dc Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Thu, 2 Jun 2016 02:31:25 -0700 Subject: convenient way to combine errors --- src/audio.h | 30 +++++++++++++++--------------- src/raylib.h | 32 ++++++++++++++++---------------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/audio.h b/src/audio.h index 4baa30df..a7475566 100644 --- a/src/audio.h +++ b/src/audio.h @@ -48,21 +48,21 @@ #endif typedef enum { - ERROR_RAW_CONTEXT_CREATION = -20, - ERROR_XM_CONTEXT_CREATION, - ERROR_MOD_CONTEXT_CREATION, - ERROR_MIX_CHANNEL_CREATION, - ERROR_MUSIC_CHANNEL_CREATION, - ERROR_LOADING_XM, - ERROR_LOADING_MOD, - ERROR_LOADING_WAV, - ERROR_LOADING_OGG, - ERROR_OUT_OF_MIX_CHANNELS, - ERROR_EXTENSION_NOT_RECOGNIZED, - ERROR_UNABLE_TO_OPEN_RRES_FILE, - ERROR_INVALID_RRES_FILE, - ERROR_INVALID_RRES_RESOURCE, - ERROR_UNINITIALIZED_CHANNELS + ERROR_RAW_CONTEXT_CREATION = 1, + ERROR_XM_CONTEXT_CREATION = 2, + ERROR_MOD_CONTEXT_CREATION = 4, + ERROR_MIX_CHANNEL_CREATION = 8, + ERROR_MUSIC_CHANNEL_CREATION = 16, + ERROR_LOADING_XM = 32, + ERROR_LOADING_MOD = 64, + ERROR_LOADING_WAV = 128, + ERROR_LOADING_OGG = 256, + ERROR_OUT_OF_MIX_CHANNELS = 512, + ERROR_EXTENSION_NOT_RECOGNIZED = 1024, + ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, + ERROR_INVALID_RRES_FILE = 4096, + ERROR_INVALID_RRES_RESOURCE = 8192, + ERROR_UNINITIALIZED_CHANNELS = 16384 } AudioError; // Sound source type diff --git a/src/raylib.h b/src/raylib.h index a280b09e..21892d68 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -452,22 +452,22 @@ typedef struct Ray { Vector3 direction; } Ray; -typedef enum { - ERROR_RAW_CONTEXT_CREATION = -20, - ERROR_XM_CONTEXT_CREATION, - ERROR_MOD_CONTEXT_CREATION, - ERROR_MIX_CHANNEL_CREATION, - ERROR_MUSIC_CHANNEL_CREATION, - ERROR_LOADING_XM, - ERROR_LOADING_MOD, - ERROR_LOADING_WAV, - ERROR_LOADING_OGG, - ERROR_OUT_OF_MIX_CHANNELS, - ERROR_EXTENSION_NOT_RECOGNIZED, - ERROR_UNABLE_TO_OPEN_RRES_FILE, - ERROR_INVALID_RRES_FILE, - ERROR_INVALID_RRES_RESOURCE, - ERROR_UNINITIALIZED_CHANNELS +typedef enum { // allows errors to be & together + ERROR_RAW_CONTEXT_CREATION = 1, + ERROR_XM_CONTEXT_CREATION = 2, + ERROR_MOD_CONTEXT_CREATION = 4, + ERROR_MIX_CHANNEL_CREATION = 8, + ERROR_MUSIC_CHANNEL_CREATION = 16, + ERROR_LOADING_XM = 32, + ERROR_LOADING_MOD = 64, + ERROR_LOADING_WAV = 128, + ERROR_LOADING_OGG = 256, + ERROR_OUT_OF_MIX_CHANNELS = 512, + ERROR_EXTENSION_NOT_RECOGNIZED = 1024, + ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, + ERROR_INVALID_RRES_FILE = 4096, + ERROR_INVALID_RRES_RESOURCE = 8192, + ERROR_UNINITIALIZED_CHANNELS = 16384 } AudioError; // Sound source type -- cgit v1.2.3 From cf6d2e39852b4e73479369a383ab3666189ee23f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 17:12:31 +0200 Subject: Review coding style to match raylib style Moved AudioError enum inside audio.c --- src/audio.c | 363 ++++++++++++++++++++++++++++++++--------------------------- src/audio.h | 20 +--- src/raylib.h | 23 +--- 3 files changed, 199 insertions(+), 207 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 452459ef..361b8b55 100644 --- a/src/audio.c +++ b/src/audio.c @@ -35,29 +35,29 @@ #include "raylib.h" #endif -#include "AL/al.h" // OpenAL basic header -#include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) -#include "AL/alext.h" // OpenAL extensions for other format types +#include "AL/al.h" // OpenAL basic header +#include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) +#include "AL/alext.h" // OpenAL extensions for other format types -#include // Required for: malloc(), free() -#include // Required for: strcmp(), strncmp() -#include // Required for: FILE, fopen(), fclose(), fread() +#include // Required for: malloc(), free() +#include // Required for: strcmp(), strncmp() +#include // Required for: FILE, fopen(), fclose(), fread() #if defined(AUDIO_STANDALONE) - #include // Required for: va_list, va_start(), vfprintf(), va_end() + #include // Required for: va_list, va_start(), vfprintf(), va_end() #else - #include "utils.h" // Required for: DecompressData() - // NOTE: Includes Android fopen() function map + #include "utils.h" // Required for: DecompressData() + // NOTE: Includes Android fopen() function map #endif //#define STB_VORBIS_HEADER_ONLY -#include "stb_vorbis.h" // OGG loading functions +#include "stb_vorbis.h" // OGG loading functions #define JAR_XM_IMPLEMENTATION -#include "jar_xm.h" // XM loading functions +#include "jar_xm.h" // XM loading functions #define JAR_MOD_IMPLEMENTATION -#include "jar_mod.h" // For playing .mod files +#include "jar_mod.h" // MOD loading functions //---------------------------------------------------------------------------------- // Defines and Macros @@ -89,25 +89,45 @@ typedef struct MixChannel_t { unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream bool floatingPoint; // if false then the short datatype is used instead bool playing; // false if paused - ALenum alFormat; // openAL format specifier - ALuint alSource; // openAL source - ALuint alBuffer[MAX_STREAM_BUFFERS]; // openAL sample buffer + + ALenum alFormat; // OpenAL format specifier + ALuint alSource; // OpenAL source + ALuint alBuffer[MAX_STREAM_BUFFERS]; // OpenAL sample buffer } MixChannel_t; // Music type (file streaming from memory) // NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... typedef struct Music { stb_vorbis *stream; - jar_xm_context_t *xmctx; // Stores jar_xm mixc, XM chiptune context - jar_mod_context_t modctx; // Stores mod chiptune context + jar_xm_context_t *xmctx; // XM chiptune context + jar_mod_context_t modctx; // MOD chiptune context MixChannel_t *mixc; // mix channel unsigned int totalSamplesLeft; float totalLengthSeconds; bool loop; - bool chipTune; // True if chiptune is loaded + bool chipTune; // chiptune is loaded? } Music; +// Audio errors registered +typedef enum { + ERROR_RAW_CONTEXT_CREATION = 1, + ERROR_XM_CONTEXT_CREATION = 2, + ERROR_MOD_CONTEXT_CREATION = 4, + ERROR_MIX_CHANNEL_CREATION = 8, + ERROR_MUSIC_CHANNEL_CREATION = 16, + ERROR_LOADING_XM = 32, + ERROR_LOADING_MOD = 64, + ERROR_LOADING_WAV = 128, + ERROR_LOADING_OGG = 256, + ERROR_OUT_OF_MIX_CHANNELS = 512, + ERROR_EXTENSION_NOT_RECOGNIZED = 1024, + ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, + ERROR_INVALID_RRES_FILE = 4096, + ERROR_INVALID_RRES_RESOURCE = 8192, + ERROR_UNINITIALIZED_CHANNELS = 16384 +} AudioError; + #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif @@ -119,6 +139,8 @@ static MixChannel_t* mixChannels_g[MAX_MIX_CHANNELS]; // What mix channel static bool musicEnabled_g = false; static Music musicChannels_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static lastAudioError = 0; // Registers last audio error + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -129,10 +151,9 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data static void EmptyMusicStream(int index); // Empty music buffers - -static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. -static void CloseMixChannel(MixChannel_t* mixc); // Frees mix channel -static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses +static MixChannel_t *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. +static void CloseMixChannel(MixChannel_t *mixc); // Frees mix channel +static int BufferMixChannel(MixChannel_t *mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in @@ -153,13 +174,13 @@ void InitAudioDevice(void) // Open and initialize a device with default settings ALCdevice *device = alcOpenDevice(NULL); - if(!device) TraceLog(ERROR, "Audio device could not be opened"); + if (!device) TraceLog(ERROR, "Audio device could not be opened"); ALCcontext *context = alcCreateContext(device, NULL); - if(context == NULL || alcMakeContextCurrent(context) == ALC_FALSE) + if ((context == NULL) || (alcMakeContextCurrent(context) == ALC_FALSE)) { - if(context != NULL) alcDestroyContext(context); + if (context != NULL) alcDestroyContext(context); alcCloseDevice(device); @@ -177,11 +198,10 @@ void InitAudioDevice(void) // Close the audio device for all contexts void CloseAudioDevice(void) { - for(int index=0; index= MAX_MIX_CHANNELS) return NULL; - if(!IsAudioDeviceReady()) InitAudioDevice(); + if (mixChannel >= MAX_MIX_CHANNELS) return NULL; + if (!IsAudioDeviceReady()) InitAudioDevice(); - if(!mixChannels_g[mixChannel]){ - MixChannel_t *mixc = (MixChannel_t*)malloc(sizeof(MixChannel_t)); + if (!mixChannels_g[mixChannel]) + { + MixChannel_t *mixc = (MixChannel_t *)malloc(sizeof(MixChannel_t)); mixc->sampleRate = sampleRate; mixc->channels = channels; mixc->mixChannel = mixChannel; mixc->floatingPoint = floatingPoint; mixChannels_g[mixChannel] = mixc; - // setup openAL format - if(channels == 1) + // Setup OpenAL format + if (channels == 1) { - if(floatingPoint) - mixc->alFormat = AL_FORMAT_MONO_FLOAT32; - else - mixc->alFormat = AL_FORMAT_MONO16; + if (floatingPoint) mixc->alFormat = AL_FORMAT_MONO_FLOAT32; + else mixc->alFormat = AL_FORMAT_MONO16; } - else if(channels == 2) + else if (channels == 2) { - if(floatingPoint) - mixc->alFormat = AL_FORMAT_STEREO_FLOAT32; - else - mixc->alFormat = AL_FORMAT_STEREO16; + if (floatingPoint) mixc->alFormat = AL_FORMAT_STEREO_FLOAT32; + else mixc->alFormat = AL_FORMAT_STEREO16; } // Create an audio source @@ -253,10 +273,8 @@ static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mix // Create Buffer alGenBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - //fill buffers - int x; - for(x=0;xalBuffer[x]); + // Fill buffers + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) FillAlBufferWithSilence(mixc, mixc->alBuffer[i]); alSourceQueueBuffers(mixc->alSource, MAX_STREAM_BUFFERS, mixc->alBuffer); mixc->playing = true; @@ -264,27 +282,30 @@ static MixChannel_t* InitMixChannel(unsigned short sampleRate, unsigned char mix return mixc; } + return NULL; } // Frees buffer in mix channel -static void CloseMixChannel(MixChannel_t* mixc) +static void CloseMixChannel(MixChannel_t *mixc) { - if(mixc){ + if (mixc) + { alSourceStop(mixc->alSource); mixc->playing = false; - //flush out all queued buffers + // Flush out all queued buffers ALuint buffer = 0; int queued = 0; alGetSourcei(mixc->alSource, AL_BUFFERS_QUEUED, &queued); + while (queued > 0) { alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); queued--; } - //delete source and buffers + // Delete source and buffers alDeleteSources(1, &mixc->alSource); alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); mixChannels_g[mixc->mixChannel] = NULL; @@ -296,39 +317,46 @@ static void CloseMixChannel(MixChannel_t* mixc) // Pushes more audio data into mixc mix channel, only one buffer per call // Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. -static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) +static int BufferMixChannel(MixChannel_t *mixc, void *data, int numberElements) { - if(!mixc || mixChannels_g[mixc->mixChannel] != mixc) return 0; // when there is two channels there must be an even number of samples + if (!mixc || (mixChannels_g[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples - if (!data || !numberElements) - { // pauses audio until data is given - if(mixc->playing){ + if (!data || !numberElements) + { + // Pauses audio until data is given + if (mixc->playing) + { alSourcePause(mixc->alSource); mixc->playing = false; } + return 0; } - else if(!mixc->playing) - { // restart audio otherwise + else if (!mixc->playing) + { + // Restart audio otherwise alSourcePlay(mixc->alSource); mixc->playing = true; } - - + ALuint buffer = 0; alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); - if(!buffer) return 0; - if(mixc->floatingPoint) // process float buffers + if (!buffer) return 0; + + if (mixc->floatingPoint) { - float *ptr = (float*)data; + // Process float buffers + float *ptr = (float *)data; alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(float), mixc->sampleRate); } - else // process short buffers + else { - short *ptr = (short*)data; + // Process short buffers + short *ptr = (short *)data; alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(short), mixc->sampleRate); } + alSourceQueueBuffers(mixc->alSource, 1, &buffer); return numberElements; @@ -337,15 +365,18 @@ static int BufferMixChannel(MixChannel_t* mixc, void *data, int numberElements) // fill buffer with zeros, returns number processed static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) { - if(mixc->floatingPoint){ - float pcm[MUSIC_BUFFER_SIZE_FLOAT] = {0.f}; + if (mixc->floatingPoint) + { + float pcm[MUSIC_BUFFER_SIZE_FLOAT] = { 0.0f }; alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), mixc->sampleRate); + return MUSIC_BUFFER_SIZE_FLOAT; } else { - short pcm[MUSIC_BUFFER_SIZE_SHORT] = {0}; + short pcm[MUSIC_BUFFER_SIZE_SHORT] = { 0 }; alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); + return MUSIC_BUFFER_SIZE_SHORT; } } @@ -355,13 +386,10 @@ static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) // ResampleShortToFloat(sh,fl,3); static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len) { - int x; - for(x=0;x= 0) + + if (ctx >= 0) { MixChannel_t* mixc = mixChannels_g[ctx]; numBuffered = BufferMixChannel(mixc, data, numberElements); } + return numBuffered; } - - - - //---------------------------------------------------------------------------------- // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- @@ -438,9 +458,12 @@ Sound LoadSound(char *fileName) if (strcmp(GetExtension(fileName),"wav") == 0) wave = LoadWAV(fileName); else if (strcmp(GetExtension(fileName),"ogg") == 0) wave = LoadOGG(fileName); - else{ + else + { TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); - sound.error = ERROR_EXTENSION_NOT_RECOGNIZED; //error + + // TODO: Find a better way to register errors (similar to glGetError()) + lastAudioError = ERROR_EXTENSION_NOT_RECOGNIZED; } if (wave.data != NULL) @@ -568,7 +591,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) if (rresFile == NULL) { TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); - sound.error = ERROR_UNABLE_TO_OPEN_RRES_FILE; //error + lastAudioError = ERROR_UNABLE_TO_OPEN_RRES_FILE; } else { @@ -583,7 +606,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) { TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); - sound.error = ERROR_INVALID_RRES_FILE; + lastAudioError = ERROR_INVALID_RRES_FILE; } else { @@ -674,7 +697,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) else { TraceLog(WARNING, "[%s] Required resource do not seem to be a valid SOUND resource", rresName); - sound.error = ERROR_INVALID_RRES_RESOURCE; + lastAudioError = ERROR_INVALID_RRES_RESOURCE; } } else @@ -780,12 +803,12 @@ int PlayMusicStream(int musicIndex, char *fileName) { int mixIndex; - if(musicChannels_g[musicIndex].stream || musicChannels_g[musicIndex].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error + if (musicChannels_g[musicIndex].stream || musicChannels_g[musicIndex].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error - for(mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot + for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { - if(mixChannels_g[mixIndex] == NULL) break; - else if(mixIndex == MAX_MIX_CHANNELS - 1) return ERROR_OUT_OF_MIX_CHANNELS; // error + if (mixChannels_g[mixIndex] == NULL) break; + else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) @@ -814,21 +837,24 @@ int PlayMusicStream(int musicIndex, char *fileName) musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[musicIndex].stream) * info.channels; musicChannels_g[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[musicIndex].stream); - if (info.channels == 2){ + if (info.channels == 2) + { musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); musicChannels_g[musicIndex].mixc->playing = true; } - else{ + else + { musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); musicChannels_g[musicIndex].mixc->playing = true; } - if(!musicChannels_g[musicIndex].mixc) return ERROR_LOADING_OGG; // error + + if (!musicChannels_g[musicIndex].mixc) return ERROR_LOADING_OGG; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if(!jar_xm_create_context_from_file(&musicChannels_g[musicIndex].xmctx, 48000, fileName)) + if (!jar_xm_create_context_from_file(&musicChannels_g[musicIndex].xmctx, 48000, fileName)) { musicChannels_g[musicIndex].chipTune = true; musicChannels_g[musicIndex].loop = true; @@ -841,7 +867,9 @@ int PlayMusicStream(int musicIndex, char *fileName) TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, true); - if(!musicChannels_g[musicIndex].mixc) return ERROR_XM_CONTEXT_CREATION; // error + + if (!musicChannels_g[musicIndex].mixc) return ERROR_XM_CONTEXT_CREATION; // error + musicChannels_g[musicIndex].mixc->playing = true; } else @@ -853,7 +881,8 @@ int PlayMusicStream(int musicIndex, char *fileName) else if (strcmp(GetExtension(fileName),"mod") == 0) { jar_mod_init(&musicChannels_g[musicIndex].modctx); - if(jar_mod_load_file(&musicChannels_g[musicIndex].modctx, fileName)) + + if (jar_mod_load_file(&musicChannels_g[musicIndex].modctx, fileName)) { musicChannels_g[musicIndex].chipTune = true; musicChannels_g[musicIndex].loop = true; @@ -865,7 +894,9 @@ int PlayMusicStream(int musicIndex, char *fileName) TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); - if(!musicChannels_g[musicIndex].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + + if (!musicChannels_g[musicIndex].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + musicChannels_g[musicIndex].mixc->playing = true; } else @@ -879,6 +910,7 @@ int PlayMusicStream(int musicIndex, char *fileName) TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); return ERROR_EXTENSION_NOT_RECOGNIZED; // error } + return 0; // normal return } @@ -894,17 +926,12 @@ void StopMusicStream(int index) jar_xm_free_context(musicChannels_g[index].xmctx); musicChannels_g[index].xmctx = 0; } - else if(musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) - { - jar_mod_unload(&musicChannels_g[index].modctx); - } - else - { - stb_vorbis_close(musicChannels_g[index].stream); - } + else if (musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) jar_mod_unload(&musicChannels_g[index].modctx); + else stb_vorbis_close(musicChannels_g[index].stream); - if(!getMusicStreamCount()) musicEnabled_g = false; - if(musicChannels_g[index].stream || musicChannels_g[index].xmctx) + if (!GetMusicStreamCount()) musicEnabled_g = false; + + if (musicChannels_g[index].stream || musicChannels_g[index].xmctx) { musicChannels_g[index].stream = NULL; musicChannels_g[index].xmctx = NULL; @@ -913,11 +940,15 @@ void StopMusicStream(int index) } //get number of music channels active at this time, this does not mean they are playing -int getMusicStreamCount(void) +int GetMusicStreamCount(void) { int musicCount = 0; - for(int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) // find empty music slot + + // Find empty music slot + for (int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) + { if(musicChannels_g[musicIndex].stream != NULL || musicChannels_g[musicIndex].chipTune) musicCount++; + } return musicCount; } @@ -939,8 +970,11 @@ void ResumeMusicStream(int index) { // Resume music playing... if music available! ALenum state; - if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + { alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); @@ -956,8 +990,10 @@ bool IsMusicPlaying(int index) bool playing = false; ALint state; - if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + { alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PLAYING) playing = true; } @@ -967,14 +1003,17 @@ bool IsMusicPlaying(int index) // Set volume for music void SetMusicVolume(int index, float volume) { - if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + { alSourcef(musicChannels_g[index].mixc->alSource, AL_GAIN, volume); } } +// Set pitch for music void SetMusicPitch(int index, float pitch) { - if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc){ + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + { alSourcef(musicChannels_g[index].mixc->alSource, AL_PITCH, pitch); } } @@ -983,14 +1022,9 @@ void SetMusicPitch(int index, float pitch) float GetMusicTimeLength(int index) { float totalSeconds; - if (musicChannels_g[index].chipTune) - { - totalSeconds = (float)musicChannels_g[index].totalLengthSeconds; - } - else - { - totalSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); - } + + if (musicChannels_g[index].chipTune) totalSeconds = (float)musicChannels_g[index].totalLengthSeconds; + else totalSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); return totalSeconds; } @@ -999,7 +1033,8 @@ float GetMusicTimeLength(int index) float GetMusicTimePlayed(int index) { float secondsPlayed = 0.0f; - if(index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) { if (musicChannels_g[index].chipTune && musicChannels_g[index].xmctx) { @@ -1033,33 +1068,33 @@ static bool BufferMusicStream(int index, int numBuffers) short pcm[MUSIC_BUFFER_SIZE_SHORT]; float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; - int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts - bool active = true; // We can get more data from stream (not finished) + int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts + bool active = true; // We can get more data from stream (not finished) if (musicChannels_g[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - for(int x=0; x= MUSIC_BUFFER_SIZE_SHORT) - size = MUSIC_BUFFER_SIZE_SHORT / 2; - else - size = musicChannels_g[index].totalSamplesLeft / 2; + if (musicChannels_g[index].modctx.mod_loaded) + { + if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT/2; + else size = musicChannels_g[index].totalSamplesLeft/2; + jar_mod_fillbuffer(&musicChannels_g[index].modctx, pcm, size, 0 ); - BufferMixChannel(musicChannels_g[index].mixc, pcm, size * 2); + BufferMixChannel(musicChannels_g[index].mixc, pcm, size*2); } - else if(musicChannels_g[index].xmctx){ - if(musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) - size = MUSIC_BUFFER_SIZE_FLOAT / 2; - else - size = musicChannels_g[index].totalSamplesLeft / 2; + else if (musicChannels_g[index].xmctx) + { + if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT/2; + else size = musicChannels_g[index].totalSamplesLeft/2; + jar_xm_generate_samples(musicChannels_g[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location - BufferMixChannel(musicChannels_g[index].mixc, pcmf, size * 2); + BufferMixChannel(musicChannels_g[index].mixc, pcmf, size*2); } - musicChannels_g[index].totalSamplesLeft -= size; - if(musicChannels_g[index].totalSamplesLeft <= 0) + + if (musicChannels_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1068,17 +1103,16 @@ static bool BufferMusicStream(int index, int numBuffers) } else { - if(musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) - size = MUSIC_BUFFER_SIZE_SHORT; - else - size = musicChannels_g[index].totalSamplesLeft; + if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; + else size = musicChannels_g[index].totalSamplesLeft; - for(int x=0; xchannels, pcm, size); BufferMixChannel(musicChannels_g[index].mixc, pcm, streamedBytes * musicChannels_g[index].mixc->channels); musicChannels_g[index].totalSamplesLeft -= streamedBytes * musicChannels_g[index].mixc->channels; - if(musicChannels_g[index].totalSamplesLeft <= 0) + + if (musicChannels_g[index].totalSamplesLeft <= 0) { active = false; break; @@ -1105,7 +1139,7 @@ static void EmptyMusicStream(int index) } } -//determine if a music stream is ready to be written to +// Determine if a music stream is ready to be written static int IsMusicStreamReadyForBuffering(int index) { ALint processed = 0; @@ -1120,7 +1154,7 @@ void UpdateMusicStream(int index) bool active = true; int numBuffers = IsMusicStreamReadyForBuffering(index); - if (musicChannels_g[index].mixc->playing && index < MAX_MUSIC_STREAMS && musicEnabled_g && musicChannels_g[index].mixc && numBuffers) + if (musicChannels_g[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicEnabled_g && musicChannels_g[index].mixc && numBuffers) { active = BufferMusicStream(index, numBuffers); @@ -1136,9 +1170,9 @@ void UpdateMusicStream(int index) stb_vorbis_seek_start(musicChannels_g[index].stream); musicChannels_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; } + active = true; } - if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); @@ -1149,9 +1183,6 @@ void UpdateMusicStream(int index) if (!active) StopMusicStream(index); } - else - return; - } // Load WAV file into Wave structure diff --git a/src/audio.h b/src/audio.h index a7475566..e30087ba 100644 --- a/src/audio.h +++ b/src/audio.h @@ -47,24 +47,6 @@ #endif #endif -typedef enum { - ERROR_RAW_CONTEXT_CREATION = 1, - ERROR_XM_CONTEXT_CREATION = 2, - ERROR_MOD_CONTEXT_CREATION = 4, - ERROR_MIX_CHANNEL_CREATION = 8, - ERROR_MUSIC_CHANNEL_CREATION = 16, - ERROR_LOADING_XM = 32, - ERROR_LOADING_MOD = 64, - ERROR_LOADING_WAV = 128, - ERROR_LOADING_OGG = 256, - ERROR_OUT_OF_MIX_CHANNELS = 512, - ERROR_EXTENSION_NOT_RECOGNIZED = 1024, - ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, - ERROR_INVALID_RRES_FILE = 4096, - ERROR_INVALID_RRES_RESOURCE = 8192, - ERROR_UNINITIALIZED_CHANNELS = 16384 -} AudioError; - // Sound source type typedef struct Sound { unsigned int source; @@ -120,7 +102,7 @@ bool IsMusicPlaying(int index); // Check if musi void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(int index); // Get music time length (in seconds) float GetMusicTimePlayed(int index); // Get current music time played (in seconds) -int getMusicStreamCount(void); +int GetMusicStreamCount(void); void SetMusicPitch(int index, float pitch); // used to output raw audio streams, returns negative numbers on error diff --git a/src/raylib.h b/src/raylib.h index 21892d68..97f4a2e6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -452,29 +452,10 @@ typedef struct Ray { Vector3 direction; } Ray; -typedef enum { // allows errors to be & together - ERROR_RAW_CONTEXT_CREATION = 1, - ERROR_XM_CONTEXT_CREATION = 2, - ERROR_MOD_CONTEXT_CREATION = 4, - ERROR_MIX_CHANNEL_CREATION = 8, - ERROR_MUSIC_CHANNEL_CREATION = 16, - ERROR_LOADING_XM = 32, - ERROR_LOADING_MOD = 64, - ERROR_LOADING_WAV = 128, - ERROR_LOADING_OGG = 256, - ERROR_OUT_OF_MIX_CHANNELS = 512, - ERROR_EXTENSION_NOT_RECOGNIZED = 1024, - ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, - ERROR_INVALID_RRES_FILE = 4096, - ERROR_INVALID_RRES_RESOURCE = 8192, - ERROR_UNINITIALIZED_CHANNELS = 16384 -} AudioError; - // Sound source type typedef struct Sound { unsigned int source; unsigned int buffer; - AudioError error; // if there was any error during the creation or use of this Sound } Sound; // Wave type, defines audio wave data @@ -488,8 +469,6 @@ typedef struct Wave { typedef int RawAudioContext; - - // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { @@ -940,7 +919,7 @@ bool IsMusicPlaying(int index); // Check if musi void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) float GetMusicTimeLength(int index); // Get current music time length (in seconds) float GetMusicTimePlayed(int index); // Get current music time played (in seconds) -int getMusicStreamCount(void); +int GetMusicStreamCount(void); void SetMusicPitch(int index, float pitch); // used to output raw audio streams, returns negative numbers on error -- cgit v1.2.3 From 4fb3103dfaa797685ed8b9db647ac7d9f08f89bd Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 18:19:47 +0200 Subject: Corrected some formatting issues --- src/audio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 361b8b55..31ecd879 100644 --- a/src/audio.c +++ b/src/audio.c @@ -135,11 +135,11 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static MixChannel_t* mixChannels_g[MAX_MIX_CHANNELS]; // What mix channels are currently active -static bool musicEnabled_g = false; static Music musicChannels_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static MixChannel_t *mixChannels_g[MAX_MIX_CHANNELS]; // What mix channels are currently active +static bool musicEnabled_g = false; -static lastAudioError = 0; // Registers last audio error +static int lastAudioError = 0; // Registers last audio error //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -388,8 +388,8 @@ static void ResampleShortToFloat(short *shorts, float *floats, unsigned short le { for (int i = 0; i < len; i++) { - if (shorts[x] < 0) floats[x] = (float)shorts[x]/32766.0f; - else floats[x] = (float)shorts[x]/32767.0f; + if (shorts[i] < 0) floats[i] = (float)shorts[i]/32766.0f; + else floats[i] = (float)shorts[i]/32767.0f; } } @@ -400,8 +400,8 @@ static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) { for (int i = 0; i < len; i++) { - if (chars[x] < 0) floats[x] = (float)chars[x]/127.0f; - else floats[x] = (float)chars[x]/128.0f; + if (chars[i] < 0) floats[i] = (float)chars[i]/127.0f; + else floats[i] = (float)chars[i]/128.0f; } } -- cgit v1.2.3 From c286bea8e13a84fd78a9f6211de086398a6f9a06 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 18:20:59 +0200 Subject: Remove GLEW dependency --- src/core.c | 44 ++++++++++---------------------------------- src/rlgl.c | 4 +--- 2 files changed, 11 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 7bd44c81..be9151ee 100644 --- a/src/core.c +++ b/src/core.c @@ -54,13 +54,7 @@ #include // Macros for reporting and retrieving error conditions through error codes #if defined(PLATFORM_DESKTOP) - #define GLAD_EXTENSIONS_LOADER - #if defined(GLEW_EXTENSIONS_LOADER) - #define GLEW_STATIC - #include // GLEW extensions loading lib - #elif defined(GLAD_EXTENSIONS_LOADER) - #include "glad.h" // GLAD library: Manage OpenGL headers and extensions - #endif + #include "glad.h" // GLAD library: Manage OpenGL headers and extensions #endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -1576,33 +1570,15 @@ static void InitDisplay(int width, int height) // Extensions initialization for OpenGL 3.3 if (rlGetVersion() == OPENGL_33) { - #if defined(GLEW_EXTENSIONS_LOADER) - // Initialize extensions using GLEW - glewExperimental = 1; // Needed for core profile - GLenum error = glewInit(); - - if (error != GLEW_OK) TraceLog(ERROR, "Failed to initialize GLEW - Error Code: %s\n", glewGetErrorString(error)); - - if (glewIsSupported("GL_VERSION_3_3")) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); - else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); - - // With GLEW, we can check if an extension has been loaded in two ways: - //if (GLEW_ARB_vertex_array_object) { } - //if (glewIsSupported("GL_ARB_vertex_array_object")) { } - - // NOTE: GLEW is a big library that loads ALL extensions, we can use some alternative to load only required ones - // Alternatives: glLoadGen, glad, libepoxy - #elif defined(GLAD_EXTENSIONS_LOADER) - // NOTE: glad is generated and contains only required OpenGL version and Core extensions - //if (!gladLoadGL()) TraceLog(ERROR, "Failed to initialize glad\n"); - if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) TraceLog(ERROR, "Failed to initialize glad\n"); // No GLFW3 in this module... - - if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); - else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); - - // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans - //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object - #endif + // NOTE: glad is generated and contains only required OpenGL version and Core extensions + //if (!gladLoadGL()) TraceLog(ERROR, "Failed to initialize glad\n"); + if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) TraceLog(ERROR, "Failed to initialize glad\n"); // No GLFW3 in this module... + + if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); + else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); + + // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans + //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object } #endif diff --git a/src/rlgl.c b/src/rlgl.c index cca48ba2..cfa6e2e6 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -48,8 +48,6 @@ #ifdef __APPLE__ #include // OpenGL 3 library for OSX #else - //#define GLEW_STATIC - //#include // GLEW header, includes OpenGL headers #include "glad.h" // GLAD library, includes OpenGL headers #endif #endif @@ -912,8 +910,8 @@ void rlglInit(void) vaoSupported = true; npotSupported = true; - // NOTE: We don't need to check again supported extensions but we do (in case GLEW is replaced sometime) // We get a list of available extensions and we check for some of them (compressed textures) + // NOTE: We don't need to check again supported extensions but we do (GLAD already dealt with that) glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); const char *extList[numExt]; -- cgit v1.2.3 From 5bcddca5e1841f7d320f769bdd56f0f89327cd14 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 18:29:49 +0200 Subject: Remove useless stuff --- src/raymath.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src') diff --git a/src/raymath.h b/src/raymath.h index 2e055e9f..188bd610 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -151,7 +151,6 @@ RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top, RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double far); // Returns perspective projection matrix RMDEF Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far); // Returns orthographic projection matrix RMDEF Matrix MatrixLookAt(Vector3 position, Vector3 target, Vector3 up); // Returns camera look-at matrix (view matrix) -RMDEF void PrintMatrix(Matrix m); // Print matrix utility //------------------------------------------------------------------------------------ // Functions Declaration to work with Quaternions @@ -178,9 +177,7 @@ RMDEF void QuaternionTransform(Quaternion *q, Matrix mat); // Transfo #if defined(RAYMATH_IMPLEMENTATION) || defined(RAYMATH_EXTERN_INLINE) -#include // Used only on PrintMatrix() -#include // Standard math libary: sin(), cos(), tan()... -#include // Used for abs() +#include // Required for: sinf(), cosf(), tan(), fabs() //---------------------------------------------------------------------------------- // Module Functions Definition - Vector3 math @@ -871,17 +868,6 @@ RMDEF Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up) return result; } -// Print matrix utility (for debug) -RMDEF void PrintMatrix(Matrix m) -{ - printf("----------------------\n"); - printf("%2.2f %2.2f %2.2f %2.2f\n", m.m0, m.m4, m.m8, m.m12); - printf("%2.2f %2.2f %2.2f %2.2f\n", m.m1, m.m5, m.m9, m.m13); - printf("%2.2f %2.2f %2.2f %2.2f\n", m.m2, m.m6, m.m10, m.m14); - printf("%2.2f %2.2f %2.2f %2.2f\n", m.m3, m.m7, m.m11, m.m15); - printf("----------------------\n"); -} - //---------------------------------------------------------------------------------- // Module Functions Definition - Quaternion math //---------------------------------------------------------------------------------- -- cgit v1.2.3 From 80b3c4cd2bef67c71970a6f4b6c54c6f23e4bcaa Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 18:49:40 +0200 Subject: Review comments to be value-generic --- src/easings.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/easings.h b/src/easings.h index a8178f4a..527970ab 100644 --- a/src/easings.h +++ b/src/easings.h @@ -9,21 +9,24 @@ * // This requires lots of memory on system. * How to use: * The four inputs t,b,c,d are defined as follows: -* t = current time in milliseconds -* b = starting position in only one dimension [X || Y || Z] your choice +* t = current time (in any unit measure, but same unit as duration) +* b = starting value to interpolate * c = the total change in value of b that needs to occur -* d = total time it should take to complete +* d = total time it should take to complete (duration) * * Example: -* float speed = 1.f; -* float currentTime = 0.f; -* float currentPos[2] = {0,0}; -* float finalPos[2] = {1,1}; -* float startPosition[2] = currentPos;//x,y positions -* while(currentPos[0] < finalPos[0]) -* currentPos[0] = EaseSineIn(currentTime, startPosition[0], startPosition[0]-finalPos[0], speed); -* currentPos[1] = EaseSineIn(currentTime, startPosition[1], startPosition[1]-finalPos[0], speed); -* currentTime += diffTime(); +* +* int currentTime = 0; +* int duration = 100; +* float startPositionX = 0.0f; +* float finalPositionX = 30.0f; +* float currentPositionX = startPositionX; +* +* while (currentPositionX < finalPositionX) +* { +* currentPositionX = EaseSineIn(currentTime, startPositionX, finalPositionX - startPositionX, duration); +* currentTime++; +* } * * A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/) * @@ -87,7 +90,7 @@ #define EASEDEF extern #endif -#include +#include // Required for: sin(), cos(), sqrt(), pow() #ifdef __cplusplus extern "C" { // Prevents name mangling of functions -- cgit v1.2.3 From 4c9d0f16a5f797e7cca2723245923d0516432a48 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 19:09:31 +0200 Subject: Comment to avoid warning --- src/raygui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c index 266ecc6a..eaf15224 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -667,7 +667,7 @@ int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) Vector2 mousePoint = GetMousePosition(); int textWidth = MeasureText(FormatText("%i", value), style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; + //int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Unused variable int buttonSide = 0; -- cgit v1.2.3 From cafc66a3c18ae4b8adf2673dfecda1ad3604aaee Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 19:09:56 +0200 Subject: Rename for consistency with other functions --- src/audio.c | 70 ++++++++++++++++++++++++++++++------------------------------ src/audio.h | 2 +- src/raylib.h | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 31ecd879..b5514b12 100644 --- a/src/audio.c +++ b/src/audio.c @@ -799,11 +799,11 @@ void SetSoundPitch(Sound sound, float pitch) // Start music playing (open stream) // returns 0 on success -int PlayMusicStream(int musicIndex, char *fileName) +int PlayMusicStream(int index, char *fileName) { int mixIndex; - if (musicChannels_g[musicIndex].stream || musicChannels_g[musicIndex].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error + if (musicChannels_g[index].stream || musicChannels_g[index].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { @@ -814,9 +814,9 @@ int PlayMusicStream(int musicIndex, char *fileName) if (strcmp(GetExtension(fileName),"ogg") == 0) { // Open audio stream - musicChannels_g[musicIndex].stream = stb_vorbis_open_filename(fileName, NULL, NULL); + musicChannels_g[index].stream = stb_vorbis_open_filename(fileName, NULL, NULL); - if (musicChannels_g[musicIndex].stream == NULL) + if (musicChannels_g[index].stream == NULL) { TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); return ERROR_LOADING_OGG; // error @@ -824,53 +824,53 @@ int PlayMusicStream(int musicIndex, char *fileName) else { // Get file info - stb_vorbis_info info = stb_vorbis_get_info(musicChannels_g[musicIndex].stream); + stb_vorbis_info info = stb_vorbis_get_info(musicChannels_g[index].stream); TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); - musicChannels_g[musicIndex].loop = true; // We loop by default + musicChannels_g[index].loop = true; // We loop by default musicEnabled_g = true; - musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[musicIndex].stream) * info.channels; - musicChannels_g[musicIndex].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[musicIndex].stream); + musicChannels_g[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * info.channels; + musicChannels_g[index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); if (info.channels == 2) { - musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); - musicChannels_g[musicIndex].mixc->playing = true; + musicChannels_g[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + musicChannels_g[index].mixc->playing = true; } else { - musicChannels_g[musicIndex].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - musicChannels_g[musicIndex].mixc->playing = true; + musicChannels_g[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + musicChannels_g[index].mixc->playing = true; } - if (!musicChannels_g[musicIndex].mixc) return ERROR_LOADING_OGG; // error + if (!musicChannels_g[index].mixc) return ERROR_LOADING_OGG; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if (!jar_xm_create_context_from_file(&musicChannels_g[musicIndex].xmctx, 48000, fileName)) + if (!jar_xm_create_context_from_file(&musicChannels_g[index].xmctx, 48000, fileName)) { - musicChannels_g[musicIndex].chipTune = true; - musicChannels_g[musicIndex].loop = true; - jar_xm_set_max_loop_count(musicChannels_g[musicIndex].xmctx, 0); // infinite number of loops - musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicChannels_g[musicIndex].xmctx); - musicChannels_g[musicIndex].totalLengthSeconds = ((float)musicChannels_g[musicIndex].totalSamplesLeft) / 48000.f; + musicChannels_g[index].chipTune = true; + musicChannels_g[index].loop = true; + jar_xm_set_max_loop_count(musicChannels_g[index].xmctx, 0); // infinite number of loops + musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicChannels_g[index].xmctx); + musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicChannels_g[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); - musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, true); + musicChannels_g[index].mixc = InitMixChannel(48000, mixIndex, 2, true); - if (!musicChannels_g[musicIndex].mixc) return ERROR_XM_CONTEXT_CREATION; // error + if (!musicChannels_g[index].mixc) return ERROR_XM_CONTEXT_CREATION; // error - musicChannels_g[musicIndex].mixc->playing = true; + musicChannels_g[index].mixc->playing = true; } else { @@ -880,24 +880,24 @@ int PlayMusicStream(int musicIndex, char *fileName) } else if (strcmp(GetExtension(fileName),"mod") == 0) { - jar_mod_init(&musicChannels_g[musicIndex].modctx); + jar_mod_init(&musicChannels_g[index].modctx); - if (jar_mod_load_file(&musicChannels_g[musicIndex].modctx, fileName)) + if (jar_mod_load_file(&musicChannels_g[index].modctx, fileName)) { - musicChannels_g[musicIndex].chipTune = true; - musicChannels_g[musicIndex].loop = true; - musicChannels_g[musicIndex].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicChannels_g[musicIndex].modctx); - musicChannels_g[musicIndex].totalLengthSeconds = ((float)musicChannels_g[musicIndex].totalSamplesLeft) / 48000.f; + musicChannels_g[index].chipTune = true; + musicChannels_g[index].loop = true; + musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicChannels_g[index].modctx); + musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; musicEnabled_g = true; - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicChannels_g[musicIndex].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[musicIndex].totalLengthSeconds); + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); - musicChannels_g[musicIndex].mixc = InitMixChannel(48000, mixIndex, 2, false); + musicChannels_g[index].mixc = InitMixChannel(48000, mixIndex, 2, false); - if (!musicChannels_g[musicIndex].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + if (!musicChannels_g[index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error - musicChannels_g[musicIndex].mixc->playing = true; + musicChannels_g[index].mixc->playing = true; } else { diff --git a/src/audio.h b/src/audio.h index e30087ba..fe72d866 100644 --- a/src/audio.h +++ b/src/audio.h @@ -93,7 +93,7 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) +int PlayMusicStream(int index, char *fileName); // Start music playing (open stream) void UpdateMusicStream(int index); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing diff --git a/src/raylib.h b/src/raylib.h index 97f4a2e6..bc2f658f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -910,7 +910,7 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -int PlayMusicStream(int musicIndex, char *fileName); // Start music playing (open stream) +int PlayMusicStream(int index, char *fileName); // Start music playing (open stream) void UpdateMusicStream(int index); // Updates buffers for music streaming void StopMusicStream(int index); // Stop music playing (close stream) void PauseMusicStream(int index); // Pause music playing -- cgit v1.2.3 From 2168d8aa1af1e60467983099c5f72b7ac5ab5144 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 19:16:11 +0200 Subject: Removed DrawPhysicObjectInfo() function To avoid additional dependencies --- src/physac.c | 16 ---------------- src/physac.h | 1 - src/raylib.h | 1 - 3 files changed, 18 deletions(-) (limited to 'src') diff --git a/src/physac.c b/src/physac.c index eed2f26e..1d577d3d 100644 --- a/src/physac.c +++ b/src/physac.c @@ -570,22 +570,6 @@ Rectangle TransformToRectangle(Transform transform) return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; } -// Draw physic object information at screen position -void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize) -{ - // Draw physic object ID - DrawText(FormatText("PhysicObject ID: %i - Enabled: %i", pObj->id, pObj->enabled), position.x, position.y, fontSize, BLACK); - - // Draw physic object transform values - DrawText(FormatText("\nTRANSFORM\nPosition: %f, %f\nRotation: %f\nScale: %f, %f", pObj->transform.position.x, pObj->transform.position.y, pObj->transform.rotation, pObj->transform.scale.x, pObj->transform.scale.y), position.x, position.y, fontSize, BLACK); - - // Draw physic object rigidbody values - DrawText(FormatText("\n\n\n\n\n\nRIGIDBODY\nEnabled: %i\nMass: %f\nAcceleration: %f, %f\nVelocity: %f, %f\nApplyGravity: %i\nIsGrounded: %i\nFriction: %f\nBounciness: %f", pObj->rigidbody.enabled, pObj->rigidbody.mass, pObj->rigidbody.acceleration.x, pObj->rigidbody.acceleration.y, - pObj->rigidbody.velocity.x, pObj->rigidbody.velocity.y, pObj->rigidbody.applyGravity, pObj->rigidbody.isGrounded, pObj->rigidbody.friction, pObj->rigidbody.bounciness), position.x, position.y, fontSize, BLACK); - - DrawText(FormatText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nCOLLIDER\nEnabled: %i\nBounds: %i, %i, %i, %i\nRadius: %i", pObj->collider.enabled, pObj->collider.bounds.x, pObj->collider.bounds.y, pObj->collider.bounds.width, pObj->collider.bounds.height, pObj->collider.radius), position.x, position.y, fontSize, BLACK); -} - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- diff --git a/src/physac.h b/src/physac.h index 6cef480a..b2ae2766 100644 --- a/src/physac.h +++ b/src/physac.h @@ -92,7 +92,6 @@ void ApplyForce(PhysicObject pObj, Vector2 force); void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) -void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize); // Draw physic object information at screen position #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index bc2f658f..a00c0ff9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -890,7 +890,6 @@ void ApplyForce(PhysicObject pObj, Vector2 force); void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) -void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize); // Draw physic object information at screen position //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) -- cgit v1.2.3 From 0bc71d84f8ca2b8cbe48eae8769fb16958b98531 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 2 Jun 2016 20:23:09 +0200 Subject: Added functions to customize internal matrix Internal modelview and projection matrices can be replaced before drawing. --- src/raylib.h | 3 +++ src/raymath.h | 5 ++--- src/rlgl.c | 25 ++++++++++++++++++------- src/rlgl.h | 3 +++ 4 files changed, 26 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index a00c0ff9..efd96a67 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -868,6 +868,9 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // S void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) +void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) + void BeginShaderMode(Shader shader); // Begin custom shader drawing void EndShaderMode(void); // End custom shader drawing (use default shader) void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) diff --git a/src/raymath.h b/src/raymath.h index 188bd610..4075a1a9 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -339,15 +339,14 @@ RMDEF Vector3 VectorReflect(Vector3 vector, Vector3 normal) return result; } -// Transforms a Vector3 with a given Matrix +// Transforms a Vector3 by a given Matrix +// TODO: Review math (matrix transpose required?) RMDEF void VectorTransform(Vector3 *v, Matrix mat) { float x = v->x; float y = v->y; float z = v->z; - //MatrixTranspose(&mat); - v->x = mat.m0*x + mat.m4*y + mat.m8*z + mat.m12; v->y = mat.m1*x + mat.m5*y + mat.m9*z + mat.m13; v->z = mat.m2*x + mat.m6*y + mat.m10*z + mat.m14; diff --git a/src/rlgl.c b/src/rlgl.c index cfa6e2e6..6beececb 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -28,7 +28,7 @@ #include "rlgl.h" -#include // Standard input / output lib +#include // Required for: fopen(), fclose(), fread()... [Used only on ReadTextFile()] #include // Required for: malloc(), free(), rand() #include // Required for: strcmp(), strlen(), strtok() @@ -59,8 +59,8 @@ #endif #if defined(RLGL_STANDALONE) - #include // Required for: va_list, va_start(), vfprintf(), va_end() -#endif // NOTE: Used on TraceLog() + #include // Required for: va_list, va_start(), vfprintf(), va_end() [Used only on TraceLog()] +#endif //---------------------------------------------------------------------------------- // Defines and Macros @@ -355,7 +355,6 @@ void rlRotatef(float angleDeg, float x, float y, float z) Vector3 axis = (Vector3){ x, y, z }; VectorNormalize(&axis); matRotation = MatrixRotate(axis, angleDeg*DEG2RAD); - MatrixTranspose(&matRotation); *currentMatrix = MatrixMultiply(*currentMatrix, matRotation); @@ -2153,7 +2152,7 @@ void UnloadShader(Shader shader) } } -// Set custom shader to be used on batch draw +// Begin custom shader mode void BeginShaderMode(Shader shader) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -2165,7 +2164,7 @@ void BeginShaderMode(Shader shader) #endif } -// Set default shader to be used in batch draw +// End custom shader mode (returns to default shader) void EndShaderMode(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) @@ -2251,6 +2250,18 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) #endif } +// Set a custom projection matrix (replaces internal projection matrix) +void SetMatrixProjection(Matrix proj) +{ + projection = proj; +} + +// Set a custom modelview matrix (replaces internal modelview matrix) +void SetMatrixModelview(Matrix view) +{ + modelview = view; +} + // Begin blending mode (alpha, additive, multiplied) // NOTE: Only 3 blending modes supported, default blend mode is alpha void BeginBlendMode(int mode) @@ -3068,7 +3079,7 @@ static void UnloadDefaultBuffers(void) free(quads.indices); } -// Sets shader uniform values for lights array +// Setup shader uniform values for lights array // NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0f static void SetShaderLights(Shader shader) { diff --git a/src/rlgl.h b/src/rlgl.h index 00482d2e..2a578a1f 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -329,6 +329,9 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // S void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) +void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) + void BeginShaderMode(Shader shader); // Begin custom shader drawing void EndShaderMode(void); // End custom shader drawing (use default shader) void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -- cgit v1.2.3 From 7ca639722316ce020a8359c52c815dca2b4015e8 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 3 Jun 2016 00:53:51 +0200 Subject: Added support for Oculus Rift CV1 --- src/core.c | 428 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 404 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index be9151ee..d4db5017 100644 --- a/src/core.c +++ b/src/core.c @@ -9,6 +9,7 @@ * PLATFORM_ANDROID - Only OpenGL ES 2.0 devices * PLATFORM_RPI - Rapsberry Pi (tested on Raspbian) * PLATFORM_WEB - Emscripten, HTML5 +* PLATFORM_OCULUS - Oculus Rift CV1 (with desktop mirror) * * On PLATFORM_DESKTOP, the external lib GLFW3 (www.glfw.com) is used to manage graphic * device, OpenGL context and input on multiple operating systems (Windows, Linux, OSX). @@ -53,10 +54,18 @@ #include // String function definitions, memset() #include // Macros for reporting and retrieving error conditions through error codes +#if defined(PLATFORM_OCULUS) + #define PLATFORM_DESKTOP // Enable PLATFORM_DESKTOP code-base +#endif + #if defined(PLATFORM_DESKTOP) #include "glad.h" // GLAD library: Manage OpenGL headers and extensions #endif +#if defined(PLATFORM_OCULUS) + #include "../examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL +#endif + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 #include // GLFW3 library: Windows, OpenGL context and Input management @@ -129,7 +138,31 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- -// ... +#if defined(PLATFORM_OCULUS) +typedef struct OculusBuffer { + ovrTextureSwapChain textureChain; + GLuint depthId; + GLuint fboId; + int width; + int height; +} OculusBuffer; + +typedef struct OculusMirror { + ovrMirrorTexture texture; + GLuint fboId; + int width; + int height; +} OculusMirror; + +typedef struct OculusLayer { + ovrViewScaleDesc viewScaleDesc; + ovrLayerEyeFov eyeLayer; // layer 0 + //ovrLayerQuad quadLayer; // TODO: layer 1: '2D' quad for GUI + Matrix eyeProjections[2]; + int width; + int height; +} OculusLayer; +#endif //---------------------------------------------------------------------------------- // Global Variables Definition @@ -137,7 +170,9 @@ #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) static GLFWwindow *window; // Native window (graphic device) static bool windowMinimized = false; -#elif defined(PLATFORM_ANDROID) +#endif + +#if defined(PLATFORM_ANDROID) static struct android_app *app; // Android activity static struct android_poll_source *source; // Android events polling source static int ident, events; // Android ALooper_pollAll() variables @@ -149,7 +184,9 @@ static bool contextRebindRequired = false; // Used to know context rebind r static int previousButtonState[128] = { 1 }; // Required to check if button pressed/released once static int currentButtonState[128] = { 1 }; // Required to check if button pressed/released once -#elif defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_RPI) static EGL_DISPMANX_WINDOW_T nativeWindow; // Native window (graphic device) // Keyboard input variables @@ -180,6 +217,17 @@ static uint64_t baseTime; // Base time measure for hi-res time static bool windowShouldClose = false; // Flag to set window for closing #endif +#if defined(PLATFORM_OCULUS) +// OVR device variables +static ovrSession session; +static ovrHmdDesc hmdDesc; +static ovrGraphicsLuid luid; +static OculusLayer layer; +static OculusBuffer buffer; +static OculusMirror mirror; +static unsigned int frameIndex = 0; +#endif + static unsigned int displayWidth, displayHeight; // Display width and height (monitor, device-screen, LCD, ...) static int screenWidth, screenHeight; // Screen width and height (used render area) static int renderWidth, renderHeight; // Framebuffer width and height (render area) @@ -189,6 +237,7 @@ static int renderOffsetX = 0; // Offset X from render area (must b static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2) static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size) +static Matrix cameraView; // Store camera view matrix (required for Oculus Rift) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... @@ -287,6 +336,19 @@ static void InitGamepad(void); // Init raw gamepad inpu static void *GamepadThread(void *arg); // Mouse reading thread #endif +#if defined(PLATFORM_OCULUS) +// Oculus Rift functions +static Matrix FromOvrMatrix(ovrMatrix4f ovrM); +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); +static void SetOculusBuffer(ovrSession session, OculusBuffer buffer); +static void UnsetOculusBuffer(OculusBuffer buffer); +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror); // Unload Oculus mirror buffers +static void BlitOculusMirror(ovrSession session, OculusMirror mirror); +static OculusLayer InitOculusLayer(ovrSession session); +#endif + //---------------------------------------------------------------------------------- // Module Functions Definition - Window and OpenGL Context Functions //---------------------------------------------------------------------------------- @@ -335,6 +397,11 @@ void InitWindow(int width, int height, const char *title) //emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenInputCallback); #endif +#if defined(PLATFORM_OCULUS) + // Recenter OVR tracking origin + ovr_RecenterTrackingOrigin(session); +#endif + mousePosition.x = (float)screenWidth/2.0f; mousePosition.y = (float)screenHeight/2.0f; @@ -345,8 +412,9 @@ void InitWindow(int width, int height, const char *title) LogoAnimation(); } } +#endif -#elif defined(PLATFORM_ANDROID) +#if defined(PLATFORM_ANDROID) // Android activity initialization void InitWindow(int width, int height, struct android_app *state) { @@ -415,12 +483,19 @@ void CloseWindow(void) { UnloadDefaultFont(); +#if defined(PLATFORM_OCULUS) + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers +#endif + rlglClose(); // De-init rlgl #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwDestroyWindow(window); glfwTerminate(); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) // Close surface, context and display if (display != EGL_NO_DISPLAY) { @@ -443,6 +518,11 @@ void CloseWindow(void) } #endif +#if defined(PLATFORM_OCULUS) + ovr_Destroy(session); // Must be called after glfwTerminate() + ovr_Shutdown(); +#endif + TraceLog(INFO, "Window closed successfully"); } @@ -454,7 +534,9 @@ bool WindowShouldClose(void) while (windowMinimized) glfwPollEvents(); return (glfwWindowShouldClose(window)); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) return windowShouldClose; #endif } @@ -480,7 +562,9 @@ void ToggleFullscreen(void) glfwDestroyWindow(window); // Destroy the current window (we will recreate it!) InitWindow(screenWidth, screenHeight, windowTitle); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) TraceLog(WARNING, "Could not toggle to windowed mode"); #endif } @@ -510,6 +594,18 @@ void BeginDrawing(void) currentTime = GetTime(); // Number of elapsed seconds since InitTimer() was called updateTime = currentTime - previousTime; previousTime = currentTime; + +#if defined(PLATFORM_OCULUS) + frameIndex++; + + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; + + SetOculusBuffer(session, buffer); +#endif rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -522,10 +618,51 @@ void BeginDrawing(void) // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) +#if defined(PLATFORM_OCULUS) + for (int eye = 0; eye < 2; eye++) + { + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - SwapBuffers(); // Copy back buffer to front buffer + Quaternion eyeRPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); + Matrix modelEyeView = MatrixMultiply(cameraView, eyeView); // Using internal camera modelview matrix + + SetMatrixModelview(modelEyeView); + SetMatrixProjection(layer.eyeProjections[eye]); +#endif + + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + +#if defined(PLATFORM_OCULUS) + } + + UnsetOculusBuffer(buffer); + + ovr_CommitTextureSwapChain(session, buffer.textureChain); + + ovrLayerHeader *layers = &layer.eyeLayer.Header; + ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); + + // Blit mirror texture to back buffer + BlitOculusMirror(session, mirror); + + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); +#endif + + SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events // Frame time control system @@ -595,8 +732,8 @@ void Begin3dMode(Camera camera) rlLoadIdentity(); // Reset current matrix (MODELVIEW) // Setup Camera view - Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - rlMultMatrixf(MatrixToFloat(matView)); // Multiply MODELVIEW matrix by view matrix (camera) + cameraView = MatrixLookAt(camera.position, camera.target, camera.up); + rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D } @@ -1437,6 +1574,30 @@ static void InitDisplay(int width, int height) // Downscale matrix is required in case desired screen area is bigger than display area downscaleView = MatrixIdentity(); +#if defined(PLATFORM_OCULUS) + ovrResult result = ovr_Initialize(NULL); + if (OVR_FAILURE(result)) TraceLog(ERROR, "OVR: Could not initialize Oculus device"); + + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + } + + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + TraceLog(INFO, "OVR: Serian Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + screenWidth = hmdDesc.Resolution.w/2; + screenHeight = hmdDesc.Resolution.h/2; +#endif + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSetErrorCallback(ErrorCallback); @@ -1565,14 +1726,17 @@ static void InitDisplay(int width, int height) #endif glfwMakeContextCurrent(window); +#if defined(PLATFORM_OCULUS) + glfwSwapInterval(0); +#endif #if defined(PLATFORM_DESKTOP) - // Extensions initialization for OpenGL 3.3 + // Load OpenGL 3.3 extensions using GLAD if (rlGetVersion() == OPENGL_33) { - // NOTE: glad is generated and contains only required OpenGL version and Core extensions - //if (!gladLoadGL()) TraceLog(ERROR, "Failed to initialize glad\n"); - if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) TraceLog(ERROR, "Failed to initialize glad\n"); // No GLFW3 in this module... + // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions + if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); + else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); @@ -1746,13 +1910,16 @@ static void InitDisplay(int width, int height) static void InitGraphics(void) { rlglInit(); // Init rlgl - + rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) + #if defined(PLATFORM_OCULUS) - //rlglInitOculus(); // Init rlgl for Oculus Rift (required textures) + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); #endif - rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) - ClearBackground(RAYWHITE); // Default background color for raylib games :P #if defined(PLATFORM_ANDROID) @@ -1860,7 +2027,9 @@ static double GetTime(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetTime(); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; @@ -1928,8 +2097,9 @@ static void PollInputEvents(void) currentMouseWheelY = 0; glfwPollEvents(); // Register keyboard/mouse events... and window events! -#elif defined(PLATFORM_ANDROID) +#endif +#if defined(PLATFORM_ANDROID) // Register previous keys states for (int i = 0; i < 128; i++) previousButtonState[i] = currentButtonState[i]; @@ -1948,8 +2118,9 @@ static void PollInputEvents(void) //ANativeActivity_finish(app->activity); } } -#elif defined(PLATFORM_RPI) +#endif +#if defined(PLATFORM_RPI) // NOTE: Mouse input events polling is done asynchonously in another pthread - MouseThread() // NOTE: Keyboard reading could be done using input_event(s) reading or just read from stdin, @@ -1957,7 +2128,6 @@ static void PollInputEvents(void) ProcessKeyboard(); // NOTE: Gamepad (Joystick) input events polling is done asynchonously in another pthread - GamepadThread() - #endif } @@ -1966,7 +2136,9 @@ static void SwapBuffers(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSwapBuffers(window); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) eglSwapBuffers(display, surface); #endif } @@ -2774,6 +2946,214 @@ static void *GamepadThread(void *arg) } #endif + +#if defined(PLATFORM_OCULUS) +// Convert from Oculus ovrMatrix4f struct to raymath Matrix struct +static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) +{ + Matrix rmat; + + rmat.m0 = ovrmat.M[0][0]; + rmat.m1 = ovrmat.M[1][0]; + rmat.m2 = ovrmat.M[2][0]; + rmat.m3 = ovrmat.M[3][0]; + rmat.m4 = ovrmat.M[0][1]; + rmat.m5 = ovrmat.M[1][1]; + rmat.m6 = ovrmat.M[2][1]; + rmat.m7 = ovrmat.M[3][1]; + rmat.m8 = ovrmat.M[0][2]; + rmat.m9 = ovrmat.M[1][2]; + rmat.m10 = ovrmat.M[2][2]; + rmat.m11 = ovrmat.M[3][2]; + rmat.m12 = ovrmat.M[0][3]; + rmat.m13 = ovrmat.M[1][3]; + rmat.m14 = ovrmat.M[2][3]; + rmat.m15 = ovrmat.M[3][3]; + + MatrixTranspose(&rmat); + + return rmat; +} + +// Load Oculus required buffers: texture-swap-chain, fbo, texture-depth +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) +{ + OculusBuffer buffer; + buffer.width = width; + buffer.height = height; + + // Create OVR texture chain + ovrTextureSwapChainDesc desc = {}; + desc.Type = ovrTexture_2D; + desc.ArraySize = 1; + desc.Width = width; + desc.Height = height; + desc.MipLevels = 1; + desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; // Requires glEnable(GL_FRAMEBUFFER_SRGB); + desc.SampleCount = 1; + desc.StaticImage = ovrFalse; + + ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); + + if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); + + int textureCount = 0; + ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); + + if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); + + for (int i = 0; i < textureCount; ++i) + { + GLuint chainTexId; + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, i, &chainTexId); + glBindTexture(GL_TEXTURE_2D, chainTexId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + + glBindTexture(GL_TEXTURE_2D, 0); + + /* + // Setup framebuffer object (using depth texture) + glGenFramebuffers(1, &buffer.fboId); + glGenTextures(1, &buffer.depthId); + glBindTexture(GL_TEXTURE_2D, buffer.depthId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + */ + + // Setup framebuffer object (using depth renderbuffer) + glGenFramebuffers(1, &buffer.fboId); + glGenRenderbuffers(1, &buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glBindRenderbuffer(GL_RENDERBUFFER, buffer.depthId); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, buffer.width, buffer.height); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + return buffer; +} + +// Unload texture required buffers +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer) +{ + if (buffer.textureChain) + { + ovr_DestroyTextureSwapChain(session, buffer.textureChain); + buffer.textureChain = NULL; + } + + if (buffer.depthId != 0) glDeleteTextures(1, &buffer.depthId); + if (buffer.fboId != 0) glDeleteFramebuffers(1, &buffer.fboId); +} + +// Set current Oculus buffer +static void SetOculusBuffer(ovrSession session, OculusBuffer buffer) +{ + GLuint currentTexId; + int currentIndex; + + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); + + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); + //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded + + //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) + //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + // Required if OculusBuffer format is OVR_FORMAT_R8G8B8A8_UNORM_SRGB + glEnable(GL_FRAMEBUFFER_SRGB); +} + +// Unset Oculus buffer +static void UnsetOculusBuffer(OculusBuffer buffer) +{ + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); +} + +// Load Oculus mirror buffers +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) +{ + OculusMirror mirror; + mirror.width = width; + mirror.height = height; + + ovrMirrorTextureDesc mirrorDesc; + memset(&mirrorDesc, 0, sizeof(mirrorDesc)); + mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; + mirrorDesc.Width = mirror.width; + mirrorDesc.Height = mirror.height; + + if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); + + glGenFramebuffers(1, &mirror.fboId); + + return mirror; +} + +// Unload Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) +{ + if (mirror.fboId != 0) glDeleteFramebuffers(1, &mirror.fboId); + if (mirror.texture) ovr_DestroyMirrorTexture(session, mirror.texture); +} + +static void BlitOculusMirror(ovrSession session, OculusMirror mirror) +{ + GLuint mirrorTextureId; + + ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); + glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); + glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); +} + +// Requires: session, hmdDesc +static OculusLayer InitOculusLayer(ovrSession session) +{ + OculusLayer layer = { 0 }; + + layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; + + memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); + layer.eyeLayer.Header.Type = ovrLayerType_EyeFov; + layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; + + ovrEyeRenderDesc eyeRenderDescs[2]; + + for (int eye = 0; eye < 2; eye++) + { + eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); + ovrMatrix4f ovrPerspectiveProjection = ovrMatrix4f_Projection(eyeRenderDescs[eye].Fov, 0.01f, 10000.0f, ovrProjection_None); //ovrProjection_ClipRangeOpenGL); + layer.eyeProjections[eye] = FromOvrMatrix(ovrPerspectiveProjection); // NOTE: struct ovrMatrix4f { float M[4][4] } --> struct Matrix + + layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; + layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; + + ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); + layer.eyeLayer.Viewport[eye].Size = eyeSize; + layer.eyeLayer.Viewport[eye].Pos.x = layer.width; + layer.eyeLayer.Viewport[eye].Pos.y = 0; + + layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); + layer.width += eyeSize.w; + } + + return layer; +} +#endif + // Plays raylib logo appearing animation static void LogoAnimation(void) { -- cgit v1.2.3 From 13bef7aa0215c135074947a28dce92695d456565 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 3 Jun 2016 18:26:59 +0200 Subject: Work on Oculus functionality Trying to find the best way to integrate Oculus support into raylib, making it easy for the user... --- src/core.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- src/raylib.h | 6 ++++++ 2 files changed, 63 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index d4db5017..7316c79c 100644 --- a/src/core.c +++ b/src/core.c @@ -483,11 +483,6 @@ void CloseWindow(void) { UnloadDefaultFont(); -#if defined(PLATFORM_OCULUS) - UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer - UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers -#endif - rlglClose(); // De-init rlgl #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -526,6 +521,63 @@ void CloseWindow(void) TraceLog(INFO, "Window closed successfully"); } +#if defined(PLATFORM_OCULUS) +// Init Oculus Rift device +// NOTE: Device initialization should be done before window creation? +void InitOculusDevice(void) +{ + ovrResult result = ovr_Initialize(NULL); + if (OVR_FAILURE(result)) TraceLog(ERROR, "OVR: Could not initialize Oculus device"); + + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + } + + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + TraceLog(INFO, "OVR: Serian Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + screenWidth = hmdDesc.Resolution.w/2; + screenHeight = hmdDesc.Resolution.h/2; + + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); +} + +// Close Oculus Rift device +void CloseOculusDevice(void) +{ + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers + + ovr_Destroy(session); // Must be called after glfwTerminate() --> REALLY??? + ovr_Shutdown(); +} + +// Update Oculus Rift tracking (position and orientation) +void UpdateOculusTracking(void) +{ + frameIndex++; + + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; +} +#endif + // Detect if KEY_ESCAPE pressed or Close icon pressed bool WindowShouldClose(void) { diff --git a/src/raylib.h b/src/raylib.h index efd96a67..bdaaeb08 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -578,6 +578,12 @@ void InitWindow(int width, int height, struct android_app *state); // Init Andr void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics #endif +#if defined(PLATFORM_OCULUS) +void InitOculusDevice(void); // Init Oculus Rift device +void CloseOculusDevice(void); // Close Oculus Rift device +void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) +#endif + void CloseWindow(void); // Close Window and Terminate Context bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) -- cgit v1.2.3 From d1133ca8d3a959c438ccf98f1c21f0ff24381b48 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 3 Jun 2016 18:51:19 +0200 Subject: Some gestures comments tweaks... --- src/core.c | 2 +- src/gestures.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 7316c79c..d229e1f8 100644 --- a/src/core.c +++ b/src/core.c @@ -2674,7 +2674,7 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent gestureEvent.position[1].y /= (float)GetScreenHeight(); // Gesture data is sent to gestures system for processing - ProcessGestureEvent(gestureEvent); // Process obtained gestures data + ProcessGestureEvent(gestureEvent); return 1; } diff --git a/src/gestures.c b/src/gestures.c index d3b85d12..90371620 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -46,12 +46,12 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define FORCE_TO_SWIPE 0.0005f // Measured in normalized pixels / time -#define MINIMUM_DRAG 0.015f // Measured in normalized pixels [0..1] -#define MINIMUM_PINCH 0.005f // Measured in normalized pixels [0..1] +#define FORCE_TO_SWIPE 0.0005f // Measured in normalized screen units/time +#define MINIMUM_DRAG 0.015f // Measured in normalized screen units (0.0f to 1.0f) +#define MINIMUM_PINCH 0.005f // Measured in normalized screen units (0.0f to 1.0f) #define TAP_TIMEOUT 300 // Time in milliseconds #define PINCH_TIMEOUT 300 // Time in milliseconds -#define DOUBLETAP_RANGE 0.03f +#define DOUBLETAP_RANGE 0.03f // Measured in normalized screen units (0.0f to 1.0f) //---------------------------------------------------------------------------------- // Types and Structures Definition -- cgit v1.2.3 From 60232810d83c7ea3a52491f0b20444003be53358 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 3 Jun 2016 19:00:58 +0200 Subject: Added some comments --- src/raygui.c | 3 +-- src/raylib.h | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c index eaf15224..5064f123 100644 --- a/src/raygui.c +++ b/src/raygui.c @@ -177,7 +177,7 @@ static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if p static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' // NOTE: raygui depend on some raylib input and drawing functions -// TODO: Set your own functions +// TODO: Replace by your own functions static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } static int IsMouseButtonDown(int button) { return 0; } static int IsMouseButtonPressed(int button) { return 0; } @@ -191,7 +191,6 @@ static int MeasureText(const char *text, int fontSize) { return 0; } static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } static void DrawRectangleRec(Rectangle rec, Color color) { } static void DrawRectangle(int posX, int posY, int width, int height, Color color) { DrawRectangleRec((Rectangle){ posX, posY, width, height }, color); } - #endif //---------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index bdaaeb08..706c4f4a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -64,6 +64,7 @@ //#define PLATFORM_ANDROID // Android device //#define PLATFORM_RPI // Raspberry Pi //#define PLATFORM_WEB // HTML5 (emscripten, asm.js) +//#define PLATFORM_OCULUS // Oculus Rift CV1 // Security check in case no PLATFORM_* defined #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) @@ -71,7 +72,7 @@ #endif #if defined(PLATFORM_ANDROID) - typedef struct android_app; // Define android_app struct (android_native_app_glue.h) + typedef struct android_app; // Define android_app struct (android_native_app_glue.h) #endif //---------------------------------------------------------------------------------- @@ -448,14 +449,14 @@ typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; // Ray type (useful for raycast) typedef struct Ray { - Vector3 position; - Vector3 direction; + Vector3 position; // Ray position (origin) + Vector3 direction; // Ray direction } Ray; // Sound source type typedef struct Sound { - unsigned int source; - unsigned int buffer; + unsigned int source; // Sound audio source id + unsigned int buffer; // Sound audio buffer id } Sound; // Wave type, defines audio wave data -- cgit v1.2.3 From 72eb2632cc3a16b08ef5875faccbe3b9b55cb52e Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 5 Jun 2016 23:51:41 +0200 Subject: Corrected compilation bug on OpenGL 1.1 --- src/rlgl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 6beececb..756fba75 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2253,13 +2253,17 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) // Set a custom projection matrix (replaces internal projection matrix) void SetMatrixProjection(Matrix proj) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) projection = proj; +#endif } // Set a custom modelview matrix (replaces internal modelview matrix) void SetMatrixModelview(Matrix view) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) modelview = view; +#endif } // Begin blending mode (alpha, additive, multiplied) -- cgit v1.2.3 From 688045307a20e64b797bf487e72375cfcfaee601 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 13:52:06 +0200 Subject: Reorganize folder for Android library Android build system has been simplified and now is included in src folder, like other build systems. --- src/android/jni/Android.mk | 59 ++ src/android/jni/Application.mk | 3 + src/android/jni/include/AL/al.h | 825 +++++++++++++++++++++ src/android/jni/include/AL/alc.h | 285 +++++++ src/android/jni/include/AL/alext.h | 165 +++++ src/android/jni/include/AL/efx-creative.h | 3 + src/android/jni/include/AL/efx.h | 758 +++++++++++++++++++ .../jni/include/AL/oalMacOSX_OALExtensions.h | 161 ++++ .../jni/include/AL/oalStaticBufferExtension.h | 0 src/android/jni/include/android_native_app_glue.h | 349 +++++++++ 10 files changed, 2608 insertions(+) create mode 100644 src/android/jni/Android.mk create mode 100644 src/android/jni/Application.mk create mode 100644 src/android/jni/include/AL/al.h create mode 100644 src/android/jni/include/AL/alc.h create mode 100644 src/android/jni/include/AL/alext.h create mode 100644 src/android/jni/include/AL/efx-creative.h create mode 100644 src/android/jni/include/AL/efx.h create mode 100644 src/android/jni/include/AL/oalMacOSX_OALExtensions.h create mode 100644 src/android/jni/include/AL/oalStaticBufferExtension.h create mode 100644 src/android/jni/include/android_native_app_glue.h (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk new file mode 100644 index 00000000..0325d1f5 --- /dev/null +++ b/src/android/jni/Android.mk @@ -0,0 +1,59 @@ +#************************************************************************************************** +# +# raylib for Android +# +# Static library compilation +# +# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# +# This software is provided "as-is", without any express or implied warranty. In no event +# will the authors be held liable for any damages arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, including commercial +# applications, and to alter it and redistribute it freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not claim that you +# wrote the original software. If you use this software in a product, an acknowledgment +# in the product documentation would be appreciated but is not required. +# +# 2. Altered source versions must be plainly marked as such, and must not be misrepresented +# as being the original software. +# +# 3. This notice may not be removed or altered from any source distribution. +# +#************************************************************************************************** + +# Path of the current directory (i.e. the directory containing the Android.mk file itself) +LOCAL_PATH := $(call my-dir) + +# raylib static library compilation +# NOTE: It uses source placed on relative path ../../src from this file +#----------------------------------------------------------------------- +# Makefile that will clear many LOCAL_XXX variables for you +include $(CLEAR_VARS) + +# Module name +LOCAL_MODULE := raylib + +# Module source files +LOCAL_SRC_FILES :=\ + ../../core.c \ + ../../rlgl.c \ + ../../textures.c \ + ../../text.c \ + ../../shapes.c \ + ../../gestures.c \ + ../../models.c \ + ../../utils.c \ + ../../audio.c \ + ../../stb_vorbis.c \ + +# Required includes paths (.h) +LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/../.. + +# Required flags for compilation: defines PLATFORM_ANDROID and GRAPHICS_API_OPENGL_ES2 +LOCAL_CFLAGS := -Wall -std=c99 -Wno-missing-braces -g -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2 + +# Build the static library libraylib.a +include $(BUILD_STATIC_LIBRARY) +#-------------------------------------------------------------------- diff --git a/src/android/jni/Application.mk b/src/android/jni/Application.mk new file mode 100644 index 00000000..fab0d7e5 --- /dev/null +++ b/src/android/jni/Application.mk @@ -0,0 +1,3 @@ +APP_ABI := $(TARGET_ARCH_ABI) +# $(warning APP_ABI $(APP_ABI)) +# $(warning LOCAL_ARM_NEON $(LOCAL_ARM_NEON)) diff --git a/src/android/jni/include/AL/al.h b/src/android/jni/include/AL/al.h new file mode 100644 index 00000000..e084b3ed --- /dev/null +++ b/src/android/jni/include/AL/al.h @@ -0,0 +1,825 @@ +#ifndef AL_AL_H +#define AL_AL_H + +#ifdef ANDROID +#include +#ifndef LOGI +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,"OpenAL",__VA_ARGS__) +#endif +#ifndef LOGE +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,"OpenAL",__VA_ARGS__) +#endif +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(AL_LIBTYPE_STATIC) + #define AL_API +#elif defined(_WIN32) && !defined(_XBOX) + #if defined(AL_BUILD_LIBRARY) + #define AL_API __declspec(dllexport) + #else + #define AL_API __declspec(dllimport) + #endif +#else + #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY) + #define AL_API __attribute__((visibility("protected"))) + #else + #define AL_API extern + #endif +#endif + +#if defined(_WIN32) + #define AL_APIENTRY __cdecl +#else + #define AL_APIENTRY +#endif + +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC + #pragma export on +#endif + +/* + * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and + * AL_ILLEGAL_COMMAND macros are deprecated, but are included for + * applications porting code from AL 1.0 + */ +#define OPENAL +#define ALAPI AL_API +#define ALAPIENTRY AL_APIENTRY +#define AL_INVALID (-1) +#define AL_ILLEGAL_ENUM AL_INVALID_ENUM +#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION + +#define AL_VERSION_1_0 +#define AL_VERSION_1_1 + + +/** 8-bit boolean */ +typedef char ALboolean; + +/** character */ +typedef char ALchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALsizei; + +/** enumerated 32-bit value */ +typedef int ALenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALdouble; + +#ifdef OPENAL_FIXED_POINT +/* Apportable tries to define int64_t and int32_t if it thinks it is needed. + * But this is breaking in a complex project involving both pure C and C++ + * something is triggering redefinition errors. The workaround seems to be just using stdint.h. + */ +#include +/** Types and Macros for fixed-point math */ +#ifndef INT64_MAX +typedef long long int64_t; +#define INT64_MAX 9223372036854775807LL + +#endif +#ifndef INT32_MAX +typedef int int32_t; +#define INT32_MAX 2147483647 +#endif + +// FIXME(apportable) make this int32_t +typedef int64_t ALfp; +typedef int64_t ALdfp; + +#define ONE (1<=0 ? 0.5 : -0.5))) +#define ALfp2float(x) ((float)(x) / (1<=0 ? 0.5 : -0.5))) +#define ALdfp2double(x) ((double)(x) / (1<> OPENAL_FIXED_POINT_SHIFT)) + +#define int2ALdfp(x) ((ALdfp)(x) << OPENAL_FIXED_POINT_SHIFT) +#define ALdfp2int(x) ((ALint)((x) >> OPENAL_FIXED_POINT_SHIFT)) + +#define ALfpMult(x,y) ((ALfp)((((int64_t)(x))*((int64_t)(y)))>>OPENAL_FIXED_POINT_SHIFT)) +#define ALfpDiv(x,y) ((ALfp)(((int64_t)(x) << OPENAL_FIXED_POINT_SHIFT) / (y))) + +#define ALdfpMult(x,y) ALfpMult(x,y) +#define ALdfpDiv(x,y) ALfpDiv(x,y) + +#define __isnan(x) (0) +#define __cos(x) (float2ALfp(cos(ALfp2float(x)))) +#define __sin(x) (float2ALfp(sin(ALfp2float(x)))) +#define __log10(x) (float2ALfp(log10(ALfp2float(x)))) +#define __atan(x) (float2ALfp(atan(ALfp2float(x)))) + +#define toALfpConst(x) ((x)*(1< Hz + */ +#define ALC_FREQUENCY 0x1007 + +/** + * followed by Hz + */ +#define ALC_REFRESH 0x1008 + +/** + * followed by AL_TRUE, AL_FALSE + */ +#define ALC_SYNC 0x1009 + +/** + * followed by Num of requested Mono (3D) Sources + */ +#define ALC_MONO_SOURCES 0x1010 + +/** + * followed by Num of requested Stereo Sources + */ +#define ALC_STEREO_SOURCES 0x1011 + +/** + * errors + */ + +/** + * No error + */ +#define ALC_NO_ERROR ALC_FALSE + +/** + * No device + */ +#define ALC_INVALID_DEVICE 0xA001 + +/** + * invalid context ID + */ +#define ALC_INVALID_CONTEXT 0xA002 + +/** + * bad enum + */ +#define ALC_INVALID_ENUM 0xA003 + +/** + * bad value + */ +#define ALC_INVALID_VALUE 0xA004 + +/** + * Out of memory. + */ +#define ALC_OUT_OF_MEMORY 0xA005 + + +/** + * The Specifier string for default device + */ +#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 +#define ALC_DEVICE_SPECIFIER 0x1005 +#define ALC_EXTENSIONS 0x1006 + +#define ALC_MAJOR_VERSION 0x1000 +#define ALC_MINOR_VERSION 0x1001 + +#define ALC_ATTRIBUTES_SIZE 0x1002 +#define ALC_ALL_ATTRIBUTES 0x1003 + + +/** + * Capture extension + */ +#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 +#define ALC_CAPTURE_SAMPLES 0x312 + + +/* + * Context Management + */ +ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ); + +ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); + +ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void ); + +ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ); + + +/* + * Device Management + */ +ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ); + +ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device ); + + +/* + * Error support. + * Obtain the most recent Context error + */ +ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device ); + + +/* + * Extension support. + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. + */ +ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); + +ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); + +ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); + + +/* + * Query functions + */ +ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ); + +ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data ); + + +/* + * Capture functions + */ +ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); + +ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +/* + * Pointer-to-function types, useful for dynamically getting ALC entry points. + */ +typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist); +typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); +typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void ); +typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); +typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); +typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); +typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device ); +typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname ); +typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname ); +typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname ); +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param ); +typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); +typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); +typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +#if defined(TARGET_OS_MAC) && TARGET_OS_MAC + #pragma export off +#endif + +#if defined(ANDROID) +/* + * OpenAL extension for suspend/resume of audio throughout application lifecycle + */ +ALC_API void ALC_APIENTRY alcSuspend( void ); +ALC_API void ALC_APIENTRY alcResume( void ); +#endif + +#if defined(__cplusplus) +} +#endif + +#endif /* AL_ALC_H */ diff --git a/src/android/jni/include/AL/alext.h b/src/android/jni/include/AL/alext.h new file mode 100644 index 00000000..f3c7bcae --- /dev/null +++ b/src/android/jni/include/AL/alext.h @@ -0,0 +1,165 @@ +/** + * OpenAL cross platform audio library + * Copyright (C) 2008 by authors. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * Or go to http://www.gnu.org/copyleft/lgpl.html + */ + +#ifndef AL_ALEXT_H +#define AL_ALEXT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef AL_LOKI_IMA_ADPCM_format +#define AL_LOKI_IMA_ADPCM_format 1 +#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000 +#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001 +#endif + +#ifndef AL_LOKI_WAVE_format +#define AL_LOKI_WAVE_format 1 +#define AL_FORMAT_WAVE_EXT 0x10002 +#endif + +#ifndef AL_EXT_vorbis +#define AL_EXT_vorbis 1 +#define AL_FORMAT_VORBIS_EXT 0x10003 +#endif + +#ifndef AL_LOKI_quadriphonic +#define AL_LOKI_quadriphonic 1 +#define AL_FORMAT_QUAD8_LOKI 0x10004 +#define AL_FORMAT_QUAD16_LOKI 0x10005 +#endif + +#ifndef AL_EXT_float32 +#define AL_EXT_float32 1 +#define AL_FORMAT_MONO_FLOAT32 0x10010 +#define AL_FORMAT_STEREO_FLOAT32 0x10011 +#endif + +#ifndef AL_EXT_double +#define AL_EXT_double 1 +#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012 +#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013 +#endif + +#ifndef ALC_LOKI_audio_channel +#define ALC_LOKI_audio_channel 1 +#define ALC_CHAN_MAIN_LOKI 0x500001 +#define ALC_CHAN_PCM_LOKI 0x500002 +#define ALC_CHAN_CD_LOKI 0x500003 +#endif + +#ifndef ALC_ENUMERATE_ALL_EXT +#define ALC_ENUMERATE_ALL_EXT 1 +#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 +#define ALC_ALL_DEVICES_SPECIFIER 0x1013 +#endif + +#ifndef AL_EXT_MCFORMATS +#define AL_EXT_MCFORMATS 1 +#define AL_FORMAT_QUAD8 0x1204 +#define AL_FORMAT_QUAD16 0x1205 +#define AL_FORMAT_QUAD32 0x1206 +#define AL_FORMAT_REAR8 0x1207 +#define AL_FORMAT_REAR16 0x1208 +#define AL_FORMAT_REAR32 0x1209 +#define AL_FORMAT_51CHN8 0x120A +#define AL_FORMAT_51CHN16 0x120B +#define AL_FORMAT_51CHN32 0x120C +#define AL_FORMAT_61CHN8 0x120D +#define AL_FORMAT_61CHN16 0x120E +#define AL_FORMAT_61CHN32 0x120F +#define AL_FORMAT_71CHN8 0x1210 +#define AL_FORMAT_71CHN16 0x1211 +#define AL_FORMAT_71CHN32 0x1212 +#endif + +#ifndef AL_EXT_MULAW_MCFORMATS +#define AL_EXT_MULAW_MCFORMATS 1 +#define AL_FORMAT_MONO_MULAW 0x10014 +#define AL_FORMAT_STEREO_MULAW 0x10015 +#define AL_FORMAT_QUAD_MULAW 0x10021 +#define AL_FORMAT_REAR_MULAW 0x10022 +#define AL_FORMAT_51CHN_MULAW 0x10023 +#define AL_FORMAT_61CHN_MULAW 0x10024 +#define AL_FORMAT_71CHN_MULAW 0x10025 +#endif + +#ifndef AL_EXT_IMA4 +#define AL_EXT_IMA4 1 +#define AL_FORMAT_MONO_IMA4 0x1300 +#define AL_FORMAT_STEREO_IMA4 0x1301 +#endif + +#ifndef AL_EXT_STATIC_BUFFER +#define AL_EXT_STATIC_BUFFER 1 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); +#endif +#endif + +#ifndef ALC_EXT_EFX +#define ALC_EXT_EFX 1 +#include "efx.h" +#endif + +#ifndef ALC_EXT_disconnect +#define ALC_EXT_disconnect 1 +#define ALC_CONNECTED 0x313 +#endif + +#ifndef ALC_EXT_thread_local_context +#define ALC_EXT_thread_local_context 1 +typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); +typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context); +ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); +#endif +#endif + +#ifndef AL_EXT_source_distance_model +#define AL_EXT_source_distance_model 1 +#define AL_SOURCE_DISTANCE_MODEL 0x200 +#endif + +#ifndef AL_SOFT_buffer_sub_data +#define AL_SOFT_buffer_sub_data 1 +#define AL_BYTE_RW_OFFSETS_SOFT 0x1031 +#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); +#endif +#endif + +#ifndef AL_SOFT_loop_points +#define AL_SOFT_loop_points 1 +#define AL_LOOP_POINTS_SOFT 0x2015 +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/android/jni/include/AL/efx-creative.h b/src/android/jni/include/AL/efx-creative.h new file mode 100644 index 00000000..0a04c982 --- /dev/null +++ b/src/android/jni/include/AL/efx-creative.h @@ -0,0 +1,3 @@ +/* The tokens that would be defined here are already defined in efx.h. This + * empty file is here to provide compatibility with Windows-based projects + * that would include it. */ diff --git a/src/android/jni/include/AL/efx.h b/src/android/jni/include/AL/efx.h new file mode 100644 index 00000000..0ccef95d --- /dev/null +++ b/src/android/jni/include/AL/efx.h @@ -0,0 +1,758 @@ +#ifndef AL_EFX_H +#define AL_EFX_H + + +#ifdef __cplusplus +extern "C" { +#endif + +#define ALC_EXT_EFX_NAME "ALC_EXT_EFX" + +#define ALC_EFX_MAJOR_VERSION 0x20001 +#define ALC_EFX_MINOR_VERSION 0x20002 +#define ALC_MAX_AUXILIARY_SENDS 0x20003 + + +/* Listener properties. */ +#define AL_METERS_PER_UNIT 0x20004 + +/* Source properties. */ +#define AL_DIRECT_FILTER 0x20005 +#define AL_AUXILIARY_SEND_FILTER 0x20006 +#define AL_AIR_ABSORPTION_FACTOR 0x20007 +#define AL_ROOM_ROLLOFF_FACTOR 0x20008 +#define AL_CONE_OUTER_GAINHF 0x20009 +#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A +#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B +#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C + + +/* Effect properties. */ + +/* Reverb effect parameters */ +#define AL_REVERB_DENSITY 0x0001 +#define AL_REVERB_DIFFUSION 0x0002 +#define AL_REVERB_GAIN 0x0003 +#define AL_REVERB_GAINHF 0x0004 +#define AL_REVERB_DECAY_TIME 0x0005 +#define AL_REVERB_DECAY_HFRATIO 0x0006 +#define AL_REVERB_REFLECTIONS_GAIN 0x0007 +#define AL_REVERB_REFLECTIONS_DELAY 0x0008 +#define AL_REVERB_LATE_REVERB_GAIN 0x0009 +#define AL_REVERB_LATE_REVERB_DELAY 0x000A +#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B +#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C +#define AL_REVERB_DECAY_HFLIMIT 0x000D + +/* EAX Reverb effect parameters */ +#define AL_EAXREVERB_DENSITY 0x0001 +#define AL_EAXREVERB_DIFFUSION 0x0002 +#define AL_EAXREVERB_GAIN 0x0003 +#define AL_EAXREVERB_GAINHF 0x0004 +#define AL_EAXREVERB_GAINLF 0x0005 +#define AL_EAXREVERB_DECAY_TIME 0x0006 +#define AL_EAXREVERB_DECAY_HFRATIO 0x0007 +#define AL_EAXREVERB_DECAY_LFRATIO 0x0008 +#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009 +#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A +#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B +#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C +#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D +#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E +#define AL_EAXREVERB_ECHO_TIME 0x000F +#define AL_EAXREVERB_ECHO_DEPTH 0x0010 +#define AL_EAXREVERB_MODULATION_TIME 0x0011 +#define AL_EAXREVERB_MODULATION_DEPTH 0x0012 +#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013 +#define AL_EAXREVERB_HFREFERENCE 0x0014 +#define AL_EAXREVERB_LFREFERENCE 0x0015 +#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016 +#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017 + +/* Chorus effect parameters */ +#define AL_CHORUS_WAVEFORM 0x0001 +#define AL_CHORUS_PHASE 0x0002 +#define AL_CHORUS_RATE 0x0003 +#define AL_CHORUS_DEPTH 0x0004 +#define AL_CHORUS_FEEDBACK 0x0005 +#define AL_CHORUS_DELAY 0x0006 + +/* Distortion effect parameters */ +#define AL_DISTORTION_EDGE 0x0001 +#define AL_DISTORTION_GAIN 0x0002 +#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003 +#define AL_DISTORTION_EQCENTER 0x0004 +#define AL_DISTORTION_EQBANDWIDTH 0x0005 + +/* Echo effect parameters */ +#define AL_ECHO_DELAY 0x0001 +#define AL_ECHO_LRDELAY 0x0002 +#define AL_ECHO_DAMPING 0x0003 +#define AL_ECHO_FEEDBACK 0x0004 +#define AL_ECHO_SPREAD 0x0005 + +/* Flanger effect parameters */ +#define AL_FLANGER_WAVEFORM 0x0001 +#define AL_FLANGER_PHASE 0x0002 +#define AL_FLANGER_RATE 0x0003 +#define AL_FLANGER_DEPTH 0x0004 +#define AL_FLANGER_FEEDBACK 0x0005 +#define AL_FLANGER_DELAY 0x0006 + +/* Frequency shifter effect parameters */ +#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001 +#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002 +#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003 + +/* Vocal morpher effect parameters */ +#define AL_VOCAL_MORPHER_PHONEMEA 0x0001 +#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002 +#define AL_VOCAL_MORPHER_PHONEMEB 0x0003 +#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004 +#define AL_VOCAL_MORPHER_WAVEFORM 0x0005 +#define AL_VOCAL_MORPHER_RATE 0x0006 + +/* Pitchshifter effect parameters */ +#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001 +#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002 + +/* Ringmodulator effect parameters */ +#define AL_RING_MODULATOR_FREQUENCY 0x0001 +#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002 +#define AL_RING_MODULATOR_WAVEFORM 0x0003 + +/* Autowah effect parameters */ +#define AL_AUTOWAH_ATTACK_TIME 0x0001 +#define AL_AUTOWAH_RELEASE_TIME 0x0002 +#define AL_AUTOWAH_RESONANCE 0x0003 +#define AL_AUTOWAH_PEAK_GAIN 0x0004 + +/* Compressor effect parameters */ +#define AL_COMPRESSOR_ONOFF 0x0001 + +/* Equalizer effect parameters */ +#define AL_EQUALIZER_LOW_GAIN 0x0001 +#define AL_EQUALIZER_LOW_CUTOFF 0x0002 +#define AL_EQUALIZER_MID1_GAIN 0x0003 +#define AL_EQUALIZER_MID1_CENTER 0x0004 +#define AL_EQUALIZER_MID1_WIDTH 0x0005 +#define AL_EQUALIZER_MID2_GAIN 0x0006 +#define AL_EQUALIZER_MID2_CENTER 0x0007 +#define AL_EQUALIZER_MID2_WIDTH 0x0008 +#define AL_EQUALIZER_HIGH_GAIN 0x0009 +#define AL_EQUALIZER_HIGH_CUTOFF 0x000A + +/* Effect type */ +#define AL_EFFECT_FIRST_PARAMETER 0x0000 +#define AL_EFFECT_LAST_PARAMETER 0x8000 +#define AL_EFFECT_TYPE 0x8001 + +/* Effect types, used with the AL_EFFECT_TYPE property */ +#define AL_EFFECT_NULL 0x0000 +#define AL_EFFECT_REVERB 0x0001 +#define AL_EFFECT_CHORUS 0x0002 +#define AL_EFFECT_DISTORTION 0x0003 +#define AL_EFFECT_ECHO 0x0004 +#define AL_EFFECT_FLANGER 0x0005 +#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006 +#define AL_EFFECT_VOCAL_MORPHER 0x0007 +#define AL_EFFECT_PITCH_SHIFTER 0x0008 +#define AL_EFFECT_RING_MODULATOR 0x0009 +#define AL_EFFECT_AUTOWAH 0x000A +#define AL_EFFECT_COMPRESSOR 0x000B +#define AL_EFFECT_EQUALIZER 0x000C +#define AL_EFFECT_EAXREVERB 0x8000 + +/* Auxiliary Effect Slot properties. */ +#define AL_EFFECTSLOT_EFFECT 0x0001 +#define AL_EFFECTSLOT_GAIN 0x0002 +#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003 + +/* NULL Auxiliary Slot ID to disable a source send. */ +#define AL_EFFECTSLOT_NULL 0x0000 + + +/* Filter properties. */ + +/* Lowpass filter parameters */ +#define AL_LOWPASS_GAIN 0x0001 +#define AL_LOWPASS_GAINHF 0x0002 + +/* Highpass filter parameters */ +#define AL_HIGHPASS_GAIN 0x0001 +#define AL_HIGHPASS_GAINLF 0x0002 + +/* Bandpass filter parameters */ +#define AL_BANDPASS_GAIN 0x0001 +#define AL_BANDPASS_GAINLF 0x0002 +#define AL_BANDPASS_GAINHF 0x0003 + +/* Filter type */ +#define AL_FILTER_FIRST_PARAMETER 0x0000 +#define AL_FILTER_LAST_PARAMETER 0x8000 +#define AL_FILTER_TYPE 0x8001 + +/* Filter types, used with the AL_FILTER_TYPE property */ +#define AL_FILTER_NULL 0x0000 +#define AL_FILTER_LOWPASS 0x0001 +#define AL_FILTER_HIGHPASS 0x0002 +#define AL_FILTER_BANDPASS 0x0003 + + +/* Effect object function types. */ +typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint); +typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*); + +/* Filter object function types. */ +typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint); +typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*); + +/* Auxiliary Effect Slot object function types. */ +typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); + +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); +AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects); +AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect); +AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); +AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters); +AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter); +AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); +AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); +AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); +#endif + +/* Filter ranges and defaults. */ + +/* Lowpass filter */ +#define LOWPASS_MIN_GAIN (0.0f) +#define LOWPASS_MAX_GAIN (1.0f) +#define LOWPASS_DEFAULT_GAIN (1.0f) + +#define LOWPASS_MIN_GAINHF (0.0f) +#define LOWPASS_MAX_GAINHF (1.0f) +#define LOWPASS_DEFAULT_GAINHF (1.0f) + +/* Highpass filter */ +#define HIGHPASS_MIN_GAIN (0.0f) +#define HIGHPASS_MAX_GAIN (1.0f) +#define HIGHPASS_DEFAULT_GAIN (1.0f) + +#define HIGHPASS_MIN_GAINLF (0.0f) +#define HIGHPASS_MAX_GAINLF (1.0f) +#define HIGHPASS_DEFAULT_GAINLF (1.0f) + +/* Bandpass filter */ +#define BANDPASS_MIN_GAIN (0.0f) +#define BANDPASS_MAX_GAIN (1.0f) +#define BANDPASS_DEFAULT_GAIN (1.0f) + +#define BANDPASS_MIN_GAINHF (0.0f) +#define BANDPASS_MAX_GAINHF (1.0f) +#define BANDPASS_DEFAULT_GAINHF (1.0f) + +#define BANDPASS_MIN_GAINLF (0.0f) +#define BANDPASS_MAX_GAINLF (1.0f) +#define BANDPASS_DEFAULT_GAINLF (1.0f) + + +/* Effect parameter ranges and defaults. */ + +/* Standard reverb effect */ +#define AL_REVERB_MIN_DENSITY (0.0f) +#define AL_REVERB_MAX_DENSITY (1.0f) +#define AL_REVERB_DEFAULT_DENSITY (1.0f) + +#define AL_REVERB_MIN_DIFFUSION (0.0f) +#define AL_REVERB_MAX_DIFFUSION (1.0f) +#define AL_REVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_REVERB_MIN_GAIN (0.0f) +#define AL_REVERB_MAX_GAIN (1.0f) +#define AL_REVERB_DEFAULT_GAIN (0.32f) + +#define AL_REVERB_MIN_GAINHF (0.0f) +#define AL_REVERB_MAX_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_GAINHF (0.89f) + +#define AL_REVERB_MIN_DECAY_TIME (0.1f) +#define AL_REVERB_MAX_DECAY_TIME (20.0f) +#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* EAX reverb effect */ +#define AL_EAXREVERB_MIN_DENSITY (0.0f) +#define AL_EAXREVERB_MAX_DENSITY (1.0f) +#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f) + +#define AL_EAXREVERB_MIN_DIFFUSION (0.0f) +#define AL_EAXREVERB_MAX_DIFFUSION (1.0f) +#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_EAXREVERB_MIN_GAIN (0.0f) +#define AL_EAXREVERB_MAX_GAIN (1.0f) +#define AL_EAXREVERB_DEFAULT_GAIN (0.32f) + +#define AL_EAXREVERB_MIN_GAINHF (0.0f) +#define AL_EAXREVERB_MAX_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f) + +#define AL_EAXREVERB_MIN_GAINLF (0.0f) +#define AL_EAXREVERB_MAX_GAINLF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f) + +#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f) +#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f) +#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f) +#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f) + +#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f) +#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f) + +#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f) +#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f) +#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f) + +#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f) +#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f) +#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f) + +#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* Chorus effect */ +#define AL_CHORUS_WAVEFORM_SINUSOID (0) +#define AL_CHORUS_WAVEFORM_TRIANGLE (1) + +#define AL_CHORUS_MIN_WAVEFORM (0) +#define AL_CHORUS_MAX_WAVEFORM (1) +#define AL_CHORUS_DEFAULT_WAVEFORM (1) + +#define AL_CHORUS_MIN_PHASE (-180) +#define AL_CHORUS_MAX_PHASE (180) +#define AL_CHORUS_DEFAULT_PHASE (90) + +#define AL_CHORUS_MIN_RATE (0.0f) +#define AL_CHORUS_MAX_RATE (10.0f) +#define AL_CHORUS_DEFAULT_RATE (1.1f) + +#define AL_CHORUS_MIN_DEPTH (0.0f) +#define AL_CHORUS_MAX_DEPTH (1.0f) +#define AL_CHORUS_DEFAULT_DEPTH (0.1f) + +#define AL_CHORUS_MIN_FEEDBACK (-1.0f) +#define AL_CHORUS_MAX_FEEDBACK (1.0f) +#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f) + +#define AL_CHORUS_MIN_DELAY (0.0f) +#define AL_CHORUS_MAX_DELAY (0.016f) +#define AL_CHORUS_DEFAULT_DELAY (0.016f) + +/* Distortion effect */ +#define AL_DISTORTION_MIN_EDGE (0.0f) +#define AL_DISTORTION_MAX_EDGE (1.0f) +#define AL_DISTORTION_DEFAULT_EDGE (0.2f) + +#define AL_DISTORTION_MIN_GAIN (0.01f) +#define AL_DISTORTION_MAX_GAIN (1.0f) +#define AL_DISTORTION_DEFAULT_GAIN (0.05f) + +#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f) +#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f) +#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f) + +#define AL_DISTORTION_MIN_EQCENTER (80.0f) +#define AL_DISTORTION_MAX_EQCENTER (24000.0f) +#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f) + +#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f) +#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f) +#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f) + +/* Echo effect */ +#define AL_ECHO_MIN_DELAY (0.0f) +#define AL_ECHO_MAX_DELAY (0.207f) +#define AL_ECHO_DEFAULT_DELAY (0.1f) + +#define AL_ECHO_MIN_LRDELAY (0.0f) +#define AL_ECHO_MAX_LRDELAY (0.404f) +#define AL_ECHO_DEFAULT_LRDELAY (0.1f) + +#define AL_ECHO_MIN_DAMPING (0.0f) +#define AL_ECHO_MAX_DAMPING (0.99f) +#define AL_ECHO_DEFAULT_DAMPING (0.5f) + +#define AL_ECHO_MIN_FEEDBACK (0.0f) +#define AL_ECHO_MAX_FEEDBACK (1.0f) +#define AL_ECHO_DEFAULT_FEEDBACK (0.5f) + +#define AL_ECHO_MIN_SPREAD (-1.0f) +#define AL_ECHO_MAX_SPREAD (1.0f) +#define AL_ECHO_DEFAULT_SPREAD (-1.0f) + +/* Flanger effect */ +#define AL_FLANGER_WAVEFORM_SINUSOID (0) +#define AL_FLANGER_WAVEFORM_TRIANGLE (1) + +#define AL_FLANGER_MIN_WAVEFORM (0) +#define AL_FLANGER_MAX_WAVEFORM (1) +#define AL_FLANGER_DEFAULT_WAVEFORM (1) + +#define AL_FLANGER_MIN_PHASE (-180) +#define AL_FLANGER_MAX_PHASE (180) +#define AL_FLANGER_DEFAULT_PHASE (0) + +#define AL_FLANGER_MIN_RATE (0.0f) +#define AL_FLANGER_MAX_RATE (10.0f) +#define AL_FLANGER_DEFAULT_RATE (0.27f) + +#define AL_FLANGER_MIN_DEPTH (0.0f) +#define AL_FLANGER_MAX_DEPTH (1.0f) +#define AL_FLANGER_DEFAULT_DEPTH (1.0f) + +#define AL_FLANGER_MIN_FEEDBACK (-1.0f) +#define AL_FLANGER_MAX_FEEDBACK (1.0f) +#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f) + +#define AL_FLANGER_MIN_DELAY (0.0f) +#define AL_FLANGER_MAX_DELAY (0.004f) +#define AL_FLANGER_DEFAULT_DELAY (0.002f) + +/* Frequency shifter effect */ +#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f) +#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f) +#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f) + +#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0) + +#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0) +#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1) +#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2) + +#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0) + +/* Vocal morpher effect */ +#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_PHONEME_A (0) +#define AL_VOCAL_MORPHER_PHONEME_E (1) +#define AL_VOCAL_MORPHER_PHONEME_I (2) +#define AL_VOCAL_MORPHER_PHONEME_O (3) +#define AL_VOCAL_MORPHER_PHONEME_U (4) +#define AL_VOCAL_MORPHER_PHONEME_AA (5) +#define AL_VOCAL_MORPHER_PHONEME_AE (6) +#define AL_VOCAL_MORPHER_PHONEME_AH (7) +#define AL_VOCAL_MORPHER_PHONEME_AO (8) +#define AL_VOCAL_MORPHER_PHONEME_EH (9) +#define AL_VOCAL_MORPHER_PHONEME_ER (10) +#define AL_VOCAL_MORPHER_PHONEME_IH (11) +#define AL_VOCAL_MORPHER_PHONEME_IY (12) +#define AL_VOCAL_MORPHER_PHONEME_UH (13) +#define AL_VOCAL_MORPHER_PHONEME_UW (14) +#define AL_VOCAL_MORPHER_PHONEME_B (15) +#define AL_VOCAL_MORPHER_PHONEME_D (16) +#define AL_VOCAL_MORPHER_PHONEME_F (17) +#define AL_VOCAL_MORPHER_PHONEME_G (18) +#define AL_VOCAL_MORPHER_PHONEME_J (19) +#define AL_VOCAL_MORPHER_PHONEME_K (20) +#define AL_VOCAL_MORPHER_PHONEME_L (21) +#define AL_VOCAL_MORPHER_PHONEME_M (22) +#define AL_VOCAL_MORPHER_PHONEME_N (23) +#define AL_VOCAL_MORPHER_PHONEME_P (24) +#define AL_VOCAL_MORPHER_PHONEME_R (25) +#define AL_VOCAL_MORPHER_PHONEME_S (26) +#define AL_VOCAL_MORPHER_PHONEME_T (27) +#define AL_VOCAL_MORPHER_PHONEME_V (28) +#define AL_VOCAL_MORPHER_PHONEME_Z (29) + +#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0) +#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1) +#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2) + +#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0) +#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2) +#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0) + +#define AL_VOCAL_MORPHER_MIN_RATE (0.0f) +#define AL_VOCAL_MORPHER_MAX_RATE (10.0f) +#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f) + +/* Pitch shifter effect */ +#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12) +#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12) +#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12) + +#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50) +#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50) +#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0) + +/* Ring modulator effect */ +#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f) +#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f) +#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f) + +#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f) +#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f) +#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f) + +#define AL_RING_MODULATOR_SINUSOID (0) +#define AL_RING_MODULATOR_SAWTOOTH (1) +#define AL_RING_MODULATOR_SQUARE (2) + +#define AL_RING_MODULATOR_MIN_WAVEFORM (0) +#define AL_RING_MODULATOR_MAX_WAVEFORM (2) +#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0) + +/* Autowah effect */ +#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f) +#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f) +#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RESONANCE (2.0f) +#define AL_AUTOWAH_MAX_RESONANCE (1000.0f) +#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f) + +#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f) +#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f) +#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f) + +/* Compressor effect */ +#define AL_COMPRESSOR_MIN_ONOFF (0) +#define AL_COMPRESSOR_MAX_ONOFF (1) +#define AL_COMPRESSOR_DEFAULT_ONOFF (1) + +/* Equalizer effect */ +#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f) +#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f) +#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f) +#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f) + +#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f) +#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f) +#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f) + +#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f) +#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f) +#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f) + +#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f) +#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f) +#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f) +#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f) + + +/* Source parameter value ranges and defaults. */ +#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f) +#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f) +#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f) + +#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_MIN_CONE_OUTER_GAINHF (0.0f) +#define AL_MAX_CONE_OUTER_GAINHF (1.0f) +#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f) + +#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE + + +/* Listener parameter value ranges and defaults. */ +#define AL_MIN_METERS_PER_UNIT FLT_MIN +#define AL_MAX_METERS_PER_UNIT FLT_MAX +#define AL_DEFAULT_METERS_PER_UNIT (1.0f) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* AL_EFX_H */ diff --git a/src/android/jni/include/AL/oalMacOSX_OALExtensions.h b/src/android/jni/include/AL/oalMacOSX_OALExtensions.h new file mode 100644 index 00000000..c3db3054 --- /dev/null +++ b/src/android/jni/include/AL/oalMacOSX_OALExtensions.h @@ -0,0 +1,161 @@ +/********************************************************************************************************************************** +* +* OpenAL cross platform audio library +* Copyright (c) 2004-2006, Apple Computer, Inc. All rights reserved. +* Copyright (c) 2007-2008, Apple Inc. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following +* conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following +* disclaimer in the documentation and/or other materials provided with the distribution. +* 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +**********************************************************************************************************************************/ + +#ifndef __OAL_MAC_OSX_OAL_EXTENSIONS_H__ +#define __OAL_MAC_OSX_OAL_EXTENSIONS_H__ + +#include + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ALC_EXT_MAC_OSX + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +// Retrieve functions via alGetProcAddress() by passing in strings: alcMacOSXMixerOutputRate or alcMacOSXGetMixerOutputRate + +// Setting the Mixer Output Rate effectively sets the samnple rate at which the mixer +typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (ALint value); +typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (ALint value); +typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (ALint value); +typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (ALdouble value); + +typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) (); +typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) (); +typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) (); +typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) (); + +/* Render Quality. Used with alcMacOSXRenderingQuality() */ + + #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi' + #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo' + + // High Quality Spatial Algorithm suitable only for headphone use + #define ALC_IPHONE_SPATIAL_RENDERING_QUALITY_HEADPHONES 'hdph' + +/* + Render Channels. Used with alMacOSXRenderChannelCount() + Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used +*/ + #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst' + +/* GameKit extension */ + + #define AL_GAMEKIT 'gksr' + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + AL_EXT_SOURCE_NOTIFICATIONS + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* + Source Notifications + + Eliminates the need for continuous polling for source state by providing a + mechanism for the application to receive source state change notifications. + Upon receiving a notification, the application can retrieve the actual state + corresponding to the notification ID for which the notification was sent. + */ + +#define AL_QUEUE_HAS_LOOPED 0x9000 + +/* + Notification Proc: ALSourceNotificationProc + + sid - source id + notificationID - id of state that has changed + userData - user data provided to alSourceAddNotification() + */ + +typedef ALvoid (*alSourceNotificationProc)(ALuint sid, ALuint notificationID, ALvoid* userData); + +/* + API: alSourceAddNotification + + sid - source id + notificationID - id of state for which caller wants to be notified of a change + notifyProc - notification proc + userData - ptr to applications user data, will be returned in the notification proc + + Returns AL_NO_ERROR if request is successful. + + Valid IDs: + AL_SOURCE_STATE + AL_BUFFERS_PROCESSED + AL_QUEUE_HAS_LOOPED - notification sent when a looping source has looped to it's start point + */ +typedef ALenum (*alSourceAddNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData); + +/* + API: alSourceRemoveStateNotification + + sid - source id + notificationID - id of state for which caller wants to remove an existing notification + notifyProc - notification proc + userData - ptr to applications user data, will be returned in the notification proc + */ +typedef ALvoid (*alSourceRemoveNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData); + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ALC_EXT_ASA : Apple Spatial Audio Extension + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* + Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener() +*/ + +typedef ALenum (*alcASAGetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint* dataSize); +typedef ALenum (*alcASASetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint dataSize); +typedef ALenum (*alcASAGetListenerProcPtr) (ALuint property, ALvoid *data, ALuint* dataSize); +typedef ALenum (*alcASASetListenerProcPtr) (ALuint property, ALvoid *data, ALuint dataSize); + + /* listener properties */ + #define ALC_ASA_REVERB_ON 'rvon' // type ALuint + #define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db + + #define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint + + /* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */ + #define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0 + #define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1 + #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2 + #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3 + #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4 + #define ALC_ASA_REVERB_ROOM_TYPE_Plate 5 + #define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6 + #define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7 + #define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8 + #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9 + #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10 + #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11 + #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12 + + #define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat + #define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat + #define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat + + /* source properties */ + #define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default) + #define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default) + #define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default) + +#endif // __OAL_MAC_OSX_OAL_EXTENSIONS_H__ diff --git a/src/android/jni/include/AL/oalStaticBufferExtension.h b/src/android/jni/include/AL/oalStaticBufferExtension.h new file mode 100644 index 00000000..e69de29b diff --git a/src/android/jni/include/android_native_app_glue.h b/src/android/jni/include/android_native_app_glue.h new file mode 100644 index 00000000..1b8c1f10 --- /dev/null +++ b/src/android/jni/include/android_native_app_glue.h @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef _ANDROID_NATIVE_APP_GLUE_H +#define _ANDROID_NATIVE_APP_GLUE_H + +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The native activity interface provided by + * is based on a set of application-provided callbacks that will be called + * by the Activity's main thread when certain events occur. + * + * This means that each one of this callbacks _should_ _not_ block, or they + * risk having the system force-close the application. This programming + * model is direct, lightweight, but constraining. + * + * The 'threaded_native_app' static library is used to provide a different + * execution model where the application can implement its own main event + * loop in a different thread instead. Here's how it works: + * + * 1/ The application must provide a function named "android_main()" that + * will be called when the activity is created, in a new thread that is + * distinct from the activity's main thread. + * + * 2/ android_main() receives a pointer to a valid "android_app" structure + * that contains references to other important objects, e.g. the + * ANativeActivity obejct instance the application is running in. + * + * 3/ the "android_app" object holds an ALooper instance that already + * listens to two important things: + * + * - activity lifecycle events (e.g. "pause", "resume"). See APP_CMD_XXX + * declarations below. + * + * - input events coming from the AInputQueue attached to the activity. + * + * Each of these correspond to an ALooper identifier returned by + * ALooper_pollOnce with values of LOOPER_ID_MAIN and LOOPER_ID_INPUT, + * respectively. + * + * Your application can use the same ALooper to listen to additional + * file-descriptors. They can either be callback based, or with return + * identifiers starting with LOOPER_ID_USER. + * + * 4/ Whenever you receive a LOOPER_ID_MAIN or LOOPER_ID_INPUT event, + * the returned data will point to an android_poll_source structure. You + * can call the process() function on it, and fill in android_app->onAppCmd + * and android_app->onInputEvent to be called for your own processing + * of the event. + * + * Alternatively, you can call the low-level functions to read and process + * the data directly... look at the process_cmd() and process_input() + * implementations in the glue to see how to do this. + * + * See the sample named "native-activity" that comes with the NDK with a + * full usage example. Also look at the JavaDoc of NativeActivity. + */ + +struct android_app; + +/** + * Data associated with an ALooper fd that will be returned as the "outData" + * when that source has data ready. + */ +struct android_poll_source { + // The identifier of this source. May be LOOPER_ID_MAIN or + // LOOPER_ID_INPUT. + int32_t id; + + // The android_app this ident is associated with. + struct android_app* app; + + // Function to call to perform the standard processing of data from + // this source. + void (*process)(struct android_app* app, struct android_poll_source* source); +}; + +/** + * This is the interface for the standard glue code of a threaded + * application. In this model, the application's code is running + * in its own thread separate from the main thread of the process. + * It is not required that this thread be associated with the Java + * VM, although it will need to be in order to make JNI calls any + * Java objects. + */ +struct android_app { + // The application can place a pointer to its own state object + // here if it likes. + void* userData; + + // Fill this in with the function to process main app commands (APP_CMD_*) + void (*onAppCmd)(struct android_app* app, int32_t cmd); + + // Fill this in with the function to process input events. At this point + // the event has already been pre-dispatched, and it will be finished upon + // return. Return 1 if you have handled the event, 0 for any default + // dispatching. + int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event); + + // The ANativeActivity object instance that this app is running in. + ANativeActivity* activity; + + // The current configuration the app is running in. + AConfiguration* config; + + // This is the last instance's saved state, as provided at creation time. + // It is NULL if there was no state. You can use this as you need; the + // memory will remain around until you call android_app_exec_cmd() for + // APP_CMD_RESUME, at which point it will be freed and savedState set to NULL. + // These variables should only be changed when processing a APP_CMD_SAVE_STATE, + // at which point they will be initialized to NULL and you can malloc your + // state and place the information here. In that case the memory will be + // freed for you later. + void* savedState; + size_t savedStateSize; + + // The ALooper associated with the app's thread. + ALooper* looper; + + // When non-NULL, this is the input queue from which the app will + // receive user input events. + AInputQueue* inputQueue; + + // When non-NULL, this is the window surface that the app can draw in. + ANativeWindow* window; + + // Current content rectangle of the window; this is the area where the + // window's content should be placed to be seen by the user. + ARect contentRect; + + // Current state of the app's activity. May be either APP_CMD_START, + // APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below. + int activityState; + + // This is non-zero when the application's NativeActivity is being + // destroyed and waiting for the app thread to complete. + int destroyRequested; + + // ------------------------------------------------- + // Below are "private" implementation of the glue code. + + pthread_mutex_t mutex; + pthread_cond_t cond; + + int msgread; + int msgwrite; + + pthread_t thread; + + struct android_poll_source cmdPollSource; + struct android_poll_source inputPollSource; + + int running; + int stateSaved; + int destroyed; + int redrawNeeded; + AInputQueue* pendingInputQueue; + ANativeWindow* pendingWindow; + ARect pendingContentRect; +}; + +enum { + /** + * Looper data ID of commands coming from the app's main thread, which + * is returned as an identifier from ALooper_pollOnce(). The data for this + * identifier is a pointer to an android_poll_source structure. + * These can be retrieved and processed with android_app_read_cmd() + * and android_app_exec_cmd(). + */ + LOOPER_ID_MAIN = 1, + + /** + * Looper data ID of events coming from the AInputQueue of the + * application's window, which is returned as an identifier from + * ALooper_pollOnce(). The data for this identifier is a pointer to an + * android_poll_source structure. These can be read via the inputQueue + * object of android_app. + */ + LOOPER_ID_INPUT = 2, + + /** + * Start of user-defined ALooper identifiers. + */ + LOOPER_ID_USER = 3, +}; + +enum { + /** + * Command from main thread: the AInputQueue has changed. Upon processing + * this command, android_app->inputQueue will be updated to the new queue + * (or NULL). + */ + APP_CMD_INPUT_CHANGED, + + /** + * Command from main thread: a new ANativeWindow is ready for use. Upon + * receiving this command, android_app->window will contain the new window + * surface. + */ + APP_CMD_INIT_WINDOW, + + /** + * Command from main thread: the existing ANativeWindow needs to be + * terminated. Upon receiving this command, android_app->window still + * contains the existing window; after calling android_app_exec_cmd + * it will be set to NULL. + */ + APP_CMD_TERM_WINDOW, + + /** + * Command from main thread: the current ANativeWindow has been resized. + * Please redraw with its new size. + */ + APP_CMD_WINDOW_RESIZED, + + /** + * Command from main thread: the system needs that the current ANativeWindow + * be redrawn. You should redraw the window before handing this to + * android_app_exec_cmd() in order to avoid transient drawing glitches. + */ + APP_CMD_WINDOW_REDRAW_NEEDED, + + /** + * Command from main thread: the content area of the window has changed, + * such as from the soft input window being shown or hidden. You can + * find the new content rect in android_app::contentRect. + */ + APP_CMD_CONTENT_RECT_CHANGED, + + /** + * Command from main thread: the app's activity window has gained + * input focus. + */ + APP_CMD_GAINED_FOCUS, + + /** + * Command from main thread: the app's activity window has lost + * input focus. + */ + APP_CMD_LOST_FOCUS, + + /** + * Command from main thread: the current device configuration has changed. + */ + APP_CMD_CONFIG_CHANGED, + + /** + * Command from main thread: the system is running low on memory. + * Try to reduce your memory use. + */ + APP_CMD_LOW_MEMORY, + + /** + * Command from main thread: the app's activity has been started. + */ + APP_CMD_START, + + /** + * Command from main thread: the app's activity has been resumed. + */ + APP_CMD_RESUME, + + /** + * Command from main thread: the app should generate a new saved state + * for itself, to restore from later if needed. If you have saved state, + * allocate it with malloc and place it in android_app.savedState with + * the size in android_app.savedStateSize. The will be freed for you + * later. + */ + APP_CMD_SAVE_STATE, + + /** + * Command from main thread: the app's activity has been paused. + */ + APP_CMD_PAUSE, + + /** + * Command from main thread: the app's activity has been stopped. + */ + APP_CMD_STOP, + + /** + * Command from main thread: the app's activity is being destroyed, + * and waiting for the app thread to clean up and exit before proceeding. + */ + APP_CMD_DESTROY, +}; + +/** + * Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next + * app command message. + */ +int8_t android_app_read_cmd(struct android_app* android_app); + +/** + * Call with the command returned by android_app_read_cmd() to do the + * initial pre-processing of the given command. You can perform your own + * actions for the command after calling this function. + */ +void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd); + +/** + * Call with the command returned by android_app_read_cmd() to do the + * final post-processing of the given command. You must have done your own + * actions for the command before calling this function. + */ +void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd); + +/** + * Dummy function you can call to ensure glue code isn't stripped. + */ +void app_dummy(); + +/** + * This is the function that application code must implement, representing + * the main entry to the app. + */ +extern void android_main(struct android_app* app); + +#ifdef __cplusplus +} +#endif + +#endif /* _ANDROID_NATIVE_APP_GLUE_H */ -- cgit v1.2.3 From 29d505c98e6b24882927347cf24f5736d5f8c849 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 14:34:43 +0200 Subject: Reorganize external libraries - BREAKING CHANGE - Moved all external libraries used by raylib to external folder inside raylib src. Makefile has already been update and also the different includes in raylib modules. --- src/Makefile | 30 +- src/audio.c | 6 +- src/core.c | 4 +- src/external/glad.c | 7684 ++++++++++ src/external/glad.h | 14241 +++++++++++++++++++ src/external/glfw3/COPYING.txt | 21 + src/external/glfw3/include/GLFW/glfw3.h | 3355 +++++ src/external/glfw3/include/GLFW/glfw3native.h | 356 + src/external/glfw3/lib/linux/libglfw3.a | Bin 0 -> 176482 bytes src/external/glfw3/lib/osx/libglfw.3.0.dylib | Bin 0 -> 127856 bytes src/external/glfw3/lib/osx/libglfw.3.dylib | 1 + src/external/glfw3/lib/osx/libglfw.dylib | 1 + src/external/glfw3/lib/win32/libglfw3.a | Bin 0 -> 83834 bytes src/external/glfw3/lib/win32/libglfw3dll.a | Bin 0 -> 54834 bytes src/external/jar_mod.h | 1587 +++ src/external/jar_xm.h | 2666 ++++ src/external/openal_soft/COPYING | 484 + src/external/openal_soft/include/AL/al.h | 656 + src/external/openal_soft/include/AL/alc.h | 237 + src/external/openal_soft/include/AL/alext.h | 438 + src/external/openal_soft/include/AL/efx-creative.h | 3 + src/external/openal_soft/include/AL/efx-presets.h | 402 + src/external/openal_soft/include/AL/efx.h | 761 + .../openal_soft/lib/win32/libOpenAL32.dll.a | Bin 0 -> 100246 bytes src/external/stb_image.h | 6763 +++++++++ src/external/stb_image_resize.h | 2578 ++++ src/external/stb_image_write.h | 1048 ++ src/external/stb_rect_pack.h | 572 + src/external/stb_truetype.h | 3267 +++++ src/external/stb_vorbis.c | 5010 +++++++ src/external/stb_vorbis.h | 393 + src/external/tinfl.c | 592 + src/glad.c | 7684 ---------- src/glad.h | 14241 ------------------- src/jar_mod.h | 1587 --- src/jar_xm.h | 2666 ---- src/libraylib.bc | Bin 603552 -> 710808 bytes src/rlgl.c | 2 +- src/stb_image.h | 6763 --------- src/stb_image_resize.h | 2578 ---- src/stb_image_write.h | 1048 -- src/stb_rect_pack.h | 572 - src/stb_truetype.h | 3267 ----- src/stb_vorbis.c | 5010 ------- src/stb_vorbis.h | 393 - src/text.c | 2 +- src/textures.c | 6 +- src/tinfl.c | 592 - src/utils.c | 5 +- 49 files changed, 53144 insertions(+), 46428 deletions(-) create mode 100644 src/external/glad.c create mode 100644 src/external/glad.h create mode 100644 src/external/glfw3/COPYING.txt create mode 100644 src/external/glfw3/include/GLFW/glfw3.h create mode 100644 src/external/glfw3/include/GLFW/glfw3native.h create mode 100644 src/external/glfw3/lib/linux/libglfw3.a create mode 100644 src/external/glfw3/lib/osx/libglfw.3.0.dylib create mode 100644 src/external/glfw3/lib/osx/libglfw.3.dylib create mode 100644 src/external/glfw3/lib/osx/libglfw.dylib create mode 100644 src/external/glfw3/lib/win32/libglfw3.a create mode 100644 src/external/glfw3/lib/win32/libglfw3dll.a create mode 100644 src/external/jar_mod.h create mode 100644 src/external/jar_xm.h create mode 100644 src/external/openal_soft/COPYING create mode 100644 src/external/openal_soft/include/AL/al.h create mode 100644 src/external/openal_soft/include/AL/alc.h create mode 100644 src/external/openal_soft/include/AL/alext.h create mode 100644 src/external/openal_soft/include/AL/efx-creative.h create mode 100644 src/external/openal_soft/include/AL/efx-presets.h create mode 100644 src/external/openal_soft/include/AL/efx.h create mode 100644 src/external/openal_soft/lib/win32/libOpenAL32.dll.a create mode 100644 src/external/stb_image.h create mode 100644 src/external/stb_image_resize.h create mode 100644 src/external/stb_image_write.h create mode 100644 src/external/stb_rect_pack.h create mode 100644 src/external/stb_truetype.h create mode 100644 src/external/stb_vorbis.c create mode 100644 src/external/stb_vorbis.h create mode 100644 src/external/tinfl.c delete mode 100644 src/glad.c delete mode 100644 src/glad.h delete mode 100644 src/jar_mod.h delete mode 100644 src/jar_xm.h delete mode 100644 src/stb_image.h delete mode 100644 src/stb_image_resize.h delete mode 100644 src/stb_image_write.h delete mode 100644 src/stb_rect_pack.h delete mode 100644 src/stb_truetype.h delete mode 100644 src/stb_vorbis.c delete mode 100644 src/stb_vorbis.h delete mode 100644 src/tinfl.c (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 244675e2..7f15bd2f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -81,14 +81,14 @@ CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces # define any directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads + INCLUDES = -I. -Iexternal -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads else - INCLUDES = -I. -I../src -# external libraries headers -# GLFW3 - INCLUDES += -I../external/glfw3/include -# OpenAL Soft - INCLUDES += -I../external/openal_soft/include +# STB libraries and others + INCLUDES = -I. -Iexternal +# GLFW3 library + INCLUDES += -Iexternal/glfw3/include +# OpenAL Soft library + INCLUDES += -Iexternal/openal_soft/include endif # define all object files required @@ -121,10 +121,6 @@ core.o: core.c rlgl.o: rlgl.c $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) -# compile glad module -glad.o: glad.c - $(CC) -c glad.c $(CFLAGS) $(INCLUDES) - # compile shapes module shapes.o: shapes.c $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) @@ -145,10 +141,6 @@ models.o: models.c audio.o: audio.c $(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -# compile stb_vorbis library -stb_vorbis.o: stb_vorbis.c - $(CC) -c stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) - # compile utils module utils.o: utils.c $(CC) -c utils.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) @@ -161,6 +153,14 @@ camera.o: camera.c gestures.o: gestures.c $(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +# compile glad module +glad.o: external/glad.c + $(CC) -c external/glad.c $(CFLAGS) $(INCLUDES) + +# compile stb_vorbis library +stb_vorbis.o: external/stb_vorbis.c + $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) + # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) diff --git a/src/audio.c b/src/audio.c index b5514b12..ad1d7eba 100644 --- a/src/audio.c +++ b/src/audio.c @@ -51,13 +51,13 @@ #endif //#define STB_VORBIS_HEADER_ONLY -#include "stb_vorbis.h" // OGG loading functions +#include "external/stb_vorbis.h" // OGG loading functions #define JAR_XM_IMPLEMENTATION -#include "jar_xm.h" // XM loading functions +#include "external/jar_xm.h" // XM loading functions #define JAR_MOD_IMPLEMENTATION -#include "jar_mod.h" // MOD loading functions +#include "external/jar_mod.h" // MOD loading functions //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/core.c b/src/core.c index d229e1f8..4ba7505b 100644 --- a/src/core.c +++ b/src/core.c @@ -55,11 +55,11 @@ #include // Macros for reporting and retrieving error conditions through error codes #if defined(PLATFORM_OCULUS) - #define PLATFORM_DESKTOP // Enable PLATFORM_DESKTOP code-base + #define PLATFORM_DESKTOP // Enable PLATFORM_DESKTOP code-base #endif #if defined(PLATFORM_DESKTOP) - #include "glad.h" // GLAD library: Manage OpenGL headers and extensions + #include "external/glad.h" // GLAD library: Manage OpenGL headers and extensions #endif #if defined(PLATFORM_OCULUS) diff --git a/src/external/glad.c b/src/external/glad.c new file mode 100644 index 00000000..aace05a7 --- /dev/null +++ b/src/external/glad.c @@ -0,0 +1,7684 @@ +/* + + OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=3.3 + Profile: core + Extensions: + GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control + Loader: No + + Commandline: + --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" + Online: + Too many extensions +*/ + +#include +#include +#include +#include "glad.h" + +struct gladGLversionStruct GLVersion; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static const char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < num_exts_i; index++) { + exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + free(exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_1_0; +int GLAD_GL_VERSION_1_1; +int GLAD_GL_VERSION_1_2; +int GLAD_GL_VERSION_1_3; +int GLAD_GL_VERSION_1_4; +int GLAD_GL_VERSION_1_5; +int GLAD_GL_VERSION_2_0; +int GLAD_GL_VERSION_2_1; +int GLAD_GL_VERSION_3_0; +int GLAD_GL_VERSION_3_1; +int GLAD_GL_VERSION_3_2; +int GLAD_GL_VERSION_3_3; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +PFNGLBINDSAMPLERPROC glad_glBindSampler; +PFNGLLINEWIDTHPROC glad_glLineWidth; +PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +PFNGLCOMPILESHADERPROC glad_glCompileShader; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +PFNGLENABLEIPROC glad_glEnablei; +PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +PFNGLCREATESHADERPROC glad_glCreateShader; +PFNGLISBUFFERPROC glad_glIsBuffer; +PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +PFNGLHINTPROC glad_glHint; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +PFNGLPOINTSIZEPROC glad_glPointSize; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +PFNGLWAITSYNCPROC glad_glWaitSync; +PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +PFNGLUNIFORM3IPROC glad_glUniform3i; +PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +PFNGLUNIFORM3FPROC glad_glUniform3f; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +PFNGLCOLORMASKIPROC glad_glColorMaski; +PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +PFNGLDRAWARRAYSPROC glad_glDrawArrays; +PFNGLUNIFORM1UIPROC glad_glUniform1ui; +PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +PFNGLCLEARPROC glad_glClear; +PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +PFNGLISENABLEDPROC glad_glIsEnabled; +PFNGLSTENCILOPPROC glad_glStencilOp; +PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +PFNGLGETQUERYIVPROC glad_glGetQueryiv; +PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +PFNGLISSHADERPROC glad_glIsShader; +PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +PFNGLENABLEPROC glad_glEnable; +PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +PFNGLFLUSHPROC glad_glFlush; +PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +PFNGLFENCESYNCPROC glad_glFenceSync; +PFNGLCOLORP3UIPROC glad_glColorP3ui; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +PFNGLGENSAMPLERSPROC glad_glGenSamplers; +PFNGLCLAMPCOLORPROC glad_glClampColor; +PFNGLUNIFORM4IVPROC glad_glUniform4iv; +PFNGLCLEARSTENCILPROC glad_glClearStencil; +PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +PFNGLGENTEXTURESPROC glad_glGenTextures; +PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +PFNGLISSYNCPROC glad_glIsSync; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +PFNGLUNIFORM2IPROC glad_glUniform2i; +PFNGLUNIFORM2FPROC glad_glUniform2f; +PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +PFNGLGENQUERIESPROC glad_glGenQueries; +PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +PFNGLISENABLEDIPROC glad_glIsEnabledi; +PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +PFNGLUNIFORM2IVPROC glad_glUniform2iv; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +PFNGLGETSHADERIVPROC glad_glGetShaderiv; +PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +PFNGLGETDOUBLEVPROC glad_glGetDoublev; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +PFNGLUNIFORM3FVPROC glad_glUniform3fv; +PFNGLDEPTHRANGEPROC glad_glDepthRange; +PFNGLMAPBUFFERPROC glad_glMapBuffer; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +PFNGLDELETESYNCPROC glad_glDeleteSync; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +PFNGLUNIFORM3IVPROC glad_glUniform3iv; +PFNGLPOLYGONMODEPROC glad_glPolygonMode; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +PFNGLUSEPROGRAMPROC glad_glUseProgram; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +PFNGLFINISHPROC glad_glFinish; +PFNGLDELETESHADERPROC glad_glDeleteShader; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +PFNGLVIEWPORTPROC glad_glViewport; +PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +PFNGLUNIFORM2UIPROC glad_glUniform2ui; +PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +PFNGLCLEARDEPTHPROC glad_glClearDepth; +PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +PFNGLTEXBUFFERPROC glad_glTexBuffer; +PFNGLPIXELSTOREIPROC glad_glPixelStorei; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +PFNGLPIXELSTOREFPROC glad_glPixelStoref; +PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +PFNGLLINKPROGRAMPROC glad_glLinkProgram; +PFNGLBINDTEXTUREPROC glad_glBindTexture; +PFNGLGETSTRINGPROC glad_glGetString; +PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +PFNGLDETACHSHADERPROC glad_glDetachShader; +PFNGLENDQUERYPROC glad_glEndQuery; +PFNGLNORMALP3UIPROC glad_glNormalP3ui; +PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +PFNGLUNIFORM1FPROC glad_glUniform1f; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +PFNGLUNIFORM1IPROC glad_glUniform1i; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +PFNGLDISABLEPROC glad_glDisable; +PFNGLLOGICOPPROC glad_glLogicOp; +PFNGLUNIFORM4UIPROC glad_glUniform4ui; +PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +PFNGLCULLFACEPROC glad_glCullFace; +PFNGLGETSTRINGIPROC glad_glGetStringi; +PFNGLATTACHSHADERPROC glad_glAttachShader; +PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +PFNGLDRAWELEMENTSPROC glad_glDrawElements; +PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +PFNGLUNIFORM1IVPROC glad_glUniform1iv; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +PFNGLREADBUFFERPROC glad_glReadBuffer; +PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +PFNGLBLENDCOLORPROC glad_glBlendColor; +PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +PFNGLISPROGRAMPROC glad_glIsProgram; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +PFNGLUNIFORM4IPROC glad_glUniform4i; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +PFNGLREADPIXELSPROC glad_glReadPixels; +PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +PFNGLUNIFORM4FPROC glad_glUniform4f; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +PFNGLSTENCILFUNCPROC glad_glStencilFunc; +PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +PFNGLCOLORP4UIPROC glad_glColorP4ui; +PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +PFNGLGENBUFFERSPROC glad_glGenBuffers; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +PFNGLBLENDFUNCPROC glad_glBlendFunc; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +PFNGLSCISSORPROC glad_glScissor; +PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +PFNGLCLEARCOLORPROC glad_glClearColor; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +PFNGLUNIFORM3UIPROC glad_glUniform3ui; +PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +PFNGLUNIFORM2FVPROC glad_glUniform2fv; +PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +PFNGLDEPTHFUNCPROC glad_glDepthFunc; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +PFNGLCOLORMASKPROC glad_glColorMask; +PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +PFNGLUNIFORM4FVPROC glad_glUniform4fv; +PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +PFNGLISSAMPLERPROC glad_glIsSampler; +PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +PFNGLDISABLEIPROC glad_glDisablei; +PFNGLSHADERSOURCEPROC glad_glShaderSource; +PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +PFNGLGETSYNCIVPROC glad_glGetSynciv; +PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +PFNGLBEGINQUERYPROC glad_glBeginQuery; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +PFNGLBINDBUFFERPROC glad_glBindBuffer; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +PFNGLBUFFERDATAPROC glad_glBufferData; +PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +PFNGLGETERRORPROC glad_glGetError; +PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +PFNGLGETFLOATVPROC glad_glGetFloatv; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +PFNGLGETINTEGERVPROC glad_glGetIntegerv; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +PFNGLISQUERYPROC glad_glIsQuery; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +PFNGLSTENCILMASKPROC glad_glStencilMask; +PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +PFNGLISTEXTUREPROC glad_glIsTexture; +PFNGLUNIFORM1FVPROC glad_glUniform1fv; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +PFNGLDEPTHMASKPROC glad_glDepthMask; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +PFNGLFRONTFACEPROC glad_glFrontFace; +int GLAD_GL_SGIX_pixel_tiles; +int GLAD_GL_NV_point_sprite; +int GLAD_GL_APPLE_element_array; +int GLAD_GL_AMD_multi_draw_indirect; +int GLAD_GL_EXT_blend_subtract; +int GLAD_GL_SGIX_tag_sample_buffer; +int GLAD_GL_IBM_texture_mirrored_repeat; +int GLAD_GL_APPLE_transform_hint; +int GLAD_GL_ATI_separate_stencil; +int GLAD_GL_NV_shader_atomic_int64; +int GLAD_GL_NV_vertex_program2_option; +int GLAD_GL_EXT_texture_buffer_object; +int GLAD_GL_ARB_vertex_blend; +int GLAD_GL_OVR_multiview; +int GLAD_GL_ARB_program_interface_query; +int GLAD_GL_EXT_misc_attribute; +int GLAD_GL_NV_multisample_coverage; +int GLAD_GL_ARB_shading_language_packing; +int GLAD_GL_EXT_texture_cube_map; +int GLAD_GL_NV_viewport_array2; +int GLAD_GL_KHR_robustness; +int GLAD_GL_EXT_index_func; +int GLAD_GL_OES_compressed_paletted_texture; +int GLAD_GL_NV_depth_clamp; +int GLAD_GL_NV_shader_buffer_load; +int GLAD_GL_EXT_color_subtable; +int GLAD_GL_SUNX_constant_data; +int GLAD_GL_EXT_multi_draw_arrays; +int GLAD_GL_ARB_shader_atomic_counters; +int GLAD_GL_ARB_arrays_of_arrays; +int GLAD_GL_NV_conditional_render; +int GLAD_GL_EXT_texture_env_combine; +int GLAD_GL_AMD_depth_clamp_separate; +int GLAD_GL_SGIX_async_histogram; +int GLAD_GL_MESA_resize_buffers; +int GLAD_GL_ARB_sample_shading; +int GLAD_GL_NV_texture_env_combine4; +int GLAD_GL_ARB_texture_view; +int GLAD_GL_ARB_texture_env_combine; +int GLAD_GL_ARB_map_buffer_range; +int GLAD_GL_EXT_convolution; +int GLAD_GL_NV_compute_program5; +int GLAD_GL_EXT_paletted_texture; +int GLAD_GL_ARB_texture_buffer_object; +int GLAD_GL_SUN_triangle_list; +int GLAD_GL_SGIX_resample; +int GLAD_GL_SGIX_flush_raster; +int GLAD_GL_EXT_light_texture; +int GLAD_GL_ARB_point_sprite; +int GLAD_GL_ARB_sparse_texture2; +int GLAD_GL_ARB_half_float_pixel; +int GLAD_GL_NV_tessellation_program5; +int GLAD_GL_REND_screen_coordinates; +int GLAD_GL_HP_image_transform; +int GLAD_GL_EXT_packed_float; +int GLAD_GL_ATI_vertex_attrib_array_object; +int GLAD_GL_SGIX_vertex_preclip; +int GLAD_GL_SGIX_texture_scale_bias; +int GLAD_GL_AMD_draw_buffers_blend; +int GLAD_GL_APPLE_texture_range; +int GLAD_GL_SGIX_framezoom; +int GLAD_GL_NV_texture_barrier; +int GLAD_GL_ARB_texture_query_levels; +int GLAD_GL_EXT_blend_logic_op; +int GLAD_GL_EXT_texture_swizzle; +int GLAD_GL_ARB_texture_rg; +int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; +int GLAD_GL_ARB_fragment_shader; +int GLAD_GL_3DFX_tbuffer; +int GLAD_GL_SGIX_ycrcb; +int GLAD_GL_IBM_cull_vertex; +int GLAD_GL_EXT_separate_shader_objects; +int GLAD_GL_NV_texture_multisample; +int GLAD_GL_ARB_shader_objects; +int GLAD_GL_ARB_framebuffer_object; +int GLAD_GL_ATI_envmap_bumpmap; +int GLAD_GL_ARB_robust_buffer_access_behavior; +int GLAD_GL_ARB_shader_stencil_export; +int GLAD_GL_AMD_sample_positions; +int GLAD_GL_ARB_enhanced_layouts; +int GLAD_GL_ARB_texture_rectangle; +int GLAD_GL_SGI_texture_color_table; +int GLAD_GL_ATI_map_object_buffer; +int GLAD_GL_ARB_robustness; +int GLAD_GL_NV_pixel_data_range; +int GLAD_GL_EXT_framebuffer_blit; +int GLAD_GL_ARB_gpu_shader_fp64; +int GLAD_GL_NV_command_list; +int GLAD_GL_ARB_window_pos; +int GLAD_GL_ARB_robustness_isolation; +int GLAD_GL_GREMEDY_string_marker; +int GLAD_GL_ARB_texture_compression_bptc; +int GLAD_GL_EXT_subtexture; +int GLAD_GL_EXT_pixel_transform_color_table; +int GLAD_GL_EXT_texture_compression_rgtc; +int GLAD_GL_ARB_shadow; +int GLAD_GL_SGIX_depth_pass_instrument; +int GLAD_GL_NVX_conditional_render; +int GLAD_GL_NV_evaluators; +int GLAD_GL_SGIS_texture_filter4; +int GLAD_GL_AMD_performance_monitor; +int GLAD_GL_NV_geometry_shader4; +int GLAD_GL_EXT_stencil_clear_tag; +int GLAD_GL_NV_vertex_program1_1; +int GLAD_GL_NV_present_video; +int GLAD_GL_ARB_texture_compression_rgtc; +int GLAD_GL_ARB_texture_filter_minmax; +int GLAD_GL_HP_convolution_border_modes; +int GLAD_GL_EXT_gpu_program_parameters; +int GLAD_GL_SGIX_list_priority; +int GLAD_GL_ARB_stencil_texturing; +int GLAD_GL_ARB_shader_clock; +int GLAD_GL_NV_shader_atomic_fp16_vector; +int GLAD_GL_SGIX_fog_offset; +int GLAD_GL_ARB_draw_elements_base_vertex; +int GLAD_GL_INGR_interlace_read; +int GLAD_GL_NV_transform_feedback; +int GLAD_GL_EXT_post_depth_coverage; +int GLAD_GL_ARB_debug_output; +int GLAD_GL_AMD_stencil_operation_extended; +int GLAD_GL_ARB_compatibility; +int GLAD_GL_ARB_instanced_arrays; +int GLAD_GL_ARB_get_texture_sub_image; +int GLAD_GL_NV_vertex_array_range2; +int GLAD_GL_ARB_texture_stencil8; +int GLAD_GL_AMD_sparse_texture; +int GLAD_GL_ARB_clip_control; +int GLAD_GL_NV_fragment_coverage_to_color; +int GLAD_GL_NV_fence; +int GLAD_GL_ARB_texture_buffer_range; +int GLAD_GL_SUN_mesh_array; +int GLAD_GL_ARB_vertex_attrib_binding; +int GLAD_GL_EXT_texture_compression_s3tc; +int GLAD_GL_ARB_cl_event; +int GLAD_GL_ARB_derivative_control; +int GLAD_GL_NV_packed_depth_stencil; +int GLAD_GL_OES_single_precision; +int GLAD_GL_NV_primitive_restart; +int GLAD_GL_ARB_fragment_shader_interlock; +int GLAD_GL_EXT_texture_object; +int GLAD_GL_AMD_name_gen_delete; +int GLAD_GL_NV_texture_compression_vtc; +int GLAD_GL_NV_sample_mask_override_coverage; +int GLAD_GL_NV_texture_shader3; +int GLAD_GL_NV_texture_shader2; +int GLAD_GL_EXT_texture; +int GLAD_GL_ARB_buffer_storage; +int GLAD_GL_AMD_shader_atomic_counter_ops; +int GLAD_GL_APPLE_vertex_program_evaluators; +int GLAD_GL_ARB_multi_bind; +int GLAD_GL_ARB_explicit_uniform_location; +int GLAD_GL_ARB_depth_buffer_float; +int GLAD_GL_NV_path_rendering_shared_edge; +int GLAD_GL_SGIX_shadow_ambient; +int GLAD_GL_ARB_texture_cube_map; +int GLAD_GL_AMD_vertex_shader_viewport_index; +int GLAD_GL_EXT_shader_integer_mix; +int GLAD_GL_NV_vertex_buffer_unified_memory; +int GLAD_GL_EXT_fog_coord; +int GLAD_GL_EXT_texture_env_dot3; +int GLAD_GL_ATI_texture_env_combine3; +int GLAD_GL_ARB_map_buffer_alignment; +int GLAD_GL_NV_blend_equation_advanced; +int GLAD_GL_SGIS_sharpen_texture; +int GLAD_GL_KHR_robust_buffer_access_behavior; +int GLAD_GL_ARB_pipeline_statistics_query; +int GLAD_GL_ARB_vertex_program; +int GLAD_GL_ARB_texture_rgb10_a2ui; +int GLAD_GL_OML_interlace; +int GLAD_GL_ATI_pixel_format_float; +int GLAD_GL_ARB_vertex_buffer_object; +int GLAD_GL_EXT_shadow_funcs; +int GLAD_GL_ATI_text_fragment_shader; +int GLAD_GL_NV_vertex_array_range; +int GLAD_GL_SGIX_fragment_lighting; +int GLAD_GL_NV_texture_expand_normal; +int GLAD_GL_NV_framebuffer_multisample_coverage; +int GLAD_GL_ARB_framebuffer_no_attachments; +int GLAD_GL_EXT_timer_query; +int GLAD_GL_EXT_vertex_array_bgra; +int GLAD_GL_NV_bindless_texture; +int GLAD_GL_KHR_debug; +int GLAD_GL_SGIS_texture_border_clamp; +int GLAD_GL_OML_subsample; +int GLAD_GL_SGIX_clipmap; +int GLAD_GL_EXT_geometry_shader4; +int GLAD_GL_ARB_shader_texture_image_samples; +int GLAD_GL_MESA_ycbcr_texture; +int GLAD_GL_MESAX_texture_stack; +int GLAD_GL_AMD_seamless_cubemap_per_texture; +int GLAD_GL_EXT_bindable_uniform; +int GLAD_GL_KHR_texture_compression_astc_hdr; +int GLAD_GL_ARB_shader_ballot; +int GLAD_GL_KHR_blend_equation_advanced; +int GLAD_GL_ARB_fragment_program_shadow; +int GLAD_GL_ATI_element_array; +int GLAD_GL_ARB_sparse_texture_clamp; +int GLAD_GL_AMD_texture_texture4; +int GLAD_GL_SGIX_reference_plane; +int GLAD_GL_EXT_stencil_two_side; +int GLAD_GL_ARB_transform_feedback_overflow_query; +int GLAD_GL_SGIX_texture_lod_bias; +int GLAD_GL_KHR_no_error; +int GLAD_GL_NV_explicit_multisample; +int GLAD_GL_IBM_static_data; +int GLAD_GL_EXT_clip_volume_hint; +int GLAD_GL_EXT_texture_perturb_normal; +int GLAD_GL_NV_fragment_program2; +int GLAD_GL_NV_fragment_program4; +int GLAD_GL_EXT_point_parameters; +int GLAD_GL_PGI_misc_hints; +int GLAD_GL_SGIX_subsample; +int GLAD_GL_AMD_shader_stencil_export; +int GLAD_GL_ARB_shader_texture_lod; +int GLAD_GL_ARB_vertex_shader; +int GLAD_GL_ARB_depth_clamp; +int GLAD_GL_SGIS_texture_select; +int GLAD_GL_NV_texture_shader; +int GLAD_GL_ARB_tessellation_shader; +int GLAD_GL_EXT_draw_buffers2; +int GLAD_GL_ARB_vertex_attrib_64bit; +int GLAD_GL_EXT_texture_filter_minmax; +int GLAD_GL_ARB_texture_gather; +int GLAD_GL_AMD_interleaved_elements; +int GLAD_GL_ARB_fragment_program; +int GLAD_GL_OML_resample; +int GLAD_GL_APPLE_ycbcr_422; +int GLAD_GL_SGIX_texture_add_env; +int GLAD_GL_ARB_shadow_ambient; +int GLAD_GL_ARB_texture_storage; +int GLAD_GL_EXT_pixel_buffer_object; +int GLAD_GL_NV_vertex_program; +int GLAD_GL_SGIS_pixel_texture; +int GLAD_GL_SGIS_generate_mipmap; +int GLAD_GL_SGIX_instruments; +int GLAD_GL_ARB_fragment_layer_viewport; +int GLAD_GL_ARB_shader_storage_buffer_object; +int GLAD_GL_EXT_sparse_texture2; +int GLAD_GL_EXT_blend_minmax; +int GLAD_GL_MESA_pack_invert; +int GLAD_GL_ARB_base_instance; +int GLAD_GL_SUN_global_alpha; +int GLAD_GL_PGI_vertex_hints; +int GLAD_GL_AMD_transform_feedback4; +int GLAD_GL_ARB_ES3_1_compatibility; +int GLAD_GL_EXT_texture_integer; +int GLAD_GL_ARB_texture_multisample; +int GLAD_GL_AMD_gpu_shader_int64; +int GLAD_GL_S3_s3tc; +int GLAD_GL_ARB_query_buffer_object; +int GLAD_GL_AMD_vertex_shader_tessellator; +int GLAD_GL_ARB_invalidate_subdata; +int GLAD_GL_ARB_draw_indirect; +int GLAD_GL_ARB_transform_feedback2; +int GLAD_GL_EXT_index_material; +int GLAD_GL_NV_blend_equation_advanced_coherent; +int GLAD_GL_ARB_texture_non_power_of_two; +int GLAD_GL_KHR_texture_compression_astc_sliced_3d; +int GLAD_GL_ATI_draw_buffers; +int GLAD_GL_EXT_cmyka; +int GLAD_GL_SGIX_pixel_texture; +int GLAD_GL_APPLE_specular_vector; +int GLAD_GL_ARB_seamless_cubemap_per_texture; +int GLAD_GL_ARB_conservative_depth; +int GLAD_GL_SGIX_interlace; +int GLAD_GL_NV_parameter_buffer_object; +int GLAD_GL_AMD_shader_trinary_minmax; +int GLAD_GL_EXT_texture_lod_bias; +int GLAD_GL_EXT_rescale_normal; +int GLAD_GL_ARB_pixel_buffer_object; +int GLAD_GL_ARB_uniform_buffer_object; +int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; +int GLAD_GL_ARB_texture_swizzle; +int GLAD_GL_ARB_texture_compression; +int GLAD_GL_SGIX_async_pixel; +int GLAD_GL_NV_fragment_program_option; +int GLAD_GL_ARB_explicit_attrib_location; +int GLAD_GL_EXT_blend_color; +int GLAD_GL_NV_shader_thread_group; +int GLAD_GL_EXT_stencil_wrap; +int GLAD_GL_EXT_index_array_formats; +int GLAD_GL_OVR_multiview2; +int GLAD_GL_EXT_histogram; +int GLAD_GL_EXT_polygon_offset; +int GLAD_GL_SGIS_point_parameters; +int GLAD_GL_EXT_direct_state_access; +int GLAD_GL_ARB_shader_group_vote; +int GLAD_GL_NV_texture_rectangle; +int GLAD_GL_ARB_copy_image; +int GLAD_GL_NV_shader_thread_shuffle; +int GLAD_GL_ARB_shader_precision; +int GLAD_GL_EXT_vertex_shader; +int GLAD_GL_EXT_blend_func_separate; +int GLAD_GL_APPLE_fence; +int GLAD_GL_OES_byte_coordinates; +int GLAD_GL_ARB_transpose_matrix; +int GLAD_GL_ARB_provoking_vertex; +int GLAD_GL_NV_uniform_buffer_unified_memory; +int GLAD_GL_NV_fragment_shader_interlock; +int GLAD_GL_EXT_vertex_array; +int GLAD_GL_ARB_half_float_vertex; +int GLAD_GL_EXT_blend_equation_separate; +int GLAD_GL_NV_framebuffer_mixed_samples; +int GLAD_GL_ARB_multi_draw_indirect; +int GLAD_GL_EXT_raster_multisample; +int GLAD_GL_NV_copy_image; +int GLAD_GL_NV_geometry_shader_passthrough; +int GLAD_GL_INTEL_framebuffer_CMAA; +int GLAD_GL_SGIX_convolution_accuracy; +int GLAD_GL_ARB_transform_feedback3; +int GLAD_GL_SGIX_ycrcba; +int GLAD_GL_EXT_debug_marker; +int GLAD_GL_EXT_bgra; +int GLAD_GL_INTEL_parallel_arrays; +int GLAD_GL_EXT_pixel_transform; +int GLAD_GL_NV_vertex_attrib_integer_64bit; +int GLAD_GL_ATI_fragment_shader; +int GLAD_GL_ARB_vertex_array_object; +int GLAD_GL_ATI_pn_triangles; +int GLAD_GL_EXT_texture_env_add; +int GLAD_GL_EXT_packed_depth_stencil; +int GLAD_GL_EXT_texture_mirror_clamp; +int GLAD_GL_NV_multisample_filter_hint; +int GLAD_GL_INTEL_performance_query; +int GLAD_GL_ARB_transform_feedback_instanced; +int GLAD_GL_SGIX_async; +int GLAD_GL_EXT_texture_compression_latc; +int GLAD_GL_NV_shader_atomic_float; +int GLAD_GL_ARB_shading_language_100; +int GLAD_GL_APPLE_float_pixels; +int GLAD_GL_ARB_texture_mirror_clamp_to_edge; +int GLAD_GL_NV_vertex_program2; +int GLAD_GL_NV_bindless_multi_draw_indirect_count; +int GLAD_GL_ARB_depth_texture; +int GLAD_GL_ARB_ES2_compatibility; +int GLAD_GL_ARB_indirect_parameters; +int GLAD_GL_NV_half_float; +int GLAD_GL_ARB_ES3_2_compatibility; +int GLAD_GL_ATI_texture_mirror_once; +int GLAD_GL_IBM_rasterpos_clip; +int GLAD_GL_SGIX_shadow; +int GLAD_GL_EXT_polygon_offset_clamp; +int GLAD_GL_NV_deep_texture3D; +int GLAD_GL_ARB_shader_draw_parameters; +int GLAD_GL_SGIX_calligraphic_fragment; +int GLAD_GL_ARB_shader_bit_encoding; +int GLAD_GL_EXT_compiled_vertex_array; +int GLAD_GL_NV_depth_buffer_float; +int GLAD_GL_APPLE_flush_buffer_range; +int GLAD_GL_ARB_imaging; +int GLAD_GL_ARB_draw_buffers_blend; +int GLAD_GL_AMD_gcn_shader; +int GLAD_GL_AMD_blend_minmax_factor; +int GLAD_GL_EXT_texture_sRGB_decode; +int GLAD_GL_ARB_shading_language_420pack; +int GLAD_GL_ARB_shader_viewport_layer_array; +int GLAD_GL_ATI_meminfo; +int GLAD_GL_EXT_abgr; +int GLAD_GL_AMD_pinned_memory; +int GLAD_GL_EXT_texture_snorm; +int GLAD_GL_SGIX_texture_coordinate_clamp; +int GLAD_GL_ARB_clear_buffer_object; +int GLAD_GL_ARB_multisample; +int GLAD_GL_EXT_debug_label; +int GLAD_GL_NV_light_max_exponent; +int GLAD_GL_NV_internalformat_sample_query; +int GLAD_GL_INTEL_map_texture; +int GLAD_GL_ARB_texture_env_crossbar; +int GLAD_GL_EXT_422_pixels; +int GLAD_GL_ARB_compute_shader; +int GLAD_GL_NV_texgen_emboss; +int GLAD_GL_ARB_blend_func_extended; +int GLAD_GL_IBM_vertex_array_lists; +int GLAD_GL_ARB_color_buffer_float; +int GLAD_GL_ARB_bindless_texture; +int GLAD_GL_SGIX_depth_texture; +int GLAD_GL_ARB_internalformat_query; +int GLAD_GL_ARB_shader_atomic_counter_ops; +int GLAD_GL_ARB_texture_mirrored_repeat; +int GLAD_GL_EXT_shader_image_load_store; +int GLAD_GL_EXT_copy_texture; +int GLAD_GL_NV_register_combiners2; +int GLAD_GL_SGIX_ycrcb_subsample; +int GLAD_GL_ARB_copy_buffer; +int GLAD_GL_NV_draw_texture; +int GLAD_GL_EXT_texture_shared_exponent; +int GLAD_GL_EXT_draw_instanced; +int GLAD_GL_NV_copy_depth_to_color; +int GLAD_GL_ARB_viewport_array; +int GLAD_GL_ARB_separate_shader_objects; +int GLAD_GL_EXT_multisample; +int GLAD_GL_EXT_depth_bounds_test; +int GLAD_GL_EXT_shared_texture_palette; +int GLAD_GL_ARB_texture_env_add; +int GLAD_GL_NV_video_capture; +int GLAD_GL_ARB_sampler_objects; +int GLAD_GL_ARB_matrix_palette; +int GLAD_GL_SGIS_texture_color_mask; +int GLAD_GL_EXT_packed_pixels; +int GLAD_GL_EXT_coordinate_frame; +int GLAD_GL_NV_transform_feedback2; +int GLAD_GL_APPLE_aux_depth_stencil; +int GLAD_GL_ARB_shader_subroutine; +int GLAD_GL_EXT_framebuffer_sRGB; +int GLAD_GL_ARB_texture_storage_multisample; +int GLAD_GL_KHR_blend_equation_advanced_coherent; +int GLAD_GL_EXT_vertex_attrib_64bit; +int GLAD_GL_HP_texture_lighting; +int GLAD_GL_NV_shader_buffer_store; +int GLAD_GL_OES_query_matrix; +int GLAD_GL_MESA_window_pos; +int GLAD_GL_NV_fill_rectangle; +int GLAD_GL_NV_shader_storage_buffer_object; +int GLAD_GL_ARB_texture_query_lod; +int GLAD_GL_SGIX_ir_instrument1; +int GLAD_GL_ARB_shader_image_size; +int GLAD_GL_NV_shader_atomic_counters; +int GLAD_GL_APPLE_object_purgeable; +int GLAD_GL_ARB_occlusion_query; +int GLAD_GL_INGR_color_clamp; +int GLAD_GL_SGI_color_table; +int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; +int GLAD_GL_ARB_texture_cube_map_array; +int GLAD_GL_AMD_debug_output; +int GLAD_GL_EXT_gpu_shader4; +int GLAD_GL_NV_geometry_program4; +int GLAD_GL_NV_gpu_program5_mem_extended; +int GLAD_GL_SGIX_scalebias_hint; +int GLAD_GL_ARB_texture_border_clamp; +int GLAD_GL_ARB_fragment_coord_conventions; +int GLAD_GL_SGIX_polynomial_ffd; +int GLAD_GL_EXT_provoking_vertex; +int GLAD_GL_ARB_point_parameters; +int GLAD_GL_ARB_shader_image_load_store; +int GLAD_GL_ARB_conditional_render_inverted; +int GLAD_GL_HP_occlusion_test; +int GLAD_GL_ARB_ES3_compatibility; +int GLAD_GL_EXT_texture_array; +int GLAD_GL_ARB_texture_buffer_object_rgb32; +int GLAD_GL_NV_bindless_multi_draw_indirect; +int GLAD_GL_SGIX_texture_multi_buffer; +int GLAD_GL_EXT_transform_feedback; +int GLAD_GL_KHR_texture_compression_astc_ldr; +int GLAD_GL_3DFX_multisample; +int GLAD_GL_INTEL_fragment_shader_ordering; +int GLAD_GL_ARB_texture_env_dot3; +int GLAD_GL_NV_gpu_program4; +int GLAD_GL_NV_gpu_program5; +int GLAD_GL_NV_float_buffer; +int GLAD_GL_SGIS_texture_edge_clamp; +int GLAD_GL_ARB_framebuffer_sRGB; +int GLAD_GL_SUN_slice_accum; +int GLAD_GL_EXT_index_texture; +int GLAD_GL_EXT_shader_image_load_formatted; +int GLAD_GL_ARB_geometry_shader4; +int GLAD_GL_EXT_separate_specular_color; +int GLAD_GL_NV_fog_distance; +int GLAD_GL_NV_conservative_raster; +int GLAD_GL_SUN_convolution_border_modes; +int GLAD_GL_SGIX_sprite; +int GLAD_GL_ARB_get_program_binary; +int GLAD_GL_ARB_timer_query; +int GLAD_GL_AMD_occlusion_query_event; +int GLAD_GL_SGIS_multisample; +int GLAD_GL_EXT_framebuffer_object; +int GLAD_GL_EXT_vertex_weighting; +int GLAD_GL_ARB_vertex_array_bgra; +int GLAD_GL_APPLE_vertex_array_range; +int GLAD_GL_AMD_query_buffer_object; +int GLAD_GL_NV_register_combiners; +int GLAD_GL_ARB_draw_buffers; +int GLAD_GL_ARB_clear_texture; +int GLAD_GL_NV_fragment_program; +int GLAD_GL_SGI_color_matrix; +int GLAD_GL_EXT_cull_vertex; +int GLAD_GL_EXT_texture_sRGB; +int GLAD_GL_APPLE_row_bytes; +int GLAD_GL_NV_texgen_reflection; +int GLAD_GL_IBM_multimode_draw_arrays; +int GLAD_GL_APPLE_vertex_array_object; +int GLAD_GL_3DFX_texture_compression_FXT1; +int GLAD_GL_GREMEDY_frame_terminator; +int GLAD_GL_AMD_conservative_depth; +int GLAD_GL_ARB_texture_float; +int GLAD_GL_ARB_compressed_texture_pixel_storage; +int GLAD_GL_SGIS_detail_texture; +int GLAD_GL_ARB_draw_instanced; +int GLAD_GL_OES_read_format; +int GLAD_GL_ATI_texture_float; +int GLAD_GL_WIN_specular_fog; +int GLAD_GL_AMD_vertex_shader_layer; +int GLAD_GL_ARB_shading_language_include; +int GLAD_GL_APPLE_client_storage; +int GLAD_GL_WIN_phong_shading; +int GLAD_GL_INGR_blend_func_separate; +int GLAD_GL_NV_path_rendering; +int GLAD_GL_NV_conservative_raster_dilate; +int GLAD_GL_ARB_texture_barrier; +int GLAD_GL_ATI_vertex_streams; +int GLAD_GL_ARB_post_depth_coverage; +int GLAD_GL_NV_occlusion_query; +int GLAD_GL_APPLE_rgb_422; +int GLAD_GL_ARB_direct_state_access; +int GLAD_GL_ARB_gpu_shader_int64; +int GLAD_GL_ARB_seamless_cube_map; +int GLAD_GL_ARB_cull_distance; +int GLAD_GL_NV_vdpau_interop; +int GLAD_GL_ARB_occlusion_query2; +int GLAD_GL_ARB_internalformat_query2; +int GLAD_GL_EXT_texture_filter_anisotropic; +int GLAD_GL_SUN_vertex; +int GLAD_GL_ARB_sparse_texture; +int GLAD_GL_SGIS_texture_lod; +int GLAD_GL_NV_vertex_program3; +int GLAD_GL_NV_gpu_shader5; +int GLAD_GL_NV_vertex_program4; +int GLAD_GL_AMD_transform_feedback3_lines_triangles; +int GLAD_GL_SGIS_fog_function; +int GLAD_GL_EXT_x11_sync_object; +int GLAD_GL_ARB_sync; +int GLAD_GL_NV_sample_locations; +int GLAD_GL_ARB_compute_variable_group_size; +int GLAD_GL_OES_fixed_point; +int GLAD_GL_NV_blend_square; +int GLAD_GL_EXT_framebuffer_multisample; +int GLAD_GL_ARB_gpu_shader5; +int GLAD_GL_SGIS_texture4D; +int GLAD_GL_EXT_texture3D; +int GLAD_GL_ARB_multitexture; +int GLAD_GL_EXT_secondary_color; +int GLAD_GL_NV_parameter_buffer_object2; +int GLAD_GL_ATI_vertex_array_object; +int GLAD_GL_ARB_parallel_shader_compile; +int GLAD_GL_NVX_gpu_memory_info; +int GLAD_GL_SGIX_igloo_interface; +int GLAD_GL_SGIS_point_line_texgen; +int GLAD_GL_ARB_sample_locations; +int GLAD_GL_ARB_sparse_buffer; +int GLAD_GL_EXT_draw_range_elements; +int GLAD_GL_SGIX_blend_alpha_minmax; +int GLAD_GL_KHR_context_flush_control; +PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; +PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; +PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; +PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; +PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; +PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; +PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; +PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; +PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; +PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; +PFNGLWEIGHTIVARBPROC glad_glWeightivARB; +PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; +PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; +PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; +PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; +PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; +PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; +PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; +PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; +PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; +PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; +PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; +PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; +PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; +PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; +PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; +PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; +PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; +PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; +PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; +PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; +PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; +PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; +PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; +PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; +PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; +PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; +PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; +PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; +PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; +PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; +PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; +PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; +PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; +PFNGLTEXTUREVIEWPROC glad_glTextureView; +PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; +PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; +PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; +PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; +PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; +PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; +PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; +PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; +PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; +PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; +PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; +PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; +PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; +PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; +PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; +PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; +PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; +PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; +PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; +PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; +PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; +PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; +PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; +PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; +PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; +PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; +PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; +PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; +PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; +PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; +PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; +PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; +PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; +PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; +PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; +PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; +PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; +PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; +PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; +PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; +PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; +PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; +PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; +PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; +PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; +PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; +PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; +PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; +PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; +PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; +PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; +PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; +PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; +PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; +PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; +PFNGLGETHANDLEARBPROC glad_glGetHandleARB; +PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; +PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; +PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; +PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; +PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; +PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; +PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; +PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; +PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; +PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; +PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; +PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; +PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; +PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; +PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; +PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; +PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; +PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; +PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; +PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; +PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; +PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; +PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; +PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; +PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; +PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; +PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; +PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; +PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; +PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; +PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; +PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; +PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; +PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; +PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; +PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; +PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; +PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; +PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; +PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; +PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; +PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; +PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; +PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; +PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; +PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; +PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; +PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; +PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; +PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; +PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; +PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; +PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; +PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; +PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; +PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; +PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; +PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; +PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; +PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; +PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; +PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; +PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; +PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; +PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; +PFNGLUNIFORM1DPROC glad_glUniform1d; +PFNGLUNIFORM2DPROC glad_glUniform2d; +PFNGLUNIFORM3DPROC glad_glUniform3d; +PFNGLUNIFORM4DPROC glad_glUniform4d; +PFNGLUNIFORM1DVPROC glad_glUniform1dv; +PFNGLUNIFORM2DVPROC glad_glUniform2dv; +PFNGLUNIFORM3DVPROC glad_glUniform3dv; +PFNGLUNIFORM4DVPROC glad_glUniform4dv; +PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; +PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; +PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; +PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; +PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; +PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; +PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; +PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; +PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; +PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; +PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; +PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; +PFNGLISSTATENVPROC glad_glIsStateNV; +PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; +PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; +PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; +PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; +PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; +PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; +PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; +PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; +PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; +PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; +PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; +PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; +PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; +PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; +PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; +PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; +PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; +PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; +PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; +PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; +PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; +PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; +PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; +PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; +PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; +PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; +PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; +PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; +PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; +PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; +PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; +PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; +PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; +PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; +PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; +PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; +PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; +PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; +PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; +PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; +PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; +PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; +PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; +PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; +PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; +PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; +PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; +PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; +PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; +PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; +PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; +PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; +PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; +PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; +PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; +PFNGLREADNPIXELSPROC glad_glReadnPixels; +PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; +PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; +PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; +PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; +PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; +PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; +PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; +PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; +PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; +PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; +PFNGLCLIPCONTROLPROC glad_glClipControl; +PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; +PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; +PFNGLGENFENCESNVPROC glad_glGenFencesNV; +PFNGLISFENCENVPROC glad_glIsFenceNV; +PFNGLTESTFENCENVPROC glad_glTestFenceNV; +PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; +PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; +PFNGLSETFENCENVPROC glad_glSetFenceNV; +PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; +PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; +PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; +PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; +PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; +PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; +PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; +PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; +PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; +PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; +PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; +PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; +PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; +PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; +PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; +PFNGLORTHOFOESPROC glad_glOrthofOES; +PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; +PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; +PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; +PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; +PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; +PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; +PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; +PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; +PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; +PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; +PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; +PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; +PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; +PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; +PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; +PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; +PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; +PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; +PFNGLISNAMEAMDPROC glad_glIsNameAMD; +PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; +PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; +PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; +PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; +PFNGLBINDTEXTURESPROC glad_glBindTextures; +PFNGLBINDSAMPLERSPROC glad_glBindSamplers; +PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; +PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; +PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; +PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; +PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; +PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; +PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; +PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; +PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; +PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; +PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; +PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; +PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; +PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; +PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; +PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; +PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; +PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; +PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; +PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; +PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; +PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; +PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; +PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; +PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; +PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; +PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; +PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; +PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; +PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; +PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; +PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; +PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; +PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; +PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; +PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; +PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; +PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; +PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; +PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; +PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; +PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; +PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; +PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; +PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; +PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; +PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; +PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; +PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; +PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; +PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; +PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; +PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; +PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; +PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; +PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; +PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; +PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; +PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; +PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; +PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; +PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; +PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; +PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; +PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; +PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; +PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; +PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; +PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; +PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; +PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; +PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; +PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; +PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; +PFNGLISPROGRAMARBPROC glad_glIsProgramARB; +PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; +PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; +PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; +PFNGLISBUFFERARBPROC glad_glIsBufferARB; +PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; +PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; +PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; +PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; +PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; +PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; +PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; +PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; +PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; +PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; +PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; +PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; +PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; +PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; +PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; +PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; +PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; +PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; +PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; +PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; +PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; +PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; +PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; +PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; +PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; +PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; +PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; +PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; +PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; +PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; +PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; +PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; +PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; +PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; +PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; +PFNGLOBJECTLABELPROC glad_glObjectLabel; +PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; +PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; +PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; +PFNGLGETPOINTERVPROC glad_glGetPointerv; +PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; +PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; +PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; +PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; +PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; +PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; +PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; +PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; +PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; +PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; +PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; +PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; +PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; +PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; +PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; +PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; +PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; +PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; +PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; +PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; +PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; +PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; +PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; +PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; +PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; +PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; +PFNGLHINTPGIPROC glad_glHintPGI; +PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; +PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; +PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; +PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; +PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; +PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; +PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; +PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; +PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; +PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; +PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; +PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; +PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; +PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; +PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; +PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; +PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; +PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; +PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; +PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; +PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; +PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; +PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; +PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; +PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; +PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; +PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; +PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; +PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; +PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; +PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; +PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; +PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; +PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; +PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; +PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; +PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; +PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; +PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; +PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; +PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; +PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; +PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; +PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; +PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; +PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; +PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; +PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; +PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; +PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; +PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; +PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; +PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; +PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; +PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; +PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; +PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; +PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; +PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; +PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; +PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; +PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; +PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; +PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; +PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; +PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; +PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; +PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; +PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; +PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; +PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; +PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; +PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; +PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; +PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; +PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; +PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; +PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; +PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; +PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; +PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; +PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; +PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; +PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; +PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; +PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; +PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; +PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; +PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; +PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; +PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; +PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; +PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; +PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; +PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; +PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; +PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; +PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; +PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; +PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; +PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; +PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; +PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; +PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; +PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; +PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; +PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; +PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; +PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; +PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; +PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; +PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; +PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; +PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; +PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; +PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; +PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; +PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; +PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; +PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; +PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; +PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; +PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; +PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; +PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; +PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; +PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; +PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; +PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; +PFNGLCREATETEXTURESPROC glad_glCreateTextures; +PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; +PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; +PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; +PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; +PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; +PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; +PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; +PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; +PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; +PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; +PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; +PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; +PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; +PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; +PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; +PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; +PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; +PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; +PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; +PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; +PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; +PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; +PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; +PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; +PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; +PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; +PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; +PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; +PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; +PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; +PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; +PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; +PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; +PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; +PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; +PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; +PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; +PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; +PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; +PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; +PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; +PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; +PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; +PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; +PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; +PFNGLCREATEQUERIESPROC glad_glCreateQueries; +PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; +PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; +PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; +PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; +PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; +PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; +PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; +PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; +PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; +PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; +PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; +PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; +PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; +PFNGLMINMAXEXTPROC glad_glMinmaxEXT; +PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; +PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; +PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; +PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; +PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; +PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; +PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; +PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; +PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; +PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; +PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; +PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; +PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; +PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; +PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; +PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; +PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; +PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; +PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; +PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; +PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; +PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; +PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; +PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; +PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; +PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; +PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; +PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; +PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; +PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; +PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; +PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; +PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; +PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; +PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; +PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; +PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; +PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; +PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; +PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; +PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; +PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; +PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; +PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; +PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; +PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; +PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; +PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; +PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; +PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; +PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; +PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; +PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; +PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; +PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; +PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; +PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; +PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; +PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; +PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; +PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; +PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; +PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; +PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; +PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; +PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; +PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; +PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; +PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; +PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; +PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; +PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; +PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; +PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; +PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; +PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; +PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; +PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; +PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; +PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; +PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; +PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; +PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; +PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; +PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; +PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; +PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; +PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; +PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; +PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; +PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; +PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; +PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; +PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; +PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; +PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; +PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; +PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; +PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; +PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; +PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; +PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; +PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; +PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; +PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; +PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; +PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; +PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; +PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; +PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; +PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; +PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; +PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; +PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; +PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; +PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; +PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; +PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; +PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; +PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; +PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; +PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; +PFNGLISPROGRAMNVPROC glad_glIsProgramNV; +PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; +PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; +PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; +PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; +PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; +PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; +PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; +PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; +PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; +PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; +PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; +PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; +PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; +PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; +PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; +PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; +PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; +PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; +PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; +PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; +PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; +PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; +PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; +PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; +PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; +PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; +PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; +PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; +PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; +PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; +PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; +PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; +PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; +PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; +PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; +PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; +PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; +PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; +PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; +PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; +PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; +PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; +PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; +PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; +PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; +PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; +PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; +PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; +PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; +PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; +PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; +PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; +PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; +PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; +PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; +PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; +PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; +PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; +PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; +PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; +PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; +PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; +PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; +PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; +PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; +PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; +PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; +PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; +PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; +PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; +PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; +PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; +PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; +PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; +PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; +PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; +PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; +PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; +PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; +PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; +PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; +PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; +PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; +PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; +PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; +PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; +PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; +PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; +PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; +PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; +PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; +PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; +PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; +PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; +PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; +PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; +PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; +PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; +PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; +PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; +PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; +PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; +PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; +PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; +PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; +PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; +PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; +PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; +PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; +PFNGLVERTEX2BOESPROC glad_glVertex2bOES; +PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; +PFNGLVERTEX3BOESPROC glad_glVertex3bOES; +PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; +PFNGLVERTEX4BOESPROC glad_glVertex4bOES; +PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; +PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; +PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; +PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; +PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; +PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; +PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; +PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; +PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; +PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; +PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; +PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; +PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; +PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; +PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; +PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; +PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; +PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; +PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; +PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; +PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; +PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; +PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; +PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; +PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; +PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; +PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; +PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; +PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; +PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; +PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; +PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; +PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; +PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; +PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; +PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; +PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; +PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; +PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; +PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; +PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; +PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; +PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; +PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; +PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; +PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; +PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; +PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; +PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; +PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; +PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; +PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; +PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; +PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; +PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; +PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; +PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; +PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; +PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; +PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; +PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; +PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; +PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; +PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; +PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; +PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; +PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; +PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; +PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; +PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; +PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; +PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; +PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; +PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; +PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; +PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +PFNGLSHADERBINARYPROC glad_glShaderBinary; +PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; +PFNGLVERTEX2HNVPROC glad_glVertex2hNV; +PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; +PFNGLVERTEX3HNVPROC glad_glVertex3hNV; +PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; +PFNGLVERTEX4HNVPROC glad_glVertex4hNV; +PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; +PFNGLNORMAL3HNVPROC glad_glNormal3hNV; +PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; +PFNGLCOLOR3HNVPROC glad_glColor3hNV; +PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; +PFNGLCOLOR4HNVPROC glad_glColor4hNV; +PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; +PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; +PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; +PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; +PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; +PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; +PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; +PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; +PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; +PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; +PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; +PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; +PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; +PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; +PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; +PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; +PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; +PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; +PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; +PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; +PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; +PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; +PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; +PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; +PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; +PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; +PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; +PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; +PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; +PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; +PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; +PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; +PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; +PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; +PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; +PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; +PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; +PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; +PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; +PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; +PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; +PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; +PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; +PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; +PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; +PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; +PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; +PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; +PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; +PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; +PFNGLCOLORTABLEPROC glad_glColorTable; +PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; +PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; +PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; +PFNGLGETCOLORTABLEPROC glad_glGetColorTable; +PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; +PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; +PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; +PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; +PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; +PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; +PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; +PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; +PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; +PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; +PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; +PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; +PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; +PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; +PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; +PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; +PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; +PFNGLGETHISTOGRAMPROC glad_glGetHistogram; +PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; +PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; +PFNGLGETMINMAXPROC glad_glGetMinmax; +PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; +PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; +PFNGLHISTOGRAMPROC glad_glHistogram; +PFNGLMINMAXPROC glad_glMinmax; +PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; +PFNGLRESETMINMAXPROC glad_glResetMinmax; +PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; +PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; +PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; +PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; +PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; +PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; +PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; +PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; +PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; +PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; +PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; +PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; +PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; +PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; +PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; +PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; +PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; +PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; +PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; +PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; +PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; +PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; +PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; +PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; +PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; +PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; +PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; +PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; +PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; +PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; +PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; +PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; +PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; +PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; +PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; +PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; +PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; +PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; +PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; +PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; +PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; +PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; +PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; +PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; +PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; +PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; +PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; +PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; +PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; +PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; +PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; +PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; +PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; +PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; +PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; +PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; +PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; +PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; +PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; +PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; +PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; +PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; +PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; +PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; +PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; +PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; +PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; +PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; +PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; +PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; +PFNGLGETFLOATI_VPROC glad_glGetFloati_v; +PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; +PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; +PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; +PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; +PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; +PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; +PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; +PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; +PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; +PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; +PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; +PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; +PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; +PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; +PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; +PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; +PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; +PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; +PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; +PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; +PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; +PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; +PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; +PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; +PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; +PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; +PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; +PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; +PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; +PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; +PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; +PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; +PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; +PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; +PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; +PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; +PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; +PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; +PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; +PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; +PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; +PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; +PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; +PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; +PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; +PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; +PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; +PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; +PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; +PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; +PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; +PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; +PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; +PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; +PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; +PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; +PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; +PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; +PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; +PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; +PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; +PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; +PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; +PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; +PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; +PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; +PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; +PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; +PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; +PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; +PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; +PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; +PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; +PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; +PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; +PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; +PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; +PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; +PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; +PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; +PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; +PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; +PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; +PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; +PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; +PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; +PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; +PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; +PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; +PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; +PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; +PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; +PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; +PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; +PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; +PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; +PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; +PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; +PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; +PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; +PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; +PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; +PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; +PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; +PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; +PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; +PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; +PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; +PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; +PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; +PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; +PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; +PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; +PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; +PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; +PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; +PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; +PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; +PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; +PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; +PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; +PFNGLISQUERYARBPROC glad_glIsQueryARB; +PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; +PFNGLENDQUERYARBPROC glad_glEndQueryARB; +PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; +PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; +PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; +PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; +PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; +PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; +PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; +PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; +PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; +PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; +PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; +PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; +PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; +PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; +PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; +PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; +PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; +PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; +PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; +PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; +PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; +PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; +PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; +PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; +PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; +PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; +PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; +PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; +PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; +PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; +PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; +PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; +PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; +PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; +PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; +PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; +PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; +PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; +PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; +PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; +PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; +PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; +PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; +PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; +PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; +PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; +PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; +PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; +PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; +PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; +PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; +PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; +PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; +PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; +PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; +PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; +PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; +PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; +PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; +PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; +PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; +PFNGLDEFORMSGIXPROC glad_glDeformSGIX; +PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; +PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; +PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; +PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; +PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; +PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; +PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; +PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; +PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; +PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; +PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; +PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; +PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; +PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; +PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; +PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; +PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; +PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; +PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; +PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; +PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; +PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; +PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; +PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; +PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; +PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; +PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; +PFNGLPROGRAMBINARYPROC glad_glProgramBinary; +PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; +PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; +PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; +PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; +PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; +PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; +PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; +PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; +PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; +PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; +PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; +PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; +PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; +PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; +PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; +PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; +PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; +PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; +PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; +PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; +PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; +PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; +PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; +PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; +PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; +PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; +PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; +PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; +PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; +PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; +PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; +PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; +PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; +PFNGLGENPATHSNVPROC glad_glGenPathsNV; +PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; +PFNGLISPATHNVPROC glad_glIsPathNV; +PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; +PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; +PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; +PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; +PFNGLPATHSTRINGNVPROC glad_glPathStringNV; +PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; +PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; +PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; +PFNGLCOPYPATHNVPROC glad_glCopyPathNV; +PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; +PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; +PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; +PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; +PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; +PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; +PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; +PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; +PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; +PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; +PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; +PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; +PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; +PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; +PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; +PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; +PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; +PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; +PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; +PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; +PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; +PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; +PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; +PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; +PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; +PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; +PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; +PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; +PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; +PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; +PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; +PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; +PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; +PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; +PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; +PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; +PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; +PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; +PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; +PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; +PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; +PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; +PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; +PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; +PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; +PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; +PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; +PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; +PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; +PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; +PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; +PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; +PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; +PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; +PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; +PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; +PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; +PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; +PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; +PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; +PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; +PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; +PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; +PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; +PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; +PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; +PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; +PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; +PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; +PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; +PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; +PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; +PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; +PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; +PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; +PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; +PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; +PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; +PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; +PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; +PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; +PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; +PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; +PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; +PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; +PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; +PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; +PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; +PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; +PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; +PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; +PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; +PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; +PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; +PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; +PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; +PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; +PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; +PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; +PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; +PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; +PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; +PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; +PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; +PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; +PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; +PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; +PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; +PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; +PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; +PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; +PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; +PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; +PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; +PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; +PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; +PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; +PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; +PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; +PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; +PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; +PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; +PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; +PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; +PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; +PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; +PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; +PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; +PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; +PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; +PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; +PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; +PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; +PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; +PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; +PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; +PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; +PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; +PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; +PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; +PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; +PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; +PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; +PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; +PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; +PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; +PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; +PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; +PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; +PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; +PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; +PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; +PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; +PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; +PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; +PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; +PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; +PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; +PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; +PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; +PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; +PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; +PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; +PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; +PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; +PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; +PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; +PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; +PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; +PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; +PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; +PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; +PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; +PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; +PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; +PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; +PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; +PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; +PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; +PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; +PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; +PFNGLCOLOR4XOESPROC glad_glColor4xOES; +PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; +PFNGLFOGXOESPROC glad_glFogxOES; +PFNGLFOGXVOESPROC glad_glFogxvOES; +PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; +PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; +PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; +PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; +PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; +PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; +PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; +PFNGLLIGHTXOESPROC glad_glLightxOES; +PFNGLLIGHTXVOESPROC glad_glLightxvOES; +PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; +PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; +PFNGLMATERIALXOESPROC glad_glMaterialxOES; +PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; +PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; +PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; +PFNGLNORMAL3XOESPROC glad_glNormal3xOES; +PFNGLORTHOXOESPROC glad_glOrthoxOES; +PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; +PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; +PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; +PFNGLROTATEXOESPROC glad_glRotatexOES; +PFNGLSCALEXOESPROC glad_glScalexOES; +PFNGLTEXENVXOESPROC glad_glTexEnvxOES; +PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; +PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; +PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; +PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; +PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; +PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; +PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; +PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; +PFNGLACCUMXOESPROC glad_glAccumxOES; +PFNGLBITMAPXOESPROC glad_glBitmapxOES; +PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; +PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; +PFNGLCOLOR3XOESPROC glad_glColor3xOES; +PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; +PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; +PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; +PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; +PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; +PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; +PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; +PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; +PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; +PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; +PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; +PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; +PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; +PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; +PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; +PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; +PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; +PFNGLINDEXXOESPROC glad_glIndexxOES; +PFNGLINDEXXVOESPROC glad_glIndexxvOES; +PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; +PFNGLMAP1XOESPROC glad_glMap1xOES; +PFNGLMAP2XOESPROC glad_glMap2xOES; +PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; +PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; +PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; +PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; +PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; +PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; +PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; +PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; +PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; +PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; +PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; +PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; +PFNGLPIXELMAPXPROC glad_glPixelMapx; +PFNGLPIXELSTOREXPROC glad_glPixelStorex; +PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; +PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; +PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; +PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; +PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; +PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; +PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; +PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; +PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; +PFNGLRECTXOESPROC glad_glRectxOES; +PFNGLRECTXVOESPROC glad_glRectxvOES; +PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; +PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; +PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; +PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; +PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; +PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; +PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; +PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; +PFNGLTEXGENXOESPROC glad_glTexGenxOES; +PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; +PFNGLVERTEX2XOESPROC glad_glVertex2xOES; +PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; +PFNGLVERTEX3XOESPROC glad_glVertex3xOES; +PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; +PFNGLVERTEX4XOESPROC glad_glVertex4xOES; +PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; +PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; +PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; +PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; +PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; +PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; +PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; +PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; +PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; +PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; +PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; +PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; +PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; +PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; +PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; +PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; +PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; +PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; +PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; +PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; +PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; +PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; +PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; +PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; +PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; +PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; +PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; +PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; +PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; +PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; +PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; +PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; +PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; +PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; +PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; +PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; +PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; +PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; +PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; +PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; +PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); +} +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); +} +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); +} +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); +} +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); +} +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); +} +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); +} +static void load_GL_VERSION_2_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_1) return; + glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); + glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); + glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); + glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); + glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); + glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); +} +static void load_GL_VERSION_3_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_0) return; + glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); + glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); + glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); + glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); + glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); + glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); + glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); + glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); + glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); + glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); + glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); + glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); + glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); + glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); + glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); + glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); + glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); + glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); + glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); + glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); + glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); + glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); + glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); + glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); + glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); + glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); + glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); + glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); + glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); + glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); + glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); + glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); + glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); + glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); + glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); + glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); + glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); + glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); + glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); + glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); + glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); + glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); + glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); + glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); + glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); + glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); + glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); + glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); + glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); + glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); + glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); + glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); + glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); + glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); +} +static void load_GL_VERSION_3_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_1) return; + glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); + glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); + glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); + glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); +} +static void load_GL_VERSION_3_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_2) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); + glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); + glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); + glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); +} +static void load_GL_VERSION_3_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_3) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); + glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); + glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); + glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); + glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); + glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); + glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); + glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); + glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); + glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); + glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); + glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); + glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); + glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); + glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); + glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); +} +static void load_GL_APPLE_element_array(GLADloadproc load) { + if(!GLAD_GL_APPLE_element_array) return; + glad_glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)load("glElementPointerAPPLE"); + glad_glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)load("glDrawElementArrayAPPLE"); + glad_glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)load("glDrawRangeElementArrayAPPLE"); + glad_glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)load("glMultiDrawElementArrayAPPLE"); + glad_glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)load("glMultiDrawRangeElementArrayAPPLE"); +} +static void load_GL_AMD_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_AMD_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)load("glMultiDrawArraysIndirectAMD"); + glad_glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)load("glMultiDrawElementsIndirectAMD"); +} +static void load_GL_SGIX_tag_sample_buffer(GLADloadproc load) { + if(!GLAD_GL_SGIX_tag_sample_buffer) return; + glad_glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)load("glTagSampleBufferSGIX"); +} +static void load_GL_NV_point_sprite(GLADloadproc load) { + if(!GLAD_GL_NV_point_sprite) return; + glad_glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)load("glPointParameteriNV"); + glad_glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)load("glPointParameterivNV"); +} +static void load_GL_ATI_separate_stencil(GLADloadproc load) { + if(!GLAD_GL_ATI_separate_stencil) return; + glad_glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)load("glStencilOpSeparateATI"); + glad_glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)load("glStencilFuncSeparateATI"); +} +static void load_GL_EXT_texture_buffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_buffer_object) return; + glad_glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)load("glTexBufferEXT"); +} +static void load_GL_ARB_vertex_blend(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_blend) return; + glad_glWeightbvARB = (PFNGLWEIGHTBVARBPROC)load("glWeightbvARB"); + glad_glWeightsvARB = (PFNGLWEIGHTSVARBPROC)load("glWeightsvARB"); + glad_glWeightivARB = (PFNGLWEIGHTIVARBPROC)load("glWeightivARB"); + glad_glWeightfvARB = (PFNGLWEIGHTFVARBPROC)load("glWeightfvARB"); + glad_glWeightdvARB = (PFNGLWEIGHTDVARBPROC)load("glWeightdvARB"); + glad_glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)load("glWeightubvARB"); + glad_glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)load("glWeightusvARB"); + glad_glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)load("glWeightuivARB"); + glad_glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)load("glWeightPointerARB"); + glad_glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)load("glVertexBlendARB"); +} +static void load_GL_OVR_multiview(GLADloadproc load) { + if(!GLAD_GL_OVR_multiview) return; + glad_glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)load("glFramebufferTextureMultiviewOVR"); +} +static void load_GL_ARB_program_interface_query(GLADloadproc load) { + if(!GLAD_GL_ARB_program_interface_query) return; + glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); + glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); + glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); + glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); + glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); + glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); +} +static void load_GL_EXT_index_func(GLADloadproc load) { + if(!GLAD_GL_EXT_index_func) return; + glad_glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)load("glIndexFuncEXT"); +} +static void load_GL_NV_shader_buffer_load(GLADloadproc load) { + if(!GLAD_GL_NV_shader_buffer_load) return; + glad_glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)load("glMakeBufferResidentNV"); + glad_glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)load("glMakeBufferNonResidentNV"); + glad_glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)load("glIsBufferResidentNV"); + glad_glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)load("glMakeNamedBufferResidentNV"); + glad_glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)load("glMakeNamedBufferNonResidentNV"); + glad_glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)load("glIsNamedBufferResidentNV"); + glad_glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)load("glGetBufferParameterui64vNV"); + glad_glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)load("glGetNamedBufferParameterui64vNV"); + glad_glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)load("glGetIntegerui64vNV"); + glad_glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)load("glUniformui64NV"); + glad_glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)load("glUniformui64vNV"); + glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); + glad_glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)load("glProgramUniformui64NV"); + glad_glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)load("glProgramUniformui64vNV"); +} +static void load_GL_EXT_color_subtable(GLADloadproc load) { + if(!GLAD_GL_EXT_color_subtable) return; + glad_glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)load("glColorSubTableEXT"); + glad_glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)load("glCopyColorSubTableEXT"); +} +static void load_GL_SUNX_constant_data(GLADloadproc load) { + if(!GLAD_GL_SUNX_constant_data) return; + glad_glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)load("glFinishTextureSUNX"); +} +static void load_GL_EXT_multi_draw_arrays(GLADloadproc load) { + if(!GLAD_GL_EXT_multi_draw_arrays) return; + glad_glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)load("glMultiDrawArraysEXT"); + glad_glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)load("glMultiDrawElementsEXT"); +} +static void load_GL_ARB_shader_atomic_counters(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_atomic_counters) return; + glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); +} +static void load_GL_NV_conditional_render(GLADloadproc load) { + if(!GLAD_GL_NV_conditional_render) return; + glad_glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)load("glBeginConditionalRenderNV"); + glad_glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)load("glEndConditionalRenderNV"); +} +static void load_GL_MESA_resize_buffers(GLADloadproc load) { + if(!GLAD_GL_MESA_resize_buffers) return; + glad_glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)load("glResizeBuffersMESA"); +} +static void load_GL_ARB_texture_view(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_view) return; + glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); +} +static void load_GL_ARB_map_buffer_range(GLADloadproc load) { + if(!GLAD_GL_ARB_map_buffer_range) return; + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); +} +static void load_GL_EXT_convolution(GLADloadproc load) { + if(!GLAD_GL_EXT_convolution) return; + glad_glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)load("glConvolutionFilter1DEXT"); + glad_glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)load("glConvolutionFilter2DEXT"); + glad_glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)load("glConvolutionParameterfEXT"); + glad_glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)load("glConvolutionParameterfvEXT"); + glad_glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)load("glConvolutionParameteriEXT"); + glad_glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)load("glConvolutionParameterivEXT"); + glad_glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)load("glCopyConvolutionFilter1DEXT"); + glad_glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)load("glCopyConvolutionFilter2DEXT"); + glad_glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)load("glGetConvolutionFilterEXT"); + glad_glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)load("glGetConvolutionParameterfvEXT"); + glad_glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)load("glGetConvolutionParameterivEXT"); + glad_glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)load("glGetSeparableFilterEXT"); + glad_glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)load("glSeparableFilter2DEXT"); +} +static void load_GL_NV_vertex_attrib_integer_64bit(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_attrib_integer_64bit) return; + glad_glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)load("glVertexAttribL1i64NV"); + glad_glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)load("glVertexAttribL2i64NV"); + glad_glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)load("glVertexAttribL3i64NV"); + glad_glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)load("glVertexAttribL4i64NV"); + glad_glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)load("glVertexAttribL1i64vNV"); + glad_glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)load("glVertexAttribL2i64vNV"); + glad_glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)load("glVertexAttribL3i64vNV"); + glad_glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)load("glVertexAttribL4i64vNV"); + glad_glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)load("glVertexAttribL1ui64NV"); + glad_glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)load("glVertexAttribL2ui64NV"); + glad_glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)load("glVertexAttribL3ui64NV"); + glad_glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)load("glVertexAttribL4ui64NV"); + glad_glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)load("glVertexAttribL1ui64vNV"); + glad_glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)load("glVertexAttribL2ui64vNV"); + glad_glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)load("glVertexAttribL3ui64vNV"); + glad_glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)load("glVertexAttribL4ui64vNV"); + glad_glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)load("glGetVertexAttribLi64vNV"); + glad_glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)load("glGetVertexAttribLui64vNV"); + glad_glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)load("glVertexAttribLFormatNV"); +} +static void load_GL_EXT_paletted_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_paletted_texture) return; + glad_glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)load("glColorTableEXT"); + glad_glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)load("glGetColorTableEXT"); + glad_glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)load("glGetColorTableParameterivEXT"); + glad_glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)load("glGetColorTableParameterfvEXT"); +} +static void load_GL_ARB_texture_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_buffer_object) return; + glad_glTexBufferARB = (PFNGLTEXBUFFERARBPROC)load("glTexBufferARB"); +} +static void load_GL_ATI_pn_triangles(GLADloadproc load) { + if(!GLAD_GL_ATI_pn_triangles) return; + glad_glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)load("glPNTrianglesiATI"); + glad_glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)load("glPNTrianglesfATI"); +} +static void load_GL_SGIX_flush_raster(GLADloadproc load) { + if(!GLAD_GL_SGIX_flush_raster) return; + glad_glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)load("glFlushRasterSGIX"); +} +static void load_GL_EXT_light_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_light_texture) return; + glad_glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)load("glApplyTextureEXT"); + glad_glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)load("glTextureLightEXT"); + glad_glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)load("glTextureMaterialEXT"); +} +static void load_GL_HP_image_transform(GLADloadproc load) { + if(!GLAD_GL_HP_image_transform) return; + glad_glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)load("glImageTransformParameteriHP"); + glad_glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)load("glImageTransformParameterfHP"); + glad_glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)load("glImageTransformParameterivHP"); + glad_glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)load("glImageTransformParameterfvHP"); + glad_glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)load("glGetImageTransformParameterivHP"); + glad_glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)load("glGetImageTransformParameterfvHP"); +} +static void load_GL_AMD_draw_buffers_blend(GLADloadproc load) { + if(!GLAD_GL_AMD_draw_buffers_blend) return; + glad_glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)load("glBlendFuncIndexedAMD"); + glad_glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)load("glBlendFuncSeparateIndexedAMD"); + glad_glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)load("glBlendEquationIndexedAMD"); + glad_glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)load("glBlendEquationSeparateIndexedAMD"); +} +static void load_GL_APPLE_texture_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_texture_range) return; + glad_glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)load("glTextureRangeAPPLE"); + glad_glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)load("glGetTexParameterPointervAPPLE"); +} +static void load_GL_EXT_texture_array(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_array) return; + glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); +} +static void load_GL_NV_texture_barrier(GLADloadproc load) { + if(!GLAD_GL_NV_texture_barrier) return; + glad_glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)load("glTextureBarrierNV"); +} +static void load_GL_ARB_vertex_type_2_10_10_10_rev(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_type_2_10_10_10_rev) return; + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); +} +static void load_GL_3DFX_tbuffer(GLADloadproc load) { + if(!GLAD_GL_3DFX_tbuffer) return; + glad_glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)load("glTbufferMask3DFX"); +} +static void load_GL_GREMEDY_frame_terminator(GLADloadproc load) { + if(!GLAD_GL_GREMEDY_frame_terminator) return; + glad_glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)load("glFrameTerminatorGREMEDY"); +} +static void load_GL_ARB_blend_func_extended(GLADloadproc load) { + if(!GLAD_GL_ARB_blend_func_extended) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); +} +static void load_GL_EXT_separate_shader_objects(GLADloadproc load) { + if(!GLAD_GL_EXT_separate_shader_objects) return; + glad_glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)load("glUseShaderProgramEXT"); + glad_glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)load("glActiveProgramEXT"); + glad_glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)load("glCreateShaderProgramEXT"); + glad_glActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC)load("glActiveShaderProgramEXT"); + glad_glBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC)load("glBindProgramPipelineEXT"); + glad_glCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC)load("glCreateShaderProgramvEXT"); + glad_glDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC)load("glDeleteProgramPipelinesEXT"); + glad_glGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC)load("glGenProgramPipelinesEXT"); + glad_glGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)load("glGetProgramPipelineInfoLogEXT"); + glad_glGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC)load("glGetProgramPipelineivEXT"); + glad_glIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC)load("glIsProgramPipelineEXT"); + glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); + glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); + glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); + glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); + glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); + glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); + glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); + glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); + glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); + glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); + glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); + glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); + glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); + glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); + glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); + glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); + glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); + glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); + glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC)load("glUseProgramStagesEXT"); + glad_glValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)load("glValidateProgramPipelineEXT"); + glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); + glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); + glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); + glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); + glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); + glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); + glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); + glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); + glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); + glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); + glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); + glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); + glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); +} +static void load_GL_NV_texture_multisample(GLADloadproc load) { + if(!GLAD_GL_NV_texture_multisample) return; + glad_glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTexImage2DMultisampleCoverageNV"); + glad_glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTexImage3DMultisampleCoverageNV"); + glad_glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)load("glTextureImage2DMultisampleNV"); + glad_glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)load("glTextureImage3DMultisampleNV"); + glad_glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTextureImage2DMultisampleCoverageNV"); + glad_glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTextureImage3DMultisampleCoverageNV"); +} +static void load_GL_ARB_shader_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_objects) return; + glad_glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)load("glDeleteObjectARB"); + glad_glGetHandleARB = (PFNGLGETHANDLEARBPROC)load("glGetHandleARB"); + glad_glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)load("glDetachObjectARB"); + glad_glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)load("glCreateShaderObjectARB"); + glad_glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)load("glShaderSourceARB"); + glad_glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)load("glCompileShaderARB"); + glad_glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)load("glCreateProgramObjectARB"); + glad_glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)load("glAttachObjectARB"); + glad_glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)load("glLinkProgramARB"); + glad_glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)load("glUseProgramObjectARB"); + glad_glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)load("glValidateProgramARB"); + glad_glUniform1fARB = (PFNGLUNIFORM1FARBPROC)load("glUniform1fARB"); + glad_glUniform2fARB = (PFNGLUNIFORM2FARBPROC)load("glUniform2fARB"); + glad_glUniform3fARB = (PFNGLUNIFORM3FARBPROC)load("glUniform3fARB"); + glad_glUniform4fARB = (PFNGLUNIFORM4FARBPROC)load("glUniform4fARB"); + glad_glUniform1iARB = (PFNGLUNIFORM1IARBPROC)load("glUniform1iARB"); + glad_glUniform2iARB = (PFNGLUNIFORM2IARBPROC)load("glUniform2iARB"); + glad_glUniform3iARB = (PFNGLUNIFORM3IARBPROC)load("glUniform3iARB"); + glad_glUniform4iARB = (PFNGLUNIFORM4IARBPROC)load("glUniform4iARB"); + glad_glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)load("glUniform1fvARB"); + glad_glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)load("glUniform2fvARB"); + glad_glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)load("glUniform3fvARB"); + glad_glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)load("glUniform4fvARB"); + glad_glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)load("glUniform1ivARB"); + glad_glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)load("glUniform2ivARB"); + glad_glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)load("glUniform3ivARB"); + glad_glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)load("glUniform4ivARB"); + glad_glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)load("glUniformMatrix2fvARB"); + glad_glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)load("glUniformMatrix3fvARB"); + glad_glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)load("glUniformMatrix4fvARB"); + glad_glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)load("glGetObjectParameterfvARB"); + glad_glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)load("glGetObjectParameterivARB"); + glad_glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)load("glGetInfoLogARB"); + glad_glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)load("glGetAttachedObjectsARB"); + glad_glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)load("glGetUniformLocationARB"); + glad_glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)load("glGetActiveUniformARB"); + glad_glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)load("glGetUniformfvARB"); + glad_glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)load("glGetUniformivARB"); + glad_glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)load("glGetShaderSourceARB"); +} +static void load_GL_ARB_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_framebuffer_object) return; + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); +} +static void load_GL_ATI_envmap_bumpmap(GLADloadproc load) { + if(!GLAD_GL_ATI_envmap_bumpmap) return; + glad_glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)load("glTexBumpParameterivATI"); + glad_glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)load("glTexBumpParameterfvATI"); + glad_glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)load("glGetTexBumpParameterivATI"); + glad_glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)load("glGetTexBumpParameterfvATI"); +} +static void load_GL_ATI_map_object_buffer(GLADloadproc load) { + if(!GLAD_GL_ATI_map_object_buffer) return; + glad_glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)load("glMapObjectBufferATI"); + glad_glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)load("glUnmapObjectBufferATI"); +} +static void load_GL_ARB_robustness(GLADloadproc load) { + if(!GLAD_GL_ARB_robustness) return; + glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)load("glGetGraphicsResetStatusARB"); + glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)load("glGetnTexImageARB"); + glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)load("glReadnPixelsARB"); + glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)load("glGetnCompressedTexImageARB"); + glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)load("glGetnUniformfvARB"); + glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)load("glGetnUniformivARB"); + glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)load("glGetnUniformuivARB"); + glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)load("glGetnUniformdvARB"); + glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)load("glGetnMapdvARB"); + glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)load("glGetnMapfvARB"); + glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)load("glGetnMapivARB"); + glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)load("glGetnPixelMapfvARB"); + glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)load("glGetnPixelMapuivARB"); + glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)load("glGetnPixelMapusvARB"); + glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)load("glGetnPolygonStippleARB"); + glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)load("glGetnColorTableARB"); + glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)load("glGetnConvolutionFilterARB"); + glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)load("glGetnSeparableFilterARB"); + glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)load("glGetnHistogramARB"); + glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)load("glGetnMinmaxARB"); +} +static void load_GL_NV_pixel_data_range(GLADloadproc load) { + if(!GLAD_GL_NV_pixel_data_range) return; + glad_glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)load("glPixelDataRangeNV"); + glad_glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)load("glFlushPixelDataRangeNV"); +} +static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_blit) return; + glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); +} +static void load_GL_ARB_gpu_shader_fp64(GLADloadproc load) { + if(!GLAD_GL_ARB_gpu_shader_fp64) return; + glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); + glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); + glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); + glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); + glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); + glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); + glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); + glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); + glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); + glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); + glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); + glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); + glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); + glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); + glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); + glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); + glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); + glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); +} +static void load_GL_NV_command_list(GLADloadproc load) { + if(!GLAD_GL_NV_command_list) return; + glad_glCreateStatesNV = (PFNGLCREATESTATESNVPROC)load("glCreateStatesNV"); + glad_glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)load("glDeleteStatesNV"); + glad_glIsStateNV = (PFNGLISSTATENVPROC)load("glIsStateNV"); + glad_glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)load("glStateCaptureNV"); + glad_glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)load("glGetCommandHeaderNV"); + glad_glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)load("glGetStageIndexNV"); + glad_glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)load("glDrawCommandsNV"); + glad_glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)load("glDrawCommandsAddressNV"); + glad_glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)load("glDrawCommandsStatesNV"); + glad_glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)load("glDrawCommandsStatesAddressNV"); + glad_glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)load("glCreateCommandListsNV"); + glad_glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)load("glDeleteCommandListsNV"); + glad_glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)load("glIsCommandListNV"); + glad_glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)load("glListDrawCommandsStatesClientNV"); + glad_glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)load("glCommandListSegmentsNV"); + glad_glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)load("glCompileCommandListNV"); + glad_glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)load("glCallCommandListNV"); +} +static void load_GL_EXT_vertex_weighting(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_weighting) return; + glad_glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)load("glVertexWeightfEXT"); + glad_glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)load("glVertexWeightfvEXT"); + glad_glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)load("glVertexWeightPointerEXT"); +} +static void load_GL_GREMEDY_string_marker(GLADloadproc load) { + if(!GLAD_GL_GREMEDY_string_marker) return; + glad_glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)load("glStringMarkerGREMEDY"); +} +static void load_GL_EXT_subtexture(GLADloadproc load) { + if(!GLAD_GL_EXT_subtexture) return; + glad_glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)load("glTexSubImage1DEXT"); + glad_glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)load("glTexSubImage2DEXT"); +} +static void load_GL_EXT_gpu_program_parameters(GLADloadproc load) { + if(!GLAD_GL_EXT_gpu_program_parameters) return; + glad_glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)load("glProgramEnvParameters4fvEXT"); + glad_glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glProgramLocalParameters4fvEXT"); +} +static void load_GL_NV_evaluators(GLADloadproc load) { + if(!GLAD_GL_NV_evaluators) return; + glad_glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)load("glMapControlPointsNV"); + glad_glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)load("glMapParameterivNV"); + glad_glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)load("glMapParameterfvNV"); + glad_glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)load("glGetMapControlPointsNV"); + glad_glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)load("glGetMapParameterivNV"); + glad_glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)load("glGetMapParameterfvNV"); + glad_glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)load("glGetMapAttribParameterivNV"); + glad_glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)load("glGetMapAttribParameterfvNV"); + glad_glEvalMapsNV = (PFNGLEVALMAPSNVPROC)load("glEvalMapsNV"); +} +static void load_GL_SGIS_texture_filter4(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture_filter4) return; + glad_glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)load("glGetTexFilterFuncSGIS"); + glad_glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)load("glTexFilterFuncSGIS"); +} +static void load_GL_AMD_performance_monitor(GLADloadproc load) { + if(!GLAD_GL_AMD_performance_monitor) return; + glad_glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)load("glGetPerfMonitorGroupsAMD"); + glad_glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)load("glGetPerfMonitorCountersAMD"); + glad_glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)load("glGetPerfMonitorGroupStringAMD"); + glad_glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)load("glGetPerfMonitorCounterStringAMD"); + glad_glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)load("glGetPerfMonitorCounterInfoAMD"); + glad_glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)load("glGenPerfMonitorsAMD"); + glad_glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)load("glDeletePerfMonitorsAMD"); + glad_glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)load("glSelectPerfMonitorCountersAMD"); + glad_glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)load("glBeginPerfMonitorAMD"); + glad_glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)load("glEndPerfMonitorAMD"); + glad_glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)load("glGetPerfMonitorCounterDataAMD"); +} +static void load_GL_EXT_stencil_clear_tag(GLADloadproc load) { + if(!GLAD_GL_EXT_stencil_clear_tag) return; + glad_glStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC)load("glStencilClearTagEXT"); +} +static void load_GL_NV_present_video(GLADloadproc load) { + if(!GLAD_GL_NV_present_video) return; + glad_glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)load("glPresentFrameKeyedNV"); + glad_glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)load("glPresentFrameDualFillNV"); + glad_glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)load("glGetVideoivNV"); + glad_glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)load("glGetVideouivNV"); + glad_glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)load("glGetVideoi64vNV"); + glad_glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)load("glGetVideoui64vNV"); +} +static void load_GL_SGIX_framezoom(GLADloadproc load) { + if(!GLAD_GL_SGIX_framezoom) return; + glad_glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)load("glFrameZoomSGIX"); +} +static void load_GL_ARB_draw_elements_base_vertex(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_elements_base_vertex) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); +} +static void load_GL_NV_transform_feedback(GLADloadproc load) { + if(!GLAD_GL_NV_transform_feedback) return; + glad_glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)load("glBeginTransformFeedbackNV"); + glad_glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)load("glEndTransformFeedbackNV"); + glad_glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)load("glTransformFeedbackAttribsNV"); + glad_glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)load("glBindBufferRangeNV"); + glad_glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)load("glBindBufferOffsetNV"); + glad_glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)load("glBindBufferBaseNV"); + glad_glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)load("glTransformFeedbackVaryingsNV"); + glad_glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)load("glActiveVaryingNV"); + glad_glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)load("glGetVaryingLocationNV"); + glad_glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)load("glGetActiveVaryingNV"); + glad_glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)load("glGetTransformFeedbackVaryingNV"); + glad_glTransformFeedbackStreamAttribsNV = (PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)load("glTransformFeedbackStreamAttribsNV"); +} +static void load_GL_NV_fragment_program(GLADloadproc load) { + if(!GLAD_GL_NV_fragment_program) return; + glad_glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)load("glProgramNamedParameter4fNV"); + glad_glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)load("glProgramNamedParameter4fvNV"); + glad_glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)load("glProgramNamedParameter4dNV"); + glad_glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)load("glProgramNamedParameter4dvNV"); + glad_glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)load("glGetProgramNamedParameterfvNV"); + glad_glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)load("glGetProgramNamedParameterdvNV"); +} +static void load_GL_AMD_stencil_operation_extended(GLADloadproc load) { + if(!GLAD_GL_AMD_stencil_operation_extended) return; + glad_glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)load("glStencilOpValueAMD"); +} +static void load_GL_ARB_instanced_arrays(GLADloadproc load) { + if(!GLAD_GL_ARB_instanced_arrays) return; + glad_glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)load("glVertexAttribDivisorARB"); +} +static void load_GL_EXT_polygon_offset(GLADloadproc load) { + if(!GLAD_GL_EXT_polygon_offset) return; + glad_glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)load("glPolygonOffsetEXT"); +} +static void load_GL_KHR_robustness(GLADloadproc load) { + if(!GLAD_GL_KHR_robustness) return; + glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); + glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); + glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); + glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); + glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); + glad_glGetGraphicsResetStatusKHR = (PFNGLGETGRAPHICSRESETSTATUSKHRPROC)load("glGetGraphicsResetStatusKHR"); + glad_glReadnPixelsKHR = (PFNGLREADNPIXELSKHRPROC)load("glReadnPixelsKHR"); + glad_glGetnUniformfvKHR = (PFNGLGETNUNIFORMFVKHRPROC)load("glGetnUniformfvKHR"); + glad_glGetnUniformivKHR = (PFNGLGETNUNIFORMIVKHRPROC)load("glGetnUniformivKHR"); + glad_glGetnUniformuivKHR = (PFNGLGETNUNIFORMUIVKHRPROC)load("glGetnUniformuivKHR"); +} +static void load_GL_AMD_sparse_texture(GLADloadproc load) { + if(!GLAD_GL_AMD_sparse_texture) return; + glad_glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)load("glTexStorageSparseAMD"); + glad_glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)load("glTextureStorageSparseAMD"); +} +static void load_GL_ARB_clip_control(GLADloadproc load) { + if(!GLAD_GL_ARB_clip_control) return; + glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); +} +static void load_GL_NV_fragment_coverage_to_color(GLADloadproc load) { + if(!GLAD_GL_NV_fragment_coverage_to_color) return; + glad_glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)load("glFragmentCoverageColorNV"); +} +static void load_GL_NV_fence(GLADloadproc load) { + if(!GLAD_GL_NV_fence) return; + glad_glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)load("glDeleteFencesNV"); + glad_glGenFencesNV = (PFNGLGENFENCESNVPROC)load("glGenFencesNV"); + glad_glIsFenceNV = (PFNGLISFENCENVPROC)load("glIsFenceNV"); + glad_glTestFenceNV = (PFNGLTESTFENCENVPROC)load("glTestFenceNV"); + glad_glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)load("glGetFenceivNV"); + glad_glFinishFenceNV = (PFNGLFINISHFENCENVPROC)load("glFinishFenceNV"); + glad_glSetFenceNV = (PFNGLSETFENCENVPROC)load("glSetFenceNV"); +} +static void load_GL_ARB_texture_buffer_range(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_buffer_range) return; + glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); +} +static void load_GL_SUN_mesh_array(GLADloadproc load) { + if(!GLAD_GL_SUN_mesh_array) return; + glad_glDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC)load("glDrawMeshArraysSUN"); +} +static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_attrib_binding) return; + glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); + glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); + glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); + glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); + glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); + glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); +} +static void load_GL_ARB_framebuffer_no_attachments(GLADloadproc load) { + if(!GLAD_GL_ARB_framebuffer_no_attachments) return; + glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); + glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); +} +static void load_GL_ARB_cl_event(GLADloadproc load) { + if(!GLAD_GL_ARB_cl_event) return; + glad_glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)load("glCreateSyncFromCLeventARB"); +} +static void load_GL_OES_single_precision(GLADloadproc load) { + if(!GLAD_GL_OES_single_precision) return; + glad_glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)load("glClearDepthfOES"); + glad_glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)load("glClipPlanefOES"); + glad_glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)load("glDepthRangefOES"); + glad_glFrustumfOES = (PFNGLFRUSTUMFOESPROC)load("glFrustumfOES"); + glad_glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)load("glGetClipPlanefOES"); + glad_glOrthofOES = (PFNGLORTHOFOESPROC)load("glOrthofOES"); +} +static void load_GL_NV_primitive_restart(GLADloadproc load) { + if(!GLAD_GL_NV_primitive_restart) return; + glad_glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)load("glPrimitiveRestartNV"); + glad_glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)load("glPrimitiveRestartIndexNV"); +} +static void load_GL_SUN_global_alpha(GLADloadproc load) { + if(!GLAD_GL_SUN_global_alpha) return; + glad_glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)load("glGlobalAlphaFactorbSUN"); + glad_glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)load("glGlobalAlphaFactorsSUN"); + glad_glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)load("glGlobalAlphaFactoriSUN"); + glad_glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)load("glGlobalAlphaFactorfSUN"); + glad_glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)load("glGlobalAlphaFactordSUN"); + glad_glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)load("glGlobalAlphaFactorubSUN"); + glad_glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)load("glGlobalAlphaFactorusSUN"); + glad_glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)load("glGlobalAlphaFactoruiSUN"); +} +static void load_GL_EXT_texture_object(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_object) return; + glad_glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)load("glAreTexturesResidentEXT"); + glad_glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)load("glBindTextureEXT"); + glad_glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)load("glDeleteTexturesEXT"); + glad_glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)load("glGenTexturesEXT"); + glad_glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)load("glIsTextureEXT"); + glad_glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)load("glPrioritizeTexturesEXT"); +} +static void load_GL_AMD_name_gen_delete(GLADloadproc load) { + if(!GLAD_GL_AMD_name_gen_delete) return; + glad_glGenNamesAMD = (PFNGLGENNAMESAMDPROC)load("glGenNamesAMD"); + glad_glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)load("glDeleteNamesAMD"); + glad_glIsNameAMD = (PFNGLISNAMEAMDPROC)load("glIsNameAMD"); +} +static void load_GL_ARB_buffer_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_buffer_storage) return; + glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); +} +static void load_GL_APPLE_vertex_program_evaluators(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_program_evaluators) return; + glad_glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)load("glEnableVertexAttribAPPLE"); + glad_glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)load("glDisableVertexAttribAPPLE"); + glad_glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)load("glIsVertexAttribEnabledAPPLE"); + glad_glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)load("glMapVertexAttrib1dAPPLE"); + glad_glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)load("glMapVertexAttrib1fAPPLE"); + glad_glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)load("glMapVertexAttrib2dAPPLE"); + glad_glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)load("glMapVertexAttrib2fAPPLE"); +} +static void load_GL_ARB_multi_bind(GLADloadproc load) { + if(!GLAD_GL_ARB_multi_bind) return; + glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); + glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); + glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); + glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); + glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); + glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); +} +static void load_GL_SGIX_list_priority(GLADloadproc load) { + if(!GLAD_GL_SGIX_list_priority) return; + glad_glGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC)load("glGetListParameterfvSGIX"); + glad_glGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC)load("glGetListParameterivSGIX"); + glad_glListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC)load("glListParameterfSGIX"); + glad_glListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC)load("glListParameterfvSGIX"); + glad_glListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC)load("glListParameteriSGIX"); + glad_glListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC)load("glListParameterivSGIX"); +} +static void load_GL_NV_vertex_buffer_unified_memory(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_buffer_unified_memory) return; + glad_glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)load("glBufferAddressRangeNV"); + glad_glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)load("glVertexFormatNV"); + glad_glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)load("glNormalFormatNV"); + glad_glColorFormatNV = (PFNGLCOLORFORMATNVPROC)load("glColorFormatNV"); + glad_glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)load("glIndexFormatNV"); + glad_glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)load("glTexCoordFormatNV"); + glad_glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)load("glEdgeFlagFormatNV"); + glad_glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)load("glSecondaryColorFormatNV"); + glad_glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)load("glFogCoordFormatNV"); + glad_glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)load("glVertexAttribFormatNV"); + glad_glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)load("glVertexAttribIFormatNV"); + glad_glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)load("glGetIntegerui64i_vNV"); +} +static void load_GL_NV_blend_equation_advanced(GLADloadproc load) { + if(!GLAD_GL_NV_blend_equation_advanced) return; + glad_glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)load("glBlendParameteriNV"); + glad_glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)load("glBlendBarrierNV"); +} +static void load_GL_SGIS_sharpen_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_sharpen_texture) return; + glad_glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)load("glSharpenTexFuncSGIS"); + glad_glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)load("glGetSharpenTexFuncSGIS"); +} +static void load_GL_ARB_vertex_program(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_program) return; + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); +} +static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_buffer_object) return; + glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); + glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); + glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); + glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); + glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); + glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); + glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); + glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); + glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); + glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); + glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); +} +static void load_GL_NV_vertex_array_range(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_array_range) return; + glad_glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)load("glFlushVertexArrayRangeNV"); + glad_glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)load("glVertexArrayRangeNV"); +} +static void load_GL_SGIX_fragment_lighting(GLADloadproc load) { + if(!GLAD_GL_SGIX_fragment_lighting) return; + glad_glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)load("glFragmentColorMaterialSGIX"); + glad_glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)load("glFragmentLightfSGIX"); + glad_glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)load("glFragmentLightfvSGIX"); + glad_glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)load("glFragmentLightiSGIX"); + glad_glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)load("glFragmentLightivSGIX"); + glad_glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)load("glFragmentLightModelfSGIX"); + glad_glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)load("glFragmentLightModelfvSGIX"); + glad_glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)load("glFragmentLightModeliSGIX"); + glad_glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)load("glFragmentLightModelivSGIX"); + glad_glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)load("glFragmentMaterialfSGIX"); + glad_glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)load("glFragmentMaterialfvSGIX"); + glad_glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)load("glFragmentMaterialiSGIX"); + glad_glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)load("glFragmentMaterialivSGIX"); + glad_glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)load("glGetFragmentLightfvSGIX"); + glad_glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)load("glGetFragmentLightivSGIX"); + glad_glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)load("glGetFragmentMaterialfvSGIX"); + glad_glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)load("glGetFragmentMaterialivSGIX"); + glad_glLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC)load("glLightEnviSGIX"); +} +static void load_GL_NV_framebuffer_multisample_coverage(GLADloadproc load) { + if(!GLAD_GL_NV_framebuffer_multisample_coverage) return; + glad_glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)load("glRenderbufferStorageMultisampleCoverageNV"); +} +static void load_GL_EXT_timer_query(GLADloadproc load) { + if(!GLAD_GL_EXT_timer_query) return; + glad_glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)load("glGetQueryObjecti64vEXT"); + glad_glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)load("glGetQueryObjectui64vEXT"); +} +static void load_GL_NV_bindless_texture(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_texture) return; + glad_glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)load("glGetTextureHandleNV"); + glad_glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)load("glGetTextureSamplerHandleNV"); + glad_glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)load("glMakeTextureHandleResidentNV"); + glad_glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)load("glMakeTextureHandleNonResidentNV"); + glad_glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)load("glGetImageHandleNV"); + glad_glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)load("glMakeImageHandleResidentNV"); + glad_glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)load("glMakeImageHandleNonResidentNV"); + glad_glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)load("glUniformHandleui64NV"); + glad_glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)load("glUniformHandleui64vNV"); + glad_glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)load("glProgramUniformHandleui64NV"); + glad_glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)load("glProgramUniformHandleui64vNV"); + glad_glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)load("glIsTextureHandleResidentNV"); + glad_glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)load("glIsImageHandleResidentNV"); +} +static void load_GL_KHR_debug(GLADloadproc load) { + if(!GLAD_GL_KHR_debug) return; + glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); + glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); + glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); + glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); + glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); + glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); + glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); + glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); + glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); + glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); + glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); + glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); + glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); + glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); + glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); + glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); + glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); + glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); + glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); + glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); +} +static void load_GL_ATI_vertex_attrib_array_object(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_attrib_array_object) return; + glad_glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)load("glVertexAttribArrayObjectATI"); + glad_glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)load("glGetVertexAttribArrayObjectfvATI"); + glad_glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)load("glGetVertexAttribArrayObjectivATI"); +} +static void load_GL_EXT_geometry_shader4(GLADloadproc load) { + if(!GLAD_GL_EXT_geometry_shader4) return; + glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); +} +static void load_GL_EXT_bindable_uniform(GLADloadproc load) { + if(!GLAD_GL_EXT_bindable_uniform) return; + glad_glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)load("glUniformBufferEXT"); + glad_glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)load("glGetUniformBufferSizeEXT"); + glad_glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)load("glGetUniformOffsetEXT"); +} +static void load_GL_KHR_blend_equation_advanced(GLADloadproc load) { + if(!GLAD_GL_KHR_blend_equation_advanced) return; + glad_glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)load("glBlendBarrierKHR"); +} +static void load_GL_ATI_element_array(GLADloadproc load) { + if(!GLAD_GL_ATI_element_array) return; + glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); + glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); + glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); +} +static void load_GL_SGIX_reference_plane(GLADloadproc load) { + if(!GLAD_GL_SGIX_reference_plane) return; + glad_glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)load("glReferencePlaneSGIX"); +} +static void load_GL_EXT_stencil_two_side(GLADloadproc load) { + if(!GLAD_GL_EXT_stencil_two_side) return; + glad_glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)load("glActiveStencilFaceEXT"); +} +static void load_GL_NV_explicit_multisample(GLADloadproc load) { + if(!GLAD_GL_NV_explicit_multisample) return; + glad_glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)load("glGetMultisamplefvNV"); + glad_glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)load("glSampleMaskIndexedNV"); + glad_glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)load("glTexRenderbufferNV"); +} +static void load_GL_IBM_static_data(GLADloadproc load) { + if(!GLAD_GL_IBM_static_data) return; + glad_glFlushStaticDataIBM = (PFNGLFLUSHSTATICDATAIBMPROC)load("glFlushStaticDataIBM"); +} +static void load_GL_EXT_texture_perturb_normal(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_perturb_normal) return; + glad_glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)load("glTextureNormalEXT"); +} +static void load_GL_EXT_point_parameters(GLADloadproc load) { + if(!GLAD_GL_EXT_point_parameters) return; + glad_glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)load("glPointParameterfEXT"); + glad_glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)load("glPointParameterfvEXT"); +} +static void load_GL_PGI_misc_hints(GLADloadproc load) { + if(!GLAD_GL_PGI_misc_hints) return; + glad_glHintPGI = (PFNGLHINTPGIPROC)load("glHintPGI"); +} +static void load_GL_ARB_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_shader) return; + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); + glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); + glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); +} +static void load_GL_ARB_tessellation_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_tessellation_shader) return; + glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); + glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); +} +static void load_GL_EXT_draw_buffers2(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_buffers2) return; + glad_glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)load("glColorMaskIndexedEXT"); + glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); + glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); + glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); + glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); + glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); +} +static void load_GL_ARB_vertex_attrib_64bit(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_attrib_64bit) return; + glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); + glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); + glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); + glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); + glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); + glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); + glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); + glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); + glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); + glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); +} +static void load_GL_EXT_texture_filter_minmax(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_filter_minmax) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); +} +static void load_GL_AMD_interleaved_elements(GLADloadproc load) { + if(!GLAD_GL_AMD_interleaved_elements) return; + glad_glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)load("glVertexAttribParameteriAMD"); +} +static void load_GL_ARB_fragment_program(GLADloadproc load) { + if(!GLAD_GL_ARB_fragment_program) return; + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); +} +static void load_GL_ARB_texture_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_storage) return; + glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); + glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); + glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); +} +static void load_GL_ARB_copy_image(GLADloadproc load) { + if(!GLAD_GL_ARB_copy_image) return; + glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); +} +static void load_GL_SGIS_pixel_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_pixel_texture) return; + glad_glPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC)load("glPixelTexGenParameteriSGIS"); + glad_glPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC)load("glPixelTexGenParameterivSGIS"); + glad_glPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC)load("glPixelTexGenParameterfSGIS"); + glad_glPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC)load("glPixelTexGenParameterfvSGIS"); + glad_glGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)load("glGetPixelTexGenParameterivSGIS"); + glad_glGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)load("glGetPixelTexGenParameterfvSGIS"); +} +static void load_GL_SGIX_instruments(GLADloadproc load) { + if(!GLAD_GL_SGIX_instruments) return; + glad_glGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC)load("glGetInstrumentsSGIX"); + glad_glInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC)load("glInstrumentsBufferSGIX"); + glad_glPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC)load("glPollInstrumentsSGIX"); + glad_glReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC)load("glReadInstrumentsSGIX"); + glad_glStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC)load("glStartInstrumentsSGIX"); + glad_glStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC)load("glStopInstrumentsSGIX"); +} +static void load_GL_ARB_shader_storage_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_storage_buffer_object) return; + glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); +} +static void load_GL_EXT_blend_minmax(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_minmax) return; + glad_glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)load("glBlendEquationEXT"); +} +static void load_GL_ARB_base_instance(GLADloadproc load) { + if(!GLAD_GL_ARB_base_instance) return; + glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); + glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); + glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); +} +static void load_GL_ARB_ES3_1_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES3_1_compatibility) return; + glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); +} +static void load_GL_EXT_texture_integer(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_integer) return; + glad_glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)load("glTexParameterIivEXT"); + glad_glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)load("glTexParameterIuivEXT"); + glad_glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)load("glGetTexParameterIivEXT"); + glad_glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)load("glGetTexParameterIuivEXT"); + glad_glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)load("glClearColorIiEXT"); + glad_glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)load("glClearColorIuiEXT"); +} +static void load_GL_ARB_texture_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_multisample) return; + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); +} +static void load_GL_AMD_gpu_shader_int64(GLADloadproc load) { + if(!GLAD_GL_AMD_gpu_shader_int64) return; + glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); + glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); + glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); + glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); + glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); + glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); + glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); + glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); + glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); + glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); + glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); + glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); + glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); + glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); + glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); + glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); + glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); + glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); + glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); + glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); + glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); + glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); + glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); + glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); + glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); + glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); + glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); + glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); + glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); + glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); + glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); + glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); + glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); + glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); +} +static void load_GL_AMD_vertex_shader_tessellator(GLADloadproc load) { + if(!GLAD_GL_AMD_vertex_shader_tessellator) return; + glad_glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)load("glTessellationFactorAMD"); + glad_glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)load("glTessellationModeAMD"); +} +static void load_GL_ARB_invalidate_subdata(GLADloadproc load) { + if(!GLAD_GL_ARB_invalidate_subdata) return; + glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); + glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); + glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); + glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); + glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); + glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); +} +static void load_GL_EXT_index_material(GLADloadproc load) { + if(!GLAD_GL_EXT_index_material) return; + glad_glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)load("glIndexMaterialEXT"); +} +static void load_GL_INTEL_parallel_arrays(GLADloadproc load) { + if(!GLAD_GL_INTEL_parallel_arrays) return; + glad_glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)load("glVertexPointervINTEL"); + glad_glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)load("glNormalPointervINTEL"); + glad_glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)load("glColorPointervINTEL"); + glad_glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)load("glTexCoordPointervINTEL"); +} +static void load_GL_ATI_draw_buffers(GLADloadproc load) { + if(!GLAD_GL_ATI_draw_buffers) return; + glad_glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)load("glDrawBuffersATI"); +} +static void load_GL_SGIX_pixel_texture(GLADloadproc load) { + if(!GLAD_GL_SGIX_pixel_texture) return; + glad_glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)load("glPixelTexGenSGIX"); +} +static void load_GL_ARB_timer_query(GLADloadproc load) { + if(!GLAD_GL_ARB_timer_query) return; + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); +} +static void load_GL_NV_parameter_buffer_object(GLADloadproc load) { + if(!GLAD_GL_NV_parameter_buffer_object) return; + glad_glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)load("glProgramBufferParametersfvNV"); + glad_glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)load("glProgramBufferParametersIivNV"); + glad_glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)load("glProgramBufferParametersIuivNV"); +} +static void load_GL_ARB_direct_state_access(GLADloadproc load) { + if(!GLAD_GL_ARB_direct_state_access) return; + glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); + glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); + glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); + glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); + glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); + glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); + glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); + glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); + glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); + glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); + glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); + glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); + glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); + glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); + glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); + glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); + glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); + glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); + glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); + glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); + glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); + glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); + glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); + glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); + glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); + glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); + glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); + glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); + glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); + glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); + glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); + glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); + glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); + glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); + glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); + glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); + glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); + glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); + glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); + glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); + glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); + glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); + glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); + glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); + glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); + glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); + glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); + glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); + glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); + glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); + glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); + glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); + glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); + glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); + glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); + glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); + glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); + glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); + glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); + glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); + glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); + glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); + glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); + glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); + glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); + glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); + glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); + glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); + glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); + glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); + glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); + glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); + glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); + glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); + glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); + glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); + glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); + glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); + glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); + glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); + glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); + glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); + glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); + glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); + glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); + glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); + glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); + glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); + glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); + glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); + glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); + glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); + glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); + glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); + glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); + glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); + glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); +} +static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_uniform_buffer_object) return; + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); +} +static void load_GL_NV_transform_feedback2(GLADloadproc load) { + if(!GLAD_GL_NV_transform_feedback2) return; + glad_glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)load("glBindTransformFeedbackNV"); + glad_glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)load("glDeleteTransformFeedbacksNV"); + glad_glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)load("glGenTransformFeedbacksNV"); + glad_glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)load("glIsTransformFeedbackNV"); + glad_glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)load("glPauseTransformFeedbackNV"); + glad_glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)load("glResumeTransformFeedbackNV"); + glad_glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)load("glDrawTransformFeedbackNV"); +} +static void load_GL_EXT_blend_color(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_color) return; + glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); +} +static void load_GL_EXT_histogram(GLADloadproc load) { + if(!GLAD_GL_EXT_histogram) return; + glad_glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)load("glGetHistogramEXT"); + glad_glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)load("glGetHistogramParameterfvEXT"); + glad_glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)load("glGetHistogramParameterivEXT"); + glad_glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)load("glGetMinmaxEXT"); + glad_glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)load("glGetMinmaxParameterfvEXT"); + glad_glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)load("glGetMinmaxParameterivEXT"); + glad_glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)load("glHistogramEXT"); + glad_glMinmaxEXT = (PFNGLMINMAXEXTPROC)load("glMinmaxEXT"); + glad_glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)load("glResetHistogramEXT"); + glad_glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)load("glResetMinmaxEXT"); +} +static void load_GL_ARB_get_texture_sub_image(GLADloadproc load) { + if(!GLAD_GL_ARB_get_texture_sub_image) return; + glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); + glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); +} +static void load_GL_SGIS_point_parameters(GLADloadproc load) { + if(!GLAD_GL_SGIS_point_parameters) return; + glad_glPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC)load("glPointParameterfSGIS"); + glad_glPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC)load("glPointParameterfvSGIS"); +} +static void load_GL_EXT_direct_state_access(GLADloadproc load) { + if(!GLAD_GL_EXT_direct_state_access) return; + glad_glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)load("glMatrixLoadfEXT"); + glad_glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)load("glMatrixLoaddEXT"); + glad_glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)load("glMatrixMultfEXT"); + glad_glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)load("glMatrixMultdEXT"); + glad_glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)load("glMatrixLoadIdentityEXT"); + glad_glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)load("glMatrixRotatefEXT"); + glad_glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)load("glMatrixRotatedEXT"); + glad_glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)load("glMatrixScalefEXT"); + glad_glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)load("glMatrixScaledEXT"); + glad_glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)load("glMatrixTranslatefEXT"); + glad_glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)load("glMatrixTranslatedEXT"); + glad_glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)load("glMatrixFrustumEXT"); + glad_glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)load("glMatrixOrthoEXT"); + glad_glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)load("glMatrixPopEXT"); + glad_glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)load("glMatrixPushEXT"); + glad_glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)load("glClientAttribDefaultEXT"); + glad_glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)load("glPushClientAttribDefaultEXT"); + glad_glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)load("glTextureParameterfEXT"); + glad_glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)load("glTextureParameterfvEXT"); + glad_glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)load("glTextureParameteriEXT"); + glad_glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)load("glTextureParameterivEXT"); + glad_glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)load("glTextureImage1DEXT"); + glad_glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)load("glTextureImage2DEXT"); + glad_glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)load("glTextureSubImage1DEXT"); + glad_glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)load("glTextureSubImage2DEXT"); + glad_glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)load("glCopyTextureImage1DEXT"); + glad_glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)load("glCopyTextureImage2DEXT"); + glad_glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)load("glCopyTextureSubImage1DEXT"); + glad_glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)load("glCopyTextureSubImage2DEXT"); + glad_glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)load("glGetTextureImageEXT"); + glad_glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)load("glGetTextureParameterfvEXT"); + glad_glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)load("glGetTextureParameterivEXT"); + glad_glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)load("glGetTextureLevelParameterfvEXT"); + glad_glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)load("glGetTextureLevelParameterivEXT"); + glad_glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)load("glTextureImage3DEXT"); + glad_glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)load("glTextureSubImage3DEXT"); + glad_glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)load("glCopyTextureSubImage3DEXT"); + glad_glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)load("glBindMultiTextureEXT"); + glad_glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)load("glMultiTexCoordPointerEXT"); + glad_glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)load("glMultiTexEnvfEXT"); + glad_glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)load("glMultiTexEnvfvEXT"); + glad_glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)load("glMultiTexEnviEXT"); + glad_glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)load("glMultiTexEnvivEXT"); + glad_glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)load("glMultiTexGendEXT"); + glad_glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)load("glMultiTexGendvEXT"); + glad_glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)load("glMultiTexGenfEXT"); + glad_glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)load("glMultiTexGenfvEXT"); + glad_glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)load("glMultiTexGeniEXT"); + glad_glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)load("glMultiTexGenivEXT"); + glad_glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)load("glGetMultiTexEnvfvEXT"); + glad_glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)load("glGetMultiTexEnvivEXT"); + glad_glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)load("glGetMultiTexGendvEXT"); + glad_glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)load("glGetMultiTexGenfvEXT"); + glad_glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)load("glGetMultiTexGenivEXT"); + glad_glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)load("glMultiTexParameteriEXT"); + glad_glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)load("glMultiTexParameterivEXT"); + glad_glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)load("glMultiTexParameterfEXT"); + glad_glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)load("glMultiTexParameterfvEXT"); + glad_glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)load("glMultiTexImage1DEXT"); + glad_glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)load("glMultiTexImage2DEXT"); + glad_glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)load("glMultiTexSubImage1DEXT"); + glad_glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)load("glMultiTexSubImage2DEXT"); + glad_glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)load("glCopyMultiTexImage1DEXT"); + glad_glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)load("glCopyMultiTexImage2DEXT"); + glad_glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)load("glCopyMultiTexSubImage1DEXT"); + glad_glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)load("glCopyMultiTexSubImage2DEXT"); + glad_glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)load("glGetMultiTexImageEXT"); + glad_glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)load("glGetMultiTexParameterfvEXT"); + glad_glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)load("glGetMultiTexParameterivEXT"); + glad_glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)load("glGetMultiTexLevelParameterfvEXT"); + glad_glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)load("glGetMultiTexLevelParameterivEXT"); + glad_glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)load("glMultiTexImage3DEXT"); + glad_glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)load("glMultiTexSubImage3DEXT"); + glad_glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)load("glCopyMultiTexSubImage3DEXT"); + glad_glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)load("glEnableClientStateIndexedEXT"); + glad_glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)load("glDisableClientStateIndexedEXT"); + glad_glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)load("glGetFloatIndexedvEXT"); + glad_glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)load("glGetDoubleIndexedvEXT"); + glad_glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)load("glGetPointerIndexedvEXT"); + glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); + glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); + glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); + glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); + glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); + glad_glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)load("glCompressedTextureImage3DEXT"); + glad_glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)load("glCompressedTextureImage2DEXT"); + glad_glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)load("glCompressedTextureImage1DEXT"); + glad_glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)load("glCompressedTextureSubImage3DEXT"); + glad_glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)load("glCompressedTextureSubImage2DEXT"); + glad_glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)load("glCompressedTextureSubImage1DEXT"); + glad_glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)load("glGetCompressedTextureImageEXT"); + glad_glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)load("glCompressedMultiTexImage3DEXT"); + glad_glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)load("glCompressedMultiTexImage2DEXT"); + glad_glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)load("glCompressedMultiTexImage1DEXT"); + glad_glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)load("glCompressedMultiTexSubImage3DEXT"); + glad_glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)load("glCompressedMultiTexSubImage2DEXT"); + glad_glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)load("glCompressedMultiTexSubImage1DEXT"); + glad_glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)load("glGetCompressedMultiTexImageEXT"); + glad_glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)load("glMatrixLoadTransposefEXT"); + glad_glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)load("glMatrixLoadTransposedEXT"); + glad_glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)load("glMatrixMultTransposefEXT"); + glad_glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)load("glMatrixMultTransposedEXT"); + glad_glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)load("glNamedBufferDataEXT"); + glad_glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)load("glNamedBufferSubDataEXT"); + glad_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)load("glMapNamedBufferEXT"); + glad_glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)load("glUnmapNamedBufferEXT"); + glad_glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)load("glGetNamedBufferParameterivEXT"); + glad_glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)load("glGetNamedBufferPointervEXT"); + glad_glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)load("glGetNamedBufferSubDataEXT"); + glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); + glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); + glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); + glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); + glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); + glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); + glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); + glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); + glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); + glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); + glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); + glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); + glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); + glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); + glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); + glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); + glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); + glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); + glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); + glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); + glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); + glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); + glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); + glad_glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)load("glTextureBufferEXT"); + glad_glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)load("glMultiTexBufferEXT"); + glad_glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)load("glTextureParameterIivEXT"); + glad_glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)load("glTextureParameterIuivEXT"); + glad_glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)load("glGetTextureParameterIivEXT"); + glad_glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)load("glGetTextureParameterIuivEXT"); + glad_glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)load("glMultiTexParameterIivEXT"); + glad_glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)load("glMultiTexParameterIuivEXT"); + glad_glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)load("glGetMultiTexParameterIivEXT"); + glad_glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)load("glGetMultiTexParameterIuivEXT"); + glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); + glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); + glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); + glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); + glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); + glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); + glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); + glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); + glad_glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glNamedProgramLocalParameters4fvEXT"); + glad_glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)load("glNamedProgramLocalParameterI4iEXT"); + glad_glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)load("glNamedProgramLocalParameterI4ivEXT"); + glad_glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)load("glNamedProgramLocalParametersI4ivEXT"); + glad_glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)load("glNamedProgramLocalParameterI4uiEXT"); + glad_glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)load("glNamedProgramLocalParameterI4uivEXT"); + glad_glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)load("glNamedProgramLocalParametersI4uivEXT"); + glad_glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)load("glGetNamedProgramLocalParameterIivEXT"); + glad_glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)load("glGetNamedProgramLocalParameterIuivEXT"); + glad_glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)load("glEnableClientStateiEXT"); + glad_glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)load("glDisableClientStateiEXT"); + glad_glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)load("glGetFloati_vEXT"); + glad_glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)load("glGetDoublei_vEXT"); + glad_glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)load("glGetPointeri_vEXT"); + glad_glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)load("glNamedProgramStringEXT"); + glad_glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)load("glNamedProgramLocalParameter4dEXT"); + glad_glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)load("glNamedProgramLocalParameter4dvEXT"); + glad_glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)load("glNamedProgramLocalParameter4fEXT"); + glad_glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)load("glNamedProgramLocalParameter4fvEXT"); + glad_glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)load("glGetNamedProgramLocalParameterdvEXT"); + glad_glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)load("glGetNamedProgramLocalParameterfvEXT"); + glad_glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)load("glGetNamedProgramivEXT"); + glad_glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)load("glGetNamedProgramStringEXT"); + glad_glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)load("glNamedRenderbufferStorageEXT"); + glad_glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)load("glGetNamedRenderbufferParameterivEXT"); + glad_glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glNamedRenderbufferStorageMultisampleEXT"); + glad_glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)load("glNamedRenderbufferStorageMultisampleCoverageEXT"); + glad_glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)load("glCheckNamedFramebufferStatusEXT"); + glad_glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)load("glNamedFramebufferTexture1DEXT"); + glad_glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)load("glNamedFramebufferTexture2DEXT"); + glad_glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)load("glNamedFramebufferTexture3DEXT"); + glad_glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)load("glNamedFramebufferRenderbufferEXT"); + glad_glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetNamedFramebufferAttachmentParameterivEXT"); + glad_glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)load("glGenerateTextureMipmapEXT"); + glad_glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)load("glGenerateMultiTexMipmapEXT"); + glad_glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)load("glFramebufferDrawBufferEXT"); + glad_glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)load("glFramebufferDrawBuffersEXT"); + glad_glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)load("glFramebufferReadBufferEXT"); + glad_glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetFramebufferParameterivEXT"); + glad_glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)load("glNamedCopyBufferSubDataEXT"); + glad_glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)load("glNamedFramebufferTextureEXT"); + glad_glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)load("glNamedFramebufferTextureLayerEXT"); + glad_glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)load("glNamedFramebufferTextureFaceEXT"); + glad_glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)load("glTextureRenderbufferEXT"); + glad_glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)load("glMultiTexRenderbufferEXT"); + glad_glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)load("glVertexArrayVertexOffsetEXT"); + glad_glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)load("glVertexArrayColorOffsetEXT"); + glad_glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)load("glVertexArrayEdgeFlagOffsetEXT"); + glad_glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)load("glVertexArrayIndexOffsetEXT"); + glad_glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)load("glVertexArrayNormalOffsetEXT"); + glad_glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)load("glVertexArrayTexCoordOffsetEXT"); + glad_glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)load("glVertexArrayMultiTexCoordOffsetEXT"); + glad_glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)load("glVertexArrayFogCoordOffsetEXT"); + glad_glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)load("glVertexArraySecondaryColorOffsetEXT"); + glad_glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)load("glVertexArrayVertexAttribOffsetEXT"); + glad_glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)load("glVertexArrayVertexAttribIOffsetEXT"); + glad_glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)load("glEnableVertexArrayEXT"); + glad_glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)load("glDisableVertexArrayEXT"); + glad_glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)load("glEnableVertexArrayAttribEXT"); + glad_glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)load("glDisableVertexArrayAttribEXT"); + glad_glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)load("glGetVertexArrayIntegervEXT"); + glad_glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)load("glGetVertexArrayPointervEXT"); + glad_glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)load("glGetVertexArrayIntegeri_vEXT"); + glad_glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)load("glGetVertexArrayPointeri_vEXT"); + glad_glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)load("glMapNamedBufferRangeEXT"); + glad_glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)load("glFlushMappedNamedBufferRangeEXT"); + glad_glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)load("glNamedBufferStorageEXT"); + glad_glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)load("glClearNamedBufferDataEXT"); + glad_glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)load("glClearNamedBufferSubDataEXT"); + glad_glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)load("glNamedFramebufferParameteriEXT"); + glad_glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetNamedFramebufferParameterivEXT"); + glad_glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)load("glProgramUniform1dEXT"); + glad_glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)load("glProgramUniform2dEXT"); + glad_glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)load("glProgramUniform3dEXT"); + glad_glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)load("glProgramUniform4dEXT"); + glad_glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)load("glProgramUniform1dvEXT"); + glad_glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)load("glProgramUniform2dvEXT"); + glad_glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)load("glProgramUniform3dvEXT"); + glad_glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)load("glProgramUniform4dvEXT"); + glad_glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)load("glProgramUniformMatrix2dvEXT"); + glad_glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)load("glProgramUniformMatrix3dvEXT"); + glad_glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)load("glProgramUniformMatrix4dvEXT"); + glad_glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)load("glProgramUniformMatrix2x3dvEXT"); + glad_glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)load("glProgramUniformMatrix2x4dvEXT"); + glad_glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)load("glProgramUniformMatrix3x2dvEXT"); + glad_glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)load("glProgramUniformMatrix3x4dvEXT"); + glad_glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)load("glProgramUniformMatrix4x2dvEXT"); + glad_glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)load("glProgramUniformMatrix4x3dvEXT"); + glad_glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)load("glTextureBufferRangeEXT"); + glad_glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)load("glTextureStorage1DEXT"); + glad_glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)load("glTextureStorage2DEXT"); + glad_glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)load("glTextureStorage3DEXT"); + glad_glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)load("glTextureStorage2DMultisampleEXT"); + glad_glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)load("glTextureStorage3DMultisampleEXT"); + glad_glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)load("glVertexArrayBindVertexBufferEXT"); + glad_glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)load("glVertexArrayVertexAttribFormatEXT"); + glad_glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)load("glVertexArrayVertexAttribIFormatEXT"); + glad_glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)load("glVertexArrayVertexAttribLFormatEXT"); + glad_glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)load("glVertexArrayVertexAttribBindingEXT"); + glad_glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)load("glVertexArrayVertexBindingDivisorEXT"); + glad_glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)load("glVertexArrayVertexAttribLOffsetEXT"); + glad_glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)load("glTexturePageCommitmentEXT"); + glad_glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)load("glVertexArrayVertexAttribDivisorEXT"); +} +static void load_GL_AMD_sample_positions(GLADloadproc load) { + if(!GLAD_GL_AMD_sample_positions) return; + glad_glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)load("glSetMultisamplefvAMD"); +} +static void load_GL_NV_vertex_program(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_program) return; + glad_glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)load("glAreProgramsResidentNV"); + glad_glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)load("glBindProgramNV"); + glad_glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)load("glDeleteProgramsNV"); + glad_glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)load("glExecuteProgramNV"); + glad_glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)load("glGenProgramsNV"); + glad_glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)load("glGetProgramParameterdvNV"); + glad_glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)load("glGetProgramParameterfvNV"); + glad_glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)load("glGetProgramivNV"); + glad_glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)load("glGetProgramStringNV"); + glad_glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)load("glGetTrackMatrixivNV"); + glad_glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)load("glGetVertexAttribdvNV"); + glad_glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)load("glGetVertexAttribfvNV"); + glad_glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)load("glGetVertexAttribivNV"); + glad_glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)load("glGetVertexAttribPointervNV"); + glad_glIsProgramNV = (PFNGLISPROGRAMNVPROC)load("glIsProgramNV"); + glad_glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)load("glLoadProgramNV"); + glad_glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)load("glProgramParameter4dNV"); + glad_glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)load("glProgramParameter4dvNV"); + glad_glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)load("glProgramParameter4fNV"); + glad_glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)load("glProgramParameter4fvNV"); + glad_glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)load("glProgramParameters4dvNV"); + glad_glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)load("glProgramParameters4fvNV"); + glad_glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)load("glRequestResidentProgramsNV"); + glad_glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)load("glTrackMatrixNV"); + glad_glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)load("glVertexAttribPointerNV"); + glad_glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)load("glVertexAttrib1dNV"); + glad_glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)load("glVertexAttrib1dvNV"); + glad_glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)load("glVertexAttrib1fNV"); + glad_glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)load("glVertexAttrib1fvNV"); + glad_glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)load("glVertexAttrib1sNV"); + glad_glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)load("glVertexAttrib1svNV"); + glad_glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)load("glVertexAttrib2dNV"); + glad_glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)load("glVertexAttrib2dvNV"); + glad_glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)load("glVertexAttrib2fNV"); + glad_glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)load("glVertexAttrib2fvNV"); + glad_glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)load("glVertexAttrib2sNV"); + glad_glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)load("glVertexAttrib2svNV"); + glad_glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)load("glVertexAttrib3dNV"); + glad_glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)load("glVertexAttrib3dvNV"); + glad_glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)load("glVertexAttrib3fNV"); + glad_glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)load("glVertexAttrib3fvNV"); + glad_glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)load("glVertexAttrib3sNV"); + glad_glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)load("glVertexAttrib3svNV"); + glad_glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)load("glVertexAttrib4dNV"); + glad_glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)load("glVertexAttrib4dvNV"); + glad_glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)load("glVertexAttrib4fNV"); + glad_glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)load("glVertexAttrib4fvNV"); + glad_glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)load("glVertexAttrib4sNV"); + glad_glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)load("glVertexAttrib4svNV"); + glad_glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)load("glVertexAttrib4ubNV"); + glad_glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)load("glVertexAttrib4ubvNV"); + glad_glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)load("glVertexAttribs1dvNV"); + glad_glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)load("glVertexAttribs1fvNV"); + glad_glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)load("glVertexAttribs1svNV"); + glad_glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)load("glVertexAttribs2dvNV"); + glad_glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)load("glVertexAttribs2fvNV"); + glad_glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)load("glVertexAttribs2svNV"); + glad_glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)load("glVertexAttribs3dvNV"); + glad_glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)load("glVertexAttribs3fvNV"); + glad_glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)load("glVertexAttribs3svNV"); + glad_glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)load("glVertexAttribs4dvNV"); + glad_glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)load("glVertexAttribs4fvNV"); + glad_glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)load("glVertexAttribs4svNV"); + glad_glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)load("glVertexAttribs4ubvNV"); +} +static void load_GL_EXT_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_shader) return; + glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); + glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); + glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); + glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); + glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); + glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); + glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); + glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); + glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); + glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); + glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); + glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); + glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); + glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); + glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); + glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); + glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); + glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); + glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); + glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); + glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); + glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); + glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); + glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); + glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); + glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); + glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); + glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); + glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); + glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); + glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); + glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); + glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); + glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); + glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); + glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); + glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); + glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); + glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); + glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); + glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); + glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); +} +static void load_GL_EXT_blend_func_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_func_separate) return; + glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); +} +static void load_GL_APPLE_fence(GLADloadproc load) { + if(!GLAD_GL_APPLE_fence) return; + glad_glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)load("glGenFencesAPPLE"); + glad_glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)load("glDeleteFencesAPPLE"); + glad_glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)load("glSetFenceAPPLE"); + glad_glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)load("glIsFenceAPPLE"); + glad_glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)load("glTestFenceAPPLE"); + glad_glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)load("glFinishFenceAPPLE"); + glad_glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)load("glTestObjectAPPLE"); + glad_glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)load("glFinishObjectAPPLE"); +} +static void load_GL_OES_byte_coordinates(GLADloadproc load) { + if(!GLAD_GL_OES_byte_coordinates) return; + glad_glMultiTexCoord1bOES = (PFNGLMULTITEXCOORD1BOESPROC)load("glMultiTexCoord1bOES"); + glad_glMultiTexCoord1bvOES = (PFNGLMULTITEXCOORD1BVOESPROC)load("glMultiTexCoord1bvOES"); + glad_glMultiTexCoord2bOES = (PFNGLMULTITEXCOORD2BOESPROC)load("glMultiTexCoord2bOES"); + glad_glMultiTexCoord2bvOES = (PFNGLMULTITEXCOORD2BVOESPROC)load("glMultiTexCoord2bvOES"); + glad_glMultiTexCoord3bOES = (PFNGLMULTITEXCOORD3BOESPROC)load("glMultiTexCoord3bOES"); + glad_glMultiTexCoord3bvOES = (PFNGLMULTITEXCOORD3BVOESPROC)load("glMultiTexCoord3bvOES"); + glad_glMultiTexCoord4bOES = (PFNGLMULTITEXCOORD4BOESPROC)load("glMultiTexCoord4bOES"); + glad_glMultiTexCoord4bvOES = (PFNGLMULTITEXCOORD4BVOESPROC)load("glMultiTexCoord4bvOES"); + glad_glTexCoord1bOES = (PFNGLTEXCOORD1BOESPROC)load("glTexCoord1bOES"); + glad_glTexCoord1bvOES = (PFNGLTEXCOORD1BVOESPROC)load("glTexCoord1bvOES"); + glad_glTexCoord2bOES = (PFNGLTEXCOORD2BOESPROC)load("glTexCoord2bOES"); + glad_glTexCoord2bvOES = (PFNGLTEXCOORD2BVOESPROC)load("glTexCoord2bvOES"); + glad_glTexCoord3bOES = (PFNGLTEXCOORD3BOESPROC)load("glTexCoord3bOES"); + glad_glTexCoord3bvOES = (PFNGLTEXCOORD3BVOESPROC)load("glTexCoord3bvOES"); + glad_glTexCoord4bOES = (PFNGLTEXCOORD4BOESPROC)load("glTexCoord4bOES"); + glad_glTexCoord4bvOES = (PFNGLTEXCOORD4BVOESPROC)load("glTexCoord4bvOES"); + glad_glVertex2bOES = (PFNGLVERTEX2BOESPROC)load("glVertex2bOES"); + glad_glVertex2bvOES = (PFNGLVERTEX2BVOESPROC)load("glVertex2bvOES"); + glad_glVertex3bOES = (PFNGLVERTEX3BOESPROC)load("glVertex3bOES"); + glad_glVertex3bvOES = (PFNGLVERTEX3BVOESPROC)load("glVertex3bvOES"); + glad_glVertex4bOES = (PFNGLVERTEX4BOESPROC)load("glVertex4bOES"); + glad_glVertex4bvOES = (PFNGLVERTEX4BVOESPROC)load("glVertex4bvOES"); +} +static void load_GL_ARB_transpose_matrix(GLADloadproc load) { + if(!GLAD_GL_ARB_transpose_matrix) return; + glad_glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)load("glLoadTransposeMatrixfARB"); + glad_glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)load("glLoadTransposeMatrixdARB"); + glad_glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)load("glMultTransposeMatrixfARB"); + glad_glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)load("glMultTransposeMatrixdARB"); +} +static void load_GL_ARB_provoking_vertex(GLADloadproc load) { + if(!GLAD_GL_ARB_provoking_vertex) return; + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); +} +static void load_GL_EXT_fog_coord(GLADloadproc load) { + if(!GLAD_GL_EXT_fog_coord) return; + glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); + glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); + glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); + glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); + glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); +} +static void load_GL_EXT_vertex_array(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_array) return; + glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); + glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); + glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); + glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); + glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); + glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); + glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); + glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); + glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); +} +static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_equation_separate) return; + glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); +} +static void load_GL_NV_framebuffer_mixed_samples(GLADloadproc load) { + if(!GLAD_GL_NV_framebuffer_mixed_samples) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); + glad_glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)load("glCoverageModulationTableNV"); + glad_glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)load("glGetCoverageModulationTableNV"); + glad_glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)load("glCoverageModulationNV"); +} +static void load_GL_NVX_conditional_render(GLADloadproc load) { + if(!GLAD_GL_NVX_conditional_render) return; + glad_glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)load("glBeginConditionalRenderNVX"); + glad_glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)load("glEndConditionalRenderNVX"); +} +static void load_GL_ARB_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_ARB_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); + glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); +} +static void load_GL_EXT_raster_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_raster_multisample) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); +} +static void load_GL_NV_copy_image(GLADloadproc load) { + if(!GLAD_GL_NV_copy_image) return; + glad_glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)load("glCopyImageSubDataNV"); +} +static void load_GL_INTEL_framebuffer_CMAA(GLADloadproc load) { + if(!GLAD_GL_INTEL_framebuffer_CMAA) return; + glad_glApplyFramebufferAttachmentCMAAINTEL = (PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)load("glApplyFramebufferAttachmentCMAAINTEL"); +} +static void load_GL_ARB_transform_feedback2(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback2) return; + glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); + glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); + glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); + glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); + glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); + glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); + glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); +} +static void load_GL_ARB_transform_feedback3(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback3) return; + glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); + glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); + glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); + glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); +} +static void load_GL_EXT_debug_marker(GLADloadproc load) { + if(!GLAD_GL_EXT_debug_marker) return; + glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); + glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); + glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); +} +static void load_GL_EXT_pixel_transform(GLADloadproc load) { + if(!GLAD_GL_EXT_pixel_transform) return; + glad_glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)load("glPixelTransformParameteriEXT"); + glad_glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)load("glPixelTransformParameterfEXT"); + glad_glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)load("glPixelTransformParameterivEXT"); + glad_glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)load("glPixelTransformParameterfvEXT"); + glad_glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)load("glGetPixelTransformParameterivEXT"); + glad_glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)load("glGetPixelTransformParameterfvEXT"); +} +static void load_GL_ATI_fragment_shader(GLADloadproc load) { + if(!GLAD_GL_ATI_fragment_shader) return; + glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); + glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); + glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); + glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); + glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); + glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); + glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); + glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); + glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); + glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); + glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); + glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); + glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); + glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); +} +static void load_GL_ARB_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_array_object) return; + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); +} +static void load_GL_SUN_triangle_list(GLADloadproc load) { + if(!GLAD_GL_SUN_triangle_list) return; + glad_glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)load("glReplacementCodeuiSUN"); + glad_glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)load("glReplacementCodeusSUN"); + glad_glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)load("glReplacementCodeubSUN"); + glad_glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)load("glReplacementCodeuivSUN"); + glad_glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)load("glReplacementCodeusvSUN"); + glad_glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)load("glReplacementCodeubvSUN"); + glad_glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)load("glReplacementCodePointerSUN"); +} +static void load_GL_ARB_transform_feedback_instanced(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback_instanced) return; + glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); + glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); +} +static void load_GL_SGIX_async(GLADloadproc load) { + if(!GLAD_GL_SGIX_async) return; + glad_glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)load("glAsyncMarkerSGIX"); + glad_glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)load("glFinishAsyncSGIX"); + glad_glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)load("glPollAsyncSGIX"); + glad_glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)load("glGenAsyncMarkersSGIX"); + glad_glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)load("glDeleteAsyncMarkersSGIX"); + glad_glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)load("glIsAsyncMarkerSGIX"); +} +static void load_GL_INTEL_performance_query(GLADloadproc load) { + if(!GLAD_GL_INTEL_performance_query) return; + glad_glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)load("glBeginPerfQueryINTEL"); + glad_glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)load("glCreatePerfQueryINTEL"); + glad_glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)load("glDeletePerfQueryINTEL"); + glad_glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)load("glEndPerfQueryINTEL"); + glad_glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)load("glGetFirstPerfQueryIdINTEL"); + glad_glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)load("glGetNextPerfQueryIdINTEL"); + glad_glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)load("glGetPerfCounterInfoINTEL"); + glad_glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)load("glGetPerfQueryDataINTEL"); + glad_glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)load("glGetPerfQueryIdByNameINTEL"); + glad_glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)load("glGetPerfQueryInfoINTEL"); +} +static void load_GL_NV_gpu_shader5(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_shader5) return; + glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); + glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); + glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); + glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); + glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); + glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); + glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); + glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); + glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); + glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); + glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); + glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); + glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); + glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); + glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); + glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); + glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); + glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); + glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); + glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); + glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); + glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); + glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); + glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); + glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); + glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); + glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); + glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); + glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); + glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); + glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); + glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); + glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); +} +static void load_GL_NV_bindless_multi_draw_indirect_count(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_multi_draw_indirect_count) return; + glad_glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawArraysIndirectBindlessCountNV"); + glad_glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawElementsIndirectBindlessCountNV"); +} +static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES2_compatibility) return; + glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); + glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); + glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); +} +static void load_GL_ARB_indirect_parameters(GLADloadproc load) { + if(!GLAD_GL_ARB_indirect_parameters) return; + glad_glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)load("glMultiDrawArraysIndirectCountARB"); + glad_glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)load("glMultiDrawElementsIndirectCountARB"); +} +static void load_GL_NV_half_float(GLADloadproc load) { + if(!GLAD_GL_NV_half_float) return; + glad_glVertex2hNV = (PFNGLVERTEX2HNVPROC)load("glVertex2hNV"); + glad_glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)load("glVertex2hvNV"); + glad_glVertex3hNV = (PFNGLVERTEX3HNVPROC)load("glVertex3hNV"); + glad_glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)load("glVertex3hvNV"); + glad_glVertex4hNV = (PFNGLVERTEX4HNVPROC)load("glVertex4hNV"); + glad_glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)load("glVertex4hvNV"); + glad_glNormal3hNV = (PFNGLNORMAL3HNVPROC)load("glNormal3hNV"); + glad_glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)load("glNormal3hvNV"); + glad_glColor3hNV = (PFNGLCOLOR3HNVPROC)load("glColor3hNV"); + glad_glColor3hvNV = (PFNGLCOLOR3HVNVPROC)load("glColor3hvNV"); + glad_glColor4hNV = (PFNGLCOLOR4HNVPROC)load("glColor4hNV"); + glad_glColor4hvNV = (PFNGLCOLOR4HVNVPROC)load("glColor4hvNV"); + glad_glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)load("glTexCoord1hNV"); + glad_glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)load("glTexCoord1hvNV"); + glad_glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)load("glTexCoord2hNV"); + glad_glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)load("glTexCoord2hvNV"); + glad_glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)load("glTexCoord3hNV"); + glad_glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)load("glTexCoord3hvNV"); + glad_glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)load("glTexCoord4hNV"); + glad_glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)load("glTexCoord4hvNV"); + glad_glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)load("glMultiTexCoord1hNV"); + glad_glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)load("glMultiTexCoord1hvNV"); + glad_glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)load("glMultiTexCoord2hNV"); + glad_glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)load("glMultiTexCoord2hvNV"); + glad_glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)load("glMultiTexCoord3hNV"); + glad_glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)load("glMultiTexCoord3hvNV"); + glad_glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)load("glMultiTexCoord4hNV"); + glad_glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)load("glMultiTexCoord4hvNV"); + glad_glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)load("glFogCoordhNV"); + glad_glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)load("glFogCoordhvNV"); + glad_glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)load("glSecondaryColor3hNV"); + glad_glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)load("glSecondaryColor3hvNV"); + glad_glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)load("glVertexWeighthNV"); + glad_glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)load("glVertexWeighthvNV"); + glad_glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)load("glVertexAttrib1hNV"); + glad_glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)load("glVertexAttrib1hvNV"); + glad_glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)load("glVertexAttrib2hNV"); + glad_glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)load("glVertexAttrib2hvNV"); + glad_glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)load("glVertexAttrib3hNV"); + glad_glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)load("glVertexAttrib3hvNV"); + glad_glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)load("glVertexAttrib4hNV"); + glad_glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)load("glVertexAttrib4hvNV"); + glad_glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)load("glVertexAttribs1hvNV"); + glad_glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)load("glVertexAttribs2hvNV"); + glad_glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)load("glVertexAttribs3hvNV"); + glad_glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)load("glVertexAttribs4hvNV"); +} +static void load_GL_ARB_ES3_2_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES3_2_compatibility) return; + glad_glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)load("glPrimitiveBoundingBoxARB"); +} +static void load_GL_EXT_polygon_offset_clamp(GLADloadproc load) { + if(!GLAD_GL_EXT_polygon_offset_clamp) return; + glad_glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)load("glPolygonOffsetClampEXT"); +} +static void load_GL_EXT_compiled_vertex_array(GLADloadproc load) { + if(!GLAD_GL_EXT_compiled_vertex_array) return; + glad_glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)load("glLockArraysEXT"); + glad_glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)load("glUnlockArraysEXT"); +} +static void load_GL_NV_depth_buffer_float(GLADloadproc load) { + if(!GLAD_GL_NV_depth_buffer_float) return; + glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); + glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); + glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); +} +static void load_GL_NV_occlusion_query(GLADloadproc load) { + if(!GLAD_GL_NV_occlusion_query) return; + glad_glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)load("glGenOcclusionQueriesNV"); + glad_glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)load("glDeleteOcclusionQueriesNV"); + glad_glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)load("glIsOcclusionQueryNV"); + glad_glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)load("glBeginOcclusionQueryNV"); + glad_glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)load("glEndOcclusionQueryNV"); + glad_glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)load("glGetOcclusionQueryivNV"); + glad_glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)load("glGetOcclusionQueryuivNV"); +} +static void load_GL_APPLE_flush_buffer_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_flush_buffer_range) return; + glad_glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)load("glBufferParameteriAPPLE"); + glad_glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)load("glFlushMappedBufferRangeAPPLE"); +} +static void load_GL_ARB_imaging(GLADloadproc load) { + if(!GLAD_GL_ARB_imaging) return; + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); + glad_glColorTable = (PFNGLCOLORTABLEPROC)load("glColorTable"); + glad_glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)load("glColorTableParameterfv"); + glad_glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)load("glColorTableParameteriv"); + glad_glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)load("glCopyColorTable"); + glad_glGetColorTable = (PFNGLGETCOLORTABLEPROC)load("glGetColorTable"); + glad_glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)load("glGetColorTableParameterfv"); + glad_glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)load("glGetColorTableParameteriv"); + glad_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)load("glColorSubTable"); + glad_glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)load("glCopyColorSubTable"); + glad_glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)load("glConvolutionFilter1D"); + glad_glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)load("glConvolutionFilter2D"); + glad_glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)load("glConvolutionParameterf"); + glad_glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)load("glConvolutionParameterfv"); + glad_glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)load("glConvolutionParameteri"); + glad_glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)load("glConvolutionParameteriv"); + glad_glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)load("glCopyConvolutionFilter1D"); + glad_glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)load("glCopyConvolutionFilter2D"); + glad_glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)load("glGetConvolutionFilter"); + glad_glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)load("glGetConvolutionParameterfv"); + glad_glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)load("glGetConvolutionParameteriv"); + glad_glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)load("glGetSeparableFilter"); + glad_glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)load("glSeparableFilter2D"); + glad_glGetHistogram = (PFNGLGETHISTOGRAMPROC)load("glGetHistogram"); + glad_glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)load("glGetHistogramParameterfv"); + glad_glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)load("glGetHistogramParameteriv"); + glad_glGetMinmax = (PFNGLGETMINMAXPROC)load("glGetMinmax"); + glad_glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)load("glGetMinmaxParameterfv"); + glad_glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)load("glGetMinmaxParameteriv"); + glad_glHistogram = (PFNGLHISTOGRAMPROC)load("glHistogram"); + glad_glMinmax = (PFNGLMINMAXPROC)load("glMinmax"); + glad_glResetHistogram = (PFNGLRESETHISTOGRAMPROC)load("glResetHistogram"); + glad_glResetMinmax = (PFNGLRESETMINMAXPROC)load("glResetMinmax"); +} +static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers_blend) return; + glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); + glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); + glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); + glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); +} +static void load_GL_ARB_clear_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_clear_buffer_object) return; + glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); + glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); +} +static void load_GL_ARB_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_multisample) return; + glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); +} +static void load_GL_EXT_debug_label(GLADloadproc load) { + if(!GLAD_GL_EXT_debug_label) return; + glad_glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)load("glLabelObjectEXT"); + glad_glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)load("glGetObjectLabelEXT"); +} +static void load_GL_ARB_sample_shading(GLADloadproc load) { + if(!GLAD_GL_ARB_sample_shading) return; + glad_glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)load("glMinSampleShadingARB"); +} +static void load_GL_NV_internalformat_sample_query(GLADloadproc load) { + if(!GLAD_GL_NV_internalformat_sample_query) return; + glad_glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)load("glGetInternalformatSampleivNV"); +} +static void load_GL_INTEL_map_texture(GLADloadproc load) { + if(!GLAD_GL_INTEL_map_texture) return; + glad_glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)load("glSyncTextureINTEL"); + glad_glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)load("glUnmapTexture2DINTEL"); + glad_glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)load("glMapTexture2DINTEL"); +} +static void load_GL_ARB_compute_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_compute_shader) return; + glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); + glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); +} +static void load_GL_IBM_vertex_array_lists(GLADloadproc load) { + if(!GLAD_GL_IBM_vertex_array_lists) return; + glad_glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)load("glColorPointerListIBM"); + glad_glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)load("glSecondaryColorPointerListIBM"); + glad_glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)load("glEdgeFlagPointerListIBM"); + glad_glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)load("glFogCoordPointerListIBM"); + glad_glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)load("glIndexPointerListIBM"); + glad_glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)load("glNormalPointerListIBM"); + glad_glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)load("glTexCoordPointerListIBM"); + glad_glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)load("glVertexPointerListIBM"); +} +static void load_GL_ARB_color_buffer_float(GLADloadproc load) { + if(!GLAD_GL_ARB_color_buffer_float) return; + glad_glClampColorARB = (PFNGLCLAMPCOLORARBPROC)load("glClampColorARB"); +} +static void load_GL_ARB_bindless_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_bindless_texture) return; + glad_glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)load("glGetTextureHandleARB"); + glad_glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)load("glGetTextureSamplerHandleARB"); + glad_glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)load("glMakeTextureHandleResidentARB"); + glad_glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)load("glMakeTextureHandleNonResidentARB"); + glad_glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)load("glGetImageHandleARB"); + glad_glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)load("glMakeImageHandleResidentARB"); + glad_glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)load("glMakeImageHandleNonResidentARB"); + glad_glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)load("glUniformHandleui64ARB"); + glad_glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)load("glUniformHandleui64vARB"); + glad_glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)load("glProgramUniformHandleui64ARB"); + glad_glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)load("glProgramUniformHandleui64vARB"); + glad_glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)load("glIsTextureHandleResidentARB"); + glad_glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)load("glIsImageHandleResidentARB"); + glad_glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)load("glVertexAttribL1ui64ARB"); + glad_glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)load("glVertexAttribL1ui64vARB"); + glad_glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)load("glGetVertexAttribLui64vARB"); +} +static void load_GL_ARB_window_pos(GLADloadproc load) { + if(!GLAD_GL_ARB_window_pos) return; + glad_glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)load("glWindowPos2dARB"); + glad_glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)load("glWindowPos2dvARB"); + glad_glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)load("glWindowPos2fARB"); + glad_glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)load("glWindowPos2fvARB"); + glad_glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)load("glWindowPos2iARB"); + glad_glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)load("glWindowPos2ivARB"); + glad_glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)load("glWindowPos2sARB"); + glad_glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)load("glWindowPos2svARB"); + glad_glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)load("glWindowPos3dARB"); + glad_glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)load("glWindowPos3dvARB"); + glad_glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)load("glWindowPos3fARB"); + glad_glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)load("glWindowPos3fvARB"); + glad_glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)load("glWindowPos3iARB"); + glad_glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)load("glWindowPos3ivARB"); + glad_glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)load("glWindowPos3sARB"); + glad_glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)load("glWindowPos3svARB"); +} +static void load_GL_ARB_internalformat_query(GLADloadproc load) { + if(!GLAD_GL_ARB_internalformat_query) return; + glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); +} +static void load_GL_EXT_shader_image_load_store(GLADloadproc load) { + if(!GLAD_GL_EXT_shader_image_load_store) return; + glad_glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)load("glBindImageTextureEXT"); + glad_glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)load("glMemoryBarrierEXT"); +} +static void load_GL_EXT_copy_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_copy_texture) return; + glad_glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)load("glCopyTexImage1DEXT"); + glad_glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)load("glCopyTexImage2DEXT"); + glad_glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)load("glCopyTexSubImage1DEXT"); + glad_glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)load("glCopyTexSubImage2DEXT"); + glad_glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)load("glCopyTexSubImage3DEXT"); +} +static void load_GL_NV_register_combiners2(GLADloadproc load) { + if(!GLAD_GL_NV_register_combiners2) return; + glad_glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)load("glCombinerStageParameterfvNV"); + glad_glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)load("glGetCombinerStageParameterfvNV"); +} +static void load_GL_NV_draw_texture(GLADloadproc load) { + if(!GLAD_GL_NV_draw_texture) return; + glad_glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)load("glDrawTextureNV"); +} +static void load_GL_EXT_draw_instanced(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_instanced) return; + glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load("glDrawArraysInstancedEXT"); + glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load("glDrawElementsInstancedEXT"); +} +static void load_GL_ARB_viewport_array(GLADloadproc load) { + if(!GLAD_GL_ARB_viewport_array) return; + glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); + glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); + glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); + glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); + glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); + glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); + glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); + glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); + glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); + glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); +} +static void load_GL_ARB_separate_shader_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_separate_shader_objects) return; + glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); + glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); + glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); + glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); + glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); + glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); + glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); + glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); + glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); + glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); + glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); + glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); + glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); + glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); + glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); + glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); + glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); + glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); + glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); + glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); + glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); + glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); + glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); + glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); + glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); + glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); + glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); + glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); + glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); + glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); + glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); + glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); + glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); + glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); + glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); + glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); + glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); + glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); + glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); + glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); + glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); + glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); + glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); + glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); + glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); + glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); + glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); + glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); + glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); + glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); + glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); + glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); + glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); + glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); + glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); + glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); + glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); + glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); + glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); + glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); +} +static void load_GL_EXT_depth_bounds_test(GLADloadproc load) { + if(!GLAD_GL_EXT_depth_bounds_test) return; + glad_glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)load("glDepthBoundsEXT"); +} +static void load_GL_NV_video_capture(GLADloadproc load) { + if(!GLAD_GL_NV_video_capture) return; + glad_glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)load("glBeginVideoCaptureNV"); + glad_glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)load("glBindVideoCaptureStreamBufferNV"); + glad_glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)load("glBindVideoCaptureStreamTextureNV"); + glad_glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)load("glEndVideoCaptureNV"); + glad_glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)load("glGetVideoCaptureivNV"); + glad_glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)load("glGetVideoCaptureStreamivNV"); + glad_glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)load("glGetVideoCaptureStreamfvNV"); + glad_glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)load("glGetVideoCaptureStreamdvNV"); + glad_glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)load("glVideoCaptureNV"); + glad_glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)load("glVideoCaptureStreamParameterivNV"); + glad_glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)load("glVideoCaptureStreamParameterfvNV"); + glad_glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)load("glVideoCaptureStreamParameterdvNV"); +} +static void load_GL_ARB_sampler_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_sampler_objects) return; + glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); + glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); + glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); + glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); + glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); + glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); + glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); + glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); + glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); + glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); + glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); + glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); + glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); + glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); +} +static void load_GL_ARB_matrix_palette(GLADloadproc load) { + if(!GLAD_GL_ARB_matrix_palette) return; + glad_glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)load("glCurrentPaletteMatrixARB"); + glad_glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)load("glMatrixIndexubvARB"); + glad_glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)load("glMatrixIndexusvARB"); + glad_glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)load("glMatrixIndexuivARB"); + glad_glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)load("glMatrixIndexPointerARB"); +} +static void load_GL_SGIS_texture_color_mask(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture_color_mask) return; + glad_glTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC)load("glTextureColorMaskSGIS"); +} +static void load_GL_EXT_coordinate_frame(GLADloadproc load) { + if(!GLAD_GL_EXT_coordinate_frame) return; + glad_glTangent3bEXT = (PFNGLTANGENT3BEXTPROC)load("glTangent3bEXT"); + glad_glTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC)load("glTangent3bvEXT"); + glad_glTangent3dEXT = (PFNGLTANGENT3DEXTPROC)load("glTangent3dEXT"); + glad_glTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC)load("glTangent3dvEXT"); + glad_glTangent3fEXT = (PFNGLTANGENT3FEXTPROC)load("glTangent3fEXT"); + glad_glTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC)load("glTangent3fvEXT"); + glad_glTangent3iEXT = (PFNGLTANGENT3IEXTPROC)load("glTangent3iEXT"); + glad_glTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC)load("glTangent3ivEXT"); + glad_glTangent3sEXT = (PFNGLTANGENT3SEXTPROC)load("glTangent3sEXT"); + glad_glTangent3svEXT = (PFNGLTANGENT3SVEXTPROC)load("glTangent3svEXT"); + glad_glBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC)load("glBinormal3bEXT"); + glad_glBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC)load("glBinormal3bvEXT"); + glad_glBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC)load("glBinormal3dEXT"); + glad_glBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC)load("glBinormal3dvEXT"); + glad_glBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC)load("glBinormal3fEXT"); + glad_glBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC)load("glBinormal3fvEXT"); + glad_glBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC)load("glBinormal3iEXT"); + glad_glBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC)load("glBinormal3ivEXT"); + glad_glBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC)load("glBinormal3sEXT"); + glad_glBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC)load("glBinormal3svEXT"); + glad_glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)load("glTangentPointerEXT"); + glad_glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)load("glBinormalPointerEXT"); +} +static void load_GL_ARB_texture_compression(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_compression) return; + glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); + glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); + glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); + glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); + glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); + glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); + glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); +} +static void load_GL_ARB_shader_subroutine(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_subroutine) return; + glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); + glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); + glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); + glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); + glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); + glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); + glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); + glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); +} +static void load_GL_ARB_texture_storage_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_storage_multisample) return; + glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); + glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); +} +static void load_GL_EXT_vertex_attrib_64bit(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_attrib_64bit) return; + glad_glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)load("glVertexAttribL1dEXT"); + glad_glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)load("glVertexAttribL2dEXT"); + glad_glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)load("glVertexAttribL3dEXT"); + glad_glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)load("glVertexAttribL4dEXT"); + glad_glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)load("glVertexAttribL1dvEXT"); + glad_glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)load("glVertexAttribL2dvEXT"); + glad_glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)load("glVertexAttribL3dvEXT"); + glad_glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)load("glVertexAttribL4dvEXT"); + glad_glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)load("glVertexAttribLPointerEXT"); + glad_glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)load("glGetVertexAttribLdvEXT"); +} +static void load_GL_OES_query_matrix(GLADloadproc load) { + if(!GLAD_GL_OES_query_matrix) return; + glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); +} +static void load_GL_MESA_window_pos(GLADloadproc load) { + if(!GLAD_GL_MESA_window_pos) return; + glad_glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)load("glWindowPos2dMESA"); + glad_glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)load("glWindowPos2dvMESA"); + glad_glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)load("glWindowPos2fMESA"); + glad_glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)load("glWindowPos2fvMESA"); + glad_glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)load("glWindowPos2iMESA"); + glad_glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)load("glWindowPos2ivMESA"); + glad_glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)load("glWindowPos2sMESA"); + glad_glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)load("glWindowPos2svMESA"); + glad_glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)load("glWindowPos3dMESA"); + glad_glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)load("glWindowPos3dvMESA"); + glad_glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)load("glWindowPos3fMESA"); + glad_glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)load("glWindowPos3fvMESA"); + glad_glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)load("glWindowPos3iMESA"); + glad_glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)load("glWindowPos3ivMESA"); + glad_glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)load("glWindowPos3sMESA"); + glad_glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)load("glWindowPos3svMESA"); + glad_glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)load("glWindowPos4dMESA"); + glad_glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)load("glWindowPos4dvMESA"); + glad_glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)load("glWindowPos4fMESA"); + glad_glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)load("glWindowPos4fvMESA"); + glad_glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)load("glWindowPos4iMESA"); + glad_glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)load("glWindowPos4ivMESA"); + glad_glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)load("glWindowPos4sMESA"); + glad_glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)load("glWindowPos4svMESA"); +} +static void load_GL_ARB_copy_buffer(GLADloadproc load) { + if(!GLAD_GL_ARB_copy_buffer) return; + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); +} +static void load_GL_APPLE_object_purgeable(GLADloadproc load) { + if(!GLAD_GL_APPLE_object_purgeable) return; + glad_glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)load("glObjectPurgeableAPPLE"); + glad_glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)load("glObjectUnpurgeableAPPLE"); + glad_glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)load("glGetObjectParameterivAPPLE"); +} +static void load_GL_ARB_occlusion_query(GLADloadproc load) { + if(!GLAD_GL_ARB_occlusion_query) return; + glad_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)load("glGenQueriesARB"); + glad_glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)load("glDeleteQueriesARB"); + glad_glIsQueryARB = (PFNGLISQUERYARBPROC)load("glIsQueryARB"); + glad_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)load("glBeginQueryARB"); + glad_glEndQueryARB = (PFNGLENDQUERYARBPROC)load("glEndQueryARB"); + glad_glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)load("glGetQueryivARB"); + glad_glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)load("glGetQueryObjectivARB"); + glad_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)load("glGetQueryObjectuivARB"); +} +static void load_GL_SGI_color_table(GLADloadproc load) { + if(!GLAD_GL_SGI_color_table) return; + glad_glColorTableSGI = (PFNGLCOLORTABLESGIPROC)load("glColorTableSGI"); + glad_glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)load("glColorTableParameterfvSGI"); + glad_glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)load("glColorTableParameterivSGI"); + glad_glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)load("glCopyColorTableSGI"); + glad_glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)load("glGetColorTableSGI"); + glad_glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)load("glGetColorTableParameterfvSGI"); + glad_glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)load("glGetColorTableParameterivSGI"); +} +static void load_GL_EXT_gpu_shader4(GLADloadproc load) { + if(!GLAD_GL_EXT_gpu_shader4) return; + glad_glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)load("glGetUniformuivEXT"); + glad_glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)load("glBindFragDataLocationEXT"); + glad_glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)load("glGetFragDataLocationEXT"); + glad_glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)load("glUniform1uiEXT"); + glad_glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)load("glUniform2uiEXT"); + glad_glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)load("glUniform3uiEXT"); + glad_glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)load("glUniform4uiEXT"); + glad_glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)load("glUniform1uivEXT"); + glad_glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)load("glUniform2uivEXT"); + glad_glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)load("glUniform3uivEXT"); + glad_glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)load("glUniform4uivEXT"); +} +static void load_GL_NV_geometry_program4(GLADloadproc load) { + if(!GLAD_GL_NV_geometry_program4) return; + glad_glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)load("glProgramVertexLimitNV"); + glad_glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)load("glFramebufferTextureEXT"); + glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); + glad_glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)load("glFramebufferTextureFaceEXT"); +} +static void load_GL_AMD_debug_output(GLADloadproc load) { + if(!GLAD_GL_AMD_debug_output) return; + glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); + glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); + glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); + glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); +} +static void load_GL_ARB_multitexture(GLADloadproc load) { + if(!GLAD_GL_ARB_multitexture) return; + glad_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)load("glActiveTextureARB"); + glad_glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)load("glClientActiveTextureARB"); + glad_glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)load("glMultiTexCoord1dARB"); + glad_glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)load("glMultiTexCoord1dvARB"); + glad_glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)load("glMultiTexCoord1fARB"); + glad_glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)load("glMultiTexCoord1fvARB"); + glad_glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)load("glMultiTexCoord1iARB"); + glad_glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)load("glMultiTexCoord1ivARB"); + glad_glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)load("glMultiTexCoord1sARB"); + glad_glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)load("glMultiTexCoord1svARB"); + glad_glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)load("glMultiTexCoord2dARB"); + glad_glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)load("glMultiTexCoord2dvARB"); + glad_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)load("glMultiTexCoord2fARB"); + glad_glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)load("glMultiTexCoord2fvARB"); + glad_glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)load("glMultiTexCoord2iARB"); + glad_glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)load("glMultiTexCoord2ivARB"); + glad_glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)load("glMultiTexCoord2sARB"); + glad_glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)load("glMultiTexCoord2svARB"); + glad_glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)load("glMultiTexCoord3dARB"); + glad_glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)load("glMultiTexCoord3dvARB"); + glad_glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)load("glMultiTexCoord3fARB"); + glad_glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)load("glMultiTexCoord3fvARB"); + glad_glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)load("glMultiTexCoord3iARB"); + glad_glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)load("glMultiTexCoord3ivARB"); + glad_glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)load("glMultiTexCoord3sARB"); + glad_glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)load("glMultiTexCoord3svARB"); + glad_glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)load("glMultiTexCoord4dARB"); + glad_glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)load("glMultiTexCoord4dvARB"); + glad_glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)load("glMultiTexCoord4fARB"); + glad_glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)load("glMultiTexCoord4fvARB"); + glad_glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)load("glMultiTexCoord4iARB"); + glad_glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)load("glMultiTexCoord4ivARB"); + glad_glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)load("glMultiTexCoord4sARB"); + glad_glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)load("glMultiTexCoord4svARB"); +} +static void load_GL_SGIX_polynomial_ffd(GLADloadproc load) { + if(!GLAD_GL_SGIX_polynomial_ffd) return; + glad_glDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC)load("glDeformationMap3dSGIX"); + glad_glDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC)load("glDeformationMap3fSGIX"); + glad_glDeformSGIX = (PFNGLDEFORMSGIXPROC)load("glDeformSGIX"); + glad_glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)load("glLoadIdentityDeformationMapSGIX"); +} +static void load_GL_EXT_provoking_vertex(GLADloadproc load) { + if(!GLAD_GL_EXT_provoking_vertex) return; + glad_glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)load("glProvokingVertexEXT"); +} +static void load_GL_ARB_point_parameters(GLADloadproc load) { + if(!GLAD_GL_ARB_point_parameters) return; + glad_glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)load("glPointParameterfARB"); + glad_glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)load("glPointParameterfvARB"); +} +static void load_GL_ARB_shader_image_load_store(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_image_load_store) return; + glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); + glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); +} +static void load_GL_ARB_texture_barrier(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_barrier) return; + glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); +} +static void load_GL_NV_bindless_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)load("glMultiDrawArraysIndirectBindlessNV"); + glad_glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)load("glMultiDrawElementsIndirectBindlessNV"); +} +static void load_GL_EXT_transform_feedback(GLADloadproc load) { + if(!GLAD_GL_EXT_transform_feedback) return; + glad_glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)load("glBeginTransformFeedbackEXT"); + glad_glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)load("glEndTransformFeedbackEXT"); + glad_glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)load("glBindBufferRangeEXT"); + glad_glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)load("glBindBufferOffsetEXT"); + glad_glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)load("glBindBufferBaseEXT"); + glad_glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)load("glTransformFeedbackVaryingsEXT"); + glad_glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)load("glGetTransformFeedbackVaryingEXT"); +} +static void load_GL_NV_gpu_program4(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_program4) return; + glad_glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)load("glProgramLocalParameterI4iNV"); + glad_glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)load("glProgramLocalParameterI4ivNV"); + glad_glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)load("glProgramLocalParametersI4ivNV"); + glad_glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)load("glProgramLocalParameterI4uiNV"); + glad_glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)load("glProgramLocalParameterI4uivNV"); + glad_glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)load("glProgramLocalParametersI4uivNV"); + glad_glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)load("glProgramEnvParameterI4iNV"); + glad_glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)load("glProgramEnvParameterI4ivNV"); + glad_glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)load("glProgramEnvParametersI4ivNV"); + glad_glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)load("glProgramEnvParameterI4uiNV"); + glad_glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)load("glProgramEnvParameterI4uivNV"); + glad_glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)load("glProgramEnvParametersI4uivNV"); + glad_glGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)load("glGetProgramLocalParameterIivNV"); + glad_glGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)load("glGetProgramLocalParameterIuivNV"); + glad_glGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)load("glGetProgramEnvParameterIivNV"); + glad_glGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)load("glGetProgramEnvParameterIuivNV"); +} +static void load_GL_NV_gpu_program5(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_program5) return; + glad_glProgramSubroutineParametersuivNV = (PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)load("glProgramSubroutineParametersuivNV"); + glad_glGetProgramSubroutineParameteruivNV = (PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)load("glGetProgramSubroutineParameteruivNV"); +} +static void load_GL_ARB_geometry_shader4(GLADloadproc load) { + if(!GLAD_GL_ARB_geometry_shader4) return; + glad_glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)load("glProgramParameteriARB"); + glad_glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)load("glFramebufferTextureARB"); + glad_glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)load("glFramebufferTextureLayerARB"); + glad_glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)load("glFramebufferTextureFaceARB"); +} +static void load_GL_NV_conservative_raster(GLADloadproc load) { + if(!GLAD_GL_NV_conservative_raster) return; + glad_glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)load("glSubpixelPrecisionBiasNV"); +} +static void load_GL_SGIX_sprite(GLADloadproc load) { + if(!GLAD_GL_SGIX_sprite) return; + glad_glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)load("glSpriteParameterfSGIX"); + glad_glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)load("glSpriteParameterfvSGIX"); + glad_glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)load("glSpriteParameteriSGIX"); + glad_glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)load("glSpriteParameterivSGIX"); +} +static void load_GL_ARB_get_program_binary(GLADloadproc load) { + if(!GLAD_GL_ARB_get_program_binary) return; + glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); + glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); + glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); +} +static void load_GL_AMD_occlusion_query_event(GLADloadproc load) { + if(!GLAD_GL_AMD_occlusion_query_event) return; + glad_glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)load("glQueryObjectParameteruiAMD"); +} +static void load_GL_SGIS_multisample(GLADloadproc load) { + if(!GLAD_GL_SGIS_multisample) return; + glad_glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)load("glSampleMaskSGIS"); + glad_glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)load("glSamplePatternSGIS"); +} +static void load_GL_EXT_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_object) return; + glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); + glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); + glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); + glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); + glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); + glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); + glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); + glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); + glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); + glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); + glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); + glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); + glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); + glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); + glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); + glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); + glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); +} +static void load_GL_APPLE_vertex_array_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_array_range) return; + glad_glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)load("glVertexArrayRangeAPPLE"); + glad_glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)load("glFlushVertexArrayRangeAPPLE"); + glad_glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)load("glVertexArrayParameteriAPPLE"); +} +static void load_GL_NV_register_combiners(GLADloadproc load) { + if(!GLAD_GL_NV_register_combiners) return; + glad_glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)load("glCombinerParameterfvNV"); + glad_glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)load("glCombinerParameterfNV"); + glad_glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)load("glCombinerParameterivNV"); + glad_glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)load("glCombinerParameteriNV"); + glad_glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)load("glCombinerInputNV"); + glad_glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)load("glCombinerOutputNV"); + glad_glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)load("glFinalCombinerInputNV"); + glad_glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)load("glGetCombinerInputParameterfvNV"); + glad_glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)load("glGetCombinerInputParameterivNV"); + glad_glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)load("glGetCombinerOutputParameterfvNV"); + glad_glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)load("glGetCombinerOutputParameterivNV"); + glad_glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)load("glGetFinalCombinerInputParameterfvNV"); + glad_glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)load("glGetFinalCombinerInputParameterivNV"); +} +static void load_GL_ARB_draw_buffers(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers) return; + glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); +} +static void load_GL_ARB_clear_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_clear_texture) return; + glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); + glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); +} +static void load_GL_ARB_debug_output(GLADloadproc load) { + if(!GLAD_GL_ARB_debug_output) return; + glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); + glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); + glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); + glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); +} +static void load_GL_EXT_cull_vertex(GLADloadproc load) { + if(!GLAD_GL_EXT_cull_vertex) return; + glad_glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)load("glCullParameterdvEXT"); + glad_glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)load("glCullParameterfvEXT"); +} +static void load_GL_IBM_multimode_draw_arrays(GLADloadproc load) { + if(!GLAD_GL_IBM_multimode_draw_arrays) return; + glad_glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)load("glMultiModeDrawArraysIBM"); + glad_glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)load("glMultiModeDrawElementsIBM"); +} +static void load_GL_APPLE_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_array_object) return; + glad_glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)load("glBindVertexArrayAPPLE"); + glad_glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)load("glDeleteVertexArraysAPPLE"); + glad_glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)load("glGenVertexArraysAPPLE"); + glad_glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)load("glIsVertexArrayAPPLE"); +} +static void load_GL_SGIS_detail_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_detail_texture) return; + glad_glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)load("glDetailTexFuncSGIS"); + glad_glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)load("glGetDetailTexFuncSGIS"); +} +static void load_GL_ARB_draw_instanced(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_instanced) return; + glad_glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)load("glDrawArraysInstancedARB"); + glad_glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)load("glDrawElementsInstancedARB"); +} +static void load_GL_ARB_shading_language_include(GLADloadproc load) { + if(!GLAD_GL_ARB_shading_language_include) return; + glad_glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)load("glNamedStringARB"); + glad_glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)load("glDeleteNamedStringARB"); + glad_glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)load("glCompileShaderIncludeARB"); + glad_glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)load("glIsNamedStringARB"); + glad_glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)load("glGetNamedStringARB"); + glad_glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)load("glGetNamedStringivARB"); +} +static void load_GL_INGR_blend_func_separate(GLADloadproc load) { + if(!GLAD_GL_INGR_blend_func_separate) return; + glad_glBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC)load("glBlendFuncSeparateINGR"); +} +static void load_GL_NV_path_rendering(GLADloadproc load) { + if(!GLAD_GL_NV_path_rendering) return; + glad_glGenPathsNV = (PFNGLGENPATHSNVPROC)load("glGenPathsNV"); + glad_glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)load("glDeletePathsNV"); + glad_glIsPathNV = (PFNGLISPATHNVPROC)load("glIsPathNV"); + glad_glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)load("glPathCommandsNV"); + glad_glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)load("glPathCoordsNV"); + glad_glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)load("glPathSubCommandsNV"); + glad_glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)load("glPathSubCoordsNV"); + glad_glPathStringNV = (PFNGLPATHSTRINGNVPROC)load("glPathStringNV"); + glad_glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)load("glPathGlyphsNV"); + glad_glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)load("glPathGlyphRangeNV"); + glad_glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)load("glWeightPathsNV"); + glad_glCopyPathNV = (PFNGLCOPYPATHNVPROC)load("glCopyPathNV"); + glad_glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)load("glInterpolatePathsNV"); + glad_glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)load("glTransformPathNV"); + glad_glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)load("glPathParameterivNV"); + glad_glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)load("glPathParameteriNV"); + glad_glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)load("glPathParameterfvNV"); + glad_glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)load("glPathParameterfNV"); + glad_glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)load("glPathDashArrayNV"); + glad_glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)load("glPathStencilFuncNV"); + glad_glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)load("glPathStencilDepthOffsetNV"); + glad_glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)load("glStencilFillPathNV"); + glad_glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)load("glStencilStrokePathNV"); + glad_glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)load("glStencilFillPathInstancedNV"); + glad_glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)load("glStencilStrokePathInstancedNV"); + glad_glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)load("glPathCoverDepthFuncNV"); + glad_glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)load("glCoverFillPathNV"); + glad_glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)load("glCoverStrokePathNV"); + glad_glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)load("glCoverFillPathInstancedNV"); + glad_glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)load("glCoverStrokePathInstancedNV"); + glad_glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)load("glGetPathParameterivNV"); + glad_glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)load("glGetPathParameterfvNV"); + glad_glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)load("glGetPathCommandsNV"); + glad_glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)load("glGetPathCoordsNV"); + glad_glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)load("glGetPathDashArrayNV"); + glad_glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)load("glGetPathMetricsNV"); + glad_glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)load("glGetPathMetricRangeNV"); + glad_glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)load("glGetPathSpacingNV"); + glad_glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)load("glIsPointInFillPathNV"); + glad_glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)load("glIsPointInStrokePathNV"); + glad_glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)load("glGetPathLengthNV"); + glad_glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)load("glPointAlongPathNV"); + glad_glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)load("glMatrixLoad3x2fNV"); + glad_glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)load("glMatrixLoad3x3fNV"); + glad_glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)load("glMatrixLoadTranspose3x3fNV"); + glad_glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)load("glMatrixMult3x2fNV"); + glad_glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)load("glMatrixMult3x3fNV"); + glad_glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)load("glMatrixMultTranspose3x3fNV"); + glad_glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)load("glStencilThenCoverFillPathNV"); + glad_glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)load("glStencilThenCoverStrokePathNV"); + glad_glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)load("glStencilThenCoverFillPathInstancedNV"); + glad_glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)load("glStencilThenCoverStrokePathInstancedNV"); + glad_glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)load("glPathGlyphIndexRangeNV"); + glad_glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)load("glPathGlyphIndexArrayNV"); + glad_glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)load("glPathMemoryGlyphIndexArrayNV"); + glad_glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)load("glProgramPathFragmentInputGenNV"); + glad_glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)load("glGetProgramResourcefvNV"); + glad_glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)load("glPathColorGenNV"); + glad_glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)load("glPathTexGenNV"); + glad_glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)load("glPathFogGenNV"); + glad_glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)load("glGetPathColorGenivNV"); + glad_glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)load("glGetPathColorGenfvNV"); + glad_glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)load("glGetPathTexGenivNV"); + glad_glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)load("glGetPathTexGenfvNV"); +} +static void load_GL_NV_conservative_raster_dilate(GLADloadproc load) { + if(!GLAD_GL_NV_conservative_raster_dilate) return; + glad_glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)load("glConservativeRasterParameterfNV"); +} +static void load_GL_ATI_vertex_streams(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_streams) return; + glad_glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)load("glVertexStream1sATI"); + glad_glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)load("glVertexStream1svATI"); + glad_glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)load("glVertexStream1iATI"); + glad_glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)load("glVertexStream1ivATI"); + glad_glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)load("glVertexStream1fATI"); + glad_glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)load("glVertexStream1fvATI"); + glad_glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)load("glVertexStream1dATI"); + glad_glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)load("glVertexStream1dvATI"); + glad_glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)load("glVertexStream2sATI"); + glad_glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)load("glVertexStream2svATI"); + glad_glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)load("glVertexStream2iATI"); + glad_glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)load("glVertexStream2ivATI"); + glad_glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)load("glVertexStream2fATI"); + glad_glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)load("glVertexStream2fvATI"); + glad_glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)load("glVertexStream2dATI"); + glad_glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)load("glVertexStream2dvATI"); + glad_glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)load("glVertexStream3sATI"); + glad_glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)load("glVertexStream3svATI"); + glad_glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)load("glVertexStream3iATI"); + glad_glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)load("glVertexStream3ivATI"); + glad_glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)load("glVertexStream3fATI"); + glad_glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)load("glVertexStream3fvATI"); + glad_glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)load("glVertexStream3dATI"); + glad_glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)load("glVertexStream3dvATI"); + glad_glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)load("glVertexStream4sATI"); + glad_glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)load("glVertexStream4svATI"); + glad_glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)load("glVertexStream4iATI"); + glad_glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)load("glVertexStream4ivATI"); + glad_glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)load("glVertexStream4fATI"); + glad_glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)load("glVertexStream4fvATI"); + glad_glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)load("glVertexStream4dATI"); + glad_glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)load("glVertexStream4dvATI"); + glad_glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)load("glNormalStream3bATI"); + glad_glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)load("glNormalStream3bvATI"); + glad_glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)load("glNormalStream3sATI"); + glad_glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)load("glNormalStream3svATI"); + glad_glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)load("glNormalStream3iATI"); + glad_glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)load("glNormalStream3ivATI"); + glad_glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)load("glNormalStream3fATI"); + glad_glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)load("glNormalStream3fvATI"); + glad_glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)load("glNormalStream3dATI"); + glad_glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)load("glNormalStream3dvATI"); + glad_glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)load("glClientActiveVertexStreamATI"); + glad_glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)load("glVertexBlendEnviATI"); + glad_glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)load("glVertexBlendEnvfATI"); +} +static void load_GL_ARB_gpu_shader_int64(GLADloadproc load) { + if(!GLAD_GL_ARB_gpu_shader_int64) return; + glad_glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)load("glUniform1i64ARB"); + glad_glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)load("glUniform2i64ARB"); + glad_glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)load("glUniform3i64ARB"); + glad_glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)load("glUniform4i64ARB"); + glad_glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)load("glUniform1i64vARB"); + glad_glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)load("glUniform2i64vARB"); + glad_glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)load("glUniform3i64vARB"); + glad_glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)load("glUniform4i64vARB"); + glad_glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)load("glUniform1ui64ARB"); + glad_glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)load("glUniform2ui64ARB"); + glad_glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)load("glUniform3ui64ARB"); + glad_glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)load("glUniform4ui64ARB"); + glad_glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)load("glUniform1ui64vARB"); + glad_glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)load("glUniform2ui64vARB"); + glad_glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)load("glUniform3ui64vARB"); + glad_glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)load("glUniform4ui64vARB"); + glad_glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)load("glGetUniformi64vARB"); + glad_glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)load("glGetUniformui64vARB"); + glad_glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)load("glGetnUniformi64vARB"); + glad_glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)load("glGetnUniformui64vARB"); + glad_glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)load("glProgramUniform1i64ARB"); + glad_glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)load("glProgramUniform2i64ARB"); + glad_glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)load("glProgramUniform3i64ARB"); + glad_glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)load("glProgramUniform4i64ARB"); + glad_glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)load("glProgramUniform1i64vARB"); + glad_glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)load("glProgramUniform2i64vARB"); + glad_glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)load("glProgramUniform3i64vARB"); + glad_glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)load("glProgramUniform4i64vARB"); + glad_glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)load("glProgramUniform1ui64ARB"); + glad_glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)load("glProgramUniform2ui64ARB"); + glad_glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)load("glProgramUniform3ui64ARB"); + glad_glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)load("glProgramUniform4ui64ARB"); + glad_glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)load("glProgramUniform1ui64vARB"); + glad_glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)load("glProgramUniform2ui64vARB"); + glad_glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)load("glProgramUniform3ui64vARB"); + glad_glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)load("glProgramUniform4ui64vARB"); +} +static void load_GL_NV_vdpau_interop(GLADloadproc load) { + if(!GLAD_GL_NV_vdpau_interop) return; + glad_glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)load("glVDPAUInitNV"); + glad_glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)load("glVDPAUFiniNV"); + glad_glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)load("glVDPAURegisterVideoSurfaceNV"); + glad_glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)load("glVDPAURegisterOutputSurfaceNV"); + glad_glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)load("glVDPAUIsSurfaceNV"); + glad_glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)load("glVDPAUUnregisterSurfaceNV"); + glad_glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)load("glVDPAUGetSurfaceivNV"); + glad_glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)load("glVDPAUSurfaceAccessNV"); + glad_glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)load("glVDPAUMapSurfacesNV"); + glad_glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)load("glVDPAUUnmapSurfacesNV"); +} +static void load_GL_ARB_internalformat_query2(GLADloadproc load) { + if(!GLAD_GL_ARB_internalformat_query2) return; + glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); +} +static void load_GL_SUN_vertex(GLADloadproc load) { + if(!GLAD_GL_SUN_vertex) return; + glad_glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)load("glColor4ubVertex2fSUN"); + glad_glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)load("glColor4ubVertex2fvSUN"); + glad_glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)load("glColor4ubVertex3fSUN"); + glad_glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)load("glColor4ubVertex3fvSUN"); + glad_glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)load("glColor3fVertex3fSUN"); + glad_glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)load("glColor3fVertex3fvSUN"); + glad_glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)load("glNormal3fVertex3fSUN"); + glad_glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)load("glNormal3fVertex3fvSUN"); + glad_glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glColor4fNormal3fVertex3fSUN"); + glad_glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glColor4fNormal3fVertex3fvSUN"); + glad_glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)load("glTexCoord2fVertex3fSUN"); + glad_glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)load("glTexCoord2fVertex3fvSUN"); + glad_glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)load("glTexCoord4fVertex4fSUN"); + glad_glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)load("glTexCoord4fVertex4fvSUN"); + glad_glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)load("glTexCoord2fColor4ubVertex3fSUN"); + glad_glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)load("glTexCoord2fColor4ubVertex3fvSUN"); + glad_glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)load("glTexCoord2fColor3fVertex3fSUN"); + glad_glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)load("glTexCoord2fColor3fVertex3fvSUN"); + glad_glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fNormal3fVertex3fSUN"); + glad_glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fNormal3fVertex3fvSUN"); + glad_glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fSUN"); + glad_glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fvSUN"); + glad_glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fSUN"); + glad_glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fvSUN"); + glad_glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)load("glReplacementCodeuiVertex3fSUN"); + glad_glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)load("glReplacementCodeuiVertex3fvSUN"); + glad_glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)load("glReplacementCodeuiColor4ubVertex3fSUN"); + glad_glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4ubVertex3fvSUN"); + glad_glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor3fVertex3fSUN"); + glad_glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor3fVertex3fvSUN"); + glad_glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiNormal3fVertex3fSUN"); + glad_glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"); +} +static void load_GL_SGIX_igloo_interface(GLADloadproc load) { + if(!GLAD_GL_SGIX_igloo_interface) return; + glad_glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)load("glIglooInterfaceSGIX"); +} +static void load_GL_ARB_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_indirect) return; + glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); + glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); +} +static void load_GL_NV_vertex_program4(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_program4) return; + glad_glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)load("glVertexAttribI1iEXT"); + glad_glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)load("glVertexAttribI2iEXT"); + glad_glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)load("glVertexAttribI3iEXT"); + glad_glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)load("glVertexAttribI4iEXT"); + glad_glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)load("glVertexAttribI1uiEXT"); + glad_glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)load("glVertexAttribI2uiEXT"); + glad_glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)load("glVertexAttribI3uiEXT"); + glad_glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)load("glVertexAttribI4uiEXT"); + glad_glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)load("glVertexAttribI1ivEXT"); + glad_glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)load("glVertexAttribI2ivEXT"); + glad_glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)load("glVertexAttribI3ivEXT"); + glad_glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)load("glVertexAttribI4ivEXT"); + glad_glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)load("glVertexAttribI1uivEXT"); + glad_glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)load("glVertexAttribI2uivEXT"); + glad_glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)load("glVertexAttribI3uivEXT"); + glad_glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)load("glVertexAttribI4uivEXT"); + glad_glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)load("glVertexAttribI4bvEXT"); + glad_glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)load("glVertexAttribI4svEXT"); + glad_glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)load("glVertexAttribI4ubvEXT"); + glad_glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)load("glVertexAttribI4usvEXT"); + glad_glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)load("glVertexAttribIPointerEXT"); + glad_glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)load("glGetVertexAttribIivEXT"); + glad_glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)load("glGetVertexAttribIuivEXT"); +} +static void load_GL_SGIS_fog_function(GLADloadproc load) { + if(!GLAD_GL_SGIS_fog_function) return; + glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); + glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); +} +static void load_GL_EXT_x11_sync_object(GLADloadproc load) { + if(!GLAD_GL_EXT_x11_sync_object) return; + glad_glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)load("glImportSyncEXT"); +} +static void load_GL_ARB_sync(GLADloadproc load) { + if(!GLAD_GL_ARB_sync) return; + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); +} +static void load_GL_NV_sample_locations(GLADloadproc load) { + if(!GLAD_GL_NV_sample_locations) return; + glad_glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glFramebufferSampleLocationsfvNV"); + glad_glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glNamedFramebufferSampleLocationsfvNV"); + glad_glResolveDepthValuesNV = (PFNGLRESOLVEDEPTHVALUESNVPROC)load("glResolveDepthValuesNV"); +} +static void load_GL_ARB_compute_variable_group_size(GLADloadproc load) { + if(!GLAD_GL_ARB_compute_variable_group_size) return; + glad_glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)load("glDispatchComputeGroupSizeARB"); +} +static void load_GL_OES_fixed_point(GLADloadproc load) { + if(!GLAD_GL_OES_fixed_point) return; + glad_glAlphaFuncxOES = (PFNGLALPHAFUNCXOESPROC)load("glAlphaFuncxOES"); + glad_glClearColorxOES = (PFNGLCLEARCOLORXOESPROC)load("glClearColorxOES"); + glad_glClearDepthxOES = (PFNGLCLEARDEPTHXOESPROC)load("glClearDepthxOES"); + glad_glClipPlanexOES = (PFNGLCLIPPLANEXOESPROC)load("glClipPlanexOES"); + glad_glColor4xOES = (PFNGLCOLOR4XOESPROC)load("glColor4xOES"); + glad_glDepthRangexOES = (PFNGLDEPTHRANGEXOESPROC)load("glDepthRangexOES"); + glad_glFogxOES = (PFNGLFOGXOESPROC)load("glFogxOES"); + glad_glFogxvOES = (PFNGLFOGXVOESPROC)load("glFogxvOES"); + glad_glFrustumxOES = (PFNGLFRUSTUMXOESPROC)load("glFrustumxOES"); + glad_glGetClipPlanexOES = (PFNGLGETCLIPPLANEXOESPROC)load("glGetClipPlanexOES"); + glad_glGetFixedvOES = (PFNGLGETFIXEDVOESPROC)load("glGetFixedvOES"); + glad_glGetTexEnvxvOES = (PFNGLGETTEXENVXVOESPROC)load("glGetTexEnvxvOES"); + glad_glGetTexParameterxvOES = (PFNGLGETTEXPARAMETERXVOESPROC)load("glGetTexParameterxvOES"); + glad_glLightModelxOES = (PFNGLLIGHTMODELXOESPROC)load("glLightModelxOES"); + glad_glLightModelxvOES = (PFNGLLIGHTMODELXVOESPROC)load("glLightModelxvOES"); + glad_glLightxOES = (PFNGLLIGHTXOESPROC)load("glLightxOES"); + glad_glLightxvOES = (PFNGLLIGHTXVOESPROC)load("glLightxvOES"); + glad_glLineWidthxOES = (PFNGLLINEWIDTHXOESPROC)load("glLineWidthxOES"); + glad_glLoadMatrixxOES = (PFNGLLOADMATRIXXOESPROC)load("glLoadMatrixxOES"); + glad_glMaterialxOES = (PFNGLMATERIALXOESPROC)load("glMaterialxOES"); + glad_glMaterialxvOES = (PFNGLMATERIALXVOESPROC)load("glMaterialxvOES"); + glad_glMultMatrixxOES = (PFNGLMULTMATRIXXOESPROC)load("glMultMatrixxOES"); + glad_glMultiTexCoord4xOES = (PFNGLMULTITEXCOORD4XOESPROC)load("glMultiTexCoord4xOES"); + glad_glNormal3xOES = (PFNGLNORMAL3XOESPROC)load("glNormal3xOES"); + glad_glOrthoxOES = (PFNGLORTHOXOESPROC)load("glOrthoxOES"); + glad_glPointParameterxvOES = (PFNGLPOINTPARAMETERXVOESPROC)load("glPointParameterxvOES"); + glad_glPointSizexOES = (PFNGLPOINTSIZEXOESPROC)load("glPointSizexOES"); + glad_glPolygonOffsetxOES = (PFNGLPOLYGONOFFSETXOESPROC)load("glPolygonOffsetxOES"); + glad_glRotatexOES = (PFNGLROTATEXOESPROC)load("glRotatexOES"); + glad_glScalexOES = (PFNGLSCALEXOESPROC)load("glScalexOES"); + glad_glTexEnvxOES = (PFNGLTEXENVXOESPROC)load("glTexEnvxOES"); + glad_glTexEnvxvOES = (PFNGLTEXENVXVOESPROC)load("glTexEnvxvOES"); + glad_glTexParameterxOES = (PFNGLTEXPARAMETERXOESPROC)load("glTexParameterxOES"); + glad_glTexParameterxvOES = (PFNGLTEXPARAMETERXVOESPROC)load("glTexParameterxvOES"); + glad_glTranslatexOES = (PFNGLTRANSLATEXOESPROC)load("glTranslatexOES"); + glad_glGetLightxvOES = (PFNGLGETLIGHTXVOESPROC)load("glGetLightxvOES"); + glad_glGetMaterialxvOES = (PFNGLGETMATERIALXVOESPROC)load("glGetMaterialxvOES"); + glad_glPointParameterxOES = (PFNGLPOINTPARAMETERXOESPROC)load("glPointParameterxOES"); + glad_glSampleCoveragexOES = (PFNGLSAMPLECOVERAGEXOESPROC)load("glSampleCoveragexOES"); + glad_glAccumxOES = (PFNGLACCUMXOESPROC)load("glAccumxOES"); + glad_glBitmapxOES = (PFNGLBITMAPXOESPROC)load("glBitmapxOES"); + glad_glBlendColorxOES = (PFNGLBLENDCOLORXOESPROC)load("glBlendColorxOES"); + glad_glClearAccumxOES = (PFNGLCLEARACCUMXOESPROC)load("glClearAccumxOES"); + glad_glColor3xOES = (PFNGLCOLOR3XOESPROC)load("glColor3xOES"); + glad_glColor3xvOES = (PFNGLCOLOR3XVOESPROC)load("glColor3xvOES"); + glad_glColor4xvOES = (PFNGLCOLOR4XVOESPROC)load("glColor4xvOES"); + glad_glConvolutionParameterxOES = (PFNGLCONVOLUTIONPARAMETERXOESPROC)load("glConvolutionParameterxOES"); + glad_glConvolutionParameterxvOES = (PFNGLCONVOLUTIONPARAMETERXVOESPROC)load("glConvolutionParameterxvOES"); + glad_glEvalCoord1xOES = (PFNGLEVALCOORD1XOESPROC)load("glEvalCoord1xOES"); + glad_glEvalCoord1xvOES = (PFNGLEVALCOORD1XVOESPROC)load("glEvalCoord1xvOES"); + glad_glEvalCoord2xOES = (PFNGLEVALCOORD2XOESPROC)load("glEvalCoord2xOES"); + glad_glEvalCoord2xvOES = (PFNGLEVALCOORD2XVOESPROC)load("glEvalCoord2xvOES"); + glad_glFeedbackBufferxOES = (PFNGLFEEDBACKBUFFERXOESPROC)load("glFeedbackBufferxOES"); + glad_glGetConvolutionParameterxvOES = (PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)load("glGetConvolutionParameterxvOES"); + glad_glGetHistogramParameterxvOES = (PFNGLGETHISTOGRAMPARAMETERXVOESPROC)load("glGetHistogramParameterxvOES"); + glad_glGetLightxOES = (PFNGLGETLIGHTXOESPROC)load("glGetLightxOES"); + glad_glGetMapxvOES = (PFNGLGETMAPXVOESPROC)load("glGetMapxvOES"); + glad_glGetMaterialxOES = (PFNGLGETMATERIALXOESPROC)load("glGetMaterialxOES"); + glad_glGetPixelMapxv = (PFNGLGETPIXELMAPXVPROC)load("glGetPixelMapxv"); + glad_glGetTexGenxvOES = (PFNGLGETTEXGENXVOESPROC)load("glGetTexGenxvOES"); + glad_glGetTexLevelParameterxvOES = (PFNGLGETTEXLEVELPARAMETERXVOESPROC)load("glGetTexLevelParameterxvOES"); + glad_glIndexxOES = (PFNGLINDEXXOESPROC)load("glIndexxOES"); + glad_glIndexxvOES = (PFNGLINDEXXVOESPROC)load("glIndexxvOES"); + glad_glLoadTransposeMatrixxOES = (PFNGLLOADTRANSPOSEMATRIXXOESPROC)load("glLoadTransposeMatrixxOES"); + glad_glMap1xOES = (PFNGLMAP1XOESPROC)load("glMap1xOES"); + glad_glMap2xOES = (PFNGLMAP2XOESPROC)load("glMap2xOES"); + glad_glMapGrid1xOES = (PFNGLMAPGRID1XOESPROC)load("glMapGrid1xOES"); + glad_glMapGrid2xOES = (PFNGLMAPGRID2XOESPROC)load("glMapGrid2xOES"); + glad_glMultTransposeMatrixxOES = (PFNGLMULTTRANSPOSEMATRIXXOESPROC)load("glMultTransposeMatrixxOES"); + glad_glMultiTexCoord1xOES = (PFNGLMULTITEXCOORD1XOESPROC)load("glMultiTexCoord1xOES"); + glad_glMultiTexCoord1xvOES = (PFNGLMULTITEXCOORD1XVOESPROC)load("glMultiTexCoord1xvOES"); + glad_glMultiTexCoord2xOES = (PFNGLMULTITEXCOORD2XOESPROC)load("glMultiTexCoord2xOES"); + glad_glMultiTexCoord2xvOES = (PFNGLMULTITEXCOORD2XVOESPROC)load("glMultiTexCoord2xvOES"); + glad_glMultiTexCoord3xOES = (PFNGLMULTITEXCOORD3XOESPROC)load("glMultiTexCoord3xOES"); + glad_glMultiTexCoord3xvOES = (PFNGLMULTITEXCOORD3XVOESPROC)load("glMultiTexCoord3xvOES"); + glad_glMultiTexCoord4xvOES = (PFNGLMULTITEXCOORD4XVOESPROC)load("glMultiTexCoord4xvOES"); + glad_glNormal3xvOES = (PFNGLNORMAL3XVOESPROC)load("glNormal3xvOES"); + glad_glPassThroughxOES = (PFNGLPASSTHROUGHXOESPROC)load("glPassThroughxOES"); + glad_glPixelMapx = (PFNGLPIXELMAPXPROC)load("glPixelMapx"); + glad_glPixelStorex = (PFNGLPIXELSTOREXPROC)load("glPixelStorex"); + glad_glPixelTransferxOES = (PFNGLPIXELTRANSFERXOESPROC)load("glPixelTransferxOES"); + glad_glPixelZoomxOES = (PFNGLPIXELZOOMXOESPROC)load("glPixelZoomxOES"); + glad_glPrioritizeTexturesxOES = (PFNGLPRIORITIZETEXTURESXOESPROC)load("glPrioritizeTexturesxOES"); + glad_glRasterPos2xOES = (PFNGLRASTERPOS2XOESPROC)load("glRasterPos2xOES"); + glad_glRasterPos2xvOES = (PFNGLRASTERPOS2XVOESPROC)load("glRasterPos2xvOES"); + glad_glRasterPos3xOES = (PFNGLRASTERPOS3XOESPROC)load("glRasterPos3xOES"); + glad_glRasterPos3xvOES = (PFNGLRASTERPOS3XVOESPROC)load("glRasterPos3xvOES"); + glad_glRasterPos4xOES = (PFNGLRASTERPOS4XOESPROC)load("glRasterPos4xOES"); + glad_glRasterPos4xvOES = (PFNGLRASTERPOS4XVOESPROC)load("glRasterPos4xvOES"); + glad_glRectxOES = (PFNGLRECTXOESPROC)load("glRectxOES"); + glad_glRectxvOES = (PFNGLRECTXVOESPROC)load("glRectxvOES"); + glad_glTexCoord1xOES = (PFNGLTEXCOORD1XOESPROC)load("glTexCoord1xOES"); + glad_glTexCoord1xvOES = (PFNGLTEXCOORD1XVOESPROC)load("glTexCoord1xvOES"); + glad_glTexCoord2xOES = (PFNGLTEXCOORD2XOESPROC)load("glTexCoord2xOES"); + glad_glTexCoord2xvOES = (PFNGLTEXCOORD2XVOESPROC)load("glTexCoord2xvOES"); + glad_glTexCoord3xOES = (PFNGLTEXCOORD3XOESPROC)load("glTexCoord3xOES"); + glad_glTexCoord3xvOES = (PFNGLTEXCOORD3XVOESPROC)load("glTexCoord3xvOES"); + glad_glTexCoord4xOES = (PFNGLTEXCOORD4XOESPROC)load("glTexCoord4xOES"); + glad_glTexCoord4xvOES = (PFNGLTEXCOORD4XVOESPROC)load("glTexCoord4xvOES"); + glad_glTexGenxOES = (PFNGLTEXGENXOESPROC)load("glTexGenxOES"); + glad_glTexGenxvOES = (PFNGLTEXGENXVOESPROC)load("glTexGenxvOES"); + glad_glVertex2xOES = (PFNGLVERTEX2XOESPROC)load("glVertex2xOES"); + glad_glVertex2xvOES = (PFNGLVERTEX2XVOESPROC)load("glVertex2xvOES"); + glad_glVertex3xOES = (PFNGLVERTEX3XOESPROC)load("glVertex3xOES"); + glad_glVertex3xvOES = (PFNGLVERTEX3XVOESPROC)load("glVertex3xvOES"); + glad_glVertex4xOES = (PFNGLVERTEX4XOESPROC)load("glVertex4xOES"); + glad_glVertex4xvOES = (PFNGLVERTEX4XVOESPROC)load("glVertex4xvOES"); +} +static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_multisample) return; + glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); +} +static void load_GL_SGIS_texture4D(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture4D) return; + glad_glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)load("glTexImage4DSGIS"); + glad_glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)load("glTexSubImage4DSGIS"); +} +static void load_GL_EXT_texture3D(GLADloadproc load) { + if(!GLAD_GL_EXT_texture3D) return; + glad_glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)load("glTexImage3DEXT"); + glad_glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)load("glTexSubImage3DEXT"); +} +static void load_GL_EXT_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_multisample) return; + glad_glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)load("glSampleMaskEXT"); + glad_glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)load("glSamplePatternEXT"); +} +static void load_GL_EXT_secondary_color(GLADloadproc load) { + if(!GLAD_GL_EXT_secondary_color) return; + glad_glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)load("glSecondaryColor3bEXT"); + glad_glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)load("glSecondaryColor3bvEXT"); + glad_glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)load("glSecondaryColor3dEXT"); + glad_glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)load("glSecondaryColor3dvEXT"); + glad_glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)load("glSecondaryColor3fEXT"); + glad_glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)load("glSecondaryColor3fvEXT"); + glad_glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)load("glSecondaryColor3iEXT"); + glad_glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)load("glSecondaryColor3ivEXT"); + glad_glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)load("glSecondaryColor3sEXT"); + glad_glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)load("glSecondaryColor3svEXT"); + glad_glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)load("glSecondaryColor3ubEXT"); + glad_glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)load("glSecondaryColor3ubvEXT"); + glad_glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)load("glSecondaryColor3uiEXT"); + glad_glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)load("glSecondaryColor3uivEXT"); + glad_glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)load("glSecondaryColor3usEXT"); + glad_glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)load("glSecondaryColor3usvEXT"); + glad_glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)load("glSecondaryColorPointerEXT"); +} +static void load_GL_ATI_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_array_object) return; + glad_glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)load("glNewObjectBufferATI"); + glad_glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)load("glIsObjectBufferATI"); + glad_glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)load("glUpdateObjectBufferATI"); + glad_glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)load("glGetObjectBufferfvATI"); + glad_glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)load("glGetObjectBufferivATI"); + glad_glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)load("glFreeObjectBufferATI"); + glad_glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)load("glArrayObjectATI"); + glad_glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)load("glGetArrayObjectfvATI"); + glad_glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)load("glGetArrayObjectivATI"); + glad_glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)load("glVariantArrayObjectATI"); + glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); + glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); +} +static void load_GL_ARB_parallel_shader_compile(GLADloadproc load) { + if(!GLAD_GL_ARB_parallel_shader_compile) return; + glad_glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)load("glMaxShaderCompilerThreadsARB"); +} +static void load_GL_ARB_sparse_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_sparse_texture) return; + glad_glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)load("glTexPageCommitmentARB"); +} +static void load_GL_ARB_sample_locations(GLADloadproc load) { + if(!GLAD_GL_ARB_sample_locations) return; + glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); + glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); + glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); +} +static void load_GL_ARB_sparse_buffer(GLADloadproc load) { + if(!GLAD_GL_ARB_sparse_buffer) return; + glad_glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)load("glBufferPageCommitmentARB"); + glad_glNamedBufferPageCommitmentEXT = (PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)load("glNamedBufferPageCommitmentEXT"); + glad_glNamedBufferPageCommitmentARB = (PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)load("glNamedBufferPageCommitmentARB"); +} +static void load_GL_EXT_draw_range_elements(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_range_elements) return; + glad_glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)load("glDrawRangeElementsEXT"); +} +static int find_extensionsGL(void) { + if (!get_exts()) return 0; + GLAD_GL_SGIX_pixel_tiles = has_ext("GL_SGIX_pixel_tiles"); + GLAD_GL_EXT_post_depth_coverage = has_ext("GL_EXT_post_depth_coverage"); + GLAD_GL_APPLE_element_array = has_ext("GL_APPLE_element_array"); + GLAD_GL_AMD_multi_draw_indirect = has_ext("GL_AMD_multi_draw_indirect"); + GLAD_GL_EXT_blend_subtract = has_ext("GL_EXT_blend_subtract"); + GLAD_GL_SGIX_tag_sample_buffer = has_ext("GL_SGIX_tag_sample_buffer"); + GLAD_GL_NV_point_sprite = has_ext("GL_NV_point_sprite"); + GLAD_GL_IBM_texture_mirrored_repeat = has_ext("GL_IBM_texture_mirrored_repeat"); + GLAD_GL_APPLE_transform_hint = has_ext("GL_APPLE_transform_hint"); + GLAD_GL_ATI_separate_stencil = has_ext("GL_ATI_separate_stencil"); + GLAD_GL_NV_shader_atomic_int64 = has_ext("GL_NV_shader_atomic_int64"); + GLAD_GL_NV_vertex_program2_option = has_ext("GL_NV_vertex_program2_option"); + GLAD_GL_EXT_texture_buffer_object = has_ext("GL_EXT_texture_buffer_object"); + GLAD_GL_ARB_vertex_blend = has_ext("GL_ARB_vertex_blend"); + GLAD_GL_OVR_multiview = has_ext("GL_OVR_multiview"); + GLAD_GL_NV_vertex_program2 = has_ext("GL_NV_vertex_program2"); + GLAD_GL_ARB_program_interface_query = has_ext("GL_ARB_program_interface_query"); + GLAD_GL_EXT_misc_attribute = has_ext("GL_EXT_misc_attribute"); + GLAD_GL_NV_multisample_coverage = has_ext("GL_NV_multisample_coverage"); + GLAD_GL_ARB_shading_language_packing = has_ext("GL_ARB_shading_language_packing"); + GLAD_GL_EXT_texture_cube_map = has_ext("GL_EXT_texture_cube_map"); + GLAD_GL_NV_viewport_array2 = has_ext("GL_NV_viewport_array2"); + GLAD_GL_ARB_texture_stencil8 = has_ext("GL_ARB_texture_stencil8"); + GLAD_GL_EXT_index_func = has_ext("GL_EXT_index_func"); + GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); + GLAD_GL_NV_depth_clamp = has_ext("GL_NV_depth_clamp"); + GLAD_GL_NV_shader_buffer_load = has_ext("GL_NV_shader_buffer_load"); + GLAD_GL_EXT_color_subtable = has_ext("GL_EXT_color_subtable"); + GLAD_GL_SUNX_constant_data = has_ext("GL_SUNX_constant_data"); + GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); + GLAD_GL_EXT_multi_draw_arrays = has_ext("GL_EXT_multi_draw_arrays"); + GLAD_GL_ARB_shader_atomic_counters = has_ext("GL_ARB_shader_atomic_counters"); + GLAD_GL_ARB_arrays_of_arrays = has_ext("GL_ARB_arrays_of_arrays"); + GLAD_GL_NV_conditional_render = has_ext("GL_NV_conditional_render"); + GLAD_GL_EXT_texture_env_combine = has_ext("GL_EXT_texture_env_combine"); + GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); + GLAD_GL_SGIX_async_histogram = has_ext("GL_SGIX_async_histogram"); + GLAD_GL_MESA_resize_buffers = has_ext("GL_MESA_resize_buffers"); + GLAD_GL_NV_light_max_exponent = has_ext("GL_NV_light_max_exponent"); + GLAD_GL_NV_texture_env_combine4 = has_ext("GL_NV_texture_env_combine4"); + GLAD_GL_ARB_texture_view = has_ext("GL_ARB_texture_view"); + GLAD_GL_ARB_texture_env_combine = has_ext("GL_ARB_texture_env_combine"); + GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); + GLAD_GL_EXT_convolution = has_ext("GL_EXT_convolution"); + GLAD_GL_NV_compute_program5 = has_ext("GL_NV_compute_program5"); + GLAD_GL_NV_vertex_attrib_integer_64bit = has_ext("GL_NV_vertex_attrib_integer_64bit"); + GLAD_GL_EXT_paletted_texture = has_ext("GL_EXT_paletted_texture"); + GLAD_GL_ARB_texture_buffer_object = has_ext("GL_ARB_texture_buffer_object"); + GLAD_GL_ATI_pn_triangles = has_ext("GL_ATI_pn_triangles"); + GLAD_GL_SGIX_resample = has_ext("GL_SGIX_resample"); + GLAD_GL_SGIX_flush_raster = has_ext("GL_SGIX_flush_raster"); + GLAD_GL_EXT_light_texture = has_ext("GL_EXT_light_texture"); + GLAD_GL_ARB_point_sprite = has_ext("GL_ARB_point_sprite"); + GLAD_GL_SUN_convolution_border_modes = has_ext("GL_SUN_convolution_border_modes"); + GLAD_GL_NV_parameter_buffer_object2 = has_ext("GL_NV_parameter_buffer_object2"); + GLAD_GL_ARB_half_float_pixel = has_ext("GL_ARB_half_float_pixel"); + GLAD_GL_NV_tessellation_program5 = has_ext("GL_NV_tessellation_program5"); + GLAD_GL_REND_screen_coordinates = has_ext("GL_REND_screen_coordinates"); + GLAD_GL_HP_image_transform = has_ext("GL_HP_image_transform"); + GLAD_GL_EXT_packed_float = has_ext("GL_EXT_packed_float"); + GLAD_GL_OML_subsample = has_ext("GL_OML_subsample"); + GLAD_GL_SGIX_vertex_preclip = has_ext("GL_SGIX_vertex_preclip"); + GLAD_GL_SGIX_texture_scale_bias = has_ext("GL_SGIX_texture_scale_bias"); + GLAD_GL_AMD_draw_buffers_blend = has_ext("GL_AMD_draw_buffers_blend"); + GLAD_GL_APPLE_texture_range = has_ext("GL_APPLE_texture_range"); + GLAD_GL_EXT_texture_array = has_ext("GL_EXT_texture_array"); + GLAD_GL_NV_texture_barrier = has_ext("GL_NV_texture_barrier"); + GLAD_GL_ARB_texture_query_levels = has_ext("GL_ARB_texture_query_levels"); + GLAD_GL_NV_texgen_emboss = has_ext("GL_NV_texgen_emboss"); + GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); + GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); + GLAD_GL_ARB_vertex_type_2_10_10_10_rev = has_ext("GL_ARB_vertex_type_2_10_10_10_rev"); + GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); + GLAD_GL_3DFX_tbuffer = has_ext("GL_3DFX_tbuffer"); + GLAD_GL_GREMEDY_frame_terminator = has_ext("GL_GREMEDY_frame_terminator"); + GLAD_GL_ARB_blend_func_extended = has_ext("GL_ARB_blend_func_extended"); + GLAD_GL_EXT_separate_shader_objects = has_ext("GL_EXT_separate_shader_objects"); + GLAD_GL_NV_texture_multisample = has_ext("GL_NV_texture_multisample"); + GLAD_GL_ARB_shader_objects = has_ext("GL_ARB_shader_objects"); + GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); + GLAD_GL_ATI_envmap_bumpmap = has_ext("GL_ATI_envmap_bumpmap"); + GLAD_GL_ARB_robust_buffer_access_behavior = has_ext("GL_ARB_robust_buffer_access_behavior"); + GLAD_GL_ARB_shader_stencil_export = has_ext("GL_ARB_shader_stencil_export"); + GLAD_GL_NV_texture_rectangle = has_ext("GL_NV_texture_rectangle"); + GLAD_GL_ARB_enhanced_layouts = has_ext("GL_ARB_enhanced_layouts"); + GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); + GLAD_GL_SGI_texture_color_table = has_ext("GL_SGI_texture_color_table"); + GLAD_GL_ATI_map_object_buffer = has_ext("GL_ATI_map_object_buffer"); + GLAD_GL_ARB_robustness = has_ext("GL_ARB_robustness"); + GLAD_GL_NV_pixel_data_range = has_ext("GL_NV_pixel_data_range"); + GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); + GLAD_GL_ARB_gpu_shader_fp64 = has_ext("GL_ARB_gpu_shader_fp64"); + GLAD_GL_NV_command_list = has_ext("GL_NV_command_list"); + GLAD_GL_SGIX_depth_texture = has_ext("GL_SGIX_depth_texture"); + GLAD_GL_EXT_vertex_weighting = has_ext("GL_EXT_vertex_weighting"); + GLAD_GL_GREMEDY_string_marker = has_ext("GL_GREMEDY_string_marker"); + GLAD_GL_ARB_texture_compression_bptc = has_ext("GL_ARB_texture_compression_bptc"); + GLAD_GL_EXT_subtexture = has_ext("GL_EXT_subtexture"); + GLAD_GL_EXT_pixel_transform_color_table = has_ext("GL_EXT_pixel_transform_color_table"); + GLAD_GL_EXT_texture_compression_rgtc = has_ext("GL_EXT_texture_compression_rgtc"); + GLAD_GL_ARB_shader_atomic_counter_ops = has_ext("GL_ARB_shader_atomic_counter_ops"); + GLAD_GL_SGIX_depth_pass_instrument = has_ext("GL_SGIX_depth_pass_instrument"); + GLAD_GL_EXT_gpu_program_parameters = has_ext("GL_EXT_gpu_program_parameters"); + GLAD_GL_NV_evaluators = has_ext("GL_NV_evaluators"); + GLAD_GL_SGIS_texture_filter4 = has_ext("GL_SGIS_texture_filter4"); + GLAD_GL_AMD_performance_monitor = has_ext("GL_AMD_performance_monitor"); + GLAD_GL_NV_geometry_shader4 = has_ext("GL_NV_geometry_shader4"); + GLAD_GL_EXT_stencil_clear_tag = has_ext("GL_EXT_stencil_clear_tag"); + GLAD_GL_NV_vertex_program1_1 = has_ext("GL_NV_vertex_program1_1"); + GLAD_GL_NV_present_video = has_ext("GL_NV_present_video"); + GLAD_GL_ARB_texture_compression_rgtc = has_ext("GL_ARB_texture_compression_rgtc"); + GLAD_GL_HP_convolution_border_modes = has_ext("GL_HP_convolution_border_modes"); + GLAD_GL_EXT_shader_integer_mix = has_ext("GL_EXT_shader_integer_mix"); + GLAD_GL_SGIX_framezoom = has_ext("GL_SGIX_framezoom"); + GLAD_GL_ARB_stencil_texturing = has_ext("GL_ARB_stencil_texturing"); + GLAD_GL_ARB_shader_clock = has_ext("GL_ARB_shader_clock"); + GLAD_GL_NV_shader_atomic_fp16_vector = has_ext("GL_NV_shader_atomic_fp16_vector"); + GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); + GLAD_GL_ARB_draw_elements_base_vertex = has_ext("GL_ARB_draw_elements_base_vertex"); + GLAD_GL_INGR_interlace_read = has_ext("GL_INGR_interlace_read"); + GLAD_GL_NV_transform_feedback = has_ext("GL_NV_transform_feedback"); + GLAD_GL_NV_fragment_program = has_ext("GL_NV_fragment_program"); + GLAD_GL_AMD_stencil_operation_extended = has_ext("GL_AMD_stencil_operation_extended"); + GLAD_GL_ARB_seamless_cubemap_per_texture = has_ext("GL_ARB_seamless_cubemap_per_texture"); + GLAD_GL_ARB_instanced_arrays = has_ext("GL_ARB_instanced_arrays"); + GLAD_GL_EXT_polygon_offset = has_ext("GL_EXT_polygon_offset"); + GLAD_GL_NV_vertex_array_range2 = has_ext("GL_NV_vertex_array_range2"); + GLAD_GL_KHR_robustness = has_ext("GL_KHR_robustness"); + GLAD_GL_AMD_sparse_texture = has_ext("GL_AMD_sparse_texture"); + GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control"); + GLAD_GL_NV_fragment_coverage_to_color = has_ext("GL_NV_fragment_coverage_to_color"); + GLAD_GL_NV_fence = has_ext("GL_NV_fence"); + GLAD_GL_ARB_texture_buffer_range = has_ext("GL_ARB_texture_buffer_range"); + GLAD_GL_SUN_mesh_array = has_ext("GL_SUN_mesh_array"); + GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); + GLAD_GL_ARB_framebuffer_no_attachments = has_ext("GL_ARB_framebuffer_no_attachments"); + GLAD_GL_ARB_cl_event = has_ext("GL_ARB_cl_event"); + GLAD_GL_ARB_derivative_control = has_ext("GL_ARB_derivative_control"); + GLAD_GL_NV_packed_depth_stencil = has_ext("GL_NV_packed_depth_stencil"); + GLAD_GL_OES_single_precision = has_ext("GL_OES_single_precision"); + GLAD_GL_NV_primitive_restart = has_ext("GL_NV_primitive_restart"); + GLAD_GL_SUN_global_alpha = has_ext("GL_SUN_global_alpha"); + GLAD_GL_ARB_fragment_shader_interlock = has_ext("GL_ARB_fragment_shader_interlock"); + GLAD_GL_EXT_texture_object = has_ext("GL_EXT_texture_object"); + GLAD_GL_AMD_name_gen_delete = has_ext("GL_AMD_name_gen_delete"); + GLAD_GL_NV_texture_compression_vtc = has_ext("GL_NV_texture_compression_vtc"); + GLAD_GL_NV_sample_mask_override_coverage = has_ext("GL_NV_sample_mask_override_coverage"); + GLAD_GL_NV_texture_shader3 = has_ext("GL_NV_texture_shader3"); + GLAD_GL_NV_texture_shader2 = has_ext("GL_NV_texture_shader2"); + GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); + GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); + GLAD_GL_AMD_shader_atomic_counter_ops = has_ext("GL_AMD_shader_atomic_counter_ops"); + GLAD_GL_APPLE_vertex_program_evaluators = has_ext("GL_APPLE_vertex_program_evaluators"); + GLAD_GL_ARB_multi_bind = has_ext("GL_ARB_multi_bind"); + GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); + GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); + GLAD_GL_NV_path_rendering_shared_edge = has_ext("GL_NV_path_rendering_shared_edge"); + GLAD_GL_SGIX_shadow_ambient = has_ext("GL_SGIX_shadow_ambient"); + GLAD_GL_ARB_texture_cube_map = has_ext("GL_ARB_texture_cube_map"); + GLAD_GL_AMD_vertex_shader_viewport_index = has_ext("GL_AMD_vertex_shader_viewport_index"); + GLAD_GL_SGIX_list_priority = has_ext("GL_SGIX_list_priority"); + GLAD_GL_NV_vertex_buffer_unified_memory = has_ext("GL_NV_vertex_buffer_unified_memory"); + GLAD_GL_NV_uniform_buffer_unified_memory = has_ext("GL_NV_uniform_buffer_unified_memory"); + GLAD_GL_EXT_texture_env_dot3 = has_ext("GL_EXT_texture_env_dot3"); + GLAD_GL_ATI_texture_env_combine3 = has_ext("GL_ATI_texture_env_combine3"); + GLAD_GL_ARB_map_buffer_alignment = has_ext("GL_ARB_map_buffer_alignment"); + GLAD_GL_NV_blend_equation_advanced = has_ext("GL_NV_blend_equation_advanced"); + GLAD_GL_SGIS_sharpen_texture = has_ext("GL_SGIS_sharpen_texture"); + GLAD_GL_KHR_robust_buffer_access_behavior = has_ext("GL_KHR_robust_buffer_access_behavior"); + GLAD_GL_ARB_pipeline_statistics_query = has_ext("GL_ARB_pipeline_statistics_query"); + GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); + GLAD_GL_ARB_texture_rgb10_a2ui = has_ext("GL_ARB_texture_rgb10_a2ui"); + GLAD_GL_OML_interlace = has_ext("GL_OML_interlace"); + GLAD_GL_ATI_pixel_format_float = has_ext("GL_ATI_pixel_format_float"); + GLAD_GL_NV_geometry_shader_passthrough = has_ext("GL_NV_geometry_shader_passthrough"); + GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); + GLAD_GL_EXT_shadow_funcs = has_ext("GL_EXT_shadow_funcs"); + GLAD_GL_ATI_text_fragment_shader = has_ext("GL_ATI_text_fragment_shader"); + GLAD_GL_NV_vertex_array_range = has_ext("GL_NV_vertex_array_range"); + GLAD_GL_SGIX_fragment_lighting = has_ext("GL_SGIX_fragment_lighting"); + GLAD_GL_NV_texture_expand_normal = has_ext("GL_NV_texture_expand_normal"); + GLAD_GL_NV_framebuffer_multisample_coverage = has_ext("GL_NV_framebuffer_multisample_coverage"); + GLAD_GL_EXT_timer_query = has_ext("GL_EXT_timer_query"); + GLAD_GL_EXT_vertex_array_bgra = has_ext("GL_EXT_vertex_array_bgra"); + GLAD_GL_NV_bindless_texture = has_ext("GL_NV_bindless_texture"); + GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); + GLAD_GL_SGIS_texture_border_clamp = has_ext("GL_SGIS_texture_border_clamp"); + GLAD_GL_ATI_vertex_attrib_array_object = has_ext("GL_ATI_vertex_attrib_array_object"); + GLAD_GL_SGIX_clipmap = has_ext("GL_SGIX_clipmap"); + GLAD_GL_EXT_geometry_shader4 = has_ext("GL_EXT_geometry_shader4"); + GLAD_GL_ARB_shader_texture_image_samples = has_ext("GL_ARB_shader_texture_image_samples"); + GLAD_GL_MESA_ycbcr_texture = has_ext("GL_MESA_ycbcr_texture"); + GLAD_GL_MESAX_texture_stack = has_ext("GL_MESAX_texture_stack"); + GLAD_GL_AMD_seamless_cubemap_per_texture = has_ext("GL_AMD_seamless_cubemap_per_texture"); + GLAD_GL_EXT_bindable_uniform = has_ext("GL_EXT_bindable_uniform"); + GLAD_GL_KHR_texture_compression_astc_hdr = has_ext("GL_KHR_texture_compression_astc_hdr"); + GLAD_GL_ARB_shader_ballot = has_ext("GL_ARB_shader_ballot"); + GLAD_GL_KHR_blend_equation_advanced = has_ext("GL_KHR_blend_equation_advanced"); + GLAD_GL_ARB_fragment_program_shadow = has_ext("GL_ARB_fragment_program_shadow"); + GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); + GLAD_GL_AMD_texture_texture4 = has_ext("GL_AMD_texture_texture4"); + GLAD_GL_SGIX_reference_plane = has_ext("GL_SGIX_reference_plane"); + GLAD_GL_EXT_stencil_two_side = has_ext("GL_EXT_stencil_two_side"); + GLAD_GL_ARB_transform_feedback_overflow_query = has_ext("GL_ARB_transform_feedback_overflow_query"); + GLAD_GL_SGIX_texture_lod_bias = has_ext("GL_SGIX_texture_lod_bias"); + GLAD_GL_KHR_no_error = has_ext("GL_KHR_no_error"); + GLAD_GL_NV_explicit_multisample = has_ext("GL_NV_explicit_multisample"); + GLAD_GL_IBM_static_data = has_ext("GL_IBM_static_data"); + GLAD_GL_EXT_clip_volume_hint = has_ext("GL_EXT_clip_volume_hint"); + GLAD_GL_EXT_texture_perturb_normal = has_ext("GL_EXT_texture_perturb_normal"); + GLAD_GL_NV_fragment_program2 = has_ext("GL_NV_fragment_program2"); + GLAD_GL_NV_fragment_program4 = has_ext("GL_NV_fragment_program4"); + GLAD_GL_EXT_point_parameters = has_ext("GL_EXT_point_parameters"); + GLAD_GL_PGI_misc_hints = has_ext("GL_PGI_misc_hints"); + GLAD_GL_SGIX_subsample = has_ext("GL_SGIX_subsample"); + GLAD_GL_AMD_shader_stencil_export = has_ext("GL_AMD_shader_stencil_export"); + GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod"); + GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); + GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); + GLAD_GL_SGIS_texture_select = has_ext("GL_SGIS_texture_select"); + GLAD_GL_NV_texture_shader = has_ext("GL_NV_texture_shader"); + GLAD_GL_ARB_tessellation_shader = has_ext("GL_ARB_tessellation_shader"); + GLAD_GL_EXT_draw_buffers2 = has_ext("GL_EXT_draw_buffers2"); + GLAD_GL_ARB_vertex_attrib_64bit = has_ext("GL_ARB_vertex_attrib_64bit"); + GLAD_GL_EXT_texture_filter_minmax = has_ext("GL_EXT_texture_filter_minmax"); + GLAD_GL_WIN_specular_fog = has_ext("GL_WIN_specular_fog"); + GLAD_GL_AMD_interleaved_elements = has_ext("GL_AMD_interleaved_elements"); + GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); + GLAD_GL_OML_resample = has_ext("GL_OML_resample"); + GLAD_GL_APPLE_ycbcr_422 = has_ext("GL_APPLE_ycbcr_422"); + GLAD_GL_SGIX_texture_add_env = has_ext("GL_SGIX_texture_add_env"); + GLAD_GL_ARB_shadow_ambient = has_ext("GL_ARB_shadow_ambient"); + GLAD_GL_ARB_texture_storage = has_ext("GL_ARB_texture_storage"); + GLAD_GL_EXT_pixel_buffer_object = has_ext("GL_EXT_pixel_buffer_object"); + GLAD_GL_ARB_copy_image = has_ext("GL_ARB_copy_image"); + GLAD_GL_SGIS_pixel_texture = has_ext("GL_SGIS_pixel_texture"); + GLAD_GL_SGIS_generate_mipmap = has_ext("GL_SGIS_generate_mipmap"); + GLAD_GL_SGIX_instruments = has_ext("GL_SGIX_instruments"); + GLAD_GL_HP_texture_lighting = has_ext("GL_HP_texture_lighting"); + GLAD_GL_ARB_shader_storage_buffer_object = has_ext("GL_ARB_shader_storage_buffer_object"); + GLAD_GL_EXT_sparse_texture2 = has_ext("GL_EXT_sparse_texture2"); + GLAD_GL_EXT_blend_minmax = has_ext("GL_EXT_blend_minmax"); + GLAD_GL_MESA_pack_invert = has_ext("GL_MESA_pack_invert"); + GLAD_GL_ARB_base_instance = has_ext("GL_ARB_base_instance"); + GLAD_GL_SGIX_convolution_accuracy = has_ext("GL_SGIX_convolution_accuracy"); + GLAD_GL_PGI_vertex_hints = has_ext("GL_PGI_vertex_hints"); + GLAD_GL_AMD_transform_feedback4 = has_ext("GL_AMD_transform_feedback4"); + GLAD_GL_ARB_ES3_1_compatibility = has_ext("GL_ARB_ES3_1_compatibility"); + GLAD_GL_EXT_texture_integer = has_ext("GL_EXT_texture_integer"); + GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); + GLAD_GL_AMD_gpu_shader_int64 = has_ext("GL_AMD_gpu_shader_int64"); + GLAD_GL_S3_s3tc = has_ext("GL_S3_s3tc"); + GLAD_GL_ARB_query_buffer_object = has_ext("GL_ARB_query_buffer_object"); + GLAD_GL_AMD_vertex_shader_tessellator = has_ext("GL_AMD_vertex_shader_tessellator"); + GLAD_GL_ARB_invalidate_subdata = has_ext("GL_ARB_invalidate_subdata"); + GLAD_GL_EXT_index_material = has_ext("GL_EXT_index_material"); + GLAD_GL_NV_blend_equation_advanced_coherent = has_ext("GL_NV_blend_equation_advanced_coherent"); + GLAD_GL_KHR_texture_compression_astc_sliced_3d = has_ext("GL_KHR_texture_compression_astc_sliced_3d"); + GLAD_GL_INTEL_parallel_arrays = has_ext("GL_INTEL_parallel_arrays"); + GLAD_GL_ATI_draw_buffers = has_ext("GL_ATI_draw_buffers"); + GLAD_GL_EXT_cmyka = has_ext("GL_EXT_cmyka"); + GLAD_GL_SGIX_pixel_texture = has_ext("GL_SGIX_pixel_texture"); + GLAD_GL_APPLE_specular_vector = has_ext("GL_APPLE_specular_vector"); + GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); + GLAD_GL_ARB_timer_query = has_ext("GL_ARB_timer_query"); + GLAD_GL_SGIX_interlace = has_ext("GL_SGIX_interlace"); + GLAD_GL_NV_parameter_buffer_object = has_ext("GL_NV_parameter_buffer_object"); + GLAD_GL_AMD_shader_trinary_minmax = has_ext("GL_AMD_shader_trinary_minmax"); + GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access"); + GLAD_GL_EXT_rescale_normal = has_ext("GL_EXT_rescale_normal"); + GLAD_GL_ARB_pixel_buffer_object = has_ext("GL_ARB_pixel_buffer_object"); + GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); + GLAD_GL_ARB_vertex_type_10f_11f_11f_rev = has_ext("GL_ARB_vertex_type_10f_11f_11f_rev"); + GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); + GLAD_GL_NV_transform_feedback2 = has_ext("GL_NV_transform_feedback2"); + GLAD_GL_SGIX_async_pixel = has_ext("GL_SGIX_async_pixel"); + GLAD_GL_NV_fragment_program_option = has_ext("GL_NV_fragment_program_option"); + GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); + GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); + GLAD_GL_NV_shader_thread_group = has_ext("GL_NV_shader_thread_group"); + GLAD_GL_EXT_stencil_wrap = has_ext("GL_EXT_stencil_wrap"); + GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); + GLAD_GL_OVR_multiview2 = has_ext("GL_OVR_multiview2"); + GLAD_GL_EXT_histogram = has_ext("GL_EXT_histogram"); + GLAD_GL_ARB_get_texture_sub_image = has_ext("GL_ARB_get_texture_sub_image"); + GLAD_GL_SGIS_point_parameters = has_ext("GL_SGIS_point_parameters"); + GLAD_GL_SGIX_ycrcb = has_ext("GL_SGIX_ycrcb"); + GLAD_GL_EXT_direct_state_access = has_ext("GL_EXT_direct_state_access"); + GLAD_GL_ARB_cull_distance = has_ext("GL_ARB_cull_distance"); + GLAD_GL_AMD_sample_positions = has_ext("GL_AMD_sample_positions"); + GLAD_GL_NV_vertex_program = has_ext("GL_NV_vertex_program"); + GLAD_GL_NV_shader_thread_shuffle = has_ext("GL_NV_shader_thread_shuffle"); + GLAD_GL_ARB_shader_precision = has_ext("GL_ARB_shader_precision"); + GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); + GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); + GLAD_GL_APPLE_fence = has_ext("GL_APPLE_fence"); + GLAD_GL_OES_byte_coordinates = has_ext("GL_OES_byte_coordinates"); + GLAD_GL_ARB_transpose_matrix = has_ext("GL_ARB_transpose_matrix"); + GLAD_GL_ARB_provoking_vertex = has_ext("GL_ARB_provoking_vertex"); + GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); + GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); + GLAD_GL_ARB_half_float_vertex = has_ext("GL_ARB_half_float_vertex"); + GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); + GLAD_GL_NV_framebuffer_mixed_samples = has_ext("GL_NV_framebuffer_mixed_samples"); + GLAD_GL_NVX_conditional_render = has_ext("GL_NVX_conditional_render"); + GLAD_GL_ARB_multi_draw_indirect = has_ext("GL_ARB_multi_draw_indirect"); + GLAD_GL_EXT_raster_multisample = has_ext("GL_EXT_raster_multisample"); + GLAD_GL_NV_copy_image = has_ext("GL_NV_copy_image"); + GLAD_GL_ARB_fragment_layer_viewport = has_ext("GL_ARB_fragment_layer_viewport"); + GLAD_GL_INTEL_framebuffer_CMAA = has_ext("GL_INTEL_framebuffer_CMAA"); + GLAD_GL_ARB_transform_feedback2 = has_ext("GL_ARB_transform_feedback2"); + GLAD_GL_ARB_transform_feedback3 = has_ext("GL_ARB_transform_feedback3"); + GLAD_GL_SGIX_ycrcba = has_ext("GL_SGIX_ycrcba"); + GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); + GLAD_GL_EXT_bgra = has_ext("GL_EXT_bgra"); + GLAD_GL_ARB_sparse_texture_clamp = has_ext("GL_ARB_sparse_texture_clamp"); + GLAD_GL_EXT_pixel_transform = has_ext("GL_EXT_pixel_transform"); + GLAD_GL_ARB_conservative_depth = has_ext("GL_ARB_conservative_depth"); + GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); + GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); + GLAD_GL_SUN_triangle_list = has_ext("GL_SUN_triangle_list"); + GLAD_GL_EXT_texture_env_add = has_ext("GL_EXT_texture_env_add"); + GLAD_GL_EXT_packed_depth_stencil = has_ext("GL_EXT_packed_depth_stencil"); + GLAD_GL_EXT_texture_mirror_clamp = has_ext("GL_EXT_texture_mirror_clamp"); + GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); + GLAD_GL_APPLE_float_pixels = has_ext("GL_APPLE_float_pixels"); + GLAD_GL_ARB_transform_feedback_instanced = has_ext("GL_ARB_transform_feedback_instanced"); + GLAD_GL_SGIX_async = has_ext("GL_SGIX_async"); + GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); + GLAD_GL_NV_shader_atomic_float = has_ext("GL_NV_shader_atomic_float"); + GLAD_GL_ARB_shading_language_100 = has_ext("GL_ARB_shading_language_100"); + GLAD_GL_INTEL_performance_query = has_ext("GL_INTEL_performance_query"); + GLAD_GL_ARB_texture_mirror_clamp_to_edge = has_ext("GL_ARB_texture_mirror_clamp_to_edge"); + GLAD_GL_NV_gpu_shader5 = has_ext("GL_NV_gpu_shader5"); + GLAD_GL_NV_bindless_multi_draw_indirect_count = has_ext("GL_NV_bindless_multi_draw_indirect_count"); + GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); + GLAD_GL_ARB_indirect_parameters = has_ext("GL_ARB_indirect_parameters"); + GLAD_GL_NV_half_float = has_ext("GL_NV_half_float"); + GLAD_GL_ARB_ES3_2_compatibility = has_ext("GL_ARB_ES3_2_compatibility"); + GLAD_GL_ATI_texture_mirror_once = has_ext("GL_ATI_texture_mirror_once"); + GLAD_GL_IBM_rasterpos_clip = has_ext("GL_IBM_rasterpos_clip"); + GLAD_GL_SGIX_shadow = has_ext("GL_SGIX_shadow"); + GLAD_GL_EXT_polygon_offset_clamp = has_ext("GL_EXT_polygon_offset_clamp"); + GLAD_GL_NV_deep_texture3D = has_ext("GL_NV_deep_texture3D"); + GLAD_GL_ARB_shader_draw_parameters = has_ext("GL_ARB_shader_draw_parameters"); + GLAD_GL_SGIX_calligraphic_fragment = has_ext("GL_SGIX_calligraphic_fragment"); + GLAD_GL_ARB_shader_bit_encoding = has_ext("GL_ARB_shader_bit_encoding"); + GLAD_GL_EXT_compiled_vertex_array = has_ext("GL_EXT_compiled_vertex_array"); + GLAD_GL_NV_depth_buffer_float = has_ext("GL_NV_depth_buffer_float"); + GLAD_GL_NV_occlusion_query = has_ext("GL_NV_occlusion_query"); + GLAD_GL_APPLE_flush_buffer_range = has_ext("GL_APPLE_flush_buffer_range"); + GLAD_GL_ARB_imaging = has_ext("GL_ARB_imaging"); + GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); + GLAD_GL_AMD_gcn_shader = has_ext("GL_AMD_gcn_shader"); + GLAD_GL_AMD_blend_minmax_factor = has_ext("GL_AMD_blend_minmax_factor"); + GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); + GLAD_GL_ARB_shading_language_420pack = has_ext("GL_ARB_shading_language_420pack"); + GLAD_GL_ARB_shader_viewport_layer_array = has_ext("GL_ARB_shader_viewport_layer_array"); + GLAD_GL_ATI_meminfo = has_ext("GL_ATI_meminfo"); + GLAD_GL_EXT_abgr = has_ext("GL_EXT_abgr"); + GLAD_GL_AMD_pinned_memory = has_ext("GL_AMD_pinned_memory"); + GLAD_GL_EXT_texture_snorm = has_ext("GL_EXT_texture_snorm"); + GLAD_GL_SGIX_texture_coordinate_clamp = has_ext("GL_SGIX_texture_coordinate_clamp"); + GLAD_GL_ARB_clear_buffer_object = has_ext("GL_ARB_clear_buffer_object"); + GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); + GLAD_GL_EXT_debug_label = has_ext("GL_EXT_debug_label"); + GLAD_GL_ARB_sample_shading = has_ext("GL_ARB_sample_shading"); + GLAD_GL_NV_internalformat_sample_query = has_ext("GL_NV_internalformat_sample_query"); + GLAD_GL_INTEL_map_texture = has_ext("GL_INTEL_map_texture"); + GLAD_GL_ARB_texture_env_crossbar = has_ext("GL_ARB_texture_env_crossbar"); + GLAD_GL_EXT_422_pixels = has_ext("GL_EXT_422_pixels"); + GLAD_GL_ARB_compute_shader = has_ext("GL_ARB_compute_shader"); + GLAD_GL_EXT_blend_logic_op = has_ext("GL_EXT_blend_logic_op"); + GLAD_GL_IBM_cull_vertex = has_ext("GL_IBM_cull_vertex"); + GLAD_GL_IBM_vertex_array_lists = has_ext("GL_IBM_vertex_array_lists"); + GLAD_GL_ARB_color_buffer_float = has_ext("GL_ARB_color_buffer_float"); + GLAD_GL_ARB_bindless_texture = has_ext("GL_ARB_bindless_texture"); + GLAD_GL_ARB_window_pos = has_ext("GL_ARB_window_pos"); + GLAD_GL_ARB_internalformat_query = has_ext("GL_ARB_internalformat_query"); + GLAD_GL_ARB_shadow = has_ext("GL_ARB_shadow"); + GLAD_GL_ARB_texture_mirrored_repeat = has_ext("GL_ARB_texture_mirrored_repeat"); + GLAD_GL_EXT_shader_image_load_store = has_ext("GL_EXT_shader_image_load_store"); + GLAD_GL_EXT_copy_texture = has_ext("GL_EXT_copy_texture"); + GLAD_GL_NV_register_combiners2 = has_ext("GL_NV_register_combiners2"); + GLAD_GL_SGIX_ycrcb_subsample = has_ext("GL_SGIX_ycrcb_subsample"); + GLAD_GL_SGIX_ir_instrument1 = has_ext("GL_SGIX_ir_instrument1"); + GLAD_GL_NV_draw_texture = has_ext("GL_NV_draw_texture"); + GLAD_GL_EXT_texture_shared_exponent = has_ext("GL_EXT_texture_shared_exponent"); + GLAD_GL_EXT_draw_instanced = has_ext("GL_EXT_draw_instanced"); + GLAD_GL_NV_copy_depth_to_color = has_ext("GL_NV_copy_depth_to_color"); + GLAD_GL_ARB_viewport_array = has_ext("GL_ARB_viewport_array"); + GLAD_GL_ARB_separate_shader_objects = has_ext("GL_ARB_separate_shader_objects"); + GLAD_GL_EXT_depth_bounds_test = has_ext("GL_EXT_depth_bounds_test"); + GLAD_GL_EXT_shared_texture_palette = has_ext("GL_EXT_shared_texture_palette"); + GLAD_GL_ARB_texture_env_add = has_ext("GL_ARB_texture_env_add"); + GLAD_GL_NV_video_capture = has_ext("GL_NV_video_capture"); + GLAD_GL_ARB_sampler_objects = has_ext("GL_ARB_sampler_objects"); + GLAD_GL_ARB_matrix_palette = has_ext("GL_ARB_matrix_palette"); + GLAD_GL_SGIS_texture_color_mask = has_ext("GL_SGIS_texture_color_mask"); + GLAD_GL_EXT_packed_pixels = has_ext("GL_EXT_packed_pixels"); + GLAD_GL_EXT_coordinate_frame = has_ext("GL_EXT_coordinate_frame"); + GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); + GLAD_GL_APPLE_aux_depth_stencil = has_ext("GL_APPLE_aux_depth_stencil"); + GLAD_GL_ARB_shader_subroutine = has_ext("GL_ARB_shader_subroutine"); + GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); + GLAD_GL_ARB_texture_storage_multisample = has_ext("GL_ARB_texture_storage_multisample"); + GLAD_GL_KHR_blend_equation_advanced_coherent = has_ext("GL_KHR_blend_equation_advanced_coherent"); + GLAD_GL_EXT_vertex_attrib_64bit = has_ext("GL_EXT_vertex_attrib_64bit"); + GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); + GLAD_GL_NV_shader_buffer_store = has_ext("GL_NV_shader_buffer_store"); + GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); + GLAD_GL_MESA_window_pos = has_ext("GL_MESA_window_pos"); + GLAD_GL_NV_fill_rectangle = has_ext("GL_NV_fill_rectangle"); + GLAD_GL_NV_shader_storage_buffer_object = has_ext("GL_NV_shader_storage_buffer_object"); + GLAD_GL_ARB_texture_query_lod = has_ext("GL_ARB_texture_query_lod"); + GLAD_GL_ARB_copy_buffer = has_ext("GL_ARB_copy_buffer"); + GLAD_GL_ARB_shader_image_size = has_ext("GL_ARB_shader_image_size"); + GLAD_GL_NV_shader_atomic_counters = has_ext("GL_NV_shader_atomic_counters"); + GLAD_GL_APPLE_object_purgeable = has_ext("GL_APPLE_object_purgeable"); + GLAD_GL_ARB_occlusion_query = has_ext("GL_ARB_occlusion_query"); + GLAD_GL_INGR_color_clamp = has_ext("GL_INGR_color_clamp"); + GLAD_GL_SGI_color_table = has_ext("GL_SGI_color_table"); + GLAD_GL_NV_gpu_program5_mem_extended = has_ext("GL_NV_gpu_program5_mem_extended"); + GLAD_GL_ARB_texture_cube_map_array = has_ext("GL_ARB_texture_cube_map_array"); + GLAD_GL_SGIX_scalebias_hint = has_ext("GL_SGIX_scalebias_hint"); + GLAD_GL_EXT_gpu_shader4 = has_ext("GL_EXT_gpu_shader4"); + GLAD_GL_NV_geometry_program4 = has_ext("GL_NV_geometry_program4"); + GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); + GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); + GLAD_GL_ARB_texture_border_clamp = has_ext("GL_ARB_texture_border_clamp"); + GLAD_GL_ARB_fragment_coord_conventions = has_ext("GL_ARB_fragment_coord_conventions"); + GLAD_GL_ARB_multitexture = has_ext("GL_ARB_multitexture"); + GLAD_GL_SGIX_polynomial_ffd = has_ext("GL_SGIX_polynomial_ffd"); + GLAD_GL_EXT_provoking_vertex = has_ext("GL_EXT_provoking_vertex"); + GLAD_GL_ARB_point_parameters = has_ext("GL_ARB_point_parameters"); + GLAD_GL_ARB_shader_image_load_store = has_ext("GL_ARB_shader_image_load_store"); + GLAD_GL_ARB_conditional_render_inverted = has_ext("GL_ARB_conditional_render_inverted"); + GLAD_GL_HP_occlusion_test = has_ext("GL_HP_occlusion_test"); + GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); + GLAD_GL_ARB_texture_barrier = has_ext("GL_ARB_texture_barrier"); + GLAD_GL_ARB_texture_buffer_object_rgb32 = has_ext("GL_ARB_texture_buffer_object_rgb32"); + GLAD_GL_NV_bindless_multi_draw_indirect = has_ext("GL_NV_bindless_multi_draw_indirect"); + GLAD_GL_SGIX_texture_multi_buffer = has_ext("GL_SGIX_texture_multi_buffer"); + GLAD_GL_EXT_transform_feedback = has_ext("GL_EXT_transform_feedback"); + GLAD_GL_KHR_texture_compression_astc_ldr = has_ext("GL_KHR_texture_compression_astc_ldr"); + GLAD_GL_3DFX_multisample = has_ext("GL_3DFX_multisample"); + GLAD_GL_INTEL_fragment_shader_ordering = has_ext("GL_INTEL_fragment_shader_ordering"); + GLAD_GL_ARB_texture_env_dot3 = has_ext("GL_ARB_texture_env_dot3"); + GLAD_GL_NV_gpu_program4 = has_ext("GL_NV_gpu_program4"); + GLAD_GL_NV_gpu_program5 = has_ext("GL_NV_gpu_program5"); + GLAD_GL_NV_float_buffer = has_ext("GL_NV_float_buffer"); + GLAD_GL_SGIS_texture_edge_clamp = has_ext("GL_SGIS_texture_edge_clamp"); + GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); + GLAD_GL_SUN_slice_accum = has_ext("GL_SUN_slice_accum"); + GLAD_GL_EXT_index_texture = has_ext("GL_EXT_index_texture"); + GLAD_GL_EXT_shader_image_load_formatted = has_ext("GL_EXT_shader_image_load_formatted"); + GLAD_GL_ARB_geometry_shader4 = has_ext("GL_ARB_geometry_shader4"); + GLAD_GL_EXT_separate_specular_color = has_ext("GL_EXT_separate_specular_color"); + GLAD_GL_AMD_depth_clamp_separate = has_ext("GL_AMD_depth_clamp_separate"); + GLAD_GL_NV_conservative_raster = has_ext("GL_NV_conservative_raster"); + GLAD_GL_ARB_sparse_texture2 = has_ext("GL_ARB_sparse_texture2"); + GLAD_GL_SGIX_sprite = has_ext("GL_SGIX_sprite"); + GLAD_GL_ARB_get_program_binary = has_ext("GL_ARB_get_program_binary"); + GLAD_GL_AMD_occlusion_query_event = has_ext("GL_AMD_occlusion_query_event"); + GLAD_GL_SGIS_multisample = has_ext("GL_SGIS_multisample"); + GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); + GLAD_GL_ARB_robustness_isolation = has_ext("GL_ARB_robustness_isolation"); + GLAD_GL_ARB_vertex_array_bgra = has_ext("GL_ARB_vertex_array_bgra"); + GLAD_GL_APPLE_vertex_array_range = has_ext("GL_APPLE_vertex_array_range"); + GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); + GLAD_GL_NV_register_combiners = has_ext("GL_NV_register_combiners"); + GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); + GLAD_GL_ARB_clear_texture = has_ext("GL_ARB_clear_texture"); + GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); + GLAD_GL_SGI_color_matrix = has_ext("GL_SGI_color_matrix"); + GLAD_GL_EXT_cull_vertex = has_ext("GL_EXT_cull_vertex"); + GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); + GLAD_GL_APPLE_row_bytes = has_ext("GL_APPLE_row_bytes"); + GLAD_GL_NV_texgen_reflection = has_ext("GL_NV_texgen_reflection"); + GLAD_GL_IBM_multimode_draw_arrays = has_ext("GL_IBM_multimode_draw_arrays"); + GLAD_GL_APPLE_vertex_array_object = has_ext("GL_APPLE_vertex_array_object"); + GLAD_GL_3DFX_texture_compression_FXT1 = has_ext("GL_3DFX_texture_compression_FXT1"); + GLAD_GL_NV_fragment_shader_interlock = has_ext("GL_NV_fragment_shader_interlock"); + GLAD_GL_AMD_conservative_depth = has_ext("GL_AMD_conservative_depth"); + GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); + GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); + GLAD_GL_SGIS_detail_texture = has_ext("GL_SGIS_detail_texture"); + GLAD_GL_ARB_draw_instanced = has_ext("GL_ARB_draw_instanced"); + GLAD_GL_OES_read_format = has_ext("GL_OES_read_format"); + GLAD_GL_ATI_texture_float = has_ext("GL_ATI_texture_float"); + GLAD_GL_ARB_texture_gather = has_ext("GL_ARB_texture_gather"); + GLAD_GL_AMD_vertex_shader_layer = has_ext("GL_AMD_vertex_shader_layer"); + GLAD_GL_ARB_shading_language_include = has_ext("GL_ARB_shading_language_include"); + GLAD_GL_APPLE_client_storage = has_ext("GL_APPLE_client_storage"); + GLAD_GL_WIN_phong_shading = has_ext("GL_WIN_phong_shading"); + GLAD_GL_INGR_blend_func_separate = has_ext("GL_INGR_blend_func_separate"); + GLAD_GL_NV_path_rendering = has_ext("GL_NV_path_rendering"); + GLAD_GL_NV_conservative_raster_dilate = has_ext("GL_NV_conservative_raster_dilate"); + GLAD_GL_ATI_vertex_streams = has_ext("GL_ATI_vertex_streams"); + GLAD_GL_ARB_post_depth_coverage = has_ext("GL_ARB_post_depth_coverage"); + GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); + GLAD_GL_APPLE_rgb_422 = has_ext("GL_APPLE_rgb_422"); + GLAD_GL_EXT_texture_lod_bias = has_ext("GL_EXT_texture_lod_bias"); + GLAD_GL_ARB_gpu_shader_int64 = has_ext("GL_ARB_gpu_shader_int64"); + GLAD_GL_ARB_seamless_cube_map = has_ext("GL_ARB_seamless_cube_map"); + GLAD_GL_ARB_shader_group_vote = has_ext("GL_ARB_shader_group_vote"); + GLAD_GL_NV_vdpau_interop = has_ext("GL_NV_vdpau_interop"); + GLAD_GL_ARB_occlusion_query2 = has_ext("GL_ARB_occlusion_query2"); + GLAD_GL_ARB_internalformat_query2 = has_ext("GL_ARB_internalformat_query2"); + GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); + GLAD_GL_SUN_vertex = has_ext("GL_SUN_vertex"); + GLAD_GL_SGIX_igloo_interface = has_ext("GL_SGIX_igloo_interface"); + GLAD_GL_SGIS_texture_lod = has_ext("GL_SGIS_texture_lod"); + GLAD_GL_NV_vertex_program3 = has_ext("GL_NV_vertex_program3"); + GLAD_GL_ARB_draw_indirect = has_ext("GL_ARB_draw_indirect"); + GLAD_GL_NV_vertex_program4 = has_ext("GL_NV_vertex_program4"); + GLAD_GL_AMD_transform_feedback3_lines_triangles = has_ext("GL_AMD_transform_feedback3_lines_triangles"); + GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); + GLAD_GL_EXT_x11_sync_object = has_ext("GL_EXT_x11_sync_object"); + GLAD_GL_ARB_sync = has_ext("GL_ARB_sync"); + GLAD_GL_NV_sample_locations = has_ext("GL_NV_sample_locations"); + GLAD_GL_ARB_compute_variable_group_size = has_ext("GL_ARB_compute_variable_group_size"); + GLAD_GL_OES_fixed_point = has_ext("GL_OES_fixed_point"); + GLAD_GL_NV_blend_square = has_ext("GL_NV_blend_square"); + GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); + GLAD_GL_ARB_gpu_shader5 = has_ext("GL_ARB_gpu_shader5"); + GLAD_GL_SGIS_texture4D = has_ext("GL_SGIS_texture4D"); + GLAD_GL_EXT_texture3D = has_ext("GL_EXT_texture3D"); + GLAD_GL_EXT_multisample = has_ext("GL_EXT_multisample"); + GLAD_GL_EXT_secondary_color = has_ext("GL_EXT_secondary_color"); + GLAD_GL_ARB_texture_filter_minmax = has_ext("GL_ARB_texture_filter_minmax"); + GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); + GLAD_GL_ARB_parallel_shader_compile = has_ext("GL_ARB_parallel_shader_compile"); + GLAD_GL_NVX_gpu_memory_info = has_ext("GL_NVX_gpu_memory_info"); + GLAD_GL_ARB_sparse_texture = has_ext("GL_ARB_sparse_texture"); + GLAD_GL_SGIS_point_line_texgen = has_ext("GL_SGIS_point_line_texgen"); + GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); + GLAD_GL_ARB_sparse_buffer = has_ext("GL_ARB_sparse_buffer"); + GLAD_GL_EXT_draw_range_elements = has_ext("GL_EXT_draw_range_elements"); + GLAD_GL_SGIX_blend_alpha_minmax = has_ext("GL_SGIX_blend_alpha_minmax"); + GLAD_GL_KHR_context_flush_control = has_ext("GL_KHR_context_flush_control"); + free_exts(); + return 1; +} + +static void find_coreGL(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; + GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; + GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; + GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; + GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; + GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; + GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; + GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; + GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; + GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; + if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { + max_loaded_major = 3; + max_loaded_minor = 3; + } +} + +int gladLoadGLLoader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGL(); + load_GL_VERSION_1_0(load); + load_GL_VERSION_1_1(load); + load_GL_VERSION_1_2(load); + load_GL_VERSION_1_3(load); + load_GL_VERSION_1_4(load); + load_GL_VERSION_1_5(load); + load_GL_VERSION_2_0(load); + load_GL_VERSION_2_1(load); + load_GL_VERSION_3_0(load); + load_GL_VERSION_3_1(load); + load_GL_VERSION_3_2(load); + load_GL_VERSION_3_3(load); + + if (!find_extensionsGL()) return 0; + load_GL_APPLE_element_array(load); + load_GL_AMD_multi_draw_indirect(load); + load_GL_SGIX_tag_sample_buffer(load); + load_GL_NV_point_sprite(load); + load_GL_ATI_separate_stencil(load); + load_GL_EXT_texture_buffer_object(load); + load_GL_ARB_vertex_blend(load); + load_GL_OVR_multiview(load); + load_GL_ARB_program_interface_query(load); + load_GL_EXT_index_func(load); + load_GL_NV_shader_buffer_load(load); + load_GL_EXT_color_subtable(load); + load_GL_SUNX_constant_data(load); + load_GL_EXT_multi_draw_arrays(load); + load_GL_ARB_shader_atomic_counters(load); + load_GL_NV_conditional_render(load); + load_GL_MESA_resize_buffers(load); + load_GL_ARB_texture_view(load); + load_GL_ARB_map_buffer_range(load); + load_GL_EXT_convolution(load); + load_GL_NV_vertex_attrib_integer_64bit(load); + load_GL_EXT_paletted_texture(load); + load_GL_ARB_texture_buffer_object(load); + load_GL_ATI_pn_triangles(load); + load_GL_SGIX_flush_raster(load); + load_GL_EXT_light_texture(load); + load_GL_HP_image_transform(load); + load_GL_AMD_draw_buffers_blend(load); + load_GL_APPLE_texture_range(load); + load_GL_EXT_texture_array(load); + load_GL_NV_texture_barrier(load); + load_GL_ARB_vertex_type_2_10_10_10_rev(load); + load_GL_3DFX_tbuffer(load); + load_GL_GREMEDY_frame_terminator(load); + load_GL_ARB_blend_func_extended(load); + load_GL_EXT_separate_shader_objects(load); + load_GL_NV_texture_multisample(load); + load_GL_ARB_shader_objects(load); + load_GL_ARB_framebuffer_object(load); + load_GL_ATI_envmap_bumpmap(load); + load_GL_ATI_map_object_buffer(load); + load_GL_ARB_robustness(load); + load_GL_NV_pixel_data_range(load); + load_GL_EXT_framebuffer_blit(load); + load_GL_ARB_gpu_shader_fp64(load); + load_GL_NV_command_list(load); + load_GL_EXT_vertex_weighting(load); + load_GL_GREMEDY_string_marker(load); + load_GL_EXT_subtexture(load); + load_GL_EXT_gpu_program_parameters(load); + load_GL_NV_evaluators(load); + load_GL_SGIS_texture_filter4(load); + load_GL_AMD_performance_monitor(load); + load_GL_EXT_stencil_clear_tag(load); + load_GL_NV_present_video(load); + load_GL_SGIX_framezoom(load); + load_GL_ARB_draw_elements_base_vertex(load); + load_GL_NV_transform_feedback(load); + load_GL_NV_fragment_program(load); + load_GL_AMD_stencil_operation_extended(load); + load_GL_ARB_instanced_arrays(load); + load_GL_EXT_polygon_offset(load); + load_GL_KHR_robustness(load); + load_GL_AMD_sparse_texture(load); + load_GL_ARB_clip_control(load); + load_GL_NV_fragment_coverage_to_color(load); + load_GL_NV_fence(load); + load_GL_ARB_texture_buffer_range(load); + load_GL_SUN_mesh_array(load); + load_GL_ARB_vertex_attrib_binding(load); + load_GL_ARB_framebuffer_no_attachments(load); + load_GL_ARB_cl_event(load); + load_GL_OES_single_precision(load); + load_GL_NV_primitive_restart(load); + load_GL_SUN_global_alpha(load); + load_GL_EXT_texture_object(load); + load_GL_AMD_name_gen_delete(load); + load_GL_ARB_buffer_storage(load); + load_GL_APPLE_vertex_program_evaluators(load); + load_GL_ARB_multi_bind(load); + load_GL_SGIX_list_priority(load); + load_GL_NV_vertex_buffer_unified_memory(load); + load_GL_NV_blend_equation_advanced(load); + load_GL_SGIS_sharpen_texture(load); + load_GL_ARB_vertex_program(load); + load_GL_ARB_vertex_buffer_object(load); + load_GL_NV_vertex_array_range(load); + load_GL_SGIX_fragment_lighting(load); + load_GL_NV_framebuffer_multisample_coverage(load); + load_GL_EXT_timer_query(load); + load_GL_NV_bindless_texture(load); + load_GL_KHR_debug(load); + load_GL_ATI_vertex_attrib_array_object(load); + load_GL_EXT_geometry_shader4(load); + load_GL_EXT_bindable_uniform(load); + load_GL_KHR_blend_equation_advanced(load); + load_GL_ATI_element_array(load); + load_GL_SGIX_reference_plane(load); + load_GL_EXT_stencil_two_side(load); + load_GL_NV_explicit_multisample(load); + load_GL_IBM_static_data(load); + load_GL_EXT_texture_perturb_normal(load); + load_GL_EXT_point_parameters(load); + load_GL_PGI_misc_hints(load); + load_GL_ARB_vertex_shader(load); + load_GL_ARB_tessellation_shader(load); + load_GL_EXT_draw_buffers2(load); + load_GL_ARB_vertex_attrib_64bit(load); + load_GL_EXT_texture_filter_minmax(load); + load_GL_AMD_interleaved_elements(load); + load_GL_ARB_fragment_program(load); + load_GL_ARB_texture_storage(load); + load_GL_ARB_copy_image(load); + load_GL_SGIS_pixel_texture(load); + load_GL_SGIX_instruments(load); + load_GL_ARB_shader_storage_buffer_object(load); + load_GL_EXT_blend_minmax(load); + load_GL_ARB_base_instance(load); + load_GL_ARB_ES3_1_compatibility(load); + load_GL_EXT_texture_integer(load); + load_GL_ARB_texture_multisample(load); + load_GL_AMD_gpu_shader_int64(load); + load_GL_AMD_vertex_shader_tessellator(load); + load_GL_ARB_invalidate_subdata(load); + load_GL_EXT_index_material(load); + load_GL_INTEL_parallel_arrays(load); + load_GL_ATI_draw_buffers(load); + load_GL_SGIX_pixel_texture(load); + load_GL_ARB_timer_query(load); + load_GL_NV_parameter_buffer_object(load); + load_GL_ARB_direct_state_access(load); + load_GL_ARB_uniform_buffer_object(load); + load_GL_NV_transform_feedback2(load); + load_GL_EXT_blend_color(load); + load_GL_EXT_histogram(load); + load_GL_ARB_get_texture_sub_image(load); + load_GL_SGIS_point_parameters(load); + load_GL_EXT_direct_state_access(load); + load_GL_AMD_sample_positions(load); + load_GL_NV_vertex_program(load); + load_GL_EXT_vertex_shader(load); + load_GL_EXT_blend_func_separate(load); + load_GL_APPLE_fence(load); + load_GL_OES_byte_coordinates(load); + load_GL_ARB_transpose_matrix(load); + load_GL_ARB_provoking_vertex(load); + load_GL_EXT_fog_coord(load); + load_GL_EXT_vertex_array(load); + load_GL_EXT_blend_equation_separate(load); + load_GL_NV_framebuffer_mixed_samples(load); + load_GL_NVX_conditional_render(load); + load_GL_ARB_multi_draw_indirect(load); + load_GL_EXT_raster_multisample(load); + load_GL_NV_copy_image(load); + load_GL_INTEL_framebuffer_CMAA(load); + load_GL_ARB_transform_feedback2(load); + load_GL_ARB_transform_feedback3(load); + load_GL_EXT_debug_marker(load); + load_GL_EXT_pixel_transform(load); + load_GL_ATI_fragment_shader(load); + load_GL_ARB_vertex_array_object(load); + load_GL_SUN_triangle_list(load); + load_GL_ARB_transform_feedback_instanced(load); + load_GL_SGIX_async(load); + load_GL_INTEL_performance_query(load); + load_GL_NV_gpu_shader5(load); + load_GL_NV_bindless_multi_draw_indirect_count(load); + load_GL_ARB_ES2_compatibility(load); + load_GL_ARB_indirect_parameters(load); + load_GL_NV_half_float(load); + load_GL_ARB_ES3_2_compatibility(load); + load_GL_EXT_polygon_offset_clamp(load); + load_GL_EXT_compiled_vertex_array(load); + load_GL_NV_depth_buffer_float(load); + load_GL_NV_occlusion_query(load); + load_GL_APPLE_flush_buffer_range(load); + load_GL_ARB_imaging(load); + load_GL_ARB_draw_buffers_blend(load); + load_GL_ARB_clear_buffer_object(load); + load_GL_ARB_multisample(load); + load_GL_EXT_debug_label(load); + load_GL_ARB_sample_shading(load); + load_GL_NV_internalformat_sample_query(load); + load_GL_INTEL_map_texture(load); + load_GL_ARB_compute_shader(load); + load_GL_IBM_vertex_array_lists(load); + load_GL_ARB_color_buffer_float(load); + load_GL_ARB_bindless_texture(load); + load_GL_ARB_window_pos(load); + load_GL_ARB_internalformat_query(load); + load_GL_EXT_shader_image_load_store(load); + load_GL_EXT_copy_texture(load); + load_GL_NV_register_combiners2(load); + load_GL_NV_draw_texture(load); + load_GL_EXT_draw_instanced(load); + load_GL_ARB_viewport_array(load); + load_GL_ARB_separate_shader_objects(load); + load_GL_EXT_depth_bounds_test(load); + load_GL_NV_video_capture(load); + load_GL_ARB_sampler_objects(load); + load_GL_ARB_matrix_palette(load); + load_GL_SGIS_texture_color_mask(load); + load_GL_EXT_coordinate_frame(load); + load_GL_ARB_texture_compression(load); + load_GL_ARB_shader_subroutine(load); + load_GL_ARB_texture_storage_multisample(load); + load_GL_EXT_vertex_attrib_64bit(load); + load_GL_OES_query_matrix(load); + load_GL_MESA_window_pos(load); + load_GL_ARB_copy_buffer(load); + load_GL_APPLE_object_purgeable(load); + load_GL_ARB_occlusion_query(load); + load_GL_SGI_color_table(load); + load_GL_EXT_gpu_shader4(load); + load_GL_NV_geometry_program4(load); + load_GL_AMD_debug_output(load); + load_GL_ARB_multitexture(load); + load_GL_SGIX_polynomial_ffd(load); + load_GL_EXT_provoking_vertex(load); + load_GL_ARB_point_parameters(load); + load_GL_ARB_shader_image_load_store(load); + load_GL_ARB_texture_barrier(load); + load_GL_NV_bindless_multi_draw_indirect(load); + load_GL_EXT_transform_feedback(load); + load_GL_NV_gpu_program4(load); + load_GL_NV_gpu_program5(load); + load_GL_ARB_geometry_shader4(load); + load_GL_NV_conservative_raster(load); + load_GL_SGIX_sprite(load); + load_GL_ARB_get_program_binary(load); + load_GL_AMD_occlusion_query_event(load); + load_GL_SGIS_multisample(load); + load_GL_EXT_framebuffer_object(load); + load_GL_APPLE_vertex_array_range(load); + load_GL_NV_register_combiners(load); + load_GL_ARB_draw_buffers(load); + load_GL_ARB_clear_texture(load); + load_GL_ARB_debug_output(load); + load_GL_EXT_cull_vertex(load); + load_GL_IBM_multimode_draw_arrays(load); + load_GL_APPLE_vertex_array_object(load); + load_GL_SGIS_detail_texture(load); + load_GL_ARB_draw_instanced(load); + load_GL_ARB_shading_language_include(load); + load_GL_INGR_blend_func_separate(load); + load_GL_NV_path_rendering(load); + load_GL_NV_conservative_raster_dilate(load); + load_GL_ATI_vertex_streams(load); + load_GL_ARB_gpu_shader_int64(load); + load_GL_NV_vdpau_interop(load); + load_GL_ARB_internalformat_query2(load); + load_GL_SUN_vertex(load); + load_GL_SGIX_igloo_interface(load); + load_GL_ARB_draw_indirect(load); + load_GL_NV_vertex_program4(load); + load_GL_SGIS_fog_function(load); + load_GL_EXT_x11_sync_object(load); + load_GL_ARB_sync(load); + load_GL_NV_sample_locations(load); + load_GL_ARB_compute_variable_group_size(load); + load_GL_OES_fixed_point(load); + load_GL_EXT_framebuffer_multisample(load); + load_GL_SGIS_texture4D(load); + load_GL_EXT_texture3D(load); + load_GL_EXT_multisample(load); + load_GL_EXT_secondary_color(load); + load_GL_ATI_vertex_array_object(load); + load_GL_ARB_parallel_shader_compile(load); + load_GL_ARB_sparse_texture(load); + load_GL_ARB_sample_locations(load); + load_GL_ARB_sparse_buffer(load); + load_GL_EXT_draw_range_elements(load); + return GLVersion.major != 0 || GLVersion.minor != 0; +} + diff --git a/src/external/glad.h b/src/external/glad.h new file mode 100644 index 00000000..56bb622d --- /dev/null +++ b/src/external/glad.h @@ -0,0 +1,14241 @@ +/* + + OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=3.3 + Profile: core + Extensions: + GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control + Loader: No + + Commandline: + --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" + Online: + Too many extensions +*/ + + +#ifndef __glad_h_ +#define __glad_h_ + +#ifdef __gl_h_ +#error OpenGL header already included, remove this include, glad already provides it +#endif +#define __gl_h_ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +//#include +#define APIENTRY __stdcall // RAY: Added +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct gladGLversionStruct { + int major; + int minor; +}; + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI struct gladGLversionStruct GLVersion; +GLAPI int gladLoadGLLoader(GLADloadproc); + +#include +//#include // RAY: Not required +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLclampx; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef int GLsizei; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void *GLeglImageOES; +typedef char GLchar; +typedef char GLcharARB; +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef unsigned short GLhalfARB; +typedef unsigned short GLhalf; +typedef GLint GLfixed; +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +typedef int64_t GLint64; +typedef uint64_t GLuint64; +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +typedef struct __GLsync *GLsync; +struct _cl_context; +struct _cl_event; +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef unsigned short GLhalfNV; +typedef GLintptr GLvdpauSurfaceNV; +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_NONE 0 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_VIEWPORT 0x0BA2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_REPEAT 0x2901 +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_COLOR_ATTACHMENT16 0x8CF0 +#define GL_COLOR_ATTACHMENT17 0x8CF1 +#define GL_COLOR_ATTACHMENT18 0x8CF2 +#define GL_COLOR_ATTACHMENT19 0x8CF3 +#define GL_COLOR_ATTACHMENT20 0x8CF4 +#define GL_COLOR_ATTACHMENT21 0x8CF5 +#define GL_COLOR_ATTACHMENT22 0x8CF6 +#define GL_COLOR_ATTACHMENT23 0x8CF7 +#define GL_COLOR_ATTACHMENT24 0x8CF8 +#define GL_COLOR_ATTACHMENT25 0x8CF9 +#define GL_COLOR_ATTACHMENT26 0x8CFA +#define GL_COLOR_ATTACHMENT27 0x8CFB +#define GL_COLOR_ATTACHMENT28 0x8CFC +#define GL_COLOR_ATTACHMENT29 0x8CFD +#define GL_COLOR_ATTACHMENT30 0x8CFE +#define GL_COLOR_ATTACHMENT31 0x8CFF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#define GL_INDEX 0x8222 +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#define GL_HALF_FLOAT 0x140B +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_DEPTH_CLAMP 0x864F +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_SAMPLER_BINDING 0x8919 +#define GL_RGB10_A2UI 0x906F +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#define GL_INT_2_10_10_10_REV 0x8D9F +#ifndef GL_VERSION_1_0 +#define GL_VERSION_1_0 1 +GLAPI int GLAD_GL_VERSION_1_0; +typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); +GLAPI PFNGLCULLFACEPROC glad_glCullFace; +#define glCullFace glad_glCullFace +typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); +GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; +#define glFrontFace glad_glFrontFace +typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); +GLAPI PFNGLHINTPROC glad_glHint; +#define glHint glad_glHint +typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); +GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; +#define glLineWidth glad_glLineWidth +typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); +GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; +#define glPointSize glad_glPointSize +typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); +GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; +#define glPolygonMode glad_glPolygonMode +typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORPROC glad_glScissor; +#define glScissor glad_glScissor +typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +#define glTexParameterf glad_glTexParameterf +typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +#define glTexParameterfv glad_glTexParameterfv +typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +#define glTexParameteri glad_glTexParameteri +typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +#define glTexParameteriv glad_glTexParameteriv +typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +#define glTexImage1D glad_glTexImage1D +typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +#define glTexImage2D glad_glTexImage2D +typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); +GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +#define glDrawBuffer glad_glDrawBuffer +typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); +GLAPI PFNGLCLEARPROC glad_glClear; +#define glClear glad_glClear +typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; +#define glClearColor glad_glClearColor +typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); +GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; +#define glClearStencil glad_glClearStencil +typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); +GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; +#define glClearDepth glad_glClearDepth +typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); +GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; +#define glStencilMask glad_glStencilMask +typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLCOLORMASKPROC glad_glColorMask; +#define glColorMask glad_glColorMask +typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); +GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; +#define glDepthMask glad_glDepthMask +typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); +GLAPI PFNGLDISABLEPROC glad_glDisable; +#define glDisable glad_glDisable +typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); +GLAPI PFNGLENABLEPROC glad_glEnable; +#define glEnable glad_glEnable +typedef void (APIENTRYP PFNGLFINISHPROC)(); +GLAPI PFNGLFINISHPROC glad_glFinish; +#define glFinish glad_glFinish +typedef void (APIENTRYP PFNGLFLUSHPROC)(); +GLAPI PFNGLFLUSHPROC glad_glFlush; +#define glFlush glad_glFlush +typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); +GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; +#define glBlendFunc glad_glBlendFunc +typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); +GLAPI PFNGLLOGICOPPROC glad_glLogicOp; +#define glLogicOp glad_glLogicOp +typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; +#define glStencilFunc glad_glStencilFunc +typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); +GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; +#define glStencilOp glad_glStencilOp +typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); +GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; +#define glDepthFunc glad_glDepthFunc +typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; +#define glPixelStoref glad_glPixelStoref +typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; +#define glPixelStorei glad_glPixelStorei +typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); +GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; +#define glReadBuffer glad_glReadBuffer +typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); +GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; +#define glReadPixels glad_glReadPixels +typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean* data); +GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +#define glGetBooleanv glad_glGetBooleanv +typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble* data); +GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; +#define glGetDoublev glad_glGetDoublev +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); +GLAPI PFNGLGETERRORPROC glad_glGetError; +#define glGetError glad_glGetError +typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat* data); +GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; +#define glGetFloatv glad_glGetFloatv +typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint* data); +GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; +#define glGetIntegerv glad_glGetIntegerv +typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); +GLAPI PFNGLGETSTRINGPROC glad_glGetString; +#define glGetString glad_glGetString +typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +#define glGetTexImage glad_glGetTexImage +typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +#define glGetTexParameterfv glad_glGetTexParameterfv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +#define glGetTexParameteriv glad_glGetTexParameteriv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv +typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); +GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; +#define glIsEnabled glad_glIsEnabled +typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far); +GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; +#define glDepthRange glad_glDepthRange +typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLVIEWPORTPROC glad_glViewport; +#define glViewport glad_glViewport +#endif +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 +GLAPI int GLAD_GL_VERSION_1_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; +#define glDrawArrays glad_glDrawArrays +typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices); +GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; +#define glDrawElements glad_glDrawElements +typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +#define glPolygonOffset glad_glPolygonOffset +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +#define glCopyTexImage1D glad_glCopyTexImage1D +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +#define glCopyTexImage2D glad_glCopyTexImage2D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +#define glCopyTexSubImage1D glad_glCopyTexSubImage1D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +#define glCopyTexSubImage2D glad_glCopyTexSubImage2D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +#define glTexSubImage1D glad_glTexSubImage1D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +#define glTexSubImage2D glad_glTexSubImage2D +typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; +#define glBindTexture glad_glBindTexture +typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint* textures); +GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +#define glDeleteTextures glad_glDeleteTextures +typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint* textures); +GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; +#define glGenTextures glad_glGenTextures +typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; +#define glIsTexture glad_glIsTexture +#endif +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +GLAPI int GLAD_GL_VERSION_1_2; +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); +GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +#define glDrawRangeElements glad_glDrawRangeElements +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +#define glTexImage3D glad_glTexImage3D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +#define glTexSubImage3D glad_glTexSubImage3D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +#define glCopyTexSubImage3D glad_glCopyTexSubImage3D +#endif +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +GLAPI int GLAD_GL_VERSION_1_3; +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +#define glActiveTexture glad_glActiveTexture +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +#define glSampleCoverage glad_glSampleCoverage +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +#define glCompressedTexImage3D glad_glCompressedTexImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +#define glCompressedTexImage2D glad_glCompressedTexImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +#define glCompressedTexImage1D glad_glCompressedTexImage1D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void* img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +#define glGetCompressedTexImage glad_glGetCompressedTexImage +#endif +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +GLAPI int GLAD_GL_VERSION_1_4; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +#define glBlendFuncSeparate glad_glBlendFuncSeparate +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +#define glMultiDrawArrays glad_glMultiDrawArrays +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +#define glMultiDrawElements glad_glMultiDrawElements +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +#define glPointParameterf glad_glPointParameterf +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +#define glPointParameterfv glad_glPointParameterfv +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +#define glPointParameteri glad_glPointParameteri +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +#define glPointParameteriv glad_glPointParameteriv +typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; +#define glBlendColor glad_glBlendColor +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); +GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +#define glBlendEquation glad_glBlendEquation +#endif +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +GLAPI int GLAD_GL_VERSION_1_5; +typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; +#define glGenQueries glad_glGenQueries +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint* ids); +GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +#define glDeleteQueries glad_glDeleteQueries +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); +GLAPI PFNGLISQUERYPROC glad_glIsQuery; +#define glIsQuery glad_glIsQuery +typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); +GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; +#define glBeginQuery glad_glBeginQuery +typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); +GLAPI PFNGLENDQUERYPROC glad_glEndQuery; +#define glEndQuery glad_glEndQuery +typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; +#define glGetQueryiv glad_glGetQueryiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +#define glGetQueryObjectiv glad_glGetQueryObjectiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint* params); +GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +#define glGetQueryObjectuiv glad_glGetQueryObjectuiv +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; +#define glBindBuffer glad_glBindBuffer +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint* buffers); +GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +#define glDeleteBuffers glad_glDeleteBuffers +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint* buffers); +GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; +#define glGenBuffers glad_glGenBuffers +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; +#define glIsBuffer glad_glIsBuffer +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void* data, GLenum usage); +GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; +#define glBufferData glad_glBufferData +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +#define glBufferSubData glad_glBufferSubData +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void* data); +GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +#define glGetBufferSubData glad_glGetBufferSubData +typedef void* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; +#define glMapBuffer glad_glMapBuffer +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +#define glUnmapBuffer glad_glUnmapBuffer +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +#define glGetBufferParameteriv glad_glGetBufferParameteriv +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void** params); +GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +#define glGetBufferPointerv glad_glGetBufferPointerv +#endif +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +GLAPI int GLAD_GL_VERSION_2_0; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +#define glBlendEquationSeparate glad_glBlendEquationSeparate +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum* bufs); +GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +#define glDrawBuffers glad_glDrawBuffers +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +#define glStencilOpSeparate glad_glStencilOpSeparate +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +#define glStencilFuncSeparate glad_glStencilFuncSeparate +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); +GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +#define glStencilMaskSeparate glad_glStencilMaskSeparate +typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; +#define glAttachShader glad_glAttachShader +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar* name); +GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +#define glBindAttribLocation glad_glBindAttribLocation +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); +GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; +#define glCompileShader glad_glCompileShader +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); +GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +#define glCreateProgram glad_glCreateProgram +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); +GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; +#define glCreateShader glad_glCreateShader +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); +GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +#define glDeleteProgram glad_glDeleteProgram +typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); +GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; +#define glDeleteShader glad_glDeleteShader +typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; +#define glDetachShader glad_glDetachShader +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +#define glDisableVertexAttribArray glad_glDisableVertexAttribArray +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +#define glEnableVertexAttribArray glad_glEnableVertexAttribArray +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +#define glGetActiveAttrib glad_glGetActiveAttrib +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +#define glGetActiveUniform glad_glGetActiveUniform +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +#define glGetAttachedShaders glad_glGetAttachedShaders +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +#define glGetAttribLocation glad_glGetAttribLocation +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +#define glGetProgramiv glad_glGetProgramiv +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +#define glGetProgramInfoLog glad_glGetProgramInfoLog +typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint* params); +GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; +#define glGetShaderiv glad_glGetShaderiv +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +#define glGetShaderInfoLog glad_glGetShaderInfoLog +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* source); +GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +#define glGetShaderSource glad_glGetShaderSource +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +#define glGetUniformLocation glad_glGetUniformLocation +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat* params); +GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +#define glGetUniformfv glad_glGetUniformfv +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint* params); +GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +#define glGetUniformiv glad_glGetUniformiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +#define glGetVertexAttribdv glad_glGetVertexAttribdv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +#define glGetVertexAttribfv glad_glGetVertexAttribfv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +#define glGetVertexAttribiv glad_glGetVertexAttribiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void** pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); +GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; +#define glIsProgram glad_glIsProgram +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); +GLAPI PFNGLISSHADERPROC glad_glIsShader; +#define glIsShader glad_glIsShader +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); +GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; +#define glLinkProgram glad_glLinkProgram +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length); +GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; +#define glShaderSource glad_glShaderSource +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); +GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; +#define glUseProgram glad_glUseProgram +typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); +GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; +#define glUniform1f glad_glUniform1f +typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; +#define glUniform2f glad_glUniform2f +typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; +#define glUniform3f glad_glUniform3f +typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; +#define glUniform4f glad_glUniform4f +typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); +GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; +#define glUniform1i glad_glUniform1i +typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); +GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; +#define glUniform2i glad_glUniform2i +typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; +#define glUniform3i glad_glUniform3i +typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; +#define glUniform4i glad_glUniform4i +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; +#define glUniform1fv glad_glUniform1fv +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; +#define glUniform2fv glad_glUniform2fv +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; +#define glUniform3fv glad_glUniform3fv +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; +#define glUniform4fv glad_glUniform4fv +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; +#define glUniform1iv glad_glUniform1iv +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; +#define glUniform2iv glad_glUniform2iv +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; +#define glUniform3iv glad_glUniform3iv +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; +#define glUniform4iv glad_glUniform4iv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +#define glUniformMatrix2fv glad_glUniformMatrix2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +#define glUniformMatrix3fv glad_glUniformMatrix3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +#define glUniformMatrix4fv glad_glUniformMatrix4fv +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); +GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +#define glValidateProgram glad_glValidateProgram +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +#define glVertexAttrib1d glad_glVertexAttrib1d +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +#define glVertexAttrib1dv glad_glVertexAttrib1dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +#define glVertexAttrib1f glad_glVertexAttrib1f +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +#define glVertexAttrib1fv glad_glVertexAttrib1fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +#define glVertexAttrib1s glad_glVertexAttrib1s +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +#define glVertexAttrib1sv glad_glVertexAttrib1sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +#define glVertexAttrib2d glad_glVertexAttrib2d +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +#define glVertexAttrib2dv glad_glVertexAttrib2dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +#define glVertexAttrib2f glad_glVertexAttrib2f +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +#define glVertexAttrib2fv glad_glVertexAttrib2fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +#define glVertexAttrib2s glad_glVertexAttrib2s +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +#define glVertexAttrib2sv glad_glVertexAttrib2sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +#define glVertexAttrib3d glad_glVertexAttrib3d +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +#define glVertexAttrib3dv glad_glVertexAttrib3dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +#define glVertexAttrib3f glad_glVertexAttrib3f +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +#define glVertexAttrib3fv glad_glVertexAttrib3fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +#define glVertexAttrib3s glad_glVertexAttrib3s +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +#define glVertexAttrib3sv glad_glVertexAttrib3sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +#define glVertexAttrib4Niv glad_glVertexAttrib4Niv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +#define glVertexAttrib4Nub glad_glVertexAttrib4Nub +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +#define glVertexAttrib4bv glad_glVertexAttrib4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +#define glVertexAttrib4d glad_glVertexAttrib4d +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +#define glVertexAttrib4dv glad_glVertexAttrib4dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +#define glVertexAttrib4f glad_glVertexAttrib4f +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +#define glVertexAttrib4fv glad_glVertexAttrib4fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +#define glVertexAttrib4iv glad_glVertexAttrib4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +#define glVertexAttrib4s glad_glVertexAttrib4s +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +#define glVertexAttrib4sv glad_glVertexAttrib4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +#define glVertexAttrib4ubv glad_glVertexAttrib4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +#define glVertexAttrib4uiv glad_glVertexAttrib4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +#define glVertexAttrib4usv glad_glVertexAttrib4usv +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +#define glVertexAttribPointer glad_glVertexAttribPointer +#endif +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +GLAPI int GLAD_GL_VERSION_2_1; +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv +#endif +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +GLAPI int GLAD_GL_VERSION_3_0; +typedef void (APIENTRYP PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI PFNGLCOLORMASKIPROC glad_glColorMaski; +#define glColorMaski glad_glColorMaski +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean* data); +GLAPI PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +#define glGetBooleani_v glad_glGetBooleani_v +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint* data); +GLAPI PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +#define glGetIntegeri_v glad_glGetIntegeri_v +typedef void (APIENTRYP PFNGLENABLEIPROC)(GLenum target, GLuint index); +GLAPI PFNGLENABLEIPROC glad_glEnablei; +#define glEnablei glad_glEnablei +typedef void (APIENTRYP PFNGLDISABLEIPROC)(GLenum target, GLuint index); +GLAPI PFNGLDISABLEIPROC glad_glDisablei; +#define glDisablei glad_glDisablei +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC)(GLenum target, GLuint index); +GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; +#define glIsEnabledi glad_glIsEnabledi +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); +GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +#define glBeginTransformFeedback glad_glBeginTransformFeedback +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); +GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +#define glEndTransformFeedback glad_glEndTransformFeedback +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +#define glBindBufferRange glad_glBindBufferRange +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer); +GLAPI PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +#define glBindBufferBase glad_glBindBufferBase +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); +GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp); +GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; +#define glClampColor glad_glClampColor +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); +GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +#define glBeginConditionalRender glad_glBeginConditionalRender +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); +GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +#define glEndConditionalRender glad_glEndConditionalRender +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +#define glVertexAttribIPointer glad_glVertexAttribIPointer +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +#define glGetVertexAttribIiv glad_glGetVertexAttribIiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint* params); +GLAPI PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x); +GLAPI PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +#define glVertexAttribI1i glad_glVertexAttribI1i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y); +GLAPI PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +#define glVertexAttribI2i glad_glVertexAttribI2i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +#define glVertexAttribI3i glad_glVertexAttribI3i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +#define glVertexAttribI4i glad_glVertexAttribI4i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x); +GLAPI PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +#define glVertexAttribI1ui glad_glVertexAttribI1ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y); +GLAPI PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +#define glVertexAttribI2ui glad_glVertexAttribI2ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +#define glVertexAttribI3ui glad_glVertexAttribI3ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +#define glVertexAttribI4ui glad_glVertexAttribI4ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +#define glVertexAttribI1iv glad_glVertexAttribI1iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +#define glVertexAttribI2iv glad_glVertexAttribI2iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +#define glVertexAttribI3iv glad_glVertexAttribI3iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +#define glVertexAttribI4iv glad_glVertexAttribI4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +#define glVertexAttribI1uiv glad_glVertexAttribI1uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +#define glVertexAttribI2uiv glad_glVertexAttribI2uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +#define glVertexAttribI3uiv glad_glVertexAttribI3uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +#define glVertexAttribI4uiv glad_glVertexAttribI4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +#define glVertexAttribI4bv glad_glVertexAttribI4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +#define glVertexAttribI4sv glad_glVertexAttribI4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +#define glVertexAttribI4ubv glad_glVertexAttribI4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +#define glVertexAttribI4usv glad_glVertexAttribI4usv +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint* params); +GLAPI PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +#define glGetUniformuiv glad_glGetUniformuiv +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar* name); +GLAPI PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +#define glBindFragDataLocation glad_glBindFragDataLocation +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +#define glGetFragDataLocation glad_glGetFragDataLocation +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0); +GLAPI PFNGLUNIFORM1UIPROC glad_glUniform1ui; +#define glUniform1ui glad_glUniform1ui +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1); +GLAPI PFNGLUNIFORM2UIPROC glad_glUniform2ui; +#define glUniform2ui glad_glUniform2ui +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI PFNGLUNIFORM3UIPROC glad_glUniform3ui; +#define glUniform3ui glad_glUniform3ui +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI PFNGLUNIFORM4UIPROC glad_glUniform4ui; +#define glUniform4ui glad_glUniform4ui +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +#define glUniform1uiv glad_glUniform1uiv +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +#define glUniform2uiv glad_glUniform2uiv +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +#define glUniform3uiv glad_glUniform3uiv +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +#define glUniform4uiv glad_glUniform4uiv +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +#define glTexParameterIiv glad_glTexParameterIiv +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint* params); +GLAPI PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +#define glTexParameterIuiv glad_glTexParameterIuiv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +#define glGetTexParameterIiv glad_glGetTexParameterIiv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint* params); +GLAPI PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +#define glGetTexParameterIuiv glad_glGetTexParameterIuiv +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint* value); +GLAPI PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +#define glClearBufferiv glad_glClearBufferiv +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint* value); +GLAPI PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +#define glClearBufferuiv glad_glClearBufferuiv +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat* value); +GLAPI PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +#define glClearBufferfv glad_glClearBufferfv +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +#define glClearBufferfi glad_glClearBufferfi +typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum name, GLuint index); +GLAPI PFNGLGETSTRINGIPROC glad_glGetStringi; +#define glGetStringi glad_glGetStringi +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +#define glIsRenderbuffer glad_glIsRenderbuffer +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +#define glBindRenderbuffer glad_glBindRenderbuffer +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint* renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +#define glDeleteRenderbuffers glad_glDeleteRenderbuffers +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +#define glGenRenderbuffers glad_glGenRenderbuffers +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +#define glRenderbufferStorage glad_glRenderbufferStorage +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +#define glIsFramebuffer glad_glIsFramebuffer +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +#define glBindFramebuffer glad_glBindFramebuffer +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint* framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +#define glDeleteFramebuffers glad_glDeleteFramebuffers +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +#define glGenFramebuffers glad_glGenFramebuffers +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +#define glCheckFramebufferStatus glad_glCheckFramebufferStatus +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +#define glFramebufferTexture1D glad_glFramebufferTexture1D +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +#define glFramebufferTexture2D glad_glFramebufferTexture2D +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +#define glFramebufferTexture3D glad_glFramebufferTexture3D +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +#define glGenerateMipmap glad_glGenerateMipmap +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +#define glBlitFramebuffer glad_glBlitFramebuffer +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +#define glFramebufferTextureLayer glad_glFramebufferTextureLayer +typedef void* (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +#define glMapBufferRange glad_glMapBufferRange +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +#define glFlushMappedBufferRange glad_glFlushMappedBufferRange +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC)(GLuint array); +GLAPI PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +#define glBindVertexArray glad_glBindVertexArray +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint* arrays); +GLAPI PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +#define glDeleteVertexArrays glad_glDeleteVertexArrays +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); +GLAPI PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +#define glGenVertexArrays glad_glGenVertexArrays +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint array); +GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +#define glIsVertexArray glad_glIsVertexArray +#endif +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +GLAPI int GLAD_GL_VERSION_3_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +#define glDrawArraysInstanced glad_glDrawArraysInstanced +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount); +GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +#define glDrawElementsInstanced glad_glDrawElementsInstanced +typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer; +#define glTexBuffer glad_glTexBuffer +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index); +GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +#define glCopyBufferSubData glad_glCopyBufferSubData +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +#define glGetUniformIndices glad_glGetUniformIndices +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +#define glGetActiveUniformsiv glad_glGetActiveUniformsiv +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +#define glGetActiveUniformName glad_glGetActiveUniformName +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar* uniformBlockName); +GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +#define glGetUniformBlockIndex glad_glGetUniformBlockIndex +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +#define glUniformBlockBinding glad_glUniformBlockBinding +#endif +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +GLAPI int GLAD_GL_VERSION_3_2; +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLint basevertex); +GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices, GLint basevertex); +GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex); +GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount, const GLint* basevertex); +GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum mode); +GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +#define glProvokingVertex glad_glProvokingVertex +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags); +GLAPI PFNGLFENCESYNCPROC glad_glFenceSync; +#define glFenceSync glad_glFenceSync +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync); +GLAPI PFNGLISSYNCPROC glad_glIsSync; +#define glIsSync glad_glIsSync +typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync); +GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync; +#define glDeleteSync glad_glDeleteSync +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +#define glClientWaitSync glad_glClientWaitSync +typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; +#define glWaitSync glad_glWaitSync +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64* data); +GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +#define glGetInteger64v glad_glGetInteger64v +typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); +GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; +#define glGetSynciv glad_glGetSynciv +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64* data); +GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +#define glGetInteger64i_v glad_glGetInteger64i_v +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64* params); +GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +#define glGetBufferParameteri64v glad_glGetBufferParameteri64v +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +#define glFramebufferTexture glad_glFramebufferTexture +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +#define glTexImage2DMultisample glad_glTexImage2DMultisample +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +#define glTexImage3DMultisample glad_glTexImage3DMultisample +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat* val); +GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +#define glGetMultisamplefv glad_glGetMultisamplefv +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask); +GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +#define glSampleMaski glad_glSampleMaski +#endif +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +GLAPI int GLAD_GL_VERSION_3_3; +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar* name); +GLAPI PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +#define glGetFragDataIndex glad_glGetFragDataIndex +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint* samplers); +GLAPI PFNGLGENSAMPLERSPROC glad_glGenSamplers; +#define glGenSamplers glad_glGenSamplers +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint* samplers); +GLAPI PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +#define glDeleteSamplers glad_glDeleteSamplers +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC)(GLuint sampler); +GLAPI PFNGLISSAMPLERPROC glad_glIsSampler; +#define glIsSampler glad_glIsSampler +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler); +GLAPI PFNGLBINDSAMPLERPROC glad_glBindSampler; +#define glBindSampler glad_glBindSampler +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param); +GLAPI PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +#define glSamplerParameteri glad_glSamplerParameteri +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint* param); +GLAPI PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +#define glSamplerParameteriv glad_glSamplerParameteriv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param); +GLAPI PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +#define glSamplerParameterf glad_glSamplerParameterf +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat* param); +GLAPI PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +#define glSamplerParameterfv glad_glSamplerParameterfv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint* param); +GLAPI PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +#define glSamplerParameterIiv glad_glSamplerParameterIiv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint* param); +GLAPI PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +#define glSamplerParameterIuiv glad_glSamplerParameterIuiv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint* params); +GLAPI PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +#define glGetSamplerParameteriv glad_glGetSamplerParameteriv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint* params); +GLAPI PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat* params); +GLAPI PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +#define glGetSamplerParameterfv glad_glGetSamplerParameterfv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint* params); +GLAPI PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target); +GLAPI PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +#define glQueryCounter glad_glQueryCounter +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64* params); +GLAPI PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +#define glGetQueryObjecti64v glad_glGetQueryObjecti64v +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64* params); +GLAPI PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +#define glGetQueryObjectui64v glad_glGetQueryObjectui64v +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor); +GLAPI PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +#define glVertexAttribDivisor glad_glVertexAttribDivisor +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +#define glVertexAttribP1ui glad_glVertexAttribP1ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +GLAPI PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +#define glVertexAttribP1uiv glad_glVertexAttribP1uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +#define glVertexAttribP2ui glad_glVertexAttribP2ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +GLAPI PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +#define glVertexAttribP2uiv glad_glVertexAttribP2uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +#define glVertexAttribP3ui glad_glVertexAttribP3ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +GLAPI PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +#define glVertexAttribP3uiv glad_glVertexAttribP3uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +#define glVertexAttribP4ui glad_glVertexAttribP4ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +GLAPI PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +#define glVertexAttribP4uiv glad_glVertexAttribP4uiv +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +#define glVertexP2ui glad_glVertexP2ui +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint* value); +GLAPI PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +#define glVertexP2uiv glad_glVertexP2uiv +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +#define glVertexP3ui glad_glVertexP3ui +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint* value); +GLAPI PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +#define glVertexP3uiv glad_glVertexP3uiv +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +#define glVertexP4ui glad_glVertexP4ui +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint* value); +GLAPI PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +#define glVertexP4uiv glad_glVertexP4uiv +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +#define glTexCoordP1ui glad_glTexCoordP1ui +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint* coords); +GLAPI PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +#define glTexCoordP1uiv glad_glTexCoordP1uiv +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +#define glTexCoordP2ui glad_glTexCoordP2ui +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint* coords); +GLAPI PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +#define glTexCoordP2uiv glad_glTexCoordP2uiv +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +#define glTexCoordP3ui glad_glTexCoordP3ui +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint* coords); +GLAPI PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +#define glTexCoordP3uiv glad_glTexCoordP3uiv +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +#define glTexCoordP4ui glad_glTexCoordP4ui +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint* coords); +GLAPI PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +#define glTexCoordP4uiv glad_glTexCoordP4uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); +GLAPI PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); +GLAPI PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); +GLAPI PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); +GLAPI PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv +typedef void (APIENTRYP PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLNORMALP3UIPROC glad_glNormalP3ui; +#define glNormalP3ui glad_glNormalP3ui +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint* coords); +GLAPI PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +#define glNormalP3uiv glad_glNormalP3uiv +typedef void (APIENTRYP PFNGLCOLORP3UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLCOLORP3UIPROC glad_glColorP3ui; +#define glColorP3ui glad_glColorP3ui +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint* color); +GLAPI PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +#define glColorP3uiv glad_glColorP3uiv +typedef void (APIENTRYP PFNGLCOLORP4UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLCOLORP4UIPROC glad_glColorP4ui; +#define glColorP4ui glad_glColorP4ui +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint* color); +GLAPI PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +#define glColorP4uiv glad_glColorP4uiv +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +#define glSecondaryColorP3ui glad_glSecondaryColorP3ui +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint* color); +GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv +#endif +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +#define GL_SAMPLES_ARB 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#define GL_DEPTH_CLAMP_NV 0x864F +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#define GL_EYE_PLANE 0x2502 +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#define GL_WRAP_BORDER_SUN 0x81D4 +#define GL_HALF_FLOAT_ARB 0x140B +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 +#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE_EXT 0x8258 +#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A +#define GL_BLEND_COLOR_COMMAND_NV 0x000B +#define GL_STENCIL_REF_COMMAND_NV 0x000C +#define GL_LINE_WIDTH_COMMAND_NV 0x000D +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E +#define GL_ALPHA_REF_COMMAND_NV 0x000F +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#define GL_INTERLACE_READ_INGR 0x8568 +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_LOST 0x0507 +#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 +#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 +#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 +#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 +#define GL_CONTEXT_LOST_KHR 0x0507 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#define GL_MAP_PERSISTENT_BIT 0x0040 +#define GL_MAP_COHERENT_BIT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#define GL_SHARED_EDGE_NV 0xC0 +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#define GL_LIST_PRIORITY_SGIX 0x8182 +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 +#define GL_COLORBURN_NV 0x929A +#define GL_COLORDODGE_NV 0x9299 +#define GL_CONJOINT_NV 0x9284 +#define GL_CONTRAST_NV 0x92A1 +#define GL_DARKEN_NV 0x9297 +#define GL_DIFFERENCE_NV 0x929E +#define GL_DISJOINT_NV 0x9283 +#define GL_DST_ATOP_NV 0x928F +#define GL_DST_IN_NV 0x928B +#define GL_DST_NV 0x9287 +#define GL_DST_OUT_NV 0x928D +#define GL_DST_OVER_NV 0x9289 +#define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 +#define GL_HARDLIGHT_NV 0x929B +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_INVERT_OVG_NV 0x92B4 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LIGHTEN_NV 0x9298 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_MINUS_NV 0x929F +#define GL_MULTIPLY_NV 0x9294 +#define GL_OVERLAY_NV 0x9296 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 +#define GL_SCREEN_NV 0x9295 +#define GL_SOFTLIGHT_NV 0x929C +#define GL_SRC_ATOP_NV 0x928E +#define GL_SRC_IN_NV 0x928A +#define GL_SRC_NV 0x9286 +#define GL_SRC_OUT_NV 0x928C +#define GL_SRC_OVER_NV 0x9288 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#define GL_TIME_ELAPSED_EXT 0x88BF +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 +#define GL_DEBUG_SOURCE_API_KHR 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A +#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B +#define GL_DEBUG_TYPE_ERROR_KHR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 +#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 +#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D +#define GL_BUFFER_KHR 0x82E0 +#define GL_SHADER_KHR 0x82E1 +#define GL_PROGRAM_KHR 0x82E2 +#define GL_VERTEX_ARRAY_KHR 0x8074 +#define GL_QUERY_KHR 0x82E3 +#define GL_PROGRAM_PIPELINE_KHR 0x82E4 +#define GL_SAMPLER_KHR 0x82E6 +#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 +#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 +#define GL_DEBUG_OUTPUT_KHR 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 +#define GL_STACK_OVERFLOW_KHR 0x0503 +#define GL_STACK_UNDERFLOW_KHR 0x0504 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_QUADS 0x0007 +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_BLEND_EQUATION_EXT 0x8009 +#define GL_PACK_INVERT_MESA 0x8758 +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#define GL_INTERLACE_SGIX 0x8094 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_RESCALE_NORMAL_EXT 0x803A +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#define GL_ASYNC_MARKER_SGIX 0x8329 +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_RGB565 0x8D62 +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF +#define GL_HALF_FLOAT_NV 0x140B +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#define GL_ABGR_EXT 0x8000 +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_CULL_VERTEX_IBM 103050 +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +#define GL_FILL_RECTANGLE_NV 0x933C +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#define GL_SLICE_ACCUM_SUN 0x85CC +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +#define GL_FOG 0x0B60 +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#define GL_CLEAR_TEXTURE 0x9365 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_CLOSE_PATH_NV 0x00 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_BOLD_BIT_NV 0x01 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_2_BYTES_NV 0x1407 +#define GL_3_BYTES_NV 0x1408 +#define GL_4_BYTES_NV 0x1409 +#define GL_EYE_LINEAR_NV 0x2400 +#define GL_OBJECT_LINEAR_NV 0x2401 +#define GL_CONSTANT_NV 0x8576 +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_PROJECTION_NV 0x1701 +#define GL_PATH_MODELVIEW_NV 0x1700 +#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 +#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 +#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 +#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 +#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 +#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 +#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 +#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 +#define GL_FRAGMENT_INPUT_NV 0x936D +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_RGB_RAW_422_APPLE 0x8A51 +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#define GL_INT64_ARB 0x140E +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#define GL_SYNC_X11_FENCE_EXT 0x90E1 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_FIXED_OES 0x140C +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC +#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +GLAPI int GLAD_GL_SGIX_pixel_tiles; +#endif +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 +GLAPI int GLAD_GL_EXT_post_depth_coverage; +#endif +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +GLAPI int GLAD_GL_APPLE_element_array; +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC)(GLenum type, const void* pointer); +GLAPI PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; +#define glElementPointerAPPLE glad_glElementPointerAPPLE +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; +#define glDrawElementArrayAPPLE glad_glDrawElementArrayAPPLE +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; +#define glDrawRangeElementArrayAPPLE glad_glDrawRangeElementArrayAPPLE +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); +GLAPI PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; +#define glMultiDrawElementArrayAPPLE glad_glMultiDrawElementArrayAPPLE +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei* count, GLsizei primcount); +GLAPI PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; +#define glMultiDrawRangeElementArrayAPPLE glad_glMultiDrawRangeElementArrayAPPLE +#endif +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 +GLAPI int GLAD_GL_AMD_multi_draw_indirect; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)(GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; +#define glMultiDrawArraysIndirectAMD glad_glMultiDrawArraysIndirectAMD +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; +#define glMultiDrawElementsIndirectAMD glad_glMultiDrawElementsIndirectAMD +#endif +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +GLAPI int GLAD_GL_EXT_blend_subtract; +#endif +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +GLAPI int GLAD_GL_SGIX_tag_sample_buffer; +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC)(); +GLAPI PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; +#define glTagSampleBufferSGIX glad_glTagSampleBufferSGIX +#endif +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +GLAPI int GLAD_GL_NV_point_sprite; +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC)(GLenum pname, GLint param); +GLAPI PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; +#define glPointParameteriNV glad_glPointParameteriNV +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; +#define glPointParameterivNV glad_glPointParameterivNV +#endif +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +GLAPI int GLAD_GL_IBM_texture_mirrored_repeat; +#endif +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +GLAPI int GLAD_GL_APPLE_transform_hint; +#endif +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +GLAPI int GLAD_GL_ATI_separate_stencil; +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; +#define glStencilOpSeparateATI glad_glStencilOpSeparateATI +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; +#define glStencilFuncSeparateATI glad_glStencilFuncSeparateATI +#endif +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 +GLAPI int GLAD_GL_NV_shader_atomic_int64; +#endif +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +GLAPI int GLAD_GL_NV_vertex_program2_option; +#endif +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +GLAPI int GLAD_GL_EXT_texture_buffer_object; +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC)(GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; +#define glTexBufferEXT glad_glTexBufferEXT +#endif +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +GLAPI int GLAD_GL_ARB_vertex_blend; +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC)(GLint size, const GLbyte* weights); +GLAPI PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; +#define glWeightbvARB glad_glWeightbvARB +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC)(GLint size, const GLshort* weights); +GLAPI PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; +#define glWeightsvARB glad_glWeightsvARB +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC)(GLint size, const GLint* weights); +GLAPI PFNGLWEIGHTIVARBPROC glad_glWeightivARB; +#define glWeightivARB glad_glWeightivARB +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC)(GLint size, const GLfloat* weights); +GLAPI PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; +#define glWeightfvARB glad_glWeightfvARB +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC)(GLint size, const GLdouble* weights); +GLAPI PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; +#define glWeightdvARB glad_glWeightdvARB +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC)(GLint size, const GLubyte* weights); +GLAPI PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; +#define glWeightubvARB glad_glWeightubvARB +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC)(GLint size, const GLushort* weights); +GLAPI PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; +#define glWeightusvARB glad_glWeightusvARB +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC)(GLint size, const GLuint* weights); +GLAPI PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; +#define glWeightuivARB glad_glWeightuivARB +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; +#define glWeightPointerARB glad_glWeightPointerARB +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC)(GLint count); +GLAPI PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; +#define glVertexBlendARB glad_glVertexBlendARB +#endif +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 +GLAPI int GLAD_GL_OVR_multiview; +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +GLAPI PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; +#define glFramebufferTextureMultiviewOVR glad_glFramebufferTextureMultiviewOVR +#endif +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +GLAPI int GLAD_GL_NV_vertex_program2; +#endif +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +GLAPI int GLAD_GL_ARB_program_interface_query; +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC)(GLuint program, GLenum programInterface, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; +#define glGetProgramInterfaceiv glad_glGetProgramInterfaceiv +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); +GLAPI PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; +#define glGetProgramResourceIndex glad_glGetProgramResourceIndex +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name); +GLAPI PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; +#define glGetProgramResourceName glad_glGetProgramResourceName +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params); +GLAPI PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; +#define glGetProgramResourceiv glad_glGetProgramResourceiv +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC)(GLuint program, GLenum programInterface, const GLchar* name); +GLAPI PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; +#define glGetProgramResourceLocation glad_glGetProgramResourceLocation +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); +GLAPI PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; +#define glGetProgramResourceLocationIndex glad_glGetProgramResourceLocationIndex +#endif +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +GLAPI int GLAD_GL_EXT_misc_attribute; +#endif +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +GLAPI int GLAD_GL_NV_multisample_coverage; +#endif +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 +GLAPI int GLAD_GL_ARB_shading_language_packing; +#endif +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 +GLAPI int GLAD_GL_EXT_texture_cube_map; +#endif +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 +GLAPI int GLAD_GL_NV_viewport_array2; +#endif +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 +GLAPI int GLAD_GL_ARB_texture_stencil8; +#endif +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +GLAPI int GLAD_GL_EXT_index_func; +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC)(GLenum func, GLclampf ref); +GLAPI PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; +#define glIndexFuncEXT glad_glIndexFuncEXT +#endif +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +GLAPI int GLAD_GL_OES_compressed_paletted_texture; +#endif +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +GLAPI int GLAD_GL_NV_depth_clamp; +#endif +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +GLAPI int GLAD_GL_NV_shader_buffer_load; +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; +#define glMakeBufferResidentNV glad_glMakeBufferResidentNV +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC)(GLenum target); +GLAPI PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; +#define glMakeBufferNonResidentNV glad_glMakeBufferNonResidentNV +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC)(GLenum target); +GLAPI PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; +#define glIsBufferResidentNV glad_glIsBufferResidentNV +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)(GLuint buffer, GLenum access); +GLAPI PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; +#define glMakeNamedBufferResidentNV glad_glMakeNamedBufferResidentNV +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)(GLuint buffer); +GLAPI PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; +#define glMakeNamedBufferNonResidentNV glad_glMakeNamedBufferNonResidentNV +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC)(GLuint buffer); +GLAPI PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; +#define glIsNamedBufferResidentNV glad_glIsNamedBufferResidentNV +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC)(GLenum target, GLenum pname, GLuint64EXT* params); +GLAPI PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; +#define glGetBufferParameterui64vNV glad_glGetBufferParameterui64vNV +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)(GLuint buffer, GLenum pname, GLuint64EXT* params); +GLAPI PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; +#define glGetNamedBufferParameterui64vNV glad_glGetNamedBufferParameterui64vNV +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC)(GLenum value, GLuint64EXT* result); +GLAPI PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; +#define glGetIntegerui64vNV glad_glGetIntegerui64vNV +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC)(GLint location, GLuint64EXT value); +GLAPI PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; +#define glUniformui64NV glad_glUniformui64NV +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; +#define glUniformui64vNV glad_glUniformui64vNV +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLuint64EXT* params); +GLAPI PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; +#define glGetUniformui64vNV glad_glGetUniformui64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC)(GLuint program, GLint location, GLuint64EXT value); +GLAPI PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; +#define glProgramUniformui64NV glad_glProgramUniformui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; +#define glProgramUniformui64vNV glad_glProgramUniformui64vNV +#endif +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +GLAPI int GLAD_GL_EXT_color_subtable; +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; +#define glColorSubTableEXT glad_glColorSubTableEXT +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; +#define glCopyColorSubTableEXT glad_glCopyColorSubTableEXT +#endif +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +GLAPI int GLAD_GL_SUNX_constant_data; +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC)(); +GLAPI PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; +#define glFinishTextureSUNX glad_glFinishTextureSUNX +#endif +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +GLAPI int GLAD_GL_EXT_texture_compression_s3tc; +#endif +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +GLAPI int GLAD_GL_EXT_multi_draw_arrays; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); +GLAPI PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; +#define glMultiDrawArraysEXT glad_glMultiDrawArraysEXT +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount); +GLAPI PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; +#define glMultiDrawElementsEXT glad_glMultiDrawElementsEXT +#endif +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 +GLAPI int GLAD_GL_ARB_shader_atomic_counters; +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)(GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); +GLAPI PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; +#define glGetActiveAtomicCounterBufferiv glad_glGetActiveAtomicCounterBufferiv +#endif +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +GLAPI int GLAD_GL_ARB_arrays_of_arrays; +#endif +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +GLAPI int GLAD_GL_NV_conditional_render; +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC)(GLuint id, GLenum mode); +GLAPI PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; +#define glBeginConditionalRenderNV glad_glBeginConditionalRenderNV +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC)(); +GLAPI PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; +#define glEndConditionalRenderNV glad_glEndConditionalRenderNV +#endif +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +GLAPI int GLAD_GL_EXT_texture_env_combine; +#endif +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +GLAPI int GLAD_GL_NV_fog_distance; +#endif +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +GLAPI int GLAD_GL_SGIX_async_histogram; +#endif +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +GLAPI int GLAD_GL_MESA_resize_buffers; +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC)(); +GLAPI PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; +#define glResizeBuffersMESA glad_glResizeBuffersMESA +#endif +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +GLAPI int GLAD_GL_NV_light_max_exponent; +#endif +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +GLAPI int GLAD_GL_NV_texture_env_combine4; +#endif +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +GLAPI int GLAD_GL_ARB_texture_view; +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +GLAPI PFNGLTEXTUREVIEWPROC glad_glTextureView; +#define glTextureView glad_glTextureView +#endif +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +GLAPI int GLAD_GL_ARB_texture_env_combine; +#endif +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +GLAPI int GLAD_GL_ARB_map_buffer_range; +#endif +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +GLAPI int GLAD_GL_EXT_convolution; +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +GLAPI PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; +#define glConvolutionFilter1DEXT glad_glConvolutionFilter1DEXT +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +GLAPI PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; +#define glConvolutionFilter2DEXT glad_glConvolutionFilter2DEXT +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat params); +GLAPI PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; +#define glConvolutionParameterfEXT glad_glConvolutionParameterfEXT +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; +#define glConvolutionParameterfvEXT glad_glConvolutionParameterfvEXT +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint params); +GLAPI PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; +#define glConvolutionParameteriEXT glad_glConvolutionParameteriEXT +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; +#define glConvolutionParameterivEXT glad_glConvolutionParameterivEXT +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; +#define glCopyConvolutionFilter1DEXT glad_glCopyConvolutionFilter1DEXT +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; +#define glCopyConvolutionFilter2DEXT glad_glCopyConvolutionFilter2DEXT +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* image); +GLAPI PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; +#define glGetConvolutionFilterEXT glad_glGetConvolutionFilterEXT +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; +#define glGetConvolutionParameterfvEXT glad_glGetConvolutionParameterfvEXT +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; +#define glGetConvolutionParameterivEXT glad_glGetConvolutionParameterivEXT +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +GLAPI PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; +#define glGetSeparableFilterEXT glad_glGetSeparableFilterEXT +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); +GLAPI PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; +#define glSeparableFilter2DEXT glad_glSeparableFilter2DEXT +#endif +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 +GLAPI int GLAD_GL_NV_compute_program5; +#endif +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +GLAPI int GLAD_GL_NV_vertex_attrib_integer_64bit; +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC)(GLuint index, GLint64EXT x); +GLAPI PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; +#define glVertexAttribL1i64NV glad_glVertexAttribL1i64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; +#define glVertexAttribL2i64NV glad_glVertexAttribL2i64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; +#define glVertexAttribL3i64NV glad_glVertexAttribL3i64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; +#define glVertexAttribL4i64NV glad_glVertexAttribL4i64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC)(GLuint index, const GLint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; +#define glVertexAttribL1i64vNV glad_glVertexAttribL1i64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC)(GLuint index, const GLint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; +#define glVertexAttribL2i64vNV glad_glVertexAttribL2i64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC)(GLuint index, const GLint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; +#define glVertexAttribL3i64vNV glad_glVertexAttribL3i64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC)(GLuint index, const GLint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; +#define glVertexAttribL4i64vNV glad_glVertexAttribL4i64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC)(GLuint index, GLuint64EXT x); +GLAPI PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; +#define glVertexAttribL1ui64NV glad_glVertexAttribL1ui64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; +#define glVertexAttribL2ui64NV glad_glVertexAttribL2ui64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; +#define glVertexAttribL3ui64NV glad_glVertexAttribL3ui64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; +#define glVertexAttribL4ui64NV glad_glVertexAttribL4ui64NV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC)(GLuint index, const GLuint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; +#define glVertexAttribL1ui64vNV glad_glVertexAttribL1ui64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC)(GLuint index, const GLuint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; +#define glVertexAttribL2ui64vNV glad_glVertexAttribL2ui64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC)(GLuint index, const GLuint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; +#define glVertexAttribL3ui64vNV glad_glVertexAttribL3ui64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC)(GLuint index, const GLuint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; +#define glVertexAttribL4ui64vNV glad_glVertexAttribL4ui64vNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC)(GLuint index, GLenum pname, GLint64EXT* params); +GLAPI PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; +#define glGetVertexAttribLi64vNV glad_glGetVertexAttribLi64vNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC)(GLuint index, GLenum pname, GLuint64EXT* params); +GLAPI PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; +#define glGetVertexAttribLui64vNV glad_glGetVertexAttribLui64vNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; +#define glVertexAttribLFormatNV glad_glVertexAttribLFormatNV +#endif +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +GLAPI int GLAD_GL_EXT_paletted_texture; +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* table); +GLAPI PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; +#define glColorTableEXT glad_glColorTableEXT +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC)(GLenum target, GLenum format, GLenum type, void* data); +GLAPI PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; +#define glGetColorTableEXT glad_glGetColorTableEXT +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; +#define glGetColorTableParameterivEXT glad_glGetColorTableParameterivEXT +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; +#define glGetColorTableParameterfvEXT glad_glGetColorTableParameterfvEXT +#endif +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +GLAPI int GLAD_GL_ARB_texture_buffer_object; +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC)(GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; +#define glTexBufferARB glad_glTexBufferARB +#endif +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +GLAPI int GLAD_GL_ATI_pn_triangles; +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; +#define glPNTrianglesiATI glad_glPNTrianglesiATI +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; +#define glPNTrianglesfATI glad_glPNTrianglesfATI +#endif +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +GLAPI int GLAD_GL_SGIX_resample; +#endif +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +GLAPI int GLAD_GL_SGIX_flush_raster; +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC)(); +GLAPI PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; +#define glFlushRasterSGIX glad_glFlushRasterSGIX +#endif +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +GLAPI int GLAD_GL_EXT_light_texture; +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC)(GLenum mode); +GLAPI PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; +#define glApplyTextureEXT glad_glApplyTextureEXT +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC)(GLenum pname); +GLAPI PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; +#define glTextureLightEXT glad_glTextureLightEXT +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC)(GLenum face, GLenum mode); +GLAPI PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; +#define glTextureMaterialEXT glad_glTextureMaterialEXT +#endif +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +GLAPI int GLAD_GL_ARB_point_sprite; +#endif +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +GLAPI int GLAD_GL_SUN_convolution_border_modes; +#endif +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +GLAPI int GLAD_GL_NV_parameter_buffer_object2; +#endif +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +GLAPI int GLAD_GL_ARB_half_float_pixel; +#endif +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +GLAPI int GLAD_GL_NV_tessellation_program5; +#endif +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +GLAPI int GLAD_GL_REND_screen_coordinates; +#endif +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +GLAPI int GLAD_GL_HP_image_transform; +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; +#define glImageTransformParameteriHP glad_glImageTransformParameteriHP +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; +#define glImageTransformParameterfHP glad_glImageTransformParameterfHP +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; +#define glImageTransformParameterivHP glad_glImageTransformParameterivHP +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; +#define glImageTransformParameterfvHP glad_glImageTransformParameterfvHP +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; +#define glGetImageTransformParameterivHP glad_glGetImageTransformParameterivHP +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; +#define glGetImageTransformParameterfvHP glad_glGetImageTransformParameterfvHP +#endif +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +GLAPI int GLAD_GL_EXT_packed_float; +#endif +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +GLAPI int GLAD_GL_OML_subsample; +#endif +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +GLAPI int GLAD_GL_SGIX_vertex_preclip; +#endif +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +GLAPI int GLAD_GL_SGIX_texture_scale_bias; +#endif +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +GLAPI int GLAD_GL_AMD_draw_buffers_blend; +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC)(GLuint buf, GLenum src, GLenum dst); +GLAPI PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; +#define glBlendFuncIndexedAMD glad_glBlendFuncIndexedAMD +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; +#define glBlendFuncSeparateIndexedAMD glad_glBlendFuncSeparateIndexedAMD +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC)(GLuint buf, GLenum mode); +GLAPI PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; +#define glBlendEquationIndexedAMD glad_glBlendEquationIndexedAMD +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; +#define glBlendEquationSeparateIndexedAMD glad_glBlendEquationSeparateIndexedAMD +#endif +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +GLAPI int GLAD_GL_APPLE_texture_range; +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC)(GLenum target, GLsizei length, const void* pointer); +GLAPI PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; +#define glTextureRangeAPPLE glad_glTextureRangeAPPLE +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)(GLenum target, GLenum pname, void** params); +GLAPI PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; +#define glGetTexParameterPointervAPPLE glad_glGetTexParameterPointervAPPLE +#endif +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +GLAPI int GLAD_GL_EXT_texture_array; +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; +#define glFramebufferTextureLayerEXT glad_glFramebufferTextureLayerEXT +#endif +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +GLAPI int GLAD_GL_NV_texture_barrier; +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC)(); +GLAPI PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; +#define glTextureBarrierNV glad_glTextureBarrierNV +#endif +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +GLAPI int GLAD_GL_ARB_texture_query_levels; +#endif +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +GLAPI int GLAD_GL_NV_texgen_emboss; +#endif +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +GLAPI int GLAD_GL_EXT_texture_swizzle; +#endif +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +GLAPI int GLAD_GL_ARB_texture_rg; +#endif +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +GLAPI int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; +#endif +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +GLAPI int GLAD_GL_ARB_fragment_shader; +#endif +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +GLAPI int GLAD_GL_3DFX_tbuffer; +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC)(GLuint mask); +GLAPI PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; +#define glTbufferMask3DFX glad_glTbufferMask3DFX +#endif +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +GLAPI int GLAD_GL_GREMEDY_frame_terminator; +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC)(); +GLAPI PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; +#define glFrameTerminatorGREMEDY glad_glFrameTerminatorGREMEDY +#endif +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +GLAPI int GLAD_GL_ARB_blend_func_extended; +#endif +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +GLAPI int GLAD_GL_EXT_separate_shader_objects; +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC)(GLenum type, GLuint program); +GLAPI PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; +#define glUseShaderProgramEXT glad_glUseShaderProgramEXT +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC)(GLuint program); +GLAPI PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; +#define glActiveProgramEXT glad_glActiveProgramEXT +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC)(GLenum type, const GLchar* string); +GLAPI PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; +#define glCreateShaderProgramEXT glad_glCreateShaderProgramEXT +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC)(GLuint pipeline, GLuint program); +GLAPI PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; +#define glActiveShaderProgramEXT glad_glActiveShaderProgramEXT +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC)(GLuint pipeline); +GLAPI PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; +#define glBindProgramPipelineEXT glad_glBindProgramPipelineEXT +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC)(GLenum type, GLsizei count, const GLchar** strings); +GLAPI PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; +#define glCreateShaderProgramvEXT glad_glCreateShaderProgramvEXT +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC)(GLsizei n, const GLuint* pipelines); +GLAPI PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; +#define glDeleteProgramPipelinesEXT glad_glDeleteProgramPipelinesEXT +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC)(GLsizei n, GLuint* pipelines); +GLAPI PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; +#define glGenProgramPipelinesEXT glad_glGenProgramPipelinesEXT +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; +#define glGetProgramPipelineInfoLogEXT glad_glGetProgramPipelineInfoLogEXT +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC)(GLuint pipeline, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; +#define glGetProgramPipelineivEXT glad_glGetProgramPipelineivEXT +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC)(GLuint pipeline); +GLAPI PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; +#define glIsProgramPipelineEXT glad_glIsProgramPipelineEXT +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC)(GLuint program, GLenum pname, GLint value); +GLAPI PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; +#define glProgramParameteriEXT glad_glProgramParameteriEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC)(GLuint program, GLint location, GLfloat v0); +GLAPI PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; +#define glProgramUniform1fEXT glad_glProgramUniform1fEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; +#define glProgramUniform1fvEXT glad_glProgramUniform1fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC)(GLuint program, GLint location, GLint v0); +GLAPI PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; +#define glProgramUniform1iEXT glad_glProgramUniform1iEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; +#define glProgramUniform1ivEXT glad_glProgramUniform1ivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; +#define glProgramUniform2fEXT glad_glProgramUniform2fEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; +#define glProgramUniform2fvEXT glad_glProgramUniform2fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1); +GLAPI PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; +#define glProgramUniform2iEXT glad_glProgramUniform2iEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; +#define glProgramUniform2ivEXT glad_glProgramUniform2ivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; +#define glProgramUniform3fEXT glad_glProgramUniform3fEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; +#define glProgramUniform3fvEXT glad_glProgramUniform3fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; +#define glProgramUniform3iEXT glad_glProgramUniform3iEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; +#define glProgramUniform3ivEXT glad_glProgramUniform3ivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; +#define glProgramUniform4fEXT glad_glProgramUniform4fEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; +#define glProgramUniform4fvEXT glad_glProgramUniform4fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; +#define glProgramUniform4iEXT glad_glProgramUniform4iEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; +#define glProgramUniform4ivEXT glad_glProgramUniform4ivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; +#define glProgramUniformMatrix2fvEXT glad_glProgramUniformMatrix2fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; +#define glProgramUniformMatrix3fvEXT glad_glProgramUniformMatrix3fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; +#define glProgramUniformMatrix4fvEXT glad_glProgramUniformMatrix4fvEXT +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC)(GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; +#define glUseProgramStagesEXT glad_glUseProgramStagesEXT +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)(GLuint pipeline); +GLAPI PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; +#define glValidateProgramPipelineEXT glad_glValidateProgramPipelineEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC)(GLuint program, GLint location, GLuint v0); +GLAPI PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; +#define glProgramUniform1uiEXT glad_glProgramUniform1uiEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; +#define glProgramUniform2uiEXT glad_glProgramUniform2uiEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; +#define glProgramUniform3uiEXT glad_glProgramUniform3uiEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; +#define glProgramUniform4uiEXT glad_glProgramUniform4uiEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; +#define glProgramUniform1uivEXT glad_glProgramUniform1uivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; +#define glProgramUniform2uivEXT glad_glProgramUniform2uivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; +#define glProgramUniform3uivEXT glad_glProgramUniform3uivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; +#define glProgramUniform4uivEXT glad_glProgramUniform4uivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; +#define glProgramUniformMatrix2x3fvEXT glad_glProgramUniformMatrix2x3fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; +#define glProgramUniformMatrix3x2fvEXT glad_glProgramUniformMatrix3x2fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; +#define glProgramUniformMatrix2x4fvEXT glad_glProgramUniformMatrix2x4fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; +#define glProgramUniformMatrix4x2fvEXT glad_glProgramUniformMatrix4x2fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; +#define glProgramUniformMatrix3x4fvEXT glad_glProgramUniformMatrix3x4fvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; +#define glProgramUniformMatrix4x3fvEXT glad_glProgramUniformMatrix4x3fvEXT +#endif +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 +GLAPI int GLAD_GL_NV_texture_multisample; +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; +#define glTexImage2DMultisampleCoverageNV glad_glTexImage2DMultisampleCoverageNV +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; +#define glTexImage3DMultisampleCoverageNV glad_glTexImage3DMultisampleCoverageNV +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; +#define glTextureImage2DMultisampleNV glad_glTextureImage2DMultisampleNV +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; +#define glTextureImage3DMultisampleNV glad_glTextureImage3DMultisampleNV +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; +#define glTextureImage2DMultisampleCoverageNV glad_glTextureImage2DMultisampleCoverageNV +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; +#define glTextureImage3DMultisampleCoverageNV glad_glTextureImage3DMultisampleCoverageNV +#endif +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +GLAPI int GLAD_GL_ARB_shader_objects; +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC)(GLhandleARB obj); +GLAPI PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; +#define glDeleteObjectARB glad_glDeleteObjectARB +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC)(GLenum pname); +GLAPI PFNGLGETHANDLEARBPROC glad_glGetHandleARB; +#define glGetHandleARB glad_glGetHandleARB +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; +#define glDetachObjectARB glad_glDetachObjectARB +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC)(GLenum shaderType); +GLAPI PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; +#define glCreateShaderObjectARB glad_glCreateShaderObjectARB +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC)(GLhandleARB shaderObj, GLsizei count, const GLcharARB** string, const GLint* length); +GLAPI PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; +#define glShaderSourceARB glad_glShaderSourceARB +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC)(GLhandleARB shaderObj); +GLAPI PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; +#define glCompileShaderARB glad_glCompileShaderARB +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC)(); +GLAPI PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; +#define glCreateProgramObjectARB glad_glCreateProgramObjectARB +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB obj); +GLAPI PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; +#define glAttachObjectARB glad_glAttachObjectARB +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC)(GLhandleARB programObj); +GLAPI PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; +#define glLinkProgramARB glad_glLinkProgramARB +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC)(GLhandleARB programObj); +GLAPI PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; +#define glUseProgramObjectARB glad_glUseProgramObjectARB +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC)(GLhandleARB programObj); +GLAPI PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; +#define glValidateProgramARB glad_glValidateProgramARB +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC)(GLint location, GLfloat v0); +GLAPI PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; +#define glUniform1fARB glad_glUniform1fARB +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC)(GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; +#define glUniform2fARB glad_glUniform2fARB +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; +#define glUniform3fARB glad_glUniform3fARB +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; +#define glUniform4fARB glad_glUniform4fARB +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC)(GLint location, GLint v0); +GLAPI PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; +#define glUniform1iARB glad_glUniform1iARB +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC)(GLint location, GLint v0, GLint v1); +GLAPI PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; +#define glUniform2iARB glad_glUniform2iARB +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; +#define glUniform3iARB glad_glUniform3iARB +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; +#define glUniform4iARB glad_glUniform4iARB +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; +#define glUniform1fvARB glad_glUniform1fvARB +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; +#define glUniform2fvARB glad_glUniform2fvARB +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; +#define glUniform3fvARB glad_glUniform3fvARB +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; +#define glUniform4fvARB glad_glUniform4fvARB +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; +#define glUniform1ivARB glad_glUniform1ivARB +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; +#define glUniform2ivARB glad_glUniform2ivARB +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; +#define glUniform3ivARB glad_glUniform3ivARB +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC)(GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; +#define glUniform4ivARB glad_glUniform4ivARB +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; +#define glUniformMatrix2fvARB glad_glUniformMatrix2fvARB +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; +#define glUniformMatrix3fvARB glad_glUniformMatrix3fvARB +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; +#define glUniformMatrix4fvARB glad_glUniformMatrix4fvARB +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC)(GLhandleARB obj, GLenum pname, GLfloat* params); +GLAPI PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; +#define glGetObjectParameterfvARB glad_glGetObjectParameterfvARB +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC)(GLhandleARB obj, GLenum pname, GLint* params); +GLAPI PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; +#define glGetObjectParameterivARB glad_glGetObjectParameterivARB +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* infoLog); +GLAPI PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; +#define glGetInfoLogARB glad_glGetInfoLogARB +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC)(GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB* obj); +GLAPI PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; +#define glGetAttachedObjectsARB glad_glGetAttachedObjectsARB +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); +GLAPI PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; +#define glGetUniformLocationARB glad_glGetUniformLocationARB +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); +GLAPI PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; +#define glGetActiveUniformARB glad_glGetActiveUniformARB +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC)(GLhandleARB programObj, GLint location, GLfloat* params); +GLAPI PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; +#define glGetUniformfvARB glad_glGetUniformfvARB +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC)(GLhandleARB programObj, GLint location, GLint* params); +GLAPI PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; +#define glGetUniformivARB glad_glGetUniformivARB +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* source); +GLAPI PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; +#define glGetShaderSourceARB glad_glGetShaderSourceARB +#endif +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +GLAPI int GLAD_GL_ARB_framebuffer_object; +#endif +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +GLAPI int GLAD_GL_ATI_envmap_bumpmap; +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC)(GLenum pname, const GLint* param); +GLAPI PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; +#define glTexBumpParameterivATI glad_glTexBumpParameterivATI +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC)(GLenum pname, const GLfloat* param); +GLAPI PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; +#define glTexBumpParameterfvATI glad_glTexBumpParameterfvATI +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC)(GLenum pname, GLint* param); +GLAPI PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; +#define glGetTexBumpParameterivATI glad_glGetTexBumpParameterivATI +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC)(GLenum pname, GLfloat* param); +GLAPI PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; +#define glGetTexBumpParameterfvATI glad_glGetTexBumpParameterfvATI +#endif +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +GLAPI int GLAD_GL_ARB_robust_buffer_access_behavior; +#endif +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +GLAPI int GLAD_GL_ARB_shader_stencil_export; +#endif +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +GLAPI int GLAD_GL_NV_texture_rectangle; +#endif +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 +GLAPI int GLAD_GL_ARB_enhanced_layouts; +#endif +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +GLAPI int GLAD_GL_ARB_texture_rectangle; +#endif +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +GLAPI int GLAD_GL_SGI_texture_color_table; +#endif +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +GLAPI int GLAD_GL_ATI_map_object_buffer; +typedef void* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; +#define glMapObjectBufferATI glad_glMapObjectBufferATI +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; +#define glUnmapObjectBufferATI glad_glUnmapObjectBufferATI +#endif +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +GLAPI int GLAD_GL_ARB_robustness; +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC)(); +GLAPI PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; +#define glGetGraphicsResetStatusARB glad_glGetGraphicsResetStatusARB +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +GLAPI PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; +#define glGetnTexImageARB glad_glGetnTexImageARB +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); +GLAPI PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; +#define glReadnPixelsARB glad_glReadnPixelsARB +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint lod, GLsizei bufSize, void* img); +GLAPI PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; +#define glGetnCompressedTexImageARB glad_glGetnCompressedTexImageARB +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +GLAPI PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; +#define glGetnUniformfvARB glad_glGetnUniformfvARB +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); +GLAPI PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; +#define glGetnUniformivARB glad_glGetnUniformivARB +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); +GLAPI PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; +#define glGetnUniformuivARB glad_glGetnUniformuivARB +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +GLAPI PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; +#define glGetnUniformdvARB glad_glGetnUniformdvARB +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +GLAPI PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; +#define glGetnMapdvARB glad_glGetnMapdvARB +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +GLAPI PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; +#define glGetnMapfvARB glad_glGetnMapfvARB +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLint* v); +GLAPI PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; +#define glGetnMapivARB glad_glGetnMapivARB +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC)(GLenum map, GLsizei bufSize, GLfloat* values); +GLAPI PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; +#define glGetnPixelMapfvARB glad_glGetnPixelMapfvARB +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC)(GLenum map, GLsizei bufSize, GLuint* values); +GLAPI PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; +#define glGetnPixelMapuivARB glad_glGetnPixelMapuivARB +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC)(GLenum map, GLsizei bufSize, GLushort* values); +GLAPI PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; +#define glGetnPixelMapusvARB glad_glGetnPixelMapusvARB +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC)(GLsizei bufSize, GLubyte* pattern); +GLAPI PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; +#define glGetnPolygonStippleARB glad_glGetnPolygonStippleARB +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +GLAPI PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; +#define glGetnColorTableARB glad_glGetnColorTableARB +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +GLAPI PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; +#define glGetnConvolutionFilterARB glad_glGetnConvolutionFilterARB +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void* column, void* span); +GLAPI PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; +#define glGetnSeparableFilterARB glad_glGetnSeparableFilterARB +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +GLAPI PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; +#define glGetnHistogramARB glad_glGetnHistogramARB +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +GLAPI PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; +#define glGetnMinmaxARB glad_glGetnMinmaxARB +#endif +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +GLAPI int GLAD_GL_NV_pixel_data_range; +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC)(GLenum target, GLsizei length, const void* pointer); +GLAPI PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; +#define glPixelDataRangeNV glad_glPixelDataRangeNV +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC)(GLenum target); +GLAPI PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; +#define glFlushPixelDataRangeNV glad_glFlushPixelDataRangeNV +#endif +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +GLAPI int GLAD_GL_EXT_framebuffer_blit; +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; +#define glBlitFramebufferEXT glad_glBlitFramebufferEXT +#endif +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +GLAPI int GLAD_GL_ARB_gpu_shader_fp64; +typedef void (APIENTRYP PFNGLUNIFORM1DPROC)(GLint location, GLdouble x); +GLAPI PFNGLUNIFORM1DPROC glad_glUniform1d; +#define glUniform1d glad_glUniform1d +typedef void (APIENTRYP PFNGLUNIFORM2DPROC)(GLint location, GLdouble x, GLdouble y); +GLAPI PFNGLUNIFORM2DPROC glad_glUniform2d; +#define glUniform2d glad_glUniform2d +typedef void (APIENTRYP PFNGLUNIFORM3DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLUNIFORM3DPROC glad_glUniform3d; +#define glUniform3d glad_glUniform3d +typedef void (APIENTRYP PFNGLUNIFORM4DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLUNIFORM4DPROC glad_glUniform4d; +#define glUniform4d glad_glUniform4d +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC)(GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLUNIFORM1DVPROC glad_glUniform1dv; +#define glUniform1dv glad_glUniform1dv +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC)(GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLUNIFORM2DVPROC glad_glUniform2dv; +#define glUniform2dv glad_glUniform2dv +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC)(GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLUNIFORM3DVPROC glad_glUniform3dv; +#define glUniform3dv glad_glUniform3dv +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC)(GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLUNIFORM4DVPROC glad_glUniform4dv; +#define glUniform4dv glad_glUniform4dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; +#define glUniformMatrix2dv glad_glUniformMatrix2dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; +#define glUniformMatrix3dv glad_glUniformMatrix3dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; +#define glUniformMatrix4dv glad_glUniformMatrix4dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; +#define glUniformMatrix2x3dv glad_glUniformMatrix2x3dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; +#define glUniformMatrix2x4dv glad_glUniformMatrix2x4dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; +#define glUniformMatrix3x2dv glad_glUniformMatrix3x2dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; +#define glUniformMatrix3x4dv glad_glUniformMatrix3x4dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; +#define glUniformMatrix4x2dv glad_glUniformMatrix4x2dv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; +#define glUniformMatrix4x3dv glad_glUniformMatrix4x3dv +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC)(GLuint program, GLint location, GLdouble* params); +GLAPI PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; +#define glGetUniformdv glad_glGetUniformdv +#endif +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 +GLAPI int GLAD_GL_NV_command_list; +typedef void (APIENTRYP PFNGLCREATESTATESNVPROC)(GLsizei n, GLuint* states); +GLAPI PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; +#define glCreateStatesNV glad_glCreateStatesNV +typedef void (APIENTRYP PFNGLDELETESTATESNVPROC)(GLsizei n, const GLuint* states); +GLAPI PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; +#define glDeleteStatesNV glad_glDeleteStatesNV +typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC)(GLuint state); +GLAPI PFNGLISSTATENVPROC glad_glIsStateNV; +#define glIsStateNV glad_glIsStateNV +typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC)(GLuint state, GLenum mode); +GLAPI PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; +#define glStateCaptureNV glad_glStateCaptureNV +typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC)(GLenum tokenID, GLuint size); +GLAPI PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; +#define glGetCommandHeaderNV glad_glGetCommandHeaderNV +typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC)(GLenum shadertype); +GLAPI PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; +#define glGetStageIndexNV glad_glGetStageIndexNV +typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC)(GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); +GLAPI PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; +#define glDrawCommandsNV glad_glDrawCommandsNV +typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC)(GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); +GLAPI PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; +#define glDrawCommandsAddressNV glad_glDrawCommandsAddressNV +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC)(GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +GLAPI PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; +#define glDrawCommandsStatesNV glad_glDrawCommandsStatesNV +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)(const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +GLAPI PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; +#define glDrawCommandsStatesAddressNV glad_glDrawCommandsStatesAddressNV +typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC)(GLsizei n, GLuint* lists); +GLAPI PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; +#define glCreateCommandListsNV glad_glCreateCommandListsNV +typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC)(GLsizei n, const GLuint* lists); +GLAPI PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; +#define glDeleteCommandListsNV glad_glDeleteCommandListsNV +typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC)(GLuint list); +GLAPI PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; +#define glIsCommandListNV glad_glIsCommandListNV +typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)(GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); +GLAPI PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; +#define glListDrawCommandsStatesClientNV glad_glListDrawCommandsStatesClientNV +typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC)(GLuint list, GLuint segments); +GLAPI PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; +#define glCommandListSegmentsNV glad_glCommandListSegmentsNV +typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC)(GLuint list); +GLAPI PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; +#define glCompileCommandListNV glad_glCompileCommandListNV +typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC)(GLuint list); +GLAPI PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; +#define glCallCommandListNV glad_glCallCommandListNV +#endif +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +GLAPI int GLAD_GL_SGIX_depth_texture; +#endif +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +GLAPI int GLAD_GL_EXT_vertex_weighting; +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC)(GLfloat weight); +GLAPI PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; +#define glVertexWeightfEXT glad_glVertexWeightfEXT +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC)(const GLfloat* weight); +GLAPI PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; +#define glVertexWeightfvEXT glad_glVertexWeightfvEXT +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; +#define glVertexWeightPointerEXT glad_glVertexWeightPointerEXT +#endif +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +GLAPI int GLAD_GL_GREMEDY_string_marker; +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC)(GLsizei len, const void* string); +GLAPI PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; +#define glStringMarkerGREMEDY glad_glStringMarkerGREMEDY +#endif +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +GLAPI int GLAD_GL_ARB_texture_compression_bptc; +#endif +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +GLAPI int GLAD_GL_EXT_subtexture; +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; +#define glTexSubImage1DEXT glad_glTexSubImage1DEXT +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; +#define glTexSubImage2DEXT glad_glTexSubImage2DEXT +#endif +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +GLAPI int GLAD_GL_EXT_pixel_transform_color_table; +#endif +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +GLAPI int GLAD_GL_EXT_texture_compression_rgtc; +#endif +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 +GLAPI int GLAD_GL_ARB_shader_atomic_counter_ops; +#endif +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +GLAPI int GLAD_GL_SGIX_depth_pass_instrument; +#endif +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +GLAPI int GLAD_GL_EXT_gpu_program_parameters; +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); +GLAPI PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; +#define glProgramEnvParameters4fvEXT glad_glProgramEnvParameters4fvEXT +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); +GLAPI PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; +#define glProgramLocalParameters4fvEXT glad_glProgramLocalParameters4fvEXT +#endif +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +GLAPI int GLAD_GL_NV_evaluators; +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +GLAPI PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; +#define glMapControlPointsNV glad_glMapControlPointsNV +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; +#define glMapParameterivNV glad_glMapParameterivNV +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; +#define glMapParameterfvNV glad_glMapParameterfvNV +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +GLAPI PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; +#define glGetMapControlPointsNV glad_glGetMapControlPointsNV +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; +#define glGetMapParameterivNV glad_glGetMapParameterivNV +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; +#define glGetMapParameterfvNV glad_glGetMapParameterfvNV +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; +#define glGetMapAttribParameterivNV glad_glGetMapAttribParameterivNV +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; +#define glGetMapAttribParameterfvNV glad_glGetMapAttribParameterfvNV +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC)(GLenum target, GLenum mode); +GLAPI PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; +#define glEvalMapsNV glad_glEvalMapsNV +#endif +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +GLAPI int GLAD_GL_SGIS_texture_filter4; +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLfloat* weights); +GLAPI PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; +#define glGetTexFilterFuncSGIS glad_glGetTexFilterFuncSGIS +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); +GLAPI PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; +#define glTexFilterFuncSGIS glad_glTexFilterFuncSGIS +#endif +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +GLAPI int GLAD_GL_AMD_performance_monitor; +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC)(GLint* numGroups, GLsizei groupsSize, GLuint* groups); +GLAPI PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; +#define glGetPerfMonitorGroupsAMD glad_glGetPerfMonitorGroupsAMD +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC)(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters); +GLAPI PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; +#define glGetPerfMonitorCountersAMD glad_glGetPerfMonitorCountersAMD +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString); +GLAPI PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; +#define glGetPerfMonitorGroupStringAMD glad_glGetPerfMonitorGroupStringAMD +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString); +GLAPI PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; +#define glGetPerfMonitorCounterStringAMD glad_glGetPerfMonitorCounterStringAMD +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)(GLuint group, GLuint counter, GLenum pname, void* data); +GLAPI PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; +#define glGetPerfMonitorCounterInfoAMD glad_glGetPerfMonitorCounterInfoAMD +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); +GLAPI PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; +#define glGenPerfMonitorsAMD glad_glGenPerfMonitorsAMD +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); +GLAPI PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; +#define glDeletePerfMonitorsAMD glad_glDeletePerfMonitorsAMD +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); +GLAPI PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; +#define glSelectPerfMonitorCountersAMD glad_glSelectPerfMonitorCountersAMD +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC)(GLuint monitor); +GLAPI PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; +#define glBeginPerfMonitorAMD glad_glBeginPerfMonitorAMD +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC)(GLuint monitor); +GLAPI PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; +#define glEndPerfMonitorAMD glad_glEndPerfMonitorAMD +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten); +GLAPI PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; +#define glGetPerfMonitorCounterDataAMD glad_glGetPerfMonitorCounterDataAMD +#endif +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +GLAPI int GLAD_GL_NV_geometry_shader4; +#endif +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +GLAPI int GLAD_GL_EXT_stencil_clear_tag; +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC)(GLsizei stencilTagBits, GLuint stencilClearTag); +GLAPI PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; +#define glStencilClearTagEXT glad_glStencilClearTagEXT +#endif +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +GLAPI int GLAD_GL_NV_vertex_program1_1; +#endif +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +GLAPI int GLAD_GL_NV_present_video; +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; +#define glPresentFrameKeyedNV glad_glPresentFrameKeyedNV +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; +#define glPresentFrameDualFillNV glad_glPresentFrameDualFillNV +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC)(GLuint video_slot, GLenum pname, GLint* params); +GLAPI PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; +#define glGetVideoivNV glad_glGetVideoivNV +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC)(GLuint video_slot, GLenum pname, GLuint* params); +GLAPI PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; +#define glGetVideouivNV glad_glGetVideouivNV +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC)(GLuint video_slot, GLenum pname, GLint64EXT* params); +GLAPI PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; +#define glGetVideoi64vNV glad_glGetVideoi64vNV +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC)(GLuint video_slot, GLenum pname, GLuint64EXT* params); +GLAPI PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; +#define glGetVideoui64vNV glad_glGetVideoui64vNV +#endif +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +GLAPI int GLAD_GL_ARB_texture_compression_rgtc; +#endif +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +GLAPI int GLAD_GL_HP_convolution_border_modes; +#endif +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +GLAPI int GLAD_GL_EXT_shader_integer_mix; +#endif +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +GLAPI int GLAD_GL_SGIX_framezoom; +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC)(GLint factor); +GLAPI PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; +#define glFrameZoomSGIX glad_glFrameZoomSGIX +#endif +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +GLAPI int GLAD_GL_ARB_stencil_texturing; +#endif +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 +GLAPI int GLAD_GL_ARB_shader_clock; +#endif +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 +GLAPI int GLAD_GL_NV_shader_atomic_fp16_vector; +#endif +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +GLAPI int GLAD_GL_SGIX_fog_offset; +#endif +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +GLAPI int GLAD_GL_ARB_draw_elements_base_vertex; +#endif +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +GLAPI int GLAD_GL_INGR_interlace_read; +#endif +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +GLAPI int GLAD_GL_NV_transform_feedback; +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC)(GLenum primitiveMode); +GLAPI PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; +#define glBeginTransformFeedbackNV glad_glBeginTransformFeedbackNV +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC)(); +GLAPI PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; +#define glEndTransformFeedbackNV glad_glEndTransformFeedbackNV +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; +#define glTransformFeedbackAttribsNV glad_glTransformFeedbackAttribsNV +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; +#define glBindBufferRangeNV glad_glBindBufferRangeNV +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; +#define glBindBufferOffsetNV glad_glBindBufferOffsetNV +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC)(GLenum target, GLuint index, GLuint buffer); +GLAPI PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; +#define glBindBufferBaseNV glad_glBindBufferBaseNV +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)(GLuint program, GLsizei count, const GLint* locations, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; +#define glTransformFeedbackVaryingsNV glad_glTransformFeedbackVaryingsNV +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; +#define glActiveVaryingNV glad_glActiveVaryingNV +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; +#define glGetVaryingLocationNV glad_glGetVaryingLocationNV +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); +GLAPI PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; +#define glGetActiveVaryingNV glad_glGetActiveVaryingNV +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)(GLuint program, GLuint index, GLint* location); +GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; +#define glGetTransformFeedbackVaryingNV glad_glGetTransformFeedbackVaryingNV +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLsizei nbuffers, const GLint* bufstreams, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; +#define glTransformFeedbackStreamAttribsNV glad_glTransformFeedbackStreamAttribsNV +#endif +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +GLAPI int GLAD_GL_NV_fragment_program; +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; +#define glProgramNamedParameter4fNV glad_glProgramNamedParameter4fNV +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLfloat* v); +GLAPI PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; +#define glProgramNamedParameter4fvNV glad_glProgramNamedParameter4fvNV +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; +#define glProgramNamedParameter4dNV glad_glProgramNamedParameter4dNV +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLdouble* v); +GLAPI PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; +#define glProgramNamedParameter4dvNV glad_glProgramNamedParameter4dvNV +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat* params); +GLAPI PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; +#define glGetProgramNamedParameterfvNV glad_glGetProgramNamedParameterfvNV +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble* params); +GLAPI PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; +#define glGetProgramNamedParameterdvNV glad_glGetProgramNamedParameterdvNV +#endif +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 +GLAPI int GLAD_GL_AMD_stencil_operation_extended; +typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC)(GLenum face, GLuint value); +GLAPI PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; +#define glStencilOpValueAMD glad_glStencilOpValueAMD +#endif +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 +GLAPI int GLAD_GL_ARB_seamless_cubemap_per_texture; +#endif +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +GLAPI int GLAD_GL_ARB_instanced_arrays; +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC)(GLuint index, GLuint divisor); +GLAPI PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; +#define glVertexAttribDivisorARB glad_glVertexAttribDivisorARB +#endif +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +GLAPI int GLAD_GL_EXT_polygon_offset; +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC)(GLfloat factor, GLfloat bias); +GLAPI PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; +#define glPolygonOffsetEXT glad_glPolygonOffsetEXT +#endif +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +GLAPI int GLAD_GL_NV_vertex_array_range2; +#endif +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 +GLAPI int GLAD_GL_KHR_robustness; +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC)(); +GLAPI PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; +#define glGetGraphicsResetStatus glad_glGetGraphicsResetStatus +typedef void (APIENTRYP PFNGLREADNPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); +GLAPI PFNGLREADNPIXELSPROC glad_glReadnPixels; +#define glReadnPixels glad_glReadnPixels +typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +GLAPI PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; +#define glGetnUniformfv glad_glGetnUniformfv +typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); +GLAPI PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; +#define glGetnUniformiv glad_glGetnUniformiv +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); +GLAPI PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; +#define glGetnUniformuiv glad_glGetnUniformuiv +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(); +GLAPI PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; +#define glGetGraphicsResetStatusKHR glad_glGetGraphicsResetStatusKHR +typedef void (APIENTRYP PFNGLREADNPIXELSKHRPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); +GLAPI PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; +#define glReadnPixelsKHR glad_glReadnPixelsKHR +typedef void (APIENTRYP PFNGLGETNUNIFORMFVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +GLAPI PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; +#define glGetnUniformfvKHR glad_glGetnUniformfvKHR +typedef void (APIENTRYP PFNGLGETNUNIFORMIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); +GLAPI PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; +#define glGetnUniformivKHR glad_glGetnUniformivKHR +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); +GLAPI PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; +#define glGetnUniformuivKHR glad_glGetnUniformuivKHR +#endif +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +GLAPI int GLAD_GL_AMD_sparse_texture; +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; +#define glTexStorageSparseAMD glad_glTexStorageSparseAMD +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC)(GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; +#define glTextureStorageSparseAMD glad_glTextureStorageSparseAMD +#endif +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 +GLAPI int GLAD_GL_ARB_clip_control; +typedef void (APIENTRYP PFNGLCLIPCONTROLPROC)(GLenum origin, GLenum depth); +GLAPI PFNGLCLIPCONTROLPROC glad_glClipControl; +#define glClipControl glad_glClipControl +#endif +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 +GLAPI int GLAD_GL_NV_fragment_coverage_to_color; +typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC)(GLuint color); +GLAPI PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; +#define glFragmentCoverageColorNV glad_glFragmentCoverageColorNV +#endif +#ifndef GL_NV_fence +#define GL_NV_fence 1 +GLAPI int GLAD_GL_NV_fence; +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC)(GLsizei n, const GLuint* fences); +GLAPI PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; +#define glDeleteFencesNV glad_glDeleteFencesNV +typedef void (APIENTRYP PFNGLGENFENCESNVPROC)(GLsizei n, GLuint* fences); +GLAPI PFNGLGENFENCESNVPROC glad_glGenFencesNV; +#define glGenFencesNV glad_glGenFencesNV +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC)(GLuint fence); +GLAPI PFNGLISFENCENVPROC glad_glIsFenceNV; +#define glIsFenceNV glad_glIsFenceNV +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC)(GLuint fence); +GLAPI PFNGLTESTFENCENVPROC glad_glTestFenceNV; +#define glTestFenceNV glad_glTestFenceNV +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC)(GLuint fence, GLenum pname, GLint* params); +GLAPI PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; +#define glGetFenceivNV glad_glGetFenceivNV +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC)(GLuint fence); +GLAPI PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; +#define glFinishFenceNV glad_glFinishFenceNV +typedef void (APIENTRYP PFNGLSETFENCENVPROC)(GLuint fence, GLenum condition); +GLAPI PFNGLSETFENCENVPROC glad_glSetFenceNV; +#define glSetFenceNV glad_glSetFenceNV +#endif +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +GLAPI int GLAD_GL_ARB_texture_buffer_range; +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; +#define glTexBufferRange glad_glTexBufferRange +#endif +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +GLAPI int GLAD_GL_SUN_mesh_array; +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC)(GLenum mode, GLint first, GLsizei count, GLsizei width); +GLAPI PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; +#define glDrawMeshArraysSUN glad_glDrawMeshArraysSUN +#endif +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +GLAPI int GLAD_GL_ARB_vertex_attrib_binding; +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; +#define glBindVertexBuffer glad_glBindVertexBuffer +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; +#define glVertexAttribFormat glad_glVertexAttribFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; +#define glVertexAttribIFormat glad_glVertexAttribIFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; +#define glVertexAttribLFormat glad_glVertexAttribLFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC)(GLuint attribindex, GLuint bindingindex); +GLAPI PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; +#define glVertexAttribBinding glad_glVertexAttribBinding +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC)(GLuint bindingindex, GLuint divisor); +GLAPI PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; +#define glVertexBindingDivisor glad_glVertexBindingDivisor +#endif +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +GLAPI int GLAD_GL_ARB_framebuffer_no_attachments; +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; +#define glFramebufferParameteri glad_glFramebufferParameteri +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; +#define glGetFramebufferParameteriv glad_glGetFramebufferParameteriv +#endif +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +GLAPI int GLAD_GL_ARB_cl_event; +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC)(struct _cl_context* context, struct _cl_event* event, GLbitfield flags); +GLAPI PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; +#define glCreateSyncFromCLeventARB glad_glCreateSyncFromCLeventARB +#endif +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 +GLAPI int GLAD_GL_ARB_derivative_control; +#endif +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +GLAPI int GLAD_GL_NV_packed_depth_stencil; +#endif +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +GLAPI int GLAD_GL_OES_single_precision; +typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC)(GLclampf depth); +GLAPI PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; +#define glClearDepthfOES glad_glClearDepthfOES +typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC)(GLenum plane, const GLfloat* equation); +GLAPI PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; +#define glClipPlanefOES glad_glClipPlanefOES +typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC)(GLclampf n, GLclampf f); +GLAPI PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; +#define glDepthRangefOES glad_glDepthRangefOES +typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; +#define glFrustumfOES glad_glFrustumfOES +typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC)(GLenum plane, GLfloat* equation); +GLAPI PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; +#define glGetClipPlanefOES glad_glGetClipPlanefOES +typedef void (APIENTRYP PFNGLORTHOFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI PFNGLORTHOFOESPROC glad_glOrthofOES; +#define glOrthofOES glad_glOrthofOES +#endif +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +GLAPI int GLAD_GL_NV_primitive_restart; +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC)(); +GLAPI PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; +#define glPrimitiveRestartNV glad_glPrimitiveRestartNV +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC)(GLuint index); +GLAPI PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; +#define glPrimitiveRestartIndexNV glad_glPrimitiveRestartIndexNV +#endif +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +GLAPI int GLAD_GL_SUN_global_alpha; +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC)(GLbyte factor); +GLAPI PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; +#define glGlobalAlphaFactorbSUN glad_glGlobalAlphaFactorbSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC)(GLshort factor); +GLAPI PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; +#define glGlobalAlphaFactorsSUN glad_glGlobalAlphaFactorsSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC)(GLint factor); +GLAPI PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; +#define glGlobalAlphaFactoriSUN glad_glGlobalAlphaFactoriSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC)(GLfloat factor); +GLAPI PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; +#define glGlobalAlphaFactorfSUN glad_glGlobalAlphaFactorfSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC)(GLdouble factor); +GLAPI PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; +#define glGlobalAlphaFactordSUN glad_glGlobalAlphaFactordSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC)(GLubyte factor); +GLAPI PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; +#define glGlobalAlphaFactorubSUN glad_glGlobalAlphaFactorubSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC)(GLushort factor); +GLAPI PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; +#define glGlobalAlphaFactorusSUN glad_glGlobalAlphaFactorusSUN +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC)(GLuint factor); +GLAPI PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; +#define glGlobalAlphaFactoruiSUN glad_glGlobalAlphaFactoruiSUN +#endif +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 +GLAPI int GLAD_GL_ARB_fragment_shader_interlock; +#endif +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +GLAPI int GLAD_GL_EXT_texture_object; +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC)(GLsizei n, const GLuint* textures, GLboolean* residences); +GLAPI PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; +#define glAreTexturesResidentEXT glad_glAreTexturesResidentEXT +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; +#define glBindTextureEXT glad_glBindTextureEXT +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC)(GLsizei n, const GLuint* textures); +GLAPI PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; +#define glDeleteTexturesEXT glad_glDeleteTexturesEXT +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC)(GLsizei n, GLuint* textures); +GLAPI PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; +#define glGenTexturesEXT glad_glGenTexturesEXT +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; +#define glIsTextureEXT glad_glIsTextureEXT +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC)(GLsizei n, const GLuint* textures, const GLclampf* priorities); +GLAPI PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; +#define glPrioritizeTexturesEXT glad_glPrioritizeTexturesEXT +#endif +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +GLAPI int GLAD_GL_AMD_name_gen_delete; +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC)(GLenum identifier, GLuint num, GLuint* names); +GLAPI PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; +#define glGenNamesAMD glad_glGenNamesAMD +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC)(GLenum identifier, GLuint num, const GLuint* names); +GLAPI PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; +#define glDeleteNamesAMD glad_glDeleteNamesAMD +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC)(GLenum identifier, GLuint name); +GLAPI PFNGLISNAMEAMDPROC glad_glIsNameAMD; +#define glIsNameAMD glad_glIsNameAMD +#endif +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +GLAPI int GLAD_GL_NV_texture_compression_vtc; +#endif +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 +GLAPI int GLAD_GL_NV_sample_mask_override_coverage; +#endif +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +GLAPI int GLAD_GL_NV_texture_shader3; +#endif +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +GLAPI int GLAD_GL_NV_texture_shader2; +#endif +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +GLAPI int GLAD_GL_EXT_texture; +#endif +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +GLAPI int GLAD_GL_ARB_buffer_storage; +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags); +GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +#define glBufferStorage glad_glBufferStorage +#endif +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 +GLAPI int GLAD_GL_AMD_shader_atomic_counter_ops; +#endif +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +GLAPI int GLAD_GL_APPLE_vertex_program_evaluators; +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); +GLAPI PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; +#define glEnableVertexAttribAPPLE glad_glEnableVertexAttribAPPLE +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); +GLAPI PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; +#define glDisableVertexAttribAPPLE glad_glDisableVertexAttribAPPLE +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)(GLuint index, GLenum pname); +GLAPI PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; +#define glIsVertexAttribEnabledAPPLE glad_glIsVertexAttribEnabledAPPLE +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +GLAPI PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; +#define glMapVertexAttrib1dAPPLE glad_glMapVertexAttrib1dAPPLE +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +GLAPI PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; +#define glMapVertexAttrib1fAPPLE glad_glMapVertexAttrib1fAPPLE +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +GLAPI PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; +#define glMapVertexAttrib2dAPPLE glad_glMapVertexAttrib2dAPPLE +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); +GLAPI PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; +#define glMapVertexAttrib2fAPPLE glad_glMapVertexAttrib2fAPPLE +#endif +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 +GLAPI int GLAD_GL_ARB_multi_bind; +typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +GLAPI PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; +#define glBindBuffersBase glad_glBindBuffersBase +typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizeiptr* sizes); +GLAPI PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; +#define glBindBuffersRange glad_glBindBuffersRange +typedef void (APIENTRYP PFNGLBINDTEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); +GLAPI PFNGLBINDTEXTURESPROC glad_glBindTextures; +#define glBindTextures glad_glBindTextures +typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC)(GLuint first, GLsizei count, const GLuint* samplers); +GLAPI PFNGLBINDSAMPLERSPROC glad_glBindSamplers; +#define glBindSamplers glad_glBindSamplers +typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); +GLAPI PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; +#define glBindImageTextures glad_glBindImageTextures +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC)(GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); +GLAPI PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; +#define glBindVertexBuffers glad_glBindVertexBuffers +#endif +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +GLAPI int GLAD_GL_ARB_explicit_uniform_location; +#endif +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +GLAPI int GLAD_GL_ARB_depth_buffer_float; +#endif +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 +GLAPI int GLAD_GL_NV_path_rendering_shared_edge; +#endif +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +GLAPI int GLAD_GL_SGIX_shadow_ambient; +#endif +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +GLAPI int GLAD_GL_ARB_texture_cube_map; +#endif +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 +GLAPI int GLAD_GL_AMD_vertex_shader_viewport_index; +#endif +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +GLAPI int GLAD_GL_SGIX_list_priority; +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, GLfloat* params); +GLAPI PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; +#define glGetListParameterfvSGIX glad_glGetListParameterfvSGIX +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, GLint* params); +GLAPI PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; +#define glGetListParameterivSGIX glad_glGetListParameterivSGIX +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC)(GLuint list, GLenum pname, GLfloat param); +GLAPI PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; +#define glListParameterfSGIX glad_glListParameterfSGIX +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, const GLfloat* params); +GLAPI PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; +#define glListParameterfvSGIX glad_glListParameterfvSGIX +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC)(GLuint list, GLenum pname, GLint param); +GLAPI PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; +#define glListParameteriSGIX glad_glListParameteriSGIX +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, const GLint* params); +GLAPI PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; +#define glListParameterivSGIX glad_glListParameterivSGIX +#endif +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +GLAPI int GLAD_GL_NV_vertex_buffer_unified_memory; +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC)(GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; +#define glBufferAddressRangeNV glad_glBufferAddressRangeNV +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; +#define glVertexFormatNV glad_glVertexFormatNV +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC)(GLenum type, GLsizei stride); +GLAPI PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; +#define glNormalFormatNV glad_glNormalFormatNV +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; +#define glColorFormatNV glad_glColorFormatNV +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC)(GLenum type, GLsizei stride); +GLAPI PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; +#define glIndexFormatNV glad_glIndexFormatNV +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; +#define glTexCoordFormatNV glad_glTexCoordFormatNV +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC)(GLsizei stride); +GLAPI PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; +#define glEdgeFlagFormatNV glad_glEdgeFlagFormatNV +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; +#define glSecondaryColorFormatNV glad_glSecondaryColorFormatNV +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC)(GLenum type, GLsizei stride); +GLAPI PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; +#define glFogCoordFormatNV glad_glFogCoordFormatNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; +#define glVertexAttribFormatNV glad_glVertexAttribFormatNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; +#define glVertexAttribIFormatNV glad_glVertexAttribIFormatNV +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC)(GLenum value, GLuint index, GLuint64EXT* result); +GLAPI PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; +#define glGetIntegerui64i_vNV glad_glGetIntegerui64i_vNV +#endif +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 +GLAPI int GLAD_GL_NV_uniform_buffer_unified_memory; +#endif +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +GLAPI int GLAD_GL_EXT_texture_env_dot3; +#endif +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +GLAPI int GLAD_GL_ATI_texture_env_combine3; +#endif +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 +GLAPI int GLAD_GL_ARB_map_buffer_alignment; +#endif +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 +GLAPI int GLAD_GL_NV_blend_equation_advanced; +typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC)(GLenum pname, GLint value); +GLAPI PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; +#define glBlendParameteriNV glad_glBlendParameteriNV +typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC)(); +GLAPI PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; +#define glBlendBarrierNV glad_glBlendBarrierNV +#endif +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +GLAPI int GLAD_GL_SGIS_sharpen_texture; +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); +GLAPI PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; +#define glSharpenTexFuncSGIS glad_glSharpenTexFuncSGIS +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC)(GLenum target, GLfloat* points); +GLAPI PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; +#define glGetSharpenTexFuncSGIS glad_glGetSharpenTexFuncSGIS +#endif +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 +GLAPI int GLAD_GL_KHR_robust_buffer_access_behavior; +#endif +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 +GLAPI int GLAD_GL_ARB_pipeline_statistics_query; +#endif +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +GLAPI int GLAD_GL_ARB_vertex_program; +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; +#define glVertexAttrib1dARB glad_glVertexAttrib1dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; +#define glVertexAttrib1dvARB glad_glVertexAttrib1dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; +#define glVertexAttrib1fARB glad_glVertexAttrib1fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; +#define glVertexAttrib1fvARB glad_glVertexAttrib1fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; +#define glVertexAttrib1sARB glad_glVertexAttrib1sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; +#define glVertexAttrib1svARB glad_glVertexAttrib1svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; +#define glVertexAttrib2dARB glad_glVertexAttrib2dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; +#define glVertexAttrib2dvARB glad_glVertexAttrib2dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; +#define glVertexAttrib2fARB glad_glVertexAttrib2fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; +#define glVertexAttrib2fvARB glad_glVertexAttrib2fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; +#define glVertexAttrib2sARB glad_glVertexAttrib2sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; +#define glVertexAttrib2svARB glad_glVertexAttrib2svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; +#define glVertexAttrib3dARB glad_glVertexAttrib3dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; +#define glVertexAttrib3dvARB glad_glVertexAttrib3dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; +#define glVertexAttrib3fARB glad_glVertexAttrib3fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; +#define glVertexAttrib3fvARB glad_glVertexAttrib3fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; +#define glVertexAttrib3sARB glad_glVertexAttrib3sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; +#define glVertexAttrib3svARB glad_glVertexAttrib3svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; +#define glVertexAttrib4NbvARB glad_glVertexAttrib4NbvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; +#define glVertexAttrib4NivARB glad_glVertexAttrib4NivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; +#define glVertexAttrib4NsvARB glad_glVertexAttrib4NsvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; +#define glVertexAttrib4NubARB glad_glVertexAttrib4NubARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; +#define glVertexAttrib4NubvARB glad_glVertexAttrib4NubvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; +#define glVertexAttrib4NuivARB glad_glVertexAttrib4NuivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; +#define glVertexAttrib4NusvARB glad_glVertexAttrib4NusvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; +#define glVertexAttrib4bvARB glad_glVertexAttrib4bvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; +#define glVertexAttrib4dARB glad_glVertexAttrib4dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; +#define glVertexAttrib4dvARB glad_glVertexAttrib4dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; +#define glVertexAttrib4fARB glad_glVertexAttrib4fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; +#define glVertexAttrib4fvARB glad_glVertexAttrib4fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; +#define glVertexAttrib4ivARB glad_glVertexAttrib4ivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; +#define glVertexAttrib4sARB glad_glVertexAttrib4sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; +#define glVertexAttrib4svARB glad_glVertexAttrib4svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; +#define glVertexAttrib4ubvARB glad_glVertexAttrib4ubvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; +#define glVertexAttrib4uivARB glad_glVertexAttrib4uivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; +#define glVertexAttrib4usvARB glad_glVertexAttrib4usvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; +#define glVertexAttribPointerARB glad_glVertexAttribPointerARB +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; +#define glEnableVertexAttribArrayARB glad_glEnableVertexAttribArrayARB +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; +#define glDisableVertexAttribArrayARB glad_glDisableVertexAttribArrayARB +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); +GLAPI PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; +#define glProgramStringARB glad_glProgramStringARB +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); +GLAPI PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; +#define glBindProgramARB glad_glBindProgramARB +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); +GLAPI PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; +#define glDeleteProgramsARB glad_glDeleteProgramsARB +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); +GLAPI PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; +#define glGenProgramsARB glad_glGenProgramsARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; +#define glProgramEnvParameter4dARB glad_glProgramEnvParameter4dARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); +GLAPI PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; +#define glProgramEnvParameter4dvARB glad_glProgramEnvParameter4dvARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; +#define glProgramEnvParameter4fARB glad_glProgramEnvParameter4fARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); +GLAPI PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; +#define glProgramEnvParameter4fvARB glad_glProgramEnvParameter4fvARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; +#define glProgramLocalParameter4dARB glad_glProgramLocalParameter4dARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); +GLAPI PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; +#define glProgramLocalParameter4dvARB glad_glProgramLocalParameter4dvARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; +#define glProgramLocalParameter4fARB glad_glProgramLocalParameter4fARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); +GLAPI PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; +#define glProgramLocalParameter4fvARB glad_glProgramLocalParameter4fvARB +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; +#define glGetProgramEnvParameterdvARB glad_glGetProgramEnvParameterdvARB +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; +#define glGetProgramEnvParameterfvARB glad_glGetProgramEnvParameterfvARB +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; +#define glGetProgramLocalParameterdvARB glad_glGetProgramLocalParameterdvARB +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; +#define glGetProgramLocalParameterfvARB glad_glGetProgramLocalParameterfvARB +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; +#define glGetProgramivARB glad_glGetProgramivARB +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); +GLAPI PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; +#define glGetProgramStringARB glad_glGetProgramStringARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; +#define glGetVertexAttribdvARB glad_glGetVertexAttribdvARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; +#define glGetVertexAttribfvARB glad_glGetVertexAttribfvARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; +#define glGetVertexAttribivARB glad_glGetVertexAttribivARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; +#define glGetVertexAttribPointervARB glad_glGetVertexAttribPointervARB +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC)(GLuint program); +GLAPI PFNGLISPROGRAMARBPROC glad_glIsProgramARB; +#define glIsProgramARB glad_glIsProgramARB +#endif +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +GLAPI int GLAD_GL_ARB_texture_rgb10_a2ui; +#endif +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +GLAPI int GLAD_GL_OML_interlace; +#endif +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +GLAPI int GLAD_GL_ATI_pixel_format_float; +#endif +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 +GLAPI int GLAD_GL_NV_geometry_shader_passthrough; +#endif +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +GLAPI int GLAD_GL_ARB_vertex_buffer_object; +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; +#define glBindBufferARB glad_glBindBufferARB +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); +GLAPI PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; +#define glDeleteBuffersARB glad_glDeleteBuffersARB +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); +GLAPI PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; +#define glGenBuffersARB glad_glGenBuffersARB +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERARBPROC glad_glIsBufferARB; +#define glIsBufferARB glad_glIsBufferARB +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const void* data, GLenum usage); +GLAPI PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; +#define glBufferDataARB glad_glBufferDataARB +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void* data); +GLAPI PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; +#define glBufferSubDataARB glad_glBufferSubDataARB +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void* data); +GLAPI PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; +#define glGetBufferSubDataARB glad_glGetBufferSubDataARB +typedef void* (APIENTRYP PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; +#define glMapBufferARB glad_glMapBufferARB +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; +#define glUnmapBufferARB glad_glUnmapBufferARB +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; +#define glGetBufferParameterivARB glad_glGetBufferParameterivARB +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, void** params); +GLAPI PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; +#define glGetBufferPointervARB glad_glGetBufferPointervARB +#endif +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +GLAPI int GLAD_GL_EXT_shadow_funcs; +#endif +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +GLAPI int GLAD_GL_ATI_text_fragment_shader; +#endif +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +GLAPI int GLAD_GL_NV_vertex_array_range; +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC)(); +GLAPI PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; +#define glFlushVertexArrayRangeNV glad_glFlushVertexArrayRangeNV +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC)(GLsizei length, const void* pointer); +GLAPI PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; +#define glVertexArrayRangeNV glad_glVertexArrayRangeNV +#endif +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +GLAPI int GLAD_GL_SGIX_fragment_lighting; +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC)(GLenum face, GLenum mode); +GLAPI PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; +#define glFragmentColorMaterialSGIX glad_glFragmentColorMaterialSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC)(GLenum light, GLenum pname, GLfloat param); +GLAPI PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; +#define glFragmentLightfSGIX glad_glFragmentLightfSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, const GLfloat* params); +GLAPI PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; +#define glFragmentLightfvSGIX glad_glFragmentLightfvSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC)(GLenum light, GLenum pname, GLint param); +GLAPI PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; +#define glFragmentLightiSGIX glad_glFragmentLightiSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, const GLint* params); +GLAPI PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; +#define glFragmentLightivSGIX glad_glFragmentLightivSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; +#define glFragmentLightModelfSGIX glad_glFragmentLightModelfSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; +#define glFragmentLightModelfvSGIX glad_glFragmentLightModelfvSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC)(GLenum pname, GLint param); +GLAPI PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; +#define glFragmentLightModeliSGIX glad_glFragmentLightModeliSGIX +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; +#define glFragmentLightModelivSGIX glad_glFragmentLightModelivSGIX +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC)(GLenum face, GLenum pname, GLfloat param); +GLAPI PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; +#define glFragmentMaterialfSGIX glad_glFragmentMaterialfSGIX +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, const GLfloat* params); +GLAPI PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; +#define glFragmentMaterialfvSGIX glad_glFragmentMaterialfvSGIX +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC)(GLenum face, GLenum pname, GLint param); +GLAPI PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; +#define glFragmentMaterialiSGIX glad_glFragmentMaterialiSGIX +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, const GLint* params); +GLAPI PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; +#define glFragmentMaterialivSGIX glad_glFragmentMaterialivSGIX +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, GLfloat* params); +GLAPI PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; +#define glGetFragmentLightfvSGIX glad_glGetFragmentLightfvSGIX +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; +#define glGetFragmentLightivSGIX glad_glGetFragmentLightivSGIX +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, GLfloat* params); +GLAPI PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; +#define glGetFragmentMaterialfvSGIX glad_glGetFragmentMaterialfvSGIX +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; +#define glGetFragmentMaterialivSGIX glad_glGetFragmentMaterialivSGIX +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC)(GLenum pname, GLint param); +GLAPI PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; +#define glLightEnviSGIX glad_glLightEnviSGIX +#endif +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +GLAPI int GLAD_GL_NV_texture_expand_normal; +#endif +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +GLAPI int GLAD_GL_NV_framebuffer_multisample_coverage; +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; +#define glRenderbufferStorageMultisampleCoverageNV glad_glRenderbufferStorageMultisampleCoverageNV +#endif +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +GLAPI int GLAD_GL_EXT_timer_query; +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC)(GLuint id, GLenum pname, GLint64* params); +GLAPI PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; +#define glGetQueryObjecti64vEXT glad_glGetQueryObjecti64vEXT +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC)(GLuint id, GLenum pname, GLuint64* params); +GLAPI PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; +#define glGetQueryObjectui64vEXT glad_glGetQueryObjectui64vEXT +#endif +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +GLAPI int GLAD_GL_EXT_vertex_array_bgra; +#endif +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +GLAPI int GLAD_GL_NV_bindless_texture; +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC)(GLuint texture); +GLAPI PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; +#define glGetTextureHandleNV glad_glGetTextureHandleNV +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC)(GLuint texture, GLuint sampler); +GLAPI PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; +#define glGetTextureSamplerHandleNV glad_glGetTextureSamplerHandleNV +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); +GLAPI PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; +#define glMakeTextureHandleResidentNV glad_glMakeTextureHandleResidentNV +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)(GLuint64 handle); +GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; +#define glMakeTextureHandleNonResidentNV glad_glMakeTextureHandleNonResidentNV +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; +#define glGetImageHandleNV glad_glGetImageHandleNV +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle, GLenum access); +GLAPI PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; +#define glMakeImageHandleResidentNV glad_glMakeImageHandleResidentNV +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)(GLuint64 handle); +GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; +#define glMakeImageHandleNonResidentNV glad_glMakeImageHandleNonResidentNV +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC)(GLint location, GLuint64 value); +GLAPI PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; +#define glUniformHandleui64NV glad_glUniformHandleui64NV +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; +#define glUniformHandleui64vNV glad_glUniformHandleui64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)(GLuint program, GLint location, GLuint64 value); +GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; +#define glProgramUniformHandleui64NV glad_glProgramUniformHandleui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); +GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; +#define glProgramUniformHandleui64vNV glad_glProgramUniformHandleui64vNV +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); +GLAPI PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; +#define glIsTextureHandleResidentNV glad_glIsTextureHandleResidentNV +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle); +GLAPI PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; +#define glIsImageHandleResidentNV glad_glIsImageHandleResidentNV +#endif +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +GLAPI int GLAD_GL_KHR_debug; +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; +#define glDebugMessageControl glad_glDebugMessageControl +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; +#define glDebugMessageInsert glad_glDebugMessageInsert +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback, const void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; +#define glDebugMessageCallback glad_glDebugMessageCallback +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; +#define glGetDebugMessageLog glad_glGetDebugMessageLog +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); +GLAPI PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; +#define glPushDebugGroup glad_glPushDebugGroup +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC)(); +GLAPI PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; +#define glPopDebugGroup glad_glPopDebugGroup +typedef void (APIENTRYP PFNGLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +GLAPI PFNGLOBJECTLABELPROC glad_glObjectLabel; +#define glObjectLabel glad_glObjectLabel +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); +GLAPI PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; +#define glGetObjectLabel glad_glGetObjectLabel +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC)(const void* ptr, GLsizei length, const GLchar* label); +GLAPI PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; +#define glObjectPtrLabel glad_glObjectPtrLabel +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); +GLAPI PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; +#define glGetObjectPtrLabel glad_glGetObjectPtrLabel +typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void** params); +GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; +#define glGetPointerv glad_glGetPointerv +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; +#define glDebugMessageControlKHR glad_glDebugMessageControlKHR +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; +#define glDebugMessageInsertKHR glad_glDebugMessageInsertKHR +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC)(GLDEBUGPROCKHR callback, const void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; +#define glDebugMessageCallbackKHR glad_glDebugMessageCallbackKHR +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; +#define glGetDebugMessageLogKHR glad_glGetDebugMessageLogKHR +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); +GLAPI PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; +#define glPushDebugGroupKHR glad_glPushDebugGroupKHR +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC)(); +GLAPI PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; +#define glPopDebugGroupKHR glad_glPopDebugGroupKHR +typedef void (APIENTRYP PFNGLOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +GLAPI PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; +#define glObjectLabelKHR glad_glObjectLabelKHR +typedef void (APIENTRYP PFNGLGETOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); +GLAPI PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; +#define glGetObjectLabelKHR glad_glGetObjectLabelKHR +typedef void (APIENTRYP PFNGLOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei length, const GLchar* label); +GLAPI PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; +#define glObjectPtrLabelKHR glad_glObjectPtrLabelKHR +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); +GLAPI PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; +#define glGetObjectPtrLabelKHR glad_glGetObjectPtrLabelKHR +typedef void (APIENTRYP PFNGLGETPOINTERVKHRPROC)(GLenum pname, void** params); +GLAPI PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; +#define glGetPointervKHR glad_glGetPointervKHR +#endif +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +GLAPI int GLAD_GL_SGIS_texture_border_clamp; +#endif +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +GLAPI int GLAD_GL_ATI_vertex_attrib_array_object; +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; +#define glVertexAttribArrayObjectATI glad_glVertexAttribArrayObjectATI +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)(GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; +#define glGetVertexAttribArrayObjectfvATI glad_glGetVertexAttribArrayObjectfvATI +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; +#define glGetVertexAttribArrayObjectivATI glad_glGetVertexAttribArrayObjectivATI +#endif +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +GLAPI int GLAD_GL_SGIX_clipmap; +#endif +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +GLAPI int GLAD_GL_EXT_geometry_shader4; +#endif +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 +GLAPI int GLAD_GL_ARB_shader_texture_image_samples; +#endif +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +GLAPI int GLAD_GL_MESA_ycbcr_texture; +#endif +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +GLAPI int GLAD_GL_MESAX_texture_stack; +#endif +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +GLAPI int GLAD_GL_AMD_seamless_cubemap_per_texture; +#endif +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +GLAPI int GLAD_GL_EXT_bindable_uniform; +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC)(GLuint program, GLint location, GLuint buffer); +GLAPI PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; +#define glUniformBufferEXT glad_glUniformBufferEXT +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC)(GLuint program, GLint location); +GLAPI PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; +#define glGetUniformBufferSizeEXT glad_glGetUniformBufferSizeEXT +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC)(GLuint program, GLint location); +GLAPI PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; +#define glGetUniformOffsetEXT glad_glGetUniformOffsetEXT +#endif +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 +GLAPI int GLAD_GL_KHR_texture_compression_astc_hdr; +#endif +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 +GLAPI int GLAD_GL_ARB_shader_ballot; +#endif +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 +GLAPI int GLAD_GL_KHR_blend_equation_advanced; +typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC)(); +GLAPI PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; +#define glBlendBarrierKHR glad_glBlendBarrierKHR +#endif +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +GLAPI int GLAD_GL_ARB_fragment_program_shadow; +#endif +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +GLAPI int GLAD_GL_ATI_element_array; +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC)(GLenum type, const void* pointer); +GLAPI PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; +#define glElementPointerATI glad_glElementPointerATI +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC)(GLenum mode, GLsizei count); +GLAPI PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; +#define glDrawElementArrayATI glad_glDrawElementArrayATI +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count); +GLAPI PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; +#define glDrawRangeElementArrayATI glad_glDrawRangeElementArrayATI +#endif +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +GLAPI int GLAD_GL_AMD_texture_texture4; +#endif +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +GLAPI int GLAD_GL_SGIX_reference_plane; +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC)(const GLdouble* equation); +GLAPI PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; +#define glReferencePlaneSGIX glad_glReferencePlaneSGIX +#endif +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +GLAPI int GLAD_GL_EXT_stencil_two_side; +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC)(GLenum face); +GLAPI PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; +#define glActiveStencilFaceEXT glad_glActiveStencilFaceEXT +#endif +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 +GLAPI int GLAD_GL_ARB_transform_feedback_overflow_query; +#endif +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +GLAPI int GLAD_GL_SGIX_texture_lod_bias; +#endif +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 +GLAPI int GLAD_GL_KHR_no_error; +#endif +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +GLAPI int GLAD_GL_NV_explicit_multisample; +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC)(GLenum pname, GLuint index, GLfloat* val); +GLAPI PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; +#define glGetMultisamplefvNV glad_glGetMultisamplefvNV +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC)(GLuint index, GLbitfield mask); +GLAPI PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; +#define glSampleMaskIndexedNV glad_glSampleMaskIndexedNV +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; +#define glTexRenderbufferNV glad_glTexRenderbufferNV +#endif +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 +GLAPI int GLAD_GL_IBM_static_data; +typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC)(GLenum target); +GLAPI PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; +#define glFlushStaticDataIBM glad_glFlushStaticDataIBM +#endif +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +GLAPI int GLAD_GL_EXT_clip_volume_hint; +#endif +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +GLAPI int GLAD_GL_EXT_texture_perturb_normal; +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC)(GLenum mode); +GLAPI PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; +#define glTextureNormalEXT glad_glTextureNormalEXT +#endif +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +GLAPI int GLAD_GL_NV_fragment_program2; +#endif +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +GLAPI int GLAD_GL_NV_fragment_program4; +#endif +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +GLAPI int GLAD_GL_EXT_point_parameters; +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; +#define glPointParameterfEXT glad_glPointParameterfEXT +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; +#define glPointParameterfvEXT glad_glPointParameterfvEXT +#endif +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +GLAPI int GLAD_GL_PGI_misc_hints; +typedef void (APIENTRYP PFNGLHINTPGIPROC)(GLenum target, GLint mode); +GLAPI PFNGLHINTPGIPROC glad_glHintPGI; +#define glHintPGI glad_glHintPGI +#endif +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +GLAPI int GLAD_GL_SGIX_subsample; +#endif +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +GLAPI int GLAD_GL_AMD_shader_stencil_export; +#endif +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +GLAPI int GLAD_GL_ARB_shader_texture_lod; +#endif +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +GLAPI int GLAD_GL_ARB_vertex_shader; +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC)(GLhandleARB programObj, GLuint index, const GLcharARB* name); +GLAPI PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; +#define glBindAttribLocationARB glad_glBindAttribLocationARB +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); +GLAPI PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; +#define glGetActiveAttribARB glad_glGetActiveAttribARB +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); +GLAPI PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; +#define glGetAttribLocationARB glad_glGetAttribLocationARB +#endif +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +GLAPI int GLAD_GL_ARB_depth_clamp; +#endif +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 +GLAPI int GLAD_GL_SGIS_texture_select; +#endif +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +GLAPI int GLAD_GL_NV_texture_shader; +#endif +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +GLAPI int GLAD_GL_ARB_tessellation_shader; +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC)(GLenum pname, GLint value); +GLAPI PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; +#define glPatchParameteri glad_glPatchParameteri +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC)(GLenum pname, const GLfloat* values); +GLAPI PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; +#define glPatchParameterfv glad_glPatchParameterfv +#endif +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +GLAPI int GLAD_GL_EXT_draw_buffers2; +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; +#define glColorMaskIndexedEXT glad_glColorMaskIndexedEXT +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC)(GLenum target, GLuint index, GLboolean* data); +GLAPI PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; +#define glGetBooleanIndexedvEXT glad_glGetBooleanIndexedvEXT +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC)(GLenum target, GLuint index, GLint* data); +GLAPI PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; +#define glGetIntegerIndexedvEXT glad_glGetIntegerIndexedvEXT +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC)(GLenum target, GLuint index); +GLAPI PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; +#define glEnableIndexedEXT glad_glEnableIndexedEXT +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC)(GLenum target, GLuint index); +GLAPI PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; +#define glDisableIndexedEXT glad_glDisableIndexedEXT +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC)(GLenum target, GLuint index); +GLAPI PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; +#define glIsEnabledIndexedEXT glad_glIsEnabledIndexedEXT +#endif +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +GLAPI int GLAD_GL_ARB_vertex_attrib_64bit; +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; +#define glVertexAttribL1d glad_glVertexAttribL1d +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; +#define glVertexAttribL2d glad_glVertexAttribL2d +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; +#define glVertexAttribL3d glad_glVertexAttribL3d +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; +#define glVertexAttribL4d glad_glVertexAttribL4d +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; +#define glVertexAttribL1dv glad_glVertexAttribL1dv +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; +#define glVertexAttribL2dv glad_glVertexAttribL2dv +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; +#define glVertexAttribL3dv glad_glVertexAttribL3dv +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; +#define glVertexAttribL4dv glad_glVertexAttribL4dv +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; +#define glVertexAttribLPointer glad_glVertexAttribLPointer +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; +#define glGetVertexAttribLdv glad_glGetVertexAttribLdv +#endif +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 +GLAPI int GLAD_GL_EXT_texture_filter_minmax; +typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC)(GLuint samples, GLboolean fixedsamplelocations); +GLAPI PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; +#define glRasterSamplesEXT glad_glRasterSamplesEXT +#endif +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +GLAPI int GLAD_GL_WIN_specular_fog; +#endif +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 +GLAPI int GLAD_GL_AMD_interleaved_elements; +typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC)(GLuint index, GLenum pname, GLint param); +GLAPI PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; +#define glVertexAttribParameteriAMD glad_glVertexAttribParameteriAMD +#endif +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +GLAPI int GLAD_GL_ARB_fragment_program; +#endif +#ifndef GL_OML_resample +#define GL_OML_resample 1 +GLAPI int GLAD_GL_OML_resample; +#endif +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +GLAPI int GLAD_GL_APPLE_ycbcr_422; +#endif +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +GLAPI int GLAD_GL_SGIX_texture_add_env; +#endif +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +GLAPI int GLAD_GL_ARB_shadow_ambient; +#endif +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 +GLAPI int GLAD_GL_ARB_texture_storage; +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; +#define glTexStorage1D glad_glTexStorage1D +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; +#define glTexStorage2D glad_glTexStorage2D +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; +#define glTexStorage3D glad_glTexStorage3D +#endif +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +GLAPI int GLAD_GL_EXT_pixel_buffer_object; +#endif +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +GLAPI int GLAD_GL_ARB_copy_image; +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; +#define glCopyImageSubData glad_glCopyImageSubData +#endif +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +GLAPI int GLAD_GL_SGIS_pixel_texture; +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; +#define glPixelTexGenParameteriSGIS glad_glPixelTexGenParameteriSGIS +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; +#define glPixelTexGenParameterivSGIS glad_glPixelTexGenParameterivSGIS +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; +#define glPixelTexGenParameterfSGIS glad_glPixelTexGenParameterfSGIS +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; +#define glPixelTexGenParameterfvSGIS glad_glPixelTexGenParameterfvSGIS +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, GLint* params); +GLAPI PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; +#define glGetPixelTexGenParameterivSGIS glad_glGetPixelTexGenParameterivSGIS +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, GLfloat* params); +GLAPI PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; +#define glGetPixelTexGenParameterfvSGIS glad_glGetPixelTexGenParameterfvSGIS +#endif +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +GLAPI int GLAD_GL_SGIS_generate_mipmap; +#endif +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +GLAPI int GLAD_GL_SGIX_instruments; +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC)(); +GLAPI PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; +#define glGetInstrumentsSGIX glad_glGetInstrumentsSGIX +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC)(GLsizei size, GLint* buffer); +GLAPI PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; +#define glInstrumentsBufferSGIX glad_glInstrumentsBufferSGIX +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC)(GLint* marker_p); +GLAPI PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; +#define glPollInstrumentsSGIX glad_glPollInstrumentsSGIX +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC)(GLint marker); +GLAPI PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; +#define glReadInstrumentsSGIX glad_glReadInstrumentsSGIX +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC)(); +GLAPI PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; +#define glStartInstrumentsSGIX glad_glStartInstrumentsSGIX +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC)(GLint marker); +GLAPI PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; +#define glStopInstrumentsSGIX glad_glStopInstrumentsSGIX +#endif +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +GLAPI int GLAD_GL_HP_texture_lighting; +#endif +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +GLAPI int GLAD_GL_ARB_shader_storage_buffer_object; +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +GLAPI PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; +#define glShaderStorageBlockBinding glad_glShaderStorageBlockBinding +#endif +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 +GLAPI int GLAD_GL_EXT_sparse_texture2; +#endif +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +GLAPI int GLAD_GL_EXT_blend_minmax; +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC)(GLenum mode); +GLAPI PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; +#define glBlendEquationEXT glad_glBlendEquationEXT +#endif +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +GLAPI int GLAD_GL_MESA_pack_invert; +#endif +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 +GLAPI int GLAD_GL_ARB_base_instance; +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; +#define glDrawArraysInstancedBaseInstance glad_glDrawArraysInstancedBaseInstance +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLuint baseinstance); +GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; +#define glDrawElementsInstancedBaseInstance glad_glDrawElementsInstancedBaseInstance +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; +#define glDrawElementsInstancedBaseVertexBaseInstance glad_glDrawElementsInstancedBaseVertexBaseInstance +#endif +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +GLAPI int GLAD_GL_SGIX_convolution_accuracy; +#endif +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +GLAPI int GLAD_GL_PGI_vertex_hints; +#endif +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 +GLAPI int GLAD_GL_AMD_transform_feedback4; +#endif +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 +GLAPI int GLAD_GL_ARB_ES3_1_compatibility; +typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC)(GLbitfield barriers); +GLAPI PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; +#define glMemoryBarrierByRegion glad_glMemoryBarrierByRegion +#endif +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +GLAPI int GLAD_GL_EXT_texture_integer; +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; +#define glTexParameterIivEXT glad_glTexParameterIivEXT +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, const GLuint* params); +GLAPI PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; +#define glTexParameterIuivEXT glad_glTexParameterIuivEXT +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; +#define glGetTexParameterIivEXT glad_glGetTexParameterIivEXT +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, GLuint* params); +GLAPI PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; +#define glGetTexParameterIuivEXT glad_glGetTexParameterIuivEXT +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC)(GLint red, GLint green, GLint blue, GLint alpha); +GLAPI PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; +#define glClearColorIiEXT glad_glClearColorIiEXT +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; +#define glClearColorIuiEXT glad_glClearColorIuiEXT +#endif +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +GLAPI int GLAD_GL_ARB_texture_multisample; +#endif +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 +GLAPI int GLAD_GL_AMD_gpu_shader_int64; +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC)(GLint location, GLint64EXT x); +GLAPI PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; +#define glUniform1i64NV glad_glUniform1i64NV +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y); +GLAPI PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; +#define glUniform2i64NV glad_glUniform2i64NV +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; +#define glUniform3i64NV glad_glUniform3i64NV +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; +#define glUniform4i64NV glad_glUniform4i64NV +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; +#define glUniform1i64vNV glad_glUniform1i64vNV +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; +#define glUniform2i64vNV glad_glUniform2i64vNV +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; +#define glUniform3i64vNV glad_glUniform3i64vNV +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; +#define glUniform4i64vNV glad_glUniform4i64vNV +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC)(GLint location, GLuint64EXT x); +GLAPI PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; +#define glUniform1ui64NV glad_glUniform1ui64NV +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; +#define glUniform2ui64NV glad_glUniform2ui64NV +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; +#define glUniform3ui64NV glad_glUniform3ui64NV +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; +#define glUniform4ui64NV glad_glUniform4ui64NV +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; +#define glUniform1ui64vNV glad_glUniform1ui64vNV +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; +#define glUniform2ui64vNV glad_glUniform2ui64vNV +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; +#define glUniform3ui64vNV glad_glUniform3ui64vNV +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; +#define glUniform4ui64vNV glad_glUniform4ui64vNV +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC)(GLuint program, GLint location, GLint64EXT* params); +GLAPI PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; +#define glGetUniformi64vNV glad_glGetUniformi64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC)(GLuint program, GLint location, GLint64EXT x); +GLAPI PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; +#define glProgramUniform1i64NV glad_glProgramUniform1i64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; +#define glProgramUniform2i64NV glad_glProgramUniform2i64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; +#define glProgramUniform3i64NV glad_glProgramUniform3i64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; +#define glProgramUniform4i64NV glad_glProgramUniform4i64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; +#define glProgramUniform1i64vNV glad_glProgramUniform1i64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; +#define glProgramUniform2i64vNV glad_glProgramUniform2i64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; +#define glProgramUniform3i64vNV glad_glProgramUniform3i64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; +#define glProgramUniform4i64vNV glad_glProgramUniform4i64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x); +GLAPI PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; +#define glProgramUniform1ui64NV glad_glProgramUniform1ui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; +#define glProgramUniform2ui64NV glad_glProgramUniform2ui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; +#define glProgramUniform3ui64NV glad_glProgramUniform3ui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; +#define glProgramUniform4ui64NV glad_glProgramUniform4ui64NV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; +#define glProgramUniform1ui64vNV glad_glProgramUniform1ui64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; +#define glProgramUniform2ui64vNV glad_glProgramUniform2ui64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; +#define glProgramUniform3ui64vNV glad_glProgramUniform3ui64vNV +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +GLAPI PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; +#define glProgramUniform4ui64vNV glad_glProgramUniform4ui64vNV +#endif +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +GLAPI int GLAD_GL_S3_s3tc; +#endif +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 +GLAPI int GLAD_GL_ARB_query_buffer_object; +#endif +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 +GLAPI int GLAD_GL_AMD_vertex_shader_tessellator; +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC)(GLfloat factor); +GLAPI PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; +#define glTessellationFactorAMD glad_glTessellationFactorAMD +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC)(GLenum mode); +GLAPI PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; +#define glTessellationModeAMD glad_glTessellationModeAMD +#endif +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +GLAPI int GLAD_GL_ARB_invalidate_subdata; +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; +#define glInvalidateTexSubImage glad_glInvalidateTexSubImage +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC)(GLuint texture, GLint level); +GLAPI PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; +#define glInvalidateTexImage glad_glInvalidateTexImage +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; +#define glInvalidateBufferSubData glad_glInvalidateBufferSubData +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer); +GLAPI PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; +#define glInvalidateBufferData glad_glInvalidateBufferData +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments); +GLAPI PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; +#define glInvalidateFramebuffer glad_glInvalidateFramebuffer +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; +#define glInvalidateSubFramebuffer glad_glInvalidateSubFramebuffer +#endif +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +GLAPI int GLAD_GL_EXT_index_material; +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC)(GLenum face, GLenum mode); +GLAPI PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; +#define glIndexMaterialEXT glad_glIndexMaterialEXT +#endif +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 +GLAPI int GLAD_GL_NV_blend_equation_advanced_coherent; +#endif +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 +GLAPI int GLAD_GL_KHR_texture_compression_astc_sliced_3d; +#endif +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +GLAPI int GLAD_GL_INTEL_parallel_arrays; +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); +GLAPI PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; +#define glVertexPointervINTEL glad_glVertexPointervINTEL +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC)(GLenum type, const void** pointer); +GLAPI PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; +#define glNormalPointervINTEL glad_glNormalPointervINTEL +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); +GLAPI PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; +#define glColorPointervINTEL glad_glColorPointervINTEL +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); +GLAPI PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; +#define glTexCoordPointervINTEL glad_glTexCoordPointervINTEL +#endif +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +GLAPI int GLAD_GL_ATI_draw_buffers; +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC)(GLsizei n, const GLenum* bufs); +GLAPI PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; +#define glDrawBuffersATI glad_glDrawBuffersATI +#endif +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +GLAPI int GLAD_GL_EXT_cmyka; +#endif +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +GLAPI int GLAD_GL_SGIX_pixel_texture; +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC)(GLenum mode); +GLAPI PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; +#define glPixelTexGenSGIX glad_glPixelTexGenSGIX +#endif +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +GLAPI int GLAD_GL_APPLE_specular_vector; +#endif +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +GLAPI int GLAD_GL_ARB_compatibility; +#endif +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +GLAPI int GLAD_GL_ARB_timer_query; +#endif +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +GLAPI int GLAD_GL_SGIX_interlace; +#endif +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +GLAPI int GLAD_GL_NV_parameter_buffer_object; +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat* params); +GLAPI PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; +#define glProgramBufferParametersfvNV glad_glProgramBufferParametersfvNV +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint* params); +GLAPI PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; +#define glProgramBufferParametersIivNV glad_glProgramBufferParametersIivNV +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint* params); +GLAPI PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; +#define glProgramBufferParametersIuivNV glad_glProgramBufferParametersIuivNV +#endif +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 +GLAPI int GLAD_GL_AMD_shader_trinary_minmax; +#endif +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 +GLAPI int GLAD_GL_ARB_direct_state_access; +typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; +#define glCreateTransformFeedbacks glad_glCreateTransformFeedbacks +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)(GLuint xfb, GLuint index, GLuint buffer); +GLAPI PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; +#define glTransformFeedbackBufferBase glad_glTransformFeedbackBufferBase +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; +#define glTransformFeedbackBufferRange glad_glTransformFeedbackBufferRange +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC)(GLuint xfb, GLenum pname, GLint* param); +GLAPI PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; +#define glGetTransformFeedbackiv glad_glGetTransformFeedbackiv +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint* param); +GLAPI PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; +#define glGetTransformFeedbacki_v glad_glGetTransformFeedbacki_v +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint64* param); +GLAPI PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; +#define glGetTransformFeedbacki64_v glad_glGetTransformFeedbacki64_v +typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC)(GLsizei n, GLuint* buffers); +GLAPI PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; +#define glCreateBuffers glad_glCreateBuffers +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); +GLAPI PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; +#define glNamedBufferStorage glad_glNamedBufferStorage +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); +GLAPI PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; +#define glNamedBufferData glad_glNamedBufferData +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +GLAPI PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; +#define glNamedBufferSubData glad_glNamedBufferSubData +typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; +#define glCopyNamedBufferSubData glad_glCopyNamedBufferSubData +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; +#define glClearNamedBufferData glad_glClearNamedBufferData +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; +#define glClearNamedBufferSubData glad_glClearNamedBufferSubData +typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERPROC)(GLuint buffer, GLenum access); +GLAPI PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; +#define glMapNamedBuffer glad_glMapNamedBuffer +typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; +#define glMapNamedBufferRange glad_glMapNamedBufferRange +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC)(GLuint buffer); +GLAPI PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; +#define glUnmapNamedBuffer glad_glUnmapNamedBuffer +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; +#define glFlushMappedNamedBufferRange glad_glFlushMappedNamedBufferRange +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC)(GLuint buffer, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; +#define glGetNamedBufferParameteriv glad_glGetNamedBufferParameteriv +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)(GLuint buffer, GLenum pname, GLint64* params); +GLAPI PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; +#define glGetNamedBufferParameteri64v glad_glGetNamedBufferParameteri64v +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC)(GLuint buffer, GLenum pname, void** params); +GLAPI PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; +#define glGetNamedBufferPointerv glad_glGetNamedBufferPointerv +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +GLAPI PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; +#define glGetNamedBufferSubData glad_glGetNamedBufferSubData +typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); +GLAPI PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; +#define glCreateFramebuffers glad_glCreateFramebuffers +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; +#define glNamedFramebufferRenderbuffer glad_glNamedFramebufferRenderbuffer +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)(GLuint framebuffer, GLenum pname, GLint param); +GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; +#define glNamedFramebufferParameteri glad_glNamedFramebufferParameteri +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; +#define glNamedFramebufferTexture glad_glNamedFramebufferTexture +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; +#define glNamedFramebufferTextureLayer glad_glNamedFramebufferTextureLayer +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)(GLuint framebuffer, GLenum buf); +GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; +#define glNamedFramebufferDrawBuffer glad_glNamedFramebufferDrawBuffer +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); +GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; +#define glNamedFramebufferDrawBuffers glad_glNamedFramebufferDrawBuffers +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)(GLuint framebuffer, GLenum src); +GLAPI PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; +#define glNamedFramebufferReadBuffer glad_glNamedFramebufferReadBuffer +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); +GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; +#define glInvalidateNamedFramebufferData glad_glInvalidateNamedFramebufferData +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; +#define glInvalidateNamedFramebufferSubData glad_glInvalidateNamedFramebufferSubData +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); +GLAPI PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; +#define glClearNamedFramebufferiv glad_glClearNamedFramebufferiv +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); +GLAPI PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; +#define glClearNamedFramebufferuiv glad_glClearNamedFramebufferuiv +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); +GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; +#define glClearNamedFramebufferfv glad_glClearNamedFramebufferfv +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; +#define glClearNamedFramebufferfi glad_glClearNamedFramebufferfi +typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; +#define glBlitNamedFramebuffer glad_glBlitNamedFramebuffer +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)(GLuint framebuffer, GLenum target); +GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; +#define glCheckNamedFramebufferStatus glad_glCheckNamedFramebufferStatus +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)(GLuint framebuffer, GLenum pname, GLint* param); +GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; +#define glGetNamedFramebufferParameteriv glad_glGetNamedFramebufferParameteriv +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; +#define glGetNamedFramebufferAttachmentParameteriv glad_glGetNamedFramebufferAttachmentParameteriv +typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); +GLAPI PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; +#define glCreateRenderbuffers glad_glCreateRenderbuffers +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; +#define glNamedRenderbufferStorage glad_glNamedRenderbufferStorage +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; +#define glNamedRenderbufferStorageMultisample glad_glNamedRenderbufferStorageMultisample +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)(GLuint renderbuffer, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; +#define glGetNamedRenderbufferParameteriv glad_glGetNamedRenderbufferParameteriv +typedef void (APIENTRYP PFNGLCREATETEXTURESPROC)(GLenum target, GLsizei n, GLuint* textures); +GLAPI PFNGLCREATETEXTURESPROC glad_glCreateTextures; +#define glCreateTextures glad_glCreateTextures +typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC)(GLuint texture, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; +#define glTextureBuffer glad_glTextureBuffer +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; +#define glTextureBufferRange glad_glTextureBufferRange +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; +#define glTextureStorage1D glad_glTextureStorage1D +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; +#define glTextureStorage2D glad_glTextureStorage2D +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; +#define glTextureStorage3D glad_glTextureStorage3D +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; +#define glTextureStorage2DMultisample glad_glTextureStorage2DMultisample +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; +#define glTextureStorage3DMultisample glad_glTextureStorage3DMultisample +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; +#define glTextureSubImage1D glad_glTextureSubImage1D +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; +#define glTextureSubImage2D glad_glTextureSubImage2D +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; +#define glTextureSubImage3D glad_glTextureSubImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; +#define glCompressedTextureSubImage1D glad_glCompressedTextureSubImage1D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; +#define glCompressedTextureSubImage2D glad_glCompressedTextureSubImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; +#define glCompressedTextureSubImage3D glad_glCompressedTextureSubImage3D +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; +#define glCopyTextureSubImage1D glad_glCopyTextureSubImage1D +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; +#define glCopyTextureSubImage2D glad_glCopyTextureSubImage2D +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; +#define glCopyTextureSubImage3D glad_glCopyTextureSubImage3D +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC)(GLuint texture, GLenum pname, GLfloat param); +GLAPI PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; +#define glTextureParameterf glad_glTextureParameterf +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, const GLfloat* param); +GLAPI PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; +#define glTextureParameterfv glad_glTextureParameterfv +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC)(GLuint texture, GLenum pname, GLint param); +GLAPI PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; +#define glTextureParameteri glad_glTextureParameteri +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, const GLint* params); +GLAPI PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; +#define glTextureParameterIiv glad_glTextureParameterIiv +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, const GLuint* params); +GLAPI PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; +#define glTextureParameterIuiv glad_glTextureParameterIuiv +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, const GLint* param); +GLAPI PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; +#define glTextureParameteriv glad_glTextureParameteriv +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC)(GLuint texture); +GLAPI PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; +#define glGenerateTextureMipmap glad_glGenerateTextureMipmap +typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC)(GLuint unit, GLuint texture); +GLAPI PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; +#define glBindTextureUnit glad_glBindTextureUnit +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels); +GLAPI PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; +#define glGetTextureImage glad_glGetTextureImage +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLsizei bufSize, void* pixels); +GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; +#define glGetCompressedTextureImage glad_glGetCompressedTextureImage +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC)(GLuint texture, GLint level, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; +#define glGetTextureLevelParameterfv glad_glGetTextureLevelParameterfv +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC)(GLuint texture, GLint level, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; +#define glGetTextureLevelParameteriv glad_glGetTextureLevelParameteriv +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; +#define glGetTextureParameterfv glad_glGetTextureParameterfv +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; +#define glGetTextureParameterIiv glad_glGetTextureParameterIiv +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, GLuint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; +#define glGetTextureParameterIuiv glad_glGetTextureParameterIuiv +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; +#define glGetTextureParameteriv glad_glGetTextureParameteriv +typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); +GLAPI PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; +#define glCreateVertexArrays glad_glCreateVertexArrays +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); +GLAPI PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; +#define glDisableVertexArrayAttrib glad_glDisableVertexArrayAttrib +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); +GLAPI PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; +#define glEnableVertexArrayAttrib glad_glEnableVertexArrayAttrib +typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint vaobj, GLuint buffer); +GLAPI PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; +#define glVertexArrayElementBuffer glad_glVertexArrayElementBuffer +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; +#define glVertexArrayVertexBuffer glad_glVertexArrayVertexBuffer +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); +GLAPI PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; +#define glVertexArrayVertexBuffers glad_glVertexArrayVertexBuffers +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; +#define glVertexArrayAttribBinding glad_glVertexArrayAttribBinding +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; +#define glVertexArrayAttribFormat glad_glVertexArrayAttribFormat +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; +#define glVertexArrayAttribIFormat glad_glVertexArrayAttribIFormat +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; +#define glVertexArrayAttribLFormat glad_glVertexArrayAttribLFormat +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; +#define glVertexArrayBindingDivisor glad_glVertexArrayBindingDivisor +typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC)(GLuint vaobj, GLenum pname, GLint* param); +GLAPI PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; +#define glGetVertexArrayiv glad_glGetVertexArrayiv +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); +GLAPI PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; +#define glGetVertexArrayIndexediv glad_glGetVertexArrayIndexediv +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint64* param); +GLAPI PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; +#define glGetVertexArrayIndexed64iv glad_glGetVertexArrayIndexed64iv +typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC)(GLsizei n, GLuint* samplers); +GLAPI PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; +#define glCreateSamplers glad_glCreateSamplers +typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); +GLAPI PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; +#define glCreateProgramPipelines glad_glCreateProgramPipelines +typedef void (APIENTRYP PFNGLCREATEQUERIESPROC)(GLenum target, GLsizei n, GLuint* ids); +GLAPI PFNGLCREATEQUERIESPROC glad_glCreateQueries; +#define glCreateQueries glad_glCreateQueries +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; +#define glGetQueryBufferObjecti64v glad_glGetQueryBufferObjecti64v +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; +#define glGetQueryBufferObjectiv glad_glGetQueryBufferObjectiv +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; +#define glGetQueryBufferObjectui64v glad_glGetQueryBufferObjectui64v +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; +#define glGetQueryBufferObjectuiv glad_glGetQueryBufferObjectuiv +#endif +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +GLAPI int GLAD_GL_EXT_rescale_normal; +#endif +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +GLAPI int GLAD_GL_ARB_pixel_buffer_object; +#endif +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +GLAPI int GLAD_GL_ARB_uniform_buffer_object; +#endif +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 +GLAPI int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; +#endif +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +GLAPI int GLAD_GL_ARB_texture_swizzle; +#endif +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +GLAPI int GLAD_GL_NV_transform_feedback2; +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC)(GLenum target, GLuint id); +GLAPI PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; +#define glBindTransformFeedbackNV glad_glBindTransformFeedbackNV +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC)(GLsizei n, const GLuint* ids); +GLAPI PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; +#define glDeleteTransformFeedbacksNV glad_glDeleteTransformFeedbacksNV +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; +#define glGenTransformFeedbacksNV glad_glGenTransformFeedbacksNV +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC)(GLuint id); +GLAPI PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; +#define glIsTransformFeedbackNV glad_glIsTransformFeedbackNV +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC)(); +GLAPI PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; +#define glPauseTransformFeedbackNV glad_glPauseTransformFeedbackNV +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC)(); +GLAPI PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; +#define glResumeTransformFeedbackNV glad_glResumeTransformFeedbackNV +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC)(GLenum mode, GLuint id); +GLAPI PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; +#define glDrawTransformFeedbackNV glad_glDrawTransformFeedbackNV +#endif +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +GLAPI int GLAD_GL_SGIX_async_pixel; +#endif +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +GLAPI int GLAD_GL_NV_fragment_program_option; +#endif +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +GLAPI int GLAD_GL_ARB_explicit_attrib_location; +#endif +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +GLAPI int GLAD_GL_EXT_blend_color; +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; +#define glBlendColorEXT glad_glBlendColorEXT +#endif +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 +GLAPI int GLAD_GL_NV_shader_thread_group; +#endif +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +GLAPI int GLAD_GL_EXT_stencil_wrap; +#endif +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +GLAPI int GLAD_GL_EXT_index_array_formats; +#endif +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 +GLAPI int GLAD_GL_OVR_multiview2; +#endif +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +GLAPI int GLAD_GL_EXT_histogram; +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +GLAPI PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; +#define glGetHistogramEXT glad_glGetHistogramEXT +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; +#define glGetHistogramParameterfvEXT glad_glGetHistogramParameterfvEXT +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; +#define glGetHistogramParameterivEXT glad_glGetHistogramParameterivEXT +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +GLAPI PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; +#define glGetMinmaxEXT glad_glGetMinmaxEXT +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; +#define glGetMinmaxParameterfvEXT glad_glGetMinmaxParameterfvEXT +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; +#define glGetMinmaxParameterivEXT glad_glGetMinmaxParameterivEXT +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; +#define glHistogramEXT glad_glHistogramEXT +typedef void (APIENTRYP PFNGLMINMAXEXTPROC)(GLenum target, GLenum internalformat, GLboolean sink); +GLAPI PFNGLMINMAXEXTPROC glad_glMinmaxEXT; +#define glMinmaxEXT glad_glMinmaxEXT +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC)(GLenum target); +GLAPI PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; +#define glResetHistogramEXT glad_glResetHistogramEXT +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC)(GLenum target); +GLAPI PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; +#define glResetMinmaxEXT glad_glResetMinmaxEXT +#endif +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 +GLAPI int GLAD_GL_ARB_get_texture_sub_image; +typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void* pixels); +GLAPI PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; +#define glGetTextureSubImage glad_glGetTextureSubImage +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void* pixels); +GLAPI PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; +#define glGetCompressedTextureSubImage glad_glGetCompressedTextureSubImage +#endif +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +GLAPI int GLAD_GL_SGIS_point_parameters; +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; +#define glPointParameterfSGIS glad_glPointParameterfSGIS +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; +#define glPointParameterfvSGIS glad_glPointParameterfvSGIS +#endif +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +GLAPI int GLAD_GL_SGIX_ycrcb; +#endif +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +GLAPI int GLAD_GL_EXT_direct_state_access; +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC)(GLenum mode, const GLfloat* m); +GLAPI PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; +#define glMatrixLoadfEXT glad_glMatrixLoadfEXT +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC)(GLenum mode, const GLdouble* m); +GLAPI PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; +#define glMatrixLoaddEXT glad_glMatrixLoaddEXT +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC)(GLenum mode, const GLfloat* m); +GLAPI PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; +#define glMatrixMultfEXT glad_glMatrixMultfEXT +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC)(GLenum mode, const GLdouble* m); +GLAPI PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; +#define glMatrixMultdEXT glad_glMatrixMultdEXT +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC)(GLenum mode); +GLAPI PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; +#define glMatrixLoadIdentityEXT glad_glMatrixLoadIdentityEXT +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC)(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; +#define glMatrixRotatefEXT glad_glMatrixRotatefEXT +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC)(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; +#define glMatrixRotatedEXT glad_glMatrixRotatedEXT +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; +#define glMatrixScalefEXT glad_glMatrixScalefEXT +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; +#define glMatrixScaledEXT glad_glMatrixScaledEXT +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; +#define glMatrixTranslatefEXT glad_glMatrixTranslatefEXT +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; +#define glMatrixTranslatedEXT glad_glMatrixTranslatedEXT +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; +#define glMatrixFrustumEXT glad_glMatrixFrustumEXT +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; +#define glMatrixOrthoEXT glad_glMatrixOrthoEXT +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC)(GLenum mode); +GLAPI PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; +#define glMatrixPopEXT glad_glMatrixPopEXT +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC)(GLenum mode); +GLAPI PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; +#define glMatrixPushEXT glad_glMatrixPushEXT +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); +GLAPI PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; +#define glClientAttribDefaultEXT glad_glClientAttribDefaultEXT +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); +GLAPI PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; +#define glPushClientAttribDefaultEXT glad_glPushClientAttribDefaultEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; +#define glTextureParameterfEXT glad_glTextureParameterfEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; +#define glTextureParameterfvEXT glad_glTextureParameterfvEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; +#define glTextureParameteriEXT glad_glTextureParameteriEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; +#define glTextureParameterivEXT glad_glTextureParameterivEXT +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; +#define glTextureImage1DEXT glad_glTextureImage1DEXT +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; +#define glTextureImage2DEXT glad_glTextureImage2DEXT +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; +#define glTextureSubImage1DEXT glad_glTextureSubImage1DEXT +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; +#define glTextureSubImage2DEXT glad_glTextureSubImage2DEXT +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; +#define glCopyTextureImage1DEXT glad_glCopyTextureImage1DEXT +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; +#define glCopyTextureImage2DEXT glad_glCopyTextureImage2DEXT +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; +#define glCopyTextureSubImage1DEXT glad_glCopyTextureSubImage1DEXT +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; +#define glCopyTextureSubImage2DEXT glad_glCopyTextureSubImage2DEXT +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +GLAPI PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; +#define glGetTextureImageEXT glad_glGetTextureImageEXT +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; +#define glGetTextureParameterfvEXT glad_glGetTextureParameterfvEXT +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; +#define glGetTextureParameterivEXT glad_glGetTextureParameterivEXT +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +GLAPI PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; +#define glGetTextureLevelParameterfvEXT glad_glGetTextureLevelParameterfvEXT +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; +#define glGetTextureLevelParameterivEXT glad_glGetTextureLevelParameterivEXT +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; +#define glTextureImage3DEXT glad_glTextureImage3DEXT +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; +#define glTextureSubImage3DEXT glad_glTextureSubImage3DEXT +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; +#define glCopyTextureSubImage3DEXT glad_glCopyTextureSubImage3DEXT +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC)(GLenum texunit, GLenum target, GLuint texture); +GLAPI PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; +#define glBindMultiTextureEXT glad_glBindMultiTextureEXT +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC)(GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; +#define glMultiTexCoordPointerEXT glad_glMultiTexCoordPointerEXT +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; +#define glMultiTexEnvfEXT glad_glMultiTexEnvfEXT +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; +#define glMultiTexEnvfvEXT glad_glMultiTexEnvfvEXT +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; +#define glMultiTexEnviEXT glad_glMultiTexEnviEXT +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; +#define glMultiTexEnvivEXT glad_glMultiTexEnvivEXT +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; +#define glMultiTexGendEXT glad_glMultiTexGendEXT +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +GLAPI PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; +#define glMultiTexGendvEXT glad_glMultiTexGendvEXT +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; +#define glMultiTexGenfEXT glad_glMultiTexGenfEXT +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +GLAPI PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; +#define glMultiTexGenfvEXT glad_glMultiTexGenfvEXT +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; +#define glMultiTexGeniEXT glad_glMultiTexGeniEXT +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +GLAPI PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; +#define glMultiTexGenivEXT glad_glMultiTexGenivEXT +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; +#define glGetMultiTexEnvfvEXT glad_glGetMultiTexEnvfvEXT +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; +#define glGetMultiTexEnvivEXT glad_glGetMultiTexEnvivEXT +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +GLAPI PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; +#define glGetMultiTexGendvEXT glad_glGetMultiTexGendvEXT +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; +#define glGetMultiTexGenfvEXT glad_glGetMultiTexGenfvEXT +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint* params); +GLAPI PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; +#define glGetMultiTexGenivEXT glad_glGetMultiTexGenivEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; +#define glMultiTexParameteriEXT glad_glMultiTexParameteriEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; +#define glMultiTexParameterivEXT glad_glMultiTexParameterivEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; +#define glMultiTexParameterfEXT glad_glMultiTexParameterfEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; +#define glMultiTexParameterfvEXT glad_glMultiTexParameterfvEXT +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; +#define glMultiTexImage1DEXT glad_glMultiTexImage1DEXT +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; +#define glMultiTexImage2DEXT glad_glMultiTexImage2DEXT +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; +#define glMultiTexSubImage1DEXT glad_glMultiTexSubImage1DEXT +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; +#define glMultiTexSubImage2DEXT glad_glMultiTexSubImage2DEXT +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; +#define glCopyMultiTexImage1DEXT glad_glCopyMultiTexImage1DEXT +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; +#define glCopyMultiTexImage2DEXT glad_glCopyMultiTexImage2DEXT +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; +#define glCopyMultiTexSubImage1DEXT glad_glCopyMultiTexSubImage1DEXT +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; +#define glCopyMultiTexSubImage2DEXT glad_glCopyMultiTexSubImage2DEXT +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +GLAPI PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; +#define glGetMultiTexImageEXT glad_glGetMultiTexImageEXT +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; +#define glGetMultiTexParameterfvEXT glad_glGetMultiTexParameterfvEXT +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; +#define glGetMultiTexParameterivEXT glad_glGetMultiTexParameterivEXT +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; +#define glGetMultiTexLevelParameterfvEXT glad_glGetMultiTexLevelParameterfvEXT +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +GLAPI PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; +#define glGetMultiTexLevelParameterivEXT glad_glGetMultiTexLevelParameterivEXT +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; +#define glMultiTexImage3DEXT glad_glMultiTexImage3DEXT +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; +#define glMultiTexSubImage3DEXT glad_glMultiTexSubImage3DEXT +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; +#define glCopyMultiTexSubImage3DEXT glad_glCopyMultiTexSubImage3DEXT +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); +GLAPI PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; +#define glEnableClientStateIndexedEXT glad_glEnableClientStateIndexedEXT +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); +GLAPI PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; +#define glDisableClientStateIndexedEXT glad_glDisableClientStateIndexedEXT +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC)(GLenum target, GLuint index, GLfloat* data); +GLAPI PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; +#define glGetFloatIndexedvEXT glad_glGetFloatIndexedvEXT +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC)(GLenum target, GLuint index, GLdouble* data); +GLAPI PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; +#define glGetDoubleIndexedvEXT glad_glGetDoubleIndexedvEXT +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC)(GLenum target, GLuint index, void** data); +GLAPI PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; +#define glGetPointerIndexedvEXT glad_glGetPointerIndexedvEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; +#define glCompressedTextureImage3DEXT glad_glCompressedTextureImage3DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; +#define glCompressedTextureImage2DEXT glad_glCompressedTextureImage2DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; +#define glCompressedTextureImage1DEXT glad_glCompressedTextureImage1DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; +#define glCompressedTextureSubImage3DEXT glad_glCompressedTextureSubImage3DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; +#define glCompressedTextureSubImage2DEXT glad_glCompressedTextureSubImage2DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; +#define glCompressedTextureSubImage1DEXT glad_glCompressedTextureSubImage1DEXT +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint lod, void* img); +GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; +#define glGetCompressedTextureImageEXT glad_glGetCompressedTextureImageEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; +#define glCompressedMultiTexImage3DEXT glad_glCompressedMultiTexImage3DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; +#define glCompressedMultiTexImage2DEXT glad_glCompressedMultiTexImage2DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; +#define glCompressedMultiTexImage1DEXT glad_glCompressedMultiTexImage1DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; +#define glCompressedMultiTexSubImage3DEXT glad_glCompressedMultiTexSubImage3DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; +#define glCompressedMultiTexSubImage2DEXT glad_glCompressedMultiTexSubImage2DEXT +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); +GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; +#define glCompressedMultiTexSubImage1DEXT glad_glCompressedMultiTexSubImage1DEXT +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint lod, void* img); +GLAPI PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; +#define glGetCompressedMultiTexImageEXT glad_glGetCompressedMultiTexImageEXT +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); +GLAPI PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; +#define glMatrixLoadTransposefEXT glad_glMatrixLoadTransposefEXT +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); +GLAPI PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; +#define glMatrixLoadTransposedEXT glad_glMatrixLoadTransposedEXT +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); +GLAPI PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; +#define glMatrixMultTransposefEXT glad_glMatrixMultTransposefEXT +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); +GLAPI PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; +#define glMatrixMultTransposedEXT glad_glMatrixMultTransposedEXT +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); +GLAPI PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; +#define glNamedBufferDataEXT glad_glNamedBufferDataEXT +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +GLAPI PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; +#define glNamedBufferSubDataEXT glad_glNamedBufferSubDataEXT +typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC)(GLuint buffer, GLenum access); +GLAPI PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; +#define glMapNamedBufferEXT glad_glMapNamedBufferEXT +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC)(GLuint buffer); +GLAPI PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; +#define glUnmapNamedBufferEXT glad_glUnmapNamedBufferEXT +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)(GLuint buffer, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; +#define glGetNamedBufferParameterivEXT glad_glGetNamedBufferParameterivEXT +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)(GLuint buffer, GLenum pname, void** params); +GLAPI PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; +#define glGetNamedBufferPointervEXT glad_glGetNamedBufferPointervEXT +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +GLAPI PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; +#define glGetNamedBufferSubDataEXT glad_glGetNamedBufferSubDataEXT +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; +#define glTextureBufferEXT glad_glTextureBufferEXT +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC)(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; +#define glMultiTexBufferEXT glad_glMultiTexBufferEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; +#define glTextureParameterIivEXT glad_glTextureParameterIivEXT +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLuint* params); +GLAPI PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; +#define glTextureParameterIuivEXT glad_glTextureParameterIuivEXT +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; +#define glGetTextureParameterIivEXT glad_glGetTextureParameterIivEXT +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLuint* params); +GLAPI PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; +#define glGetTextureParameterIuivEXT glad_glGetTextureParameterIuivEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; +#define glMultiTexParameterIivEXT glad_glMultiTexParameterIivEXT +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +GLAPI PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; +#define glMultiTexParameterIuivEXT glad_glMultiTexParameterIuivEXT +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; +#define glGetMultiTexParameterIivEXT glad_glGetMultiTexParameterIivEXT +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLuint* params); +GLAPI PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; +#define glGetMultiTexParameterIuivEXT glad_glGetMultiTexParameterIuivEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; +#define glNamedProgramLocalParameters4fvEXT glad_glNamedProgramLocalParameters4fvEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; +#define glNamedProgramLocalParameterI4iEXT glad_glNamedProgramLocalParameterI4iEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLint* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; +#define glNamedProgramLocalParameterI4ivEXT glad_glNamedProgramLocalParameterI4ivEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; +#define glNamedProgramLocalParametersI4ivEXT glad_glNamedProgramLocalParametersI4ivEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; +#define glNamedProgramLocalParameterI4uiEXT glad_glNamedProgramLocalParameterI4uiEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLuint* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; +#define glNamedProgramLocalParameterI4uivEXT glad_glNamedProgramLocalParameterI4uivEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; +#define glNamedProgramLocalParametersI4uivEXT glad_glNamedProgramLocalParametersI4uivEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLint* params); +GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; +#define glGetNamedProgramLocalParameterIivEXT glad_glGetNamedProgramLocalParameterIivEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint* params); +GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; +#define glGetNamedProgramLocalParameterIuivEXT glad_glGetNamedProgramLocalParameterIuivEXT +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); +GLAPI PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; +#define glEnableClientStateiEXT glad_glEnableClientStateiEXT +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); +GLAPI PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; +#define glDisableClientStateiEXT glad_glDisableClientStateiEXT +typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC)(GLenum pname, GLuint index, GLfloat* params); +GLAPI PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; +#define glGetFloati_vEXT glad_glGetFloati_vEXT +typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC)(GLenum pname, GLuint index, GLdouble* params); +GLAPI PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; +#define glGetDoublei_vEXT glad_glGetDoublei_vEXT +typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC)(GLenum pname, GLuint index, void** params); +GLAPI PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; +#define glGetPointeri_vEXT glad_glGetPointeri_vEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); +GLAPI PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; +#define glNamedProgramStringEXT glad_glNamedProgramStringEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; +#define glNamedProgramLocalParameter4dEXT glad_glNamedProgramLocalParameter4dEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLdouble* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; +#define glNamedProgramLocalParameter4dvEXT glad_glNamedProgramLocalParameter4dvEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; +#define glNamedProgramLocalParameter4fEXT glad_glNamedProgramLocalParameter4fEXT +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLfloat* params); +GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; +#define glNamedProgramLocalParameter4fvEXT glad_glNamedProgramLocalParameter4fvEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble* params); +GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; +#define glGetNamedProgramLocalParameterdvEXT glad_glGetNamedProgramLocalParameterdvEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat* params); +GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; +#define glGetNamedProgramLocalParameterfvEXT glad_glGetNamedProgramLocalParameterfvEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC)(GLuint program, GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; +#define glGetNamedProgramivEXT glad_glGetNamedProgramivEXT +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum pname, void* string); +GLAPI PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; +#define glGetNamedProgramStringEXT glad_glGetNamedProgramStringEXT +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; +#define glNamedRenderbufferStorageEXT glad_glNamedRenderbufferStorageEXT +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)(GLuint renderbuffer, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; +#define glGetNamedRenderbufferParameterivEXT glad_glGetNamedRenderbufferParameterivEXT +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; +#define glNamedRenderbufferStorageMultisampleEXT glad_glNamedRenderbufferStorageMultisampleEXT +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; +#define glNamedRenderbufferStorageMultisampleCoverageEXT glad_glNamedRenderbufferStorageMultisampleCoverageEXT +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)(GLuint framebuffer, GLenum target); +GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; +#define glCheckNamedFramebufferStatusEXT glad_glCheckNamedFramebufferStatusEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; +#define glNamedFramebufferTexture1DEXT glad_glNamedFramebufferTexture1DEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; +#define glNamedFramebufferTexture2DEXT glad_glNamedFramebufferTexture2DEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; +#define glNamedFramebufferTexture3DEXT glad_glNamedFramebufferTexture3DEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; +#define glNamedFramebufferRenderbufferEXT glad_glNamedFramebufferRenderbufferEXT +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; +#define glGetNamedFramebufferAttachmentParameterivEXT glad_glGetNamedFramebufferAttachmentParameterivEXT +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC)(GLuint texture, GLenum target); +GLAPI PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; +#define glGenerateTextureMipmapEXT glad_glGenerateTextureMipmapEXT +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC)(GLenum texunit, GLenum target); +GLAPI PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; +#define glGenerateMultiTexMipmapEXT glad_glGenerateMultiTexMipmapEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); +GLAPI PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; +#define glFramebufferDrawBufferEXT glad_glFramebufferDrawBufferEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); +GLAPI PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; +#define glFramebufferDrawBuffersEXT glad_glFramebufferDrawBuffersEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); +GLAPI PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; +#define glFramebufferReadBufferEXT glad_glFramebufferReadBufferEXT +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; +#define glGetFramebufferParameterivEXT glad_glGetFramebufferParameterivEXT +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; +#define glNamedCopyBufferSubDataEXT glad_glNamedCopyBufferSubDataEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; +#define glNamedFramebufferTextureEXT glad_glNamedFramebufferTextureEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; +#define glNamedFramebufferTextureLayerEXT glad_glNamedFramebufferTextureLayerEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; +#define glNamedFramebufferTextureFaceEXT glad_glNamedFramebufferTextureFaceEXT +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC)(GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; +#define glTextureRenderbufferEXT glad_glTextureRenderbufferEXT +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC)(GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; +#define glMultiTexRenderbufferEXT glad_glMultiTexRenderbufferEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; +#define glVertexArrayVertexOffsetEXT glad_glVertexArrayVertexOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; +#define glVertexArrayColorOffsetEXT glad_glVertexArrayColorOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; +#define glVertexArrayEdgeFlagOffsetEXT glad_glVertexArrayEdgeFlagOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; +#define glVertexArrayIndexOffsetEXT glad_glVertexArrayIndexOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; +#define glVertexArrayNormalOffsetEXT glad_glVertexArrayNormalOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; +#define glVertexArrayTexCoordOffsetEXT glad_glVertexArrayTexCoordOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; +#define glVertexArrayMultiTexCoordOffsetEXT glad_glVertexArrayMultiTexCoordOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; +#define glVertexArrayFogCoordOffsetEXT glad_glVertexArrayFogCoordOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; +#define glVertexArraySecondaryColorOffsetEXT glad_glVertexArraySecondaryColorOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; +#define glVertexArrayVertexAttribOffsetEXT glad_glVertexArrayVertexAttribOffsetEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; +#define glVertexArrayVertexAttribIOffsetEXT glad_glVertexArrayVertexAttribIOffsetEXT +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); +GLAPI PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; +#define glEnableVertexArrayEXT glad_glEnableVertexArrayEXT +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); +GLAPI PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; +#define glDisableVertexArrayEXT glad_glDisableVertexArrayEXT +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); +GLAPI PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; +#define glEnableVertexArrayAttribEXT glad_glEnableVertexArrayAttribEXT +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); +GLAPI PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; +#define glDisableVertexArrayAttribEXT glad_glDisableVertexArrayAttribEXT +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC)(GLuint vaobj, GLenum pname, GLint* param); +GLAPI PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; +#define glGetVertexArrayIntegervEXT glad_glGetVertexArrayIntegervEXT +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC)(GLuint vaobj, GLenum pname, void** param); +GLAPI PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; +#define glGetVertexArrayPointervEXT glad_glGetVertexArrayPointervEXT +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); +GLAPI PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; +#define glGetVertexArrayIntegeri_vEXT glad_glGetVertexArrayIntegeri_vEXT +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, void** param); +GLAPI PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; +#define glGetVertexArrayPointeri_vEXT glad_glGetVertexArrayPointeri_vEXT +typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; +#define glMapNamedBufferRangeEXT glad_glMapNamedBufferRangeEXT +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; +#define glFlushMappedNamedBufferRangeEXT glad_glFlushMappedNamedBufferRangeEXT +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); +GLAPI PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; +#define glNamedBufferStorageEXT glad_glNamedBufferStorageEXT +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; +#define glClearNamedBufferDataEXT glad_glClearNamedBufferDataEXT +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; +#define glClearNamedBufferSubDataEXT glad_glClearNamedBufferSubDataEXT +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)(GLuint framebuffer, GLenum pname, GLint param); +GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; +#define glNamedFramebufferParameteriEXT glad_glNamedFramebufferParameteriEXT +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; +#define glGetNamedFramebufferParameterivEXT glad_glGetNamedFramebufferParameterivEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC)(GLuint program, GLint location, GLdouble x); +GLAPI PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; +#define glProgramUniform1dEXT glad_glProgramUniform1dEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; +#define glProgramUniform2dEXT glad_glProgramUniform2dEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; +#define glProgramUniform3dEXT glad_glProgramUniform3dEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; +#define glProgramUniform4dEXT glad_glProgramUniform4dEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; +#define glProgramUniform1dvEXT glad_glProgramUniform1dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; +#define glProgramUniform2dvEXT glad_glProgramUniform2dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; +#define glProgramUniform3dvEXT glad_glProgramUniform3dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; +#define glProgramUniform4dvEXT glad_glProgramUniform4dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; +#define glProgramUniformMatrix2dvEXT glad_glProgramUniformMatrix2dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; +#define glProgramUniformMatrix3dvEXT glad_glProgramUniformMatrix3dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; +#define glProgramUniformMatrix4dvEXT glad_glProgramUniformMatrix4dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; +#define glProgramUniformMatrix2x3dvEXT glad_glProgramUniformMatrix2x3dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; +#define glProgramUniformMatrix2x4dvEXT glad_glProgramUniformMatrix2x4dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; +#define glProgramUniformMatrix3x2dvEXT glad_glProgramUniformMatrix3x2dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; +#define glProgramUniformMatrix3x4dvEXT glad_glProgramUniformMatrix3x4dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; +#define glProgramUniformMatrix4x2dvEXT glad_glProgramUniformMatrix4x2dvEXT +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; +#define glProgramUniformMatrix4x3dvEXT glad_glProgramUniformMatrix4x3dvEXT +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; +#define glTextureBufferRangeEXT glad_glTextureBufferRangeEXT +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; +#define glTextureStorage1DEXT glad_glTextureStorage1DEXT +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; +#define glTextureStorage2DEXT glad_glTextureStorage2DEXT +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; +#define glTextureStorage3DEXT glad_glTextureStorage3DEXT +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; +#define glTextureStorage2DMultisampleEXT glad_glTextureStorage2DMultisampleEXT +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; +#define glTextureStorage3DMultisampleEXT glad_glTextureStorage3DMultisampleEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; +#define glVertexArrayBindVertexBufferEXT glad_glVertexArrayBindVertexBufferEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; +#define glVertexArrayVertexAttribFormatEXT glad_glVertexArrayVertexAttribFormatEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; +#define glVertexArrayVertexAttribIFormatEXT glad_glVertexArrayVertexAttribIFormatEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; +#define glVertexArrayVertexAttribLFormatEXT glad_glVertexArrayVertexAttribLFormatEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; +#define glVertexArrayVertexAttribBindingEXT glad_glVertexArrayVertexAttribBindingEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; +#define glVertexArrayVertexBindingDivisorEXT glad_glVertexArrayVertexBindingDivisorEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; +#define glVertexArrayVertexAttribLOffsetEXT glad_glVertexArrayVertexAttribLOffsetEXT +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +GLAPI PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; +#define glTexturePageCommitmentEXT glad_glTexturePageCommitmentEXT +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)(GLuint vaobj, GLuint index, GLuint divisor); +GLAPI PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; +#define glVertexArrayVertexAttribDivisorEXT glad_glVertexArrayVertexAttribDivisorEXT +#endif +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 +GLAPI int GLAD_GL_ARB_cull_distance; +#endif +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 +GLAPI int GLAD_GL_AMD_sample_positions; +typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC)(GLenum pname, GLuint index, const GLfloat* val); +GLAPI PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; +#define glSetMultisamplefvAMD glad_glSetMultisamplefvAMD +#endif +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +GLAPI int GLAD_GL_NV_vertex_program; +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC)(GLsizei n, const GLuint* programs, GLboolean* residences); +GLAPI PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; +#define glAreProgramsResidentNV glad_glAreProgramsResidentNV +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC)(GLenum target, GLuint id); +GLAPI PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; +#define glBindProgramNV glad_glBindProgramNV +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); +GLAPI PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; +#define glDeleteProgramsNV glad_glDeleteProgramsNV +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC)(GLenum target, GLuint id, const GLfloat* params); +GLAPI PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; +#define glExecuteProgramNV glad_glExecuteProgramNV +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC)(GLsizei n, GLuint* programs); +GLAPI PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; +#define glGenProgramsNV glad_glGenProgramsNV +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC)(GLenum target, GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; +#define glGetProgramParameterdvNV glad_glGetProgramParameterdvNV +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; +#define glGetProgramParameterfvNV glad_glGetProgramParameterfvNV +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; +#define glGetProgramivNV glad_glGetProgramivNV +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC)(GLuint id, GLenum pname, GLubyte* program); +GLAPI PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; +#define glGetProgramStringNV glad_glGetProgramStringNV +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC)(GLenum target, GLuint address, GLenum pname, GLint* params); +GLAPI PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; +#define glGetTrackMatrixivNV glad_glGetTrackMatrixivNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; +#define glGetVertexAttribdvNV glad_glGetVertexAttribdvNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC)(GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; +#define glGetVertexAttribfvNV glad_glGetVertexAttribfvNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; +#define glGetVertexAttribivNV glad_glGetVertexAttribivNV +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC)(GLuint index, GLenum pname, void** pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; +#define glGetVertexAttribPointervNV glad_glGetVertexAttribPointervNV +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC)(GLuint id); +GLAPI PFNGLISPROGRAMNVPROC glad_glIsProgramNV; +#define glIsProgramNV glad_glIsProgramNV +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC)(GLenum target, GLuint id, GLsizei len, const GLubyte* program); +GLAPI PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; +#define glLoadProgramNV glad_glLoadProgramNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; +#define glProgramParameter4dNV glad_glProgramParameter4dNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC)(GLenum target, GLuint index, const GLdouble* v); +GLAPI PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; +#define glProgramParameter4dvNV glad_glProgramParameter4dvNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; +#define glProgramParameter4fNV glad_glProgramParameter4fNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC)(GLenum target, GLuint index, const GLfloat* v); +GLAPI PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; +#define glProgramParameter4fvNV glad_glProgramParameter4fvNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLdouble* v); +GLAPI PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; +#define glProgramParameters4dvNV glad_glProgramParameters4dvNV +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* v); +GLAPI PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; +#define glProgramParameters4fvNV glad_glProgramParameters4fvNV +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); +GLAPI PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; +#define glRequestResidentProgramsNV glad_glRequestResidentProgramsNV +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC)(GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; +#define glTrackMatrixNV glad_glTrackMatrixNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC)(GLuint index, GLint fsize, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; +#define glVertexAttribPointerNV glad_glVertexAttribPointerNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; +#define glVertexAttrib1dNV glad_glVertexAttrib1dNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; +#define glVertexAttrib1dvNV glad_glVertexAttrib1dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; +#define glVertexAttrib1fNV glad_glVertexAttrib1fNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; +#define glVertexAttrib1fvNV glad_glVertexAttrib1fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; +#define glVertexAttrib1sNV glad_glVertexAttrib1sNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; +#define glVertexAttrib1svNV glad_glVertexAttrib1svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; +#define glVertexAttrib2dNV glad_glVertexAttrib2dNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; +#define glVertexAttrib2dvNV glad_glVertexAttrib2dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; +#define glVertexAttrib2fNV glad_glVertexAttrib2fNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; +#define glVertexAttrib2fvNV glad_glVertexAttrib2fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; +#define glVertexAttrib2sNV glad_glVertexAttrib2sNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; +#define glVertexAttrib2svNV glad_glVertexAttrib2svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; +#define glVertexAttrib3dNV glad_glVertexAttrib3dNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; +#define glVertexAttrib3dvNV glad_glVertexAttrib3dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; +#define glVertexAttrib3fNV glad_glVertexAttrib3fNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; +#define glVertexAttrib3fvNV glad_glVertexAttrib3fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; +#define glVertexAttrib3sNV glad_glVertexAttrib3sNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; +#define glVertexAttrib3svNV glad_glVertexAttrib3svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; +#define glVertexAttrib4dNV glad_glVertexAttrib4dNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; +#define glVertexAttrib4dvNV glad_glVertexAttrib4dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; +#define glVertexAttrib4fNV glad_glVertexAttrib4fNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; +#define glVertexAttrib4fvNV glad_glVertexAttrib4fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; +#define glVertexAttrib4sNV glad_glVertexAttrib4sNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; +#define glVertexAttrib4svNV glad_glVertexAttrib4svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; +#define glVertexAttrib4ubNV glad_glVertexAttrib4ubNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; +#define glVertexAttrib4ubvNV glad_glVertexAttrib4ubvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; +#define glVertexAttribs1dvNV glad_glVertexAttribs1dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; +#define glVertexAttribs1fvNV glad_glVertexAttribs1fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; +#define glVertexAttribs1svNV glad_glVertexAttribs1svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; +#define glVertexAttribs2dvNV glad_glVertexAttribs2dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; +#define glVertexAttribs2fvNV glad_glVertexAttribs2fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; +#define glVertexAttribs2svNV glad_glVertexAttribs2svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; +#define glVertexAttribs3dvNV glad_glVertexAttribs3dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; +#define glVertexAttribs3fvNV glad_glVertexAttribs3fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; +#define glVertexAttribs3svNV glad_glVertexAttribs3svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; +#define glVertexAttribs4dvNV glad_glVertexAttribs4dvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; +#define glVertexAttribs4fvNV glad_glVertexAttribs4fvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; +#define glVertexAttribs4svNV glad_glVertexAttribs4svNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC)(GLuint index, GLsizei count, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; +#define glVertexAttribs4ubvNV glad_glVertexAttribs4ubvNV +#endif +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 +GLAPI int GLAD_GL_NV_shader_thread_shuffle; +#endif +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 +GLAPI int GLAD_GL_ARB_shader_precision; +#endif +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +GLAPI int GLAD_GL_EXT_vertex_shader; +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC)(); +GLAPI PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; +#define glBeginVertexShaderEXT glad_glBeginVertexShaderEXT +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC)(); +GLAPI PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; +#define glEndVertexShaderEXT glad_glEndVertexShaderEXT +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC)(GLuint id); +GLAPI PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; +#define glBindVertexShaderEXT glad_glBindVertexShaderEXT +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC)(GLuint range); +GLAPI PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; +#define glGenVertexShadersEXT glad_glGenVertexShadersEXT +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC)(GLuint id); +GLAPI PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; +#define glDeleteVertexShaderEXT glad_glDeleteVertexShaderEXT +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC)(GLenum op, GLuint res, GLuint arg1); +GLAPI PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; +#define glShaderOp1EXT glad_glShaderOp1EXT +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; +#define glShaderOp2EXT glad_glShaderOp2EXT +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; +#define glShaderOp3EXT glad_glShaderOp3EXT +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; +#define glSwizzleEXT glad_glSwizzleEXT +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; +#define glWriteMaskEXT glad_glWriteMaskEXT +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); +GLAPI PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; +#define glInsertComponentEXT glad_glInsertComponentEXT +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); +GLAPI PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; +#define glExtractComponentEXT glad_glExtractComponentEXT +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC)(GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; +#define glGenSymbolsEXT glad_glGenSymbolsEXT +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC)(GLuint id, GLenum type, const void* addr); +GLAPI PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; +#define glSetInvariantEXT glad_glSetInvariantEXT +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC)(GLuint id, GLenum type, const void* addr); +GLAPI PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; +#define glSetLocalConstantEXT glad_glSetLocalConstantEXT +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC)(GLuint id, const GLbyte* addr); +GLAPI PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; +#define glVariantbvEXT glad_glVariantbvEXT +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC)(GLuint id, const GLshort* addr); +GLAPI PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; +#define glVariantsvEXT glad_glVariantsvEXT +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC)(GLuint id, const GLint* addr); +GLAPI PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; +#define glVariantivEXT glad_glVariantivEXT +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC)(GLuint id, const GLfloat* addr); +GLAPI PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; +#define glVariantfvEXT glad_glVariantfvEXT +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC)(GLuint id, const GLdouble* addr); +GLAPI PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; +#define glVariantdvEXT glad_glVariantdvEXT +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC)(GLuint id, const GLubyte* addr); +GLAPI PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; +#define glVariantubvEXT glad_glVariantubvEXT +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC)(GLuint id, const GLushort* addr); +GLAPI PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; +#define glVariantusvEXT glad_glVariantusvEXT +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC)(GLuint id, const GLuint* addr); +GLAPI PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; +#define glVariantuivEXT glad_glVariantuivEXT +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC)(GLuint id, GLenum type, GLuint stride, const void* addr); +GLAPI PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; +#define glVariantPointerEXT glad_glVariantPointerEXT +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); +GLAPI PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; +#define glEnableVariantClientStateEXT glad_glEnableVariantClientStateEXT +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); +GLAPI PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; +#define glDisableVariantClientStateEXT glad_glDisableVariantClientStateEXT +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC)(GLenum light, GLenum value); +GLAPI PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; +#define glBindLightParameterEXT glad_glBindLightParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC)(GLenum face, GLenum value); +GLAPI PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; +#define glBindMaterialParameterEXT glad_glBindMaterialParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC)(GLenum unit, GLenum coord, GLenum value); +GLAPI PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; +#define glBindTexGenParameterEXT glad_glBindTexGenParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)(GLenum unit, GLenum value); +GLAPI PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; +#define glBindTextureUnitParameterEXT glad_glBindTextureUnitParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC)(GLenum value); +GLAPI PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; +#define glBindParameterEXT glad_glBindParameterEXT +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC)(GLuint id, GLenum cap); +GLAPI PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; +#define glIsVariantEnabledEXT glad_glIsVariantEnabledEXT +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; +#define glGetVariantBooleanvEXT glad_glGetVariantBooleanvEXT +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; +#define glGetVariantIntegervEXT glad_glGetVariantIntegervEXT +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; +#define glGetVariantFloatvEXT glad_glGetVariantFloatvEXT +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC)(GLuint id, GLenum value, void** data); +GLAPI PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; +#define glGetVariantPointervEXT glad_glGetVariantPointervEXT +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; +#define glGetInvariantBooleanvEXT glad_glGetInvariantBooleanvEXT +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; +#define glGetInvariantIntegervEXT glad_glGetInvariantIntegervEXT +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; +#define glGetInvariantFloatvEXT glad_glGetInvariantFloatvEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; +#define glGetLocalConstantBooleanvEXT glad_glGetLocalConstantBooleanvEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; +#define glGetLocalConstantIntegervEXT glad_glGetLocalConstantIntegervEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; +#define glGetLocalConstantFloatvEXT glad_glGetLocalConstantFloatvEXT +#endif +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +GLAPI int GLAD_GL_EXT_blend_func_separate; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; +#define glBlendFuncSeparateEXT glad_glBlendFuncSeparateEXT +#endif +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +GLAPI int GLAD_GL_APPLE_fence; +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC)(GLsizei n, GLuint* fences); +GLAPI PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; +#define glGenFencesAPPLE glad_glGenFencesAPPLE +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC)(GLsizei n, const GLuint* fences); +GLAPI PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; +#define glDeleteFencesAPPLE glad_glDeleteFencesAPPLE +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC)(GLuint fence); +GLAPI PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; +#define glSetFenceAPPLE glad_glSetFenceAPPLE +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC)(GLuint fence); +GLAPI PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; +#define glIsFenceAPPLE glad_glIsFenceAPPLE +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC)(GLuint fence); +GLAPI PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; +#define glTestFenceAPPLE glad_glTestFenceAPPLE +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC)(GLuint fence); +GLAPI PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; +#define glFinishFenceAPPLE glad_glFinishFenceAPPLE +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC)(GLenum object, GLuint name); +GLAPI PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; +#define glTestObjectAPPLE glad_glTestObjectAPPLE +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC)(GLenum object, GLint name); +GLAPI PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; +#define glFinishObjectAPPLE glad_glFinishObjectAPPLE +#endif +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +GLAPI int GLAD_GL_OES_byte_coordinates; +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC)(GLenum texture, GLbyte s); +GLAPI PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; +#define glMultiTexCoord1bOES glad_glMultiTexCoord1bOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC)(GLenum texture, const GLbyte* coords); +GLAPI PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; +#define glMultiTexCoord1bvOES glad_glMultiTexCoord1bvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC)(GLenum texture, GLbyte s, GLbyte t); +GLAPI PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; +#define glMultiTexCoord2bOES glad_glMultiTexCoord2bOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC)(GLenum texture, const GLbyte* coords); +GLAPI PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; +#define glMultiTexCoord2bvOES glad_glMultiTexCoord2bvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r); +GLAPI PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; +#define glMultiTexCoord3bOES glad_glMultiTexCoord3bOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC)(GLenum texture, const GLbyte* coords); +GLAPI PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; +#define glMultiTexCoord3bvOES glad_glMultiTexCoord3bvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; +#define glMultiTexCoord4bOES glad_glMultiTexCoord4bOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC)(GLenum texture, const GLbyte* coords); +GLAPI PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; +#define glMultiTexCoord4bvOES glad_glMultiTexCoord4bvOES +typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC)(GLbyte s); +GLAPI PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; +#define glTexCoord1bOES glad_glTexCoord1bOES +typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; +#define glTexCoord1bvOES glad_glTexCoord1bvOES +typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC)(GLbyte s, GLbyte t); +GLAPI PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; +#define glTexCoord2bOES glad_glTexCoord2bOES +typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; +#define glTexCoord2bvOES glad_glTexCoord2bvOES +typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC)(GLbyte s, GLbyte t, GLbyte r); +GLAPI PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; +#define glTexCoord3bOES glad_glTexCoord3bOES +typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; +#define glTexCoord3bvOES glad_glTexCoord3bvOES +typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC)(GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; +#define glTexCoord4bOES glad_glTexCoord4bOES +typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; +#define glTexCoord4bvOES glad_glTexCoord4bvOES +typedef void (APIENTRYP PFNGLVERTEX2BOESPROC)(GLbyte x, GLbyte y); +GLAPI PFNGLVERTEX2BOESPROC glad_glVertex2bOES; +#define glVertex2bOES glad_glVertex2bOES +typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; +#define glVertex2bvOES glad_glVertex2bvOES +typedef void (APIENTRYP PFNGLVERTEX3BOESPROC)(GLbyte x, GLbyte y, GLbyte z); +GLAPI PFNGLVERTEX3BOESPROC glad_glVertex3bOES; +#define glVertex3bOES glad_glVertex3bOES +typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; +#define glVertex3bvOES glad_glVertex3bvOES +typedef void (APIENTRYP PFNGLVERTEX4BOESPROC)(GLbyte x, GLbyte y, GLbyte z, GLbyte w); +GLAPI PFNGLVERTEX4BOESPROC glad_glVertex4bOES; +#define glVertex4bOES glad_glVertex4bOES +typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC)(const GLbyte* coords); +GLAPI PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; +#define glVertex4bvOES glad_glVertex4bvOES +#endif +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +GLAPI int GLAD_GL_ARB_transpose_matrix; +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); +GLAPI PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; +#define glLoadTransposeMatrixfARB glad_glLoadTransposeMatrixfARB +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); +GLAPI PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; +#define glLoadTransposeMatrixdARB glad_glLoadTransposeMatrixdARB +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); +GLAPI PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; +#define glMultTransposeMatrixfARB glad_glMultTransposeMatrixfARB +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); +GLAPI PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; +#define glMultTransposeMatrixdARB glad_glMultTransposeMatrixdARB +#endif +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +GLAPI int GLAD_GL_ARB_provoking_vertex; +#endif +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +GLAPI int GLAD_GL_EXT_fog_coord; +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC)(GLfloat coord); +GLAPI PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; +#define glFogCoordfEXT glad_glFogCoordfEXT +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC)(const GLfloat* coord); +GLAPI PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; +#define glFogCoordfvEXT glad_glFogCoordfvEXT +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC)(GLdouble coord); +GLAPI PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; +#define glFogCoorddEXT glad_glFogCoorddEXT +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC)(const GLdouble* coord); +GLAPI PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; +#define glFogCoorddvEXT glad_glFogCoorddvEXT +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; +#define glFogCoordPointerEXT glad_glFogCoordPointerEXT +#endif +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +GLAPI int GLAD_GL_EXT_vertex_array; +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC)(GLint i); +GLAPI PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; +#define glArrayElementEXT glad_glArrayElementEXT +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; +#define glColorPointerEXT glad_glColorPointerEXT +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; +#define glDrawArraysEXT glad_glDrawArraysEXT +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); +GLAPI PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; +#define glEdgeFlagPointerEXT glad_glEdgeFlagPointerEXT +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC)(GLenum pname, void** params); +GLAPI PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; +#define glGetPointervEXT glad_glGetPointervEXT +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; +#define glIndexPointerEXT glad_glIndexPointerEXT +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; +#define glNormalPointerEXT glad_glNormalPointerEXT +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; +#define glTexCoordPointerEXT glad_glTexCoordPointerEXT +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; +#define glVertexPointerEXT glad_glVertexPointerEXT +#endif +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +GLAPI int GLAD_GL_ARB_half_float_vertex; +#endif +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +GLAPI int GLAD_GL_EXT_blend_equation_separate; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; +#define glBlendEquationSeparateEXT glad_glBlendEquationSeparateEXT +#endif +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 +GLAPI int GLAD_GL_NV_framebuffer_mixed_samples; +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC)(GLsizei n, const GLfloat* v); +GLAPI PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; +#define glCoverageModulationTableNV glad_glCoverageModulationTableNV +typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC)(GLsizei bufsize, GLfloat* v); +GLAPI PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; +#define glGetCoverageModulationTableNV glad_glGetCoverageModulationTableNV +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC)(GLenum components); +GLAPI PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; +#define glCoverageModulationNV glad_glCoverageModulationNV +#endif +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 +GLAPI int GLAD_GL_NVX_conditional_render; +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC)(GLuint id); +GLAPI PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; +#define glBeginConditionalRenderNVX glad_glBeginConditionalRenderNVX +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC)(); +GLAPI PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; +#define glEndConditionalRenderNVX glad_glEndConditionalRenderNVX +#endif +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +GLAPI int GLAD_GL_ARB_multi_draw_indirect; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect, GLsizei drawcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; +#define glMultiDrawArraysIndirect glad_glMultiDrawArraysIndirect +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; +#define glMultiDrawElementsIndirect glad_glMultiDrawElementsIndirect +#endif +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 +GLAPI int GLAD_GL_EXT_raster_multisample; +#endif +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +GLAPI int GLAD_GL_NV_copy_image; +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; +#define glCopyImageSubDataNV glad_glCopyImageSubDataNV +#endif +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +GLAPI int GLAD_GL_ARB_fragment_layer_viewport; +#endif +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 +GLAPI int GLAD_GL_INTEL_framebuffer_CMAA; +typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)(); +GLAPI PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; +#define glApplyFramebufferAttachmentCMAAINTEL glad_glApplyFramebufferAttachmentCMAAINTEL +#endif +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +GLAPI int GLAD_GL_ARB_transform_feedback2; +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC)(GLenum target, GLuint id); +GLAPI PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; +#define glBindTransformFeedback glad_glBindTransformFeedback +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC)(GLsizei n, const GLuint* ids); +GLAPI PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; +#define glDeleteTransformFeedbacks glad_glDeleteTransformFeedbacks +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; +#define glGenTransformFeedbacks glad_glGenTransformFeedbacks +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC)(GLuint id); +GLAPI PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; +#define glIsTransformFeedback glad_glIsTransformFeedback +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC)(); +GLAPI PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; +#define glPauseTransformFeedback glad_glPauseTransformFeedback +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC)(); +GLAPI PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; +#define glResumeTransformFeedback glad_glResumeTransformFeedback +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC)(GLenum mode, GLuint id); +GLAPI PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; +#define glDrawTransformFeedback glad_glDrawTransformFeedback +#endif +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +GLAPI int GLAD_GL_ARB_transform_feedback3; +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)(GLenum mode, GLuint id, GLuint stream); +GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; +#define glDrawTransformFeedbackStream glad_glDrawTransformFeedbackStream +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC)(GLenum target, GLuint index, GLuint id); +GLAPI PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; +#define glBeginQueryIndexed glad_glBeginQueryIndexed +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC)(GLenum target, GLuint index); +GLAPI PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; +#define glEndQueryIndexed glad_glEndQueryIndexed +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; +#define glGetQueryIndexediv glad_glGetQueryIndexediv +#endif +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +GLAPI int GLAD_GL_SGIX_ycrcba; +#endif +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +GLAPI int GLAD_GL_EXT_debug_marker; +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC)(GLsizei length, const GLchar* marker); +GLAPI PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; +#define glInsertEventMarkerEXT glad_glInsertEventMarkerEXT +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC)(GLsizei length, const GLchar* marker); +GLAPI PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; +#define glPushGroupMarkerEXT glad_glPushGroupMarkerEXT +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC)(); +GLAPI PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; +#define glPopGroupMarkerEXT glad_glPopGroupMarkerEXT +#endif +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +GLAPI int GLAD_GL_EXT_bgra; +#endif +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 +GLAPI int GLAD_GL_ARB_sparse_texture_clamp; +#endif +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +GLAPI int GLAD_GL_EXT_pixel_transform; +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; +#define glPixelTransformParameteriEXT glad_glPixelTransformParameteriEXT +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; +#define glPixelTransformParameterfEXT glad_glPixelTransformParameterfEXT +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; +#define glPixelTransformParameterivEXT glad_glPixelTransformParameterivEXT +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; +#define glPixelTransformParameterfvEXT glad_glPixelTransformParameterfvEXT +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; +#define glGetPixelTransformParameterivEXT glad_glGetPixelTransformParameterivEXT +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; +#define glGetPixelTransformParameterfvEXT glad_glGetPixelTransformParameterfvEXT +#endif +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 +GLAPI int GLAD_GL_ARB_conservative_depth; +#endif +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +GLAPI int GLAD_GL_ATI_fragment_shader; +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); +GLAPI PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; +#define glGenFragmentShadersATI glad_glGenFragmentShadersATI +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); +GLAPI PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; +#define glBindFragmentShaderATI glad_glBindFragmentShaderATI +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); +GLAPI PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; +#define glDeleteFragmentShaderATI glad_glDeleteFragmentShaderATI +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC)(); +GLAPI PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; +#define glBeginFragmentShaderATI glad_glBeginFragmentShaderATI +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC)(); +GLAPI PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; +#define glEndFragmentShaderATI glad_glEndFragmentShaderATI +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); +GLAPI PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; +#define glPassTexCoordATI glad_glPassTexCoordATI +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); +GLAPI PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; +#define glSampleMapATI glad_glSampleMapATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; +#define glColorFragmentOp1ATI glad_glColorFragmentOp1ATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; +#define glColorFragmentOp2ATI glad_glColorFragmentOp2ATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; +#define glColorFragmentOp3ATI glad_glColorFragmentOp3ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; +#define glAlphaFragmentOp1ATI glad_glAlphaFragmentOp1ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; +#define glAlphaFragmentOp2ATI glad_glAlphaFragmentOp2ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; +#define glAlphaFragmentOp3ATI glad_glAlphaFragmentOp3ATI +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat* value); +GLAPI PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; +#define glSetFragmentShaderConstantATI glad_glSetFragmentShaderConstantATI +#endif +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +GLAPI int GLAD_GL_ARB_vertex_array_object; +#endif +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +GLAPI int GLAD_GL_SUN_triangle_list; +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC)(GLuint code); +GLAPI PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; +#define glReplacementCodeuiSUN glad_glReplacementCodeuiSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC)(GLushort code); +GLAPI PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; +#define glReplacementCodeusSUN glad_glReplacementCodeusSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC)(GLubyte code); +GLAPI PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; +#define glReplacementCodeubSUN glad_glReplacementCodeubSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC)(const GLuint* code); +GLAPI PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; +#define glReplacementCodeuivSUN glad_glReplacementCodeuivSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC)(const GLushort* code); +GLAPI PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; +#define glReplacementCodeusvSUN glad_glReplacementCodeusvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC)(const GLubyte* code); +GLAPI PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; +#define glReplacementCodeubvSUN glad_glReplacementCodeubvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC)(GLenum type, GLsizei stride, const void** pointer); +GLAPI PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; +#define glReplacementCodePointerSUN glad_glReplacementCodePointerSUN +#endif +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +GLAPI int GLAD_GL_EXT_texture_env_add; +#endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +GLAPI int GLAD_GL_EXT_packed_depth_stencil; +#endif +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +GLAPI int GLAD_GL_EXT_texture_mirror_clamp; +#endif +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +GLAPI int GLAD_GL_NV_multisample_filter_hint; +#endif +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +GLAPI int GLAD_GL_APPLE_float_pixels; +#endif +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 +GLAPI int GLAD_GL_ARB_transform_feedback_instanced; +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)(GLenum mode, GLuint id, GLsizei instancecount); +GLAPI PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; +#define glDrawTransformFeedbackInstanced glad_glDrawTransformFeedbackInstanced +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; +#define glDrawTransformFeedbackStreamInstanced glad_glDrawTransformFeedbackStreamInstanced +#endif +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +GLAPI int GLAD_GL_SGIX_async; +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC)(GLuint marker); +GLAPI PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; +#define glAsyncMarkerSGIX glad_glAsyncMarkerSGIX +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC)(GLuint* markerp); +GLAPI PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; +#define glFinishAsyncSGIX glad_glFinishAsyncSGIX +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC)(GLuint* markerp); +GLAPI PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; +#define glPollAsyncSGIX glad_glPollAsyncSGIX +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC)(GLsizei range); +GLAPI PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; +#define glGenAsyncMarkersSGIX glad_glGenAsyncMarkersSGIX +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC)(GLuint marker, GLsizei range); +GLAPI PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; +#define glDeleteAsyncMarkersSGIX glad_glDeleteAsyncMarkersSGIX +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC)(GLuint marker); +GLAPI PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; +#define glIsAsyncMarkerSGIX glad_glIsAsyncMarkerSGIX +#endif +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +GLAPI int GLAD_GL_EXT_texture_compression_latc; +#endif +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 +GLAPI int GLAD_GL_NV_shader_atomic_float; +#endif +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +GLAPI int GLAD_GL_ARB_shading_language_100; +#endif +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +GLAPI int GLAD_GL_INTEL_performance_query; +typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC)(GLuint queryHandle); +GLAPI PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; +#define glBeginPerfQueryINTEL glad_glBeginPerfQueryINTEL +typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC)(GLuint queryId, GLuint* queryHandle); +GLAPI PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; +#define glCreatePerfQueryINTEL glad_glCreatePerfQueryINTEL +typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC)(GLuint queryHandle); +GLAPI PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; +#define glDeletePerfQueryINTEL glad_glDeletePerfQueryINTEL +typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC)(GLuint queryHandle); +GLAPI PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; +#define glEndPerfQueryINTEL glad_glEndPerfQueryINTEL +typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC)(GLuint* queryId); +GLAPI PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; +#define glGetFirstPerfQueryIdINTEL glad_glGetFirstPerfQueryIdINTEL +typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC)(GLuint queryId, GLuint* nextQueryId); +GLAPI PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; +#define glGetNextPerfQueryIdINTEL glad_glGetNextPerfQueryIdINTEL +typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC)(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar* counterDesc, GLuint* counterOffset, GLuint* counterDataSize, GLuint* counterTypeEnum, GLuint* counterDataTypeEnum, GLuint64* rawCounterMaxValue); +GLAPI PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; +#define glGetPerfCounterInfoINTEL glad_glGetPerfCounterInfoINTEL +typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC)(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid* data, GLuint* bytesWritten); +GLAPI PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; +#define glGetPerfQueryDataINTEL glad_glGetPerfQueryDataINTEL +typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC)(GLchar* queryName, GLuint* queryId); +GLAPI PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; +#define glGetPerfQueryIdByNameINTEL glad_glGetPerfQueryIdByNameINTEL +typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC)(GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint* dataSize, GLuint* noCounters, GLuint* noInstances, GLuint* capsMask); +GLAPI PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; +#define glGetPerfQueryInfoINTEL glad_glGetPerfQueryInfoINTEL +#endif +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 +GLAPI int GLAD_GL_ARB_texture_mirror_clamp_to_edge; +#endif +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +GLAPI int GLAD_GL_NV_gpu_shader5; +#endif +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 +GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect_count; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; +#define glMultiDrawArraysIndirectBindlessCountNV glad_glMultiDrawArraysIndirectBindlessCountNV +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; +#define glMultiDrawElementsIndirectBindlessCountNV glad_glMultiDrawElementsIndirectBindlessCountNV +#endif +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +GLAPI int GLAD_GL_ARB_ES2_compatibility; +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(); +GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +#define glReleaseShaderCompiler glad_glReleaseShaderCompiler +typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); +GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; +#define glShaderBinary glad_glShaderBinary +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); +GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +#define glDepthRangef glad_glDepthRangef +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); +GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +#define glClearDepthf glad_glClearDepthf +#endif +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 +GLAPI int GLAD_GL_ARB_indirect_parameters; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; +#define glMultiDrawArraysIndirectCountARB glad_glMultiDrawArraysIndirectCountARB +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; +#define glMultiDrawElementsIndirectCountARB glad_glMultiDrawElementsIndirectCountARB +#endif +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +GLAPI int GLAD_GL_NV_half_float; +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC)(GLhalfNV x, GLhalfNV y); +GLAPI PFNGLVERTEX2HNVPROC glad_glVertex2hNV; +#define glVertex2hNV glad_glVertex2hNV +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; +#define glVertex2hvNV glad_glVertex2hvNV +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI PFNGLVERTEX3HNVPROC glad_glVertex3hNV; +#define glVertex3hNV glad_glVertex3hNV +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; +#define glVertex3hvNV glad_glVertex3hvNV +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI PFNGLVERTEX4HNVPROC glad_glVertex4hNV; +#define glVertex4hNV glad_glVertex4hNV +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; +#define glVertex4hvNV glad_glVertex4hvNV +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC)(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI PFNGLNORMAL3HNVPROC glad_glNormal3hNV; +#define glNormal3hNV glad_glNormal3hNV +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; +#define glNormal3hvNV glad_glNormal3hvNV +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI PFNGLCOLOR3HNVPROC glad_glColor3hNV; +#define glColor3hNV glad_glColor3hNV +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; +#define glColor3hvNV glad_glColor3hvNV +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI PFNGLCOLOR4HNVPROC glad_glColor4hNV; +#define glColor4hNV glad_glColor4hNV +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; +#define glColor4hvNV glad_glColor4hvNV +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC)(GLhalfNV s); +GLAPI PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; +#define glTexCoord1hNV glad_glTexCoord1hNV +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; +#define glTexCoord1hvNV glad_glTexCoord1hvNV +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC)(GLhalfNV s, GLhalfNV t); +GLAPI PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; +#define glTexCoord2hNV glad_glTexCoord2hNV +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; +#define glTexCoord2hvNV glad_glTexCoord2hvNV +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; +#define glTexCoord3hNV glad_glTexCoord3hNV +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; +#define glTexCoord3hvNV glad_glTexCoord3hvNV +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; +#define glTexCoord4hNV glad_glTexCoord4hNV +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; +#define glTexCoord4hvNV glad_glTexCoord4hvNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC)(GLenum target, GLhalfNV s); +GLAPI PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; +#define glMultiTexCoord1hNV glad_glMultiTexCoord1hNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC)(GLenum target, const GLhalfNV* v); +GLAPI PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; +#define glMultiTexCoord1hvNV glad_glMultiTexCoord1hvNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; +#define glMultiTexCoord2hNV glad_glMultiTexCoord2hNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC)(GLenum target, const GLhalfNV* v); +GLAPI PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; +#define glMultiTexCoord2hvNV glad_glMultiTexCoord2hvNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; +#define glMultiTexCoord3hNV glad_glMultiTexCoord3hNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC)(GLenum target, const GLhalfNV* v); +GLAPI PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; +#define glMultiTexCoord3hvNV glad_glMultiTexCoord3hvNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; +#define glMultiTexCoord4hNV glad_glMultiTexCoord4hNV +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC)(GLenum target, const GLhalfNV* v); +GLAPI PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; +#define glMultiTexCoord4hvNV glad_glMultiTexCoord4hvNV +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC)(GLhalfNV fog); +GLAPI PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; +#define glFogCoordhNV glad_glFogCoordhNV +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC)(const GLhalfNV* fog); +GLAPI PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; +#define glFogCoordhvNV glad_glFogCoordhvNV +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; +#define glSecondaryColor3hNV glad_glSecondaryColor3hNV +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC)(const GLhalfNV* v); +GLAPI PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; +#define glSecondaryColor3hvNV glad_glSecondaryColor3hvNV +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC)(GLhalfNV weight); +GLAPI PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; +#define glVertexWeighthNV glad_glVertexWeighthNV +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC)(const GLhalfNV* weight); +GLAPI PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; +#define glVertexWeighthvNV glad_glVertexWeighthvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC)(GLuint index, GLhalfNV x); +GLAPI PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; +#define glVertexAttrib1hNV glad_glVertexAttrib1hNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC)(GLuint index, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; +#define glVertexAttrib1hvNV glad_glVertexAttrib1hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; +#define glVertexAttrib2hNV glad_glVertexAttrib2hNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC)(GLuint index, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; +#define glVertexAttrib2hvNV glad_glVertexAttrib2hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; +#define glVertexAttrib3hNV glad_glVertexAttrib3hNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC)(GLuint index, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; +#define glVertexAttrib3hvNV glad_glVertexAttrib3hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; +#define glVertexAttrib4hNV glad_glVertexAttrib4hNV +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC)(GLuint index, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; +#define glVertexAttrib4hvNV glad_glVertexAttrib4hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; +#define glVertexAttribs1hvNV glad_glVertexAttribs1hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; +#define glVertexAttribs2hvNV glad_glVertexAttribs2hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; +#define glVertexAttribs3hvNV glad_glVertexAttribs3hvNV +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); +GLAPI PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; +#define glVertexAttribs4hvNV glad_glVertexAttribs4hvNV +#endif +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 +GLAPI int GLAD_GL_ARB_ES3_2_compatibility; +typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +GLAPI PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; +#define glPrimitiveBoundingBoxARB glad_glPrimitiveBoundingBoxARB +#endif +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +GLAPI int GLAD_GL_ATI_texture_mirror_once; +#endif +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +GLAPI int GLAD_GL_IBM_rasterpos_clip; +#endif +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +GLAPI int GLAD_GL_SGIX_shadow; +#endif +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 +GLAPI int GLAD_GL_EXT_polygon_offset_clamp; +typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC)(GLfloat factor, GLfloat units, GLfloat clamp); +GLAPI PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; +#define glPolygonOffsetClampEXT glad_glPolygonOffsetClampEXT +#endif +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 +GLAPI int GLAD_GL_NV_deep_texture3D; +#endif +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 +GLAPI int GLAD_GL_ARB_shader_draw_parameters; +#endif +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +GLAPI int GLAD_GL_SGIX_calligraphic_fragment; +#endif +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 +GLAPI int GLAD_GL_ARB_shader_bit_encoding; +#endif +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +GLAPI int GLAD_GL_EXT_compiled_vertex_array; +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC)(GLint first, GLsizei count); +GLAPI PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; +#define glLockArraysEXT glad_glLockArraysEXT +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC)(); +GLAPI PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; +#define glUnlockArraysEXT glad_glUnlockArraysEXT +#endif +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +GLAPI int GLAD_GL_NV_depth_buffer_float; +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC)(GLdouble zNear, GLdouble zFar); +GLAPI PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; +#define glDepthRangedNV glad_glDepthRangedNV +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC)(GLdouble depth); +GLAPI PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; +#define glClearDepthdNV glad_glClearDepthdNV +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC)(GLdouble zmin, GLdouble zmax); +GLAPI PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; +#define glDepthBoundsdNV glad_glDepthBoundsdNV +#endif +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +GLAPI int GLAD_GL_NV_occlusion_query; +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; +#define glGenOcclusionQueriesNV glad_glGenOcclusionQueriesNV +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC)(GLsizei n, const GLuint* ids); +GLAPI PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; +#define glDeleteOcclusionQueriesNV glad_glDeleteOcclusionQueriesNV +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC)(GLuint id); +GLAPI PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; +#define glIsOcclusionQueryNV glad_glIsOcclusionQueryNV +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC)(GLuint id); +GLAPI PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; +#define glBeginOcclusionQueryNV glad_glBeginOcclusionQueryNV +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC)(); +GLAPI PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; +#define glEndOcclusionQueryNV glad_glEndOcclusionQueryNV +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; +#define glGetOcclusionQueryivNV glad_glGetOcclusionQueryivNV +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC)(GLuint id, GLenum pname, GLuint* params); +GLAPI PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; +#define glGetOcclusionQueryuivNV glad_glGetOcclusionQueryuivNV +#endif +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +GLAPI int GLAD_GL_APPLE_flush_buffer_range; +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; +#define glBufferParameteriAPPLE glad_glBufferParameteriAPPLE +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)(GLenum target, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; +#define glFlushMappedBufferRangeAPPLE glad_glFlushMappedBufferRangeAPPLE +#endif +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 +GLAPI int GLAD_GL_ARB_imaging; +typedef void (APIENTRYP PFNGLCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +GLAPI PFNGLCOLORTABLEPROC glad_glColorTable; +#define glColorTable glad_glColorTable +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; +#define glColorTableParameterfv glad_glColorTableParameterfv +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; +#define glColorTableParameteriv glad_glColorTableParameteriv +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; +#define glCopyColorTable glad_glCopyColorTable +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC)(GLenum target, GLenum format, GLenum type, void* table); +GLAPI PFNGLGETCOLORTABLEPROC glad_glGetColorTable; +#define glGetColorTable glad_glGetColorTable +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; +#define glGetColorTableParameterfv glad_glGetColorTableParameterfv +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; +#define glGetColorTableParameteriv glad_glGetColorTableParameteriv +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; +#define glColorSubTable glad_glColorSubTable +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; +#define glCopyColorSubTable glad_glCopyColorSubTable +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +GLAPI PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; +#define glConvolutionFilter1D glad_glConvolutionFilter1D +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +GLAPI PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; +#define glConvolutionFilter2D glad_glConvolutionFilter2D +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat params); +GLAPI PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; +#define glConvolutionParameterf glad_glConvolutionParameterf +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; +#define glConvolutionParameterfv glad_glConvolutionParameterfv +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC)(GLenum target, GLenum pname, GLint params); +GLAPI PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; +#define glConvolutionParameteri glad_glConvolutionParameteri +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; +#define glConvolutionParameteriv glad_glConvolutionParameteriv +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; +#define glCopyConvolutionFilter1D glad_glCopyConvolutionFilter1D +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; +#define glCopyConvolutionFilter2D glad_glCopyConvolutionFilter2D +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC)(GLenum target, GLenum format, GLenum type, void* image); +GLAPI PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; +#define glGetConvolutionFilter glad_glGetConvolutionFilter +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; +#define glGetConvolutionParameterfv glad_glGetConvolutionParameterfv +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; +#define glGetConvolutionParameteriv glad_glGetConvolutionParameteriv +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +GLAPI PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; +#define glGetSeparableFilter glad_glGetSeparableFilter +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); +GLAPI PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; +#define glSeparableFilter2D glad_glSeparableFilter2D +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +GLAPI PFNGLGETHISTOGRAMPROC glad_glGetHistogram; +#define glGetHistogram glad_glGetHistogram +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; +#define glGetHistogramParameterfv glad_glGetHistogramParameterfv +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; +#define glGetHistogramParameteriv glad_glGetHistogramParameteriv +typedef void (APIENTRYP PFNGLGETMINMAXPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +GLAPI PFNGLGETMINMAXPROC glad_glGetMinmax; +#define glGetMinmax glad_glGetMinmax +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; +#define glGetMinmaxParameterfv glad_glGetMinmaxParameterfv +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; +#define glGetMinmaxParameteriv glad_glGetMinmaxParameteriv +typedef void (APIENTRYP PFNGLHISTOGRAMPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI PFNGLHISTOGRAMPROC glad_glHistogram; +#define glHistogram glad_glHistogram +typedef void (APIENTRYP PFNGLMINMAXPROC)(GLenum target, GLenum internalformat, GLboolean sink); +GLAPI PFNGLMINMAXPROC glad_glMinmax; +#define glMinmax glad_glMinmax +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC)(GLenum target); +GLAPI PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; +#define glResetHistogram glad_glResetHistogram +typedef void (APIENTRYP PFNGLRESETMINMAXPROC)(GLenum target); +GLAPI PFNGLRESETMINMAXPROC glad_glResetMinmax; +#define glResetMinmax glad_glResetMinmax +#endif +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +GLAPI int GLAD_GL_ARB_draw_buffers_blend; +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC)(GLuint buf, GLenum mode); +GLAPI PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; +#define glBlendEquationiARB glad_glBlendEquationiARB +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; +#define glBlendEquationSeparateiARB glad_glBlendEquationSeparateiARB +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC)(GLuint buf, GLenum src, GLenum dst); +GLAPI PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; +#define glBlendFunciARB glad_glBlendFunciARB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; +#define glBlendFuncSeparateiARB glad_glBlendFuncSeparateiARB +#endif +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 +GLAPI int GLAD_GL_AMD_gcn_shader; +#endif +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 +GLAPI int GLAD_GL_AMD_blend_minmax_factor; +#endif +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +GLAPI int GLAD_GL_EXT_texture_sRGB_decode; +#endif +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 +GLAPI int GLAD_GL_ARB_shading_language_420pack; +#endif +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 +GLAPI int GLAD_GL_ARB_shader_viewport_layer_array; +#endif +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +GLAPI int GLAD_GL_ATI_meminfo; +#endif +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +GLAPI int GLAD_GL_EXT_abgr; +#endif +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 +GLAPI int GLAD_GL_AMD_pinned_memory; +#endif +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +GLAPI int GLAD_GL_EXT_texture_snorm; +#endif +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +GLAPI int GLAD_GL_SGIX_texture_coordinate_clamp; +#endif +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +GLAPI int GLAD_GL_ARB_clear_buffer_object; +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; +#define glClearBufferData glad_glClearBufferData +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; +#define glClearBufferSubData glad_glClearBufferSubData +#endif +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +GLAPI int GLAD_GL_ARB_multisample; +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; +#define glSampleCoverageARB glad_glSampleCoverageARB +#endif +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +GLAPI int GLAD_GL_EXT_debug_label; +typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC)(GLenum type, GLuint object, GLsizei length, const GLchar* label); +GLAPI PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; +#define glLabelObjectEXT glad_glLabelObjectEXT +typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC)(GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar* label); +GLAPI PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; +#define glGetObjectLabelEXT glad_glGetObjectLabelEXT +#endif +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +GLAPI int GLAD_GL_ARB_sample_shading; +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC)(GLfloat value); +GLAPI PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; +#define glMinSampleShadingARB glad_glMinSampleShadingARB +#endif +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 +GLAPI int GLAD_GL_NV_internalformat_sample_query; +typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)(GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); +GLAPI PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; +#define glGetInternalformatSampleivNV glad_glGetInternalformatSampleivNV +#endif +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 +GLAPI int GLAD_GL_INTEL_map_texture; +typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC)(GLuint texture); +GLAPI PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; +#define glSyncTextureINTEL glad_glSyncTextureINTEL +typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level); +GLAPI PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; +#define glUnmapTexture2DINTEL glad_glUnmapTexture2DINTEL +typedef void* (APIENTRYP PFNGLMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum* layout); +GLAPI PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; +#define glMapTexture2DINTEL glad_glMapTexture2DINTEL +#endif +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +GLAPI int GLAD_GL_ARB_texture_env_crossbar; +#endif +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +GLAPI int GLAD_GL_EXT_422_pixels; +#endif +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 +GLAPI int GLAD_GL_ARB_compute_shader; +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; +#define glDispatchCompute glad_glDispatchCompute +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC)(GLintptr indirect); +GLAPI PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; +#define glDispatchComputeIndirect glad_glDispatchComputeIndirect +#endif +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +GLAPI int GLAD_GL_EXT_blend_logic_op; +#endif +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +GLAPI int GLAD_GL_IBM_cull_vertex; +#endif +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +GLAPI int GLAD_GL_IBM_vertex_array_lists; +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; +#define glColorPointerListIBM glad_glColorPointerListIBM +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; +#define glSecondaryColorPointerListIBM glad_glSecondaryColorPointerListIBM +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC)(GLint stride, const GLboolean** pointer, GLint ptrstride); +GLAPI PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; +#define glEdgeFlagPointerListIBM glad_glEdgeFlagPointerListIBM +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; +#define glFogCoordPointerListIBM glad_glFogCoordPointerListIBM +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; +#define glIndexPointerListIBM glad_glIndexPointerListIBM +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; +#define glNormalPointerListIBM glad_glNormalPointerListIBM +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; +#define glTexCoordPointerListIBM glad_glTexCoordPointerListIBM +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); +GLAPI PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; +#define glVertexPointerListIBM glad_glVertexPointerListIBM +#endif +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +GLAPI int GLAD_GL_ARB_color_buffer_float; +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC)(GLenum target, GLenum clamp); +GLAPI PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; +#define glClampColorARB glad_glClampColorARB +#endif +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 +GLAPI int GLAD_GL_ARB_bindless_texture; +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC)(GLuint texture); +GLAPI PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; +#define glGetTextureHandleARB glad_glGetTextureHandleARB +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC)(GLuint texture, GLuint sampler); +GLAPI PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; +#define glGetTextureSamplerHandleARB glad_glGetTextureSamplerHandleARB +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); +GLAPI PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; +#define glMakeTextureHandleResidentARB glad_glMakeTextureHandleResidentARB +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)(GLuint64 handle); +GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; +#define glMakeTextureHandleNonResidentARB glad_glMakeTextureHandleNonResidentARB +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; +#define glGetImageHandleARB glad_glGetImageHandleARB +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle, GLenum access); +GLAPI PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; +#define glMakeImageHandleResidentARB glad_glMakeImageHandleResidentARB +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)(GLuint64 handle); +GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; +#define glMakeImageHandleNonResidentARB glad_glMakeImageHandleNonResidentARB +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC)(GLint location, GLuint64 value); +GLAPI PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; +#define glUniformHandleui64ARB glad_glUniformHandleui64ARB +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; +#define glUniformHandleui64vARB glad_glUniformHandleui64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)(GLuint program, GLint location, GLuint64 value); +GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; +#define glProgramUniformHandleui64ARB glad_glProgramUniformHandleui64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); +GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; +#define glProgramUniformHandleui64vARB glad_glProgramUniformHandleui64vARB +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); +GLAPI PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; +#define glIsTextureHandleResidentARB glad_glIsTextureHandleResidentARB +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle); +GLAPI PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; +#define glIsImageHandleResidentARB glad_glIsImageHandleResidentARB +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC)(GLuint index, GLuint64EXT x); +GLAPI PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; +#define glVertexAttribL1ui64ARB glad_glVertexAttribL1ui64ARB +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC)(GLuint index, const GLuint64EXT* v); +GLAPI PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; +#define glVertexAttribL1ui64vARB glad_glVertexAttribL1ui64vARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC)(GLuint index, GLenum pname, GLuint64EXT* params); +GLAPI PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; +#define glGetVertexAttribLui64vARB glad_glGetVertexAttribLui64vARB +#endif +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +GLAPI int GLAD_GL_ARB_window_pos; +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; +#define glWindowPos2dARB glad_glWindowPos2dARB +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC)(const GLdouble* v); +GLAPI PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; +#define glWindowPos2dvARB glad_glWindowPos2dvARB +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; +#define glWindowPos2fARB glad_glWindowPos2fARB +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC)(const GLfloat* v); +GLAPI PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; +#define glWindowPos2fvARB glad_glWindowPos2fvARB +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC)(GLint x, GLint y); +GLAPI PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; +#define glWindowPos2iARB glad_glWindowPos2iARB +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC)(const GLint* v); +GLAPI PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; +#define glWindowPos2ivARB glad_glWindowPos2ivARB +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC)(GLshort x, GLshort y); +GLAPI PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; +#define glWindowPos2sARB glad_glWindowPos2sARB +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC)(const GLshort* v); +GLAPI PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; +#define glWindowPos2svARB glad_glWindowPos2svARB +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; +#define glWindowPos3dARB glad_glWindowPos3dARB +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC)(const GLdouble* v); +GLAPI PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; +#define glWindowPos3dvARB glad_glWindowPos3dvARB +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; +#define glWindowPos3fARB glad_glWindowPos3fARB +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC)(const GLfloat* v); +GLAPI PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; +#define glWindowPos3fvARB glad_glWindowPos3fvARB +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; +#define glWindowPos3iARB glad_glWindowPos3iARB +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC)(const GLint* v); +GLAPI PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; +#define glWindowPos3ivARB glad_glWindowPos3ivARB +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; +#define glWindowPos3sARB glad_glWindowPos3sARB +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC)(const GLshort* v); +GLAPI PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; +#define glWindowPos3svARB glad_glWindowPos3svARB +#endif +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 +GLAPI int GLAD_GL_ARB_internalformat_query; +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); +GLAPI PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; +#define glGetInternalformativ glad_glGetInternalformativ +#endif +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +GLAPI int GLAD_GL_ARB_shadow; +#endif +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +GLAPI int GLAD_GL_ARB_texture_mirrored_repeat; +#endif +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +GLAPI int GLAD_GL_EXT_shader_image_load_store; +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC)(GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; +#define glBindImageTextureEXT glad_glBindImageTextureEXT +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC)(GLbitfield barriers); +GLAPI PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; +#define glMemoryBarrierEXT glad_glMemoryBarrierEXT +#endif +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +GLAPI int GLAD_GL_EXT_copy_texture; +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; +#define glCopyTexImage1DEXT glad_glCopyTexImage1DEXT +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; +#define glCopyTexImage2DEXT glad_glCopyTexImage2DEXT +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; +#define glCopyTexSubImage1DEXT glad_glCopyTexSubImage1DEXT +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; +#define glCopyTexSubImage2DEXT glad_glCopyTexSubImage2DEXT +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; +#define glCopyTexSubImage3DEXT glad_glCopyTexSubImage3DEXT +#endif +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +GLAPI int GLAD_GL_NV_register_combiners2; +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, const GLfloat* params); +GLAPI PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; +#define glCombinerStageParameterfvNV glad_glCombinerStageParameterfvNV +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; +#define glGetCombinerStageParameterfvNV glad_glGetCombinerStageParameterfvNV +#endif +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +GLAPI int GLAD_GL_SGIX_ycrcb_subsample; +#endif +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +GLAPI int GLAD_GL_SGIX_ir_instrument1; +#endif +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 +GLAPI int GLAD_GL_NV_draw_texture; +typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC)(GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +GLAPI PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; +#define glDrawTextureNV glad_glDrawTextureNV +#endif +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +GLAPI int GLAD_GL_EXT_texture_shared_exponent; +#endif +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +GLAPI int GLAD_GL_EXT_draw_instanced; +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC)(GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; +#define glDrawArraysInstancedEXT glad_glDrawArraysInstancedEXT +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +GLAPI PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; +#define glDrawElementsInstancedEXT glad_glDrawElementsInstancedEXT +#endif +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +GLAPI int GLAD_GL_NV_copy_depth_to_color; +#endif +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +GLAPI int GLAD_GL_ARB_viewport_array; +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC)(GLuint first, GLsizei count, const GLfloat* v); +GLAPI PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; +#define glViewportArrayv glad_glViewportArrayv +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; +#define glViewportIndexedf glad_glViewportIndexedf +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; +#define glViewportIndexedfv glad_glViewportIndexedfv +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC)(GLuint first, GLsizei count, const GLint* v); +GLAPI PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; +#define glScissorArrayv glad_glScissorArrayv +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; +#define glScissorIndexed glad_glScissorIndexed +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC)(GLuint index, const GLint* v); +GLAPI PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; +#define glScissorIndexedv glad_glScissorIndexedv +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC)(GLuint first, GLsizei count, const GLdouble* v); +GLAPI PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; +#define glDepthRangeArrayv glad_glDepthRangeArrayv +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f); +GLAPI PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; +#define glDepthRangeIndexed glad_glDepthRangeIndexed +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat* data); +GLAPI PFNGLGETFLOATI_VPROC glad_glGetFloati_v; +#define glGetFloati_v glad_glGetFloati_v +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC)(GLenum target, GLuint index, GLdouble* data); +GLAPI PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; +#define glGetDoublei_v glad_glGetDoublei_v +#endif +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +GLAPI int GLAD_GL_ARB_separate_shader_objects; +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC)(GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; +#define glUseProgramStages glad_glUseProgramStages +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC)(GLuint pipeline, GLuint program); +GLAPI PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; +#define glActiveShaderProgram glad_glActiveShaderProgram +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC)(GLenum type, GLsizei count, const GLchar** strings); +GLAPI PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; +#define glCreateShaderProgramv glad_glCreateShaderProgramv +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC)(GLuint pipeline); +GLAPI PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; +#define glBindProgramPipeline glad_glBindProgramPipeline +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC)(GLsizei n, const GLuint* pipelines); +GLAPI PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; +#define glDeleteProgramPipelines glad_glDeleteProgramPipelines +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); +GLAPI PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; +#define glGenProgramPipelines glad_glGenProgramPipelines +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC)(GLuint pipeline); +GLAPI PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; +#define glIsProgramPipeline glad_glIsProgramPipeline +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC)(GLuint pipeline, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; +#define glGetProgramPipelineiv glad_glGetProgramPipelineiv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC)(GLuint program, GLint location, GLint v0); +GLAPI PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; +#define glProgramUniform1i glad_glProgramUniform1i +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; +#define glProgramUniform1iv glad_glProgramUniform1iv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC)(GLuint program, GLint location, GLfloat v0); +GLAPI PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; +#define glProgramUniform1f glad_glProgramUniform1f +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; +#define glProgramUniform1fv glad_glProgramUniform1fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC)(GLuint program, GLint location, GLdouble v0); +GLAPI PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; +#define glProgramUniform1d glad_glProgramUniform1d +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; +#define glProgramUniform1dv glad_glProgramUniform1dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC)(GLuint program, GLint location, GLuint v0); +GLAPI PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; +#define glProgramUniform1ui glad_glProgramUniform1ui +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; +#define glProgramUniform1uiv glad_glProgramUniform1uiv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC)(GLuint program, GLint location, GLint v0, GLint v1); +GLAPI PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; +#define glProgramUniform2i glad_glProgramUniform2i +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; +#define glProgramUniform2iv glad_glProgramUniform2iv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; +#define glProgramUniform2f glad_glProgramUniform2f +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; +#define glProgramUniform2fv glad_glProgramUniform2fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; +#define glProgramUniform2d glad_glProgramUniform2d +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; +#define glProgramUniform2dv glad_glProgramUniform2dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; +#define glProgramUniform2ui glad_glProgramUniform2ui +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; +#define glProgramUniform2uiv glad_glProgramUniform2uiv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; +#define glProgramUniform3i glad_glProgramUniform3i +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; +#define glProgramUniform3iv glad_glProgramUniform3iv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; +#define glProgramUniform3f glad_glProgramUniform3f +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; +#define glProgramUniform3fv glad_glProgramUniform3fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; +#define glProgramUniform3d glad_glProgramUniform3d +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; +#define glProgramUniform3dv glad_glProgramUniform3dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; +#define glProgramUniform3ui glad_glProgramUniform3ui +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; +#define glProgramUniform3uiv glad_glProgramUniform3uiv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; +#define glProgramUniform4i glad_glProgramUniform4i +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); +GLAPI PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; +#define glProgramUniform4iv glad_glProgramUniform4iv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; +#define glProgramUniform4f glad_glProgramUniform4f +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; +#define glProgramUniform4fv glad_glProgramUniform4fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; +#define glProgramUniform4d glad_glProgramUniform4d +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; +#define glProgramUniform4dv glad_glProgramUniform4dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; +#define glProgramUniform4ui glad_glProgramUniform4ui +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; +#define glProgramUniform4uiv glad_glProgramUniform4uiv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; +#define glProgramUniformMatrix2fv glad_glProgramUniformMatrix2fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; +#define glProgramUniformMatrix3fv glad_glProgramUniformMatrix3fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; +#define glProgramUniformMatrix4fv glad_glProgramUniformMatrix4fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; +#define glProgramUniformMatrix2dv glad_glProgramUniformMatrix2dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; +#define glProgramUniformMatrix3dv glad_glProgramUniformMatrix3dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; +#define glProgramUniformMatrix4dv glad_glProgramUniformMatrix4dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; +#define glProgramUniformMatrix2x3fv glad_glProgramUniformMatrix2x3fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; +#define glProgramUniformMatrix3x2fv glad_glProgramUniformMatrix3x2fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; +#define glProgramUniformMatrix2x4fv glad_glProgramUniformMatrix2x4fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; +#define glProgramUniformMatrix4x2fv glad_glProgramUniformMatrix4x2fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; +#define glProgramUniformMatrix3x4fv glad_glProgramUniformMatrix3x4fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; +#define glProgramUniformMatrix4x3fv glad_glProgramUniformMatrix4x3fv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; +#define glProgramUniformMatrix2x3dv glad_glProgramUniformMatrix2x3dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; +#define glProgramUniformMatrix3x2dv glad_glProgramUniformMatrix3x2dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; +#define glProgramUniformMatrix2x4dv glad_glProgramUniformMatrix2x4dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; +#define glProgramUniformMatrix4x2dv glad_glProgramUniformMatrix4x2dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; +#define glProgramUniformMatrix3x4dv glad_glProgramUniformMatrix3x4dv +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; +#define glProgramUniformMatrix4x3dv glad_glProgramUniformMatrix4x3dv +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC)(GLuint pipeline); +GLAPI PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; +#define glValidateProgramPipeline glad_glValidateProgramPipeline +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; +#define glGetProgramPipelineInfoLog glad_glGetProgramPipelineInfoLog +#endif +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +GLAPI int GLAD_GL_EXT_depth_bounds_test; +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); +GLAPI PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; +#define glDepthBoundsEXT glad_glDepthBoundsEXT +#endif +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +GLAPI int GLAD_GL_EXT_shared_texture_palette; +#endif +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +GLAPI int GLAD_GL_ARB_texture_env_add; +#endif +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +GLAPI int GLAD_GL_NV_video_capture; +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC)(GLuint video_capture_slot); +GLAPI PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; +#define glBeginVideoCaptureNV glad_glBeginVideoCaptureNV +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; +#define glBindVideoCaptureStreamBufferNV glad_glBindVideoCaptureStreamBufferNV +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; +#define glBindVideoCaptureStreamTextureNV glad_glBindVideoCaptureStreamTextureNV +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC)(GLuint video_capture_slot); +GLAPI PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; +#define glEndVideoCaptureNV glad_glEndVideoCaptureNV +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC)(GLuint video_capture_slot, GLenum pname, GLint* params); +GLAPI PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; +#define glGetVideoCaptureivNV glad_glGetVideoCaptureivNV +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +GLAPI PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; +#define glGetVideoCaptureStreamivNV glad_glGetVideoCaptureStreamivNV +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; +#define glGetVideoCaptureStreamfvNV glad_glGetVideoCaptureStreamfvNV +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; +#define glGetVideoCaptureStreamdvNV glad_glGetVideoCaptureStreamdvNV +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC)(GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT* capture_time); +GLAPI PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; +#define glVideoCaptureNV glad_glVideoCaptureNV +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); +GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; +#define glVideoCaptureStreamParameterivNV glad_glVideoCaptureStreamParameterivNV +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; +#define glVideoCaptureStreamParameterfvNV glad_glVideoCaptureStreamParameterfvNV +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; +#define glVideoCaptureStreamParameterdvNV glad_glVideoCaptureStreamParameterdvNV +#endif +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +GLAPI int GLAD_GL_ARB_sampler_objects; +#endif +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +GLAPI int GLAD_GL_ARB_matrix_palette; +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC)(GLint index); +GLAPI PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; +#define glCurrentPaletteMatrixARB glad_glCurrentPaletteMatrixARB +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC)(GLint size, const GLubyte* indices); +GLAPI PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; +#define glMatrixIndexubvARB glad_glMatrixIndexubvARB +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC)(GLint size, const GLushort* indices); +GLAPI PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; +#define glMatrixIndexusvARB glad_glMatrixIndexusvARB +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC)(GLint size, const GLuint* indices); +GLAPI PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; +#define glMatrixIndexuivARB glad_glMatrixIndexuivARB +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; +#define glMatrixIndexPointerARB glad_glMatrixIndexPointerARB +#endif +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +GLAPI int GLAD_GL_SGIS_texture_color_mask; +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; +#define glTextureColorMaskSGIS glad_glTextureColorMaskSGIS +#endif +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +GLAPI int GLAD_GL_EXT_packed_pixels; +#endif +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +GLAPI int GLAD_GL_EXT_coordinate_frame; +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC)(GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; +#define glTangent3bEXT glad_glTangent3bEXT +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC)(const GLbyte* v); +GLAPI PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; +#define glTangent3bvEXT glad_glTangent3bvEXT +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC)(GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; +#define glTangent3dEXT glad_glTangent3dEXT +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC)(const GLdouble* v); +GLAPI PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; +#define glTangent3dvEXT glad_glTangent3dvEXT +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC)(GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; +#define glTangent3fEXT glad_glTangent3fEXT +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC)(const GLfloat* v); +GLAPI PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; +#define glTangent3fvEXT glad_glTangent3fvEXT +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC)(GLint tx, GLint ty, GLint tz); +GLAPI PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; +#define glTangent3iEXT glad_glTangent3iEXT +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC)(const GLint* v); +GLAPI PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; +#define glTangent3ivEXT glad_glTangent3ivEXT +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC)(GLshort tx, GLshort ty, GLshort tz); +GLAPI PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; +#define glTangent3sEXT glad_glTangent3sEXT +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC)(const GLshort* v); +GLAPI PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; +#define glTangent3svEXT glad_glTangent3svEXT +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC)(GLbyte bx, GLbyte by, GLbyte bz); +GLAPI PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; +#define glBinormal3bEXT glad_glBinormal3bEXT +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC)(const GLbyte* v); +GLAPI PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; +#define glBinormal3bvEXT glad_glBinormal3bvEXT +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC)(GLdouble bx, GLdouble by, GLdouble bz); +GLAPI PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; +#define glBinormal3dEXT glad_glBinormal3dEXT +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC)(const GLdouble* v); +GLAPI PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; +#define glBinormal3dvEXT glad_glBinormal3dvEXT +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC)(GLfloat bx, GLfloat by, GLfloat bz); +GLAPI PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; +#define glBinormal3fEXT glad_glBinormal3fEXT +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC)(const GLfloat* v); +GLAPI PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; +#define glBinormal3fvEXT glad_glBinormal3fvEXT +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC)(GLint bx, GLint by, GLint bz); +GLAPI PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; +#define glBinormal3iEXT glad_glBinormal3iEXT +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC)(const GLint* v); +GLAPI PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; +#define glBinormal3ivEXT glad_glBinormal3ivEXT +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC)(GLshort bx, GLshort by, GLshort bz); +GLAPI PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; +#define glBinormal3sEXT glad_glBinormal3sEXT +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC)(const GLshort* v); +GLAPI PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; +#define glBinormal3svEXT glad_glBinormal3svEXT +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; +#define glTangentPointerEXT glad_glTangentPointerEXT +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; +#define glBinormalPointerEXT glad_glBinormalPointerEXT +#endif +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +GLAPI int GLAD_GL_ARB_texture_compression; +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; +#define glCompressedTexImage3DARB glad_glCompressedTexImage3DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; +#define glCompressedTexImage2DARB glad_glCompressedTexImage2DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; +#define glCompressedTexImage1DARB glad_glCompressedTexImage1DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; +#define glCompressedTexSubImage3DARB glad_glCompressedTexSubImage3DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; +#define glCompressedTexSubImage2DARB glad_glCompressedTexSubImage2DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; +#define glCompressedTexSubImage1DARB glad_glCompressedTexSubImage1DARB +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; +#define glGetCompressedTexImageARB glad_glGetCompressedTexImageARB +#endif +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +GLAPI int GLAD_GL_APPLE_aux_depth_stencil; +#endif +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +GLAPI int GLAD_GL_ARB_shader_subroutine; +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)(GLuint program, GLenum shadertype, const GLchar* name); +GLAPI PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; +#define glGetSubroutineUniformLocation glad_glGetSubroutineUniformLocation +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC)(GLuint program, GLenum shadertype, const GLchar* name); +GLAPI PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; +#define glGetSubroutineIndex glad_glGetSubroutineIndex +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; +#define glGetActiveSubroutineUniformiv glad_glGetActiveSubroutineUniformiv +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); +GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; +#define glGetActiveSubroutineUniformName glad_glGetActiveSubroutineUniformName +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); +GLAPI PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; +#define glGetActiveSubroutineName glad_glGetActiveSubroutineName +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC)(GLenum shadertype, GLsizei count, const GLuint* indices); +GLAPI PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; +#define glUniformSubroutinesuiv glad_glUniformSubroutinesuiv +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC)(GLenum shadertype, GLint location, GLuint* params); +GLAPI PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; +#define glGetUniformSubroutineuiv glad_glGetUniformSubroutineuiv +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC)(GLuint program, GLenum shadertype, GLenum pname, GLint* values); +GLAPI PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; +#define glGetProgramStageiv glad_glGetProgramStageiv +#endif +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +GLAPI int GLAD_GL_EXT_framebuffer_sRGB; +#endif +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +GLAPI int GLAD_GL_ARB_texture_storage_multisample; +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; +#define glTexStorage2DMultisample glad_glTexStorage2DMultisample +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; +#define glTexStorage3DMultisample glad_glTexStorage3DMultisample +#endif +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 +GLAPI int GLAD_GL_KHR_blend_equation_advanced_coherent; +#endif +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +GLAPI int GLAD_GL_EXT_vertex_attrib_64bit; +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; +#define glVertexAttribL1dEXT glad_glVertexAttribL1dEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; +#define glVertexAttribL2dEXT glad_glVertexAttribL2dEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; +#define glVertexAttribL3dEXT glad_glVertexAttribL3dEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; +#define glVertexAttribL4dEXT glad_glVertexAttribL4dEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; +#define glVertexAttribL1dvEXT glad_glVertexAttribL1dvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; +#define glVertexAttribL2dvEXT glad_glVertexAttribL2dvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; +#define glVertexAttribL3dvEXT glad_glVertexAttribL3dvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; +#define glVertexAttribL4dvEXT glad_glVertexAttribL4dvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; +#define glVertexAttribLPointerEXT glad_glVertexAttribLPointerEXT +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; +#define glGetVertexAttribLdvEXT glad_glGetVertexAttribLdvEXT +#endif +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +GLAPI int GLAD_GL_ARB_depth_texture; +#endif +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +GLAPI int GLAD_GL_NV_shader_buffer_store; +#endif +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +GLAPI int GLAD_GL_OES_query_matrix; +typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC)(GLfixed* mantissa, GLint* exponent); +GLAPI PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; +#define glQueryMatrixxOES glad_glQueryMatrixxOES +#endif +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +GLAPI int GLAD_GL_MESA_window_pos; +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; +#define glWindowPos2dMESA glad_glWindowPos2dMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC)(const GLdouble* v); +GLAPI PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; +#define glWindowPos2dvMESA glad_glWindowPos2dvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; +#define glWindowPos2fMESA glad_glWindowPos2fMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC)(const GLfloat* v); +GLAPI PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; +#define glWindowPos2fvMESA glad_glWindowPos2fvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC)(GLint x, GLint y); +GLAPI PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; +#define glWindowPos2iMESA glad_glWindowPos2iMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC)(const GLint* v); +GLAPI PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; +#define glWindowPos2ivMESA glad_glWindowPos2ivMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC)(GLshort x, GLshort y); +GLAPI PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; +#define glWindowPos2sMESA glad_glWindowPos2sMESA +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC)(const GLshort* v); +GLAPI PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; +#define glWindowPos2svMESA glad_glWindowPos2svMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; +#define glWindowPos3dMESA glad_glWindowPos3dMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC)(const GLdouble* v); +GLAPI PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; +#define glWindowPos3dvMESA glad_glWindowPos3dvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; +#define glWindowPos3fMESA glad_glWindowPos3fMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC)(const GLfloat* v); +GLAPI PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; +#define glWindowPos3fvMESA glad_glWindowPos3fvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; +#define glWindowPos3iMESA glad_glWindowPos3iMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC)(const GLint* v); +GLAPI PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; +#define glWindowPos3ivMESA glad_glWindowPos3ivMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; +#define glWindowPos3sMESA glad_glWindowPos3sMESA +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC)(const GLshort* v); +GLAPI PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; +#define glWindowPos3svMESA glad_glWindowPos3svMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; +#define glWindowPos4dMESA glad_glWindowPos4dMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC)(const GLdouble* v); +GLAPI PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; +#define glWindowPos4dvMESA glad_glWindowPos4dvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; +#define glWindowPos4fMESA glad_glWindowPos4fMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC)(const GLfloat* v); +GLAPI PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; +#define glWindowPos4fvMESA glad_glWindowPos4fvMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; +#define glWindowPos4iMESA glad_glWindowPos4iMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC)(const GLint* v); +GLAPI PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; +#define glWindowPos4ivMESA glad_glWindowPos4ivMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; +#define glWindowPos4sMESA glad_glWindowPos4sMESA +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC)(const GLshort* v); +GLAPI PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; +#define glWindowPos4svMESA glad_glWindowPos4svMESA +#endif +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 +GLAPI int GLAD_GL_NV_fill_rectangle; +#endif +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 +GLAPI int GLAD_GL_NV_shader_storage_buffer_object; +#endif +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +GLAPI int GLAD_GL_ARB_texture_query_lod; +#endif +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +GLAPI int GLAD_GL_ARB_copy_buffer; +#endif +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +GLAPI int GLAD_GL_ARB_shader_image_size; +#endif +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 +GLAPI int GLAD_GL_NV_shader_atomic_counters; +#endif +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +GLAPI int GLAD_GL_APPLE_object_purgeable; +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); +GLAPI PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; +#define glObjectPurgeableAPPLE glad_glObjectPurgeableAPPLE +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); +GLAPI PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; +#define glObjectUnpurgeableAPPLE glad_glObjectUnpurgeableAPPLE +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC)(GLenum objectType, GLuint name, GLenum pname, GLint* params); +GLAPI PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; +#define glGetObjectParameterivAPPLE glad_glGetObjectParameterivAPPLE +#endif +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +GLAPI int GLAD_GL_ARB_occlusion_query; +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint* ids); +GLAPI PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; +#define glGenQueriesARB glad_glGenQueriesARB +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint* ids); +GLAPI PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; +#define glDeleteQueriesARB glad_glDeleteQueriesARB +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC)(GLuint id); +GLAPI PFNGLISQUERYARBPROC glad_glIsQueryARB; +#define glIsQueryARB glad_glIsQueryARB +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); +GLAPI PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; +#define glBeginQueryARB glad_glBeginQueryARB +typedef void (APIENTRYP PFNGLENDQUERYARBPROC)(GLenum target); +GLAPI PFNGLENDQUERYARBPROC glad_glEndQueryARB; +#define glEndQueryARB glad_glEndQueryARB +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; +#define glGetQueryivARB glad_glGetQueryivARB +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; +#define glGetQueryObjectivARB glad_glGetQueryObjectivARB +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint* params); +GLAPI PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; +#define glGetQueryObjectuivARB glad_glGetQueryObjectuivARB +#endif +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +GLAPI int GLAD_GL_INGR_color_clamp; +#endif +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +GLAPI int GLAD_GL_SGI_color_table; +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +GLAPI PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; +#define glColorTableSGI glad_glColorTableSGI +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, const GLfloat* params); +GLAPI PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; +#define glColorTableParameterfvSGI glad_glColorTableParameterfvSGI +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, const GLint* params); +GLAPI PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; +#define glColorTableParameterivSGI glad_glColorTableParameterivSGI +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; +#define glCopyColorTableSGI glad_glCopyColorTableSGI +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC)(GLenum target, GLenum format, GLenum type, void* table); +GLAPI PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; +#define glGetColorTableSGI glad_glGetColorTableSGI +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; +#define glGetColorTableParameterfvSGI glad_glGetColorTableParameterfvSGI +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; +#define glGetColorTableParameterivSGI glad_glGetColorTableParameterivSGI +#endif +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 +GLAPI int GLAD_GL_NV_gpu_program5_mem_extended; +#endif +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +GLAPI int GLAD_GL_ARB_texture_cube_map_array; +#endif +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +GLAPI int GLAD_GL_SGIX_scalebias_hint; +#endif +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +GLAPI int GLAD_GL_EXT_gpu_shader4; +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC)(GLuint program, GLint location, GLuint* params); +GLAPI PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; +#define glGetUniformuivEXT glad_glGetUniformuivEXT +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC)(GLuint program, GLuint color, const GLchar* name); +GLAPI PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; +#define glBindFragDataLocationEXT glad_glBindFragDataLocationEXT +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC)(GLuint program, const GLchar* name); +GLAPI PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; +#define glGetFragDataLocationEXT glad_glGetFragDataLocationEXT +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC)(GLint location, GLuint v0); +GLAPI PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; +#define glUniform1uiEXT glad_glUniform1uiEXT +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC)(GLint location, GLuint v0, GLuint v1); +GLAPI PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; +#define glUniform2uiEXT glad_glUniform2uiEXT +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; +#define glUniform3uiEXT glad_glUniform3uiEXT +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; +#define glUniform4uiEXT glad_glUniform4uiEXT +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; +#define glUniform1uivEXT glad_glUniform1uivEXT +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; +#define glUniform2uivEXT glad_glUniform2uivEXT +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; +#define glUniform3uivEXT glad_glUniform3uivEXT +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); +GLAPI PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; +#define glUniform4uivEXT glad_glUniform4uivEXT +#endif +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +GLAPI int GLAD_GL_NV_geometry_program4; +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC)(GLenum target, GLint limit); +GLAPI PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; +#define glProgramVertexLimitNV glad_glProgramVertexLimitNV +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; +#define glFramebufferTextureEXT glad_glFramebufferTextureEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; +#define glFramebufferTextureFaceEXT glad_glFramebufferTextureFaceEXT +#endif +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +GLAPI int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; +#endif +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +GLAPI int GLAD_GL_AMD_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC)(GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; +#define glDebugMessageEnableAMD glad_glDebugMessageEnableAMD +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC)(GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; +#define glDebugMessageInsertAMD glad_glDebugMessageInsertAMD +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC)(GLDEBUGPROCAMD callback, void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; +#define glDebugMessageCallbackAMD glad_glDebugMessageCallbackAMD +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC)(GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); +GLAPI PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; +#define glGetDebugMessageLogAMD glad_glGetDebugMessageLogAMD +#endif +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +GLAPI int GLAD_GL_ARB_texture_border_clamp; +#endif +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +GLAPI int GLAD_GL_ARB_fragment_coord_conventions; +#endif +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +GLAPI int GLAD_GL_ARB_multitexture; +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; +#define glActiveTextureARB glad_glActiveTextureARB +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC)(GLenum texture); +GLAPI PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; +#define glClientActiveTextureARB glad_glClientActiveTextureARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC)(GLenum target, GLdouble s); +GLAPI PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; +#define glMultiTexCoord1dARB glad_glMultiTexCoord1dARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC)(GLenum target, const GLdouble* v); +GLAPI PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; +#define glMultiTexCoord1dvARB glad_glMultiTexCoord1dvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC)(GLenum target, GLfloat s); +GLAPI PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; +#define glMultiTexCoord1fARB glad_glMultiTexCoord1fARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC)(GLenum target, const GLfloat* v); +GLAPI PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; +#define glMultiTexCoord1fvARB glad_glMultiTexCoord1fvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC)(GLenum target, GLint s); +GLAPI PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; +#define glMultiTexCoord1iARB glad_glMultiTexCoord1iARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC)(GLenum target, const GLint* v); +GLAPI PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; +#define glMultiTexCoord1ivARB glad_glMultiTexCoord1ivARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC)(GLenum target, GLshort s); +GLAPI PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; +#define glMultiTexCoord1sARB glad_glMultiTexCoord1sARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC)(GLenum target, const GLshort* v); +GLAPI PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; +#define glMultiTexCoord1svARB glad_glMultiTexCoord1svARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC)(GLenum target, GLdouble s, GLdouble t); +GLAPI PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; +#define glMultiTexCoord2dARB glad_glMultiTexCoord2dARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC)(GLenum target, const GLdouble* v); +GLAPI PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; +#define glMultiTexCoord2dvARB glad_glMultiTexCoord2dvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC)(GLenum target, GLfloat s, GLfloat t); +GLAPI PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; +#define glMultiTexCoord2fARB glad_glMultiTexCoord2fARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC)(GLenum target, const GLfloat* v); +GLAPI PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; +#define glMultiTexCoord2fvARB glad_glMultiTexCoord2fvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC)(GLenum target, GLint s, GLint t); +GLAPI PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; +#define glMultiTexCoord2iARB glad_glMultiTexCoord2iARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC)(GLenum target, const GLint* v); +GLAPI PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; +#define glMultiTexCoord2ivARB glad_glMultiTexCoord2ivARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC)(GLenum target, GLshort s, GLshort t); +GLAPI PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; +#define glMultiTexCoord2sARB glad_glMultiTexCoord2sARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC)(GLenum target, const GLshort* v); +GLAPI PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; +#define glMultiTexCoord2svARB glad_glMultiTexCoord2svARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; +#define glMultiTexCoord3dARB glad_glMultiTexCoord3dARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC)(GLenum target, const GLdouble* v); +GLAPI PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; +#define glMultiTexCoord3dvARB glad_glMultiTexCoord3dvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; +#define glMultiTexCoord3fARB glad_glMultiTexCoord3fARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC)(GLenum target, const GLfloat* v); +GLAPI PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; +#define glMultiTexCoord3fvARB glad_glMultiTexCoord3fvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC)(GLenum target, GLint s, GLint t, GLint r); +GLAPI PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; +#define glMultiTexCoord3iARB glad_glMultiTexCoord3iARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC)(GLenum target, const GLint* v); +GLAPI PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; +#define glMultiTexCoord3ivARB glad_glMultiTexCoord3ivARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; +#define glMultiTexCoord3sARB glad_glMultiTexCoord3sARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC)(GLenum target, const GLshort* v); +GLAPI PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; +#define glMultiTexCoord3svARB glad_glMultiTexCoord3svARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; +#define glMultiTexCoord4dARB glad_glMultiTexCoord4dARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC)(GLenum target, const GLdouble* v); +GLAPI PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; +#define glMultiTexCoord4dvARB glad_glMultiTexCoord4dvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; +#define glMultiTexCoord4fARB glad_glMultiTexCoord4fARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC)(GLenum target, const GLfloat* v); +GLAPI PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; +#define glMultiTexCoord4fvARB glad_glMultiTexCoord4fvARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; +#define glMultiTexCoord4iARB glad_glMultiTexCoord4iARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC)(GLenum target, const GLint* v); +GLAPI PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; +#define glMultiTexCoord4ivARB glad_glMultiTexCoord4ivARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; +#define glMultiTexCoord4sARB glad_glMultiTexCoord4sARB +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC)(GLenum target, const GLshort* v); +GLAPI PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; +#define glMultiTexCoord4svARB glad_glMultiTexCoord4svARB +#endif +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +GLAPI int GLAD_GL_SGIX_polynomial_ffd; +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble* points); +GLAPI PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; +#define glDeformationMap3dSGIX glad_glDeformationMap3dSGIX +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat* points); +GLAPI PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; +#define glDeformationMap3fSGIX glad_glDeformationMap3fSGIX +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC)(GLbitfield mask); +GLAPI PFNGLDEFORMSGIXPROC glad_glDeformSGIX; +#define glDeformSGIX glad_glDeformSGIX +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)(GLbitfield mask); +GLAPI PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; +#define glLoadIdentityDeformationMapSGIX glad_glLoadIdentityDeformationMapSGIX +#endif +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +GLAPI int GLAD_GL_EXT_provoking_vertex; +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC)(GLenum mode); +GLAPI PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; +#define glProvokingVertexEXT glad_glProvokingVertexEXT +#endif +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +GLAPI int GLAD_GL_ARB_point_parameters; +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; +#define glPointParameterfARB glad_glPointParameterfARB +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; +#define glPointParameterfvARB glad_glPointParameterfvARB +#endif +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 +GLAPI int GLAD_GL_ARB_shader_image_load_store; +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; +#define glBindImageTexture glad_glBindImageTexture +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC)(GLbitfield barriers); +GLAPI PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; +#define glMemoryBarrier glad_glMemoryBarrier +#endif +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 +GLAPI int GLAD_GL_ARB_conditional_render_inverted; +#endif +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +GLAPI int GLAD_GL_HP_occlusion_test; +#endif +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +GLAPI int GLAD_GL_ARB_ES3_compatibility; +#endif +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 +GLAPI int GLAD_GL_ARB_texture_barrier; +typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC)(); +GLAPI PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; +#define glTextureBarrier glad_glTextureBarrier +#endif +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +GLAPI int GLAD_GL_ARB_texture_buffer_object_rgb32; +#endif +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 +GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect; +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; +#define glMultiDrawArraysIndirectBindlessNV glad_glMultiDrawArraysIndirectBindlessNV +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; +#define glMultiDrawElementsIndirectBindlessNV glad_glMultiDrawElementsIndirectBindlessNV +#endif +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +GLAPI int GLAD_GL_SGIX_texture_multi_buffer; +#endif +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +GLAPI int GLAD_GL_EXT_transform_feedback; +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)(GLenum primitiveMode); +GLAPI PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; +#define glBeginTransformFeedbackEXT glad_glBeginTransformFeedbackEXT +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC)(); +GLAPI PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; +#define glEndTransformFeedbackEXT glad_glEndTransformFeedbackEXT +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; +#define glBindBufferRangeEXT glad_glBindBufferRangeEXT +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; +#define glBindBufferOffsetEXT glad_glBindBufferOffsetEXT +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC)(GLenum target, GLuint index, GLuint buffer); +GLAPI PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; +#define glBindBufferBaseEXT glad_glBindBufferBaseEXT +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; +#define glTransformFeedbackVaryingsEXT glad_glTransformFeedbackVaryingsEXT +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); +GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; +#define glGetTransformFeedbackVaryingEXT glad_glGetTransformFeedbackVaryingEXT +#endif +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +GLAPI int GLAD_GL_KHR_texture_compression_astc_ldr; +#endif +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +GLAPI int GLAD_GL_3DFX_multisample; +#endif +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 +GLAPI int GLAD_GL_INTEL_fragment_shader_ordering; +#endif +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +GLAPI int GLAD_GL_ARB_texture_env_dot3; +#endif +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +GLAPI int GLAD_GL_NV_gpu_program4; +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; +#define glProgramLocalParameterI4iNV glad_glProgramLocalParameterI4iNV +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); +GLAPI PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; +#define glProgramLocalParameterI4ivNV glad_glProgramLocalParameterI4ivNV +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); +GLAPI PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; +#define glProgramLocalParametersI4ivNV glad_glProgramLocalParametersI4ivNV +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; +#define glProgramLocalParameterI4uiNV glad_glProgramLocalParameterI4uiNV +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); +GLAPI PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; +#define glProgramLocalParameterI4uivNV glad_glProgramLocalParameterI4uivNV +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); +GLAPI PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; +#define glProgramLocalParametersI4uivNV glad_glProgramLocalParametersI4uivNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; +#define glProgramEnvParameterI4iNV glad_glProgramEnvParameterI4iNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); +GLAPI PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; +#define glProgramEnvParameterI4ivNV glad_glProgramEnvParameterI4ivNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); +GLAPI PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; +#define glProgramEnvParametersI4ivNV glad_glProgramEnvParametersI4ivNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; +#define glProgramEnvParameterI4uiNV glad_glProgramEnvParameterI4uiNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); +GLAPI PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; +#define glProgramEnvParameterI4uivNV glad_glProgramEnvParameterI4uivNV +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); +GLAPI PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; +#define glProgramEnvParametersI4uivNV glad_glProgramEnvParametersI4uivNV +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; +#define glGetProgramLocalParameterIivNV glad_glGetProgramLocalParameterIivNV +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; +#define glGetProgramLocalParameterIuivNV glad_glGetProgramLocalParameterIuivNV +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; +#define glGetProgramEnvParameterIivNV glad_glGetProgramEnvParameterIivNV +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; +#define glGetProgramEnvParameterIuivNV glad_glGetProgramEnvParameterIuivNV +#endif +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +GLAPI int GLAD_GL_NV_gpu_program5; +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)(GLenum target, GLsizei count, const GLuint* params); +GLAPI PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; +#define glProgramSubroutineParametersuivNV glad_glProgramSubroutineParametersuivNV +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)(GLenum target, GLuint index, GLuint* param); +GLAPI PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; +#define glGetProgramSubroutineParameteruivNV glad_glGetProgramSubroutineParameteruivNV +#endif +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +GLAPI int GLAD_GL_NV_float_buffer; +#endif +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +GLAPI int GLAD_GL_SGIS_texture_edge_clamp; +#endif +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +GLAPI int GLAD_GL_ARB_framebuffer_sRGB; +#endif +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +GLAPI int GLAD_GL_SUN_slice_accum; +#endif +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +GLAPI int GLAD_GL_EXT_index_texture; +#endif +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 +GLAPI int GLAD_GL_EXT_shader_image_load_formatted; +#endif +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +GLAPI int GLAD_GL_ARB_geometry_shader4; +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC)(GLuint program, GLenum pname, GLint value); +GLAPI PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; +#define glProgramParameteriARB glad_glProgramParameteriARB +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; +#define glFramebufferTextureARB glad_glFramebufferTextureARB +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; +#define glFramebufferTextureLayerARB glad_glFramebufferTextureLayerARB +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; +#define glFramebufferTextureFaceARB glad_glFramebufferTextureFaceARB +#endif +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +GLAPI int GLAD_GL_EXT_separate_specular_color; +#endif +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 +GLAPI int GLAD_GL_AMD_depth_clamp_separate; +#endif +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 +GLAPI int GLAD_GL_NV_conservative_raster; +typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC)(GLuint xbits, GLuint ybits); +GLAPI PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; +#define glSubpixelPrecisionBiasNV glad_glSubpixelPrecisionBiasNV +#endif +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 +GLAPI int GLAD_GL_ARB_sparse_texture2; +#endif +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +GLAPI int GLAD_GL_SGIX_sprite; +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; +#define glSpriteParameterfSGIX glad_glSpriteParameterfSGIX +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; +#define glSpriteParameterfvSGIX glad_glSpriteParameterfvSGIX +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC)(GLenum pname, GLint param); +GLAPI PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; +#define glSpriteParameteriSGIX glad_glSpriteParameteriSGIX +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; +#define glSpriteParameterivSGIX glad_glSpriteParameterivSGIX +#endif +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +GLAPI int GLAD_GL_ARB_get_program_binary; +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary); +GLAPI PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; +#define glGetProgramBinary glad_glGetProgramBinary +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); +GLAPI PFNGLPROGRAMBINARYPROC glad_glProgramBinary; +#define glProgramBinary glad_glProgramBinary +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value); +GLAPI PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; +#define glProgramParameteri glad_glProgramParameteri +#endif +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +GLAPI int GLAD_GL_AMD_occlusion_query_event; +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC)(GLenum target, GLuint id, GLenum pname, GLuint param); +GLAPI PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; +#define glQueryObjectParameteruiAMD glad_glQueryObjectParameteruiAMD +#endif +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +GLAPI int GLAD_GL_SGIS_multisample; +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC)(GLclampf value, GLboolean invert); +GLAPI PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; +#define glSampleMaskSGIS glad_glSampleMaskSGIS +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC)(GLenum pattern); +GLAPI PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; +#define glSamplePatternSGIS glad_glSamplePatternSGIS +#endif +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +GLAPI int GLAD_GL_EXT_framebuffer_object; +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +#define glIsRenderbufferEXT glad_glIsRenderbufferEXT +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +#define glBindRenderbufferEXT glad_glBindRenderbufferEXT +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint* renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint* renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +#define glIsFramebufferEXT glad_glIsFramebufferEXT +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +#define glBindFramebufferEXT glad_glBindFramebufferEXT +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint* framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint* framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +#define glGenFramebuffersEXT glad_glGenFramebuffersEXT +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +#define glGenerateMipmapEXT glad_glGenerateMipmapEXT +#endif +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +GLAPI int GLAD_GL_ARB_robustness_isolation; +#endif +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +GLAPI int GLAD_GL_ARB_vertex_array_bgra; +#endif +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +GLAPI int GLAD_GL_APPLE_vertex_array_range; +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); +GLAPI PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; +#define glVertexArrayRangeAPPLE glad_glVertexArrayRangeAPPLE +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); +GLAPI PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; +#define glFlushVertexArrayRangeAPPLE glad_glFlushVertexArrayRangeAPPLE +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)(GLenum pname, GLint param); +GLAPI PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; +#define glVertexArrayParameteriAPPLE glad_glVertexArrayParameteriAPPLE +#endif +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +GLAPI int GLAD_GL_AMD_query_buffer_object; +#endif +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +GLAPI int GLAD_GL_NV_register_combiners; +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC)(GLenum pname, const GLfloat* params); +GLAPI PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; +#define glCombinerParameterfvNV glad_glCombinerParameterfvNV +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; +#define glCombinerParameterfNV glad_glCombinerParameterfNV +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC)(GLenum pname, const GLint* params); +GLAPI PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; +#define glCombinerParameterivNV glad_glCombinerParameterivNV +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC)(GLenum pname, GLint param); +GLAPI PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; +#define glCombinerParameteriNV glad_glCombinerParameteriNV +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; +#define glCombinerInputNV glad_glCombinerInputNV +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; +#define glCombinerOutputNV glad_glCombinerOutputNV +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; +#define glFinalCombinerInputNV glad_glFinalCombinerInputNV +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; +#define glGetCombinerInputParameterfvNV glad_glGetCombinerInputParameterfvNV +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +GLAPI PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; +#define glGetCombinerInputParameterivNV glad_glGetCombinerInputParameterivNV +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; +#define glGetCombinerOutputParameterfvNV glad_glGetCombinerOutputParameterfvNV +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLint* params); +GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; +#define glGetCombinerOutputParameterivNV glad_glGetCombinerOutputParameterivNV +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)(GLenum variable, GLenum pname, GLfloat* params); +GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; +#define glGetFinalCombinerInputParameterfvNV glad_glGetFinalCombinerInputParameterfvNV +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)(GLenum variable, GLenum pname, GLint* params); +GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; +#define glGetFinalCombinerInputParameterivNV glad_glGetFinalCombinerInputParameterivNV +#endif +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +GLAPI int GLAD_GL_ARB_draw_buffers; +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs); +GLAPI PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; +#define glDrawBuffersARB glad_glDrawBuffersARB +#endif +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 +GLAPI int GLAD_GL_ARB_clear_texture; +typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; +#define glClearTexImage glad_glClearTexImage +typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* data); +GLAPI PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; +#define glClearTexSubImage glad_glClearTexSubImage +#endif +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +GLAPI int GLAD_GL_ARB_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +#define glDebugMessageControlARB glad_glDebugMessageControlARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +#define glDebugMessageInsertARB glad_glDebugMessageInsertARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB +#endif +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +GLAPI int GLAD_GL_SGI_color_matrix; +#endif +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +GLAPI int GLAD_GL_EXT_cull_vertex; +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC)(GLenum pname, GLdouble* params); +GLAPI PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; +#define glCullParameterdvEXT glad_glCullParameterdvEXT +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC)(GLenum pname, GLfloat* params); +GLAPI PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; +#define glCullParameterfvEXT glad_glCullParameterfvEXT +#endif +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +GLAPI int GLAD_GL_EXT_texture_sRGB; +#endif +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +GLAPI int GLAD_GL_APPLE_row_bytes; +#endif +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +GLAPI int GLAD_GL_NV_texgen_reflection; +#endif +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +GLAPI int GLAD_GL_IBM_multimode_draw_arrays; +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC)(const GLenum* mode, const GLint* first, const GLsizei* count, GLsizei primcount, GLint modestride); +GLAPI PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; +#define glMultiModeDrawArraysIBM glad_glMultiModeDrawArraysIBM +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC)(const GLenum* mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount, GLint modestride); +GLAPI PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; +#define glMultiModeDrawElementsIBM glad_glMultiModeDrawElementsIBM +#endif +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +GLAPI int GLAD_GL_APPLE_vertex_array_object; +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC)(GLuint array); +GLAPI PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; +#define glBindVertexArrayAPPLE glad_glBindVertexArrayAPPLE +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC)(GLsizei n, const GLuint* arrays); +GLAPI PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; +#define glDeleteVertexArraysAPPLE glad_glDeleteVertexArraysAPPLE +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC)(GLsizei n, GLuint* arrays); +GLAPI PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; +#define glGenVertexArraysAPPLE glad_glGenVertexArraysAPPLE +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC)(GLuint array); +GLAPI PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; +#define glIsVertexArrayAPPLE glad_glIsVertexArrayAPPLE +#endif +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +GLAPI int GLAD_GL_3DFX_texture_compression_FXT1; +#endif +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 +GLAPI int GLAD_GL_NV_fragment_shader_interlock; +#endif +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +GLAPI int GLAD_GL_AMD_conservative_depth; +#endif +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +GLAPI int GLAD_GL_ARB_texture_float; +#endif +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +GLAPI int GLAD_GL_ARB_compressed_texture_pixel_storage; +#endif +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +GLAPI int GLAD_GL_SGIS_detail_texture; +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); +GLAPI PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; +#define glDetailTexFuncSGIS glad_glDetailTexFuncSGIS +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC)(GLenum target, GLfloat* points); +GLAPI PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; +#define glGetDetailTexFuncSGIS glad_glGetDetailTexFuncSGIS +#endif +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +GLAPI int GLAD_GL_ARB_draw_instanced; +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; +#define glDrawArraysInstancedARB glad_glDrawArraysInstancedARB +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +GLAPI PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; +#define glDrawElementsInstancedARB glad_glDrawElementsInstancedARB +#endif +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +GLAPI int GLAD_GL_OES_read_format; +#endif +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +GLAPI int GLAD_GL_ATI_texture_float; +#endif +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +GLAPI int GLAD_GL_ARB_texture_gather; +#endif +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 +GLAPI int GLAD_GL_AMD_vertex_shader_layer; +#endif +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +GLAPI int GLAD_GL_ARB_shading_language_include; +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC)(GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar* string); +GLAPI PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; +#define glNamedStringARB glad_glNamedStringARB +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); +GLAPI PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; +#define glDeleteNamedStringARB glad_glDeleteNamedStringARB +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC)(GLuint shader, GLsizei count, const GLchar** path, const GLint* length); +GLAPI PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; +#define glCompileShaderIncludeARB glad_glCompileShaderIncludeARB +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); +GLAPI PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; +#define glIsNamedStringARB glad_glIsNamedStringARB +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name, GLsizei bufSize, GLint* stringlen, GLchar* string); +GLAPI PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; +#define glGetNamedStringARB glad_glGetNamedStringARB +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC)(GLint namelen, const GLchar* name, GLenum pname, GLint* params); +GLAPI PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; +#define glGetNamedStringivARB glad_glGetNamedStringivARB +#endif +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +GLAPI int GLAD_GL_APPLE_client_storage; +#endif +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +GLAPI int GLAD_GL_WIN_phong_shading; +#endif +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +GLAPI int GLAD_GL_INGR_blend_func_separate; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; +#define glBlendFuncSeparateINGR glad_glBlendFuncSeparateINGR +#endif +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 +GLAPI int GLAD_GL_NV_path_rendering; +typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC)(GLsizei range); +GLAPI PFNGLGENPATHSNVPROC glad_glGenPathsNV; +#define glGenPathsNV glad_glGenPathsNV +typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC)(GLuint path, GLsizei range); +GLAPI PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; +#define glDeletePathsNV glad_glDeletePathsNV +typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC)(GLuint path); +GLAPI PFNGLISPATHNVPROC glad_glIsPathNV; +#define glIsPathNV glad_glIsPathNV +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC)(GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); +GLAPI PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; +#define glPathCommandsNV glad_glPathCommandsNV +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC)(GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +GLAPI PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; +#define glPathCoordsNV glad_glPathCoordsNV +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC)(GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); +GLAPI PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; +#define glPathSubCommandsNV glad_glPathSubCommandsNV +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC)(GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +GLAPI PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; +#define glPathSubCoordsNV glad_glPathSubCoordsNV +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC)(GLuint path, GLenum format, GLsizei length, const void* pathString); +GLAPI PFNGLPATHSTRINGNVPROC glad_glPathStringNV; +#define glPathStringNV glad_glPathStringNV +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void* charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; +#define glPathGlyphsNV glad_glPathGlyphsNV +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; +#define glPathGlyphRangeNV glad_glPathGlyphRangeNV +typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC)(GLuint resultPath, GLsizei numPaths, const GLuint* paths, const GLfloat* weights); +GLAPI PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; +#define glWeightPathsNV glad_glWeightPathsNV +typedef void (APIENTRYP PFNGLCOPYPATHNVPROC)(GLuint resultPath, GLuint srcPath); +GLAPI PFNGLCOPYPATHNVPROC glad_glCopyPathNV; +#define glCopyPathNV glad_glCopyPathNV +typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC)(GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GLAPI PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; +#define glInterpolatePathsNV glad_glInterpolatePathsNV +typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC)(GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; +#define glTransformPathNV glad_glTransformPathNV +typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, const GLint* value); +GLAPI PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; +#define glPathParameterivNV glad_glPathParameterivNV +typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC)(GLuint path, GLenum pname, GLint value); +GLAPI PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; +#define glPathParameteriNV glad_glPathParameteriNV +typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, const GLfloat* value); +GLAPI PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; +#define glPathParameterfvNV glad_glPathParameterfvNV +typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC)(GLuint path, GLenum pname, GLfloat value); +GLAPI PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; +#define glPathParameterfNV glad_glPathParameterfNV +typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC)(GLuint path, GLsizei dashCount, const GLfloat* dashArray); +GLAPI PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; +#define glPathDashArrayNV glad_glPathDashArrayNV +typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; +#define glPathStencilFuncNV glad_glPathStencilFuncNV +typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; +#define glPathStencilDepthOffsetNV glad_glPathStencilDepthOffsetNV +typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask); +GLAPI PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; +#define glStencilFillPathNV glad_glStencilFillPathNV +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask); +GLAPI PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; +#define glStencilStrokePathNV glad_glStencilStrokePathNV +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; +#define glStencilFillPathInstancedNV glad_glStencilFillPathInstancedNV +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; +#define glStencilStrokePathInstancedNV glad_glStencilStrokePathInstancedNV +typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC)(GLenum func); +GLAPI PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; +#define glPathCoverDepthFuncNV glad_glPathCoverDepthFuncNV +typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC)(GLuint path, GLenum coverMode); +GLAPI PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; +#define glCoverFillPathNV glad_glCoverFillPathNV +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC)(GLuint path, GLenum coverMode); +GLAPI PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; +#define glCoverStrokePathNV glad_glCoverStrokePathNV +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; +#define glCoverFillPathInstancedNV glad_glCoverFillPathInstancedNV +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; +#define glCoverStrokePathInstancedNV glad_glCoverStrokePathInstancedNV +typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, GLint* value); +GLAPI PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; +#define glGetPathParameterivNV glad_glGetPathParameterivNV +typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, GLfloat* value); +GLAPI PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; +#define glGetPathParameterfvNV glad_glGetPathParameterfvNV +typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC)(GLuint path, GLubyte* commands); +GLAPI PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; +#define glGetPathCommandsNV glad_glGetPathCommandsNV +typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC)(GLuint path, GLfloat* coords); +GLAPI PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; +#define glGetPathCoordsNV glad_glGetPathCoordsNV +typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC)(GLuint path, GLfloat* dashArray); +GLAPI PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; +#define glGetPathDashArrayNV glad_glGetPathDashArrayNV +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC)(GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat* metrics); +GLAPI PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; +#define glGetPathMetricsNV glad_glGetPathMetricsNV +typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC)(GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +GLAPI PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; +#define glGetPathMetricRangeNV glad_glGetPathMetricRangeNV +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC)(GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat* returnedSpacing); +GLAPI PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; +#define glGetPathSpacingNV glad_glGetPathSpacingNV +typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC)(GLuint path, GLuint mask, GLfloat x, GLfloat y); +GLAPI PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; +#define glIsPointInFillPathNV glad_glIsPointInFillPathNV +typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC)(GLuint path, GLfloat x, GLfloat y); +GLAPI PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; +#define glIsPointInStrokePathNV glad_glIsPointInStrokePathNV +typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments); +GLAPI PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; +#define glGetPathLengthNV glad_glGetPathLengthNV +typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat* y, GLfloat* tangentX, GLfloat* tangentY); +GLAPI PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; +#define glPointAlongPathNV glad_glPointAlongPathNV +typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; +#define glMatrixLoad3x2fNV glad_glMatrixLoad3x2fNV +typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; +#define glMatrixLoad3x3fNV glad_glMatrixLoad3x3fNV +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; +#define glMatrixLoadTranspose3x3fNV glad_glMatrixLoadTranspose3x3fNV +typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; +#define glMatrixMult3x2fNV glad_glMatrixMult3x2fNV +typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; +#define glMatrixMult3x3fNV glad_glMatrixMult3x3fNV +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); +GLAPI PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; +#define glMatrixMultTranspose3x3fNV glad_glMatrixMultTranspose3x3fNV +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +GLAPI PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; +#define glStencilThenCoverFillPathNV glad_glStencilThenCoverFillPathNV +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask, GLenum coverMode); +GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; +#define glStencilThenCoverStrokePathNV glad_glStencilThenCoverStrokePathNV +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; +#define glStencilThenCoverFillPathInstancedNV glad_glStencilThenCoverFillPathInstancedNV +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); +GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; +#define glStencilThenCoverStrokePathInstancedNV glad_glStencilThenCoverStrokePathInstancedNV +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC)(GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint* baseAndCount); +GLAPI PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; +#define glPathGlyphIndexRangeNV glad_glPathGlyphIndexRangeNV +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; +#define glPathGlyphIndexArrayNV glad_glPathGlyphIndexArrayNV +typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void* fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; +#define glPathMemoryGlyphIndexArrayNV glad_glPathMemoryGlyphIndexArrayNV +typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)(GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); +GLAPI PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; +#define glProgramPathFragmentInputGenNV glad_glProgramPathFragmentInputGenNV +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLfloat* params); +GLAPI PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; +#define glGetProgramResourcefvNV glad_glGetProgramResourcefvNV +typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC)(GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +GLAPI PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; +#define glPathColorGenNV glad_glPathColorGenNV +typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC)(GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +GLAPI PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; +#define glPathTexGenNV glad_glPathTexGenNV +typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC)(GLenum genMode); +GLAPI PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; +#define glPathFogGenNV glad_glPathFogGenNV +typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC)(GLenum color, GLenum pname, GLint* value); +GLAPI PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; +#define glGetPathColorGenivNV glad_glGetPathColorGenivNV +typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC)(GLenum color, GLenum pname, GLfloat* value); +GLAPI PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; +#define glGetPathColorGenfvNV glad_glGetPathColorGenfvNV +typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC)(GLenum texCoordSet, GLenum pname, GLint* value); +GLAPI PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; +#define glGetPathTexGenivNV glad_glGetPathTexGenivNV +typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC)(GLenum texCoordSet, GLenum pname, GLfloat* value); +GLAPI PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; +#define glGetPathTexGenfvNV glad_glGetPathTexGenfvNV +#endif +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 +GLAPI int GLAD_GL_NV_conservative_raster_dilate; +typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)(GLenum pname, GLfloat value); +GLAPI PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; +#define glConservativeRasterParameterfNV glad_glConservativeRasterParameterfNV +#endif +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +GLAPI int GLAD_GL_ATI_vertex_streams; +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC)(GLenum stream, GLshort x); +GLAPI PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; +#define glVertexStream1sATI glad_glVertexStream1sATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC)(GLenum stream, const GLshort* coords); +GLAPI PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; +#define glVertexStream1svATI glad_glVertexStream1svATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC)(GLenum stream, GLint x); +GLAPI PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; +#define glVertexStream1iATI glad_glVertexStream1iATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC)(GLenum stream, const GLint* coords); +GLAPI PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; +#define glVertexStream1ivATI glad_glVertexStream1ivATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC)(GLenum stream, GLfloat x); +GLAPI PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; +#define glVertexStream1fATI glad_glVertexStream1fATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC)(GLenum stream, const GLfloat* coords); +GLAPI PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; +#define glVertexStream1fvATI glad_glVertexStream1fvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC)(GLenum stream, GLdouble x); +GLAPI PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; +#define glVertexStream1dATI glad_glVertexStream1dATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC)(GLenum stream, const GLdouble* coords); +GLAPI PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; +#define glVertexStream1dvATI glad_glVertexStream1dvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC)(GLenum stream, GLshort x, GLshort y); +GLAPI PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; +#define glVertexStream2sATI glad_glVertexStream2sATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC)(GLenum stream, const GLshort* coords); +GLAPI PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; +#define glVertexStream2svATI glad_glVertexStream2svATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC)(GLenum stream, GLint x, GLint y); +GLAPI PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; +#define glVertexStream2iATI glad_glVertexStream2iATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC)(GLenum stream, const GLint* coords); +GLAPI PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; +#define glVertexStream2ivATI glad_glVertexStream2ivATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC)(GLenum stream, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; +#define glVertexStream2fATI glad_glVertexStream2fATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC)(GLenum stream, const GLfloat* coords); +GLAPI PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; +#define glVertexStream2fvATI glad_glVertexStream2fvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC)(GLenum stream, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; +#define glVertexStream2dATI glad_glVertexStream2dATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC)(GLenum stream, const GLdouble* coords); +GLAPI PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; +#define glVertexStream2dvATI glad_glVertexStream2dvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; +#define glVertexStream3sATI glad_glVertexStream3sATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); +GLAPI PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; +#define glVertexStream3svATI glad_glVertexStream3svATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC)(GLenum stream, GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; +#define glVertexStream3iATI glad_glVertexStream3iATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); +GLAPI PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; +#define glVertexStream3ivATI glad_glVertexStream3ivATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; +#define glVertexStream3fATI glad_glVertexStream3fATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); +GLAPI PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; +#define glVertexStream3fvATI glad_glVertexStream3fvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; +#define glVertexStream3dATI glad_glVertexStream3dATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); +GLAPI PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; +#define glVertexStream3dvATI glad_glVertexStream3dvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; +#define glVertexStream4sATI glad_glVertexStream4sATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC)(GLenum stream, const GLshort* coords); +GLAPI PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; +#define glVertexStream4svATI glad_glVertexStream4svATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC)(GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; +#define glVertexStream4iATI glad_glVertexStream4iATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC)(GLenum stream, const GLint* coords); +GLAPI PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; +#define glVertexStream4ivATI glad_glVertexStream4ivATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; +#define glVertexStream4fATI glad_glVertexStream4fATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC)(GLenum stream, const GLfloat* coords); +GLAPI PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; +#define glVertexStream4fvATI glad_glVertexStream4fvATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; +#define glVertexStream4dATI glad_glVertexStream4dATI +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC)(GLenum stream, const GLdouble* coords); +GLAPI PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; +#define glVertexStream4dvATI glad_glVertexStream4dvATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC)(GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; +#define glNormalStream3bATI glad_glNormalStream3bATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC)(GLenum stream, const GLbyte* coords); +GLAPI PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; +#define glNormalStream3bvATI glad_glNormalStream3bvATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC)(GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; +#define glNormalStream3sATI glad_glNormalStream3sATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); +GLAPI PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; +#define glNormalStream3svATI glad_glNormalStream3svATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC)(GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; +#define glNormalStream3iATI glad_glNormalStream3iATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); +GLAPI PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; +#define glNormalStream3ivATI glad_glNormalStream3ivATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC)(GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; +#define glNormalStream3fATI glad_glNormalStream3fATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); +GLAPI PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; +#define glNormalStream3fvATI glad_glNormalStream3fvATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC)(GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; +#define glNormalStream3dATI glad_glNormalStream3dATI +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); +GLAPI PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; +#define glNormalStream3dvATI glad_glNormalStream3dvATI +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)(GLenum stream); +GLAPI PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; +#define glClientActiveVertexStreamATI glad_glClientActiveVertexStreamATI +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC)(GLenum pname, GLint param); +GLAPI PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; +#define glVertexBlendEnviATI glad_glVertexBlendEnviATI +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; +#define glVertexBlendEnvfATI glad_glVertexBlendEnvfATI +#endif +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 +GLAPI int GLAD_GL_ARB_post_depth_coverage; +#endif +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +GLAPI int GLAD_GL_ARB_texture_non_power_of_two; +#endif +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +GLAPI int GLAD_GL_APPLE_rgb_422; +#endif +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +GLAPI int GLAD_GL_EXT_texture_lod_bias; +#endif +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 +GLAPI int GLAD_GL_ARB_gpu_shader_int64; +typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC)(GLint location, GLint64 x); +GLAPI PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; +#define glUniform1i64ARB glad_glUniform1i64ARB +typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC)(GLint location, GLint64 x, GLint64 y); +GLAPI PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; +#define glUniform2i64ARB glad_glUniform2i64ARB +typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z); +GLAPI PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; +#define glUniform3i64ARB glad_glUniform3i64ARB +typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +GLAPI PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; +#define glUniform4i64ARB glad_glUniform4i64ARB +typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; +#define glUniform1i64vARB glad_glUniform1i64vARB +typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; +#define glUniform2i64vARB glad_glUniform2i64vARB +typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; +#define glUniform3i64vARB glad_glUniform3i64vARB +typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; +#define glUniform4i64vARB glad_glUniform4i64vARB +typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC)(GLint location, GLuint64 x); +GLAPI PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; +#define glUniform1ui64ARB glad_glUniform1ui64ARB +typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y); +GLAPI PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; +#define glUniform2ui64ARB glad_glUniform2ui64ARB +typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +GLAPI PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; +#define glUniform3ui64ARB glad_glUniform3ui64ARB +typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +GLAPI PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; +#define glUniform4ui64ARB glad_glUniform4ui64ARB +typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; +#define glUniform1ui64vARB glad_glUniform1ui64vARB +typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; +#define glUniform2ui64vARB glad_glUniform2ui64vARB +typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; +#define glUniform3ui64vARB glad_glUniform3ui64vARB +typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; +#define glUniform4ui64vARB glad_glUniform4ui64vARB +typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC)(GLuint program, GLint location, GLint64* params); +GLAPI PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; +#define glGetUniformi64vARB glad_glGetUniformi64vARB +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLuint64* params); +GLAPI PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; +#define glGetUniformui64vARB glad_glGetUniformui64vARB +typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint64* params); +GLAPI PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; +#define glGetnUniformi64vARB glad_glGetnUniformi64vARB +typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint64* params); +GLAPI PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; +#define glGetnUniformui64vARB glad_glGetnUniformui64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC)(GLuint program, GLint location, GLint64 x); +GLAPI PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; +#define glProgramUniform1i64ARB glad_glProgramUniform1i64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y); +GLAPI PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; +#define glProgramUniform2i64ARB glad_glProgramUniform2i64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +GLAPI PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; +#define glProgramUniform3i64ARB glad_glProgramUniform3i64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +GLAPI PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; +#define glProgramUniform4i64ARB glad_glProgramUniform4i64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; +#define glProgramUniform1i64vARB glad_glProgramUniform1i64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; +#define glProgramUniform2i64vARB glad_glProgramUniform2i64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; +#define glProgramUniform3i64vARB glad_glProgramUniform3i64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); +GLAPI PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; +#define glProgramUniform4i64vARB glad_glProgramUniform4i64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC)(GLuint program, GLint location, GLuint64 x); +GLAPI PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; +#define glProgramUniform1ui64ARB glad_glProgramUniform1ui64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y); +GLAPI PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; +#define glProgramUniform2ui64ARB glad_glProgramUniform2ui64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +GLAPI PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; +#define glProgramUniform3ui64ARB glad_glProgramUniform3ui64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +GLAPI PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; +#define glProgramUniform4ui64ARB glad_glProgramUniform4ui64ARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; +#define glProgramUniform1ui64vARB glad_glProgramUniform1ui64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; +#define glProgramUniform2ui64vARB glad_glProgramUniform2ui64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; +#define glProgramUniform3ui64vARB glad_glProgramUniform3ui64vARB +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); +GLAPI PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; +#define glProgramUniform4ui64vARB glad_glProgramUniform4ui64vARB +#endif +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +GLAPI int GLAD_GL_ARB_seamless_cube_map; +#endif +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 +GLAPI int GLAD_GL_ARB_shader_group_vote; +#endif +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +GLAPI int GLAD_GL_NV_vdpau_interop; +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC)(const void* vdpDevice, const void* getProcAddress); +GLAPI PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; +#define glVDPAUInitNV glad_glVDPAUInitNV +typedef void (APIENTRYP PFNGLVDPAUFININVPROC)(); +GLAPI PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; +#define glVDPAUFiniNV glad_glVDPAUFiniNV +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); +GLAPI PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; +#define glVDPAURegisterVideoSurfaceNV glad_glVDPAURegisterVideoSurfaceNV +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); +GLAPI PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; +#define glVDPAURegisterOutputSurfaceNV glad_glVDPAURegisterOutputSurfaceNV +typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC)(GLvdpauSurfaceNV surface); +GLAPI PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; +#define glVDPAUIsSurfaceNV glad_glVDPAUIsSurfaceNV +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC)(GLvdpauSurfaceNV surface); +GLAPI PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; +#define glVDPAUUnregisterSurfaceNV glad_glVDPAUUnregisterSurfaceNV +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC)(GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); +GLAPI PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; +#define glVDPAUGetSurfaceivNV glad_glVDPAUGetSurfaceivNV +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC)(GLvdpauSurfaceNV surface, GLenum access); +GLAPI PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; +#define glVDPAUSurfaceAccessNV glad_glVDPAUSurfaceAccessNV +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC)(GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +GLAPI PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; +#define glVDPAUMapSurfacesNV glad_glVDPAUMapSurfacesNV +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC)(GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +GLAPI PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; +#define glVDPAUUnmapSurfacesNV glad_glVDPAUUnmapSurfacesNV +#endif +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +GLAPI int GLAD_GL_ARB_occlusion_query2; +#endif +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +GLAPI int GLAD_GL_ARB_internalformat_query2; +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); +GLAPI PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; +#define glGetInternalformati64v glad_glGetInternalformati64v +#endif +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; +#endif +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +GLAPI int GLAD_GL_SUN_vertex; +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; +#define glColor4ubVertex2fSUN glad_glColor4ubVertex2fSUN +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC)(const GLubyte* c, const GLfloat* v); +GLAPI PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; +#define glColor4ubVertex2fvSUN glad_glColor4ubVertex2fvSUN +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; +#define glColor4ubVertex3fSUN glad_glColor4ubVertex3fSUN +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC)(const GLubyte* c, const GLfloat* v); +GLAPI PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; +#define glColor4ubVertex3fvSUN glad_glColor4ubVertex3fvSUN +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; +#define glColor3fVertex3fSUN glad_glColor3fVertex3fSUN +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* v); +GLAPI PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; +#define glColor3fVertex3fvSUN glad_glColor3fVertex3fvSUN +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC)(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; +#define glNormal3fVertex3fSUN glad_glNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* n, const GLfloat* v); +GLAPI PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; +#define glNormal3fVertex3fvSUN glad_glNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; +#define glColor4fNormal3fVertex3fSUN glad_glColor4fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; +#define glColor4fNormal3fVertex3fvSUN glad_glColor4fNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; +#define glTexCoord2fVertex3fSUN glad_glTexCoord2fVertex3fSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* v); +GLAPI PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; +#define glTexCoord2fVertex3fvSUN glad_glTexCoord2fVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; +#define glTexCoord4fVertex4fSUN glad_glTexCoord4fVertex4fSUN +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* v); +GLAPI PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; +#define glTexCoord4fVertex4fvSUN glad_glTexCoord4fVertex4fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; +#define glTexCoord2fColor4ubVertex3fSUN glad_glTexCoord2fColor4ubVertex3fSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)(const GLfloat* tc, const GLubyte* c, const GLfloat* v); +GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; +#define glTexCoord2fColor4ubVertex3fvSUN glad_glTexCoord2fColor4ubVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; +#define glTexCoord2fColor3fVertex3fSUN glad_glTexCoord2fColor3fVertex3fSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* v); +GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; +#define glTexCoord2fColor3fVertex3fvSUN glad_glTexCoord2fColor3fVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; +#define glTexCoord2fNormal3fVertex3fSUN glad_glTexCoord2fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; +#define glTexCoord2fNormal3fVertex3fvSUN glad_glTexCoord2fNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; +#define glTexCoord2fColor4fNormal3fVertex3fSUN glad_glTexCoord2fColor4fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; +#define glTexCoord2fColor4fNormal3fVertex3fvSUN glad_glTexCoord2fColor4fNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; +#define glTexCoord4fColor4fNormal3fVertex4fSUN glad_glTexCoord4fColor4fNormal3fVertex4fSUN +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; +#define glTexCoord4fColor4fNormal3fVertex4fvSUN glad_glTexCoord4fColor4fNormal3fVertex4fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)(GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; +#define glReplacementCodeuiVertex3fSUN glad_glReplacementCodeuiVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; +#define glReplacementCodeuiVertex3fvSUN glad_glReplacementCodeuiVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; +#define glReplacementCodeuiColor4ubVertex3fSUN glad_glReplacementCodeuiColor4ubVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)(const GLuint* rc, const GLubyte* c, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; +#define glReplacementCodeuiColor4ubVertex3fvSUN glad_glReplacementCodeuiColor4ubVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; +#define glReplacementCodeuiColor3fVertex3fSUN glad_glReplacementCodeuiColor3fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; +#define glReplacementCodeuiColor3fVertex3fvSUN glad_glReplacementCodeuiColor3fVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; +#define glReplacementCodeuiNormal3fVertex3fSUN glad_glReplacementCodeuiNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; +#define glReplacementCodeuiNormal3fVertex3fvSUN glad_glReplacementCodeuiNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; +#define glReplacementCodeuiTexCoord2fVertex3fSUN glad_glReplacementCodeuiTexCoord2fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; +#define glReplacementCodeuiTexCoord2fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); +GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN +#endif +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +GLAPI int GLAD_GL_SGIX_igloo_interface; +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC)(GLenum pname, const void* params); +GLAPI PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; +#define glIglooInterfaceSGIX glad_glIglooInterfaceSGIX +#endif +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +GLAPI int GLAD_GL_SGIS_texture_lod; +#endif +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +GLAPI int GLAD_GL_NV_vertex_program3; +#endif +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +GLAPI int GLAD_GL_ARB_draw_indirect; +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect); +GLAPI PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; +#define glDrawArraysIndirect glad_glDrawArraysIndirect +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect); +GLAPI PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; +#define glDrawElementsIndirect glad_glDrawElementsIndirect +#endif +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +GLAPI int GLAD_GL_NV_vertex_program4; +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC)(GLuint index, GLint x); +GLAPI PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; +#define glVertexAttribI1iEXT glad_glVertexAttribI1iEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC)(GLuint index, GLint x, GLint y); +GLAPI PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; +#define glVertexAttribI2iEXT glad_glVertexAttribI2iEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC)(GLuint index, GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; +#define glVertexAttribI3iEXT glad_glVertexAttribI3iEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; +#define glVertexAttribI4iEXT glad_glVertexAttribI4iEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC)(GLuint index, GLuint x); +GLAPI PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; +#define glVertexAttribI1uiEXT glad_glVertexAttribI1uiEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC)(GLuint index, GLuint x, GLuint y); +GLAPI PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; +#define glVertexAttribI2uiEXT glad_glVertexAttribI2uiEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; +#define glVertexAttribI3uiEXT glad_glVertexAttribI3uiEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; +#define glVertexAttribI4uiEXT glad_glVertexAttribI4uiEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; +#define glVertexAttribI1ivEXT glad_glVertexAttribI1ivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; +#define glVertexAttribI2ivEXT glad_glVertexAttribI2ivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; +#define glVertexAttribI3ivEXT glad_glVertexAttribI3ivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; +#define glVertexAttribI4ivEXT glad_glVertexAttribI4ivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; +#define glVertexAttribI1uivEXT glad_glVertexAttribI1uivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; +#define glVertexAttribI2uivEXT glad_glVertexAttribI2uivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; +#define glVertexAttribI3uivEXT glad_glVertexAttribI3uivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; +#define glVertexAttribI4uivEXT glad_glVertexAttribI4uivEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; +#define glVertexAttribI4bvEXT glad_glVertexAttribI4bvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; +#define glVertexAttribI4svEXT glad_glVertexAttribI4svEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; +#define glVertexAttribI4ubvEXT glad_glVertexAttribI4ubvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; +#define glVertexAttribI4usvEXT glad_glVertexAttribI4usvEXT +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; +#define glVertexAttribIPointerEXT glad_glVertexAttribIPointerEXT +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; +#define glGetVertexAttribIivEXT glad_glGetVertexAttribIivEXT +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC)(GLuint index, GLenum pname, GLuint* params); +GLAPI PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; +#define glGetVertexAttribIuivEXT glad_glGetVertexAttribIuivEXT +#endif +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +GLAPI int GLAD_GL_AMD_transform_feedback3_lines_triangles; +#endif +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +GLAPI int GLAD_GL_SGIS_fog_function; +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC)(GLsizei n, const GLfloat* points); +GLAPI PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; +#define glFogFuncSGIS glad_glFogFuncSGIS +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC)(GLfloat* points); +GLAPI PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; +#define glGetFogFuncSGIS glad_glGetFogFuncSGIS +#endif +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 +GLAPI int GLAD_GL_EXT_x11_sync_object; +typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC)(GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +GLAPI PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; +#define glImportSyncEXT glad_glImportSyncEXT +#endif +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +GLAPI int GLAD_GL_ARB_sync; +#endif +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 +GLAPI int GLAD_GL_NV_sample_locations; +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; +#define glFramebufferSampleLocationsfvNV glad_glFramebufferSampleLocationsfvNV +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; +#define glNamedFramebufferSampleLocationsfvNV glad_glNamedFramebufferSampleLocationsfvNV +typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC)(); +GLAPI PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; +#define glResolveDepthValuesNV glad_glResolveDepthValuesNV +#endif +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 +GLAPI int GLAD_GL_ARB_compute_variable_group_size; +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +GLAPI PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; +#define glDispatchComputeGroupSizeARB glad_glDispatchComputeGroupSizeARB +#endif +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +GLAPI int GLAD_GL_OES_fixed_point; +typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC)(GLenum func, GLfixed ref); +GLAPI PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; +#define glAlphaFuncxOES glad_glAlphaFuncxOES +typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; +#define glClearColorxOES glad_glClearColorxOES +typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC)(GLfixed depth); +GLAPI PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; +#define glClearDepthxOES glad_glClearDepthxOES +typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC)(GLenum plane, const GLfixed* equation); +GLAPI PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; +#define glClipPlanexOES glad_glClipPlanexOES +typedef void (APIENTRYP PFNGLCOLOR4XOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCOLOR4XOESPROC glad_glColor4xOES; +#define glColor4xOES glad_glColor4xOES +typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC)(GLfixed n, GLfixed f); +GLAPI PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; +#define glDepthRangexOES glad_glDepthRangexOES +typedef void (APIENTRYP PFNGLFOGXOESPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLFOGXOESPROC glad_glFogxOES; +#define glFogxOES glad_glFogxOES +typedef void (APIENTRYP PFNGLFOGXVOESPROC)(GLenum pname, const GLfixed* param); +GLAPI PFNGLFOGXVOESPROC glad_glFogxvOES; +#define glFogxvOES glad_glFogxvOES +typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; +#define glFrustumxOES glad_glFrustumxOES +typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC)(GLenum plane, GLfixed* equation); +GLAPI PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; +#define glGetClipPlanexOES glad_glGetClipPlanexOES +typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC)(GLenum pname, GLfixed* params); +GLAPI PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; +#define glGetFixedvOES glad_glGetFixedvOES +typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); +GLAPI PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; +#define glGetTexEnvxvOES glad_glGetTexEnvxvOES +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); +GLAPI PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; +#define glGetTexParameterxvOES glad_glGetTexParameterxvOES +typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; +#define glLightModelxOES glad_glLightModelxOES +typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC)(GLenum pname, const GLfixed* param); +GLAPI PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; +#define glLightModelxvOES glad_glLightModelxvOES +typedef void (APIENTRYP PFNGLLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed param); +GLAPI PFNGLLIGHTXOESPROC glad_glLightxOES; +#define glLightxOES glad_glLightxOES +typedef void (APIENTRYP PFNGLLIGHTXVOESPROC)(GLenum light, GLenum pname, const GLfixed* params); +GLAPI PFNGLLIGHTXVOESPROC glad_glLightxvOES; +#define glLightxvOES glad_glLightxvOES +typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC)(GLfixed width); +GLAPI PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; +#define glLineWidthxOES glad_glLineWidthxOES +typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC)(const GLfixed* m); +GLAPI PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; +#define glLoadMatrixxOES glad_glLoadMatrixxOES +typedef void (APIENTRYP PFNGLMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); +GLAPI PFNGLMATERIALXOESPROC glad_glMaterialxOES; +#define glMaterialxOES glad_glMaterialxOES +typedef void (APIENTRYP PFNGLMATERIALXVOESPROC)(GLenum face, GLenum pname, const GLfixed* param); +GLAPI PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; +#define glMaterialxvOES glad_glMaterialxvOES +typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC)(const GLfixed* m); +GLAPI PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; +#define glMultMatrixxOES glad_glMultMatrixxOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; +#define glMultiTexCoord4xOES glad_glMultiTexCoord4xOES +typedef void (APIENTRYP PFNGLNORMAL3XOESPROC)(GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI PFNGLNORMAL3XOESPROC glad_glNormal3xOES; +#define glNormal3xOES glad_glNormal3xOES +typedef void (APIENTRYP PFNGLORTHOXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI PFNGLORTHOXOESPROC glad_glOrthoxOES; +#define glOrthoxOES glad_glOrthoxOES +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC)(GLenum pname, const GLfixed* params); +GLAPI PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; +#define glPointParameterxvOES glad_glPointParameterxvOES +typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC)(GLfixed size); +GLAPI PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; +#define glPointSizexOES glad_glPointSizexOES +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC)(GLfixed factor, GLfixed units); +GLAPI PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; +#define glPolygonOffsetxOES glad_glPolygonOffsetxOES +typedef void (APIENTRYP PFNGLROTATEXOESPROC)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLROTATEXOESPROC glad_glRotatexOES; +#define glRotatexOES glad_glRotatexOES +typedef void (APIENTRYP PFNGLSCALEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLSCALEXOESPROC glad_glScalexOES; +#define glScalexOES glad_glScalexOES +typedef void (APIENTRYP PFNGLTEXENVXOESPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXENVXOESPROC glad_glTexEnvxOES; +#define glTexEnvxOES glad_glTexEnvxOES +typedef void (APIENTRYP PFNGLTEXENVXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); +GLAPI PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; +#define glTexEnvxvOES glad_glTexEnvxvOES +typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; +#define glTexParameterxOES glad_glTexParameterxOES +typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); +GLAPI PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; +#define glTexParameterxvOES glad_glTexParameterxvOES +typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; +#define glTranslatexOES glad_glTranslatexOES +typedef void (APIENTRYP PFNGLGETLIGHTXVOESPROC)(GLenum light, GLenum pname, GLfixed* params); +GLAPI PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; +#define glGetLightxvOES glad_glGetLightxvOES +typedef void (APIENTRYP PFNGLGETMATERIALXVOESPROC)(GLenum face, GLenum pname, GLfixed* params); +GLAPI PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; +#define glGetMaterialxvOES glad_glGetMaterialxvOES +typedef void (APIENTRYP PFNGLPOINTPARAMETERXOESPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; +#define glPointParameterxOES glad_glPointParameterxOES +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC)(GLclampx value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; +#define glSampleCoveragexOES glad_glSampleCoveragexOES +typedef void (APIENTRYP PFNGLACCUMXOESPROC)(GLenum op, GLfixed value); +GLAPI PFNGLACCUMXOESPROC glad_glAccumxOES; +#define glAccumxOES glad_glAccumxOES +typedef void (APIENTRYP PFNGLBITMAPXOESPROC)(GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte* bitmap); +GLAPI PFNGLBITMAPXOESPROC glad_glBitmapxOES; +#define glBitmapxOES glad_glBitmapxOES +typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; +#define glBlendColorxOES glad_glBlendColorxOES +typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; +#define glClearAccumxOES glad_glClearAccumxOES +typedef void (APIENTRYP PFNGLCOLOR3XOESPROC)(GLfixed red, GLfixed green, GLfixed blue); +GLAPI PFNGLCOLOR3XOESPROC glad_glColor3xOES; +#define glColor3xOES glad_glColor3xOES +typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC)(const GLfixed* components); +GLAPI PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; +#define glColor3xvOES glad_glColor3xvOES +typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC)(const GLfixed* components); +GLAPI PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; +#define glColor4xvOES glad_glColor4xvOES +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); +GLAPI PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; +#define glConvolutionParameterxOES glad_glConvolutionParameterxOES +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); +GLAPI PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; +#define glConvolutionParameterxvOES glad_glConvolutionParameterxvOES +typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC)(GLfixed u); +GLAPI PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; +#define glEvalCoord1xOES glad_glEvalCoord1xOES +typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; +#define glEvalCoord1xvOES glad_glEvalCoord1xvOES +typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC)(GLfixed u, GLfixed v); +GLAPI PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; +#define glEvalCoord2xOES glad_glEvalCoord2xOES +typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; +#define glEvalCoord2xvOES glad_glEvalCoord2xvOES +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC)(GLsizei n, GLenum type, const GLfixed* buffer); +GLAPI PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; +#define glFeedbackBufferxOES glad_glFeedbackBufferxOES +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); +GLAPI PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; +#define glGetConvolutionParameterxvOES glad_glGetConvolutionParameterxvOES +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); +GLAPI PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; +#define glGetHistogramParameterxvOES glad_glGetHistogramParameterxvOES +typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed* params); +GLAPI PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; +#define glGetLightxOES glad_glGetLightxOES +typedef void (APIENTRYP PFNGLGETMAPXVOESPROC)(GLenum target, GLenum query, GLfixed* v); +GLAPI PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; +#define glGetMapxvOES glad_glGetMapxvOES +typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); +GLAPI PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; +#define glGetMaterialxOES glad_glGetMaterialxOES +typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC)(GLenum map, GLint size, GLfixed* values); +GLAPI PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; +#define glGetPixelMapxv glad_glGetPixelMapxv +typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC)(GLenum coord, GLenum pname, GLfixed* params); +GLAPI PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; +#define glGetTexGenxvOES glad_glGetTexGenxvOES +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC)(GLenum target, GLint level, GLenum pname, GLfixed* params); +GLAPI PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; +#define glGetTexLevelParameterxvOES glad_glGetTexLevelParameterxvOES +typedef void (APIENTRYP PFNGLINDEXXOESPROC)(GLfixed component); +GLAPI PFNGLINDEXXOESPROC glad_glIndexxOES; +#define glIndexxOES glad_glIndexxOES +typedef void (APIENTRYP PFNGLINDEXXVOESPROC)(const GLfixed* component); +GLAPI PFNGLINDEXXVOESPROC glad_glIndexxvOES; +#define glIndexxvOES glad_glIndexxvOES +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); +GLAPI PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; +#define glLoadTransposeMatrixxOES glad_glLoadTransposeMatrixxOES +typedef void (APIENTRYP PFNGLMAP1XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +GLAPI PFNGLMAP1XOESPROC glad_glMap1xOES; +#define glMap1xOES glad_glMap1xOES +typedef void (APIENTRYP PFNGLMAP2XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +GLAPI PFNGLMAP2XOESPROC glad_glMap2xOES; +#define glMap2xOES glad_glMap2xOES +typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC)(GLint n, GLfixed u1, GLfixed u2); +GLAPI PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; +#define glMapGrid1xOES glad_glMapGrid1xOES +typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC)(GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +GLAPI PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; +#define glMapGrid2xOES glad_glMapGrid2xOES +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); +GLAPI PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; +#define glMultTransposeMatrixxOES glad_glMultTransposeMatrixxOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC)(GLenum texture, GLfixed s); +GLAPI PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; +#define glMultiTexCoord1xOES glad_glMultiTexCoord1xOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC)(GLenum texture, const GLfixed* coords); +GLAPI PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; +#define glMultiTexCoord1xvOES glad_glMultiTexCoord1xvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC)(GLenum texture, GLfixed s, GLfixed t); +GLAPI PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; +#define glMultiTexCoord2xOES glad_glMultiTexCoord2xOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC)(GLenum texture, const GLfixed* coords); +GLAPI PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; +#define glMultiTexCoord2xvOES glad_glMultiTexCoord2xvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r); +GLAPI PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; +#define glMultiTexCoord3xOES glad_glMultiTexCoord3xOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC)(GLenum texture, const GLfixed* coords); +GLAPI PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; +#define glMultiTexCoord3xvOES glad_glMultiTexCoord3xvOES +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC)(GLenum texture, const GLfixed* coords); +GLAPI PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; +#define glMultiTexCoord4xvOES glad_glMultiTexCoord4xvOES +typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; +#define glNormal3xvOES glad_glNormal3xvOES +typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC)(GLfixed token); +GLAPI PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; +#define glPassThroughxOES glad_glPassThroughxOES +typedef void (APIENTRYP PFNGLPIXELMAPXPROC)(GLenum map, GLint size, const GLfixed* values); +GLAPI PFNGLPIXELMAPXPROC glad_glPixelMapx; +#define glPixelMapx glad_glPixelMapx +typedef void (APIENTRYP PFNGLPIXELSTOREXPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLPIXELSTOREXPROC glad_glPixelStorex; +#define glPixelStorex glad_glPixelStorex +typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC)(GLenum pname, GLfixed param); +GLAPI PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; +#define glPixelTransferxOES glad_glPixelTransferxOES +typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC)(GLfixed xfactor, GLfixed yfactor); +GLAPI PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; +#define glPixelZoomxOES glad_glPixelZoomxOES +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC)(GLsizei n, const GLuint* textures, const GLfixed* priorities); +GLAPI PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; +#define glPrioritizeTexturesxOES glad_glPrioritizeTexturesxOES +typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC)(GLfixed x, GLfixed y); +GLAPI PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; +#define glRasterPos2xOES glad_glRasterPos2xOES +typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; +#define glRasterPos2xvOES glad_glRasterPos2xvOES +typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; +#define glRasterPos3xOES glad_glRasterPos3xOES +typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; +#define glRasterPos3xvOES glad_glRasterPos3xvOES +typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC)(GLfixed x, GLfixed y, GLfixed z, GLfixed w); +GLAPI PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; +#define glRasterPos4xOES glad_glRasterPos4xOES +typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; +#define glRasterPos4xvOES glad_glRasterPos4xvOES +typedef void (APIENTRYP PFNGLRECTXOESPROC)(GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +GLAPI PFNGLRECTXOESPROC glad_glRectxOES; +#define glRectxOES glad_glRectxOES +typedef void (APIENTRYP PFNGLRECTXVOESPROC)(const GLfixed* v1, const GLfixed* v2); +GLAPI PFNGLRECTXVOESPROC glad_glRectxvOES; +#define glRectxvOES glad_glRectxvOES +typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC)(GLfixed s); +GLAPI PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; +#define glTexCoord1xOES glad_glTexCoord1xOES +typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; +#define glTexCoord1xvOES glad_glTexCoord1xvOES +typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC)(GLfixed s, GLfixed t); +GLAPI PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; +#define glTexCoord2xOES glad_glTexCoord2xOES +typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; +#define glTexCoord2xvOES glad_glTexCoord2xvOES +typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC)(GLfixed s, GLfixed t, GLfixed r); +GLAPI PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; +#define glTexCoord3xOES glad_glTexCoord3xOES +typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; +#define glTexCoord3xvOES glad_glTexCoord3xvOES +typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC)(GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; +#define glTexCoord4xOES glad_glTexCoord4xOES +typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; +#define glTexCoord4xvOES glad_glTexCoord4xvOES +typedef void (APIENTRYP PFNGLTEXGENXOESPROC)(GLenum coord, GLenum pname, GLfixed param); +GLAPI PFNGLTEXGENXOESPROC glad_glTexGenxOES; +#define glTexGenxOES glad_glTexGenxOES +typedef void (APIENTRYP PFNGLTEXGENXVOESPROC)(GLenum coord, GLenum pname, const GLfixed* params); +GLAPI PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; +#define glTexGenxvOES glad_glTexGenxvOES +typedef void (APIENTRYP PFNGLVERTEX2XOESPROC)(GLfixed x); +GLAPI PFNGLVERTEX2XOESPROC glad_glVertex2xOES; +#define glVertex2xOES glad_glVertex2xOES +typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; +#define glVertex2xvOES glad_glVertex2xvOES +typedef void (APIENTRYP PFNGLVERTEX3XOESPROC)(GLfixed x, GLfixed y); +GLAPI PFNGLVERTEX3XOESPROC glad_glVertex3xOES; +#define glVertex3xOES glad_glVertex3xOES +typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; +#define glVertex3xvOES glad_glVertex3xvOES +typedef void (APIENTRYP PFNGLVERTEX4XOESPROC)(GLfixed x, GLfixed y, GLfixed z); +GLAPI PFNGLVERTEX4XOESPROC glad_glVertex4xOES; +#define glVertex4xOES glad_glVertex4xOES +typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC)(const GLfixed* coords); +GLAPI PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; +#define glVertex4xvOES glad_glVertex4xvOES +#endif +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +GLAPI int GLAD_GL_NV_blend_square; +#endif +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +GLAPI int GLAD_GL_EXT_framebuffer_multisample; +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; +#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT +#endif +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +GLAPI int GLAD_GL_ARB_gpu_shader5; +#endif +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +GLAPI int GLAD_GL_SGIS_texture4D; +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; +#define glTexImage4DSGIS glad_glTexImage4DSGIS +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; +#define glTexSubImage4DSGIS glad_glTexSubImage4DSGIS +#endif +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +GLAPI int GLAD_GL_EXT_texture3D; +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; +#define glTexImage3DEXT glad_glTexImage3DEXT +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GLAPI PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; +#define glTexSubImage3DEXT glad_glTexSubImage3DEXT +#endif +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +GLAPI int GLAD_GL_EXT_multisample; +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC)(GLclampf value, GLboolean invert); +GLAPI PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; +#define glSampleMaskEXT glad_glSampleMaskEXT +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC)(GLenum pattern); +GLAPI PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; +#define glSamplePatternEXT glad_glSamplePatternEXT +#endif +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +GLAPI int GLAD_GL_EXT_secondary_color; +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; +#define glSecondaryColor3bEXT glad_glSecondaryColor3bEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC)(const GLbyte* v); +GLAPI PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; +#define glSecondaryColor3bvEXT glad_glSecondaryColor3bvEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; +#define glSecondaryColor3dEXT glad_glSecondaryColor3dEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC)(const GLdouble* v); +GLAPI PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; +#define glSecondaryColor3dvEXT glad_glSecondaryColor3dvEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; +#define glSecondaryColor3fEXT glad_glSecondaryColor3fEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC)(const GLfloat* v); +GLAPI PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; +#define glSecondaryColor3fvEXT glad_glSecondaryColor3fvEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; +#define glSecondaryColor3iEXT glad_glSecondaryColor3iEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC)(const GLint* v); +GLAPI PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; +#define glSecondaryColor3ivEXT glad_glSecondaryColor3ivEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; +#define glSecondaryColor3sEXT glad_glSecondaryColor3sEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC)(const GLshort* v); +GLAPI PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; +#define glSecondaryColor3svEXT glad_glSecondaryColor3svEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; +#define glSecondaryColor3ubEXT glad_glSecondaryColor3ubEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC)(const GLubyte* v); +GLAPI PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; +#define glSecondaryColor3ubvEXT glad_glSecondaryColor3ubvEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; +#define glSecondaryColor3uiEXT glad_glSecondaryColor3uiEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC)(const GLuint* v); +GLAPI PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; +#define glSecondaryColor3uivEXT glad_glSecondaryColor3uivEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; +#define glSecondaryColor3usEXT glad_glSecondaryColor3usEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC)(const GLushort* v); +GLAPI PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; +#define glSecondaryColor3usvEXT glad_glSecondaryColor3usvEXT +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); +GLAPI PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; +#define glSecondaryColorPointerEXT glad_glSecondaryColorPointerEXT +#endif +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 +GLAPI int GLAD_GL_ARB_texture_filter_minmax; +#endif +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +GLAPI int GLAD_GL_ATI_vertex_array_object; +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC)(GLsizei size, const void* pointer, GLenum usage); +GLAPI PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; +#define glNewObjectBufferATI glad_glNewObjectBufferATI +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; +#define glIsObjectBufferATI glad_glIsObjectBufferATI +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC)(GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +GLAPI PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; +#define glUpdateObjectBufferATI glad_glUpdateObjectBufferATI +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC)(GLuint buffer, GLenum pname, GLfloat* params); +GLAPI PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; +#define glGetObjectBufferfvATI glad_glGetObjectBufferfvATI +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC)(GLuint buffer, GLenum pname, GLint* params); +GLAPI PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; +#define glGetObjectBufferivATI glad_glGetObjectBufferivATI +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; +#define glFreeObjectBufferATI glad_glFreeObjectBufferATI +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC)(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; +#define glArrayObjectATI glad_glArrayObjectATI +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC)(GLenum array, GLenum pname, GLfloat* params); +GLAPI PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; +#define glGetArrayObjectfvATI glad_glGetArrayObjectfvATI +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC)(GLenum array, GLenum pname, GLint* params); +GLAPI PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; +#define glGetArrayObjectivATI glad_glGetArrayObjectivATI +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC)(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; +#define glVariantArrayObjectATI glad_glVariantArrayObjectATI +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC)(GLuint id, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; +#define glGetVariantArrayObjectfvATI glad_glGetVariantArrayObjectfvATI +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; +#define glGetVariantArrayObjectivATI glad_glGetVariantArrayObjectivATI +#endif +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 +GLAPI int GLAD_GL_ARB_parallel_shader_compile; +typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC)(GLuint count); +GLAPI PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; +#define glMaxShaderCompilerThreadsARB glad_glMaxShaderCompilerThreadsARB +#endif +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 +GLAPI int GLAD_GL_NVX_gpu_memory_info; +#endif +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 +GLAPI int GLAD_GL_ARB_sparse_texture; +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +GLAPI PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; +#define glTexPageCommitmentARB glad_glTexPageCommitmentARB +#endif +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +GLAPI int GLAD_GL_SGIS_point_line_texgen; +#endif +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 +GLAPI int GLAD_GL_ARB_sample_locations; +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; +#define glFramebufferSampleLocationsfvARB glad_glFramebufferSampleLocationsfvARB +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; +#define glNamedFramebufferSampleLocationsfvARB glad_glNamedFramebufferSampleLocationsfvARB +typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC)(); +GLAPI PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; +#define glEvaluateDepthValuesARB glad_glEvaluateDepthValuesARB +#endif +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 +GLAPI int GLAD_GL_ARB_sparse_buffer; +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC)(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; +#define glBufferPageCommitmentARB glad_glBufferPageCommitmentARB +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; +#define glNamedBufferPageCommitmentEXT glad_glNamedBufferPageCommitmentEXT +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; +#define glNamedBufferPageCommitmentARB glad_glNamedBufferPageCommitmentARB +#endif +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +GLAPI int GLAD_GL_EXT_draw_range_elements; +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); +GLAPI PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; +#define glDrawRangeElementsEXT glad_glDrawRangeElementsEXT +#endif +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +GLAPI int GLAD_GL_SGIX_blend_alpha_minmax; +#endif +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 +GLAPI int GLAD_GL_KHR_context_flush_control; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/external/glfw3/COPYING.txt b/src/external/glfw3/COPYING.txt new file mode 100644 index 00000000..8e1af084 --- /dev/null +++ b/src/external/glfw3/COPYING.txt @@ -0,0 +1,21 @@ +Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2006-2010 Camilla Berglund + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. \ No newline at end of file diff --git a/src/external/glfw3/include/GLFW/glfw3.h b/src/external/glfw3/include/GLFW/glfw3.h new file mode 100644 index 00000000..89414491 --- /dev/null +++ b/src/external/glfw3/include/GLFW/glfw3.h @@ -0,0 +1,3355 @@ +/************************************************************************* + * GLFW 3.1 - www.glfw.org + * A library for OpenGL, window and input + *------------------------------------------------------------------------ + * Copyright (c) 2002-2006 Marcus Geelnard + * Copyright (c) 2006-2010 Camilla Berglund + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would + * be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + *************************************************************************/ + +#ifndef _glfw3_h_ +#define _glfw3_h_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************************************* + * Doxygen documentation + *************************************************************************/ + +/*! @defgroup context Context handling + * + * This is the reference documentation for context related functions. For more + * information, see the @ref context. + */ +/*! @defgroup init Initialization, version and errors + * + * This is the reference documentation for initialization and termination of + * the library, version management and error handling. For more information, + * see the @ref intro. + */ +/*! @defgroup input Input handling + * + * This is the reference documentation for input related functions and types. + * For more information, see the @ref input. + */ +/*! @defgroup monitor Monitor handling + * + * This is the reference documentation for monitor related functions and types. + * For more information, see the @ref monitor. + */ +/*! @defgroup window Window handling + * + * This is the reference documentation for window related functions and types, + * including creation, deletion and event polling. For more information, see + * the @ref window. + */ + + +/************************************************************************* + * Global definitions + *************************************************************************/ + +/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ + +/* Please report any problems that you find with your compiler, which may + * be solved in this section! There are several compilers that I have not + * been able to test this file with yet. + * + * First: If we are we on Windows, we want a single define for it (_WIN32) + * (Note: For Cygwin the compiler flag -mwin32 should be used, but to + * make sure that things run smoothly for Cygwin users, we add __CYGWIN__ + * to the list of "valid Win32 identifiers", which removes the need for + * -mwin32) + */ +#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) + #define _WIN32 +#endif /* _WIN32 */ + +/* In order for extension support to be portable, we need to define an + * OpenGL function call method. We use the keyword APIENTRY, which is + * defined for Win32. (Note: Windows also needs this for ) + */ +#ifndef APIENTRY + #ifdef _WIN32 + #define APIENTRY __stdcall + #else + #define APIENTRY + #endif +#endif /* APIENTRY */ + +/* The following three defines are here solely to make some Windows-based + * files happy. Theoretically we could include , but + * it has the major drawback of severely polluting our namespace. + */ + +/* Under Windows, we need WINGDIAPI defined */ +#if !defined(WINGDIAPI) && defined(_WIN32) + #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__) + /* Microsoft Visual C++, Borland C++ Builder and Pelles C */ + #define WINGDIAPI __declspec(dllimport) + #elif defined(__LCC__) + /* LCC-Win32 */ + #define WINGDIAPI __stdcall + #else + /* Others (e.g. MinGW, Cygwin) */ + #define WINGDIAPI extern + #endif + #define GLFW_WINGDIAPI_DEFINED +#endif /* WINGDIAPI */ + +/* Some files also need CALLBACK defined */ +#if !defined(CALLBACK) && defined(_WIN32) + #if defined(_MSC_VER) + /* Microsoft Visual C++ */ + #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #else + /* Other Windows compilers */ + #define CALLBACK __stdcall + #endif + #define GLFW_CALLBACK_DEFINED +#endif /* CALLBACK */ + +/* Most GL/glu.h variants on Windows need wchar_t + * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */ +#if !defined(GLFW_INCLUDE_NONE) + #include +#endif + +/* Include the chosen client API headers. + */ +#if defined(__APPLE_CC__) + #if defined(GLFW_INCLUDE_GLCOREARB) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #elif !defined(GLFW_INCLUDE_NONE) + #if !defined(GLFW_INCLUDE_GLEXT) + #define GL_GLEXT_LEGACY + #endif + #include + #endif + #if defined(GLFW_INCLUDE_GLU) + #include + #endif +#else + #if defined(GLFW_INCLUDE_GLCOREARB) + #include + #elif defined(GLFW_INCLUDE_ES1) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #elif defined(GLFW_INCLUDE_ES2) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #elif defined(GLFW_INCLUDE_ES3) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #elif defined(GLFW_INCLUDE_ES31) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #elif !defined(GLFW_INCLUDE_NONE) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif + #endif + #if defined(GLFW_INCLUDE_GLU) + #include + #endif +#endif + +#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) + /* GLFW_DLL must be defined by applications that are linking against the DLL + * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW + * configuration header when compiling the DLL version of the library. + */ + #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" +#endif + +/* GLFWAPI is used to declare public API functions for export + * from the DLL / shared library / dynamic library. + */ +#if defined(_WIN32) && defined(_GLFW_BUILD_DLL) + /* We are building GLFW as a Win32 DLL */ + #define GLFWAPI __declspec(dllexport) +#elif defined(_WIN32) && defined(GLFW_DLL) + /* We are calling GLFW as a Win32 DLL */ + #if defined(__LCC__) + #define GLFWAPI extern + #else + #define GLFWAPI __declspec(dllimport) + #endif +#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) + /* We are building GLFW as a shared / dynamic library */ + #define GLFWAPI __attribute__((visibility("default"))) +#else + /* We are building or calling GLFW as a static library */ + #define GLFWAPI +#endif + +/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ + + +/************************************************************************* + * GLFW API tokens + *************************************************************************/ + +/*! @name GLFW version macros + * @{ */ +/*! @brief The major version number of the GLFW library. + * + * This is incremented when the API is changed in non-compatible ways. + * @ingroup init + */ +#define GLFW_VERSION_MAJOR 3 +/*! @brief The minor version number of the GLFW library. + * + * This is incremented when features are added to the API but it remains + * backward-compatible. + * @ingroup init + */ +#define GLFW_VERSION_MINOR 1 +/*! @brief The revision number of the GLFW library. + * + * This is incremented when a bug fix release is made that does not contain any + * API changes. + * @ingroup init + */ +#define GLFW_VERSION_REVISION 0 +/*! @} */ + +/*! @name Key and button actions + * @{ */ +/*! @brief The key or mouse button was released. + * + * The key or mouse button was released. + * + * @ingroup input + */ +#define GLFW_RELEASE 0 +/*! @brief The key or mouse button was pressed. + * + * The key or mouse button was pressed. + * + * @ingroup input + */ +#define GLFW_PRESS 1 +/*! @brief The key was held down until it repeated. + * + * The key was held down until it repeated. + * + * @ingroup input + */ +#define GLFW_REPEAT 2 +/*! @} */ + +/*! @defgroup keys Keyboard keys + * + * See [key input](@ref input_key) for how these are used. + * + * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), + * but re-arranged to map to 7-bit ASCII for printable keys (function keys are + * put in the 256+ range). + * + * The naming of the key codes follow these rules: + * - The US keyboard layout is used + * - Names of printable alpha-numeric characters are used (e.g. "A", "R", + * "3", etc.) + * - For non-alphanumeric characters, Unicode:ish names are used (e.g. + * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not + * correspond to the Unicode standard (usually for brevity) + * - Keys that lack a clear US mapping are named "WORLD_x" + * - For non-printable keys, custom names are used (e.g. "F4", + * "BACKSPACE", etc.) + * + * @ingroup input + * @{ + */ + +/* The unknown key */ +#define GLFW_KEY_UNKNOWN -1 + +/* Printable keys */ +#define GLFW_KEY_SPACE 32 +#define GLFW_KEY_APOSTROPHE 39 /* ' */ +#define GLFW_KEY_COMMA 44 /* , */ +#define GLFW_KEY_MINUS 45 /* - */ +#define GLFW_KEY_PERIOD 46 /* . */ +#define GLFW_KEY_SLASH 47 /* / */ +#define GLFW_KEY_0 48 +#define GLFW_KEY_1 49 +#define GLFW_KEY_2 50 +#define GLFW_KEY_3 51 +#define GLFW_KEY_4 52 +#define GLFW_KEY_5 53 +#define GLFW_KEY_6 54 +#define GLFW_KEY_7 55 +#define GLFW_KEY_8 56 +#define GLFW_KEY_9 57 +#define GLFW_KEY_SEMICOLON 59 /* ; */ +#define GLFW_KEY_EQUAL 61 /* = */ +#define GLFW_KEY_A 65 +#define GLFW_KEY_B 66 +#define GLFW_KEY_C 67 +#define GLFW_KEY_D 68 +#define GLFW_KEY_E 69 +#define GLFW_KEY_F 70 +#define GLFW_KEY_G 71 +#define GLFW_KEY_H 72 +#define GLFW_KEY_I 73 +#define GLFW_KEY_J 74 +#define GLFW_KEY_K 75 +#define GLFW_KEY_L 76 +#define GLFW_KEY_M 77 +#define GLFW_KEY_N 78 +#define GLFW_KEY_O 79 +#define GLFW_KEY_P 80 +#define GLFW_KEY_Q 81 +#define GLFW_KEY_R 82 +#define GLFW_KEY_S 83 +#define GLFW_KEY_T 84 +#define GLFW_KEY_U 85 +#define GLFW_KEY_V 86 +#define GLFW_KEY_W 87 +#define GLFW_KEY_X 88 +#define GLFW_KEY_Y 89 +#define GLFW_KEY_Z 90 +#define GLFW_KEY_LEFT_BRACKET 91 /* [ */ +#define GLFW_KEY_BACKSLASH 92 /* \ */ +#define GLFW_KEY_RIGHT_BRACKET 93 /* ] */ +#define GLFW_KEY_GRAVE_ACCENT 96 /* ` */ +#define GLFW_KEY_WORLD_1 161 /* non-US #1 */ +#define GLFW_KEY_WORLD_2 162 /* non-US #2 */ + +/* Function keys */ +#define GLFW_KEY_ESCAPE 256 +#define GLFW_KEY_ENTER 257 +#define GLFW_KEY_TAB 258 +#define GLFW_KEY_BACKSPACE 259 +#define GLFW_KEY_INSERT 260 +#define GLFW_KEY_DELETE 261 +#define GLFW_KEY_RIGHT 262 +#define GLFW_KEY_LEFT 263 +#define GLFW_KEY_DOWN 264 +#define GLFW_KEY_UP 265 +#define GLFW_KEY_PAGE_UP 266 +#define GLFW_KEY_PAGE_DOWN 267 +#define GLFW_KEY_HOME 268 +#define GLFW_KEY_END 269 +#define GLFW_KEY_CAPS_LOCK 280 +#define GLFW_KEY_SCROLL_LOCK 281 +#define GLFW_KEY_NUM_LOCK 282 +#define GLFW_KEY_PRINT_SCREEN 283 +#define GLFW_KEY_PAUSE 284 +#define GLFW_KEY_F1 290 +#define GLFW_KEY_F2 291 +#define GLFW_KEY_F3 292 +#define GLFW_KEY_F4 293 +#define GLFW_KEY_F5 294 +#define GLFW_KEY_F6 295 +#define GLFW_KEY_F7 296 +#define GLFW_KEY_F8 297 +#define GLFW_KEY_F9 298 +#define GLFW_KEY_F10 299 +#define GLFW_KEY_F11 300 +#define GLFW_KEY_F12 301 +#define GLFW_KEY_F13 302 +#define GLFW_KEY_F14 303 +#define GLFW_KEY_F15 304 +#define GLFW_KEY_F16 305 +#define GLFW_KEY_F17 306 +#define GLFW_KEY_F18 307 +#define GLFW_KEY_F19 308 +#define GLFW_KEY_F20 309 +#define GLFW_KEY_F21 310 +#define GLFW_KEY_F22 311 +#define GLFW_KEY_F23 312 +#define GLFW_KEY_F24 313 +#define GLFW_KEY_F25 314 +#define GLFW_KEY_KP_0 320 +#define GLFW_KEY_KP_1 321 +#define GLFW_KEY_KP_2 322 +#define GLFW_KEY_KP_3 323 +#define GLFW_KEY_KP_4 324 +#define GLFW_KEY_KP_5 325 +#define GLFW_KEY_KP_6 326 +#define GLFW_KEY_KP_7 327 +#define GLFW_KEY_KP_8 328 +#define GLFW_KEY_KP_9 329 +#define GLFW_KEY_KP_DECIMAL 330 +#define GLFW_KEY_KP_DIVIDE 331 +#define GLFW_KEY_KP_MULTIPLY 332 +#define GLFW_KEY_KP_SUBTRACT 333 +#define GLFW_KEY_KP_ADD 334 +#define GLFW_KEY_KP_ENTER 335 +#define GLFW_KEY_KP_EQUAL 336 +#define GLFW_KEY_LEFT_SHIFT 340 +#define GLFW_KEY_LEFT_CONTROL 341 +#define GLFW_KEY_LEFT_ALT 342 +#define GLFW_KEY_LEFT_SUPER 343 +#define GLFW_KEY_RIGHT_SHIFT 344 +#define GLFW_KEY_RIGHT_CONTROL 345 +#define GLFW_KEY_RIGHT_ALT 346 +#define GLFW_KEY_RIGHT_SUPER 347 +#define GLFW_KEY_MENU 348 +#define GLFW_KEY_LAST GLFW_KEY_MENU + +/*! @} */ + +/*! @defgroup mods Modifier key flags + * + * See [key input](@ref input_key) for how these are used. + * + * @ingroup input + * @{ */ + +/*! @brief If this bit is set one or more Shift keys were held down. + */ +#define GLFW_MOD_SHIFT 0x0001 +/*! @brief If this bit is set one or more Control keys were held down. + */ +#define GLFW_MOD_CONTROL 0x0002 +/*! @brief If this bit is set one or more Alt keys were held down. + */ +#define GLFW_MOD_ALT 0x0004 +/*! @brief If this bit is set one or more Super keys were held down. + */ +#define GLFW_MOD_SUPER 0x0008 + +/*! @} */ + +/*! @defgroup buttons Mouse buttons + * + * See [mouse button input](@ref input_mouse_button) for how these are used. + * + * @ingroup input + * @{ */ +#define GLFW_MOUSE_BUTTON_1 0 +#define GLFW_MOUSE_BUTTON_2 1 +#define GLFW_MOUSE_BUTTON_3 2 +#define GLFW_MOUSE_BUTTON_4 3 +#define GLFW_MOUSE_BUTTON_5 4 +#define GLFW_MOUSE_BUTTON_6 5 +#define GLFW_MOUSE_BUTTON_7 6 +#define GLFW_MOUSE_BUTTON_8 7 +#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 +#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 +#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 +#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 +/*! @} */ + +/*! @defgroup joysticks Joysticks + * + * See [joystick input](@ref joystick) for how these are used. + * + * @ingroup input + * @{ */ +#define GLFW_JOYSTICK_1 0 +#define GLFW_JOYSTICK_2 1 +#define GLFW_JOYSTICK_3 2 +#define GLFW_JOYSTICK_4 3 +#define GLFW_JOYSTICK_5 4 +#define GLFW_JOYSTICK_6 5 +#define GLFW_JOYSTICK_7 6 +#define GLFW_JOYSTICK_8 7 +#define GLFW_JOYSTICK_9 8 +#define GLFW_JOYSTICK_10 9 +#define GLFW_JOYSTICK_11 10 +#define GLFW_JOYSTICK_12 11 +#define GLFW_JOYSTICK_13 12 +#define GLFW_JOYSTICK_14 13 +#define GLFW_JOYSTICK_15 14 +#define GLFW_JOYSTICK_16 15 +#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 +/*! @} */ + +/*! @defgroup errors Error codes + * + * See [error handling](@ref error_handling) for how these are used. + * + * @ingroup init + * @{ */ +/*! @brief GLFW has not been initialized. + * + * This occurs if a GLFW function was called that may not be called unless the + * library is [initialized](@ref intro_init). + * + * @par Analysis + * Application programmer error. Initialize GLFW before calling any function + * that requires initialization. + */ +#define GLFW_NOT_INITIALIZED 0x00010001 +/*! @brief No context is current for this thread. + * + * This occurs if a GLFW function was called that needs and operates on the + * current OpenGL or OpenGL ES context but no context is current on the calling + * thread. One such function is @ref glfwSwapInterval. + * + * @par Analysis + * Application programmer error. Ensure a context is current before calling + * functions that require a current context. + */ +#define GLFW_NO_CURRENT_CONTEXT 0x00010002 +/*! @brief One of the arguments to the function was an invalid enum value. + * + * One of the arguments to the function was an invalid enum value, for example + * requesting [GLFW_RED_BITS](@ref window_hints_fb) with @ref + * glfwGetWindowAttrib. + * + * @par Analysis + * Application programmer error. Fix the offending call. + */ +#define GLFW_INVALID_ENUM 0x00010003 +/*! @brief One of the arguments to the function was an invalid value. + * + * One of the arguments to the function was an invalid value, for example + * requesting a non-existent OpenGL or OpenGL ES version like 2.7. + * + * Requesting a valid but unavailable OpenGL or OpenGL ES version will instead + * result in a @ref GLFW_VERSION_UNAVAILABLE error. + * + * @par Analysis + * Application programmer error. Fix the offending call. + */ +#define GLFW_INVALID_VALUE 0x00010004 +/*! @brief A memory allocation failed. + * + * A memory allocation failed. + * + * @par Analysis + * A bug in GLFW or the underlying operating system. Report the bug to our + * [issue tracker](https://github.com/glfw/glfw/issues). + */ +#define GLFW_OUT_OF_MEMORY 0x00010005 +/*! @brief GLFW could not find support for the requested client API on the + * system. + * + * GLFW could not find support for the requested client API on the system. + * + * @par Analysis + * The installed graphics driver does not support the requested client API, or + * does not support it via the chosen context creation backend. Below are + * a few examples. + * + * @par + * Some pre-installed Windows graphics drivers do not support OpenGL. AMD only + * supports OpenGL ES via EGL, while Nvidia and Intel only supports it via + * a WGL or GLX extension. OS X does not provide OpenGL ES at all. The Mesa + * EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary + * driver. + */ +#define GLFW_API_UNAVAILABLE 0x00010006 +/*! @brief The requested OpenGL or OpenGL ES version is not available. + * + * The requested OpenGL or OpenGL ES version (including any requested profile + * or context option) is not available on this machine. + * + * @par Analysis + * The machine does not support your requirements. If your application is + * sufficiently flexible, downgrade your requirements and try again. + * Otherwise, inform the user that their machine does not match your + * requirements. + * + * @par + * Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 + * comes out before the 4.x series gets that far, also fail with this error and + * not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions + * will exist. + */ +#define GLFW_VERSION_UNAVAILABLE 0x00010007 +/*! @brief A platform-specific error occurred that does not match any of the + * more specific categories. + * + * A platform-specific error occurred that does not match any of the more + * specific categories. + * + * @par Analysis + * A bug in GLFW or the underlying operating system. Report the bug to our + * [issue tracker](https://github.com/glfw/glfw/issues). + */ +#define GLFW_PLATFORM_ERROR 0x00010008 +/*! @brief The requested format is not supported or available. + * + * If emitted during window creation, the requested pixel format is not + * supported. + * + * If emitted when querying the clipboard, the contents of the clipboard could + * not be converted to the requested format. + * + * @par Analysis + * If emitted during window creation, one or more + * [hard constraints](@ref window_hints_hard) did not match any of the + * available pixel formats. If your application is sufficiently flexible, + * downgrade your requirements and try again. Otherwise, inform the user that + * their machine does not match your requirements. + * + * @par + * If emitted when querying the clipboard, ignore the error or report it to + * the user, as appropriate. + */ +#define GLFW_FORMAT_UNAVAILABLE 0x00010009 +/*! @} */ + +#define GLFW_FOCUSED 0x00020001 +#define GLFW_ICONIFIED 0x00020002 +#define GLFW_RESIZABLE 0x00020003 +#define GLFW_VISIBLE 0x00020004 +#define GLFW_DECORATED 0x00020005 +#define GLFW_AUTO_ICONIFY 0x00020006 +#define GLFW_FLOATING 0x00020007 + +#define GLFW_RED_BITS 0x00021001 +#define GLFW_GREEN_BITS 0x00021002 +#define GLFW_BLUE_BITS 0x00021003 +#define GLFW_ALPHA_BITS 0x00021004 +#define GLFW_DEPTH_BITS 0x00021005 +#define GLFW_STENCIL_BITS 0x00021006 +#define GLFW_ACCUM_RED_BITS 0x00021007 +#define GLFW_ACCUM_GREEN_BITS 0x00021008 +#define GLFW_ACCUM_BLUE_BITS 0x00021009 +#define GLFW_ACCUM_ALPHA_BITS 0x0002100A +#define GLFW_AUX_BUFFERS 0x0002100B +#define GLFW_STEREO 0x0002100C +#define GLFW_SAMPLES 0x0002100D +#define GLFW_SRGB_CAPABLE 0x0002100E +#define GLFW_REFRESH_RATE 0x0002100F +#define GLFW_DOUBLEBUFFER 0x00021010 + +#define GLFW_CLIENT_API 0x00022001 +#define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 +#define GLFW_CONTEXT_VERSION_MINOR 0x00022003 +#define GLFW_CONTEXT_REVISION 0x00022004 +#define GLFW_CONTEXT_ROBUSTNESS 0x00022005 +#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 +#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 +#define GLFW_OPENGL_PROFILE 0x00022008 +#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 + +#define GLFW_OPENGL_API 0x00030001 +#define GLFW_OPENGL_ES_API 0x00030002 + +#define GLFW_NO_ROBUSTNESS 0 +#define GLFW_NO_RESET_NOTIFICATION 0x00031001 +#define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002 + +#define GLFW_OPENGL_ANY_PROFILE 0 +#define GLFW_OPENGL_CORE_PROFILE 0x00032001 +#define GLFW_OPENGL_COMPAT_PROFILE 0x00032002 + +#define GLFW_CURSOR 0x00033001 +#define GLFW_STICKY_KEYS 0x00033002 +#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003 + +#define GLFW_CURSOR_NORMAL 0x00034001 +#define GLFW_CURSOR_HIDDEN 0x00034002 +#define GLFW_CURSOR_DISABLED 0x00034003 + +#define GLFW_ANY_RELEASE_BEHAVIOR 0 +#define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 +#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 + +/*! @defgroup shapes Standard cursor shapes + * + * See [standard cursor creation](@ref cursor_standard) for how these are used. + * + * @ingroup input + * @{ */ + +/*! @brief The regular arrow cursor shape. + * + * The regular arrow cursor. + */ +#define GLFW_ARROW_CURSOR 0x00036001 +/*! @brief The text input I-beam cursor shape. + * + * The text input I-beam cursor shape. + */ +#define GLFW_IBEAM_CURSOR 0x00036002 +/*! @brief The crosshair shape. + * + * The crosshair shape. + */ +#define GLFW_CROSSHAIR_CURSOR 0x00036003 +/*! @brief The hand shape. + * + * The hand shape. + */ +#define GLFW_HAND_CURSOR 0x00036004 +/*! @brief The horizontal resize arrow shape. + * + * The horizontal resize arrow shape. + */ +#define GLFW_HRESIZE_CURSOR 0x00036005 +/*! @brief The vertical resize arrow shape. + * + * The vertical resize arrow shape. + */ +#define GLFW_VRESIZE_CURSOR 0x00036006 +/*! @} */ + +#define GLFW_CONNECTED 0x00040001 +#define GLFW_DISCONNECTED 0x00040002 + +#define GLFW_DONT_CARE -1 + + +/************************************************************************* + * GLFW API types + *************************************************************************/ + +/*! @brief Client API function pointer type. + * + * Generic function pointer used for returning client API function pointers + * without forcing a cast from a regular pointer. + * + * @ingroup context + */ +typedef void (*GLFWglproc)(void); + +/*! @brief Opaque monitor object. + * + * Opaque monitor object. + * + * @ingroup monitor + */ +typedef struct GLFWmonitor GLFWmonitor; + +/*! @brief Opaque window object. + * + * Opaque window object. + * + * @ingroup window + */ +typedef struct GLFWwindow GLFWwindow; + +/*! @brief Opaque cursor object. + * + * Opaque cursor object. + * + * @ingroup cursor + */ +typedef struct GLFWcursor GLFWcursor; + +/*! @brief The function signature for error callbacks. + * + * This is the function signature for error callback functions. + * + * @param[in] error An [error code](@ref errors). + * @param[in] description A UTF-8 encoded string describing the error. + * + * @sa glfwSetErrorCallback + * + * @ingroup init + */ +typedef void (* GLFWerrorfun)(int,const char*); + +/*! @brief The function signature for window position callbacks. + * + * This is the function signature for window position callback functions. + * + * @param[in] window The window that was moved. + * @param[in] xpos The new x-coordinate, in screen coordinates, of the + * upper-left corner of the client area of the window. + * @param[in] ypos The new y-coordinate, in screen coordinates, of the + * upper-left corner of the client area of the window. + * + * @sa glfwSetWindowPosCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); + +/*! @brief The function signature for window resize callbacks. + * + * This is the function signature for window size callback functions. + * + * @param[in] window The window that was resized. + * @param[in] width The new width, in screen coordinates, of the window. + * @param[in] height The new height, in screen coordinates, of the window. + * + * @sa glfwSetWindowSizeCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); + +/*! @brief The function signature for window close callbacks. + * + * This is the function signature for window close callback functions. + * + * @param[in] window The window that the user attempted to close. + * + * @sa glfwSetWindowCloseCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowclosefun)(GLFWwindow*); + +/*! @brief The function signature for window content refresh callbacks. + * + * This is the function signature for window refresh callback functions. + * + * @param[in] window The window whose content needs to be refreshed. + * + * @sa glfwSetWindowRefreshCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); + +/*! @brief The function signature for window focus/defocus callbacks. + * + * This is the function signature for window focus callback functions. + * + * @param[in] window The window that gained or lost input focus. + * @param[in] focused `GL_TRUE` if the window was given input focus, or + * `GL_FALSE` if it lost it. + * + * @sa glfwSetWindowFocusCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); + +/*! @brief The function signature for window iconify/restore callbacks. + * + * This is the function signature for window iconify/restore callback + * functions. + * + * @param[in] window The window that was iconified or restored. + * @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE` + * if it was restored. + * + * @sa glfwSetWindowIconifyCallback + * + * @ingroup window + */ +typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); + +/*! @brief The function signature for framebuffer resize callbacks. + * + * This is the function signature for framebuffer resize callback + * functions. + * + * @param[in] window The window whose framebuffer was resized. + * @param[in] width The new width, in pixels, of the framebuffer. + * @param[in] height The new height, in pixels, of the framebuffer. + * + * @sa glfwSetFramebufferSizeCallback + * + * @ingroup window + */ +typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); + +/*! @brief The function signature for mouse button callbacks. + * + * This is the function signature for mouse button callback functions. + * + * @param[in] window The window that received the event. + * @param[in] button The [mouse button](@ref buttons) that was pressed or + * released. + * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. + * @param[in] mods Bit field describing which [modifier keys](@ref mods) were + * held down. + * + * @sa glfwSetMouseButtonCallback + * + * @ingroup input + */ +typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); + +/*! @brief The function signature for cursor position callbacks. + * + * This is the function signature for cursor position callback functions. + * + * @param[in] window The window that received the event. + * @param[in] xpos The new x-coordinate, in screen coordinates, of the cursor. + * @param[in] ypos The new y-coordinate, in screen coordinates, of the cursor. + * + * @sa glfwSetCursorPosCallback + * + * @ingroup input + */ +typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); + +/*! @brief The function signature for cursor enter/leave callbacks. + * + * This is the function signature for cursor enter/leave callback functions. + * + * @param[in] window The window that received the event. + * @param[in] entered `GL_TRUE` if the cursor entered the window's client + * area, or `GL_FALSE` if it left it. + * + * @sa glfwSetCursorEnterCallback + * + * @ingroup input + */ +typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); + +/*! @brief The function signature for scroll callbacks. + * + * This is the function signature for scroll callback functions. + * + * @param[in] window The window that received the event. + * @param[in] xoffset The scroll offset along the x-axis. + * @param[in] yoffset The scroll offset along the y-axis. + * + * @sa glfwSetScrollCallback + * + * @ingroup input + */ +typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); + +/*! @brief The function signature for keyboard key callbacks. + * + * This is the function signature for keyboard key callback functions. + * + * @param[in] window The window that received the event. + * @param[in] key The [keyboard key](@ref keys) that was pressed or released. + * @param[in] scancode The system-specific scancode of the key. + * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. + * @param[in] mods Bit field describing which [modifier keys](@ref mods) were + * held down. + * + * @sa glfwSetKeyCallback + * + * @ingroup input + */ +typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); + +/*! @brief The function signature for Unicode character callbacks. + * + * This is the function signature for Unicode character callback functions. + * + * @param[in] window The window that received the event. + * @param[in] codepoint The Unicode code point of the character. + * + * @sa glfwSetCharCallback + * + * @ingroup input + */ +typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); + +/*! @brief The function signature for Unicode character with modifiers + * callbacks. + * + * This is the function signature for Unicode character with modifiers callback + * functions. It is called for each input character, regardless of what + * modifier keys are held down. + * + * @param[in] window The window that received the event. + * @param[in] codepoint The Unicode code point of the character. + * @param[in] mods Bit field describing which [modifier keys](@ref mods) were + * held down. + * + * @sa glfwSetCharModsCallback + * + * @ingroup input + */ +typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); + +/*! @brief The function signature for file drop callbacks. + * + * This is the function signature for file drop callbacks. + * + * @param[in] window The window that received the event. + * @param[in] count The number of dropped files. + * @param[in] names The UTF-8 encoded path names of the dropped files. + * + * @sa glfwSetDropCallback + * + * @ingroup input + */ +typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); + +/*! @brief The function signature for monitor configuration callbacks. + * + * This is the function signature for monitor configuration callback functions. + * + * @param[in] monitor The monitor that was connected or disconnected. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. + * + * @sa glfwSetMonitorCallback + * + * @ingroup monitor + */ +typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); + +/*! @brief Video mode type. + * + * This describes a single video mode. + * + * @ingroup monitor + */ +typedef struct GLFWvidmode +{ + /*! The width, in screen coordinates, of the video mode. + */ + int width; + /*! The height, in screen coordinates, of the video mode. + */ + int height; + /*! The bit depth of the red channel of the video mode. + */ + int redBits; + /*! The bit depth of the green channel of the video mode. + */ + int greenBits; + /*! The bit depth of the blue channel of the video mode. + */ + int blueBits; + /*! The refresh rate, in Hz, of the video mode. + */ + int refreshRate; +} GLFWvidmode; + +/*! @brief Gamma ramp. + * + * This describes the gamma ramp for a monitor. + * + * @sa glfwGetGammaRamp glfwSetGammaRamp + * + * @ingroup monitor + */ +typedef struct GLFWgammaramp +{ + /*! An array of value describing the response of the red channel. + */ + unsigned short* red; + /*! An array of value describing the response of the green channel. + */ + unsigned short* green; + /*! An array of value describing the response of the blue channel. + */ + unsigned short* blue; + /*! The number of elements in each array. + */ + unsigned int size; +} GLFWgammaramp; + +/*! @brief Image data. + */ +typedef struct GLFWimage +{ + /*! The width, in pixels, of this image. + */ + int width; + /*! The height, in pixels, of this image. + */ + int height; + /*! The pixel data of this image, arranged left-to-right, top-to-bottom. + */ + unsigned char* pixels; +} GLFWimage; + + +/************************************************************************* + * GLFW API functions + *************************************************************************/ + +/*! @brief Initializes the GLFW library. + * + * This function initializes the GLFW library. Before most GLFW functions can + * be used, GLFW must be initialized, and before an application terminates GLFW + * should be terminated in order to free any resources allocated during or + * after initialization. + * + * If this function fails, it calls @ref glfwTerminate before returning. If it + * succeeds, you should call @ref glfwTerminate before the application exits. + * + * Additional calls to this function after successful initialization but before + * termination will return `GL_TRUE` immediately. + * + * @return `GL_TRUE` if successful, or `GL_FALSE` if an + * [error](@ref error_handling) occurred. + * + * @remarks __OS X:__ This function will change the current directory of the + * application to the `Contents/Resources` subdirectory of the application's + * bundle, if present. This can be disabled with a + * [compile-time option](@ref compile_options_osx). + * + * @remarks __X11:__ If the `LC_CTYPE` category of the current locale is set to + * `"C"` then the environment's locale will be applied to that category. This + * is done because character input will not function when `LC_CTYPE` is set to + * `"C"`. If another locale was set before this function was called, it will + * be left untouched. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref intro_init + * @sa glfwTerminate + * + * @since Added in GLFW 1.0. + * + * @ingroup init + */ +GLFWAPI int glfwInit(void); + +/*! @brief Terminates the GLFW library. + * + * This function destroys all remaining windows and cursors, restores any + * modified gamma ramps and frees any other allocated resources. Once this + * function is called, you must again call @ref glfwInit successfully before + * you will be able to use most GLFW functions. + * + * If GLFW has been successfully initialized, this function should be called + * before the application exits. If initialization fails, there is no need to + * call this function, as it is called by @ref glfwInit before it returns + * failure. + * + * @remarks This function may be called before @ref glfwInit. + * + * @warning No window's context may be current on another thread when this + * function is called. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref intro_init + * @sa glfwInit + * + * @since Added in GLFW 1.0. + * + * @ingroup init + */ +GLFWAPI void glfwTerminate(void); + +/*! @brief Retrieves the version of the GLFW library. + * + * This function retrieves the major, minor and revision numbers of the GLFW + * library. It is intended for when you are using GLFW as a shared library and + * want to ensure that you are using the minimum required version. + * + * Any or all of the version arguments may be `NULL`. This function always + * succeeds. + * + * @param[out] major Where to store the major version number, or `NULL`. + * @param[out] minor Where to store the minor version number, or `NULL`. + * @param[out] rev Where to store the revision number, or `NULL`. + * + * @remarks This function may be called before @ref glfwInit. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref intro_version + * @sa glfwGetVersionString + * + * @since Added in GLFW 1.0. + * + * @ingroup init + */ +GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); + +/*! @brief Returns a string describing the compile-time configuration. + * + * This function returns the compile-time generated + * [version string](@ref intro_version_string) of the GLFW library binary. It + * describes the version, platform, compiler and any platform-specific + * compile-time options. + * + * __Do not use the version string__ to parse the GLFW library version. The + * @ref glfwGetVersion function already provides the version of the running + * library binary. + * + * This function always succeeds. + * + * @return The GLFW version string. + * + * @remarks This function may be called before @ref glfwInit. + * + * @par Pointer Lifetime + * The returned string is static and compile-time generated. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref intro_version + * @sa glfwGetVersion + * + * @since Added in GLFW 3.0. + * + * @ingroup init + */ +GLFWAPI const char* glfwGetVersionString(void); + +/*! @brief Sets the error callback. + * + * This function sets the error callback, which is called with an error code + * and a human-readable description each time a GLFW error occurs. + * + * The error callback is called on the thread where the error occurred. If you + * are using GLFW from multiple threads, your error callback needs to be + * written accordingly. + * + * Because the description string may have been generated specifically for that + * error, it is not guaranteed to be valid after the callback has returned. If + * you wish to use it after the callback returns, you need to make a copy. + * + * Once set, the error callback remains set even after the library has been + * terminated. + * + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set. + * + * @remarks This function may be called before @ref glfwInit. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref error_handling + * + * @since Added in GLFW 3.0. + * + * @ingroup init + */ +GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); + +/*! @brief Returns the currently connected monitors. + * + * This function returns an array of handles for all currently connected + * monitors. + * + * @param[out] count Where to store the number of monitors in the returned + * array. This is set to zero if an error occurred. + * @return An array of monitor handles, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned array is allocated and freed by GLFW. You should not free it + * yourself. It is guaranteed to be valid only until the monitor configuration + * changes or the library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_monitors + * @sa @ref monitor_event + * @sa glfwGetPrimaryMonitor + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); + +/*! @brief Returns the primary monitor. + * + * This function returns the primary monitor. This is usually the monitor + * where elements like the Windows task bar or the OS X menu bar is located. + * + * @return The primary monitor, or `NULL` if an [error](@ref error_handling) + * occurred. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_monitors + * @sa glfwGetMonitors + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); + +/*! @brief Returns the position of the monitor's viewport on the virtual screen. + * + * This function returns the position, in screen coordinates, of the upper-left + * corner of the specified monitor. + * + * Any or all of the position arguments may be `NULL`. If an error occurs, all + * non-`NULL` position arguments will be set to zero. + * + * @param[in] monitor The monitor to query. + * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. + * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_properties + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); + +/*! @brief Returns the physical size of the monitor. + * + * This function returns the size, in millimetres, of the display area of the + * specified monitor. + * + * Some systems do not provide accurate monitor size information, either + * because the monitor + * [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data) + * data is incorrect or because the driver does not report it accurately. + * + * Any or all of the size arguments may be `NULL`. If an error occurs, all + * non-`NULL` size arguments will be set to zero. + * + * @param[in] monitor The monitor to query. + * @param[out] widthMM Where to store the width, in millimetres, of the + * monitor's display area, or `NULL`. + * @param[out] heightMM Where to store the height, in millimetres, of the + * monitor's display area, or `NULL`. + * + * @remarks __Windows:__ The OS calculates the returned physical size from the + * current resolution and system DPI instead of querying the monitor EDID data. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_properties + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM); + +/*! @brief Returns the name of the specified monitor. + * + * This function returns a human-readable name, encoded as UTF-8, of the + * specified monitor. The name typically reflects the make and model of the + * monitor and is not guaranteed to be unique among the connected monitors. + * + * @param[in] monitor The monitor to query. + * @return The UTF-8 encoded name of the monitor, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned string is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified monitor is disconnected or the + * library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_properties + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); + +/*! @brief Sets the monitor configuration callback. + * + * This function sets the monitor configuration callback, or removes the + * currently set callback. This is called when a monitor is connected to or + * disconnected from the system. + * + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @bug __X11:__ This callback is not yet called on monitor configuration + * changes. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_event + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); + +/*! @brief Returns the available video modes for the specified monitor. + * + * This function returns an array of all video modes supported by the specified + * monitor. The returned array is sorted in ascending order, first by color + * bit depth (the sum of all channel depths) and then by resolution area (the + * product of width and height). + * + * @param[in] monitor The monitor to query. + * @param[out] count Where to store the number of video modes in the returned + * array. This is set to zero if an error occurred. + * @return An array of video modes, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned array is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified monitor is disconnected, this + * function is called again for that monitor or the library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_modes + * @sa glfwGetVideoMode + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Changed to return an array of modes for a specific monitor. + * + * @ingroup monitor + */ +GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); + +/*! @brief Returns the current mode of the specified monitor. + * + * This function returns the current video mode of the specified monitor. If + * you have created a full screen window for that monitor, the return value + * will depend on whether that window is iconified. + * + * @param[in] monitor The monitor to query. + * @return The current mode of the monitor, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned array is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified monitor is disconnected or the + * library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_modes + * @sa glfwGetVideoModes + * + * @since Added in GLFW 3.0. Replaces `glfwGetDesktopMode`. + * + * @ingroup monitor + */ +GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); + +/*! @brief Generates a gamma ramp and sets it for the specified monitor. + * + * This function generates a 256-element gamma ramp from the specified exponent + * and then calls @ref glfwSetGammaRamp with it. + * + * @param[in] monitor The monitor whose gamma ramp to set. + * @param[in] gamma The desired exponent. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_gamma + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); + +/*! @brief Returns the current gamma ramp for the specified monitor. + * + * This function returns the current gamma ramp of the specified monitor. + * + * @param[in] monitor The monitor to query. + * @return The current gamma ramp, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned structure and its arrays are allocated and freed by GLFW. You + * should not free them yourself. They are valid until the specified monitor + * is disconnected, this function is called again for that monitor or the + * library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_gamma + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); + +/*! @brief Sets the current gamma ramp for the specified monitor. + * + * This function sets the current gamma ramp for the specified monitor. The + * original gamma ramp for that monitor is saved by GLFW the first time this + * function is called and is restored by @ref glfwTerminate. + * + * @param[in] monitor The monitor whose gamma ramp to set. + * @param[in] ramp The gamma ramp to use. + * + * @note Gamma ramp sizes other than 256 are not supported by all hardware. + * + * @par Pointer Lifetime + * The specified gamma ramp is copied before this function returns. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref monitor_gamma + * + * @since Added in GLFW 3.0. + * + * @ingroup monitor + */ +GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); + +/*! @brief Resets all window hints to their default values. + * + * This function resets all window hints to their + * [default values](@ref window_hints_values). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_hints + * @sa glfwWindowHint + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwDefaultWindowHints(void); + +/*! @brief Sets the specified window hint to the desired value. + * + * This function sets hints for the next call to @ref glfwCreateWindow. The + * hints, once set, retain their values until changed by a call to @ref + * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is + * terminated. + * + * @param[in] target The [window hint](@ref window_hints) to set. + * @param[in] hint The new value of the window hint. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_hints + * @sa glfwDefaultWindowHints + * + * @since Added in GLFW 3.0. Replaces `glfwOpenWindowHint`. + * + * @ingroup window + */ +GLFWAPI void glfwWindowHint(int target, int hint); + +/*! @brief Creates a window and its associated context. + * + * This function creates a window and its associated OpenGL or OpenGL ES + * context. Most of the options controlling how the window and its context + * should be created are specified with [window hints](@ref window_hints). + * + * Successful creation does not change which context is current. Before you + * can use the newly created context, you need to + * [make it current](@ref context_current). For information about the `share` + * parameter, see @ref context_sharing. + * + * The created window, framebuffer and context may differ from what you + * requested, as not all parameters and hints are + * [hard constraints](@ref window_hints_hard). This includes the size of the + * window, especially for full screen windows. To query the actual attributes + * of the created window, framebuffer and context, use queries like @ref + * glfwGetWindowAttrib and @ref glfwGetWindowSize. + * + * To create a full screen window, you need to specify the monitor the window + * will cover. If no monitor is specified, windowed mode will be used. Unless + * you have a way for the user to choose a specific monitor, it is recommended + * that you pick the primary monitor. For more information on how to query + * connected monitors, see @ref monitor_monitors. + * + * For full screen windows, the specified size becomes the resolution of the + * window's _desired video mode_. As long as a full screen window has input + * focus, the supported video mode most closely matching the desired video mode + * is set for the specified monitor. For more information about full screen + * windows, including the creation of so called _windowed full screen_ or + * _borderless full screen_ windows, see @ref window_windowed_full_screen. + * + * By default, newly created windows use the placement recommended by the + * window system. To create the window at a specific position, make it + * initially invisible using the [GLFW_VISIBLE](@ref window_hints_wnd) window + * hint, set its [position](@ref window_pos) and then [show](@ref window_hide) + * it. + * + * If a full screen window has input focus, the screensaver is prohibited from + * starting. + * + * Window systems put limits on window sizes. Very large or very small window + * dimensions may be overridden by the window system on creation. Check the + * actual [size](@ref window_size) after creation. + * + * The [swap interval](@ref buffer_swap) is not set during window creation and + * the initial value may vary depending on driver settings and defaults. + * + * @param[in] width The desired width, in screen coordinates, of the window. + * This must be greater than zero. + * @param[in] height The desired height, in screen coordinates, of the window. + * This must be greater than zero. + * @param[in] title The initial, UTF-8 encoded window title. + * @param[in] monitor The monitor to use for full screen mode, or `NULL` to use + * windowed mode. + * @param[in] share The window whose context to share resources with, or `NULL` + * to not share resources. + * @return The handle of the created window, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @remarks __Windows:__ Window creation will fail if the Microsoft GDI + * software OpenGL implementation is the only one available. + * + * @remarks __Windows:__ If the executable has an icon resource named + * `GLFW_ICON,` it will be set as the icon for the window. If no such icon is + * present, the `IDI_WINLOGO` icon will be used instead. + * + * @remarks __Windows:__ The context to share resources with may not be current + * on any other thread. + * + * @remarks __OS X:__ The GLFW window has no icon, as it is not a document + * window, but the dock icon will be the same as the application bundle's icon. + * For more information on bundles, see the + * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) + * in the Mac Developer Library. + * + * @remarks __OS X:__ The first time a window is created the menu bar is + * populated with common commands like Hide, Quit and About. The About entry + * opens a minimal about dialog with information from the application's bundle. + * The menu bar can be disabled with a + * [compile-time option](@ref compile_options_osx). + * + * @remarks __X11:__ There is no mechanism for setting the window icon yet. + * + * @remarks __X11:__ Some window managers will not respect the placement of + * initially hidden windows. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_creation + * @sa glfwDestroyWindow + * + * @since Added in GLFW 3.0. Replaces `glfwOpenWindow`. + * + * @ingroup window + */ +GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); + +/*! @brief Destroys the specified window and its context. + * + * This function destroys the specified window and its context. On calling + * this function, no further callbacks will be called for that window. + * + * If the context of the specified window is current on the main thread, it is + * detached before being destroyed. + * + * @param[in] window The window to destroy. + * + * @note The context of the specified window must not be current on any other + * thread when this function is called. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_creation + * @sa glfwCreateWindow + * + * @since Added in GLFW 3.0. Replaces `glfwCloseWindow`. + * + * @ingroup window + */ +GLFWAPI void glfwDestroyWindow(GLFWwindow* window); + +/*! @brief Checks the close flag of the specified window. + * + * This function returns the value of the close flag of the specified window. + * + * @param[in] window The window to query. + * @return The value of the close flag. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @sa @ref window_close + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); + +/*! @brief Sets the close flag of the specified window. + * + * This function sets the value of the close flag of the specified window. + * This can be used to override the user's attempt to close the window, or + * to signal that it should be closed. + * + * @param[in] window The window whose flag to change. + * @param[in] value The new value. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @sa @ref window_close + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); + +/*! @brief Sets the title of the specified window. + * + * This function sets the window title, encoded as UTF-8, of the specified + * window. + * + * @param[in] window The window whose title to change. + * @param[in] title The UTF-8 encoded window title. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_title + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); + +/*! @brief Retrieves the position of the client area of the specified window. + * + * This function retrieves the position, in screen coordinates, of the + * upper-left corner of the client area of the specified window. + * + * Any or all of the position arguments may be `NULL`. If an error occurs, all + * non-`NULL` position arguments will be set to zero. + * + * @param[in] window The window to query. + * @param[out] xpos Where to store the x-coordinate of the upper-left corner of + * the client area, or `NULL`. + * @param[out] ypos Where to store the y-coordinate of the upper-left corner of + * the client area, or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_pos + * @sa glfwSetWindowPos + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); + +/*! @brief Sets the position of the client area of the specified window. + * + * This function sets the position, in screen coordinates, of the upper-left + * corner of the client area of the specified windowed mode window. If the + * window is a full screen window, this function does nothing. + * + * __Do not use this function__ to move an already visible window unless you + * have very good reasons for doing so, as it will confuse and annoy the user. + * + * The window manager may put limits on what positions are allowed. GLFW + * cannot and should not override these limits. + * + * @param[in] window The window to query. + * @param[in] xpos The x-coordinate of the upper-left corner of the client area. + * @param[in] ypos The y-coordinate of the upper-left corner of the client area. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_pos + * @sa glfwGetWindowPos + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); + +/*! @brief Retrieves the size of the client area of the specified window. + * + * This function retrieves the size, in screen coordinates, of the client area + * of the specified window. If you wish to retrieve the size of the + * framebuffer of the window in pixels, see @ref glfwGetFramebufferSize. + * + * Any or all of the size arguments may be `NULL`. If an error occurs, all + * non-`NULL` size arguments will be set to zero. + * + * @param[in] window The window whose size to retrieve. + * @param[out] width Where to store the width, in screen coordinates, of the + * client area, or `NULL`. + * @param[out] height Where to store the height, in screen coordinates, of the + * client area, or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_size + * @sa glfwSetWindowSize + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); + +/*! @brief Sets the size of the client area of the specified window. + * + * This function sets the size, in screen coordinates, of the client area of + * the specified window. + * + * For full screen windows, this function selects and switches to the resolution + * closest to the specified size, without affecting the window's context. As + * the context is unaffected, the bit depths of the framebuffer remain + * unchanged. + * + * The window manager may put limits on what sizes are allowed. GLFW cannot + * and should not override these limits. + * + * @param[in] window The window to resize. + * @param[in] width The desired width of the specified window. + * @param[in] height The desired height of the specified window. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_size + * @sa glfwGetWindowSize + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); + +/*! @brief Retrieves the size of the framebuffer of the specified window. + * + * This function retrieves the size, in pixels, of the framebuffer of the + * specified window. If you wish to retrieve the size of the window in screen + * coordinates, see @ref glfwGetWindowSize. + * + * Any or all of the size arguments may be `NULL`. If an error occurs, all + * non-`NULL` size arguments will be set to zero. + * + * @param[in] window The window whose framebuffer to query. + * @param[out] width Where to store the width, in pixels, of the framebuffer, + * or `NULL`. + * @param[out] height Where to store the height, in pixels, of the framebuffer, + * or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_fbsize + * @sa glfwSetFramebufferSizeCallback + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height); + +/*! @brief Retrieves the size of the frame of the window. + * + * This function retrieves the size, in screen coordinates, of each edge of the + * frame of the specified window. This size includes the title bar, if the + * window has one. The size of the frame may vary depending on the + * [window-related hints](@ref window_hints_wnd) used to create it. + * + * Because this function retrieves the size of each window frame edge and not + * the offset along a particular coordinate axis, the retrieved values will + * always be zero or positive. + * + * Any or all of the size arguments may be `NULL`. If an error occurs, all + * non-`NULL` size arguments will be set to zero. + * + * @param[in] window The window whose frame size to query. + * @param[out] left Where to store the size, in screen coordinates, of the left + * edge of the window frame, or `NULL`. + * @param[out] top Where to store the size, in screen coordinates, of the top + * edge of the window frame, or `NULL`. + * @param[out] right Where to store the size, in screen coordinates, of the + * right edge of the window frame, or `NULL`. + * @param[out] bottom Where to store the size, in screen coordinates, of the + * bottom edge of the window frame, or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_size + * + * @since Added in GLFW 3.1. + * + * @ingroup window + */ +GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom); + +/*! @brief Iconifies the specified window. + * + * This function iconifies (minimizes) the specified window if it was + * previously restored. If the window is already iconified, this function does + * nothing. + * + * If the specified window is a full screen window, the original monitor + * resolution is restored until the window is restored. + * + * @param[in] window The window to iconify. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_iconify + * @sa glfwRestoreWindow + * + * @since Added in GLFW 2.1. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwIconifyWindow(GLFWwindow* window); + +/*! @brief Restores the specified window. + * + * This function restores the specified window if it was previously iconified + * (minimized). If the window is already restored, this function does nothing. + * + * If the specified window is a full screen window, the resolution chosen for + * the window is restored on the selected monitor. + * + * @param[in] window The window to restore. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_iconify + * @sa glfwIconifyWindow + * + * @since Added in GLFW 2.1. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwRestoreWindow(GLFWwindow* window); + +/*! @brief Makes the specified window visible. + * + * This function makes the specified window visible if it was previously + * hidden. If the window is already visible or is in full screen mode, this + * function does nothing. + * + * @param[in] window The window to make visible. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_hide + * @sa glfwHideWindow + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwShowWindow(GLFWwindow* window); + +/*! @brief Hides the specified window. + * + * This function hides the specified window if it was previously visible. If + * the window is already hidden or is in full screen mode, this function does + * nothing. + * + * @param[in] window The window to hide. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_hide + * @sa glfwShowWindow + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwHideWindow(GLFWwindow* window); + +/*! @brief Returns the monitor that the window uses for full screen mode. + * + * This function returns the handle of the monitor that the specified window is + * in full screen on. + * + * @param[in] window The window to query. + * @return The monitor, or `NULL` if the window is in windowed mode or an error + * occurred. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_monitor + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); + +/*! @brief Returns an attribute of the specified window. + * + * This function returns the value of an attribute of the specified window or + * its OpenGL or OpenGL ES context. + * + * @param[in] window The window to query. + * @param[in] attrib The [window attribute](@ref window_attribs) whose value to + * return. + * @return The value of the attribute, or zero if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_attribs + * + * @since Added in GLFW 3.0. Replaces `glfwGetWindowParam` and + * `glfwGetGLVersion`. + * + * @ingroup window + */ +GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); + +/*! @brief Sets the user pointer of the specified window. + * + * This function sets the user-defined pointer of the specified window. The + * current value is retained until the window is destroyed. The initial value + * is `NULL`. + * + * @param[in] window The window whose pointer to set. + * @param[in] pointer The new value. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @sa @ref window_userptr + * @sa glfwGetWindowUserPointer + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); + +/*! @brief Returns the user pointer of the specified window. + * + * This function returns the current value of the user-defined pointer of the + * specified window. The initial value is `NULL`. + * + * @param[in] window The window whose pointer to return. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @sa @ref window_userptr + * @sa glfwSetWindowUserPointer + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); + +/*! @brief Sets the position callback for the specified window. + * + * This function sets the position callback of the specified window, which is + * called when the window is moved. The callback is provided with the screen + * position of the upper-left corner of the client area of the window. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_pos + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); + +/*! @brief Sets the size callback for the specified window. + * + * This function sets the size callback of the specified window, which is + * called when the window is resized. The callback is provided with the size, + * in screen coordinates, of the client area of the window. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_size + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup window + */ +GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); + +/*! @brief Sets the close callback for the specified window. + * + * This function sets the close callback of the specified window, which is + * called when the user attempts to close the window, for example by clicking + * the close widget in the title bar. + * + * The close flag is set before this callback is called, but you can modify it + * at any time with @ref glfwSetWindowShouldClose. + * + * The close callback is not triggered by @ref glfwDestroyWindow. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @remarks __OS X:__ Selecting Quit from the application menu will + * trigger the close callback for all windows. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_close + * + * @since Added in GLFW 2.5. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup window + */ +GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); + +/*! @brief Sets the refresh callback for the specified window. + * + * This function sets the refresh callback of the specified window, which is + * called when the client area of the window needs to be redrawn, for example + * if the window has been exposed after having been covered by another window. + * + * On compositing window systems such as Aero, Compiz or Aqua, where the window + * contents are saved off-screen, this callback may be called only very + * infrequently or never at all. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_refresh + * + * @since Added in GLFW 2.5. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup window + */ +GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun); + +/*! @brief Sets the focus callback for the specified window. + * + * This function sets the focus callback of the specified window, which is + * called when the window gains or loses input focus. + * + * After the focus callback is called for a window that lost input focus, + * synthetic key and mouse button release events will be generated for all such + * that had been pressed. For more information, see @ref glfwSetKeyCallback + * and @ref glfwSetMouseButtonCallback. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_focus + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); + +/*! @brief Sets the iconify callback for the specified window. + * + * This function sets the iconification callback of the specified window, which + * is called when the window is iconified or restored. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_iconify + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); + +/*! @brief Sets the framebuffer resize callback for the specified window. + * + * This function sets the framebuffer resize callback of the specified window, + * which is called when the framebuffer of the specified window is resized. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref window_fbsize + * + * @since Added in GLFW 3.0. + * + * @ingroup window + */ +GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); + +/*! @brief Processes all pending events. + * + * This function processes only those events that are already in the event + * queue and then returns immediately. Processing events will cause the window + * and input callbacks associated with those events to be called. + * + * On some platforms, a window move, resize or menu operation will cause event + * processing to block. This is due to how event processing is designed on + * those platforms. You can use the + * [window refresh callback](@ref window_refresh) to redraw the contents of + * your window when necessary during such operations. + * + * On some platforms, certain events are sent directly to the application + * without going through the event queue, causing callbacks to be called + * outside of a call to one of the event processing functions. + * + * Event processing is not required for joystick input to work. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref events + * @sa glfwWaitEvents + * + * @since Added in GLFW 1.0. + * + * @ingroup window + */ +GLFWAPI void glfwPollEvents(void); + +/*! @brief Waits until events are queued and processes them. + * + * This function puts the calling thread to sleep until at least one event is + * available in the event queue. Once one or more events are available, + * it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue + * are processed and the function then returns immediately. Processing events + * will cause the window and input callbacks associated with those events to be + * called. + * + * Since not all events are associated with callbacks, this function may return + * without a callback having been called even if you are monitoring all + * callbacks. + * + * On some platforms, a window move, resize or menu operation will cause event + * processing to block. This is due to how event processing is designed on + * those platforms. You can use the + * [window refresh callback](@ref window_refresh) to redraw the contents of + * your window when necessary during such operations. + * + * On some platforms, certain callbacks may be called outside of a call to one + * of the event processing functions. + * + * If no windows exist, this function returns immediately. For synchronization + * of threads in applications that do not create windows, use your threading + * library of choice. + * + * Event processing is not required for joystick input to work. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref events + * @sa glfwPollEvents + * + * @since Added in GLFW 2.5. + * + * @ingroup window + */ +GLFWAPI void glfwWaitEvents(void); + +/*! @brief Posts an empty event to the event queue. + * + * This function posts an empty event from the current thread to the event + * queue, causing @ref glfwWaitEvents to return. + * + * If no windows exist, this function returns immediately. For synchronization + * of threads in applications that do not create windows, use your threading + * library of choice. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref events + * @sa glfwWaitEvents + * + * @since Added in GLFW 3.1. + * + * @ingroup window + */ +GLFWAPI void glfwPostEmptyEvent(void); + +/*! @brief Returns the value of an input option for the specified window. + * + * This function returns the value of an input option for the specified window. + * The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or + * `GLFW_STICKY_MOUSE_BUTTONS`. + * + * @param[in] window The window to query. + * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or + * `GLFW_STICKY_MOUSE_BUTTONS`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa glfwSetInputMode + * + * @since Added in GLFW 3.0. + * + * @ingroup input + */ +GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); + +/*! @brief Sets an input option for the specified window. + * + * This function sets an input mode option for the specified window. The mode + * must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or + * `GLFW_STICKY_MOUSE_BUTTONS`. + * + * If the mode is `GLFW_CURSOR`, the value must be one of the following cursor + * modes: + * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. + * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client + * area of the window but does not restrict the cursor from leaving. + * - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual + * and unlimited cursor movement. This is useful for implementing for + * example 3D camera controls. + * + * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to + * enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are + * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS` + * the next time it is called even if the key had been released before the + * call. This is useful when you are only interested in whether keys have been + * pressed but not when or in which order. + * + * If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either + * `GL_TRUE` to enable sticky mouse buttons, or `GL_FALSE` to disable it. If + * sticky mouse buttons are enabled, a mouse button press will ensure that @ref + * glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even if + * the mouse button had been released before the call. This is useful when you + * are only interested in whether mouse buttons have been pressed but not when + * or in which order. + * + * @param[in] window The window whose input mode to set. + * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or + * `GLFW_STICKY_MOUSE_BUTTONS`. + * @param[in] value The new value of the specified input mode. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa glfwGetInputMode + * + * @since Added in GLFW 3.0. Replaces `glfwEnable` and `glfwDisable`. + * + * @ingroup input + */ +GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); + +/*! @brief Returns the last reported state of a keyboard key for the specified + * window. + * + * This function returns the last state reported for the specified key to the + * specified window. The returned state is one of `GLFW_PRESS` or + * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to + * the key callback. + * + * If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns + * `GLFW_PRESS` the first time you call it for a key that was pressed, even if + * that key has already been released. + * + * The key functions deal with physical keys, with [key tokens](@ref keys) + * named after their use on the standard US keyboard layout. If you want to + * input text, use the Unicode character callback instead. + * + * The [modifier key bit masks](@ref mods) are not key tokens and cannot be + * used with this function. + * + * @param[in] window The desired window. + * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is + * not a valid key for this function. + * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_key + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup input + */ +GLFWAPI int glfwGetKey(GLFWwindow* window, int key); + +/*! @brief Returns the last reported state of a mouse button for the specified + * window. + * + * This function returns the last state reported for the specified mouse button + * to the specified window. The returned state is one of `GLFW_PRESS` or + * `GLFW_RELEASE`. + * + * If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function + * `GLFW_PRESS` the first time you call it for a mouse button that was pressed, + * even if that mouse button has already been released. + * + * @param[in] window The desired window. + * @param[in] button The desired [mouse button](@ref buttons). + * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_mouse_button + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup input + */ +GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); + +/*! @brief Retrieves the position of the cursor relative to the client area of + * the window. + * + * This function returns the position of the cursor, in screen coordinates, + * relative to the upper-left corner of the client area of the specified + * window. + * + * If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor + * position is unbounded and limited only by the minimum and maximum values of + * a `double`. + * + * The coordinate can be converted to their integer equivalents with the + * `floor` function. Casting directly to an integer type works for positive + * coordinates, but fails for negative ones. + * + * Any or all of the position arguments may be `NULL`. If an error occurs, all + * non-`NULL` position arguments will be set to zero. + * + * @param[in] window The desired window. + * @param[out] xpos Where to store the cursor x-coordinate, relative to the + * left edge of the client area, or `NULL`. + * @param[out] ypos Where to store the cursor y-coordinate, relative to the to + * top edge of the client area, or `NULL`. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_pos + * @sa glfwSetCursorPos + * + * @since Added in GLFW 3.0. Replaces `glfwGetMousePos`. + * + * @ingroup input + */ +GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); + +/*! @brief Sets the position of the cursor, relative to the client area of the + * window. + * + * This function sets the position, in screen coordinates, of the cursor + * relative to the upper-left corner of the client area of the specified + * window. The window must have input focus. If the window does not have + * input focus when this function is called, it fails silently. + * + * __Do not use this function__ to implement things like camera controls. GLFW + * already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the + * cursor, transparently re-centers it and provides unconstrained cursor + * motion. See @ref glfwSetInputMode for more information. + * + * If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is + * unconstrained and limited only by the minimum and maximum values of + * a `double`. + * + * @param[in] window The desired window. + * @param[in] xpos The desired x-coordinate, relative to the left edge of the + * client area. + * @param[in] ypos The desired y-coordinate, relative to the top edge of the + * client area. + * + * @remarks __X11:__ Due to the asynchronous nature of a modern X desktop, it + * may take a moment for the window focus event to arrive. This means you will + * not be able to set the cursor position directly after window creation. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_pos + * @sa glfwGetCursorPos + * + * @since Added in GLFW 3.0. Replaces `glfwSetMousePos`. + * + * @ingroup input + */ +GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); + +/*! @brief Creates a custom cursor. + * + * Creates a new custom cursor image that can be set for a window with @ref + * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor. + * Any remaining cursors are destroyed by @ref glfwTerminate. + * + * The pixels are 32-bit little-endian RGBA, i.e. eight bits per channel. They + * are arranged canonically as packed sequential rows, starting from the + * top-left corner. + * + * The cursor hotspot is specified in pixels, relative to the upper-left corner + * of the cursor image. Like all other coordinate systems in GLFW, the X-axis + * points to the right and the Y-axis points down. + * + * @param[in] image The desired cursor image. + * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot. + * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot. + * + * @return The handle of the created cursor, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The specified image data is copied before this function returns. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_object + * @sa glfwDestroyCursor + * @sa glfwCreateStandardCursor + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); + +/*! @brief Creates a cursor with a standard shape. + * + * Returns a cursor with a [standard shape](@ref shapes), that can be set for + * a window with @ref glfwSetCursor. + * + * @param[in] shape One of the [standard shapes](@ref shapes). + * + * @return A new cursor ready to use or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_object + * @sa glfwCreateCursor + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape); + +/*! @brief Destroys a cursor. + * + * This function destroys a cursor previously created with @ref + * glfwCreateCursor. Any remaining cursors will be destroyed by @ref + * glfwTerminate. + * + * @param[in] cursor The cursor object to destroy. + * + * @par Reentrancy + * This function may not be called from a callback. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_object + * @sa glfwCreateCursor + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); + +/*! @brief Sets the cursor for the window. + * + * This function sets the cursor image to be used when the cursor is over the + * client area of the specified window. The set cursor will only be visible + * when the [cursor mode](@ref cursor_mode) of the window is + * `GLFW_CURSOR_NORMAL`. + * + * On some platforms, the set cursor may not be visible unless the window also + * has input focus. + * + * @param[in] window The window to set the cursor for. + * @param[in] cursor The cursor to set, or `NULL` to switch back to the default + * arrow cursor. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_object + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); + +/*! @brief Sets the key callback. + * + * This function sets the key callback of the specified window, which is called + * when a key is pressed, repeated or released. + * + * The key functions deal with physical keys, with layout independent + * [key tokens](@ref keys) named after their values in the standard US keyboard + * layout. If you want to input text, use the + * [character callback](@ref glfwSetCharCallback) instead. + * + * When a window loses input focus, it will generate synthetic key release + * events for all pressed keys. You can tell these events from user-generated + * events by the fact that the synthetic ones are generated after the focus + * loss event has been processed, i.e. after the + * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. + * + * The scancode of a key is specific to that platform or sometimes even to that + * machine. Scancodes are intended to allow users to bind keys that don't have + * a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their + * state is not saved and so it cannot be queried with @ref glfwGetKey. + * + * Sometimes GLFW needs to generate synthetic key events, in which case the + * scancode may be zero. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new key callback, or `NULL` to remove the currently + * set callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_key + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup input + */ +GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); + +/*! @brief Sets the Unicode character callback. + * + * This function sets the character callback of the specified window, which is + * called when a Unicode character is input. + * + * The character callback is intended for Unicode text input. As it deals with + * characters, it is keyboard layout dependent, whereas the + * [key callback](@ref glfwSetKeyCallback) is not. Characters do not map 1:1 + * to physical keys, as a key may produce zero, one or more characters. If you + * want to know whether a specific physical key was pressed or released, see + * the key callback instead. + * + * The character callback behaves as system text input normally does and will + * not be called if modifier keys are held down that would prevent normal text + * input on that platform, for example a Super (Command) key on OS X or Alt key + * on Windows. There is a + * [character with modifiers callback](@ref glfwSetCharModsCallback) that + * receives these events. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_char + * + * @since Added in GLFW 2.4. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup input + */ +GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); + +/*! @brief Sets the Unicode character with modifiers callback. + * + * This function sets the character with modifiers callback of the specified + * window, which is called when a Unicode character is input regardless of what + * modifier keys are used. + * + * The character with modifiers callback is intended for implementing custom + * Unicode character input. For regular Unicode text input, see the + * [character callback](@ref glfwSetCharCallback). Like the character + * callback, the character with modifiers callback deals with characters and is + * keyboard layout dependent. Characters do not map 1:1 to physical keys, as + * a key may produce zero, one or more characters. If you want to know whether + * a specific physical key was pressed or released, see the + * [key callback](@ref glfwSetKeyCallback) instead. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_char + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); + +/*! @brief Sets the mouse button callback. + * + * This function sets the mouse button callback of the specified window, which + * is called when a mouse button is pressed or released. + * + * When a window loses input focus, it will generate synthetic mouse button + * release events for all pressed mouse buttons. You can tell these events + * from user-generated events by the fact that the synthetic ones are generated + * after the focus loss event has been processed, i.e. after the + * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref input_mouse_button + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * + * @ingroup input + */ +GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); + +/*! @brief Sets the cursor position callback. + * + * This function sets the cursor position callback of the specified window, + * which is called when the cursor is moved. The callback is provided with the + * position, in screen coordinates, relative to the upper-left corner of the + * client area of the window. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_pos + * + * @since Added in GLFW 3.0. Replaces `glfwSetMousePosCallback`. + * + * @ingroup input + */ +GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); + +/*! @brief Sets the cursor enter/exit callback. + * + * This function sets the cursor boundary crossing callback of the specified + * window, which is called when the cursor enters or leaves the client area of + * the window. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref cursor_enter + * + * @since Added in GLFW 3.0. + * + * @ingroup input + */ +GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); + +/*! @brief Sets the scroll callback. + * + * This function sets the scroll callback of the specified window, which is + * called when a scrolling device is used, such as a mouse wheel or scrolling + * area of a touchpad. + * + * The scroll callback receives all scrolling input, like that from a mouse + * wheel or a touchpad scrolling area. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently + * set callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref scrolling + * + * @since Added in GLFW 3.0. Replaces `glfwSetMouseWheelCallback`. + * + * @ingroup input + */ +GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); + +/*! @brief Sets the file drop callback. + * + * This function sets the file drop callback of the specified window, which is + * called when one or more dragged files are dropped on the window. + * + * Because the path array and its strings may have been generated specifically + * for that event, they are not guaranteed to be valid after the callback has + * returned. If you wish to use them after the callback returns, you need to + * make a deep copy. + * + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new file drop callback, or `NULL` to remove the + * currently set callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref path_drop + * + * @since Added in GLFW 3.1. + * + * @ingroup input + */ +GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); + +/*! @brief Returns whether the specified joystick is present. + * + * This function returns whether the specified joystick is present. + * + * @param[in] joy The [joystick](@ref joysticks) to query. + * @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref joystick + * + * @since Added in GLFW 3.0. Replaces `glfwGetJoystickParam`. + * + * @ingroup input + */ +GLFWAPI int glfwJoystickPresent(int joy); + +/*! @brief Returns the values of all axes of the specified joystick. + * + * This function returns the values of all axes of the specified joystick. + * Each element in the array is a value between -1.0 and 1.0. + * + * @param[in] joy The [joystick](@ref joysticks) to query. + * @param[out] count Where to store the number of axis values in the returned + * array. This is set to zero if an error occurred. + * @return An array of axis values, or `NULL` if the joystick is not present. + * + * @par Pointer Lifetime + * The returned array is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref joystick_axis + * + * @since Added in GLFW 3.0. Replaces `glfwGetJoystickPos`. + * + * @ingroup input + */ +GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); + +/*! @brief Returns the state of all buttons of the specified joystick. + * + * This function returns the state of all buttons of the specified joystick. + * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. + * + * @param[in] joy The [joystick](@ref joysticks) to query. + * @param[out] count Where to store the number of button states in the returned + * array. This is set to zero if an error occurred. + * @return An array of button states, or `NULL` if the joystick is not present. + * + * @par Pointer Lifetime + * The returned array is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref joystick_button + * + * @since Added in GLFW 2.2. + * + * @par + * __GLFW 3:__ Changed to return a dynamic array. + * + * @ingroup input + */ +GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count); + +/*! @brief Returns the name of the specified joystick. + * + * This function returns the name, encoded as UTF-8, of the specified joystick. + * The returned string is allocated and freed by GLFW. You should not free it + * yourself. + * + * @param[in] joy The [joystick](@ref joysticks) to query. + * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick + * is not present. + * + * @par Pointer Lifetime + * The returned string is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref joystick_name + * + * @since Added in GLFW 3.0. + * + * @ingroup input + */ +GLFWAPI const char* glfwGetJoystickName(int joy); + +/*! @brief Sets the clipboard to the specified string. + * + * This function sets the system clipboard to the specified, UTF-8 encoded + * string. + * + * @param[in] window The window that will own the clipboard contents. + * @param[in] string A UTF-8 encoded string. + * + * @par Pointer Lifetime + * The specified string is copied before this function returns. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref clipboard + * @sa glfwGetClipboardString + * + * @since Added in GLFW 3.0. + * + * @ingroup input + */ +GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); + +/*! @brief Returns the contents of the clipboard as a string. + * + * This function returns the contents of the system clipboard, if it contains + * or is convertible to a UTF-8 encoded string. + * + * @param[in] window The window that will request the clipboard contents. + * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL` + * if an [error](@ref error_handling) occurred. + * + * @par Pointer Lifetime + * The returned string is allocated and freed by GLFW. You should not free it + * yourself. It is valid until the next call to @ref + * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library + * is terminated. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref clipboard + * @sa glfwSetClipboardString + * + * @since Added in GLFW 3.0. + * + * @ingroup input + */ +GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); + +/*! @brief Returns the value of the GLFW timer. + * + * This function returns the value of the GLFW timer. Unless the timer has + * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW + * was initialized. + * + * The resolution of the timer is system dependent, but is usually on the order + * of a few micro- or nanoseconds. It uses the highest-resolution monotonic + * time source on each supported platform. + * + * @return The current value, in seconds, or zero if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @sa @ref time + * + * @since Added in GLFW 1.0. + * + * @ingroup input + */ +GLFWAPI double glfwGetTime(void); + +/*! @brief Sets the GLFW timer. + * + * This function sets the value of the GLFW timer. It then continues to count + * up from that value. + * + * @param[in] time The new value, in seconds. + * + * @par Thread Safety + * This function may only be called from the main thread. + * + * @sa @ref time + * + * @since Added in GLFW 2.2. + * + * @ingroup input + */ +GLFWAPI void glfwSetTime(double time); + +/*! @brief Makes the context of the specified window current for the calling + * thread. + * + * This function makes the OpenGL or OpenGL ES context of the specified window + * current on the calling thread. A context can only be made current on + * a single thread at a time and each thread can have only a single current + * context at a time. + * + * By default, making a context non-current implicitly forces a pipeline flush. + * On machines that support `GL_KHR_context_flush_control`, you can control + * whether a context performs this flush by setting the + * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint. + * + * @param[in] window The window whose context to make current, or `NULL` to + * detach the current context. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref context_current + * @sa glfwGetCurrentContext + * + * @since Added in GLFW 3.0. + * + * @ingroup context + */ +GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); + +/*! @brief Returns the window whose context is current on the calling thread. + * + * This function returns the window whose OpenGL or OpenGL ES context is + * current on the calling thread. + * + * @return The window whose context is current, or `NULL` if no window's + * context is current. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref context_current + * @sa glfwMakeContextCurrent + * + * @since Added in GLFW 3.0. + * + * @ingroup context + */ +GLFWAPI GLFWwindow* glfwGetCurrentContext(void); + +/*! @brief Swaps the front and back buffers of the specified window. + * + * This function swaps the front and back buffers of the specified window. If + * the swap interval is greater than zero, the GPU driver waits the specified + * number of screen updates before swapping the buffers. + * + * @param[in] window The window whose buffers to swap. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref buffer_swap + * @sa glfwSwapInterval + * + * @since Added in GLFW 1.0. + * + * @par + * __GLFW 3:__ Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwSwapBuffers(GLFWwindow* window); + +/*! @brief Sets the swap interval for the current context. + * + * This function sets the swap interval for the current context, i.e. the + * number of screen updates to wait from the time @ref glfwSwapBuffers was + * called before swapping the buffers and returning. This is sometimes called + * _vertical synchronization_, _vertical retrace synchronization_ or just + * _vsync_. + * + * Contexts that support either of the `WGL_EXT_swap_control_tear` and + * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals, + * which allow the driver to swap even if a frame arrives a little bit late. + * You can check for the presence of these extensions using @ref + * glfwExtensionSupported. For more information about swap tearing, see the + * extension specifications. + * + * A context must be current on the calling thread. Calling this function + * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. + * + * @param[in] interval The minimum number of screen updates to wait for + * until the buffers are swapped by @ref glfwSwapBuffers. + * + * @note This function is not called during window creation, leaving the swap + * interval set to whatever is the default on that platform. This is done + * because some swap interval extensions used by GLFW do not allow the swap + * interval to be reset to zero once it has been set to a non-zero value. + * + * @note Some GPU drivers do not honor the requested swap interval, either + * because of user settings that override the request or due to bugs in the + * driver. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref buffer_swap + * @sa glfwSwapBuffers + * + * @since Added in GLFW 1.0. + * + * @ingroup context + */ +GLFWAPI void glfwSwapInterval(int interval); + +/*! @brief Returns whether the specified extension is available. + * + * This function returns whether the specified + * [API extension](@ref context_glext) is supported by the current OpenGL or + * OpenGL ES context. It searches both for OpenGL and OpenGL ES extension and + * platform-specific context creation API extensions. + * + * A context must be current on the calling thread. Calling this function + * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. + * + * As this functions retrieves and searches one or more extension strings each + * call, it is recommended that you cache its results if it is going to be used + * frequently. The extension strings will not change during the lifetime of + * a context, so there is no danger in doing this. + * + * @param[in] extension The ASCII encoded name of the extension. + * @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref context_glext + * @sa glfwGetProcAddress + * + * @since Added in GLFW 1.0. + * + * @ingroup context + */ +GLFWAPI int glfwExtensionSupported(const char* extension); + +/*! @brief Returns the address of the specified function for the current + * context. + * + * This function returns the address of the specified + * [client API or extension function](@ref context_glext), if it is supported + * by the current context. + * + * A context must be current on the calling thread. Calling this function + * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. + * + * @param[in] procname The ASCII encoded name of the function. + * @return The address of the function, or `NULL` if the function is + * unavailable or an [error](@ref error_handling) occurred. + * + * @note The addresses of a given function is not guaranteed to be the same + * between contexts. + * + * @par Pointer Lifetime + * The returned function pointer is valid until the context is destroyed or the + * library is terminated. + * + * @par Thread Safety + * This function may be called from any thread. + * + * @sa @ref context_glext + * @sa glfwExtensionSupported + * + * @since Added in GLFW 1.0. + * + * @ingroup context + */ +GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); + + +/************************************************************************* + * Global definition cleanup + *************************************************************************/ + +/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ + +#ifdef GLFW_WINGDIAPI_DEFINED + #undef WINGDIAPI + #undef GLFW_WINGDIAPI_DEFINED +#endif + +#ifdef GLFW_CALLBACK_DEFINED + #undef CALLBACK + #undef GLFW_CALLBACK_DEFINED +#endif + +/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _glfw3_h_ */ + diff --git a/src/external/glfw3/include/GLFW/glfw3native.h b/src/external/glfw3/include/GLFW/glfw3native.h new file mode 100644 index 00000000..b3ce7482 --- /dev/null +++ b/src/external/glfw3/include/GLFW/glfw3native.h @@ -0,0 +1,356 @@ +/************************************************************************* + * GLFW 3.1 - www.glfw.org + * A library for OpenGL, window and input + *------------------------------------------------------------------------ + * Copyright (c) 2002-2006 Marcus Geelnard + * Copyright (c) 2006-2010 Camilla Berglund + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would + * be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + *************************************************************************/ + +#ifndef _glfw3_native_h_ +#define _glfw3_native_h_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************************************* + * Doxygen documentation + *************************************************************************/ + +/*! @defgroup native Native access + * + * **By using the native access functions you assert that you know what you're + * doing and how to fix problems caused by using them. If you don't, you + * shouldn't be using them.** + * + * Before the inclusion of @ref glfw3native.h, you must define exactly one + * window system API macro and exactly one context creation API macro. Failure + * to do this will cause a compile-time error. + * + * The available window API macros are: + * * `GLFW_EXPOSE_NATIVE_WIN32` + * * `GLFW_EXPOSE_NATIVE_COCOA` + * * `GLFW_EXPOSE_NATIVE_X11` + * + * The available context API macros are: + * * `GLFW_EXPOSE_NATIVE_WGL` + * * `GLFW_EXPOSE_NATIVE_NSGL` + * * `GLFW_EXPOSE_NATIVE_GLX` + * * `GLFW_EXPOSE_NATIVE_EGL` + * + * These macros select which of the native access functions that are declared + * and which platform-specific headers to include. It is then up your (by + * definition platform-specific) code to handle which of these should be + * defined. + */ + + +/************************************************************************* + * System headers and types + *************************************************************************/ + +#if defined(GLFW_EXPOSE_NATIVE_WIN32) + // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for + // example to allow applications to correctly declare a GL_ARB_debug_output + // callback) but windows.h assumes no one will define APIENTRY before it does + #undef APIENTRY + #include +#elif defined(GLFW_EXPOSE_NATIVE_COCOA) + #include + #if defined(__OBJC__) + #import + #else + typedef void* id; + #endif +#elif defined(GLFW_EXPOSE_NATIVE_X11) + #include + #include +#else + #error "No window API selected" +#endif + +#if defined(GLFW_EXPOSE_NATIVE_WGL) + /* WGL is declared by windows.h */ +#elif defined(GLFW_EXPOSE_NATIVE_NSGL) + /* NSGL is declared by Cocoa.h */ +#elif defined(GLFW_EXPOSE_NATIVE_GLX) + #include +#elif defined(GLFW_EXPOSE_NATIVE_EGL) + #include +#else + #error "No context API selected" +#endif + + +/************************************************************************* + * Functions + *************************************************************************/ + +#if defined(GLFW_EXPOSE_NATIVE_WIN32) +/*! @brief Returns the adapter device name of the specified monitor. + * + * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) + * of the specified monitor, or `NULL` if an [error](@ref error_handling) + * occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.1. + * + * @ingroup native + */ +GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); + +/*! @brief Returns the display device name of the specified monitor. + * + * @return The UTF-8 encoded display device name (for example + * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.1. + * + * @ingroup native + */ +GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); + +/*! @brief Returns the `HWND` of the specified window. + * + * @return The `HWND` of the specified window, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_WGL) +/*! @brief Returns the `HGLRC` of the specified window. + * + * @return The `HGLRC` of the specified window, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_COCOA) +/*! @brief Returns the `CGDirectDisplayID` of the specified monitor. + * + * @return The `CGDirectDisplayID` of the specified monitor, or + * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.1. + * + * @ingroup native + */ +GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); + +/*! @brief Returns the `NSWindow` of the specified window. + * + * @return The `NSWindow` of the specified window, or `nil` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_NSGL) +/*! @brief Returns the `NSOpenGLContext` of the specified window. + * + * @return The `NSOpenGLContext` of the specified window, or `nil` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_X11) +/*! @brief Returns the `Display` used by GLFW. + * + * @return The `Display` used by GLFW, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI Display* glfwGetX11Display(void); + +/*! @brief Returns the `RRCrtc` of the specified monitor. + * + * @return The `RRCrtc` of the specified monitor, or `None` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.1. + * + * @ingroup native + */ +GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); + +/*! @brief Returns the `RROutput` of the specified monitor. + * + * @return The `RROutput` of the specified monitor, or `None` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.1. + * + * @ingroup native + */ +GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); + +/*! @brief Returns the `Window` of the specified window. + * + * @return The `Window` of the specified window, or `None` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI Window glfwGetX11Window(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_GLX) +/*! @brief Returns the `GLXContext` of the specified window. + * + * @return The `GLXContext` of the specified window, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_EGL) +/*! @brief Returns the `EGLDisplay` used by GLFW. + * + * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI EGLDisplay glfwGetEGLDisplay(void); + +/*! @brief Returns the `EGLContext` of the specified window. + * + * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); + +/*! @brief Returns the `EGLSurface` of the specified window. + * + * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an + * [error](@ref error_handling) occurred. + * + * @par Thread Safety + * This function may be called from any thread. Access is not synchronized. + * + * @par History + * Added in GLFW 3.0. + * + * @ingroup native + */ +GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _glfw3_native_h_ */ + diff --git a/src/external/glfw3/lib/linux/libglfw3.a b/src/external/glfw3/lib/linux/libglfw3.a new file mode 100644 index 00000000..84cc1d20 Binary files /dev/null and b/src/external/glfw3/lib/linux/libglfw3.a differ diff --git a/src/external/glfw3/lib/osx/libglfw.3.0.dylib b/src/external/glfw3/lib/osx/libglfw.3.0.dylib new file mode 100644 index 00000000..15674573 Binary files /dev/null and b/src/external/glfw3/lib/osx/libglfw.3.0.dylib differ diff --git a/src/external/glfw3/lib/osx/libglfw.3.dylib b/src/external/glfw3/lib/osx/libglfw.3.dylib new file mode 100644 index 00000000..cd20112e --- /dev/null +++ b/src/external/glfw3/lib/osx/libglfw.3.dylib @@ -0,0 +1 @@ +libglfw.3.0.dylib \ No newline at end of file diff --git a/src/external/glfw3/lib/osx/libglfw.dylib b/src/external/glfw3/lib/osx/libglfw.dylib new file mode 100644 index 00000000..d4bd51e1 --- /dev/null +++ b/src/external/glfw3/lib/osx/libglfw.dylib @@ -0,0 +1 @@ +libglfw.3.dylib \ No newline at end of file diff --git a/src/external/glfw3/lib/win32/libglfw3.a b/src/external/glfw3/lib/win32/libglfw3.a new file mode 100644 index 00000000..fc920396 Binary files /dev/null and b/src/external/glfw3/lib/win32/libglfw3.a differ diff --git a/src/external/glfw3/lib/win32/libglfw3dll.a b/src/external/glfw3/lib/win32/libglfw3dll.a new file mode 100644 index 00000000..f1bd73b1 Binary files /dev/null and b/src/external/glfw3/lib/win32/libglfw3dll.a differ diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h new file mode 100644 index 00000000..2ddc61d1 --- /dev/null +++ b/src/external/jar_mod.h @@ -0,0 +1,1587 @@ +// jar_mod.h - v0.01 - public domain C0 - Joshua Reisenauer +// +// HISTORY: +// +// v0.01 2016-03-12 Setup +// +// +// USAGE: +// +// In ONE source file, put: +// +// #define JAR_MOD_IMPLEMENTATION +// #include "jar_mod.h" +// +// Other source files should just include jar_mod.h +// +// SAMPLE CODE: +// jar_mod_context_t modctx; +// short samplebuff[4096]; +// bool bufferFull = false; +// int intro_load(void) +// { +// jar_mod_init(&modctx); +// jar_mod_load_file(&modctx, "file.mod"); +// return 1; +// } +// int intro_unload(void) +// { +// jar_mod_unload(&modctx); +// return 1; +// } +// int intro_tick(long counter) +// { +// if(!bufferFull) +// { +// jar_mod_fillbuffer(&modctx, samplebuff, 4096, 0); +// bufferFull=true; +// } +// if(IsKeyDown(KEY_ENTER)) +// return 1; +// return 0; +// } +// +// +// LISCENSE: +// +// Written by: Jean-François DEL NERO (http://hxc2001.com/) free.fr> +// Adapted to jar_mod by: Joshua Adam Reisenauer +// This program is free software. It comes without any warranty, to the +// extent permitted by applicable law. You can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To Public +// License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/wtfpl/COPYING for more details. +/////////////////////////////////////////////////////////////////////////////////// +// HxCMOD Core API: +// ------------------------------------------- +// int jar_mod_init(jar_mod_context_t * modctx) +// +// - Initialize the jar_mod_context_t buffer. Must be called before doing anything else. +// Return 1 if success. 0 in case of error. +// ------------------------------------------- +// mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) +// +// - "Load" a MOD from file, context must already be initialized. +// Return size of file in bytes. +// ------------------------------------------- +// void jar_mod_fillbuffer( jar_mod_context_t * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +// +// - Generate and return the next samples chunk to outbuffer. +// nbsample specify the number of stereo 16bits samples you want. +// The output format is by default signed 48000Hz 16-bit Stereo PCM samples, otherwise it is changed with jar_mod_setcfg(). +// The output buffer size in bytes must be equal to ( nbsample * 2 * channels ). +// The optional trkbuf parameter can be used to get detailed status of the player. Put NULL/0 is unused. +// ------------------------------------------- +// void jar_mod_unload( jar_mod_context_t * modctx ) +// - "Unload" / clear the player status. +// ------------------------------------------- +/////////////////////////////////////////////////////////////////////////////////// + + +#ifndef INCLUDE_JAR_MOD_H +#define INCLUDE_JAR_MOD_H + +#include +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// Basic type +typedef unsigned char muchar; +typedef unsigned short muint; +typedef short mint; +typedef unsigned long mulong; + +#define NUMMAXCHANNELS 32 +#define MAXNOTES 12*12 +#define DEFAULT_SAMPLE_RATE 48000 +// +// MOD file structures +// + +#pragma pack(1) + +typedef struct { + muchar name[22]; + muint length; + muchar finetune; + muchar volume; + muint reppnt; + muint replen; +} sample; + +typedef struct { + muchar sampperiod; + muchar period; + muchar sampeffect; + muchar effect; +} note; + +typedef struct { + muchar title[20]; + sample samples[31]; + muchar length; // length of tablepos + muchar protracker; + muchar patterntable[128]; + muchar signature[4]; + muchar speed; +} module; + +#pragma pack() + +// +// HxCMod Internal structures +// +typedef struct { + char* sampdata; + muint sampnum; + muint length; + muint reppnt; + muint replen; + mulong samppos; + muint period; + muchar volume; + mulong ticks; + muchar effect; + muchar parameffect; + muint effect_code; + mint decalperiod; + mint portaspeed; + mint portaperiod; + mint vibraperiod; + mint Arpperiods[3]; + muchar ArpIndex; + mint oldk; + muchar volumeslide; + muchar vibraparam; + muchar vibrapointeur; + muchar finetune; + muchar cut_param; + muint patternloopcnt; + muint patternloopstartpoint; +} channel; + +typedef struct { + module song; + char* sampledata[31]; + note* patterndata[128]; + + mulong playrate; + muint tablepos; + muint patternpos; + muint patterndelay; + muint jump_loop_effect; + muchar bpm; + mulong patternticks; + mulong patterntickse; + mulong patternticksaim; + mulong sampleticksconst; + mulong samplenb; + channel channels[NUMMAXCHANNELS]; + muint number_of_channels; + muint fullperiod[MAXNOTES * 8]; + muint mod_loaded; + mint last_r_sample; + mint last_l_sample; + mint stereo; + mint stereo_separation; + mint bits; + mint filter; + + muchar *modfile; // the raw mod file + mulong modfilesize; + muint loopcount; +} jar_mod_context_t; + +// +// Player states structures +// +typedef struct track_state_ +{ + unsigned char instrument_number; + unsigned short cur_period; + unsigned char cur_volume; + unsigned short cur_effect; + unsigned short cur_parameffect; +}track_state; + +typedef struct tracker_state_ +{ + int number_of_tracks; + int bpm; + int speed; + int cur_pattern; + int cur_pattern_pos; + int cur_pattern_table_pos; + unsigned int buf_index; + track_state tracks[32]; +}tracker_state; + +typedef struct tracker_state_instrument_ +{ + char name[22]; + int active; +}tracker_state_instrument; + +typedef struct jar_mod_tracker_buffer_state_ +{ + int nb_max_of_state; + int nb_of_state; + int cur_rd_index; + int sample_step; + char name[64]; + tracker_state_instrument instruments[31]; + tracker_state * track_state_buf; +}jar_mod_tracker_buffer_state; + + + +bool jar_mod_init(jar_mod_context_t * modctx); +bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); +void jar_mod_fillbuffer(jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); +void jar_mod_unload(jar_mod_context_t * modctx); +mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename); +mulong jar_mod_current_samples(jar_mod_context_t * modctx); +mulong jar_mod_max_samples(jar_mod_context_t * modctx); +void jar_mod_seek_start(jar_mod_context_t * ctx); + +#ifdef __cplusplus +} +#endif +//-------------------------------------------------------------------- + + + +//------------------------------------------------------------------------------- +#ifdef JAR_MOD_IMPLEMENTATION + +// Effects list +#define EFFECT_ARPEGGIO 0x0 // Supported +#define EFFECT_PORTAMENTO_UP 0x1 // Supported +#define EFFECT_PORTAMENTO_DOWN 0x2 // Supported +#define EFFECT_TONE_PORTAMENTO 0x3 // Supported +#define EFFECT_VIBRATO 0x4 // Supported +#define EFFECT_VOLSLIDE_TONEPORTA 0x5 // Supported +#define EFFECT_VOLSLIDE_VIBRATO 0x6 // Supported +#define EFFECT_VOLSLIDE_TREMOLO 0x7 // - TO BE DONE - +#define EFFECT_SET_PANNING 0x8 // - TO BE DONE - +#define EFFECT_SET_OFFSET 0x9 // Supported +#define EFFECT_VOLUME_SLIDE 0xA // Supported +#define EFFECT_JUMP_POSITION 0xB // Supported +#define EFFECT_SET_VOLUME 0xC // Supported +#define EFFECT_PATTERN_BREAK 0xD // Supported + +#define EFFECT_EXTENDED 0xE +#define EFFECT_E_FINE_PORTA_UP 0x1 // Supported +#define EFFECT_E_FINE_PORTA_DOWN 0x2 // Supported +#define EFFECT_E_GLISSANDO_CTRL 0x3 // - TO BE DONE - +#define EFFECT_E_VIBRATO_WAVEFORM 0x4 // - TO BE DONE - +#define EFFECT_E_SET_FINETUNE 0x5 // - TO BE DONE - +#define EFFECT_E_PATTERN_LOOP 0x6 // Supported +#define EFFECT_E_TREMOLO_WAVEFORM 0x7 // - TO BE DONE - +#define EFFECT_E_SET_PANNING_2 0x8 // - TO BE DONE - +#define EFFECT_E_RETRIGGER_NOTE 0x9 // - TO BE DONE - +#define EFFECT_E_FINE_VOLSLIDE_UP 0xA // Supported +#define EFFECT_E_FINE_VOLSLIDE_DOWN 0xB // Supported +#define EFFECT_E_NOTE_CUT 0xC // Supported +#define EFFECT_E_NOTE_DELAY 0xD // - TO BE DONE - +#define EFFECT_E_PATTERN_DELAY 0xE // Supported +#define EFFECT_E_INVERT_LOOP 0xF // - TO BE DONE - +#define EFFECT_SET_SPEED 0xF0 // Supported +#define EFFECT_SET_TEMPO 0xF2 // Supported + +#define PERIOD_TABLE_LENGTH MAXNOTES +#define FULL_PERIOD_TABLE_LENGTH ( PERIOD_TABLE_LENGTH * 8 ) + +static const short periodtable[]= +{ + 27392, 25856, 24384, 23040, 21696, 20480, 19328, 18240, 17216, 16256, 15360, 14496, + 13696, 12928, 12192, 11520, 10848, 10240, 9664, 9120, 8606, 8128, 7680, 7248, + 6848, 6464, 6096, 5760, 5424, 5120, 4832, 4560, 4304, 4064, 3840, 3624, + 3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812, + 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906, + 856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453, + 428, 404, 381, 360, 339, 320, 302, 285, 269, 254, 240, 226, + 214, 202, 190, 180, 170, 160, 151, 143, 135, 127, 120, 113, + 107, 101, 95, 90, 85, 80, 75, 71, 67, 63, 60, 56, + 53, 50, 47, 45, 42, 40, 37, 35, 33, 31, 30, 28, + 27, 25, 24, 22, 21, 20, 19, 18, 17, 16, 15, 14, + 13, 13, 12, 11, 11, 10, 9, 9, 8, 8, 7, 7 +}; + +static const short sintable[]={ + 0, 24, 49, 74, 97, 120, 141,161, + 180, 197, 212, 224, 235, 244, 250,253, + 255, 253, 250, 244, 235, 224, 212,197, + 180, 161, 141, 120, 97, 74, 49, 24 +}; + +typedef struct modtype_ +{ + unsigned char signature[5]; + int numberofchannels; +}modtype; + +modtype modlist[]= +{ + { "M!K!",4}, + { "M.K.",4}, + { "FLT4",4}, + { "FLT8",8}, + { "4CHN",4}, + { "6CHN",6}, + { "8CHN",8}, + { "10CH",10}, + { "12CH",12}, + { "14CH",14}, + { "16CH",16}, + { "18CH",18}, + { "20CH",20}, + { "22CH",22}, + { "24CH",24}, + { "26CH",26}, + { "28CH",28}, + { "30CH",30}, + { "32CH",32}, + { "",0} +}; + +/////////////////////////////////////////////////////////////////////////////////// + +static void memcopy( void * dest, void *source, unsigned long size ) +{ + unsigned long i; + unsigned char * d,*s; + + d=(unsigned char*)dest; + s=(unsigned char*)source; + for(i=0;i= mod->fullperiod[i]) + { + return i; + } + } + + return MAXNOTES; +} + +static void worknote( note * nptr, channel * cptr, char t, jar_mod_context_t * mod ) +{ + muint sample, period, effect, operiod; + muint curnote, arpnote; + + sample = (nptr->sampperiod & 0xF0) | (nptr->sampeffect >> 4); + period = ((nptr->sampperiod & 0xF) << 8) | nptr->period; + effect = ((nptr->sampeffect & 0xF) << 8) | nptr->effect; + + operiod = cptr->period; + + if ( period || sample ) + { + if( sample && sample < 32 ) + { + cptr->sampnum = sample - 1; + } + + if( period || sample ) + { + cptr->sampdata = (char *) mod->sampledata[cptr->sampnum]; + cptr->length = mod->song.samples[cptr->sampnum].length; + cptr->reppnt = mod->song.samples[cptr->sampnum].reppnt; + cptr->replen = mod->song.samples[cptr->sampnum].replen; + + cptr->finetune = (mod->song.samples[cptr->sampnum].finetune)&0xF; + + if(effect>>8!=4 && effect>>8!=6) + { + cptr->vibraperiod=0; + cptr->vibrapointeur=0; + } + } + + if( (sample != 0) && ( (effect>>8) != EFFECT_VOLSLIDE_TONEPORTA ) ) + { + cptr->volume = mod->song.samples[cptr->sampnum].volume; + cptr->volumeslide = 0; + } + + if( ( (effect>>8) != EFFECT_TONE_PORTAMENTO && (effect>>8)!=EFFECT_VOLSLIDE_TONEPORTA) ) + { + if (period!=0) + cptr->samppos = 0; + } + + cptr->decalperiod = 0; + if( period ) + { + if(cptr->finetune) + { + if( cptr->finetune <= 7 ) + { + period = mod->fullperiod[getnote(mod,period,0) + cptr->finetune]; + } + else + { + period = mod->fullperiod[getnote(mod,period,0) - (16 - (cptr->finetune)) ]; + } + } + + cptr->period = period; + } + + } + + cptr->effect = 0; + cptr->parameffect = 0; + cptr->effect_code = effect; + + switch (effect >> 8) + { + case EFFECT_ARPEGGIO: + /* + [0]: Arpeggio + Where [0][x][y] means "play note, note+x semitones, note+y + semitones, then return to original note". The fluctuations are + carried out evenly spaced in one pattern division. They are usually + used to simulate chords, but this doesn't work too well. They are + also used to produce heavy vibrato. A major chord is when x=4, y=7. + A minor chord is when x=3, y=7. + */ + + if(effect&0xff) + { + cptr->effect = EFFECT_ARPEGGIO; + cptr->parameffect = effect&0xff; + + cptr->ArpIndex = 0; + + curnote = getnote(mod,cptr->period,cptr->finetune); + + cptr->Arpperiods[0] = cptr->period; + + arpnote = curnote + (((cptr->parameffect>>4)&0xF)*8); + if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) + arpnote = FULL_PERIOD_TABLE_LENGTH - 1; + + cptr->Arpperiods[1] = mod->fullperiod[arpnote]; + + arpnote = curnote + (((cptr->parameffect)&0xF)*8); + if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) + arpnote = FULL_PERIOD_TABLE_LENGTH - 1; + + cptr->Arpperiods[2] = mod->fullperiod[arpnote]; + } + break; + + case EFFECT_PORTAMENTO_UP: + /* + [1]: Slide up + Where [1][x][y] means "smoothly decrease the period of current + sample by x*16+y after each tick in the division". The + ticks/division are set with the 'set speed' effect (see below). If + the period of the note being played is z, then the final period + will be z - (x*16 + y)*(ticks - 1). As the slide rate depends on + the speed, changing the speed will change the slide. You cannot + slide beyond the note B3 (period 113). + */ + + cptr->effect = EFFECT_PORTAMENTO_UP; + cptr->parameffect = effect&0xff; + break; + + case EFFECT_PORTAMENTO_DOWN: + /* + [2]: Slide down + Where [2][x][y] means "smoothly increase the period of current + sample by x*16+y after each tick in the division". Similar to [1], + but lowers the pitch. You cannot slide beyond the note C1 (period + 856). + */ + + cptr->effect = EFFECT_PORTAMENTO_DOWN; + cptr->parameffect = effect&0xff; + break; + + case EFFECT_TONE_PORTAMENTO: + /* + [3]: Slide to note + Where [3][x][y] means "smoothly change the period of current sample + by x*16+y after each tick in the division, never sliding beyond + current period". The period-length in this channel's division is a + parameter to this effect, and hence is not played. Sliding to a + note is similar to effects [1] and [2], but the slide will not go + beyond the given period, and the direction is implied by that + period. If x and y are both 0, then the old slide will continue. + */ + + cptr->effect = EFFECT_TONE_PORTAMENTO; + if( (effect&0xff) != 0 ) + { + cptr->portaspeed = (short)(effect&0xff); + } + + if(period!=0) + { + cptr->portaperiod = period; + cptr->period = operiod; + } + break; + + case EFFECT_VIBRATO: + /* + [4]: Vibrato + Where [4][x][y] means "oscillate the sample pitch using a + particular waveform with amplitude y/16 semitones, such that (x * + ticks)/64 cycles occur in the division". The waveform is set using + effect [14][4]. By placing vibrato effects on consecutive + divisions, the vibrato effect can be maintained. If either x or y + are 0, then the old vibrato values will be used. + */ + + cptr->effect = EFFECT_VIBRATO; + if( ( effect & 0x0F ) != 0 ) // Depth continue or change ? + cptr->vibraparam = (cptr->vibraparam & 0xF0) | ( effect & 0x0F ); + if( ( effect & 0xF0 ) != 0 ) // Speed continue or change ? + cptr->vibraparam = (cptr->vibraparam & 0x0F) | ( effect & 0xF0 ); + + break; + + case EFFECT_VOLSLIDE_TONEPORTA: + /* + [5]: Continue 'Slide to note', but also do Volume slide + Where [5][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1), at the same time as continuing + the last 'Slide to note'". It is illegal for both x and y to be + non-zero. You cannot slide outside the volume range 0..64. The + period-length in this channel's division is a parameter to this + effect, and hence is not played. + */ + + if( period != 0 ) + { + cptr->portaperiod = period; + cptr->period = operiod; + } + + cptr->effect = EFFECT_VOLSLIDE_TONEPORTA; + if( ( effect & 0xFF ) != 0 ) + cptr->volumeslide = ( effect & 0xFF ); + + break; + + case EFFECT_VOLSLIDE_VIBRATO: + /* + [6]: Continue 'Vibrato', but also do Volume slide + Where [6][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1), at the same time as continuing + the last 'Vibrato'". It is illegal for both x and y to be non-zero. + You cannot slide outside the volume range 0..64. + */ + + cptr->effect = EFFECT_VOLSLIDE_VIBRATO; + if( (effect & 0xFF) != 0 ) + cptr->volumeslide = (effect & 0xFF); + break; + + case EFFECT_SET_OFFSET: + /* + [9]: Set sample offset + Where [9][x][y] means "play the sample from offset x*4096 + y*256". + The offset is measured in words. If no sample is given, yet one is + still playing on this channel, it should be retriggered to the new + offset using the current volume. + */ + + cptr->samppos = ((effect>>4) * 4096) + ((effect&0xF)*256); + + break; + + case EFFECT_VOLUME_SLIDE: + /* + [10]: Volume slide + Where [10][x][y] means "either slide the volume up x*(ticks - 1) or + slide the volume down y*(ticks - 1)". If both x and y are non-zero, + then the y value is ignored (assumed to be 0). You cannot slide + outside the volume range 0..64. + */ + + cptr->effect = EFFECT_VOLUME_SLIDE; + cptr->volumeslide = (effect & 0xFF); + break; + + case EFFECT_JUMP_POSITION: + /* + [11]: Position Jump + Where [11][x][y] means "stop the pattern after this division, and + continue the song at song-position x*16+y". This shifts the + 'pattern-cursor' in the pattern table (see above). Legal values for + x*16+y are from 0 to 127. + */ + + mod->tablepos = (effect & 0xFF); + if(mod->tablepos >= mod->song.length) + { + mod->tablepos = 0; + } + mod->patternpos = 0; + mod->jump_loop_effect = 1; + + break; + + case EFFECT_SET_VOLUME: + /* + [12]: Set volume + Where [12][x][y] means "set current sample's volume to x*16+y". + Legal volumes are 0..64. + */ + + cptr->volume = (effect & 0xFF); + break; + + case EFFECT_PATTERN_BREAK: + /* + [13]: Pattern Break + Where [13][x][y] means "stop the pattern after this division, and + continue the song at the next pattern at division x*10+y" (the 10 + is not a typo). Legal divisions are from 0 to 63 (note Protracker + exception above). + */ + + mod->patternpos = ( ((effect>>4)&0xF)*10 + (effect&0xF) ) * mod->number_of_channels; + mod->jump_loop_effect = 1; + mod->tablepos++; + if(mod->tablepos >= mod->song.length) + { + mod->tablepos = 0; + } + + break; + + case EFFECT_EXTENDED: + switch( (effect>>4) & 0xF ) + { + case EFFECT_E_FINE_PORTA_UP: + /* + [14][1]: Fineslide up + Where [14][1][x] means "decrement the period of the current sample + by x". The incrementing takes place at the beginning of the + division, and hence there is no actual sliding. You cannot slide + beyond the note B3 (period 113). + */ + + cptr->period -= (effect & 0xF); + if( cptr->period < 113 ) + cptr->period = 113; + break; + + case EFFECT_E_FINE_PORTA_DOWN: + /* + [14][2]: Fineslide down + Where [14][2][x] means "increment the period of the current sample + by x". Similar to [14][1] but shifts the pitch down. You cannot + slide beyond the note C1 (period 856). + */ + + cptr->period += (effect & 0xF); + if( cptr->period > 856 ) + cptr->period = 856; + break; + + case EFFECT_E_FINE_VOLSLIDE_UP: + /* + [14][10]: Fine volume slide up + Where [14][10][x] means "increment the volume of the current sample + by x". The incrementing takes place at the beginning of the + division, and hence there is no sliding. You cannot slide beyond + volume 64. + */ + + cptr->volume += (effect & 0xF); + if( cptr->volume>64 ) + cptr->volume = 64; + break; + + case EFFECT_E_FINE_VOLSLIDE_DOWN: + /* + [14][11]: Fine volume slide down + Where [14][11][x] means "decrement the volume of the current sample + by x". Similar to [14][10] but lowers volume. You cannot slide + beyond volume 0. + */ + + cptr->volume -= (effect & 0xF); + if( cptr->volume > 200 ) + cptr->volume = 0; + break; + + case EFFECT_E_PATTERN_LOOP: + /* + [14][6]: Loop pattern + Where [14][6][x] means "set the start of a loop to this division if + x is 0, otherwise after this division, jump back to the start of a + loop and play it another x times before continuing". If the start + of the loop was not set, it will default to the start of the + current pattern. Hence 'loop pattern' cannot be performed across + multiple patterns. Note that loops do not support nesting, and you + may generate an infinite loop if you try to nest 'loop pattern's. + */ + + if( effect & 0xF ) + { + if( cptr->patternloopcnt ) + { + cptr->patternloopcnt--; + if( cptr->patternloopcnt ) + { + mod->patternpos = cptr->patternloopstartpoint; + mod->jump_loop_effect = 1; + } + else + { + cptr->patternloopstartpoint = mod->patternpos ; + } + } + else + { + cptr->patternloopcnt = (effect & 0xF); + mod->patternpos = cptr->patternloopstartpoint; + mod->jump_loop_effect = 1; + } + } + else // Start point + { + cptr->patternloopstartpoint = mod->patternpos; + } + + break; + + case EFFECT_E_PATTERN_DELAY: + /* + [14][14]: Delay pattern + Where [14][14][x] means "after this division there will be a delay + equivalent to the time taken to play x divisions after which the + pattern will be resumed". The delay only relates to the + interpreting of new divisions, and all effects and previous notes + continue during delay. + */ + + mod->patterndelay = (effect & 0xF); + break; + + case EFFECT_E_NOTE_CUT: + /* + [14][12]: Cut sample + Where [14][12][x] means "after the current sample has been played + for x ticks in this division, its volume will be set to 0". This + implies that if x is 0, then you will not hear any of the sample. + If you wish to insert "silence" in a pattern, it is better to use a + "silence"-sample (see above) due to the lack of proper support for + this effect. + */ + cptr->effect = EFFECT_E_NOTE_CUT; + cptr->cut_param = (effect & 0xF); + if(!cptr->cut_param) + cptr->volume = 0; + break; + + default: + + break; + } + break; + + case 0xF: + /* + [15]: Set speed + Where [15][x][y] means "set speed to x*16+y". Though it is nowhere + near that simple. Let z = x*16+y. Depending on what values z takes, + different units of speed are set, there being two: ticks/division + and beats/minute (though this one is only a label and not strictly + true). If z=0, then what should technically happen is that the + module stops, but in practice it is treated as if z=1, because + there is already a method for stopping the module (running out of + patterns). If z<=32, then it means "set ticks/division to z" + otherwise it means "set beats/minute to z" (convention says that + this should read "If z<32.." but there are some composers out there + that defy conventions). Default values are 6 ticks/division, and + 125 beats/minute (4 divisions = 1 beat). The beats/minute tag is + only meaningful for 6 ticks/division. To get a more accurate view + of how things work, use the following formula: + 24 * beats/minute + divisions/minute = ----------------- + ticks/division + Hence divisions/minute range from 24.75 to 6120, eg. to get a value + of 2000 divisions/minute use 3 ticks/division and 250 beats/minute. + If multiple "set speed" effects are performed in a single division, + the ones on higher-numbered channels take precedence over the ones + on lower-numbered channels. This effect has a large number of + different implementations, but the one described here has the + widest usage. + */ + + if( (effect&0xFF) < 0x21 ) + { + if( effect&0xFF ) + { + mod->song.speed = effect&0xFF; + mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); + } + } + + if( (effect&0xFF) >= 0x21 ) + { + /// HZ = 2 * BPM / 5 + mod->bpm = effect&0xFF; + mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); + } + + break; + + default: + // Unsupported effect + break; + + } + +} + +static void workeffect( note * nptr, channel * cptr ) +{ + switch(cptr->effect) + { + case EFFECT_ARPEGGIO: + + if( cptr->parameffect ) + { + cptr->decalperiod = cptr->period - cptr->Arpperiods[cptr->ArpIndex]; + + cptr->ArpIndex++; + if( cptr->ArpIndex>2 ) + cptr->ArpIndex = 0; + } + break; + + case EFFECT_PORTAMENTO_UP: + + if(cptr->period) + { + cptr->period -= cptr->parameffect; + + if( cptr->period < 113 || cptr->period > 20000 ) + cptr->period = 113; + } + + break; + + case EFFECT_PORTAMENTO_DOWN: + + if(cptr->period) + { + cptr->period += cptr->parameffect; + + if( cptr->period > 20000 ) + cptr->period = 20000; + } + + break; + + case EFFECT_VOLSLIDE_TONEPORTA: + case EFFECT_TONE_PORTAMENTO: + + if( cptr->period && ( cptr->period != cptr->portaperiod ) && cptr->portaperiod ) + { + if( cptr->period > cptr->portaperiod ) + { + if( cptr->period - cptr->portaperiod >= cptr->portaspeed ) + { + cptr->period -= cptr->portaspeed; + } + else + { + cptr->period = cptr->portaperiod; + } + } + else + { + if( cptr->portaperiod - cptr->period >= cptr->portaspeed ) + { + cptr->period += cptr->portaspeed; + } + else + { + cptr->period = cptr->portaperiod; + } + } + + if( cptr->period == cptr->portaperiod ) + { + // If the slide is over, don't let it to be retriggered. + cptr->portaperiod = 0; + } + } + + if( cptr->effect == EFFECT_VOLSLIDE_TONEPORTA ) + { + if( cptr->volumeslide > 0x0F ) + { + cptr->volume = cptr->volume + (cptr->volumeslide>>4); + + if(cptr->volume>63) + cptr->volume = 63; + } + else + { + cptr->volume = cptr->volume - (cptr->volumeslide); + + if(cptr->volume>63) + cptr->volume=0; + } + } + break; + + case EFFECT_VOLSLIDE_VIBRATO: + case EFFECT_VIBRATO: + + cptr->vibraperiod = ( (cptr->vibraparam&0xF) * sintable[cptr->vibrapointeur&0x1F] )>>7; + + if( cptr->vibrapointeur > 31 ) + cptr->vibraperiod = -cptr->vibraperiod; + + cptr->vibrapointeur = (cptr->vibrapointeur+(((cptr->vibraparam>>4))&0xf)) & 0x3F; + + if( cptr->effect == EFFECT_VOLSLIDE_VIBRATO ) + { + if( cptr->volumeslide > 0xF ) + { + cptr->volume = cptr->volume+(cptr->volumeslide>>4); + + if( cptr->volume > 64 ) + cptr->volume = 64; + } + else + { + cptr->volume = cptr->volume - cptr->volumeslide; + + if( cptr->volume > 64 ) + cptr->volume = 0; + } + } + + break; + + case EFFECT_VOLUME_SLIDE: + + if( cptr->volumeslide > 0xF ) + { + cptr->volume += (cptr->volumeslide>>4); + + if( cptr->volume > 64 ) + cptr->volume = 64; + } + else + { + cptr->volume -= (cptr->volumeslide&0xf); + + if( cptr->volume > 64 ) + cptr->volume = 0; + } + break; + + case EFFECT_E_NOTE_CUT: + if(cptr->cut_param) + cptr->cut_param--; + + if(!cptr->cut_param) + cptr->volume = 0; + break; + + default: + break; + + } + +} + +/////////////////////////////////////////////////////////////////////////////////// +bool jar_mod_init(jar_mod_context_t * modctx) +{ + muint i,j; + + if( modctx ) + { + memclear(modctx, 0, sizeof(jar_mod_context_t)); + modctx->playrate = DEFAULT_SAMPLE_RATE; + modctx->stereo = 1; + modctx->stereo_separation = 1; + modctx->bits = 16; + modctx->filter = 1; + modctx->loopcount = 0; + + for(i=0; i < PERIOD_TABLE_LENGTH - 1; i++) + { + for(j=0; j < 8; j++) + { + modctx->fullperiod[(i*8) + j] = periodtable[i] - ((( periodtable[i] - periodtable[i+1] ) / 8) * j); + } + } + + return 1; + } + + return 0; +} + +bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter) +{ + if( modctx ) + { + modctx->playrate = samplerate; + + if( stereo ) + modctx->stereo = 1; + else + modctx->stereo = 0; + + if(stereo_separation < 4) + { + modctx->stereo_separation = stereo_separation; + } + + if( bits == 8 || bits == 16 ) + modctx->bits = bits; + else + modctx->bits = 16; + + if( filter ) + modctx->filter = 1; + else + modctx->filter = 0; + + return 1; + } + + return 0; +} + +// make certain that mod_data stays in memory while playing +static bool jar_mod_load( jar_mod_context_t * modctx, void * mod_data, int mod_data_size ) +{ + muint i, max; + unsigned short t; + sample *sptr; + unsigned char * modmemory,* endmodmemory; + + modmemory = (unsigned char *)mod_data; + endmodmemory = modmemory + mod_data_size; + + + + if(modmemory) + { + if( modctx ) + { + memcopy(&(modctx->song.title),modmemory,1084); + + i = 0; + modctx->number_of_channels = 0; + while(modlist[i].numberofchannels) + { + if(memcompare(modctx->song.signature,modlist[i].signature,4)) + { + modctx->number_of_channels = modlist[i].numberofchannels; + } + + i++; + } + + if( !modctx->number_of_channels ) + { + // 15 Samples modules support + // Shift the whole datas to make it look likes a standard 4 channels mod. + memcopy(&(modctx->song.signature), "M.K.", 4); + memcopy(&(modctx->song.length), &(modctx->song.samples[15]), 130); + memclear(&(modctx->song.samples[15]), 0, 480); + modmemory += 600; + modctx->number_of_channels = 4; + } + else + { + modmemory += 1084; + } + + if( modmemory >= endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + + // Patterns loading + for (i = max = 0; i < 128; i++) + { + while (max <= modctx->song.patterntable[i]) + { + modctx->patterndata[max] = (note*)modmemory; + modmemory += (256*modctx->number_of_channels); + max++; + + if( modmemory >= endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + } + } + + for (i = 0; i < 31; i++) + modctx->sampledata[i]=0; + + // Samples loading + for (i = 0, sptr = modctx->song.samples; i <31; i++, sptr++) + { + t= (sptr->length &0xFF00)>>8 | (sptr->length &0xFF)<<8; + sptr->length = t*2; + + t= (sptr->reppnt &0xFF00)>>8 | (sptr->reppnt &0xFF)<<8; + sptr->reppnt = t*2; + + t= (sptr->replen &0xFF00)>>8 | (sptr->replen &0xFF)<<8; + sptr->replen = t*2; + + + if (sptr->length == 0) continue; + + modctx->sampledata[i] = (char*)modmemory; + modmemory += sptr->length; + + if (sptr->replen + sptr->reppnt > sptr->length) + sptr->replen = sptr->length - sptr->reppnt; + + if( modmemory > endmodmemory ) + return 0; // End passed ? - Probably a bad file ! + } + + // States init + + modctx->tablepos = 0; + modctx->patternpos = 0; + modctx->song.speed = 6; + modctx->bpm = 125; + modctx->samplenb = 0; + + modctx->patternticks = (((long)modctx->song.speed * modctx->playrate * 5)/ (2 * modctx->bpm)) + 1; + modctx->patternticksaim = ((long)modctx->song.speed * modctx->playrate * 5) / (2 * modctx->bpm); + + modctx->sampleticksconst = 3546894UL / modctx->playrate; //8448*428/playrate; + + for(i=0; i < modctx->number_of_channels; i++) + { + modctx->channels[i].volume = 0; + modctx->channels[i].period = 0; + } + + modctx->mod_loaded = 1; + + return 1; + } + } + + return 0; +} + +void jar_mod_fillbuffer( jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +{ + unsigned long i, j; + unsigned long k; + unsigned char c; + unsigned int state_remaining_steps; + int l,r; + int ll,lr; + int tl,tr; + short finalperiod; + note *nptr; + channel *cptr; + + if( modctx && outbuffer ) + { + if(modctx->mod_loaded) + { + state_remaining_steps = 0; + + if( trkbuf ) + { + trkbuf->cur_rd_index = 0; + + memcopy(trkbuf->name,modctx->song.title,sizeof(modctx->song.title)); + + for(i=0;i<31;i++) + { + memcopy(trkbuf->instruments[i].name,modctx->song.samples[i].name,sizeof(trkbuf->instruments[i].name)); + } + } + + ll = modctx->last_l_sample; + lr = modctx->last_r_sample; + + for (i = 0; i < nbsample; i++) + { + //--------------------------------------- + if( modctx->patternticks++ > modctx->patternticksaim ) + { + if( !modctx->patterndelay ) + { + nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; + nptr = nptr + modctx->patternpos; + cptr = modctx->channels; + + modctx->patternticks = 0; + modctx->patterntickse = 0; + + for(c=0;cnumber_of_channels;c++) + { + worknote((note*)(nptr+c), (channel*)(cptr+c),(char)(c+1),modctx); + } + + if( !modctx->jump_loop_effect ) + modctx->patternpos += modctx->number_of_channels; + else + modctx->jump_loop_effect = 0; + + if( modctx->patternpos == 64*modctx->number_of_channels ) + { + modctx->tablepos++; + modctx->patternpos = 0; + if(modctx->tablepos >= modctx->song.length) + { + modctx->tablepos = 0; + modctx->loopcount++; // count next loop + } + } + } + else + { + modctx->patterndelay--; + modctx->patternticks = 0; + modctx->patterntickse = 0; + } + + } + + if( modctx->patterntickse++ > (modctx->patternticksaim/modctx->song.speed) ) + { + nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; + nptr = nptr + modctx->patternpos; + cptr = modctx->channels; + + for(c=0;cnumber_of_channels;c++) + { + workeffect(nptr+c, cptr+c); + } + + modctx->patterntickse = 0; + } + + //--------------------------------------- + + if( trkbuf && !state_remaining_steps ) + { + if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) + { + memclear(&trkbuf->track_state_buf[trkbuf->nb_of_state], 0, sizeof(tracker_state)); + } + } + + l=0; + r=0; + + for(j =0, cptr = modctx->channels; j < modctx->number_of_channels ; j++, cptr++) + { + if( cptr->period != 0 ) + { + finalperiod = cptr->period - cptr->decalperiod - cptr->vibraperiod; + if( finalperiod ) + { + cptr->samppos += ( (modctx->sampleticksconst<<10) / finalperiod ); + } + + cptr->ticks++; + + if( cptr->replen<=2 ) + { + if( (cptr->samppos>>10) >= (cptr->length) ) + { + cptr->length = 0; + cptr->reppnt = 0; + + if( cptr->length ) + cptr->samppos = cptr->samppos % (((unsigned long)cptr->length)<<10); + else + cptr->samppos = 0; + } + } + else + { + if( (cptr->samppos>>10) >= (unsigned long)(cptr->replen+cptr->reppnt) ) + { + cptr->samppos = ((unsigned long)(cptr->reppnt)<<10) + (cptr->samppos % ((unsigned long)(cptr->replen+cptr->reppnt)<<10)); + } + } + + k = cptr->samppos >> 10; + + if( cptr->sampdata!=0 && ( ((j&3)==1) || ((j&3)==2) ) ) + { + r += ( cptr->sampdata[k] * cptr->volume ); + } + + if( cptr->sampdata!=0 && ( ((j&3)==0) || ((j&3)==3) ) ) + { + l += ( cptr->sampdata[k] * cptr->volume ); + } + + if( trkbuf && !state_remaining_steps ) + { + if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) + { + trkbuf->track_state_buf[trkbuf->nb_of_state].number_of_tracks = modctx->number_of_channels; + trkbuf->track_state_buf[trkbuf->nb_of_state].buf_index = i; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern = modctx->song.patterntable[modctx->tablepos]; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_pos = modctx->patternpos / modctx->number_of_channels; + trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_table_pos = modctx->tablepos; + trkbuf->track_state_buf[trkbuf->nb_of_state].bpm = modctx->bpm; + trkbuf->track_state_buf[trkbuf->nb_of_state].speed = modctx->song.speed; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_effect = cptr->effect_code; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_parameffect = cptr->parameffect; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_period = finalperiod; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_volume = cptr->volume; + trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].instrument_number = (unsigned char)cptr->sampnum; + } + } + } + } + + if( trkbuf && !state_remaining_steps ) + { + state_remaining_steps = trkbuf->sample_step; + + if(trkbuf->nb_of_state < trkbuf->nb_max_of_state) + trkbuf->nb_of_state++; + } + else + { + state_remaining_steps--; + } + + tl = (short)l; + tr = (short)r; + + if ( modctx->filter ) + { + // Filter + l = (l+ll)>>1; + r = (r+lr)>>1; + } + + if ( modctx->stereo_separation == 1 ) + { + // Left & Right Stereo panning + l = (l+(r>>1)); + r = (r+(l>>1)); + } + + // Level limitation + if( l > 32767 ) l = 32767; + if( l < -32768 ) l = -32768; + if( r > 32767 ) r = 32767; + if( r < -32768 ) r = -32768; + + // Store the final sample. + outbuffer[(i*2)] = l; + outbuffer[(i*2)+1] = r; + + ll = tl; + lr = tr; + + } + + modctx->last_l_sample = ll; + modctx->last_r_sample = lr; + + modctx->samplenb = modctx->samplenb+nbsample; + } + else + { + for (i = 0; i < nbsample; i++) + { + // Mod not loaded. Return blank buffer. + outbuffer[(i*2)] = 0; + outbuffer[(i*2)+1] = 0; + } + + if(trkbuf) + { + trkbuf->nb_of_state = 0; + trkbuf->cur_rd_index = 0; + trkbuf->name[0] = 0; + memclear(trkbuf->track_state_buf, 0, sizeof(tracker_state) * trkbuf->nb_max_of_state); + memclear(trkbuf->instruments, 0, sizeof(trkbuf->instruments)); + } + } + } +} + +//resets internals for mod context +static void jar_mod_reset( jar_mod_context_t * modctx) +{ + if(modctx) + { + memclear(&modctx->song, 0, sizeof(modctx->song)); + memclear(&modctx->sampledata, 0, sizeof(modctx->sampledata)); + memclear(&modctx->patterndata, 0, sizeof(modctx->patterndata)); + modctx->tablepos = 0; + modctx->patternpos = 0; + modctx->patterndelay = 0; + modctx->jump_loop_effect = 0; + modctx->bpm = 0; + modctx->patternticks = 0; + modctx->patterntickse = 0; + modctx->patternticksaim = 0; + modctx->sampleticksconst = 0; + modctx->loopcount = 0; + modctx->samplenb = 0; + memclear(modctx->channels, 0, sizeof(modctx->channels)); + modctx->number_of_channels = 0; + modctx->mod_loaded = 0; + modctx->last_r_sample = 0; + modctx->last_l_sample = 0; + + jar_mod_init(modctx); + } +} + +void jar_mod_unload( jar_mod_context_t * modctx) +{ + if(modctx) + { + if(modctx->modfile) + { + free(modctx->modfile); + modctx->modfile = 0; + } + jar_mod_reset(modctx); + } +} + + + +mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) +{ + mulong fsize = 0; + if(modctx->modfile) + { + free(modctx->modfile); + modctx->modfile = 0; + } + + FILE *f = fopen(filename, "rb"); + if(f) + { + fseek(f,0,SEEK_END); + fsize = ftell(f); + fseek(f,0,SEEK_SET); + + if(fsize && fsize < 32*1024*1024) + { + modctx->modfile = malloc(fsize); + modctx->modfilesize = fsize; + memset(modctx->modfile, 0, fsize); + fread(modctx->modfile, fsize, 1, f); + fclose(f); + + if(!jar_mod_load(modctx, (void*)modctx->modfile, fsize)) fsize = 0; + } else fsize = 0; + } + return fsize; +} + +mulong jar_mod_current_samples(jar_mod_context_t * modctx) +{ + if(modctx) + return modctx->samplenb; + + return 0; +} + +// Works, however it is very slow, this data should be cached to ensure it is run only once per file +mulong jar_mod_max_samples(jar_mod_context_t * ctx) +{ + jar_mod_context_t tmpctx; + jar_mod_init(&tmpctx); + if(!jar_mod_load(&tmpctx, (void*)ctx->modfile, ctx->modfilesize)) return 0; + + muint buff[2]; + mulong lastcount = tmpctx.loopcount; + + while(1){ + jar_mod_fillbuffer( &tmpctx, buff, 1, 0 ); + if(tmpctx.loopcount > lastcount) break; + } + return tmpctx.samplenb; +} + +// move seek_val to sample index, 0 -> jar_mod_max_samples is the range +void jar_mod_seek_start(jar_mod_context_t * ctx) +{ + if(ctx) + { + jar_mod_reset(ctx); + jar_mod_load(ctx, ctx->modfile, ctx->modfilesize); + } +} + +#endif // end of JAR_MOD_IMPLEMENTATION +//------------------------------------------------------------------------------- + + +#endif //end of header file \ No newline at end of file diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h new file mode 100644 index 00000000..f9ddb511 --- /dev/null +++ b/src/external/jar_xm.h @@ -0,0 +1,2666 @@ +// jar_xm.h - v0.01 - public domain - Joshua Reisenauer, MAR 2016 +// +// HISTORY: +// +// v0.01 2016-02-22 Setup +// +// +// USAGE: +// +// In ONE source file, put: +// +// #define JAR_XM_IMPLEMENTATION +// #include "jar_xm.h" +// +// Other source files should just include jar_xm.h +// +// SAMPLE CODE: +// +// jar_xm_context_t *musicptr; +// float musicBuffer[48000 / 60]; +// int intro_load(void) +// { +// jar_xm_create_context_from_file(&musicptr, 48000, "Song.XM"); +// return 1; +// } +// int intro_unload(void) +// { +// jar_xm_free_context(musicptr); +// return 1; +// } +// int intro_tick(long counter) +// { +// jar_xm_generate_samples(musicptr, musicBuffer, (48000 / 60) / 2); +// if(IsKeyDown(KEY_ENTER)) +// return 1; +// return 0; +// } +// +// +// LISCENSE - FOR LIBXM: +// +// Author: Romain "Artefact2" Dalmaso +// Contributor: Dan Spencer +// Repackaged into jar_xm.h By: Joshua Adam Reisenauer +// This program is free software. It comes without any warranty, to the +// extent permitted by applicable law. You can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To Public +// License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/wtfpl/COPYING for more details. + +#ifndef INCLUDE_JAR_XM_H +#define INCLUDE_JAR_XM_H + +#define JAR_XM_DEBUG 0 +#define JAR_XM_LINEAR_INTERPOLATION 1 // speed increase with decrease in quality +#define JAR_XM_DEFENSIVE 1 +#define JAR_XM_RAMPING 1 + +#include +#include +#include +#include +#include + + + +//------------------------------------------------------------------------------- +#ifdef __cplusplus +extern "C" { +#endif + +struct jar_xm_context_s; +typedef struct jar_xm_context_s jar_xm_context_t; + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + * @returns 3 unable to open input file + * @returns 4 fseek() failed + * @returns 5 fread() failed + * @returns 6 unkown error + * + * @deprecated This function is unsafe! + * @see jar_xm_create_context_safe() + */ +int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename); + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + * + * @deprecated This function is unsafe! + * @see jar_xm_create_context_safe() + */ +int jar_xm_create_context(jar_xm_context_t**, const char* moddata, uint32_t rate); + +/** Create a XM context. + * + * @param moddata the contents of the module + * @param moddata_length the length of the contents of the module, in bytes + * @param rate play rate in Hz, recommended value of 48000 + * + * @returns 0 on success + * @returns 1 if module data is not sane + * @returns 2 if memory allocation failed + */ +int jar_xm_create_context_safe(jar_xm_context_t**, const char* moddata, size_t moddata_length, uint32_t rate); + +/** Free a XM context created by jar_xm_create_context(). */ +void jar_xm_free_context(jar_xm_context_t*); + +/** Play the module and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements (A left and right value for each sample) + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples(jar_xm_context_t*, float* output, size_t numsamples); + +/** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements (A left and right value for each sample) + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) +{ + float* musicBuffer = malloc((2*numsamples)*sizeof(float)); + jar_xm_generate_samples(ctx, musicBuffer, numsamples); + + if(output){ + int x; + for(x=0;x<2*numsamples;x++) + output[x] = musicBuffer[x] * SHRT_MAX; + } + + free(musicBuffer); +} + +/** Play the module, resample from 32 bit to 8 bit, and put the sound samples in an output buffer. + * + * @param output buffer of 2*numsamples elements (A left and right value for each sample) + * @param numsamples number of samples to generate + */ +void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) +{ + float* musicBuffer = malloc((2*numsamples)*sizeof(float)); + jar_xm_generate_samples(ctx, musicBuffer, numsamples); + + if(output){ + int x; + for(x=0;x<2*numsamples;x++) + output[x] = musicBuffer[x] * CHAR_MAX; + } + + free(musicBuffer); +} + + + +/** Set the maximum number of times a module can loop. After the + * specified number of loops, calls to jar_xm_generate_samples will only + * generate silence. You can control the current number of loops with + * jar_xm_get_loop_count(). + * + * @param loopcnt maximum number of loops. Use 0 to loop + * indefinitely. */ +void jar_xm_set_max_loop_count(jar_xm_context_t*, uint8_t loopcnt); + +/** Get the loop count of the currently playing module. This value is + * 0 when the module is still playing, 1 when the module has looped + * once, etc. */ +uint8_t jar_xm_get_loop_count(jar_xm_context_t*); + + + +/** Mute or unmute a channel. + * + * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). + * + * @return whether the channel was muted. + */ +bool jar_xm_mute_channel(jar_xm_context_t*, uint16_t, bool); + +/** Mute or unmute an instrument. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + * + * @return whether the instrument was muted. + */ +bool jar_xm_mute_instrument(jar_xm_context_t*, uint16_t, bool); + + + +/** Get the module name as a NUL-terminated string. */ +const char* jar_xm_get_module_name(jar_xm_context_t*); + +/** Get the tracker name as a NUL-terminated string. */ +const char* jar_xm_get_tracker_name(jar_xm_context_t*); + + + +/** Get the number of channels. */ +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t*); + +/** Get the module length (in patterns). */ +uint16_t jar_xm_get_module_length(jar_xm_context_t*); + +/** Get the number of patterns. */ +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t*); + +/** Get the number of rows of a pattern. + * + * @note Pattern numbers go from 0 to + * jar_xm_get_number_of_patterns(...)-1. + */ +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t*, uint16_t); + +/** Get the number of instruments. */ +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t*); + +/** Get the number of samples of an instrument. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + */ +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t*, uint16_t); + + + +/** Get the current module speed. + * + * @param bpm will receive the current BPM + * @param tempo will receive the current tempo (ticks per line) + */ +void jar_xm_get_playing_speed(jar_xm_context_t*, uint16_t* bpm, uint16_t* tempo); + +/** Get the current position in the module being played. + * + * @param pattern_index if not NULL, will receive the current pattern + * index in the POT (pattern order table) + * + * @param pattern if not NULL, will receive the current pattern number + * + * @param row if not NULL, will receive the current row + * + * @param samples if not NULL, will receive the total number of + * generated samples (divide by sample rate to get seconds of + * generated audio) + */ +void jar_xm_get_position(jar_xm_context_t*, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); + +/** Get the latest time (in number of generated samples) when a + * particular instrument was triggered in any channel. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + */ +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t*, uint16_t); + +/** Get the latest time (in number of generated samples) when a + * particular sample was triggered in any channel. + * + * @note Instrument numbers go from 1 to + * jar_xm_get_number_of_instruments(...). + * + * @note Sample numbers go from 0 to + * jar_xm_get_nubmer_of_samples(...,instr)-1. + */ +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t*, uint16_t instr, uint16_t sample); + +/** Get the latest time (in number of generated samples) when any + * instrument was triggered in a given channel. + * + * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). + */ +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t*, uint16_t); + +/** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. + * + * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. + * @note This function is very slow and should only be run once, if at all. + */ +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t*); + +#ifdef __cplusplus +} +#endif +//------------------------------------------------------------------------------- + + + + + + +//Function Definitions----------------------------------------------------------- +#ifdef JAR_XM_IMPLEMENTATION + +#include +#include + +#if JAR_XM_DEBUG +#include +#define DEBUG(fmt, ...) do { \ + fprintf(stderr, "%s(): " fmt "\n", __func__, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) +#else +#define DEBUG(...) +#endif + +#if jar_xm_BIG_ENDIAN +#error "Big endian platforms are not yet supported, sorry" +/* Make sure the compiler stops, even if #error is ignored */ +extern int __fail[-1]; +#endif + +/* ----- XM constants ----- */ + +#define SAMPLE_NAME_LENGTH 22 +#define INSTRUMENT_NAME_LENGTH 22 +#define MODULE_NAME_LENGTH 20 +#define TRACKER_NAME_LENGTH 20 +#define PATTERN_ORDER_TABLE_LENGTH 256 +#define NUM_NOTES 96 +#define NUM_ENVELOPE_POINTS 12 +#define MAX_NUM_ROWS 256 + +#if JAR_XM_RAMPING +#define jar_xm_SAMPLE_RAMPING_POINTS 0x20 +#endif + +/* ----- Data types ----- */ + +enum jar_xm_waveform_type_e { + jar_xm_SINE_WAVEFORM = 0, + jar_xm_RAMP_DOWN_WAVEFORM = 1, + jar_xm_SQUARE_WAVEFORM = 2, + jar_xm_RANDOM_WAVEFORM = 3, + jar_xm_RAMP_UP_WAVEFORM = 4, +}; +typedef enum jar_xm_waveform_type_e jar_xm_waveform_type_t; + +enum jar_xm_loop_type_e { + jar_xm_NO_LOOP, + jar_xm_FORWARD_LOOP, + jar_xm_PING_PONG_LOOP, +}; +typedef enum jar_xm_loop_type_e jar_xm_loop_type_t; + +enum jar_xm_frequency_type_e { + jar_xm_LINEAR_FREQUENCIES, + jar_xm_AMIGA_FREQUENCIES, +}; +typedef enum jar_xm_frequency_type_e jar_xm_frequency_type_t; + +struct jar_xm_envelope_point_s { + uint16_t frame; + uint16_t value; +}; +typedef struct jar_xm_envelope_point_s jar_xm_envelope_point_t; + +struct jar_xm_envelope_s { + jar_xm_envelope_point_t points[NUM_ENVELOPE_POINTS]; + uint8_t num_points; + uint8_t sustain_point; + uint8_t loop_start_point; + uint8_t loop_end_point; + bool enabled; + bool sustain_enabled; + bool loop_enabled; +}; +typedef struct jar_xm_envelope_s jar_xm_envelope_t; + +struct jar_xm_sample_s { + char name[SAMPLE_NAME_LENGTH + 1]; + int8_t bits; /* Either 8 or 16 */ + + uint32_t length; + uint32_t loop_start; + uint32_t loop_length; + uint32_t loop_end; + float volume; + int8_t finetune; + jar_xm_loop_type_t loop_type; + float panning; + int8_t relative_note; + uint64_t latest_trigger; + + float* data; + }; + typedef struct jar_xm_sample_s jar_xm_sample_t; + + struct jar_xm_instrument_s { + char name[INSTRUMENT_NAME_LENGTH + 1]; + uint16_t num_samples; + uint8_t sample_of_notes[NUM_NOTES]; + jar_xm_envelope_t volume_envelope; + jar_xm_envelope_t panning_envelope; + jar_xm_waveform_type_t vibrato_type; + uint8_t vibrato_sweep; + uint8_t vibrato_depth; + uint8_t vibrato_rate; + uint16_t volume_fadeout; + uint64_t latest_trigger; + bool muted; + + jar_xm_sample_t* samples; + }; + typedef struct jar_xm_instrument_s jar_xm_instrument_t; + + struct jar_xm_pattern_slot_s { + uint8_t note; /* 1-96, 97 = Key Off note */ + uint8_t instrument; /* 1-128 */ + uint8_t volume_column; + uint8_t effect_type; + uint8_t effect_param; + }; + typedef struct jar_xm_pattern_slot_s jar_xm_pattern_slot_t; + + struct jar_xm_pattern_s { + uint16_t num_rows; + jar_xm_pattern_slot_t* slots; /* Array of size num_rows * num_channels */ + }; + typedef struct jar_xm_pattern_s jar_xm_pattern_t; + + struct jar_xm_module_s { + char name[MODULE_NAME_LENGTH + 1]; + char trackername[TRACKER_NAME_LENGTH + 1]; + uint16_t length; + uint16_t restart_position; + uint16_t num_channels; + uint16_t num_patterns; + uint16_t num_instruments; + jar_xm_frequency_type_t frequency_type; + uint8_t pattern_table[PATTERN_ORDER_TABLE_LENGTH]; + + jar_xm_pattern_t* patterns; + jar_xm_instrument_t* instruments; /* Instrument 1 has index 0, + * instrument 2 has index 1, etc. */ + }; + typedef struct jar_xm_module_s jar_xm_module_t; + + struct jar_xm_channel_context_s { + float note; + float orig_note; /* The original note before effect modifications, as read in the pattern. */ + jar_xm_instrument_t* instrument; /* Could be NULL */ + jar_xm_sample_t* sample; /* Could be NULL */ + jar_xm_pattern_slot_t* current; + + float sample_position; + float period; + float frequency; + float step; + bool ping; /* For ping-pong samples: true is -->, false is <-- */ + + float volume; /* Ideally between 0 (muted) and 1 (loudest) */ + float panning; /* Between 0 (left) and 1 (right); 0.5 is centered */ + + uint16_t autovibrato_ticks; + + bool sustained; + float fadeout_volume; + float volume_envelope_volume; + float panning_envelope_panning; + uint16_t volume_envelope_frame_count; + uint16_t panning_envelope_frame_count; + + float autovibrato_note_offset; + + bool arp_in_progress; + uint8_t arp_note_offset; + uint8_t volume_slide_param; + uint8_t fine_volume_slide_param; + uint8_t global_volume_slide_param; + uint8_t panning_slide_param; + uint8_t portamento_up_param; + uint8_t portamento_down_param; + uint8_t fine_portamento_up_param; + uint8_t fine_portamento_down_param; + uint8_t extra_fine_portamento_up_param; + uint8_t extra_fine_portamento_down_param; + uint8_t tone_portamento_param; + float tone_portamento_target_period; + uint8_t multi_retrig_param; + uint8_t note_delay_param; + uint8_t pattern_loop_origin; /* Where to restart a E6y loop */ + uint8_t pattern_loop_count; /* How many loop passes have been done */ + bool vibrato_in_progress; + jar_xm_waveform_type_t vibrato_waveform; + bool vibrato_waveform_retrigger; /* True if a new note retriggers the waveform */ + uint8_t vibrato_param; + uint16_t vibrato_ticks; /* Position in the waveform */ + float vibrato_note_offset; + jar_xm_waveform_type_t tremolo_waveform; + bool tremolo_waveform_retrigger; + uint8_t tremolo_param; + uint8_t tremolo_ticks; + float tremolo_volume; + uint8_t tremor_param; + bool tremor_on; + + uint64_t latest_trigger; + bool muted; + +#if JAR_XM_RAMPING + /* These values are updated at the end of each tick, to save + * a couple of float operations on every generated sample. */ + float target_panning; + float target_volume; + + unsigned long frame_count; + float end_of_previous_sample[jar_xm_SAMPLE_RAMPING_POINTS]; +#endif + + float actual_panning; + float actual_volume; + }; + typedef struct jar_xm_channel_context_s jar_xm_channel_context_t; + + struct jar_xm_context_s { + void* allocated_memory; + jar_xm_module_t module; + uint32_t rate; + + uint16_t tempo; + uint16_t bpm; + float global_volume; + float amplification; + +#if JAR_XM_RAMPING + /* How much is a channel final volume allowed to change per + * sample; this is used to avoid abrubt volume changes which + * manifest as "clicks" in the generated sound. */ + float volume_ramp; + float panning_ramp; /* Same for panning. */ +#endif + + uint8_t current_table_index; + uint8_t current_row; + uint16_t current_tick; /* Can go below 255, with high tempo and a pattern delay */ + float remaining_samples_in_tick; + uint64_t generated_samples; + + bool position_jump; + bool pattern_break; + uint8_t jump_dest; + uint8_t jump_row; + + /* Extra ticks to be played before going to the next row - + * Used for EEy effect */ + uint16_t extra_ticks; + + uint8_t* row_loop_count; /* Array of size MAX_NUM_ROWS * module_length */ + uint8_t loop_count; + uint8_t max_loop_count; + + jar_xm_channel_context_t* channels; +}; + +/* ----- Internal API ----- */ + +#if JAR_XM_DEFENSIVE + +/** Check the module data for errors/inconsistencies. + * + * @returns 0 if everything looks OK. Module should be safe to load. + */ +int jar_xm_check_sanity_preload(const char*, size_t); + +/** Check a loaded module for errors/inconsistencies. + * + * @returns 0 if everything looks OK. + */ +int jar_xm_check_sanity_postload(jar_xm_context_t*); + +#endif + +/** Get the number of bytes needed to store the module data in a + * dynamically allocated blank context. + * + * Things that are dynamically allocated: + * - sample data + * - sample structures in instruments + * - pattern data + * - row loop count arrays + * - pattern structures in module + * - instrument structures in module + * - channel contexts + * - context structure itself + + * @returns 0 if everything looks OK. + */ +size_t jar_xm_get_memory_needed_for_context(const char*, size_t); + +/** Populate the context from module data. + * + * @returns pointer to the memory pool + */ +char* jar_xm_load_module(jar_xm_context_t*, const char*, size_t, char*); + +int jar_xm_create_context(jar_xm_context_t** ctxp, const char* moddata, uint32_t rate) { + return jar_xm_create_context_safe(ctxp, moddata, SIZE_MAX, rate); +} + +int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, size_t moddata_length, uint32_t rate) { +#if JAR_XM_DEFENSIVE + int ret; +#endif + size_t bytes_needed; + char* mempool; + jar_xm_context_t* ctx; + +#if JAR_XM_DEFENSIVE + if((ret = jar_xm_check_sanity_preload(moddata, moddata_length))) { + DEBUG("jar_xm_check_sanity_preload() returned %i, module is not safe to load", ret); + return 1; + } +#endif + + bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length); + mempool = malloc(bytes_needed); + if(mempool == NULL && bytes_needed > 0) { + /* malloc() failed, trouble ahead */ + DEBUG("call to malloc() failed, returned %p", (void*)mempool); + return 2; + } + + /* Initialize most of the fields to 0, 0.f, NULL or false depending on type */ + memset(mempool, 0, bytes_needed); + + ctx = (*ctxp = (jar_xm_context_t*)mempool); + ctx->allocated_memory = mempool; /* Keep original pointer for free() */ + mempool += sizeof(jar_xm_context_t); + + ctx->rate = rate; + mempool = jar_xm_load_module(ctx, moddata, moddata_length, mempool); + + ctx->channels = (jar_xm_channel_context_t*)mempool; + mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t); + + ctx->global_volume = 1.f; + ctx->amplification = .25f; /* XXX: some bad modules may still clip. Find out something better. */ + +#if JAR_XM_RAMPING + ctx->volume_ramp = (1.f / 128.f); + ctx->panning_ramp = (1.f / 128.f); +#endif + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + ch->ping = true; + ch->vibrato_waveform = jar_xm_SINE_WAVEFORM; + ch->vibrato_waveform_retrigger = true; + ch->tremolo_waveform = jar_xm_SINE_WAVEFORM; + ch->tremolo_waveform_retrigger = true; + + ch->volume = ch->volume_envelope_volume = ch->fadeout_volume = 1.0f; + ch->panning = ch->panning_envelope_panning = .5f; + ch->actual_volume = .0f; + ch->actual_panning = .5f; + } + + ctx->row_loop_count = (uint8_t*)mempool; + mempool += MAX_NUM_ROWS * sizeof(uint8_t); + +#if JAR_XM_DEFENSIVE + if((ret = jar_xm_check_sanity_postload(ctx))) { + DEBUG("jar_xm_check_sanity_postload() returned %i, module is not safe to play", ret); + jar_xm_free_context(ctx); + return 1; + } +#endif + + return 0; +} + +void jar_xm_free_context(jar_xm_context_t* context) { + free(context->allocated_memory); +} + +void jar_xm_set_max_loop_count(jar_xm_context_t* context, uint8_t loopcnt) { + context->max_loop_count = loopcnt; +} + +uint8_t jar_xm_get_loop_count(jar_xm_context_t* context) { + return context->loop_count; +} + + + +bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t channel, bool mute) { + bool old = ctx->channels[channel - 1].muted; + ctx->channels[channel - 1].muted = mute; + return old; +} + +bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t instr, bool mute) { + bool old = ctx->module.instruments[instr - 1].muted; + ctx->module.instruments[instr - 1].muted = mute; + return old; +} + + + +const char* jar_xm_get_module_name(jar_xm_context_t* ctx) { + return ctx->module.name; +} + +const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx) { + return ctx->module.trackername; +} + + + +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx) { + return ctx->module.num_channels; +} + +uint16_t jar_xm_get_module_length(jar_xm_context_t* ctx) { + return ctx->module.length; +} + +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx) { + return ctx->module.num_patterns; +} + +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t pattern) { + return ctx->module.patterns[pattern].num_rows; +} + +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx) { + return ctx->module.num_instruments; +} + +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t instrument) { + return ctx->module.instruments[instrument - 1].num_samples; +} + + + +void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo) { + if(bpm) *bpm = ctx->bpm; + if(tempo) *tempo = ctx->tempo; +} + +void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples) { + if(pattern_index) *pattern_index = ctx->current_table_index; + if(pattern) *pattern = ctx->module.pattern_table[ctx->current_table_index]; + if(row) *row = ctx->current_row; + if(samples) *samples = ctx->generated_samples; +} + +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t instr) { + return ctx->module.instruments[instr - 1].latest_trigger; +} + +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample) { + return ctx->module.instruments[instr - 1].samples[sample].latest_trigger; +} + +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t chn) { + return ctx->channels[chn - 1].latest_trigger; +} + +/* .xm files are little-endian. (XXX: Are they really?) */ + +/* Bounded reader macros. + * If we attempt to read the buffer out-of-bounds, pretend that the buffer is + * infinitely padded with zeroes. + */ +#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0) +#define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8)) +#define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16)) +#define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset) + +static inline void memcpy_pad(void* dst, size_t dst_len, const void* src, size_t src_len, size_t offset) { + uint8_t* dst_c = dst; + const uint8_t* src_c = src; + + /* how many bytes can be copied without overrunning `src` */ + size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0; + copy_bytes = copy_bytes > dst_len ? dst_len : copy_bytes; + + memcpy(dst_c, src_c + offset, copy_bytes); + /* padded bytes */ + memset(dst_c + copy_bytes, 0, dst_len - copy_bytes); +} + +#if JAR_XM_DEFENSIVE + +int jar_xm_check_sanity_preload(const char* module, size_t module_length) { + if(module_length < 60) { + return 4; + } + + if(memcmp("Extended Module: ", module, 17) != 0) { + return 1; + } + + if(module[37] != 0x1A) { + return 2; + } + + if(module[59] != 0x01 || module[58] != 0x04) { + /* Not XM 1.04 */ + return 3; + } + + return 0; +} + +int jar_xm_check_sanity_postload(jar_xm_context_t* ctx) { + /* @todo: plenty of stuff to do here… */ + + /* Check the POT */ + for(uint8_t i = 0; i < ctx->module.length; ++i) { + if(ctx->module.pattern_table[i] >= ctx->module.num_patterns) { + if(i+1 == ctx->module.length && ctx->module.length > 1) { + /* Cheap fix */ + --ctx->module.length; + DEBUG("trimming invalid POT at pos %X", i); + } else { + DEBUG("module has invalid POT, pos %X references nonexistent pattern %X", + i, + ctx->module.pattern_table[i]); + return 1; + } + } + } + + return 0; +} + +#endif + +size_t jar_xm_get_memory_needed_for_context(const char* moddata, size_t moddata_length) { + size_t memory_needed = 0; + size_t offset = 60; /* Skip the first header */ + uint16_t num_channels; + uint16_t num_patterns; + uint16_t num_instruments; + + /* Read the module header */ + + num_channels = READ_U16(offset + 8); + num_channels = READ_U16(offset + 8); + + num_patterns = READ_U16(offset + 10); + memory_needed += num_patterns * sizeof(jar_xm_pattern_t); + + num_instruments = READ_U16(offset + 12); + memory_needed += num_instruments * sizeof(jar_xm_instrument_t); + + memory_needed += MAX_NUM_ROWS * READ_U16(offset + 4) * sizeof(uint8_t); /* Module length */ + + /* Header size */ + offset += READ_U32(offset); + + /* Read pattern headers */ + for(uint16_t i = 0; i < num_patterns; ++i) { + uint16_t num_rows; + + num_rows = READ_U16(offset + 5); + memory_needed += num_rows * num_channels * sizeof(jar_xm_pattern_slot_t); + + /* Pattern header length + packed pattern data size */ + offset += READ_U32(offset) + READ_U16(offset + 7); + } + + /* Read instrument headers */ + for(uint16_t i = 0; i < num_instruments; ++i) { + uint16_t num_samples; + uint32_t sample_header_size = 0; + uint32_t sample_size_aggregate = 0; + + num_samples = READ_U16(offset + 27); + memory_needed += num_samples * sizeof(jar_xm_sample_t); + + if(num_samples > 0) { + sample_header_size = READ_U32(offset + 29); + } + + /* Instrument header size */ + offset += READ_U32(offset); + + for(uint16_t j = 0; j < num_samples; ++j) { + uint32_t sample_size; + uint8_t flags; + + sample_size = READ_U32(offset); + flags = READ_U8(offset + 14); + sample_size_aggregate += sample_size; + + if(flags & (1 << 4)) { + /* 16 bit sample */ + memory_needed += sample_size * (sizeof(float) >> 1); + } else { + /* 8 bit sample */ + memory_needed += sample_size * sizeof(float); + } + + offset += sample_header_size; + } + + offset += sample_size_aggregate; + } + + memory_needed += num_channels * sizeof(jar_xm_channel_context_t); + memory_needed += sizeof(jar_xm_context_t); + + return memory_needed; +} + +char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t moddata_length, char* mempool) { + size_t offset = 0; + jar_xm_module_t* mod = &(ctx->module); + + /* Read XM header */ + READ_MEMCPY(mod->name, offset + 17, MODULE_NAME_LENGTH); + READ_MEMCPY(mod->trackername, offset + 38, TRACKER_NAME_LENGTH); + offset += 60; + + /* Read module header */ + uint32_t header_size = READ_U32(offset); + + mod->length = READ_U16(offset + 4); + mod->restart_position = READ_U16(offset + 6); + mod->num_channels = READ_U16(offset + 8); + mod->num_patterns = READ_U16(offset + 10); + mod->num_instruments = READ_U16(offset + 12); + + mod->patterns = (jar_xm_pattern_t*)mempool; + mempool += mod->num_patterns * sizeof(jar_xm_pattern_t); + + mod->instruments = (jar_xm_instrument_t*)mempool; + mempool += mod->num_instruments * sizeof(jar_xm_instrument_t); + + uint16_t flags = READ_U32(offset + 14); + mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES; + + ctx->tempo = READ_U16(offset + 16); + ctx->bpm = READ_U16(offset + 18); + + READ_MEMCPY(mod->pattern_table, offset + 20, PATTERN_ORDER_TABLE_LENGTH); + offset += header_size; + + /* Read patterns */ + for(uint16_t i = 0; i < mod->num_patterns; ++i) { + uint16_t packed_patterndata_size = READ_U16(offset + 7); + jar_xm_pattern_t* pat = mod->patterns + i; + + pat->num_rows = READ_U16(offset + 5); + + pat->slots = (jar_xm_pattern_slot_t*)mempool; + mempool += mod->num_channels * pat->num_rows * sizeof(jar_xm_pattern_slot_t); + + /* Pattern header length */ + offset += READ_U32(offset); + + if(packed_patterndata_size == 0) { + /* No pattern data is present */ + memset(pat->slots, 0, sizeof(jar_xm_pattern_slot_t) * pat->num_rows * mod->num_channels); + } else { + /* This isn't your typical for loop */ + for(uint16_t j = 0, k = 0; j < packed_patterndata_size; ++k) { + uint8_t note = READ_U8(offset + j); + jar_xm_pattern_slot_t* slot = pat->slots + k; + + if(note & (1 << 7)) { + /* MSB is set, this is a compressed packet */ + ++j; + + if(note & (1 << 0)) { + /* Note follows */ + slot->note = READ_U8(offset + j); + ++j; + } else { + slot->note = 0; + } + + if(note & (1 << 1)) { + /* Instrument follows */ + slot->instrument = READ_U8(offset + j); + ++j; + } else { + slot->instrument = 0; + } + + if(note & (1 << 2)) { + /* Volume column follows */ + slot->volume_column = READ_U8(offset + j); + ++j; + } else { + slot->volume_column = 0; + } + + if(note & (1 << 3)) { + /* Effect follows */ + slot->effect_type = READ_U8(offset + j); + ++j; + } else { + slot->effect_type = 0; + } + + if(note & (1 << 4)) { + /* Effect parameter follows */ + slot->effect_param = READ_U8(offset + j); + ++j; + } else { + slot->effect_param = 0; + } + } else { + /* Uncompressed packet */ + slot->note = note; + slot->instrument = READ_U8(offset + j + 1); + slot->volume_column = READ_U8(offset + j + 2); + slot->effect_type = READ_U8(offset + j + 3); + slot->effect_param = READ_U8(offset + j + 4); + j += 5; + } + } + } + + offset += packed_patterndata_size; + } + + /* Read instruments */ + for(uint16_t i = 0; i < ctx->module.num_instruments; ++i) { + uint32_t sample_header_size = 0; + jar_xm_instrument_t* instr = mod->instruments + i; + + READ_MEMCPY(instr->name, offset + 4, INSTRUMENT_NAME_LENGTH); + instr->num_samples = READ_U16(offset + 27); + + if(instr->num_samples > 0) { + /* Read extra header properties */ + sample_header_size = READ_U32(offset + 29); + READ_MEMCPY(instr->sample_of_notes, offset + 33, NUM_NOTES); + + instr->volume_envelope.num_points = READ_U8(offset + 225); + instr->panning_envelope.num_points = READ_U8(offset + 226); + + for(uint8_t j = 0; j < instr->volume_envelope.num_points; ++j) { + instr->volume_envelope.points[j].frame = READ_U16(offset + 129 + 4 * j); + instr->volume_envelope.points[j].value = READ_U16(offset + 129 + 4 * j + 2); + } + + for(uint8_t j = 0; j < instr->panning_envelope.num_points; ++j) { + instr->panning_envelope.points[j].frame = READ_U16(offset + 177 + 4 * j); + instr->panning_envelope.points[j].value = READ_U16(offset + 177 + 4 * j + 2); + } + + instr->volume_envelope.sustain_point = READ_U8(offset + 227); + instr->volume_envelope.loop_start_point = READ_U8(offset + 228); + instr->volume_envelope.loop_end_point = READ_U8(offset + 229); + + instr->panning_envelope.sustain_point = READ_U8(offset + 230); + instr->panning_envelope.loop_start_point = READ_U8(offset + 231); + instr->panning_envelope.loop_end_point = READ_U8(offset + 232); + + uint8_t flags = READ_U8(offset + 233); + instr->volume_envelope.enabled = flags & (1 << 0); + instr->volume_envelope.sustain_enabled = flags & (1 << 1); + instr->volume_envelope.loop_enabled = flags & (1 << 2); + + flags = READ_U8(offset + 234); + instr->panning_envelope.enabled = flags & (1 << 0); + instr->panning_envelope.sustain_enabled = flags & (1 << 1); + instr->panning_envelope.loop_enabled = flags & (1 << 2); + + instr->vibrato_type = READ_U8(offset + 235); + if(instr->vibrato_type == 2) { + instr->vibrato_type = 1; + } else if(instr->vibrato_type == 1) { + instr->vibrato_type = 2; + } + instr->vibrato_sweep = READ_U8(offset + 236); + instr->vibrato_depth = READ_U8(offset + 237); + instr->vibrato_rate = READ_U8(offset + 238); + instr->volume_fadeout = READ_U16(offset + 239); + + instr->samples = (jar_xm_sample_t*)mempool; + mempool += instr->num_samples * sizeof(jar_xm_sample_t); + } else { + instr->samples = NULL; + } + + /* Instrument header size */ + offset += READ_U32(offset); + + for(uint16_t j = 0; j < instr->num_samples; ++j) { + /* Read sample header */ + jar_xm_sample_t* sample = instr->samples + j; + + sample->length = READ_U32(offset); + sample->loop_start = READ_U32(offset + 4); + sample->loop_length = READ_U32(offset + 8); + sample->loop_end = sample->loop_start + sample->loop_length; + sample->volume = (float)READ_U8(offset + 12) / (float)0x40; + sample->finetune = (int8_t)READ_U8(offset + 13); + + uint8_t flags = READ_U8(offset + 14); + if((flags & 3) == 0) { + sample->loop_type = jar_xm_NO_LOOP; + } else if((flags & 3) == 1) { + sample->loop_type = jar_xm_FORWARD_LOOP; + } else { + sample->loop_type = jar_xm_PING_PONG_LOOP; + } + + sample->bits = (flags & (1 << 4)) ? 16 : 8; + + sample->panning = (float)READ_U8(offset + 15) / (float)0xFF; + sample->relative_note = (int8_t)READ_U8(offset + 16); + READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH); + sample->data = (float*)mempool; + + if(sample->bits == 16) { + /* 16 bit sample */ + mempool += sample->length * (sizeof(float) >> 1); + sample->loop_start >>= 1; + sample->loop_length >>= 1; + sample->loop_end >>= 1; + sample->length >>= 1; + } else { + /* 8 bit sample */ + mempool += sample->length * sizeof(float); + } + + offset += sample_header_size; + } + + for(uint16_t j = 0; j < instr->num_samples; ++j) { + /* Read sample data */ + jar_xm_sample_t* sample = instr->samples + j; + uint32_t length = sample->length; + + if(sample->bits == 16) { + int16_t v = 0; + for(uint32_t k = 0; k < length; ++k) { + v = v + (int16_t)READ_U16(offset + (k << 1)); + sample->data[k] = (float)v / (float)(1 << 15); + } + offset += sample->length << 1; + } else { + int8_t v = 0; + for(uint32_t k = 0; k < length; ++k) { + v = v + (int8_t)READ_U8(offset + k); + sample->data[k] = (float)v / (float)(1 << 7); + } + offset += sample->length; + } + } + } + + return mempool; +} + +//------------------------------------------------------------------------------- +//THE FOLLOWING IS FOR PLAYING +//------------------------------------------------------------------------------- + +/* ----- Static functions ----- */ + +static float jar_xm_waveform(jar_xm_waveform_type_t, uint8_t); +static void jar_xm_autovibrato(jar_xm_context_t*, jar_xm_channel_context_t*); +static void jar_xm_vibrato(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_tremolo(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_arpeggio(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); +static void jar_xm_tone_portamento(jar_xm_context_t*, jar_xm_channel_context_t*); +static void jar_xm_pitch_slide(jar_xm_context_t*, jar_xm_channel_context_t*, float); +static void jar_xm_panning_slide(jar_xm_channel_context_t*, uint8_t); +static void jar_xm_volume_slide(jar_xm_channel_context_t*, uint8_t); + +static float jar_xm_envelope_lerp(jar_xm_envelope_point_t*, jar_xm_envelope_point_t*, uint16_t); +static void jar_xm_envelope_tick(jar_xm_channel_context_t*, jar_xm_envelope_t*, uint16_t*, float*); +static void jar_xm_envelopes(jar_xm_channel_context_t*); + +static float jar_xm_linear_period(float); +static float jar_xm_linear_frequency(float); +static float jar_xm_amiga_period(float); +static float jar_xm_amiga_frequency(float); +static float jar_xm_period(jar_xm_context_t*, float); +static float jar_xm_frequency(jar_xm_context_t*, float, float); +static void jar_xm_update_frequency(jar_xm_context_t*, jar_xm_channel_context_t*); + +static void jar_xm_handle_note_and_instrument(jar_xm_context_t*, jar_xm_channel_context_t*, jar_xm_pattern_slot_t*); +static void jar_xm_trigger_note(jar_xm_context_t*, jar_xm_channel_context_t*, unsigned int flags); +static void jar_xm_cut_note(jar_xm_channel_context_t*); +static void jar_xm_key_off(jar_xm_channel_context_t*); + +static void jar_xm_post_pattern_change(jar_xm_context_t*); +static void jar_xm_row(jar_xm_context_t*); +static void jar_xm_tick(jar_xm_context_t*); + +static float jar_xm_next_of_sample(jar_xm_channel_context_t*); +static void jar_xm_sample(jar_xm_context_t*, float*, float*); + +/* ----- Other oddities ----- */ + +#define jar_xm_TRIGGER_KEEP_VOLUME (1 << 0) +#define jar_xm_TRIGGER_KEEP_PERIOD (1 << 1) +#define jar_xm_TRIGGER_KEEP_SAMPLE_POSITION (1 << 2) + +static const uint16_t amiga_frequencies[] = { + 1712, 1616, 1525, 1440, /* C-2, C#2, D-2, D#2 */ + 1357, 1281, 1209, 1141, /* E-2, F-2, F#2, G-2 */ + 1077, 1017, 961, 907, /* G#2, A-2, A#2, B-2 */ + 856, /* C-3 */ +}; + +static const float multi_retrig_add[] = { + 0.f, -1.f, -2.f, -4.f, /* 0, 1, 2, 3 */ + -8.f, -16.f, 0.f, 0.f, /* 4, 5, 6, 7 */ + 0.f, 1.f, 2.f, 4.f, /* 8, 9, A, B */ + 8.f, 16.f, 0.f, 0.f /* C, D, E, F */ +}; + +static const float multi_retrig_multiply[] = { + 1.f, 1.f, 1.f, 1.f, /* 0, 1, 2, 3 */ + 1.f, 1.f, .6666667f, .5f, /* 4, 5, 6, 7 */ + 1.f, 1.f, 1.f, 1.f, /* 8, 9, A, B */ + 1.f, 1.f, 1.5f, 2.f /* C, D, E, F */ +}; + +#define jar_xm_CLAMP_UP1F(vol, limit) do { \ + if((vol) > (limit)) (vol) = (limit); \ + } while(0) +#define jar_xm_CLAMP_UP(vol) jar_xm_CLAMP_UP1F((vol), 1.f) + +#define jar_xm_CLAMP_DOWN1F(vol, limit) do { \ + if((vol) < (limit)) (vol) = (limit); \ + } while(0) +#define jar_xm_CLAMP_DOWN(vol) jar_xm_CLAMP_DOWN1F((vol), .0f) + +#define jar_xm_CLAMP2F(vol, up, down) do { \ + if((vol) > (up)) (vol) = (up); \ + else if((vol) < (down)) (vol) = (down); \ + } while(0) +#define jar_xm_CLAMP(vol) jar_xm_CLAMP2F((vol), 1.f, .0f) + +#define jar_xm_SLIDE_TOWARDS(val, goal, incr) do { \ + if((val) > (goal)) { \ + (val) -= (incr); \ + jar_xm_CLAMP_DOWN1F((val), (goal)); \ + } else if((val) < (goal)) { \ + (val) += (incr); \ + jar_xm_CLAMP_UP1F((val), (goal)); \ + } \ + } while(0) + +#define jar_xm_LERP(u, v, t) ((u) + (t) * ((v) - (u))) +#define jar_xm_INVERSE_LERP(u, v, lerp) (((lerp) - (u)) / ((v) - (u))) + +#define HAS_TONE_PORTAMENTO(s) ((s)->effect_type == 3 \ + || (s)->effect_type == 5 \ + || ((s)->volume_column >> 4) == 0xF) +#define HAS_ARPEGGIO(s) ((s)->effect_type == 0 \ + && (s)->effect_param != 0) +#define HAS_VIBRATO(s) ((s)->effect_type == 4 \ + || (s)->effect_param == 6 \ + || ((s)->volume_column >> 4) == 0xB) +#define NOTE_IS_VALID(n) ((n) > 0 && (n) < 97) + +/* ----- Function definitions ----- */ + +static float jar_xm_waveform(jar_xm_waveform_type_t waveform, uint8_t step) { + static unsigned int next_rand = 24492; + step %= 0x40; + + switch(waveform) { + + case jar_xm_SINE_WAVEFORM: + /* Why not use a table? For saving space, and because there's + * very very little actual performance gain. */ + return -sinf(2.f * 3.141592f * (float)step / (float)0x40); + + case jar_xm_RAMP_DOWN_WAVEFORM: + /* Ramp down: 1.0f when step = 0; -1.0f when step = 0x40 */ + return (float)(0x20 - step) / 0x20; + + case jar_xm_SQUARE_WAVEFORM: + /* Square with a 50% duty */ + return (step >= 0x20) ? 1.f : -1.f; + + case jar_xm_RANDOM_WAVEFORM: + /* Use the POSIX.1-2001 example, just to be deterministic + * across different machines */ + next_rand = next_rand * 1103515245 + 12345; + return (float)((next_rand >> 16) & 0x7FFF) / (float)0x4000 - 1.f; + + case jar_xm_RAMP_UP_WAVEFORM: + /* Ramp up: -1.f when step = 0; 1.f when step = 0x40 */ + return (float)(step - 0x20) / 0x20; + + default: + break; + + } + + return .0f; +} + +static void jar_xm_autovibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + if(ch->instrument == NULL || ch->instrument->vibrato_depth == 0) return; + jar_xm_instrument_t* instr = ch->instrument; + float sweep = 1.f; + + if(ch->autovibrato_ticks < instr->vibrato_sweep) { + /* No idea if this is correct, but it sounds close enough… */ + sweep = jar_xm_LERP(0.f, 1.f, (float)ch->autovibrato_ticks / (float)instr->vibrato_sweep); + } + + unsigned int step = ((ch->autovibrato_ticks++) * instr->vibrato_rate) >> 2; + ch->autovibrato_note_offset = .25f * jar_xm_waveform(instr->vibrato_type, step) + * (float)instr->vibrato_depth / (float)0xF * sweep; + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_vibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { + unsigned int step = pos * (param >> 4); + ch->vibrato_note_offset = + 2.f + * jar_xm_waveform(ch->vibrato_waveform, step) + * (float)(param & 0x0F) / (float)0xF; + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_tremolo(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { + unsigned int step = pos * (param >> 4); + /* Not so sure about this, it sounds correct by ear compared with + * MilkyTracker, but it could come from other bugs */ + ch->tremolo_volume = -1.f * jar_xm_waveform(ch->tremolo_waveform, step) + * (float)(param & 0x0F) / (float)0xF; +} + +static void jar_xm_arpeggio(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t tick) { + switch(tick % 3) { + case 0: + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + break; + case 2: + ch->arp_in_progress = true; + ch->arp_note_offset = param >> 4; + break; + case 1: + ch->arp_in_progress = true; + ch->arp_note_offset = param & 0x0F; + break; + } + + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_tone_portamento(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + /* 3xx called without a note, wait until we get an actual + * target note. */ + if(ch->tone_portamento_target_period == 0.f) return; + + if(ch->period != ch->tone_portamento_target_period) { + jar_xm_SLIDE_TOWARDS(ch->period, + ch->tone_portamento_target_period, + (ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES ? + 4.f : 1.f) * ch->tone_portamento_param + ); + jar_xm_update_frequency(ctx, ch); + } +} + +static void jar_xm_pitch_slide(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, float period_offset) { + /* Don't ask about the 4.f coefficient. I found mention of it + * nowhere. Found by ear™. */ + if(ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES) { + period_offset *= 4.f; + } + + ch->period += period_offset; + jar_xm_CLAMP_DOWN(ch->period); + /* XXX: upper bound of period ? */ + + jar_xm_update_frequency(ctx, ch); +} + +static void jar_xm_panning_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { + float f; + + if((rawval & 0xF0) && (rawval & 0x0F)) { + /* Illegal state */ + return; + } + + if(rawval & 0xF0) { + /* Slide right */ + f = (float)(rawval >> 4) / (float)0xFF; + ch->panning += f; + jar_xm_CLAMP_UP(ch->panning); + } else { + /* Slide left */ + f = (float)(rawval & 0x0F) / (float)0xFF; + ch->panning -= f; + jar_xm_CLAMP_DOWN(ch->panning); + } +} + +static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { + float f; + + if((rawval & 0xF0) && (rawval & 0x0F)) { + /* Illegal state */ + return; + } + + if(rawval & 0xF0) { + /* Slide up */ + f = (float)(rawval >> 4) / (float)0x40; + ch->volume += f; + jar_xm_CLAMP_UP(ch->volume); + } else { + /* Slide down */ + f = (float)(rawval & 0x0F) / (float)0x40; + ch->volume -= f; + jar_xm_CLAMP_DOWN(ch->volume); + } +} + +static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* restrict a, jar_xm_envelope_point_t* restrict b, uint16_t pos) { + /* Linear interpolation between two envelope points */ + if(pos <= a->frame) return a->value; + else if(pos >= b->frame) return b->value; + else { + float p = (float)(pos - a->frame) / (float)(b->frame - a->frame); + return a->value * (1 - p) + b->value * p; + } +} + +static void jar_xm_post_pattern_change(jar_xm_context_t* ctx) { + /* Loop if necessary */ + if(ctx->current_table_index >= ctx->module.length) { + ctx->current_table_index = ctx->module.restart_position; + } +} + +static float jar_xm_linear_period(float note) { + return 7680.f - note * 64.f; +} + +static float jar_xm_linear_frequency(float period) { + return 8363.f * powf(2.f, (4608.f - period) / 768.f); +} + +static float jar_xm_amiga_period(float note) { + unsigned int intnote = note; + uint8_t a = intnote % 12; + int8_t octave = note / 12.f - 2; + uint16_t p1 = amiga_frequencies[a], p2 = amiga_frequencies[a + 1]; + + if(octave > 0) { + p1 >>= octave; + p2 >>= octave; + } else if(octave < 0) { + p1 <<= (-octave); + p2 <<= (-octave); + } + + return jar_xm_LERP(p1, p2, note - intnote); +} + +static float jar_xm_amiga_frequency(float period) { + if(period == .0f) return .0f; + + /* This is the PAL value. No reason to choose this one over the + * NTSC value. */ + return 7093789.2f / (period * 2.f); +} + +static float jar_xm_period(jar_xm_context_t* ctx, float note) { + switch(ctx->module.frequency_type) { + case jar_xm_LINEAR_FREQUENCIES: + return jar_xm_linear_period(note); + case jar_xm_AMIGA_FREQUENCIES: + return jar_xm_amiga_period(note); + } + return .0f; +} + +static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_offset) { + uint8_t a; + int8_t octave; + float note; + uint16_t p1, p2; + + switch(ctx->module.frequency_type) { + + case jar_xm_LINEAR_FREQUENCIES: + return jar_xm_linear_frequency(period - 64.f * note_offset); + + case jar_xm_AMIGA_FREQUENCIES: + if(note_offset == 0) { + /* A chance to escape from insanity */ + return jar_xm_amiga_frequency(period); + } + + /* FIXME: this is very crappy at best */ + a = octave = 0; + + /* Find the octave of the current period */ + if(period > amiga_frequencies[0]) { + --octave; + while(period > (amiga_frequencies[0] << (-octave))) --octave; + } else if(period < amiga_frequencies[12]) { + ++octave; + while(period < (amiga_frequencies[12] >> octave)) ++octave; + } + + /* Find the smallest note closest to the current period */ + for(uint8_t i = 0; i < 12; ++i) { + p1 = amiga_frequencies[i], p2 = amiga_frequencies[i + 1]; + + if(octave > 0) { + p1 >>= octave; + p2 >>= octave; + } else if(octave < 0) { + p1 <<= (-octave); + p2 <<= (-octave); + } + + if(p2 <= period && period <= p1) { + a = i; + break; + } + } + + if(JAR_XM_DEBUG && (p1 < period || p2 > period)) { + DEBUG("%i <= %f <= %i should hold but doesn't, this is a bug", p2, period, p1); + } + + note = 12.f * (octave + 2) + a + jar_xm_INVERSE_LERP(p1, p2, period); + + return jar_xm_amiga_frequency(jar_xm_amiga_period(note + note_offset)); + + } + + return .0f; +} + +static void jar_xm_update_frequency(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { + ch->frequency = jar_xm_frequency( + ctx, ch->period, + (ch->arp_note_offset > 0 ? ch->arp_note_offset : ( + ch->vibrato_note_offset + ch->autovibrato_note_offset + )) + ); + ch->step = ch->frequency / ctx->rate; +} + +static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, + jar_xm_pattern_slot_t* s) { + if(s->instrument > 0) { + if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) { + /* Tone portamento in effect, unclear stuff happens */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_PERIOD | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); + } else if(s->instrument > ctx->module.num_instruments) { + /* Invalid instrument, Cut current note */ + jar_xm_cut_note(ch); + ch->instrument = NULL; + ch->sample = NULL; + } else { + ch->instrument = ctx->module.instruments + (s->instrument - 1); + if(s->note == 0 && ch->sample != NULL) { + /* Ghost instrument, trigger note */ + /* Sample position is kept, but envelopes are reset */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); + } + } + } + + if(NOTE_IS_VALID(s->note)) { + /* Yes, the real note number is s->note -1. Try finding + * THAT in any of the specs! :-) */ + + jar_xm_instrument_t* instr = ch->instrument; + + if(HAS_TONE_PORTAMENTO(ch->current) && instr != NULL && ch->sample != NULL) { + /* Tone portamento in effect */ + ch->note = s->note + ch->sample->relative_note + ch->sample->finetune / 128.f - 1.f; + ch->tone_portamento_target_period = jar_xm_period(ctx, ch->note); + } else if(instr == NULL || ch->instrument->num_samples == 0) { + /* Bad instrument */ + jar_xm_cut_note(ch); + } else { + if(instr->sample_of_notes[s->note - 1] < instr->num_samples) { +#if JAR_XM_RAMPING + for(unsigned int z = 0; z < jar_xm_SAMPLE_RAMPING_POINTS; ++z) { + ch->end_of_previous_sample[z] = jar_xm_next_of_sample(ch); + } + ch->frame_count = 0; +#endif + ch->sample = instr->samples + instr->sample_of_notes[s->note - 1]; + ch->orig_note = ch->note = s->note + ch->sample->relative_note + + ch->sample->finetune / 128.f - 1.f; + if(s->instrument > 0) { + jar_xm_trigger_note(ctx, ch, 0); + } else { + /* Ghost note: keep old volume */ + jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_VOLUME); + } + } else { + /* Bad sample */ + jar_xm_cut_note(ch); + } + } + } else if(s->note == 97) { + /* Key Off */ + jar_xm_key_off(ch); + } + + switch(s->volume_column >> 4) { + + case 0x5: + if(s->volume_column > 0x50) break; + case 0x1: + case 0x2: + case 0x3: + case 0x4: + /* Set volume */ + ch->volume = (float)(s->volume_column - 0x10) / (float)0x40; + break; + + case 0x8: /* Fine volume slide down */ + jar_xm_volume_slide(ch, s->volume_column & 0x0F); + break; + + case 0x9: /* Fine volume slide up */ + jar_xm_volume_slide(ch, s->volume_column << 4); + break; + + case 0xA: /* Set vibrato speed */ + ch->vibrato_param = (ch->vibrato_param & 0x0F) | ((s->volume_column & 0x0F) << 4); + break; + + case 0xC: /* Set panning */ + ch->panning = (float)( + ((s->volume_column & 0x0F) << 4) | (s->volume_column & 0x0F) + ) / (float)0xFF; + break; + + case 0xF: /* Tone portamento */ + if(s->volume_column & 0x0F) { + ch->tone_portamento_param = ((s->volume_column & 0x0F) << 4) + | (s->volume_column & 0x0F); + } + break; + + default: + break; + + } + + switch(s->effect_type) { + + case 1: /* 1xx: Portamento up */ + if(s->effect_param > 0) { + ch->portamento_up_param = s->effect_param; + } + break; + + case 2: /* 2xx: Portamento down */ + if(s->effect_param > 0) { + ch->portamento_down_param = s->effect_param; + } + break; + + case 3: /* 3xx: Tone portamento */ + if(s->effect_param > 0) { + ch->tone_portamento_param = s->effect_param; + } + break; + + case 4: /* 4xy: Vibrato */ + if(s->effect_param & 0x0F) { + /* Set vibrato depth */ + ch->vibrato_param = (ch->vibrato_param & 0xF0) | (s->effect_param & 0x0F); + } + if(s->effect_param >> 4) { + /* Set vibrato speed */ + ch->vibrato_param = (s->effect_param & 0xF0) | (ch->vibrato_param & 0x0F); + } + break; + + case 5: /* 5xy: Tone portamento + Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 6: /* 6xy: Vibrato + Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 7: /* 7xy: Tremolo */ + if(s->effect_param & 0x0F) { + /* Set tremolo depth */ + ch->tremolo_param = (ch->tremolo_param & 0xF0) | (s->effect_param & 0x0F); + } + if(s->effect_param >> 4) { + /* Set tremolo speed */ + ch->tremolo_param = (s->effect_param & 0xF0) | (ch->tremolo_param & 0x0F); + } + break; + + case 8: /* 8xx: Set panning */ + ch->panning = (float)s->effect_param / (float)0xFF; + break; + + case 9: /* 9xx: Sample offset */ + if(ch->sample != NULL && NOTE_IS_VALID(s->note)) { + uint32_t final_offset = s->effect_param << (ch->sample->bits == 16 ? 7 : 8); + if(final_offset >= ch->sample->length) { + /* Pretend the sample dosen't loop and is done playing */ + ch->sample_position = -1; + break; + } + ch->sample_position = final_offset; + } + break; + + case 0xA: /* Axy: Volume slide */ + if(s->effect_param > 0) { + ch->volume_slide_param = s->effect_param; + } + break; + + case 0xB: /* Bxx: Position jump */ + if(s->effect_param < ctx->module.length) { + ctx->position_jump = true; + ctx->jump_dest = s->effect_param; + } + break; + + case 0xC: /* Cxx: Set volume */ + ch->volume = (float)((s->effect_param > 0x40) + ? 0x40 : s->effect_param) / (float)0x40; + break; + + case 0xD: /* Dxx: Pattern break */ + /* Jump after playing this line */ + ctx->pattern_break = true; + ctx->jump_row = (s->effect_param >> 4) * 10 + (s->effect_param & 0x0F); + break; + + case 0xE: /* EXy: Extended command */ + switch(s->effect_param >> 4) { + + case 1: /* E1y: Fine portamento up */ + if(s->effect_param & 0x0F) { + ch->fine_portamento_up_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, -ch->fine_portamento_up_param); + break; + + case 2: /* E2y: Fine portamento down */ + if(s->effect_param & 0x0F) { + ch->fine_portamento_down_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, ch->fine_portamento_down_param); + break; + + case 4: /* E4y: Set vibrato control */ + ch->vibrato_waveform = s->effect_param & 3; + ch->vibrato_waveform_retrigger = !((s->effect_param >> 2) & 1); + break; + + case 5: /* E5y: Set finetune */ + if(NOTE_IS_VALID(ch->current->note) && ch->sample != NULL) { + ch->note = ch->current->note + ch->sample->relative_note + + (float)(((s->effect_param & 0x0F) - 8) << 4) / 128.f - 1.f; + ch->period = jar_xm_period(ctx, ch->note); + jar_xm_update_frequency(ctx, ch); + } + break; + + case 6: /* E6y: Pattern loop */ + if(s->effect_param & 0x0F) { + if((s->effect_param & 0x0F) == ch->pattern_loop_count) { + /* Loop is over */ + ch->pattern_loop_count = 0; + break; + } + + /* Jump to the beginning of the loop */ + ch->pattern_loop_count++; + ctx->position_jump = true; + ctx->jump_row = ch->pattern_loop_origin; + ctx->jump_dest = ctx->current_table_index; + } else { + /* Set loop start point */ + ch->pattern_loop_origin = ctx->current_row; + /* Replicate FT2 E60 bug */ + ctx->jump_row = ch->pattern_loop_origin; + } + break; + + case 7: /* E7y: Set tremolo control */ + ch->tremolo_waveform = s->effect_param & 3; + ch->tremolo_waveform_retrigger = !((s->effect_param >> 2) & 1); + break; + + case 0xA: /* EAy: Fine volume slide up */ + if(s->effect_param & 0x0F) { + ch->fine_volume_slide_param = s->effect_param & 0x0F; + } + jar_xm_volume_slide(ch, ch->fine_volume_slide_param << 4); + break; + + case 0xB: /* EBy: Fine volume slide down */ + if(s->effect_param & 0x0F) { + ch->fine_volume_slide_param = s->effect_param & 0x0F; + } + jar_xm_volume_slide(ch, ch->fine_volume_slide_param); + break; + + case 0xD: /* EDy: Note delay */ + /* XXX: figure this out better. EDx triggers + * the note even when there no note and no + * instrument. But ED0 acts like like a ghost + * note, EDx (x ≠ 0) does not. */ + if(s->note == 0 && s->instrument == 0) { + unsigned int flags = jar_xm_TRIGGER_KEEP_VOLUME; + + if(ch->current->effect_param & 0x0F) { + ch->note = ch->orig_note; + jar_xm_trigger_note(ctx, ch, flags); + } else { + jar_xm_trigger_note( + ctx, ch, + flags + | jar_xm_TRIGGER_KEEP_PERIOD + | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION + ); + } + } + break; + + case 0xE: /* EEy: Pattern delay */ + ctx->extra_ticks = (ch->current->effect_param & 0x0F) * ctx->tempo; + break; + + default: + break; + + } + break; + + case 0xF: /* Fxx: Set tempo/BPM */ + if(s->effect_param > 0) { + if(s->effect_param <= 0x1F) { + ctx->tempo = s->effect_param; + } else { + ctx->bpm = s->effect_param; + } + } + break; + + case 16: /* Gxx: Set global volume */ + ctx->global_volume = (float)((s->effect_param > 0x40) + ? 0x40 : s->effect_param) / (float)0x40; + break; + + case 17: /* Hxy: Global volume slide */ + if(s->effect_param > 0) { + ch->global_volume_slide_param = s->effect_param; + } + break; + + case 21: /* Lxx: Set envelope position */ + ch->volume_envelope_frame_count = s->effect_param; + ch->panning_envelope_frame_count = s->effect_param; + break; + + case 25: /* Pxy: Panning slide */ + if(s->effect_param > 0) { + ch->panning_slide_param = s->effect_param; + } + break; + + case 27: /* Rxy: Multi retrig note */ + if(s->effect_param > 0) { + if((s->effect_param >> 4) == 0) { + /* Keep previous x value */ + ch->multi_retrig_param = (ch->multi_retrig_param & 0xF0) | (s->effect_param & 0x0F); + } else { + ch->multi_retrig_param = s->effect_param; + } + } + break; + + case 29: /* Txy: Tremor */ + if(s->effect_param > 0) { + /* Tremor x and y params do not appear to be separately + * kept in memory, unlike Rxy */ + ch->tremor_param = s->effect_param; + } + break; + + case 33: /* Xxy: Extra stuff */ + switch(s->effect_param >> 4) { + + case 1: /* X1y: Extra fine portamento up */ + if(s->effect_param & 0x0F) { + ch->extra_fine_portamento_up_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, -1.0f * ch->extra_fine_portamento_up_param); + break; + + case 2: /* X2y: Extra fine portamento down */ + if(s->effect_param & 0x0F) { + ch->extra_fine_portamento_down_param = s->effect_param & 0x0F; + } + jar_xm_pitch_slide(ctx, ch, ch->extra_fine_portamento_down_param); + break; + + default: + break; + + } + break; + + default: + break; + + } +} + +static void jar_xm_trigger_note(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, unsigned int flags) { + if(!(flags & jar_xm_TRIGGER_KEEP_SAMPLE_POSITION)) { + ch->sample_position = 0.f; + ch->ping = true; + } + + if(ch->sample != NULL) { + if(!(flags & jar_xm_TRIGGER_KEEP_VOLUME)) { + ch->volume = ch->sample->volume; + } + + ch->panning = ch->sample->panning; + } + + ch->sustained = true; + ch->fadeout_volume = ch->volume_envelope_volume = 1.0f; + ch->panning_envelope_panning = .5f; + ch->volume_envelope_frame_count = ch->panning_envelope_frame_count = 0; + ch->vibrato_note_offset = 0.f; + ch->tremolo_volume = 0.f; + ch->tremor_on = false; + + ch->autovibrato_ticks = 0; + + if(ch->vibrato_waveform_retrigger) { + ch->vibrato_ticks = 0; /* XXX: should the waveform itself also + * be reset to sine? */ + } + if(ch->tremolo_waveform_retrigger) { + ch->tremolo_ticks = 0; + } + + if(!(flags & jar_xm_TRIGGER_KEEP_PERIOD)) { + ch->period = jar_xm_period(ctx, ch->note); + jar_xm_update_frequency(ctx, ch); + } + + ch->latest_trigger = ctx->generated_samples; + if(ch->instrument != NULL) { + ch->instrument->latest_trigger = ctx->generated_samples; + } + if(ch->sample != NULL) { + ch->sample->latest_trigger = ctx->generated_samples; + } +} + +static void jar_xm_cut_note(jar_xm_channel_context_t* ch) { + /* NB: this is not the same as Key Off */ + ch->volume = .0f; +} + +static void jar_xm_key_off(jar_xm_channel_context_t* ch) { + /* Key Off */ + ch->sustained = false; + + /* If no volume envelope is used, also cut the note */ + if(ch->instrument == NULL || !ch->instrument->volume_envelope.enabled) { + jar_xm_cut_note(ch); + } +} + +static void jar_xm_row(jar_xm_context_t* ctx) { + if(ctx->position_jump) { + ctx->current_table_index = ctx->jump_dest; + ctx->current_row = ctx->jump_row; + ctx->position_jump = false; + ctx->pattern_break = false; + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } else if(ctx->pattern_break) { + ctx->current_table_index++; + ctx->current_row = ctx->jump_row; + ctx->pattern_break = false; + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } + + jar_xm_pattern_t* cur = ctx->module.patterns + ctx->module.pattern_table[ctx->current_table_index]; + bool in_a_loop = false; + + /* Read notes… */ + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_pattern_slot_t* s = cur->slots + ctx->current_row * ctx->module.num_channels + i; + jar_xm_channel_context_t* ch = ctx->channels + i; + + ch->current = s; + + if(s->effect_type != 0xE || s->effect_param >> 4 != 0xD) { + jar_xm_handle_note_and_instrument(ctx, ch, s); + } else { + ch->note_delay_param = s->effect_param & 0x0F; + } + + if(!in_a_loop && ch->pattern_loop_count > 0) { + in_a_loop = true; + } + } + + if(!in_a_loop) { + /* No E6y loop is in effect (or we are in the first pass) */ + ctx->loop_count = (ctx->row_loop_count[MAX_NUM_ROWS * ctx->current_table_index + ctx->current_row]++); + } + + ctx->current_row++; /* Since this is an uint8, this line can + * increment from 255 to 0, in which case it + * is still necessary to go the next + * pattern. */ + if(!ctx->position_jump && !ctx->pattern_break && + (ctx->current_row >= cur->num_rows || ctx->current_row == 0)) { + ctx->current_table_index++; + ctx->current_row = ctx->jump_row; /* This will be 0 most of + * the time, except when E60 + * is used */ + ctx->jump_row = 0; + jar_xm_post_pattern_change(ctx); + } +} + +static void jar_xm_envelope_tick(jar_xm_channel_context_t* ch, + jar_xm_envelope_t* env, + uint16_t* counter, + float* outval) { + if(env->num_points < 2) { + /* Don't really know what to do… */ + if(env->num_points == 1) { + /* XXX I am pulling this out of my ass */ + *outval = (float)env->points[0].value / (float)0x40; + if(*outval > 1) { + *outval = 1; + } + } + + return; + } else { + uint8_t j; + + if(env->loop_enabled) { + uint16_t loop_start = env->points[env->loop_start_point].frame; + uint16_t loop_end = env->points[env->loop_end_point].frame; + uint16_t loop_length = loop_end - loop_start; + + if(*counter >= loop_end) { + *counter -= loop_length; + } + } + + for(j = 0; j < (env->num_points - 2); ++j) { + if(env->points[j].frame <= *counter && + env->points[j+1].frame >= *counter) { + break; + } + } + + *outval = jar_xm_envelope_lerp(env->points + j, env->points + j + 1, *counter) / (float)0x40; + + /* Make sure it is safe to increment frame count */ + if(!ch->sustained || !env->sustain_enabled || + *counter != env->points[env->sustain_point].frame) { + (*counter)++; + } + } +} + +static void jar_xm_envelopes(jar_xm_channel_context_t* ch) { + if(ch->instrument != NULL) { + if(ch->instrument->volume_envelope.enabled) { + if(!ch->sustained) { + ch->fadeout_volume -= (float)ch->instrument->volume_fadeout / 65536.f; + jar_xm_CLAMP_DOWN(ch->fadeout_volume); + } + + jar_xm_envelope_tick(ch, + &(ch->instrument->volume_envelope), + &(ch->volume_envelope_frame_count), + &(ch->volume_envelope_volume)); + } + + if(ch->instrument->panning_envelope.enabled) { + jar_xm_envelope_tick(ch, + &(ch->instrument->panning_envelope), + &(ch->panning_envelope_frame_count), + &(ch->panning_envelope_panning)); + } + } +} + +static void jar_xm_tick(jar_xm_context_t* ctx) { + if(ctx->current_tick == 0) { + jar_xm_row(ctx); + } + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + jar_xm_envelopes(ch); + jar_xm_autovibrato(ctx, ch); + + if(ch->arp_in_progress && !HAS_ARPEGGIO(ch->current)) { + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + jar_xm_update_frequency(ctx, ch); + } + if(ch->vibrato_in_progress && !HAS_VIBRATO(ch->current)) { + ch->vibrato_in_progress = false; + ch->vibrato_note_offset = 0.f; + jar_xm_update_frequency(ctx, ch); + } + + switch(ch->current->volume_column >> 4) { + + case 0x6: /* Volume slide down */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->current->volume_column & 0x0F); + break; + + case 0x7: /* Volume slide up */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->current->volume_column << 4); + break; + + case 0xB: /* Vibrato */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = false; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + break; + + case 0xD: /* Panning slide left */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->current->volume_column & 0x0F); + break; + + case 0xE: /* Panning slide right */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->current->volume_column << 4); + break; + + case 0xF: /* Tone portamento */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + break; + + default: + break; + + } + + switch(ch->current->effect_type) { + + case 0: /* 0xy: Arpeggio */ + if(ch->current->effect_param > 0) { + char arp_offset = ctx->tempo % 3; + switch(arp_offset) { + case 2: /* 0 -> x -> 0 -> y -> x -> … */ + if(ctx->current_tick == 1) { + ch->arp_in_progress = true; + ch->arp_note_offset = ch->current->effect_param >> 4; + jar_xm_update_frequency(ctx, ch); + break; + } + /* No break here, this is intended */ + case 1: /* 0 -> 0 -> y -> x -> … */ + if(ctx->current_tick == 0) { + ch->arp_in_progress = false; + ch->arp_note_offset = 0; + jar_xm_update_frequency(ctx, ch); + break; + } + /* No break here, this is intended */ + case 0: /* 0 -> y -> x -> … */ + jar_xm_arpeggio(ctx, ch, ch->current->effect_param, ctx->current_tick - arp_offset); + default: + break; + } + } + break; + + case 1: /* 1xx: Portamento up */ + if(ctx->current_tick == 0) break; + jar_xm_pitch_slide(ctx, ch, -ch->portamento_up_param); + break; + + case 2: /* 2xx: Portamento down */ + if(ctx->current_tick == 0) break; + jar_xm_pitch_slide(ctx, ch, ch->portamento_down_param); + break; + + case 3: /* 3xx: Tone portamento */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + break; + + case 4: /* 4xy: Vibrato */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = true; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + break; + + case 5: /* 5xy: Tone portamento + Volume slide */ + if(ctx->current_tick == 0) break; + jar_xm_tone_portamento(ctx, ch); + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 6: /* 6xy: Vibrato + Volume slide */ + if(ctx->current_tick == 0) break; + ch->vibrato_in_progress = true; + jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 7: /* 7xy: Tremolo */ + if(ctx->current_tick == 0) break; + jar_xm_tremolo(ctx, ch, ch->tremolo_param, ch->tremolo_ticks++); + break; + + case 0xA: /* Axy: Volume slide */ + if(ctx->current_tick == 0) break; + jar_xm_volume_slide(ch, ch->volume_slide_param); + break; + + case 0xE: /* EXy: Extended command */ + switch(ch->current->effect_param >> 4) { + + case 0x9: /* E9y: Retrigger note */ + if(ctx->current_tick != 0 && ch->current->effect_param & 0x0F) { + if(!(ctx->current_tick % (ch->current->effect_param & 0x0F))) { + jar_xm_trigger_note(ctx, ch, 0); + jar_xm_envelopes(ch); + } + } + break; + + case 0xC: /* ECy: Note cut */ + if((ch->current->effect_param & 0x0F) == ctx->current_tick) { + jar_xm_cut_note(ch); + } + break; + + case 0xD: /* EDy: Note delay */ + if(ch->note_delay_param == ctx->current_tick) { + jar_xm_handle_note_and_instrument(ctx, ch, ch->current); + jar_xm_envelopes(ch); + } + break; + + default: + break; + + } + break; + + case 17: /* Hxy: Global volume slide */ + if(ctx->current_tick == 0) break; + if((ch->global_volume_slide_param & 0xF0) && + (ch->global_volume_slide_param & 0x0F)) { + /* Illegal state */ + break; + } + if(ch->global_volume_slide_param & 0xF0) { + /* Global slide up */ + float f = (float)(ch->global_volume_slide_param >> 4) / (float)0x40; + ctx->global_volume += f; + jar_xm_CLAMP_UP(ctx->global_volume); + } else { + /* Global slide down */ + float f = (float)(ch->global_volume_slide_param & 0x0F) / (float)0x40; + ctx->global_volume -= f; + jar_xm_CLAMP_DOWN(ctx->global_volume); + } + break; + + case 20: /* Kxx: Key off */ + /* Most documentations will tell you the parameter has no + * use. Don't be fooled. */ + if(ctx->current_tick == ch->current->effect_param) { + jar_xm_key_off(ch); + } + break; + + case 25: /* Pxy: Panning slide */ + if(ctx->current_tick == 0) break; + jar_xm_panning_slide(ch, ch->panning_slide_param); + break; + + case 27: /* Rxy: Multi retrig note */ + if(ctx->current_tick == 0) break; + if(((ch->multi_retrig_param) & 0x0F) == 0) break; + if((ctx->current_tick % (ch->multi_retrig_param & 0x0F)) == 0) { + float v = ch->volume * multi_retrig_multiply[ch->multi_retrig_param >> 4] + + multi_retrig_add[ch->multi_retrig_param >> 4]; + jar_xm_CLAMP(v); + jar_xm_trigger_note(ctx, ch, 0); + ch->volume = v; + } + break; + + case 29: /* Txy: Tremor */ + if(ctx->current_tick == 0) break; + ch->tremor_on = ( + (ctx->current_tick - 1) % ((ch->tremor_param >> 4) + (ch->tremor_param & 0x0F) + 2) + > + (ch->tremor_param >> 4) + ); + break; + + default: + break; + + } + + float panning, volume; + + panning = ch->panning + + (ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; + + if(ch->tremor_on) { + volume = .0f; + } else { + volume = ch->volume + ch->tremolo_volume; + jar_xm_CLAMP(volume); + volume *= ch->fadeout_volume * ch->volume_envelope_volume; + } + +#if JAR_XM_RAMPING + ch->target_panning = panning; + ch->target_volume = volume; +#else + ch->actual_panning = panning; + ch->actual_volume = volume; +#endif + } + + ctx->current_tick++; + if(ctx->current_tick >= ctx->tempo + ctx->extra_ticks) { + ctx->current_tick = 0; + ctx->extra_ticks = 0; + } + + /* FT2 manual says number of ticks / second = BPM * 0.4 */ + ctx->remaining_samples_in_tick += (float)ctx->rate / ((float)ctx->bpm * 0.4f); +} + +static float jar_xm_next_of_sample(jar_xm_channel_context_t* ch) { + if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { +#if JAR_XM_RAMPING + if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], .0f, + (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } +#endif + return .0f; + } + if(ch->sample->length == 0) { + return .0f; + } + + float u, v, t; + uint32_t a, b; + a = (uint32_t)ch->sample_position; /* This cast is fine, + * sample_position will not + * go above integer + * ranges */ + if(JAR_XM_LINEAR_INTERPOLATION) { + b = a + 1; + t = ch->sample_position - a; /* Cheaper than fmodf(., 1.f) */ + } + u = ch->sample->data[a]; + + switch(ch->sample->loop_type) { + + case jar_xm_NO_LOOP: + if(JAR_XM_LINEAR_INTERPOLATION) { + v = (b < ch->sample->length) ? ch->sample->data[b] : .0f; + } + ch->sample_position += ch->step; + if(ch->sample_position >= ch->sample->length) { + ch->sample_position = -1; + } + break; + + case jar_xm_FORWARD_LOOP: + if(JAR_XM_LINEAR_INTERPOLATION) { + v = ch->sample->data[ + (b == ch->sample->loop_end) ? ch->sample->loop_start : b + ]; + } + ch->sample_position += ch->step; + while(ch->sample_position >= ch->sample->loop_end) { + ch->sample_position -= ch->sample->loop_length; + } + break; + + case jar_xm_PING_PONG_LOOP: + if(ch->ping) { + ch->sample_position += ch->step; + } else { + ch->sample_position -= ch->step; + } + /* XXX: this may not work for very tight ping-pong loops + * (ie switches direction more than once per sample */ + if(ch->ping) { + if(JAR_XM_LINEAR_INTERPOLATION) { + v = (b >= ch->sample->loop_end) ? ch->sample->data[a] : ch->sample->data[b]; + } + if(ch->sample_position >= ch->sample->loop_end) { + ch->ping = false; + ch->sample_position = (ch->sample->loop_end << 1) - ch->sample_position; + } + /* sanity checking */ + if(ch->sample_position >= ch->sample->length) { + ch->ping = false; + ch->sample_position -= ch->sample->length - 1; + } + } else { + if(JAR_XM_LINEAR_INTERPOLATION) { + v = u; + u = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[a] : ch->sample->data[b - 2]; + } + if(ch->sample_position <= ch->sample->loop_start) { + ch->ping = true; + ch->sample_position = (ch->sample->loop_start << 1) - ch->sample_position; + } + /* sanity checking */ + if(ch->sample_position <= .0f) { + ch->ping = true; + ch->sample_position = .0f; + } + } + break; + + default: + v = .0f; + break; + } + + float endval = JAR_XM_LINEAR_INTERPOLATION ? jar_xm_LERP(u, v, t) : u; + +#if JAR_XM_RAMPING + if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { + /* Smoothly transition between old and new sample. */ + return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], endval, + (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); + } +#endif + + return endval; +} + +static void jar_xm_sample(jar_xm_context_t* ctx, float* left, float* right) { + if(ctx->remaining_samples_in_tick <= 0) { + jar_xm_tick(ctx); + } + ctx->remaining_samples_in_tick--; + + *left = 0.f; + *right = 0.f; + + if(ctx->max_loop_count > 0 && ctx->loop_count >= ctx->max_loop_count) { + return; + } + + for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { + jar_xm_channel_context_t* ch = ctx->channels + i; + + if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { + continue; + } + + const float fval = jar_xm_next_of_sample(ch); + + if(!ch->muted && !ch->instrument->muted) { + *left += fval * ch->actual_volume * (1.f - ch->actual_panning); + *right += fval * ch->actual_volume * ch->actual_panning; + } + +#if JAR_XM_RAMPING + ch->frame_count++; + jar_xm_SLIDE_TOWARDS(ch->actual_volume, ch->target_volume, ctx->volume_ramp); + jar_xm_SLIDE_TOWARDS(ch->actual_panning, ch->target_panning, ctx->panning_ramp); +#endif + } + + const float fgvol = ctx->global_volume * ctx->amplification; + *left *= fgvol; + *right *= fgvol; + +#if JAR_XM_DEBUG + if(fabs(*left) > 1 || fabs(*right) > 1) { + DEBUG("clipping frame: %f %f, this is a bad module or a libxm bug", *left, *right); + } +#endif +} + +void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples) { + if(ctx && output) { + ctx->generated_samples += numsamples; + for(size_t i = 0; i < numsamples; i++) { + jar_xm_sample(ctx, output + (2 * i), output + (2 * i + 1)); + } + } +} + +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) +{ + uint64_t total = 0; + uint8_t currentLoopCount = jar_xm_get_loop_count(ctx); + jar_xm_set_max_loop_count(ctx, 0); + + while(jar_xm_get_loop_count(ctx) == currentLoopCount) + { + total += ctx->remaining_samples_in_tick; + ctx->remaining_samples_in_tick = 0; + jar_xm_tick(ctx); + } + + ctx->loop_count = currentLoopCount; + return total; +} + + + + + +//-------------------------------------------- +//FILE LOADER - TODO - NEEDS TO BE CLEANED UP +//-------------------------------------------- + + + +#undef DEBUG +#define DEBUG(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) + +#define DEBUG_ERR(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + } while(0) + +#define FATAL(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + exit(1); \ + } while(0) + +#define FATAL_ERR(...) do { \ + fprintf(stderr, __VA_ARGS__); \ + fflush(stderr); \ + exit(1); \ + } while(0) + + +int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename) { + FILE* xmf; + int size; + + xmf = fopen(filename, "rb"); + if(xmf == NULL) { + DEBUG_ERR("Could not open input file"); + *ctx = NULL; + return 3; + } + + fseek(xmf, 0, SEEK_END); + size = ftell(xmf); + rewind(xmf); + if(size == -1) { + fclose(xmf); + DEBUG_ERR("fseek() failed"); + *ctx = NULL; + return 4; + } + + char* data = malloc(size + 1); + if(fread(data, 1, size, xmf) < size) { + fclose(xmf); + DEBUG_ERR("fread() failed"); + *ctx = NULL; + return 5; + } + + fclose(xmf); + + switch(jar_xm_create_context_safe(ctx, data, size, rate)) { + case 0: + break; + + case 1: + DEBUG("could not create context: module is not sane\n"); + *ctx = NULL; + return 1; + break; + + case 2: + FATAL("could not create context: malloc failed\n"); + return 2; + break; + + default: + FATAL("could not create context: unknown error\n"); + return 6; + break; + + } + + return 0; +} + + + + +#endif//end of JAR_XM_IMPLEMENTATION +//------------------------------------------------------------------------------- + + + + +#endif//end of INCLUDE_JAR_XM_H diff --git a/src/external/openal_soft/COPYING b/src/external/openal_soft/COPYING new file mode 100644 index 00000000..d0c89786 --- /dev/null +++ b/src/external/openal_soft/COPYING @@ -0,0 +1,484 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/src/external/openal_soft/include/AL/al.h b/src/external/openal_soft/include/AL/al.h new file mode 100644 index 00000000..413b3833 --- /dev/null +++ b/src/external/openal_soft/include/AL/al.h @@ -0,0 +1,656 @@ +#ifndef AL_AL_H +#define AL_AL_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef AL_API + #if defined(AL_LIBTYPE_STATIC) + #define AL_API + #elif defined(_WIN32) + #define AL_API __declspec(dllimport) + #else + #define AL_API extern + #endif +#endif + +#if defined(_WIN32) + #define AL_APIENTRY __cdecl +#else + #define AL_APIENTRY +#endif + + +/** Deprecated macro. */ +#define OPENAL +#define ALAPI AL_API +#define ALAPIENTRY AL_APIENTRY +#define AL_INVALID (-1) +#define AL_ILLEGAL_ENUM AL_INVALID_ENUM +#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION + +/** Supported AL version. */ +#define AL_VERSION_1_0 +#define AL_VERSION_1_1 + +/** 8-bit boolean */ +typedef char ALboolean; + +/** character */ +typedef char ALchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALsizei; + +/** enumerated 32-bit value */ +typedef int ALenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALdouble; + +/** void type (for opaque pointers only) */ +typedef void ALvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/** "no distance model" or "no buffer" */ +#define AL_NONE 0 + +/** Boolean False. */ +#define AL_FALSE 0 + +/** Boolean True. */ +#define AL_TRUE 1 + + +/** + * Relative source. + * Type: ALboolean + * Range: [AL_TRUE, AL_FALSE] + * Default: AL_FALSE + * + * Specifies if the Source has relative coordinates. + */ +#define AL_SOURCE_RELATIVE 0x202 + + +/** + * Inner cone angle, in degrees. + * Type: ALint, ALfloat + * Range: [0 - 360] + * Default: 360 + * + * The angle covered by the inner cone, where the source will not attenuate. + */ +#define AL_CONE_INNER_ANGLE 0x1001 + +/** + * Outer cone angle, in degrees. + * Range: [0 - 360] + * Default: 360 + * + * The angle covered by the outer cone, where the source will be fully + * attenuated. + */ +#define AL_CONE_OUTER_ANGLE 0x1002 + +/** + * Source pitch. + * Type: ALfloat + * Range: [0.5 - 2.0] + * Default: 1.0 + * + * A multiplier for the frequency (sample rate) of the source's buffer. + */ +#define AL_PITCH 0x1003 + +/** + * Source or listener position. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * The source or listener location in three dimensional space. + * + * OpenAL, like OpenGL, uses a right handed coordinate system, where in a + * frontal default view X (thumb) points right, Y points up (index finger), and + * Z points towards the viewer/camera (middle finger). + * + * To switch from a left handed coordinate system, flip the sign on the Z + * coordinate. + */ +#define AL_POSITION 0x1004 + +/** + * Source direction. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * Specifies the current direction in local space. + * A zero-length vector specifies an omni-directional source (cone is ignored). + */ +#define AL_DIRECTION 0x1005 + +/** + * Source or listener velocity. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * Specifies the current velocity in local space. + */ +#define AL_VELOCITY 0x1006 + +/** + * Source looping. + * Type: ALboolean + * Range: [AL_TRUE, AL_FALSE] + * Default: AL_FALSE + * + * Specifies whether source is looping. + */ +#define AL_LOOPING 0x1007 + +/** + * Source buffer. + * Type: ALuint + * Range: any valid Buffer. + * + * Specifies the buffer to provide sound samples. + */ +#define AL_BUFFER 0x1009 + +/** + * Source or listener gain. + * Type: ALfloat + * Range: [0.0 - ] + * + * A value of 1.0 means unattenuated. Each division by 2 equals an attenuation + * of about -6dB. Each multiplicaton by 2 equals an amplification of about + * +6dB. + * + * A value of 0.0 is meaningless with respect to a logarithmic scale; it is + * silent. + */ +#define AL_GAIN 0x100A + +/** + * Minimum source gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * The minimum gain allowed for a source, after distance and cone attenation is + * applied (if applicable). + */ +#define AL_MIN_GAIN 0x100D + +/** + * Maximum source gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * The maximum gain allowed for a source, after distance and cone attenation is + * applied (if applicable). + */ +#define AL_MAX_GAIN 0x100E + +/** + * Listener orientation. + * Type: ALfloat[6] + * Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0} + * + * Effectively two three dimensional vectors. The first vector is the front (or + * "at") and the second is the top (or "up"). + * + * Both vectors are in local space. + */ +#define AL_ORIENTATION 0x100F + +/** + * Source state (query only). + * Type: ALint + * Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED] + */ +#define AL_SOURCE_STATE 0x1010 + +/** Source state value. */ +#define AL_INITIAL 0x1011 +#define AL_PLAYING 0x1012 +#define AL_PAUSED 0x1013 +#define AL_STOPPED 0x1014 + +/** + * Source Buffer Queue size (query only). + * Type: ALint + * + * The number of buffers queued using alSourceQueueBuffers, minus the buffers + * removed with alSourceUnqueueBuffers. + */ +#define AL_BUFFERS_QUEUED 0x1015 + +/** + * Source Buffer Queue processed count (query only). + * Type: ALint + * + * The number of queued buffers that have been fully processed, and can be + * removed with alSourceUnqueueBuffers. + * + * Looping sources will never fully process buffers because they will be set to + * play again for when the source loops. + */ +#define AL_BUFFERS_PROCESSED 0x1016 + +/** + * Source reference distance. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * The distance in units that no attenuation occurs. + * + * At 0.0, no distance attenuation ever occurs on non-linear attenuation models. + */ +#define AL_REFERENCE_DISTANCE 0x1020 + +/** + * Source rolloff factor. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * Multiplier to exaggerate or diminish distance attenuation. + * + * At 0.0, no distance attenuation ever occurs. + */ +#define AL_ROLLOFF_FACTOR 0x1021 + +/** + * Outer cone gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * Default: 0.0 + * + * The gain attenuation applied when the listener is outside of the source's + * outer cone. + */ +#define AL_CONE_OUTER_GAIN 0x1022 + +/** + * Source maximum distance. + * Type: ALfloat + * Range: [0.0 - ] + * Default: +inf + * + * The distance above which the source is not attenuated any further with a + * clamped distance model, or where attenuation reaches 0.0 gain for linear + * distance models with a default rolloff factor. + */ +#define AL_MAX_DISTANCE 0x1023 + +/** Source buffer position, in seconds */ +#define AL_SEC_OFFSET 0x1024 +/** Source buffer position, in sample frames */ +#define AL_SAMPLE_OFFSET 0x1025 +/** Source buffer position, in bytes */ +#define AL_BYTE_OFFSET 0x1026 + +/** + * Source type (query only). + * Type: ALint + * Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED] + * + * A Source is Static if a Buffer has been attached using AL_BUFFER. + * + * A Source is Streaming if one or more Buffers have been attached using + * alSourceQueueBuffers. + * + * A Source is Undetermined when it has the NULL buffer attached using + * AL_BUFFER. + */ +#define AL_SOURCE_TYPE 0x1027 + +/** Source type value. */ +#define AL_STATIC 0x1028 +#define AL_STREAMING 0x1029 +#define AL_UNDETERMINED 0x1030 + +/** Buffer format specifier. */ +#define AL_FORMAT_MONO8 0x1100 +#define AL_FORMAT_MONO16 0x1101 +#define AL_FORMAT_STEREO8 0x1102 +#define AL_FORMAT_STEREO16 0x1103 + +/** Buffer frequency (query only). */ +#define AL_FREQUENCY 0x2001 +/** Buffer bits per sample (query only). */ +#define AL_BITS 0x2002 +/** Buffer channel count (query only). */ +#define AL_CHANNELS 0x2003 +/** Buffer data size (query only). */ +#define AL_SIZE 0x2004 + +/** + * Buffer state. + * + * Not for public use. + */ +#define AL_UNUSED 0x2010 +#define AL_PENDING 0x2011 +#define AL_PROCESSED 0x2012 + + +/** No error. */ +#define AL_NO_ERROR 0 + +/** Invalid name paramater passed to AL call. */ +#define AL_INVALID_NAME 0xA001 + +/** Invalid enum parameter passed to AL call. */ +#define AL_INVALID_ENUM 0xA002 + +/** Invalid value parameter passed to AL call. */ +#define AL_INVALID_VALUE 0xA003 + +/** Illegal AL call. */ +#define AL_INVALID_OPERATION 0xA004 + +/** Not enough memory. */ +#define AL_OUT_OF_MEMORY 0xA005 + + +/** Context string: Vendor ID. */ +#define AL_VENDOR 0xB001 +/** Context string: Version. */ +#define AL_VERSION 0xB002 +/** Context string: Renderer ID. */ +#define AL_RENDERER 0xB003 +/** Context string: Space-separated extension list. */ +#define AL_EXTENSIONS 0xB004 + + +/** + * Doppler scale. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * Scale for source and listener velocities. + */ +#define AL_DOPPLER_FACTOR 0xC000 +AL_API void AL_APIENTRY alDopplerFactor(ALfloat value); + +/** + * Doppler velocity (deprecated). + * + * A multiplier applied to the Speed of Sound. + */ +#define AL_DOPPLER_VELOCITY 0xC001 +AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value); + +/** + * Speed of Sound, in units per second. + * Type: ALfloat + * Range: [0.0001 - ] + * Default: 343.3 + * + * The speed at which sound waves are assumed to travel, when calculating the + * doppler effect. + */ +#define AL_SPEED_OF_SOUND 0xC003 +AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value); + +/** + * Distance attenuation model. + * Type: ALint + * Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, + * AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, + * AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED] + * Default: AL_INVERSE_DISTANCE_CLAMPED + * + * The model by which sources attenuate with distance. + * + * None - No distance attenuation. + * Inverse - Doubling the distance halves the source gain. + * Linear - Linear gain scaling between the reference and max distances. + * Exponent - Exponential gain dropoff. + * + * Clamped variations work like the non-clamped counterparts, except the + * distance calculated is clamped between the reference and max distances. + */ +#define AL_DISTANCE_MODEL 0xD000 +AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); + +/** Distance model value. */ +#define AL_INVERSE_DISTANCE 0xD001 +#define AL_INVERSE_DISTANCE_CLAMPED 0xD002 +#define AL_LINEAR_DISTANCE 0xD003 +#define AL_LINEAR_DISTANCE_CLAMPED 0xD004 +#define AL_EXPONENT_DISTANCE 0xD005 +#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 + +/** Renderer State management. */ +AL_API void AL_APIENTRY alEnable(ALenum capability); +AL_API void AL_APIENTRY alDisable(ALenum capability); +AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability); + +/** State retrieval. */ +AL_API const ALchar* AL_APIENTRY alGetString(ALenum param); +AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values); +AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values); +AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values); +AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param); +AL_API ALint AL_APIENTRY alGetInteger(ALenum param); +AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param); +AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param); + +/** + * Error retrieval. + * + * Obtain the first error generated in the AL context since the last check. + */ +AL_API ALenum AL_APIENTRY alGetError(void); + +/** + * Extension support. + * + * Query for the presence of an extension, and obtain any appropriate function + * pointers and enum values. + */ +AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); +AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname); +AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename); + + +/** Set Listener parameters */ +AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value); +AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value); +AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values); + +/** Get Listener parameters */ +AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values); + + +/** Create Source objects. */ +AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources); +/** Delete Source objects. */ +AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources); +/** Verify a handle is a valid Source. */ +AL_API ALboolean AL_APIENTRY alIsSource(ALuint source); + +/** Set Source parameters. */ +AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value); +AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value); +AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values); + +/** Get Source parameters. */ +AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values); + + +/** Play, replay, or resume (if paused) a list of Sources */ +AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources); +/** Stop a list of Sources */ +AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources); +/** Rewind a list of Sources */ +AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources); +/** Pause a list of Sources */ +AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources); + +/** Play, replay, or resume a Source */ +AL_API void AL_APIENTRY alSourcePlay(ALuint source); +/** Stop a Source */ +AL_API void AL_APIENTRY alSourceStop(ALuint source); +/** Rewind a Source (set playback postiton to beginning) */ +AL_API void AL_APIENTRY alSourceRewind(ALuint source); +/** Pause a Source */ +AL_API void AL_APIENTRY alSourcePause(ALuint source); + +/** Queue buffers onto a source */ +AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers); +/** Unqueue processed buffers from a source */ +AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers); + + +/** Create Buffer objects */ +AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers); +/** Delete Buffer objects */ +AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers); +/** Verify a handle is a valid Buffer */ +AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer); + +/** Specifies the data to be copied into a buffer */ +AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); + +/** Set Buffer parameters, */ +AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value); +AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value); +AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values); + +/** Get Buffer parameters. */ +AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values); + +/** Pointer-to-function type, useful for dynamically getting AL entry points. */ +typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability); +typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability); +typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability); +typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param); +typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values); +typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values); +typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param); +typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param); +typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param); +typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param); +typedef ALenum (AL_APIENTRY *LPALGETERROR)(void); +typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname); +typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname); +typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename); +typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources); +typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources); +typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers); +typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers); +typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers); +typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers); +typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer); +typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); +typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value); +typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value); +typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value); +typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel); + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#endif /* AL_AL_H */ diff --git a/src/external/openal_soft/include/AL/alc.h b/src/external/openal_soft/include/AL/alc.h new file mode 100644 index 00000000..294e8b33 --- /dev/null +++ b/src/external/openal_soft/include/AL/alc.h @@ -0,0 +1,237 @@ +#ifndef AL_ALC_H +#define AL_ALC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef ALC_API + #if defined(AL_LIBTYPE_STATIC) + #define ALC_API + #elif defined(_WIN32) + #define ALC_API __declspec(dllimport) + #else + #define ALC_API extern + #endif +#endif + +#if defined(_WIN32) + #define ALC_APIENTRY __cdecl +#else + #define ALC_APIENTRY +#endif + + +/** Deprecated macro. */ +#define ALCAPI ALC_API +#define ALCAPIENTRY ALC_APIENTRY +#define ALC_INVALID 0 + +/** Supported ALC version? */ +#define ALC_VERSION_0_1 1 + +/** Opaque device handle */ +typedef struct ALCdevice_struct ALCdevice; +/** Opaque context handle */ +typedef struct ALCcontext_struct ALCcontext; + +/** 8-bit boolean */ +typedef char ALCboolean; + +/** character */ +typedef char ALCchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALCbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALCubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALCshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALCushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALCint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALCuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALCsizei; + +/** enumerated 32-bit value */ +typedef int ALCenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALCfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALCdouble; + +/** void type (for opaque pointers only) */ +typedef void ALCvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/** Boolean False. */ +#define ALC_FALSE 0 + +/** Boolean True. */ +#define ALC_TRUE 1 + +/** Context attribute: Hz. */ +#define ALC_FREQUENCY 0x1007 + +/** Context attribute: Hz. */ +#define ALC_REFRESH 0x1008 + +/** Context attribute: AL_TRUE or AL_FALSE. */ +#define ALC_SYNC 0x1009 + +/** Context attribute: requested Mono (3D) Sources. */ +#define ALC_MONO_SOURCES 0x1010 + +/** Context attribute: requested Stereo Sources. */ +#define ALC_STEREO_SOURCES 0x1011 + +/** No error. */ +#define ALC_NO_ERROR 0 + +/** Invalid device handle. */ +#define ALC_INVALID_DEVICE 0xA001 + +/** Invalid context handle. */ +#define ALC_INVALID_CONTEXT 0xA002 + +/** Invalid enum parameter passed to an ALC call. */ +#define ALC_INVALID_ENUM 0xA003 + +/** Invalid value parameter passed to an ALC call. */ +#define ALC_INVALID_VALUE 0xA004 + +/** Out of memory. */ +#define ALC_OUT_OF_MEMORY 0xA005 + + +/** Runtime ALC version. */ +#define ALC_MAJOR_VERSION 0x1000 +#define ALC_MINOR_VERSION 0x1001 + +/** Context attribute list properties. */ +#define ALC_ATTRIBUTES_SIZE 0x1002 +#define ALC_ALL_ATTRIBUTES 0x1003 + +/** String for the default device specifier. */ +#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 +/** + * String for the given device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known device specifiers (list ends with an empty string). + */ +#define ALC_DEVICE_SPECIFIER 0x1005 +/** String for space-separated list of ALC extensions. */ +#define ALC_EXTENSIONS 0x1006 + + +/** Capture extension */ +#define ALC_EXT_CAPTURE 1 +/** + * String for the given capture device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known capture device specifiers (list ends with an empty string). + */ +#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 +/** String for the default capture device specifier. */ +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 +/** Number of sample frames available for capture. */ +#define ALC_CAPTURE_SAMPLES 0x312 + + +/** Enumerate All extension */ +#define ALC_ENUMERATE_ALL_EXT 1 +/** String for the default extended device specifier. */ +#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 +/** + * String for the given extended device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known extended device specifiers (list ends with an empty string). + */ +#define ALC_ALL_DEVICES_SPECIFIER 0x1013 + + +/** Context management. */ +ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist); +ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context); +ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context); +ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context); +ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context); +ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void); +ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context); + +/** Device management. */ +ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename); +ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device); + + +/** + * Error support. + * + * Obtain the most recent Device error. + */ +ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device); + +/** + * Extension support. + * + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. + */ +ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname); +ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); +ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname); + +/** Query function. */ +ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param); +ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); + +/** Capture function. */ +ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); +ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); + +/** Pointer-to-function type, useful for dynamically getting ALC entry points. */ +typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist); +typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context); +typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void); +typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context); +typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename); +typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device); +typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device); +typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname); +typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); +typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname); +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param); +typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); +typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); +typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); + +#if defined(__cplusplus) +} +#endif + +#endif /* AL_ALC_H */ diff --git a/src/external/openal_soft/include/AL/alext.h b/src/external/openal_soft/include/AL/alext.h new file mode 100644 index 00000000..6af581aa --- /dev/null +++ b/src/external/openal_soft/include/AL/alext.h @@ -0,0 +1,438 @@ +/** + * OpenAL cross platform audio library + * Copyright (C) 2008 by authors. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Or go to http://www.gnu.org/copyleft/lgpl.html + */ + +#ifndef AL_ALEXT_H +#define AL_ALEXT_H + +#include +/* Define int64_t and uint64_t types */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif + +#include "alc.h" +#include "al.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef AL_LOKI_IMA_ADPCM_format +#define AL_LOKI_IMA_ADPCM_format 1 +#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000 +#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001 +#endif + +#ifndef AL_LOKI_WAVE_format +#define AL_LOKI_WAVE_format 1 +#define AL_FORMAT_WAVE_EXT 0x10002 +#endif + +#ifndef AL_EXT_vorbis +#define AL_EXT_vorbis 1 +#define AL_FORMAT_VORBIS_EXT 0x10003 +#endif + +#ifndef AL_LOKI_quadriphonic +#define AL_LOKI_quadriphonic 1 +#define AL_FORMAT_QUAD8_LOKI 0x10004 +#define AL_FORMAT_QUAD16_LOKI 0x10005 +#endif + +#ifndef AL_EXT_float32 +#define AL_EXT_float32 1 +#define AL_FORMAT_MONO_FLOAT32 0x10010 +#define AL_FORMAT_STEREO_FLOAT32 0x10011 +#endif + +#ifndef AL_EXT_double +#define AL_EXT_double 1 +#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012 +#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013 +#endif + +#ifndef AL_EXT_MULAW +#define AL_EXT_MULAW 1 +#define AL_FORMAT_MONO_MULAW_EXT 0x10014 +#define AL_FORMAT_STEREO_MULAW_EXT 0x10015 +#endif + +#ifndef AL_EXT_ALAW +#define AL_EXT_ALAW 1 +#define AL_FORMAT_MONO_ALAW_EXT 0x10016 +#define AL_FORMAT_STEREO_ALAW_EXT 0x10017 +#endif + +#ifndef ALC_LOKI_audio_channel +#define ALC_LOKI_audio_channel 1 +#define ALC_CHAN_MAIN_LOKI 0x500001 +#define ALC_CHAN_PCM_LOKI 0x500002 +#define ALC_CHAN_CD_LOKI 0x500003 +#endif + +#ifndef AL_EXT_MCFORMATS +#define AL_EXT_MCFORMATS 1 +#define AL_FORMAT_QUAD8 0x1204 +#define AL_FORMAT_QUAD16 0x1205 +#define AL_FORMAT_QUAD32 0x1206 +#define AL_FORMAT_REAR8 0x1207 +#define AL_FORMAT_REAR16 0x1208 +#define AL_FORMAT_REAR32 0x1209 +#define AL_FORMAT_51CHN8 0x120A +#define AL_FORMAT_51CHN16 0x120B +#define AL_FORMAT_51CHN32 0x120C +#define AL_FORMAT_61CHN8 0x120D +#define AL_FORMAT_61CHN16 0x120E +#define AL_FORMAT_61CHN32 0x120F +#define AL_FORMAT_71CHN8 0x1210 +#define AL_FORMAT_71CHN16 0x1211 +#define AL_FORMAT_71CHN32 0x1212 +#endif + +#ifndef AL_EXT_MULAW_MCFORMATS +#define AL_EXT_MULAW_MCFORMATS 1 +#define AL_FORMAT_MONO_MULAW 0x10014 +#define AL_FORMAT_STEREO_MULAW 0x10015 +#define AL_FORMAT_QUAD_MULAW 0x10021 +#define AL_FORMAT_REAR_MULAW 0x10022 +#define AL_FORMAT_51CHN_MULAW 0x10023 +#define AL_FORMAT_61CHN_MULAW 0x10024 +#define AL_FORMAT_71CHN_MULAW 0x10025 +#endif + +#ifndef AL_EXT_IMA4 +#define AL_EXT_IMA4 1 +#define AL_FORMAT_MONO_IMA4 0x1300 +#define AL_FORMAT_STEREO_IMA4 0x1301 +#endif + +#ifndef AL_EXT_STATIC_BUFFER +#define AL_EXT_STATIC_BUFFER 1 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); +#endif +#endif + +#ifndef ALC_EXT_EFX +#define ALC_EXT_EFX 1 +#include "efx.h" +#endif + +#ifndef ALC_EXT_disconnect +#define ALC_EXT_disconnect 1 +#define ALC_CONNECTED 0x313 +#endif + +#ifndef ALC_EXT_thread_local_context +#define ALC_EXT_thread_local_context 1 +typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); +typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context); +ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); +#endif +#endif + +#ifndef AL_EXT_source_distance_model +#define AL_EXT_source_distance_model 1 +#define AL_SOURCE_DISTANCE_MODEL 0x200 +#endif + +#ifndef AL_SOFT_buffer_sub_data +#define AL_SOFT_buffer_sub_data 1 +#define AL_BYTE_RW_OFFSETS_SOFT 0x1031 +#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); +#endif +#endif + +#ifndef AL_SOFT_loop_points +#define AL_SOFT_loop_points 1 +#define AL_LOOP_POINTS_SOFT 0x2015 +#endif + +#ifndef AL_EXT_FOLDBACK +#define AL_EXT_FOLDBACK 1 +#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK" +#define AL_FOLDBACK_EVENT_BLOCK 0x4112 +#define AL_FOLDBACK_EVENT_START 0x4111 +#define AL_FOLDBACK_EVENT_STOP 0x4113 +#define AL_FOLDBACK_MODE_MONO 0x4101 +#define AL_FOLDBACK_MODE_STEREO 0x4102 +typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei); +typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK); +typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback); +AL_API void AL_APIENTRY alRequestFoldbackStop(void); +#endif +#endif + +#ifndef ALC_EXT_DEDICATED +#define ALC_EXT_DEDICATED 1 +#define AL_DEDICATED_GAIN 0x0001 +#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001 +#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000 +#endif + +#ifndef AL_SOFT_buffer_samples +#define AL_SOFT_buffer_samples 1 +/* Channel configurations */ +#define AL_MONO_SOFT 0x1500 +#define AL_STEREO_SOFT 0x1501 +#define AL_REAR_SOFT 0x1502 +#define AL_QUAD_SOFT 0x1503 +#define AL_5POINT1_SOFT 0x1504 +#define AL_6POINT1_SOFT 0x1505 +#define AL_7POINT1_SOFT 0x1506 + +/* Sample types */ +#define AL_BYTE_SOFT 0x1400 +#define AL_UNSIGNED_BYTE_SOFT 0x1401 +#define AL_SHORT_SOFT 0x1402 +#define AL_UNSIGNED_SHORT_SOFT 0x1403 +#define AL_INT_SOFT 0x1404 +#define AL_UNSIGNED_INT_SOFT 0x1405 +#define AL_FLOAT_SOFT 0x1406 +#define AL_DOUBLE_SOFT 0x1407 +#define AL_BYTE3_SOFT 0x1408 +#define AL_UNSIGNED_BYTE3_SOFT 0x1409 + +/* Storage formats */ +#define AL_MONO8_SOFT 0x1100 +#define AL_MONO16_SOFT 0x1101 +#define AL_MONO32F_SOFT 0x10010 +#define AL_STEREO8_SOFT 0x1102 +#define AL_STEREO16_SOFT 0x1103 +#define AL_STEREO32F_SOFT 0x10011 +#define AL_QUAD8_SOFT 0x1204 +#define AL_QUAD16_SOFT 0x1205 +#define AL_QUAD32F_SOFT 0x1206 +#define AL_REAR8_SOFT 0x1207 +#define AL_REAR16_SOFT 0x1208 +#define AL_REAR32F_SOFT 0x1209 +#define AL_5POINT1_8_SOFT 0x120A +#define AL_5POINT1_16_SOFT 0x120B +#define AL_5POINT1_32F_SOFT 0x120C +#define AL_6POINT1_8_SOFT 0x120D +#define AL_6POINT1_16_SOFT 0x120E +#define AL_6POINT1_32F_SOFT 0x120F +#define AL_7POINT1_8_SOFT 0x1210 +#define AL_7POINT1_16_SOFT 0x1211 +#define AL_7POINT1_32F_SOFT 0x1212 + +/* Buffer attributes */ +#define AL_INTERNAL_FORMAT_SOFT 0x2008 +#define AL_BYTE_LENGTH_SOFT 0x2009 +#define AL_SAMPLE_LENGTH_SOFT 0x200A +#define AL_SEC_LENGTH_SOFT 0x200B + +typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); +typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); +typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); +typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); +AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); +AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data); +AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); +#endif +#endif + +#ifndef AL_SOFT_direct_channels +#define AL_SOFT_direct_channels 1 +#define AL_DIRECT_CHANNELS_SOFT 0x1033 +#endif + +#ifndef ALC_SOFT_loopback +#define ALC_SOFT_loopback 1 +#define ALC_FORMAT_CHANNELS_SOFT 0x1990 +#define ALC_FORMAT_TYPE_SOFT 0x1991 + +/* Sample types */ +#define ALC_BYTE_SOFT 0x1400 +#define ALC_UNSIGNED_BYTE_SOFT 0x1401 +#define ALC_SHORT_SOFT 0x1402 +#define ALC_UNSIGNED_SHORT_SOFT 0x1403 +#define ALC_INT_SOFT 0x1404 +#define ALC_UNSIGNED_INT_SOFT 0x1405 +#define ALC_FLOAT_SOFT 0x1406 + +/* Channel configurations */ +#define ALC_MONO_SOFT 0x1500 +#define ALC_STEREO_SOFT 0x1501 +#define ALC_QUAD_SOFT 0x1503 +#define ALC_5POINT1_SOFT 0x1504 +#define ALC_6POINT1_SOFT 0x1505 +#define ALC_7POINT1_SOFT 0x1506 + +typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); +typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); +typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName); +ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); +ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); +#endif +#endif + +#ifndef AL_EXT_STEREO_ANGLES +#define AL_EXT_STEREO_ANGLES 1 +#define AL_STEREO_ANGLES 0x1030 +#endif + +#ifndef AL_EXT_SOURCE_RADIUS +#define AL_EXT_SOURCE_RADIUS 1 +#define AL_SOURCE_RADIUS 0x1031 +#endif + +#ifndef AL_SOFT_source_latency +#define AL_SOFT_source_latency 1 +#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200 +#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201 +typedef int64_t ALint64SOFT; +typedef uint64_t ALuint64SOFT; +typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble); +typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble); +typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*); +typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT); +typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT); +typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value); +AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3); +AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values); +AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value); +AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3); +AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values); +AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value); +AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3); +AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values); +AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value); +AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3); +AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values); +#endif +#endif + +#ifndef ALC_EXT_DEFAULT_FILTER_ORDER +#define ALC_EXT_DEFAULT_FILTER_ORDER 1 +#define ALC_DEFAULT_FILTER_ORDER 0x1100 +#endif + +#ifndef AL_SOFT_deferred_updates +#define AL_SOFT_deferred_updates 1 +#define AL_DEFERRED_UPDATES_SOFT 0xC002 +typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); +typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); +AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); +#endif +#endif + +#ifndef AL_SOFT_block_alignment +#define AL_SOFT_block_alignment 1 +#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C +#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D +#endif + +#ifndef AL_SOFT_MSADPCM +#define AL_SOFT_MSADPCM 1 +#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302 +#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303 +#endif + +#ifndef AL_SOFT_source_length +#define AL_SOFT_source_length 1 +/*#define AL_BYTE_LENGTH_SOFT 0x2009*/ +/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ +/*#define AL_SEC_LENGTH_SOFT 0x200B*/ +#endif + +#ifndef ALC_SOFT_pause_device +#define ALC_SOFT_pause_device 1 +typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device); +typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device); +ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device); +#endif +#endif + +#ifndef AL_EXT_BFORMAT +#define AL_EXT_BFORMAT 1 +#define AL_FORMAT_BFORMAT2D_8 0x20021 +#define AL_FORMAT_BFORMAT2D_16 0x20022 +#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023 +#define AL_FORMAT_BFORMAT3D_8 0x20031 +#define AL_FORMAT_BFORMAT3D_16 0x20032 +#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033 +#endif + +#ifndef AL_EXT_MULAW_BFORMAT +#define AL_EXT_MULAW_BFORMAT 1 +#define AL_FORMAT_BFORMAT2D_MULAW 0x10031 +#define AL_FORMAT_BFORMAT3D_MULAW 0x10032 +#endif + +#ifndef ALC_SOFT_HRTF +#define ALC_SOFT_HRTF 1 +#define ALC_HRTF_SOFT 0x1992 +#define ALC_DONT_CARE_SOFT 0x0002 +#define ALC_HRTF_STATUS_SOFT 0x1993 +#define ALC_HRTF_DISABLED_SOFT 0x0000 +#define ALC_HRTF_ENABLED_SOFT 0x0001 +#define ALC_HRTF_DENIED_SOFT 0x0002 +#define ALC_HRTF_REQUIRED_SOFT 0x0003 +#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004 +#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005 +#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994 +#define ALC_HRTF_SPECIFIER_SOFT 0x1995 +#define ALC_HRTF_ID_SOFT 0x1996 +typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index); +typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index); +ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs); +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/external/openal_soft/include/AL/efx-creative.h b/src/external/openal_soft/include/AL/efx-creative.h new file mode 100644 index 00000000..0a04c982 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx-creative.h @@ -0,0 +1,3 @@ +/* The tokens that would be defined here are already defined in efx.h. This + * empty file is here to provide compatibility with Windows-based projects + * that would include it. */ diff --git a/src/external/openal_soft/include/AL/efx-presets.h b/src/external/openal_soft/include/AL/efx-presets.h new file mode 100644 index 00000000..8539fd51 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx-presets.h @@ -0,0 +1,402 @@ +/* Reverb presets for EFX */ + +#ifndef EFX_PRESETS_H +#define EFX_PRESETS_H + +#ifndef EFXEAXREVERBPROPERTIES_DEFINED +#define EFXEAXREVERBPROPERTIES_DEFINED +typedef struct { + float flDensity; + float flDiffusion; + float flGain; + float flGainHF; + float flGainLF; + float flDecayTime; + float flDecayHFRatio; + float flDecayLFRatio; + float flReflectionsGain; + float flReflectionsDelay; + float flReflectionsPan[3]; + float flLateReverbGain; + float flLateReverbDelay; + float flLateReverbPan[3]; + float flEchoTime; + float flEchoDepth; + float flModulationTime; + float flModulationDepth; + float flAirAbsorptionGainHF; + float flHFReference; + float flLFReference; + float flRoomRolloffFactor; + int iDecayHFLimit; +} EFXEAXREVERBPROPERTIES, *LPEFXEAXREVERBPROPERTIES; +#endif + +/* Default Presets */ + +#define EFX_REVERB_PRESET_GENERIC \ + { 1.0000f, 1.0000f, 0.3162f, 0.8913f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PADDEDCELL \ + { 0.1715f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.1700f, 0.1000f, 1.0000f, 0.2500f, 0.0010f, { 0.0000f, 0.0000f, 0.0000f }, 1.2691f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ROOM \ + { 0.4287f, 1.0000f, 0.3162f, 0.5929f, 1.0000f, 0.4000f, 0.8300f, 1.0000f, 0.1503f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.0629f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_BATHROOM \ + { 0.1715f, 1.0000f, 0.3162f, 0.2512f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.6531f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 3.2734f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_LIVINGROOM \ + { 0.9766f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.5000f, 0.1000f, 1.0000f, 0.2051f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2805f, 0.0040f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_STONEROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 2.3100f, 0.6400f, 1.0000f, 0.4411f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1003f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_AUDITORIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.5781f, 1.0000f, 4.3200f, 0.5900f, 1.0000f, 0.4032f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7170f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CONCERTHALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.5623f, 1.0000f, 3.9200f, 0.7000f, 1.0000f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.9977f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CAVE \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 2.9100f, 1.3000f, 1.0000f, 0.5000f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.7063f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_ARENA \ + { 1.0000f, 1.0000f, 0.3162f, 0.4477f, 1.0000f, 7.2400f, 0.3300f, 1.0000f, 0.2612f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.0186f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_HANGAR \ + { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 10.0500f, 0.2300f, 1.0000f, 0.5000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2560f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CARPETEDHALLWAY \ + { 0.4287f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 0.3000f, 0.1000f, 1.0000f, 0.1215f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.1531f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_HALLWAY \ + { 0.3645f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 1.4900f, 0.5900f, 1.0000f, 0.2458f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.6615f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_STONECORRIDOR \ + { 1.0000f, 1.0000f, 0.3162f, 0.7612f, 1.0000f, 2.7000f, 0.7900f, 1.0000f, 0.2472f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 1.5758f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ALLEY \ + { 1.0000f, 0.3000f, 0.3162f, 0.7328f, 1.0000f, 1.4900f, 0.8600f, 1.0000f, 0.2500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.9954f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.9500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FOREST \ + { 1.0000f, 0.3000f, 0.3162f, 0.0224f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.0525f, 0.1620f, { 0.0000f, 0.0000f, 0.0000f }, 0.7682f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY \ + { 1.0000f, 0.5000f, 0.3162f, 0.3981f, 1.0000f, 1.4900f, 0.6700f, 1.0000f, 0.0730f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1427f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_MOUNTAINS \ + { 1.0000f, 0.2700f, 0.3162f, 0.0562f, 1.0000f, 1.4900f, 0.2100f, 1.0000f, 0.0407f, 0.3000f, { 0.0000f, 0.0000f, 0.0000f }, 0.1919f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_QUARRY \ + { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0000f, 0.0610f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.7000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PLAIN \ + { 1.0000f, 0.2100f, 0.3162f, 0.1000f, 1.0000f, 1.4900f, 0.5000f, 1.0000f, 0.0585f, 0.1790f, { 0.0000f, 0.0000f, 0.0000f }, 0.1089f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PARKINGLOT \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 1.6500f, 1.5000f, 1.0000f, 0.2082f, 0.0080f, { 0.0000f, 0.0000f, 0.0000f }, 0.2652f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SEWERPIPE \ + { 0.3071f, 0.8000f, 0.3162f, 0.3162f, 1.0000f, 2.8100f, 0.1400f, 1.0000f, 1.6387f, 0.0140f, { 0.0000f, 0.0000f, 0.0000f }, 3.2471f, 0.0210f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_UNDERWATER \ + { 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRUGGED \ + { 0.4287f, 0.5000f, 0.3162f, 1.0000f, 1.0000f, 8.3900f, 1.3900f, 1.0000f, 0.8760f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 3.1081f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DIZZY \ + { 0.3645f, 0.6000f, 0.3162f, 0.6310f, 1.0000f, 17.2300f, 0.5600f, 1.0000f, 0.1392f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4937f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.8100f, 0.3100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PSYCHOTIC \ + { 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Castle Presets */ + +#define EFX_REVERB_PRESET_CASTLE_SMALLROOM \ + { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 1.2200f, 0.8300f, 0.3100f, 0.8913f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_SHORTPASSAGE \ + { 1.0000f, 0.8900f, 0.3162f, 0.3162f, 0.1000f, 2.3200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_MEDIUMROOM \ + { 1.0000f, 0.9300f, 0.3162f, 0.2818f, 0.1000f, 2.0400f, 0.8300f, 0.4600f, 0.6310f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1550f, 0.0300f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_LARGEROOM \ + { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.1259f, 2.5300f, 0.8300f, 0.5000f, 0.4467f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1850f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_LONGPASSAGE \ + { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 3.4200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_HALL \ + { 1.0000f, 0.8100f, 0.3162f, 0.2818f, 0.1778f, 3.1400f, 0.7900f, 0.6200f, 0.1778f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_CUPBOARD \ + { 1.0000f, 0.8900f, 0.3162f, 0.2818f, 0.1000f, 0.6700f, 0.8700f, 0.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 3.5481f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_COURTYARD \ + { 1.0000f, 0.4200f, 0.3162f, 0.4467f, 0.1995f, 2.1300f, 0.6100f, 0.2300f, 0.2239f, 0.1600f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3700f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CASTLE_ALCOVE \ + { 1.0000f, 0.8900f, 0.3162f, 0.5012f, 0.1000f, 1.6400f, 0.8700f, 0.3100f, 1.0000f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +/* Factory Presets */ + +#define EFX_REVERB_PRESET_FACTORY_SMALLROOM \ + { 0.3645f, 0.8200f, 0.3162f, 0.7943f, 0.5012f, 1.7200f, 0.6500f, 1.3100f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.1190f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_SHORTPASSAGE \ + { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 2.5300f, 0.6500f, 1.3100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_MEDIUMROOM \ + { 0.4287f, 0.8200f, 0.2512f, 0.7943f, 0.5012f, 2.7600f, 0.6500f, 1.3100f, 0.2818f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1740f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_LARGEROOM \ + { 0.4287f, 0.7500f, 0.2512f, 0.7079f, 0.6310f, 4.2400f, 0.5100f, 1.3100f, 0.1778f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2310f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_LONGPASSAGE \ + { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 4.0600f, 0.6500f, 1.3100f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_HALL \ + { 0.4287f, 0.7500f, 0.3162f, 0.7079f, 0.6310f, 7.4300f, 0.5100f, 1.3100f, 0.0631f, 0.0730f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_CUPBOARD \ + { 0.3071f, 0.6300f, 0.2512f, 0.7943f, 0.5012f, 0.4900f, 0.6500f, 1.3100f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.1070f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_COURTYARD \ + { 0.3071f, 0.5700f, 0.3162f, 0.3162f, 0.6310f, 2.3200f, 0.2900f, 0.5600f, 0.2239f, 0.1400f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2900f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_ALCOVE \ + { 0.3645f, 0.5900f, 0.2512f, 0.7943f, 0.5012f, 3.1400f, 0.6500f, 1.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1140f, 0.1000f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +/* Ice Palace Presets */ + +#define EFX_REVERB_PRESET_ICEPALACE_SMALLROOM \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 1.5100f, 1.5300f, 0.2700f, 0.8913f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1640f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_SHORTPASSAGE \ + { 1.0000f, 0.7500f, 0.3162f, 0.5623f, 0.2818f, 1.7900f, 1.4600f, 0.2800f, 0.5012f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_MEDIUMROOM \ + { 1.0000f, 0.8700f, 0.3162f, 0.5623f, 0.4467f, 2.2200f, 1.5300f, 0.3200f, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_LARGEROOM \ + { 1.0000f, 0.8100f, 0.3162f, 0.5623f, 0.4467f, 3.1400f, 1.5300f, 0.3200f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_LONGPASSAGE \ + { 1.0000f, 0.7700f, 0.3162f, 0.5623f, 0.3981f, 3.0100f, 1.4600f, 0.2800f, 0.7943f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.0400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_HALL \ + { 1.0000f, 0.7600f, 0.3162f, 0.4467f, 0.5623f, 5.4900f, 1.5300f, 0.3800f, 0.1122f, 0.0540f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0520f, { 0.0000f, 0.0000f, 0.0000f }, 0.2260f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_CUPBOARD \ + { 1.0000f, 0.8300f, 0.3162f, 0.5012f, 0.2239f, 0.7600f, 1.5300f, 0.2600f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1430f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_COURTYARD \ + { 1.0000f, 0.5900f, 0.3162f, 0.2818f, 0.3162f, 2.0400f, 1.2000f, 0.3800f, 0.3162f, 0.1730f, { 0.0000f, 0.0000f, 0.0000f }, 0.3162f, 0.0430f, { 0.0000f, 0.0000f, 0.0000f }, 0.2350f, 0.4800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_ALCOVE \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 2.7600f, 1.4600f, 0.2800f, 1.1220f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1610f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +/* Space Station Presets */ + +#define EFX_REVERB_PRESET_SPACESTATION_SMALLROOM \ + { 0.2109f, 0.7000f, 0.3162f, 0.7079f, 0.8913f, 1.7200f, 0.8200f, 0.5500f, 0.7943f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 0.1880f, 0.2600f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_SHORTPASSAGE \ + { 0.2109f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 3.5700f, 0.5000f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1720f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_MEDIUMROOM \ + { 0.2109f, 0.7500f, 0.3162f, 0.6310f, 0.8913f, 3.0100f, 0.5000f, 0.5500f, 0.3981f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2090f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_LARGEROOM \ + { 0.3645f, 0.8100f, 0.3162f, 0.6310f, 0.8913f, 3.8900f, 0.3800f, 0.6100f, 0.3162f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2330f, 0.2800f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_LONGPASSAGE \ + { 0.4287f, 0.8200f, 0.3162f, 0.6310f, 0.8913f, 4.6200f, 0.6200f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_HALL \ + { 0.4287f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 7.1100f, 0.3800f, 0.6100f, 0.1778f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2500f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_CUPBOARD \ + { 0.1715f, 0.5600f, 0.3162f, 0.7079f, 0.8913f, 0.7900f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1810f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_ALCOVE \ + { 0.2109f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.1600f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1920f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +/* Wooden Galleon Presets */ + +#define EFX_REVERB_PRESET_WOODEN_SMALLROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.1122f, 0.3162f, 0.7900f, 0.3200f, 0.8700f, 1.0000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_SHORTPASSAGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.7500f, 0.5000f, 0.8700f, 0.8913f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_MEDIUMROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.2818f, 1.4700f, 0.4200f, 0.8200f, 0.8913f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_LARGEROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.2818f, 2.6500f, 0.3300f, 0.8200f, 0.8913f, 0.0660f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_LONGPASSAGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.3162f, 1.9900f, 0.4000f, 0.7900f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4467f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_HALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.0794f, 0.2818f, 3.4500f, 0.3000f, 0.8200f, 0.8913f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_CUPBOARD \ + { 1.0000f, 1.0000f, 0.3162f, 0.1413f, 0.3162f, 0.5600f, 0.4600f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_COURTYARD \ + { 1.0000f, 0.6500f, 0.3162f, 0.0794f, 0.3162f, 1.7900f, 0.3500f, 0.7900f, 0.5623f, 0.1230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_ALCOVE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.2200f, 0.6200f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +/* Sports Presets */ + +#define EFX_REVERB_PRESET_SPORT_EMPTYSTADIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.4467f, 0.7943f, 6.2600f, 0.5100f, 1.1000f, 0.0631f, 0.1830f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_SQUASHCOURT \ + { 1.0000f, 0.7500f, 0.3162f, 0.3162f, 0.7943f, 2.2200f, 0.9100f, 1.1600f, 0.4467f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1260f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_SMALLSWIMMINGPOOL \ + { 1.0000f, 0.7000f, 0.3162f, 0.7943f, 0.8913f, 2.7600f, 1.2500f, 1.1400f, 0.6310f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SPORT_LARGESWIMMINGPOOL \ + { 1.0000f, 0.8200f, 0.3162f, 0.7943f, 1.0000f, 5.4900f, 1.3100f, 1.1400f, 0.4467f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2220f, 0.5500f, 1.1590f, 0.2100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SPORT_GYMNASIUM \ + { 1.0000f, 0.8100f, 0.3162f, 0.4467f, 0.8913f, 3.1400f, 1.0600f, 1.3500f, 0.3981f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0450f, { 0.0000f, 0.0000f, 0.0000f }, 0.1460f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_FULLSTADIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.0708f, 0.7943f, 5.2500f, 0.1700f, 0.8000f, 0.1000f, 0.1880f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_STADIUMTANNOY \ + { 1.0000f, 0.7800f, 0.3162f, 0.5623f, 0.5012f, 2.5300f, 0.8800f, 0.6800f, 0.2818f, 0.2300f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +/* Prefab Presets */ + +#define EFX_REVERB_PRESET_PREFAB_WORKSHOP \ + { 0.4287f, 1.0000f, 0.3162f, 0.1413f, 0.3981f, 0.7600f, 1.0000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PREFAB_SCHOOLROOM \ + { 0.4022f, 0.6900f, 0.3162f, 0.6310f, 0.5012f, 0.9800f, 0.4500f, 0.1800f, 1.4125f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PREFAB_PRACTISEROOM \ + { 0.4022f, 0.8700f, 0.3162f, 0.3981f, 0.5012f, 1.1200f, 0.5600f, 0.1800f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PREFAB_OUTHOUSE \ + { 1.0000f, 0.8200f, 0.3162f, 0.1122f, 0.1585f, 1.3800f, 0.3800f, 0.3500f, 0.8913f, 0.0240f, { 0.0000f, 0.0000f, -0.0000f }, 0.6310f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.1210f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PREFAB_CARAVAN \ + { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.1259f, 0.4300f, 1.5000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Dome and Pipe Presets */ + +#define EFX_REVERB_PRESET_DOME_TOMB \ + { 1.0000f, 0.7900f, 0.3162f, 0.3548f, 0.2239f, 4.1800f, 0.2100f, 0.1000f, 0.3868f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 1.6788f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PIPE_SMALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 5.0400f, 0.1000f, 0.1000f, 0.5012f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 2.5119f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DOME_SAINTPAULS \ + { 1.0000f, 0.8700f, 0.3162f, 0.3548f, 0.2239f, 10.4800f, 0.1900f, 0.1000f, 0.1778f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0420f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PIPE_LONGTHIN \ + { 0.2560f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 9.2100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PIPE_LARGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 8.4500f, 0.1000f, 0.1000f, 0.3981f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PIPE_RESONANT \ + { 0.1373f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 6.8100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +/* Outdoors Presets */ + +#define EFX_REVERB_PRESET_OUTDOORS_BACKYARD \ + { 1.0000f, 0.4500f, 0.3162f, 0.2512f, 0.5012f, 1.1200f, 0.3400f, 0.4600f, 0.4467f, 0.0690f, { 0.0000f, 0.0000f, -0.0000f }, 0.7079f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_ROLLINGPLAINS \ + { 1.0000f, 0.0000f, 0.3162f, 0.0112f, 0.6310f, 2.1300f, 0.2100f, 0.4600f, 0.1778f, 0.3000f, { 0.0000f, 0.0000f, -0.0000f }, 0.4467f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_DEEPCANYON \ + { 1.0000f, 0.7400f, 0.3162f, 0.1778f, 0.6310f, 3.8900f, 0.2100f, 0.4600f, 0.3162f, 0.2230f, { 0.0000f, 0.0000f, -0.0000f }, 0.3548f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_CREEK \ + { 1.0000f, 0.3500f, 0.3162f, 0.1778f, 0.5012f, 2.1300f, 0.2100f, 0.4600f, 0.3981f, 0.1150f, { 0.0000f, 0.0000f, -0.0000f }, 0.1995f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_VALLEY \ + { 1.0000f, 0.2800f, 0.3162f, 0.0282f, 0.1585f, 2.8800f, 0.2600f, 0.3500f, 0.1413f, 0.2630f, { 0.0000f, 0.0000f, -0.0000f }, 0.3981f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +/* Mood Presets */ + +#define EFX_REVERB_PRESET_MOOD_HEAVEN \ + { 1.0000f, 0.9400f, 0.3162f, 0.7943f, 0.4467f, 5.0400f, 1.1200f, 0.5600f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0800f, 2.7420f, 0.0500f, 0.9977f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_MOOD_HELL \ + { 1.0000f, 0.5700f, 0.3162f, 0.3548f, 0.4467f, 3.5700f, 0.4900f, 2.0000f, 0.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1100f, 0.0400f, 2.1090f, 0.5200f, 0.9943f, 5000.0000f, 139.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_MOOD_MEMORY \ + { 1.0000f, 0.8500f, 0.3162f, 0.6310f, 0.3548f, 4.0600f, 0.8200f, 0.5600f, 0.0398f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.4740f, 0.4500f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Driving Presets */ + +#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \ + { 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \ + { 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_RACER \ + { 0.0832f, 0.8000f, 0.3162f, 1.0000f, 0.7943f, 0.1700f, 2.0000f, 0.4100f, 1.7783f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_SPORTS \ + { 0.0832f, 0.8000f, 0.3162f, 0.6310f, 1.0000f, 0.1700f, 0.7500f, 0.4100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_LUXURY \ + { 0.2560f, 1.0000f, 0.3162f, 0.1000f, 0.5012f, 0.1300f, 0.4100f, 0.4600f, 0.7943f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_FULLGRANDSTAND \ + { 1.0000f, 1.0000f, 0.3162f, 0.2818f, 0.6310f, 3.0100f, 1.3700f, 1.2800f, 0.3548f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.1778f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_EMPTYGRANDSTAND \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 0.7943f, 4.6200f, 1.7500f, 1.4000f, 0.2082f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_TUNNEL \ + { 1.0000f, 0.8100f, 0.3162f, 0.3981f, 0.8913f, 3.4200f, 0.9400f, 1.3100f, 0.7079f, 0.0510f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.0500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 155.3000f, 0.0000f, 0x1 } + +/* City Presets */ + +#define EFX_REVERB_PRESET_CITY_STREETS \ + { 1.0000f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.7900f, 1.1200f, 0.9100f, 0.2818f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 0.1995f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_SUBWAY \ + { 1.0000f, 0.7400f, 0.3162f, 0.7079f, 0.8913f, 3.0100f, 1.2300f, 0.9100f, 0.7079f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_MUSEUM \ + { 1.0000f, 0.8200f, 0.3162f, 0.1778f, 0.1778f, 3.2800f, 1.4000f, 0.5700f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CITY_LIBRARY \ + { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.0891f, 2.7600f, 0.8900f, 0.4100f, 0.3548f, 0.0290f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CITY_UNDERPASS \ + { 1.0000f, 0.8200f, 0.3162f, 0.4467f, 0.8913f, 3.5700f, 1.1200f, 0.9100f, 0.3981f, 0.0590f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1400f, 0.2500f, 0.0000f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_ABANDONED \ + { 1.0000f, 0.6900f, 0.3162f, 0.7943f, 0.8913f, 3.2800f, 1.1700f, 0.9100f, 0.4467f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9966f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +/* Misc. Presets */ + +#define EFX_REVERB_PRESET_DUSTYROOM \ + { 0.3645f, 0.5600f, 0.3162f, 0.7943f, 0.7079f, 1.7900f, 0.3800f, 0.2100f, 0.5012f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0060f, { 0.0000f, 0.0000f, 0.0000f }, 0.2020f, 0.0500f, 0.2500f, 0.0000f, 0.9886f, 13046.0000f, 163.3000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CHAPEL \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 1.0000f, 4.6200f, 0.6400f, 1.2300f, 0.4467f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.1100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SMALLWATERROOM \ + { 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#endif /* EFX_PRESETS_H */ diff --git a/src/external/openal_soft/include/AL/efx.h b/src/external/openal_soft/include/AL/efx.h new file mode 100644 index 00000000..57766983 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx.h @@ -0,0 +1,761 @@ +#ifndef AL_EFX_H +#define AL_EFX_H + + +#include "alc.h" +#include "al.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ALC_EXT_EFX_NAME "ALC_EXT_EFX" + +#define ALC_EFX_MAJOR_VERSION 0x20001 +#define ALC_EFX_MINOR_VERSION 0x20002 +#define ALC_MAX_AUXILIARY_SENDS 0x20003 + + +/* Listener properties. */ +#define AL_METERS_PER_UNIT 0x20004 + +/* Source properties. */ +#define AL_DIRECT_FILTER 0x20005 +#define AL_AUXILIARY_SEND_FILTER 0x20006 +#define AL_AIR_ABSORPTION_FACTOR 0x20007 +#define AL_ROOM_ROLLOFF_FACTOR 0x20008 +#define AL_CONE_OUTER_GAINHF 0x20009 +#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A +#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B +#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C + + +/* Effect properties. */ + +/* Reverb effect parameters */ +#define AL_REVERB_DENSITY 0x0001 +#define AL_REVERB_DIFFUSION 0x0002 +#define AL_REVERB_GAIN 0x0003 +#define AL_REVERB_GAINHF 0x0004 +#define AL_REVERB_DECAY_TIME 0x0005 +#define AL_REVERB_DECAY_HFRATIO 0x0006 +#define AL_REVERB_REFLECTIONS_GAIN 0x0007 +#define AL_REVERB_REFLECTIONS_DELAY 0x0008 +#define AL_REVERB_LATE_REVERB_GAIN 0x0009 +#define AL_REVERB_LATE_REVERB_DELAY 0x000A +#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B +#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C +#define AL_REVERB_DECAY_HFLIMIT 0x000D + +/* EAX Reverb effect parameters */ +#define AL_EAXREVERB_DENSITY 0x0001 +#define AL_EAXREVERB_DIFFUSION 0x0002 +#define AL_EAXREVERB_GAIN 0x0003 +#define AL_EAXREVERB_GAINHF 0x0004 +#define AL_EAXREVERB_GAINLF 0x0005 +#define AL_EAXREVERB_DECAY_TIME 0x0006 +#define AL_EAXREVERB_DECAY_HFRATIO 0x0007 +#define AL_EAXREVERB_DECAY_LFRATIO 0x0008 +#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009 +#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A +#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B +#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C +#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D +#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E +#define AL_EAXREVERB_ECHO_TIME 0x000F +#define AL_EAXREVERB_ECHO_DEPTH 0x0010 +#define AL_EAXREVERB_MODULATION_TIME 0x0011 +#define AL_EAXREVERB_MODULATION_DEPTH 0x0012 +#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013 +#define AL_EAXREVERB_HFREFERENCE 0x0014 +#define AL_EAXREVERB_LFREFERENCE 0x0015 +#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016 +#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017 + +/* Chorus effect parameters */ +#define AL_CHORUS_WAVEFORM 0x0001 +#define AL_CHORUS_PHASE 0x0002 +#define AL_CHORUS_RATE 0x0003 +#define AL_CHORUS_DEPTH 0x0004 +#define AL_CHORUS_FEEDBACK 0x0005 +#define AL_CHORUS_DELAY 0x0006 + +/* Distortion effect parameters */ +#define AL_DISTORTION_EDGE 0x0001 +#define AL_DISTORTION_GAIN 0x0002 +#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003 +#define AL_DISTORTION_EQCENTER 0x0004 +#define AL_DISTORTION_EQBANDWIDTH 0x0005 + +/* Echo effect parameters */ +#define AL_ECHO_DELAY 0x0001 +#define AL_ECHO_LRDELAY 0x0002 +#define AL_ECHO_DAMPING 0x0003 +#define AL_ECHO_FEEDBACK 0x0004 +#define AL_ECHO_SPREAD 0x0005 + +/* Flanger effect parameters */ +#define AL_FLANGER_WAVEFORM 0x0001 +#define AL_FLANGER_PHASE 0x0002 +#define AL_FLANGER_RATE 0x0003 +#define AL_FLANGER_DEPTH 0x0004 +#define AL_FLANGER_FEEDBACK 0x0005 +#define AL_FLANGER_DELAY 0x0006 + +/* Frequency shifter effect parameters */ +#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001 +#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002 +#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003 + +/* Vocal morpher effect parameters */ +#define AL_VOCAL_MORPHER_PHONEMEA 0x0001 +#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002 +#define AL_VOCAL_MORPHER_PHONEMEB 0x0003 +#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004 +#define AL_VOCAL_MORPHER_WAVEFORM 0x0005 +#define AL_VOCAL_MORPHER_RATE 0x0006 + +/* Pitchshifter effect parameters */ +#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001 +#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002 + +/* Ringmodulator effect parameters */ +#define AL_RING_MODULATOR_FREQUENCY 0x0001 +#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002 +#define AL_RING_MODULATOR_WAVEFORM 0x0003 + +/* Autowah effect parameters */ +#define AL_AUTOWAH_ATTACK_TIME 0x0001 +#define AL_AUTOWAH_RELEASE_TIME 0x0002 +#define AL_AUTOWAH_RESONANCE 0x0003 +#define AL_AUTOWAH_PEAK_GAIN 0x0004 + +/* Compressor effect parameters */ +#define AL_COMPRESSOR_ONOFF 0x0001 + +/* Equalizer effect parameters */ +#define AL_EQUALIZER_LOW_GAIN 0x0001 +#define AL_EQUALIZER_LOW_CUTOFF 0x0002 +#define AL_EQUALIZER_MID1_GAIN 0x0003 +#define AL_EQUALIZER_MID1_CENTER 0x0004 +#define AL_EQUALIZER_MID1_WIDTH 0x0005 +#define AL_EQUALIZER_MID2_GAIN 0x0006 +#define AL_EQUALIZER_MID2_CENTER 0x0007 +#define AL_EQUALIZER_MID2_WIDTH 0x0008 +#define AL_EQUALIZER_HIGH_GAIN 0x0009 +#define AL_EQUALIZER_HIGH_CUTOFF 0x000A + +/* Effect type */ +#define AL_EFFECT_FIRST_PARAMETER 0x0000 +#define AL_EFFECT_LAST_PARAMETER 0x8000 +#define AL_EFFECT_TYPE 0x8001 + +/* Effect types, used with the AL_EFFECT_TYPE property */ +#define AL_EFFECT_NULL 0x0000 +#define AL_EFFECT_REVERB 0x0001 +#define AL_EFFECT_CHORUS 0x0002 +#define AL_EFFECT_DISTORTION 0x0003 +#define AL_EFFECT_ECHO 0x0004 +#define AL_EFFECT_FLANGER 0x0005 +#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006 +#define AL_EFFECT_VOCAL_MORPHER 0x0007 +#define AL_EFFECT_PITCH_SHIFTER 0x0008 +#define AL_EFFECT_RING_MODULATOR 0x0009 +#define AL_EFFECT_AUTOWAH 0x000A +#define AL_EFFECT_COMPRESSOR 0x000B +#define AL_EFFECT_EQUALIZER 0x000C +#define AL_EFFECT_EAXREVERB 0x8000 + +/* Auxiliary Effect Slot properties. */ +#define AL_EFFECTSLOT_EFFECT 0x0001 +#define AL_EFFECTSLOT_GAIN 0x0002 +#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003 + +/* NULL Auxiliary Slot ID to disable a source send. */ +#define AL_EFFECTSLOT_NULL 0x0000 + + +/* Filter properties. */ + +/* Lowpass filter parameters */ +#define AL_LOWPASS_GAIN 0x0001 +#define AL_LOWPASS_GAINHF 0x0002 + +/* Highpass filter parameters */ +#define AL_HIGHPASS_GAIN 0x0001 +#define AL_HIGHPASS_GAINLF 0x0002 + +/* Bandpass filter parameters */ +#define AL_BANDPASS_GAIN 0x0001 +#define AL_BANDPASS_GAINLF 0x0002 +#define AL_BANDPASS_GAINHF 0x0003 + +/* Filter type */ +#define AL_FILTER_FIRST_PARAMETER 0x0000 +#define AL_FILTER_LAST_PARAMETER 0x8000 +#define AL_FILTER_TYPE 0x8001 + +/* Filter types, used with the AL_FILTER_TYPE property */ +#define AL_FILTER_NULL 0x0000 +#define AL_FILTER_LOWPASS 0x0001 +#define AL_FILTER_HIGHPASS 0x0002 +#define AL_FILTER_BANDPASS 0x0003 + + +/* Effect object function types. */ +typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint); +typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*); + +/* Filter object function types. */ +typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint); +typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*); + +/* Auxiliary Effect Slot object function types. */ +typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); + +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); +AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects); +AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect); +AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); +AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters); +AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter); +AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); +AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots); +AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); +#endif + +/* Filter ranges and defaults. */ + +/* Lowpass filter */ +#define AL_LOWPASS_MIN_GAIN (0.0f) +#define AL_LOWPASS_MAX_GAIN (1.0f) +#define AL_LOWPASS_DEFAULT_GAIN (1.0f) + +#define AL_LOWPASS_MIN_GAINHF (0.0f) +#define AL_LOWPASS_MAX_GAINHF (1.0f) +#define AL_LOWPASS_DEFAULT_GAINHF (1.0f) + +/* Highpass filter */ +#define AL_HIGHPASS_MIN_GAIN (0.0f) +#define AL_HIGHPASS_MAX_GAIN (1.0f) +#define AL_HIGHPASS_DEFAULT_GAIN (1.0f) + +#define AL_HIGHPASS_MIN_GAINLF (0.0f) +#define AL_HIGHPASS_MAX_GAINLF (1.0f) +#define AL_HIGHPASS_DEFAULT_GAINLF (1.0f) + +/* Bandpass filter */ +#define AL_BANDPASS_MIN_GAIN (0.0f) +#define AL_BANDPASS_MAX_GAIN (1.0f) +#define AL_BANDPASS_DEFAULT_GAIN (1.0f) + +#define AL_BANDPASS_MIN_GAINHF (0.0f) +#define AL_BANDPASS_MAX_GAINHF (1.0f) +#define AL_BANDPASS_DEFAULT_GAINHF (1.0f) + +#define AL_BANDPASS_MIN_GAINLF (0.0f) +#define AL_BANDPASS_MAX_GAINLF (1.0f) +#define AL_BANDPASS_DEFAULT_GAINLF (1.0f) + + +/* Effect parameter ranges and defaults. */ + +/* Standard reverb effect */ +#define AL_REVERB_MIN_DENSITY (0.0f) +#define AL_REVERB_MAX_DENSITY (1.0f) +#define AL_REVERB_DEFAULT_DENSITY (1.0f) + +#define AL_REVERB_MIN_DIFFUSION (0.0f) +#define AL_REVERB_MAX_DIFFUSION (1.0f) +#define AL_REVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_REVERB_MIN_GAIN (0.0f) +#define AL_REVERB_MAX_GAIN (1.0f) +#define AL_REVERB_DEFAULT_GAIN (0.32f) + +#define AL_REVERB_MIN_GAINHF (0.0f) +#define AL_REVERB_MAX_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_GAINHF (0.89f) + +#define AL_REVERB_MIN_DECAY_TIME (0.1f) +#define AL_REVERB_MAX_DECAY_TIME (20.0f) +#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* EAX reverb effect */ +#define AL_EAXREVERB_MIN_DENSITY (0.0f) +#define AL_EAXREVERB_MAX_DENSITY (1.0f) +#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f) + +#define AL_EAXREVERB_MIN_DIFFUSION (0.0f) +#define AL_EAXREVERB_MAX_DIFFUSION (1.0f) +#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_EAXREVERB_MIN_GAIN (0.0f) +#define AL_EAXREVERB_MAX_GAIN (1.0f) +#define AL_EAXREVERB_DEFAULT_GAIN (0.32f) + +#define AL_EAXREVERB_MIN_GAINHF (0.0f) +#define AL_EAXREVERB_MAX_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f) + +#define AL_EAXREVERB_MIN_GAINLF (0.0f) +#define AL_EAXREVERB_MAX_GAINLF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f) + +#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f) +#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f) +#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f) +#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f) + +#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f) +#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f) + +#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f) +#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f) +#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f) + +#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f) +#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f) +#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f) + +#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* Chorus effect */ +#define AL_CHORUS_WAVEFORM_SINUSOID (0) +#define AL_CHORUS_WAVEFORM_TRIANGLE (1) + +#define AL_CHORUS_MIN_WAVEFORM (0) +#define AL_CHORUS_MAX_WAVEFORM (1) +#define AL_CHORUS_DEFAULT_WAVEFORM (1) + +#define AL_CHORUS_MIN_PHASE (-180) +#define AL_CHORUS_MAX_PHASE (180) +#define AL_CHORUS_DEFAULT_PHASE (90) + +#define AL_CHORUS_MIN_RATE (0.0f) +#define AL_CHORUS_MAX_RATE (10.0f) +#define AL_CHORUS_DEFAULT_RATE (1.1f) + +#define AL_CHORUS_MIN_DEPTH (0.0f) +#define AL_CHORUS_MAX_DEPTH (1.0f) +#define AL_CHORUS_DEFAULT_DEPTH (0.1f) + +#define AL_CHORUS_MIN_FEEDBACK (-1.0f) +#define AL_CHORUS_MAX_FEEDBACK (1.0f) +#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f) + +#define AL_CHORUS_MIN_DELAY (0.0f) +#define AL_CHORUS_MAX_DELAY (0.016f) +#define AL_CHORUS_DEFAULT_DELAY (0.016f) + +/* Distortion effect */ +#define AL_DISTORTION_MIN_EDGE (0.0f) +#define AL_DISTORTION_MAX_EDGE (1.0f) +#define AL_DISTORTION_DEFAULT_EDGE (0.2f) + +#define AL_DISTORTION_MIN_GAIN (0.01f) +#define AL_DISTORTION_MAX_GAIN (1.0f) +#define AL_DISTORTION_DEFAULT_GAIN (0.05f) + +#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f) +#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f) +#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f) + +#define AL_DISTORTION_MIN_EQCENTER (80.0f) +#define AL_DISTORTION_MAX_EQCENTER (24000.0f) +#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f) + +#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f) +#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f) +#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f) + +/* Echo effect */ +#define AL_ECHO_MIN_DELAY (0.0f) +#define AL_ECHO_MAX_DELAY (0.207f) +#define AL_ECHO_DEFAULT_DELAY (0.1f) + +#define AL_ECHO_MIN_LRDELAY (0.0f) +#define AL_ECHO_MAX_LRDELAY (0.404f) +#define AL_ECHO_DEFAULT_LRDELAY (0.1f) + +#define AL_ECHO_MIN_DAMPING (0.0f) +#define AL_ECHO_MAX_DAMPING (0.99f) +#define AL_ECHO_DEFAULT_DAMPING (0.5f) + +#define AL_ECHO_MIN_FEEDBACK (0.0f) +#define AL_ECHO_MAX_FEEDBACK (1.0f) +#define AL_ECHO_DEFAULT_FEEDBACK (0.5f) + +#define AL_ECHO_MIN_SPREAD (-1.0f) +#define AL_ECHO_MAX_SPREAD (1.0f) +#define AL_ECHO_DEFAULT_SPREAD (-1.0f) + +/* Flanger effect */ +#define AL_FLANGER_WAVEFORM_SINUSOID (0) +#define AL_FLANGER_WAVEFORM_TRIANGLE (1) + +#define AL_FLANGER_MIN_WAVEFORM (0) +#define AL_FLANGER_MAX_WAVEFORM (1) +#define AL_FLANGER_DEFAULT_WAVEFORM (1) + +#define AL_FLANGER_MIN_PHASE (-180) +#define AL_FLANGER_MAX_PHASE (180) +#define AL_FLANGER_DEFAULT_PHASE (0) + +#define AL_FLANGER_MIN_RATE (0.0f) +#define AL_FLANGER_MAX_RATE (10.0f) +#define AL_FLANGER_DEFAULT_RATE (0.27f) + +#define AL_FLANGER_MIN_DEPTH (0.0f) +#define AL_FLANGER_MAX_DEPTH (1.0f) +#define AL_FLANGER_DEFAULT_DEPTH (1.0f) + +#define AL_FLANGER_MIN_FEEDBACK (-1.0f) +#define AL_FLANGER_MAX_FEEDBACK (1.0f) +#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f) + +#define AL_FLANGER_MIN_DELAY (0.0f) +#define AL_FLANGER_MAX_DELAY (0.004f) +#define AL_FLANGER_DEFAULT_DELAY (0.002f) + +/* Frequency shifter effect */ +#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f) +#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f) +#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f) + +#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0) + +#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0) +#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1) +#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2) + +#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0) + +/* Vocal morpher effect */ +#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_PHONEME_A (0) +#define AL_VOCAL_MORPHER_PHONEME_E (1) +#define AL_VOCAL_MORPHER_PHONEME_I (2) +#define AL_VOCAL_MORPHER_PHONEME_O (3) +#define AL_VOCAL_MORPHER_PHONEME_U (4) +#define AL_VOCAL_MORPHER_PHONEME_AA (5) +#define AL_VOCAL_MORPHER_PHONEME_AE (6) +#define AL_VOCAL_MORPHER_PHONEME_AH (7) +#define AL_VOCAL_MORPHER_PHONEME_AO (8) +#define AL_VOCAL_MORPHER_PHONEME_EH (9) +#define AL_VOCAL_MORPHER_PHONEME_ER (10) +#define AL_VOCAL_MORPHER_PHONEME_IH (11) +#define AL_VOCAL_MORPHER_PHONEME_IY (12) +#define AL_VOCAL_MORPHER_PHONEME_UH (13) +#define AL_VOCAL_MORPHER_PHONEME_UW (14) +#define AL_VOCAL_MORPHER_PHONEME_B (15) +#define AL_VOCAL_MORPHER_PHONEME_D (16) +#define AL_VOCAL_MORPHER_PHONEME_F (17) +#define AL_VOCAL_MORPHER_PHONEME_G (18) +#define AL_VOCAL_MORPHER_PHONEME_J (19) +#define AL_VOCAL_MORPHER_PHONEME_K (20) +#define AL_VOCAL_MORPHER_PHONEME_L (21) +#define AL_VOCAL_MORPHER_PHONEME_M (22) +#define AL_VOCAL_MORPHER_PHONEME_N (23) +#define AL_VOCAL_MORPHER_PHONEME_P (24) +#define AL_VOCAL_MORPHER_PHONEME_R (25) +#define AL_VOCAL_MORPHER_PHONEME_S (26) +#define AL_VOCAL_MORPHER_PHONEME_T (27) +#define AL_VOCAL_MORPHER_PHONEME_V (28) +#define AL_VOCAL_MORPHER_PHONEME_Z (29) + +#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0) +#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1) +#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2) + +#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0) +#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2) +#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0) + +#define AL_VOCAL_MORPHER_MIN_RATE (0.0f) +#define AL_VOCAL_MORPHER_MAX_RATE (10.0f) +#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f) + +/* Pitch shifter effect */ +#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12) +#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12) +#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12) + +#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50) +#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50) +#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0) + +/* Ring modulator effect */ +#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f) +#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f) +#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f) + +#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f) +#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f) +#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f) + +#define AL_RING_MODULATOR_SINUSOID (0) +#define AL_RING_MODULATOR_SAWTOOTH (1) +#define AL_RING_MODULATOR_SQUARE (2) + +#define AL_RING_MODULATOR_MIN_WAVEFORM (0) +#define AL_RING_MODULATOR_MAX_WAVEFORM (2) +#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0) + +/* Autowah effect */ +#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f) +#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f) +#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RESONANCE (2.0f) +#define AL_AUTOWAH_MAX_RESONANCE (1000.0f) +#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f) + +#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f) +#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f) +#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f) + +/* Compressor effect */ +#define AL_COMPRESSOR_MIN_ONOFF (0) +#define AL_COMPRESSOR_MAX_ONOFF (1) +#define AL_COMPRESSOR_DEFAULT_ONOFF (1) + +/* Equalizer effect */ +#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f) +#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f) +#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f) +#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f) + +#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f) +#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f) +#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f) + +#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f) +#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f) +#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f) + +#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f) +#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f) +#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f) +#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f) + + +/* Source parameter value ranges and defaults. */ +#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f) +#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f) +#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f) + +#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_MIN_CONE_OUTER_GAINHF (0.0f) +#define AL_MAX_CONE_OUTER_GAINHF (1.0f) +#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f) + +#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE + + +/* Listener parameter value ranges and defaults. */ +#define AL_MIN_METERS_PER_UNIT FLT_MIN +#define AL_MAX_METERS_PER_UNIT FLT_MAX +#define AL_DEFAULT_METERS_PER_UNIT (1.0f) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* AL_EFX_H */ diff --git a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a new file mode 100644 index 00000000..1c4c63c8 Binary files /dev/null and b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a differ diff --git a/src/external/stb_image.h b/src/external/stb_image.h new file mode 100644 index 00000000..ce87646d --- /dev/null +++ b/src/external/stb_image.h @@ -0,0 +1,6763 @@ +/* stb_image - v2.12 - public domain image loader - http://nothings.org/stb_image.h + no warranty implied; use at your own risk + + Do this: + #define STB_IMAGE_IMPLEMENTATION + before you include this file in *one* C or C++ file to create the implementation. + + // i.e. it should look like this: + #include ... + #include ... + #include ... + #define STB_IMAGE_IMPLEMENTATION + #include "stb_image.h" + + You can #define STBI_ASSERT(x) before the #include to avoid using assert.h. + And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free + + + QUICK NOTES: + Primarily of interest to game developers and other people who can + avoid problematic images and only need the trivial interface + + JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib) + PNG 1/2/4/8-bit-per-channel (16 bpc not supported) + + TGA (not sure what subset, if a subset) + BMP non-1bpp, non-RLE + PSD (composited view only, no extra channels, 8/16 bit-per-channel) + + GIF (*comp always reports as 4-channel) + HDR (radiance rgbE format) + PIC (Softimage PIC) + PNM (PPM and PGM binary only) + + Animated GIF still needs a proper API, but here's one way to do it: + http://gist.github.com/urraka/685d9a6340b26b830d49 + + - decode from memory or through FILE (define STBI_NO_STDIO to remove code) + - decode from arbitrary I/O callbacks + - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON) + + Full documentation under "DOCUMENTATION" below. + + + Revision 2.00 release notes: + + - Progressive JPEG is now supported. + + - PPM and PGM binary formats are now supported, thanks to Ken Miller. + + - x86 platforms now make use of SSE2 SIMD instructions for + JPEG decoding, and ARM platforms can use NEON SIMD if requested. + This work was done by Fabian "ryg" Giesen. SSE2 is used by + default, but NEON must be enabled explicitly; see docs. + + With other JPEG optimizations included in this version, we see + 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup + on a JPEG on an ARM machine, relative to previous versions of this + library. The same results will not obtain for all JPGs and for all + x86/ARM machines. (Note that progressive JPEGs are significantly + slower to decode than regular JPEGs.) This doesn't mean that this + is the fastest JPEG decoder in the land; rather, it brings it + closer to parity with standard libraries. If you want the fastest + decode, look elsewhere. (See "Philosophy" section of docs below.) + + See final bullet items below for more info on SIMD. + + - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing + the memory allocator. Unlike other STBI libraries, these macros don't + support a context parameter, so if you need to pass a context in to + the allocator, you'll have to store it in a global or a thread-local + variable. + + - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and + STBI_NO_LINEAR. + STBI_NO_HDR: suppress implementation of .hdr reader format + STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API + + - You can suppress implementation of any of the decoders to reduce + your code footprint by #defining one or more of the following + symbols before creating the implementation. + + STBI_NO_JPEG + STBI_NO_PNG + STBI_NO_BMP + STBI_NO_PSD + STBI_NO_TGA + STBI_NO_GIF + STBI_NO_HDR + STBI_NO_PIC + STBI_NO_PNM (.ppm and .pgm) + + - You can request *only* certain decoders and suppress all other ones + (this will be more forward-compatible, as addition of new decoders + doesn't require you to disable them explicitly): + + STBI_ONLY_JPEG + STBI_ONLY_PNG + STBI_ONLY_BMP + STBI_ONLY_PSD + STBI_ONLY_TGA + STBI_ONLY_GIF + STBI_ONLY_HDR + STBI_ONLY_PIC + STBI_ONLY_PNM (.ppm and .pgm) + + Note that you can define multiples of these, and you will get all + of them ("only x" and "only y" is interpreted to mean "only x&y"). + + - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still + want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB + + - Compilation of all SIMD code can be suppressed with + #define STBI_NO_SIMD + It should not be necessary to disable SIMD unless you have issues + compiling (e.g. using an x86 compiler which doesn't support SSE + intrinsics or that doesn't support the method used to detect + SSE2 support at run-time), and even those can be reported as + bugs so I can refine the built-in compile-time checking to be + smarter. + + - The old STBI_SIMD system which allowed installing a user-defined + IDCT etc. has been removed. If you need this, don't upgrade. My + assumption is that almost nobody was doing this, and those who + were will find the built-in SIMD more satisfactory anyway. + + - RGB values computed for JPEG images are slightly different from + previous versions of stb_image. (This is due to using less + integer precision in SIMD.) The C code has been adjusted so + that the same RGB values will be computed regardless of whether + SIMD support is available, so your app should always produce + consistent results. But these results are slightly different from + previous versions. (Specifically, about 3% of available YCbCr values + will compute different RGB results from pre-1.49 versions by +-1; + most of the deviating values are one smaller in the G channel.) + + - If you must produce consistent results with previous versions of + stb_image, #define STBI_JPEG_OLD and you will get the same results + you used to; however, you will not get the SIMD speedups for + the YCbCr-to-RGB conversion step (although you should still see + significant JPEG speedup from the other changes). + + Please note that STBI_JPEG_OLD is a temporary feature; it will be + removed in future versions of the library. It is only intended for + near-term back-compatibility use. + + + Latest revision history: + 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes + 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 + RGB-format JPEG; remove white matting in PSD; + allocate large structures on the stack; + correct channel count for PNG & BMP + 2.10 (2016-01-22) avoid warning introduced in 2.09 + 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED + 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA + 2.07 (2015-09-13) partial animated GIF support + limited 16-bit PSD support + minor bugs, code cleanup, and compiler warnings + 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value + 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning + 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit + 2.03 (2015-04-12) additional corruption checking + stbi_set_flip_vertically_on_load + fix NEON support; fix mingw support + 2.02 (2015-01-19) fix incorrect assert, fix warning + 2.01 (2015-01-17) fix various warnings + 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG + 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD + progressive JPEG + PGM/PPM support + STBI_MALLOC,STBI_REALLOC,STBI_FREE + STBI_NO_*, STBI_ONLY_* + GIF bugfix + + See end of file for full revision history. + + + ============================ Contributors ========================= + + Image formats Extensions, features + Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info) + Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info) + Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG) + Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks) + Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG) + Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip) + Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD) + urraka@github (animated gif) Junggon Kim (PNM comments) + Daniel Gibson (16-bit TGA) + + Optimizations & bugfixes + Fabian "ryg" Giesen + Arseny Kapoulkine + + Bug & warning fixes + Marc LeBlanc David Woo Guillaume George Martins Mozeiko + Christpher Lloyd Martin Golini Jerry Jansson Joseph Thomson + Dave Moore Roy Eltham Hayaki Saito Phil Jordan + Won Chun Luke Graham Johan Duparc Nathan Reed + the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis + Janez Zemva John Bartholomew Michal Cichon svdijk@github + Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson + Laurent Gomila Cort Stratton Sergio Gonzalez romigrou@github + Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan + Ryamond Barbiero Paul Du Bois Engin Manap snagar@github + Michaelangel007@github Oriol Ferrer Mesia socks-the-fox + Blazej Dariusz Roszkowski + + +LICENSE + +This software is dual-licensed to the public domain and under the following +license: you are granted a perpetual, irrevocable license to copy, modify, +publish, and distribute this file as you see fit. + +*/ + +#ifndef STBI_INCLUDE_STB_IMAGE_H +#define STBI_INCLUDE_STB_IMAGE_H + +// DOCUMENTATION +// +// Limitations: +// - no 16-bit-per-channel PNG +// - no 12-bit-per-channel JPEG +// - no JPEGs with arithmetic coding +// - no 1-bit BMP +// - GIF always returns *comp=4 +// +// Basic usage (see HDR discussion below for HDR usage): +// int x,y,n; +// unsigned char *data = stbi_load(filename, &x, &y, &n, 0); +// // ... process data if not NULL ... +// // ... x = width, y = height, n = # 8-bit components per pixel ... +// // ... replace '0' with '1'..'4' to force that many components per pixel +// // ... but 'n' will always be the number that it would have been if you said 0 +// stbi_image_free(data) +// +// Standard parameters: +// int *x -- outputs image width in pixels +// int *y -- outputs image height in pixels +// int *comp -- outputs # of image components in image file +// int req_comp -- if non-zero, # of image components requested in result +// +// The return value from an image loader is an 'unsigned char *' which points +// to the pixel data, or NULL on an allocation failure or if the image is +// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels, +// with each pixel consisting of N interleaved 8-bit components; the first +// pixel pointed to is top-left-most in the image. There is no padding between +// image scanlines or between pixels, regardless of format. The number of +// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. +// If req_comp is non-zero, *comp has the number of components that _would_ +// have been output otherwise. E.g. if you set req_comp to 4, you will always +// get RGBA output, but you can check *comp to see if it's trivially opaque +// because e.g. there were only 3 channels in the source image. +// +// An output image with N components has the following components interleaved +// in this order in each pixel: +// +// N=#comp components +// 1 grey +// 2 grey, alpha +// 3 red, green, blue +// 4 red, green, blue, alpha +// +// If image loading fails for any reason, the return value will be NULL, +// and *x, *y, *comp will be unchanged. The function stbi_failure_reason() +// can be queried for an extremely brief, end-user unfriendly explanation +// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid +// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly +// more user-friendly ones. +// +// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. +// +// =========================================================================== +// +// Philosophy +// +// stb libraries are designed with the following priorities: +// +// 1. easy to use +// 2. easy to maintain +// 3. good performance +// +// Sometimes I let "good performance" creep up in priority over "easy to maintain", +// and for best performance I may provide less-easy-to-use APIs that give higher +// performance, in addition to the easy to use ones. Nevertheless, it's important +// to keep in mind that from the standpoint of you, a client of this library, +// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all. +// +// Some secondary priorities arise directly from the first two, some of which +// make more explicit reasons why performance can't be emphasized. +// +// - Portable ("ease of use") +// - Small footprint ("easy to maintain") +// - No dependencies ("ease of use") +// +// =========================================================================== +// +// I/O callbacks +// +// I/O callbacks allow you to read from arbitrary sources, like packaged +// files or some other source. Data read from callbacks are processed +// through a small internal buffer (currently 128 bytes) to try to reduce +// overhead. +// +// The three functions you must define are "read" (reads some bytes of data), +// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end). +// +// =========================================================================== +// +// SIMD support +// +// The JPEG decoder will try to automatically use SIMD kernels on x86 when +// supported by the compiler. For ARM Neon support, you must explicitly +// request it. +// +// (The old do-it-yourself SIMD API is no longer supported in the current +// code.) +// +// On x86, SSE2 will automatically be used when available based on a run-time +// test; if not, the generic C versions are used as a fall-back. On ARM targets, +// the typical path is to have separate builds for NEON and non-NEON devices +// (at least this is true for iOS and Android). Therefore, the NEON support is +// toggled by a build flag: define STBI_NEON to get NEON loops. +// +// The output of the JPEG decoder is slightly different from versions where +// SIMD support was introduced (that is, for versions before 1.49). The +// difference is only +-1 in the 8-bit RGB channels, and only on a small +// fraction of pixels. You can force the pre-1.49 behavior by defining +// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path +// and hence cost some performance. +// +// If for some reason you do not want to use any of SIMD code, or if +// you have issues compiling it, you can disable it entirely by +// defining STBI_NO_SIMD. +// +// =========================================================================== +// +// HDR image support (disable by defining STBI_NO_HDR) +// +// stb_image now supports loading HDR images in general, and currently +// the Radiance .HDR file format, although the support is provided +// generically. You can still load any file through the existing interface; +// if you attempt to load an HDR file, it will be automatically remapped to +// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; +// both of these constants can be reconfigured through this interface: +// +// stbi_hdr_to_ldr_gamma(2.2f); +// stbi_hdr_to_ldr_scale(1.0f); +// +// (note, do not use _inverse_ constants; stbi_image will invert them +// appropriately). +// +// Additionally, there is a new, parallel interface for loading files as +// (linear) floats to preserve the full dynamic range: +// +// float *data = stbi_loadf(filename, &x, &y, &n, 0); +// +// If you load LDR images through this interface, those images will +// be promoted to floating point values, run through the inverse of +// constants corresponding to the above: +// +// stbi_ldr_to_hdr_scale(1.0f); +// stbi_ldr_to_hdr_gamma(2.2f); +// +// Finally, given a filename (or an open file or memory block--see header +// file for details) containing image data, you can query for the "most +// appropriate" interface to use (that is, whether the image is HDR or +// not), using: +// +// stbi_is_hdr(char *filename); +// +// =========================================================================== +// +// iPhone PNG support: +// +// By default we convert iphone-formatted PNGs back to RGB, even though +// they are internally encoded differently. You can disable this conversion +// by by calling stbi_convert_iphone_png_to_rgb(0), in which case +// you will always just get the native iphone "format" through (which +// is BGR stored in RGB). +// +// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per +// pixel to remove any premultiplied alpha *only* if the image file explicitly +// says there's premultiplied data (currently only happens in iPhone images, +// and only if iPhone convert-to-rgb processing is on). +// + + +#define STBI_NO_HDR // RaySan: not required by raylib +#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 + +#ifndef STBI_NO_STDIO +#include +#endif // STBI_NO_STDIO + +// NOTE: Added to work with raylib on Android +#if defined(PLATFORM_ANDROID) + #include "utils.h" // Android fopen function map +#endif + +#define STBI_VERSION 1 + +enum +{ + STBI_default = 0, // only used for req_comp + + STBI_grey = 1, + STBI_grey_alpha = 2, + STBI_rgb = 3, + STBI_rgb_alpha = 4 +}; + +typedef unsigned char stbi_uc; + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef STB_IMAGE_STATIC +#define STBIDEF static +#else +#define STBIDEF extern +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// PRIMARY API - works on images of any type +// + +// +// load image by filename, open file, or memory buffer +// + +typedef struct +{ + int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read + void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative + int (*eof) (void *user); // returns nonzero if we are at end of file/data +} stbi_io_callbacks; + +STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); +STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp); +STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp); + +#ifndef STBI_NO_STDIO +STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +// for stbi_load_from_file, file pointer is left pointing immediately after image +#endif + +#ifndef STBI_NO_LINEAR + STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); + STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); + STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); + + #ifndef STBI_NO_STDIO + STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); + #endif +#endif + +#ifndef STBI_NO_HDR + STBIDEF void stbi_hdr_to_ldr_gamma(float gamma); + STBIDEF void stbi_hdr_to_ldr_scale(float scale); +#endif // STBI_NO_HDR + +#ifndef STBI_NO_LINEAR + STBIDEF void stbi_ldr_to_hdr_gamma(float gamma); + STBIDEF void stbi_ldr_to_hdr_scale(float scale); +#endif // STBI_NO_LINEAR + +// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR +STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); +STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); +#ifndef STBI_NO_STDIO +STBIDEF int stbi_is_hdr (char const *filename); +STBIDEF int stbi_is_hdr_from_file(FILE *f); +#endif // STBI_NO_STDIO + + +// get a VERY brief reason for failure +// NOT THREADSAFE +STBIDEF const char *stbi_failure_reason (void); + +// free the loaded image -- this is just free() +STBIDEF void stbi_image_free (void *retval_from_stbi_load); + +// get image dimensions & components without fully decoding +STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); +STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); + +#ifndef STBI_NO_STDIO +STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); +STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); + +#endif + + + +// for image formats that explicitly notate that they have premultiplied alpha, +// we just return the colors as stored in the file. set this flag to force +// unpremultiplication. results are undefined if the unpremultiply overflow. +STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); + +// indicate whether we should process iphone images back to canonical format, +// or just pass them through "as-is" +STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); + +// flip the image vertically, so the first pixel in the output array is the bottom left +STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); + +// ZLIB client - used by PNG, available for other purposes + +STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); +STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header); +STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); +STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); + +STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); +STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); + + +#ifdef __cplusplus +} +#endif + +// +// +//// end header file ///////////////////////////////////////////////////// +#endif // STBI_INCLUDE_STB_IMAGE_H + +#ifdef STB_IMAGE_IMPLEMENTATION + +#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \ + || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \ + || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \ + || defined(STBI_ONLY_ZLIB) + #ifndef STBI_ONLY_JPEG + #define STBI_NO_JPEG + #endif + #ifndef STBI_ONLY_PNG + #define STBI_NO_PNG + #endif + #ifndef STBI_ONLY_BMP + #define STBI_NO_BMP + #endif + #ifndef STBI_ONLY_PSD + #define STBI_NO_PSD + #endif + #ifndef STBI_ONLY_TGA + #define STBI_NO_TGA + #endif + #ifndef STBI_ONLY_GIF + #define STBI_NO_GIF + #endif + #ifndef STBI_ONLY_HDR + #define STBI_NO_HDR + #endif + #ifndef STBI_ONLY_PIC + #define STBI_NO_PIC + #endif + #ifndef STBI_ONLY_PNM + #define STBI_NO_PNM + #endif +#endif + +#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB) +#define STBI_NO_ZLIB +#endif + + +#include +#include // ptrdiff_t on osx +#include +#include + +#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) +#include // ldexp +#endif + +#ifndef STBI_NO_STDIO +#include +#endif + +#ifndef STBI_ASSERT +#include +#define STBI_ASSERT(x) assert(x) +#endif + + +#ifndef _MSC_VER + #ifdef __cplusplus + #define stbi_inline inline + #else + #define stbi_inline + #endif +#else + #define stbi_inline __forceinline +#endif + + +#ifdef _MSC_VER +typedef unsigned short stbi__uint16; +typedef signed short stbi__int16; +typedef unsigned int stbi__uint32; +typedef signed int stbi__int32; +#else +#include +typedef uint16_t stbi__uint16; +typedef int16_t stbi__int16; +typedef uint32_t stbi__uint32; +typedef int32_t stbi__int32; +#endif + +// should produce compiler error if size is wrong +typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; + +#ifdef _MSC_VER +#define STBI_NOTUSED(v) (void)(v) +#else +#define STBI_NOTUSED(v) (void)sizeof(v) +#endif + +#ifdef _MSC_VER +#define STBI_HAS_LROTL +#endif + +#ifdef STBI_HAS_LROTL + #define stbi_lrot(x,y) _lrotl(x,y) +#else + #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y)))) +#endif + +#if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) +// ok +#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED) +// ok +#else +#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)." +#endif + +#ifndef STBI_MALLOC +#define STBI_MALLOC(sz) malloc(sz) +#define STBI_REALLOC(p,newsz) realloc(p,newsz) +#define STBI_FREE(p) free(p) +#endif + +#ifndef STBI_REALLOC_SIZED +#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz) +#endif + +// x86/x64 detection +#if defined(__x86_64__) || defined(_M_X64) +#define STBI__X64_TARGET +#elif defined(__i386) || defined(_M_IX86) +#define STBI__X86_TARGET +#endif + +#if defined(__GNUC__) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) && !defined(__SSE2__) && !defined(STBI_NO_SIMD) +// NOTE: not clear do we actually need this for the 64-bit path? +// gcc doesn't support sse2 intrinsics unless you compile with -msse2, +// (but compiling with -msse2 allows the compiler to use SSE2 everywhere; +// this is just broken and gcc are jerks for not fixing it properly +// http://www.virtualdub.org/blog/pivot/entry.php?id=363 ) +#define STBI_NO_SIMD +#endif + +#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD) +// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET +// +// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the +// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant. +// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not +// simultaneously enabling "-mstackrealign". +// +// See https://github.com/nothings/stb/issues/81 for more information. +// +// So default to no SSE2 on 32-bit MinGW. If you've read this far and added +// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2. +#define STBI_NO_SIMD +#endif + +#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) +#define STBI_SSE2 +#include + +#ifdef _MSC_VER + +#if _MSC_VER >= 1400 // not VC6 +#include // __cpuid +static int stbi__cpuid3(void) +{ + int info[4]; + __cpuid(info,1); + return info[3]; +} +#else +static int stbi__cpuid3(void) +{ + int res; + __asm { + mov eax,1 + cpuid + mov res,edx + } + return res; +} +#endif + +#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name + +static int stbi__sse2_available() +{ + int info3 = stbi__cpuid3(); + return ((info3 >> 26) & 1) != 0; +} +#else // assume GCC-style if not VC++ +#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) + +static int stbi__sse2_available() +{ +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later + // GCC 4.8+ has a nice way to do this + return __builtin_cpu_supports("sse2"); +#else + // portable way to do this, preferably without using GCC inline ASM? + // just bail for now. + return 0; +#endif +} +#endif +#endif + +// ARM NEON +#if defined(STBI_NO_SIMD) && defined(STBI_NEON) +#undef STBI_NEON +#endif + +#ifdef STBI_NEON +#include +// assume GCC or Clang on ARM targets +#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) +#endif + +#ifndef STBI_SIMD_ALIGN +#define STBI_SIMD_ALIGN(type, name) type name +#endif + +/////////////////////////////////////////////// +// +// stbi__context struct and start_xxx functions + +// stbi__context structure is our basic context used by all images, so it +// contains all the IO context, plus some basic image information +typedef struct +{ + stbi__uint32 img_x, img_y; + int img_n, img_out_n; + + stbi_io_callbacks io; + void *io_user_data; + + int read_from_callbacks; + int buflen; + stbi_uc buffer_start[128]; + + stbi_uc *img_buffer, *img_buffer_end; + stbi_uc *img_buffer_original, *img_buffer_original_end; +} stbi__context; + + +static void stbi__refill_buffer(stbi__context *s); + +// initialize a memory-decode context +static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len) +{ + s->io.read = NULL; + s->read_from_callbacks = 0; + s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer; + s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len; +} + +// initialize a callback-based context +static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user) +{ + s->io = *c; + s->io_user_data = user; + s->buflen = sizeof(s->buffer_start); + s->read_from_callbacks = 1; + s->img_buffer_original = s->buffer_start; + stbi__refill_buffer(s); + s->img_buffer_original_end = s->img_buffer_end; +} + +#ifndef STBI_NO_STDIO + +static int stbi__stdio_read(void *user, char *data, int size) +{ + return (int) fread(data,1,size,(FILE*) user); +} + +static void stbi__stdio_skip(void *user, int n) +{ + fseek((FILE*) user, n, SEEK_CUR); +} + +static int stbi__stdio_eof(void *user) +{ + return feof((FILE*) user); +} + +static stbi_io_callbacks stbi__stdio_callbacks = +{ + stbi__stdio_read, + stbi__stdio_skip, + stbi__stdio_eof, +}; + +static void stbi__start_file(stbi__context *s, FILE *f) +{ + stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f); +} + +//static void stop_file(stbi__context *s) { } + +#endif // !STBI_NO_STDIO + +static void stbi__rewind(stbi__context *s) +{ + // conceptually rewind SHOULD rewind to the beginning of the stream, + // but we just rewind to the beginning of the initial buffer, because + // we only use it after doing 'test', which only ever looks at at most 92 bytes + s->img_buffer = s->img_buffer_original; + s->img_buffer_end = s->img_buffer_original_end; +} + +#ifndef STBI_NO_JPEG +static int stbi__jpeg_test(stbi__context *s); +static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_PNG +static int stbi__png_test(stbi__context *s); +static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_BMP +static int stbi__bmp_test(stbi__context *s); +static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_TGA +static int stbi__tga_test(stbi__context *s); +static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_PSD +static int stbi__psd_test(stbi__context *s); +static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_HDR +static int stbi__hdr_test(stbi__context *s); +static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_PIC +static int stbi__pic_test(stbi__context *s); +static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_GIF +static int stbi__gif_test(stbi__context *s); +static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +#ifndef STBI_NO_PNM +static int stbi__pnm_test(stbi__context *s); +static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); +#endif + +// this is not threadsafe +static const char *stbi__g_failure_reason; + +STBIDEF const char *stbi_failure_reason(void) +{ + return stbi__g_failure_reason; +} + +static int stbi__err(const char *str) +{ + stbi__g_failure_reason = str; + return 0; +} + +static void *stbi__malloc(size_t size) +{ + return STBI_MALLOC(size); +} + +// stbi__err - error +// stbi__errpf - error returning pointer to float +// stbi__errpuc - error returning pointer to unsigned char + +#ifdef STBI_NO_FAILURE_STRINGS + #define stbi__err(x,y) 0 +#elif defined(STBI_FAILURE_USERMSG) + #define stbi__err(x,y) stbi__err(y) +#else + #define stbi__err(x,y) stbi__err(x) +#endif + +#define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL)) +#define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL)) + +STBIDEF void stbi_image_free(void *retval_from_stbi_load) +{ + STBI_FREE(retval_from_stbi_load); +} + +#ifndef STBI_NO_LINEAR +static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp); +#endif + +#ifndef STBI_NO_HDR +static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp); +#endif + +static int stbi__vertically_flip_on_load = 0; + +STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) +{ + stbi__vertically_flip_on_load = flag_true_if_should_flip; +} + +static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + #ifndef STBI_NO_JPEG + if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_PNG + if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_BMP + if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_GIF + if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_PSD + if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_PIC + if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp); + #endif + #ifndef STBI_NO_PNM + if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp); + #endif + + #ifndef STBI_NO_HDR + if (stbi__hdr_test(s)) { + float *hdr = stbi__hdr_load(s, x,y,comp,req_comp); + return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); + } + #endif + + #ifndef STBI_NO_TGA + // test tga last because it's a crappy test! + if (stbi__tga_test(s)) + return stbi__tga_load(s,x,y,comp,req_comp); + #endif + + return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); +} + +static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *result = stbi__load_main(s, x, y, comp, req_comp); + + if (stbi__vertically_flip_on_load && result != NULL) { + int w = *x, h = *y; + int depth = req_comp ? req_comp : *comp; + int row,col,z; + stbi_uc temp; + + // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once + for (row = 0; row < (h>>1); row++) { + for (col = 0; col < w; col++) { + for (z = 0; z < depth; z++) { + temp = result[(row * w + col) * depth + z]; + result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; + result[((h - row - 1) * w + col) * depth + z] = temp; + } + } + } + } + + return result; +} + +#ifndef STBI_NO_HDR +static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) +{ + if (stbi__vertically_flip_on_load && result != NULL) { + int w = *x, h = *y; + int depth = req_comp ? req_comp : *comp; + int row,col,z; + float temp; + + // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once + for (row = 0; row < (h>>1); row++) { + for (col = 0; col < w; col++) { + for (z = 0; z < depth; z++) { + temp = result[(row * w + col) * depth + z]; + result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; + result[((h - row - 1) * w + col) * depth + z] = temp; + } + } + } + } +} +#endif + +#ifndef STBI_NO_STDIO + +static FILE *stbi__fopen(char const *filename, char const *mode) +{ + FILE *f; +#if defined(_MSC_VER) && _MSC_VER >= 1400 + if (0 != fopen_s(&f, filename, mode)) + f=0; +#else + f = fopen(filename, mode); +#endif + return f; +} + + +STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + FILE *f = stbi__fopen(filename, "rb"); + unsigned char *result; + if (!f) return stbi__errpuc("can't fopen", "Unable to open file"); + result = stbi_load_from_file(f,x,y,comp,req_comp); + fclose(f); + return result; +} + +STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *result; + stbi__context s; + stbi__start_file(&s,f); + result = stbi__load_flip(&s,x,y,comp,req_comp); + if (result) { + // need to 'unget' all the characters in the IO buffer + fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); + } + return result; +} +#endif //!STBI_NO_STDIO + +STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi__context s; + stbi__start_mem(&s,buffer,len); + return stbi__load_flip(&s,x,y,comp,req_comp); +} + +STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) +{ + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); + return stbi__load_flip(&s,x,y,comp,req_comp); +} + +#ifndef STBI_NO_LINEAR +static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + unsigned char *data; + #ifndef STBI_NO_HDR + if (stbi__hdr_test(s)) { + float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp); + if (hdr_data) + stbi__float_postprocess(hdr_data,x,y,comp,req_comp); + return hdr_data; + } + #endif + data = stbi__load_flip(s, x, y, comp, req_comp); + if (data) + return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); + return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); +} + +STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) +{ + stbi__context s; + stbi__start_mem(&s,buffer,len); + return stbi__loadf_main(&s,x,y,comp,req_comp); +} + +STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) +{ + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); + return stbi__loadf_main(&s,x,y,comp,req_comp); +} + +#ifndef STBI_NO_STDIO +STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + float *result; + FILE *f = stbi__fopen(filename, "rb"); + if (!f) return stbi__errpf("can't fopen", "Unable to open file"); + result = stbi_loadf_from_file(f,x,y,comp,req_comp); + fclose(f); + return result; +} + +STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi__context s; + stbi__start_file(&s,f); + return stbi__loadf_main(&s,x,y,comp,req_comp); +} +#endif // !STBI_NO_STDIO + +#endif // !STBI_NO_LINEAR + +// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is +// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always +// reports false! + +STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) +{ + #ifndef STBI_NO_HDR + stbi__context s; + stbi__start_mem(&s,buffer,len); + return stbi__hdr_test(&s); + #else + STBI_NOTUSED(buffer); + STBI_NOTUSED(len); + return 0; + #endif +} + +#ifndef STBI_NO_STDIO +STBIDEF int stbi_is_hdr (char const *filename) +{ + FILE *f = stbi__fopen(filename, "rb"); + int result=0; + if (f) { + result = stbi_is_hdr_from_file(f); + fclose(f); + } + return result; +} + +STBIDEF int stbi_is_hdr_from_file(FILE *f) +{ + #ifndef STBI_NO_HDR + stbi__context s; + stbi__start_file(&s,f); + return stbi__hdr_test(&s); + #else + STBI_NOTUSED(f); + return 0; + #endif +} +#endif // !STBI_NO_STDIO + +STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user) +{ + #ifndef STBI_NO_HDR + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); + return stbi__hdr_test(&s); + #else + STBI_NOTUSED(clbk); + STBI_NOTUSED(user); + return 0; + #endif +} + +#ifndef STBI_NO_LINEAR +static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f; + +STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } +STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } +#endif + +static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; + +STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; } +STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; } + + +////////////////////////////////////////////////////////////////////////////// +// +// Common code used by all image loaders +// + +enum +{ + STBI__SCAN_load=0, + STBI__SCAN_type, + STBI__SCAN_header +}; + +static void stbi__refill_buffer(stbi__context *s) +{ + int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); + if (n == 0) { + // at end of file, treat same as if from memory, but need to handle case + // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file + s->read_from_callbacks = 0; + s->img_buffer = s->buffer_start; + s->img_buffer_end = s->buffer_start+1; + *s->img_buffer = 0; + } else { + s->img_buffer = s->buffer_start; + s->img_buffer_end = s->buffer_start + n; + } +} + +stbi_inline static stbi_uc stbi__get8(stbi__context *s) +{ + if (s->img_buffer < s->img_buffer_end) + return *s->img_buffer++; + if (s->read_from_callbacks) { + stbi__refill_buffer(s); + return *s->img_buffer++; + } + return 0; +} + +stbi_inline static int stbi__at_eof(stbi__context *s) +{ + if (s->io.read) { + if (!(s->io.eof)(s->io_user_data)) return 0; + // if feof() is true, check if buffer = end + // special case: we've only got the special 0 character at the end + if (s->read_from_callbacks == 0) return 1; + } + + return s->img_buffer >= s->img_buffer_end; +} + +static void stbi__skip(stbi__context *s, int n) +{ + if (n < 0) { + s->img_buffer = s->img_buffer_end; + return; + } + if (s->io.read) { + int blen = (int) (s->img_buffer_end - s->img_buffer); + if (blen < n) { + s->img_buffer = s->img_buffer_end; + (s->io.skip)(s->io_user_data, n - blen); + return; + } + } + s->img_buffer += n; +} + +static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) +{ + if (s->io.read) { + int blen = (int) (s->img_buffer_end - s->img_buffer); + if (blen < n) { + int res, count; + + memcpy(buffer, s->img_buffer, blen); + + count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen); + res = (count == (n-blen)); + s->img_buffer = s->img_buffer_end; + return res; + } + } + + if (s->img_buffer+n <= s->img_buffer_end) { + memcpy(buffer, s->img_buffer, n); + s->img_buffer += n; + return 1; + } else + return 0; +} + +static int stbi__get16be(stbi__context *s) +{ + int z = stbi__get8(s); + return (z << 8) + stbi__get8(s); +} + +static stbi__uint32 stbi__get32be(stbi__context *s) +{ + stbi__uint32 z = stbi__get16be(s); + return (z << 16) + stbi__get16be(s); +} + +#if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) +// nothing +#else +static int stbi__get16le(stbi__context *s) +{ + int z = stbi__get8(s); + return z + (stbi__get8(s) << 8); +} +#endif + +#ifndef STBI_NO_BMP +static stbi__uint32 stbi__get32le(stbi__context *s) +{ + stbi__uint32 z = stbi__get16le(s); + return z + (stbi__get16le(s) << 16); +} +#endif + +#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings + + +////////////////////////////////////////////////////////////////////////////// +// +// generic converter from built-in img_n to req_comp +// individual types do this automatically as much as possible (e.g. jpeg +// does all cases internally since it needs to colorspace convert anyway, +// and it never has alpha, so very few cases ). png can automatically +// interleave an alpha=255 channel, but falls back to this for other cases +// +// assume data buffer is malloced, so malloc a new one and free that one +// only failure mode is malloc failing + +static stbi_uc stbi__compute_y(int r, int g, int b) +{ + return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); +} + +static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) +{ + int i,j; + unsigned char *good; + + if (req_comp == img_n) return data; + STBI_ASSERT(req_comp >= 1 && req_comp <= 4); + + good = (unsigned char *) stbi__malloc(req_comp * x * y); + if (good == NULL) { + STBI_FREE(data); + return stbi__errpuc("outofmem", "Out of memory"); + } + + for (j=0; j < (int) y; ++j) { + unsigned char *src = data + j * x * img_n ; + unsigned char *dest = good + j * x * req_comp; + + #define COMBO(a,b) ((a)*8+(b)) + #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + // convert source image with img_n components to one with req_comp components; + // avoid switch per pixel, so use switch per scanline and massive macros + switch (COMBO(img_n, req_comp)) { + CASE(1,2) dest[0]=src[0], dest[1]=255; break; + CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; + CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; + CASE(2,1) dest[0]=src[0]; break; + CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; + CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; + CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; + CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; + CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break; + CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; + CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; + CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; + default: STBI_ASSERT(0); + } + #undef CASE + } + + STBI_FREE(data); + return good; +} + +#ifndef STBI_NO_LINEAR +static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) +{ + int i,k,n; + float *output = (float *) stbi__malloc(x * y * comp * sizeof(float)); + if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); } + // compute number of non-alpha components + if (comp & 1) n = comp; else n = comp-1; + for (i=0; i < x*y; ++i) { + for (k=0; k < n; ++k) { + output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale); + } + if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; + } + STBI_FREE(data); + return output; +} +#endif + +#ifndef STBI_NO_HDR +#define stbi__float2int(x) ((int) (x)) +static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) +{ + int i,k,n; + stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp); + if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } + // compute number of non-alpha components + if (comp & 1) n = comp; else n = comp-1; + for (i=0; i < x*y; ++i) { + for (k=0; k < n; ++k) { + float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f; + if (z < 0) z = 0; + if (z > 255) z = 255; + output[i*comp + k] = (stbi_uc) stbi__float2int(z); + } + if (k < comp) { + float z = data[i*comp+k] * 255 + 0.5f; + if (z < 0) z = 0; + if (z > 255) z = 255; + output[i*comp + k] = (stbi_uc) stbi__float2int(z); + } + } + STBI_FREE(data); + return output; +} +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// "baseline" JPEG/JFIF decoder +// +// simple implementation +// - doesn't support delayed output of y-dimension +// - simple interface (only one output format: 8-bit interleaved RGB) +// - doesn't try to recover corrupt jpegs +// - doesn't allow partial loading, loading multiple at once +// - still fast on x86 (copying globals into locals doesn't help x86) +// - allocates lots of intermediate memory (full size of all components) +// - non-interleaved case requires this anyway +// - allows good upsampling (see next) +// high-quality +// - upsampled channels are bilinearly interpolated, even across blocks +// - quality integer IDCT derived from IJG's 'slow' +// performance +// - fast huffman; reasonable integer IDCT +// - some SIMD kernels for common paths on targets with SSE2/NEON +// - uses a lot of intermediate memory, could cache poorly + +#ifndef STBI_NO_JPEG + +// huffman decoding acceleration +#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache + +typedef struct +{ + stbi_uc fast[1 << FAST_BITS]; + // weirdly, repacking this into AoS is a 10% speed loss, instead of a win + stbi__uint16 code[256]; + stbi_uc values[256]; + stbi_uc size[257]; + unsigned int maxcode[18]; + int delta[17]; // old 'firstsymbol' - old 'firstcode' +} stbi__huffman; + +typedef struct +{ + stbi__context *s; + stbi__huffman huff_dc[4]; + stbi__huffman huff_ac[4]; + stbi_uc dequant[4][64]; + stbi__int16 fast_ac[4][1 << FAST_BITS]; + +// sizes for components, interleaved MCUs + int img_h_max, img_v_max; + int img_mcu_x, img_mcu_y; + int img_mcu_w, img_mcu_h; + +// definition of jpeg image component + struct + { + int id; + int h,v; + int tq; + int hd,ha; + int dc_pred; + + int x,y,w2,h2; + stbi_uc *data; + void *raw_data, *raw_coeff; + stbi_uc *linebuf; + short *coeff; // progressive only + int coeff_w, coeff_h; // number of 8x8 coefficient blocks + } img_comp[4]; + + stbi__uint32 code_buffer; // jpeg entropy-coded buffer + int code_bits; // number of valid bits + unsigned char marker; // marker seen while filling entropy buffer + int nomore; // flag if we saw a marker so must stop + + int progressive; + int spec_start; + int spec_end; + int succ_high; + int succ_low; + int eob_run; + int rgb; + + int scan_n, order[4]; + int restart_interval, todo; + +// kernels + void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]); + void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step); + stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs); +} stbi__jpeg; + +static int stbi__build_huffman(stbi__huffman *h, int *count) +{ + int i,j,k=0,code; + // build size list for each symbol (from JPEG spec) + for (i=0; i < 16; ++i) + for (j=0; j < count[i]; ++j) + h->size[k++] = (stbi_uc) (i+1); + h->size[k] = 0; + + // compute actual symbols (from jpeg spec) + code = 0; + k = 0; + for(j=1; j <= 16; ++j) { + // compute delta to add to code to compute symbol id + h->delta[j] = k - code; + if (h->size[k] == j) { + while (h->size[k] == j) + h->code[k++] = (stbi__uint16) (code++); + if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG"); + } + // compute largest code + 1 for this size, preshifted as needed later + h->maxcode[j] = code << (16-j); + code <<= 1; + } + h->maxcode[j] = 0xffffffff; + + // build non-spec acceleration table; 255 is flag for not-accelerated + memset(h->fast, 255, 1 << FAST_BITS); + for (i=0; i < k; ++i) { + int s = h->size[i]; + if (s <= FAST_BITS) { + int c = h->code[i] << (FAST_BITS-s); + int m = 1 << (FAST_BITS-s); + for (j=0; j < m; ++j) { + h->fast[c+j] = (stbi_uc) i; + } + } + } + return 1; +} + +// build a table that decodes both magnitude and value of small ACs in +// one go. +static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) +{ + int i; + for (i=0; i < (1 << FAST_BITS); ++i) { + stbi_uc fast = h->fast[i]; + fast_ac[i] = 0; + if (fast < 255) { + int rs = h->values[fast]; + int run = (rs >> 4) & 15; + int magbits = rs & 15; + int len = h->size[fast]; + + if (magbits && len + magbits <= FAST_BITS) { + // magnitude code followed by receive_extend code + int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits); + int m = 1 << (magbits - 1); + if (k < m) k += (-1 << magbits) + 1; + // if the result is small enough, we can fit it in fast_ac table + if (k >= -128 && k <= 127) + fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits)); + } + } + } +} + +static void stbi__grow_buffer_unsafe(stbi__jpeg *j) +{ + do { + int b = j->nomore ? 0 : stbi__get8(j->s); + if (b == 0xff) { + int c = stbi__get8(j->s); + if (c != 0) { + j->marker = (unsigned char) c; + j->nomore = 1; + return; + } + } + j->code_buffer |= b << (24 - j->code_bits); + j->code_bits += 8; + } while (j->code_bits <= 24); +} + +// (1 << n) - 1 +static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; + +// decode a jpeg huffman value from the bitstream +stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) +{ + unsigned int temp; + int c,k; + + if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); + + // look at the top FAST_BITS and determine what symbol ID it is, + // if the code is <= FAST_BITS + c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); + k = h->fast[c]; + if (k < 255) { + int s = h->size[k]; + if (s > j->code_bits) + return -1; + j->code_buffer <<= s; + j->code_bits -= s; + return h->values[k]; + } + + // naive test is to shift the code_buffer down so k bits are + // valid, then test against maxcode. To speed this up, we've + // preshifted maxcode left so that it has (16-k) 0s at the + // end; in other words, regardless of the number of bits, it + // wants to be compared against something shifted to have 16; + // that way we don't need to shift inside the loop. + temp = j->code_buffer >> 16; + for (k=FAST_BITS+1 ; ; ++k) + if (temp < h->maxcode[k]) + break; + if (k == 17) { + // error! code not found + j->code_bits -= 16; + return -1; + } + + if (k > j->code_bits) + return -1; + + // convert the huffman code to the symbol id + c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; + STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]); + + // convert the id to a symbol + j->code_bits -= k; + j->code_buffer <<= k; + return h->values[c]; +} + +// bias[n] = (-1<code_bits < n) stbi__grow_buffer_unsafe(j); + + sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB + k = stbi_lrot(j->code_buffer, n); + STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask))); + j->code_buffer = k & ~stbi__bmask[n]; + k &= stbi__bmask[n]; + j->code_bits -= n; + return k + (stbi__jbias[n] & ~sgn); +} + +// get some unsigned bits +stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) +{ + unsigned int k; + if (j->code_bits < n) stbi__grow_buffer_unsafe(j); + k = stbi_lrot(j->code_buffer, n); + j->code_buffer = k & ~stbi__bmask[n]; + k &= stbi__bmask[n]; + j->code_bits -= n; + return k; +} + +stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) +{ + unsigned int k; + if (j->code_bits < 1) stbi__grow_buffer_unsafe(j); + k = j->code_buffer; + j->code_buffer <<= 1; + --j->code_bits; + return k & 0x80000000; +} + +// given a value that's at position X in the zigzag stream, +// where does it appear in the 8x8 matrix coded as row-major? +static stbi_uc stbi__jpeg_dezigzag[64+15] = +{ + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63, + // let corrupt input sample past end + 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63 +}; + +// decode one 64-entry block-- +static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant) +{ + int diff,dc,k; + int t; + + if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); + t = stbi__jpeg_huff_decode(j, hdc); + if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG"); + + // 0 all the ac values now so we can do it 32-bits at a time + memset(data,0,64*sizeof(data[0])); + + diff = t ? stbi__extend_receive(j, t) : 0; + dc = j->img_comp[b].dc_pred + diff; + j->img_comp[b].dc_pred = dc; + data[0] = (short) (dc * dequant[0]); + + // decode AC components, see JPEG spec + k = 1; + do { + unsigned int zig; + int c,r,s; + if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); + c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); + r = fac[c]; + if (r) { // fast-AC path + k += (r >> 4) & 15; // run + s = r & 15; // combined length + j->code_buffer <<= s; + j->code_bits -= s; + // decode into unzigzag'd location + zig = stbi__jpeg_dezigzag[k++]; + data[zig] = (short) ((r >> 8) * dequant[zig]); + } else { + int rs = stbi__jpeg_huff_decode(j, hac); + if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); + s = rs & 15; + r = rs >> 4; + if (s == 0) { + if (rs != 0xf0) break; // end block + k += 16; + } else { + k += r; + // decode into unzigzag'd location + zig = stbi__jpeg_dezigzag[k++]; + data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]); + } + } + } while (k < 64); + return 1; +} + +static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b) +{ + int diff,dc; + int t; + if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); + + if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); + + if (j->succ_high == 0) { + // first scan for DC coefficient, must be first + memset(data,0,64*sizeof(data[0])); // 0 all the ac values now + t = stbi__jpeg_huff_decode(j, hdc); + diff = t ? stbi__extend_receive(j, t) : 0; + + dc = j->img_comp[b].dc_pred + diff; + j->img_comp[b].dc_pred = dc; + data[0] = (short) (dc << j->succ_low); + } else { + // refinement scan for DC coefficient + if (stbi__jpeg_get_bit(j)) + data[0] += (short) (1 << j->succ_low); + } + return 1; +} + +// @OPTIMIZE: store non-zigzagged during the decode passes, +// and only de-zigzag when dequantizing +static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac) +{ + int k; + if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); + + if (j->succ_high == 0) { + int shift = j->succ_low; + + if (j->eob_run) { + --j->eob_run; + return 1; + } + + k = j->spec_start; + do { + unsigned int zig; + int c,r,s; + if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); + c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); + r = fac[c]; + if (r) { // fast-AC path + k += (r >> 4) & 15; // run + s = r & 15; // combined length + j->code_buffer <<= s; + j->code_bits -= s; + zig = stbi__jpeg_dezigzag[k++]; + data[zig] = (short) ((r >> 8) << shift); + } else { + int rs = stbi__jpeg_huff_decode(j, hac); + if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); + s = rs & 15; + r = rs >> 4; + if (s == 0) { + if (r < 15) { + j->eob_run = (1 << r); + if (r) + j->eob_run += stbi__jpeg_get_bits(j, r); + --j->eob_run; + break; + } + k += 16; + } else { + k += r; + zig = stbi__jpeg_dezigzag[k++]; + data[zig] = (short) (stbi__extend_receive(j,s) << shift); + } + } + } while (k <= j->spec_end); + } else { + // refinement scan for these AC coefficients + + short bit = (short) (1 << j->succ_low); + + if (j->eob_run) { + --j->eob_run; + for (k = j->spec_start; k <= j->spec_end; ++k) { + short *p = &data[stbi__jpeg_dezigzag[k]]; + if (*p != 0) + if (stbi__jpeg_get_bit(j)) + if ((*p & bit)==0) { + if (*p > 0) + *p += bit; + else + *p -= bit; + } + } + } else { + k = j->spec_start; + do { + int r,s; + int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh + if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); + s = rs & 15; + r = rs >> 4; + if (s == 0) { + if (r < 15) { + j->eob_run = (1 << r) - 1; + if (r) + j->eob_run += stbi__jpeg_get_bits(j, r); + r = 64; // force end of block + } else { + // r=15 s=0 should write 16 0s, so we just do + // a run of 15 0s and then write s (which is 0), + // so we don't have to do anything special here + } + } else { + if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG"); + // sign bit + if (stbi__jpeg_get_bit(j)) + s = bit; + else + s = -bit; + } + + // advance by r + while (k <= j->spec_end) { + short *p = &data[stbi__jpeg_dezigzag[k++]]; + if (*p != 0) { + if (stbi__jpeg_get_bit(j)) + if ((*p & bit)==0) { + if (*p > 0) + *p += bit; + else + *p -= bit; + } + } else { + if (r == 0) { + *p = (short) s; + break; + } + --r; + } + } + } while (k <= j->spec_end); + } + } + return 1; +} + +// take a -128..127 value and stbi__clamp it and convert to 0..255 +stbi_inline static stbi_uc stbi__clamp(int x) +{ + // trick to use a single test to catch both cases + if ((unsigned int) x > 255) { + if (x < 0) return 0; + if (x > 255) return 255; + } + return (stbi_uc) x; +} + +#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) +#define stbi__fsh(x) ((x) << 12) + +// derived from jidctint -- DCT_ISLOW +#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ + int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ + p2 = s2; \ + p3 = s6; \ + p1 = (p2+p3) * stbi__f2f(0.5411961f); \ + t2 = p1 + p3*stbi__f2f(-1.847759065f); \ + t3 = p1 + p2*stbi__f2f( 0.765366865f); \ + p2 = s0; \ + p3 = s4; \ + t0 = stbi__fsh(p2+p3); \ + t1 = stbi__fsh(p2-p3); \ + x0 = t0+t3; \ + x3 = t0-t3; \ + x1 = t1+t2; \ + x2 = t1-t2; \ + t0 = s7; \ + t1 = s5; \ + t2 = s3; \ + t3 = s1; \ + p3 = t0+t2; \ + p4 = t1+t3; \ + p1 = t0+t3; \ + p2 = t1+t2; \ + p5 = (p3+p4)*stbi__f2f( 1.175875602f); \ + t0 = t0*stbi__f2f( 0.298631336f); \ + t1 = t1*stbi__f2f( 2.053119869f); \ + t2 = t2*stbi__f2f( 3.072711026f); \ + t3 = t3*stbi__f2f( 1.501321110f); \ + p1 = p5 + p1*stbi__f2f(-0.899976223f); \ + p2 = p5 + p2*stbi__f2f(-2.562915447f); \ + p3 = p3*stbi__f2f(-1.961570560f); \ + p4 = p4*stbi__f2f(-0.390180644f); \ + t3 += p1+p4; \ + t2 += p2+p3; \ + t1 += p2+p4; \ + t0 += p1+p3; + +static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) +{ + int i,val[64],*v=val; + stbi_uc *o; + short *d = data; + + // columns + for (i=0; i < 8; ++i,++d, ++v) { + // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing + if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 + && d[40]==0 && d[48]==0 && d[56]==0) { + // no shortcut 0 seconds + // (1|2|3|4|5|6|7)==0 0 seconds + // all separate -0.047 seconds + // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds + int dcterm = d[0] << 2; + v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; + } else { + STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56]) + // constants scaled things up by 1<<12; let's bring them back + // down, but keep 2 extra bits of precision + x0 += 512; x1 += 512; x2 += 512; x3 += 512; + v[ 0] = (x0+t3) >> 10; + v[56] = (x0-t3) >> 10; + v[ 8] = (x1+t2) >> 10; + v[48] = (x1-t2) >> 10; + v[16] = (x2+t1) >> 10; + v[40] = (x2-t1) >> 10; + v[24] = (x3+t0) >> 10; + v[32] = (x3-t0) >> 10; + } + } + + for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { + // no fast case since the first 1D IDCT spread components out + STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) + // constants scaled things up by 1<<12, plus we had 1<<2 from first + // loop, plus horizontal and vertical each scale by sqrt(8) so together + // we've got an extra 1<<3, so 1<<17 total we need to remove. + // so we want to round that, which means adding 0.5 * 1<<17, + // aka 65536. Also, we'll end up with -128 to 127 that we want + // to encode as 0..255 by adding 128, so we'll add that before the shift + x0 += 65536 + (128<<17); + x1 += 65536 + (128<<17); + x2 += 65536 + (128<<17); + x3 += 65536 + (128<<17); + // tried computing the shifts into temps, or'ing the temps to see + // if any were out of range, but that was slower + o[0] = stbi__clamp((x0+t3) >> 17); + o[7] = stbi__clamp((x0-t3) >> 17); + o[1] = stbi__clamp((x1+t2) >> 17); + o[6] = stbi__clamp((x1-t2) >> 17); + o[2] = stbi__clamp((x2+t1) >> 17); + o[5] = stbi__clamp((x2-t1) >> 17); + o[3] = stbi__clamp((x3+t0) >> 17); + o[4] = stbi__clamp((x3-t0) >> 17); + } +} + +#ifdef STBI_SSE2 +// sse2 integer IDCT. not the fastest possible implementation but it +// produces bit-identical results to the generic C version so it's +// fully "transparent". +static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) +{ + // This is constructed to match our regular (generic) integer IDCT exactly. + __m128i row0, row1, row2, row3, row4, row5, row6, row7; + __m128i tmp; + + // dot product constant: even elems=x, odd elems=y + #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y)) + + // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) + // out(1) = c1[even]*x + c1[odd]*y + #define dct_rot(out0,out1, x,y,c0,c1) \ + __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \ + __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \ + __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ + __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ + __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ + __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) + + // out = in << 12 (in 16-bit, out 32-bit) + #define dct_widen(out, in) \ + __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ + __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) + + // wide add + #define dct_wadd(out, a, b) \ + __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ + __m128i out##_h = _mm_add_epi32(a##_h, b##_h) + + // wide sub + #define dct_wsub(out, a, b) \ + __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ + __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) + + // butterfly a/b, add bias, then shift by "s" and pack + #define dct_bfly32o(out0, out1, a,b,bias,s) \ + { \ + __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ + __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ + dct_wadd(sum, abiased, b); \ + dct_wsub(dif, abiased, b); \ + out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ + out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ + } + + // 8-bit interleave step (for transposes) + #define dct_interleave8(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi8(a, b); \ + b = _mm_unpackhi_epi8(tmp, b) + + // 16-bit interleave step (for transposes) + #define dct_interleave16(a, b) \ + tmp = a; \ + a = _mm_unpacklo_epi16(a, b); \ + b = _mm_unpackhi_epi16(tmp, b) + + #define dct_pass(bias,shift) \ + { \ + /* even part */ \ + dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \ + __m128i sum04 = _mm_add_epi16(row0, row4); \ + __m128i dif04 = _mm_sub_epi16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \ + dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \ + __m128i sum17 = _mm_add_epi16(row1, row7); \ + __m128i sum35 = _mm_add_epi16(row3, row5); \ + dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \ + dct_wadd(x4, y0o, y4o); \ + dct_wadd(x5, y1o, y5o); \ + dct_wadd(x6, y2o, y5o); \ + dct_wadd(x7, y3o, y4o); \ + dct_bfly32o(row0,row7, x0,x7,bias,shift); \ + dct_bfly32o(row1,row6, x1,x6,bias,shift); \ + dct_bfly32o(row2,row5, x2,x5,bias,shift); \ + dct_bfly32o(row3,row4, x3,x4,bias,shift); \ + } + + __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); + __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f)); + __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f)); + __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f)); + __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f)); + __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f)); + __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f)); + __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f)); + + // rounding biases in column/row passes, see stbi__idct_block for explanation. + __m128i bias_0 = _mm_set1_epi32(512); + __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17)); + + // load + row0 = _mm_load_si128((const __m128i *) (data + 0*8)); + row1 = _mm_load_si128((const __m128i *) (data + 1*8)); + row2 = _mm_load_si128((const __m128i *) (data + 2*8)); + row3 = _mm_load_si128((const __m128i *) (data + 3*8)); + row4 = _mm_load_si128((const __m128i *) (data + 4*8)); + row5 = _mm_load_si128((const __m128i *) (data + 5*8)); + row6 = _mm_load_si128((const __m128i *) (data + 6*8)); + row7 = _mm_load_si128((const __m128i *) (data + 7*8)); + + // column pass + dct_pass(bias_0, 10); + + { + // 16bit 8x8 transpose pass 1 + dct_interleave16(row0, row4); + dct_interleave16(row1, row5); + dct_interleave16(row2, row6); + dct_interleave16(row3, row7); + + // transpose pass 2 + dct_interleave16(row0, row2); + dct_interleave16(row1, row3); + dct_interleave16(row4, row6); + dct_interleave16(row5, row7); + + // transpose pass 3 + dct_interleave16(row0, row1); + dct_interleave16(row2, row3); + dct_interleave16(row4, row5); + dct_interleave16(row6, row7); + } + + // row pass + dct_pass(bias_1, 17); + + { + // pack + __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7 + __m128i p1 = _mm_packus_epi16(row2, row3); + __m128i p2 = _mm_packus_epi16(row4, row5); + __m128i p3 = _mm_packus_epi16(row6, row7); + + // 8bit 8x8 transpose pass 1 + dct_interleave8(p0, p2); // a0e0a1e1... + dct_interleave8(p1, p3); // c0g0c1g1... + + // transpose pass 2 + dct_interleave8(p0, p1); // a0c0e0g0... + dct_interleave8(p2, p3); // b0d0f0h0... + + // transpose pass 3 + dct_interleave8(p0, p2); // a0b0c0d0... + dct_interleave8(p1, p3); // a4b4c4d4... + + // store + _mm_storel_epi64((__m128i *) out, p0); out += out_stride; + _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride; + _mm_storel_epi64((__m128i *) out, p2); out += out_stride; + _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride; + _mm_storel_epi64((__m128i *) out, p1); out += out_stride; + _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride; + _mm_storel_epi64((__m128i *) out, p3); out += out_stride; + _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e)); + } + +#undef dct_const +#undef dct_rot +#undef dct_widen +#undef dct_wadd +#undef dct_wsub +#undef dct_bfly32o +#undef dct_interleave8 +#undef dct_interleave16 +#undef dct_pass +} + +#endif // STBI_SSE2 + +#ifdef STBI_NEON + +// NEON integer IDCT. should produce bit-identical +// results to the generic C version. +static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) +{ + int16x8_t row0, row1, row2, row3, row4, row5, row6, row7; + + int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f)); + int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f)); + int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f)); + int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f)); + int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f)); + int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f)); + int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f)); + int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f)); + int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f)); + int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f)); + int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f)); + int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f)); + +#define dct_long_mul(out, inq, coeff) \ + int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ + int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) + +#define dct_long_mac(out, acc, inq, coeff) \ + int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ + int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) + +#define dct_widen(out, inq) \ + int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ + int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) + +// wide add +#define dct_wadd(out, a, b) \ + int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ + int32x4_t out##_h = vaddq_s32(a##_h, b##_h) + +// wide sub +#define dct_wsub(out, a, b) \ + int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ + int32x4_t out##_h = vsubq_s32(a##_h, b##_h) + +// butterfly a/b, then shift using "shiftop" by "s" and pack +#define dct_bfly32o(out0,out1, a,b,shiftop,s) \ + { \ + dct_wadd(sum, a, b); \ + dct_wsub(dif, a, b); \ + out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ + out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ + } + +#define dct_pass(shiftop, shift) \ + { \ + /* even part */ \ + int16x8_t sum26 = vaddq_s16(row2, row6); \ + dct_long_mul(p1e, sum26, rot0_0); \ + dct_long_mac(t2e, p1e, row6, rot0_1); \ + dct_long_mac(t3e, p1e, row2, rot0_2); \ + int16x8_t sum04 = vaddq_s16(row0, row4); \ + int16x8_t dif04 = vsubq_s16(row0, row4); \ + dct_widen(t0e, sum04); \ + dct_widen(t1e, dif04); \ + dct_wadd(x0, t0e, t3e); \ + dct_wsub(x3, t0e, t3e); \ + dct_wadd(x1, t1e, t2e); \ + dct_wsub(x2, t1e, t2e); \ + /* odd part */ \ + int16x8_t sum15 = vaddq_s16(row1, row5); \ + int16x8_t sum17 = vaddq_s16(row1, row7); \ + int16x8_t sum35 = vaddq_s16(row3, row5); \ + int16x8_t sum37 = vaddq_s16(row3, row7); \ + int16x8_t sumodd = vaddq_s16(sum17, sum35); \ + dct_long_mul(p5o, sumodd, rot1_0); \ + dct_long_mac(p1o, p5o, sum17, rot1_1); \ + dct_long_mac(p2o, p5o, sum35, rot1_2); \ + dct_long_mul(p3o, sum37, rot2_0); \ + dct_long_mul(p4o, sum15, rot2_1); \ + dct_wadd(sump13o, p1o, p3o); \ + dct_wadd(sump24o, p2o, p4o); \ + dct_wadd(sump23o, p2o, p3o); \ + dct_wadd(sump14o, p1o, p4o); \ + dct_long_mac(x4, sump13o, row7, rot3_0); \ + dct_long_mac(x5, sump24o, row5, rot3_1); \ + dct_long_mac(x6, sump23o, row3, rot3_2); \ + dct_long_mac(x7, sump14o, row1, rot3_3); \ + dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \ + dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \ + dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \ + dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \ + } + + // load + row0 = vld1q_s16(data + 0*8); + row1 = vld1q_s16(data + 1*8); + row2 = vld1q_s16(data + 2*8); + row3 = vld1q_s16(data + 3*8); + row4 = vld1q_s16(data + 4*8); + row5 = vld1q_s16(data + 5*8); + row6 = vld1q_s16(data + 6*8); + row7 = vld1q_s16(data + 7*8); + + // add DC bias + row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0)); + + // column pass + dct_pass(vrshrn_n_s32, 10); + + // 16bit 8x8 transpose + { +// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. +// whether compilers actually get this is another story, sadly. +#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; } +#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); } +#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); } + + // pass 1 + dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6 + dct_trn16(row2, row3); + dct_trn16(row4, row5); + dct_trn16(row6, row7); + + // pass 2 + dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4 + dct_trn32(row1, row3); + dct_trn32(row4, row6); + dct_trn32(row5, row7); + + // pass 3 + dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0 + dct_trn64(row1, row5); + dct_trn64(row2, row6); + dct_trn64(row3, row7); + +#undef dct_trn16 +#undef dct_trn32 +#undef dct_trn64 + } + + // row pass + // vrshrn_n_s32 only supports shifts up to 16, we need + // 17. so do a non-rounding shift of 16 first then follow + // up with a rounding shift by 1. + dct_pass(vshrn_n_s32, 16); + + { + // pack and round + uint8x8_t p0 = vqrshrun_n_s16(row0, 1); + uint8x8_t p1 = vqrshrun_n_s16(row1, 1); + uint8x8_t p2 = vqrshrun_n_s16(row2, 1); + uint8x8_t p3 = vqrshrun_n_s16(row3, 1); + uint8x8_t p4 = vqrshrun_n_s16(row4, 1); + uint8x8_t p5 = vqrshrun_n_s16(row5, 1); + uint8x8_t p6 = vqrshrun_n_s16(row6, 1); + uint8x8_t p7 = vqrshrun_n_s16(row7, 1); + + // again, these can translate into one instruction, but often don't. +#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; } +#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); } +#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); } + + // sadly can't use interleaved stores here since we only write + // 8 bytes to each scan line! + + // 8x8 8-bit transpose pass 1 + dct_trn8_8(p0, p1); + dct_trn8_8(p2, p3); + dct_trn8_8(p4, p5); + dct_trn8_8(p6, p7); + + // pass 2 + dct_trn8_16(p0, p2); + dct_trn8_16(p1, p3); + dct_trn8_16(p4, p6); + dct_trn8_16(p5, p7); + + // pass 3 + dct_trn8_32(p0, p4); + dct_trn8_32(p1, p5); + dct_trn8_32(p2, p6); + dct_trn8_32(p3, p7); + + // store + vst1_u8(out, p0); out += out_stride; + vst1_u8(out, p1); out += out_stride; + vst1_u8(out, p2); out += out_stride; + vst1_u8(out, p3); out += out_stride; + vst1_u8(out, p4); out += out_stride; + vst1_u8(out, p5); out += out_stride; + vst1_u8(out, p6); out += out_stride; + vst1_u8(out, p7); + +#undef dct_trn8_8 +#undef dct_trn8_16 +#undef dct_trn8_32 + } + +#undef dct_long_mul +#undef dct_long_mac +#undef dct_widen +#undef dct_wadd +#undef dct_wsub +#undef dct_bfly32o +#undef dct_pass +} + +#endif // STBI_NEON + +#define STBI__MARKER_none 0xff +// if there's a pending marker from the entropy stream, return that +// otherwise, fetch from the stream and get a marker. if there's no +// marker, return 0xff, which is never a valid marker value +static stbi_uc stbi__get_marker(stbi__jpeg *j) +{ + stbi_uc x; + if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; } + x = stbi__get8(j->s); + if (x != 0xff) return STBI__MARKER_none; + while (x == 0xff) + x = stbi__get8(j->s); + return x; +} + +// in each scan, we'll have scan_n components, and the order +// of the components is specified by order[] +#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) + +// after a restart interval, stbi__jpeg_reset the entropy decoder and +// the dc prediction +static void stbi__jpeg_reset(stbi__jpeg *j) +{ + j->code_bits = 0; + j->code_buffer = 0; + j->nomore = 0; + j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0; + j->marker = STBI__MARKER_none; + j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; + j->eob_run = 0; + // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, + // since we don't even allow 1<<30 pixels +} + +static int stbi__parse_entropy_coded_data(stbi__jpeg *z) +{ + stbi__jpeg_reset(z); + if (!z->progressive) { + if (z->scan_n == 1) { + int i,j; + STBI_SIMD_ALIGN(short, data[64]); + int n = z->order[0]; + // non-interleaved data, we just need to process one block at a time, + // in trivial scanline order + // number of blocks to do just depends on how many actual "pixels" this + // component has, independent of interleaved MCU blocking and such + int w = (z->img_comp[n].x+7) >> 3; + int h = (z->img_comp[n].y+7) >> 3; + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) { + int ha = z->img_comp[n].ha; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); + // every data block is an MCU, so countdown the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); + // if it's NOT a restart, then just bail, so we get corrupt data + // rather than no data + if (!STBI__RESTART(z->marker)) return 1; + stbi__jpeg_reset(z); + } + } + } + return 1; + } else { // interleaved + int i,j,k,x,y; + STBI_SIMD_ALIGN(short, data[64]); + for (j=0; j < z->img_mcu_y; ++j) { + for (i=0; i < z->img_mcu_x; ++i) { + // scan an interleaved mcu... process scan_n components in order + for (k=0; k < z->scan_n; ++k) { + int n = z->order[k]; + // scan out an mcu's worth of this component; that's just determined + // by the basic H and V specified for the component + for (y=0; y < z->img_comp[n].v; ++y) { + for (x=0; x < z->img_comp[n].h; ++x) { + int x2 = (i*z->img_comp[n].h + x)*8; + int y2 = (j*z->img_comp[n].v + y)*8; + int ha = z->img_comp[n].ha; + if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; + z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data); + } + } + } + // after all interleaved components, that's an interleaved MCU, + // so now count down the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); + if (!STBI__RESTART(z->marker)) return 1; + stbi__jpeg_reset(z); + } + } + } + return 1; + } + } else { + if (z->scan_n == 1) { + int i,j; + int n = z->order[0]; + // non-interleaved data, we just need to process one block at a time, + // in trivial scanline order + // number of blocks to do just depends on how many actual "pixels" this + // component has, independent of interleaved MCU blocking and such + int w = (z->img_comp[n].x+7) >> 3; + int h = (z->img_comp[n].y+7) >> 3; + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) { + short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); + if (z->spec_start == 0) { + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) + return 0; + } else { + int ha = z->img_comp[n].ha; + if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) + return 0; + } + // every data block is an MCU, so countdown the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); + if (!STBI__RESTART(z->marker)) return 1; + stbi__jpeg_reset(z); + } + } + } + return 1; + } else { // interleaved + int i,j,k,x,y; + for (j=0; j < z->img_mcu_y; ++j) { + for (i=0; i < z->img_mcu_x; ++i) { + // scan an interleaved mcu... process scan_n components in order + for (k=0; k < z->scan_n; ++k) { + int n = z->order[k]; + // scan out an mcu's worth of this component; that's just determined + // by the basic H and V specified for the component + for (y=0; y < z->img_comp[n].v; ++y) { + for (x=0; x < z->img_comp[n].h; ++x) { + int x2 = (i*z->img_comp[n].h + x); + int y2 = (j*z->img_comp[n].v + y); + short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); + if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) + return 0; + } + } + } + // after all interleaved components, that's an interleaved MCU, + // so now count down the restart interval + if (--z->todo <= 0) { + if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); + if (!STBI__RESTART(z->marker)) return 1; + stbi__jpeg_reset(z); + } + } + } + return 1; + } + } +} + +static void stbi__jpeg_dequantize(short *data, stbi_uc *dequant) +{ + int i; + for (i=0; i < 64; ++i) + data[i] *= dequant[i]; +} + +static void stbi__jpeg_finish(stbi__jpeg *z) +{ + if (z->progressive) { + // dequantize and idct the data + int i,j,n; + for (n=0; n < z->s->img_n; ++n) { + int w = (z->img_comp[n].x+7) >> 3; + int h = (z->img_comp[n].y+7) >> 3; + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) { + short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); + stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]); + z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); + } + } + } + } +} + +static int stbi__process_marker(stbi__jpeg *z, int m) +{ + int L; + switch (m) { + case STBI__MARKER_none: // no marker found + return stbi__err("expected marker","Corrupt JPEG"); + + case 0xDD: // DRI - specify restart interval + if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG"); + z->restart_interval = stbi__get16be(z->s); + return 1; + + case 0xDB: // DQT - define quantization table + L = stbi__get16be(z->s)-2; + while (L > 0) { + int q = stbi__get8(z->s); + int p = q >> 4; + int t = q & 15,i; + if (p != 0) return stbi__err("bad DQT type","Corrupt JPEG"); + if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG"); + for (i=0; i < 64; ++i) + z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s); + L -= 65; + } + return L==0; + + case 0xC4: // DHT - define huffman table + L = stbi__get16be(z->s)-2; + while (L > 0) { + stbi_uc *v; + int sizes[16],i,n=0; + int q = stbi__get8(z->s); + int tc = q >> 4; + int th = q & 15; + if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG"); + for (i=0; i < 16; ++i) { + sizes[i] = stbi__get8(z->s); + n += sizes[i]; + } + L -= 17; + if (tc == 0) { + if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0; + v = z->huff_dc[th].values; + } else { + if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0; + v = z->huff_ac[th].values; + } + for (i=0; i < n; ++i) + v[i] = stbi__get8(z->s); + if (tc != 0) + stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); + L -= n; + } + return L==0; + } + // check for comment block or APP blocks + if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { + stbi__skip(z->s, stbi__get16be(z->s)-2); + return 1; + } + return 0; +} + +// after we see SOS +static int stbi__process_scan_header(stbi__jpeg *z) +{ + int i; + int Ls = stbi__get16be(z->s); + z->scan_n = stbi__get8(z->s); + if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG"); + if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG"); + for (i=0; i < z->scan_n; ++i) { + int id = stbi__get8(z->s), which; + int q = stbi__get8(z->s); + for (which = 0; which < z->s->img_n; ++which) + if (z->img_comp[which].id == id) + break; + if (which == z->s->img_n) return 0; // no match + z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG"); + z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG"); + z->order[i] = which; + } + + { + int aa; + z->spec_start = stbi__get8(z->s); + z->spec_end = stbi__get8(z->s); // should be 63, but might be 0 + aa = stbi__get8(z->s); + z->succ_high = (aa >> 4); + z->succ_low = (aa & 15); + if (z->progressive) { + if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13) + return stbi__err("bad SOS", "Corrupt JPEG"); + } else { + if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG"); + if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG"); + z->spec_end = 63; + } + } + + return 1; +} + +static int stbi__process_frame_header(stbi__jpeg *z, int scan) +{ + stbi__context *s = z->s; + int Lf,p,i,q, h_max=1,v_max=1,c; + Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG + p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline + s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG + s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires + c = stbi__get8(s); + if (c != 3 && c != 1) return stbi__err("bad component count","Corrupt JPEG"); // JFIF requires + s->img_n = c; + for (i=0; i < c; ++i) { + z->img_comp[i].data = NULL; + z->img_comp[i].linebuf = NULL; + } + + if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG"); + + z->rgb = 0; + for (i=0; i < s->img_n; ++i) { + static unsigned char rgb[3] = { 'R', 'G', 'B' }; + z->img_comp[i].id = stbi__get8(s); + if (z->img_comp[i].id != i+1) // JFIF requires + if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files! + // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format) + if (z->img_comp[i].id != rgb[i]) + return stbi__err("bad component ID","Corrupt JPEG"); + ++z->rgb; + } + q = stbi__get8(s); + z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG"); + z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG"); + z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG"); + } + + if (scan != STBI__SCAN_load) return 1; + + if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); + + for (i=0; i < s->img_n; ++i) { + if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; + if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; + } + + // compute interleaved mcu info + z->img_h_max = h_max; + z->img_v_max = v_max; + z->img_mcu_w = h_max * 8; + z->img_mcu_h = v_max * 8; + z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; + z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; + + for (i=0; i < s->img_n; ++i) { + // number of effective pixels (e.g. for non-interleaved MCU) + z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; + z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; + // to simplify generation, we'll allocate enough memory to decode + // the bogus oversized data from using interleaved MCUs and their + // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't + // discard the extra data until colorspace conversion + z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; + z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; + z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); + + if (z->img_comp[i].raw_data == NULL) { + for(--i; i >= 0; --i) { + STBI_FREE(z->img_comp[i].raw_data); + z->img_comp[i].raw_data = NULL; + } + return stbi__err("outofmem", "Out of memory"); + } + // align blocks for idct using mmx/sse + z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); + z->img_comp[i].linebuf = NULL; + if (z->progressive) { + z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3; + z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3; + z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15); + z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); + } else { + z->img_comp[i].coeff = 0; + z->img_comp[i].raw_coeff = 0; + } + } + + return 1; +} + +// use comparisons since in some cases we handle more than one case (e.g. SOF) +#define stbi__DNL(x) ((x) == 0xdc) +#define stbi__SOI(x) ((x) == 0xd8) +#define stbi__EOI(x) ((x) == 0xd9) +#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2) +#define stbi__SOS(x) ((x) == 0xda) + +#define stbi__SOF_progressive(x) ((x) == 0xc2) + +static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) +{ + int m; + z->marker = STBI__MARKER_none; // initialize cached marker to empty + m = stbi__get_marker(z); + if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG"); + if (scan == STBI__SCAN_type) return 1; + m = stbi__get_marker(z); + while (!stbi__SOF(m)) { + if (!stbi__process_marker(z,m)) return 0; + m = stbi__get_marker(z); + while (m == STBI__MARKER_none) { + // some files have extra padding after their blocks, so ok, we'll scan + if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG"); + m = stbi__get_marker(z); + } + } + z->progressive = stbi__SOF_progressive(m); + if (!stbi__process_frame_header(z, scan)) return 0; + return 1; +} + +// decode image to YCbCr format +static int stbi__decode_jpeg_image(stbi__jpeg *j) +{ + int m; + for (m = 0; m < 4; m++) { + j->img_comp[m].raw_data = NULL; + j->img_comp[m].raw_coeff = NULL; + } + j->restart_interval = 0; + if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0; + m = stbi__get_marker(j); + while (!stbi__EOI(m)) { + if (stbi__SOS(m)) { + if (!stbi__process_scan_header(j)) return 0; + if (!stbi__parse_entropy_coded_data(j)) return 0; + if (j->marker == STBI__MARKER_none ) { + // handle 0s at the end of image data from IP Kamera 9060 + while (!stbi__at_eof(j->s)) { + int x = stbi__get8(j->s); + if (x == 255) { + j->marker = stbi__get8(j->s); + break; + } else if (x != 0) { + return stbi__err("junk before marker", "Corrupt JPEG"); + } + } + // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0 + } + } else { + if (!stbi__process_marker(j, m)) return 0; + } + m = stbi__get_marker(j); + } + if (j->progressive) + stbi__jpeg_finish(j); + return 1; +} + +// static jfif-centered resampling (across block boundaries) + +typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, + int w, int hs); + +#define stbi__div4(x) ((stbi_uc) ((x) >> 2)) + +static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + STBI_NOTUSED(out); + STBI_NOTUSED(in_far); + STBI_NOTUSED(w); + STBI_NOTUSED(hs); + return in_near; +} + +static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + // need to generate two samples vertically for every one in input + int i; + STBI_NOTUSED(hs); + for (i=0; i < w; ++i) + out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2); + return out; +} + +static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + // need to generate two samples horizontally for every one in input + int i; + stbi_uc *input = in_near; + + if (w == 1) { + // if only one sample, can't do any interpolation + out[0] = out[1] = input[0]; + return out; + } + + out[0] = input[0]; + out[1] = stbi__div4(input[0]*3 + input[1] + 2); + for (i=1; i < w-1; ++i) { + int n = 3*input[i]+2; + out[i*2+0] = stbi__div4(n+input[i-1]); + out[i*2+1] = stbi__div4(n+input[i+1]); + } + out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2); + out[i*2+1] = input[w-1]; + + STBI_NOTUSED(in_far); + STBI_NOTUSED(hs); + + return out; +} + +#define stbi__div16(x) ((stbi_uc) ((x) >> 4)) + +static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + // need to generate 2x2 samples for every one in input + int i,t0,t1; + if (w == 1) { + out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); + return out; + } + + t1 = 3*in_near[0] + in_far[0]; + out[0] = stbi__div4(t1+2); + for (i=1; i < w; ++i) { + t0 = t1; + t1 = 3*in_near[i]+in_far[i]; + out[i*2-1] = stbi__div16(3*t0 + t1 + 8); + out[i*2 ] = stbi__div16(3*t1 + t0 + 8); + } + out[w*2-1] = stbi__div4(t1+2); + + STBI_NOTUSED(hs); + + return out; +} + +#if defined(STBI_SSE2) || defined(STBI_NEON) +static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + // need to generate 2x2 samples for every one in input + int i=0,t0,t1; + + if (w == 1) { + out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); + return out; + } + + t1 = 3*in_near[0] + in_far[0]; + // process groups of 8 pixels for as long as we can. + // note we can't handle the last pixel in a row in this loop + // because we need to handle the filter boundary conditions. + for (; i < ((w-1) & ~7); i += 8) { +#if defined(STBI_SSE2) + // load and perform the vertical filtering pass + // this uses 3*x + y = 4*x + (y - x) + __m128i zero = _mm_setzero_si128(); + __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i)); + __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i)); + __m128i farw = _mm_unpacklo_epi8(farb, zero); + __m128i nearw = _mm_unpacklo_epi8(nearb, zero); + __m128i diff = _mm_sub_epi16(farw, nearw); + __m128i nears = _mm_slli_epi16(nearw, 2); + __m128i curr = _mm_add_epi16(nears, diff); // current row + + // horizontal filter works the same based on shifted vers of current + // row. "prev" is current row shifted right by 1 pixel; we need to + // insert the previous pixel value (from t1). + // "next" is current row shifted left by 1 pixel, with first pixel + // of next block of 8 pixels added in. + __m128i prv0 = _mm_slli_si128(curr, 2); + __m128i nxt0 = _mm_srli_si128(curr, 2); + __m128i prev = _mm_insert_epi16(prv0, t1, 0); + __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7); + + // horizontal filter, polyphase implementation since it's convenient: + // even pixels = 3*cur + prev = cur*4 + (prev - cur) + // odd pixels = 3*cur + next = cur*4 + (next - cur) + // note the shared term. + __m128i bias = _mm_set1_epi16(8); + __m128i curs = _mm_slli_epi16(curr, 2); + __m128i prvd = _mm_sub_epi16(prev, curr); + __m128i nxtd = _mm_sub_epi16(next, curr); + __m128i curb = _mm_add_epi16(curs, bias); + __m128i even = _mm_add_epi16(prvd, curb); + __m128i odd = _mm_add_epi16(nxtd, curb); + + // interleave even and odd pixels, then undo scaling. + __m128i int0 = _mm_unpacklo_epi16(even, odd); + __m128i int1 = _mm_unpackhi_epi16(even, odd); + __m128i de0 = _mm_srli_epi16(int0, 4); + __m128i de1 = _mm_srli_epi16(int1, 4); + + // pack and write output + __m128i outv = _mm_packus_epi16(de0, de1); + _mm_storeu_si128((__m128i *) (out + i*2), outv); +#elif defined(STBI_NEON) + // load and perform the vertical filtering pass + // this uses 3*x + y = 4*x + (y - x) + uint8x8_t farb = vld1_u8(in_far + i); + uint8x8_t nearb = vld1_u8(in_near + i); + int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb)); + int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2)); + int16x8_t curr = vaddq_s16(nears, diff); // current row + + // horizontal filter works the same based on shifted vers of current + // row. "prev" is current row shifted right by 1 pixel; we need to + // insert the previous pixel value (from t1). + // "next" is current row shifted left by 1 pixel, with first pixel + // of next block of 8 pixels added in. + int16x8_t prv0 = vextq_s16(curr, curr, 7); + int16x8_t nxt0 = vextq_s16(curr, curr, 1); + int16x8_t prev = vsetq_lane_s16(t1, prv0, 0); + int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7); + + // horizontal filter, polyphase implementation since it's convenient: + // even pixels = 3*cur + prev = cur*4 + (prev - cur) + // odd pixels = 3*cur + next = cur*4 + (next - cur) + // note the shared term. + int16x8_t curs = vshlq_n_s16(curr, 2); + int16x8_t prvd = vsubq_s16(prev, curr); + int16x8_t nxtd = vsubq_s16(next, curr); + int16x8_t even = vaddq_s16(curs, prvd); + int16x8_t odd = vaddq_s16(curs, nxtd); + + // undo scaling and round, then store with even/odd phases interleaved + uint8x8x2_t o; + o.val[0] = vqrshrun_n_s16(even, 4); + o.val[1] = vqrshrun_n_s16(odd, 4); + vst2_u8(out + i*2, o); +#endif + + // "previous" value for next iter + t1 = 3*in_near[i+7] + in_far[i+7]; + } + + t0 = t1; + t1 = 3*in_near[i] + in_far[i]; + out[i*2] = stbi__div16(3*t1 + t0 + 8); + + for (++i; i < w; ++i) { + t0 = t1; + t1 = 3*in_near[i]+in_far[i]; + out[i*2-1] = stbi__div16(3*t0 + t1 + 8); + out[i*2 ] = stbi__div16(3*t1 + t0 + 8); + } + out[w*2-1] = stbi__div4(t1+2); + + STBI_NOTUSED(hs); + + return out; +} +#endif + +static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) +{ + // resample with nearest-neighbor + int i,j; + STBI_NOTUSED(in_far); + for (i=0; i < w; ++i) + for (j=0; j < hs; ++j) + out[i*hs+j] = in_near[i]; + return out; +} + +#ifdef STBI_JPEG_OLD +// this is the same YCbCr-to-RGB calculation that stb_image has used +// historically before the algorithm changes in 1.49 +#define float2fixed(x) ((int) ((x) * 65536 + 0.5)) +static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) +{ + int i; + for (i=0; i < count; ++i) { + int y_fixed = (y[i] << 16) + 32768; // rounding + int r,g,b; + int cr = pcr[i] - 128; + int cb = pcb[i] - 128; + r = y_fixed + cr*float2fixed(1.40200f); + g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f); + b = y_fixed + cb*float2fixed(1.77200f); + r >>= 16; + g >>= 16; + b >>= 16; + if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } + if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } + if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } + out[0] = (stbi_uc)r; + out[1] = (stbi_uc)g; + out[2] = (stbi_uc)b; + out[3] = 255; + out += step; + } +} +#else +// this is a reduced-precision calculation of YCbCr-to-RGB introduced +// to make sure the code produces the same results in both SIMD and scalar +#define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) +static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) +{ + int i; + for (i=0; i < count; ++i) { + int y_fixed = (y[i] << 20) + (1<<19); // rounding + int r,g,b; + int cr = pcr[i] - 128; + int cb = pcb[i] - 128; + r = y_fixed + cr* float2fixed(1.40200f); + g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); + b = y_fixed + cb* float2fixed(1.77200f); + r >>= 20; + g >>= 20; + b >>= 20; + if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } + if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } + if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } + out[0] = (stbi_uc)r; + out[1] = (stbi_uc)g; + out[2] = (stbi_uc)b; + out[3] = 255; + out += step; + } +} +#endif + +#if defined(STBI_SSE2) || defined(STBI_NEON) +static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step) +{ + int i = 0; + +#ifdef STBI_SSE2 + // step == 3 is pretty ugly on the final interleave, and i'm not convinced + // it's useful in practice (you wouldn't use it for textures, for example). + // so just accelerate step == 4 case. + if (step == 4) { + // this is a fairly straightforward implementation and not super-optimized. + __m128i signflip = _mm_set1_epi8(-0x80); + __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f)); + __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f)); + __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f)); + __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f)); + __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128); + __m128i xw = _mm_set1_epi16(255); // alpha channel + + for (; i+7 < count; i += 8) { + // load + __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i)); + __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i)); + __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i)); + __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128 + __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128 + + // unpack to short (and left-shift cr, cb by 8) + __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes); + __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased); + __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased); + + // color transform + __m128i yws = _mm_srli_epi16(yw, 4); + __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw); + __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw); + __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1); + __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1); + __m128i rws = _mm_add_epi16(cr0, yws); + __m128i gwt = _mm_add_epi16(cb0, yws); + __m128i bws = _mm_add_epi16(yws, cb1); + __m128i gws = _mm_add_epi16(gwt, cr1); + + // descale + __m128i rw = _mm_srai_epi16(rws, 4); + __m128i bw = _mm_srai_epi16(bws, 4); + __m128i gw = _mm_srai_epi16(gws, 4); + + // back to byte, set up for transpose + __m128i brb = _mm_packus_epi16(rw, bw); + __m128i gxb = _mm_packus_epi16(gw, xw); + + // transpose to interleave channels + __m128i t0 = _mm_unpacklo_epi8(brb, gxb); + __m128i t1 = _mm_unpackhi_epi8(brb, gxb); + __m128i o0 = _mm_unpacklo_epi16(t0, t1); + __m128i o1 = _mm_unpackhi_epi16(t0, t1); + + // store + _mm_storeu_si128((__m128i *) (out + 0), o0); + _mm_storeu_si128((__m128i *) (out + 16), o1); + out += 32; + } + } +#endif + +#ifdef STBI_NEON + // in this version, step=3 support would be easy to add. but is there demand? + if (step == 4) { + // this is a fairly straightforward implementation and not super-optimized. + uint8x8_t signflip = vdup_n_u8(0x80); + int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f)); + int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f)); + int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f)); + int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f)); + + for (; i+7 < count; i += 8) { + // load + uint8x8_t y_bytes = vld1_u8(y + i); + uint8x8_t cr_bytes = vld1_u8(pcr + i); + uint8x8_t cb_bytes = vld1_u8(pcb + i); + int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip)); + int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip)); + + // expand to s16 + int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4)); + int16x8_t crw = vshll_n_s8(cr_biased, 7); + int16x8_t cbw = vshll_n_s8(cb_biased, 7); + + // color transform + int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0); + int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0); + int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1); + int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1); + int16x8_t rws = vaddq_s16(yws, cr0); + int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1); + int16x8_t bws = vaddq_s16(yws, cb1); + + // undo scaling, round, convert to byte + uint8x8x4_t o; + o.val[0] = vqrshrun_n_s16(rws, 4); + o.val[1] = vqrshrun_n_s16(gws, 4); + o.val[2] = vqrshrun_n_s16(bws, 4); + o.val[3] = vdup_n_u8(255); + + // store, interleaving r/g/b/a + vst4_u8(out, o); + out += 8*4; + } + } +#endif + + for (; i < count; ++i) { + int y_fixed = (y[i] << 20) + (1<<19); // rounding + int r,g,b; + int cr = pcr[i] - 128; + int cb = pcb[i] - 128; + r = y_fixed + cr* float2fixed(1.40200f); + g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); + b = y_fixed + cb* float2fixed(1.77200f); + r >>= 20; + g >>= 20; + b >>= 20; + if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } + if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } + if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } + out[0] = (stbi_uc)r; + out[1] = (stbi_uc)g; + out[2] = (stbi_uc)b; + out[3] = 255; + out += step; + } +} +#endif + +// set up the kernels +static void stbi__setup_jpeg(stbi__jpeg *j) +{ + j->idct_block_kernel = stbi__idct_block; + j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row; + j->resample_row_hv_2_kernel = stbi__resample_row_hv_2; + +#ifdef STBI_SSE2 + if (stbi__sse2_available()) { + j->idct_block_kernel = stbi__idct_simd; + #ifndef STBI_JPEG_OLD + j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; + #endif + j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; + } +#endif + +#ifdef STBI_NEON + j->idct_block_kernel = stbi__idct_simd; + #ifndef STBI_JPEG_OLD + j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; + #endif + j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; +#endif +} + +// clean up the temporary component buffers +static void stbi__cleanup_jpeg(stbi__jpeg *j) +{ + int i; + for (i=0; i < j->s->img_n; ++i) { + if (j->img_comp[i].raw_data) { + STBI_FREE(j->img_comp[i].raw_data); + j->img_comp[i].raw_data = NULL; + j->img_comp[i].data = NULL; + } + if (j->img_comp[i].raw_coeff) { + STBI_FREE(j->img_comp[i].raw_coeff); + j->img_comp[i].raw_coeff = 0; + j->img_comp[i].coeff = 0; + } + if (j->img_comp[i].linebuf) { + STBI_FREE(j->img_comp[i].linebuf); + j->img_comp[i].linebuf = NULL; + } + } +} + +typedef struct +{ + resample_row_func resample; + stbi_uc *line0,*line1; + int hs,vs; // expansion factor in each axis + int w_lores; // horizontal pixels pre-expansion + int ystep; // how far through vertical expansion we are + int ypos; // which pre-expansion row we're on +} stbi__resample; + +static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) +{ + int n, decode_n; + z->s->img_n = 0; // make stbi__cleanup_jpeg safe + + // validate req_comp + if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); + + // load a jpeg image from whichever source, but leave in YCbCr format + if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; } + + // determine actual number of components to generate + n = req_comp ? req_comp : z->s->img_n; + + if (z->s->img_n == 3 && n < 3) + decode_n = 1; + else + decode_n = z->s->img_n; + + // resample and color-convert + { + int k; + unsigned int i,j; + stbi_uc *output; + stbi_uc *coutput[4]; + + stbi__resample res_comp[4]; + + for (k=0; k < decode_n; ++k) { + stbi__resample *r = &res_comp[k]; + + // allocate line buffer big enough for upsampling off the edges + // with upsample factor of 4 + z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3); + if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } + + r->hs = z->img_h_max / z->img_comp[k].h; + r->vs = z->img_v_max / z->img_comp[k].v; + r->ystep = r->vs >> 1; + r->w_lores = (z->s->img_x + r->hs-1) / r->hs; + r->ypos = 0; + r->line0 = r->line1 = z->img_comp[k].data; + + if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; + else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; + else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2; + else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel; + else r->resample = stbi__resample_row_generic; + } + + // can't error after this so, this is safe + output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1); + if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } + + // now go ahead and resample + for (j=0; j < z->s->img_y; ++j) { + stbi_uc *out = output + n * z->s->img_x * j; + for (k=0; k < decode_n; ++k) { + stbi__resample *r = &res_comp[k]; + int y_bot = r->ystep >= (r->vs >> 1); + coutput[k] = r->resample(z->img_comp[k].linebuf, + y_bot ? r->line1 : r->line0, + y_bot ? r->line0 : r->line1, + r->w_lores, r->hs); + if (++r->ystep >= r->vs) { + r->ystep = 0; + r->line0 = r->line1; + if (++r->ypos < z->img_comp[k].y) + r->line1 += z->img_comp[k].w2; + } + } + if (n >= 3) { + stbi_uc *y = coutput[0]; + if (z->s->img_n == 3) { + if (z->rgb == 3) { + for (i=0; i < z->s->img_x; ++i) { + out[0] = y[i]; + out[1] = coutput[1][i]; + out[2] = coutput[2][i]; + out[3] = 255; + out += n; + } + } else { + z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); + } + } else + for (i=0; i < z->s->img_x; ++i) { + out[0] = out[1] = out[2] = y[i]; + out[3] = 255; // not used if n==3 + out += n; + } + } else { + stbi_uc *y = coutput[0]; + if (n == 1) + for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; + else + for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255; + } + } + stbi__cleanup_jpeg(z); + *out_x = z->s->img_x; + *out_y = z->s->img_y; + if (comp) *comp = z->s->img_n; // report original components, not output + return output; + } +} + +static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + unsigned char* result; + stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); + j->s = s; + stbi__setup_jpeg(j); + result = load_jpeg_image(j, x,y,comp,req_comp); + STBI_FREE(j); + return result; +} + +static int stbi__jpeg_test(stbi__context *s) +{ + int r; + stbi__jpeg j; + j.s = s; + stbi__setup_jpeg(&j); + r = stbi__decode_jpeg_header(&j, STBI__SCAN_type); + stbi__rewind(s); + return r; +} + +static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp) +{ + if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) { + stbi__rewind( j->s ); + return 0; + } + if (x) *x = j->s->img_x; + if (y) *y = j->s->img_y; + if (comp) *comp = j->s->img_n; + return 1; +} + +static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) +{ + int result; + stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); + j->s = s; + result = stbi__jpeg_info_raw(j, x, y, comp); + STBI_FREE(j); + return result; +} +#endif + +// public domain zlib decode v0.2 Sean Barrett 2006-11-18 +// simple implementation +// - all input must be provided in an upfront buffer +// - all output is written to a single output buffer (can malloc/realloc) +// performance +// - fast huffman + +#ifndef STBI_NO_ZLIB + +// fast-way is faster to check than jpeg huffman, but slow way is slower +#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables +#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) + +// zlib-style huffman encoding +// (jpegs packs from left, zlib from right, so can't share code) +typedef struct +{ + stbi__uint16 fast[1 << STBI__ZFAST_BITS]; + stbi__uint16 firstcode[16]; + int maxcode[17]; + stbi__uint16 firstsymbol[16]; + stbi_uc size[288]; + stbi__uint16 value[288]; +} stbi__zhuffman; + +stbi_inline static int stbi__bitreverse16(int n) +{ + n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); + n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); + n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); + n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); + return n; +} + +stbi_inline static int stbi__bit_reverse(int v, int bits) +{ + STBI_ASSERT(bits <= 16); + // to bit reverse n bits, reverse 16 and shift + // e.g. 11 bits, bit reverse and shift away 5 + return stbi__bitreverse16(v) >> (16-bits); +} + +static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num) +{ + int i,k=0; + int code, next_code[16], sizes[17]; + + // DEFLATE spec for generating codes + memset(sizes, 0, sizeof(sizes)); + memset(z->fast, 0, sizeof(z->fast)); + for (i=0; i < num; ++i) + ++sizes[sizelist[i]]; + sizes[0] = 0; + for (i=1; i < 16; ++i) + if (sizes[i] > (1 << i)) + return stbi__err("bad sizes", "Corrupt PNG"); + code = 0; + for (i=1; i < 16; ++i) { + next_code[i] = code; + z->firstcode[i] = (stbi__uint16) code; + z->firstsymbol[i] = (stbi__uint16) k; + code = (code + sizes[i]); + if (sizes[i]) + if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG"); + z->maxcode[i] = code << (16-i); // preshift for inner loop + code <<= 1; + k += sizes[i]; + } + z->maxcode[16] = 0x10000; // sentinel + for (i=0; i < num; ++i) { + int s = sizelist[i]; + if (s) { + int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; + stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i); + z->size [c] = (stbi_uc ) s; + z->value[c] = (stbi__uint16) i; + if (s <= STBI__ZFAST_BITS) { + int j = stbi__bit_reverse(next_code[s],s); + while (j < (1 << STBI__ZFAST_BITS)) { + z->fast[j] = fastv; + j += (1 << s); + } + } + ++next_code[s]; + } + } + return 1; +} + +// zlib-from-memory implementation for PNG reading +// because PNG allows splitting the zlib stream arbitrarily, +// and it's annoying structurally to have PNG call ZLIB call PNG, +// we require PNG read all the IDATs and combine them into a single +// memory buffer + +typedef struct +{ + stbi_uc *zbuffer, *zbuffer_end; + int num_bits; + stbi__uint32 code_buffer; + + char *zout; + char *zout_start; + char *zout_end; + int z_expandable; + + stbi__zhuffman z_length, z_distance; +} stbi__zbuf; + +stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z) +{ + if (z->zbuffer >= z->zbuffer_end) return 0; + return *z->zbuffer++; +} + +static void stbi__fill_bits(stbi__zbuf *z) +{ + do { + STBI_ASSERT(z->code_buffer < (1U << z->num_bits)); + z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; + z->num_bits += 8; + } while (z->num_bits <= 24); +} + +stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n) +{ + unsigned int k; + if (z->num_bits < n) stbi__fill_bits(z); + k = z->code_buffer & ((1 << n) - 1); + z->code_buffer >>= n; + z->num_bits -= n; + return k; +} + +static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) +{ + int b,s,k; + // not resolved by fast table, so compute it the slow way + // use jpeg approach, which requires MSbits at top + k = stbi__bit_reverse(a->code_buffer, 16); + for (s=STBI__ZFAST_BITS+1; ; ++s) + if (k < z->maxcode[s]) + break; + if (s == 16) return -1; // invalid code! + // code size is s, so: + b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; + STBI_ASSERT(z->size[b] == s); + a->code_buffer >>= s; + a->num_bits -= s; + return z->value[b]; +} + +stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) +{ + int b,s; + if (a->num_bits < 16) stbi__fill_bits(a); + b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; + if (b) { + s = b >> 9; + a->code_buffer >>= s; + a->num_bits -= s; + return b & 511; + } + return stbi__zhuffman_decode_slowpath(a, z); +} + +static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes +{ + char *q; + int cur, limit, old_limit; + z->zout = zout; + if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); + cur = (int) (z->zout - z->zout_start); + limit = old_limit = (int) (z->zout_end - z->zout_start); + while (cur + n > limit) + limit *= 2; + q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); + STBI_NOTUSED(old_limit); + if (q == NULL) return stbi__err("outofmem", "Out of memory"); + z->zout_start = q; + z->zout = q + cur; + z->zout_end = q + limit; + return 1; +} + +static int stbi__zlength_base[31] = { + 3,4,5,6,7,8,9,10,11,13, + 15,17,19,23,27,31,35,43,51,59, + 67,83,99,115,131,163,195,227,258,0,0 }; + +static int stbi__zlength_extra[31]= +{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + +static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, +257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + +static int stbi__zdist_extra[32] = +{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +static int stbi__parse_huffman_block(stbi__zbuf *a) +{ + char *zout = a->zout; + for(;;) { + int z = stbi__zhuffman_decode(a, &a->z_length); + if (z < 256) { + if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes + if (zout >= a->zout_end) { + if (!stbi__zexpand(a, zout, 1)) return 0; + zout = a->zout; + } + *zout++ = (char) z; + } else { + stbi_uc *p; + int len,dist; + if (z == 256) { + a->zout = zout; + return 1; + } + z -= 257; + len = stbi__zlength_base[z]; + if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); + z = stbi__zhuffman_decode(a, &a->z_distance); + if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); + dist = stbi__zdist_base[z]; + if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); + if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); + if (zout + len > a->zout_end) { + if (!stbi__zexpand(a, zout, len)) return 0; + zout = a->zout; + } + p = (stbi_uc *) (zout - dist); + if (dist == 1) { // run of one byte; common in images. + stbi_uc v = *p; + if (len) { do *zout++ = v; while (--len); } + } else { + if (len) { do *zout++ = *p++; while (--len); } + } + } + } +} + +static int stbi__compute_huffman_codes(stbi__zbuf *a) +{ + static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + stbi__zhuffman z_codelength; + stbi_uc lencodes[286+32+137];//padding for maximum single op + stbi_uc codelength_sizes[19]; + int i,n; + + int hlit = stbi__zreceive(a,5) + 257; + int hdist = stbi__zreceive(a,5) + 1; + int hclen = stbi__zreceive(a,4) + 4; + + memset(codelength_sizes, 0, sizeof(codelength_sizes)); + for (i=0; i < hclen; ++i) { + int s = stbi__zreceive(a,3); + codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; + } + if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; + + n = 0; + while (n < hlit + hdist) { + int c = stbi__zhuffman_decode(a, &z_codelength); + if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); + if (c < 16) + lencodes[n++] = (stbi_uc) c; + else if (c == 16) { + c = stbi__zreceive(a,2)+3; + memset(lencodes+n, lencodes[n-1], c); + n += c; + } else if (c == 17) { + c = stbi__zreceive(a,3)+3; + memset(lencodes+n, 0, c); + n += c; + } else { + STBI_ASSERT(c == 18); + c = stbi__zreceive(a,7)+11; + memset(lencodes+n, 0, c); + n += c; + } + } + if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); + if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; + if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; + return 1; +} + +static int stbi__parse_uncompressed_block(stbi__zbuf *a) +{ + stbi_uc header[4]; + int len,nlen,k; + if (a->num_bits & 7) + stbi__zreceive(a, a->num_bits & 7); // discard + // drain the bit-packed data into header + k = 0; + while (a->num_bits > 0) { + header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check + a->code_buffer >>= 8; + a->num_bits -= 8; + } + STBI_ASSERT(a->num_bits == 0); + // now fill header the normal way + while (k < 4) + header[k++] = stbi__zget8(a); + len = header[1] * 256 + header[0]; + nlen = header[3] * 256 + header[2]; + if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); + if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); + if (a->zout + len > a->zout_end) + if (!stbi__zexpand(a, a->zout, len)) return 0; + memcpy(a->zout, a->zbuffer, len); + a->zbuffer += len; + a->zout += len; + return 1; +} + +static int stbi__parse_zlib_header(stbi__zbuf *a) +{ + int cmf = stbi__zget8(a); + int cm = cmf & 15; + /* int cinfo = cmf >> 4; */ + int flg = stbi__zget8(a); + if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec + if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png + if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png + // window = 1 << (8 + cinfo)... but who cares, we fully buffer output + return 1; +} + +// @TODO: should statically initialize these for optimal thread safety +static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32]; +static void stbi__init_zdefaults(void) +{ + int i; // use <= to match clearly with spec + for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8; + for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9; + for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7; + for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8; + + for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5; +} + +static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) +{ + int final, type; + if (parse_header) + if (!stbi__parse_zlib_header(a)) return 0; + a->num_bits = 0; + a->code_buffer = 0; + do { + final = stbi__zreceive(a,1); + type = stbi__zreceive(a,2); + if (type == 0) { + if (!stbi__parse_uncompressed_block(a)) return 0; + } else if (type == 3) { + return 0; + } else { + if (type == 1) { + // use fixed code lengths + if (!stbi__zdefault_distance[31]) stbi__init_zdefaults(); + if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0; + if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; + } else { + if (!stbi__compute_huffman_codes(a)) return 0; + } + if (!stbi__parse_huffman_block(a)) return 0; + } + } while (!final); + return 1; +} + +static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header) +{ + a->zout_start = obuf; + a->zout = obuf; + a->zout_end = obuf + olen; + a->z_expandable = exp; + + return stbi__parse_zlib(a, parse_header); +} + +STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) +{ + stbi__zbuf a; + char *p = (char *) stbi__malloc(initial_size); + if (p == NULL) return NULL; + a.zbuffer = (stbi_uc *) buffer; + a.zbuffer_end = (stbi_uc *) buffer + len; + if (stbi__do_zlib(&a, p, initial_size, 1, 1)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + STBI_FREE(a.zout_start); + return NULL; + } +} + +STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) +{ + return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); +} + +STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) +{ + stbi__zbuf a; + char *p = (char *) stbi__malloc(initial_size); + if (p == NULL) return NULL; + a.zbuffer = (stbi_uc *) buffer; + a.zbuffer_end = (stbi_uc *) buffer + len; + if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + STBI_FREE(a.zout_start); + return NULL; + } +} + +STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) +{ + stbi__zbuf a; + a.zbuffer = (stbi_uc *) ibuffer; + a.zbuffer_end = (stbi_uc *) ibuffer + ilen; + if (stbi__do_zlib(&a, obuffer, olen, 0, 1)) + return (int) (a.zout - a.zout_start); + else + return -1; +} + +STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) +{ + stbi__zbuf a; + char *p = (char *) stbi__malloc(16384); + if (p == NULL) return NULL; + a.zbuffer = (stbi_uc *) buffer; + a.zbuffer_end = (stbi_uc *) buffer+len; + if (stbi__do_zlib(&a, p, 16384, 1, 0)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + STBI_FREE(a.zout_start); + return NULL; + } +} + +STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) +{ + stbi__zbuf a; + a.zbuffer = (stbi_uc *) ibuffer; + a.zbuffer_end = (stbi_uc *) ibuffer + ilen; + if (stbi__do_zlib(&a, obuffer, olen, 0, 0)) + return (int) (a.zout - a.zout_start); + else + return -1; +} +#endif + +// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 +// simple implementation +// - only 8-bit samples +// - no CRC checking +// - allocates lots of intermediate memory +// - avoids problem of streaming data between subsystems +// - avoids explicit window management +// performance +// - uses stb_zlib, a PD zlib implementation with fast huffman decoding + +#ifndef STBI_NO_PNG +typedef struct +{ + stbi__uint32 length; + stbi__uint32 type; +} stbi__pngchunk; + +static stbi__pngchunk stbi__get_chunk_header(stbi__context *s) +{ + stbi__pngchunk c; + c.length = stbi__get32be(s); + c.type = stbi__get32be(s); + return c; +} + +static int stbi__check_png_header(stbi__context *s) +{ + static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 }; + int i; + for (i=0; i < 8; ++i) + if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG"); + return 1; +} + +typedef struct +{ + stbi__context *s; + stbi_uc *idata, *expanded, *out; + int depth; +} stbi__png; + + +enum { + STBI__F_none=0, + STBI__F_sub=1, + STBI__F_up=2, + STBI__F_avg=3, + STBI__F_paeth=4, + // synthetic filters used for first scanline to avoid needing a dummy row of 0s + STBI__F_avg_first, + STBI__F_paeth_first +}; + +static stbi_uc first_row_filter[5] = +{ + STBI__F_none, + STBI__F_sub, + STBI__F_none, + STBI__F_avg_first, + STBI__F_paeth_first +}; + +static int stbi__paeth(int a, int b, int c) +{ + int p = a + b - c; + int pa = abs(p-a); + int pb = abs(p-b); + int pc = abs(p-c); + if (pa <= pb && pa <= pc) return a; + if (pb <= pc) return b; + return c; +} + +static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; + +// create the png data from post-deflated data +static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) +{ + int bytes = (depth == 16? 2 : 1); + stbi__context *s = a->s; + stbi__uint32 i,j,stride = x*out_n*bytes; + stbi__uint32 img_len, img_width_bytes; + int k; + int img_n = s->img_n; // copy it into a local for later + + int output_bytes = out_n*bytes; + int filter_bytes = img_n*bytes; + int width = x; + + STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); + a->out = (stbi_uc *) stbi__malloc(x * y * output_bytes); // extra bytes to write off the end into + if (!a->out) return stbi__err("outofmem", "Out of memory"); + + img_width_bytes = (((img_n * x * depth) + 7) >> 3); + img_len = (img_width_bytes + 1) * y; + if (s->img_x == x && s->img_y == y) { + if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG"); + } else { // interlaced: + if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); + } + + for (j=0; j < y; ++j) { + stbi_uc *cur = a->out + stride*j; + stbi_uc *prior = cur - stride; + int filter = *raw++; + + if (filter > 4) + return stbi__err("invalid filter","Corrupt PNG"); + + if (depth < 8) { + STBI_ASSERT(img_width_bytes <= x); + cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place + filter_bytes = 1; + width = img_width_bytes; + } + + // if first row, use special filter that doesn't sample previous row + if (j == 0) filter = first_row_filter[filter]; + + // handle first byte explicitly + for (k=0; k < filter_bytes; ++k) { + switch (filter) { + case STBI__F_none : cur[k] = raw[k]; break; + case STBI__F_sub : cur[k] = raw[k]; break; + case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; + case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; + case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; + case STBI__F_avg_first : cur[k] = raw[k]; break; + case STBI__F_paeth_first: cur[k] = raw[k]; break; + } + } + + if (depth == 8) { + if (img_n != out_n) + cur[img_n] = 255; // first pixel + raw += img_n; + cur += out_n; + prior += out_n; + } else if (depth == 16) { + if (img_n != out_n) { + cur[filter_bytes] = 255; // first pixel top byte + cur[filter_bytes+1] = 255; // first pixel bottom byte + } + raw += filter_bytes; + cur += output_bytes; + prior += output_bytes; + } else { + raw += 1; + cur += 1; + prior += 1; + } + + // this is a little gross, so that we don't switch per-pixel or per-component + if (depth < 8 || img_n == out_n) { + int nk = (width - 1)*filter_bytes; + #define CASE(f) \ + case f: \ + for (k=0; k < nk; ++k) + switch (filter) { + // "none" filter turns into a memcpy here; make that explicit. + case STBI__F_none: memcpy(cur, raw, nk); break; + CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break; + CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; + CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break; + CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break; + CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break; + CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break; + } + #undef CASE + raw += nk; + } else { + STBI_ASSERT(img_n+1 == out_n); + #define CASE(f) \ + case f: \ + for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ + for (k=0; k < filter_bytes; ++k) + switch (filter) { + CASE(STBI__F_none) cur[k] = raw[k]; break; + CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; + CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; + CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; + CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; + CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; + CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; + } + #undef CASE + + // the loop above sets the high byte of the pixels' alpha, but for + // 16 bit png files we also need the low byte set. we'll do that here. + if (depth == 16) { + cur = a->out + stride*j; // start at the beginning of the row again + for (i=0; i < x; ++i,cur+=output_bytes) { + cur[filter_bytes+1] = 255; + } + } + } + } + + // we make a separate pass to expand bits to pixels; for performance, + // this could run two scanlines behind the above code, so it won't + // intefere with filtering but will still be in the cache. + if (depth < 8) { + for (j=0; j < y; ++j) { + stbi_uc *cur = a->out + stride*j; + stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; + // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit + // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop + stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range + + // note that the final byte might overshoot and write more data than desired. + // we can allocate enough data that this never writes out of memory, but it + // could also overwrite the next scanline. can it overwrite non-empty data + // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. + // so we need to explicitly clamp the final ones + + if (depth == 4) { + for (k=x*img_n; k >= 2; k-=2, ++in) { + *cur++ = scale * ((*in >> 4) ); + *cur++ = scale * ((*in ) & 0x0f); + } + if (k > 0) *cur++ = scale * ((*in >> 4) ); + } else if (depth == 2) { + for (k=x*img_n; k >= 4; k-=4, ++in) { + *cur++ = scale * ((*in >> 6) ); + *cur++ = scale * ((*in >> 4) & 0x03); + *cur++ = scale * ((*in >> 2) & 0x03); + *cur++ = scale * ((*in ) & 0x03); + } + if (k > 0) *cur++ = scale * ((*in >> 6) ); + if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); + if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); + } else if (depth == 1) { + for (k=x*img_n; k >= 8; k-=8, ++in) { + *cur++ = scale * ((*in >> 7) ); + *cur++ = scale * ((*in >> 6) & 0x01); + *cur++ = scale * ((*in >> 5) & 0x01); + *cur++ = scale * ((*in >> 4) & 0x01); + *cur++ = scale * ((*in >> 3) & 0x01); + *cur++ = scale * ((*in >> 2) & 0x01); + *cur++ = scale * ((*in >> 1) & 0x01); + *cur++ = scale * ((*in ) & 0x01); + } + if (k > 0) *cur++ = scale * ((*in >> 7) ); + if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); + if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); + if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); + if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); + if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); + if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); + } + if (img_n != out_n) { + int q; + // insert alpha = 255 + cur = a->out + stride*j; + if (img_n == 1) { + for (q=x-1; q >= 0; --q) { + cur[q*2+1] = 255; + cur[q*2+0] = cur[q]; + } + } else { + STBI_ASSERT(img_n == 3); + for (q=x-1; q >= 0; --q) { + cur[q*4+3] = 255; + cur[q*4+2] = cur[q*3+2]; + cur[q*4+1] = cur[q*3+1]; + cur[q*4+0] = cur[q*3+0]; + } + } + } + } + } else if (depth == 16) { + // force the image data from big-endian to platform-native. + // this is done in a separate pass due to the decoding relying + // on the data being untouched, but could probably be done + // per-line during decode if care is taken. + stbi_uc *cur = a->out; + stbi__uint16 *cur16 = (stbi__uint16*)cur; + + for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { + *cur16 = (cur[0] << 8) | cur[1]; + } + } + + return 1; +} + +static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) +{ + stbi_uc *final; + int p; + if (!interlaced) + return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); + + // de-interlacing + final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n); + for (p=0; p < 7; ++p) { + int xorig[] = { 0,4,0,2,0,1,0 }; + int yorig[] = { 0,0,4,0,2,0,1 }; + int xspc[] = { 8,8,4,4,2,2,1 }; + int yspc[] = { 8,8,8,4,4,2,2 }; + int i,j,x,y; + // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 + x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; + y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; + if (x && y) { + stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y; + if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) { + STBI_FREE(final); + return 0; + } + for (j=0; j < y; ++j) { + for (i=0; i < x; ++i) { + int out_y = j*yspc[p]+yorig[p]; + int out_x = i*xspc[p]+xorig[p]; + memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n, + a->out + (j*x+i)*out_n, out_n); + } + } + STBI_FREE(a->out); + image_data += img_len; + image_data_len -= img_len; + } + } + a->out = final; + + return 1; +} + +static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi_uc *p = z->out; + + // compute color-based transparency, assuming we've + // already got 255 as the alpha value in the output + STBI_ASSERT(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i=0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 255); + p += 2; + } + } else { + for (i=0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + +static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi__uint16 *p = (stbi__uint16*) z->out; + + // compute color-based transparency, assuming we've + // already got 65535 as the alpha value in the output + STBI_ASSERT(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i = 0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 65535); + p += 2; + } + } else { + for (i = 0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + +static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) +{ + stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; + stbi_uc *p, *temp_out, *orig = a->out; + + p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n); + if (p == NULL) return stbi__err("outofmem", "Out of memory"); + + // between here and free(out) below, exitting would leak + temp_out = p; + + if (pal_img_n == 3) { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p += 3; + } + } else { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p[3] = palette[n+3]; + p += 4; + } + } + STBI_FREE(a->out); + a->out = temp_out; + + STBI_NOTUSED(len); + + return 1; +} + +static int stbi__reduce_png(stbi__png *p) +{ + int i; + int img_len = p->s->img_x * p->s->img_y * p->s->img_out_n; + stbi_uc *reduced; + stbi__uint16 *orig = (stbi__uint16*)p->out; + + if (p->depth != 16) return 1; // don't need to do anything if not 16-bit data + + reduced = (stbi_uc *)stbi__malloc(img_len); + if (p == NULL) return stbi__err("outofmem", "Out of memory"); + + for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is a decent approx of 16->8 bit scaling + + p->out = reduced; + STBI_FREE(orig); + + return 1; +} + +static int stbi__unpremultiply_on_load = 0; +static int stbi__de_iphone_flag = 0; + +STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) +{ + stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply; +} + +STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) +{ + stbi__de_iphone_flag = flag_true_if_should_convert; +} + +static void stbi__de_iphone(stbi__png *z) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi_uc *p = z->out; + + if (s->img_out_n == 3) { // convert bgr to rgb + for (i=0; i < pixel_count; ++i) { + stbi_uc t = p[0]; + p[0] = p[2]; + p[2] = t; + p += 3; + } + } else { + STBI_ASSERT(s->img_out_n == 4); + if (stbi__unpremultiply_on_load) { + // convert bgr to rgb and unpremultiply + for (i=0; i < pixel_count; ++i) { + stbi_uc a = p[3]; + stbi_uc t = p[0]; + if (a) { + p[0] = p[2] * 255 / a; + p[1] = p[1] * 255 / a; + p[2] = t * 255 / a; + } else { + p[0] = p[2]; + p[2] = t; + } + p += 4; + } + } else { + // convert bgr to rgb + for (i=0; i < pixel_count; ++i) { + stbi_uc t = p[0]; + p[0] = p[2]; + p[2] = t; + p += 4; + } + } + } +} + +#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) + +static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) +{ + stbi_uc palette[1024], pal_img_n=0; + stbi_uc has_trans=0, tc[3]; + stbi__uint16 tc16[3]; + stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; + int first=1,k,interlace=0, color=0, is_iphone=0; + stbi__context *s = z->s; + + z->expanded = NULL; + z->idata = NULL; + z->out = NULL; + + if (!stbi__check_png_header(s)) return 0; + + if (scan == STBI__SCAN_type) return 1; + + for (;;) { + stbi__pngchunk c = stbi__get_chunk_header(s); + switch (c.type) { + case STBI__PNG_TYPE('C','g','B','I'): + is_iphone = 1; + stbi__skip(s, c.length); + break; + case STBI__PNG_TYPE('I','H','D','R'): { + int comp,filter; + if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); + first = 0; + if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); + s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); + s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); + z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); + color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); + if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); + if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); + comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); + filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); + interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG"); + if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG"); + if (!pal_img_n) { + s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); + if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); + if (scan == STBI__SCAN_header) return 1; + } else { + // if paletted, then pal_n is our final components, and + // img_n is # components to decompress/filter. + s->img_n = 1; + if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG"); + // if SCAN_header, have to scan to see if we have a tRNS + } + break; + } + + case STBI__PNG_TYPE('P','L','T','E'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG"); + pal_len = c.length / 3; + if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG"); + for (i=0; i < pal_len; ++i) { + palette[i*4+0] = stbi__get8(s); + palette[i*4+1] = stbi__get8(s); + palette[i*4+2] = stbi__get8(s); + palette[i*4+3] = 255; + } + break; + } + + case STBI__PNG_TYPE('t','R','N','S'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG"); + if (pal_img_n) { + if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; } + if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG"); + if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG"); + pal_img_n = 4; + for (i=0; i < c.length; ++i) + palette[i*4+3] = stbi__get8(s); + } else { + if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); + if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); + has_trans = 1; + if (z->depth == 16) { + for (k = 0; k < s->img_n; ++k) tc16[k] = stbi__get16be(s); // copy the values as-is + } else { + for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger + } + } + break; + } + + case STBI__PNG_TYPE('I','D','A','T'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); + if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; } + if ((int)(ioff + c.length) < (int)ioff) return 0; + if (ioff + c.length > idata_limit) { + stbi__uint32 idata_limit_old = idata_limit; + stbi_uc *p; + if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; + while (ioff + c.length > idata_limit) + idata_limit *= 2; + STBI_NOTUSED(idata_limit_old); + p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); + z->idata = p; + } + if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG"); + ioff += c.length; + break; + } + + case STBI__PNG_TYPE('I','E','N','D'): { + stbi__uint32 raw_len, bpl; + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (scan != STBI__SCAN_load) return 1; + if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); + // initial guess for decoded data size to avoid unnecessary reallocs + bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component + raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; + z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); + if (z->expanded == NULL) return 0; // zlib should set error + STBI_FREE(z->idata); z->idata = NULL; + if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) + s->img_out_n = s->img_n+1; + else + s->img_out_n = s->img_n; + if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; + if (has_trans) { + if (z->depth == 16) { + if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; + } else { + if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; + } + } + if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) + stbi__de_iphone(z); + if (pal_img_n) { + // pal_img_n == 3 or 4 + s->img_n = pal_img_n; // record the actual colors we had + s->img_out_n = pal_img_n; + if (req_comp >= 3) s->img_out_n = req_comp; + if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) + return 0; + } + STBI_FREE(z->expanded); z->expanded = NULL; + return 1; + } + + default: + // if critical, fail + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if ((c.type & (1 << 29)) == 0) { + #ifndef STBI_NO_FAILURE_STRINGS + // not threadsafe + static char invalid_chunk[] = "XXXX PNG chunk not known"; + invalid_chunk[0] = STBI__BYTECAST(c.type >> 24); + invalid_chunk[1] = STBI__BYTECAST(c.type >> 16); + invalid_chunk[2] = STBI__BYTECAST(c.type >> 8); + invalid_chunk[3] = STBI__BYTECAST(c.type >> 0); + #endif + return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type"); + } + stbi__skip(s, c.length); + break; + } + // end of PNG chunk, read and skip CRC + stbi__get32be(s); + } +} + +static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp) +{ + unsigned char *result=NULL; + if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); + if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { + if (p->depth == 16) { + if (!stbi__reduce_png(p)) { + return result; + } + } + result = p->out; + p->out = NULL; + if (req_comp && req_comp != p->s->img_out_n) { + result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); + p->s->img_out_n = req_comp; + if (result == NULL) return result; + } + *x = p->s->img_x; + *y = p->s->img_y; + if (n) *n = p->s->img_n; + } + STBI_FREE(p->out); p->out = NULL; + STBI_FREE(p->expanded); p->expanded = NULL; + STBI_FREE(p->idata); p->idata = NULL; + + return result; +} + +static unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi__png p; + p.s = s; + return stbi__do_png(&p, x,y,comp,req_comp); +} + +static int stbi__png_test(stbi__context *s) +{ + int r; + r = stbi__check_png_header(s); + stbi__rewind(s); + return r; +} + +static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) +{ + if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { + stbi__rewind( p->s ); + return 0; + } + if (x) *x = p->s->img_x; + if (y) *y = p->s->img_y; + if (comp) *comp = p->s->img_n; + return 1; +} + +static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) +{ + stbi__png p; + p.s = s; + return stbi__png_info_raw(&p, x, y, comp); +} +#endif + +// Microsoft/Windows BMP image + +#ifndef STBI_NO_BMP +static int stbi__bmp_test_raw(stbi__context *s) +{ + int r; + int sz; + if (stbi__get8(s) != 'B') return 0; + if (stbi__get8(s) != 'M') return 0; + stbi__get32le(s); // discard filesize + stbi__get16le(s); // discard reserved + stbi__get16le(s); // discard reserved + stbi__get32le(s); // discard data offset + sz = stbi__get32le(s); + r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124); + return r; +} + +static int stbi__bmp_test(stbi__context *s) +{ + int r = stbi__bmp_test_raw(s); + stbi__rewind(s); + return r; +} + + +// returns 0..31 for the highest set bit +static int stbi__high_bit(unsigned int z) +{ + int n=0; + if (z == 0) return -1; + if (z >= 0x10000) n += 16, z >>= 16; + if (z >= 0x00100) n += 8, z >>= 8; + if (z >= 0x00010) n += 4, z >>= 4; + if (z >= 0x00004) n += 2, z >>= 2; + if (z >= 0x00002) n += 1, z >>= 1; + return n; +} + +static int stbi__bitcount(unsigned int a) +{ + a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 + a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 + a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits + a = (a + (a >> 8)); // max 16 per 8 bits + a = (a + (a >> 16)); // max 32 per 8 bits + return a & 0xff; +} + +static int stbi__shiftsigned(int v, int shift, int bits) +{ + int result; + int z=0; + + if (shift < 0) v <<= -shift; + else v >>= shift; + result = v; + + z = bits; + while (z < 8) { + result += v >> z; + z += bits; + } + return result; +} + +typedef struct +{ + int bpp, offset, hsz; + unsigned int mr,mg,mb,ma, all_a; +} stbi__bmp_data; + +static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) +{ + int hsz; + if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP"); + stbi__get32le(s); // discard filesize + stbi__get16le(s); // discard reserved + stbi__get16le(s); // discard reserved + info->offset = stbi__get32le(s); + info->hsz = hsz = stbi__get32le(s); + info->mr = info->mg = info->mb = info->ma = 0; + + if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); + if (hsz == 12) { + s->img_x = stbi__get16le(s); + s->img_y = stbi__get16le(s); + } else { + s->img_x = stbi__get32le(s); + s->img_y = stbi__get32le(s); + } + if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP"); + info->bpp = stbi__get16le(s); + if (info->bpp == 1) return stbi__errpuc("monochrome", "BMP type not supported: 1-bit"); + if (hsz != 12) { + int compress = stbi__get32le(s); + if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); + stbi__get32le(s); // discard sizeof + stbi__get32le(s); // discard hres + stbi__get32le(s); // discard vres + stbi__get32le(s); // discard colorsused + stbi__get32le(s); // discard max important + if (hsz == 40 || hsz == 56) { + if (hsz == 56) { + stbi__get32le(s); + stbi__get32le(s); + stbi__get32le(s); + stbi__get32le(s); + } + if (info->bpp == 16 || info->bpp == 32) { + if (compress == 0) { + if (info->bpp == 32) { + info->mr = 0xffu << 16; + info->mg = 0xffu << 8; + info->mb = 0xffu << 0; + info->ma = 0xffu << 24; + info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 + } else { + info->mr = 31u << 10; + info->mg = 31u << 5; + info->mb = 31u << 0; + } + } else if (compress == 3) { + info->mr = stbi__get32le(s); + info->mg = stbi__get32le(s); + info->mb = stbi__get32le(s); + // not documented, but generated by photoshop and handled by mspaint + if (info->mr == info->mg && info->mg == info->mb) { + // ?!?!? + return stbi__errpuc("bad BMP", "bad BMP"); + } + } else + return stbi__errpuc("bad BMP", "bad BMP"); + } + } else { + int i; + if (hsz != 108 && hsz != 124) + return stbi__errpuc("bad BMP", "bad BMP"); + info->mr = stbi__get32le(s); + info->mg = stbi__get32le(s); + info->mb = stbi__get32le(s); + info->ma = stbi__get32le(s); + stbi__get32le(s); // discard color space + for (i=0; i < 12; ++i) + stbi__get32le(s); // discard color space parameters + if (hsz == 124) { + stbi__get32le(s); // discard rendering intent + stbi__get32le(s); // discard offset of profile data + stbi__get32le(s); // discard size of profile data + stbi__get32le(s); // discard reserved + } + } + } + return (void *) 1; +} + + +static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *out; + unsigned int mr=0,mg=0,mb=0,ma=0, all_a; + stbi_uc pal[256][4]; + int psize=0,i,j,width; + int flip_vertically, pad, target; + stbi__bmp_data info; + + info.all_a = 255; + if (stbi__bmp_parse_header(s, &info) == NULL) + return NULL; // error code already set + + flip_vertically = ((int) s->img_y) > 0; + s->img_y = abs((int) s->img_y); + + mr = info.mr; + mg = info.mg; + mb = info.mb; + ma = info.ma; + all_a = info.all_a; + + if (info.hsz == 12) { + if (info.bpp < 24) + psize = (info.offset - 14 - 24) / 3; + } else { + if (info.bpp < 16) + psize = (info.offset - 14 - info.hsz) >> 2; + } + + s->img_n = ma ? 4 : 3; + if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 + target = req_comp; + else + target = s->img_n; // if they want monochrome, we'll post-convert + + out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y); + if (!out) return stbi__errpuc("outofmem", "Out of memory"); + if (info.bpp < 16) { + int z=0; + if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); } + for (i=0; i < psize; ++i) { + pal[i][2] = stbi__get8(s); + pal[i][1] = stbi__get8(s); + pal[i][0] = stbi__get8(s); + if (info.hsz != 12) stbi__get8(s); + pal[i][3] = 255; + } + stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); + if (info.bpp == 4) width = (s->img_x + 1) >> 1; + else if (info.bpp == 8) width = s->img_x; + else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); } + pad = (-width)&3; + for (j=0; j < (int) s->img_y; ++j) { + for (i=0; i < (int) s->img_x; i += 2) { + int v=stbi__get8(s),v2=0; + if (info.bpp == 4) { + v2 = v & 15; + v >>= 4; + } + out[z++] = pal[v][0]; + out[z++] = pal[v][1]; + out[z++] = pal[v][2]; + if (target == 4) out[z++] = 255; + if (i+1 == (int) s->img_x) break; + v = (info.bpp == 8) ? stbi__get8(s) : v2; + out[z++] = pal[v][0]; + out[z++] = pal[v][1]; + out[z++] = pal[v][2]; + if (target == 4) out[z++] = 255; + } + stbi__skip(s, pad); + } + } else { + int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; + int z = 0; + int easy=0; + stbi__skip(s, info.offset - 14 - info.hsz); + if (info.bpp == 24) width = 3 * s->img_x; + else if (info.bpp == 16) width = 2*s->img_x; + else /* bpp = 32 and pad = 0 */ width=0; + pad = (-width) & 3; + if (info.bpp == 24) { + easy = 1; + } else if (info.bpp == 32) { + if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) + easy = 2; + } + if (!easy) { + if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } + // right shift amt to put high bit in position #7 + rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr); + gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg); + bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb); + ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma); + } + for (j=0; j < (int) s->img_y; ++j) { + if (easy) { + for (i=0; i < (int) s->img_x; ++i) { + unsigned char a; + out[z+2] = stbi__get8(s); + out[z+1] = stbi__get8(s); + out[z+0] = stbi__get8(s); + z += 3; + a = (easy == 2 ? stbi__get8(s) : 255); + all_a |= a; + if (target == 4) out[z++] = a; + } + } else { + int bpp = info.bpp; + for (i=0; i < (int) s->img_x; ++i) { + stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s)); + int a; + out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount)); + out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount)); + out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount)); + a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255); + all_a |= a; + if (target == 4) out[z++] = STBI__BYTECAST(a); + } + } + stbi__skip(s, pad); + } + } + + // if alpha channel is all 0s, replace with all 255s + if (target == 4 && all_a == 0) + for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4) + out[i] = 255; + + if (flip_vertically) { + stbi_uc t; + for (j=0; j < (int) s->img_y>>1; ++j) { + stbi_uc *p1 = out + j *s->img_x*target; + stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; + for (i=0; i < (int) s->img_x*target; ++i) { + t = p1[i], p1[i] = p2[i], p2[i] = t; + } + } + } + + if (req_comp && req_comp != target) { + out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y); + if (out == NULL) return out; // stbi__convert_format frees input on failure + } + + *x = s->img_x; + *y = s->img_y; + if (comp) *comp = s->img_n; + return out; +} +#endif + +// Targa Truevision - TGA +// by Jonathan Dummer +#ifndef STBI_NO_TGA +// returns STBI_rgb or whatever, 0 on error +static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16) +{ + // only RGB or RGBA (incl. 16bit) or grey allowed + if(is_rgb16) *is_rgb16 = 0; + switch(bits_per_pixel) { + case 8: return STBI_grey; + case 16: if(is_grey) return STBI_grey_alpha; + // else: fall-through + case 15: if(is_rgb16) *is_rgb16 = 1; + return STBI_rgb; + case 24: // fall-through + case 32: return bits_per_pixel/8; + default: return 0; + } +} + +static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp) +{ + int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp; + int sz, tga_colormap_type; + stbi__get8(s); // discard Offset + tga_colormap_type = stbi__get8(s); // colormap type + if( tga_colormap_type > 1 ) { + stbi__rewind(s); + return 0; // only RGB or indexed allowed + } + tga_image_type = stbi__get8(s); // image type + if ( tga_colormap_type == 1 ) { // colormapped (paletted) image + if (tga_image_type != 1 && tga_image_type != 9) { + stbi__rewind(s); + return 0; + } + stbi__skip(s,4); // skip index of first colormap entry and number of entries + sz = stbi__get8(s); // check bits per palette color entry + if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) { + stbi__rewind(s); + return 0; + } + stbi__skip(s,4); // skip image x and y origin + tga_colormap_bpp = sz; + } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE + if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) { + stbi__rewind(s); + return 0; // only RGB or grey allowed, +/- RLE + } + stbi__skip(s,9); // skip colormap specification and image x/y origin + tga_colormap_bpp = 0; + } + tga_w = stbi__get16le(s); + if( tga_w < 1 ) { + stbi__rewind(s); + return 0; // test width + } + tga_h = stbi__get16le(s); + if( tga_h < 1 ) { + stbi__rewind(s); + return 0; // test height + } + tga_bits_per_pixel = stbi__get8(s); // bits per pixel + stbi__get8(s); // ignore alpha bits + if (tga_colormap_bpp != 0) { + if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) { + // when using a colormap, tga_bits_per_pixel is the size of the indexes + // I don't think anything but 8 or 16bit indexes makes sense + stbi__rewind(s); + return 0; + } + tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL); + } else { + tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL); + } + if(!tga_comp) { + stbi__rewind(s); + return 0; + } + if (x) *x = tga_w; + if (y) *y = tga_h; + if (comp) *comp = tga_comp; + return 1; // seems to have passed everything +} + +static int stbi__tga_test(stbi__context *s) +{ + int res = 0; + int sz, tga_color_type; + stbi__get8(s); // discard Offset + tga_color_type = stbi__get8(s); // color type + if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed + sz = stbi__get8(s); // image type + if ( tga_color_type == 1 ) { // colormapped (paletted) image + if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9 + stbi__skip(s,4); // skip index of first colormap entry and number of entries + sz = stbi__get8(s); // check bits per palette color entry + if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; + stbi__skip(s,4); // skip image x and y origin + } else { // "normal" image w/o colormap + if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE + stbi__skip(s,9); // skip colormap specification and image x/y origin + } + if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width + if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height + sz = stbi__get8(s); // bits per pixel + if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index + if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; + + res = 1; // if we got this far, everything's good and we can return 1 instead of 0 + +errorEnd: + stbi__rewind(s); + return res; +} + +// read 16bit value and convert to 24bit RGB +void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) +{ + stbi__uint16 px = stbi__get16le(s); + stbi__uint16 fiveBitMask = 31; + // we have 3 channels with 5bits each + int r = (px >> 10) & fiveBitMask; + int g = (px >> 5) & fiveBitMask; + int b = px & fiveBitMask; + // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later + out[0] = (r * 255)/31; + out[1] = (g * 255)/31; + out[2] = (b * 255)/31; + + // some people claim that the most significant bit might be used for alpha + // (possibly if an alpha-bit is set in the "image descriptor byte") + // but that only made 16bit test images completely translucent.. + // so let's treat all 15 and 16bit TGAs as RGB with no alpha. +} + +static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + // read in the TGA header stuff + int tga_offset = stbi__get8(s); + int tga_indexed = stbi__get8(s); + int tga_image_type = stbi__get8(s); + int tga_is_RLE = 0; + int tga_palette_start = stbi__get16le(s); + int tga_palette_len = stbi__get16le(s); + int tga_palette_bits = stbi__get8(s); + int tga_x_origin = stbi__get16le(s); + int tga_y_origin = stbi__get16le(s); + int tga_width = stbi__get16le(s); + int tga_height = stbi__get16le(s); + int tga_bits_per_pixel = stbi__get8(s); + int tga_comp, tga_rgb16=0; + int tga_inverted = stbi__get8(s); + // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?) + // image data + unsigned char *tga_data; + unsigned char *tga_palette = NULL; + int i, j; + unsigned char raw_data[4]; + int RLE_count = 0; + int RLE_repeating = 0; + int read_next_pixel = 1; + + // do a tiny bit of precessing + if ( tga_image_type >= 8 ) + { + tga_image_type -= 8; + tga_is_RLE = 1; + } + tga_inverted = 1 - ((tga_inverted >> 5) & 1); + + // If I'm paletted, then I'll use the number of bits from the palette + if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); + else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); + + if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency + return stbi__errpuc("bad format", "Can't find out TGA pixelformat"); + + // tga info + *x = tga_width; + *y = tga_height; + if (comp) *comp = tga_comp; + + tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp ); + if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); + + // skip to the data's starting position (offset usually = 0) + stbi__skip(s, tga_offset ); + + if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) { + for (i=0; i < tga_height; ++i) { + int row = tga_inverted ? tga_height -i - 1 : i; + stbi_uc *tga_row = tga_data + row*tga_width*tga_comp; + stbi__getn(s, tga_row, tga_width * tga_comp); + } + } else { + // do I need to load a palette? + if ( tga_indexed) + { + // any data to skip? (offset usually = 0) + stbi__skip(s, tga_palette_start ); + // load the palette + tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_comp ); + if (!tga_palette) { + STBI_FREE(tga_data); + return stbi__errpuc("outofmem", "Out of memory"); + } + if (tga_rgb16) { + stbi_uc *pal_entry = tga_palette; + STBI_ASSERT(tga_comp == STBI_rgb); + for (i=0; i < tga_palette_len; ++i) { + stbi__tga_read_rgb16(s, pal_entry); + pal_entry += tga_comp; + } + } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) { + STBI_FREE(tga_data); + STBI_FREE(tga_palette); + return stbi__errpuc("bad palette", "Corrupt TGA"); + } + } + // load the data + for (i=0; i < tga_width * tga_height; ++i) + { + // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk? + if ( tga_is_RLE ) + { + if ( RLE_count == 0 ) + { + // yep, get the next byte as a RLE command + int RLE_cmd = stbi__get8(s); + RLE_count = 1 + (RLE_cmd & 127); + RLE_repeating = RLE_cmd >> 7; + read_next_pixel = 1; + } else if ( !RLE_repeating ) + { + read_next_pixel = 1; + } + } else + { + read_next_pixel = 1; + } + // OK, if I need to read a pixel, do it now + if ( read_next_pixel ) + { + // load however much data we did have + if ( tga_indexed ) + { + // read in index, then perform the lookup + int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s); + if ( pal_idx >= tga_palette_len ) { + // invalid index + pal_idx = 0; + } + pal_idx *= tga_comp; + for (j = 0; j < tga_comp; ++j) { + raw_data[j] = tga_palette[pal_idx+j]; + } + } else if(tga_rgb16) { + STBI_ASSERT(tga_comp == STBI_rgb); + stbi__tga_read_rgb16(s, raw_data); + } else { + // read in the data raw + for (j = 0; j < tga_comp; ++j) { + raw_data[j] = stbi__get8(s); + } + } + // clear the reading flag for the next pixel + read_next_pixel = 0; + } // end of reading a pixel + + // copy data + for (j = 0; j < tga_comp; ++j) + tga_data[i*tga_comp+j] = raw_data[j]; + + // in case we're in RLE mode, keep counting down + --RLE_count; + } + // do I need to invert the image? + if ( tga_inverted ) + { + for (j = 0; j*2 < tga_height; ++j) + { + int index1 = j * tga_width * tga_comp; + int index2 = (tga_height - 1 - j) * tga_width * tga_comp; + for (i = tga_width * tga_comp; i > 0; --i) + { + unsigned char temp = tga_data[index1]; + tga_data[index1] = tga_data[index2]; + tga_data[index2] = temp; + ++index1; + ++index2; + } + } + } + // clear my palette, if I had one + if ( tga_palette != NULL ) + { + STBI_FREE( tga_palette ); + } + } + + // swap RGB - if the source data was RGB16, it already is in the right order + if (tga_comp >= 3 && !tga_rgb16) + { + unsigned char* tga_pixel = tga_data; + for (i=0; i < tga_width * tga_height; ++i) + { + unsigned char temp = tga_pixel[0]; + tga_pixel[0] = tga_pixel[2]; + tga_pixel[2] = temp; + tga_pixel += tga_comp; + } + } + + // convert to target component count + if (req_comp && req_comp != tga_comp) + tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); + + // the things I do to get rid of an error message, and yet keep + // Microsoft's C compilers happy... [8^( + tga_palette_start = tga_palette_len = tga_palette_bits = + tga_x_origin = tga_y_origin = 0; + // OK, done + return tga_data; +} +#endif + +// ************************************************************************************************* +// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB + +#ifndef STBI_NO_PSD +static int stbi__psd_test(stbi__context *s) +{ + int r = (stbi__get32be(s) == 0x38425053); + stbi__rewind(s); + return r; +} + +static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + int pixelCount; + int channelCount, compression; + int channel, i, count, len; + int bitdepth; + int w,h; + stbi_uc *out; + + // Check identifier + if (stbi__get32be(s) != 0x38425053) // "8BPS" + return stbi__errpuc("not PSD", "Corrupt PSD image"); + + // Check file type version. + if (stbi__get16be(s) != 1) + return stbi__errpuc("wrong version", "Unsupported version of PSD image"); + + // Skip 6 reserved bytes. + stbi__skip(s, 6 ); + + // Read the number of channels (R, G, B, A, etc). + channelCount = stbi__get16be(s); + if (channelCount < 0 || channelCount > 16) + return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); + + // Read the rows and columns of the image. + h = stbi__get32be(s); + w = stbi__get32be(s); + + // Make sure the depth is 8 bits. + bitdepth = stbi__get16be(s); + if (bitdepth != 8 && bitdepth != 16) + return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); + + // Make sure the color mode is RGB. + // Valid options are: + // 0: Bitmap + // 1: Grayscale + // 2: Indexed color + // 3: RGB color + // 4: CMYK color + // 7: Multichannel + // 8: Duotone + // 9: Lab color + if (stbi__get16be(s) != 3) + return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); + + // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) + stbi__skip(s,stbi__get32be(s) ); + + // Skip the image resources. (resolution, pen tool paths, etc) + stbi__skip(s, stbi__get32be(s) ); + + // Skip the reserved data. + stbi__skip(s, stbi__get32be(s) ); + + // Find out if the data is compressed. + // Known values: + // 0: no compression + // 1: RLE compressed + compression = stbi__get16be(s); + if (compression > 1) + return stbi__errpuc("bad compression", "PSD has an unknown compression format"); + + // Create the destination image. + out = (stbi_uc *) stbi__malloc(4 * w*h); + if (!out) return stbi__errpuc("outofmem", "Out of memory"); + pixelCount = w*h; + + // Initialize the data to zero. + //memset( out, 0, pixelCount * 4 ); + + // Finally, the image data. + if (compression) { + // RLE as used by .PSD and .TIFF + // Loop until you get the number of unpacked bytes you are expecting: + // Read the next source byte into n. + // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. + // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. + // Else if n is 128, noop. + // Endloop + + // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, + // which we're going to just skip. + stbi__skip(s, h * channelCount * 2 ); + + // Read the RLE data by channel. + for (channel = 0; channel < 4; channel++) { + stbi_uc *p; + + p = out+channel; + if (channel >= channelCount) { + // Fill this channel with default data. + for (i = 0; i < pixelCount; i++, p += 4) + *p = (channel == 3 ? 255 : 0); + } else { + // Read the RLE data. + count = 0; + while (count < pixelCount) { + len = stbi__get8(s); + if (len == 128) { + // No-op. + } else if (len < 128) { + // Copy next len+1 bytes literally. + len++; + count += len; + while (len) { + *p = stbi__get8(s); + p += 4; + len--; + } + } else if (len > 128) { + stbi_uc val; + // Next -len+1 bytes in the dest are replicated from next source byte. + // (Interpret len as a negative 8-bit int.) + len ^= 0x0FF; + len += 2; + val = stbi__get8(s); + count += len; + while (len) { + *p = val; + p += 4; + len--; + } + } + } + } + } + + } else { + // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) + // where each channel consists of an 8-bit value for each pixel in the image. + + // Read the data by channel. + for (channel = 0; channel < 4; channel++) { + stbi_uc *p; + + p = out + channel; + if (channel >= channelCount) { + // Fill this channel with default data. + stbi_uc val = channel == 3 ? 255 : 0; + for (i = 0; i < pixelCount; i++, p += 4) + *p = val; + } else { + // Read the data. + if (bitdepth == 16) { + for (i = 0; i < pixelCount; i++, p += 4) + *p = (stbi_uc) (stbi__get16be(s) >> 8); + } else { + for (i = 0; i < pixelCount; i++, p += 4) + *p = stbi__get8(s); + } + } + } + } + + if (channelCount >= 4) { + for (i=0; i < w*h; ++i) { + unsigned char *pixel = out + 4*i; + if (pixel[3] != 0 && pixel[3] != 255) { + // remove weird white matte from PSD + float a = pixel[3] / 255.0f; + float ra = 1.0f / a; + float inv_a = 255.0f * (1 - ra); + pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); + pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); + pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); + } + } + } + + if (req_comp && req_comp != 4) { + out = stbi__convert_format(out, 4, req_comp, w, h); + if (out == NULL) return out; // stbi__convert_format frees input on failure + } + + if (comp) *comp = 4; + *y = h; + *x = w; + + return out; +} +#endif + +// ************************************************************************************************* +// Softimage PIC loader +// by Tom Seddon +// +// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format +// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/ + +#ifndef STBI_NO_PIC +static int stbi__pic_is4(stbi__context *s,const char *str) +{ + int i; + for (i=0; i<4; ++i) + if (stbi__get8(s) != (stbi_uc)str[i]) + return 0; + + return 1; +} + +static int stbi__pic_test_core(stbi__context *s) +{ + int i; + + if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) + return 0; + + for(i=0;i<84;++i) + stbi__get8(s); + + if (!stbi__pic_is4(s,"PICT")) + return 0; + + return 1; +} + +typedef struct +{ + stbi_uc size,type,channel; +} stbi__pic_packet; + +static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest) +{ + int mask=0x80, i; + + for (i=0; i<4; ++i, mask>>=1) { + if (channel & mask) { + if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short"); + dest[i]=stbi__get8(s); + } + } + + return dest; +} + +static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src) +{ + int mask=0x80,i; + + for (i=0;i<4; ++i, mask>>=1) + if (channel&mask) + dest[i]=src[i]; +} + +static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result) +{ + int act_comp=0,num_packets=0,y,chained; + stbi__pic_packet packets[10]; + + // this will (should...) cater for even some bizarre stuff like having data + // for the same channel in multiple packets. + do { + stbi__pic_packet *packet; + + if (num_packets==sizeof(packets)/sizeof(packets[0])) + return stbi__errpuc("bad format","too many packets"); + + packet = &packets[num_packets++]; + + chained = stbi__get8(s); + packet->size = stbi__get8(s); + packet->type = stbi__get8(s); + packet->channel = stbi__get8(s); + + act_comp |= packet->channel; + + if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)"); + if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp"); + } while (chained); + + *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? + + for(y=0; ytype) { + default: + return stbi__errpuc("bad format","packet has bad compression type"); + + case 0: {//uncompressed + int x; + + for(x=0;xchannel,dest)) + return 0; + break; + } + + case 1://Pure RLE + { + int left=width, i; + + while (left>0) { + stbi_uc count,value[4]; + + count=stbi__get8(s); + if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)"); + + if (count > left) + count = (stbi_uc) left; + + if (!stbi__readval(s,packet->channel,value)) return 0; + + for(i=0; ichannel,dest,value); + left -= count; + } + } + break; + + case 2: {//Mixed RLE + int left=width; + while (left>0) { + int count = stbi__get8(s), i; + if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)"); + + if (count >= 128) { // Repeated + stbi_uc value[4]; + + if (count==128) + count = stbi__get16be(s); + else + count -= 127; + if (count > left) + return stbi__errpuc("bad file","scanline overrun"); + + if (!stbi__readval(s,packet->channel,value)) + return 0; + + for(i=0;ichannel,dest,value); + } else { // Raw + ++count; + if (count>left) return stbi__errpuc("bad file","scanline overrun"); + + for(i=0;ichannel,dest)) + return 0; + } + left-=count; + } + break; + } + } + } + } + + return result; +} + +static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp) +{ + stbi_uc *result; + int i, x,y; + + for (i=0; i<92; ++i) + stbi__get8(s); + + x = stbi__get16be(s); + y = stbi__get16be(s); + if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); + if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode"); + + stbi__get32be(s); //skip `ratio' + stbi__get16be(s); //skip `fields' + stbi__get16be(s); //skip `pad' + + // intermediate buffer is RGBA + result = (stbi_uc *) stbi__malloc(x*y*4); + memset(result, 0xff, x*y*4); + + if (!stbi__pic_load_core(s,x,y,comp, result)) { + STBI_FREE(result); + result=0; + } + *px = x; + *py = y; + if (req_comp == 0) req_comp = *comp; + result=stbi__convert_format(result,4,req_comp,x,y); + + return result; +} + +static int stbi__pic_test(stbi__context *s) +{ + int r = stbi__pic_test_core(s); + stbi__rewind(s); + return r; +} +#endif + +// ************************************************************************************************* +// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb + +#ifndef STBI_NO_GIF +typedef struct +{ + stbi__int16 prefix; + stbi_uc first; + stbi_uc suffix; +} stbi__gif_lzw; + +typedef struct +{ + int w,h; + stbi_uc *out, *old_out; // output buffer (always 4 components) + int flags, bgindex, ratio, transparent, eflags, delay; + stbi_uc pal[256][4]; + stbi_uc lpal[256][4]; + stbi__gif_lzw codes[4096]; + stbi_uc *color_table; + int parse, step; + int lflags; + int start_x, start_y; + int max_x, max_y; + int cur_x, cur_y; + int line_size; +} stbi__gif; + +static int stbi__gif_test_raw(stbi__context *s) +{ + int sz; + if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0; + sz = stbi__get8(s); + if (sz != '9' && sz != '7') return 0; + if (stbi__get8(s) != 'a') return 0; + return 1; +} + +static int stbi__gif_test(stbi__context *s) +{ + int r = stbi__gif_test_raw(s); + stbi__rewind(s); + return r; +} + +static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp) +{ + int i; + for (i=0; i < num_entries; ++i) { + pal[i][2] = stbi__get8(s); + pal[i][1] = stbi__get8(s); + pal[i][0] = stbi__get8(s); + pal[i][3] = transp == i ? 0 : 255; + } +} + +static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) +{ + stbi_uc version; + if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') + return stbi__err("not GIF", "Corrupt GIF"); + + version = stbi__get8(s); + if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); + if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF"); + + stbi__g_failure_reason = ""; + g->w = stbi__get16le(s); + g->h = stbi__get16le(s); + g->flags = stbi__get8(s); + g->bgindex = stbi__get8(s); + g->ratio = stbi__get8(s); + g->transparent = -1; + + if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments + + if (is_info) return 1; + + if (g->flags & 0x80) + stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1); + + return 1; +} + +static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) +{ + stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); + if (!stbi__gif_header(s, g, comp, 1)) { + STBI_FREE(g); + stbi__rewind( s ); + return 0; + } + if (x) *x = g->w; + if (y) *y = g->h; + STBI_FREE(g); + return 1; +} + +static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) +{ + stbi_uc *p, *c; + + // recurse to decode the prefixes, since the linked-list is backwards, + // and working backwards through an interleaved image would be nasty + if (g->codes[code].prefix >= 0) + stbi__out_gif_code(g, g->codes[code].prefix); + + if (g->cur_y >= g->max_y) return; + + p = &g->out[g->cur_x + g->cur_y]; + c = &g->color_table[g->codes[code].suffix * 4]; + + if (c[3] >= 128) { + p[0] = c[2]; + p[1] = c[1]; + p[2] = c[0]; + p[3] = c[3]; + } + g->cur_x += 4; + + if (g->cur_x >= g->max_x) { + g->cur_x = g->start_x; + g->cur_y += g->step; + + while (g->cur_y >= g->max_y && g->parse > 0) { + g->step = (1 << g->parse) * g->line_size; + g->cur_y = g->start_y + (g->step >> 1); + --g->parse; + } + } +} + +static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) +{ + stbi_uc lzw_cs; + stbi__int32 len, init_code; + stbi__uint32 first; + stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; + stbi__gif_lzw *p; + + lzw_cs = stbi__get8(s); + if (lzw_cs > 12) return NULL; + clear = 1 << lzw_cs; + first = 1; + codesize = lzw_cs + 1; + codemask = (1 << codesize) - 1; + bits = 0; + valid_bits = 0; + for (init_code = 0; init_code < clear; init_code++) { + g->codes[init_code].prefix = -1; + g->codes[init_code].first = (stbi_uc) init_code; + g->codes[init_code].suffix = (stbi_uc) init_code; + } + + // support no starting clear code + avail = clear+2; + oldcode = -1; + + len = 0; + for(;;) { + if (valid_bits < codesize) { + if (len == 0) { + len = stbi__get8(s); // start new block + if (len == 0) + return g->out; + } + --len; + bits |= (stbi__int32) stbi__get8(s) << valid_bits; + valid_bits += 8; + } else { + stbi__int32 code = bits & codemask; + bits >>= codesize; + valid_bits -= codesize; + // @OPTIMIZE: is there some way we can accelerate the non-clear path? + if (code == clear) { // clear code + codesize = lzw_cs + 1; + codemask = (1 << codesize) - 1; + avail = clear + 2; + oldcode = -1; + first = 0; + } else if (code == clear + 1) { // end of stream code + stbi__skip(s, len); + while ((len = stbi__get8(s)) > 0) + stbi__skip(s,len); + return g->out; + } else if (code <= avail) { + if (first) return stbi__errpuc("no clear code", "Corrupt GIF"); + + if (oldcode >= 0) { + p = &g->codes[avail++]; + if (avail > 4096) return stbi__errpuc("too many codes", "Corrupt GIF"); + p->prefix = (stbi__int16) oldcode; + p->first = g->codes[oldcode].first; + p->suffix = (code == avail) ? p->first : g->codes[code].first; + } else if (code == avail) + return stbi__errpuc("illegal code in raster", "Corrupt GIF"); + + stbi__out_gif_code(g, (stbi__uint16) code); + + if ((avail & codemask) == 0 && avail <= 0x0FFF) { + codesize++; + codemask = (1 << codesize) - 1; + } + + oldcode = code; + } else { + return stbi__errpuc("illegal code in raster", "Corrupt GIF"); + } + } + } +} + +static void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1, int y1) +{ + int x, y; + stbi_uc *c = g->pal[g->bgindex]; + for (y = y0; y < y1; y += 4 * g->w) { + for (x = x0; x < x1; x += 4) { + stbi_uc *p = &g->out[y + x]; + p[0] = c[2]; + p[1] = c[1]; + p[2] = c[0]; + p[3] = 0; + } + } +} + +// this function is designed to support animated gifs, although stb_image doesn't support it +static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp) +{ + int i; + stbi_uc *prev_out = 0; + + if (g->out == 0 && !stbi__gif_header(s, g, comp,0)) + return 0; // stbi__g_failure_reason set by stbi__gif_header + + prev_out = g->out; + g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h); + if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory"); + + switch ((g->eflags & 0x1C) >> 2) { + case 0: // unspecified (also always used on 1st frame) + stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h); + break; + case 1: // do not dispose + if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); + g->old_out = prev_out; + break; + case 2: // dispose to background + if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); + stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x, g->max_y); + break; + case 3: // dispose to previous + if (g->old_out) { + for (i = g->start_y; i < g->max_y; i += 4 * g->w) + memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x], g->max_x - g->start_x); + } + break; + } + + for (;;) { + switch (stbi__get8(s)) { + case 0x2C: /* Image Descriptor */ + { + int prev_trans = -1; + stbi__int32 x, y, w, h; + stbi_uc *o; + + x = stbi__get16le(s); + y = stbi__get16le(s); + w = stbi__get16le(s); + h = stbi__get16le(s); + if (((x + w) > (g->w)) || ((y + h) > (g->h))) + return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); + + g->line_size = g->w * 4; + g->start_x = x * 4; + g->start_y = y * g->line_size; + g->max_x = g->start_x + w * 4; + g->max_y = g->start_y + h * g->line_size; + g->cur_x = g->start_x; + g->cur_y = g->start_y; + + g->lflags = stbi__get8(s); + + if (g->lflags & 0x40) { + g->step = 8 * g->line_size; // first interlaced spacing + g->parse = 3; + } else { + g->step = g->line_size; + g->parse = 0; + } + + if (g->lflags & 0x80) { + stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1); + g->color_table = (stbi_uc *) g->lpal; + } else if (g->flags & 0x80) { + if (g->transparent >= 0 && (g->eflags & 0x01)) { + prev_trans = g->pal[g->transparent][3]; + g->pal[g->transparent][3] = 0; + } + g->color_table = (stbi_uc *) g->pal; + } else + return stbi__errpuc("missing color table", "Corrupt GIF"); + + o = stbi__process_gif_raster(s, g); + if (o == NULL) return NULL; + + if (prev_trans != -1) + g->pal[g->transparent][3] = (stbi_uc) prev_trans; + + return o; + } + + case 0x21: // Comment Extension. + { + int len; + if (stbi__get8(s) == 0xF9) { // Graphic Control Extension. + len = stbi__get8(s); + if (len == 4) { + g->eflags = stbi__get8(s); + g->delay = stbi__get16le(s); + g->transparent = stbi__get8(s); + } else { + stbi__skip(s, len); + break; + } + } + while ((len = stbi__get8(s)) != 0) + stbi__skip(s, len); + break; + } + + case 0x3B: // gif stream termination code + return (stbi_uc *) s; // using '1' causes warning on some compilers + + default: + return stbi__errpuc("unknown code", "Corrupt GIF"); + } + } + + STBI_NOTUSED(req_comp); +} + +static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *u = 0; + stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); + memset(g, 0, sizeof(*g)); + + u = stbi__gif_load_next(s, g, comp, req_comp); + if (u == (stbi_uc *) s) u = 0; // end of animated gif marker + if (u) { + *x = g->w; + *y = g->h; + if (req_comp && req_comp != 4) + u = stbi__convert_format(u, 4, req_comp, g->w, g->h); + } + else if (g->out) + STBI_FREE(g->out); + STBI_FREE(g); + return u; +} + +static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) +{ + return stbi__gif_info_raw(s,x,y,comp); +} +#endif + +// ************************************************************************************************* +// Radiance RGBE HDR loader +// originally by Nicolas Schulz +#ifndef STBI_NO_HDR +static int stbi__hdr_test_core(stbi__context *s) +{ + const char *signature = "#?RADIANCE\n"; + int i; + for (i=0; signature[i]; ++i) + if (stbi__get8(s) != signature[i]) + return 0; + return 1; +} + +static int stbi__hdr_test(stbi__context* s) +{ + int r = stbi__hdr_test_core(s); + stbi__rewind(s); + return r; +} + +#define STBI__HDR_BUFLEN 1024 +static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) +{ + int len=0; + char c = '\0'; + + c = (char) stbi__get8(z); + + while (!stbi__at_eof(z) && c != '\n') { + buffer[len++] = c; + if (len == STBI__HDR_BUFLEN-1) { + // flush to end of line + while (!stbi__at_eof(z) && stbi__get8(z) != '\n') + ; + break; + } + c = (char) stbi__get8(z); + } + + buffer[len] = 0; + return buffer; +} + +static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp) +{ + if ( input[3] != 0 ) { + float f1; + // Exponent + f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); + if (req_comp <= 2) + output[0] = (input[0] + input[1] + input[2]) * f1 / 3; + else { + output[0] = input[0] * f1; + output[1] = input[1] * f1; + output[2] = input[2] * f1; + } + if (req_comp == 2) output[1] = 1; + if (req_comp == 4) output[3] = 1; + } else { + switch (req_comp) { + case 4: output[3] = 1; /* fallthrough */ + case 3: output[0] = output[1] = output[2] = 0; + break; + case 2: output[1] = 1; /* fallthrough */ + case 1: output[0] = 0; + break; + } + } +} + +static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + char buffer[STBI__HDR_BUFLEN]; + char *token; + int valid = 0; + int width, height; + stbi_uc *scanline; + float *hdr_data; + int len; + unsigned char count, value; + int i, j, k, c1,c2, z; + + + // Check identifier + if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0) + return stbi__errpf("not HDR", "Corrupt HDR image"); + + // Parse header + for(;;) { + token = stbi__hdr_gettoken(s,buffer); + if (token[0] == 0) break; + if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; + } + + if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format"); + + // Parse width and height + // can't use sscanf() if we're not using stdio! + token = stbi__hdr_gettoken(s,buffer); + if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); + token += 3; + height = (int) strtol(token, &token, 10); + while (*token == ' ') ++token; + if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); + token += 3; + width = (int) strtol(token, NULL, 10); + + *x = width; + *y = height; + + if (comp) *comp = 3; + if (req_comp == 0) req_comp = 3; + + // Read data + hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float)); + + // Load image data + // image data is stored as some number of sca + if ( width < 8 || width >= 32768) { + // Read flat data + for (j=0; j < height; ++j) { + for (i=0; i < width; ++i) { + stbi_uc rgbe[4]; + main_decode_loop: + stbi__getn(s, rgbe, 4); + stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); + } + } + } else { + // Read RLE-encoded data + scanline = NULL; + + for (j = 0; j < height; ++j) { + c1 = stbi__get8(s); + c2 = stbi__get8(s); + len = stbi__get8(s); + if (c1 != 2 || c2 != 2 || (len & 0x80)) { + // not run-length encoded, so we have to actually use THIS data as a decoded + // pixel (note this can't be a valid pixel--one of RGB must be >= 128) + stbi_uc rgbe[4]; + rgbe[0] = (stbi_uc) c1; + rgbe[1] = (stbi_uc) c2; + rgbe[2] = (stbi_uc) len; + rgbe[3] = (stbi_uc) stbi__get8(s); + stbi__hdr_convert(hdr_data, rgbe, req_comp); + i = 1; + j = 0; + STBI_FREE(scanline); + goto main_decode_loop; // yes, this makes no sense + } + len <<= 8; + len |= stbi__get8(s); + if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); } + if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4); + + for (k = 0; k < 4; ++k) { + i = 0; + while (i < width) { + count = stbi__get8(s); + if (count > 128) { + // Run + value = stbi__get8(s); + count -= 128; + for (z = 0; z < count; ++z) + scanline[i++ * 4 + k] = value; + } else { + // Dump + for (z = 0; z < count; ++z) + scanline[i++ * 4 + k] = stbi__get8(s); + } + } + } + for (i=0; i < width; ++i) + stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); + } + STBI_FREE(scanline); + } + + return hdr_data; +} + +static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp) +{ + char buffer[STBI__HDR_BUFLEN]; + char *token; + int valid = 0; + + if (stbi__hdr_test(s) == 0) { + stbi__rewind( s ); + return 0; + } + + for(;;) { + token = stbi__hdr_gettoken(s,buffer); + if (token[0] == 0) break; + if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; + } + + if (!valid) { + stbi__rewind( s ); + return 0; + } + token = stbi__hdr_gettoken(s,buffer); + if (strncmp(token, "-Y ", 3)) { + stbi__rewind( s ); + return 0; + } + token += 3; + *y = (int) strtol(token, &token, 10); + while (*token == ' ') ++token; + if (strncmp(token, "+X ", 3)) { + stbi__rewind( s ); + return 0; + } + token += 3; + *x = (int) strtol(token, NULL, 10); + *comp = 3; + return 1; +} +#endif // STBI_NO_HDR + +#ifndef STBI_NO_BMP +static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) +{ + void *p; + stbi__bmp_data info; + + info.all_a = 255; + p = stbi__bmp_parse_header(s, &info); + stbi__rewind( s ); + if (p == NULL) + return 0; + *x = s->img_x; + *y = s->img_y; + *comp = info.ma ? 4 : 3; + return 1; +} +#endif + +#ifndef STBI_NO_PSD +static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) +{ + int channelCount; + if (stbi__get32be(s) != 0x38425053) { + stbi__rewind( s ); + return 0; + } + if (stbi__get16be(s) != 1) { + stbi__rewind( s ); + return 0; + } + stbi__skip(s, 6); + channelCount = stbi__get16be(s); + if (channelCount < 0 || channelCount > 16) { + stbi__rewind( s ); + return 0; + } + *y = stbi__get32be(s); + *x = stbi__get32be(s); + if (stbi__get16be(s) != 8) { + stbi__rewind( s ); + return 0; + } + if (stbi__get16be(s) != 3) { + stbi__rewind( s ); + return 0; + } + *comp = 4; + return 1; +} +#endif + +#ifndef STBI_NO_PIC +static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) +{ + int act_comp=0,num_packets=0,chained; + stbi__pic_packet packets[10]; + + if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) { + stbi__rewind(s); + return 0; + } + + stbi__skip(s, 88); + + *x = stbi__get16be(s); + *y = stbi__get16be(s); + if (stbi__at_eof(s)) { + stbi__rewind( s); + return 0; + } + if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) { + stbi__rewind( s ); + return 0; + } + + stbi__skip(s, 8); + + do { + stbi__pic_packet *packet; + + if (num_packets==sizeof(packets)/sizeof(packets[0])) + return 0; + + packet = &packets[num_packets++]; + chained = stbi__get8(s); + packet->size = stbi__get8(s); + packet->type = stbi__get8(s); + packet->channel = stbi__get8(s); + act_comp |= packet->channel; + + if (stbi__at_eof(s)) { + stbi__rewind( s ); + return 0; + } + if (packet->size != 8) { + stbi__rewind( s ); + return 0; + } + } while (chained); + + *comp = (act_comp & 0x10 ? 4 : 3); + + return 1; +} +#endif + +// ************************************************************************************************* +// Portable Gray Map and Portable Pixel Map loader +// by Ken Miller +// +// PGM: http://netpbm.sourceforge.net/doc/pgm.html +// PPM: http://netpbm.sourceforge.net/doc/ppm.html +// +// Known limitations: +// Does not support comments in the header section +// Does not support ASCII image data (formats P2 and P3) +// Does not support 16-bit-per-channel + +#ifndef STBI_NO_PNM + +static int stbi__pnm_test(stbi__context *s) +{ + char p, t; + p = (char) stbi__get8(s); + t = (char) stbi__get8(s); + if (p != 'P' || (t != '5' && t != '6')) { + stbi__rewind( s ); + return 0; + } + return 1; +} + +static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi_uc *out; + if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n)) + return 0; + *x = s->img_x; + *y = s->img_y; + *comp = s->img_n; + + out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y); + if (!out) return stbi__errpuc("outofmem", "Out of memory"); + stbi__getn(s, out, s->img_n * s->img_x * s->img_y); + + if (req_comp && req_comp != s->img_n) { + out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y); + if (out == NULL) return out; // stbi__convert_format frees input on failure + } + return out; +} + +static int stbi__pnm_isspace(char c) +{ + return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'; +} + +static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) +{ + for (;;) { + while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) + *c = (char) stbi__get8(s); + + if (stbi__at_eof(s) || *c != '#') + break; + + while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' ) + *c = (char) stbi__get8(s); + } +} + +static int stbi__pnm_isdigit(char c) +{ + return c >= '0' && c <= '9'; +} + +static int stbi__pnm_getinteger(stbi__context *s, char *c) +{ + int value = 0; + + while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) { + value = value*10 + (*c - '0'); + *c = (char) stbi__get8(s); + } + + return value; +} + +static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) +{ + int maxv; + char c, p, t; + + stbi__rewind( s ); + + // Get identifier + p = (char) stbi__get8(s); + t = (char) stbi__get8(s); + if (p != 'P' || (t != '5' && t != '6')) { + stbi__rewind( s ); + return 0; + } + + *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm + + c = (char) stbi__get8(s); + stbi__pnm_skip_whitespace(s, &c); + + *x = stbi__pnm_getinteger(s, &c); // read width + stbi__pnm_skip_whitespace(s, &c); + + *y = stbi__pnm_getinteger(s, &c); // read height + stbi__pnm_skip_whitespace(s, &c); + + maxv = stbi__pnm_getinteger(s, &c); // read max value + + if (maxv > 255) + return stbi__err("max value > 255", "PPM image not 8-bit"); + else + return 1; +} +#endif + +static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) +{ + #ifndef STBI_NO_JPEG + if (stbi__jpeg_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PNG + if (stbi__png_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_GIF + if (stbi__gif_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_BMP + if (stbi__bmp_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PSD + if (stbi__psd_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PIC + if (stbi__pic_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PNM + if (stbi__pnm_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_HDR + if (stbi__hdr_info(s, x, y, comp)) return 1; + #endif + + // test tga last because it's a crappy test! + #ifndef STBI_NO_TGA + if (stbi__tga_info(s, x, y, comp)) + return 1; + #endif + return stbi__err("unknown image type", "Image not of any known type, or corrupt"); +} + +#ifndef STBI_NO_STDIO +STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) +{ + FILE *f = stbi__fopen(filename, "rb"); + int result; + if (!f) return stbi__err("can't fopen", "Unable to open file"); + result = stbi_info_from_file(f, x, y, comp); + fclose(f); + return result; +} + +STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) +{ + int r; + stbi__context s; + long pos = ftell(f); + stbi__start_file(&s, f); + r = stbi__info_main(&s,x,y,comp); + fseek(f,pos,SEEK_SET); + return r; +} +#endif // !STBI_NO_STDIO + +STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) +{ + stbi__context s; + stbi__start_mem(&s,buffer,len); + return stbi__info_main(&s,x,y,comp); +} + +STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) +{ + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); + return stbi__info_main(&s,x,y,comp); +} + +#endif // STB_IMAGE_IMPLEMENTATION + +/* + revision history: + 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes + 2.11 (2016-04-02) allocate large structures on the stack + remove white matting for transparent PSD + fix reported channel count for PNG & BMP + re-enable SSE2 in non-gcc 64-bit + support RGB-formatted JPEG + read 16-bit PNGs (only as 8-bit) + 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED + 2.09 (2016-01-16) allow comments in PNM files + 16-bit-per-pixel TGA (not bit-per-component) + info() for TGA could break due to .hdr handling + info() for BMP to shares code instead of sloppy parse + can use STBI_REALLOC_SIZED if allocator doesn't support realloc + code cleanup + 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA + 2.07 (2015-09-13) fix compiler warnings + partial animated GIF support + limited 16-bpc PSD support + #ifdef unused functions + bug with < 92 byte PIC,PNM,HDR,TGA + 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value + 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning + 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit + 2.03 (2015-04-12) extra corruption checking (mmozeiko) + stbi_set_flip_vertically_on_load (nguillemot) + fix NEON support; fix mingw support + 2.02 (2015-01-19) fix incorrect assert, fix warning + 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2 + 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG + 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg) + progressive JPEG (stb) + PGM/PPM support (Ken Miller) + STBI_MALLOC,STBI_REALLOC,STBI_FREE + GIF bugfix -- seemingly never worked + STBI_NO_*, STBI_ONLY_* + 1.48 (2014-12-14) fix incorrectly-named assert() + 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb) + optimize PNG (ryg) + fix bug in interlaced PNG with user-specified channel count (stb) + 1.46 (2014-08-26) + fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG + 1.45 (2014-08-16) + fix MSVC-ARM internal compiler error by wrapping malloc + 1.44 (2014-08-07) + various warning fixes from Ronny Chevalier + 1.43 (2014-07-15) + fix MSVC-only compiler problem in code changed in 1.42 + 1.42 (2014-07-09) + don't define _CRT_SECURE_NO_WARNINGS (affects user code) + fixes to stbi__cleanup_jpeg path + added STBI_ASSERT to avoid requiring assert.h + 1.41 (2014-06-25) + fix search&replace from 1.36 that messed up comments/error messages + 1.40 (2014-06-22) + fix gcc struct-initialization warning + 1.39 (2014-06-15) + fix to TGA optimization when req_comp != number of components in TGA; + fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite) + add support for BMP version 5 (more ignored fields) + 1.38 (2014-06-06) + suppress MSVC warnings on integer casts truncating values + fix accidental rename of 'skip' field of I/O + 1.37 (2014-06-04) + remove duplicate typedef + 1.36 (2014-06-03) + convert to header file single-file library + if de-iphone isn't set, load iphone images color-swapped instead of returning NULL + 1.35 (2014-05-27) + various warnings + fix broken STBI_SIMD path + fix bug where stbi_load_from_file no longer left file pointer in correct place + fix broken non-easy path for 32-bit BMP (possibly never used) + TGA optimization by Arseny Kapoulkine + 1.34 (unknown) + use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case + 1.33 (2011-07-14) + make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements + 1.32 (2011-07-13) + support for "info" function for all supported filetypes (SpartanJ) + 1.31 (2011-06-20) + a few more leak fixes, bug in PNG handling (SpartanJ) + 1.30 (2011-06-11) + added ability to load files via callbacks to accomidate custom input streams (Ben Wenger) + removed deprecated format-specific test/load functions + removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway + error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) + fix inefficiency in decoding 32-bit BMP (David Woo) + 1.29 (2010-08-16) + various warning fixes from Aurelien Pocheville + 1.28 (2010-08-01) + fix bug in GIF palette transparency (SpartanJ) + 1.27 (2010-08-01) + cast-to-stbi_uc to fix warnings + 1.26 (2010-07-24) + fix bug in file buffering for PNG reported by SpartanJ + 1.25 (2010-07-17) + refix trans_data warning (Won Chun) + 1.24 (2010-07-12) + perf improvements reading from files on platforms with lock-heavy fgetc() + minor perf improvements for jpeg + deprecated type-specific functions so we'll get feedback if they're needed + attempt to fix trans_data warning (Won Chun) + 1.23 fixed bug in iPhone support + 1.22 (2010-07-10) + removed image *writing* support + stbi_info support from Jetro Lauha + GIF support from Jean-Marc Lienher + iPhone PNG-extensions from James Brown + warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva) + 1.21 fix use of 'stbi_uc' in header (reported by jon blow) + 1.20 added support for Softimage PIC, by Tom Seddon + 1.19 bug in interlaced PNG corruption check (found by ryg) + 1.18 (2008-08-02) + fix a threading bug (local mutable static) + 1.17 support interlaced PNG + 1.16 major bugfix - stbi__convert_format converted one too many pixels + 1.15 initialize some fields for thread safety + 1.14 fix threadsafe conversion bug + header-file-only version (#define STBI_HEADER_FILE_ONLY before including) + 1.13 threadsafe + 1.12 const qualifiers in the API + 1.11 Support installable IDCT, colorspace conversion routines + 1.10 Fixes for 64-bit (don't use "unsigned long") + optimized upsampling by Fabian "ryg" Giesen + 1.09 Fix format-conversion for PSD code (bad global variables!) + 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz + 1.07 attempt to fix C++ warning/errors again + 1.06 attempt to fix C++ warning/errors again + 1.05 fix TGA loading to return correct *comp and use good luminance calc + 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free + 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR + 1.02 support for (subset of) HDR files, float interface for preferred access to them + 1.01 fix bug: possible bug in handling right-side up bmps... not sure + fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all + 1.00 interface to zlib that skips zlib header + 0.99 correct handling of alpha in palette + 0.98 TGA loader by lonesock; dynamically add loaders (untested) + 0.97 jpeg errors on too large a file; also catch another malloc failure + 0.96 fix detection of invalid v value - particleman@mollyrocket forum + 0.95 during header scan, seek to markers in case of padding + 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same + 0.93 handle jpegtran output; verbose errors + 0.92 read 4,8,16,24,32-bit BMP files of several formats + 0.91 output 24-bit Windows 3.0 BMP files + 0.90 fix a few more warnings; bump version number to approach 1.0 + 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd + 0.60 fix compiling as c++ + 0.59 fix warnings: merge Dave Moore's -Wall fixes + 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian + 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available + 0.56 fix bug: zlib uncompressed mode len vs. nlen + 0.55 fix bug: restart_interval not initialized to 0 + 0.54 allow NULL for 'int *comp' + 0.53 fix bug in png 3->4; speedup png decoding + 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments + 0.51 obey req_comp requests, 1-component jpegs return as 1-component, + on 'test' only check type, not whether we support this variant + 0.50 (2006-11-19) + first released version +*/ diff --git a/src/external/stb_image_resize.h b/src/external/stb_image_resize.h new file mode 100644 index 00000000..4cabe540 --- /dev/null +++ b/src/external/stb_image_resize.h @@ -0,0 +1,2578 @@ +/* stb_image_resize - v0.91 - public domain image resizing + by Jorge L Rodriguez (@VinoBS) - 2014 + http://github.com/nothings/stb + + Written with emphasis on usability, portability, and efficiency. (No + SIMD or threads, so it be easily outperformed by libs that use those.) + Only scaling and translation is supported, no rotations or shears. + Easy API downsamples w/Mitchell filter, upsamples w/cubic interpolation. + + COMPILING & LINKING + In one C/C++ file that #includes this file, do this: + #define STB_IMAGE_RESIZE_IMPLEMENTATION + before the #include. That will create the implementation in that file. + + QUICKSTART + stbir_resize_uint8( input_pixels , in_w , in_h , 0, + output_pixels, out_w, out_h, 0, num_channels) + stbir_resize_float(...) + stbir_resize_uint8_srgb( input_pixels , in_w , in_h , 0, + output_pixels, out_w, out_h, 0, + num_channels , alpha_chan , 0) + stbir_resize_uint8_srgb_edgemode( + input_pixels , in_w , in_h , 0, + output_pixels, out_w, out_h, 0, + num_channels , alpha_chan , 0, STBIR_EDGE_CLAMP) + // WRAP/REFLECT/ZERO + + FULL API + See the "header file" section of the source for API documentation. + + ADDITIONAL DOCUMENTATION + + SRGB & FLOATING POINT REPRESENTATION + The sRGB functions presume IEEE floating point. If you do not have + IEEE floating point, define STBIR_NON_IEEE_FLOAT. This will use + a slower implementation. + + MEMORY ALLOCATION + The resize functions here perform a single memory allocation using + malloc. To control the memory allocation, before the #include that + triggers the implementation, do: + + #define STBIR_MALLOC(size,context) ... + #define STBIR_FREE(ptr,context) ... + + Each resize function makes exactly one call to malloc/free, so to use + temp memory, store the temp memory in the context and return that. + + ASSERT + Define STBIR_ASSERT(boolval) to override assert() and not use assert.h + + OPTIMIZATION + Define STBIR_SATURATE_INT to compute clamp values in-range using + integer operations instead of float operations. This may be faster + on some platforms. + + DEFAULT FILTERS + For functions which don't provide explicit control over what filters + to use, you can change the compile-time defaults with + + #define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_something + #define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_something + + See stbir_filter in the header-file section for the list of filters. + + NEW FILTERS + A number of 1D filter kernels are used. For a list of + supported filters see the stbir_filter enum. To add a new filter, + write a filter function and add it to stbir__filter_info_table. + + PROGRESS + For interactive use with slow resize operations, you can install + a progress-report callback: + + #define STBIR_PROGRESS_REPORT(val) some_func(val) + + The parameter val is a float which goes from 0 to 1 as progress is made. + + For example: + + static void my_progress_report(float progress); + #define STBIR_PROGRESS_REPORT(val) my_progress_report(val) + + #define STB_IMAGE_RESIZE_IMPLEMENTATION + #include "stb_image_resize.h" + + static void my_progress_report(float progress) + { + printf("Progress: %f%%\n", progress*100); + } + + MAX CHANNELS + If your image has more than 64 channels, define STBIR_MAX_CHANNELS + to the max you'll have. + + ALPHA CHANNEL + Most of the resizing functions provide the ability to control how + the alpha channel of an image is processed. The important things + to know about this: + + 1. The best mathematically-behaved version of alpha to use is + called "premultiplied alpha", in which the other color channels + have had the alpha value multiplied in. If you use premultiplied + alpha, linear filtering (such as image resampling done by this + library, or performed in texture units on GPUs) does the "right + thing". While premultiplied alpha is standard in the movie CGI + industry, it is still uncommon in the videogame/real-time world. + + If you linearly filter non-premultiplied alpha, strange effects + occur. (For example, the average of 1% opaque bright green + and 99% opaque black produces 50% transparent dark green when + non-premultiplied, whereas premultiplied it produces 50% + transparent near-black. The former introduces green energy + that doesn't exist in the source image.) + + 2. Artists should not edit premultiplied-alpha images; artists + want non-premultiplied alpha images. Thus, art tools generally output + non-premultiplied alpha images. + + 3. You will get best results in most cases by converting images + to premultiplied alpha before processing them mathematically. + + 4. If you pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED, the + resizer does not do anything special for the alpha channel; + it is resampled identically to other channels. This produces + the correct results for premultiplied-alpha images, but produces + less-than-ideal results for non-premultiplied-alpha images. + + 5. If you do not pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED, + then the resizer weights the contribution of input pixels + based on their alpha values, or, equivalently, it multiplies + the alpha value into the color channels, resamples, then divides + by the resultant alpha value. Input pixels which have alpha=0 do + not contribute at all to output pixels unless _all_ of the input + pixels affecting that output pixel have alpha=0, in which case + the result for that pixel is the same as it would be without + STBIR_FLAG_ALPHA_PREMULTIPLIED. However, this is only true for + input images in integer formats. For input images in float format, + input pixels with alpha=0 have no effect, and output pixels + which have alpha=0 will be 0 in all channels. (For float images, + you can manually achieve the same result by adding a tiny epsilon + value to the alpha channel of every image, and then subtracting + or clamping it at the end.) + + 6. You can suppress the behavior described in #5 and make + all-0-alpha pixels have 0 in all channels by #defining + STBIR_NO_ALPHA_EPSILON. + + 7. You can separately control whether the alpha channel is + interpreted as linear or affected by the colorspace. By default + it is linear; you almost never want to apply the colorspace. + (For example, graphics hardware does not apply sRGB conversion + to the alpha channel.) + + ADDITIONAL CONTRIBUTORS + Sean Barrett: API design, optimizations + + REVISIONS + 0.91 (2016-04-02) fix warnings; fix handling of subpixel regions + 0.90 (2014-09-17) first released version + + LICENSE + + This software is dual-licensed to the public domain and under the following + license: you are granted a perpetual, irrevocable license to copy, modify, + publish, and distribute this file as you see fit. + + TODO + Don't decode all of the image data when only processing a partial tile + Don't use full-width decode buffers when only processing a partial tile + When processing wide images, break processing into tiles so data fits in L1 cache + Installable filters? + Resize that respects alpha test coverage + (Reference code: FloatImage::alphaTestCoverage and FloatImage::scaleAlphaToCoverage: + https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp ) +*/ + +#ifndef STBIR_INCLUDE_STB_IMAGE_RESIZE_H +#define STBIR_INCLUDE_STB_IMAGE_RESIZE_H + +#ifdef _MSC_VER +typedef unsigned char stbir_uint8; +typedef unsigned short stbir_uint16; +typedef unsigned int stbir_uint32; +#else +#include +typedef uint8_t stbir_uint8; +typedef uint16_t stbir_uint16; +typedef uint32_t stbir_uint32; +#endif + +#ifdef STB_IMAGE_RESIZE_STATIC +#define STBIRDEF static +#else +#ifdef __cplusplus +#define STBIRDEF extern "C" +#else +#define STBIRDEF extern +#endif +#endif + + +////////////////////////////////////////////////////////////////////////////// +// +// Easy-to-use API: +// +// * "input pixels" points to an array of image data with 'num_channels' channels (e.g. RGB=3, RGBA=4) +// * input_w is input image width (x-axis), input_h is input image height (y-axis) +// * stride is the offset between successive rows of image data in memory, in bytes. you can +// specify 0 to mean packed continuously in memory +// * alpha channel is treated identically to other channels. +// * colorspace is linear or sRGB as specified by function name +// * returned result is 1 for success or 0 in case of an error. +// #define STBIR_ASSERT() to trigger an assert on parameter validation errors. +// * Memory required grows approximately linearly with input and output size, but with +// discontinuities at input_w == output_w and input_h == output_h. +// * These functions use a "default" resampling filter defined at compile time. To change the filter, +// you can change the compile-time defaults by #defining STBIR_DEFAULT_FILTER_UPSAMPLE +// and STBIR_DEFAULT_FILTER_DOWNSAMPLE, or you can use the medium-complexity API. + +STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels); + +STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + float *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels); + + +// The following functions interpret image data as gamma-corrected sRGB. +// Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel, +// or otherwise provide the index of the alpha channel. Flags value +// of 0 will probably do the right thing if you're not sure what +// the flags mean. + +#define STBIR_ALPHA_CHANNEL_NONE -1 + +// Set this flag if your texture has premultiplied alpha. Otherwise, stbir will +// use alpha-weighted resampling (effectively premultiplying, resampling, +// then unpremultiplying). +#define STBIR_FLAG_ALPHA_PREMULTIPLIED (1 << 0) +// The specified alpha channel should be handled as gamma-corrected value even +// when doing sRGB operations. +#define STBIR_FLAG_ALPHA_USES_COLORSPACE (1 << 1) + +STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags); + + +typedef enum +{ + STBIR_EDGE_CLAMP = 1, + STBIR_EDGE_REFLECT = 2, + STBIR_EDGE_WRAP = 3, + STBIR_EDGE_ZERO = 4, +} stbir_edge; + +// This function adds the ability to specify how requests to sample off the edge of the image are handled. +STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode); + +////////////////////////////////////////////////////////////////////////////// +// +// Medium-complexity API +// +// This extends the easy-to-use API as follows: +// +// * Alpha-channel can be processed separately +// * If alpha_channel is not STBIR_ALPHA_CHANNEL_NONE +// * Alpha channel will not be gamma corrected (unless flags&STBIR_FLAG_GAMMA_CORRECT) +// * Filters will be weighted by alpha channel (unless flags&STBIR_FLAG_ALPHA_PREMULTIPLIED) +// * Filter can be selected explicitly +// * uint16 image type +// * sRGB colorspace available for all types +// * context parameter for passing to STBIR_MALLOC + +typedef enum +{ + STBIR_FILTER_DEFAULT = 0, // use same filter type that easy-to-use API chooses + STBIR_FILTER_BOX = 1, // A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios + STBIR_FILTER_TRIANGLE = 2, // On upsampling, produces same results as bilinear texture filtering + STBIR_FILTER_CUBICBSPLINE = 3, // The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque + STBIR_FILTER_CATMULLROM = 4, // An interpolating cubic spline + STBIR_FILTER_MITCHELL = 5, // Mitchell-Netrevalli filter with B=1/3, C=1/3 +} stbir_filter; + +typedef enum +{ + STBIR_COLORSPACE_LINEAR, + STBIR_COLORSPACE_SRGB, + + STBIR_MAX_COLORSPACES, +} stbir_colorspace; + +// The following functions are all identical except for the type of the image data + +STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context); + +STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context); + +STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context); + + + +////////////////////////////////////////////////////////////////////////////// +// +// Full-complexity API +// +// This extends the medium API as follows: +// +// * uint32 image type +// * not typesafe +// * separate filter types for each axis +// * separate edge modes for each axis +// * can specify scale explicitly for subpixel correctness +// * can specify image source tile using texture coordinates + +typedef enum +{ + STBIR_TYPE_UINT8 , + STBIR_TYPE_UINT16, + STBIR_TYPE_UINT32, + STBIR_TYPE_FLOAT , + + STBIR_MAX_TYPES +} stbir_datatype; + +STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context); + +STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context, + float x_scale, float y_scale, + float x_offset, float y_offset); + +STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context, + float s0, float t0, float s1, float t1); +// (s0, t0) & (s1, t1) are the top-left and bottom right corner (uv addressing style: [0, 1]x[0, 1]) of a region of the input image to use. + +// +// +//// end header file ///////////////////////////////////////////////////// +#endif // STBIR_INCLUDE_STB_IMAGE_RESIZE_H + + + + + +#ifdef STB_IMAGE_RESIZE_IMPLEMENTATION + +#ifndef STBIR_ASSERT +#include +#define STBIR_ASSERT(x) assert(x) +#endif + +// For memset +#include + +#include + +#ifndef STBIR_MALLOC +#include +#define STBIR_MALLOC(size,c) malloc(size) +#define STBIR_FREE(ptr,c) free(ptr) +#endif + +#ifndef _MSC_VER +#ifdef __cplusplus +#define stbir__inline inline +#else +#define stbir__inline +#endif +#else +#define stbir__inline __forceinline +#endif + + +// should produce compiler error if size is wrong +typedef unsigned char stbir__validate_uint32[sizeof(stbir_uint32) == 4 ? 1 : -1]; + +#ifdef _MSC_VER +#define STBIR__NOTUSED(v) (void)(v) +#else +#define STBIR__NOTUSED(v) (void)sizeof(v) +#endif + +#define STBIR__ARRAY_SIZE(a) (sizeof((a))/sizeof((a)[0])) + +#ifndef STBIR_DEFAULT_FILTER_UPSAMPLE +#define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM +#endif + +#ifndef STBIR_DEFAULT_FILTER_DOWNSAMPLE +#define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL +#endif + +#ifndef STBIR_PROGRESS_REPORT +#define STBIR_PROGRESS_REPORT(float_0_to_1) +#endif + +#ifndef STBIR_MAX_CHANNELS +#define STBIR_MAX_CHANNELS 64 +#endif + +#if STBIR_MAX_CHANNELS > 65536 +#error "Too many channels; STBIR_MAX_CHANNELS must be no more than 65536." +// because we store the indices in 16-bit variables +#endif + +// This value is added to alpha just before premultiplication to avoid +// zeroing out color values. It is equivalent to 2^-80. If you don't want +// that behavior (it may interfere if you have floating point images with +// very small alpha values) then you can define STBIR_NO_ALPHA_EPSILON to +// disable it. +#ifndef STBIR_ALPHA_EPSILON +#define STBIR_ALPHA_EPSILON ((float)1 / (1 << 20) / (1 << 20) / (1 << 20) / (1 << 20)) +#endif + + + +#ifdef _MSC_VER +#define STBIR__UNUSED_PARAM(v) (void)(v) +#else +#define STBIR__UNUSED_PARAM(v) (void)sizeof(v) +#endif + +// must match stbir_datatype +static unsigned char stbir__type_size[] = { + 1, // STBIR_TYPE_UINT8 + 2, // STBIR_TYPE_UINT16 + 4, // STBIR_TYPE_UINT32 + 4, // STBIR_TYPE_FLOAT +}; + +// Kernel function centered at 0 +typedef float (stbir__kernel_fn)(float x, float scale); +typedef float (stbir__support_fn)(float scale); + +typedef struct +{ + stbir__kernel_fn* kernel; + stbir__support_fn* support; +} stbir__filter_info; + +// When upsampling, the contributors are which source pixels contribute. +// When downsampling, the contributors are which destination pixels are contributed to. +typedef struct +{ + int n0; // First contributing pixel + int n1; // Last contributing pixel +} stbir__contributors; + +typedef struct +{ + const void* input_data; + int input_w; + int input_h; + int input_stride_bytes; + + void* output_data; + int output_w; + int output_h; + int output_stride_bytes; + + float s0, t0, s1, t1; + + float horizontal_shift; // Units: output pixels + float vertical_shift; // Units: output pixels + float horizontal_scale; + float vertical_scale; + + int channels; + int alpha_channel; + stbir_uint32 flags; + stbir_datatype type; + stbir_filter horizontal_filter; + stbir_filter vertical_filter; + stbir_edge edge_horizontal; + stbir_edge edge_vertical; + stbir_colorspace colorspace; + + stbir__contributors* horizontal_contributors; + float* horizontal_coefficients; + + stbir__contributors* vertical_contributors; + float* vertical_coefficients; + + int decode_buffer_pixels; + float* decode_buffer; + + float* horizontal_buffer; + + // cache these because ceil/floor are inexplicably showing up in profile + int horizontal_coefficient_width; + int vertical_coefficient_width; + int horizontal_filter_pixel_width; + int vertical_filter_pixel_width; + int horizontal_filter_pixel_margin; + int vertical_filter_pixel_margin; + int horizontal_num_contributors; + int vertical_num_contributors; + + int ring_buffer_length_bytes; // The length of an individual entry in the ring buffer. The total number of ring buffers is stbir__get_filter_pixel_width(filter) + int ring_buffer_first_scanline; + int ring_buffer_last_scanline; + int ring_buffer_begin_index; + float* ring_buffer; + + float* encode_buffer; // A temporary buffer to store floats so we don't lose precision while we do multiply-adds. + + int horizontal_contributors_size; + int horizontal_coefficients_size; + int vertical_contributors_size; + int vertical_coefficients_size; + int decode_buffer_size; + int horizontal_buffer_size; + int ring_buffer_size; + int encode_buffer_size; +} stbir__info; + +static stbir__inline int stbir__min(int a, int b) +{ + return a < b ? a : b; +} + +static stbir__inline int stbir__max(int a, int b) +{ + return a > b ? a : b; +} + +static stbir__inline float stbir__saturate(float x) +{ + if (x < 0) + return 0; + + if (x > 1) + return 1; + + return x; +} + +#ifdef STBIR_SATURATE_INT +static stbir__inline stbir_uint8 stbir__saturate8(int x) +{ + if ((unsigned int) x <= 255) + return x; + + if (x < 0) + return 0; + + return 255; +} + +static stbir__inline stbir_uint16 stbir__saturate16(int x) +{ + if ((unsigned int) x <= 65535) + return x; + + if (x < 0) + return 0; + + return 65535; +} +#endif + +static float stbir__srgb_uchar_to_linear_float[256] = { + 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f, + 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f, + 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f, + 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f, + 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f, + 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f, + 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f, + 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f, + 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f, + 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f, + 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f, + 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f, + 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f, + 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f, + 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f, + 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f, + 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f, + 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f, + 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f, + 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f, + 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f, + 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f, + 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f, + 0.982251f, 0.991102f, 1.0f +}; + +static float stbir__srgb_to_linear(float f) +{ + if (f <= 0.04045f) + return f / 12.92f; + else + return (float)pow((f + 0.055f) / 1.055f, 2.4f); +} + +static float stbir__linear_to_srgb(float f) +{ + if (f <= 0.0031308f) + return f * 12.92f; + else + return 1.055f * (float)pow(f, 1 / 2.4f) - 0.055f; +} + +#ifndef STBIR_NON_IEEE_FLOAT +// From https://gist.github.com/rygorous/2203834 + +typedef union +{ + stbir_uint32 u; + float f; +} stbir__FP32; + +static const stbir_uint32 fp32_to_srgb8_tab4[104] = { + 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d, + 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a, + 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033, + 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067, + 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5, + 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2, + 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143, + 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af, + 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240, + 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300, + 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401, + 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559, + 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723, +}; + +static stbir_uint8 stbir__linear_to_srgb_uchar(float in) +{ + static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps + static const stbir__FP32 minval = { (127-13) << 23 }; + stbir_uint32 tab,bias,scale,t; + stbir__FP32 f; + + // Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively. + // The tests are carefully written so that NaNs map to 0, same as in the reference + // implementation. + if (!(in > minval.f)) // written this way to catch NaNs + in = minval.f; + if (in > almostone.f) + in = almostone.f; + + // Do the table lookup and unpack bias, scale + f.f = in; + tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20]; + bias = (tab >> 16) << 9; + scale = tab & 0xffff; + + // Grab next-highest mantissa bits and perform linear interpolation + t = (f.u >> 12) & 0xff; + return (unsigned char) ((bias + scale*t) >> 16); +} + +#else +// sRGB transition values, scaled by 1<<28 +static int stbir__srgb_offset_to_linear_scaled[256] = +{ + 0, 40738, 122216, 203693, 285170, 366648, 448125, 529603, + 611080, 692557, 774035, 855852, 942009, 1033024, 1128971, 1229926, + 1335959, 1447142, 1563542, 1685229, 1812268, 1944725, 2082664, 2226148, + 2375238, 2529996, 2690481, 2856753, 3028870, 3206888, 3390865, 3580856, + 3776916, 3979100, 4187460, 4402049, 4622919, 4850123, 5083710, 5323731, + 5570236, 5823273, 6082892, 6349140, 6622065, 6901714, 7188133, 7481369, + 7781466, 8088471, 8402427, 8723380, 9051372, 9386448, 9728650, 10078021, + 10434603, 10798439, 11169569, 11548036, 11933879, 12327139, 12727857, 13136073, + 13551826, 13975156, 14406100, 14844697, 15290987, 15745007, 16206795, 16676389, + 17153826, 17639142, 18132374, 18633560, 19142734, 19659934, 20185196, 20718552, + 21260042, 21809696, 22367554, 22933648, 23508010, 24090680, 24681686, 25281066, + 25888850, 26505076, 27129772, 27762974, 28404716, 29055026, 29713942, 30381490, + 31057708, 31742624, 32436272, 33138682, 33849884, 34569912, 35298800, 36036568, + 36783260, 37538896, 38303512, 39077136, 39859796, 40651528, 41452360, 42262316, + 43081432, 43909732, 44747252, 45594016, 46450052, 47315392, 48190064, 49074096, + 49967516, 50870356, 51782636, 52704392, 53635648, 54576432, 55526772, 56486700, + 57456236, 58435408, 59424248, 60422780, 61431036, 62449032, 63476804, 64514376, + 65561776, 66619028, 67686160, 68763192, 69850160, 70947088, 72053992, 73170912, + 74297864, 75434880, 76581976, 77739184, 78906536, 80084040, 81271736, 82469648, + 83677792, 84896192, 86124888, 87363888, 88613232, 89872928, 91143016, 92423512, + 93714432, 95015816, 96327688, 97650056, 98982952, 100326408, 101680440, 103045072, + 104420320, 105806224, 107202800, 108610064, 110028048, 111456776, 112896264, 114346544, + 115807632, 117279552, 118762328, 120255976, 121760536, 123276016, 124802440, 126339832, + 127888216, 129447616, 131018048, 132599544, 134192112, 135795792, 137410592, 139036528, + 140673648, 142321952, 143981456, 145652208, 147334208, 149027488, 150732064, 152447968, + 154175200, 155913792, 157663776, 159425168, 161197984, 162982240, 164777968, 166585184, + 168403904, 170234160, 172075968, 173929344, 175794320, 177670896, 179559120, 181458992, + 183370528, 185293776, 187228736, 189175424, 191133888, 193104112, 195086128, 197079968, + 199085648, 201103184, 203132592, 205173888, 207227120, 209292272, 211369392, 213458480, + 215559568, 217672656, 219797792, 221934976, 224084240, 226245600, 228419056, 230604656, + 232802400, 235012320, 237234432, 239468736, 241715280, 243974080, 246245120, 248528464, + 250824112, 253132064, 255452368, 257785040, 260130080, 262487520, 264857376, 267239664, +}; + +static stbir_uint8 stbir__linear_to_srgb_uchar(float f) +{ + int x = (int) (f * (1 << 28)); // has headroom so you don't need to clamp + int v = 0; + int i; + + // Refine the guess with a short binary search. + i = v + 128; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 64; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 32; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 16; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 8; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 4; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 2; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + i = v + 1; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; + + return (stbir_uint8) v; +} +#endif + +static float stbir__filter_trapezoid(float x, float scale) +{ + float halfscale = scale / 2; + float t = 0.5f + halfscale; + STBIR_ASSERT(scale <= 1); + + x = (float)fabs(x); + + if (x >= t) + return 0; + else + { + float r = 0.5f - halfscale; + if (x <= r) + return 1; + else + return (t - x) / scale; + } +} + +static float stbir__support_trapezoid(float scale) +{ + STBIR_ASSERT(scale <= 1); + return 0.5f + scale / 2; +} + +static float stbir__filter_triangle(float x, float s) +{ + STBIR__UNUSED_PARAM(s); + + x = (float)fabs(x); + + if (x <= 1.0f) + return 1 - x; + else + return 0; +} + +static float stbir__filter_cubic(float x, float s) +{ + STBIR__UNUSED_PARAM(s); + + x = (float)fabs(x); + + if (x < 1.0f) + return (4 + x*x*(3*x - 6))/6; + else if (x < 2.0f) + return (8 + x*(-12 + x*(6 - x)))/6; + + return (0.0f); +} + +static float stbir__filter_catmullrom(float x, float s) +{ + STBIR__UNUSED_PARAM(s); + + x = (float)fabs(x); + + if (x < 1.0f) + return 1 - x*x*(2.5f - 1.5f*x); + else if (x < 2.0f) + return 2 - x*(4 + x*(0.5f*x - 2.5f)); + + return (0.0f); +} + +static float stbir__filter_mitchell(float x, float s) +{ + STBIR__UNUSED_PARAM(s); + + x = (float)fabs(x); + + if (x < 1.0f) + return (16 + x*x*(21 * x - 36))/18; + else if (x < 2.0f) + return (32 + x*(-60 + x*(36 - 7*x)))/18; + + return (0.0f); +} + +static float stbir__support_zero(float s) +{ + STBIR__UNUSED_PARAM(s); + return 0; +} + +static float stbir__support_one(float s) +{ + STBIR__UNUSED_PARAM(s); + return 1; +} + +static float stbir__support_two(float s) +{ + STBIR__UNUSED_PARAM(s); + return 2; +} + +static stbir__filter_info stbir__filter_info_table[] = { + { NULL, stbir__support_zero }, + { stbir__filter_trapezoid, stbir__support_trapezoid }, + { stbir__filter_triangle, stbir__support_one }, + { stbir__filter_cubic, stbir__support_two }, + { stbir__filter_catmullrom, stbir__support_two }, + { stbir__filter_mitchell, stbir__support_two }, +}; + +stbir__inline static int stbir__use_upsampling(float ratio) +{ + return ratio > 1; +} + +stbir__inline static int stbir__use_width_upsampling(stbir__info* stbir_info) +{ + return stbir__use_upsampling(stbir_info->horizontal_scale); +} + +stbir__inline static int stbir__use_height_upsampling(stbir__info* stbir_info) +{ + return stbir__use_upsampling(stbir_info->vertical_scale); +} + +// This is the maximum number of input samples that can affect an output sample +// with the given filter +static int stbir__get_filter_pixel_width(stbir_filter filter, float scale) +{ + STBIR_ASSERT(filter != 0); + STBIR_ASSERT(filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); + + if (stbir__use_upsampling(scale)) + return (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2); + else + return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2 / scale); +} + +// This is how much to expand buffers to account for filters seeking outside +// the image boundaries. +static int stbir__get_filter_pixel_margin(stbir_filter filter, float scale) +{ + return stbir__get_filter_pixel_width(filter, scale) / 2; +} + +static int stbir__get_coefficient_width(stbir_filter filter, float scale) +{ + if (stbir__use_upsampling(scale)) + return (int)ceil(stbir__filter_info_table[filter].support(1 / scale) * 2); + else + return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2); +} + +static int stbir__get_contributors(float scale, stbir_filter filter, int input_size, int output_size) +{ + if (stbir__use_upsampling(scale)) + return output_size; + else + return (input_size + stbir__get_filter_pixel_margin(filter, scale) * 2); +} + +static int stbir__get_total_horizontal_coefficients(stbir__info* info) +{ + return info->horizontal_num_contributors + * stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); +} + +static int stbir__get_total_vertical_coefficients(stbir__info* info) +{ + return info->vertical_num_contributors + * stbir__get_coefficient_width (info->vertical_filter, info->vertical_scale); +} + +static stbir__contributors* stbir__get_contributor(stbir__contributors* contributors, int n) +{ + return &contributors[n]; +} + +// For perf reasons this code is duplicated in stbir__resample_horizontal_upsample/downsample, +// if you change it here change it there too. +static float* stbir__get_coefficient(float* coefficients, stbir_filter filter, float scale, int n, int c) +{ + int width = stbir__get_coefficient_width(filter, scale); + return &coefficients[width*n + c]; +} + +static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max) +{ + switch (edge) + { + case STBIR_EDGE_ZERO: + return 0; // we'll decode the wrong pixel here, and then overwrite with 0s later + + case STBIR_EDGE_CLAMP: + if (n < 0) + return 0; + + if (n >= max) + return max - 1; + + return n; // NOTREACHED + + case STBIR_EDGE_REFLECT: + { + if (n < 0) + { + if (n < max) + return -n; + else + return max - 1; + } + + if (n >= max) + { + int max2 = max * 2; + if (n >= max2) + return 0; + else + return max2 - n - 1; + } + + return n; // NOTREACHED + } + + case STBIR_EDGE_WRAP: + if (n >= 0) + return (n % max); + else + { + int m = (-n) % max; + + if (m != 0) + m = max - m; + + return (m); + } + return n; // NOTREACHED + + default: + STBIR_ASSERT(!"Unimplemented edge type"); + return 0; + } +} + +stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max) +{ + // avoid per-pixel switch + if (n >= 0 && n < max) + return n; + return stbir__edge_wrap_slow(edge, n, max); +} + +// What input pixels contribute to this output pixel? +static void stbir__calculate_sample_range_upsample(int n, float out_filter_radius, float scale_ratio, float out_shift, int* in_first_pixel, int* in_last_pixel, float* in_center_of_out) +{ + float out_pixel_center = (float)n + 0.5f; + float out_pixel_influence_lowerbound = out_pixel_center - out_filter_radius; + float out_pixel_influence_upperbound = out_pixel_center + out_filter_radius; + + float in_pixel_influence_lowerbound = (out_pixel_influence_lowerbound + out_shift) / scale_ratio; + float in_pixel_influence_upperbound = (out_pixel_influence_upperbound + out_shift) / scale_ratio; + + *in_center_of_out = (out_pixel_center + out_shift) / scale_ratio; + *in_first_pixel = (int)(floor(in_pixel_influence_lowerbound + 0.5)); + *in_last_pixel = (int)(floor(in_pixel_influence_upperbound - 0.5)); +} + +// What output pixels does this input pixel contribute to? +static void stbir__calculate_sample_range_downsample(int n, float in_pixels_radius, float scale_ratio, float out_shift, int* out_first_pixel, int* out_last_pixel, float* out_center_of_in) +{ + float in_pixel_center = (float)n + 0.5f; + float in_pixel_influence_lowerbound = in_pixel_center - in_pixels_radius; + float in_pixel_influence_upperbound = in_pixel_center + in_pixels_radius; + + float out_pixel_influence_lowerbound = in_pixel_influence_lowerbound * scale_ratio - out_shift; + float out_pixel_influence_upperbound = in_pixel_influence_upperbound * scale_ratio - out_shift; + + *out_center_of_in = in_pixel_center * scale_ratio - out_shift; + *out_first_pixel = (int)(floor(out_pixel_influence_lowerbound + 0.5)); + *out_last_pixel = (int)(floor(out_pixel_influence_upperbound - 0.5)); +} + +static void stbir__calculate_coefficients_upsample(stbir__info* stbir_info, stbir_filter filter, float scale, int in_first_pixel, int in_last_pixel, float in_center_of_out, stbir__contributors* contributor, float* coefficient_group) +{ + int i; + float total_filter = 0; + float filter_scale; + + STBIR_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. + + contributor->n0 = in_first_pixel; + contributor->n1 = in_last_pixel; + + STBIR_ASSERT(contributor->n1 >= contributor->n0); + + for (i = 0; i <= in_last_pixel - in_first_pixel; i++) + { + float in_pixel_center = (float)(i + in_first_pixel) + 0.5f; + coefficient_group[i] = stbir__filter_info_table[filter].kernel(in_center_of_out - in_pixel_center, 1 / scale); + + // If the coefficient is zero, skip it. (Don't do the <0 check here, we want the influence of those outside pixels.) + if (i == 0 && !coefficient_group[i]) + { + contributor->n0 = ++in_first_pixel; + i--; + continue; + } + + total_filter += coefficient_group[i]; + } + + STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); + + STBIR_ASSERT(total_filter > 0.9); + STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. + + // Make sure the sum of all coefficients is 1. + filter_scale = 1 / total_filter; + + for (i = 0; i <= in_last_pixel - in_first_pixel; i++) + coefficient_group[i] *= filter_scale; + + for (i = in_last_pixel - in_first_pixel; i >= 0; i--) + { + if (coefficient_group[i]) + break; + + // This line has no weight. We can skip it. + contributor->n1 = contributor->n0 + i - 1; + } +} + +static void stbir__calculate_coefficients_downsample(stbir__info* stbir_info, stbir_filter filter, float scale_ratio, int out_first_pixel, int out_last_pixel, float out_center_of_in, stbir__contributors* contributor, float* coefficient_group) +{ + int i; + + STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. + + contributor->n0 = out_first_pixel; + contributor->n1 = out_last_pixel; + + STBIR_ASSERT(contributor->n1 >= contributor->n0); + + for (i = 0; i <= out_last_pixel - out_first_pixel; i++) + { + float out_pixel_center = (float)(i + out_first_pixel) + 0.5f; + float x = out_pixel_center - out_center_of_in; + coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; + } + + STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); + + for (i = out_last_pixel - out_first_pixel; i >= 0; i--) + { + if (coefficient_group[i]) + break; + + // This line has no weight. We can skip it. + contributor->n1 = contributor->n0 + i - 1; + } +} + +static void stbir__normalize_downsample_coefficients(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size) +{ + int num_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); + int num_coefficients = stbir__get_coefficient_width(filter, scale_ratio); + int i, j; + int skip; + + for (i = 0; i < output_size; i++) + { + float scale; + float total = 0; + + for (j = 0; j < num_contributors; j++) + { + if (i >= contributors[j].n0 && i <= contributors[j].n1) + { + float coefficient = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0); + total += coefficient; + } + else if (i < contributors[j].n0) + break; + } + + STBIR_ASSERT(total > 0.9f); + STBIR_ASSERT(total < 1.1f); + + scale = 1 / total; + + for (j = 0; j < num_contributors; j++) + { + if (i >= contributors[j].n0 && i <= contributors[j].n1) + *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0) *= scale; + else if (i < contributors[j].n0) + break; + } + } + + // Optimize: Skip zero coefficients and contributions outside of image bounds. + // Do this after normalizing because normalization depends on the n0/n1 values. + for (j = 0; j < num_contributors; j++) + { + int range, max, width; + + skip = 0; + while (*stbir__get_coefficient(coefficients, filter, scale_ratio, j, skip) == 0) + skip++; + + contributors[j].n0 += skip; + + while (contributors[j].n0 < 0) + { + contributors[j].n0++; + skip++; + } + + range = contributors[j].n1 - contributors[j].n0 + 1; + max = stbir__min(num_coefficients, range); + + width = stbir__get_coefficient_width(filter, scale_ratio); + for (i = 0; i < max; i++) + { + if (i + skip >= width) + break; + + *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i) = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i + skip); + } + + continue; + } + + // Using min to avoid writing into invalid pixels. + for (i = 0; i < num_contributors; i++) + contributors[i].n1 = stbir__min(contributors[i].n1, output_size - 1); +} + +// Each scan line uses the same kernel values so we should calculate the kernel +// values once and then we can use them for every scan line. +static void stbir__calculate_filters(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size) +{ + int n; + int total_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); + + if (stbir__use_upsampling(scale_ratio)) + { + float out_pixels_radius = stbir__filter_info_table[filter].support(1 / scale_ratio) * scale_ratio; + + // Looping through out pixels + for (n = 0; n < total_contributors; n++) + { + float in_center_of_out; // Center of the current out pixel in the in pixel space + int in_first_pixel, in_last_pixel; + + stbir__calculate_sample_range_upsample(n, out_pixels_radius, scale_ratio, shift, &in_first_pixel, &in_last_pixel, &in_center_of_out); + + stbir__calculate_coefficients_upsample(stbir_info, filter, scale_ratio, in_first_pixel, in_last_pixel, in_center_of_out, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); + } + } + else + { + float in_pixels_radius = stbir__filter_info_table[filter].support(scale_ratio) / scale_ratio; + + // Looping through in pixels + for (n = 0; n < total_contributors; n++) + { + float out_center_of_in; // Center of the current out pixel in the in pixel space + int out_first_pixel, out_last_pixel; + int n_adjusted = n - stbir__get_filter_pixel_margin(filter, scale_ratio); + + stbir__calculate_sample_range_downsample(n_adjusted, in_pixels_radius, scale_ratio, shift, &out_first_pixel, &out_last_pixel, &out_center_of_in); + + stbir__calculate_coefficients_downsample(stbir_info, filter, scale_ratio, out_first_pixel, out_last_pixel, out_center_of_in, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); + } + + stbir__normalize_downsample_coefficients(stbir_info, contributors, coefficients, filter, scale_ratio, shift, input_size, output_size); + } +} + +static float* stbir__get_decode_buffer(stbir__info* stbir_info) +{ + // The 0 index of the decode buffer starts after the margin. This makes + // it okay to use negative indexes on the decode buffer. + return &stbir_info->decode_buffer[stbir_info->horizontal_filter_pixel_margin * stbir_info->channels]; +} + +#define STBIR__DECODE(type, colorspace) ((type) * (STBIR_MAX_COLORSPACES) + (colorspace)) + +static void stbir__decode_scanline(stbir__info* stbir_info, int n) +{ + int c; + int channels = stbir_info->channels; + int alpha_channel = stbir_info->alpha_channel; + int type = stbir_info->type; + int colorspace = stbir_info->colorspace; + int input_w = stbir_info->input_w; + int input_stride_bytes = stbir_info->input_stride_bytes; + float* decode_buffer = stbir__get_decode_buffer(stbir_info); + stbir_edge edge_horizontal = stbir_info->edge_horizontal; + stbir_edge edge_vertical = stbir_info->edge_vertical; + int in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes; + const void* input_data = (char *) stbir_info->input_data + in_buffer_row_offset; + int max_x = input_w + stbir_info->horizontal_filter_pixel_margin; + int decode = STBIR__DECODE(type, colorspace); + + int x = -stbir_info->horizontal_filter_pixel_margin; + + // special handling for STBIR_EDGE_ZERO because it needs to return an item that doesn't appear in the input, + // and we want to avoid paying overhead on every pixel if not STBIR_EDGE_ZERO + if (edge_vertical == STBIR_EDGE_ZERO && (n < 0 || n >= stbir_info->input_h)) + { + for (; x < max_x; x++) + for (c = 0; c < channels; c++) + decode_buffer[x*channels + c] = 0; + return; + } + + switch (decode) + { + case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = ((float)((const unsigned char*)input_data)[input_pixel_index + c]) / 255; + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = stbir__srgb_uchar_to_linear_float[((const unsigned char*)input_data)[input_pixel_index + c]]; + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned char*)input_data)[input_pixel_index + alpha_channel]) / 255; + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = ((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535; + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535); + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned short*)input_data)[input_pixel_index + alpha_channel]) / 65535; + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295); + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear((float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295)); + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + decode_buffer[decode_pixel_index + alpha_channel] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + alpha_channel]) / 4294967295); + } + break; + + case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = ((const float*)input_data)[input_pixel_index + c]; + } + break; + + case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): + for (; x < max_x; x++) + { + int decode_pixel_index = x * channels; + int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; + for (c = 0; c < channels; c++) + decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((const float*)input_data)[input_pixel_index + c]); + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + decode_buffer[decode_pixel_index + alpha_channel] = ((const float*)input_data)[input_pixel_index + alpha_channel]; + } + + break; + + default: + STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); + break; + } + + if (!(stbir_info->flags & STBIR_FLAG_ALPHA_PREMULTIPLIED)) + { + for (x = -stbir_info->horizontal_filter_pixel_margin; x < max_x; x++) + { + int decode_pixel_index = x * channels; + + // If the alpha value is 0 it will clobber the color values. Make sure it's not. + float alpha = decode_buffer[decode_pixel_index + alpha_channel]; +#ifndef STBIR_NO_ALPHA_EPSILON + if (stbir_info->type != STBIR_TYPE_FLOAT) { + alpha += STBIR_ALPHA_EPSILON; + decode_buffer[decode_pixel_index + alpha_channel] = alpha; + } +#endif + for (c = 0; c < channels; c++) + { + if (c == alpha_channel) + continue; + + decode_buffer[decode_pixel_index + c] *= alpha; + } + } + } + + if (edge_horizontal == STBIR_EDGE_ZERO) + { + for (x = -stbir_info->horizontal_filter_pixel_margin; x < 0; x++) + { + for (c = 0; c < channels; c++) + decode_buffer[x*channels + c] = 0; + } + for (x = input_w; x < max_x; x++) + { + for (c = 0; c < channels; c++) + decode_buffer[x*channels + c] = 0; + } + } +} + +static float* stbir__get_ring_buffer_entry(float* ring_buffer, int index, int ring_buffer_length) +{ + return &ring_buffer[index * ring_buffer_length]; +} + +static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n) +{ + int ring_buffer_index; + float* ring_buffer; + + if (stbir_info->ring_buffer_begin_index < 0) + { + ring_buffer_index = stbir_info->ring_buffer_begin_index = 0; + stbir_info->ring_buffer_first_scanline = n; + } + else + { + ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline) + 1) % stbir_info->vertical_filter_pixel_width; + STBIR_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index); + } + + ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float)); + memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes); + + stbir_info->ring_buffer_last_scanline = n; + + return ring_buffer; +} + + +static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, float* output_buffer) +{ + int x, k; + int output_w = stbir_info->output_w; + int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width; + int channels = stbir_info->channels; + float* decode_buffer = stbir__get_decode_buffer(stbir_info); + stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; + float* horizontal_coefficients = stbir_info->horizontal_coefficients; + int coefficient_width = stbir_info->horizontal_coefficient_width; + + for (x = 0; x < output_w; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int out_pixel_index = x * channels; + int coefficient_group = coefficient_width * x; + int coefficient_counter = 0; + + STBIR_ASSERT(n1 >= n0); + STBIR_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); + STBIR_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); + + switch (channels) { + case 1: + for (k = n0; k <= n1; k++) + { + int in_pixel_index = k * 1; + float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + } + break; + case 2: + for (k = n0; k <= n1; k++) + { + int in_pixel_index = k * 2; + float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + } + break; + case 3: + for (k = n0; k <= n1; k++) + { + int in_pixel_index = k * 3; + float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; + } + break; + case 4: + for (k = n0; k <= n1; k++) + { + int in_pixel_index = k * 4; + float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; + output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; + } + break; + default: + for (k = n0; k <= n1; k++) + { + int in_pixel_index = k * channels; + float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; + int c; + STBIR_ASSERT(coefficient != 0); + for (c = 0; c < channels; c++) + output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; + } + break; + } + } +} + +static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n, float* output_buffer) +{ + int x, k; + int input_w = stbir_info->input_w; + int output_w = stbir_info->output_w; + int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width; + int channels = stbir_info->channels; + float* decode_buffer = stbir__get_decode_buffer(stbir_info); + stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; + float* horizontal_coefficients = stbir_info->horizontal_coefficients; + int coefficient_width = stbir_info->horizontal_coefficient_width; + int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin; + int max_x = input_w + filter_pixel_margin * 2; + + STBIR_ASSERT(!stbir__use_width_upsampling(stbir_info)); + + switch (channels) { + case 1: + for (x = 0; x < max_x; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int in_x = x - filter_pixel_margin; + int in_pixel_index = in_x * 1; + int max_n = n1; + int coefficient_group = coefficient_width * x; + + for (k = n0; k <= max_n; k++) + { + int out_pixel_index = k * 1; + float coefficient = horizontal_coefficients[coefficient_group + k - n0]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + } + } + break; + + case 2: + for (x = 0; x < max_x; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int in_x = x - filter_pixel_margin; + int in_pixel_index = in_x * 2; + int max_n = n1; + int coefficient_group = coefficient_width * x; + + for (k = n0; k <= max_n; k++) + { + int out_pixel_index = k * 2; + float coefficient = horizontal_coefficients[coefficient_group + k - n0]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + } + } + break; + + case 3: + for (x = 0; x < max_x; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int in_x = x - filter_pixel_margin; + int in_pixel_index = in_x * 3; + int max_n = n1; + int coefficient_group = coefficient_width * x; + + for (k = n0; k <= max_n; k++) + { + int out_pixel_index = k * 3; + float coefficient = horizontal_coefficients[coefficient_group + k - n0]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; + } + } + break; + + case 4: + for (x = 0; x < max_x; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int in_x = x - filter_pixel_margin; + int in_pixel_index = in_x * 4; + int max_n = n1; + int coefficient_group = coefficient_width * x; + + for (k = n0; k <= max_n; k++) + { + int out_pixel_index = k * 4; + float coefficient = horizontal_coefficients[coefficient_group + k - n0]; + STBIR_ASSERT(coefficient != 0); + output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; + output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; + output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; + output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; + } + } + break; + + default: + for (x = 0; x < max_x; x++) + { + int n0 = horizontal_contributors[x].n0; + int n1 = horizontal_contributors[x].n1; + + int in_x = x - filter_pixel_margin; + int in_pixel_index = in_x * channels; + int max_n = n1; + int coefficient_group = coefficient_width * x; + + for (k = n0; k <= max_n; k++) + { + int c; + int out_pixel_index = k * channels; + float coefficient = horizontal_coefficients[coefficient_group + k - n0]; + STBIR_ASSERT(coefficient != 0); + for (c = 0; c < channels; c++) + output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; + } + } + break; + } +} + +static void stbir__decode_and_resample_upsample(stbir__info* stbir_info, int n) +{ + // Decode the nth scanline from the source image into the decode buffer. + stbir__decode_scanline(stbir_info, n); + + // Now resample it into the ring buffer. + if (stbir__use_width_upsampling(stbir_info)) + stbir__resample_horizontal_upsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n)); + else + stbir__resample_horizontal_downsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n)); + + // Now it's sitting in the ring buffer ready to be used as source for the vertical sampling. +} + +static void stbir__decode_and_resample_downsample(stbir__info* stbir_info, int n) +{ + // Decode the nth scanline from the source image into the decode buffer. + stbir__decode_scanline(stbir_info, n); + + memset(stbir_info->horizontal_buffer, 0, stbir_info->output_w * stbir_info->channels * sizeof(float)); + + // Now resample it into the horizontal buffer. + if (stbir__use_width_upsampling(stbir_info)) + stbir__resample_horizontal_upsample(stbir_info, n, stbir_info->horizontal_buffer); + else + stbir__resample_horizontal_downsample(stbir_info, n, stbir_info->horizontal_buffer); + + // Now it's sitting in the horizontal buffer ready to be distributed into the ring buffers. +} + +// Get the specified scan line from the ring buffer. +static float* stbir__get_ring_buffer_scanline(int get_scanline, float* ring_buffer, int begin_index, int first_scanline, int ring_buffer_size, int ring_buffer_length) +{ + int ring_buffer_index = (begin_index + (get_scanline - first_scanline)) % ring_buffer_size; + return stbir__get_ring_buffer_entry(ring_buffer, ring_buffer_index, ring_buffer_length); +} + + +static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixels, void *output_buffer, float *encode_buffer, int channels, int alpha_channel, int decode) +{ + int x; + int n; + int num_nonalpha; + stbir_uint16 nonalpha[STBIR_MAX_CHANNELS]; + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) + { + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + float alpha = encode_buffer[pixel_index + alpha_channel]; + float reciprocal_alpha = alpha ? 1.0f / alpha : 0; + + // unrolling this produced a 1% slowdown upscaling a large RGBA linear-space image on my machine - stb + for (n = 0; n < channels; n++) + if (n != alpha_channel) + encode_buffer[pixel_index + n] *= reciprocal_alpha; + + // We added in a small epsilon to prevent the color channel from being deleted with zero alpha. + // Because we only add it for integer types, it will automatically be discarded on integer + // conversion, so we don't need to subtract it back out (which would be problematic for + // numeric precision reasons). + } + } + + // build a table of all channels that need colorspace correction, so + // we don't perform colorspace correction on channels that don't need it. + for (x=0, num_nonalpha=0; x < channels; ++x) + if (x != alpha_channel || (stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) + nonalpha[num_nonalpha++] = x; + + #define STBIR__ROUND_INT(f) ((int) ((f)+0.5)) + #define STBIR__ROUND_UINT(f) ((stbir_uint32) ((f)+0.5)) + + #ifdef STBIR__SATURATE_INT + #define STBIR__ENCODE_LINEAR8(f) stbir__saturate8 (STBIR__ROUND_INT((f) * 255 )) + #define STBIR__ENCODE_LINEAR16(f) stbir__saturate16(STBIR__ROUND_INT((f) * 65535)) + #else + #define STBIR__ENCODE_LINEAR8(f) (unsigned char ) STBIR__ROUND_INT(stbir__saturate(f) * 255 ) + #define STBIR__ENCODE_LINEAR16(f) (unsigned short) STBIR__ROUND_INT(stbir__saturate(f) * 65535) + #endif + + switch (decode) + { + case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < channels; n++) + { + int index = pixel_index + n; + ((unsigned char*)output_buffer)[index] = STBIR__ENCODE_LINEAR8(encode_buffer[index]); + } + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < num_nonalpha; n++) + { + int index = pixel_index + nonalpha[n]; + ((unsigned char*)output_buffer)[index] = stbir__linear_to_srgb_uchar(encode_buffer[index]); + } + + if (!(stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) + ((unsigned char *)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR8(encode_buffer[pixel_index+alpha_channel]); + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < channels; n++) + { + int index = pixel_index + n; + ((unsigned short*)output_buffer)[index] = STBIR__ENCODE_LINEAR16(encode_buffer[index]); + } + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < num_nonalpha; n++) + { + int index = pixel_index + nonalpha[n]; + ((unsigned short*)output_buffer)[index] = (unsigned short)STBIR__ROUND_INT(stbir__linear_to_srgb(stbir__saturate(encode_buffer[index])) * 65535); + } + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + ((unsigned short*)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR16(encode_buffer[pixel_index + alpha_channel]); + } + + break; + + case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < channels; n++) + { + int index = pixel_index + n; + ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__saturate(encode_buffer[index])) * 4294967295); + } + } + break; + + case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < num_nonalpha; n++) + { + int index = pixel_index + nonalpha[n]; + ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__linear_to_srgb(stbir__saturate(encode_buffer[index]))) * 4294967295); + } + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + ((unsigned int*)output_buffer)[pixel_index + alpha_channel] = (unsigned int)STBIR__ROUND_INT(((double)stbir__saturate(encode_buffer[pixel_index + alpha_channel])) * 4294967295); + } + break; + + case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < channels; n++) + { + int index = pixel_index + n; + ((float*)output_buffer)[index] = encode_buffer[index]; + } + } + break; + + case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): + for (x=0; x < num_pixels; ++x) + { + int pixel_index = x*channels; + + for (n = 0; n < num_nonalpha; n++) + { + int index = pixel_index + nonalpha[n]; + ((float*)output_buffer)[index] = stbir__linear_to_srgb(encode_buffer[index]); + } + + if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) + ((float*)output_buffer)[pixel_index + alpha_channel] = encode_buffer[pixel_index + alpha_channel]; + } + break; + + default: + STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); + break; + } +} + +static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out) +{ + int x, k; + int output_w = stbir_info->output_w; + stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; + float* vertical_coefficients = stbir_info->vertical_coefficients; + int channels = stbir_info->channels; + int alpha_channel = stbir_info->alpha_channel; + int type = stbir_info->type; + int colorspace = stbir_info->colorspace; + int kernel_pixel_width = stbir_info->vertical_filter_pixel_width; + void* output_data = stbir_info->output_data; + float* encode_buffer = stbir_info->encode_buffer; + int decode = STBIR__DECODE(type, colorspace); + int coefficient_width = stbir_info->vertical_coefficient_width; + int coefficient_counter; + int contributor = n; + + float* ring_buffer = stbir_info->ring_buffer; + int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; + int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; + int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline; + int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); + + int n0,n1, output_row_start; + int coefficient_group = coefficient_width * contributor; + + n0 = vertical_contributors[contributor].n0; + n1 = vertical_contributors[contributor].n1; + + output_row_start = n * stbir_info->output_stride_bytes; + + STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); + + memset(encode_buffer, 0, output_w * sizeof(float) * channels); + + // I tried reblocking this for better cache usage of encode_buffer + // (using x_outer, k, x_inner), but it lost speed. -- stb + + coefficient_counter = 0; + switch (channels) { + case 1: + for (k = n0; k <= n1; k++) + { + int coefficient_index = coefficient_counter++; + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + for (x = 0; x < output_w; ++x) + { + int in_pixel_index = x * 1; + encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; + } + } + break; + case 2: + for (k = n0; k <= n1; k++) + { + int coefficient_index = coefficient_counter++; + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + for (x = 0; x < output_w; ++x) + { + int in_pixel_index = x * 2; + encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; + encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; + } + } + break; + case 3: + for (k = n0; k <= n1; k++) + { + int coefficient_index = coefficient_counter++; + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + for (x = 0; x < output_w; ++x) + { + int in_pixel_index = x * 3; + encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; + encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; + encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; + } + } + break; + case 4: + for (k = n0; k <= n1; k++) + { + int coefficient_index = coefficient_counter++; + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + for (x = 0; x < output_w; ++x) + { + int in_pixel_index = x * 4; + encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; + encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; + encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; + encode_buffer[in_pixel_index + 3] += ring_buffer_entry[in_pixel_index + 3] * coefficient; + } + } + break; + default: + for (k = n0; k <= n1; k++) + { + int coefficient_index = coefficient_counter++; + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + for (x = 0; x < output_w; ++x) + { + int in_pixel_index = x * channels; + int c; + for (c = 0; c < channels; c++) + encode_buffer[in_pixel_index + c] += ring_buffer_entry[in_pixel_index + c] * coefficient; + } + } + break; + } + stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, encode_buffer, channels, alpha_channel, decode); +} + +static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out) +{ + int x, k; + int output_w = stbir_info->output_w; + int output_h = stbir_info->output_h; + stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; + float* vertical_coefficients = stbir_info->vertical_coefficients; + int channels = stbir_info->channels; + int kernel_pixel_width = stbir_info->vertical_filter_pixel_width; + void* output_data = stbir_info->output_data; + float* horizontal_buffer = stbir_info->horizontal_buffer; + int coefficient_width = stbir_info->vertical_coefficient_width; + int contributor = n + stbir_info->vertical_filter_pixel_margin; + + float* ring_buffer = stbir_info->ring_buffer; + int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; + int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; + int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline; + int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); + int n0,n1; + + n0 = vertical_contributors[contributor].n0; + n1 = vertical_contributors[contributor].n1; + + STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); + + for (k = n0; k <= n1; k++) + { + int coefficient_index = k - n0; + int coefficient_group = coefficient_width * contributor; + float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; + + float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); + + switch (channels) { + case 1: + for (x = 0; x < output_w; x++) + { + int in_pixel_index = x * 1; + ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; + } + break; + case 2: + for (x = 0; x < output_w; x++) + { + int in_pixel_index = x * 2; + ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; + ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; + } + break; + case 3: + for (x = 0; x < output_w; x++) + { + int in_pixel_index = x * 3; + ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; + ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; + ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; + } + break; + case 4: + for (x = 0; x < output_w; x++) + { + int in_pixel_index = x * 4; + ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; + ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; + ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; + ring_buffer_entry[in_pixel_index + 3] += horizontal_buffer[in_pixel_index + 3] * coefficient; + } + break; + default: + for (x = 0; x < output_w; x++) + { + int in_pixel_index = x * channels; + + int c; + for (c = 0; c < channels; c++) + ring_buffer_entry[in_pixel_index + c] += horizontal_buffer[in_pixel_index + c] * coefficient; + } + break; + } + } +} + +static void stbir__buffer_loop_upsample(stbir__info* stbir_info) +{ + int y; + float scale_ratio = stbir_info->vertical_scale; + float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio; + + STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); + + for (y = 0; y < stbir_info->output_h; y++) + { + float in_center_of_out = 0; // Center of the current out scanline in the in scanline space + int in_first_scanline = 0, in_last_scanline = 0; + + stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out); + + STBIR_ASSERT(in_last_scanline - in_first_scanline <= stbir_info->vertical_filter_pixel_width); + + if (stbir_info->ring_buffer_begin_index >= 0) + { + // Get rid of whatever we don't need anymore. + while (in_first_scanline > stbir_info->ring_buffer_first_scanline) + { + if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) + { + // We just popped the last scanline off the ring buffer. + // Reset it to the empty state. + stbir_info->ring_buffer_begin_index = -1; + stbir_info->ring_buffer_first_scanline = 0; + stbir_info->ring_buffer_last_scanline = 0; + break; + } + else + { + stbir_info->ring_buffer_first_scanline++; + stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width; + } + } + } + + // Load in new ones. + if (stbir_info->ring_buffer_begin_index < 0) + stbir__decode_and_resample_upsample(stbir_info, in_first_scanline); + + while (in_last_scanline > stbir_info->ring_buffer_last_scanline) + stbir__decode_and_resample_upsample(stbir_info, stbir_info->ring_buffer_last_scanline + 1); + + // Now all buffers should be ready to write a row of vertical sampling. + stbir__resample_vertical_upsample(stbir_info, y, in_first_scanline, in_last_scanline, in_center_of_out); + + STBIR_PROGRESS_REPORT((float)y / stbir_info->output_h); + } +} + +static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_necessary_scanline) +{ + int output_stride_bytes = stbir_info->output_stride_bytes; + int channels = stbir_info->channels; + int alpha_channel = stbir_info->alpha_channel; + int type = stbir_info->type; + int colorspace = stbir_info->colorspace; + int output_w = stbir_info->output_w; + void* output_data = stbir_info->output_data; + int decode = STBIR__DECODE(type, colorspace); + + float* ring_buffer = stbir_info->ring_buffer; + int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); + + if (stbir_info->ring_buffer_begin_index >= 0) + { + // Get rid of whatever we don't need anymore. + while (first_necessary_scanline > stbir_info->ring_buffer_first_scanline) + { + if (stbir_info->ring_buffer_first_scanline >= 0 && stbir_info->ring_buffer_first_scanline < stbir_info->output_h) + { + int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes; + float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length); + stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode); + STBIR_PROGRESS_REPORT((float)stbir_info->ring_buffer_first_scanline / stbir_info->output_h); + } + + if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) + { + // We just popped the last scanline off the ring buffer. + // Reset it to the empty state. + stbir_info->ring_buffer_begin_index = -1; + stbir_info->ring_buffer_first_scanline = 0; + stbir_info->ring_buffer_last_scanline = 0; + break; + } + else + { + stbir_info->ring_buffer_first_scanline++; + stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width; + } + } + } +} + +static void stbir__buffer_loop_downsample(stbir__info* stbir_info) +{ + int y; + float scale_ratio = stbir_info->vertical_scale; + int output_h = stbir_info->output_h; + float in_pixels_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(scale_ratio) / scale_ratio; + int pixel_margin = stbir_info->vertical_filter_pixel_margin; + int max_y = stbir_info->input_h + pixel_margin; + + STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); + + for (y = -pixel_margin; y < max_y; y++) + { + float out_center_of_in; // Center of the current out scanline in the in scanline space + int out_first_scanline, out_last_scanline; + + stbir__calculate_sample_range_downsample(y, in_pixels_radius, scale_ratio, stbir_info->vertical_shift, &out_first_scanline, &out_last_scanline, &out_center_of_in); + + STBIR_ASSERT(out_last_scanline - out_first_scanline <= stbir_info->vertical_filter_pixel_width); + + if (out_last_scanline < 0 || out_first_scanline >= output_h) + continue; + + stbir__empty_ring_buffer(stbir_info, out_first_scanline); + + stbir__decode_and_resample_downsample(stbir_info, y); + + // Load in new ones. + if (stbir_info->ring_buffer_begin_index < 0) + stbir__add_empty_ring_buffer_entry(stbir_info, out_first_scanline); + + while (out_last_scanline > stbir_info->ring_buffer_last_scanline) + stbir__add_empty_ring_buffer_entry(stbir_info, stbir_info->ring_buffer_last_scanline + 1); + + // Now the horizontal buffer is ready to write to all ring buffer rows. + stbir__resample_vertical_downsample(stbir_info, y, out_first_scanline, out_last_scanline, out_center_of_in); + } + + stbir__empty_ring_buffer(stbir_info, stbir_info->output_h); +} + +static void stbir__setup(stbir__info *info, int input_w, int input_h, int output_w, int output_h, int channels) +{ + info->input_w = input_w; + info->input_h = input_h; + info->output_w = output_w; + info->output_h = output_h; + info->channels = channels; +} + +static void stbir__calculate_transform(stbir__info *info, float s0, float t0, float s1, float t1, float *transform) +{ + info->s0 = s0; + info->t0 = t0; + info->s1 = s1; + info->t1 = t1; + + if (transform) + { + info->horizontal_scale = transform[0]; + info->vertical_scale = transform[1]; + info->horizontal_shift = transform[2]; + info->vertical_shift = transform[3]; + } + else + { + info->horizontal_scale = ((float)info->output_w / info->input_w) / (s1 - s0); + info->vertical_scale = ((float)info->output_h / info->input_h) / (t1 - t0); + + info->horizontal_shift = s0 * info->output_w / (s1 - s0); + info->vertical_shift = t0 * info->output_h / (t1 - t0); + } +} + +static void stbir__choose_filter(stbir__info *info, stbir_filter h_filter, stbir_filter v_filter) +{ + if (h_filter == 0) + h_filter = stbir__use_upsampling(info->horizontal_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; + if (v_filter == 0) + v_filter = stbir__use_upsampling(info->vertical_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; + info->horizontal_filter = h_filter; + info->vertical_filter = v_filter; +} + +static stbir_uint32 stbir__calculate_memory(stbir__info *info) +{ + int pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); + int filter_height = stbir__get_filter_pixel_width(info->vertical_filter, info->vertical_scale); + + info->horizontal_num_contributors = stbir__get_contributors(info->horizontal_scale, info->horizontal_filter, info->input_w, info->output_w); + info->vertical_num_contributors = stbir__get_contributors(info->vertical_scale , info->vertical_filter , info->input_h, info->output_h); + + info->horizontal_contributors_size = info->horizontal_num_contributors * sizeof(stbir__contributors); + info->horizontal_coefficients_size = stbir__get_total_horizontal_coefficients(info) * sizeof(float); + info->vertical_contributors_size = info->vertical_num_contributors * sizeof(stbir__contributors); + info->vertical_coefficients_size = stbir__get_total_vertical_coefficients(info) * sizeof(float); + info->decode_buffer_size = (info->input_w + pixel_margin * 2) * info->channels * sizeof(float); + info->horizontal_buffer_size = info->output_w * info->channels * sizeof(float); + info->ring_buffer_size = info->output_w * info->channels * filter_height * sizeof(float); + info->encode_buffer_size = info->output_w * info->channels * sizeof(float); + + STBIR_ASSERT(info->horizontal_filter != 0); + STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late + STBIR_ASSERT(info->vertical_filter != 0); + STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late + + if (stbir__use_height_upsampling(info)) + // The horizontal buffer is for when we're downsampling the height and we + // can't output the result of sampling the decode buffer directly into the + // ring buffers. + info->horizontal_buffer_size = 0; + else + // The encode buffer is to retain precision in the height upsampling method + // and isn't used when height downsampling. + info->encode_buffer_size = 0; + + return info->horizontal_contributors_size + info->horizontal_coefficients_size + + info->vertical_contributors_size + info->vertical_coefficients_size + + info->decode_buffer_size + info->horizontal_buffer_size + + info->ring_buffer_size + info->encode_buffer_size; +} + +static int stbir__resize_allocated(stbir__info *info, + const void* input_data, int input_stride_in_bytes, + void* output_data, int output_stride_in_bytes, + int alpha_channel, stbir_uint32 flags, stbir_datatype type, + stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace, + void* tempmem, size_t tempmem_size_in_bytes) +{ + size_t memory_required = stbir__calculate_memory(info); + + int width_stride_input = input_stride_in_bytes ? input_stride_in_bytes : info->channels * info->input_w * stbir__type_size[type]; + int width_stride_output = output_stride_in_bytes ? output_stride_in_bytes : info->channels * info->output_w * stbir__type_size[type]; + +#ifdef STBIR_DEBUG_OVERWRITE_TEST +#define OVERWRITE_ARRAY_SIZE 8 + unsigned char overwrite_output_before_pre[OVERWRITE_ARRAY_SIZE]; + unsigned char overwrite_tempmem_before_pre[OVERWRITE_ARRAY_SIZE]; + unsigned char overwrite_output_after_pre[OVERWRITE_ARRAY_SIZE]; + unsigned char overwrite_tempmem_after_pre[OVERWRITE_ARRAY_SIZE]; + + size_t begin_forbidden = width_stride_output * (info->output_h - 1) + info->output_w * info->channels * stbir__type_size[type]; + memcpy(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); + memcpy(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE); + memcpy(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); + memcpy(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE); +#endif + + STBIR_ASSERT(info->channels >= 0); + STBIR_ASSERT(info->channels <= STBIR_MAX_CHANNELS); + + if (info->channels < 0 || info->channels > STBIR_MAX_CHANNELS) + return 0; + + STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); + STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); + + if (info->horizontal_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) + return 0; + if (info->vertical_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) + return 0; + + if (alpha_channel < 0) + flags |= STBIR_FLAG_ALPHA_USES_COLORSPACE | STBIR_FLAG_ALPHA_PREMULTIPLIED; + + if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) + STBIR_ASSERT(alpha_channel >= 0 && alpha_channel < info->channels); + + if (alpha_channel >= info->channels) + return 0; + + STBIR_ASSERT(tempmem); + + if (!tempmem) + return 0; + + STBIR_ASSERT(tempmem_size_in_bytes >= memory_required); + + if (tempmem_size_in_bytes < memory_required) + return 0; + + memset(tempmem, 0, tempmem_size_in_bytes); + + info->input_data = input_data; + info->input_stride_bytes = width_stride_input; + + info->output_data = output_data; + info->output_stride_bytes = width_stride_output; + + info->alpha_channel = alpha_channel; + info->flags = flags; + info->type = type; + info->edge_horizontal = edge_horizontal; + info->edge_vertical = edge_vertical; + info->colorspace = colorspace; + + info->horizontal_coefficient_width = stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); + info->vertical_coefficient_width = stbir__get_coefficient_width (info->vertical_filter , info->vertical_scale ); + info->horizontal_filter_pixel_width = stbir__get_filter_pixel_width (info->horizontal_filter, info->horizontal_scale); + info->vertical_filter_pixel_width = stbir__get_filter_pixel_width (info->vertical_filter , info->vertical_scale ); + info->horizontal_filter_pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); + info->vertical_filter_pixel_margin = stbir__get_filter_pixel_margin(info->vertical_filter , info->vertical_scale ); + + info->ring_buffer_length_bytes = info->output_w * info->channels * sizeof(float); + info->decode_buffer_pixels = info->input_w + info->horizontal_filter_pixel_margin * 2; + +#define STBIR__NEXT_MEMPTR(current, newtype) (newtype*)(((unsigned char*)current) + current##_size) + + info->horizontal_contributors = (stbir__contributors *) tempmem; + info->horizontal_coefficients = STBIR__NEXT_MEMPTR(info->horizontal_contributors, float); + info->vertical_contributors = STBIR__NEXT_MEMPTR(info->horizontal_coefficients, stbir__contributors); + info->vertical_coefficients = STBIR__NEXT_MEMPTR(info->vertical_contributors, float); + info->decode_buffer = STBIR__NEXT_MEMPTR(info->vertical_coefficients, float); + + if (stbir__use_height_upsampling(info)) + { + info->horizontal_buffer = NULL; + info->ring_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); + info->encode_buffer = STBIR__NEXT_MEMPTR(info->ring_buffer, float); + + STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); + } + else + { + info->horizontal_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); + info->ring_buffer = STBIR__NEXT_MEMPTR(info->horizontal_buffer, float); + info->encode_buffer = NULL; + + STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); + } + +#undef STBIR__NEXT_MEMPTR + + // This signals that the ring buffer is empty + info->ring_buffer_begin_index = -1; + + stbir__calculate_filters(info, info->horizontal_contributors, info->horizontal_coefficients, info->horizontal_filter, info->horizontal_scale, info->horizontal_shift, info->input_w, info->output_w); + stbir__calculate_filters(info, info->vertical_contributors, info->vertical_coefficients, info->vertical_filter, info->vertical_scale, info->vertical_shift, info->input_h, info->output_h); + + STBIR_PROGRESS_REPORT(0); + + if (stbir__use_height_upsampling(info)) + stbir__buffer_loop_upsample(info); + else + stbir__buffer_loop_downsample(info); + + STBIR_PROGRESS_REPORT(1); + +#ifdef STBIR_DEBUG_OVERWRITE_TEST + STBIR_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); + STBIR_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0); +#endif + + return 1; +} + + +static int stbir__resize_arbitrary( + void *alloc_context, + const void* input_data, int input_w, int input_h, int input_stride_in_bytes, + void* output_data, int output_w, int output_h, int output_stride_in_bytes, + float s0, float t0, float s1, float t1, float *transform, + int channels, int alpha_channel, stbir_uint32 flags, stbir_datatype type, + stbir_filter h_filter, stbir_filter v_filter, + stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace) +{ + stbir__info info; + int result; + size_t memory_required; + void* extra_memory; + + stbir__setup(&info, input_w, input_h, output_w, output_h, channels); + stbir__calculate_transform(&info, s0,t0,s1,t1,transform); + stbir__choose_filter(&info, h_filter, v_filter); + memory_required = stbir__calculate_memory(&info); + extra_memory = STBIR_MALLOC(memory_required, alloc_context); + + if (!extra_memory) + return 0; + + result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes, + output_data, output_stride_in_bytes, + alpha_channel, flags, type, + edge_horizontal, edge_vertical, + colorspace, extra_memory, memory_required); + + STBIR_FREE(extra_memory, alloc_context); + + return result; +} + +STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels) +{ + return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, + STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); +} + +STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + float *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels) +{ + return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_FLOAT, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, + STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); +} + +STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags) +{ + return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, + STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_SRGB); +} + +STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode) +{ + return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, + edge_wrap_mode, edge_wrap_mode, STBIR_COLORSPACE_SRGB); +} + +STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context) +{ + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, filter, filter, + edge_wrap_mode, edge_wrap_mode, space); +} + +STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context) +{ + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT16, filter, filter, + edge_wrap_mode, edge_wrap_mode, space); +} + + +STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, + void *alloc_context) +{ + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_FLOAT, filter, filter, + edge_wrap_mode, edge_wrap_mode, space); +} + + +STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context) +{ + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, + edge_mode_horizontal, edge_mode_vertical, space); +} + + +STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context, + float x_scale, float y_scale, + float x_offset, float y_offset) +{ + float transform[4]; + transform[0] = x_scale; + transform[1] = y_scale; + transform[2] = x_offset; + transform[3] = y_offset; + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + 0,0,1,1,transform,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, + edge_mode_horizontal, edge_mode_vertical, space); +} + +STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, + void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, + stbir_datatype datatype, + int num_channels, int alpha_channel, int flags, + stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, + stbir_filter filter_horizontal, stbir_filter filter_vertical, + stbir_colorspace space, void *alloc_context, + float s0, float t0, float s1, float t1) +{ + return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, + output_pixels, output_w, output_h, output_stride_in_bytes, + s0,t0,s1,t1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, + edge_mode_horizontal, edge_mode_vertical, space); +} + +#endif // STB_IMAGE_RESIZE_IMPLEMENTATION diff --git a/src/external/stb_image_write.h b/src/external/stb_image_write.h new file mode 100644 index 00000000..4319c0de --- /dev/null +++ b/src/external/stb_image_write.h @@ -0,0 +1,1048 @@ +/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h + writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 + no warranty implied; use at your own risk + + Before #including, + + #define STB_IMAGE_WRITE_IMPLEMENTATION + + in the file that you want to have the implementation. + + Will probably not work correctly with strict-aliasing optimizations. + +ABOUT: + + This header file is a library for writing images to C stdio. It could be + adapted to write to memory or a general streaming interface; let me know. + + The PNG output is not optimal; it is 20-50% larger than the file + written by a decent optimizing implementation. This library is designed + for source code compactness and simplicity, not optimal image file size + or run-time performance. + +BUILDING: + + You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. + You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace + malloc,realloc,free. + You can define STBIW_MEMMOVE() to replace memmove() + +USAGE: + + There are four functions, one for each image file format: + + int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); + int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); + int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); + int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); + + There are also four equivalent functions that use an arbitrary write function. You are + expected to open/close your file-equivalent before and after calling these: + + int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); + int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); + int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); + int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); + + where the callback is: + void stbi_write_func(void *context, void *data, int size); + + You can define STBI_WRITE_NO_STDIO to disable the file variant of these + functions, so the library will not use stdio.h at all. However, this will + also disable HDR writing, because it requires stdio for formatted output. + + Each function returns 0 on failure and non-0 on success. + + The functions create an image file defined by the parameters. The image + is a rectangle of pixels stored from left-to-right, top-to-bottom. + Each pixel contains 'comp' channels of data stored interleaved with 8-bits + per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is + monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall. + The *data pointer points to the first byte of the top-left-most pixel. + For PNG, "stride_in_bytes" is the distance in bytes from the first byte of + a row of pixels to the first byte of the next row of pixels. + + PNG creates output files with the same number of components as the input. + The BMP format expands Y to RGB in the file format and does not + output alpha. + + PNG supports writing rectangles of data even when the bytes storing rows of + data are not consecutive in memory (e.g. sub-rectangles of a larger image), + by supplying the stride between the beginning of adjacent rows. The other + formats do not. (Thus you cannot write a native-format BMP through the BMP + writer, both because it is in BGR order and because it may have padding + at the end of the line.) + + HDR expects linear float data. Since the format is always 32-bit rgb(e) + data, alpha (if provided) is discarded, and for monochrome data it is + replicated across all three channels. + + TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed + data, set the global variable 'stbi_write_tga_with_rle' to 0. + +CREDITS: + + PNG/BMP/TGA + Sean Barrett + HDR + Baldur Karlsson + TGA monochrome: + Jean-Sebastien Guay + misc enhancements: + Tim Kelsey + TGA RLE + Alan Hickman + initial file IO callback implementation + Emmanuel Julien + bugfixes: + github:Chribba + Guillaume Chereau + github:jry2 + github:romigrou + Sergio Gonzalez + Jonas Karlsson + Filip Wasil + Thatcher Ulrich + +LICENSE + +This software is dual-licensed to the public domain and under the following +license: you are granted a perpetual, irrevocable license to copy, modify, +publish, and distribute this file as you see fit. + +*/ + +#ifndef INCLUDE_STB_IMAGE_WRITE_H +#define INCLUDE_STB_IMAGE_WRITE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef STB_IMAGE_WRITE_STATIC +#define STBIWDEF static +#else +#define STBIWDEF extern +extern int stbi_write_tga_with_rle; +#endif + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); +STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); +#endif + +typedef void stbi_write_func(void *context, void *data, int size); + +STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); +STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); + +#ifdef __cplusplus +} +#endif + +#endif//INCLUDE_STB_IMAGE_WRITE_H + +#ifdef STB_IMAGE_WRITE_IMPLEMENTATION + +#ifdef _WIN32 + #ifndef _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS + #endif + #ifndef _CRT_NONSTDC_NO_DEPRECATE + #define _CRT_NONSTDC_NO_DEPRECATE + #endif +#endif + +#ifndef STBI_WRITE_NO_STDIO +#include +#endif // STBI_WRITE_NO_STDIO + +#include +#include +#include +#include + +#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) +// ok +#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) +// ok +#else +#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." +#endif + +#ifndef STBIW_MALLOC +#define STBIW_MALLOC(sz) malloc(sz) +#define STBIW_REALLOC(p,newsz) realloc(p,newsz) +#define STBIW_FREE(p) free(p) +#endif + +#ifndef STBIW_REALLOC_SIZED +#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) +#endif + + +#ifndef STBIW_MEMMOVE +#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) +#endif + + +#ifndef STBIW_ASSERT +#include +#define STBIW_ASSERT(x) assert(x) +#endif + +#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) + +typedef struct +{ + stbi_write_func *func; + void *context; +} stbi__write_context; + +// initialize a callback-based context +static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) +{ + s->func = c; + s->context = context; +} + +#ifndef STBI_WRITE_NO_STDIO + +static void stbi__stdio_write(void *context, void *data, int size) +{ + fwrite(data,1,size,(FILE*) context); +} + +static int stbi__start_write_file(stbi__write_context *s, const char *filename) +{ + FILE *f = fopen(filename, "wb"); + stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); + return f != NULL; +} + +static void stbi__end_write_file(stbi__write_context *s) +{ + fclose((FILE *)s->context); +} + +#endif // !STBI_WRITE_NO_STDIO + +typedef unsigned int stbiw_uint32; +typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; + +#ifdef STB_IMAGE_WRITE_STATIC +static int stbi_write_tga_with_rle = 1; +#else +int stbi_write_tga_with_rle = 1; +#endif + +static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) +{ + while (*fmt) { + switch (*fmt++) { + case ' ': break; + case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); + s->func(s->context,&x,1); + break; } + case '2': { int x = va_arg(v,int); + unsigned char b[2]; + b[0] = STBIW_UCHAR(x); + b[1] = STBIW_UCHAR(x>>8); + s->func(s->context,b,2); + break; } + case '4': { stbiw_uint32 x = va_arg(v,int); + unsigned char b[4]; + b[0]=STBIW_UCHAR(x); + b[1]=STBIW_UCHAR(x>>8); + b[2]=STBIW_UCHAR(x>>16); + b[3]=STBIW_UCHAR(x>>24); + s->func(s->context,b,4); + break; } + default: + STBIW_ASSERT(0); + return; + } + } +} + +static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) +{ + va_list v; + va_start(v, fmt); + stbiw__writefv(s, fmt, v); + va_end(v); +} + +static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) +{ + unsigned char arr[3]; + arr[0] = a, arr[1] = b, arr[2] = c; + s->func(s->context, arr, 3); +} + +static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) +{ + unsigned char bg[3] = { 255, 0, 255}, px[3]; + int k; + + if (write_alpha < 0) + s->func(s->context, &d[comp - 1], 1); + + switch (comp) { + case 1: + s->func(s->context,d,1); + break; + case 2: + if (expand_mono) + stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp + else + s->func(s->context, d, 1); // monochrome TGA + break; + case 4: + if (!write_alpha) { + // composite against pink background + for (k = 0; k < 3; ++k) + px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; + stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); + break; + } + /* FALLTHROUGH */ + case 3: + stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); + break; + } + if (write_alpha > 0) + s->func(s->context, &d[comp - 1], 1); +} + +static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) +{ + stbiw_uint32 zero = 0; + int i,j, j_end; + + if (y <= 0) + return; + + if (vdir < 0) + j_end = -1, j = y-1; + else + j_end = y, j = 0; + + for (; j != j_end; j += vdir) { + for (i=0; i < x; ++i) { + unsigned char *d = (unsigned char *) data + (j*x+i)*comp; + stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); + } + s->func(s->context, &zero, scanline_pad); + } +} + +static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) +{ + if (y < 0 || x < 0) { + return 0; + } else { + va_list v; + va_start(v, fmt); + stbiw__writefv(s, fmt, v); + va_end(v); + stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); + return 1; + } +} + +static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) +{ + int pad = (-x*3) & 3; + return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, + "11 4 22 4" "4 44 22 444444", + 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header + 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header +} + +STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) +{ + stbi__write_context s; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_bmp_core(&s, x, y, comp, data); +} + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) +{ + stbi__write_context s; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_bmp_core(&s, x, y, comp, data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif //!STBI_WRITE_NO_STDIO + +static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) +{ + int has_alpha = (comp == 2 || comp == 4); + int colorbytes = has_alpha ? comp-1 : comp; + int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 + + if (y < 0 || x < 0) + return 0; + + if (!stbi_write_tga_with_rle) { + return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, + "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); + } else { + int i,j,k; + + stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); + + for (j = y - 1; j >= 0; --j) { + unsigned char *row = (unsigned char *) data + j * x * comp; + int len; + + for (i = 0; i < x; i += len) { + unsigned char *begin = row + i * comp; + int diff = 1; + len = 1; + + if (i < x - 1) { + ++len; + diff = memcmp(begin, row + (i + 1) * comp, comp); + if (diff) { + const unsigned char *prev = begin; + for (k = i + 2; k < x && len < 128; ++k) { + if (memcmp(prev, row + k * comp, comp)) { + prev += comp; + ++len; + } else { + --len; + break; + } + } + } else { + for (k = i + 2; k < x && len < 128; ++k) { + if (!memcmp(begin, row + k * comp, comp)) { + ++len; + } else { + break; + } + } + } + } + + if (diff) { + unsigned char header = STBIW_UCHAR(len - 1); + s->func(s->context, &header, 1); + for (k = 0; k < len; ++k) { + stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); + } + } else { + unsigned char header = STBIW_UCHAR(len - 129); + s->func(s->context, &header, 1); + stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); + } + } + } + } + return 1; +} + +int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) +{ + stbi__write_context s; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_tga_core(&s, x, y, comp, (void *) data); +} + +#ifndef STBI_WRITE_NO_STDIO +int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) +{ + stbi__write_context s; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif + +// ************************************************************************************************* +// Radiance RGBE HDR writer +// by Baldur Karlsson +#ifndef STBI_WRITE_NO_STDIO + +#define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) + +void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) +{ + int exponent; + float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); + + if (maxcomp < 1e-32f) { + rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; + } else { + float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; + + rgbe[0] = (unsigned char)(linear[0] * normalize); + rgbe[1] = (unsigned char)(linear[1] * normalize); + rgbe[2] = (unsigned char)(linear[2] * normalize); + rgbe[3] = (unsigned char)(exponent + 128); + } +} + +void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) +{ + unsigned char lengthbyte = STBIW_UCHAR(length+128); + STBIW_ASSERT(length+128 <= 255); + s->func(s->context, &lengthbyte, 1); + s->func(s->context, &databyte, 1); +} + +void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) +{ + unsigned char lengthbyte = STBIW_UCHAR(length); + STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code + s->func(s->context, &lengthbyte, 1); + s->func(s->context, data, length); +} + +void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) +{ + unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; + unsigned char rgbe[4]; + float linear[3]; + int x; + + scanlineheader[2] = (width&0xff00)>>8; + scanlineheader[3] = (width&0x00ff); + + /* skip RLE for images too small or large */ + if (width < 8 || width >= 32768) { + for (x=0; x < width; x++) { + switch (ncomp) { + case 4: /* fallthrough */ + case 3: linear[2] = scanline[x*ncomp + 2]; + linear[1] = scanline[x*ncomp + 1]; + linear[0] = scanline[x*ncomp + 0]; + break; + default: + linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; + break; + } + stbiw__linear_to_rgbe(rgbe, linear); + s->func(s->context, rgbe, 4); + } + } else { + int c,r; + /* encode into scratch buffer */ + for (x=0; x < width; x++) { + switch(ncomp) { + case 4: /* fallthrough */ + case 3: linear[2] = scanline[x*ncomp + 2]; + linear[1] = scanline[x*ncomp + 1]; + linear[0] = scanline[x*ncomp + 0]; + break; + default: + linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; + break; + } + stbiw__linear_to_rgbe(rgbe, linear); + scratch[x + width*0] = rgbe[0]; + scratch[x + width*1] = rgbe[1]; + scratch[x + width*2] = rgbe[2]; + scratch[x + width*3] = rgbe[3]; + } + + s->func(s->context, scanlineheader, 4); + + /* RLE each component separately */ + for (c=0; c < 4; c++) { + unsigned char *comp = &scratch[width*c]; + + x = 0; + while (x < width) { + // find first run + r = x; + while (r+2 < width) { + if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) + break; + ++r; + } + if (r+2 >= width) + r = width; + // dump up to first run + while (x < r) { + int len = r-x; + if (len > 128) len = 128; + stbiw__write_dump_data(s, len, &comp[x]); + x += len; + } + // if there's a run, output it + if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd + // find next byte after run + while (r < width && comp[r] == comp[x]) + ++r; + // output run up to r + while (x < r) { + int len = r-x; + if (len > 127) len = 127; + stbiw__write_run_data(s, len, comp[x]); + x += len; + } + } + } + } + } +} + +static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) +{ + if (y <= 0 || x <= 0 || data == NULL) + return 0; + else { + // Each component is stored separately. Allocate scratch space for full output scanline. + unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); + int i, len; + char buffer[128]; + char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; + s->func(s->context, header, sizeof(header)-1); + + len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); + s->func(s->context, buffer, len); + + for(i=0; i < y; i++) + stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x); + STBIW_FREE(scratch); + return 1; + } +} + +int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) +{ + stbi__write_context s; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_hdr_core(&s, x, y, comp, (float *) data); +} + +int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) +{ + stbi__write_context s; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif // STBI_WRITE_NO_STDIO + + +////////////////////////////////////////////////////////////////////////////// +// +// PNG writer +// + +// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() +#define stbiw__sbraw(a) ((int *) (a) - 2) +#define stbiw__sbm(a) stbiw__sbraw(a)[0] +#define stbiw__sbn(a) stbiw__sbraw(a)[1] + +#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) +#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) +#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) + +#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) +#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) +#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) + +static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) +{ + int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; + void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); + STBIW_ASSERT(p); + if (p) { + if (!*arr) ((int *) p)[1] = 0; + *arr = (void *) ((int *) p + 2); + stbiw__sbm(*arr) = m; + } + return *arr; +} + +static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) +{ + while (*bitcount >= 8) { + stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); + *bitbuffer >>= 8; + *bitcount -= 8; + } + return data; +} + +static int stbiw__zlib_bitrev(int code, int codebits) +{ + int res=0; + while (codebits--) { + res = (res << 1) | (code & 1); + code >>= 1; + } + return res; +} + +static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) +{ + int i; + for (i=0; i < limit && i < 258; ++i) + if (a[i] != b[i]) break; + return i; +} + +static unsigned int stbiw__zhash(unsigned char *data) +{ + stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + return hash; +} + +#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) +#define stbiw__zlib_add(code,codebits) \ + (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) +#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) +// default huffman tables +#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) +#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) +#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) +#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) +#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) +#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) + +#define stbiw__ZHASH 16384 + +unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) +{ + static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; + static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; + static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; + static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; + unsigned int bitbuf=0; + int i,j, bitcount=0; + unsigned char *out = NULL; + unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); + if (quality < 5) quality = 5; + + stbiw__sbpush(out, 0x78); // DEFLATE 32K window + stbiw__sbpush(out, 0x5e); // FLEVEL = 1 + stbiw__zlib_add(1,1); // BFINAL = 1 + stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman + + for (i=0; i < stbiw__ZHASH; ++i) + hash_table[i] = NULL; + + i=0; + while (i < data_len-3) { + // hash next 3 bytes of data to be compressed + int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; + unsigned char *bestloc = 0; + unsigned char **hlist = hash_table[h]; + int n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32768) { // if entry lies within window + int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); + if (d >= best) best=d,bestloc=hlist[j]; + } + } + // when hash table entry is too long, delete half the entries + if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { + STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); + stbiw__sbn(hash_table[h]) = quality; + } + stbiw__sbpush(hash_table[h],data+i); + + if (bestloc) { + // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal + h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); + hlist = hash_table[h]; + n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32767) { + int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); + if (e > best) { // if next match is better, bail on current match + bestloc = NULL; + break; + } + } + } + } + + if (bestloc) { + int d = (int) (data+i - bestloc); // distance back + STBIW_ASSERT(d <= 32767 && best <= 258); + for (j=0; best > lengthc[j+1]-1; ++j); + stbiw__zlib_huff(j+257); + if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); + for (j=0; d > distc[j+1]-1; ++j); + stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); + if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); + i += best; + } else { + stbiw__zlib_huffb(data[i]); + ++i; + } + } + // write out final bytes + for (;i < data_len; ++i) + stbiw__zlib_huffb(data[i]); + stbiw__zlib_huff(256); // end of block + // pad with 0 bits to byte boundary + while (bitcount) + stbiw__zlib_add(0,1); + + for (i=0; i < stbiw__ZHASH; ++i) + (void) stbiw__sbfree(hash_table[i]); + STBIW_FREE(hash_table); + + { + // compute adler32 on input + unsigned int s1=1, s2=0; + int blocklen = (int) (data_len % 5552); + j=0; + while (j < data_len) { + for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; + s1 %= 65521, s2 %= 65521; + j += blocklen; + blocklen = 5552; + } + stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s2)); + stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s1)); + } + *out_len = stbiw__sbn(out); + // make returned pointer freeable + STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); + return (unsigned char *) stbiw__sbraw(out); +} + +static unsigned int stbiw__crc32(unsigned char *buffer, int len) +{ + static unsigned int crc_table[256] = + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }; + + unsigned int crc = ~0u; + int i; + for (i=0; i < len; ++i) + crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; + return ~crc; +} + +#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) +#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); +#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) + +static void stbiw__wpcrc(unsigned char **data, int len) +{ + unsigned int crc = stbiw__crc32(*data - len - 4, len+4); + stbiw__wp32(*data, crc); +} + +static unsigned char stbiw__paeth(int a, int b, int c) +{ + int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); + if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); + if (pb <= pc) return STBIW_UCHAR(b); + return STBIW_UCHAR(c); +} + +unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) +{ + int ctype[5] = { -1, 0, 4, 2, 6 }; + unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; + unsigned char *out,*o, *filt, *zlib; + signed char *line_buffer; + int i,j,k,p,zlen; + + if (stride_bytes == 0) + stride_bytes = x * n; + + filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; + line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } + for (j=0; j < y; ++j) { + static int mapping[] = { 0,1,2,3,4 }; + static int firstmap[] = { 0,1,0,5,6 }; + int *mymap = j ? mapping : firstmap; + int best = 0, bestval = 0x7fffffff; + for (p=0; p < 2; ++p) { + for (k= p?best:0; k < 5; ++k) { + int type = mymap[k],est=0; + unsigned char *z = pixels + stride_bytes*j; + for (i=0; i < n; ++i) + switch (type) { + case 0: line_buffer[i] = z[i]; break; + case 1: line_buffer[i] = z[i]; break; + case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; + case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break; + case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break; + case 5: line_buffer[i] = z[i]; break; + case 6: line_buffer[i] = z[i]; break; + } + for (i=n; i < x*n; ++i) { + switch (type) { + case 0: line_buffer[i] = z[i]; break; + case 1: line_buffer[i] = z[i] - z[i-n]; break; + case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; + case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break; + case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break; + case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break; + case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; + } + } + if (p) break; + for (i=0; i < x*n; ++i) + est += abs((signed char) line_buffer[i]); + if (est < bestval) { bestval = est; best = k; } + } + } + // when we get here, best contains the filter type, and line_buffer contains the data + filt[j*(x*n+1)] = (unsigned char) best; + STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); + } + STBIW_FREE(line_buffer); + zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory + STBIW_FREE(filt); + if (!zlib) return 0; + + // each tag requires 12 bytes of overhead + out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); + if (!out) return 0; + *out_len = 8 + 12+13 + 12+zlen + 12; + + o=out; + STBIW_MEMMOVE(o,sig,8); o+= 8; + stbiw__wp32(o, 13); // header length + stbiw__wptag(o, "IHDR"); + stbiw__wp32(o, x); + stbiw__wp32(o, y); + *o++ = 8; + *o++ = STBIW_UCHAR(ctype[n]); + *o++ = 0; + *o++ = 0; + *o++ = 0; + stbiw__wpcrc(&o,13); + + stbiw__wp32(o, zlen); + stbiw__wptag(o, "IDAT"); + STBIW_MEMMOVE(o, zlib, zlen); + o += zlen; + STBIW_FREE(zlib); + stbiw__wpcrc(&o, zlen); + + stbiw__wp32(o,0); + stbiw__wptag(o, "IEND"); + stbiw__wpcrc(&o,0); + + STBIW_ASSERT(o == out + *out_len); + + return out; +} + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) +{ + FILE *f; + int len; + unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); + if (png == NULL) return 0; + f = fopen(filename, "wb"); + if (!f) { STBIW_FREE(png); return 0; } + fwrite(png, 1, len, f); + fclose(f); + STBIW_FREE(png); + return 1; +} +#endif + +STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) +{ + int len; + unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); + if (png == NULL) return 0; + func(context, png, len); + STBIW_FREE(png); + return 1; +} + +#endif // STB_IMAGE_WRITE_IMPLEMENTATION + +/* Revision history + 1.02 (2016-04-02) + avoid allocating large structures on the stack + 1.01 (2016-01-16) + STBIW_REALLOC_SIZED: support allocators with no realloc support + avoid race-condition in crc initialization + minor compile issues + 1.00 (2015-09-14) + installable file IO function + 0.99 (2015-09-13) + warning fixes; TGA rle support + 0.98 (2015-04-08) + added STBIW_MALLOC, STBIW_ASSERT etc + 0.97 (2015-01-18) + fixed HDR asserts, rewrote HDR rle logic + 0.96 (2015-01-17) + add HDR output + fix monochrome BMP + 0.95 (2014-08-17) + add monochrome TGA output + 0.94 (2014-05-31) + rename private functions to avoid conflicts with stb_image.h + 0.93 (2014-05-27) + warning fixes + 0.92 (2010-08-01) + casts to unsigned char to fix warnings + 0.91 (2010-07-17) + first public release + 0.90 first internal release +*/ diff --git a/src/external/stb_rect_pack.h b/src/external/stb_rect_pack.h new file mode 100644 index 00000000..bd1cfc60 --- /dev/null +++ b/src/external/stb_rect_pack.h @@ -0,0 +1,572 @@ +// stb_rect_pack.h - v0.08 - public domain - rectangle packing +// Sean Barrett 2014 +// +// Useful for e.g. packing rectangular textures into an atlas. +// Does not do rotation. +// +// Not necessarily the awesomest packing method, but better than +// the totally naive one in stb_truetype (which is primarily what +// this is meant to replace). +// +// Has only had a few tests run, may have issues. +// +// More docs to come. +// +// No memory allocations; uses qsort() and assert() from stdlib. +// Can override those by defining STBRP_SORT and STBRP_ASSERT. +// +// This library currently uses the Skyline Bottom-Left algorithm. +// +// Please note: better rectangle packers are welcome! Please +// implement them to the same API, but with a different init +// function. +// +// Credits +// +// Library +// Sean Barrett +// Minor features +// Martins Mozeiko +// Bugfixes / warning fixes +// Jeremy Jaussaud +// +// Version history: +// +// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) +// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) +// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort +// 0.05: added STBRP_ASSERT to allow replacing assert +// 0.04: fixed minor bug in STBRP_LARGE_RECTS support +// 0.01: initial release +// +// LICENSE +// +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. + +////////////////////////////////////////////////////////////////////////////// +// +// INCLUDE SECTION +// + +#ifndef STB_INCLUDE_STB_RECT_PACK_H +#define STB_INCLUDE_STB_RECT_PACK_H + +#define STB_RECT_PACK_VERSION 1 + +#ifdef STBRP_STATIC +#define STBRP_DEF static +#else +#define STBRP_DEF extern +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct stbrp_context stbrp_context; +typedef struct stbrp_node stbrp_node; +typedef struct stbrp_rect stbrp_rect; + +#ifdef STBRP_LARGE_RECTS +typedef int stbrp_coord; +#else +typedef unsigned short stbrp_coord; +#endif + +STBRP_DEF void stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); +// Assign packed locations to rectangles. The rectangles are of type +// 'stbrp_rect' defined below, stored in the array 'rects', and there +// are 'num_rects' many of them. +// +// Rectangles which are successfully packed have the 'was_packed' flag +// set to a non-zero value and 'x' and 'y' store the minimum location +// on each axis (i.e. bottom-left in cartesian coordinates, top-left +// if you imagine y increasing downwards). Rectangles which do not fit +// have the 'was_packed' flag set to 0. +// +// You should not try to access the 'rects' array from another thread +// while this function is running, as the function temporarily reorders +// the array while it executes. +// +// To pack into another rectangle, you need to call stbrp_init_target +// again. To continue packing into the same rectangle, you can call +// this function again. Calling this multiple times with multiple rect +// arrays will probably produce worse packing results than calling it +// a single time with the full rectangle array, but the option is +// available. + +struct stbrp_rect +{ + // reserved for your use: + int id; + + // input: + stbrp_coord w, h; + + // output: + stbrp_coord x, y; + int was_packed; // non-zero if valid packing + +}; // 16 bytes, nominally + + +STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); +// Initialize a rectangle packer to: +// pack a rectangle that is 'width' by 'height' in dimensions +// using temporary storage provided by the array 'nodes', which is 'num_nodes' long +// +// You must call this function every time you start packing into a new target. +// +// There is no "shutdown" function. The 'nodes' memory must stay valid for +// the following stbrp_pack_rects() call (or calls), but can be freed after +// the call (or calls) finish. +// +// Note: to guarantee best results, either: +// 1. make sure 'num_nodes' >= 'width' +// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' +// +// If you don't do either of the above things, widths will be quantized to multiples +// of small integers to guarantee the algorithm doesn't run out of temporary storage. +// +// If you do #2, then the non-quantized algorithm will be used, but the algorithm +// may run out of temporary storage and be unable to pack some rectangles. + +STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem); +// Optionally call this function after init but before doing any packing to +// change the handling of the out-of-temp-memory scenario, described above. +// If you call init again, this will be reset to the default (false). + + +STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic); +// Optionally select which packing heuristic the library should use. Different +// heuristics will produce better/worse results for different data sets. +// If you call init again, this will be reset to the default. + +enum +{ + STBRP_HEURISTIC_Skyline_default=0, + STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, + STBRP_HEURISTIC_Skyline_BF_sortHeight, +}; + + +////////////////////////////////////////////////////////////////////////////// +// +// the details of the following structures don't matter to you, but they must +// be visible so you can handle the memory allocations for them + +struct stbrp_node +{ + stbrp_coord x,y; + stbrp_node *next; +}; + +struct stbrp_context +{ + int width; + int height; + int align; + int init_mode; + int heuristic; + int num_nodes; + stbrp_node *active_head; + stbrp_node *free_head; + stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' +}; + +#ifdef __cplusplus +} +#endif + +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// IMPLEMENTATION SECTION +// + +#ifdef STB_RECT_PACK_IMPLEMENTATION +#ifndef STBRP_SORT +#include +#define STBRP_SORT qsort +#endif + +#ifndef STBRP_ASSERT +#include +#define STBRP_ASSERT assert +#endif + +enum +{ + STBRP__INIT_skyline = 1, +}; + +STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) +{ + switch (context->init_mode) { + case STBRP__INIT_skyline: + STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); + context->heuristic = heuristic; + break; + default: + STBRP_ASSERT(0); + } +} + +STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) +{ + if (allow_out_of_mem) + // if it's ok to run out of memory, then don't bother aligning them; + // this gives better packing, but may fail due to OOM (even though + // the rectangles easily fit). @TODO a smarter approach would be to only + // quantize once we've hit OOM, then we could get rid of this parameter. + context->align = 1; + else { + // if it's not ok to run out of memory, then quantize the widths + // so that num_nodes is always enough nodes. + // + // I.e. num_nodes * align >= width + // align >= width / num_nodes + // align = ceil(width/num_nodes) + + context->align = (context->width + context->num_nodes-1) / context->num_nodes; + } +} + +STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) +{ + int i; +#ifndef STBRP_LARGE_RECTS + STBRP_ASSERT(width <= 0xffff && height <= 0xffff); +#endif + + for (i=0; i < num_nodes-1; ++i) + nodes[i].next = &nodes[i+1]; + nodes[i].next = NULL; + context->init_mode = STBRP__INIT_skyline; + context->heuristic = STBRP_HEURISTIC_Skyline_default; + context->free_head = &nodes[0]; + context->active_head = &context->extra[0]; + context->width = width; + context->height = height; + context->num_nodes = num_nodes; + stbrp_setup_allow_out_of_mem(context, 0); + + // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) + context->extra[0].x = 0; + context->extra[0].y = 0; + context->extra[0].next = &context->extra[1]; + context->extra[1].x = (stbrp_coord) width; +#ifdef STBRP_LARGE_RECTS + context->extra[1].y = (1<<30); +#else + context->extra[1].y = 65535; +#endif + context->extra[1].next = NULL; +} + +// find minimum y position if it starts at x1 +static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) +{ + stbrp_node *node = first; + int x1 = x0 + width; + int min_y, visited_width, waste_area; + STBRP_ASSERT(first->x <= x0); + + #if 0 + // skip in case we're past the node + while (node->next->x <= x0) + ++node; + #else + STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency + #endif + + STBRP_ASSERT(node->x <= x0); + + min_y = 0; + waste_area = 0; + visited_width = 0; + while (node->x < x1) { + if (node->y > min_y) { + // raise min_y higher. + // we've accounted for all waste up to min_y, + // but we'll now add more waste for everything we've visted + waste_area += visited_width * (node->y - min_y); + min_y = node->y; + // the first time through, visited_width might be reduced + if (node->x < x0) + visited_width += node->next->x - x0; + else + visited_width += node->next->x - node->x; + } else { + // add waste area + int under_width = node->next->x - node->x; + if (under_width + visited_width > width) + under_width = width - visited_width; + waste_area += under_width * (min_y - node->y); + visited_width += under_width; + } + node = node->next; + } + + *pwaste = waste_area; + return min_y; +} + +typedef struct +{ + int x,y; + stbrp_node **prev_link; +} stbrp__findresult; + +static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) +{ + int best_waste = (1<<30), best_x, best_y = (1 << 30); + stbrp__findresult fr; + stbrp_node **prev, *node, *tail, **best = NULL; + + // align to multiple of c->align + width = (width + c->align - 1); + width -= width % c->align; + STBRP_ASSERT(width % c->align == 0); + + node = c->active_head; + prev = &c->active_head; + while (node->x + width <= c->width) { + int y,waste; + y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); + if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL + // bottom left + if (y < best_y) { + best_y = y; + best = prev; + } + } else { + // best-fit + if (y + height <= c->height) { + // can only use it if it first vertically + if (y < best_y || (y == best_y && waste < best_waste)) { + best_y = y; + best_waste = waste; + best = prev; + } + } + } + prev = &node->next; + node = node->next; + } + + best_x = (best == NULL) ? 0 : (*best)->x; + + // if doing best-fit (BF), we also have to try aligning right edge to each node position + // + // e.g, if fitting + // + // ____________________ + // |____________________| + // + // into + // + // | | + // | ____________| + // |____________| + // + // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned + // + // This makes BF take about 2x the time + + if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { + tail = c->active_head; + node = c->active_head; + prev = &c->active_head; + // find first node that's admissible + while (tail->x < width) + tail = tail->next; + while (tail) { + int xpos = tail->x - width; + int y,waste; + STBRP_ASSERT(xpos >= 0); + // find the left position that matches this + while (node->next->x <= xpos) { + prev = &node->next; + node = node->next; + } + STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); + y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); + if (y + height < c->height) { + if (y <= best_y) { + if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { + best_x = xpos; + STBRP_ASSERT(y <= best_y); + best_y = y; + best_waste = waste; + best = prev; + } + } + } + tail = tail->next; + } + } + + fr.prev_link = best; + fr.x = best_x; + fr.y = best_y; + return fr; +} + +static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) +{ + // find best position according to heuristic + stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); + stbrp_node *node, *cur; + + // bail if: + // 1. it failed + // 2. the best node doesn't fit (we don't always check this) + // 3. we're out of memory + if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { + res.prev_link = NULL; + return res; + } + + // on success, create new node + node = context->free_head; + node->x = (stbrp_coord) res.x; + node->y = (stbrp_coord) (res.y + height); + + context->free_head = node->next; + + // insert the new node into the right starting point, and + // let 'cur' point to the remaining nodes needing to be + // stiched back in + + cur = *res.prev_link; + if (cur->x < res.x) { + // preserve the existing one, so start testing with the next one + stbrp_node *next = cur->next; + cur->next = node; + cur = next; + } else { + *res.prev_link = node; + } + + // from here, traverse cur and free the nodes, until we get to one + // that shouldn't be freed + while (cur->next && cur->next->x <= res.x + width) { + stbrp_node *next = cur->next; + // move the current node to the free list + cur->next = context->free_head; + context->free_head = cur; + cur = next; + } + + // stitch the list back in + node->next = cur; + + if (cur->x < res.x + width) + cur->x = (stbrp_coord) (res.x + width); + +#ifdef _DEBUG + cur = context->active_head; + while (cur->x < context->width) { + STBRP_ASSERT(cur->x < cur->next->x); + cur = cur->next; + } + STBRP_ASSERT(cur->next == NULL); + + { + stbrp_node *L1 = NULL, *L2 = NULL; + int count=0; + cur = context->active_head; + while (cur) { + L1 = cur; + cur = cur->next; + ++count; + } + cur = context->free_head; + while (cur) { + L2 = cur; + cur = cur->next; + ++count; + } + STBRP_ASSERT(count == context->num_nodes+2); + } +#endif + + return res; +} + +static int rect_height_compare(const void *a, const void *b) +{ + stbrp_rect *p = (stbrp_rect *) a; + stbrp_rect *q = (stbrp_rect *) b; + if (p->h > q->h) + return -1; + if (p->h < q->h) + return 1; + return (p->w > q->w) ? -1 : (p->w < q->w); +} + +static int rect_width_compare(const void *a, const void *b) +{ + stbrp_rect *p = (stbrp_rect *) a; + stbrp_rect *q = (stbrp_rect *) b; + if (p->w > q->w) + return -1; + if (p->w < q->w) + return 1; + return (p->h > q->h) ? -1 : (p->h < q->h); +} + +static int rect_original_order(const void *a, const void *b) +{ + stbrp_rect *p = (stbrp_rect *) a; + stbrp_rect *q = (stbrp_rect *) b; + return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); +} + +#ifdef STBRP_LARGE_RECTS +#define STBRP__MAXVAL 0xffffffff +#else +#define STBRP__MAXVAL 0xffff +#endif + +STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) +{ + int i; + + // we use the 'was_packed' field internally to allow sorting/unsorting + for (i=0; i < num_rects; ++i) { + rects[i].was_packed = i; + #ifndef STBRP_LARGE_RECTS + STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff); + #endif + } + + // sort according to heuristic + STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); + + for (i=0; i < num_rects; ++i) { + if (rects[i].w == 0 || rects[i].h == 0) { + rects[i].x = rects[i].y = 0; // empty rect needs no space + } else { + stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); + if (fr.prev_link) { + rects[i].x = (stbrp_coord) fr.x; + rects[i].y = (stbrp_coord) fr.y; + } else { + rects[i].x = rects[i].y = STBRP__MAXVAL; + } + } + } + + // unsort + STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); + + // set was_packed flags + for (i=0; i < num_rects; ++i) + rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); +} +#endif diff --git a/src/external/stb_truetype.h b/src/external/stb_truetype.h new file mode 100644 index 00000000..d360d609 --- /dev/null +++ b/src/external/stb_truetype.h @@ -0,0 +1,3267 @@ +// stb_truetype.h - v1.11 - public domain +// authored from 2009-2015 by Sean Barrett / RAD Game Tools +// +// This library processes TrueType files: +// parse files +// extract glyph metrics +// extract glyph shapes +// render glyphs to one-channel bitmaps with antialiasing (box filter) +// +// Todo: +// non-MS cmaps +// crashproof on bad data +// hinting? (no longer patented) +// cleartype-style AA? +// optimize: use simple memory allocator for intermediates +// optimize: build edge-list directly from curves +// optimize: rasterize directly from curves? +// +// ADDITIONAL CONTRIBUTORS +// +// Mikko Mononen: compound shape support, more cmap formats +// Tor Andersson: kerning, subpixel rendering +// +// Misc other: +// Ryan Gordon +// Simon Glass +// +// Bug/warning reports/fixes: +// "Zer" on mollyrocket (with fix) +// Cass Everitt +// stoiko (Haemimont Games) +// Brian Hook +// Walter van Niftrik +// David Gow +// David Given +// Ivan-Assen Ivanov +// Anthony Pesch +// Johan Duparc +// Hou Qiming +// Fabian "ryg" Giesen +// Martins Mozeiko +// Cap Petschulat +// Omar Cornut +// github:aloucks +// Peter LaValle +// Sergey Popov +// Giumo X. Clanjor +// Higor Euripedes +// Thomas Fields +// Derek Vinyard +// +// VERSION HISTORY +// +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef +// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly +// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges +// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; +// variant PackFontRanges to pack and render in separate phases; +// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); +// fixed an assert() bug in the new rasterizer +// replace assert() with STBTT_assert() in new rasterizer +// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) +// also more precise AA rasterizer, except if shapes overlap +// remove need for STBTT_sort +// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC +// 1.04 (2015-04-15) typo in example +// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes +// +// Full history can be found at the end of this file. +// +// LICENSE +// +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. +// +// USAGE +// +// Include this file in whatever places neeed to refer to it. In ONE C/C++ +// file, write: +// #define STB_TRUETYPE_IMPLEMENTATION +// before the #include of this file. This expands out the actual +// implementation into that C/C++ file. +// +// To make the implementation private to the file that generates the implementation, +// #define STBTT_STATIC +// +// Simple 3D API (don't ship this, but it's fine for tools and quick start) +// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture +// stbtt_GetBakedQuad() -- compute quad to draw for a given char +// +// Improved 3D API (more shippable): +// #include "stb_rect_pack.h" -- optional, but you really want it +// stbtt_PackBegin() +// stbtt_PackSetOversample() -- for improved quality on small fonts +// stbtt_PackFontRanges() -- pack and renders +// stbtt_PackEnd() +// stbtt_GetPackedQuad() +// +// "Load" a font file from a memory buffer (you have to keep the buffer loaded) +// stbtt_InitFont() +// stbtt_GetFontOffsetForIndex() -- use for TTC font collections +// +// Render a unicode codepoint to a bitmap +// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap +// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide +// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be +// +// Character advance/positioning +// stbtt_GetCodepointHMetrics() +// stbtt_GetFontVMetrics() +// stbtt_GetCodepointKernAdvance() +// +// Starting with version 1.06, the rasterizer was replaced with a new, +// faster and generally-more-precise rasterizer. The new rasterizer more +// accurately measures pixel coverage for anti-aliasing, except in the case +// where multiple shapes overlap, in which case it overestimates the AA pixel +// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If +// this turns out to be a problem, you can re-enable the old rasterizer with +// #define STBTT_RASTERIZER_VERSION 1 +// which will incur about a 15% speed hit. +// +// ADDITIONAL DOCUMENTATION +// +// Immediately after this block comment are a series of sample programs. +// +// After the sample programs is the "header file" section. This section +// includes documentation for each API function. +// +// Some important concepts to understand to use this library: +// +// Codepoint +// Characters are defined by unicode codepoints, e.g. 65 is +// uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is +// the hiragana for "ma". +// +// Glyph +// A visual character shape (every codepoint is rendered as +// some glyph) +// +// Glyph index +// A font-specific integer ID representing a glyph +// +// Baseline +// Glyph shapes are defined relative to a baseline, which is the +// bottom of uppercase characters. Characters extend both above +// and below the baseline. +// +// Current Point +// As you draw text to the screen, you keep track of a "current point" +// which is the origin of each character. The current point's vertical +// position is the baseline. Even "baked fonts" use this model. +// +// Vertical Font Metrics +// The vertical qualities of the font, used to vertically position +// and space the characters. See docs for stbtt_GetFontVMetrics. +// +// Font Size in Pixels or Points +// The preferred interface for specifying font sizes in stb_truetype +// is to specify how tall the font's vertical extent should be in pixels. +// If that sounds good enough, skip the next paragraph. +// +// Most font APIs instead use "points", which are a common typographic +// measurement for describing font size, defined as 72 points per inch. +// stb_truetype provides a point API for compatibility. However, true +// "per inch" conventions don't make much sense on computer displays +// since they different monitors have different number of pixels per +// inch. For example, Windows traditionally uses a convention that +// there are 96 pixels per inch, thus making 'inch' measurements have +// nothing to do with inches, and thus effectively defining a point to +// be 1.333 pixels. Additionally, the TrueType font data provides +// an explicit scale factor to scale a given font's glyphs to points, +// but the author has observed that this scale factor is often wrong +// for non-commercial fonts, thus making fonts scaled in points +// according to the TrueType spec incoherently sized in practice. +// +// ADVANCED USAGE +// +// Quality: +// +// - Use the functions with Subpixel at the end to allow your characters +// to have subpixel positioning. Since the font is anti-aliased, not +// hinted, this is very import for quality. (This is not possible with +// baked fonts.) +// +// - Kerning is now supported, and if you're supporting subpixel rendering +// then kerning is worth using to give your text a polished look. +// +// Performance: +// +// - Convert Unicode codepoints to glyph indexes and operate on the glyphs; +// if you don't do this, stb_truetype is forced to do the conversion on +// every call. +// +// - There are a lot of memory allocations. We should modify it to take +// a temp buffer and allocate from the temp buffer (without freeing), +// should help performance a lot. +// +// NOTES +// +// The system uses the raw data found in the .ttf file without changing it +// and without building auxiliary data structures. This is a bit inefficient +// on little-endian systems (the data is big-endian), but assuming you're +// caching the bitmaps or glyph shapes this shouldn't be a big deal. +// +// It appears to be very hard to programmatically determine what font a +// given file is in a general way. I provide an API for this, but I don't +// recommend it. +// +// +// SOURCE STATISTICS (based on v0.6c, 2050 LOC) +// +// Documentation & header file 520 LOC \___ 660 LOC documentation +// Sample code 140 LOC / +// Truetype parsing 620 LOC ---- 620 LOC TrueType +// Software rasterization 240 LOC \ . +// Curve tesselation 120 LOC \__ 550 LOC Bitmap creation +// Bitmap management 100 LOC / +// Baked bitmap interface 70 LOC / +// Font name matching & access 150 LOC ---- 150 +// C runtime library abstraction 60 LOC ---- 60 +// +// +// PERFORMANCE MEASUREMENTS FOR 1.06: +// +// 32-bit 64-bit +// Previous release: 8.83 s 7.68 s +// Pool allocations: 7.72 s 6.34 s +// Inline sort : 6.54 s 5.65 s +// New rasterizer : 5.63 s 5.00 s + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//// +//// SAMPLE PROGRAMS +//// +// +// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless +// +#if 0 +#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation +#include "stb_truetype.h" + +unsigned char ttf_buffer[1<<20]; +unsigned char temp_bitmap[512*512]; + +stbtt_bakedchar cdata[96]; // ASCII 32..126 is 95 glyphs +GLuint ftex; + +void my_stbtt_initfont(void) +{ + fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb")); + stbtt_BakeFontBitmap(ttf_buffer,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits! + // can free ttf_buffer at this point + glGenTextures(1, &ftex); + glBindTexture(GL_TEXTURE_2D, ftex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, temp_bitmap); + // can free temp_bitmap at this point + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); +} + +void my_stbtt_print(float x, float y, char *text) +{ + // assume orthographic projection with units = screen pixels, origin at top left + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, ftex); + glBegin(GL_QUADS); + while (*text) { + if (*text >= 32 && *text < 128) { + stbtt_aligned_quad q; + stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 + glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); + glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); + glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); + glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); + } + ++text; + } + glEnd(); +} +#endif +// +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program (this compiles): get a single bitmap, print as ASCII art +// +#if 0 +#include +#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation +#include "stb_truetype.h" + +char ttf_buffer[1<<25]; + +int main(int argc, char **argv) +{ + stbtt_fontinfo font; + unsigned char *bitmap; + int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); + + fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); + + stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); + bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); + + for (j=0; j < h; ++j) { + for (i=0; i < w; ++i) + putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); + putchar('\n'); + } + return 0; +} +#endif +// +// Output: +// +// .ii. +// @@@@@@. +// V@Mio@@o +// :i. V@V +// :oM@@M +// :@@@MM@M +// @@o o@M +// :@@. M@M +// @@@o@@@@ +// :M@@V:@@. +// +////////////////////////////////////////////////////////////////////////////// +// +// Complete program: print "Hello World!" banner, with bugs +// +#if 0 +char buffer[24<<20]; +unsigned char screen[20][79]; + +int main(int arg, char **argv) +{ + stbtt_fontinfo font; + int i,j,ascent,baseline,ch=0; + float scale, xpos=2; // leave a little padding in case the character extends left + char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness + + fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); + stbtt_InitFont(&font, buffer, 0); + + scale = stbtt_ScaleForPixelHeight(&font, 15); + stbtt_GetFontVMetrics(&font, &ascent,0,0); + baseline = (int) (ascent*scale); + + while (text[ch]) { + int advance,lsb,x0,y0,x1,y1; + float x_shift = xpos - (float) floor(xpos); + stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb); + stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1); + stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]); + // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong + // because this API is really for baking character bitmaps into textures. if you want to render + // a sequence of characters, you really need to render each bitmap to a temp buffer, then + // "alpha blend" that into the working buffer + xpos += (advance * scale); + if (text[ch+1]) + xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]); + ++ch; + } + + for (j=0; j < 20; ++j) { + for (i=0; i < 78; ++i) + putchar(" .:ioVM@"[screen[j][i]>>5]); + putchar('\n'); + } + + return 0; +} +#endif + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//// +//// INTEGRATION WITH YOUR CODEBASE +//// +//// The following sections allow you to supply alternate definitions +//// of C library functions used by stb_truetype. + +#ifdef STB_TRUETYPE_IMPLEMENTATION + // #define your own (u)stbtt_int8/16/32 before including to override this + #ifndef stbtt_uint8 + typedef unsigned char stbtt_uint8; + typedef signed char stbtt_int8; + typedef unsigned short stbtt_uint16; + typedef signed short stbtt_int16; + typedef unsigned int stbtt_uint32; + typedef signed int stbtt_int32; + #endif + + typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; + typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; + + // #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h + #ifndef STBTT_ifloor + #include + #define STBTT_ifloor(x) ((int) floor(x)) + #define STBTT_iceil(x) ((int) ceil(x)) + #endif + + #ifndef STBTT_sqrt + #include + #define STBTT_sqrt(x) sqrt(x) + #endif + + #ifndef STBTT_fabs + #include + #define STBTT_fabs(x) fabs(x) + #endif + + // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h + #ifndef STBTT_malloc + #include + #define STBTT_malloc(x,u) ((void)(u),malloc(x)) + #define STBTT_free(x,u) ((void)(u),free(x)) + #endif + + #ifndef STBTT_assert + #include + #define STBTT_assert(x) assert(x) + #endif + + #ifndef STBTT_strlen + #include + #define STBTT_strlen(x) strlen(x) + #endif + + #ifndef STBTT_memcpy + #include + #define STBTT_memcpy memcpy + #define STBTT_memset memset + #endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// INTERFACE +//// +//// + +#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ +#define __STB_INCLUDE_STB_TRUETYPE_H__ + +#ifdef STBTT_STATIC +#define STBTT_DEF static +#else +#define STBTT_DEF extern +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// TEXTURE BAKING API +// +// If you use this API, you only have to call two functions ever. +// + +typedef struct +{ + unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap + float xoff,yoff,xadvance; +} stbtt_bakedchar; + +STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata); // you allocate this, it's num_chars long +// if return is positive, the first unused row of the bitmap +// if return is negative, returns the negative of the number of characters that fit +// if return is 0, no characters fit and no rows were used +// This uses a very crappy packing. + +typedef struct +{ + float x0,y0,s0,t0; // top-left + float x1,y1,s1,t1; // bottom-right +} stbtt_aligned_quad; + +STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, // same data as above + int char_index, // character to display + float *xpos, float *ypos, // pointers to current position in screen pixel space + stbtt_aligned_quad *q, // output: quad to draw + int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier +// Call GetBakedQuad with char_index = 'character - first_char', and it +// creates the quad you need to draw and advances the current position. +// +// The coordinate system used assumes y increases downwards. +// +// Characters will extend both above and below the current position; +// see discussion of "BASELINE" above. +// +// It's inefficient; you might want to c&p it and optimize it. + + + +////////////////////////////////////////////////////////////////////////////// +// +// NEW TEXTURE BAKING API +// +// This provides options for packing multiple fonts into one atlas, not +// perfectly but better than nothing. + +typedef struct +{ + unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap + float xoff,yoff,xadvance; + float xoff2,yoff2; +} stbtt_packedchar; + +typedef struct stbtt_pack_context stbtt_pack_context; +typedef struct stbtt_fontinfo stbtt_fontinfo; +#ifndef STB_RECT_PACK_VERSION +typedef struct stbrp_rect stbrp_rect; +#endif + +STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); +// Initializes a packing context stored in the passed-in stbtt_pack_context. +// Future calls using this context will pack characters into the bitmap passed +// in here: a 1-channel bitmap that is weight x height. stride_in_bytes is +// the distance from one row to the next (or 0 to mean they are packed tightly +// together). "padding" is the amount of padding to leave between each +// character (normally you want '1' for bitmaps you'll use as textures with +// bilinear filtering). +// +// Returns 0 on failure, 1 on success. + +STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); +// Cleans up the packing context and frees all memory. + +#define STBTT_POINT_SIZE(x) (-(x)) + +STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, float font_size, + int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); +// Creates character bitmaps from the font_index'th font found in fontdata (use +// font_index=0 if you don't know what that is). It creates num_chars_in_range +// bitmaps for characters with unicode values starting at first_unicode_char_in_range +// and increasing. Data for how to render them is stored in chardata_for_range; +// pass these to stbtt_GetPackedQuad to get back renderable quads. +// +// font_size is the full height of the character from ascender to descender, +// as computed by stbtt_ScaleForPixelHeight. To use a point size as computed +// by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() +// and pass that result as 'font_size': +// ..., 20 , ... // font max minus min y is 20 pixels tall +// ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall + +typedef struct +{ + float font_size; + int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint + int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints + int num_chars; + stbtt_packedchar *chardata_for_range; // output + unsigned char h_oversample, v_oversample; // don't set these, they're used internally +} stbtt_pack_range; + +STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges); +// Creates character bitmaps from multiple ranges of characters stored in +// ranges. This will usually create a better-packed bitmap than multiple +// calls to stbtt_PackFontRange. Note that you can call this multiple +// times within a single PackBegin/PackEnd. + +STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample); +// Oversampling a font increases the quality by allowing higher-quality subpixel +// positioning, and is especially valuable at smaller text sizes. +// +// This function sets the amount of oversampling for all following calls to +// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given +// pack context. The default (no oversampling) is achieved by h_oversample=1 +// and v_oversample=1. The total number of pixels required is +// h_oversample*v_oversample larger than the default; for example, 2x2 +// oversampling requires 4x the storage of 1x1. For best results, render +// oversampled textures with bilinear filtering. Look at the readme in +// stb/tests/oversample for information about oversampled fonts +// +// To use with PackFontRangesGather etc., you must set it before calls +// call to PackFontRangesGatherRects. + +STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, // same data as above + int char_index, // character to display + float *xpos, float *ypos, // pointers to current position in screen pixel space + stbtt_aligned_quad *q, // output: quad to draw + int align_to_integer); + +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +// Calling these functions in sequence is roughly equivalent to calling +// stbtt_PackFontRanges(). If you more control over the packing of multiple +// fonts, or if you want to pack custom data into a font texture, take a look +// at the source to of stbtt_PackFontRanges() and create a custom version +// using these functions, e.g. call GatherRects multiple times, +// building up a single array of rects, then call PackRects once, +// then call RenderIntoRects repeatedly. This may result in a +// better packing than calling PackFontRanges multiple times +// (or it may not). + +// this is an opaque structure that you shouldn't mess with which holds +// all the context needed from PackBegin to PackEnd. +struct stbtt_pack_context { + void *user_allocator_context; + void *pack_info; + int width; + int height; + int stride_in_bytes; + int padding; + unsigned int h_oversample, v_oversample; + unsigned char *pixels; + void *nodes; +}; + +////////////////////////////////////////////////////////////////////////////// +// +// FONT LOADING +// +// + +STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); +// Each .ttf/.ttc file may have more than one font. Each font has a sequential +// index number starting from 0. Call this function to get the font offset for +// a given index; it returns -1 if the index is out of range. A regular .ttf +// file will only define one font and it always be at offset 0, so it will +// return '0' for index 0, and -1 for all other indices. You can just skip +// this step if you know it's that kind of font. + + +// The following structure is defined publically so you can declare one on +// the stack or as a global or etc, but you should treat it as opaque. +struct stbtt_fontinfo +{ + void * userdata; + unsigned char * data; // pointer to .ttf file + int fontstart; // offset of start of font + + int numGlyphs; // number of glyphs, needed for range checking + + int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf + int index_map; // a cmap mapping for our chosen character encoding + int indexToLocFormat; // format needed to map from glyph index to glyph +}; + +STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); +// Given an offset into the file that defines a font, this function builds +// the necessary cached info for the rest of the system. You must allocate +// the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't +// need to do anything special to free it, because the contents are pure +// value data with no additional data structures. Returns 0 on failure. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER TO GLYPH-INDEX CONVERSIOn + +STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); +// If you're going to perform multiple operations on the same character +// and you want a speed-up, call this function with the character you're +// going to process, then use glyph-based functions instead of the +// codepoint-based functions. + + +////////////////////////////////////////////////////////////////////////////// +// +// CHARACTER PROPERTIES +// + +STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); +// computes a scale factor to produce a font whose "height" is 'pixels' tall. +// Height is measured as the distance from the highest ascender to the lowest +// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics +// and computing: +// scale = pixels / (ascent - descent) +// so if you prefer to measure height by the ascent only, use a similar calculation. + +STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); +// computes a scale factor to produce a font whose EM size is mapped to +// 'pixels' tall. This is probably what traditional APIs compute, but +// I'm not positive. + +STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); +// ascent is the coordinate above the baseline the font extends; descent +// is the coordinate below the baseline the font extends (i.e. it is typically negative) +// lineGap is the spacing between one row's descent and the next row's ascent... +// so you should advance the vertical position by "*ascent - *descent + *lineGap" +// these are expressed in unscaled coordinates, so you must multiply by +// the scale factor for a given size + +STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); +// the bounding box around all possible characters + +STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); +// leftSideBearing is the offset from the current horizontal position to the left edge of the character +// advanceWidth is the offset from the current horizontal position to the next horizontal position +// these are expressed in unscaled coordinates + +STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); +// an additional amount to add to the 'advance' value between ch1 and ch2 + +STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); +// Gets the bounding box of the visible part of the glyph, in unscaled coordinates + +STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); +STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); +STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); +// as above, but takes one or more glyph indices for greater efficiency + + +////////////////////////////////////////////////////////////////////////////// +// +// GLYPH SHAPES (you probably don't need these, but they have to go before +// the bitmaps for C declaration-order reasons) +// + +#ifndef STBTT_vmove // you can predefine these to use different values (but why?) + enum { + STBTT_vmove=1, + STBTT_vline, + STBTT_vcurve + }; +#endif + +#ifndef stbtt_vertex // you can predefine this to use different values + // (we share this with other code at RAD) + #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file + typedef struct + { + stbtt_vertex_type x,y,cx,cy; + unsigned char type,padding; + } stbtt_vertex; +#endif + +STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); +// returns non-zero if nothing is drawn for this glyph + +STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); +STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); +// returns # of vertices and fills *vertices with the pointer to them +// these are expressed in "unscaled" coordinates +// +// The shape is a series of countours. Each one starts with +// a STBTT_moveto, then consists of a series of mixed +// STBTT_lineto and STBTT_curveto segments. A lineto +// draws a line from previous endpoint to its x,y; a curveto +// draws a quadratic bezier from previous endpoint to +// its x,y, using cx,cy as the bezier control point. + +STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); +// frees the data allocated above + +////////////////////////////////////////////////////////////////////////////// +// +// BITMAP RENDERING +// + +STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); +// frees the bitmap allocated below + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); +// allocates a large-enough single-channel 8bpp bitmap and renders the +// specified character/glyph at the specified scale into it, with +// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). +// *width & *height are filled out with the width & height of the bitmap, +// which is stored left-to-right, top-to-bottom. +// +// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); +// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel +// shift for the character + +STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); +// the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap +// in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap +// is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the +// width and height and positioning info for it first. + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); +// same as stbtt_MakeCodepointBitmap, but you can specify a subpixel +// shift for the character + +STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +// get the bbox of the bitmap centered around the glyph origin; so the +// bitmap width is ix1-ix0, height is iy1-iy0, and location to place +// the bitmap top left is (leftSideBearing*scale,iy0). +// (Note that the bitmap uses y-increases-down, but the shape uses +// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) + +STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); +// same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel +// shift for the character + +// the following functions are equivalent to the above functions, but operate +// on glyph indices instead of Unicode codepoints (for efficiency) +STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); +STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); +STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); +STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); +STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); + + +// @TODO: don't expose this structure +typedef struct +{ + int w,h,stride; + unsigned char *pixels; +} stbtt__bitmap; + +// rasterize a shape with quadratic beziers into a bitmap +STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into + float flatness_in_pixels, // allowable error of curve in pixels + stbtt_vertex *vertices, // array of vertices defining shape + int num_verts, // number of vertices in above array + float scale_x, float scale_y, // scale applied to input vertices + float shift_x, float shift_y, // translation applied to input vertices + int x_off, int y_off, // another translation applied to input + int invert, // if non-zero, vertically flip shape + void *userdata); // context for to STBTT_MALLOC + +////////////////////////////////////////////////////////////////////////////// +// +// Finding the right font... +// +// You should really just solve this offline, keep your own tables +// of what font is what, and don't try to get it out of the .ttf file. +// That's because getting it out of the .ttf file is really hard, because +// the names in the file can appear in many possible encodings, in many +// possible languages, and e.g. if you need a case-insensitive comparison, +// the details of that depend on the encoding & language in a complex way +// (actually underspecified in truetype, but also gigantic). +// +// But you can use the provided functions in two possible ways: +// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on +// unicode-encoded names to try to find the font you want; +// you can run this before calling stbtt_InitFont() +// +// stbtt_GetFontNameString() lets you get any of the various strings +// from the file yourself and do your own comparisons on them. +// You have to have called stbtt_InitFont() first. + + +STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); +// returns the offset (not index) of the font that matches, or -1 if none +// if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". +// if you use any other flag, use a font name like "Arial"; this checks +// the 'macStyle' header field; i don't know if fonts set this consistently +#define STBTT_MACSTYLE_DONTCARE 0 +#define STBTT_MACSTYLE_BOLD 1 +#define STBTT_MACSTYLE_ITALIC 2 +#define STBTT_MACSTYLE_UNDERSCORE 4 +#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 + +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); +// returns 1/0 whether the first string interpreted as utf8 is identical to +// the second string interpreted as big-endian utf16... useful for strings from next func + +STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); +// returns the string (which may be big-endian double byte, e.g. for unicode) +// and puts the length in bytes in *length. +// +// some of the values for the IDs are below; for more see the truetype spec: +// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html +// http://www.microsoft.com/typography/otspec/name.htm + +enum { // platformID + STBTT_PLATFORM_ID_UNICODE =0, + STBTT_PLATFORM_ID_MAC =1, + STBTT_PLATFORM_ID_ISO =2, + STBTT_PLATFORM_ID_MICROSOFT =3 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_UNICODE + STBTT_UNICODE_EID_UNICODE_1_0 =0, + STBTT_UNICODE_EID_UNICODE_1_1 =1, + STBTT_UNICODE_EID_ISO_10646 =2, + STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, + STBTT_UNICODE_EID_UNICODE_2_0_FULL=4 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT + STBTT_MS_EID_SYMBOL =0, + STBTT_MS_EID_UNICODE_BMP =1, + STBTT_MS_EID_SHIFTJIS =2, + STBTT_MS_EID_UNICODE_FULL =10 +}; + +enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes + STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, + STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, + STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, + STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 +}; + +enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... + // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs + STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, + STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, + STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, + STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, + STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, + STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D +}; + +enum { // languageID for STBTT_PLATFORM_ID_MAC + STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, + STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, + STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, + STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , + STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , + STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, + STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 +}; + +#ifdef __cplusplus +} +#endif + +#endif // __STB_INCLUDE_STB_TRUETYPE_H__ + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +//// +//// IMPLEMENTATION +//// +//// + +#ifdef STB_TRUETYPE_IMPLEMENTATION + +#ifndef STBTT_MAX_OVERSAMPLE +#define STBTT_MAX_OVERSAMPLE 8 +#endif + +#if STBTT_MAX_OVERSAMPLE > 255 +#error "STBTT_MAX_OVERSAMPLE cannot be > 255" +#endif + +typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; + +#ifndef STBTT_RASTERIZER_VERSION +#define STBTT_RASTERIZER_VERSION 2 +#endif + +#ifdef _MSC_VER +#define STBTT__NOTUSED(v) (void)(v) +#else +#define STBTT__NOTUSED(v) (void)sizeof(v) +#endif + +////////////////////////////////////////////////////////////////////////// +// +// accessors to parse data from file +// + +// on platforms that don't allow misaligned reads, if we want to allow +// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE + +#define ttBYTE(p) (* (stbtt_uint8 *) (p)) +#define ttCHAR(p) (* (stbtt_int8 *) (p)) +#define ttFixed(p) ttLONG(p) + +#if defined(STB_TRUETYPE_BIGENDIAN) && !defined(ALLOW_UNALIGNED_TRUETYPE) + + #define ttUSHORT(p) (* (stbtt_uint16 *) (p)) + #define ttSHORT(p) (* (stbtt_int16 *) (p)) + #define ttULONG(p) (* (stbtt_uint32 *) (p)) + #define ttLONG(p) (* (stbtt_int32 *) (p)) + +#else + + static stbtt_uint16 ttUSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } + static stbtt_int16 ttSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } + static stbtt_uint32 ttULONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } + static stbtt_int32 ttLONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } + +#endif + +#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) +#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) + +static int stbtt__isfont(const stbtt_uint8 *font) +{ + // check the version number + if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 + if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! + if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF + if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 + return 0; +} + +// @OPTIMIZE: binary search +static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) +{ + stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); + stbtt_uint32 tabledir = fontstart + 12; + stbtt_int32 i; + for (i=0; i < num_tables; ++i) { + stbtt_uint32 loc = tabledir + 16*i; + if (stbtt_tag(data+loc+0, tag)) + return ttULONG(data+loc+8); + } + return 0; +} + +STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, int index) +{ + // if it's just a font, there's only one valid index + if (stbtt__isfont(font_collection)) + return index == 0 ? 0 : -1; + + // check if it's a TTC + if (stbtt_tag(font_collection, "ttcf")) { + // version 1? + if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { + stbtt_int32 n = ttLONG(font_collection+8); + if (index >= n) + return -1; + return ttULONG(font_collection+12+index*4); + } + } + return -1; +} + +STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data2, int fontstart) +{ + stbtt_uint8 *data = (stbtt_uint8 *) data2; + stbtt_uint32 cmap, t; + stbtt_int32 i,numTables; + + info->data = data; + info->fontstart = fontstart; + + cmap = stbtt__find_table(data, fontstart, "cmap"); // required + info->loca = stbtt__find_table(data, fontstart, "loca"); // required + info->head = stbtt__find_table(data, fontstart, "head"); // required + info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required + info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required + info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required + info->kern = stbtt__find_table(data, fontstart, "kern"); // not required + if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx) + return 0; + + t = stbtt__find_table(data, fontstart, "maxp"); + if (t) + info->numGlyphs = ttUSHORT(data+t+4); + else + info->numGlyphs = 0xffff; + + // find a cmap encoding table we understand *now* to avoid searching + // later. (todo: could make this installable) + // the same regardless of glyph. + numTables = ttUSHORT(data + cmap + 2); + info->index_map = 0; + for (i=0; i < numTables; ++i) { + stbtt_uint32 encoding_record = cmap + 4 + 8 * i; + // find an encoding we understand: + switch(ttUSHORT(data+encoding_record)) { + case STBTT_PLATFORM_ID_MICROSOFT: + switch (ttUSHORT(data+encoding_record+2)) { + case STBTT_MS_EID_UNICODE_BMP: + case STBTT_MS_EID_UNICODE_FULL: + // MS/Unicode + info->index_map = cmap + ttULONG(data+encoding_record+4); + break; + } + break; + case STBTT_PLATFORM_ID_UNICODE: + // Mac/iOS has these + // all the encodingIDs are unicode, so we don't bother to check it + info->index_map = cmap + ttULONG(data+encoding_record+4); + break; + } + } + if (info->index_map == 0) + return 0; + + info->indexToLocFormat = ttUSHORT(data+info->head + 50); + return 1; +} + +STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) +{ + stbtt_uint8 *data = info->data; + stbtt_uint32 index_map = info->index_map; + + stbtt_uint16 format = ttUSHORT(data + index_map + 0); + if (format == 0) { // apple byte encoding + stbtt_int32 bytes = ttUSHORT(data + index_map + 2); + if (unicode_codepoint < bytes-6) + return ttBYTE(data + index_map + 6 + unicode_codepoint); + return 0; + } else if (format == 6) { + stbtt_uint32 first = ttUSHORT(data + index_map + 6); + stbtt_uint32 count = ttUSHORT(data + index_map + 8); + if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) + return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); + return 0; + } else if (format == 2) { + STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean + return 0; + } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges + stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; + stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; + stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); + stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; + + // do a binary search of the segments + stbtt_uint32 endCount = index_map + 14; + stbtt_uint32 search = endCount; + + if (unicode_codepoint > 0xffff) + return 0; + + // they lie from endCount .. endCount + segCount + // but searchRange is the nearest power of two, so... + if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) + search += rangeShift*2; + + // now decrement to bias correctly to find smallest + search -= 2; + while (entrySelector) { + stbtt_uint16 end; + searchRange >>= 1; + end = ttUSHORT(data + search + searchRange*2); + if (unicode_codepoint > end) + search += searchRange*2; + --entrySelector; + } + search += 2; + + { + stbtt_uint16 offset, start; + stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); + + STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); + start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); + if (unicode_codepoint < start) + return 0; + + offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); + if (offset == 0) + return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); + + return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); + } + } else if (format == 12 || format == 13) { + stbtt_uint32 ngroups = ttULONG(data+index_map+12); + stbtt_int32 low,high; + low = 0; high = (stbtt_int32)ngroups; + // Binary search the right group. + while (low < high) { + stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high + stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); + stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); + if ((stbtt_uint32) unicode_codepoint < start_char) + high = mid; + else if ((stbtt_uint32) unicode_codepoint > end_char) + low = mid+1; + else { + stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); + if (format == 12) + return start_glyph + unicode_codepoint-start_char; + else // format == 13 + return start_glyph; + } + } + return 0; // not found + } + // @TODO + STBTT_assert(0); + return 0; +} + +STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) +{ + return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); +} + +static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) +{ + v->type = type; + v->x = (stbtt_int16) x; + v->y = (stbtt_int16) y; + v->cx = (stbtt_int16) cx; + v->cy = (stbtt_int16) cy; +} + +static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) +{ + int g1,g2; + + if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range + if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format + + if (info->indexToLocFormat == 0) { + g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; + g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; + } else { + g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); + g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); + } + + return g1==g2 ? -1 : g1; // if length is 0, return -1 +} + +STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) +{ + int g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 0; + + if (x0) *x0 = ttSHORT(info->data + g + 2); + if (y0) *y0 = ttSHORT(info->data + g + 4); + if (x1) *x1 = ttSHORT(info->data + g + 6); + if (y1) *y1 = ttSHORT(info->data + g + 8); + return 1; +} + +STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) +{ + return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); +} + +STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) +{ + stbtt_int16 numberOfContours; + int g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 1; + numberOfContours = ttSHORT(info->data + g); + return numberOfContours == 0; +} + +static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, + stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) +{ + if (start_off) { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); + } else { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); + } + return num_vertices; +} + +STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + stbtt_int16 numberOfContours; + stbtt_uint8 *endPtsOfContours; + stbtt_uint8 *data = info->data; + stbtt_vertex *vertices=0; + int num_vertices=0; + int g = stbtt__GetGlyfOffset(info, glyph_index); + + *pvertices = NULL; + + if (g < 0) return 0; + + numberOfContours = ttSHORT(data + g); + + if (numberOfContours > 0) { + stbtt_uint8 flags=0,flagcount; + stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; + stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; + stbtt_uint8 *points; + endPtsOfContours = (data + g + 10); + ins = ttUSHORT(data + g + 10 + numberOfContours * 2); + points = data + g + 10 + numberOfContours * 2 + 2 + ins; + + n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); + + m = n + 2*numberOfContours; // a loose bound on how many vertices we might need + vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); + if (vertices == 0) + return 0; + + next_move = 0; + flagcount=0; + + // in first pass, we load uninterpreted data into the allocated array + // above, shifted to the end of the array so we won't overwrite it when + // we create our final data starting from the front + + off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated + + // first load flags + + for (i=0; i < n; ++i) { + if (flagcount == 0) { + flags = *points++; + if (flags & 8) + flagcount = *points++; + } else + --flagcount; + vertices[off+i].type = flags; + } + + // now load x coordinates + x=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 2) { + stbtt_int16 dx = *points++; + x += (flags & 16) ? dx : -dx; // ??? + } else { + if (!(flags & 16)) { + x = x + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].x = (stbtt_int16) x; + } + + // now load y coordinates + y=0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + if (flags & 4) { + stbtt_int16 dy = *points++; + y += (flags & 32) ? dy : -dy; // ??? + } else { + if (!(flags & 32)) { + y = y + (stbtt_int16) (points[0]*256 + points[1]); + points += 2; + } + } + vertices[off+i].y = (stbtt_int16) y; + } + + // now convert them to our format + num_vertices=0; + sx = sy = cx = cy = scx = scy = 0; + for (i=0; i < n; ++i) { + flags = vertices[off+i].type; + x = (stbtt_int16) vertices[off+i].x; + y = (stbtt_int16) vertices[off+i].y; + + if (next_move == i) { + if (i != 0) + num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); + + // now start the new one + start_off = !(flags & 1); + if (start_off) { + // if we start off with an off-curve point, then when we need to find a point on the curve + // where we can start, and we need to save some state for when we wraparound. + scx = x; + scy = y; + if (!(vertices[off+i+1].type & 1)) { + // next point is also a curve point, so interpolate an on-point curve + sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; + sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; + } else { + // otherwise just use the next point as our start point + sx = (stbtt_int32) vertices[off+i+1].x; + sy = (stbtt_int32) vertices[off+i+1].y; + ++i; // we're using point i+1 as the starting point, so skip it + } + } else { + sx = x; + sy = y; + } + stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); + was_off = 0; + next_move = 1 + ttUSHORT(endPtsOfContours+j*2); + ++j; + } else { + if (!(flags & 1)) { // if it's a curve + if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); + cx = x; + cy = y; + was_off = 1; + } else { + if (was_off) + stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); + else + stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); + was_off = 0; + } + } + } + num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); + } else if (numberOfContours == -1) { + // Compound shapes. + int more = 1; + stbtt_uint8 *comp = data + g + 10; + num_vertices = 0; + vertices = 0; + while (more) { + stbtt_uint16 flags, gidx; + int comp_num_verts = 0, i; + stbtt_vertex *comp_verts = 0, *tmp = 0; + float mtx[6] = {1,0,0,1,0,0}, m, n; + + flags = ttSHORT(comp); comp+=2; + gidx = ttSHORT(comp); comp+=2; + + if (flags & 2) { // XY values + if (flags & 1) { // shorts + mtx[4] = ttSHORT(comp); comp+=2; + mtx[5] = ttSHORT(comp); comp+=2; + } else { + mtx[4] = ttCHAR(comp); comp+=1; + mtx[5] = ttCHAR(comp); comp+=1; + } + } + else { + // @TODO handle matching point + STBTT_assert(0); + } + if (flags & (1<<3)) { // WE_HAVE_A_SCALE + mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = mtx[2] = 0; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO + mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; + mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; + } + + // Find transformation scales. + m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); + n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); + + // Get indexed glyph. + comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); + if (comp_num_verts > 0) { + // Transform vertices. + for (i = 0; i < comp_num_verts; ++i) { + stbtt_vertex* v = &comp_verts[i]; + stbtt_vertex_type x,y; + x=v->x; y=v->y; + v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + x=v->cx; y=v->cy; + v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); + v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); + } + // Append vertices. + tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); + if (!tmp) { + if (vertices) STBTT_free(vertices, info->userdata); + if (comp_verts) STBTT_free(comp_verts, info->userdata); + return 0; + } + if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); + STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); + if (vertices) STBTT_free(vertices, info->userdata); + vertices = tmp; + STBTT_free(comp_verts, info->userdata); + num_vertices += comp_num_verts; + } + // More components ? + more = flags & (1<<5); + } + } else if (numberOfContours < 0) { + // @TODO other compound variations? + STBTT_assert(0); + } else { + // numberOfCounters == 0, do nothing + } + + *pvertices = vertices; + return num_vertices; +} + +STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) +{ + stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); + if (glyph_index < numOfLongHorMetrics) { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); + } else { + if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); + if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); + } +} + +STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) +{ + stbtt_uint8 *data = info->data + info->kern; + stbtt_uint32 needle, straw; + int l, r, m; + + // we only look at the first table. it must be 'horizontal' and format 0. + if (!info->kern) + return 0; + if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 + return 0; + if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format + return 0; + + l = 0; + r = ttUSHORT(data+10) - 1; + needle = glyph1 << 16 | glyph2; + while (l <= r) { + m = (l + r) >> 1; + straw = ttULONG(data+18+(m*6)); // note: unaligned read + if (needle < straw) + r = m - 1; + else if (needle > straw) + l = m + 1; + else + return ttSHORT(data+22+(m*6)); + } + return 0; +} + +STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) +{ + if (!info->kern) // if no kerning table, don't waste time looking up both codepoint->glyphs + return 0; + return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); +} + +STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) +{ + stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); +} + +STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) +{ + if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); + if (descent) *descent = ttSHORT(info->data+info->hhea + 6); + if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); +} + +STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) +{ + *x0 = ttSHORT(info->data + info->head + 36); + *y0 = ttSHORT(info->data + info->head + 38); + *x1 = ttSHORT(info->data + info->head + 40); + *y1 = ttSHORT(info->data + info->head + 42); +} + +STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) +{ + int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); + return (float) height / fheight; +} + +STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) +{ + int unitsPerEm = ttUSHORT(info->data + info->head + 18); + return pixels / unitsPerEm; +} + +STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) +{ + STBTT_free(v, info->userdata); +} + +////////////////////////////////////////////////////////////////////////////// +// +// antialiasing software rasterizer +// + +STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning + if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { + // e.g. space character + if (ix0) *ix0 = 0; + if (iy0) *iy0 = 0; + if (ix1) *ix1 = 0; + if (iy1) *iy1 = 0; + } else { + // move to integral bboxes (treating pixels as little squares, what pixels get touched)? + if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); + if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); + if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); + if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); + } +} + +STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); +} + +STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); +} + +STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) +{ + stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); +} + +////////////////////////////////////////////////////////////////////////////// +// +// Rasterizer + +typedef struct stbtt__hheap_chunk +{ + struct stbtt__hheap_chunk *next; +} stbtt__hheap_chunk; + +typedef struct stbtt__hheap +{ + struct stbtt__hheap_chunk *head; + void *first_free; + int num_remaining_in_head_chunk; +} stbtt__hheap; + +static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) +{ + if (hh->first_free) { + void *p = hh->first_free; + hh->first_free = * (void **) p; + return p; + } else { + if (hh->num_remaining_in_head_chunk == 0) { + int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); + stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); + if (c == NULL) + return NULL; + c->next = hh->head; + hh->head = c; + hh->num_remaining_in_head_chunk = count; + } + --hh->num_remaining_in_head_chunk; + return (char *) (hh->head) + size * hh->num_remaining_in_head_chunk; + } +} + +static void stbtt__hheap_free(stbtt__hheap *hh, void *p) +{ + *(void **) p = hh->first_free; + hh->first_free = p; +} + +static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) +{ + stbtt__hheap_chunk *c = hh->head; + while (c) { + stbtt__hheap_chunk *n = c->next; + STBTT_free(c, userdata); + c = n; + } +} + +typedef struct stbtt__edge { + float x0,y0, x1,y1; + int invert; +} stbtt__edge; + + +typedef struct stbtt__active_edge +{ + struct stbtt__active_edge *next; + #if STBTT_RASTERIZER_VERSION==1 + int x,dx; + float ey; + int direction; + #elif STBTT_RASTERIZER_VERSION==2 + float fx,fdx,fdy; + float direction; + float sy; + float ey; + #else + #error "Unrecognized value of STBTT_RASTERIZER_VERSION" + #endif +} stbtt__active_edge; + +#if STBTT_RASTERIZER_VERSION == 1 +#define STBTT_FIXSHIFT 10 +#define STBTT_FIX (1 << STBTT_FIXSHIFT) +#define STBTT_FIXMASK (STBTT_FIX-1) + +static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) +{ + stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); + float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + STBTT_assert(z != NULL); + if (!z) return z; + + // round dx down to avoid overshooting + if (dxdy < 0) + z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); + else + z->dx = STBTT_ifloor(STBTT_FIX * dxdy); + + z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount + z->x -= off_x * STBTT_FIX; + + z->ey = e->y1; + z->next = 0; + z->direction = e->invert ? 1 : -1; + return z; +} +#elif STBTT_RASTERIZER_VERSION == 2 +static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) +{ + stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); + float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); + STBTT_assert(z != NULL); + //STBTT_assert(e->y0 <= start_point); + if (!z) return z; + z->fdx = dxdy; + z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; + z->fx = e->x0 + dxdy * (start_point - e->y0); + z->fx -= off_x; + z->direction = e->invert ? 1.0f : -1.0f; + z->sy = e->y0; + z->ey = e->y1; + z->next = 0; + return z; +} +#else +#error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + +#if STBTT_RASTERIZER_VERSION == 1 +// note: this routine clips fills that extend off the edges... ideally this +// wouldn't happen, but it could happen if the truetype glyph bounding boxes +// are wrong, or if the user supplies a too-small bitmap +static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) +{ + // non-zero winding fill + int x0=0, w=0; + + while (e) { + if (w == 0) { + // if we're currently at zero, we need to record the edge start point + x0 = e->x; w += e->direction; + } else { + int x1 = e->x; w += e->direction; + // if we went to zero, we need to draw + if (w == 0) { + int i = x0 >> STBTT_FIXSHIFT; + int j = x1 >> STBTT_FIXSHIFT; + + if (i < len && j >= 0) { + if (i == j) { + // x0,x1 are the same pixel, so compute combined coverage + scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); + } else { + if (i >= 0) // add antialiasing for x0 + scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); + else + i = -1; // clip + + if (j < len) // add antialiasing for x1 + scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); + else + j = len; // clip + + for (++i; i < j; ++i) // fill pixels between x0 and x1 + scanline[i] = scanline[i] + (stbtt_uint8) max_weight; + } + } + } + } + + e = e->next; + } +} + +static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) +{ + stbtt__hheap hh = { 0, 0, 0 }; + stbtt__active_edge *active = NULL; + int y,j=0; + int max_weight = (255 / vsubsample); // weight per vertical scanline + int s; // vertical subsample index + unsigned char scanline_data[512], *scanline; + + if (result->w > 512) + scanline = (unsigned char *) STBTT_malloc(result->w, userdata); + else + scanline = scanline_data; + + y = off_y * vsubsample; + e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; + + while (j < result->h) { + STBTT_memset(scanline, 0, result->w); + for (s=0; s < vsubsample; ++s) { + // find center of pixel for this scanline + float scan_y = y + 0.5f; + stbtt__active_edge **step = &active; + + // update all active edges; + // remove all active edges that terminate before the center of this scanline + while (*step) { + stbtt__active_edge * z = *step; + if (z->ey <= scan_y) { + *step = z->next; // delete from list + STBTT_assert(z->direction); + z->direction = 0; + stbtt__hheap_free(&hh, z); + } else { + z->x += z->dx; // advance to position for current scanline + step = &((*step)->next); // advance through list + } + } + + // resort the list if needed + for(;;) { + int changed=0; + step = &active; + while (*step && (*step)->next) { + if ((*step)->x > (*step)->next->x) { + stbtt__active_edge *t = *step; + stbtt__active_edge *q = t->next; + + t->next = q->next; + q->next = t; + *step = q; + changed = 1; + } + step = &(*step)->next; + } + if (!changed) break; + } + + // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline + while (e->y0 <= scan_y) { + if (e->y1 > scan_y) { + stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); + if (z != NULL) { + // find insertion point + if (active == NULL) + active = z; + else if (z->x < active->x) { + // insert at front + z->next = active; + active = z; + } else { + // find thing to insert AFTER + stbtt__active_edge *p = active; + while (p->next && p->next->x < z->x) + p = p->next; + // at this point, p->next->x is NOT < z->x + z->next = p->next; + p->next = z; + } + } + } + ++e; + } + + // now process all active edges in XOR fashion + if (active) + stbtt__fill_active_edges(scanline, result->w, active, max_weight); + + ++y; + } + STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); + ++j; + } + + stbtt__hheap_cleanup(&hh, userdata); + + if (scanline != scanline_data) + STBTT_free(scanline, userdata); +} + +#elif STBTT_RASTERIZER_VERSION == 2 + +// the edge passed in here does not cross the vertical line at x or the vertical line at x+1 +// (i.e. it has already been clipped to those) +static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) +{ + if (y0 == y1) return; + STBTT_assert(y0 < y1); + STBTT_assert(e->sy <= e->ey); + if (y0 > e->ey) return; + if (y1 < e->sy) return; + if (y0 < e->sy) { + x0 += (x1-x0) * (e->sy - y0) / (y1-y0); + y0 = e->sy; + } + if (y1 > e->ey) { + x1 += (x1-x0) * (e->ey - y1) / (y1-y0); + y1 = e->ey; + } + + if (x0 == x) + STBTT_assert(x1 <= x+1); + else if (x0 == x+1) + STBTT_assert(x1 >= x); + else if (x0 <= x) + STBTT_assert(x1 <= x); + else if (x0 >= x+1) + STBTT_assert(x1 >= x+1); + else + STBTT_assert(x1 >= x && x1 <= x+1); + + if (x0 <= x && x1 <= x) + scanline[x] += e->direction * (y1-y0); + else if (x0 >= x+1 && x1 >= x+1) + ; + else { + STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); + scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position + } +} + +static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) +{ + float y_bottom = y_top+1; + + while (e) { + // brute force every pixel + + // compute intersection points with top & bottom + STBTT_assert(e->ey >= y_top); + + if (e->fdx == 0) { + float x0 = e->fx; + if (x0 < len) { + if (x0 >= 0) { + stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); + stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); + } else { + stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); + } + } + } else { + float x0 = e->fx; + float dx = e->fdx; + float xb = x0 + dx; + float x_top, x_bottom; + float sy0,sy1; + float dy = e->fdy; + STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); + + // compute endpoints of line segment clipped to this scanline (if the + // line segment starts on this scanline. x0 is the intersection of the + // line with y_top, but that may be off the line segment. + if (e->sy > y_top) { + x_top = x0 + dx * (e->sy - y_top); + sy0 = e->sy; + } else { + x_top = x0; + sy0 = y_top; + } + if (e->ey < y_bottom) { + x_bottom = x0 + dx * (e->ey - y_top); + sy1 = e->ey; + } else { + x_bottom = xb; + sy1 = y_bottom; + } + + if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { + // from here on, we don't have to range check x values + + if ((int) x_top == (int) x_bottom) { + float height; + // simple case, only spans one pixel + int x = (int) x_top; + height = sy1 - sy0; + STBTT_assert(x >= 0 && x < len); + scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; + scanline_fill[x] += e->direction * height; // everything right of this pixel is filled + } else { + int x,x1,x2; + float y_crossing, step, sign, area; + // covers 2+ pixels + if (x_top > x_bottom) { + // flip scanline vertically; signed area is the same + float t; + sy0 = y_bottom - (sy0 - y_top); + sy1 = y_bottom - (sy1 - y_top); + t = sy0, sy0 = sy1, sy1 = t; + t = x_bottom, x_bottom = x_top, x_top = t; + dx = -dx; + dy = -dy; + t = x0, x0 = xb, xb = t; + } + + x1 = (int) x_top; + x2 = (int) x_bottom; + // compute intersection with y axis at x1+1 + y_crossing = (x1+1 - x0) * dy + y_top; + + sign = e->direction; + // area of the rectangle covered from y0..y_crossing + area = sign * (y_crossing-sy0); + // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) + scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); + + step = sign * dy; + for (x = x1+1; x < x2; ++x) { + scanline[x] += area + step/2; + area += step; + } + y_crossing += dy * (x2 - (x1+1)); + + STBTT_assert(STBTT_fabs(area) <= 1.01f); + + scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); + + scanline_fill[x2] += sign * (sy1-sy0); + } + } else { + // if edge goes outside of box we're drawing, we require + // clipping logic. since this does not match the intended use + // of this library, we use a different, very slow brute + // force implementation + int x; + for (x=0; x < len; ++x) { + // cases: + // + // there can be up to two intersections with the pixel. any intersection + // with left or right edges can be handled by splitting into two (or three) + // regions. intersections with top & bottom do not necessitate case-wise logic. + // + // the old way of doing this found the intersections with the left & right edges, + // then used some simple logic to produce up to three segments in sorted order + // from top-to-bottom. however, this had a problem: if an x edge was epsilon + // across the x border, then the corresponding y position might not be distinct + // from the other y segment, and it might ignored as an empty segment. to avoid + // that, we need to explicitly produce segments based on x positions. + + // rename variables to clear pairs + float y0 = y_top; + float x1 = (float) (x); + float x2 = (float) (x+1); + float x3 = xb; + float y3 = y_bottom; + float y1,y2; + + // x = e->x + e->dx * (y-y_top) + // (y-y_top) = (x - e->x) / e->dx + // y = (x - e->x) / e->dx + y_top + y1 = (x - x0) / dx + y_top; + y2 = (x+1 - x0) / dx + y_top; + + if (x0 < x1 && x3 > x2) { // three segments descending down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else if (x3 < x1 && x0 > x2) { // three segments descending down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); + stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); + } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); + stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); + } else { // one segment + stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); + } + } + } + } + e = e->next; + } +} + +// directly AA rasterize edges w/o supersampling +static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) +{ + stbtt__hheap hh = { 0, 0, 0 }; + stbtt__active_edge *active = NULL; + int y,j=0, i; + float scanline_data[129], *scanline, *scanline2; + + STBTT__NOTUSED(vsubsample); + + if (result->w > 64) + scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); + else + scanline = scanline_data; + + scanline2 = scanline + result->w; + + y = off_y; + e[n].y0 = (float) (off_y + result->h) + 1; + + while (j < result->h) { + // find center of pixel for this scanline + float scan_y_top = y + 0.0f; + float scan_y_bottom = y + 1.0f; + stbtt__active_edge **step = &active; + + STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); + STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); + + // update all active edges; + // remove all active edges that terminate before the top of this scanline + while (*step) { + stbtt__active_edge * z = *step; + if (z->ey <= scan_y_top) { + *step = z->next; // delete from list + STBTT_assert(z->direction); + z->direction = 0; + stbtt__hheap_free(&hh, z); + } else { + step = &((*step)->next); // advance through list + } + } + + // insert all edges that start before the bottom of this scanline + while (e->y0 <= scan_y_bottom) { + if (e->y0 != e->y1) { + stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); + if (z != NULL) { + STBTT_assert(z->ey >= scan_y_top); + // insert at front + z->next = active; + active = z; + } + } + ++e; + } + + // now process all active edges + if (active) + stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); + + { + float sum = 0; + for (i=0; i < result->w; ++i) { + float k; + int m; + sum += scanline2[i]; + k = scanline[i] + sum; + k = (float) STBTT_fabs(k)*255 + 0.5f; + m = (int) k; + if (m > 255) m = 255; + result->pixels[j*result->stride + i] = (unsigned char) m; + } + } + // advance all the edges + step = &active; + while (*step) { + stbtt__active_edge *z = *step; + z->fx += z->fdx; // advance to position for current scanline + step = &((*step)->next); // advance through list + } + + ++y; + ++j; + } + + stbtt__hheap_cleanup(&hh, userdata); + + if (scanline != scanline_data) + STBTT_free(scanline, userdata); +} +#else +#error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + +#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) + +static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) +{ + int i,j; + for (i=1; i < n; ++i) { + stbtt__edge t = p[i], *a = &t; + j = i; + while (j > 0) { + stbtt__edge *b = &p[j-1]; + int c = STBTT__COMPARE(a,b); + if (!c) break; + p[j] = p[j-1]; + --j; + } + if (i != j) + p[j] = t; + } +} + +static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) +{ + /* threshhold for transitioning to insertion sort */ + while (n > 12) { + stbtt__edge t; + int c01,c12,c,m,i,j; + + /* compute median of three */ + m = n >> 1; + c01 = STBTT__COMPARE(&p[0],&p[m]); + c12 = STBTT__COMPARE(&p[m],&p[n-1]); + /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ + if (c01 != c12) { + /* otherwise, we'll need to swap something else to middle */ + int z; + c = STBTT__COMPARE(&p[0],&p[n-1]); + /* 0>mid && midn => n; 0 0 */ + /* 0n: 0>n => 0; 0 n */ + z = (c == c12) ? 0 : n-1; + t = p[z]; + p[z] = p[m]; + p[m] = t; + } + /* now p[m] is the median-of-three */ + /* swap it to the beginning so it won't move around */ + t = p[0]; + p[0] = p[m]; + p[m] = t; + + /* partition loop */ + i=1; + j=n-1; + for(;;) { + /* handling of equality is crucial here */ + /* for sentinels & efficiency with duplicates */ + for (;;++i) { + if (!STBTT__COMPARE(&p[i], &p[0])) break; + } + for (;;--j) { + if (!STBTT__COMPARE(&p[0], &p[j])) break; + } + /* make sure we haven't crossed */ + if (i >= j) break; + t = p[i]; + p[i] = p[j]; + p[j] = t; + + ++i; + --j; + } + /* recurse on smaller side, iterate on larger */ + if (j < (n-i)) { + stbtt__sort_edges_quicksort(p,j); + p = p+i; + n = n-i; + } else { + stbtt__sort_edges_quicksort(p+i, n-i); + n = j; + } + } +} + +static void stbtt__sort_edges(stbtt__edge *p, int n) +{ + stbtt__sort_edges_quicksort(p, n); + stbtt__sort_edges_ins_sort(p, n); +} + +typedef struct +{ + float x,y; +} stbtt__point; + +static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) +{ + float y_scale_inv = invert ? -scale_y : scale_y; + stbtt__edge *e; + int n,i,j,k,m; +#if STBTT_RASTERIZER_VERSION == 1 + int vsubsample = result->h < 8 ? 15 : 5; +#elif STBTT_RASTERIZER_VERSION == 2 + int vsubsample = 1; +#else + #error "Unrecognized value of STBTT_RASTERIZER_VERSION" +#endif + // vsubsample should divide 255 evenly; otherwise we won't reach full opacity + + // now we have to blow out the windings into explicit edge lists + n = 0; + for (i=0; i < windings; ++i) + n += wcount[i]; + + e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel + if (e == 0) return; + n = 0; + + m=0; + for (i=0; i < windings; ++i) { + stbtt__point *p = pts + m; + m += wcount[i]; + j = wcount[i]-1; + for (k=0; k < wcount[i]; j=k++) { + int a=k,b=j; + // skip the edge if horizontal + if (p[j].y == p[k].y) + continue; + // add edge from j to k to the list + e[n].invert = 0; + if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { + e[n].invert = 1; + a=j,b=k; + } + e[n].x0 = p[a].x * scale_x + shift_x; + e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; + e[n].x1 = p[b].x * scale_x + shift_x; + e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; + ++n; + } + } + + // now sort the edges by their highest point (should snap to integer, and then by x) + //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); + stbtt__sort_edges(e, n); + + // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule + stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); + + STBTT_free(e, userdata); +} + +static void stbtt__add_point(stbtt__point *points, int n, float x, float y) +{ + if (!points) return; // during first pass, it's unallocated + points[n].x = x; + points[n].y = y; +} + +// tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching +static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) +{ + // midpoint + float mx = (x0 + 2*x1 + x2)/4; + float my = (y0 + 2*y1 + y2)/4; + // versus directly drawn line + float dx = (x0+x2)/2 - mx; + float dy = (y0+y2)/2 - my; + if (n > 16) // 65536 segments on one curve better be enough! + return 1; + if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA + stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); + stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); + } else { + stbtt__add_point(points, *num_points,x2,y2); + *num_points = *num_points+1; + } + return 1; +} + +// returns number of contours +static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) +{ + stbtt__point *points=0; + int num_points=0; + + float objspace_flatness_squared = objspace_flatness * objspace_flatness; + int i,n=0,start=0, pass; + + // count how many "moves" there are to get the contour count + for (i=0; i < num_verts; ++i) + if (vertices[i].type == STBTT_vmove) + ++n; + + *num_contours = n; + if (n == 0) return 0; + + *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); + + if (*contour_lengths == 0) { + *num_contours = 0; + return 0; + } + + // make two passes through the points so we don't need to realloc + for (pass=0; pass < 2; ++pass) { + float x=0,y=0; + if (pass == 1) { + points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); + if (points == NULL) goto error; + } + num_points = 0; + n= -1; + for (i=0; i < num_verts; ++i) { + switch (vertices[i].type) { + case STBTT_vmove: + // start the next contour + if (n >= 0) + (*contour_lengths)[n] = num_points - start; + ++n; + start = num_points; + + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x,y); + break; + case STBTT_vline: + x = vertices[i].x, y = vertices[i].y; + stbtt__add_point(points, num_points++, x, y); + break; + case STBTT_vcurve: + stbtt__tesselate_curve(points, &num_points, x,y, + vertices[i].cx, vertices[i].cy, + vertices[i].x, vertices[i].y, + objspace_flatness_squared, 0); + x = vertices[i].x, y = vertices[i].y; + break; + } + } + (*contour_lengths)[n] = num_points - start; + } + + return points; +error: + STBTT_free(points, userdata); + STBTT_free(*contour_lengths, userdata); + *contour_lengths = 0; + *num_contours = 0; + return NULL; +} + +STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) +{ + float scale = scale_x > scale_y ? scale_y : scale_x; + int winding_count, *winding_lengths; + stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); + if (windings) { + stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); + STBTT_free(winding_lengths, userdata); + STBTT_free(windings, userdata); + } +} + +STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) +{ + STBTT_free(bitmap, userdata); +} + +STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) +{ + int ix0,iy0,ix1,iy1; + stbtt__bitmap gbm; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + + if (scale_x == 0) scale_x = scale_y; + if (scale_y == 0) { + if (scale_x == 0) { + STBTT_free(vertices, info->userdata); + return NULL; + } + scale_y = scale_x; + } + + stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); + + // now we get the size + gbm.w = (ix1 - ix0); + gbm.h = (iy1 - iy0); + gbm.pixels = NULL; // in case we error + + if (width ) *width = gbm.w; + if (height) *height = gbm.h; + if (xoff ) *xoff = ix0; + if (yoff ) *yoff = iy0; + + if (gbm.w && gbm.h) { + gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); + if (gbm.pixels) { + gbm.stride = gbm.w; + + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); + } + } + STBTT_free(vertices, info->userdata); + return gbm.pixels; +} + +STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); +} + +STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) +{ + int ix0,iy0; + stbtt_vertex *vertices; + int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); + stbtt__bitmap gbm; + + stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); + gbm.pixels = output; + gbm.w = out_w; + gbm.h = out_h; + gbm.stride = out_stride; + + if (gbm.w && gbm.h) + stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); + + STBTT_free(vertices, info->userdata); +} + +STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) +{ + stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); +} + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); +} + +STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) +{ + stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); +} + +STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) +{ + return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); +} + +STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) +{ + stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); +} + +////////////////////////////////////////////////////////////////////////////// +// +// bitmap baking +// +// This is SUPER-CRAPPY packing to keep source code small + +STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) + float pixel_height, // height of font in pixels + unsigned char *pixels, int pw, int ph, // bitmap to be filled in + int first_char, int num_chars, // characters to bake + stbtt_bakedchar *chardata) +{ + float scale; + int x,y,bottom_y, i; + stbtt_fontinfo f; + f.userdata = NULL; + if (!stbtt_InitFont(&f, data, offset)) + return -1; + STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels + x=y=1; + bottom_y = 1; + + scale = stbtt_ScaleForPixelHeight(&f, pixel_height); + + for (i=0; i < num_chars; ++i) { + int advance, lsb, x0,y0,x1,y1,gw,gh; + int g = stbtt_FindGlyphIndex(&f, first_char + i); + stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); + stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); + gw = x1-x0; + gh = y1-y0; + if (x + gw + 1 >= pw) + y = bottom_y, x = 1; // advance to next row + if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row + return -i; + STBTT_assert(x+gw < pw); + STBTT_assert(y+gh < ph); + stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); + chardata[i].x0 = (stbtt_int16) x; + chardata[i].y0 = (stbtt_int16) y; + chardata[i].x1 = (stbtt_int16) (x + gw); + chardata[i].y1 = (stbtt_int16) (y + gh); + chardata[i].xadvance = scale * advance; + chardata[i].xoff = (float) x0; + chardata[i].yoff = (float) y0; + x = x + gw + 1; + if (y+gh+1 > bottom_y) + bottom_y = y+gh+1; + } + return bottom_y; +} + +STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) +{ + float d3d_bias = opengl_fillrule ? 0 : -0.5f; + float ipw = 1.0f / pw, iph = 1.0f / ph; + stbtt_bakedchar *b = chardata + char_index; + int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); + int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); + + q->x0 = round_x + d3d_bias; + q->y0 = round_y + d3d_bias; + q->x1 = round_x + b->x1 - b->x0 + d3d_bias; + q->y1 = round_y + b->y1 - b->y0 + d3d_bias; + + q->s0 = b->x0 * ipw; + q->t0 = b->y0 * iph; + q->s1 = b->x1 * ipw; + q->t1 = b->y1 * iph; + + *xpos += b->xadvance; +} + +////////////////////////////////////////////////////////////////////////////// +// +// rectangle packing replacement routines if you don't have stb_rect_pack.h +// + +#ifndef STB_RECT_PACK_VERSION + +typedef int stbrp_coord; + +//////////////////////////////////////////////////////////////////////////////////// +// // +// // +// COMPILER WARNING ?!?!? // +// // +// // +// if you get a compile warning due to these symbols being defined more than // +// once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // +// // +//////////////////////////////////////////////////////////////////////////////////// + +typedef struct +{ + int width,height; + int x,y,bottom_y; +} stbrp_context; + +typedef struct +{ + unsigned char x; +} stbrp_node; + +struct stbrp_rect +{ + stbrp_coord x,y; + int id,w,h,was_packed; +}; + +static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) +{ + con->width = pw; + con->height = ph; + con->x = 0; + con->y = 0; + con->bottom_y = 0; + STBTT__NOTUSED(nodes); + STBTT__NOTUSED(num_nodes); +} + +static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) +{ + int i; + for (i=0; i < num_rects; ++i) { + if (con->x + rects[i].w > con->width) { + con->x = 0; + con->y = con->bottom_y; + } + if (con->y + rects[i].h > con->height) + break; + rects[i].x = con->x; + rects[i].y = con->y; + rects[i].was_packed = 1; + con->x += rects[i].w; + if (con->y + rects[i].h > con->bottom_y) + con->bottom_y = con->y + rects[i].h; + } + for ( ; i < num_rects; ++i) + rects[i].was_packed = 0; +} +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// bitmap baking +// +// This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If +// stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. + +STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) +{ + stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); + int num_nodes = pw - padding; + stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); + + if (context == NULL || nodes == NULL) { + if (context != NULL) STBTT_free(context, alloc_context); + if (nodes != NULL) STBTT_free(nodes , alloc_context); + return 0; + } + + spc->user_allocator_context = alloc_context; + spc->width = pw; + spc->height = ph; + spc->pixels = pixels; + spc->pack_info = context; + spc->nodes = nodes; + spc->padding = padding; + spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; + spc->h_oversample = 1; + spc->v_oversample = 1; + + stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); + + if (pixels) + STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels + + return 1; +} + +STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) +{ + STBTT_free(spc->nodes , spc->user_allocator_context); + STBTT_free(spc->pack_info, spc->user_allocator_context); +} + +STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) +{ + STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); + STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); + if (h_oversample <= STBTT_MAX_OVERSAMPLE) + spc->h_oversample = h_oversample; + if (v_oversample <= STBTT_MAX_OVERSAMPLE) + spc->v_oversample = v_oversample; +} + +#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) + +static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) +{ + unsigned char buffer[STBTT_MAX_OVERSAMPLE]; + int safe_w = w - kernel_width; + int j; + STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze + for (j=0; j < h; ++j) { + int i; + unsigned int total; + STBTT_memset(buffer, 0, kernel_width); + + total = 0; + + // make kernel_width a constant in common cases so compiler can optimize out the divide + switch (kernel_width) { + case 2: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 2); + } + break; + case 3: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 3); + } + break; + case 4: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 4); + } + break; + case 5: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / 5); + } + break; + default: + for (i=0; i <= safe_w; ++i) { + total += pixels[i] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; + pixels[i] = (unsigned char) (total / kernel_width); + } + break; + } + + for (; i < w; ++i) { + STBTT_assert(pixels[i] == 0); + total -= buffer[i & STBTT__OVER_MASK]; + pixels[i] = (unsigned char) (total / kernel_width); + } + + pixels += stride_in_bytes; + } +} + +static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) +{ + unsigned char buffer[STBTT_MAX_OVERSAMPLE]; + int safe_h = h - kernel_width; + int j; + STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze + for (j=0; j < w; ++j) { + int i; + unsigned int total; + STBTT_memset(buffer, 0, kernel_width); + + total = 0; + + // make kernel_width a constant in common cases so compiler can optimize out the divide + switch (kernel_width) { + case 2: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 2); + } + break; + case 3: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 3); + } + break; + case 4: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 4); + } + break; + case 5: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / 5); + } + break; + default: + for (i=0; i <= safe_h; ++i) { + total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; + buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; + pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); + } + break; + } + + for (; i < h; ++i) { + STBTT_assert(pixels[i*stride_in_bytes] == 0); + total -= buffer[i & STBTT__OVER_MASK]; + pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); + } + + pixels += 1; + } +} + +static float stbtt__oversample_shift(int oversample) +{ + if (!oversample) + return 0.0f; + + // The prefilter is a box filter of width "oversample", + // which shifts phase by (oversample - 1)/2 pixels in + // oversampled space. We want to shift in the opposite + // direction to counter this. + return (float)-(oversample - 1) / (2.0f * (float)oversample); +} + +// rects array must be big enough to accommodate all characters in the given ranges +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +{ + int i,j,k; + + k=0; + for (i=0; i < num_ranges; ++i) { + float fh = ranges[i].font_size; + float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); + ranges[i].h_oversample = (unsigned char) spc->h_oversample; + ranges[i].v_oversample = (unsigned char) spc->v_oversample; + for (j=0; j < ranges[i].num_chars; ++j) { + int x0,y0,x1,y1; + int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; + int glyph = stbtt_FindGlyphIndex(info, codepoint); + stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, + scale * spc->h_oversample, + scale * spc->v_oversample, + 0,0, + &x0,&y0,&x1,&y1); + rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); + rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); + ++k; + } + } + + return k; +} + +// rects array must be big enough to accommodate all characters in the given ranges +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +{ + int i,j,k, return_value = 1; + + // save current values + int old_h_over = spc->h_oversample; + int old_v_over = spc->v_oversample; + + k = 0; + for (i=0; i < num_ranges; ++i) { + float fh = ranges[i].font_size; + float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); + float recip_h,recip_v,sub_x,sub_y; + spc->h_oversample = ranges[i].h_oversample; + spc->v_oversample = ranges[i].v_oversample; + recip_h = 1.0f / spc->h_oversample; + recip_v = 1.0f / spc->v_oversample; + sub_x = stbtt__oversample_shift(spc->h_oversample); + sub_y = stbtt__oversample_shift(spc->v_oversample); + for (j=0; j < ranges[i].num_chars; ++j) { + stbrp_rect *r = &rects[k]; + if (r->was_packed) { + stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; + int advance, lsb, x0,y0,x1,y1; + int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; + int glyph = stbtt_FindGlyphIndex(info, codepoint); + stbrp_coord pad = (stbrp_coord) spc->padding; + + // pad on left and top + r->x += pad; + r->y += pad; + r->w -= pad; + r->h -= pad; + stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); + stbtt_GetGlyphBitmapBox(info, glyph, + scale * spc->h_oversample, + scale * spc->v_oversample, + &x0,&y0,&x1,&y1); + stbtt_MakeGlyphBitmapSubpixel(info, + spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w - spc->h_oversample+1, + r->h - spc->v_oversample+1, + spc->stride_in_bytes, + scale * spc->h_oversample, + scale * spc->v_oversample, + 0,0, + glyph); + + if (spc->h_oversample > 1) + stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w, r->h, spc->stride_in_bytes, + spc->h_oversample); + + if (spc->v_oversample > 1) + stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, + r->w, r->h, spc->stride_in_bytes, + spc->v_oversample); + + bc->x0 = (stbtt_int16) r->x; + bc->y0 = (stbtt_int16) r->y; + bc->x1 = (stbtt_int16) (r->x + r->w); + bc->y1 = (stbtt_int16) (r->y + r->h); + bc->xadvance = scale * advance; + bc->xoff = (float) x0 * recip_h + sub_x; + bc->yoff = (float) y0 * recip_v + sub_y; + bc->xoff2 = (x0 + r->w) * recip_h + sub_x; + bc->yoff2 = (y0 + r->h) * recip_v + sub_y; + } else { + return_value = 0; // if any fail, report failure + } + + ++k; + } + } + + // restore original values + spc->h_oversample = old_h_over; + spc->v_oversample = old_v_over; + + return return_value; +} + +STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) +{ + stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); +} + +STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) +{ + stbtt_fontinfo info; + int i,j,n, return_value = 1; + //stbrp_context *context = (stbrp_context *) spc->pack_info; + stbrp_rect *rects; + + // flag all characters as NOT packed + for (i=0; i < num_ranges; ++i) + for (j=0; j < ranges[i].num_chars; ++j) + ranges[i].chardata_for_range[j].x0 = + ranges[i].chardata_for_range[j].y0 = + ranges[i].chardata_for_range[j].x1 = + ranges[i].chardata_for_range[j].y1 = 0; + + n = 0; + for (i=0; i < num_ranges; ++i) + n += ranges[i].num_chars; + + rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); + if (rects == NULL) + return 0; + + info.userdata = spc->user_allocator_context; + stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); + + n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); + + stbtt_PackFontRangesPackRects(spc, rects, n); + + return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); + + STBTT_free(rects, spc->user_allocator_context); + return return_value; +} + +STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, float font_size, + int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) +{ + stbtt_pack_range range; + range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; + range.array_of_unicode_codepoints = NULL; + range.num_chars = num_chars_in_range; + range.chardata_for_range = chardata_for_range; + range.font_size = font_size; + return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); +} + +STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) +{ + float ipw = 1.0f / pw, iph = 1.0f / ph; + stbtt_packedchar *b = chardata + char_index; + + if (align_to_integer) { + float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); + float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); + q->x0 = x; + q->y0 = y; + q->x1 = x + b->xoff2 - b->xoff; + q->y1 = y + b->yoff2 - b->yoff; + } else { + q->x0 = *xpos + b->xoff; + q->y0 = *ypos + b->yoff; + q->x1 = *xpos + b->xoff2; + q->y1 = *ypos + b->yoff2; + } + + q->s0 = b->x0 * ipw; + q->t0 = b->y0 * iph; + q->s1 = b->x1 * ipw; + q->t1 = b->y1 * iph; + + *xpos += b->xadvance; +} + + +////////////////////////////////////////////////////////////////////////////// +// +// font name matching -- recommended not to use this +// + +// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) +{ + stbtt_int32 i=0; + + // convert utf16 to utf8 and compare the results while converting + while (len2) { + stbtt_uint16 ch = s2[0]*256 + s2[1]; + if (ch < 0x80) { + if (i >= len1) return -1; + if (s1[i++] != ch) return -1; + } else if (ch < 0x800) { + if (i+1 >= len1) return -1; + if (s1[i++] != 0xc0 + (ch >> 6)) return -1; + if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; + } else if (ch >= 0xd800 && ch < 0xdc00) { + stbtt_uint32 c; + stbtt_uint16 ch2 = s2[2]*256 + s2[3]; + if (i+3 >= len1) return -1; + c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; + if (s1[i++] != 0xf0 + (c >> 18)) return -1; + if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; + s2 += 2; // plus another 2 below + len2 -= 2; + } else if (ch >= 0xdc00 && ch < 0xe000) { + return -1; + } else { + if (i+2 >= len1) return -1; + if (s1[i++] != 0xe0 + (ch >> 12)) return -1; + if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; + if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; + } + s2 += 2; + len2 -= 2; + } + return i; +} + +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +{ + return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((const stbtt_uint8*) s1, len1, (const stbtt_uint8*) s2, len2); +} + +// returns results in whatever encoding you request... but note that 2-byte encodings +// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare +STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) +{ + stbtt_int32 i,count,stringOffset; + stbtt_uint8 *fc = font->data; + stbtt_uint32 offset = font->fontstart; + stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return NULL; + + count = ttUSHORT(fc+nm+2); + stringOffset = nm + ttUSHORT(fc+nm+4); + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) + && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { + *length = ttUSHORT(fc+loc+8); + return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); + } + } + return NULL; +} + +static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) +{ + stbtt_int32 i; + stbtt_int32 count = ttUSHORT(fc+nm+2); + stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); + + for (i=0; i < count; ++i) { + stbtt_uint32 loc = nm + 6 + 12 * i; + stbtt_int32 id = ttUSHORT(fc+loc+6); + if (id == target_id) { + // find the encoding + stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); + + // is this a Unicode encoding? + if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { + stbtt_int32 slen = ttUSHORT(fc+loc+8); + stbtt_int32 off = ttUSHORT(fc+loc+10); + + // check if there's a prefix match + stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); + if (matchlen >= 0) { + // check for target_id+1 immediately following, with same encoding & language + if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { + slen = ttUSHORT(fc+loc+12+8); + off = ttUSHORT(fc+loc+12+10); + if (slen == 0) { + if (matchlen == nlen) + return 1; + } else if (matchlen < nlen && name[matchlen] == ' ') { + ++matchlen; + if (stbtt_CompareUTF8toUTF16_bigendian((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) + return 1; + } + } else { + // if nothing immediately following + if (matchlen == nlen) + return 1; + } + } + } + + // @TODO handle other encodings + } + } + return 0; +} + +static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) +{ + stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); + stbtt_uint32 nm,hd; + if (!stbtt__isfont(fc+offset)) return 0; + + // check italics/bold/underline flags in macStyle... + if (flags) { + hd = stbtt__find_table(fc, offset, "head"); + if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; + } + + nm = stbtt__find_table(fc, offset, "name"); + if (!nm) return 0; + + if (flags) { + // if we checked the macStyle flags, then just check the family and ignore the subfamily + if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } else { + if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; + if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; + } + + return 0; +} + +STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const char *name_utf8, stbtt_int32 flags) +{ + stbtt_int32 i; + for (i=0;;++i) { + stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); + if (off < 0) return off; + if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) + return off; + } +} + +#endif // STB_TRUETYPE_IMPLEMENTATION + + +// FULL VERSION HISTORY +// +// 1.11 (2016-04-02) fix unused-variable warning +// 1.10 (2016-04-02) allow user-defined fabs() replacement +// fix memory leak if fontsize=0.0 +// fix warning from duplicate typedef +// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges +// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges +// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; +// allow PackFontRanges to pack and render in separate phases; +// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); +// fixed an assert() bug in the new rasterizer +// replace assert() with STBTT_assert() in new rasterizer +// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) +// also more precise AA rasterizer, except if shapes overlap +// remove need for STBTT_sort +// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC +// 1.04 (2015-04-15) typo in example +// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes +// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ +// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match +// non-oversampled; STBTT_POINT_SIZE for packed case only +// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling +// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) +// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID +// 0.8b (2014-07-07) fix a warning +// 0.8 (2014-05-25) fix a few more warnings +// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back +// 0.6c (2012-07-24) improve documentation +// 0.6b (2012-07-20) fix a few more warnings +// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, +// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty +// 0.5 (2011-12-09) bugfixes: +// subpixel glyph renderer computed wrong bounding box +// first vertex of shape can be off-curve (FreeSans) +// 0.4b (2011-12-03) fixed an error in the font baking example +// 0.4 (2011-12-01) kerning, subpixel rendering (tor) +// bugfixes for: +// codepoint-to-glyph conversion using table fmt=12 +// codepoint-to-glyph conversion using table fmt=4 +// stbtt_GetBakedQuad with non-square texture (Zer) +// updated Hello World! sample to use kerning and subpixel +// fixed some warnings +// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) +// userdata, malloc-from-userdata, non-zero fill (stb) +// 0.2 (2009-03-11) Fix unsigned/signed char warnings +// 0.1 (2009-03-09) First public release +// diff --git a/src/external/stb_vorbis.c b/src/external/stb_vorbis.c new file mode 100644 index 00000000..07d79318 --- /dev/null +++ b/src/external/stb_vorbis.c @@ -0,0 +1,5010 @@ +#include "stb_vorbis.h" + +#ifndef STB_VORBIS_HEADER_ONLY + +// global configuration settings (e.g. set these in the project/makefile), +// or just set them in this file at the top (although ideally the first few +// should be visible when the header file is compiled too, although it's not +// crucial) + +// STB_VORBIS_NO_PUSHDATA_API +// does not compile the code for the various stb_vorbis_*_pushdata() +// functions +// #define STB_VORBIS_NO_PUSHDATA_API + +// STB_VORBIS_NO_PULLDATA_API +// does not compile the code for the non-pushdata APIs +// #define STB_VORBIS_NO_PULLDATA_API + +// STB_VORBIS_NO_STDIO +// does not compile the code for the APIs that use FILE *s internally +// or externally (implied by STB_VORBIS_NO_PULLDATA_API) +// #define STB_VORBIS_NO_STDIO + +// STB_VORBIS_NO_INTEGER_CONVERSION +// does not compile the code for converting audio sample data from +// float to integer (implied by STB_VORBIS_NO_PULLDATA_API) +// #define STB_VORBIS_NO_INTEGER_CONVERSION + +// STB_VORBIS_NO_FAST_SCALED_FLOAT +// does not use a fast float-to-int trick to accelerate float-to-int on +// most platforms which requires endianness be defined correctly. +//#define STB_VORBIS_NO_FAST_SCALED_FLOAT + + +// STB_VORBIS_MAX_CHANNELS [number] +// globally define this to the maximum number of channels you need. +// The spec does not put a restriction on channels except that +// the count is stored in a byte, so 255 is the hard limit. +// Reducing this saves about 16 bytes per value, so using 16 saves +// (255-16)*16 or around 4KB. Plus anything other memory usage +// I forgot to account for. Can probably go as low as 8 (7.1 audio), +// 6 (5.1 audio), or 2 (stereo only). +#ifndef STB_VORBIS_MAX_CHANNELS +#define STB_VORBIS_MAX_CHANNELS 16 // enough for anyone? +#endif + +// STB_VORBIS_PUSHDATA_CRC_COUNT [number] +// after a flush_pushdata(), stb_vorbis begins scanning for the +// next valid page, without backtracking. when it finds something +// that looks like a page, it streams through it and verifies its +// CRC32. Should that validation fail, it keeps scanning. But it's +// possible that _while_ streaming through to check the CRC32 of +// one candidate page, it sees another candidate page. This #define +// determines how many "overlapping" candidate pages it can search +// at once. Note that "real" pages are typically ~4KB to ~8KB, whereas +// garbage pages could be as big as 64KB, but probably average ~16KB. +// So don't hose ourselves by scanning an apparent 64KB page and +// missing a ton of real ones in the interim; so minimum of 2 +#ifndef STB_VORBIS_PUSHDATA_CRC_COUNT +#define STB_VORBIS_PUSHDATA_CRC_COUNT 4 +#endif + +// STB_VORBIS_FAST_HUFFMAN_LENGTH [number] +// sets the log size of the huffman-acceleration table. Maximum +// supported value is 24. with larger numbers, more decodings are O(1), +// but the table size is larger so worse cache missing, so you'll have +// to probe (and try multiple ogg vorbis files) to find the sweet spot. +#ifndef STB_VORBIS_FAST_HUFFMAN_LENGTH +#define STB_VORBIS_FAST_HUFFMAN_LENGTH 10 +#endif + +// STB_VORBIS_FAST_BINARY_LENGTH [number] +// sets the log size of the binary-search acceleration table. this +// is used in similar fashion to the fast-huffman size to set initial +// parameters for the binary search + +// STB_VORBIS_FAST_HUFFMAN_INT +// The fast huffman tables are much more efficient if they can be +// stored as 16-bit results instead of 32-bit results. This restricts +// the codebooks to having only 65535 possible outcomes, though. +// (At least, accelerated by the huffman table.) +#ifndef STB_VORBIS_FAST_HUFFMAN_INT +#define STB_VORBIS_FAST_HUFFMAN_SHORT +#endif + +// STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH +// If the 'fast huffman' search doesn't succeed, then stb_vorbis falls +// back on binary searching for the correct one. This requires storing +// extra tables with the huffman codes in sorted order. Defining this +// symbol trades off space for speed by forcing a linear search in the +// non-fast case, except for "sparse" codebooks. +// #define STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH + +// STB_VORBIS_DIVIDES_IN_RESIDUE +// stb_vorbis precomputes the result of the scalar residue decoding +// that would otherwise require a divide per chunk. you can trade off +// space for time by defining this symbol. +// #define STB_VORBIS_DIVIDES_IN_RESIDUE + +// STB_VORBIS_DIVIDES_IN_CODEBOOK +// vorbis VQ codebooks can be encoded two ways: with every case explicitly +// stored, or with all elements being chosen from a small range of values, +// and all values possible in all elements. By default, stb_vorbis expands +// this latter kind out to look like the former kind for ease of decoding, +// because otherwise an integer divide-per-vector-element is required to +// unpack the index. If you define STB_VORBIS_DIVIDES_IN_CODEBOOK, you can +// trade off storage for speed. +//#define STB_VORBIS_DIVIDES_IN_CODEBOOK + +#ifdef STB_VORBIS_CODEBOOK_SHORTS +#error "STB_VORBIS_CODEBOOK_SHORTS is no longer supported as it produced incorrect results for some input formats" +#endif + +// STB_VORBIS_DIVIDE_TABLE +// this replaces small integer divides in the floor decode loop with +// table lookups. made less than 1% difference, so disabled by default. + +// STB_VORBIS_NO_INLINE_DECODE +// disables the inlining of the scalar codebook fast-huffman decode. +// might save a little codespace; useful for debugging +// #define STB_VORBIS_NO_INLINE_DECODE + +// STB_VORBIS_NO_DEFER_FLOOR +// Normally we only decode the floor without synthesizing the actual +// full curve. We can instead synthesize the curve immediately. This +// requires more memory and is very likely slower, so I don't think +// you'd ever want to do it except for debugging. +// #define STB_VORBIS_NO_DEFER_FLOOR + + + + +////////////////////////////////////////////////////////////////////////////// + +#ifdef STB_VORBIS_NO_PULLDATA_API + #define STB_VORBIS_NO_INTEGER_CONVERSION + #define STB_VORBIS_NO_STDIO +#endif + +#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) + #define STB_VORBIS_NO_STDIO 1 +#endif + +#ifndef STB_VORBIS_NO_INTEGER_CONVERSION +#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT + + // only need endianness for fast-float-to-int, which we don't + // use for pushdata + + #ifndef STB_VORBIS_BIG_ENDIAN + #define STB_VORBIS_ENDIAN 0 + #else + #define STB_VORBIS_ENDIAN 1 + #endif + +#endif +#endif + + +#ifndef STB_VORBIS_NO_STDIO +#include +#endif + +#ifndef STB_VORBIS_NO_CRT +#include +#include +#include +#include +#if !(defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)) +#include +#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) +#include +#endif +#endif +#else // STB_VORBIS_NO_CRT +#define NULL 0 +#define malloc(s) 0 +#define free(s) ((void) 0) +#define realloc(s) 0 +#endif // STB_VORBIS_NO_CRT + +#include + +#ifdef __MINGW32__ + // eff you mingw: + // "fixed": + // http://sourceforge.net/p/mingw-w64/mailman/message/32882927/ + // "no that broke the build, reverted, who cares about C": + // http://sourceforge.net/p/mingw-w64/mailman/message/32890381/ + #ifdef __forceinline + #undef __forceinline + #endif + #define __forceinline +#elif !defined(_MSC_VER) + #if __GNUC__ + #define __forceinline inline + #else + #define __forceinline + #endif +#endif + +#if STB_VORBIS_MAX_CHANNELS > 256 +#error "Value of STB_VORBIS_MAX_CHANNELS outside of allowed range" +#endif + +#if STB_VORBIS_FAST_HUFFMAN_LENGTH > 24 +#error "Value of STB_VORBIS_FAST_HUFFMAN_LENGTH outside of allowed range" +#endif + + +#if 0 +#include +#define CHECK(f) _CrtIsValidHeapPointer(f->channel_buffers[1]) +#else +#define CHECK(f) ((void) 0) +#endif + +#define MAX_BLOCKSIZE_LOG 13 // from specification +#define MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) + + +typedef unsigned char uint8; +typedef signed char int8; +typedef unsigned short uint16; +typedef signed short int16; +typedef unsigned int uint32; +typedef signed int int32; + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +typedef float codetype; + +// @NOTE +// +// Some arrays below are tagged "//varies", which means it's actually +// a variable-sized piece of data, but rather than malloc I assume it's +// small enough it's better to just allocate it all together with the +// main thing +// +// Most of the variables are specified with the smallest size I could pack +// them into. It might give better performance to make them all full-sized +// integers. It should be safe to freely rearrange the structures or change +// the sizes larger--nothing relies on silently truncating etc., nor the +// order of variables. + +#define FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) +#define FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) + +typedef struct +{ + int dimensions, entries; + uint8 *codeword_lengths; + float minimum_value; + float delta_value; + uint8 value_bits; + uint8 lookup_type; + uint8 sequence_p; + uint8 sparse; + uint32 lookup_values; + codetype *multiplicands; + uint32 *codewords; + #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT + int16 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; + #else + int32 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; + #endif + uint32 *sorted_codewords; + int *sorted_values; + int sorted_entries; +} Codebook; + +typedef struct +{ + uint8 order; + uint16 rate; + uint16 bark_map_size; + uint8 amplitude_bits; + uint8 amplitude_offset; + uint8 number_of_books; + uint8 book_list[16]; // varies +} Floor0; + +typedef struct +{ + uint8 partitions; + uint8 partition_class_list[32]; // varies + uint8 class_dimensions[16]; // varies + uint8 class_subclasses[16]; // varies + uint8 class_masterbooks[16]; // varies + int16 subclass_books[16][8]; // varies + uint16 Xlist[31*8+2]; // varies + uint8 sorted_order[31*8+2]; + uint8 neighbors[31*8+2][2]; + uint8 floor1_multiplier; + uint8 rangebits; + int values; +} Floor1; + +typedef union +{ + Floor0 floor0; + Floor1 floor1; +} Floor; + +typedef struct +{ + uint32 begin, end; + uint32 part_size; + uint8 classifications; + uint8 classbook; + uint8 **classdata; + int16 (*residue_books)[8]; +} Residue; + +typedef struct +{ + uint8 magnitude; + uint8 angle; + uint8 mux; +} MappingChannel; + +typedef struct +{ + uint16 coupling_steps; + MappingChannel *chan; + uint8 submaps; + uint8 submap_floor[15]; // varies + uint8 submap_residue[15]; // varies +} Mapping; + +typedef struct +{ + uint8 blockflag; + uint8 mapping; + uint16 windowtype; + uint16 transformtype; +} Mode; + +typedef struct +{ + uint32 goal_crc; // expected crc if match + int bytes_left; // bytes left in packet + uint32 crc_so_far; // running crc + int bytes_done; // bytes processed in _current_ chunk + uint32 sample_loc; // granule pos encoded in page +} CRCscan; + +typedef struct +{ + uint32 page_start, page_end; + uint32 last_decoded_sample; +} ProbedPage; + +struct stb_vorbis +{ + // user-accessible info + unsigned int sample_rate; + int channels; + + unsigned int setup_memory_required; + unsigned int temp_memory_required; + unsigned int setup_temp_memory_required; + + // input config +#ifndef STB_VORBIS_NO_STDIO + FILE *f; + uint32 f_start; + int close_on_free; +#endif + + uint8 *stream; + uint8 *stream_start; + uint8 *stream_end; + + uint32 stream_len; + + uint8 push_mode; + + uint32 first_audio_page_offset; + + ProbedPage p_first, p_last; + + // memory management + stb_vorbis_alloc alloc; + int setup_offset; + int temp_offset; + + // run-time results + int eof; + enum STBVorbisError error; + + // user-useful data + + // header info + int blocksize[2]; + int blocksize_0, blocksize_1; + int codebook_count; + Codebook *codebooks; + int floor_count; + uint16 floor_types[64]; // varies + Floor *floor_config; + int residue_count; + uint16 residue_types[64]; // varies + Residue *residue_config; + int mapping_count; + Mapping *mapping; + int mode_count; + Mode mode_config[64]; // varies + + uint32 total_samples; + + // decode buffer + float *channel_buffers[STB_VORBIS_MAX_CHANNELS]; + float *outputs [STB_VORBIS_MAX_CHANNELS]; + + float *previous_window[STB_VORBIS_MAX_CHANNELS]; + int previous_length; + + #ifndef STB_VORBIS_NO_DEFER_FLOOR + int16 *finalY[STB_VORBIS_MAX_CHANNELS]; + #else + float *floor_buffers[STB_VORBIS_MAX_CHANNELS]; + #endif + + uint32 current_loc; // sample location of next frame to decode + int current_loc_valid; + + // per-blocksize precomputed data + + // twiddle factors + float *A[2],*B[2],*C[2]; + float *window[2]; + uint16 *bit_reverse[2]; + + // current page/packet/segment streaming info + uint32 serial; // stream serial number for verification + int last_page; + int segment_count; + uint8 segments[255]; + uint8 page_flag; + uint8 bytes_in_seg; + uint8 first_decode; + int next_seg; + int last_seg; // flag that we're on the last segment + int last_seg_which; // what was the segment number of the last seg? + uint32 acc; + int valid_bits; + int packet_bytes; + int end_seg_with_known_loc; + uint32 known_loc_for_packet; + int discard_samples_deferred; + uint32 samples_output; + + // push mode scanning + int page_crc_tests; // only in push_mode: number of tests active; -1 if not searching +#ifndef STB_VORBIS_NO_PUSHDATA_API + CRCscan scan[STB_VORBIS_PUSHDATA_CRC_COUNT]; +#endif + + // sample-access + int channel_buffer_start; + int channel_buffer_end; +}; + +#if defined(STB_VORBIS_NO_PUSHDATA_API) + #define IS_PUSH_MODE(f) FALSE +#elif defined(STB_VORBIS_NO_PULLDATA_API) + #define IS_PUSH_MODE(f) TRUE +#else + #define IS_PUSH_MODE(f) ((f)->push_mode) +#endif + +typedef struct stb_vorbis vorb; + +static int error(vorb *f, enum STBVorbisError e) +{ + f->error = e; + if (!f->eof && e != VORBIS_need_more_data) { + f->error=e; // breakpoint for debugging + } + return 0; +} + + +// these functions are used for allocating temporary memory +// while decoding. if you can afford the stack space, use +// alloca(); otherwise, provide a temp buffer and it will +// allocate out of those. + +#define array_size_required(count,size) (count*(sizeof(void *)+(size))) + +#define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) +#ifdef dealloca +#define temp_free(f,p) (f->alloc.alloc_buffer ? 0 : dealloca(size)) +#else +#define temp_free(f,p) 0 +#endif +#define temp_alloc_save(f) ((f)->temp_offset) +#define temp_alloc_restore(f,p) ((f)->temp_offset = (p)) + +#define temp_block_array(f,count,size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) + +// given a sufficiently large block of memory, make an array of pointers to subblocks of it +static void *make_block_array(void *mem, int count, int size) +{ + int i; + void ** p = (void **) mem; + char *q = (char *) (p + count); + for (i=0; i < count; ++i) { + p[i] = q; + q += size; + } + return p; +} + +static void *setup_malloc(vorb *f, int sz) +{ + sz = (sz+3) & ~3; + f->setup_memory_required += sz; + if (f->alloc.alloc_buffer) { + void *p = (char *) f->alloc.alloc_buffer + f->setup_offset; + if (f->setup_offset + sz > f->temp_offset) return NULL; + f->setup_offset += sz; + return p; + } + return sz ? malloc(sz) : NULL; +} + +static void setup_free(vorb *f, void *p) +{ + if (f->alloc.alloc_buffer) return; // do nothing; setup mem is a stack + free(p); +} + +static void *setup_temp_malloc(vorb *f, int sz) +{ + sz = (sz+3) & ~3; + if (f->alloc.alloc_buffer) { + if (f->temp_offset - sz < f->setup_offset) return NULL; + f->temp_offset -= sz; + return (char *) f->alloc.alloc_buffer + f->temp_offset; + } + return malloc(sz); +} + +static void setup_temp_free(vorb *f, void *p, int sz) +{ + if (f->alloc.alloc_buffer) { + f->temp_offset += (sz+3)&~3; + return; + } + free(p); +} + +#define CRC32_POLY 0x04c11db7 // from spec + +static uint32 crc_table[256]; +static void crc32_init(void) +{ + int i,j; + uint32 s; + for(i=0; i < 256; i++) { + for (s=(uint32) i << 24, j=0; j < 8; ++j) + s = (s << 1) ^ (s >= (1U<<31) ? CRC32_POLY : 0); + crc_table[i] = s; + } +} + +static __forceinline uint32 crc32_update(uint32 crc, uint8 byte) +{ + return (crc << 8) ^ crc_table[byte ^ (crc >> 24)]; +} + + +// used in setup, and for huffman that doesn't go fast path +static unsigned int bit_reverse(unsigned int n) +{ + n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1); + n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2); + n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4); + n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8); + return (n >> 16) | (n << 16); +} + +static float square(float x) +{ + return x*x; +} + +// this is a weird definition of log2() for which log2(1) = 1, log2(2) = 2, log2(4) = 3 +// as required by the specification. fast(?) implementation from stb.h +// @OPTIMIZE: called multiple times per-packet with "constants"; move to setup +static int ilog(int32 n) +{ + static signed char log2_4[16] = { 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 }; + + // 2 compares if n < 16, 3 compares otherwise (4 if signed or n > 1<<29) + if (n < (1 << 14)) + if (n < (1 << 4)) return 0 + log2_4[n ]; + else if (n < (1 << 9)) return 5 + log2_4[n >> 5]; + else return 10 + log2_4[n >> 10]; + else if (n < (1 << 24)) + if (n < (1 << 19)) return 15 + log2_4[n >> 15]; + else return 20 + log2_4[n >> 20]; + else if (n < (1 << 29)) return 25 + log2_4[n >> 25]; + else if (n < (1 << 31)) return 30 + log2_4[n >> 30]; + else return 0; // signed n returns 0 +} + +#ifndef M_PI + #define M_PI 3.14159265358979323846264f // from CRC +#endif + +// code length assigned to a value with no huffman encoding +#define NO_CODE 255 + +/////////////////////// LEAF SETUP FUNCTIONS ////////////////////////// +// +// these functions are only called at setup, and only a few times +// per file + +static float float32_unpack(uint32 x) +{ + // from the specification + uint32 mantissa = x & 0x1fffff; + uint32 sign = x & 0x80000000; + uint32 exp = (x & 0x7fe00000) >> 21; + double res = sign ? -(double)mantissa : (double)mantissa; + return (float) ldexp((float)res, exp-788); +} + + +// zlib & jpeg huffman tables assume that the output symbols +// can either be arbitrarily arranged, or have monotonically +// increasing frequencies--they rely on the lengths being sorted; +// this makes for a very simple generation algorithm. +// vorbis allows a huffman table with non-sorted lengths. This +// requires a more sophisticated construction, since symbols in +// order do not map to huffman codes "in order". +static void add_entry(Codebook *c, uint32 huff_code, int symbol, int count, int len, uint32 *values) +{ + if (!c->sparse) { + c->codewords [symbol] = huff_code; + } else { + c->codewords [count] = huff_code; + c->codeword_lengths[count] = len; + values [count] = symbol; + } +} + +static int compute_codewords(Codebook *c, uint8 *len, int n, uint32 *values) +{ + int i,k,m=0; + uint32 available[32]; + + memset(available, 0, sizeof(available)); + // find the first entry + for (k=0; k < n; ++k) if (len[k] < NO_CODE) break; + if (k == n) { assert(c->sorted_entries == 0); return TRUE; } + // add to the list + add_entry(c, 0, k, m++, len[k], values); + // add all available leaves + for (i=1; i <= len[k]; ++i) + available[i] = 1U << (32-i); + // note that the above code treats the first case specially, + // but it's really the same as the following code, so they + // could probably be combined (except the initial code is 0, + // and I use 0 in available[] to mean 'empty') + for (i=k+1; i < n; ++i) { + uint32 res; + int z = len[i], y; + if (z == NO_CODE) continue; + // find lowest available leaf (should always be earliest, + // which is what the specification calls for) + // note that this property, and the fact we can never have + // more than one free leaf at a given level, isn't totally + // trivial to prove, but it seems true and the assert never + // fires, so! + while (z > 0 && !available[z]) --z; + if (z == 0) { return FALSE; } + res = available[z]; + assert(z >= 0 && z < 32); + available[z] = 0; + add_entry(c, bit_reverse(res), i, m++, len[i], values); + // propogate availability up the tree + if (z != len[i]) { + assert(len[i] >= 0 && len[i] < 32); + for (y=len[i]; y > z; --y) { + assert(available[y] == 0); + available[y] = res + (1 << (32-y)); + } + } + } + return TRUE; +} + +// accelerated huffman table allows fast O(1) match of all symbols +// of length <= STB_VORBIS_FAST_HUFFMAN_LENGTH +static void compute_accelerated_huffman(Codebook *c) +{ + int i, len; + for (i=0; i < FAST_HUFFMAN_TABLE_SIZE; ++i) + c->fast_huffman[i] = -1; + + len = c->sparse ? c->sorted_entries : c->entries; + #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT + if (len > 32767) len = 32767; // largest possible value we can encode! + #endif + for (i=0; i < len; ++i) { + if (c->codeword_lengths[i] <= STB_VORBIS_FAST_HUFFMAN_LENGTH) { + uint32 z = c->sparse ? bit_reverse(c->sorted_codewords[i]) : c->codewords[i]; + // set table entries for all bit combinations in the higher bits + while (z < FAST_HUFFMAN_TABLE_SIZE) { + c->fast_huffman[z] = i; + z += 1 << c->codeword_lengths[i]; + } + } + } +} + +#ifdef _MSC_VER +#define STBV_CDECL __cdecl +#else +#define STBV_CDECL +#endif + +static int STBV_CDECL uint32_compare(const void *p, const void *q) +{ + uint32 x = * (uint32 *) p; + uint32 y = * (uint32 *) q; + return x < y ? -1 : x > y; +} + +static int include_in_sort(Codebook *c, uint8 len) +{ + if (c->sparse) { assert(len != NO_CODE); return TRUE; } + if (len == NO_CODE) return FALSE; + if (len > STB_VORBIS_FAST_HUFFMAN_LENGTH) return TRUE; + return FALSE; +} + +// if the fast table above doesn't work, we want to binary +// search them... need to reverse the bits +static void compute_sorted_huffman(Codebook *c, uint8 *lengths, uint32 *values) +{ + int i, len; + // build a list of all the entries + // OPTIMIZATION: don't include the short ones, since they'll be caught by FAST_HUFFMAN. + // this is kind of a frivolous optimization--I don't see any performance improvement, + // but it's like 4 extra lines of code, so. + if (!c->sparse) { + int k = 0; + for (i=0; i < c->entries; ++i) + if (include_in_sort(c, lengths[i])) + c->sorted_codewords[k++] = bit_reverse(c->codewords[i]); + assert(k == c->sorted_entries); + } else { + for (i=0; i < c->sorted_entries; ++i) + c->sorted_codewords[i] = bit_reverse(c->codewords[i]); + } + + qsort(c->sorted_codewords, c->sorted_entries, sizeof(c->sorted_codewords[0]), uint32_compare); + c->sorted_codewords[c->sorted_entries] = 0xffffffff; + + len = c->sparse ? c->sorted_entries : c->entries; + // now we need to indicate how they correspond; we could either + // #1: sort a different data structure that says who they correspond to + // #2: for each sorted entry, search the original list to find who corresponds + // #3: for each original entry, find the sorted entry + // #1 requires extra storage, #2 is slow, #3 can use binary search! + for (i=0; i < len; ++i) { + int huff_len = c->sparse ? lengths[values[i]] : lengths[i]; + if (include_in_sort(c,huff_len)) { + uint32 code = bit_reverse(c->codewords[i]); + int x=0, n=c->sorted_entries; + while (n > 1) { + // invariant: sc[x] <= code < sc[x+n] + int m = x + (n >> 1); + if (c->sorted_codewords[m] <= code) { + x = m; + n -= (n>>1); + } else { + n >>= 1; + } + } + assert(c->sorted_codewords[x] == code); + if (c->sparse) { + c->sorted_values[x] = values[i]; + c->codeword_lengths[x] = huff_len; + } else { + c->sorted_values[x] = i; + } + } + } +} + +// only run while parsing the header (3 times) +static int vorbis_validate(uint8 *data) +{ + static uint8 vorbis[6] = { 'v', 'o', 'r', 'b', 'i', 's' }; + return memcmp(data, vorbis, 6) == 0; +} + +// called from setup only, once per code book +// (formula implied by specification) +static int lookup1_values(int entries, int dim) +{ + int r = (int) floor(exp((float) log((float) entries) / dim)); + if ((int) floor(pow((float) r+1, dim)) <= entries) // (int) cast for MinGW warning; + ++r; // floor() to avoid _ftol() when non-CRT + assert(pow((float) r+1, dim) > entries); + assert((int) floor(pow((float) r, dim)) <= entries); // (int),floor() as above + return r; +} + +// called twice per file +static void compute_twiddle_factors(int n, float *A, float *B, float *C) +{ + int n4 = n >> 2, n8 = n >> 3; + int k,k2; + + for (k=k2=0; k < n4; ++k,k2+=2) { + A[k2 ] = (float) cos(4*k*M_PI/n); + A[k2+1] = (float) -sin(4*k*M_PI/n); + B[k2 ] = (float) cos((k2+1)*M_PI/n/2) * 0.5f; + B[k2+1] = (float) sin((k2+1)*M_PI/n/2) * 0.5f; + } + for (k=k2=0; k < n8; ++k,k2+=2) { + C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); + C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); + } +} + +static void compute_window(int n, float *window) +{ + int n2 = n >> 1, i; + for (i=0; i < n2; ++i) + window[i] = (float) sin(0.5 * M_PI * square((float) sin((i - 0 + 0.5) / n2 * 0.5 * M_PI))); +} + +static void compute_bitreverse(int n, uint16 *rev) +{ + int ld = ilog(n) - 1; // ilog is off-by-one from normal definitions + int i, n8 = n >> 3; + for (i=0; i < n8; ++i) + rev[i] = (bit_reverse(i) >> (32-ld+3)) << 2; +} + +static int init_blocksize(vorb *f, int b, int n) +{ + int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3; + f->A[b] = (float *) setup_malloc(f, sizeof(float) * n2); + f->B[b] = (float *) setup_malloc(f, sizeof(float) * n2); + f->C[b] = (float *) setup_malloc(f, sizeof(float) * n4); + if (!f->A[b] || !f->B[b] || !f->C[b]) return error(f, VORBIS_outofmem); + compute_twiddle_factors(n, f->A[b], f->B[b], f->C[b]); + f->window[b] = (float *) setup_malloc(f, sizeof(float) * n2); + if (!f->window[b]) return error(f, VORBIS_outofmem); + compute_window(n, f->window[b]); + f->bit_reverse[b] = (uint16 *) setup_malloc(f, sizeof(uint16) * n8); + if (!f->bit_reverse[b]) return error(f, VORBIS_outofmem); + compute_bitreverse(n, f->bit_reverse[b]); + return TRUE; +} + +static void neighbors(uint16 *x, int n, int *plow, int *phigh) +{ + int low = -1; + int high = 65536; + int i; + for (i=0; i < n; ++i) { + if (x[i] > low && x[i] < x[n]) { *plow = i; low = x[i]; } + if (x[i] < high && x[i] > x[n]) { *phigh = i; high = x[i]; } + } +} + +// this has been repurposed so y is now the original index instead of y +typedef struct +{ + uint16 x,y; +} Point; + +static int STBV_CDECL point_compare(const void *p, const void *q) +{ + Point *a = (Point *) p; + Point *b = (Point *) q; + return a->x < b->x ? -1 : a->x > b->x; +} + +// +/////////////////////// END LEAF SETUP FUNCTIONS ////////////////////////// + + +#if defined(STB_VORBIS_NO_STDIO) + #define USE_MEMORY(z) TRUE +#else + #define USE_MEMORY(z) ((z)->stream) +#endif + +static uint8 get8(vorb *z) +{ + if (USE_MEMORY(z)) { + if (z->stream >= z->stream_end) { z->eof = TRUE; return 0; } + return *z->stream++; + } + + #ifndef STB_VORBIS_NO_STDIO + { + int c = fgetc(z->f); + if (c == EOF) { z->eof = TRUE; return 0; } + return c; + } + #endif +} + +static uint32 get32(vorb *f) +{ + uint32 x; + x = get8(f); + x += get8(f) << 8; + x += get8(f) << 16; + x += (uint32) get8(f) << 24; + return x; +} + +static int getn(vorb *z, uint8 *data, int n) +{ + if (USE_MEMORY(z)) { + if (z->stream+n > z->stream_end) { z->eof = 1; return 0; } + memcpy(data, z->stream, n); + z->stream += n; + return 1; + } + + #ifndef STB_VORBIS_NO_STDIO + if (fread(data, n, 1, z->f) == 1) + return 1; + else { + z->eof = 1; + return 0; + } + #endif +} + +static void skip(vorb *z, int n) +{ + if (USE_MEMORY(z)) { + z->stream += n; + if (z->stream >= z->stream_end) z->eof = 1; + return; + } + #ifndef STB_VORBIS_NO_STDIO + { + long x = ftell(z->f); + fseek(z->f, x+n, SEEK_SET); + } + #endif +} + +static int set_file_offset(stb_vorbis *f, unsigned int loc) +{ + #ifndef STB_VORBIS_NO_PUSHDATA_API + if (f->push_mode) return 0; + #endif + f->eof = 0; + if (USE_MEMORY(f)) { + if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) { + f->stream = f->stream_end; + f->eof = 1; + return 0; + } else { + f->stream = f->stream_start + loc; + return 1; + } + } + #ifndef STB_VORBIS_NO_STDIO + if (loc + f->f_start < loc || loc >= 0x80000000) { + loc = 0x7fffffff; + f->eof = 1; + } else { + loc += f->f_start; + } + if (!fseek(f->f, loc, SEEK_SET)) + return 1; + f->eof = 1; + fseek(f->f, f->f_start, SEEK_END); + return 0; + #endif +} + + +static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 }; + +static int capture_pattern(vorb *f) +{ + if (0x4f != get8(f)) return FALSE; + if (0x67 != get8(f)) return FALSE; + if (0x67 != get8(f)) return FALSE; + if (0x53 != get8(f)) return FALSE; + return TRUE; +} + +#define PAGEFLAG_continued_packet 1 +#define PAGEFLAG_first_page 2 +#define PAGEFLAG_last_page 4 + +static int start_page_no_capturepattern(vorb *f) +{ + uint32 loc0,loc1,n; + // stream structure version + if (0 != get8(f)) return error(f, VORBIS_invalid_stream_structure_version); + // header flag + f->page_flag = get8(f); + // absolute granule position + loc0 = get32(f); + loc1 = get32(f); + // @TODO: validate loc0,loc1 as valid positions? + // stream serial number -- vorbis doesn't interleave, so discard + get32(f); + //if (f->serial != get32(f)) return error(f, VORBIS_incorrect_stream_serial_number); + // page sequence number + n = get32(f); + f->last_page = n; + // CRC32 + get32(f); + // page_segments + f->segment_count = get8(f); + if (!getn(f, f->segments, f->segment_count)) + return error(f, VORBIS_unexpected_eof); + // assume we _don't_ know any the sample position of any segments + f->end_seg_with_known_loc = -2; + if (loc0 != ~0U || loc1 != ~0U) { + int i; + // determine which packet is the last one that will complete + for (i=f->segment_count-1; i >= 0; --i) + if (f->segments[i] < 255) + break; + // 'i' is now the index of the _last_ segment of a packet that ends + if (i >= 0) { + f->end_seg_with_known_loc = i; + f->known_loc_for_packet = loc0; + } + } + if (f->first_decode) { + int i,len; + ProbedPage p; + len = 0; + for (i=0; i < f->segment_count; ++i) + len += f->segments[i]; + len += 27 + f->segment_count; + p.page_start = f->first_audio_page_offset; + p.page_end = p.page_start + len; + p.last_decoded_sample = loc0; + f->p_first = p; + } + f->next_seg = 0; + return TRUE; +} + +static int start_page(vorb *f) +{ + if (!capture_pattern(f)) return error(f, VORBIS_missing_capture_pattern); + return start_page_no_capturepattern(f); +} + +static int start_packet(vorb *f) +{ + while (f->next_seg == -1) { + if (!start_page(f)) return FALSE; + if (f->page_flag & PAGEFLAG_continued_packet) + return error(f, VORBIS_continued_packet_flag_invalid); + } + f->last_seg = FALSE; + f->valid_bits = 0; + f->packet_bytes = 0; + f->bytes_in_seg = 0; + // f->next_seg is now valid + return TRUE; +} + +static int maybe_start_packet(vorb *f) +{ + if (f->next_seg == -1) { + int x = get8(f); + if (f->eof) return FALSE; // EOF at page boundary is not an error! + if (0x4f != x ) return error(f, VORBIS_missing_capture_pattern); + if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); + if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); + if (0x53 != get8(f)) return error(f, VORBIS_missing_capture_pattern); + if (!start_page_no_capturepattern(f)) return FALSE; + if (f->page_flag & PAGEFLAG_continued_packet) { + // set up enough state that we can read this packet if we want, + // e.g. during recovery + f->last_seg = FALSE; + f->bytes_in_seg = 0; + return error(f, VORBIS_continued_packet_flag_invalid); + } + } + return start_packet(f); +} + +static int next_segment(vorb *f) +{ + int len; + if (f->last_seg) return 0; + if (f->next_seg == -1) { + f->last_seg_which = f->segment_count-1; // in case start_page fails + if (!start_page(f)) { f->last_seg = 1; return 0; } + if (!(f->page_flag & PAGEFLAG_continued_packet)) return error(f, VORBIS_continued_packet_flag_invalid); + } + len = f->segments[f->next_seg++]; + if (len < 255) { + f->last_seg = TRUE; + f->last_seg_which = f->next_seg-1; + } + if (f->next_seg >= f->segment_count) + f->next_seg = -1; + assert(f->bytes_in_seg == 0); + f->bytes_in_seg = len; + return len; +} + +#define EOP (-1) +#define INVALID_BITS (-1) + +static int get8_packet_raw(vorb *f) +{ + if (!f->bytes_in_seg) { // CLANG! + if (f->last_seg) return EOP; + else if (!next_segment(f)) return EOP; + } + assert(f->bytes_in_seg > 0); + --f->bytes_in_seg; + ++f->packet_bytes; + return get8(f); +} + +static int get8_packet(vorb *f) +{ + int x = get8_packet_raw(f); + f->valid_bits = 0; + return x; +} + +static void flush_packet(vorb *f) +{ + while (get8_packet_raw(f) != EOP); +} + +// @OPTIMIZE: this is the secondary bit decoder, so it's probably not as important +// as the huffman decoder? +static uint32 get_bits(vorb *f, int n) +{ + uint32 z; + + if (f->valid_bits < 0) return 0; + if (f->valid_bits < n) { + if (n > 24) { + // the accumulator technique below would not work correctly in this case + z = get_bits(f, 24); + z += get_bits(f, n-24) << 24; + return z; + } + if (f->valid_bits == 0) f->acc = 0; + while (f->valid_bits < n) { + int z = get8_packet_raw(f); + if (z == EOP) { + f->valid_bits = INVALID_BITS; + return 0; + } + f->acc += z << f->valid_bits; + f->valid_bits += 8; + } + } + if (f->valid_bits < 0) return 0; + z = f->acc & ((1 << n)-1); + f->acc >>= n; + f->valid_bits -= n; + return z; +} + +// @OPTIMIZE: primary accumulator for huffman +// expand the buffer to as many bits as possible without reading off end of packet +// it might be nice to allow f->valid_bits and f->acc to be stored in registers, +// e.g. cache them locally and decode locally +static __forceinline void prep_huffman(vorb *f) +{ + if (f->valid_bits <= 24) { + if (f->valid_bits == 0) f->acc = 0; + do { + int z; + if (f->last_seg && !f->bytes_in_seg) return; + z = get8_packet_raw(f); + if (z == EOP) return; + f->acc += (unsigned) z << f->valid_bits; + f->valid_bits += 8; + } while (f->valid_bits <= 24); + } +} + +enum +{ + VORBIS_packet_id = 1, + VORBIS_packet_comment = 3, + VORBIS_packet_setup = 5 +}; + +static int codebook_decode_scalar_raw(vorb *f, Codebook *c) +{ + int i; + prep_huffman(f); + + if (c->codewords == NULL && c->sorted_codewords == NULL) + return -1; + + // cases to use binary search: sorted_codewords && !c->codewords + // sorted_codewords && c->entries > 8 + if (c->entries > 8 ? c->sorted_codewords!=NULL : !c->codewords) { + // binary search + uint32 code = bit_reverse(f->acc); + int x=0, n=c->sorted_entries, len; + + while (n > 1) { + // invariant: sc[x] <= code < sc[x+n] + int m = x + (n >> 1); + if (c->sorted_codewords[m] <= code) { + x = m; + n -= (n>>1); + } else { + n >>= 1; + } + } + // x is now the sorted index + if (!c->sparse) x = c->sorted_values[x]; + // x is now sorted index if sparse, or symbol otherwise + len = c->codeword_lengths[x]; + if (f->valid_bits >= len) { + f->acc >>= len; + f->valid_bits -= len; + return x; + } + + f->valid_bits = 0; + return -1; + } + + // if small, linear search + assert(!c->sparse); + for (i=0; i < c->entries; ++i) { + if (c->codeword_lengths[i] == NO_CODE) continue; + if (c->codewords[i] == (f->acc & ((1 << c->codeword_lengths[i])-1))) { + if (f->valid_bits >= c->codeword_lengths[i]) { + f->acc >>= c->codeword_lengths[i]; + f->valid_bits -= c->codeword_lengths[i]; + return i; + } + f->valid_bits = 0; + return -1; + } + } + + error(f, VORBIS_invalid_stream); + f->valid_bits = 0; + return -1; +} + +#ifndef STB_VORBIS_NO_INLINE_DECODE + +#define DECODE_RAW(var, f,c) \ + if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) \ + prep_huffman(f); \ + var = f->acc & FAST_HUFFMAN_TABLE_MASK; \ + var = c->fast_huffman[var]; \ + if (var >= 0) { \ + int n = c->codeword_lengths[var]; \ + f->acc >>= n; \ + f->valid_bits -= n; \ + if (f->valid_bits < 0) { f->valid_bits = 0; var = -1; } \ + } else { \ + var = codebook_decode_scalar_raw(f,c); \ + } + +#else + +static int codebook_decode_scalar(vorb *f, Codebook *c) +{ + int i; + if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) + prep_huffman(f); + // fast huffman table lookup + i = f->acc & FAST_HUFFMAN_TABLE_MASK; + i = c->fast_huffman[i]; + if (i >= 0) { + f->acc >>= c->codeword_lengths[i]; + f->valid_bits -= c->codeword_lengths[i]; + if (f->valid_bits < 0) { f->valid_bits = 0; return -1; } + return i; + } + return codebook_decode_scalar_raw(f,c); +} + +#define DECODE_RAW(var,f,c) var = codebook_decode_scalar(f,c); + +#endif + +#define DECODE(var,f,c) \ + DECODE_RAW(var,f,c) \ + if (c->sparse) var = c->sorted_values[var]; + +#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK + #define DECODE_VQ(var,f,c) DECODE_RAW(var,f,c) +#else + #define DECODE_VQ(var,f,c) DECODE(var,f,c) +#endif + + + + + + +// CODEBOOK_ELEMENT_FAST is an optimization for the CODEBOOK_FLOATS case +// where we avoid one addition +#define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off]) +#define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off]) +#define CODEBOOK_ELEMENT_BASE(c) (0) + +static int codebook_decode_start(vorb *f, Codebook *c) +{ + int z = -1; + + // type 0 is only legal in a scalar context + if (c->lookup_type == 0) + error(f, VORBIS_invalid_stream); + else { + DECODE_VQ(z,f,c); + if (c->sparse) assert(z < c->sorted_entries); + if (z < 0) { // check for EOP + if (!f->bytes_in_seg) + if (f->last_seg) + return z; + error(f, VORBIS_invalid_stream); + } + } + return z; +} + +static int codebook_decode(vorb *f, Codebook *c, float *output, int len) +{ + int i,z = codebook_decode_start(f,c); + if (z < 0) return FALSE; + if (len > c->dimensions) len = c->dimensions; + +#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK + if (c->lookup_type == 1) { + float last = CODEBOOK_ELEMENT_BASE(c); + int div = 1; + for (i=0; i < len; ++i) { + int off = (z / div) % c->lookup_values; + float val = CODEBOOK_ELEMENT_FAST(c,off) + last; + output[i] += val; + if (c->sequence_p) last = val + c->minimum_value; + div *= c->lookup_values; + } + return TRUE; + } +#endif + + z *= c->dimensions; + if (c->sequence_p) { + float last = CODEBOOK_ELEMENT_BASE(c); + for (i=0; i < len; ++i) { + float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; + output[i] += val; + last = val + c->minimum_value; + } + } else { + float last = CODEBOOK_ELEMENT_BASE(c); + for (i=0; i < len; ++i) { + output[i] += CODEBOOK_ELEMENT_FAST(c,z+i) + last; + } + } + + return TRUE; +} + +static int codebook_decode_step(vorb *f, Codebook *c, float *output, int len, int step) +{ + int i,z = codebook_decode_start(f,c); + float last = CODEBOOK_ELEMENT_BASE(c); + if (z < 0) return FALSE; + if (len > c->dimensions) len = c->dimensions; + +#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK + if (c->lookup_type == 1) { + int div = 1; + for (i=0; i < len; ++i) { + int off = (z / div) % c->lookup_values; + float val = CODEBOOK_ELEMENT_FAST(c,off) + last; + output[i*step] += val; + if (c->sequence_p) last = val; + div *= c->lookup_values; + } + return TRUE; + } +#endif + + z *= c->dimensions; + for (i=0; i < len; ++i) { + float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; + output[i*step] += val; + if (c->sequence_p) last = val; + } + + return TRUE; +} + +static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **outputs, int ch, int *c_inter_p, int *p_inter_p, int len, int total_decode) +{ + int c_inter = *c_inter_p; + int p_inter = *p_inter_p; + int i,z, effective = c->dimensions; + + // type 0 is only legal in a scalar context + if (c->lookup_type == 0) return error(f, VORBIS_invalid_stream); + + while (total_decode > 0) { + float last = CODEBOOK_ELEMENT_BASE(c); + DECODE_VQ(z,f,c); + #ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK + assert(!c->sparse || z < c->sorted_entries); + #endif + if (z < 0) { + if (!f->bytes_in_seg) + if (f->last_seg) return FALSE; + return error(f, VORBIS_invalid_stream); + } + + // if this will take us off the end of the buffers, stop short! + // we check by computing the length of the virtual interleaved + // buffer (len*ch), our current offset within it (p_inter*ch)+(c_inter), + // and the length we'll be using (effective) + if (c_inter + p_inter*ch + effective > len * ch) { + effective = len*ch - (p_inter*ch - c_inter); + } + + #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK + if (c->lookup_type == 1) { + int div = 1; + for (i=0; i < effective; ++i) { + int off = (z / div) % c->lookup_values; + float val = CODEBOOK_ELEMENT_FAST(c,off) + last; + if (outputs[c_inter]) + outputs[c_inter][p_inter] += val; + if (++c_inter == ch) { c_inter = 0; ++p_inter; } + if (c->sequence_p) last = val; + div *= c->lookup_values; + } + } else + #endif + { + z *= c->dimensions; + if (c->sequence_p) { + for (i=0; i < effective; ++i) { + float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; + if (outputs[c_inter]) + outputs[c_inter][p_inter] += val; + if (++c_inter == ch) { c_inter = 0; ++p_inter; } + last = val; + } + } else { + for (i=0; i < effective; ++i) { + float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; + if (outputs[c_inter]) + outputs[c_inter][p_inter] += val; + if (++c_inter == ch) { c_inter = 0; ++p_inter; } + } + } + } + + total_decode -= effective; + } + *c_inter_p = c_inter; + *p_inter_p = p_inter; + return TRUE; +} + +static int predict_point(int x, int x0, int x1, int y0, int y1) +{ + int dy = y1 - y0; + int adx = x1 - x0; + // @OPTIMIZE: force int division to round in the right direction... is this necessary on x86? + int err = abs(dy) * (x - x0); + int off = err / adx; + return dy < 0 ? y0 - off : y0 + off; +} + +// the following table is block-copied from the specification +static float inverse_db_table[256] = +{ + 1.0649863e-07f, 1.1341951e-07f, 1.2079015e-07f, 1.2863978e-07f, + 1.3699951e-07f, 1.4590251e-07f, 1.5538408e-07f, 1.6548181e-07f, + 1.7623575e-07f, 1.8768855e-07f, 1.9988561e-07f, 2.1287530e-07f, + 2.2670913e-07f, 2.4144197e-07f, 2.5713223e-07f, 2.7384213e-07f, + 2.9163793e-07f, 3.1059021e-07f, 3.3077411e-07f, 3.5226968e-07f, + 3.7516214e-07f, 3.9954229e-07f, 4.2550680e-07f, 4.5315863e-07f, + 4.8260743e-07f, 5.1396998e-07f, 5.4737065e-07f, 5.8294187e-07f, + 6.2082472e-07f, 6.6116941e-07f, 7.0413592e-07f, 7.4989464e-07f, + 7.9862701e-07f, 8.5052630e-07f, 9.0579828e-07f, 9.6466216e-07f, + 1.0273513e-06f, 1.0941144e-06f, 1.1652161e-06f, 1.2409384e-06f, + 1.3215816e-06f, 1.4074654e-06f, 1.4989305e-06f, 1.5963394e-06f, + 1.7000785e-06f, 1.8105592e-06f, 1.9282195e-06f, 2.0535261e-06f, + 2.1869758e-06f, 2.3290978e-06f, 2.4804557e-06f, 2.6416497e-06f, + 2.8133190e-06f, 2.9961443e-06f, 3.1908506e-06f, 3.3982101e-06f, + 3.6190449e-06f, 3.8542308e-06f, 4.1047004e-06f, 4.3714470e-06f, + 4.6555282e-06f, 4.9580707e-06f, 5.2802740e-06f, 5.6234160e-06f, + 5.9888572e-06f, 6.3780469e-06f, 6.7925283e-06f, 7.2339451e-06f, + 7.7040476e-06f, 8.2047000e-06f, 8.7378876e-06f, 9.3057248e-06f, + 9.9104632e-06f, 1.0554501e-05f, 1.1240392e-05f, 1.1970856e-05f, + 1.2748789e-05f, 1.3577278e-05f, 1.4459606e-05f, 1.5399272e-05f, + 1.6400004e-05f, 1.7465768e-05f, 1.8600792e-05f, 1.9809576e-05f, + 2.1096914e-05f, 2.2467911e-05f, 2.3928002e-05f, 2.5482978e-05f, + 2.7139006e-05f, 2.8902651e-05f, 3.0780908e-05f, 3.2781225e-05f, + 3.4911534e-05f, 3.7180282e-05f, 3.9596466e-05f, 4.2169667e-05f, + 4.4910090e-05f, 4.7828601e-05f, 5.0936773e-05f, 5.4246931e-05f, + 5.7772202e-05f, 6.1526565e-05f, 6.5524908e-05f, 6.9783085e-05f, + 7.4317983e-05f, 7.9147585e-05f, 8.4291040e-05f, 8.9768747e-05f, + 9.5602426e-05f, 0.00010181521f, 0.00010843174f, 0.00011547824f, + 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f, + 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f, + 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f, + 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f, + 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f, + 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f, + 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f, + 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f, + 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f, + 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f, + 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f, + 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f, + 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f, + 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f, + 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f, + 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f, + 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f, + 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f, + 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f, + 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f, + 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f, + 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f, + 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f, + 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f, + 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f, + 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f, + 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f, + 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f, + 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f, + 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f, + 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f, + 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f, + 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f, + 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f, + 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f, + 0.82788260f, 0.88168307f, 0.9389798f, 1.0f +}; + + +// @OPTIMIZE: if you want to replace this bresenham line-drawing routine, +// note that you must produce bit-identical output to decode correctly; +// this specific sequence of operations is specified in the spec (it's +// drawing integer-quantized frequency-space lines that the encoder +// expects to be exactly the same) +// ... also, isn't the whole point of Bresenham's algorithm to NOT +// have to divide in the setup? sigh. +#ifndef STB_VORBIS_NO_DEFER_FLOOR +#define LINE_OP(a,b) a *= b +#else +#define LINE_OP(a,b) a = b +#endif + +#ifdef STB_VORBIS_DIVIDE_TABLE +#define DIVTAB_NUMER 32 +#define DIVTAB_DENOM 64 +int8 integer_divide_table[DIVTAB_NUMER][DIVTAB_DENOM]; // 2KB +#endif + +static __forceinline void draw_line(float *output, int x0, int y0, int x1, int y1, int n) +{ + int dy = y1 - y0; + int adx = x1 - x0; + int ady = abs(dy); + int base; + int x=x0,y=y0; + int err = 0; + int sy; + +#ifdef STB_VORBIS_DIVIDE_TABLE + if (adx < DIVTAB_DENOM && ady < DIVTAB_NUMER) { + if (dy < 0) { + base = -integer_divide_table[ady][adx]; + sy = base-1; + } else { + base = integer_divide_table[ady][adx]; + sy = base+1; + } + } else { + base = dy / adx; + if (dy < 0) + sy = base - 1; + else + sy = base+1; + } +#else + base = dy / adx; + if (dy < 0) + sy = base - 1; + else + sy = base+1; +#endif + ady -= abs(base) * adx; + if (x1 > n) x1 = n; + if (x < x1) { + LINE_OP(output[x], inverse_db_table[y]); + for (++x; x < x1; ++x) { + err += ady; + if (err >= adx) { + err -= adx; + y += sy; + } else + y += base; + LINE_OP(output[x], inverse_db_table[y]); + } + } +} + +static int residue_decode(vorb *f, Codebook *book, float *target, int offset, int n, int rtype) +{ + int k; + if (rtype == 0) { + int step = n / book->dimensions; + for (k=0; k < step; ++k) + if (!codebook_decode_step(f, book, target+offset+k, n-offset-k, step)) + return FALSE; + } else { + for (k=0; k < n; ) { + if (!codebook_decode(f, book, target+offset, n-k)) + return FALSE; + k += book->dimensions; + offset += book->dimensions; + } + } + return TRUE; +} + +static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8 *do_not_decode) +{ + int i,j,pass; + Residue *r = f->residue_config + rn; + int rtype = f->residue_types[rn]; + int c = r->classbook; + int classwords = f->codebooks[c].dimensions; + int n_read = r->end - r->begin; + int part_read = n_read / r->part_size; + int temp_alloc_point = temp_alloc_save(f); + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + uint8 ***part_classdata = (uint8 ***) temp_block_array(f,f->channels, part_read * sizeof(**part_classdata)); + #else + int **classifications = (int **) temp_block_array(f,f->channels, part_read * sizeof(**classifications)); + #endif + + CHECK(f); + + for (i=0; i < ch; ++i) + if (!do_not_decode[i]) + memset(residue_buffers[i], 0, sizeof(float) * n); + + if (rtype == 2 && ch != 1) { + for (j=0; j < ch; ++j) + if (!do_not_decode[j]) + break; + if (j == ch) + goto done; + + for (pass=0; pass < 8; ++pass) { + int pcount = 0, class_set = 0; + if (ch == 2) { + while (pcount < part_read) { + int z = r->begin + pcount*r->part_size; + int c_inter = (z & 1), p_inter = z>>1; + if (pass == 0) { + Codebook *c = f->codebooks+r->classbook; + int q; + DECODE(q,f,c); + if (q == EOP) goto done; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + part_classdata[0][class_set] = r->classdata[q]; + #else + for (i=classwords-1; i >= 0; --i) { + classifications[0][i+pcount] = q % r->classifications; + q /= r->classifications; + } + #endif + } + for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { + int z = r->begin + pcount*r->part_size; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + int c = part_classdata[0][class_set][i]; + #else + int c = classifications[0][pcount]; + #endif + int b = r->residue_books[c][pass]; + if (b >= 0) { + Codebook *book = f->codebooks + b; + #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK + if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) + goto done; + #else + // saves 1% + if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) + goto done; + #endif + } else { + z += r->part_size; + c_inter = z & 1; + p_inter = z >> 1; + } + } + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + ++class_set; + #endif + } + } else if (ch == 1) { + while (pcount < part_read) { + int z = r->begin + pcount*r->part_size; + int c_inter = 0, p_inter = z; + if (pass == 0) { + Codebook *c = f->codebooks+r->classbook; + int q; + DECODE(q,f,c); + if (q == EOP) goto done; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + part_classdata[0][class_set] = r->classdata[q]; + #else + for (i=classwords-1; i >= 0; --i) { + classifications[0][i+pcount] = q % r->classifications; + q /= r->classifications; + } + #endif + } + for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { + int z = r->begin + pcount*r->part_size; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + int c = part_classdata[0][class_set][i]; + #else + int c = classifications[0][pcount]; + #endif + int b = r->residue_books[c][pass]; + if (b >= 0) { + Codebook *book = f->codebooks + b; + if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) + goto done; + } else { + z += r->part_size; + c_inter = 0; + p_inter = z; + } + } + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + ++class_set; + #endif + } + } else { + while (pcount < part_read) { + int z = r->begin + pcount*r->part_size; + int c_inter = z % ch, p_inter = z/ch; + if (pass == 0) { + Codebook *c = f->codebooks+r->classbook; + int q; + DECODE(q,f,c); + if (q == EOP) goto done; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + part_classdata[0][class_set] = r->classdata[q]; + #else + for (i=classwords-1; i >= 0; --i) { + classifications[0][i+pcount] = q % r->classifications; + q /= r->classifications; + } + #endif + } + for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { + int z = r->begin + pcount*r->part_size; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + int c = part_classdata[0][class_set][i]; + #else + int c = classifications[0][pcount]; + #endif + int b = r->residue_books[c][pass]; + if (b >= 0) { + Codebook *book = f->codebooks + b; + if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) + goto done; + } else { + z += r->part_size; + c_inter = z % ch; + p_inter = z / ch; + } + } + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + ++class_set; + #endif + } + } + } + goto done; + } + CHECK(f); + + for (pass=0; pass < 8; ++pass) { + int pcount = 0, class_set=0; + while (pcount < part_read) { + if (pass == 0) { + for (j=0; j < ch; ++j) { + if (!do_not_decode[j]) { + Codebook *c = f->codebooks+r->classbook; + int temp; + DECODE(temp,f,c); + if (temp == EOP) goto done; + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + part_classdata[j][class_set] = r->classdata[temp]; + #else + for (i=classwords-1; i >= 0; --i) { + classifications[j][i+pcount] = temp % r->classifications; + temp /= r->classifications; + } + #endif + } + } + } + for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { + for (j=0; j < ch; ++j) { + if (!do_not_decode[j]) { + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + int c = part_classdata[j][class_set][i]; + #else + int c = classifications[j][pcount]; + #endif + int b = r->residue_books[c][pass]; + if (b >= 0) { + float *target = residue_buffers[j]; + int offset = r->begin + pcount * r->part_size; + int n = r->part_size; + Codebook *book = f->codebooks + b; + if (!residue_decode(f, book, target, offset, n, rtype)) + goto done; + } + } + } + } + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + ++class_set; + #endif + } + } + done: + CHECK(f); + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + temp_free(f,part_classdata); + #else + temp_free(f,classifications); + #endif + temp_alloc_restore(f,temp_alloc_point); +} + + +#if 0 +// slow way for debugging +void inverse_mdct_slow(float *buffer, int n) +{ + int i,j; + int n2 = n >> 1; + float *x = (float *) malloc(sizeof(*x) * n2); + memcpy(x, buffer, sizeof(*x) * n2); + for (i=0; i < n; ++i) { + float acc = 0; + for (j=0; j < n2; ++j) + // formula from paper: + //acc += n/4.0f * x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); + // formula from wikipedia + //acc += 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); + // these are equivalent, except the formula from the paper inverts the multiplier! + // however, what actually works is NO MULTIPLIER!?! + //acc += 64 * 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); + acc += x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); + buffer[i] = acc; + } + free(x); +} +#elif 0 +// same as above, but just barely able to run in real time on modern machines +void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) +{ + float mcos[16384]; + int i,j; + int n2 = n >> 1, nmask = (n << 2) -1; + float *x = (float *) malloc(sizeof(*x) * n2); + memcpy(x, buffer, sizeof(*x) * n2); + for (i=0; i < 4*n; ++i) + mcos[i] = (float) cos(M_PI / 2 * i / n); + + for (i=0; i < n; ++i) { + float acc = 0; + for (j=0; j < n2; ++j) + acc += x[j] * mcos[(2 * i + 1 + n2)*(2*j+1) & nmask]; + buffer[i] = acc; + } + free(x); +} +#elif 0 +// transform to use a slow dct-iv; this is STILL basically trivial, +// but only requires half as many ops +void dct_iv_slow(float *buffer, int n) +{ + float mcos[16384]; + float x[2048]; + int i,j; + int n2 = n >> 1, nmask = (n << 3) - 1; + memcpy(x, buffer, sizeof(*x) * n); + for (i=0; i < 8*n; ++i) + mcos[i] = (float) cos(M_PI / 4 * i / n); + for (i=0; i < n; ++i) { + float acc = 0; + for (j=0; j < n; ++j) + acc += x[j] * mcos[((2 * i + 1)*(2*j+1)) & nmask]; + buffer[i] = acc; + } +} + +void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) +{ + int i, n4 = n >> 2, n2 = n >> 1, n3_4 = n - n4; + float temp[4096]; + + memcpy(temp, buffer, n2 * sizeof(float)); + dct_iv_slow(temp, n2); // returns -c'-d, a-b' + + for (i=0; i < n4 ; ++i) buffer[i] = temp[i+n4]; // a-b' + for ( ; i < n3_4; ++i) buffer[i] = -temp[n3_4 - i - 1]; // b-a', c+d' + for ( ; i < n ; ++i) buffer[i] = -temp[i - n3_4]; // c'+d +} +#endif + +#ifndef LIBVORBIS_MDCT +#define LIBVORBIS_MDCT 0 +#endif + +#if LIBVORBIS_MDCT +// directly call the vorbis MDCT using an interface documented +// by Jeff Roberts... useful for performance comparison +typedef struct +{ + int n; + int log2n; + + float *trig; + int *bitrev; + + float scale; +} mdct_lookup; + +extern void mdct_init(mdct_lookup *lookup, int n); +extern void mdct_clear(mdct_lookup *l); +extern void mdct_backward(mdct_lookup *init, float *in, float *out); + +mdct_lookup M1,M2; + +void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) +{ + mdct_lookup *M; + if (M1.n == n) M = &M1; + else if (M2.n == n) M = &M2; + else if (M1.n == 0) { mdct_init(&M1, n); M = &M1; } + else { + if (M2.n) __asm int 3; + mdct_init(&M2, n); + M = &M2; + } + + mdct_backward(M, buffer, buffer); +} +#endif + + +// the following were split out into separate functions while optimizing; +// they could be pushed back up but eh. __forceinline showed no change; +// they're probably already being inlined. +static void imdct_step3_iter0_loop(int n, float *e, int i_off, int k_off, float *A) +{ + float *ee0 = e + i_off; + float *ee2 = ee0 + k_off; + int i; + + assert((n & 3) == 0); + for (i=(n>>2); i > 0; --i) { + float k00_20, k01_21; + k00_20 = ee0[ 0] - ee2[ 0]; + k01_21 = ee0[-1] - ee2[-1]; + ee0[ 0] += ee2[ 0];//ee0[ 0] = ee0[ 0] + ee2[ 0]; + ee0[-1] += ee2[-1];//ee0[-1] = ee0[-1] + ee2[-1]; + ee2[ 0] = k00_20 * A[0] - k01_21 * A[1]; + ee2[-1] = k01_21 * A[0] + k00_20 * A[1]; + A += 8; + + k00_20 = ee0[-2] - ee2[-2]; + k01_21 = ee0[-3] - ee2[-3]; + ee0[-2] += ee2[-2];//ee0[-2] = ee0[-2] + ee2[-2]; + ee0[-3] += ee2[-3];//ee0[-3] = ee0[-3] + ee2[-3]; + ee2[-2] = k00_20 * A[0] - k01_21 * A[1]; + ee2[-3] = k01_21 * A[0] + k00_20 * A[1]; + A += 8; + + k00_20 = ee0[-4] - ee2[-4]; + k01_21 = ee0[-5] - ee2[-5]; + ee0[-4] += ee2[-4];//ee0[-4] = ee0[-4] + ee2[-4]; + ee0[-5] += ee2[-5];//ee0[-5] = ee0[-5] + ee2[-5]; + ee2[-4] = k00_20 * A[0] - k01_21 * A[1]; + ee2[-5] = k01_21 * A[0] + k00_20 * A[1]; + A += 8; + + k00_20 = ee0[-6] - ee2[-6]; + k01_21 = ee0[-7] - ee2[-7]; + ee0[-6] += ee2[-6];//ee0[-6] = ee0[-6] + ee2[-6]; + ee0[-7] += ee2[-7];//ee0[-7] = ee0[-7] + ee2[-7]; + ee2[-6] = k00_20 * A[0] - k01_21 * A[1]; + ee2[-7] = k01_21 * A[0] + k00_20 * A[1]; + A += 8; + ee0 -= 8; + ee2 -= 8; + } +} + +static void imdct_step3_inner_r_loop(int lim, float *e, int d0, int k_off, float *A, int k1) +{ + int i; + float k00_20, k01_21; + + float *e0 = e + d0; + float *e2 = e0 + k_off; + + for (i=lim >> 2; i > 0; --i) { + k00_20 = e0[-0] - e2[-0]; + k01_21 = e0[-1] - e2[-1]; + e0[-0] += e2[-0];//e0[-0] = e0[-0] + e2[-0]; + e0[-1] += e2[-1];//e0[-1] = e0[-1] + e2[-1]; + e2[-0] = (k00_20)*A[0] - (k01_21) * A[1]; + e2[-1] = (k01_21)*A[0] + (k00_20) * A[1]; + + A += k1; + + k00_20 = e0[-2] - e2[-2]; + k01_21 = e0[-3] - e2[-3]; + e0[-2] += e2[-2];//e0[-2] = e0[-2] + e2[-2]; + e0[-3] += e2[-3];//e0[-3] = e0[-3] + e2[-3]; + e2[-2] = (k00_20)*A[0] - (k01_21) * A[1]; + e2[-3] = (k01_21)*A[0] + (k00_20) * A[1]; + + A += k1; + + k00_20 = e0[-4] - e2[-4]; + k01_21 = e0[-5] - e2[-5]; + e0[-4] += e2[-4];//e0[-4] = e0[-4] + e2[-4]; + e0[-5] += e2[-5];//e0[-5] = e0[-5] + e2[-5]; + e2[-4] = (k00_20)*A[0] - (k01_21) * A[1]; + e2[-5] = (k01_21)*A[0] + (k00_20) * A[1]; + + A += k1; + + k00_20 = e0[-6] - e2[-6]; + k01_21 = e0[-7] - e2[-7]; + e0[-6] += e2[-6];//e0[-6] = e0[-6] + e2[-6]; + e0[-7] += e2[-7];//e0[-7] = e0[-7] + e2[-7]; + e2[-6] = (k00_20)*A[0] - (k01_21) * A[1]; + e2[-7] = (k01_21)*A[0] + (k00_20) * A[1]; + + e0 -= 8; + e2 -= 8; + + A += k1; + } +} + +static void imdct_step3_inner_s_loop(int n, float *e, int i_off, int k_off, float *A, int a_off, int k0) +{ + int i; + float A0 = A[0]; + float A1 = A[0+1]; + float A2 = A[0+a_off]; + float A3 = A[0+a_off+1]; + float A4 = A[0+a_off*2+0]; + float A5 = A[0+a_off*2+1]; + float A6 = A[0+a_off*3+0]; + float A7 = A[0+a_off*3+1]; + + float k00,k11; + + float *ee0 = e +i_off; + float *ee2 = ee0+k_off; + + for (i=n; i > 0; --i) { + k00 = ee0[ 0] - ee2[ 0]; + k11 = ee0[-1] - ee2[-1]; + ee0[ 0] = ee0[ 0] + ee2[ 0]; + ee0[-1] = ee0[-1] + ee2[-1]; + ee2[ 0] = (k00) * A0 - (k11) * A1; + ee2[-1] = (k11) * A0 + (k00) * A1; + + k00 = ee0[-2] - ee2[-2]; + k11 = ee0[-3] - ee2[-3]; + ee0[-2] = ee0[-2] + ee2[-2]; + ee0[-3] = ee0[-3] + ee2[-3]; + ee2[-2] = (k00) * A2 - (k11) * A3; + ee2[-3] = (k11) * A2 + (k00) * A3; + + k00 = ee0[-4] - ee2[-4]; + k11 = ee0[-5] - ee2[-5]; + ee0[-4] = ee0[-4] + ee2[-4]; + ee0[-5] = ee0[-5] + ee2[-5]; + ee2[-4] = (k00) * A4 - (k11) * A5; + ee2[-5] = (k11) * A4 + (k00) * A5; + + k00 = ee0[-6] - ee2[-6]; + k11 = ee0[-7] - ee2[-7]; + ee0[-6] = ee0[-6] + ee2[-6]; + ee0[-7] = ee0[-7] + ee2[-7]; + ee2[-6] = (k00) * A6 - (k11) * A7; + ee2[-7] = (k11) * A6 + (k00) * A7; + + ee0 -= k0; + ee2 -= k0; + } +} + +static __forceinline void iter_54(float *z) +{ + float k00,k11,k22,k33; + float y0,y1,y2,y3; + + k00 = z[ 0] - z[-4]; + y0 = z[ 0] + z[-4]; + y2 = z[-2] + z[-6]; + k22 = z[-2] - z[-6]; + + z[-0] = y0 + y2; // z0 + z4 + z2 + z6 + z[-2] = y0 - y2; // z0 + z4 - z2 - z6 + + // done with y0,y2 + + k33 = z[-3] - z[-7]; + + z[-4] = k00 + k33; // z0 - z4 + z3 - z7 + z[-6] = k00 - k33; // z0 - z4 - z3 + z7 + + // done with k33 + + k11 = z[-1] - z[-5]; + y1 = z[-1] + z[-5]; + y3 = z[-3] + z[-7]; + + z[-1] = y1 + y3; // z1 + z5 + z3 + z7 + z[-3] = y1 - y3; // z1 + z5 - z3 - z7 + z[-5] = k11 - k22; // z1 - z5 + z2 - z6 + z[-7] = k11 + k22; // z1 - z5 - z2 + z6 +} + +static void imdct_step3_inner_s_loop_ld654(int n, float *e, int i_off, float *A, int base_n) +{ + int a_off = base_n >> 3; + float A2 = A[0+a_off]; + float *z = e + i_off; + float *base = z - 16 * n; + + while (z > base) { + float k00,k11; + + k00 = z[-0] - z[-8]; + k11 = z[-1] - z[-9]; + z[-0] = z[-0] + z[-8]; + z[-1] = z[-1] + z[-9]; + z[-8] = k00; + z[-9] = k11 ; + + k00 = z[ -2] - z[-10]; + k11 = z[ -3] - z[-11]; + z[ -2] = z[ -2] + z[-10]; + z[ -3] = z[ -3] + z[-11]; + z[-10] = (k00+k11) * A2; + z[-11] = (k11-k00) * A2; + + k00 = z[-12] - z[ -4]; // reverse to avoid a unary negation + k11 = z[ -5] - z[-13]; + z[ -4] = z[ -4] + z[-12]; + z[ -5] = z[ -5] + z[-13]; + z[-12] = k11; + z[-13] = k00; + + k00 = z[-14] - z[ -6]; // reverse to avoid a unary negation + k11 = z[ -7] - z[-15]; + z[ -6] = z[ -6] + z[-14]; + z[ -7] = z[ -7] + z[-15]; + z[-14] = (k00+k11) * A2; + z[-15] = (k00-k11) * A2; + + iter_54(z); + iter_54(z-8); + z -= 16; + } +} + +static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) +{ + int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; + int ld; + // @OPTIMIZE: reduce register pressure by using fewer variables? + int save_point = temp_alloc_save(f); + float *buf2 = (float *) temp_alloc(f, n2 * sizeof(*buf2)); + float *u=NULL,*v=NULL; + // twiddle factors + float *A = f->A[blocktype]; + + // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" + // See notes about bugs in that paper in less-optimal implementation 'inverse_mdct_old' after this function. + + // kernel from paper + + + // merged: + // copy and reflect spectral data + // step 0 + + // note that it turns out that the items added together during + // this step are, in fact, being added to themselves (as reflected + // by step 0). inexplicable inefficiency! this became obvious + // once I combined the passes. + + // so there's a missing 'times 2' here (for adding X to itself). + // this propogates through linearly to the end, where the numbers + // are 1/2 too small, and need to be compensated for. + + { + float *d,*e, *AA, *e_stop; + d = &buf2[n2-2]; + AA = A; + e = &buffer[0]; + e_stop = &buffer[n2]; + while (e != e_stop) { + d[1] = (e[0] * AA[0] - e[2]*AA[1]); + d[0] = (e[0] * AA[1] + e[2]*AA[0]); + d -= 2; + AA += 2; + e += 4; + } + + e = &buffer[n2-3]; + while (d >= buf2) { + d[1] = (-e[2] * AA[0] - -e[0]*AA[1]); + d[0] = (-e[2] * AA[1] + -e[0]*AA[0]); + d -= 2; + AA += 2; + e -= 4; + } + } + + // now we use symbolic names for these, so that we can + // possibly swap their meaning as we change which operations + // are in place + + u = buffer; + v = buf2; + + // step 2 (paper output is w, now u) + // this could be in place, but the data ends up in the wrong + // place... _somebody_'s got to swap it, so this is nominated + { + float *AA = &A[n2-8]; + float *d0,*d1, *e0, *e1; + + e0 = &v[n4]; + e1 = &v[0]; + + d0 = &u[n4]; + d1 = &u[0]; + + while (AA >= A) { + float v40_20, v41_21; + + v41_21 = e0[1] - e1[1]; + v40_20 = e0[0] - e1[0]; + d0[1] = e0[1] + e1[1]; + d0[0] = e0[0] + e1[0]; + d1[1] = v41_21*AA[4] - v40_20*AA[5]; + d1[0] = v40_20*AA[4] + v41_21*AA[5]; + + v41_21 = e0[3] - e1[3]; + v40_20 = e0[2] - e1[2]; + d0[3] = e0[3] + e1[3]; + d0[2] = e0[2] + e1[2]; + d1[3] = v41_21*AA[0] - v40_20*AA[1]; + d1[2] = v40_20*AA[0] + v41_21*AA[1]; + + AA -= 8; + + d0 += 4; + d1 += 4; + e0 += 4; + e1 += 4; + } + } + + // step 3 + ld = ilog(n) - 1; // ilog is off-by-one from normal definitions + + // optimized step 3: + + // the original step3 loop can be nested r inside s or s inside r; + // it's written originally as s inside r, but this is dumb when r + // iterates many times, and s few. So I have two copies of it and + // switch between them halfway. + + // this is iteration 0 of step 3 + imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*0, -(n >> 3), A); + imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*1, -(n >> 3), A); + + // this is iteration 1 of step 3 + imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*0, -(n >> 4), A, 16); + imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*1, -(n >> 4), A, 16); + imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*2, -(n >> 4), A, 16); + imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*3, -(n >> 4), A, 16); + + l=2; + for (; l < (ld-3)>>1; ++l) { + int k0 = n >> (l+2), k0_2 = k0>>1; + int lim = 1 << (l+1); + int i; + for (i=0; i < lim; ++i) + imdct_step3_inner_r_loop(n >> (l+4), u, n2-1 - k0*i, -k0_2, A, 1 << (l+3)); + } + + for (; l < ld-6; ++l) { + int k0 = n >> (l+2), k1 = 1 << (l+3), k0_2 = k0>>1; + int rlim = n >> (l+6), r; + int lim = 1 << (l+1); + int i_off; + float *A0 = A; + i_off = n2-1; + for (r=rlim; r > 0; --r) { + imdct_step3_inner_s_loop(lim, u, i_off, -k0_2, A0, k1, k0); + A0 += k1*4; + i_off -= 8; + } + } + + // iterations with count: + // ld-6,-5,-4 all interleaved together + // the big win comes from getting rid of needless flops + // due to the constants on pass 5 & 4 being all 1 and 0; + // combining them to be simultaneous to improve cache made little difference + imdct_step3_inner_s_loop_ld654(n >> 5, u, n2-1, A, n); + + // output is u + + // step 4, 5, and 6 + // cannot be in-place because of step 5 + { + uint16 *bitrev = f->bit_reverse[blocktype]; + // weirdly, I'd have thought reading sequentially and writing + // erratically would have been better than vice-versa, but in + // fact that's not what my testing showed. (That is, with + // j = bitreverse(i), do you read i and write j, or read j and write i.) + + float *d0 = &v[n4-4]; + float *d1 = &v[n2-4]; + while (d0 >= v) { + int k4; + + k4 = bitrev[0]; + d1[3] = u[k4+0]; + d1[2] = u[k4+1]; + d0[3] = u[k4+2]; + d0[2] = u[k4+3]; + + k4 = bitrev[1]; + d1[1] = u[k4+0]; + d1[0] = u[k4+1]; + d0[1] = u[k4+2]; + d0[0] = u[k4+3]; + + d0 -= 4; + d1 -= 4; + bitrev += 2; + } + } + // (paper output is u, now v) + + + // data must be in buf2 + assert(v == buf2); + + // step 7 (paper output is v, now v) + // this is now in place + { + float *C = f->C[blocktype]; + float *d, *e; + + d = v; + e = v + n2 - 4; + + while (d < e) { + float a02,a11,b0,b1,b2,b3; + + a02 = d[0] - e[2]; + a11 = d[1] + e[3]; + + b0 = C[1]*a02 + C[0]*a11; + b1 = C[1]*a11 - C[0]*a02; + + b2 = d[0] + e[ 2]; + b3 = d[1] - e[ 3]; + + d[0] = b2 + b0; + d[1] = b3 + b1; + e[2] = b2 - b0; + e[3] = b1 - b3; + + a02 = d[2] - e[0]; + a11 = d[3] + e[1]; + + b0 = C[3]*a02 + C[2]*a11; + b1 = C[3]*a11 - C[2]*a02; + + b2 = d[2] + e[ 0]; + b3 = d[3] - e[ 1]; + + d[2] = b2 + b0; + d[3] = b3 + b1; + e[0] = b2 - b0; + e[1] = b1 - b3; + + C += 4; + d += 4; + e -= 4; + } + } + + // data must be in buf2 + + + // step 8+decode (paper output is X, now buffer) + // this generates pairs of data a la 8 and pushes them directly through + // the decode kernel (pushing rather than pulling) to avoid having + // to make another pass later + + // this cannot POSSIBLY be in place, so we refer to the buffers directly + + { + float *d0,*d1,*d2,*d3; + + float *B = f->B[blocktype] + n2 - 8; + float *e = buf2 + n2 - 8; + d0 = &buffer[0]; + d1 = &buffer[n2-4]; + d2 = &buffer[n2]; + d3 = &buffer[n-4]; + while (e >= v) { + float p0,p1,p2,p3; + + p3 = e[6]*B[7] - e[7]*B[6]; + p2 = -e[6]*B[6] - e[7]*B[7]; + + d0[0] = p3; + d1[3] = - p3; + d2[0] = p2; + d3[3] = p2; + + p1 = e[4]*B[5] - e[5]*B[4]; + p0 = -e[4]*B[4] - e[5]*B[5]; + + d0[1] = p1; + d1[2] = - p1; + d2[1] = p0; + d3[2] = p0; + + p3 = e[2]*B[3] - e[3]*B[2]; + p2 = -e[2]*B[2] - e[3]*B[3]; + + d0[2] = p3; + d1[1] = - p3; + d2[2] = p2; + d3[1] = p2; + + p1 = e[0]*B[1] - e[1]*B[0]; + p0 = -e[0]*B[0] - e[1]*B[1]; + + d0[3] = p1; + d1[0] = - p1; + d2[3] = p0; + d3[0] = p0; + + B -= 8; + e -= 8; + d0 += 4; + d2 += 4; + d1 -= 4; + d3 -= 4; + } + } + + temp_free(f,buf2); + temp_alloc_restore(f,save_point); +} + +#if 0 +// this is the original version of the above code, if you want to optimize it from scratch +void inverse_mdct_naive(float *buffer, int n) +{ + float s; + float A[1 << 12], B[1 << 12], C[1 << 11]; + int i,k,k2,k4, n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; + int n3_4 = n - n4, ld; + // how can they claim this only uses N words?! + // oh, because they're only used sparsely, whoops + float u[1 << 13], X[1 << 13], v[1 << 13], w[1 << 13]; + // set up twiddle factors + + for (k=k2=0; k < n4; ++k,k2+=2) { + A[k2 ] = (float) cos(4*k*M_PI/n); + A[k2+1] = (float) -sin(4*k*M_PI/n); + B[k2 ] = (float) cos((k2+1)*M_PI/n/2); + B[k2+1] = (float) sin((k2+1)*M_PI/n/2); + } + for (k=k2=0; k < n8; ++k,k2+=2) { + C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); + C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); + } + + // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" + // Note there are bugs in that pseudocode, presumably due to them attempting + // to rename the arrays nicely rather than representing the way their actual + // implementation bounces buffers back and forth. As a result, even in the + // "some formulars corrected" version, a direct implementation fails. These + // are noted below as "paper bug". + + // copy and reflect spectral data + for (k=0; k < n2; ++k) u[k] = buffer[k]; + for ( ; k < n ; ++k) u[k] = -buffer[n - k - 1]; + // kernel from paper + // step 1 + for (k=k2=k4=0; k < n4; k+=1, k2+=2, k4+=4) { + v[n-k4-1] = (u[k4] - u[n-k4-1]) * A[k2] - (u[k4+2] - u[n-k4-3])*A[k2+1]; + v[n-k4-3] = (u[k4] - u[n-k4-1]) * A[k2+1] + (u[k4+2] - u[n-k4-3])*A[k2]; + } + // step 2 + for (k=k4=0; k < n8; k+=1, k4+=4) { + w[n2+3+k4] = v[n2+3+k4] + v[k4+3]; + w[n2+1+k4] = v[n2+1+k4] + v[k4+1]; + w[k4+3] = (v[n2+3+k4] - v[k4+3])*A[n2-4-k4] - (v[n2+1+k4]-v[k4+1])*A[n2-3-k4]; + w[k4+1] = (v[n2+1+k4] - v[k4+1])*A[n2-4-k4] + (v[n2+3+k4]-v[k4+3])*A[n2-3-k4]; + } + // step 3 + ld = ilog(n) - 1; // ilog is off-by-one from normal definitions + for (l=0; l < ld-3; ++l) { + int k0 = n >> (l+2), k1 = 1 << (l+3); + int rlim = n >> (l+4), r4, r; + int s2lim = 1 << (l+2), s2; + for (r=r4=0; r < rlim; r4+=4,++r) { + for (s2=0; s2 < s2lim; s2+=2) { + u[n-1-k0*s2-r4] = w[n-1-k0*s2-r4] + w[n-1-k0*(s2+1)-r4]; + u[n-3-k0*s2-r4] = w[n-3-k0*s2-r4] + w[n-3-k0*(s2+1)-r4]; + u[n-1-k0*(s2+1)-r4] = (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1] + - (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1+1]; + u[n-3-k0*(s2+1)-r4] = (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1] + + (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1+1]; + } + } + if (l+1 < ld-3) { + // paper bug: ping-ponging of u&w here is omitted + memcpy(w, u, sizeof(u)); + } + } + + // step 4 + for (i=0; i < n8; ++i) { + int j = bit_reverse(i) >> (32-ld+3); + assert(j < n8); + if (i == j) { + // paper bug: original code probably swapped in place; if copying, + // need to directly copy in this case + int i8 = i << 3; + v[i8+1] = u[i8+1]; + v[i8+3] = u[i8+3]; + v[i8+5] = u[i8+5]; + v[i8+7] = u[i8+7]; + } else if (i < j) { + int i8 = i << 3, j8 = j << 3; + v[j8+1] = u[i8+1], v[i8+1] = u[j8 + 1]; + v[j8+3] = u[i8+3], v[i8+3] = u[j8 + 3]; + v[j8+5] = u[i8+5], v[i8+5] = u[j8 + 5]; + v[j8+7] = u[i8+7], v[i8+7] = u[j8 + 7]; + } + } + // step 5 + for (k=0; k < n2; ++k) { + w[k] = v[k*2+1]; + } + // step 6 + for (k=k2=k4=0; k < n8; ++k, k2 += 2, k4 += 4) { + u[n-1-k2] = w[k4]; + u[n-2-k2] = w[k4+1]; + u[n3_4 - 1 - k2] = w[k4+2]; + u[n3_4 - 2 - k2] = w[k4+3]; + } + // step 7 + for (k=k2=0; k < n8; ++k, k2 += 2) { + v[n2 + k2 ] = ( u[n2 + k2] + u[n-2-k2] + C[k2+1]*(u[n2+k2]-u[n-2-k2]) + C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; + v[n-2 - k2] = ( u[n2 + k2] + u[n-2-k2] - C[k2+1]*(u[n2+k2]-u[n-2-k2]) - C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; + v[n2+1+ k2] = ( u[n2+1+k2] - u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; + v[n-1 - k2] = (-u[n2+1+k2] + u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; + } + // step 8 + for (k=k2=0; k < n4; ++k,k2 += 2) { + X[k] = v[k2+n2]*B[k2 ] + v[k2+1+n2]*B[k2+1]; + X[n2-1-k] = v[k2+n2]*B[k2+1] - v[k2+1+n2]*B[k2 ]; + } + + // decode kernel to output + // determined the following value experimentally + // (by first figuring out what made inverse_mdct_slow work); then matching that here + // (probably vorbis encoder premultiplies by n or n/2, to save it on the decoder?) + s = 0.5; // theoretically would be n4 + + // [[[ note! the s value of 0.5 is compensated for by the B[] in the current code, + // so it needs to use the "old" B values to behave correctly, or else + // set s to 1.0 ]]] + for (i=0; i < n4 ; ++i) buffer[i] = s * X[i+n4]; + for ( ; i < n3_4; ++i) buffer[i] = -s * X[n3_4 - i - 1]; + for ( ; i < n ; ++i) buffer[i] = -s * X[i - n3_4]; +} +#endif + +static float *get_window(vorb *f, int len) +{ + len <<= 1; + if (len == f->blocksize_0) return f->window[0]; + if (len == f->blocksize_1) return f->window[1]; + assert(0); + return NULL; +} + +#ifndef STB_VORBIS_NO_DEFER_FLOOR +typedef int16 YTYPE; +#else +typedef int YTYPE; +#endif +static int do_floor(vorb *f, Mapping *map, int i, int n, float *target, YTYPE *finalY, uint8 *step2_flag) +{ + int n2 = n >> 1; + int s = map->chan[i].mux, floor; + floor = map->submap_floor[s]; + if (f->floor_types[floor] == 0) { + return error(f, VORBIS_invalid_stream); + } else { + Floor1 *g = &f->floor_config[floor].floor1; + int j,q; + int lx = 0, ly = finalY[0] * g->floor1_multiplier; + for (q=1; q < g->values; ++q) { + j = g->sorted_order[q]; + #ifndef STB_VORBIS_NO_DEFER_FLOOR + if (finalY[j] >= 0) + #else + if (step2_flag[j]) + #endif + { + int hy = finalY[j] * g->floor1_multiplier; + int hx = g->Xlist[j]; + if (lx != hx) + draw_line(target, lx,ly, hx,hy, n2); + CHECK(f); + lx = hx, ly = hy; + } + } + if (lx < n2) { + // optimization of: draw_line(target, lx,ly, n,ly, n2); + for (j=lx; j < n2; ++j) + LINE_OP(target[j], inverse_db_table[ly]); + CHECK(f); + } + } + return TRUE; +} + +// The meaning of "left" and "right" +// +// For a given frame: +// we compute samples from 0..n +// window_center is n/2 +// we'll window and mix the samples from left_start to left_end with data from the previous frame +// all of the samples from left_end to right_start can be output without mixing; however, +// this interval is 0-length except when transitioning between short and long frames +// all of the samples from right_start to right_end need to be mixed with the next frame, +// which we don't have, so those get saved in a buffer +// frame N's right_end-right_start, the number of samples to mix with the next frame, +// has to be the same as frame N+1's left_end-left_start (which they are by +// construction) + +static int vorbis_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) +{ + Mode *m; + int i, n, prev, next, window_center; + f->channel_buffer_start = f->channel_buffer_end = 0; + + retry: + if (f->eof) return FALSE; + if (!maybe_start_packet(f)) + return FALSE; + // check packet type + if (get_bits(f,1) != 0) { + if (IS_PUSH_MODE(f)) + return error(f,VORBIS_bad_packet_type); + while (EOP != get8_packet(f)); + goto retry; + } + + if (f->alloc.alloc_buffer) + assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); + + i = get_bits(f, ilog(f->mode_count-1)); + if (i == EOP) return FALSE; + if (i >= f->mode_count) return FALSE; + *mode = i; + m = f->mode_config + i; + if (m->blockflag) { + n = f->blocksize_1; + prev = get_bits(f,1); + next = get_bits(f,1); + } else { + prev = next = 0; + n = f->blocksize_0; + } + +// WINDOWING + + window_center = n >> 1; + if (m->blockflag && !prev) { + *p_left_start = (n - f->blocksize_0) >> 2; + *p_left_end = (n + f->blocksize_0) >> 2; + } else { + *p_left_start = 0; + *p_left_end = window_center; + } + if (m->blockflag && !next) { + *p_right_start = (n*3 - f->blocksize_0) >> 2; + *p_right_end = (n*3 + f->blocksize_0) >> 2; + } else { + *p_right_start = window_center; + *p_right_end = n; + } + + return TRUE; +} + +static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start, int left_end, int right_start, int right_end, int *p_left) +{ + Mapping *map; + int i,j,k,n,n2; + int zero_channel[256]; + int really_zero_channel[256]; + +// WINDOWING + + n = f->blocksize[m->blockflag]; + map = &f->mapping[m->mapping]; + +// FLOORS + n2 = n >> 1; + + CHECK(f); + + for (i=0; i < f->channels; ++i) { + int s = map->chan[i].mux, floor; + zero_channel[i] = FALSE; + floor = map->submap_floor[s]; + if (f->floor_types[floor] == 0) { + return error(f, VORBIS_invalid_stream); + } else { + Floor1 *g = &f->floor_config[floor].floor1; + if (get_bits(f, 1)) { + short *finalY; + uint8 step2_flag[256]; + static int range_list[4] = { 256, 128, 86, 64 }; + int range = range_list[g->floor1_multiplier-1]; + int offset = 2; + finalY = f->finalY[i]; + finalY[0] = get_bits(f, ilog(range)-1); + finalY[1] = get_bits(f, ilog(range)-1); + for (j=0; j < g->partitions; ++j) { + int pclass = g->partition_class_list[j]; + int cdim = g->class_dimensions[pclass]; + int cbits = g->class_subclasses[pclass]; + int csub = (1 << cbits)-1; + int cval = 0; + if (cbits) { + Codebook *c = f->codebooks + g->class_masterbooks[pclass]; + DECODE(cval,f,c); + } + for (k=0; k < cdim; ++k) { + int book = g->subclass_books[pclass][cval & csub]; + cval = cval >> cbits; + if (book >= 0) { + int temp; + Codebook *c = f->codebooks + book; + DECODE(temp,f,c); + finalY[offset++] = temp; + } else + finalY[offset++] = 0; + } + } + if (f->valid_bits == INVALID_BITS) goto error; // behavior according to spec + step2_flag[0] = step2_flag[1] = 1; + for (j=2; j < g->values; ++j) { + int low, high, pred, highroom, lowroom, room, val; + low = g->neighbors[j][0]; + high = g->neighbors[j][1]; + //neighbors(g->Xlist, j, &low, &high); + pred = predict_point(g->Xlist[j], g->Xlist[low], g->Xlist[high], finalY[low], finalY[high]); + val = finalY[j]; + highroom = range - pred; + lowroom = pred; + if (highroom < lowroom) + room = highroom * 2; + else + room = lowroom * 2; + if (val) { + step2_flag[low] = step2_flag[high] = 1; + step2_flag[j] = 1; + if (val >= room) + if (highroom > lowroom) + finalY[j] = val - lowroom + pred; + else + finalY[j] = pred - val + highroom - 1; + else + if (val & 1) + finalY[j] = pred - ((val+1)>>1); + else + finalY[j] = pred + (val>>1); + } else { + step2_flag[j] = 0; + finalY[j] = pred; + } + } + +#ifdef STB_VORBIS_NO_DEFER_FLOOR + do_floor(f, map, i, n, f->floor_buffers[i], finalY, step2_flag); +#else + // defer final floor computation until _after_ residue + for (j=0; j < g->values; ++j) { + if (!step2_flag[j]) + finalY[j] = -1; + } +#endif + } else { + error: + zero_channel[i] = TRUE; + } + // So we just defer everything else to later + + // at this point we've decoded the floor into buffer + } + } + CHECK(f); + // at this point we've decoded all floors + + if (f->alloc.alloc_buffer) + assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); + + // re-enable coupled channels if necessary + memcpy(really_zero_channel, zero_channel, sizeof(really_zero_channel[0]) * f->channels); + for (i=0; i < map->coupling_steps; ++i) + if (!zero_channel[map->chan[i].magnitude] || !zero_channel[map->chan[i].angle]) { + zero_channel[map->chan[i].magnitude] = zero_channel[map->chan[i].angle] = FALSE; + } + + CHECK(f); +// RESIDUE DECODE + for (i=0; i < map->submaps; ++i) { + float *residue_buffers[STB_VORBIS_MAX_CHANNELS]; + int r; + uint8 do_not_decode[256]; + int ch = 0; + for (j=0; j < f->channels; ++j) { + if (map->chan[j].mux == i) { + if (zero_channel[j]) { + do_not_decode[ch] = TRUE; + residue_buffers[ch] = NULL; + } else { + do_not_decode[ch] = FALSE; + residue_buffers[ch] = f->channel_buffers[j]; + } + ++ch; + } + } + r = map->submap_residue[i]; + decode_residue(f, residue_buffers, ch, n2, r, do_not_decode); + } + + if (f->alloc.alloc_buffer) + assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); + CHECK(f); + +// INVERSE COUPLING + for (i = map->coupling_steps-1; i >= 0; --i) { + int n2 = n >> 1; + float *m = f->channel_buffers[map->chan[i].magnitude]; + float *a = f->channel_buffers[map->chan[i].angle ]; + for (j=0; j < n2; ++j) { + float a2,m2; + if (m[j] > 0) + if (a[j] > 0) + m2 = m[j], a2 = m[j] - a[j]; + else + a2 = m[j], m2 = m[j] + a[j]; + else + if (a[j] > 0) + m2 = m[j], a2 = m[j] + a[j]; + else + a2 = m[j], m2 = m[j] - a[j]; + m[j] = m2; + a[j] = a2; + } + } + CHECK(f); + + // finish decoding the floors +#ifndef STB_VORBIS_NO_DEFER_FLOOR + for (i=0; i < f->channels; ++i) { + if (really_zero_channel[i]) { + memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); + } else { + do_floor(f, map, i, n, f->channel_buffers[i], f->finalY[i], NULL); + } + } +#else + for (i=0; i < f->channels; ++i) { + if (really_zero_channel[i]) { + memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); + } else { + for (j=0; j < n2; ++j) + f->channel_buffers[i][j] *= f->floor_buffers[i][j]; + } + } +#endif + +// INVERSE MDCT + CHECK(f); + for (i=0; i < f->channels; ++i) + inverse_mdct(f->channel_buffers[i], n, f, m->blockflag); + CHECK(f); + + // this shouldn't be necessary, unless we exited on an error + // and want to flush to get to the next packet + flush_packet(f); + + if (f->first_decode) { + // assume we start so first non-discarded sample is sample 0 + // this isn't to spec, but spec would require us to read ahead + // and decode the size of all current frames--could be done, + // but presumably it's not a commonly used feature + f->current_loc = -n2; // start of first frame is positioned for discard + // we might have to discard samples "from" the next frame too, + // if we're lapping a large block then a small at the start? + f->discard_samples_deferred = n - right_end; + f->current_loc_valid = TRUE; + f->first_decode = FALSE; + } else if (f->discard_samples_deferred) { + if (f->discard_samples_deferred >= right_start - left_start) { + f->discard_samples_deferred -= (right_start - left_start); + left_start = right_start; + *p_left = left_start; + } else { + left_start += f->discard_samples_deferred; + *p_left = left_start; + f->discard_samples_deferred = 0; + } + } else if (f->previous_length == 0 && f->current_loc_valid) { + // we're recovering from a seek... that means we're going to discard + // the samples from this packet even though we know our position from + // the last page header, so we need to update the position based on + // the discarded samples here + // but wait, the code below is going to add this in itself even + // on a discard, so we don't need to do it here... + } + + // check if we have ogg information about the sample # for this packet + if (f->last_seg_which == f->end_seg_with_known_loc) { + // if we have a valid current loc, and this is final: + if (f->current_loc_valid && (f->page_flag & PAGEFLAG_last_page)) { + uint32 current_end = f->known_loc_for_packet - (n-right_end); + // then let's infer the size of the (probably) short final frame + if (current_end < f->current_loc + (right_end-left_start)) { + if (current_end < f->current_loc) { + // negative truncation, that's impossible! + *len = 0; + } else { + *len = current_end - f->current_loc; + } + *len += left_start; + if (*len > right_end) *len = right_end; // this should never happen + f->current_loc += *len; + return TRUE; + } + } + // otherwise, just set our sample loc + // guess that the ogg granule pos refers to the _middle_ of the + // last frame? + // set f->current_loc to the position of left_start + f->current_loc = f->known_loc_for_packet - (n2-left_start); + f->current_loc_valid = TRUE; + } + if (f->current_loc_valid) + f->current_loc += (right_start - left_start); + + if (f->alloc.alloc_buffer) + assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); + *len = right_end; // ignore samples after the window goes to 0 + CHECK(f); + + return TRUE; +} + +static int vorbis_decode_packet(vorb *f, int *len, int *p_left, int *p_right) +{ + int mode, left_end, right_end; + if (!vorbis_decode_initial(f, p_left, &left_end, p_right, &right_end, &mode)) return 0; + return vorbis_decode_packet_rest(f, len, f->mode_config + mode, *p_left, left_end, *p_right, right_end, p_left); +} + +static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right) +{ + int prev,i,j; + // we use right&left (the start of the right- and left-window sin()-regions) + // to determine how much to return, rather than inferring from the rules + // (same result, clearer code); 'left' indicates where our sin() window + // starts, therefore where the previous window's right edge starts, and + // therefore where to start mixing from the previous buffer. 'right' + // indicates where our sin() ending-window starts, therefore that's where + // we start saving, and where our returned-data ends. + + // mixin from previous window + if (f->previous_length) { + int i,j, n = f->previous_length; + float *w = get_window(f, n); + for (i=0; i < f->channels; ++i) { + for (j=0; j < n; ++j) + f->channel_buffers[i][left+j] = + f->channel_buffers[i][left+j]*w[ j] + + f->previous_window[i][ j]*w[n-1-j]; + } + } + + prev = f->previous_length; + + // last half of this data becomes previous window + f->previous_length = len - right; + + // @OPTIMIZE: could avoid this copy by double-buffering the + // output (flipping previous_window with channel_buffers), but + // then previous_window would have to be 2x as large, and + // channel_buffers couldn't be temp mem (although they're NOT + // currently temp mem, they could be (unless we want to level + // performance by spreading out the computation)) + for (i=0; i < f->channels; ++i) + for (j=0; right+j < len; ++j) + f->previous_window[i][j] = f->channel_buffers[i][right+j]; + + if (!prev) + // there was no previous packet, so this data isn't valid... + // this isn't entirely true, only the would-have-overlapped data + // isn't valid, but this seems to be what the spec requires + return 0; + + // truncate a short frame + if (len < right) right = len; + + f->samples_output += right-left; + + return right - left; +} + +static void vorbis_pump_first_frame(stb_vorbis *f) +{ + int len, right, left; + if (vorbis_decode_packet(f, &len, &left, &right)) + vorbis_finish_frame(f, len, left, right); +} + +#ifndef STB_VORBIS_NO_PUSHDATA_API +static int is_whole_packet_present(stb_vorbis *f, int end_page) +{ + // make sure that we have the packet available before continuing... + // this requires a full ogg parse, but we know we can fetch from f->stream + + // instead of coding this out explicitly, we could save the current read state, + // read the next packet with get8() until end-of-packet, check f->eof, then + // reset the state? but that would be slower, esp. since we'd have over 256 bytes + // of state to restore (primarily the page segment table) + + int s = f->next_seg, first = TRUE; + uint8 *p = f->stream; + + if (s != -1) { // if we're not starting the packet with a 'continue on next page' flag + for (; s < f->segment_count; ++s) { + p += f->segments[s]; + if (f->segments[s] < 255) // stop at first short segment + break; + } + // either this continues, or it ends it... + if (end_page) + if (s < f->segment_count-1) return error(f, VORBIS_invalid_stream); + if (s == f->segment_count) + s = -1; // set 'crosses page' flag + if (p > f->stream_end) return error(f, VORBIS_need_more_data); + first = FALSE; + } + for (; s == -1;) { + uint8 *q; + int n; + + // check that we have the page header ready + if (p + 26 >= f->stream_end) return error(f, VORBIS_need_more_data); + // validate the page + if (memcmp(p, ogg_page_header, 4)) return error(f, VORBIS_invalid_stream); + if (p[4] != 0) return error(f, VORBIS_invalid_stream); + if (first) { // the first segment must NOT have 'continued_packet', later ones MUST + if (f->previous_length) + if ((p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); + // if no previous length, we're resynching, so we can come in on a continued-packet, + // which we'll just drop + } else { + if (!(p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); + } + n = p[26]; // segment counts + q = p+27; // q points to segment table + p = q + n; // advance past header + // make sure we've read the segment table + if (p > f->stream_end) return error(f, VORBIS_need_more_data); + for (s=0; s < n; ++s) { + p += q[s]; + if (q[s] < 255) + break; + } + if (end_page) + if (s < n-1) return error(f, VORBIS_invalid_stream); + if (s == n) + s = -1; // set 'crosses page' flag + if (p > f->stream_end) return error(f, VORBIS_need_more_data); + first = FALSE; + } + return TRUE; +} +#endif // !STB_VORBIS_NO_PUSHDATA_API + +static int start_decoder(vorb *f) +{ + uint8 header[6], x,y; + int len,i,j,k, max_submaps = 0; + int longest_floorlist=0; + + // first page, first packet + + if (!start_page(f)) return FALSE; + // validate page flag + if (!(f->page_flag & PAGEFLAG_first_page)) return error(f, VORBIS_invalid_first_page); + if (f->page_flag & PAGEFLAG_last_page) return error(f, VORBIS_invalid_first_page); + if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page); + // check for expected packet length + if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page); + if (f->segments[0] != 30) return error(f, VORBIS_invalid_first_page); + // read packet + // check packet header + if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page); + if (!getn(f, header, 6)) return error(f, VORBIS_unexpected_eof); + if (!vorbis_validate(header)) return error(f, VORBIS_invalid_first_page); + // vorbis_version + if (get32(f) != 0) return error(f, VORBIS_invalid_first_page); + f->channels = get8(f); if (!f->channels) return error(f, VORBIS_invalid_first_page); + if (f->channels > STB_VORBIS_MAX_CHANNELS) return error(f, VORBIS_too_many_channels); + f->sample_rate = get32(f); if (!f->sample_rate) return error(f, VORBIS_invalid_first_page); + get32(f); // bitrate_maximum + get32(f); // bitrate_nominal + get32(f); // bitrate_minimum + x = get8(f); + { + int log0,log1; + log0 = x & 15; + log1 = x >> 4; + f->blocksize_0 = 1 << log0; + f->blocksize_1 = 1 << log1; + if (log0 < 6 || log0 > 13) return error(f, VORBIS_invalid_setup); + if (log1 < 6 || log1 > 13) return error(f, VORBIS_invalid_setup); + if (log0 > log1) return error(f, VORBIS_invalid_setup); + } + + // framing_flag + x = get8(f); + if (!(x & 1)) return error(f, VORBIS_invalid_first_page); + + // second packet! + if (!start_page(f)) return FALSE; + + if (!start_packet(f)) return FALSE; + do { + len = next_segment(f); + skip(f, len); + f->bytes_in_seg = 0; + } while (len); + + // third packet! + if (!start_packet(f)) return FALSE; + + #ifndef STB_VORBIS_NO_PUSHDATA_API + if (IS_PUSH_MODE(f)) { + if (!is_whole_packet_present(f, TRUE)) { + // convert error in ogg header to write type + if (f->error == VORBIS_invalid_stream) + f->error = VORBIS_invalid_setup; + return FALSE; + } + } + #endif + + crc32_init(); // always init it, to avoid multithread race conditions + + if (get8_packet(f) != VORBIS_packet_setup) return error(f, VORBIS_invalid_setup); + for (i=0; i < 6; ++i) header[i] = get8_packet(f); + if (!vorbis_validate(header)) return error(f, VORBIS_invalid_setup); + + // codebooks + + f->codebook_count = get_bits(f,8) + 1; + f->codebooks = (Codebook *) setup_malloc(f, sizeof(*f->codebooks) * f->codebook_count); + if (f->codebooks == NULL) return error(f, VORBIS_outofmem); + memset(f->codebooks, 0, sizeof(*f->codebooks) * f->codebook_count); + for (i=0; i < f->codebook_count; ++i) { + uint32 *values; + int ordered, sorted_count; + int total=0; + uint8 *lengths; + Codebook *c = f->codebooks+i; + CHECK(f); + x = get_bits(f, 8); if (x != 0x42) return error(f, VORBIS_invalid_setup); + x = get_bits(f, 8); if (x != 0x43) return error(f, VORBIS_invalid_setup); + x = get_bits(f, 8); if (x != 0x56) return error(f, VORBIS_invalid_setup); + x = get_bits(f, 8); + c->dimensions = (get_bits(f, 8)<<8) + x; + x = get_bits(f, 8); + y = get_bits(f, 8); + c->entries = (get_bits(f, 8)<<16) + (y<<8) + x; + ordered = get_bits(f,1); + c->sparse = ordered ? 0 : get_bits(f,1); + + if (c->dimensions == 0 && c->entries != 0) return error(f, VORBIS_invalid_setup); + + if (c->sparse) + lengths = (uint8 *) setup_temp_malloc(f, c->entries); + else + lengths = c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); + + if (!lengths) return error(f, VORBIS_outofmem); + + if (ordered) { + int current_entry = 0; + int current_length = get_bits(f,5) + 1; + while (current_entry < c->entries) { + int limit = c->entries - current_entry; + int n = get_bits(f, ilog(limit)); + if (current_entry + n > (int) c->entries) { return error(f, VORBIS_invalid_setup); } + memset(lengths + current_entry, current_length, n); + current_entry += n; + ++current_length; + } + } else { + for (j=0; j < c->entries; ++j) { + int present = c->sparse ? get_bits(f,1) : 1; + if (present) { + lengths[j] = get_bits(f, 5) + 1; + ++total; + if (lengths[j] == 32) + return error(f, VORBIS_invalid_setup); + } else { + lengths[j] = NO_CODE; + } + } + } + + if (c->sparse && total >= c->entries >> 2) { + // convert sparse items to non-sparse! + if (c->entries > (int) f->setup_temp_memory_required) + f->setup_temp_memory_required = c->entries; + + c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); + if (c->codeword_lengths == NULL) return error(f, VORBIS_outofmem); + memcpy(c->codeword_lengths, lengths, c->entries); + setup_temp_free(f, lengths, c->entries); // note this is only safe if there have been no intervening temp mallocs! + lengths = c->codeword_lengths; + c->sparse = 0; + } + + // compute the size of the sorted tables + if (c->sparse) { + sorted_count = total; + } else { + sorted_count = 0; + #ifndef STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH + for (j=0; j < c->entries; ++j) + if (lengths[j] > STB_VORBIS_FAST_HUFFMAN_LENGTH && lengths[j] != NO_CODE) + ++sorted_count; + #endif + } + + c->sorted_entries = sorted_count; + values = NULL; + + CHECK(f); + if (!c->sparse) { + c->codewords = (uint32 *) setup_malloc(f, sizeof(c->codewords[0]) * c->entries); + if (!c->codewords) return error(f, VORBIS_outofmem); + } else { + unsigned int size; + if (c->sorted_entries) { + c->codeword_lengths = (uint8 *) setup_malloc(f, c->sorted_entries); + if (!c->codeword_lengths) return error(f, VORBIS_outofmem); + c->codewords = (uint32 *) setup_temp_malloc(f, sizeof(*c->codewords) * c->sorted_entries); + if (!c->codewords) return error(f, VORBIS_outofmem); + values = (uint32 *) setup_temp_malloc(f, sizeof(*values) * c->sorted_entries); + if (!values) return error(f, VORBIS_outofmem); + } + size = c->entries + (sizeof(*c->codewords) + sizeof(*values)) * c->sorted_entries; + if (size > f->setup_temp_memory_required) + f->setup_temp_memory_required = size; + } + + if (!compute_codewords(c, lengths, c->entries, values)) { + if (c->sparse) setup_temp_free(f, values, 0); + return error(f, VORBIS_invalid_setup); + } + + if (c->sorted_entries) { + // allocate an extra slot for sentinels + c->sorted_codewords = (uint32 *) setup_malloc(f, sizeof(*c->sorted_codewords) * (c->sorted_entries+1)); + if (c->sorted_codewords == NULL) return error(f, VORBIS_outofmem); + // allocate an extra slot at the front so that c->sorted_values[-1] is defined + // so that we can catch that case without an extra if + c->sorted_values = ( int *) setup_malloc(f, sizeof(*c->sorted_values ) * (c->sorted_entries+1)); + if (c->sorted_values == NULL) return error(f, VORBIS_outofmem); + ++c->sorted_values; + c->sorted_values[-1] = -1; + compute_sorted_huffman(c, lengths, values); + } + + if (c->sparse) { + setup_temp_free(f, values, sizeof(*values)*c->sorted_entries); + setup_temp_free(f, c->codewords, sizeof(*c->codewords)*c->sorted_entries); + setup_temp_free(f, lengths, c->entries); + c->codewords = NULL; + } + + compute_accelerated_huffman(c); + + CHECK(f); + c->lookup_type = get_bits(f, 4); + if (c->lookup_type > 2) return error(f, VORBIS_invalid_setup); + if (c->lookup_type > 0) { + uint16 *mults; + c->minimum_value = float32_unpack(get_bits(f, 32)); + c->delta_value = float32_unpack(get_bits(f, 32)); + c->value_bits = get_bits(f, 4)+1; + c->sequence_p = get_bits(f,1); + if (c->lookup_type == 1) { + c->lookup_values = lookup1_values(c->entries, c->dimensions); + } else { + c->lookup_values = c->entries * c->dimensions; + } + if (c->lookup_values == 0) return error(f, VORBIS_invalid_setup); + mults = (uint16 *) setup_temp_malloc(f, sizeof(mults[0]) * c->lookup_values); + if (mults == NULL) return error(f, VORBIS_outofmem); + for (j=0; j < (int) c->lookup_values; ++j) { + int q = get_bits(f, c->value_bits); + if (q == EOP) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_invalid_setup); } + mults[j] = q; + } + +#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK + if (c->lookup_type == 1) { + int len, sparse = c->sparse; + float last=0; + // pre-expand the lookup1-style multiplicands, to avoid a divide in the inner loop + if (sparse) { + if (c->sorted_entries == 0) goto skip; + c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->sorted_entries * c->dimensions); + } else + c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->entries * c->dimensions); + if (c->multiplicands == NULL) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } + len = sparse ? c->sorted_entries : c->entries; + for (j=0; j < len; ++j) { + unsigned int z = sparse ? c->sorted_values[j] : j; + unsigned int div=1; + for (k=0; k < c->dimensions; ++k) { + int off = (z / div) % c->lookup_values; + float val = mults[off]; + val = mults[off]*c->delta_value + c->minimum_value + last; + c->multiplicands[j*c->dimensions + k] = val; + if (c->sequence_p) + last = val; + if (k+1 < c->dimensions) { + if (div > UINT_MAX / (unsigned int) c->lookup_values) { + setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); + return error(f, VORBIS_invalid_setup); + } + div *= c->lookup_values; + } + } + } + c->lookup_type = 2; + } + else +#endif + { + float last=0; + CHECK(f); + c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->lookup_values); + if (c->multiplicands == NULL) { setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } + for (j=0; j < (int) c->lookup_values; ++j) { + float val = mults[j] * c->delta_value + c->minimum_value + last; + c->multiplicands[j] = val; + if (c->sequence_p) + last = val; + } + } +#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK + skip:; +#endif + setup_temp_free(f, mults, sizeof(mults[0])*c->lookup_values); + + CHECK(f); + } + CHECK(f); + } + + // time domain transfers (notused) + + x = get_bits(f, 6) + 1; + for (i=0; i < x; ++i) { + uint32 z = get_bits(f, 16); + if (z != 0) return error(f, VORBIS_invalid_setup); + } + + // Floors + f->floor_count = get_bits(f, 6)+1; + f->floor_config = (Floor *) setup_malloc(f, f->floor_count * sizeof(*f->floor_config)); + if (f->floor_config == NULL) return error(f, VORBIS_outofmem); + for (i=0; i < f->floor_count; ++i) { + f->floor_types[i] = get_bits(f, 16); + if (f->floor_types[i] > 1) return error(f, VORBIS_invalid_setup); + if (f->floor_types[i] == 0) { + Floor0 *g = &f->floor_config[i].floor0; + g->order = get_bits(f,8); + g->rate = get_bits(f,16); + g->bark_map_size = get_bits(f,16); + g->amplitude_bits = get_bits(f,6); + g->amplitude_offset = get_bits(f,8); + g->number_of_books = get_bits(f,4) + 1; + for (j=0; j < g->number_of_books; ++j) + g->book_list[j] = get_bits(f,8); + return error(f, VORBIS_feature_not_supported); + } else { + Point p[31*8+2]; + Floor1 *g = &f->floor_config[i].floor1; + int max_class = -1; + g->partitions = get_bits(f, 5); + for (j=0; j < g->partitions; ++j) { + g->partition_class_list[j] = get_bits(f, 4); + if (g->partition_class_list[j] > max_class) + max_class = g->partition_class_list[j]; + } + for (j=0; j <= max_class; ++j) { + g->class_dimensions[j] = get_bits(f, 3)+1; + g->class_subclasses[j] = get_bits(f, 2); + if (g->class_subclasses[j]) { + g->class_masterbooks[j] = get_bits(f, 8); + if (g->class_masterbooks[j] >= f->codebook_count) return error(f, VORBIS_invalid_setup); + } + for (k=0; k < 1 << g->class_subclasses[j]; ++k) { + g->subclass_books[j][k] = get_bits(f,8)-1; + if (g->subclass_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); + } + } + g->floor1_multiplier = get_bits(f,2)+1; + g->rangebits = get_bits(f,4); + g->Xlist[0] = 0; + g->Xlist[1] = 1 << g->rangebits; + g->values = 2; + for (j=0; j < g->partitions; ++j) { + int c = g->partition_class_list[j]; + for (k=0; k < g->class_dimensions[c]; ++k) { + g->Xlist[g->values] = get_bits(f, g->rangebits); + ++g->values; + } + } + // precompute the sorting + for (j=0; j < g->values; ++j) { + p[j].x = g->Xlist[j]; + p[j].y = j; + } + qsort(p, g->values, sizeof(p[0]), point_compare); + for (j=0; j < g->values; ++j) + g->sorted_order[j] = (uint8) p[j].y; + // precompute the neighbors + for (j=2; j < g->values; ++j) { + int low,hi; + neighbors(g->Xlist, j, &low,&hi); + g->neighbors[j][0] = low; + g->neighbors[j][1] = hi; + } + + if (g->values > longest_floorlist) + longest_floorlist = g->values; + } + } + + // Residue + f->residue_count = get_bits(f, 6)+1; + f->residue_config = (Residue *) setup_malloc(f, f->residue_count * sizeof(f->residue_config[0])); + if (f->residue_config == NULL) return error(f, VORBIS_outofmem); + memset(f->residue_config, 0, f->residue_count * sizeof(f->residue_config[0])); + for (i=0; i < f->residue_count; ++i) { + uint8 residue_cascade[64]; + Residue *r = f->residue_config+i; + f->residue_types[i] = get_bits(f, 16); + if (f->residue_types[i] > 2) return error(f, VORBIS_invalid_setup); + r->begin = get_bits(f, 24); + r->end = get_bits(f, 24); + if (r->end < r->begin) return error(f, VORBIS_invalid_setup); + r->part_size = get_bits(f,24)+1; + r->classifications = get_bits(f,6)+1; + r->classbook = get_bits(f,8); + if (r->classbook >= f->codebook_count) return error(f, VORBIS_invalid_setup); + for (j=0; j < r->classifications; ++j) { + uint8 high_bits=0; + uint8 low_bits=get_bits(f,3); + if (get_bits(f,1)) + high_bits = get_bits(f,5); + residue_cascade[j] = high_bits*8 + low_bits; + } + r->residue_books = (short (*)[8]) setup_malloc(f, sizeof(r->residue_books[0]) * r->classifications); + if (r->residue_books == NULL) return error(f, VORBIS_outofmem); + for (j=0; j < r->classifications; ++j) { + for (k=0; k < 8; ++k) { + if (residue_cascade[j] & (1 << k)) { + r->residue_books[j][k] = get_bits(f, 8); + if (r->residue_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); + } else { + r->residue_books[j][k] = -1; + } + } + } + // precompute the classifications[] array to avoid inner-loop mod/divide + // call it 'classdata' since we already have r->classifications + r->classdata = (uint8 **) setup_malloc(f, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); + if (!r->classdata) return error(f, VORBIS_outofmem); + memset(r->classdata, 0, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); + for (j=0; j < f->codebooks[r->classbook].entries; ++j) { + int classwords = f->codebooks[r->classbook].dimensions; + int temp = j; + r->classdata[j] = (uint8 *) setup_malloc(f, sizeof(r->classdata[j][0]) * classwords); + if (r->classdata[j] == NULL) return error(f, VORBIS_outofmem); + for (k=classwords-1; k >= 0; --k) { + r->classdata[j][k] = temp % r->classifications; + temp /= r->classifications; + } + } + } + + f->mapping_count = get_bits(f,6)+1; + f->mapping = (Mapping *) setup_malloc(f, f->mapping_count * sizeof(*f->mapping)); + if (f->mapping == NULL) return error(f, VORBIS_outofmem); + memset(f->mapping, 0, f->mapping_count * sizeof(*f->mapping)); + for (i=0; i < f->mapping_count; ++i) { + Mapping *m = f->mapping + i; + int mapping_type = get_bits(f,16); + if (mapping_type != 0) return error(f, VORBIS_invalid_setup); + m->chan = (MappingChannel *) setup_malloc(f, f->channels * sizeof(*m->chan)); + if (m->chan == NULL) return error(f, VORBIS_outofmem); + if (get_bits(f,1)) + m->submaps = get_bits(f,4)+1; + else + m->submaps = 1; + if (m->submaps > max_submaps) + max_submaps = m->submaps; + if (get_bits(f,1)) { + m->coupling_steps = get_bits(f,8)+1; + for (k=0; k < m->coupling_steps; ++k) { + m->chan[k].magnitude = get_bits(f, ilog(f->channels-1)); + m->chan[k].angle = get_bits(f, ilog(f->channels-1)); + if (m->chan[k].magnitude >= f->channels) return error(f, VORBIS_invalid_setup); + if (m->chan[k].angle >= f->channels) return error(f, VORBIS_invalid_setup); + if (m->chan[k].magnitude == m->chan[k].angle) return error(f, VORBIS_invalid_setup); + } + } else + m->coupling_steps = 0; + + // reserved field + if (get_bits(f,2)) return error(f, VORBIS_invalid_setup); + if (m->submaps > 1) { + for (j=0; j < f->channels; ++j) { + m->chan[j].mux = get_bits(f, 4); + if (m->chan[j].mux >= m->submaps) return error(f, VORBIS_invalid_setup); + } + } else + // @SPECIFICATION: this case is missing from the spec + for (j=0; j < f->channels; ++j) + m->chan[j].mux = 0; + + for (j=0; j < m->submaps; ++j) { + get_bits(f,8); // discard + m->submap_floor[j] = get_bits(f,8); + m->submap_residue[j] = get_bits(f,8); + if (m->submap_floor[j] >= f->floor_count) return error(f, VORBIS_invalid_setup); + if (m->submap_residue[j] >= f->residue_count) return error(f, VORBIS_invalid_setup); + } + } + + // Modes + f->mode_count = get_bits(f, 6)+1; + for (i=0; i < f->mode_count; ++i) { + Mode *m = f->mode_config+i; + m->blockflag = get_bits(f,1); + m->windowtype = get_bits(f,16); + m->transformtype = get_bits(f,16); + m->mapping = get_bits(f,8); + if (m->windowtype != 0) return error(f, VORBIS_invalid_setup); + if (m->transformtype != 0) return error(f, VORBIS_invalid_setup); + if (m->mapping >= f->mapping_count) return error(f, VORBIS_invalid_setup); + } + + flush_packet(f); + + f->previous_length = 0; + + for (i=0; i < f->channels; ++i) { + f->channel_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1); + f->previous_window[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); + f->finalY[i] = (int16 *) setup_malloc(f, sizeof(int16) * longest_floorlist); + if (f->channel_buffers[i] == NULL || f->previous_window[i] == NULL || f->finalY[i] == NULL) return error(f, VORBIS_outofmem); + #ifdef STB_VORBIS_NO_DEFER_FLOOR + f->floor_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); + if (f->floor_buffers[i] == NULL) return error(f, VORBIS_outofmem); + #endif + } + + if (!init_blocksize(f, 0, f->blocksize_0)) return FALSE; + if (!init_blocksize(f, 1, f->blocksize_1)) return FALSE; + f->blocksize[0] = f->blocksize_0; + f->blocksize[1] = f->blocksize_1; + +#ifdef STB_VORBIS_DIVIDE_TABLE + if (integer_divide_table[1][1]==0) + for (i=0; i < DIVTAB_NUMER; ++i) + for (j=1; j < DIVTAB_DENOM; ++j) + integer_divide_table[i][j] = i / j; +#endif + + // compute how much temporary memory is needed + + // 1. + { + uint32 imdct_mem = (f->blocksize_1 * sizeof(float) >> 1); + uint32 classify_mem; + int i,max_part_read=0; + for (i=0; i < f->residue_count; ++i) { + Residue *r = f->residue_config + i; + int n_read = r->end - r->begin; + int part_read = n_read / r->part_size; + if (part_read > max_part_read) + max_part_read = part_read; + } + #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE + classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(uint8 *)); + #else + classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(int *)); + #endif + + f->temp_memory_required = classify_mem; + if (imdct_mem > f->temp_memory_required) + f->temp_memory_required = imdct_mem; + } + + f->first_decode = TRUE; + + if (f->alloc.alloc_buffer) { + assert(f->temp_offset == f->alloc.alloc_buffer_length_in_bytes); + // check if there's enough temp memory so we don't error later + if (f->setup_offset + sizeof(*f) + f->temp_memory_required > (unsigned) f->temp_offset) + return error(f, VORBIS_outofmem); + } + + f->first_audio_page_offset = stb_vorbis_get_file_offset(f); + + return TRUE; +} + +static void vorbis_deinit(stb_vorbis *p) +{ + int i,j; + if (p->residue_config) { + for (i=0; i < p->residue_count; ++i) { + Residue *r = p->residue_config+i; + if (r->classdata) { + for (j=0; j < p->codebooks[r->classbook].entries; ++j) + setup_free(p, r->classdata[j]); + setup_free(p, r->classdata); + } + setup_free(p, r->residue_books); + } + } + + if (p->codebooks) { + CHECK(p); + for (i=0; i < p->codebook_count; ++i) { + Codebook *c = p->codebooks + i; + setup_free(p, c->codeword_lengths); + setup_free(p, c->multiplicands); + setup_free(p, c->codewords); + setup_free(p, c->sorted_codewords); + // c->sorted_values[-1] is the first entry in the array + setup_free(p, c->sorted_values ? c->sorted_values-1 : NULL); + } + setup_free(p, p->codebooks); + } + setup_free(p, p->floor_config); + setup_free(p, p->residue_config); + if (p->mapping) { + for (i=0; i < p->mapping_count; ++i) + setup_free(p, p->mapping[i].chan); + setup_free(p, p->mapping); + } + CHECK(p); + for (i=0; i < p->channels && i < STB_VORBIS_MAX_CHANNELS; ++i) { + setup_free(p, p->channel_buffers[i]); + setup_free(p, p->previous_window[i]); + #ifdef STB_VORBIS_NO_DEFER_FLOOR + setup_free(p, p->floor_buffers[i]); + #endif + setup_free(p, p->finalY[i]); + } + for (i=0; i < 2; ++i) { + setup_free(p, p->A[i]); + setup_free(p, p->B[i]); + setup_free(p, p->C[i]); + setup_free(p, p->window[i]); + setup_free(p, p->bit_reverse[i]); + } + #ifndef STB_VORBIS_NO_STDIO + if (p->close_on_free) fclose(p->f); + #endif +} + +void stb_vorbis_close(stb_vorbis *p) +{ + if (p == NULL) return; + vorbis_deinit(p); + setup_free(p,p); +} + +static void vorbis_init(stb_vorbis *p, const stb_vorbis_alloc *z) +{ + memset(p, 0, sizeof(*p)); // NULL out all malloc'd pointers to start + if (z) { + p->alloc = *z; + p->alloc.alloc_buffer_length_in_bytes = (p->alloc.alloc_buffer_length_in_bytes+3) & ~3; + p->temp_offset = p->alloc.alloc_buffer_length_in_bytes; + } + p->eof = 0; + p->error = VORBIS__no_error; + p->stream = NULL; + p->codebooks = NULL; + p->page_crc_tests = -1; + #ifndef STB_VORBIS_NO_STDIO + p->close_on_free = FALSE; + p->f = NULL; + #endif +} + +int stb_vorbis_get_sample_offset(stb_vorbis *f) +{ + if (f->current_loc_valid) + return f->current_loc; + else + return -1; +} + +stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f) +{ + stb_vorbis_info d; + d.channels = f->channels; + d.sample_rate = f->sample_rate; + d.setup_memory_required = f->setup_memory_required; + d.setup_temp_memory_required = f->setup_temp_memory_required; + d.temp_memory_required = f->temp_memory_required; + d.max_frame_size = f->blocksize_1 >> 1; + return d; +} + +int stb_vorbis_get_error(stb_vorbis *f) +{ + int e = f->error; + f->error = VORBIS__no_error; + return e; +} + +static stb_vorbis * vorbis_alloc(stb_vorbis *f) +{ + stb_vorbis *p = (stb_vorbis *) setup_malloc(f, sizeof(*p)); + return p; +} + +#ifndef STB_VORBIS_NO_PUSHDATA_API + +void stb_vorbis_flush_pushdata(stb_vorbis *f) +{ + f->previous_length = 0; + f->page_crc_tests = 0; + f->discard_samples_deferred = 0; + f->current_loc_valid = FALSE; + f->first_decode = FALSE; + f->samples_output = 0; + f->channel_buffer_start = 0; + f->channel_buffer_end = 0; +} + +static int vorbis_search_for_page_pushdata(vorb *f, uint8 *data, int data_len) +{ + int i,n; + for (i=0; i < f->page_crc_tests; ++i) + f->scan[i].bytes_done = 0; + + // if we have room for more scans, search for them first, because + // they may cause us to stop early if their header is incomplete + if (f->page_crc_tests < STB_VORBIS_PUSHDATA_CRC_COUNT) { + if (data_len < 4) return 0; + data_len -= 3; // need to look for 4-byte sequence, so don't miss + // one that straddles a boundary + for (i=0; i < data_len; ++i) { + if (data[i] == 0x4f) { + if (0==memcmp(data+i, ogg_page_header, 4)) { + int j,len; + uint32 crc; + // make sure we have the whole page header + if (i+26 >= data_len || i+27+data[i+26] >= data_len) { + // only read up to this page start, so hopefully we'll + // have the whole page header start next time + data_len = i; + break; + } + // ok, we have it all; compute the length of the page + len = 27 + data[i+26]; + for (j=0; j < data[i+26]; ++j) + len += data[i+27+j]; + // scan everything up to the embedded crc (which we must 0) + crc = 0; + for (j=0; j < 22; ++j) + crc = crc32_update(crc, data[i+j]); + // now process 4 0-bytes + for ( ; j < 26; ++j) + crc = crc32_update(crc, 0); + // len is the total number of bytes we need to scan + n = f->page_crc_tests++; + f->scan[n].bytes_left = len-j; + f->scan[n].crc_so_far = crc; + f->scan[n].goal_crc = data[i+22] + (data[i+23] << 8) + (data[i+24]<<16) + (data[i+25]<<24); + // if the last frame on a page is continued to the next, then + // we can't recover the sample_loc immediately + if (data[i+27+data[i+26]-1] == 255) + f->scan[n].sample_loc = ~0; + else + f->scan[n].sample_loc = data[i+6] + (data[i+7] << 8) + (data[i+ 8]<<16) + (data[i+ 9]<<24); + f->scan[n].bytes_done = i+j; + if (f->page_crc_tests == STB_VORBIS_PUSHDATA_CRC_COUNT) + break; + // keep going if we still have room for more + } + } + } + } + + for (i=0; i < f->page_crc_tests;) { + uint32 crc; + int j; + int n = f->scan[i].bytes_done; + int m = f->scan[i].bytes_left; + if (m > data_len - n) m = data_len - n; + // m is the bytes to scan in the current chunk + crc = f->scan[i].crc_so_far; + for (j=0; j < m; ++j) + crc = crc32_update(crc, data[n+j]); + f->scan[i].bytes_left -= m; + f->scan[i].crc_so_far = crc; + if (f->scan[i].bytes_left == 0) { + // does it match? + if (f->scan[i].crc_so_far == f->scan[i].goal_crc) { + // Houston, we have page + data_len = n+m; // consumption amount is wherever that scan ended + f->page_crc_tests = -1; // drop out of page scan mode + f->previous_length = 0; // decode-but-don't-output one frame + f->next_seg = -1; // start a new page + f->current_loc = f->scan[i].sample_loc; // set the current sample location + // to the amount we'd have decoded had we decoded this page + f->current_loc_valid = f->current_loc != ~0U; + return data_len; + } + // delete entry + f->scan[i] = f->scan[--f->page_crc_tests]; + } else { + ++i; + } + } + + return data_len; +} + +// return value: number of bytes we used +int stb_vorbis_decode_frame_pushdata( + stb_vorbis *f, // the file we're decoding + const uint8 *data, int data_len, // the memory available for decoding + int *channels, // place to write number of float * buffers + float ***output, // place to write float ** array of float * buffers + int *samples // place to write number of output samples + ) +{ + int i; + int len,right,left; + + if (!IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); + + if (f->page_crc_tests >= 0) { + *samples = 0; + return vorbis_search_for_page_pushdata(f, (uint8 *) data, data_len); + } + + f->stream = (uint8 *) data; + f->stream_end = (uint8 *) data + data_len; + f->error = VORBIS__no_error; + + // check that we have the entire packet in memory + if (!is_whole_packet_present(f, FALSE)) { + *samples = 0; + return 0; + } + + if (!vorbis_decode_packet(f, &len, &left, &right)) { + // save the actual error we encountered + enum STBVorbisError error = f->error; + if (error == VORBIS_bad_packet_type) { + // flush and resynch + f->error = VORBIS__no_error; + while (get8_packet(f) != EOP) + if (f->eof) break; + *samples = 0; + return (int) (f->stream - data); + } + if (error == VORBIS_continued_packet_flag_invalid) { + if (f->previous_length == 0) { + // we may be resynching, in which case it's ok to hit one + // of these; just discard the packet + f->error = VORBIS__no_error; + while (get8_packet(f) != EOP) + if (f->eof) break; + *samples = 0; + return (int) (f->stream - data); + } + } + // if we get an error while parsing, what to do? + // well, it DEFINITELY won't work to continue from where we are! + stb_vorbis_flush_pushdata(f); + // restore the error that actually made us bail + f->error = error; + *samples = 0; + return 1; + } + + // success! + len = vorbis_finish_frame(f, len, left, right); + for (i=0; i < f->channels; ++i) + f->outputs[i] = f->channel_buffers[i] + left; + + if (channels) *channels = f->channels; + *samples = len; + *output = f->outputs; + return (int) (f->stream - data); +} + +stb_vorbis *stb_vorbis_open_pushdata( + const unsigned char *data, int data_len, // the memory available for decoding + int *data_used, // only defined if result is not NULL + int *error, const stb_vorbis_alloc *alloc) +{ + stb_vorbis *f, p; + vorbis_init(&p, alloc); + p.stream = (uint8 *) data; + p.stream_end = (uint8 *) data + data_len; + p.push_mode = TRUE; + if (!start_decoder(&p)) { + if (p.eof) + *error = VORBIS_need_more_data; + else + *error = p.error; + return NULL; + } + f = vorbis_alloc(&p); + if (f) { + *f = p; + *data_used = (int) (f->stream - data); + *error = 0; + return f; + } else { + vorbis_deinit(&p); + return NULL; + } +} +#endif // STB_VORBIS_NO_PUSHDATA_API + +unsigned int stb_vorbis_get_file_offset(stb_vorbis *f) +{ + #ifndef STB_VORBIS_NO_PUSHDATA_API + if (f->push_mode) return 0; + #endif + if (USE_MEMORY(f)) return (unsigned int) (f->stream - f->stream_start); + #ifndef STB_VORBIS_NO_STDIO + return (unsigned int) (ftell(f->f) - f->f_start); + #endif +} + +#ifndef STB_VORBIS_NO_PULLDATA_API +// +// DATA-PULLING API +// + +static uint32 vorbis_find_page(stb_vorbis *f, uint32 *end, uint32 *last) +{ + for(;;) { + int n; + if (f->eof) return 0; + n = get8(f); + if (n == 0x4f) { // page header candidate + unsigned int retry_loc = stb_vorbis_get_file_offset(f); + int i; + // check if we're off the end of a file_section stream + if (retry_loc - 25 > f->stream_len) + return 0; + // check the rest of the header + for (i=1; i < 4; ++i) + if (get8(f) != ogg_page_header[i]) + break; + if (f->eof) return 0; + if (i == 4) { + uint8 header[27]; + uint32 i, crc, goal, len; + for (i=0; i < 4; ++i) + header[i] = ogg_page_header[i]; + for (; i < 27; ++i) + header[i] = get8(f); + if (f->eof) return 0; + if (header[4] != 0) goto invalid; + goal = header[22] + (header[23] << 8) + (header[24]<<16) + (header[25]<<24); + for (i=22; i < 26; ++i) + header[i] = 0; + crc = 0; + for (i=0; i < 27; ++i) + crc = crc32_update(crc, header[i]); + len = 0; + for (i=0; i < header[26]; ++i) { + int s = get8(f); + crc = crc32_update(crc, s); + len += s; + } + if (len && f->eof) return 0; + for (i=0; i < len; ++i) + crc = crc32_update(crc, get8(f)); + // finished parsing probable page + if (crc == goal) { + // we could now check that it's either got the last + // page flag set, OR it's followed by the capture + // pattern, but I guess TECHNICALLY you could have + // a file with garbage between each ogg page and recover + // from it automatically? So even though that paranoia + // might decrease the chance of an invalid decode by + // another 2^32, not worth it since it would hose those + // invalid-but-useful files? + if (end) + *end = stb_vorbis_get_file_offset(f); + if (last) { + if (header[5] & 0x04) + *last = 1; + else + *last = 0; + } + set_file_offset(f, retry_loc-1); + return 1; + } + } + invalid: + // not a valid page, so rewind and look for next one + set_file_offset(f, retry_loc); + } + } +} + + +#define SAMPLE_unknown 0xffffffff + +// seeking is implemented with a binary search, which narrows down the range to +// 64K, before using a linear search (because finding the synchronization +// pattern can be expensive, and the chance we'd find the end page again is +// relatively high for small ranges) +// +// two initial interpolation-style probes are used at the start of the search +// to try to bound either side of the binary search sensibly, while still +// working in O(log n) time if they fail. + +static int get_seek_page_info(stb_vorbis *f, ProbedPage *z) +{ + uint8 header[27], lacing[255]; + int i,len; + + // record where the page starts + z->page_start = stb_vorbis_get_file_offset(f); + + // parse the header + getn(f, header, 27); + if (header[0] != 'O' || header[1] != 'g' || header[2] != 'g' || header[3] != 'S') + return 0; + getn(f, lacing, header[26]); + + // determine the length of the payload + len = 0; + for (i=0; i < header[26]; ++i) + len += lacing[i]; + + // this implies where the page ends + z->page_end = z->page_start + 27 + header[26] + len; + + // read the last-decoded sample out of the data + z->last_decoded_sample = header[6] + (header[7] << 8) + (header[8] << 16) + (header[9] << 24); + + // restore file state to where we were + set_file_offset(f, z->page_start); + return 1; +} + +// rarely used function to seek back to the preceeding page while finding the +// start of a packet +static int go_to_page_before(stb_vorbis *f, unsigned int limit_offset) +{ + unsigned int previous_safe, end; + + // now we want to seek back 64K from the limit + if (limit_offset >= 65536 && limit_offset-65536 >= f->first_audio_page_offset) + previous_safe = limit_offset - 65536; + else + previous_safe = f->first_audio_page_offset; + + set_file_offset(f, previous_safe); + + while (vorbis_find_page(f, &end, NULL)) { + if (end >= limit_offset && stb_vorbis_get_file_offset(f) < limit_offset) + return 1; + set_file_offset(f, end); + } + + return 0; +} + +// implements the search logic for finding a page and starting decoding. if +// the function succeeds, current_loc_valid will be true and current_loc will +// be less than or equal to the provided sample number (the closer the +// better). +static int seek_to_sample_coarse(stb_vorbis *f, uint32 sample_number) +{ + ProbedPage left, right, mid; + int i, start_seg_with_known_loc, end_pos, page_start; + uint32 delta, stream_length, padding; + double offset, bytes_per_sample; + int probe = 0; + + // find the last page and validate the target sample + stream_length = stb_vorbis_stream_length_in_samples(f); + if (stream_length == 0) return error(f, VORBIS_seek_without_length); + if (sample_number > stream_length) return error(f, VORBIS_seek_invalid); + + // this is the maximum difference between the window-center (which is the + // actual granule position value), and the right-start (which the spec + // indicates should be the granule position (give or take one)). + padding = ((f->blocksize_1 - f->blocksize_0) >> 2); + if (sample_number < padding) + sample_number = 0; + else + sample_number -= padding; + + left = f->p_first; + while (left.last_decoded_sample == ~0U) { + // (untested) the first page does not have a 'last_decoded_sample' + set_file_offset(f, left.page_end); + if (!get_seek_page_info(f, &left)) goto error; + } + + right = f->p_last; + assert(right.last_decoded_sample != ~0U); + + // starting from the start is handled differently + if (sample_number <= left.last_decoded_sample) { + stb_vorbis_seek_start(f); + return 1; + } + + while (left.page_end != right.page_start) { + assert(left.page_end < right.page_start); + // search range in bytes + delta = right.page_start - left.page_end; + if (delta <= 65536) { + // there's only 64K left to search - handle it linearly + set_file_offset(f, left.page_end); + } else { + if (probe < 2) { + if (probe == 0) { + // first probe (interpolate) + double data_bytes = right.page_end - left.page_start; + bytes_per_sample = data_bytes / right.last_decoded_sample; + offset = left.page_start + bytes_per_sample * (sample_number - left.last_decoded_sample); + } else { + // second probe (try to bound the other side) + double error = ((double) sample_number - mid.last_decoded_sample) * bytes_per_sample; + if (error >= 0 && error < 8000) error = 8000; + if (error < 0 && error > -8000) error = -8000; + offset += error * 2; + } + + // ensure the offset is valid + if (offset < left.page_end) + offset = left.page_end; + if (offset > right.page_start - 65536) + offset = right.page_start - 65536; + + set_file_offset(f, (unsigned int) offset); + } else { + // binary search for large ranges (offset by 32K to ensure + // we don't hit the right page) + set_file_offset(f, left.page_end + (delta / 2) - 32768); + } + + if (!vorbis_find_page(f, NULL, NULL)) goto error; + } + + for (;;) { + if (!get_seek_page_info(f, &mid)) goto error; + if (mid.last_decoded_sample != ~0U) break; + // (untested) no frames end on this page + set_file_offset(f, mid.page_end); + assert(mid.page_start < right.page_start); + } + + // if we've just found the last page again then we're in a tricky file, + // and we're close enough. + if (mid.page_start == right.page_start) + break; + + if (sample_number < mid.last_decoded_sample) + right = mid; + else + left = mid; + + ++probe; + } + + // seek back to start of the last packet + page_start = left.page_start; + set_file_offset(f, page_start); + if (!start_page(f)) return error(f, VORBIS_seek_failed); + end_pos = f->end_seg_with_known_loc; + assert(end_pos >= 0); + + for (;;) { + for (i = end_pos; i > 0; --i) + if (f->segments[i-1] != 255) + break; + + start_seg_with_known_loc = i; + + if (start_seg_with_known_loc > 0 || !(f->page_flag & PAGEFLAG_continued_packet)) + break; + + // (untested) the final packet begins on an earlier page + if (!go_to_page_before(f, page_start)) + goto error; + + page_start = stb_vorbis_get_file_offset(f); + if (!start_page(f)) goto error; + end_pos = f->segment_count - 1; + } + + // prepare to start decoding + f->current_loc_valid = FALSE; + f->last_seg = FALSE; + f->valid_bits = 0; + f->packet_bytes = 0; + f->bytes_in_seg = 0; + f->previous_length = 0; + f->next_seg = start_seg_with_known_loc; + + for (i = 0; i < start_seg_with_known_loc; i++) + skip(f, f->segments[i]); + + // start decoding (optimizable - this frame is generally discarded) + vorbis_pump_first_frame(f); + return 1; + +error: + // try to restore the file to a valid state + stb_vorbis_seek_start(f); + return error(f, VORBIS_seek_failed); +} + +// the same as vorbis_decode_initial, but without advancing +static int peek_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) +{ + int bits_read, bytes_read; + + if (!vorbis_decode_initial(f, p_left_start, p_left_end, p_right_start, p_right_end, mode)) + return 0; + + // either 1 or 2 bytes were read, figure out which so we can rewind + bits_read = 1 + ilog(f->mode_count-1); + if (f->mode_config[*mode].blockflag) + bits_read += 2; + bytes_read = (bits_read + 7) / 8; + + f->bytes_in_seg += bytes_read; + f->packet_bytes -= bytes_read; + skip(f, -bytes_read); + if (f->next_seg == -1) + f->next_seg = f->segment_count - 1; + else + f->next_seg--; + f->valid_bits = 0; + + return 1; +} + +int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number) +{ + uint32 max_frame_samples; + + if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); + + // fast page-level search + if (!seek_to_sample_coarse(f, sample_number)) + return 0; + + assert(f->current_loc_valid); + assert(f->current_loc <= sample_number); + + // linear search for the relevant packet + max_frame_samples = (f->blocksize_1*3 - f->blocksize_0) >> 2; + while (f->current_loc < sample_number) { + int left_start, left_end, right_start, right_end, mode, frame_samples; + if (!peek_decode_initial(f, &left_start, &left_end, &right_start, &right_end, &mode)) + return error(f, VORBIS_seek_failed); + // calculate the number of samples returned by the next frame + frame_samples = right_start - left_start; + if (f->current_loc + frame_samples > sample_number) { + return 1; // the next frame will contain the sample + } else if (f->current_loc + frame_samples + max_frame_samples > sample_number) { + // there's a chance the frame after this could contain the sample + vorbis_pump_first_frame(f); + } else { + // this frame is too early to be relevant + f->current_loc += frame_samples; + f->previous_length = 0; + maybe_start_packet(f); + flush_packet(f); + } + } + // the next frame will start with the sample + assert(f->current_loc == sample_number); + return 1; +} + +int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number) +{ + if (!stb_vorbis_seek_frame(f, sample_number)) + return 0; + + if (sample_number != f->current_loc) { + int n; + uint32 frame_start = f->current_loc; + stb_vorbis_get_frame_float(f, &n, NULL); + assert(sample_number > frame_start); + assert(f->channel_buffer_start + (int) (sample_number-frame_start) <= f->channel_buffer_end); + f->channel_buffer_start += (sample_number - frame_start); + } + + return 1; +} + +void stb_vorbis_seek_start(stb_vorbis *f) +{ + if (IS_PUSH_MODE(f)) { error(f, VORBIS_invalid_api_mixing); return; } + set_file_offset(f, f->first_audio_page_offset); + f->previous_length = 0; + f->first_decode = TRUE; + f->next_seg = -1; + vorbis_pump_first_frame(f); +} + +unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f) +{ + unsigned int restore_offset, previous_safe; + unsigned int end, last_page_loc; + + if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); + if (!f->total_samples) { + unsigned int last; + uint32 lo,hi; + char header[6]; + + // first, store the current decode position so we can restore it + restore_offset = stb_vorbis_get_file_offset(f); + + // now we want to seek back 64K from the end (the last page must + // be at most a little less than 64K, but let's allow a little slop) + if (f->stream_len >= 65536 && f->stream_len-65536 >= f->first_audio_page_offset) + previous_safe = f->stream_len - 65536; + else + previous_safe = f->first_audio_page_offset; + + set_file_offset(f, previous_safe); + // previous_safe is now our candidate 'earliest known place that seeking + // to will lead to the final page' + + if (!vorbis_find_page(f, &end, &last)) { + // if we can't find a page, we're hosed! + f->error = VORBIS_cant_find_last_page; + f->total_samples = 0xffffffff; + goto done; + } + + // check if there are more pages + last_page_loc = stb_vorbis_get_file_offset(f); + + // stop when the last_page flag is set, not when we reach eof; + // this allows us to stop short of a 'file_section' end without + // explicitly checking the length of the section + while (!last) { + set_file_offset(f, end); + if (!vorbis_find_page(f, &end, &last)) { + // the last page we found didn't have the 'last page' flag + // set. whoops! + break; + } + previous_safe = last_page_loc+1; + last_page_loc = stb_vorbis_get_file_offset(f); + } + + set_file_offset(f, last_page_loc); + + // parse the header + getn(f, (unsigned char *)header, 6); + // extract the absolute granule position + lo = get32(f); + hi = get32(f); + if (lo == 0xffffffff && hi == 0xffffffff) { + f->error = VORBIS_cant_find_last_page; + f->total_samples = SAMPLE_unknown; + goto done; + } + if (hi) + lo = 0xfffffffe; // saturate + f->total_samples = lo; + + f->p_last.page_start = last_page_loc; + f->p_last.page_end = end; + f->p_last.last_decoded_sample = lo; + + done: + set_file_offset(f, restore_offset); + } + return f->total_samples == SAMPLE_unknown ? 0 : f->total_samples; +} + +float stb_vorbis_stream_length_in_seconds(stb_vorbis *f) +{ + return stb_vorbis_stream_length_in_samples(f) / (float) f->sample_rate; +} + + + +int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output) +{ + int len, right,left,i; + if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); + + if (!vorbis_decode_packet(f, &len, &left, &right)) { + f->channel_buffer_start = f->channel_buffer_end = 0; + return 0; + } + + len = vorbis_finish_frame(f, len, left, right); + for (i=0; i < f->channels; ++i) + f->outputs[i] = f->channel_buffers[i] + left; + + f->channel_buffer_start = left; + f->channel_buffer_end = left+len; + + if (channels) *channels = f->channels; + if (output) *output = f->outputs; + return len; +} + +#ifndef STB_VORBIS_NO_STDIO + +stb_vorbis * stb_vorbis_open_file_section(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc, unsigned int length) +{ + stb_vorbis *f, p; + vorbis_init(&p, alloc); + p.f = file; + p.f_start = (uint32) ftell(file); + p.stream_len = length; + p.close_on_free = close_on_free; + if (start_decoder(&p)) { + f = vorbis_alloc(&p); + if (f) { + *f = p; + vorbis_pump_first_frame(f); + return f; + } + } + if (error) *error = p.error; + vorbis_deinit(&p); + return NULL; +} + +stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc) +{ + unsigned int len, start; + start = (unsigned int) ftell(file); + fseek(file, 0, SEEK_END); + len = (unsigned int) (ftell(file) - start); + fseek(file, start, SEEK_SET); + return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len); +} + +stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const stb_vorbis_alloc *alloc) +{ + FILE *f = fopen(filename, "rb"); + if (f) + return stb_vorbis_open_file(f, TRUE, error, alloc); + if (error) *error = VORBIS_file_open_failure; + return NULL; +} +#endif // STB_VORBIS_NO_STDIO + +stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, int *error, const stb_vorbis_alloc *alloc) +{ + stb_vorbis *f, p; + if (data == NULL) return NULL; + vorbis_init(&p, alloc); + p.stream = (uint8 *) data; + p.stream_end = (uint8 *) data + len; + p.stream_start = (uint8 *) p.stream; + p.stream_len = len; + p.push_mode = FALSE; + if (start_decoder(&p)) { + f = vorbis_alloc(&p); + if (f) { + *f = p; + vorbis_pump_first_frame(f); + return f; + } + } + if (error) *error = p.error; + vorbis_deinit(&p); + return NULL; +} + +#ifndef STB_VORBIS_NO_INTEGER_CONVERSION +#define PLAYBACK_MONO 1 +#define PLAYBACK_LEFT 2 +#define PLAYBACK_RIGHT 4 + +#define L (PLAYBACK_LEFT | PLAYBACK_MONO) +#define C (PLAYBACK_LEFT | PLAYBACK_RIGHT | PLAYBACK_MONO) +#define R (PLAYBACK_RIGHT | PLAYBACK_MONO) + +static int8 channel_position[7][6] = +{ + { 0 }, + { C }, + { L, R }, + { L, C, R }, + { L, R, L, R }, + { L, C, R, L, R }, + { L, C, R, L, R, C }, +}; + + +#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT + typedef union { + float f; + int i; + } float_conv; + typedef char stb_vorbis_float_size_test[sizeof(float)==4 && sizeof(int) == 4]; + #define FASTDEF(x) float_conv x + // add (1<<23) to convert to int, then divide by 2^SHIFT, then add 0.5/2^SHIFT to round + #define MAGIC(SHIFT) (1.5f * (1 << (23-SHIFT)) + 0.5f/(1 << SHIFT)) + #define ADDEND(SHIFT) (((150-SHIFT) << 23) + (1 << 22)) + #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) (temp.f = (x) + MAGIC(s), temp.i - ADDEND(s)) + #define check_endianness() +#else + #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) ((int) ((x) * (1 << (s)))) + #define check_endianness() + #define FASTDEF(x) +#endif + +static void copy_samples(short *dest, float *src, int len) +{ + int i; + check_endianness(); + for (i=0; i < len; ++i) { + FASTDEF(temp); + int v = FAST_SCALED_FLOAT_TO_INT(temp, src[i],15); + if ((unsigned int) (v + 32768) > 65535) + v = v < 0 ? -32768 : 32767; + dest[i] = v; + } +} + +static void compute_samples(int mask, short *output, int num_c, float **data, int d_offset, int len) +{ + #define BUFFER_SIZE 32 + float buffer[BUFFER_SIZE]; + int i,j,o,n = BUFFER_SIZE; + check_endianness(); + for (o = 0; o < len; o += BUFFER_SIZE) { + memset(buffer, 0, sizeof(buffer)); + if (o + n > len) n = len - o; + for (j=0; j < num_c; ++j) { + if (channel_position[num_c][j] & mask) { + for (i=0; i < n; ++i) + buffer[i] += data[j][d_offset+o+i]; + } + } + for (i=0; i < n; ++i) { + FASTDEF(temp); + int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); + if ((unsigned int) (v + 32768) > 65535) + v = v < 0 ? -32768 : 32767; + output[o+i] = v; + } + } +} + +static void compute_stereo_samples(short *output, int num_c, float **data, int d_offset, int len) +{ + #define BUFFER_SIZE 32 + float buffer[BUFFER_SIZE]; + int i,j,o,n = BUFFER_SIZE >> 1; + // o is the offset in the source data + check_endianness(); + for (o = 0; o < len; o += BUFFER_SIZE >> 1) { + // o2 is the offset in the output data + int o2 = o << 1; + memset(buffer, 0, sizeof(buffer)); + if (o + n > len) n = len - o; + for (j=0; j < num_c; ++j) { + int m = channel_position[num_c][j] & (PLAYBACK_LEFT | PLAYBACK_RIGHT); + if (m == (PLAYBACK_LEFT | PLAYBACK_RIGHT)) { + for (i=0; i < n; ++i) { + buffer[i*2+0] += data[j][d_offset+o+i]; + buffer[i*2+1] += data[j][d_offset+o+i]; + } + } else if (m == PLAYBACK_LEFT) { + for (i=0; i < n; ++i) { + buffer[i*2+0] += data[j][d_offset+o+i]; + } + } else if (m == PLAYBACK_RIGHT) { + for (i=0; i < n; ++i) { + buffer[i*2+1] += data[j][d_offset+o+i]; + } + } + } + for (i=0; i < (n<<1); ++i) { + FASTDEF(temp); + int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); + if ((unsigned int) (v + 32768) > 65535) + v = v < 0 ? -32768 : 32767; + output[o2+i] = v; + } + } +} + +static void convert_samples_short(int buf_c, short **buffer, int b_offset, int data_c, float **data, int d_offset, int samples) +{ + int i; + if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { + static int channel_selector[3][2] = { {0}, {PLAYBACK_MONO}, {PLAYBACK_LEFT, PLAYBACK_RIGHT} }; + for (i=0; i < buf_c; ++i) + compute_samples(channel_selector[buf_c][i], buffer[i]+b_offset, data_c, data, d_offset, samples); + } else { + int limit = buf_c < data_c ? buf_c : data_c; + for (i=0; i < limit; ++i) + copy_samples(buffer[i]+b_offset, data[i]+d_offset, samples); + for ( ; i < buf_c; ++i) + memset(buffer[i]+b_offset, 0, sizeof(short) * samples); + } +} + +int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples) +{ + float **output; + int len = stb_vorbis_get_frame_float(f, NULL, &output); + if (len > num_samples) len = num_samples; + if (len) + convert_samples_short(num_c, buffer, 0, f->channels, output, 0, len); + return len; +} + +static void convert_channels_short_interleaved(int buf_c, short *buffer, int data_c, float **data, int d_offset, int len) +{ + int i; + check_endianness(); + if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { + assert(buf_c == 2); + for (i=0; i < buf_c; ++i) + compute_stereo_samples(buffer, data_c, data, d_offset, len); + } else { + int limit = buf_c < data_c ? buf_c : data_c; + int j; + for (j=0; j < len; ++j) { + for (i=0; i < limit; ++i) { + FASTDEF(temp); + float f = data[i][d_offset+j]; + int v = FAST_SCALED_FLOAT_TO_INT(temp, f,15);//data[i][d_offset+j],15); + if ((unsigned int) (v + 32768) > 65535) + v = v < 0 ? -32768 : 32767; + *buffer++ = v; + } + for ( ; i < buf_c; ++i) + *buffer++ = 0; + } + } +} + +int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts) +{ + float **output; + int len; + if (num_c == 1) return stb_vorbis_get_frame_short(f,num_c,&buffer, num_shorts); + len = stb_vorbis_get_frame_float(f, NULL, &output); + if (len) { + if (len*num_c > num_shorts) len = num_shorts / num_c; + convert_channels_short_interleaved(num_c, buffer, f->channels, output, 0, len); + } + return len; +} + +int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts) +{ + float **outputs; + int len = num_shorts / channels; + int n=0; + int z = f->channels; + if (z > channels) z = channels; + while (n < len) { + int k = f->channel_buffer_end - f->channel_buffer_start; + if (n+k >= len) k = len - n; + if (k) + convert_channels_short_interleaved(channels, buffer, f->channels, f->channel_buffers, f->channel_buffer_start, k); + buffer += k*channels; + n += k; + f->channel_buffer_start += k; + if (n == len) break; + if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; + } + return n; +} + +int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int len) +{ + float **outputs; + int n=0; + int z = f->channels; + if (z > channels) z = channels; + while (n < len) { + int k = f->channel_buffer_end - f->channel_buffer_start; + if (n+k >= len) k = len - n; + if (k) + convert_samples_short(channels, buffer, n, f->channels, f->channel_buffers, f->channel_buffer_start, k); + n += k; + f->channel_buffer_start += k; + if (n == len) break; + if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; + } + return n; +} + +#ifndef STB_VORBIS_NO_STDIO +int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output) +{ + int data_len, offset, total, limit, error; + short *data; + stb_vorbis *v = stb_vorbis_open_filename(filename, &error, NULL); + if (v == NULL) return -1; + limit = v->channels * 4096; + *channels = v->channels; + if (sample_rate) + *sample_rate = v->sample_rate; + offset = data_len = 0; + total = limit; + data = (short *) malloc(total * sizeof(*data)); + if (data == NULL) { + stb_vorbis_close(v); + return -2; + } + for (;;) { + int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); + if (n == 0) break; + data_len += n; + offset += n * v->channels; + if (offset + limit > total) { + short *data2; + total *= 2; + data2 = (short *) realloc(data, total * sizeof(*data)); + if (data2 == NULL) { + free(data); + stb_vorbis_close(v); + return -2; + } + data = data2; + } + } + *output = data; + stb_vorbis_close(v); + return data_len; +} +#endif // NO_STDIO + +int stb_vorbis_decode_memory(const uint8 *mem, int len, int *channels, int *sample_rate, short **output) +{ + int data_len, offset, total, limit, error; + short *data; + stb_vorbis *v = stb_vorbis_open_memory(mem, len, &error, NULL); + if (v == NULL) return -1; + limit = v->channels * 4096; + *channels = v->channels; + if (sample_rate) + *sample_rate = v->sample_rate; + offset = data_len = 0; + total = limit; + data = (short *) malloc(total * sizeof(*data)); + if (data == NULL) { + stb_vorbis_close(v); + return -2; + } + for (;;) { + int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); + if (n == 0) break; + data_len += n; + offset += n * v->channels; + if (offset + limit > total) { + short *data2; + total *= 2; + data2 = (short *) realloc(data, total * sizeof(*data)); + if (data2 == NULL) { + free(data); + stb_vorbis_close(v); + return -2; + } + data = data2; + } + } + *output = data; + stb_vorbis_close(v); + return data_len; +} +#endif // STB_VORBIS_NO_INTEGER_CONVERSION + +int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats) +{ + float **outputs; + int len = num_floats / channels; + int n=0; + int z = f->channels; + if (z > channels) z = channels; + while (n < len) { + int i,j; + int k = f->channel_buffer_end - f->channel_buffer_start; + if (n+k >= len) k = len - n; + for (j=0; j < k; ++j) { + for (i=0; i < z; ++i) + *buffer++ = f->channel_buffers[i][f->channel_buffer_start+j]; + for ( ; i < channels; ++i) + *buffer++ = 0; + } + n += k; + f->channel_buffer_start += k; + if (n == len) + break; + if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) + break; + } + return n; +} + +int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples) +{ + float **outputs; + int n=0; + int z = f->channels; + if (z > channels) z = channels; + while (n < num_samples) { + int i; + int k = f->channel_buffer_end - f->channel_buffer_start; + if (n+k >= num_samples) k = num_samples - n; + if (k) { + for (i=0; i < z; ++i) + memcpy(buffer[i]+n, f->channel_buffers[i]+f->channel_buffer_start, sizeof(float)*k); + for ( ; i < channels; ++i) + memset(buffer[i]+n, 0, sizeof(float) * k); + } + n += k; + f->channel_buffer_start += k; + if (n == num_samples) + break; + if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) + break; + } + return n; +} +#endif // STB_VORBIS_NO_PULLDATA_API + +/* Version history + 1.09 - 2016/04/04 - back out 'avoid discarding last frame' fix from previous version + 1.08 - 2016/04/02 - fixed multiple warnings; fix setup memory leaks; + avoid discarding last frame of audio data + 1.07 - 2015/01/16 - fixed some warnings, fix mingw, const-correct API + some more crash fixes when out of memory or with corrupt files + 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) + some crash fixes when out of memory or with corrupt files + 1.05 - 2015/04/19 - don't define __forceinline if it's redundant + 1.04 - 2014/08/27 - fix missing const-correct case in API + 1.03 - 2014/08/07 - Warning fixes + 1.02 - 2014/07/09 - Declare qsort compare function _cdecl on windows + 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float + 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in multichannel + (API change) report sample rate for decode-full-file funcs + 0.99996 - bracket #include for macintosh compilation by Laurent Gomila + 0.99995 - use union instead of pointer-cast for fast-float-to-int to avoid alias-optimization problem + 0.99994 - change fast-float-to-int to work in single-precision FPU mode, remove endian-dependence + 0.99993 - remove assert that fired on legal files with empty tables + 0.99992 - rewind-to-start + 0.99991 - bugfix to stb_vorbis_get_samples_short by Bernhard Wodo + 0.9999 - (should have been 0.99990) fix no-CRT support, compiling as C++ + 0.9998 - add a full-decode function with a memory source + 0.9997 - fix a bug in the read-from-FILE case in 0.9996 addition + 0.9996 - query length of vorbis stream in samples/seconds + 0.9995 - bugfix to another optimization that only happened in certain files + 0.9994 - bugfix to one of the optimizations that caused significant (but inaudible?) errors + 0.9993 - performance improvements; runs in 99% to 104% of time of reference implementation + 0.9992 - performance improvement of IMDCT; now performs close to reference implementation + 0.9991 - performance improvement of IMDCT + 0.999 - (should have been 0.9990) performance improvement of IMDCT + 0.998 - no-CRT support from Casey Muratori + 0.997 - bugfixes for bugs found by Terje Mathisen + 0.996 - bugfix: fast-huffman decode initialized incorrectly for sparse codebooks; fixing gives 10% speedup - found by Terje Mathisen + 0.995 - bugfix: fix to 'effective' overrun detection - found by Terje Mathisen + 0.994 - bugfix: garbage decode on final VQ symbol of a non-multiple - found by Terje Mathisen + 0.993 - bugfix: pushdata API required 1 extra byte for empty page (failed to consume final page if empty) - found by Terje Mathisen + 0.992 - fixes for MinGW warning + 0.991 - turn fast-float-conversion on by default + 0.990 - fix push-mode seek recovery if you seek into the headers + 0.98b - fix to bad release of 0.98 + 0.98 - fix push-mode seek recovery; robustify float-to-int and support non-fast mode + 0.97 - builds under c++ (typecasting, don't use 'class' keyword) + 0.96 - somehow MY 0.95 was right, but the web one was wrong, so here's my 0.95 rereleased as 0.96, fixes a typo in the clamping code + 0.95 - clamping code for 16-bit functions + 0.94 - not publically released + 0.93 - fixed all-zero-floor case (was decoding garbage) + 0.92 - fixed a memory leak + 0.91 - conditional compiles to omit parts of the API and the infrastructure to support them: STB_VORBIS_NO_PULLDATA_API, STB_VORBIS_NO_PUSHDATA_API, STB_VORBIS_NO_STDIO, STB_VORBIS_NO_INTEGER_CONVERSION + 0.90 - first public release +*/ + +#endif // STB_VORBIS_HEADER_ONLY diff --git a/src/external/stb_vorbis.h b/src/external/stb_vorbis.h new file mode 100644 index 00000000..624ce4bc --- /dev/null +++ b/src/external/stb_vorbis.h @@ -0,0 +1,393 @@ +// Ogg Vorbis audio decoder - v1.09 - public domain +// http://nothings.org/stb_vorbis/ +// +// Original version written by Sean Barrett in 2007. +// +// Originally sponsored by RAD Game Tools. Seeking sponsored +// by Phillip Bennefall, Marc Andersen, Aaron Baker, Elias Software, +// Aras Pranckevicius, and Sean Barrett. +// +// LICENSE +// +// This software is dual-licensed to the public domain and under the following +// license: you are granted a perpetual, irrevocable license to copy, modify, +// publish, and distribute this file as you see fit. +// +// No warranty for any purpose is expressed or implied by the author (nor +// by RAD Game Tools). Report bugs and send enhancements to the author. +// +// Limitations: +// +// - floor 0 not supported (used in old ogg vorbis files pre-2004) +// - lossless sample-truncation at beginning ignored +// - cannot concatenate multiple vorbis streams +// - sample positions are 32-bit, limiting seekable 192Khz +// files to around 6 hours (Ogg supports 64-bit) +// +// Feature contributors: +// Dougall Johnson (sample-exact seeking) +// +// Bugfix/warning contributors: +// Terje Mathisen Niklas Frykholm Andy Hill +// Casey Muratori John Bolton Gargaj +// Laurent Gomila Marc LeBlanc Ronny Chevalier +// Bernhard Wodo Evan Balster alxprd@github +// Tom Beaumont Ingo Leitgeb Nicolas Guillemot +// Phillip Bennefall Rohit Thiago Goulart +// manxorist@github saga musix +// +// Partial history: +// 1.09 - 2016/04/04 - back out 'truncation of last frame' fix from previous version +// 1.08 - 2016/04/02 - warnings; setup memory leaks; truncation of last frame +// 1.07 - 2015/01/16 - fixes for crashes on invalid files; warning fixes; const +// 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) +// some crash fixes when out of memory or with corrupt files +// fix some inappropriately signed shifts +// 1.05 - 2015/04/19 - don't define __forceinline if it's redundant +// 1.04 - 2014/08/27 - fix missing const-correct case in API +// 1.03 - 2014/08/07 - warning fixes +// 1.02 - 2014/07/09 - declare qsort comparison as explicitly _cdecl in Windows +// 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float (interleaved was correct) +// 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in >2-channel; +// (API change) report sample rate for decode-full-file funcs +// +// See end of file for full version history. + + +////////////////////////////////////////////////////////////////////////////// +// +// HEADER BEGINS HERE +// + +#ifndef STB_VORBIS_INCLUDE_STB_VORBIS_H +#define STB_VORBIS_INCLUDE_STB_VORBIS_H + +#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) +#define STB_VORBIS_NO_STDIO 1 +#endif + +#ifndef STB_VORBIS_NO_STDIO +#include +#endif + +// NOTE: Added to work with raylib on Android +#if defined(PLATFORM_ANDROID) + #include "utils.h" // Android fopen function map +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/////////// THREAD SAFETY + +// Individual stb_vorbis* handles are not thread-safe; you cannot decode from +// them from multiple threads at the same time. However, you can have multiple +// stb_vorbis* handles and decode from them independently in multiple thrads. + + +/////////// MEMORY ALLOCATION + +// normally stb_vorbis uses malloc() to allocate memory at startup, +// and alloca() to allocate temporary memory during a frame on the +// stack. (Memory consumption will depend on the amount of setup +// data in the file and how you set the compile flags for speed +// vs. size. In my test files the maximal-size usage is ~150KB.) +// +// You can modify the wrapper functions in the source (setup_malloc, +// setup_temp_malloc, temp_malloc) to change this behavior, or you +// can use a simpler allocation model: you pass in a buffer from +// which stb_vorbis will allocate _all_ its memory (including the +// temp memory). "open" may fail with a VORBIS_outofmem if you +// do not pass in enough data; there is no way to determine how +// much you do need except to succeed (at which point you can +// query get_info to find the exact amount required. yes I know +// this is lame). +// +// If you pass in a non-NULL buffer of the type below, allocation +// will occur from it as described above. Otherwise just pass NULL +// to use malloc()/alloca() + +typedef struct +{ + char *alloc_buffer; + int alloc_buffer_length_in_bytes; +} stb_vorbis_alloc; + + +/////////// FUNCTIONS USEABLE WITH ALL INPUT MODES + +typedef struct stb_vorbis stb_vorbis; + +typedef struct +{ + unsigned int sample_rate; + int channels; + + unsigned int setup_memory_required; + unsigned int setup_temp_memory_required; + unsigned int temp_memory_required; + + int max_frame_size; +} stb_vorbis_info; + +// get general information about the file +extern stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f); + +// get the last error detected (clears it, too) +extern int stb_vorbis_get_error(stb_vorbis *f); + +// close an ogg vorbis file and free all memory in use +extern void stb_vorbis_close(stb_vorbis *f); + +// this function returns the offset (in samples) from the beginning of the +// file that will be returned by the next decode, if it is known, or -1 +// otherwise. after a flush_pushdata() call, this may take a while before +// it becomes valid again. +// NOT WORKING YET after a seek with PULLDATA API +extern int stb_vorbis_get_sample_offset(stb_vorbis *f); + +// returns the current seek point within the file, or offset from the beginning +// of the memory buffer. In pushdata mode it returns 0. +extern unsigned int stb_vorbis_get_file_offset(stb_vorbis *f); + +/////////// PUSHDATA API + +#ifndef STB_VORBIS_NO_PUSHDATA_API + +// this API allows you to get blocks of data from any source and hand +// them to stb_vorbis. you have to buffer them; stb_vorbis will tell +// you how much it used, and you have to give it the rest next time; +// and stb_vorbis may not have enough data to work with and you will +// need to give it the same data again PLUS more. Note that the Vorbis +// specification does not bound the size of an individual frame. + +extern stb_vorbis *stb_vorbis_open_pushdata( + const unsigned char * datablock, int datablock_length_in_bytes, + int *datablock_memory_consumed_in_bytes, + int *error, + const stb_vorbis_alloc *alloc_buffer); +// create a vorbis decoder by passing in the initial data block containing +// the ogg&vorbis headers (you don't need to do parse them, just provide +// the first N bytes of the file--you're told if it's not enough, see below) +// on success, returns an stb_vorbis *, does not set error, returns the amount of +// data parsed/consumed on this call in *datablock_memory_consumed_in_bytes; +// on failure, returns NULL on error and sets *error, does not change *datablock_memory_consumed +// if returns NULL and *error is VORBIS_need_more_data, then the input block was +// incomplete and you need to pass in a larger block from the start of the file + +extern int stb_vorbis_decode_frame_pushdata( + stb_vorbis *f, + const unsigned char *datablock, int datablock_length_in_bytes, + int *channels, // place to write number of float * buffers + float ***output, // place to write float ** array of float * buffers + int *samples // place to write number of output samples + ); +// decode a frame of audio sample data if possible from the passed-in data block +// +// return value: number of bytes we used from datablock +// +// possible cases: +// 0 bytes used, 0 samples output (need more data) +// N bytes used, 0 samples output (resynching the stream, keep going) +// N bytes used, M samples output (one frame of data) +// note that after opening a file, you will ALWAYS get one N-bytes,0-sample +// frame, because Vorbis always "discards" the first frame. +// +// Note that on resynch, stb_vorbis will rarely consume all of the buffer, +// instead only datablock_length_in_bytes-3 or less. This is because it wants +// to avoid missing parts of a page header if they cross a datablock boundary, +// without writing state-machiney code to record a partial detection. +// +// The number of channels returned are stored in *channels (which can be +// NULL--it is always the same as the number of channels reported by +// get_info). *output will contain an array of float* buffers, one per +// channel. In other words, (*output)[0][0] contains the first sample from +// the first channel, and (*output)[1][0] contains the first sample from +// the second channel. + +extern void stb_vorbis_flush_pushdata(stb_vorbis *f); +// inform stb_vorbis that your next datablock will not be contiguous with +// previous ones (e.g. you've seeked in the data); future attempts to decode +// frames will cause stb_vorbis to resynchronize (as noted above), and +// once it sees a valid Ogg page (typically 4-8KB, as large as 64KB), it +// will begin decoding the _next_ frame. +// +// if you want to seek using pushdata, you need to seek in your file, then +// call stb_vorbis_flush_pushdata(), then start calling decoding, then once +// decoding is returning you data, call stb_vorbis_get_sample_offset, and +// if you don't like the result, seek your file again and repeat. +#endif + + +////////// PULLING INPUT API + +#ifndef STB_VORBIS_NO_PULLDATA_API +// This API assumes stb_vorbis is allowed to pull data from a source-- +// either a block of memory containing the _entire_ vorbis stream, or a +// FILE * that you or it create, or possibly some other reading mechanism +// if you go modify the source to replace the FILE * case with some kind +// of callback to your code. (But if you don't support seeking, you may +// just want to go ahead and use pushdata.) + +#if !defined(STB_VORBIS_NO_STDIO) && !defined(STB_VORBIS_NO_INTEGER_CONVERSION) +extern int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output); +#endif +#if !defined(STB_VORBIS_NO_INTEGER_CONVERSION) +extern int stb_vorbis_decode_memory(const unsigned char *mem, int len, int *channels, int *sample_rate, short **output); +#endif +// decode an entire file and output the data interleaved into a malloc()ed +// buffer stored in *output. The return value is the number of samples +// decoded, or -1 if the file could not be opened or was not an ogg vorbis file. +// When you're done with it, just free() the pointer returned in *output. + +extern stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, + int *error, const stb_vorbis_alloc *alloc_buffer); +// create an ogg vorbis decoder from an ogg vorbis stream in memory (note +// this must be the entire stream!). on failure, returns NULL and sets *error + +#ifndef STB_VORBIS_NO_STDIO +extern stb_vorbis * stb_vorbis_open_filename(const char *filename, + int *error, const stb_vorbis_alloc *alloc_buffer); +// create an ogg vorbis decoder from a filename via fopen(). on failure, +// returns NULL and sets *error (possibly to VORBIS_file_open_failure). + +extern stb_vorbis * stb_vorbis_open_file(FILE *f, int close_handle_on_close, + int *error, const stb_vorbis_alloc *alloc_buffer); +// create an ogg vorbis decoder from an open FILE *, looking for a stream at +// the _current_ seek point (ftell). on failure, returns NULL and sets *error. +// note that stb_vorbis must "own" this stream; if you seek it in between +// calls to stb_vorbis, it will become confused. Morever, if you attempt to +// perform stb_vorbis_seek_*() operations on this file, it will assume it +// owns the _entire_ rest of the file after the start point. Use the next +// function, stb_vorbis_open_file_section(), to limit it. + +extern stb_vorbis * stb_vorbis_open_file_section(FILE *f, int close_handle_on_close, + int *error, const stb_vorbis_alloc *alloc_buffer, unsigned int len); +// create an ogg vorbis decoder from an open FILE *, looking for a stream at +// the _current_ seek point (ftell); the stream will be of length 'len' bytes. +// on failure, returns NULL and sets *error. note that stb_vorbis must "own" +// this stream; if you seek it in between calls to stb_vorbis, it will become +// confused. +#endif + +extern int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number); +extern int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number); +// these functions seek in the Vorbis file to (approximately) 'sample_number'. +// after calling seek_frame(), the next call to get_frame_*() will include +// the specified sample. after calling stb_vorbis_seek(), the next call to +// stb_vorbis_get_samples_* will start with the specified sample. If you +// do not need to seek to EXACTLY the target sample when using get_samples_*, +// you can also use seek_frame(). + +extern void stb_vorbis_seek_start(stb_vorbis *f); +// this function is equivalent to stb_vorbis_seek(f,0) + +extern unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f); +extern float stb_vorbis_stream_length_in_seconds(stb_vorbis *f); +// these functions return the total length of the vorbis stream + +extern int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output); +// decode the next frame and return the number of samples. the number of +// channels returned are stored in *channels (which can be NULL--it is always +// the same as the number of channels reported by get_info). *output will +// contain an array of float* buffers, one per channel. These outputs will +// be overwritten on the next call to stb_vorbis_get_frame_*. +// +// You generally should not intermix calls to stb_vorbis_get_frame_*() +// and stb_vorbis_get_samples_*(), since the latter calls the former. + +#ifndef STB_VORBIS_NO_INTEGER_CONVERSION +extern int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts); +extern int stb_vorbis_get_frame_short (stb_vorbis *f, int num_c, short **buffer, int num_samples); +#endif +// decode the next frame and return the number of *samples* per channel. +// Note that for interleaved data, you pass in the number of shorts (the +// size of your array), but the return value is the number of samples per +// channel, not the total number of samples. +// +// The data is coerced to the number of channels you request according to the +// channel coercion rules (see below). You must pass in the size of your +// buffer(s) so that stb_vorbis will not overwrite the end of the buffer. +// The maximum buffer size needed can be gotten from get_info(); however, +// the Vorbis I specification implies an absolute maximum of 4096 samples +// per channel. + +// Channel coercion rules: +// Let M be the number of channels requested, and N the number of channels present, +// and Cn be the nth channel; let stereo L be the sum of all L and center channels, +// and stereo R be the sum of all R and center channels (channel assignment from the +// vorbis spec). +// M N output +// 1 k sum(Ck) for all k +// 2 * stereo L, stereo R +// k l k > l, the first l channels, then 0s +// k l k <= l, the first k channels +// Note that this is not _good_ surround etc. mixing at all! It's just so +// you get something useful. + +extern int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats); +extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples); +// gets num_samples samples, not necessarily on a frame boundary--this requires +// buffering so you have to supply the buffers. DOES NOT APPLY THE COERCION RULES. +// Returns the number of samples stored per channel; it may be less than requested +// at the end of the file. If there are no more samples in the file, returns 0. + +#ifndef STB_VORBIS_NO_INTEGER_CONVERSION +extern int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts); +extern int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int num_samples); +#endif +// gets num_samples samples, not necessarily on a frame boundary--this requires +// buffering so you have to supply the buffers. Applies the coercion rules above +// to produce 'channels' channels. Returns the number of samples stored per channel; +// it may be less than requested at the end of the file. If there are no more +// samples in the file, returns 0. + +#endif + +//////// ERROR CODES + +enum STBVorbisError +{ + VORBIS__no_error, + + VORBIS_need_more_data=1, // not a real error + + VORBIS_invalid_api_mixing, // can't mix API modes + VORBIS_outofmem, // not enough memory + VORBIS_feature_not_supported, // uses floor 0 + VORBIS_too_many_channels, // STB_VORBIS_MAX_CHANNELS is too small + VORBIS_file_open_failure, // fopen() failed + VORBIS_seek_without_length, // can't seek in unknown-length file + + VORBIS_unexpected_eof=10, // file is truncated? + VORBIS_seek_invalid, // seek past EOF + + // decoding errors (corrupt/invalid stream) -- you probably + // don't care about the exact details of these + + // vorbis errors: + VORBIS_invalid_setup=20, + VORBIS_invalid_stream, + + // ogg errors: + VORBIS_missing_capture_pattern=30, + VORBIS_invalid_stream_structure_version, + VORBIS_continued_packet_flag_invalid, + VORBIS_incorrect_stream_serial_number, + VORBIS_invalid_first_page, + VORBIS_bad_packet_type, + VORBIS_cant_find_last_page, + VORBIS_seek_failed +}; + + +#ifdef __cplusplus +} +#endif + +#endif // STB_VORBIS_INCLUDE_STB_VORBIS_H +// +// HEADER ENDS HERE +// +////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/external/tinfl.c b/src/external/tinfl.c new file mode 100644 index 00000000..a17a156b --- /dev/null +++ b/src/external/tinfl.c @@ -0,0 +1,592 @@ +/* tinfl.c v1.11 - public domain inflate with zlib header parsing/adler32 checking (inflate-only subset of miniz.c) + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated May 20, 2011 + Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt + + The entire decompressor coroutine is implemented in tinfl_decompress(). The other functions are optional high-level helpers. +*/ +#ifndef TINFL_HEADER_INCLUDED +#define TINFL_HEADER_INCLUDED + +#include + +typedef unsigned char mz_uint8; +typedef signed short mz_int16; +typedef unsigned short mz_uint16; +typedef unsigned int mz_uint32; +typedef unsigned int mz_uint; +typedef unsigned long long mz_uint64; + +#if defined(_M_IX86) || defined(_M_X64) +// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 if integer loads and stores to unaligned addresses are acceptable on the target platform (slightly faster). +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 +// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. +#define MINIZ_LITTLE_ENDIAN 1 +#endif + +#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) +// Set MINIZ_HAS_64BIT_REGISTERS to 1 if the processor has 64-bit general purpose registers (enables 64-bit bitbuffer in inflator) +#define MINIZ_HAS_64BIT_REGISTERS 1 +#endif + +// Works around MSVC's spammy "warning C4127: conditional expression is constant" message. +#ifdef _MSC_VER + #define MZ_MACRO_END while (0, 0) +#else + #define MZ_MACRO_END while (0) +#endif + +// Decompression flags used by tinfl_decompress(). +// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. +// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. +// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). +// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +// High level decompression functions: +// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). +// On entry: +// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. +// On return: +// Function returns a pointer to the decompressed data, or NULL on failure. +// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. +// The caller must free() the returned block when it's no longer needed. +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. +// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. +#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +// tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. +// Returns 1 on success or 0 on failure. +typedef int (*tinfl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; + +// Max size of LZ dictionary. +#define TINFL_LZ_DICT_SIZE 32768 + +// Return status. +typedef enum +{ + TINFL_STATUS_BAD_PARAM = -3, + TINFL_STATUS_ADLER32_MISMATCH = -2, + TINFL_STATUS_FAILED = -1, + TINFL_STATUS_DONE = 0, + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +// Initializes the decompressor to its initial state. +#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +// Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. +// This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +// Internal/private bits follow. +enum +{ + TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +typedef struct +{ + mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; +} tinfl_huff_table; + +#if MINIZ_HAS_64BIT_REGISTERS + #define TINFL_USE_64BIT_BITBUF 1 +#endif + +#if TINFL_USE_64BIT_BITBUF + typedef mz_uint64 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (64) +#else + typedef mz_uint32 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +#endif // #ifdef TINFL_HEADER_INCLUDED + +// ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) + +#ifndef TINFL_HEADER_FILE_ONLY + +#include + +// MZ_MALLOC, etc. are only used by the optional high-level helper functions. +#ifdef MINIZ_NO_MALLOC + #define MZ_MALLOC(x) NULL + #define MZ_FREE(x) x, ((void)0) + #define MZ_REALLOC(p, x) NULL +#else + #define MZ_MALLOC(x) malloc(x) + #define MZ_FREE(x) free(x) + #define MZ_REALLOC(p, x) realloc(p, x) +#endif + +#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) +#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) + #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else + #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) + #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) +#define TINFL_MEMSET(p, c, l) memset(p, c, l) + +#define TINFL_CR_BEGIN switch(r->m_state) { case 0: +#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END +#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END +#define TINFL_CR_FINISH } + +// TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never +// reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. +#define TINFL_GET_BYTE(state_index, c) do { \ + if (pIn_buf_cur >= pIn_buf_end) { \ + for ( ; ; ) { \ + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ + TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ + if (pIn_buf_cur < pIn_buf_end) { \ + c = *pIn_buf_cur++; \ + break; \ + } \ + } else { \ + c = 0; \ + break; \ + } \ + } \ + } else c = *pIn_buf_cur++; } MZ_MACRO_END + +#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) +#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END +#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END + +// TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. +// It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a +// Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the +// bit buffer contains >=15 bits (deflate's max. Huffman code size). +#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ + do { \ + temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ + if (temp >= 0) { \ + code_len = temp >> 9; \ + if ((code_len) && (num_bits >= code_len)) \ + break; \ + } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do { \ + temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ + } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ + } while (num_bits < 15); + +// TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read +// beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully +// decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. +// The slow path is only executed at the very end of the input buffer. +#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ + int temp; mz_uint code_len, c; \ + if (num_bits < 15) { \ + if ((pIn_buf_end - pIn_buf_cur) < 2) { \ + TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ + } else { \ + bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ + } \ + } \ + if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ + code_len = temp >> 9, temp &= 511; \ + else { \ + code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ + } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END + +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) +{ + static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; + static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + static const int s_min_table_sizes[3] = { 257, 1, 4 }; + + tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; + size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; + + // Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). + if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } + + num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; + TINFL_CR_BEGIN + + bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); + counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); + if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); + if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } + } + + do + { + TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; + if (r->m_type == 0) + { + TINFL_SKIP_BITS(5, num_bits & 7); + for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } + if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } + while ((counter) && (num_bits)) + { + TINFL_GET_BITS(51, dist, 8); + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)dist; + counter--; + } + while (counter) + { + size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } + while (pIn_buf_cur >= pIn_buf_end) + { + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) + { + TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); + } + else + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + } + n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); + TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; + } + } + else if (r->m_type == 3) + { + TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); + } + else + { + if (r->m_type == 1) + { + mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; + r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); + for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8; + } + else + { + for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } + MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } + r->m_table_sizes[2] = 19; + } + for ( ; (int)r->m_type >= 0; r->m_type--) + { + int tree_next, tree_cur; tinfl_huff_table *pTable; + mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); + for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; + used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; + for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } + if ((65536 != total) && (used_syms > 1)) + { + TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); + } + for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) + { + mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; + cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); + if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } + if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } + rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); + for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) + { + tree_cur -= ((rev_code >>= 1) & 1); + if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; + } + tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; + } + if (r->m_type == 2) + { + for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) + { + mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } + if ((dist == 16) && (!counter)) + { + TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); + } + num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; + TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; + } + if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) + { + TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); + } + TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); + } + } + for ( ; ; ) + { + mz_uint8 *pSrc; + for ( ; ; ) + { + if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) + { + TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); + if (counter >= 256) + break; + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)counter; + } + else + { + int sym2; mz_uint code_len; +#if TINFL_USE_64BIT_BITBUF + if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } +#else + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + counter = sym2; bit_buf >>= code_len; num_bits -= code_len; + if (counter & 256) + break; + +#if !TINFL_USE_64BIT_BITBUF + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + bit_buf >>= code_len; num_bits -= code_len; + + pOut_buf_cur[0] = (mz_uint8)counter; + if (sym2 & 256) + { + pOut_buf_cur++; + counter = sym2; + break; + } + pOut_buf_cur[1] = (mz_uint8)sym2; + pOut_buf_cur += 2; + } + } + if ((counter &= 511) == 256) break; + + num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } + + TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); + num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } + + dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; + if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + { + TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); + } + + pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); + + if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) + { + while (counter--) + { + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; + } + continue; + } +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + else if ((counter >= 9) && (counter <= dist)) + { + const mz_uint8 *pSrc_end = pSrc + (counter & ~7); + do + { + ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; + ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; + pOut_buf_cur += 8; + } while ((pSrc += 8) < pSrc_end); + if ((counter &= 7) < 3) + { + if (counter) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + continue; + } + } +#endif + do + { + pOut_buf_cur[0] = pSrc[0]; + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur[2] = pSrc[2]; + pOut_buf_cur += 3; pSrc += 3; + } while ((int)(counter -= 3) > 2); + if ((int)counter > 0) + { + pOut_buf_cur[0] = pSrc[0]; + if ((int)counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + } + } + } while (!(r->m_final & 1)); + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } + } + TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); + TINFL_CR_FINISH + +common_exit: + r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; + *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; + if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) + { + const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; + mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; + } + for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; + } + r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; + } + return status; +} + +// Higher level helper functions. +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) +{ + tinfl_decompressor decomp; void *pBuf = NULL, *pNew_buf; size_t src_buf_ofs = 0, out_buf_capacity = 0; + *pOut_len = 0; + tinfl_init(&decomp); + for ( ; ; ) + { + size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8*)pBuf, pBuf ? (mz_uint8*)pBuf + *pOut_len : NULL, &dst_buf_size, + (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) + { + MZ_FREE(pBuf); *pOut_len = 0; return NULL; + } + src_buf_ofs += src_buf_size; + *pOut_len += dst_buf_size; + if (status == TINFL_STATUS_DONE) break; + new_out_buf_capacity = out_buf_capacity * 2; if (new_out_buf_capacity < 128) new_out_buf_capacity = 128; + pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity); + if (!pNew_buf) + { + MZ_FREE(pBuf); *pOut_len = 0; return NULL; + } + pBuf = pNew_buf; out_buf_capacity = new_out_buf_capacity; + } + return pBuf; +} + +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) +{ + tinfl_decompressor decomp; tinfl_status status; tinfl_init(&decomp); + status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf, &src_buf_len, (mz_uint8*)pOut_buf, (mz_uint8*)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len; +} + +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + int result = 0; + tinfl_decompressor decomp; + mz_uint8 *pDict = (mz_uint8*)MZ_MALLOC(TINFL_LZ_DICT_SIZE); size_t in_buf_ofs = 0, dict_ofs = 0; + if (!pDict) + return TINFL_STATUS_FAILED; + tinfl_init(&decomp); + for ( ; ; ) + { + size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, + (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); + in_buf_ofs += in_buf_size; + if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) + break; + if (status != TINFL_STATUS_HAS_MORE_OUTPUT) + { + result = (status == TINFL_STATUS_DONE); + break; + } + dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1); + } + MZ_FREE(pDict); + *pIn_buf_size = in_buf_ofs; + return result; +} + +#endif // #ifndef TINFL_HEADER_FILE_ONLY + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + For more information, please refer to +*/ diff --git a/src/glad.c b/src/glad.c deleted file mode 100644 index aace05a7..00000000 --- a/src/glad.c +++ /dev/null @@ -1,7684 +0,0 @@ -/* - - OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. - - Language/Generator: C/C++ - Specification: gl - APIs: gl=3.3 - Profile: core - Extensions: - GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control - Loader: No - - Commandline: - --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" - Online: - Too many extensions -*/ - -#include -#include -#include -#include "glad.h" - -struct gladGLversionStruct GLVersion; - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define _GLAD_IS_SOME_NEW_VERSION 1 -#endif - -static int max_loaded_major; -static int max_loaded_minor; - -static const char *exts = NULL; -static int num_exts_i = 0; -static const char **exts_i = NULL; - -static int get_exts(void) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - exts = (const char *)glGetString(GL_EXTENSIONS); -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - num_exts_i = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); - if (num_exts_i > 0) { - exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); - } - - if (exts_i == NULL) { - return 0; - } - - for(index = 0; index < num_exts_i; index++) { - exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); - } - } -#endif - return 1; -} - -static void free_exts(void) { - if (exts_i != NULL) { - free(exts_i); - exts_i = NULL; - } -} - -static int has_ext(const char *ext) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - - if(strcmp(e, ext) == 0) { - return 1; - } - } - } -#endif - - return 0; -} -int GLAD_GL_VERSION_1_0; -int GLAD_GL_VERSION_1_1; -int GLAD_GL_VERSION_1_2; -int GLAD_GL_VERSION_1_3; -int GLAD_GL_VERSION_1_4; -int GLAD_GL_VERSION_1_5; -int GLAD_GL_VERSION_2_0; -int GLAD_GL_VERSION_2_1; -int GLAD_GL_VERSION_3_0; -int GLAD_GL_VERSION_3_1; -int GLAD_GL_VERSION_3_2; -int GLAD_GL_VERSION_3_3; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -PFNGLBINDSAMPLERPROC glad_glBindSampler; -PFNGLLINEWIDTHPROC glad_glLineWidth; -PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -PFNGLCOMPILESHADERPROC glad_glCompileShader; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -PFNGLENABLEIPROC glad_glEnablei; -PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -PFNGLCREATESHADERPROC glad_glCreateShader; -PFNGLISBUFFERPROC glad_glIsBuffer; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -PFNGLHINTPROC glad_glHint; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -PFNGLPOINTSIZEPROC glad_glPointSize; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -PFNGLWAITSYNCPROC glad_glWaitSync; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -PFNGLUNIFORM3IPROC glad_glUniform3i; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -PFNGLUNIFORM3FPROC glad_glUniform3f; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -PFNGLCOLORMASKIPROC glad_glColorMaski; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -PFNGLDRAWARRAYSPROC glad_glDrawArrays; -PFNGLUNIFORM1UIPROC glad_glUniform1ui; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -PFNGLCLEARPROC glad_glClear; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -PFNGLISENABLEDPROC glad_glIsEnabled; -PFNGLSTENCILOPPROC glad_glStencilOp; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -PFNGLGETQUERYIVPROC glad_glGetQueryiv; -PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -PFNGLISSHADERPROC glad_glIsShader; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -PFNGLENABLEPROC glad_glEnable; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -PFNGLFLUSHPROC glad_glFlush; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -PFNGLFENCESYNCPROC glad_glFenceSync; -PFNGLCOLORP3UIPROC glad_glColorP3ui; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -PFNGLGENSAMPLERSPROC glad_glGenSamplers; -PFNGLCLAMPCOLORPROC glad_glClampColor; -PFNGLUNIFORM4IVPROC glad_glUniform4iv; -PFNGLCLEARSTENCILPROC glad_glClearStencil; -PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -PFNGLGENTEXTURESPROC glad_glGenTextures; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -PFNGLISSYNCPROC glad_glIsSync; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -PFNGLUNIFORM2IPROC glad_glUniform2i; -PFNGLUNIFORM2FPROC glad_glUniform2f; -PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -PFNGLGENQUERIESPROC glad_glGenQueries; -PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -PFNGLISENABLEDIPROC glad_glIsEnabledi; -PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -PFNGLUNIFORM2IVPROC glad_glUniform2iv; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -PFNGLGETSHADERIVPROC glad_glGetShaderiv; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -PFNGLGETDOUBLEVPROC glad_glGetDoublev; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -PFNGLUNIFORM3FVPROC glad_glUniform3fv; -PFNGLDEPTHRANGEPROC glad_glDepthRange; -PFNGLMAPBUFFERPROC glad_glMapBuffer; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -PFNGLDELETESYNCPROC glad_glDeleteSync; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -PFNGLUNIFORM3IVPROC glad_glUniform3iv; -PFNGLPOLYGONMODEPROC glad_glPolygonMode; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -PFNGLUSEPROGRAMPROC glad_glUseProgram; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -PFNGLFINISHPROC glad_glFinish; -PFNGLDELETESHADERPROC glad_glDeleteShader; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -PFNGLVIEWPORTPROC glad_glViewport; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -PFNGLUNIFORM2UIPROC glad_glUniform2ui; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -PFNGLCLEARDEPTHPROC glad_glClearDepth; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -PFNGLTEXBUFFERPROC glad_glTexBuffer; -PFNGLPIXELSTOREIPROC glad_glPixelStorei; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -PFNGLPIXELSTOREFPROC glad_glPixelStoref; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -PFNGLLINKPROGRAMPROC glad_glLinkProgram; -PFNGLBINDTEXTUREPROC glad_glBindTexture; -PFNGLGETSTRINGPROC glad_glGetString; -PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -PFNGLDETACHSHADERPROC glad_glDetachShader; -PFNGLENDQUERYPROC glad_glEndQuery; -PFNGLNORMALP3UIPROC glad_glNormalP3ui; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -PFNGLUNIFORM1FPROC glad_glUniform1f; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -PFNGLUNIFORM1IPROC glad_glUniform1i; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -PFNGLDISABLEPROC glad_glDisable; -PFNGLLOGICOPPROC glad_glLogicOp; -PFNGLUNIFORM4UIPROC glad_glUniform4ui; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -PFNGLCULLFACEPROC glad_glCullFace; -PFNGLGETSTRINGIPROC glad_glGetStringi; -PFNGLATTACHSHADERPROC glad_glAttachShader; -PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -PFNGLDRAWELEMENTSPROC glad_glDrawElements; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -PFNGLUNIFORM1IVPROC glad_glUniform1iv; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -PFNGLREADBUFFERPROC glad_glReadBuffer; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -PFNGLBLENDCOLORPROC glad_glBlendColor; -PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -PFNGLISPROGRAMPROC glad_glIsProgram; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -PFNGLUNIFORM4IPROC glad_glUniform4i; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -PFNGLREADPIXELSPROC glad_glReadPixels; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -PFNGLUNIFORM4FPROC glad_glUniform4f; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -PFNGLSTENCILFUNCPROC glad_glStencilFunc; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -PFNGLCOLORP4UIPROC glad_glColorP4ui; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -PFNGLGENBUFFERSPROC glad_glGenBuffers; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -PFNGLBLENDFUNCPROC glad_glBlendFunc; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -PFNGLSCISSORPROC glad_glScissor; -PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -PFNGLCLEARCOLORPROC glad_glClearColor; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -PFNGLUNIFORM3UIPROC glad_glUniform3ui; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -PFNGLUNIFORM2FVPROC glad_glUniform2fv; -PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -PFNGLDEPTHFUNCPROC glad_glDepthFunc; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -PFNGLCOLORMASKPROC glad_glColorMask; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -PFNGLUNIFORM4FVPROC glad_glUniform4fv; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -PFNGLISSAMPLERPROC glad_glIsSampler; -PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -PFNGLDISABLEIPROC glad_glDisablei; -PFNGLSHADERSOURCEPROC glad_glShaderSource; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -PFNGLGETSYNCIVPROC glad_glGetSynciv; -PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -PFNGLBEGINQUERYPROC glad_glBeginQuery; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -PFNGLBINDBUFFERPROC glad_glBindBuffer; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -PFNGLBUFFERDATAPROC glad_glBufferData; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -PFNGLGETERRORPROC glad_glGetError; -PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -PFNGLGETFLOATVPROC glad_glGetFloatv; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -PFNGLGETINTEGERVPROC glad_glGetIntegerv; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -PFNGLISQUERYPROC glad_glIsQuery; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -PFNGLSTENCILMASKPROC glad_glStencilMask; -PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -PFNGLISTEXTUREPROC glad_glIsTexture; -PFNGLUNIFORM1FVPROC glad_glUniform1fv; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -PFNGLDEPTHMASKPROC glad_glDepthMask; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -PFNGLFRONTFACEPROC glad_glFrontFace; -int GLAD_GL_SGIX_pixel_tiles; -int GLAD_GL_NV_point_sprite; -int GLAD_GL_APPLE_element_array; -int GLAD_GL_AMD_multi_draw_indirect; -int GLAD_GL_EXT_blend_subtract; -int GLAD_GL_SGIX_tag_sample_buffer; -int GLAD_GL_IBM_texture_mirrored_repeat; -int GLAD_GL_APPLE_transform_hint; -int GLAD_GL_ATI_separate_stencil; -int GLAD_GL_NV_shader_atomic_int64; -int GLAD_GL_NV_vertex_program2_option; -int GLAD_GL_EXT_texture_buffer_object; -int GLAD_GL_ARB_vertex_blend; -int GLAD_GL_OVR_multiview; -int GLAD_GL_ARB_program_interface_query; -int GLAD_GL_EXT_misc_attribute; -int GLAD_GL_NV_multisample_coverage; -int GLAD_GL_ARB_shading_language_packing; -int GLAD_GL_EXT_texture_cube_map; -int GLAD_GL_NV_viewport_array2; -int GLAD_GL_KHR_robustness; -int GLAD_GL_EXT_index_func; -int GLAD_GL_OES_compressed_paletted_texture; -int GLAD_GL_NV_depth_clamp; -int GLAD_GL_NV_shader_buffer_load; -int GLAD_GL_EXT_color_subtable; -int GLAD_GL_SUNX_constant_data; -int GLAD_GL_EXT_multi_draw_arrays; -int GLAD_GL_ARB_shader_atomic_counters; -int GLAD_GL_ARB_arrays_of_arrays; -int GLAD_GL_NV_conditional_render; -int GLAD_GL_EXT_texture_env_combine; -int GLAD_GL_AMD_depth_clamp_separate; -int GLAD_GL_SGIX_async_histogram; -int GLAD_GL_MESA_resize_buffers; -int GLAD_GL_ARB_sample_shading; -int GLAD_GL_NV_texture_env_combine4; -int GLAD_GL_ARB_texture_view; -int GLAD_GL_ARB_texture_env_combine; -int GLAD_GL_ARB_map_buffer_range; -int GLAD_GL_EXT_convolution; -int GLAD_GL_NV_compute_program5; -int GLAD_GL_EXT_paletted_texture; -int GLAD_GL_ARB_texture_buffer_object; -int GLAD_GL_SUN_triangle_list; -int GLAD_GL_SGIX_resample; -int GLAD_GL_SGIX_flush_raster; -int GLAD_GL_EXT_light_texture; -int GLAD_GL_ARB_point_sprite; -int GLAD_GL_ARB_sparse_texture2; -int GLAD_GL_ARB_half_float_pixel; -int GLAD_GL_NV_tessellation_program5; -int GLAD_GL_REND_screen_coordinates; -int GLAD_GL_HP_image_transform; -int GLAD_GL_EXT_packed_float; -int GLAD_GL_ATI_vertex_attrib_array_object; -int GLAD_GL_SGIX_vertex_preclip; -int GLAD_GL_SGIX_texture_scale_bias; -int GLAD_GL_AMD_draw_buffers_blend; -int GLAD_GL_APPLE_texture_range; -int GLAD_GL_SGIX_framezoom; -int GLAD_GL_NV_texture_barrier; -int GLAD_GL_ARB_texture_query_levels; -int GLAD_GL_EXT_blend_logic_op; -int GLAD_GL_EXT_texture_swizzle; -int GLAD_GL_ARB_texture_rg; -int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; -int GLAD_GL_ARB_fragment_shader; -int GLAD_GL_3DFX_tbuffer; -int GLAD_GL_SGIX_ycrcb; -int GLAD_GL_IBM_cull_vertex; -int GLAD_GL_EXT_separate_shader_objects; -int GLAD_GL_NV_texture_multisample; -int GLAD_GL_ARB_shader_objects; -int GLAD_GL_ARB_framebuffer_object; -int GLAD_GL_ATI_envmap_bumpmap; -int GLAD_GL_ARB_robust_buffer_access_behavior; -int GLAD_GL_ARB_shader_stencil_export; -int GLAD_GL_AMD_sample_positions; -int GLAD_GL_ARB_enhanced_layouts; -int GLAD_GL_ARB_texture_rectangle; -int GLAD_GL_SGI_texture_color_table; -int GLAD_GL_ATI_map_object_buffer; -int GLAD_GL_ARB_robustness; -int GLAD_GL_NV_pixel_data_range; -int GLAD_GL_EXT_framebuffer_blit; -int GLAD_GL_ARB_gpu_shader_fp64; -int GLAD_GL_NV_command_list; -int GLAD_GL_ARB_window_pos; -int GLAD_GL_ARB_robustness_isolation; -int GLAD_GL_GREMEDY_string_marker; -int GLAD_GL_ARB_texture_compression_bptc; -int GLAD_GL_EXT_subtexture; -int GLAD_GL_EXT_pixel_transform_color_table; -int GLAD_GL_EXT_texture_compression_rgtc; -int GLAD_GL_ARB_shadow; -int GLAD_GL_SGIX_depth_pass_instrument; -int GLAD_GL_NVX_conditional_render; -int GLAD_GL_NV_evaluators; -int GLAD_GL_SGIS_texture_filter4; -int GLAD_GL_AMD_performance_monitor; -int GLAD_GL_NV_geometry_shader4; -int GLAD_GL_EXT_stencil_clear_tag; -int GLAD_GL_NV_vertex_program1_1; -int GLAD_GL_NV_present_video; -int GLAD_GL_ARB_texture_compression_rgtc; -int GLAD_GL_ARB_texture_filter_minmax; -int GLAD_GL_HP_convolution_border_modes; -int GLAD_GL_EXT_gpu_program_parameters; -int GLAD_GL_SGIX_list_priority; -int GLAD_GL_ARB_stencil_texturing; -int GLAD_GL_ARB_shader_clock; -int GLAD_GL_NV_shader_atomic_fp16_vector; -int GLAD_GL_SGIX_fog_offset; -int GLAD_GL_ARB_draw_elements_base_vertex; -int GLAD_GL_INGR_interlace_read; -int GLAD_GL_NV_transform_feedback; -int GLAD_GL_EXT_post_depth_coverage; -int GLAD_GL_ARB_debug_output; -int GLAD_GL_AMD_stencil_operation_extended; -int GLAD_GL_ARB_compatibility; -int GLAD_GL_ARB_instanced_arrays; -int GLAD_GL_ARB_get_texture_sub_image; -int GLAD_GL_NV_vertex_array_range2; -int GLAD_GL_ARB_texture_stencil8; -int GLAD_GL_AMD_sparse_texture; -int GLAD_GL_ARB_clip_control; -int GLAD_GL_NV_fragment_coverage_to_color; -int GLAD_GL_NV_fence; -int GLAD_GL_ARB_texture_buffer_range; -int GLAD_GL_SUN_mesh_array; -int GLAD_GL_ARB_vertex_attrib_binding; -int GLAD_GL_EXT_texture_compression_s3tc; -int GLAD_GL_ARB_cl_event; -int GLAD_GL_ARB_derivative_control; -int GLAD_GL_NV_packed_depth_stencil; -int GLAD_GL_OES_single_precision; -int GLAD_GL_NV_primitive_restart; -int GLAD_GL_ARB_fragment_shader_interlock; -int GLAD_GL_EXT_texture_object; -int GLAD_GL_AMD_name_gen_delete; -int GLAD_GL_NV_texture_compression_vtc; -int GLAD_GL_NV_sample_mask_override_coverage; -int GLAD_GL_NV_texture_shader3; -int GLAD_GL_NV_texture_shader2; -int GLAD_GL_EXT_texture; -int GLAD_GL_ARB_buffer_storage; -int GLAD_GL_AMD_shader_atomic_counter_ops; -int GLAD_GL_APPLE_vertex_program_evaluators; -int GLAD_GL_ARB_multi_bind; -int GLAD_GL_ARB_explicit_uniform_location; -int GLAD_GL_ARB_depth_buffer_float; -int GLAD_GL_NV_path_rendering_shared_edge; -int GLAD_GL_SGIX_shadow_ambient; -int GLAD_GL_ARB_texture_cube_map; -int GLAD_GL_AMD_vertex_shader_viewport_index; -int GLAD_GL_EXT_shader_integer_mix; -int GLAD_GL_NV_vertex_buffer_unified_memory; -int GLAD_GL_EXT_fog_coord; -int GLAD_GL_EXT_texture_env_dot3; -int GLAD_GL_ATI_texture_env_combine3; -int GLAD_GL_ARB_map_buffer_alignment; -int GLAD_GL_NV_blend_equation_advanced; -int GLAD_GL_SGIS_sharpen_texture; -int GLAD_GL_KHR_robust_buffer_access_behavior; -int GLAD_GL_ARB_pipeline_statistics_query; -int GLAD_GL_ARB_vertex_program; -int GLAD_GL_ARB_texture_rgb10_a2ui; -int GLAD_GL_OML_interlace; -int GLAD_GL_ATI_pixel_format_float; -int GLAD_GL_ARB_vertex_buffer_object; -int GLAD_GL_EXT_shadow_funcs; -int GLAD_GL_ATI_text_fragment_shader; -int GLAD_GL_NV_vertex_array_range; -int GLAD_GL_SGIX_fragment_lighting; -int GLAD_GL_NV_texture_expand_normal; -int GLAD_GL_NV_framebuffer_multisample_coverage; -int GLAD_GL_ARB_framebuffer_no_attachments; -int GLAD_GL_EXT_timer_query; -int GLAD_GL_EXT_vertex_array_bgra; -int GLAD_GL_NV_bindless_texture; -int GLAD_GL_KHR_debug; -int GLAD_GL_SGIS_texture_border_clamp; -int GLAD_GL_OML_subsample; -int GLAD_GL_SGIX_clipmap; -int GLAD_GL_EXT_geometry_shader4; -int GLAD_GL_ARB_shader_texture_image_samples; -int GLAD_GL_MESA_ycbcr_texture; -int GLAD_GL_MESAX_texture_stack; -int GLAD_GL_AMD_seamless_cubemap_per_texture; -int GLAD_GL_EXT_bindable_uniform; -int GLAD_GL_KHR_texture_compression_astc_hdr; -int GLAD_GL_ARB_shader_ballot; -int GLAD_GL_KHR_blend_equation_advanced; -int GLAD_GL_ARB_fragment_program_shadow; -int GLAD_GL_ATI_element_array; -int GLAD_GL_ARB_sparse_texture_clamp; -int GLAD_GL_AMD_texture_texture4; -int GLAD_GL_SGIX_reference_plane; -int GLAD_GL_EXT_stencil_two_side; -int GLAD_GL_ARB_transform_feedback_overflow_query; -int GLAD_GL_SGIX_texture_lod_bias; -int GLAD_GL_KHR_no_error; -int GLAD_GL_NV_explicit_multisample; -int GLAD_GL_IBM_static_data; -int GLAD_GL_EXT_clip_volume_hint; -int GLAD_GL_EXT_texture_perturb_normal; -int GLAD_GL_NV_fragment_program2; -int GLAD_GL_NV_fragment_program4; -int GLAD_GL_EXT_point_parameters; -int GLAD_GL_PGI_misc_hints; -int GLAD_GL_SGIX_subsample; -int GLAD_GL_AMD_shader_stencil_export; -int GLAD_GL_ARB_shader_texture_lod; -int GLAD_GL_ARB_vertex_shader; -int GLAD_GL_ARB_depth_clamp; -int GLAD_GL_SGIS_texture_select; -int GLAD_GL_NV_texture_shader; -int GLAD_GL_ARB_tessellation_shader; -int GLAD_GL_EXT_draw_buffers2; -int GLAD_GL_ARB_vertex_attrib_64bit; -int GLAD_GL_EXT_texture_filter_minmax; -int GLAD_GL_ARB_texture_gather; -int GLAD_GL_AMD_interleaved_elements; -int GLAD_GL_ARB_fragment_program; -int GLAD_GL_OML_resample; -int GLAD_GL_APPLE_ycbcr_422; -int GLAD_GL_SGIX_texture_add_env; -int GLAD_GL_ARB_shadow_ambient; -int GLAD_GL_ARB_texture_storage; -int GLAD_GL_EXT_pixel_buffer_object; -int GLAD_GL_NV_vertex_program; -int GLAD_GL_SGIS_pixel_texture; -int GLAD_GL_SGIS_generate_mipmap; -int GLAD_GL_SGIX_instruments; -int GLAD_GL_ARB_fragment_layer_viewport; -int GLAD_GL_ARB_shader_storage_buffer_object; -int GLAD_GL_EXT_sparse_texture2; -int GLAD_GL_EXT_blend_minmax; -int GLAD_GL_MESA_pack_invert; -int GLAD_GL_ARB_base_instance; -int GLAD_GL_SUN_global_alpha; -int GLAD_GL_PGI_vertex_hints; -int GLAD_GL_AMD_transform_feedback4; -int GLAD_GL_ARB_ES3_1_compatibility; -int GLAD_GL_EXT_texture_integer; -int GLAD_GL_ARB_texture_multisample; -int GLAD_GL_AMD_gpu_shader_int64; -int GLAD_GL_S3_s3tc; -int GLAD_GL_ARB_query_buffer_object; -int GLAD_GL_AMD_vertex_shader_tessellator; -int GLAD_GL_ARB_invalidate_subdata; -int GLAD_GL_ARB_draw_indirect; -int GLAD_GL_ARB_transform_feedback2; -int GLAD_GL_EXT_index_material; -int GLAD_GL_NV_blend_equation_advanced_coherent; -int GLAD_GL_ARB_texture_non_power_of_two; -int GLAD_GL_KHR_texture_compression_astc_sliced_3d; -int GLAD_GL_ATI_draw_buffers; -int GLAD_GL_EXT_cmyka; -int GLAD_GL_SGIX_pixel_texture; -int GLAD_GL_APPLE_specular_vector; -int GLAD_GL_ARB_seamless_cubemap_per_texture; -int GLAD_GL_ARB_conservative_depth; -int GLAD_GL_SGIX_interlace; -int GLAD_GL_NV_parameter_buffer_object; -int GLAD_GL_AMD_shader_trinary_minmax; -int GLAD_GL_EXT_texture_lod_bias; -int GLAD_GL_EXT_rescale_normal; -int GLAD_GL_ARB_pixel_buffer_object; -int GLAD_GL_ARB_uniform_buffer_object; -int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; -int GLAD_GL_ARB_texture_swizzle; -int GLAD_GL_ARB_texture_compression; -int GLAD_GL_SGIX_async_pixel; -int GLAD_GL_NV_fragment_program_option; -int GLAD_GL_ARB_explicit_attrib_location; -int GLAD_GL_EXT_blend_color; -int GLAD_GL_NV_shader_thread_group; -int GLAD_GL_EXT_stencil_wrap; -int GLAD_GL_EXT_index_array_formats; -int GLAD_GL_OVR_multiview2; -int GLAD_GL_EXT_histogram; -int GLAD_GL_EXT_polygon_offset; -int GLAD_GL_SGIS_point_parameters; -int GLAD_GL_EXT_direct_state_access; -int GLAD_GL_ARB_shader_group_vote; -int GLAD_GL_NV_texture_rectangle; -int GLAD_GL_ARB_copy_image; -int GLAD_GL_NV_shader_thread_shuffle; -int GLAD_GL_ARB_shader_precision; -int GLAD_GL_EXT_vertex_shader; -int GLAD_GL_EXT_blend_func_separate; -int GLAD_GL_APPLE_fence; -int GLAD_GL_OES_byte_coordinates; -int GLAD_GL_ARB_transpose_matrix; -int GLAD_GL_ARB_provoking_vertex; -int GLAD_GL_NV_uniform_buffer_unified_memory; -int GLAD_GL_NV_fragment_shader_interlock; -int GLAD_GL_EXT_vertex_array; -int GLAD_GL_ARB_half_float_vertex; -int GLAD_GL_EXT_blend_equation_separate; -int GLAD_GL_NV_framebuffer_mixed_samples; -int GLAD_GL_ARB_multi_draw_indirect; -int GLAD_GL_EXT_raster_multisample; -int GLAD_GL_NV_copy_image; -int GLAD_GL_NV_geometry_shader_passthrough; -int GLAD_GL_INTEL_framebuffer_CMAA; -int GLAD_GL_SGIX_convolution_accuracy; -int GLAD_GL_ARB_transform_feedback3; -int GLAD_GL_SGIX_ycrcba; -int GLAD_GL_EXT_debug_marker; -int GLAD_GL_EXT_bgra; -int GLAD_GL_INTEL_parallel_arrays; -int GLAD_GL_EXT_pixel_transform; -int GLAD_GL_NV_vertex_attrib_integer_64bit; -int GLAD_GL_ATI_fragment_shader; -int GLAD_GL_ARB_vertex_array_object; -int GLAD_GL_ATI_pn_triangles; -int GLAD_GL_EXT_texture_env_add; -int GLAD_GL_EXT_packed_depth_stencil; -int GLAD_GL_EXT_texture_mirror_clamp; -int GLAD_GL_NV_multisample_filter_hint; -int GLAD_GL_INTEL_performance_query; -int GLAD_GL_ARB_transform_feedback_instanced; -int GLAD_GL_SGIX_async; -int GLAD_GL_EXT_texture_compression_latc; -int GLAD_GL_NV_shader_atomic_float; -int GLAD_GL_ARB_shading_language_100; -int GLAD_GL_APPLE_float_pixels; -int GLAD_GL_ARB_texture_mirror_clamp_to_edge; -int GLAD_GL_NV_vertex_program2; -int GLAD_GL_NV_bindless_multi_draw_indirect_count; -int GLAD_GL_ARB_depth_texture; -int GLAD_GL_ARB_ES2_compatibility; -int GLAD_GL_ARB_indirect_parameters; -int GLAD_GL_NV_half_float; -int GLAD_GL_ARB_ES3_2_compatibility; -int GLAD_GL_ATI_texture_mirror_once; -int GLAD_GL_IBM_rasterpos_clip; -int GLAD_GL_SGIX_shadow; -int GLAD_GL_EXT_polygon_offset_clamp; -int GLAD_GL_NV_deep_texture3D; -int GLAD_GL_ARB_shader_draw_parameters; -int GLAD_GL_SGIX_calligraphic_fragment; -int GLAD_GL_ARB_shader_bit_encoding; -int GLAD_GL_EXT_compiled_vertex_array; -int GLAD_GL_NV_depth_buffer_float; -int GLAD_GL_APPLE_flush_buffer_range; -int GLAD_GL_ARB_imaging; -int GLAD_GL_ARB_draw_buffers_blend; -int GLAD_GL_AMD_gcn_shader; -int GLAD_GL_AMD_blend_minmax_factor; -int GLAD_GL_EXT_texture_sRGB_decode; -int GLAD_GL_ARB_shading_language_420pack; -int GLAD_GL_ARB_shader_viewport_layer_array; -int GLAD_GL_ATI_meminfo; -int GLAD_GL_EXT_abgr; -int GLAD_GL_AMD_pinned_memory; -int GLAD_GL_EXT_texture_snorm; -int GLAD_GL_SGIX_texture_coordinate_clamp; -int GLAD_GL_ARB_clear_buffer_object; -int GLAD_GL_ARB_multisample; -int GLAD_GL_EXT_debug_label; -int GLAD_GL_NV_light_max_exponent; -int GLAD_GL_NV_internalformat_sample_query; -int GLAD_GL_INTEL_map_texture; -int GLAD_GL_ARB_texture_env_crossbar; -int GLAD_GL_EXT_422_pixels; -int GLAD_GL_ARB_compute_shader; -int GLAD_GL_NV_texgen_emboss; -int GLAD_GL_ARB_blend_func_extended; -int GLAD_GL_IBM_vertex_array_lists; -int GLAD_GL_ARB_color_buffer_float; -int GLAD_GL_ARB_bindless_texture; -int GLAD_GL_SGIX_depth_texture; -int GLAD_GL_ARB_internalformat_query; -int GLAD_GL_ARB_shader_atomic_counter_ops; -int GLAD_GL_ARB_texture_mirrored_repeat; -int GLAD_GL_EXT_shader_image_load_store; -int GLAD_GL_EXT_copy_texture; -int GLAD_GL_NV_register_combiners2; -int GLAD_GL_SGIX_ycrcb_subsample; -int GLAD_GL_ARB_copy_buffer; -int GLAD_GL_NV_draw_texture; -int GLAD_GL_EXT_texture_shared_exponent; -int GLAD_GL_EXT_draw_instanced; -int GLAD_GL_NV_copy_depth_to_color; -int GLAD_GL_ARB_viewport_array; -int GLAD_GL_ARB_separate_shader_objects; -int GLAD_GL_EXT_multisample; -int GLAD_GL_EXT_depth_bounds_test; -int GLAD_GL_EXT_shared_texture_palette; -int GLAD_GL_ARB_texture_env_add; -int GLAD_GL_NV_video_capture; -int GLAD_GL_ARB_sampler_objects; -int GLAD_GL_ARB_matrix_palette; -int GLAD_GL_SGIS_texture_color_mask; -int GLAD_GL_EXT_packed_pixels; -int GLAD_GL_EXT_coordinate_frame; -int GLAD_GL_NV_transform_feedback2; -int GLAD_GL_APPLE_aux_depth_stencil; -int GLAD_GL_ARB_shader_subroutine; -int GLAD_GL_EXT_framebuffer_sRGB; -int GLAD_GL_ARB_texture_storage_multisample; -int GLAD_GL_KHR_blend_equation_advanced_coherent; -int GLAD_GL_EXT_vertex_attrib_64bit; -int GLAD_GL_HP_texture_lighting; -int GLAD_GL_NV_shader_buffer_store; -int GLAD_GL_OES_query_matrix; -int GLAD_GL_MESA_window_pos; -int GLAD_GL_NV_fill_rectangle; -int GLAD_GL_NV_shader_storage_buffer_object; -int GLAD_GL_ARB_texture_query_lod; -int GLAD_GL_SGIX_ir_instrument1; -int GLAD_GL_ARB_shader_image_size; -int GLAD_GL_NV_shader_atomic_counters; -int GLAD_GL_APPLE_object_purgeable; -int GLAD_GL_ARB_occlusion_query; -int GLAD_GL_INGR_color_clamp; -int GLAD_GL_SGI_color_table; -int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -int GLAD_GL_ARB_texture_cube_map_array; -int GLAD_GL_AMD_debug_output; -int GLAD_GL_EXT_gpu_shader4; -int GLAD_GL_NV_geometry_program4; -int GLAD_GL_NV_gpu_program5_mem_extended; -int GLAD_GL_SGIX_scalebias_hint; -int GLAD_GL_ARB_texture_border_clamp; -int GLAD_GL_ARB_fragment_coord_conventions; -int GLAD_GL_SGIX_polynomial_ffd; -int GLAD_GL_EXT_provoking_vertex; -int GLAD_GL_ARB_point_parameters; -int GLAD_GL_ARB_shader_image_load_store; -int GLAD_GL_ARB_conditional_render_inverted; -int GLAD_GL_HP_occlusion_test; -int GLAD_GL_ARB_ES3_compatibility; -int GLAD_GL_EXT_texture_array; -int GLAD_GL_ARB_texture_buffer_object_rgb32; -int GLAD_GL_NV_bindless_multi_draw_indirect; -int GLAD_GL_SGIX_texture_multi_buffer; -int GLAD_GL_EXT_transform_feedback; -int GLAD_GL_KHR_texture_compression_astc_ldr; -int GLAD_GL_3DFX_multisample; -int GLAD_GL_INTEL_fragment_shader_ordering; -int GLAD_GL_ARB_texture_env_dot3; -int GLAD_GL_NV_gpu_program4; -int GLAD_GL_NV_gpu_program5; -int GLAD_GL_NV_float_buffer; -int GLAD_GL_SGIS_texture_edge_clamp; -int GLAD_GL_ARB_framebuffer_sRGB; -int GLAD_GL_SUN_slice_accum; -int GLAD_GL_EXT_index_texture; -int GLAD_GL_EXT_shader_image_load_formatted; -int GLAD_GL_ARB_geometry_shader4; -int GLAD_GL_EXT_separate_specular_color; -int GLAD_GL_NV_fog_distance; -int GLAD_GL_NV_conservative_raster; -int GLAD_GL_SUN_convolution_border_modes; -int GLAD_GL_SGIX_sprite; -int GLAD_GL_ARB_get_program_binary; -int GLAD_GL_ARB_timer_query; -int GLAD_GL_AMD_occlusion_query_event; -int GLAD_GL_SGIS_multisample; -int GLAD_GL_EXT_framebuffer_object; -int GLAD_GL_EXT_vertex_weighting; -int GLAD_GL_ARB_vertex_array_bgra; -int GLAD_GL_APPLE_vertex_array_range; -int GLAD_GL_AMD_query_buffer_object; -int GLAD_GL_NV_register_combiners; -int GLAD_GL_ARB_draw_buffers; -int GLAD_GL_ARB_clear_texture; -int GLAD_GL_NV_fragment_program; -int GLAD_GL_SGI_color_matrix; -int GLAD_GL_EXT_cull_vertex; -int GLAD_GL_EXT_texture_sRGB; -int GLAD_GL_APPLE_row_bytes; -int GLAD_GL_NV_texgen_reflection; -int GLAD_GL_IBM_multimode_draw_arrays; -int GLAD_GL_APPLE_vertex_array_object; -int GLAD_GL_3DFX_texture_compression_FXT1; -int GLAD_GL_GREMEDY_frame_terminator; -int GLAD_GL_AMD_conservative_depth; -int GLAD_GL_ARB_texture_float; -int GLAD_GL_ARB_compressed_texture_pixel_storage; -int GLAD_GL_SGIS_detail_texture; -int GLAD_GL_ARB_draw_instanced; -int GLAD_GL_OES_read_format; -int GLAD_GL_ATI_texture_float; -int GLAD_GL_WIN_specular_fog; -int GLAD_GL_AMD_vertex_shader_layer; -int GLAD_GL_ARB_shading_language_include; -int GLAD_GL_APPLE_client_storage; -int GLAD_GL_WIN_phong_shading; -int GLAD_GL_INGR_blend_func_separate; -int GLAD_GL_NV_path_rendering; -int GLAD_GL_NV_conservative_raster_dilate; -int GLAD_GL_ARB_texture_barrier; -int GLAD_GL_ATI_vertex_streams; -int GLAD_GL_ARB_post_depth_coverage; -int GLAD_GL_NV_occlusion_query; -int GLAD_GL_APPLE_rgb_422; -int GLAD_GL_ARB_direct_state_access; -int GLAD_GL_ARB_gpu_shader_int64; -int GLAD_GL_ARB_seamless_cube_map; -int GLAD_GL_ARB_cull_distance; -int GLAD_GL_NV_vdpau_interop; -int GLAD_GL_ARB_occlusion_query2; -int GLAD_GL_ARB_internalformat_query2; -int GLAD_GL_EXT_texture_filter_anisotropic; -int GLAD_GL_SUN_vertex; -int GLAD_GL_ARB_sparse_texture; -int GLAD_GL_SGIS_texture_lod; -int GLAD_GL_NV_vertex_program3; -int GLAD_GL_NV_gpu_shader5; -int GLAD_GL_NV_vertex_program4; -int GLAD_GL_AMD_transform_feedback3_lines_triangles; -int GLAD_GL_SGIS_fog_function; -int GLAD_GL_EXT_x11_sync_object; -int GLAD_GL_ARB_sync; -int GLAD_GL_NV_sample_locations; -int GLAD_GL_ARB_compute_variable_group_size; -int GLAD_GL_OES_fixed_point; -int GLAD_GL_NV_blend_square; -int GLAD_GL_EXT_framebuffer_multisample; -int GLAD_GL_ARB_gpu_shader5; -int GLAD_GL_SGIS_texture4D; -int GLAD_GL_EXT_texture3D; -int GLAD_GL_ARB_multitexture; -int GLAD_GL_EXT_secondary_color; -int GLAD_GL_NV_parameter_buffer_object2; -int GLAD_GL_ATI_vertex_array_object; -int GLAD_GL_ARB_parallel_shader_compile; -int GLAD_GL_NVX_gpu_memory_info; -int GLAD_GL_SGIX_igloo_interface; -int GLAD_GL_SGIS_point_line_texgen; -int GLAD_GL_ARB_sample_locations; -int GLAD_GL_ARB_sparse_buffer; -int GLAD_GL_EXT_draw_range_elements; -int GLAD_GL_SGIX_blend_alpha_minmax; -int GLAD_GL_KHR_context_flush_control; -PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; -PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; -PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; -PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; -PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; -PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; -PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; -PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; -PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; -PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; -PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; -PFNGLWEIGHTIVARBPROC glad_glWeightivARB; -PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; -PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; -PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; -PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; -PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; -PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; -PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; -PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; -PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; -PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; -PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; -PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; -PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; -PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; -PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; -PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; -PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; -PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; -PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; -PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; -PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; -PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; -PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; -PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; -PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; -PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; -PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; -PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; -PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; -PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; -PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; -PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; -PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; -PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; -PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; -PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; -PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; -PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; -PFNGLTEXTUREVIEWPROC glad_glTextureView; -PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; -PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; -PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; -PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; -PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; -PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; -PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; -PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; -PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; -PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; -PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; -PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; -PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; -PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; -PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; -PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; -PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; -PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; -PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; -PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; -PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; -PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; -PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; -PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; -PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; -PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; -PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; -PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; -PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; -PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; -PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; -PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; -PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; -PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; -PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; -PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; -PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; -PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; -PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; -PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; -PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; -PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; -PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; -PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; -PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; -PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; -PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; -PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; -PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; -PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; -PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; -PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; -PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; -PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; -PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; -PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; -PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; -PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; -PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; -PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; -PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; -PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; -PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; -PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; -PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; -PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; -PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; -PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; -PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; -PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; -PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; -PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; -PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; -PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; -PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; -PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; -PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; -PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; -PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; -PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; -PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; -PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; -PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; -PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; -PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; -PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; -PFNGLGETHANDLEARBPROC glad_glGetHandleARB; -PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; -PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; -PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; -PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; -PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; -PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; -PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; -PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; -PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; -PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; -PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; -PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; -PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; -PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; -PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; -PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; -PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; -PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; -PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; -PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; -PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; -PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; -PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; -PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; -PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; -PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; -PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; -PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; -PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; -PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; -PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; -PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; -PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; -PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; -PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; -PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; -PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; -PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; -PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; -PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; -PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; -PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; -PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; -PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; -PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; -PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -PFNGLUNIFORM1DPROC glad_glUniform1d; -PFNGLUNIFORM2DPROC glad_glUniform2d; -PFNGLUNIFORM3DPROC glad_glUniform3d; -PFNGLUNIFORM4DPROC glad_glUniform4d; -PFNGLUNIFORM1DVPROC glad_glUniform1dv; -PFNGLUNIFORM2DVPROC glad_glUniform2dv; -PFNGLUNIFORM3DVPROC glad_glUniform3dv; -PFNGLUNIFORM4DVPROC glad_glUniform4dv; -PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; -PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; -PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; -PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; -PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; -PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; -PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; -PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; -PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; -PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; -PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; -PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; -PFNGLISSTATENVPROC glad_glIsStateNV; -PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; -PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; -PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; -PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; -PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; -PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; -PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; -PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; -PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; -PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; -PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; -PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; -PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; -PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; -PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; -PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; -PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; -PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; -PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; -PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; -PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; -PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; -PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; -PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; -PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; -PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; -PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; -PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; -PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; -PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; -PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; -PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; -PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; -PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; -PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; -PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; -PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; -PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; -PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; -PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; -PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; -PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; -PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; -PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; -PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; -PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; -PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; -PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; -PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; -PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; -PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; -PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; -PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; -PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; -PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; -PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; -PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; -PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; -PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; -PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; -PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; -PFNGLREADNPIXELSPROC glad_glReadnPixels; -PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; -PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; -PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; -PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; -PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; -PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; -PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; -PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; -PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; -PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; -PFNGLCLIPCONTROLPROC glad_glClipControl; -PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; -PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; -PFNGLGENFENCESNVPROC glad_glGenFencesNV; -PFNGLISFENCENVPROC glad_glIsFenceNV; -PFNGLTESTFENCENVPROC glad_glTestFenceNV; -PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; -PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; -PFNGLSETFENCENVPROC glad_glSetFenceNV; -PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; -PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; -PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; -PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; -PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; -PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; -PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; -PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; -PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; -PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; -PFNGLORTHOFOESPROC glad_glOrthofOES; -PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; -PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; -PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; -PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; -PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; -PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; -PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; -PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; -PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; -PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; -PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; -PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; -PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; -PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; -PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; -PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; -PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; -PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; -PFNGLISNAMEAMDPROC glad_glIsNameAMD; -PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; -PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; -PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; -PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; -PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; -PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; -PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; -PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; -PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; -PFNGLBINDTEXTURESPROC glad_glBindTextures; -PFNGLBINDSAMPLERSPROC glad_glBindSamplers; -PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; -PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; -PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; -PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; -PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; -PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; -PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; -PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; -PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; -PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; -PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; -PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; -PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; -PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; -PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; -PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; -PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; -PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; -PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; -PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; -PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; -PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; -PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; -PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; -PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -PFNGLISBUFFERARBPROC glad_glIsBufferARB; -PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; -PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; -PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; -PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; -PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; -PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; -PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; -PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; -PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; -PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; -PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; -PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; -PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; -PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; -PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; -PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; -PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; -PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; -PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; -PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; -PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; -PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; -PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; -PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; -PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; -PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; -PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; -PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; -PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -PFNGLOBJECTLABELPROC glad_glObjectLabel; -PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -PFNGLGETPOINTERVPROC glad_glGetPointerv; -PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; -PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; -PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; -PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; -PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; -PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; -PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; -PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; -PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; -PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; -PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; -PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; -PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; -PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; -PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; -PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; -PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; -PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; -PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; -PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; -PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; -PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; -PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; -PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; -PFNGLHINTPGIPROC glad_glHintPGI; -PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; -PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; -PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; -PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; -PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; -PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; -PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; -PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; -PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; -PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; -PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; -PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; -PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; -PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; -PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; -PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; -PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; -PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; -PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; -PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; -PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; -PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; -PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; -PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; -PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; -PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; -PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; -PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; -PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; -PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; -PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; -PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; -PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; -PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; -PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; -PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; -PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; -PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; -PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; -PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; -PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; -PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; -PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; -PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; -PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; -PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; -PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; -PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; -PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; -PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; -PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; -PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; -PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; -PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; -PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; -PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; -PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; -PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; -PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; -PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; -PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; -PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; -PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; -PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; -PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; -PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; -PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; -PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; -PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; -PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; -PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; -PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; -PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; -PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; -PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; -PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; -PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; -PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; -PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; -PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; -PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; -PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; -PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; -PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; -PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; -PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; -PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; -PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; -PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; -PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; -PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; -PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; -PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; -PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; -PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; -PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; -PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; -PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; -PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; -PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; -PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; -PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; -PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; -PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; -PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; -PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; -PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; -PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; -PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; -PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; -PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; -PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; -PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; -PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; -PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; -PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; -PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; -PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; -PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; -PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; -PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; -PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; -PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; -PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; -PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; -PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; -PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; -PFNGLCREATETEXTURESPROC glad_glCreateTextures; -PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; -PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; -PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; -PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; -PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; -PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; -PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; -PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; -PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; -PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; -PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; -PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; -PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; -PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; -PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; -PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; -PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; -PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; -PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; -PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; -PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; -PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; -PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; -PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; -PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; -PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; -PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; -PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; -PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; -PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; -PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; -PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; -PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; -PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; -PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; -PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; -PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; -PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; -PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; -PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; -PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; -PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; -PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; -PFNGLCREATEQUERIESPROC glad_glCreateQueries; -PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; -PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; -PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; -PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; -PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; -PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; -PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; -PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; -PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; -PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; -PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; -PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; -PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; -PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; -PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; -PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; -PFNGLMINMAXEXTPROC glad_glMinmaxEXT; -PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; -PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; -PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; -PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; -PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; -PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; -PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; -PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; -PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; -PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; -PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; -PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; -PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; -PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; -PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; -PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; -PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; -PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; -PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; -PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; -PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; -PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; -PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; -PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; -PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; -PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; -PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; -PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; -PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; -PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; -PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; -PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; -PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; -PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; -PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; -PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; -PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; -PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; -PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; -PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; -PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; -PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; -PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; -PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; -PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; -PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; -PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; -PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; -PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; -PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; -PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; -PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; -PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; -PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; -PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; -PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; -PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; -PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; -PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; -PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; -PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; -PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; -PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; -PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; -PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; -PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; -PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; -PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; -PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; -PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; -PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; -PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; -PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; -PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; -PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; -PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; -PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; -PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; -PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; -PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; -PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; -PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; -PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; -PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; -PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; -PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; -PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; -PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; -PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; -PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; -PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; -PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; -PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; -PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; -PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; -PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; -PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; -PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; -PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; -PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; -PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; -PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; -PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; -PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; -PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; -PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; -PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; -PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; -PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; -PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; -PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; -PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; -PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; -PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; -PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; -PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; -PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; -PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; -PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; -PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; -PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; -PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; -PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; -PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; -PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; -PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; -PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; -PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; -PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; -PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; -PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; -PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; -PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; -PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; -PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; -PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; -PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; -PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; -PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; -PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; -PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; -PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; -PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; -PFNGLISPROGRAMNVPROC glad_glIsProgramNV; -PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; -PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; -PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; -PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; -PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; -PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; -PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; -PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; -PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; -PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; -PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; -PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; -PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; -PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; -PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; -PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; -PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; -PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; -PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; -PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; -PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; -PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; -PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; -PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; -PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; -PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; -PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; -PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; -PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; -PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; -PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; -PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; -PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; -PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; -PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; -PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; -PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; -PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; -PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; -PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; -PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; -PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; -PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; -PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; -PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; -PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; -PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; -PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; -PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; -PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; -PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; -PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; -PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; -PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; -PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; -PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; -PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; -PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; -PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; -PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; -PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; -PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; -PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; -PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; -PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; -PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; -PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; -PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; -PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; -PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; -PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; -PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; -PFNGLVERTEX2BOESPROC glad_glVertex2bOES; -PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; -PFNGLVERTEX3BOESPROC glad_glVertex3bOES; -PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; -PFNGLVERTEX4BOESPROC glad_glVertex4bOES; -PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; -PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; -PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; -PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; -PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; -PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; -PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; -PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; -PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; -PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; -PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; -PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; -PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; -PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; -PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; -PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; -PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; -PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; -PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; -PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; -PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; -PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; -PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; -PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; -PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; -PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; -PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; -PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; -PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; -PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; -PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; -PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; -PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; -PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; -PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; -PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; -PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; -PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; -PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; -PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; -PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; -PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; -PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; -PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; -PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; -PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; -PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; -PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; -PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; -PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; -PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; -PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; -PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; -PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; -PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; -PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -PFNGLSHADERBINARYPROC glad_glShaderBinary; -PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; -PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; -PFNGLVERTEX2HNVPROC glad_glVertex2hNV; -PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; -PFNGLVERTEX3HNVPROC glad_glVertex3hNV; -PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; -PFNGLVERTEX4HNVPROC glad_glVertex4hNV; -PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; -PFNGLNORMAL3HNVPROC glad_glNormal3hNV; -PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; -PFNGLCOLOR3HNVPROC glad_glColor3hNV; -PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; -PFNGLCOLOR4HNVPROC glad_glColor4hNV; -PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; -PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; -PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; -PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; -PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; -PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; -PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; -PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; -PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; -PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; -PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; -PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; -PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; -PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; -PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; -PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; -PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; -PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; -PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; -PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; -PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; -PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; -PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; -PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; -PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; -PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; -PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; -PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; -PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; -PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; -PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; -PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; -PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; -PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; -PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; -PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; -PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; -PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; -PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; -PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; -PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; -PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; -PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; -PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; -PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; -PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; -PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; -PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; -PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; -PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; -PFNGLCOLORTABLEPROC glad_glColorTable; -PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; -PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; -PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; -PFNGLGETCOLORTABLEPROC glad_glGetColorTable; -PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; -PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; -PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; -PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; -PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; -PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; -PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; -PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; -PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; -PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; -PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; -PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; -PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; -PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; -PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; -PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; -PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; -PFNGLGETHISTOGRAMPROC glad_glGetHistogram; -PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; -PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; -PFNGLGETMINMAXPROC glad_glGetMinmax; -PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; -PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; -PFNGLHISTOGRAMPROC glad_glHistogram; -PFNGLMINMAXPROC glad_glMinmax; -PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; -PFNGLRESETMINMAXPROC glad_glResetMinmax; -PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; -PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; -PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; -PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; -PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; -PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; -PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; -PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; -PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; -PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; -PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; -PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; -PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; -PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; -PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; -PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; -PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; -PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; -PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; -PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; -PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; -PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; -PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; -PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; -PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; -PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; -PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; -PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; -PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; -PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; -PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; -PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; -PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; -PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; -PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; -PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; -PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; -PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; -PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; -PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; -PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; -PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; -PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; -PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; -PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; -PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; -PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; -PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; -PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; -PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; -PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; -PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; -PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; -PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; -PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; -PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; -PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; -PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; -PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; -PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; -PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; -PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; -PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; -PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; -PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; -PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; -PFNGLGETFLOATI_VPROC glad_glGetFloati_v; -PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; -PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; -PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; -PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; -PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; -PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; -PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; -PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; -PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; -PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; -PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; -PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; -PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; -PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; -PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; -PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; -PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; -PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; -PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; -PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; -PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; -PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; -PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; -PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; -PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; -PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; -PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; -PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; -PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; -PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; -PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; -PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; -PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; -PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; -PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; -PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; -PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; -PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; -PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; -PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; -PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; -PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; -PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; -PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; -PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; -PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; -PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; -PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; -PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; -PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; -PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; -PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; -PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; -PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; -PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; -PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; -PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; -PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; -PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; -PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; -PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; -PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; -PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; -PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; -PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; -PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; -PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; -PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; -PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; -PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; -PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; -PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; -PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; -PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; -PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; -PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; -PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; -PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; -PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; -PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; -PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; -PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; -PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; -PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; -PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; -PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; -PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; -PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; -PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; -PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; -PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; -PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; -PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; -PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; -PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; -PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; -PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; -PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; -PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; -PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; -PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; -PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; -PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; -PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; -PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; -PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; -PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; -PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; -PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; -PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; -PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; -PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; -PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; -PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; -PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; -PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; -PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; -PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; -PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; -PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; -PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; -PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; -PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; -PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; -PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; -PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; -PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; -PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; -PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; -PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; -PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; -PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; -PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; -PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; -PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; -PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; -PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; -PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; -PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; -PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; -PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; -PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; -PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; -PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; -PFNGLISQUERYARBPROC glad_glIsQueryARB; -PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; -PFNGLENDQUERYARBPROC glad_glEndQueryARB; -PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; -PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; -PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; -PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; -PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; -PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; -PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; -PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; -PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; -PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; -PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; -PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; -PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; -PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; -PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; -PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; -PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; -PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; -PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; -PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; -PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; -PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; -PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; -PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; -PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; -PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; -PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; -PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; -PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; -PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; -PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; -PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; -PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; -PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; -PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; -PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; -PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; -PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; -PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; -PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; -PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; -PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; -PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; -PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; -PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; -PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; -PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; -PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; -PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; -PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; -PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; -PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; -PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; -PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; -PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; -PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; -PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; -PFNGLDEFORMSGIXPROC glad_glDeformSGIX; -PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; -PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; -PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; -PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; -PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; -PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; -PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; -PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; -PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; -PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; -PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; -PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; -PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; -PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; -PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; -PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; -PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; -PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; -PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; -PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; -PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; -PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; -PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; -PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; -PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; -PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; -PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; -PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; -PFNGLPROGRAMBINARYPROC glad_glProgramBinary; -PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; -PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; -PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; -PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; -PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; -PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; -PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; -PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; -PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; -PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; -PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; -PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; -PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; -PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; -PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; -PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; -PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; -PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; -PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; -PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; -PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; -PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; -PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; -PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; -PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; -PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; -PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; -PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; -PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; -PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; -PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; -PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; -PFNGLGENPATHSNVPROC glad_glGenPathsNV; -PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; -PFNGLISPATHNVPROC glad_glIsPathNV; -PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; -PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; -PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; -PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; -PFNGLPATHSTRINGNVPROC glad_glPathStringNV; -PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; -PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; -PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; -PFNGLCOPYPATHNVPROC glad_glCopyPathNV; -PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; -PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; -PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; -PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; -PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; -PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; -PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; -PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; -PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; -PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; -PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; -PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; -PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; -PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; -PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; -PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; -PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; -PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; -PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; -PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; -PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; -PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; -PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; -PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; -PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; -PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; -PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; -PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; -PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; -PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; -PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; -PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; -PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; -PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; -PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; -PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; -PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; -PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; -PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; -PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; -PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; -PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; -PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; -PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; -PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; -PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; -PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; -PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; -PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; -PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; -PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; -PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; -PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; -PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; -PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; -PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; -PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; -PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; -PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; -PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; -PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; -PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; -PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; -PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; -PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; -PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; -PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; -PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; -PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; -PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; -PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; -PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; -PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; -PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; -PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; -PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; -PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; -PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; -PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; -PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; -PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; -PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; -PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; -PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; -PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; -PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; -PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; -PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; -PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; -PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; -PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; -PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; -PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; -PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; -PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; -PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; -PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; -PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; -PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; -PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; -PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; -PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; -PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; -PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; -PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; -PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; -PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; -PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; -PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; -PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; -PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; -PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; -PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; -PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; -PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; -PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; -PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; -PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; -PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; -PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; -PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; -PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; -PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; -PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; -PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; -PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; -PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; -PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; -PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; -PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; -PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; -PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; -PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; -PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; -PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; -PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; -PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; -PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; -PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; -PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; -PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; -PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; -PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; -PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; -PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; -PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; -PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; -PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; -PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; -PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; -PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; -PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; -PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; -PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; -PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; -PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; -PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; -PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; -PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; -PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; -PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; -PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; -PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; -PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; -PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; -PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; -PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; -PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; -PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; -PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; -PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; -PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; -PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; -PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; -PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; -PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; -PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; -PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; -PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; -PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; -PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; -PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; -PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; -PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; -PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; -PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; -PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; -PFNGLCOLOR4XOESPROC glad_glColor4xOES; -PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; -PFNGLFOGXOESPROC glad_glFogxOES; -PFNGLFOGXVOESPROC glad_glFogxvOES; -PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; -PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; -PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; -PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; -PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; -PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; -PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; -PFNGLLIGHTXOESPROC glad_glLightxOES; -PFNGLLIGHTXVOESPROC glad_glLightxvOES; -PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; -PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; -PFNGLMATERIALXOESPROC glad_glMaterialxOES; -PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; -PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; -PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; -PFNGLNORMAL3XOESPROC glad_glNormal3xOES; -PFNGLORTHOXOESPROC glad_glOrthoxOES; -PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; -PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; -PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; -PFNGLROTATEXOESPROC glad_glRotatexOES; -PFNGLSCALEXOESPROC glad_glScalexOES; -PFNGLTEXENVXOESPROC glad_glTexEnvxOES; -PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; -PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; -PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; -PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; -PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; -PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; -PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; -PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; -PFNGLACCUMXOESPROC glad_glAccumxOES; -PFNGLBITMAPXOESPROC glad_glBitmapxOES; -PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; -PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; -PFNGLCOLOR3XOESPROC glad_glColor3xOES; -PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; -PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; -PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; -PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; -PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; -PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; -PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; -PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; -PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; -PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; -PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; -PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; -PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; -PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; -PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; -PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; -PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; -PFNGLINDEXXOESPROC glad_glIndexxOES; -PFNGLINDEXXVOESPROC glad_glIndexxvOES; -PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; -PFNGLMAP1XOESPROC glad_glMap1xOES; -PFNGLMAP2XOESPROC glad_glMap2xOES; -PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; -PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; -PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; -PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; -PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; -PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; -PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; -PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; -PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; -PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; -PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; -PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; -PFNGLPIXELMAPXPROC glad_glPixelMapx; -PFNGLPIXELSTOREXPROC glad_glPixelStorex; -PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; -PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; -PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; -PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; -PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; -PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; -PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; -PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; -PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; -PFNGLRECTXOESPROC glad_glRectxOES; -PFNGLRECTXVOESPROC glad_glRectxvOES; -PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; -PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; -PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; -PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; -PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; -PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; -PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; -PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; -PFNGLTEXGENXOESPROC glad_glTexGenxOES; -PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; -PFNGLVERTEX2XOESPROC glad_glVertex2xOES; -PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; -PFNGLVERTEX3XOESPROC glad_glVertex3xOES; -PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; -PFNGLVERTEX4XOESPROC glad_glVertex4xOES; -PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; -PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; -PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; -PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; -PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; -PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; -PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; -PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; -PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; -PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; -PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; -PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; -PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; -PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; -PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; -PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; -PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; -PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; -PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; -PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; -PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; -PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; -PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; -PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; -PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; -PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; -PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; -PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; -static void load_GL_VERSION_1_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); - glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); - glad_glHint = (PFNGLHINTPROC)load("glHint"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); - glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); - glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); - glad_glClear = (PFNGLCLEARPROC)load("glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); - glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); - glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); - glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); - glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); - glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); - glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); - glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); - glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); - glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); - glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); -} -static void load_GL_VERSION_1_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); - glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); -} -static void load_GL_VERSION_1_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); -} -static void load_GL_VERSION_1_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); -} -static void load_GL_VERSION_1_4(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); -} -static void load_GL_VERSION_1_5(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); - glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); - glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); - glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); - glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); -} -static void load_GL_VERSION_2_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); -} -static void load_GL_VERSION_2_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); -} -static void load_GL_VERSION_3_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); - glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); - glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_VERSION_3_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_VERSION_3_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_VERSION_3_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_3) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); - glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_APPLE_element_array(GLADloadproc load) { - if(!GLAD_GL_APPLE_element_array) return; - glad_glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)load("glElementPointerAPPLE"); - glad_glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)load("glDrawElementArrayAPPLE"); - glad_glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)load("glDrawRangeElementArrayAPPLE"); - glad_glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)load("glMultiDrawElementArrayAPPLE"); - glad_glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)load("glMultiDrawRangeElementArrayAPPLE"); -} -static void load_GL_AMD_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_AMD_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)load("glMultiDrawArraysIndirectAMD"); - glad_glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)load("glMultiDrawElementsIndirectAMD"); -} -static void load_GL_SGIX_tag_sample_buffer(GLADloadproc load) { - if(!GLAD_GL_SGIX_tag_sample_buffer) return; - glad_glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)load("glTagSampleBufferSGIX"); -} -static void load_GL_NV_point_sprite(GLADloadproc load) { - if(!GLAD_GL_NV_point_sprite) return; - glad_glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)load("glPointParameteriNV"); - glad_glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)load("glPointParameterivNV"); -} -static void load_GL_ATI_separate_stencil(GLADloadproc load) { - if(!GLAD_GL_ATI_separate_stencil) return; - glad_glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)load("glStencilOpSeparateATI"); - glad_glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)load("glStencilFuncSeparateATI"); -} -static void load_GL_EXT_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_buffer_object) return; - glad_glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)load("glTexBufferEXT"); -} -static void load_GL_ARB_vertex_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_blend) return; - glad_glWeightbvARB = (PFNGLWEIGHTBVARBPROC)load("glWeightbvARB"); - glad_glWeightsvARB = (PFNGLWEIGHTSVARBPROC)load("glWeightsvARB"); - glad_glWeightivARB = (PFNGLWEIGHTIVARBPROC)load("glWeightivARB"); - glad_glWeightfvARB = (PFNGLWEIGHTFVARBPROC)load("glWeightfvARB"); - glad_glWeightdvARB = (PFNGLWEIGHTDVARBPROC)load("glWeightdvARB"); - glad_glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)load("glWeightubvARB"); - glad_glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)load("glWeightusvARB"); - glad_glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)load("glWeightuivARB"); - glad_glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)load("glWeightPointerARB"); - glad_glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)load("glVertexBlendARB"); -} -static void load_GL_OVR_multiview(GLADloadproc load) { - if(!GLAD_GL_OVR_multiview) return; - glad_glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)load("glFramebufferTextureMultiviewOVR"); -} -static void load_GL_ARB_program_interface_query(GLADloadproc load) { - if(!GLAD_GL_ARB_program_interface_query) return; - glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); - glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); - glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); - glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); - glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); - glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); -} -static void load_GL_EXT_index_func(GLADloadproc load) { - if(!GLAD_GL_EXT_index_func) return; - glad_glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)load("glIndexFuncEXT"); -} -static void load_GL_NV_shader_buffer_load(GLADloadproc load) { - if(!GLAD_GL_NV_shader_buffer_load) return; - glad_glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)load("glMakeBufferResidentNV"); - glad_glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)load("glMakeBufferNonResidentNV"); - glad_glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)load("glIsBufferResidentNV"); - glad_glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)load("glMakeNamedBufferResidentNV"); - glad_glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)load("glMakeNamedBufferNonResidentNV"); - glad_glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)load("glIsNamedBufferResidentNV"); - glad_glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)load("glGetBufferParameterui64vNV"); - glad_glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)load("glGetNamedBufferParameterui64vNV"); - glad_glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)load("glGetIntegerui64vNV"); - glad_glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)load("glUniformui64NV"); - glad_glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)load("glUniformui64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)load("glProgramUniformui64NV"); - glad_glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)load("glProgramUniformui64vNV"); -} -static void load_GL_EXT_color_subtable(GLADloadproc load) { - if(!GLAD_GL_EXT_color_subtable) return; - glad_glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)load("glColorSubTableEXT"); - glad_glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)load("glCopyColorSubTableEXT"); -} -static void load_GL_SUNX_constant_data(GLADloadproc load) { - if(!GLAD_GL_SUNX_constant_data) return; - glad_glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)load("glFinishTextureSUNX"); -} -static void load_GL_EXT_multi_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_EXT_multi_draw_arrays) return; - glad_glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)load("glMultiDrawArraysEXT"); - glad_glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)load("glMultiDrawElementsEXT"); -} -static void load_GL_ARB_shader_atomic_counters(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_atomic_counters) return; - glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); -} -static void load_GL_NV_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NV_conditional_render) return; - glad_glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)load("glBeginConditionalRenderNV"); - glad_glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)load("glEndConditionalRenderNV"); -} -static void load_GL_MESA_resize_buffers(GLADloadproc load) { - if(!GLAD_GL_MESA_resize_buffers) return; - glad_glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)load("glResizeBuffersMESA"); -} -static void load_GL_ARB_texture_view(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_view) return; - glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); -} -static void load_GL_ARB_map_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_map_buffer_range) return; - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); -} -static void load_GL_EXT_convolution(GLADloadproc load) { - if(!GLAD_GL_EXT_convolution) return; - glad_glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)load("glConvolutionFilter1DEXT"); - glad_glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)load("glConvolutionFilter2DEXT"); - glad_glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)load("glConvolutionParameterfEXT"); - glad_glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)load("glConvolutionParameterfvEXT"); - glad_glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)load("glConvolutionParameteriEXT"); - glad_glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)load("glConvolutionParameterivEXT"); - glad_glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)load("glCopyConvolutionFilter1DEXT"); - glad_glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)load("glCopyConvolutionFilter2DEXT"); - glad_glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)load("glGetConvolutionFilterEXT"); - glad_glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)load("glGetConvolutionParameterfvEXT"); - glad_glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)load("glGetConvolutionParameterivEXT"); - glad_glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)load("glGetSeparableFilterEXT"); - glad_glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)load("glSeparableFilter2DEXT"); -} -static void load_GL_NV_vertex_attrib_integer_64bit(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_attrib_integer_64bit) return; - glad_glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)load("glVertexAttribL1i64NV"); - glad_glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)load("glVertexAttribL2i64NV"); - glad_glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)load("glVertexAttribL3i64NV"); - glad_glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)load("glVertexAttribL4i64NV"); - glad_glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)load("glVertexAttribL1i64vNV"); - glad_glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)load("glVertexAttribL2i64vNV"); - glad_glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)load("glVertexAttribL3i64vNV"); - glad_glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)load("glVertexAttribL4i64vNV"); - glad_glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)load("glVertexAttribL1ui64NV"); - glad_glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)load("glVertexAttribL2ui64NV"); - glad_glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)load("glVertexAttribL3ui64NV"); - glad_glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)load("glVertexAttribL4ui64NV"); - glad_glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)load("glVertexAttribL1ui64vNV"); - glad_glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)load("glVertexAttribL2ui64vNV"); - glad_glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)load("glVertexAttribL3ui64vNV"); - glad_glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)load("glVertexAttribL4ui64vNV"); - glad_glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)load("glGetVertexAttribLi64vNV"); - glad_glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)load("glGetVertexAttribLui64vNV"); - glad_glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)load("glVertexAttribLFormatNV"); -} -static void load_GL_EXT_paletted_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_paletted_texture) return; - glad_glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)load("glColorTableEXT"); - glad_glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)load("glGetColorTableEXT"); - glad_glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)load("glGetColorTableParameterivEXT"); - glad_glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)load("glGetColorTableParameterfvEXT"); -} -static void load_GL_ARB_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_object) return; - glad_glTexBufferARB = (PFNGLTEXBUFFERARBPROC)load("glTexBufferARB"); -} -static void load_GL_ATI_pn_triangles(GLADloadproc load) { - if(!GLAD_GL_ATI_pn_triangles) return; - glad_glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)load("glPNTrianglesiATI"); - glad_glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)load("glPNTrianglesfATI"); -} -static void load_GL_SGIX_flush_raster(GLADloadproc load) { - if(!GLAD_GL_SGIX_flush_raster) return; - glad_glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)load("glFlushRasterSGIX"); -} -static void load_GL_EXT_light_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_light_texture) return; - glad_glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)load("glApplyTextureEXT"); - glad_glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)load("glTextureLightEXT"); - glad_glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)load("glTextureMaterialEXT"); -} -static void load_GL_HP_image_transform(GLADloadproc load) { - if(!GLAD_GL_HP_image_transform) return; - glad_glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)load("glImageTransformParameteriHP"); - glad_glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)load("glImageTransformParameterfHP"); - glad_glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)load("glImageTransformParameterivHP"); - glad_glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)load("glImageTransformParameterfvHP"); - glad_glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)load("glGetImageTransformParameterivHP"); - glad_glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)load("glGetImageTransformParameterfvHP"); -} -static void load_GL_AMD_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_AMD_draw_buffers_blend) return; - glad_glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)load("glBlendFuncIndexedAMD"); - glad_glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)load("glBlendFuncSeparateIndexedAMD"); - glad_glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)load("glBlendEquationIndexedAMD"); - glad_glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)load("glBlendEquationSeparateIndexedAMD"); -} -static void load_GL_APPLE_texture_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_texture_range) return; - glad_glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)load("glTextureRangeAPPLE"); - glad_glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)load("glGetTexParameterPointervAPPLE"); -} -static void load_GL_EXT_texture_array(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_array) return; - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); -} -static void load_GL_NV_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_NV_texture_barrier) return; - glad_glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)load("glTextureBarrierNV"); -} -static void load_GL_ARB_vertex_type_2_10_10_10_rev(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_type_2_10_10_10_rev) return; - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_3DFX_tbuffer(GLADloadproc load) { - if(!GLAD_GL_3DFX_tbuffer) return; - glad_glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)load("glTbufferMask3DFX"); -} -static void load_GL_GREMEDY_frame_terminator(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_frame_terminator) return; - glad_glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)load("glFrameTerminatorGREMEDY"); -} -static void load_GL_ARB_blend_func_extended(GLADloadproc load) { - if(!GLAD_GL_ARB_blend_func_extended) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); -} -static void load_GL_EXT_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_EXT_separate_shader_objects) return; - glad_glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)load("glUseShaderProgramEXT"); - glad_glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)load("glActiveProgramEXT"); - glad_glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)load("glCreateShaderProgramEXT"); - glad_glActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC)load("glActiveShaderProgramEXT"); - glad_glBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC)load("glBindProgramPipelineEXT"); - glad_glCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC)load("glCreateShaderProgramvEXT"); - glad_glDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC)load("glDeleteProgramPipelinesEXT"); - glad_glGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC)load("glGenProgramPipelinesEXT"); - glad_glGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)load("glGetProgramPipelineInfoLogEXT"); - glad_glGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC)load("glGetProgramPipelineivEXT"); - glad_glIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC)load("glIsProgramPipelineEXT"); - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC)load("glUseProgramStagesEXT"); - glad_glValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)load("glValidateProgramPipelineEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); -} -static void load_GL_NV_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_texture_multisample) return; - glad_glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTexImage2DMultisampleCoverageNV"); - glad_glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTexImage3DMultisampleCoverageNV"); - glad_glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)load("glTextureImage2DMultisampleNV"); - glad_glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)load("glTextureImage3DMultisampleNV"); - glad_glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTextureImage2DMultisampleCoverageNV"); - glad_glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTextureImage3DMultisampleCoverageNV"); -} -static void load_GL_ARB_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_objects) return; - glad_glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)load("glDeleteObjectARB"); - glad_glGetHandleARB = (PFNGLGETHANDLEARBPROC)load("glGetHandleARB"); - glad_glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)load("glDetachObjectARB"); - glad_glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)load("glCreateShaderObjectARB"); - glad_glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)load("glShaderSourceARB"); - glad_glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)load("glCompileShaderARB"); - glad_glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)load("glCreateProgramObjectARB"); - glad_glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)load("glAttachObjectARB"); - glad_glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)load("glLinkProgramARB"); - glad_glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)load("glUseProgramObjectARB"); - glad_glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)load("glValidateProgramARB"); - glad_glUniform1fARB = (PFNGLUNIFORM1FARBPROC)load("glUniform1fARB"); - glad_glUniform2fARB = (PFNGLUNIFORM2FARBPROC)load("glUniform2fARB"); - glad_glUniform3fARB = (PFNGLUNIFORM3FARBPROC)load("glUniform3fARB"); - glad_glUniform4fARB = (PFNGLUNIFORM4FARBPROC)load("glUniform4fARB"); - glad_glUniform1iARB = (PFNGLUNIFORM1IARBPROC)load("glUniform1iARB"); - glad_glUniform2iARB = (PFNGLUNIFORM2IARBPROC)load("glUniform2iARB"); - glad_glUniform3iARB = (PFNGLUNIFORM3IARBPROC)load("glUniform3iARB"); - glad_glUniform4iARB = (PFNGLUNIFORM4IARBPROC)load("glUniform4iARB"); - glad_glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)load("glUniform1fvARB"); - glad_glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)load("glUniform2fvARB"); - glad_glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)load("glUniform3fvARB"); - glad_glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)load("glUniform4fvARB"); - glad_glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)load("glUniform1ivARB"); - glad_glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)load("glUniform2ivARB"); - glad_glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)load("glUniform3ivARB"); - glad_glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)load("glUniform4ivARB"); - glad_glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)load("glUniformMatrix2fvARB"); - glad_glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)load("glUniformMatrix3fvARB"); - glad_glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)load("glUniformMatrix4fvARB"); - glad_glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)load("glGetObjectParameterfvARB"); - glad_glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)load("glGetObjectParameterivARB"); - glad_glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)load("glGetInfoLogARB"); - glad_glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)load("glGetAttachedObjectsARB"); - glad_glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)load("glGetUniformLocationARB"); - glad_glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)load("glGetActiveUniformARB"); - glad_glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)load("glGetUniformfvARB"); - glad_glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)load("glGetUniformivARB"); - glad_glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)load("glGetShaderSourceARB"); -} -static void load_GL_ARB_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_object) return; - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); -} -static void load_GL_ATI_envmap_bumpmap(GLADloadproc load) { - if(!GLAD_GL_ATI_envmap_bumpmap) return; - glad_glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)load("glTexBumpParameterivATI"); - glad_glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)load("glTexBumpParameterfvATI"); - glad_glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)load("glGetTexBumpParameterivATI"); - glad_glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)load("glGetTexBumpParameterfvATI"); -} -static void load_GL_ATI_map_object_buffer(GLADloadproc load) { - if(!GLAD_GL_ATI_map_object_buffer) return; - glad_glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)load("glMapObjectBufferATI"); - glad_glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)load("glUnmapObjectBufferATI"); -} -static void load_GL_ARB_robustness(GLADloadproc load) { - if(!GLAD_GL_ARB_robustness) return; - glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)load("glGetGraphicsResetStatusARB"); - glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)load("glGetnTexImageARB"); - glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)load("glReadnPixelsARB"); - glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)load("glGetnCompressedTexImageARB"); - glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)load("glGetnUniformfvARB"); - glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)load("glGetnUniformivARB"); - glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)load("glGetnUniformuivARB"); - glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)load("glGetnUniformdvARB"); - glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)load("glGetnMapdvARB"); - glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)load("glGetnMapfvARB"); - glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)load("glGetnMapivARB"); - glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)load("glGetnPixelMapfvARB"); - glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)load("glGetnPixelMapuivARB"); - glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)load("glGetnPixelMapusvARB"); - glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)load("glGetnPolygonStippleARB"); - glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)load("glGetnColorTableARB"); - glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)load("glGetnConvolutionFilterARB"); - glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)load("glGetnSeparableFilterARB"); - glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)load("glGetnHistogramARB"); - glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)load("glGetnMinmaxARB"); -} -static void load_GL_NV_pixel_data_range(GLADloadproc load) { - if(!GLAD_GL_NV_pixel_data_range) return; - glad_glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)load("glPixelDataRangeNV"); - glad_glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)load("glFlushPixelDataRangeNV"); -} -static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_blit) return; - glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); -} -static void load_GL_ARB_gpu_shader_fp64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_fp64) return; - glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); - glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); - glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); - glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); - glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); - glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); - glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); - glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); - glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); - glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); - glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); - glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); - glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); - glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); - glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); - glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); - glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); - glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); -} -static void load_GL_NV_command_list(GLADloadproc load) { - if(!GLAD_GL_NV_command_list) return; - glad_glCreateStatesNV = (PFNGLCREATESTATESNVPROC)load("glCreateStatesNV"); - glad_glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)load("glDeleteStatesNV"); - glad_glIsStateNV = (PFNGLISSTATENVPROC)load("glIsStateNV"); - glad_glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)load("glStateCaptureNV"); - glad_glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)load("glGetCommandHeaderNV"); - glad_glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)load("glGetStageIndexNV"); - glad_glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)load("glDrawCommandsNV"); - glad_glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)load("glDrawCommandsAddressNV"); - glad_glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)load("glDrawCommandsStatesNV"); - glad_glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)load("glDrawCommandsStatesAddressNV"); - glad_glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)load("glCreateCommandListsNV"); - glad_glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)load("glDeleteCommandListsNV"); - glad_glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)load("glIsCommandListNV"); - glad_glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)load("glListDrawCommandsStatesClientNV"); - glad_glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)load("glCommandListSegmentsNV"); - glad_glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)load("glCompileCommandListNV"); - glad_glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)load("glCallCommandListNV"); -} -static void load_GL_EXT_vertex_weighting(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_weighting) return; - glad_glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)load("glVertexWeightfEXT"); - glad_glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)load("glVertexWeightfvEXT"); - glad_glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)load("glVertexWeightPointerEXT"); -} -static void load_GL_GREMEDY_string_marker(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_string_marker) return; - glad_glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)load("glStringMarkerGREMEDY"); -} -static void load_GL_EXT_subtexture(GLADloadproc load) { - if(!GLAD_GL_EXT_subtexture) return; - glad_glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)load("glTexSubImage1DEXT"); - glad_glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)load("glTexSubImage2DEXT"); -} -static void load_GL_EXT_gpu_program_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_program_parameters) return; - glad_glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)load("glProgramEnvParameters4fvEXT"); - glad_glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glProgramLocalParameters4fvEXT"); -} -static void load_GL_NV_evaluators(GLADloadproc load) { - if(!GLAD_GL_NV_evaluators) return; - glad_glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)load("glMapControlPointsNV"); - glad_glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)load("glMapParameterivNV"); - glad_glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)load("glMapParameterfvNV"); - glad_glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)load("glGetMapControlPointsNV"); - glad_glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)load("glGetMapParameterivNV"); - glad_glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)load("glGetMapParameterfvNV"); - glad_glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)load("glGetMapAttribParameterivNV"); - glad_glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)load("glGetMapAttribParameterfvNV"); - glad_glEvalMapsNV = (PFNGLEVALMAPSNVPROC)load("glEvalMapsNV"); -} -static void load_GL_SGIS_texture_filter4(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_filter4) return; - glad_glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)load("glGetTexFilterFuncSGIS"); - glad_glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)load("glTexFilterFuncSGIS"); -} -static void load_GL_AMD_performance_monitor(GLADloadproc load) { - if(!GLAD_GL_AMD_performance_monitor) return; - glad_glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)load("glGetPerfMonitorGroupsAMD"); - glad_glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)load("glGetPerfMonitorCountersAMD"); - glad_glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)load("glGetPerfMonitorGroupStringAMD"); - glad_glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)load("glGetPerfMonitorCounterStringAMD"); - glad_glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)load("glGetPerfMonitorCounterInfoAMD"); - glad_glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)load("glGenPerfMonitorsAMD"); - glad_glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)load("glDeletePerfMonitorsAMD"); - glad_glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)load("glSelectPerfMonitorCountersAMD"); - glad_glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)load("glBeginPerfMonitorAMD"); - glad_glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)load("glEndPerfMonitorAMD"); - glad_glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)load("glGetPerfMonitorCounterDataAMD"); -} -static void load_GL_EXT_stencil_clear_tag(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_clear_tag) return; - glad_glStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC)load("glStencilClearTagEXT"); -} -static void load_GL_NV_present_video(GLADloadproc load) { - if(!GLAD_GL_NV_present_video) return; - glad_glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)load("glPresentFrameKeyedNV"); - glad_glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)load("glPresentFrameDualFillNV"); - glad_glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)load("glGetVideoivNV"); - glad_glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)load("glGetVideouivNV"); - glad_glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)load("glGetVideoi64vNV"); - glad_glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)load("glGetVideoui64vNV"); -} -static void load_GL_SGIX_framezoom(GLADloadproc load) { - if(!GLAD_GL_SGIX_framezoom) return; - glad_glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)load("glFrameZoomSGIX"); -} -static void load_GL_ARB_draw_elements_base_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_elements_base_vertex) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); -} -static void load_GL_NV_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback) return; - glad_glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)load("glBeginTransformFeedbackNV"); - glad_glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)load("glEndTransformFeedbackNV"); - glad_glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)load("glTransformFeedbackAttribsNV"); - glad_glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)load("glBindBufferRangeNV"); - glad_glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)load("glBindBufferOffsetNV"); - glad_glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)load("glBindBufferBaseNV"); - glad_glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)load("glTransformFeedbackVaryingsNV"); - glad_glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)load("glActiveVaryingNV"); - glad_glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)load("glGetVaryingLocationNV"); - glad_glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)load("glGetActiveVaryingNV"); - glad_glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)load("glGetTransformFeedbackVaryingNV"); - glad_glTransformFeedbackStreamAttribsNV = (PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)load("glTransformFeedbackStreamAttribsNV"); -} -static void load_GL_NV_fragment_program(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_program) return; - glad_glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)load("glProgramNamedParameter4fNV"); - glad_glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)load("glProgramNamedParameter4fvNV"); - glad_glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)load("glProgramNamedParameter4dNV"); - glad_glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)load("glProgramNamedParameter4dvNV"); - glad_glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)load("glGetProgramNamedParameterfvNV"); - glad_glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)load("glGetProgramNamedParameterdvNV"); -} -static void load_GL_AMD_stencil_operation_extended(GLADloadproc load) { - if(!GLAD_GL_AMD_stencil_operation_extended) return; - glad_glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)load("glStencilOpValueAMD"); -} -static void load_GL_ARB_instanced_arrays(GLADloadproc load) { - if(!GLAD_GL_ARB_instanced_arrays) return; - glad_glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)load("glVertexAttribDivisorARB"); -} -static void load_GL_EXT_polygon_offset(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset) return; - glad_glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)load("glPolygonOffsetEXT"); -} -static void load_GL_KHR_robustness(GLADloadproc load) { - if(!GLAD_GL_KHR_robustness) return; - glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); - glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); - glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); - glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); - glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); - glad_glGetGraphicsResetStatusKHR = (PFNGLGETGRAPHICSRESETSTATUSKHRPROC)load("glGetGraphicsResetStatusKHR"); - glad_glReadnPixelsKHR = (PFNGLREADNPIXELSKHRPROC)load("glReadnPixelsKHR"); - glad_glGetnUniformfvKHR = (PFNGLGETNUNIFORMFVKHRPROC)load("glGetnUniformfvKHR"); - glad_glGetnUniformivKHR = (PFNGLGETNUNIFORMIVKHRPROC)load("glGetnUniformivKHR"); - glad_glGetnUniformuivKHR = (PFNGLGETNUNIFORMUIVKHRPROC)load("glGetnUniformuivKHR"); -} -static void load_GL_AMD_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_AMD_sparse_texture) return; - glad_glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)load("glTexStorageSparseAMD"); - glad_glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)load("glTextureStorageSparseAMD"); -} -static void load_GL_ARB_clip_control(GLADloadproc load) { - if(!GLAD_GL_ARB_clip_control) return; - glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); -} -static void load_GL_NV_fragment_coverage_to_color(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_coverage_to_color) return; - glad_glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)load("glFragmentCoverageColorNV"); -} -static void load_GL_NV_fence(GLADloadproc load) { - if(!GLAD_GL_NV_fence) return; - glad_glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)load("glDeleteFencesNV"); - glad_glGenFencesNV = (PFNGLGENFENCESNVPROC)load("glGenFencesNV"); - glad_glIsFenceNV = (PFNGLISFENCENVPROC)load("glIsFenceNV"); - glad_glTestFenceNV = (PFNGLTESTFENCENVPROC)load("glTestFenceNV"); - glad_glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)load("glGetFenceivNV"); - glad_glFinishFenceNV = (PFNGLFINISHFENCENVPROC)load("glFinishFenceNV"); - glad_glSetFenceNV = (PFNGLSETFENCENVPROC)load("glSetFenceNV"); -} -static void load_GL_ARB_texture_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_range) return; - glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); -} -static void load_GL_SUN_mesh_array(GLADloadproc load) { - if(!GLAD_GL_SUN_mesh_array) return; - glad_glDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC)load("glDrawMeshArraysSUN"); -} -static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_binding) return; - glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); - glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); - glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); - glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); - glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); - glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); -} -static void load_GL_ARB_framebuffer_no_attachments(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_no_attachments) return; - glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); - glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); -} -static void load_GL_ARB_cl_event(GLADloadproc load) { - if(!GLAD_GL_ARB_cl_event) return; - glad_glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)load("glCreateSyncFromCLeventARB"); -} -static void load_GL_OES_single_precision(GLADloadproc load) { - if(!GLAD_GL_OES_single_precision) return; - glad_glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)load("glClearDepthfOES"); - glad_glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)load("glClipPlanefOES"); - glad_glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)load("glDepthRangefOES"); - glad_glFrustumfOES = (PFNGLFRUSTUMFOESPROC)load("glFrustumfOES"); - glad_glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)load("glGetClipPlanefOES"); - glad_glOrthofOES = (PFNGLORTHOFOESPROC)load("glOrthofOES"); -} -static void load_GL_NV_primitive_restart(GLADloadproc load) { - if(!GLAD_GL_NV_primitive_restart) return; - glad_glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)load("glPrimitiveRestartNV"); - glad_glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)load("glPrimitiveRestartIndexNV"); -} -static void load_GL_SUN_global_alpha(GLADloadproc load) { - if(!GLAD_GL_SUN_global_alpha) return; - glad_glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)load("glGlobalAlphaFactorbSUN"); - glad_glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)load("glGlobalAlphaFactorsSUN"); - glad_glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)load("glGlobalAlphaFactoriSUN"); - glad_glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)load("glGlobalAlphaFactorfSUN"); - glad_glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)load("glGlobalAlphaFactordSUN"); - glad_glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)load("glGlobalAlphaFactorubSUN"); - glad_glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)load("glGlobalAlphaFactorusSUN"); - glad_glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)load("glGlobalAlphaFactoruiSUN"); -} -static void load_GL_EXT_texture_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_object) return; - glad_glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)load("glAreTexturesResidentEXT"); - glad_glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)load("glBindTextureEXT"); - glad_glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)load("glDeleteTexturesEXT"); - glad_glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)load("glGenTexturesEXT"); - glad_glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)load("glIsTextureEXT"); - glad_glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)load("glPrioritizeTexturesEXT"); -} -static void load_GL_AMD_name_gen_delete(GLADloadproc load) { - if(!GLAD_GL_AMD_name_gen_delete) return; - glad_glGenNamesAMD = (PFNGLGENNAMESAMDPROC)load("glGenNamesAMD"); - glad_glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)load("glDeleteNamesAMD"); - glad_glIsNameAMD = (PFNGLISNAMEAMDPROC)load("glIsNameAMD"); -} -static void load_GL_ARB_buffer_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_buffer_storage) return; - glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); -} -static void load_GL_APPLE_vertex_program_evaluators(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_program_evaluators) return; - glad_glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)load("glEnableVertexAttribAPPLE"); - glad_glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)load("glDisableVertexAttribAPPLE"); - glad_glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)load("glIsVertexAttribEnabledAPPLE"); - glad_glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)load("glMapVertexAttrib1dAPPLE"); - glad_glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)load("glMapVertexAttrib1fAPPLE"); - glad_glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)load("glMapVertexAttrib2dAPPLE"); - glad_glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)load("glMapVertexAttrib2fAPPLE"); -} -static void load_GL_ARB_multi_bind(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_bind) return; - glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); - glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); - glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); - glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); - glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); - glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); -} -static void load_GL_SGIX_list_priority(GLADloadproc load) { - if(!GLAD_GL_SGIX_list_priority) return; - glad_glGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC)load("glGetListParameterfvSGIX"); - glad_glGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC)load("glGetListParameterivSGIX"); - glad_glListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC)load("glListParameterfSGIX"); - glad_glListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC)load("glListParameterfvSGIX"); - glad_glListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC)load("glListParameteriSGIX"); - glad_glListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC)load("glListParameterivSGIX"); -} -static void load_GL_NV_vertex_buffer_unified_memory(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_buffer_unified_memory) return; - glad_glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)load("glBufferAddressRangeNV"); - glad_glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)load("glVertexFormatNV"); - glad_glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)load("glNormalFormatNV"); - glad_glColorFormatNV = (PFNGLCOLORFORMATNVPROC)load("glColorFormatNV"); - glad_glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)load("glIndexFormatNV"); - glad_glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)load("glTexCoordFormatNV"); - glad_glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)load("glEdgeFlagFormatNV"); - glad_glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)load("glSecondaryColorFormatNV"); - glad_glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)load("glFogCoordFormatNV"); - glad_glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)load("glVertexAttribFormatNV"); - glad_glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)load("glVertexAttribIFormatNV"); - glad_glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)load("glGetIntegerui64i_vNV"); -} -static void load_GL_NV_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_NV_blend_equation_advanced) return; - glad_glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)load("glBlendParameteriNV"); - glad_glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)load("glBlendBarrierNV"); -} -static void load_GL_SGIS_sharpen_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_sharpen_texture) return; - glad_glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)load("glSharpenTexFuncSGIS"); - glad_glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)load("glGetSharpenTexFuncSGIS"); -} -static void load_GL_ARB_vertex_program(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_program) return; - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_buffer_object) return; - glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); - glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); - glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); - glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); - glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); - glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); - glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); - glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); - glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); - glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); - glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); -} -static void load_GL_NV_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_array_range) return; - glad_glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)load("glFlushVertexArrayRangeNV"); - glad_glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)load("glVertexArrayRangeNV"); -} -static void load_GL_SGIX_fragment_lighting(GLADloadproc load) { - if(!GLAD_GL_SGIX_fragment_lighting) return; - glad_glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)load("glFragmentColorMaterialSGIX"); - glad_glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)load("glFragmentLightfSGIX"); - glad_glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)load("glFragmentLightfvSGIX"); - glad_glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)load("glFragmentLightiSGIX"); - glad_glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)load("glFragmentLightivSGIX"); - glad_glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)load("glFragmentLightModelfSGIX"); - glad_glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)load("glFragmentLightModelfvSGIX"); - glad_glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)load("glFragmentLightModeliSGIX"); - glad_glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)load("glFragmentLightModelivSGIX"); - glad_glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)load("glFragmentMaterialfSGIX"); - glad_glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)load("glFragmentMaterialfvSGIX"); - glad_glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)load("glFragmentMaterialiSGIX"); - glad_glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)load("glFragmentMaterialivSGIX"); - glad_glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)load("glGetFragmentLightfvSGIX"); - glad_glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)load("glGetFragmentLightivSGIX"); - glad_glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)load("glGetFragmentMaterialfvSGIX"); - glad_glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)load("glGetFragmentMaterialivSGIX"); - glad_glLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC)load("glLightEnviSGIX"); -} -static void load_GL_NV_framebuffer_multisample_coverage(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_multisample_coverage) return; - glad_glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)load("glRenderbufferStorageMultisampleCoverageNV"); -} -static void load_GL_EXT_timer_query(GLADloadproc load) { - if(!GLAD_GL_EXT_timer_query) return; - glad_glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)load("glGetQueryObjecti64vEXT"); - glad_glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)load("glGetQueryObjectui64vEXT"); -} -static void load_GL_NV_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_texture) return; - glad_glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)load("glGetTextureHandleNV"); - glad_glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)load("glGetTextureSamplerHandleNV"); - glad_glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)load("glMakeTextureHandleResidentNV"); - glad_glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)load("glMakeTextureHandleNonResidentNV"); - glad_glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)load("glGetImageHandleNV"); - glad_glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)load("glMakeImageHandleResidentNV"); - glad_glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)load("glMakeImageHandleNonResidentNV"); - glad_glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)load("glUniformHandleui64NV"); - glad_glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)load("glUniformHandleui64vNV"); - glad_glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)load("glProgramUniformHandleui64NV"); - glad_glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)load("glProgramUniformHandleui64vNV"); - glad_glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)load("glIsTextureHandleResidentNV"); - glad_glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)load("glIsImageHandleResidentNV"); -} -static void load_GL_KHR_debug(GLADloadproc load) { - if(!GLAD_GL_KHR_debug) return; - glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); - glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); - glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); - glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); - glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); - glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); - glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); - glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); - glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); - glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); - glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); - glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); - glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); - glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); - glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); - glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); - glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); - glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); - glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); - glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); - glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); - glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); -} -static void load_GL_ATI_vertex_attrib_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_attrib_array_object) return; - glad_glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)load("glVertexAttribArrayObjectATI"); - glad_glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)load("glGetVertexAttribArrayObjectfvATI"); - glad_glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)load("glGetVertexAttribArrayObjectivATI"); -} -static void load_GL_EXT_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_geometry_shader4) return; - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); -} -static void load_GL_EXT_bindable_uniform(GLADloadproc load) { - if(!GLAD_GL_EXT_bindable_uniform) return; - glad_glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)load("glUniformBufferEXT"); - glad_glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)load("glGetUniformBufferSizeEXT"); - glad_glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)load("glGetUniformOffsetEXT"); -} -static void load_GL_KHR_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_KHR_blend_equation_advanced) return; - glad_glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)load("glBlendBarrierKHR"); -} -static void load_GL_ATI_element_array(GLADloadproc load) { - if(!GLAD_GL_ATI_element_array) return; - glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); - glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); - glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); -} -static void load_GL_SGIX_reference_plane(GLADloadproc load) { - if(!GLAD_GL_SGIX_reference_plane) return; - glad_glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)load("glReferencePlaneSGIX"); -} -static void load_GL_EXT_stencil_two_side(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_two_side) return; - glad_glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)load("glActiveStencilFaceEXT"); -} -static void load_GL_NV_explicit_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_explicit_multisample) return; - glad_glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)load("glGetMultisamplefvNV"); - glad_glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)load("glSampleMaskIndexedNV"); - glad_glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)load("glTexRenderbufferNV"); -} -static void load_GL_IBM_static_data(GLADloadproc load) { - if(!GLAD_GL_IBM_static_data) return; - glad_glFlushStaticDataIBM = (PFNGLFLUSHSTATICDATAIBMPROC)load("glFlushStaticDataIBM"); -} -static void load_GL_EXT_texture_perturb_normal(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_perturb_normal) return; - glad_glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)load("glTextureNormalEXT"); -} -static void load_GL_EXT_point_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_point_parameters) return; - glad_glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)load("glPointParameterfEXT"); - glad_glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)load("glPointParameterfvEXT"); -} -static void load_GL_PGI_misc_hints(GLADloadproc load) { - if(!GLAD_GL_PGI_misc_hints) return; - glad_glHintPGI = (PFNGLHINTPGIPROC)load("glHintPGI"); -} -static void load_GL_ARB_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_shader) return; - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); - glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); - glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); -} -static void load_GL_ARB_tessellation_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_tessellation_shader) return; - glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); - glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); -} -static void load_GL_EXT_draw_buffers2(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_buffers2) return; - glad_glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)load("glColorMaskIndexedEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); -} -static void load_GL_ARB_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_64bit) return; - glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); - glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); - glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); - glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); - glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); - glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); - glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); - glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); - glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); - glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); -} -static void load_GL_EXT_texture_filter_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_filter_minmax) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); -} -static void load_GL_AMD_interleaved_elements(GLADloadproc load) { - if(!GLAD_GL_AMD_interleaved_elements) return; - glad_glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)load("glVertexAttribParameteriAMD"); -} -static void load_GL_ARB_fragment_program(GLADloadproc load) { - if(!GLAD_GL_ARB_fragment_program) return; - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_texture_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage) return; - glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); - glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); - glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); -} -static void load_GL_ARB_copy_image(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_image) return; - glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); -} -static void load_GL_SGIS_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_pixel_texture) return; - glad_glPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC)load("glPixelTexGenParameteriSGIS"); - glad_glPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC)load("glPixelTexGenParameterivSGIS"); - glad_glPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC)load("glPixelTexGenParameterfSGIS"); - glad_glPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC)load("glPixelTexGenParameterfvSGIS"); - glad_glGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)load("glGetPixelTexGenParameterivSGIS"); - glad_glGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)load("glGetPixelTexGenParameterfvSGIS"); -} -static void load_GL_SGIX_instruments(GLADloadproc load) { - if(!GLAD_GL_SGIX_instruments) return; - glad_glGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC)load("glGetInstrumentsSGIX"); - glad_glInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC)load("glInstrumentsBufferSGIX"); - glad_glPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC)load("glPollInstrumentsSGIX"); - glad_glReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC)load("glReadInstrumentsSGIX"); - glad_glStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC)load("glStartInstrumentsSGIX"); - glad_glStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC)load("glStopInstrumentsSGIX"); -} -static void load_GL_ARB_shader_storage_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_storage_buffer_object) return; - glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); -} -static void load_GL_EXT_blend_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_minmax) return; - glad_glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)load("glBlendEquationEXT"); -} -static void load_GL_ARB_base_instance(GLADloadproc load) { - if(!GLAD_GL_ARB_base_instance) return; - glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); -} -static void load_GL_ARB_ES3_1_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_1_compatibility) return; - glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); -} -static void load_GL_EXT_texture_integer(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_integer) return; - glad_glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)load("glTexParameterIivEXT"); - glad_glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)load("glTexParameterIuivEXT"); - glad_glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)load("glGetTexParameterIivEXT"); - glad_glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)load("glGetTexParameterIuivEXT"); - glad_glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)load("glClearColorIiEXT"); - glad_glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)load("glClearColorIuiEXT"); -} -static void load_GL_ARB_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_multisample) return; - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_AMD_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_AMD_gpu_shader_int64) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_AMD_vertex_shader_tessellator(GLADloadproc load) { - if(!GLAD_GL_AMD_vertex_shader_tessellator) return; - glad_glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)load("glTessellationFactorAMD"); - glad_glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)load("glTessellationModeAMD"); -} -static void load_GL_ARB_invalidate_subdata(GLADloadproc load) { - if(!GLAD_GL_ARB_invalidate_subdata) return; - glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); - glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); - glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); - glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); - glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); - glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); -} -static void load_GL_EXT_index_material(GLADloadproc load) { - if(!GLAD_GL_EXT_index_material) return; - glad_glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)load("glIndexMaterialEXT"); -} -static void load_GL_INTEL_parallel_arrays(GLADloadproc load) { - if(!GLAD_GL_INTEL_parallel_arrays) return; - glad_glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)load("glVertexPointervINTEL"); - glad_glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)load("glNormalPointervINTEL"); - glad_glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)load("glColorPointervINTEL"); - glad_glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)load("glTexCoordPointervINTEL"); -} -static void load_GL_ATI_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ATI_draw_buffers) return; - glad_glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)load("glDrawBuffersATI"); -} -static void load_GL_SGIX_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIX_pixel_texture) return; - glad_glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)load("glPixelTexGenSGIX"); -} -static void load_GL_ARB_timer_query(GLADloadproc load) { - if(!GLAD_GL_ARB_timer_query) return; - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); -} -static void load_GL_NV_parameter_buffer_object(GLADloadproc load) { - if(!GLAD_GL_NV_parameter_buffer_object) return; - glad_glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)load("glProgramBufferParametersfvNV"); - glad_glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)load("glProgramBufferParametersIivNV"); - glad_glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)load("glProgramBufferParametersIuivNV"); -} -static void load_GL_ARB_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_ARB_direct_state_access) return; - glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); - glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); - glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); - glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); - glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); - glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); - glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); - glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); - glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); - glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); - glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); - glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); - glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); - glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); - glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); - glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); - glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); - glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); - glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); - glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); - glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); - glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); - glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); - glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); - glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); - glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); - glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); - glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); - glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); - glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); - glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); - glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); - glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); - glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); - glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); - glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); - glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); - glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); - glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); - glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); - glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); - glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); - glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); - glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); - glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); - glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); - glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); - glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); - glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); - glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); - glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); - glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); - glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); - glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); - glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); - glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); - glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); - glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); - glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); - glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); - glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); - glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); - glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); - glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); - glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); - glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); - glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); - glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); - glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); - glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); - glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); - glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); - glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); - glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); - glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); - glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); - glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); - glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); - glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); - glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); - glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); - glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); - glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); - glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); - glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); - glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); - glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); - glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); - glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); - glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); - glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); - glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); - glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); - glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); - glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); - glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); - glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); -} -static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_uniform_buffer_object) return; - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_NV_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback2) return; - glad_glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)load("glBindTransformFeedbackNV"); - glad_glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)load("glDeleteTransformFeedbacksNV"); - glad_glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)load("glGenTransformFeedbacksNV"); - glad_glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)load("glIsTransformFeedbackNV"); - glad_glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)load("glPauseTransformFeedbackNV"); - glad_glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)load("glResumeTransformFeedbackNV"); - glad_glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)load("glDrawTransformFeedbackNV"); -} -static void load_GL_EXT_blend_color(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_color) return; - glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); -} -static void load_GL_EXT_histogram(GLADloadproc load) { - if(!GLAD_GL_EXT_histogram) return; - glad_glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)load("glGetHistogramEXT"); - glad_glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)load("glGetHistogramParameterfvEXT"); - glad_glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)load("glGetHistogramParameterivEXT"); - glad_glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)load("glGetMinmaxEXT"); - glad_glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)load("glGetMinmaxParameterfvEXT"); - glad_glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)load("glGetMinmaxParameterivEXT"); - glad_glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)load("glHistogramEXT"); - glad_glMinmaxEXT = (PFNGLMINMAXEXTPROC)load("glMinmaxEXT"); - glad_glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)load("glResetHistogramEXT"); - glad_glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)load("glResetMinmaxEXT"); -} -static void load_GL_ARB_get_texture_sub_image(GLADloadproc load) { - if(!GLAD_GL_ARB_get_texture_sub_image) return; - glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); - glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); -} -static void load_GL_SGIS_point_parameters(GLADloadproc load) { - if(!GLAD_GL_SGIS_point_parameters) return; - glad_glPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC)load("glPointParameterfSGIS"); - glad_glPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC)load("glPointParameterfvSGIS"); -} -static void load_GL_EXT_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_EXT_direct_state_access) return; - glad_glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)load("glMatrixLoadfEXT"); - glad_glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)load("glMatrixLoaddEXT"); - glad_glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)load("glMatrixMultfEXT"); - glad_glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)load("glMatrixMultdEXT"); - glad_glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)load("glMatrixLoadIdentityEXT"); - glad_glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)load("glMatrixRotatefEXT"); - glad_glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)load("glMatrixRotatedEXT"); - glad_glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)load("glMatrixScalefEXT"); - glad_glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)load("glMatrixScaledEXT"); - glad_glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)load("glMatrixTranslatefEXT"); - glad_glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)load("glMatrixTranslatedEXT"); - glad_glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)load("glMatrixFrustumEXT"); - glad_glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)load("glMatrixOrthoEXT"); - glad_glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)load("glMatrixPopEXT"); - glad_glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)load("glMatrixPushEXT"); - glad_glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)load("glClientAttribDefaultEXT"); - glad_glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)load("glPushClientAttribDefaultEXT"); - glad_glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)load("glTextureParameterfEXT"); - glad_glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)load("glTextureParameterfvEXT"); - glad_glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)load("glTextureParameteriEXT"); - glad_glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)load("glTextureParameterivEXT"); - glad_glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)load("glTextureImage1DEXT"); - glad_glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)load("glTextureImage2DEXT"); - glad_glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)load("glTextureSubImage1DEXT"); - glad_glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)load("glTextureSubImage2DEXT"); - glad_glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)load("glCopyTextureImage1DEXT"); - glad_glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)load("glCopyTextureImage2DEXT"); - glad_glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)load("glCopyTextureSubImage1DEXT"); - glad_glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)load("glCopyTextureSubImage2DEXT"); - glad_glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)load("glGetTextureImageEXT"); - glad_glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)load("glGetTextureParameterfvEXT"); - glad_glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)load("glGetTextureParameterivEXT"); - glad_glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)load("glGetTextureLevelParameterfvEXT"); - glad_glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)load("glGetTextureLevelParameterivEXT"); - glad_glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)load("glTextureImage3DEXT"); - glad_glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)load("glTextureSubImage3DEXT"); - glad_glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)load("glCopyTextureSubImage3DEXT"); - glad_glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)load("glBindMultiTextureEXT"); - glad_glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)load("glMultiTexCoordPointerEXT"); - glad_glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)load("glMultiTexEnvfEXT"); - glad_glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)load("glMultiTexEnvfvEXT"); - glad_glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)load("glMultiTexEnviEXT"); - glad_glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)load("glMultiTexEnvivEXT"); - glad_glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)load("glMultiTexGendEXT"); - glad_glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)load("glMultiTexGendvEXT"); - glad_glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)load("glMultiTexGenfEXT"); - glad_glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)load("glMultiTexGenfvEXT"); - glad_glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)load("glMultiTexGeniEXT"); - glad_glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)load("glMultiTexGenivEXT"); - glad_glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)load("glGetMultiTexEnvfvEXT"); - glad_glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)load("glGetMultiTexEnvivEXT"); - glad_glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)load("glGetMultiTexGendvEXT"); - glad_glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)load("glGetMultiTexGenfvEXT"); - glad_glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)load("glGetMultiTexGenivEXT"); - glad_glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)load("glMultiTexParameteriEXT"); - glad_glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)load("glMultiTexParameterivEXT"); - glad_glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)load("glMultiTexParameterfEXT"); - glad_glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)load("glMultiTexParameterfvEXT"); - glad_glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)load("glMultiTexImage1DEXT"); - glad_glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)load("glMultiTexImage2DEXT"); - glad_glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)load("glMultiTexSubImage1DEXT"); - glad_glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)load("glMultiTexSubImage2DEXT"); - glad_glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)load("glCopyMultiTexImage1DEXT"); - glad_glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)load("glCopyMultiTexImage2DEXT"); - glad_glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)load("glCopyMultiTexSubImage1DEXT"); - glad_glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)load("glCopyMultiTexSubImage2DEXT"); - glad_glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)load("glGetMultiTexImageEXT"); - glad_glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)load("glGetMultiTexParameterfvEXT"); - glad_glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)load("glGetMultiTexParameterivEXT"); - glad_glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)load("glGetMultiTexLevelParameterfvEXT"); - glad_glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)load("glGetMultiTexLevelParameterivEXT"); - glad_glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)load("glMultiTexImage3DEXT"); - glad_glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)load("glMultiTexSubImage3DEXT"); - glad_glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)load("glCopyMultiTexSubImage3DEXT"); - glad_glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)load("glEnableClientStateIndexedEXT"); - glad_glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)load("glDisableClientStateIndexedEXT"); - glad_glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)load("glGetFloatIndexedvEXT"); - glad_glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)load("glGetDoubleIndexedvEXT"); - glad_glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)load("glGetPointerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)load("glCompressedTextureImage3DEXT"); - glad_glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)load("glCompressedTextureImage2DEXT"); - glad_glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)load("glCompressedTextureImage1DEXT"); - glad_glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)load("glCompressedTextureSubImage3DEXT"); - glad_glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)load("glCompressedTextureSubImage2DEXT"); - glad_glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)load("glCompressedTextureSubImage1DEXT"); - glad_glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)load("glGetCompressedTextureImageEXT"); - glad_glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)load("glCompressedMultiTexImage3DEXT"); - glad_glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)load("glCompressedMultiTexImage2DEXT"); - glad_glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)load("glCompressedMultiTexImage1DEXT"); - glad_glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)load("glCompressedMultiTexSubImage3DEXT"); - glad_glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)load("glCompressedMultiTexSubImage2DEXT"); - glad_glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)load("glCompressedMultiTexSubImage1DEXT"); - glad_glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)load("glGetCompressedMultiTexImageEXT"); - glad_glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)load("glMatrixLoadTransposefEXT"); - glad_glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)load("glMatrixLoadTransposedEXT"); - glad_glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)load("glMatrixMultTransposefEXT"); - glad_glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)load("glMatrixMultTransposedEXT"); - glad_glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)load("glNamedBufferDataEXT"); - glad_glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)load("glNamedBufferSubDataEXT"); - glad_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)load("glMapNamedBufferEXT"); - glad_glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)load("glUnmapNamedBufferEXT"); - glad_glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)load("glGetNamedBufferParameterivEXT"); - glad_glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)load("glGetNamedBufferPointervEXT"); - glad_glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)load("glGetNamedBufferSubDataEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); - glad_glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)load("glTextureBufferEXT"); - glad_glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)load("glMultiTexBufferEXT"); - glad_glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)load("glTextureParameterIivEXT"); - glad_glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)load("glTextureParameterIuivEXT"); - glad_glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)load("glGetTextureParameterIivEXT"); - glad_glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)load("glGetTextureParameterIuivEXT"); - glad_glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)load("glMultiTexParameterIivEXT"); - glad_glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)load("glMultiTexParameterIuivEXT"); - glad_glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)load("glGetMultiTexParameterIivEXT"); - glad_glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)load("glGetMultiTexParameterIuivEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glNamedProgramLocalParameters4fvEXT"); - glad_glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)load("glNamedProgramLocalParameterI4iEXT"); - glad_glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)load("glNamedProgramLocalParameterI4ivEXT"); - glad_glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)load("glNamedProgramLocalParametersI4ivEXT"); - glad_glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)load("glNamedProgramLocalParameterI4uiEXT"); - glad_glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)load("glNamedProgramLocalParameterI4uivEXT"); - glad_glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)load("glNamedProgramLocalParametersI4uivEXT"); - glad_glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)load("glGetNamedProgramLocalParameterIivEXT"); - glad_glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)load("glGetNamedProgramLocalParameterIuivEXT"); - glad_glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)load("glEnableClientStateiEXT"); - glad_glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)load("glDisableClientStateiEXT"); - glad_glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)load("glGetFloati_vEXT"); - glad_glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)load("glGetDoublei_vEXT"); - glad_glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)load("glGetPointeri_vEXT"); - glad_glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)load("glNamedProgramStringEXT"); - glad_glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)load("glNamedProgramLocalParameter4dEXT"); - glad_glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)load("glNamedProgramLocalParameter4dvEXT"); - glad_glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)load("glNamedProgramLocalParameter4fEXT"); - glad_glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)load("glNamedProgramLocalParameter4fvEXT"); - glad_glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)load("glGetNamedProgramLocalParameterdvEXT"); - glad_glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)load("glGetNamedProgramLocalParameterfvEXT"); - glad_glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)load("glGetNamedProgramivEXT"); - glad_glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)load("glGetNamedProgramStringEXT"); - glad_glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)load("glNamedRenderbufferStorageEXT"); - glad_glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)load("glGetNamedRenderbufferParameterivEXT"); - glad_glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glNamedRenderbufferStorageMultisampleEXT"); - glad_glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)load("glNamedRenderbufferStorageMultisampleCoverageEXT"); - glad_glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)load("glCheckNamedFramebufferStatusEXT"); - glad_glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)load("glNamedFramebufferTexture1DEXT"); - glad_glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)load("glNamedFramebufferTexture2DEXT"); - glad_glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)load("glNamedFramebufferTexture3DEXT"); - glad_glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)load("glNamedFramebufferRenderbufferEXT"); - glad_glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetNamedFramebufferAttachmentParameterivEXT"); - glad_glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)load("glGenerateTextureMipmapEXT"); - glad_glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)load("glGenerateMultiTexMipmapEXT"); - glad_glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)load("glFramebufferDrawBufferEXT"); - glad_glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)load("glFramebufferDrawBuffersEXT"); - glad_glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)load("glFramebufferReadBufferEXT"); - glad_glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetFramebufferParameterivEXT"); - glad_glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)load("glNamedCopyBufferSubDataEXT"); - glad_glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)load("glNamedFramebufferTextureEXT"); - glad_glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)load("glNamedFramebufferTextureLayerEXT"); - glad_glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)load("glNamedFramebufferTextureFaceEXT"); - glad_glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)load("glTextureRenderbufferEXT"); - glad_glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)load("glMultiTexRenderbufferEXT"); - glad_glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)load("glVertexArrayVertexOffsetEXT"); - glad_glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)load("glVertexArrayColorOffsetEXT"); - glad_glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)load("glVertexArrayEdgeFlagOffsetEXT"); - glad_glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)load("glVertexArrayIndexOffsetEXT"); - glad_glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)load("glVertexArrayNormalOffsetEXT"); - glad_glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)load("glVertexArrayTexCoordOffsetEXT"); - glad_glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)load("glVertexArrayMultiTexCoordOffsetEXT"); - glad_glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)load("glVertexArrayFogCoordOffsetEXT"); - glad_glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)load("glVertexArraySecondaryColorOffsetEXT"); - glad_glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)load("glVertexArrayVertexAttribOffsetEXT"); - glad_glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)load("glVertexArrayVertexAttribIOffsetEXT"); - glad_glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)load("glEnableVertexArrayEXT"); - glad_glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)load("glDisableVertexArrayEXT"); - glad_glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)load("glEnableVertexArrayAttribEXT"); - glad_glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)load("glDisableVertexArrayAttribEXT"); - glad_glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)load("glGetVertexArrayIntegervEXT"); - glad_glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)load("glGetVertexArrayPointervEXT"); - glad_glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)load("glGetVertexArrayIntegeri_vEXT"); - glad_glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)load("glGetVertexArrayPointeri_vEXT"); - glad_glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)load("glMapNamedBufferRangeEXT"); - glad_glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)load("glFlushMappedNamedBufferRangeEXT"); - glad_glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)load("glNamedBufferStorageEXT"); - glad_glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)load("glClearNamedBufferDataEXT"); - glad_glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)load("glClearNamedBufferSubDataEXT"); - glad_glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)load("glNamedFramebufferParameteriEXT"); - glad_glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetNamedFramebufferParameterivEXT"); - glad_glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)load("glProgramUniform1dEXT"); - glad_glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)load("glProgramUniform2dEXT"); - glad_glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)load("glProgramUniform3dEXT"); - glad_glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)load("glProgramUniform4dEXT"); - glad_glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)load("glProgramUniform1dvEXT"); - glad_glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)load("glProgramUniform2dvEXT"); - glad_glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)load("glProgramUniform3dvEXT"); - glad_glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)load("glProgramUniform4dvEXT"); - glad_glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)load("glProgramUniformMatrix2dvEXT"); - glad_glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)load("glProgramUniformMatrix3dvEXT"); - glad_glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)load("glProgramUniformMatrix4dvEXT"); - glad_glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)load("glProgramUniformMatrix2x3dvEXT"); - glad_glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)load("glProgramUniformMatrix2x4dvEXT"); - glad_glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)load("glProgramUniformMatrix3x2dvEXT"); - glad_glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)load("glProgramUniformMatrix3x4dvEXT"); - glad_glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)load("glProgramUniformMatrix4x2dvEXT"); - glad_glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)load("glProgramUniformMatrix4x3dvEXT"); - glad_glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)load("glTextureBufferRangeEXT"); - glad_glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)load("glTextureStorage1DEXT"); - glad_glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)load("glTextureStorage2DEXT"); - glad_glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)load("glTextureStorage3DEXT"); - glad_glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)load("glTextureStorage2DMultisampleEXT"); - glad_glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)load("glTextureStorage3DMultisampleEXT"); - glad_glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)load("glVertexArrayBindVertexBufferEXT"); - glad_glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)load("glVertexArrayVertexAttribFormatEXT"); - glad_glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)load("glVertexArrayVertexAttribIFormatEXT"); - glad_glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)load("glVertexArrayVertexAttribLFormatEXT"); - glad_glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)load("glVertexArrayVertexAttribBindingEXT"); - glad_glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)load("glVertexArrayVertexBindingDivisorEXT"); - glad_glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)load("glVertexArrayVertexAttribLOffsetEXT"); - glad_glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)load("glTexturePageCommitmentEXT"); - glad_glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)load("glVertexArrayVertexAttribDivisorEXT"); -} -static void load_GL_AMD_sample_positions(GLADloadproc load) { - if(!GLAD_GL_AMD_sample_positions) return; - glad_glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)load("glSetMultisamplefvAMD"); -} -static void load_GL_NV_vertex_program(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program) return; - glad_glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)load("glAreProgramsResidentNV"); - glad_glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)load("glBindProgramNV"); - glad_glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)load("glDeleteProgramsNV"); - glad_glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)load("glExecuteProgramNV"); - glad_glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)load("glGenProgramsNV"); - glad_glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)load("glGetProgramParameterdvNV"); - glad_glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)load("glGetProgramParameterfvNV"); - glad_glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)load("glGetProgramivNV"); - glad_glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)load("glGetProgramStringNV"); - glad_glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)load("glGetTrackMatrixivNV"); - glad_glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)load("glGetVertexAttribdvNV"); - glad_glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)load("glGetVertexAttribfvNV"); - glad_glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)load("glGetVertexAttribivNV"); - glad_glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)load("glGetVertexAttribPointervNV"); - glad_glIsProgramNV = (PFNGLISPROGRAMNVPROC)load("glIsProgramNV"); - glad_glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)load("glLoadProgramNV"); - glad_glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)load("glProgramParameter4dNV"); - glad_glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)load("glProgramParameter4dvNV"); - glad_glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)load("glProgramParameter4fNV"); - glad_glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)load("glProgramParameter4fvNV"); - glad_glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)load("glProgramParameters4dvNV"); - glad_glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)load("glProgramParameters4fvNV"); - glad_glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)load("glRequestResidentProgramsNV"); - glad_glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)load("glTrackMatrixNV"); - glad_glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)load("glVertexAttribPointerNV"); - glad_glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)load("glVertexAttrib1dNV"); - glad_glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)load("glVertexAttrib1dvNV"); - glad_glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)load("glVertexAttrib1fNV"); - glad_glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)load("glVertexAttrib1fvNV"); - glad_glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)load("glVertexAttrib1sNV"); - glad_glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)load("glVertexAttrib1svNV"); - glad_glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)load("glVertexAttrib2dNV"); - glad_glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)load("glVertexAttrib2dvNV"); - glad_glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)load("glVertexAttrib2fNV"); - glad_glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)load("glVertexAttrib2fvNV"); - glad_glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)load("glVertexAttrib2sNV"); - glad_glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)load("glVertexAttrib2svNV"); - glad_glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)load("glVertexAttrib3dNV"); - glad_glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)load("glVertexAttrib3dvNV"); - glad_glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)load("glVertexAttrib3fNV"); - glad_glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)load("glVertexAttrib3fvNV"); - glad_glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)load("glVertexAttrib3sNV"); - glad_glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)load("glVertexAttrib3svNV"); - glad_glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)load("glVertexAttrib4dNV"); - glad_glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)load("glVertexAttrib4dvNV"); - glad_glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)load("glVertexAttrib4fNV"); - glad_glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)load("glVertexAttrib4fvNV"); - glad_glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)load("glVertexAttrib4sNV"); - glad_glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)load("glVertexAttrib4svNV"); - glad_glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)load("glVertexAttrib4ubNV"); - glad_glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)load("glVertexAttrib4ubvNV"); - glad_glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)load("glVertexAttribs1dvNV"); - glad_glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)load("glVertexAttribs1fvNV"); - glad_glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)load("glVertexAttribs1svNV"); - glad_glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)load("glVertexAttribs2dvNV"); - glad_glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)load("glVertexAttribs2fvNV"); - glad_glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)load("glVertexAttribs2svNV"); - glad_glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)load("glVertexAttribs3dvNV"); - glad_glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)load("glVertexAttribs3fvNV"); - glad_glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)load("glVertexAttribs3svNV"); - glad_glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)load("glVertexAttribs4dvNV"); - glad_glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)load("glVertexAttribs4fvNV"); - glad_glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)load("glVertexAttribs4svNV"); - glad_glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)load("glVertexAttribs4ubvNV"); -} -static void load_GL_EXT_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_shader) return; - glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); - glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); - glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); - glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); - glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); - glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); - glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); - glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); - glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); - glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); - glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); - glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); - glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); - glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); - glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); - glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); - glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); - glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); - glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); - glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); - glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); - glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); - glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); - glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); - glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); - glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); - glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); - glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); - glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); - glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); - glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); - glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); - glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); - glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); - glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); - glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); - glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); - glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); - glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); - glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); - glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); - glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); -} -static void load_GL_EXT_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_func_separate) return; - glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); -} -static void load_GL_APPLE_fence(GLADloadproc load) { - if(!GLAD_GL_APPLE_fence) return; - glad_glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)load("glGenFencesAPPLE"); - glad_glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)load("glDeleteFencesAPPLE"); - glad_glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)load("glSetFenceAPPLE"); - glad_glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)load("glIsFenceAPPLE"); - glad_glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)load("glTestFenceAPPLE"); - glad_glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)load("glFinishFenceAPPLE"); - glad_glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)load("glTestObjectAPPLE"); - glad_glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)load("glFinishObjectAPPLE"); -} -static void load_GL_OES_byte_coordinates(GLADloadproc load) { - if(!GLAD_GL_OES_byte_coordinates) return; - glad_glMultiTexCoord1bOES = (PFNGLMULTITEXCOORD1BOESPROC)load("glMultiTexCoord1bOES"); - glad_glMultiTexCoord1bvOES = (PFNGLMULTITEXCOORD1BVOESPROC)load("glMultiTexCoord1bvOES"); - glad_glMultiTexCoord2bOES = (PFNGLMULTITEXCOORD2BOESPROC)load("glMultiTexCoord2bOES"); - glad_glMultiTexCoord2bvOES = (PFNGLMULTITEXCOORD2BVOESPROC)load("glMultiTexCoord2bvOES"); - glad_glMultiTexCoord3bOES = (PFNGLMULTITEXCOORD3BOESPROC)load("glMultiTexCoord3bOES"); - glad_glMultiTexCoord3bvOES = (PFNGLMULTITEXCOORD3BVOESPROC)load("glMultiTexCoord3bvOES"); - glad_glMultiTexCoord4bOES = (PFNGLMULTITEXCOORD4BOESPROC)load("glMultiTexCoord4bOES"); - glad_glMultiTexCoord4bvOES = (PFNGLMULTITEXCOORD4BVOESPROC)load("glMultiTexCoord4bvOES"); - glad_glTexCoord1bOES = (PFNGLTEXCOORD1BOESPROC)load("glTexCoord1bOES"); - glad_glTexCoord1bvOES = (PFNGLTEXCOORD1BVOESPROC)load("glTexCoord1bvOES"); - glad_glTexCoord2bOES = (PFNGLTEXCOORD2BOESPROC)load("glTexCoord2bOES"); - glad_glTexCoord2bvOES = (PFNGLTEXCOORD2BVOESPROC)load("glTexCoord2bvOES"); - glad_glTexCoord3bOES = (PFNGLTEXCOORD3BOESPROC)load("glTexCoord3bOES"); - glad_glTexCoord3bvOES = (PFNGLTEXCOORD3BVOESPROC)load("glTexCoord3bvOES"); - glad_glTexCoord4bOES = (PFNGLTEXCOORD4BOESPROC)load("glTexCoord4bOES"); - glad_glTexCoord4bvOES = (PFNGLTEXCOORD4BVOESPROC)load("glTexCoord4bvOES"); - glad_glVertex2bOES = (PFNGLVERTEX2BOESPROC)load("glVertex2bOES"); - glad_glVertex2bvOES = (PFNGLVERTEX2BVOESPROC)load("glVertex2bvOES"); - glad_glVertex3bOES = (PFNGLVERTEX3BOESPROC)load("glVertex3bOES"); - glad_glVertex3bvOES = (PFNGLVERTEX3BVOESPROC)load("glVertex3bvOES"); - glad_glVertex4bOES = (PFNGLVERTEX4BOESPROC)load("glVertex4bOES"); - glad_glVertex4bvOES = (PFNGLVERTEX4BVOESPROC)load("glVertex4bvOES"); -} -static void load_GL_ARB_transpose_matrix(GLADloadproc load) { - if(!GLAD_GL_ARB_transpose_matrix) return; - glad_glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)load("glLoadTransposeMatrixfARB"); - glad_glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)load("glLoadTransposeMatrixdARB"); - glad_glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)load("glMultTransposeMatrixfARB"); - glad_glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)load("glMultTransposeMatrixdARB"); -} -static void load_GL_ARB_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_provoking_vertex) return; - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); -} -static void load_GL_EXT_fog_coord(GLADloadproc load) { - if(!GLAD_GL_EXT_fog_coord) return; - glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); - glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); - glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); - glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); - glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); -} -static void load_GL_EXT_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_array) return; - glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); - glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); - glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); - glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); - glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); - glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); - glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); - glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); - glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); -} -static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_equation_separate) return; - glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); -} -static void load_GL_NV_framebuffer_mixed_samples(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_mixed_samples) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); - glad_glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)load("glCoverageModulationTableNV"); - glad_glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)load("glGetCoverageModulationTableNV"); - glad_glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)load("glCoverageModulationNV"); -} -static void load_GL_NVX_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NVX_conditional_render) return; - glad_glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)load("glBeginConditionalRenderNVX"); - glad_glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)load("glEndConditionalRenderNVX"); -} -static void load_GL_ARB_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); - glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); -} -static void load_GL_EXT_raster_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_raster_multisample) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); -} -static void load_GL_NV_copy_image(GLADloadproc load) { - if(!GLAD_GL_NV_copy_image) return; - glad_glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)load("glCopyImageSubDataNV"); -} -static void load_GL_INTEL_framebuffer_CMAA(GLADloadproc load) { - if(!GLAD_GL_INTEL_framebuffer_CMAA) return; - glad_glApplyFramebufferAttachmentCMAAINTEL = (PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)load("glApplyFramebufferAttachmentCMAAINTEL"); -} -static void load_GL_ARB_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback2) return; - glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); - glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); - glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); - glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); - glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); - glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); - glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); -} -static void load_GL_ARB_transform_feedback3(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback3) return; - glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); - glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); - glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); - glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); -} -static void load_GL_EXT_debug_marker(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_marker) return; - glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); - glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); - glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); -} -static void load_GL_EXT_pixel_transform(GLADloadproc load) { - if(!GLAD_GL_EXT_pixel_transform) return; - glad_glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)load("glPixelTransformParameteriEXT"); - glad_glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)load("glPixelTransformParameterfEXT"); - glad_glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)load("glPixelTransformParameterivEXT"); - glad_glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)load("glPixelTransformParameterfvEXT"); - glad_glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)load("glGetPixelTransformParameterivEXT"); - glad_glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)load("glGetPixelTransformParameterfvEXT"); -} -static void load_GL_ATI_fragment_shader(GLADloadproc load) { - if(!GLAD_GL_ATI_fragment_shader) return; - glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); - glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); - glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); - glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); - glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); - glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); - glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); - glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); - glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); - glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); - glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); - glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); - glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); - glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); -} -static void load_GL_ARB_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_array_object) return; - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_SUN_triangle_list(GLADloadproc load) { - if(!GLAD_GL_SUN_triangle_list) return; - glad_glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)load("glReplacementCodeuiSUN"); - glad_glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)load("glReplacementCodeusSUN"); - glad_glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)load("glReplacementCodeubSUN"); - glad_glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)load("glReplacementCodeuivSUN"); - glad_glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)load("glReplacementCodeusvSUN"); - glad_glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)load("glReplacementCodeubvSUN"); - glad_glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)load("glReplacementCodePointerSUN"); -} -static void load_GL_ARB_transform_feedback_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback_instanced) return; - glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); - glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); -} -static void load_GL_SGIX_async(GLADloadproc load) { - if(!GLAD_GL_SGIX_async) return; - glad_glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)load("glAsyncMarkerSGIX"); - glad_glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)load("glFinishAsyncSGIX"); - glad_glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)load("glPollAsyncSGIX"); - glad_glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)load("glGenAsyncMarkersSGIX"); - glad_glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)load("glDeleteAsyncMarkersSGIX"); - glad_glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)load("glIsAsyncMarkerSGIX"); -} -static void load_GL_INTEL_performance_query(GLADloadproc load) { - if(!GLAD_GL_INTEL_performance_query) return; - glad_glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)load("glBeginPerfQueryINTEL"); - glad_glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)load("glCreatePerfQueryINTEL"); - glad_glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)load("glDeletePerfQueryINTEL"); - glad_glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)load("glEndPerfQueryINTEL"); - glad_glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)load("glGetFirstPerfQueryIdINTEL"); - glad_glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)load("glGetNextPerfQueryIdINTEL"); - glad_glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)load("glGetPerfCounterInfoINTEL"); - glad_glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)load("glGetPerfQueryDataINTEL"); - glad_glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)load("glGetPerfQueryIdByNameINTEL"); - glad_glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)load("glGetPerfQueryInfoINTEL"); -} -static void load_GL_NV_gpu_shader5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_shader5) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_NV_bindless_multi_draw_indirect_count(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect_count) return; - glad_glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawArraysIndirectBindlessCountNV"); - glad_glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawElementsIndirectBindlessCountNV"); -} -static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES2_compatibility) return; - glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); - glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); - glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); - glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); - glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); -} -static void load_GL_ARB_indirect_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_indirect_parameters) return; - glad_glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)load("glMultiDrawArraysIndirectCountARB"); - glad_glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)load("glMultiDrawElementsIndirectCountARB"); -} -static void load_GL_NV_half_float(GLADloadproc load) { - if(!GLAD_GL_NV_half_float) return; - glad_glVertex2hNV = (PFNGLVERTEX2HNVPROC)load("glVertex2hNV"); - glad_glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)load("glVertex2hvNV"); - glad_glVertex3hNV = (PFNGLVERTEX3HNVPROC)load("glVertex3hNV"); - glad_glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)load("glVertex3hvNV"); - glad_glVertex4hNV = (PFNGLVERTEX4HNVPROC)load("glVertex4hNV"); - glad_glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)load("glVertex4hvNV"); - glad_glNormal3hNV = (PFNGLNORMAL3HNVPROC)load("glNormal3hNV"); - glad_glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)load("glNormal3hvNV"); - glad_glColor3hNV = (PFNGLCOLOR3HNVPROC)load("glColor3hNV"); - glad_glColor3hvNV = (PFNGLCOLOR3HVNVPROC)load("glColor3hvNV"); - glad_glColor4hNV = (PFNGLCOLOR4HNVPROC)load("glColor4hNV"); - glad_glColor4hvNV = (PFNGLCOLOR4HVNVPROC)load("glColor4hvNV"); - glad_glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)load("glTexCoord1hNV"); - glad_glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)load("glTexCoord1hvNV"); - glad_glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)load("glTexCoord2hNV"); - glad_glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)load("glTexCoord2hvNV"); - glad_glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)load("glTexCoord3hNV"); - glad_glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)load("glTexCoord3hvNV"); - glad_glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)load("glTexCoord4hNV"); - glad_glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)load("glTexCoord4hvNV"); - glad_glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)load("glMultiTexCoord1hNV"); - glad_glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)load("glMultiTexCoord1hvNV"); - glad_glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)load("glMultiTexCoord2hNV"); - glad_glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)load("glMultiTexCoord2hvNV"); - glad_glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)load("glMultiTexCoord3hNV"); - glad_glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)load("glMultiTexCoord3hvNV"); - glad_glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)load("glMultiTexCoord4hNV"); - glad_glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)load("glMultiTexCoord4hvNV"); - glad_glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)load("glFogCoordhNV"); - glad_glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)load("glFogCoordhvNV"); - glad_glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)load("glSecondaryColor3hNV"); - glad_glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)load("glSecondaryColor3hvNV"); - glad_glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)load("glVertexWeighthNV"); - glad_glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)load("glVertexWeighthvNV"); - glad_glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)load("glVertexAttrib1hNV"); - glad_glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)load("glVertexAttrib1hvNV"); - glad_glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)load("glVertexAttrib2hNV"); - glad_glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)load("glVertexAttrib2hvNV"); - glad_glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)load("glVertexAttrib3hNV"); - glad_glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)load("glVertexAttrib3hvNV"); - glad_glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)load("glVertexAttrib4hNV"); - glad_glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)load("glVertexAttrib4hvNV"); - glad_glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)load("glVertexAttribs1hvNV"); - glad_glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)load("glVertexAttribs2hvNV"); - glad_glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)load("glVertexAttribs3hvNV"); - glad_glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)load("glVertexAttribs4hvNV"); -} -static void load_GL_ARB_ES3_2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_2_compatibility) return; - glad_glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)load("glPrimitiveBoundingBoxARB"); -} -static void load_GL_EXT_polygon_offset_clamp(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset_clamp) return; - glad_glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)load("glPolygonOffsetClampEXT"); -} -static void load_GL_EXT_compiled_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_compiled_vertex_array) return; - glad_glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)load("glLockArraysEXT"); - glad_glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)load("glUnlockArraysEXT"); -} -static void load_GL_NV_depth_buffer_float(GLADloadproc load) { - if(!GLAD_GL_NV_depth_buffer_float) return; - glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); - glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); - glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); -} -static void load_GL_NV_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_NV_occlusion_query) return; - glad_glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)load("glGenOcclusionQueriesNV"); - glad_glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)load("glDeleteOcclusionQueriesNV"); - glad_glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)load("glIsOcclusionQueryNV"); - glad_glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)load("glBeginOcclusionQueryNV"); - glad_glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)load("glEndOcclusionQueryNV"); - glad_glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)load("glGetOcclusionQueryivNV"); - glad_glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)load("glGetOcclusionQueryuivNV"); -} -static void load_GL_APPLE_flush_buffer_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_flush_buffer_range) return; - glad_glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)load("glBufferParameteriAPPLE"); - glad_glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)load("glFlushMappedBufferRangeAPPLE"); -} -static void load_GL_ARB_imaging(GLADloadproc load) { - if(!GLAD_GL_ARB_imaging) return; - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); - glad_glColorTable = (PFNGLCOLORTABLEPROC)load("glColorTable"); - glad_glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)load("glColorTableParameterfv"); - glad_glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)load("glColorTableParameteriv"); - glad_glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)load("glCopyColorTable"); - glad_glGetColorTable = (PFNGLGETCOLORTABLEPROC)load("glGetColorTable"); - glad_glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)load("glGetColorTableParameterfv"); - glad_glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)load("glGetColorTableParameteriv"); - glad_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)load("glColorSubTable"); - glad_glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)load("glCopyColorSubTable"); - glad_glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)load("glConvolutionFilter1D"); - glad_glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)load("glConvolutionFilter2D"); - glad_glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)load("glConvolutionParameterf"); - glad_glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)load("glConvolutionParameterfv"); - glad_glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)load("glConvolutionParameteri"); - glad_glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)load("glConvolutionParameteriv"); - glad_glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)load("glCopyConvolutionFilter1D"); - glad_glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)load("glCopyConvolutionFilter2D"); - glad_glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)load("glGetConvolutionFilter"); - glad_glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)load("glGetConvolutionParameterfv"); - glad_glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)load("glGetConvolutionParameteriv"); - glad_glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)load("glGetSeparableFilter"); - glad_glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)load("glSeparableFilter2D"); - glad_glGetHistogram = (PFNGLGETHISTOGRAMPROC)load("glGetHistogram"); - glad_glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)load("glGetHistogramParameterfv"); - glad_glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)load("glGetHistogramParameteriv"); - glad_glGetMinmax = (PFNGLGETMINMAXPROC)load("glGetMinmax"); - glad_glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)load("glGetMinmaxParameterfv"); - glad_glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)load("glGetMinmaxParameteriv"); - glad_glHistogram = (PFNGLHISTOGRAMPROC)load("glHistogram"); - glad_glMinmax = (PFNGLMINMAXPROC)load("glMinmax"); - glad_glResetHistogram = (PFNGLRESETHISTOGRAMPROC)load("glResetHistogram"); - glad_glResetMinmax = (PFNGLRESETMINMAXPROC)load("glResetMinmax"); -} -static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers_blend) return; - glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); - glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); - glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); - glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); -} -static void load_GL_ARB_clear_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_buffer_object) return; - glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); - glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); -} -static void load_GL_ARB_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_multisample) return; - glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); -} -static void load_GL_EXT_debug_label(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_label) return; - glad_glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)load("glLabelObjectEXT"); - glad_glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)load("glGetObjectLabelEXT"); -} -static void load_GL_ARB_sample_shading(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_shading) return; - glad_glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)load("glMinSampleShadingARB"); -} -static void load_GL_NV_internalformat_sample_query(GLADloadproc load) { - if(!GLAD_GL_NV_internalformat_sample_query) return; - glad_glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)load("glGetInternalformatSampleivNV"); -} -static void load_GL_INTEL_map_texture(GLADloadproc load) { - if(!GLAD_GL_INTEL_map_texture) return; - glad_glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)load("glSyncTextureINTEL"); - glad_glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)load("glUnmapTexture2DINTEL"); - glad_glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)load("glMapTexture2DINTEL"); -} -static void load_GL_ARB_compute_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_shader) return; - glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); - glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); -} -static void load_GL_IBM_vertex_array_lists(GLADloadproc load) { - if(!GLAD_GL_IBM_vertex_array_lists) return; - glad_glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)load("glColorPointerListIBM"); - glad_glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)load("glSecondaryColorPointerListIBM"); - glad_glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)load("glEdgeFlagPointerListIBM"); - glad_glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)load("glFogCoordPointerListIBM"); - glad_glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)load("glIndexPointerListIBM"); - glad_glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)load("glNormalPointerListIBM"); - glad_glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)load("glTexCoordPointerListIBM"); - glad_glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)load("glVertexPointerListIBM"); -} -static void load_GL_ARB_color_buffer_float(GLADloadproc load) { - if(!GLAD_GL_ARB_color_buffer_float) return; - glad_glClampColorARB = (PFNGLCLAMPCOLORARBPROC)load("glClampColorARB"); -} -static void load_GL_ARB_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_bindless_texture) return; - glad_glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)load("glGetTextureHandleARB"); - glad_glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)load("glGetTextureSamplerHandleARB"); - glad_glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)load("glMakeTextureHandleResidentARB"); - glad_glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)load("glMakeTextureHandleNonResidentARB"); - glad_glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)load("glGetImageHandleARB"); - glad_glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)load("glMakeImageHandleResidentARB"); - glad_glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)load("glMakeImageHandleNonResidentARB"); - glad_glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)load("glUniformHandleui64ARB"); - glad_glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)load("glUniformHandleui64vARB"); - glad_glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)load("glProgramUniformHandleui64ARB"); - glad_glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)load("glProgramUniformHandleui64vARB"); - glad_glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)load("glIsTextureHandleResidentARB"); - glad_glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)load("glIsImageHandleResidentARB"); - glad_glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)load("glVertexAttribL1ui64ARB"); - glad_glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)load("glVertexAttribL1ui64vARB"); - glad_glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)load("glGetVertexAttribLui64vARB"); -} -static void load_GL_ARB_window_pos(GLADloadproc load) { - if(!GLAD_GL_ARB_window_pos) return; - glad_glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)load("glWindowPos2dARB"); - glad_glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)load("glWindowPos2dvARB"); - glad_glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)load("glWindowPos2fARB"); - glad_glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)load("glWindowPos2fvARB"); - glad_glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)load("glWindowPos2iARB"); - glad_glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)load("glWindowPos2ivARB"); - glad_glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)load("glWindowPos2sARB"); - glad_glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)load("glWindowPos2svARB"); - glad_glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)load("glWindowPos3dARB"); - glad_glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)load("glWindowPos3dvARB"); - glad_glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)load("glWindowPos3fARB"); - glad_glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)load("glWindowPos3fvARB"); - glad_glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)load("glWindowPos3iARB"); - glad_glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)load("glWindowPos3ivARB"); - glad_glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)load("glWindowPos3sARB"); - glad_glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)load("glWindowPos3svARB"); -} -static void load_GL_ARB_internalformat_query(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query) return; - glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); -} -static void load_GL_EXT_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_EXT_shader_image_load_store) return; - glad_glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)load("glBindImageTextureEXT"); - glad_glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)load("glMemoryBarrierEXT"); -} -static void load_GL_EXT_copy_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_copy_texture) return; - glad_glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)load("glCopyTexImage1DEXT"); - glad_glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)load("glCopyTexImage2DEXT"); - glad_glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)load("glCopyTexSubImage1DEXT"); - glad_glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)load("glCopyTexSubImage2DEXT"); - glad_glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)load("glCopyTexSubImage3DEXT"); -} -static void load_GL_NV_register_combiners2(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners2) return; - glad_glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)load("glCombinerStageParameterfvNV"); - glad_glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)load("glGetCombinerStageParameterfvNV"); -} -static void load_GL_NV_draw_texture(GLADloadproc load) { - if(!GLAD_GL_NV_draw_texture) return; - glad_glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)load("glDrawTextureNV"); -} -static void load_GL_EXT_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_instanced) return; - glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load("glDrawArraysInstancedEXT"); - glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load("glDrawElementsInstancedEXT"); -} -static void load_GL_ARB_viewport_array(GLADloadproc load) { - if(!GLAD_GL_ARB_viewport_array) return; - glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); - glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); - glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); - glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); - glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); - glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); - glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); - glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); - glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); - glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); -} -static void load_GL_ARB_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_separate_shader_objects) return; - glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); - glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); - glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); - glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); - glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); - glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); - glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); - glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); - glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); - glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); - glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); - glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); - glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); - glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); - glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); - glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); - glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); - glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); - glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); - glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); - glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); - glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); - glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); - glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); - glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); - glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); - glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); - glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); - glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); - glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); - glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); - glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); - glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); - glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); - glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); - glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); - glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); - glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); - glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); - glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); - glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); - glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); - glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); - glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); - glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); - glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); - glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); - glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); - glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); - glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); - glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); - glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); - glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); - glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); - glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); - glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); - glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); - glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); - glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); - glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); -} -static void load_GL_EXT_depth_bounds_test(GLADloadproc load) { - if(!GLAD_GL_EXT_depth_bounds_test) return; - glad_glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)load("glDepthBoundsEXT"); -} -static void load_GL_NV_video_capture(GLADloadproc load) { - if(!GLAD_GL_NV_video_capture) return; - glad_glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)load("glBeginVideoCaptureNV"); - glad_glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)load("glBindVideoCaptureStreamBufferNV"); - glad_glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)load("glBindVideoCaptureStreamTextureNV"); - glad_glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)load("glEndVideoCaptureNV"); - glad_glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)load("glGetVideoCaptureivNV"); - glad_glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)load("glGetVideoCaptureStreamivNV"); - glad_glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)load("glGetVideoCaptureStreamfvNV"); - glad_glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)load("glGetVideoCaptureStreamdvNV"); - glad_glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)load("glVideoCaptureNV"); - glad_glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)load("glVideoCaptureStreamParameterivNV"); - glad_glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)load("glVideoCaptureStreamParameterfvNV"); - glad_glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)load("glVideoCaptureStreamParameterdvNV"); -} -static void load_GL_ARB_sampler_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_sampler_objects) return; - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); -} -static void load_GL_ARB_matrix_palette(GLADloadproc load) { - if(!GLAD_GL_ARB_matrix_palette) return; - glad_glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)load("glCurrentPaletteMatrixARB"); - glad_glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)load("glMatrixIndexubvARB"); - glad_glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)load("glMatrixIndexusvARB"); - glad_glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)load("glMatrixIndexuivARB"); - glad_glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)load("glMatrixIndexPointerARB"); -} -static void load_GL_SGIS_texture_color_mask(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_color_mask) return; - glad_glTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC)load("glTextureColorMaskSGIS"); -} -static void load_GL_EXT_coordinate_frame(GLADloadproc load) { - if(!GLAD_GL_EXT_coordinate_frame) return; - glad_glTangent3bEXT = (PFNGLTANGENT3BEXTPROC)load("glTangent3bEXT"); - glad_glTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC)load("glTangent3bvEXT"); - glad_glTangent3dEXT = (PFNGLTANGENT3DEXTPROC)load("glTangent3dEXT"); - glad_glTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC)load("glTangent3dvEXT"); - glad_glTangent3fEXT = (PFNGLTANGENT3FEXTPROC)load("glTangent3fEXT"); - glad_glTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC)load("glTangent3fvEXT"); - glad_glTangent3iEXT = (PFNGLTANGENT3IEXTPROC)load("glTangent3iEXT"); - glad_glTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC)load("glTangent3ivEXT"); - glad_glTangent3sEXT = (PFNGLTANGENT3SEXTPROC)load("glTangent3sEXT"); - glad_glTangent3svEXT = (PFNGLTANGENT3SVEXTPROC)load("glTangent3svEXT"); - glad_glBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC)load("glBinormal3bEXT"); - glad_glBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC)load("glBinormal3bvEXT"); - glad_glBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC)load("glBinormal3dEXT"); - glad_glBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC)load("glBinormal3dvEXT"); - glad_glBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC)load("glBinormal3fEXT"); - glad_glBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC)load("glBinormal3fvEXT"); - glad_glBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC)load("glBinormal3iEXT"); - glad_glBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC)load("glBinormal3ivEXT"); - glad_glBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC)load("glBinormal3sEXT"); - glad_glBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC)load("glBinormal3svEXT"); - glad_glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)load("glTangentPointerEXT"); - glad_glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)load("glBinormalPointerEXT"); -} -static void load_GL_ARB_texture_compression(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_compression) return; - glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); - glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); - glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); - glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); - glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); - glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); - glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); -} -static void load_GL_ARB_shader_subroutine(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_subroutine) return; - glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); - glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); - glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); - glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); - glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); - glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); - glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); - glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); -} -static void load_GL_ARB_texture_storage_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage_multisample) return; - glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); - glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); -} -static void load_GL_EXT_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_attrib_64bit) return; - glad_glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)load("glVertexAttribL1dEXT"); - glad_glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)load("glVertexAttribL2dEXT"); - glad_glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)load("glVertexAttribL3dEXT"); - glad_glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)load("glVertexAttribL4dEXT"); - glad_glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)load("glVertexAttribL1dvEXT"); - glad_glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)load("glVertexAttribL2dvEXT"); - glad_glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)load("glVertexAttribL3dvEXT"); - glad_glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)load("glVertexAttribL4dvEXT"); - glad_glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)load("glVertexAttribLPointerEXT"); - glad_glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)load("glGetVertexAttribLdvEXT"); -} -static void load_GL_OES_query_matrix(GLADloadproc load) { - if(!GLAD_GL_OES_query_matrix) return; - glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); -} -static void load_GL_MESA_window_pos(GLADloadproc load) { - if(!GLAD_GL_MESA_window_pos) return; - glad_glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)load("glWindowPos2dMESA"); - glad_glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)load("glWindowPos2dvMESA"); - glad_glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)load("glWindowPos2fMESA"); - glad_glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)load("glWindowPos2fvMESA"); - glad_glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)load("glWindowPos2iMESA"); - glad_glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)load("glWindowPos2ivMESA"); - glad_glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)load("glWindowPos2sMESA"); - glad_glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)load("glWindowPos2svMESA"); - glad_glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)load("glWindowPos3dMESA"); - glad_glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)load("glWindowPos3dvMESA"); - glad_glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)load("glWindowPos3fMESA"); - glad_glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)load("glWindowPos3fvMESA"); - glad_glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)load("glWindowPos3iMESA"); - glad_glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)load("glWindowPos3ivMESA"); - glad_glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)load("glWindowPos3sMESA"); - glad_glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)load("glWindowPos3svMESA"); - glad_glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)load("glWindowPos4dMESA"); - glad_glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)load("glWindowPos4dvMESA"); - glad_glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)load("glWindowPos4fMESA"); - glad_glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)load("glWindowPos4fvMESA"); - glad_glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)load("glWindowPos4iMESA"); - glad_glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)load("glWindowPos4ivMESA"); - glad_glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)load("glWindowPos4sMESA"); - glad_glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)load("glWindowPos4svMESA"); -} -static void load_GL_ARB_copy_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_buffer) return; - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); -} -static void load_GL_APPLE_object_purgeable(GLADloadproc load) { - if(!GLAD_GL_APPLE_object_purgeable) return; - glad_glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)load("glObjectPurgeableAPPLE"); - glad_glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)load("glObjectUnpurgeableAPPLE"); - glad_glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)load("glGetObjectParameterivAPPLE"); -} -static void load_GL_ARB_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_ARB_occlusion_query) return; - glad_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)load("glGenQueriesARB"); - glad_glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)load("glDeleteQueriesARB"); - glad_glIsQueryARB = (PFNGLISQUERYARBPROC)load("glIsQueryARB"); - glad_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)load("glBeginQueryARB"); - glad_glEndQueryARB = (PFNGLENDQUERYARBPROC)load("glEndQueryARB"); - glad_glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)load("glGetQueryivARB"); - glad_glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)load("glGetQueryObjectivARB"); - glad_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)load("glGetQueryObjectuivARB"); -} -static void load_GL_SGI_color_table(GLADloadproc load) { - if(!GLAD_GL_SGI_color_table) return; - glad_glColorTableSGI = (PFNGLCOLORTABLESGIPROC)load("glColorTableSGI"); - glad_glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)load("glColorTableParameterfvSGI"); - glad_glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)load("glColorTableParameterivSGI"); - glad_glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)load("glCopyColorTableSGI"); - glad_glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)load("glGetColorTableSGI"); - glad_glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)load("glGetColorTableParameterfvSGI"); - glad_glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)load("glGetColorTableParameterivSGI"); -} -static void load_GL_EXT_gpu_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_shader4) return; - glad_glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)load("glGetUniformuivEXT"); - glad_glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)load("glBindFragDataLocationEXT"); - glad_glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)load("glGetFragDataLocationEXT"); - glad_glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)load("glUniform1uiEXT"); - glad_glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)load("glUniform2uiEXT"); - glad_glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)load("glUniform3uiEXT"); - glad_glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)load("glUniform4uiEXT"); - glad_glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)load("glUniform1uivEXT"); - glad_glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)load("glUniform2uivEXT"); - glad_glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)load("glUniform3uivEXT"); - glad_glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)load("glUniform4uivEXT"); -} -static void load_GL_NV_geometry_program4(GLADloadproc load) { - if(!GLAD_GL_NV_geometry_program4) return; - glad_glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)load("glProgramVertexLimitNV"); - glad_glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)load("glFramebufferTextureEXT"); - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); - glad_glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)load("glFramebufferTextureFaceEXT"); -} -static void load_GL_AMD_debug_output(GLADloadproc load) { - if(!GLAD_GL_AMD_debug_output) return; - glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); - glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); - glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); - glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); -} -static void load_GL_ARB_multitexture(GLADloadproc load) { - if(!GLAD_GL_ARB_multitexture) return; - glad_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)load("glActiveTextureARB"); - glad_glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)load("glClientActiveTextureARB"); - glad_glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)load("glMultiTexCoord1dARB"); - glad_glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)load("glMultiTexCoord1dvARB"); - glad_glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)load("glMultiTexCoord1fARB"); - glad_glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)load("glMultiTexCoord1fvARB"); - glad_glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)load("glMultiTexCoord1iARB"); - glad_glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)load("glMultiTexCoord1ivARB"); - glad_glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)load("glMultiTexCoord1sARB"); - glad_glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)load("glMultiTexCoord1svARB"); - glad_glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)load("glMultiTexCoord2dARB"); - glad_glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)load("glMultiTexCoord2dvARB"); - glad_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)load("glMultiTexCoord2fARB"); - glad_glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)load("glMultiTexCoord2fvARB"); - glad_glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)load("glMultiTexCoord2iARB"); - glad_glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)load("glMultiTexCoord2ivARB"); - glad_glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)load("glMultiTexCoord2sARB"); - glad_glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)load("glMultiTexCoord2svARB"); - glad_glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)load("glMultiTexCoord3dARB"); - glad_glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)load("glMultiTexCoord3dvARB"); - glad_glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)load("glMultiTexCoord3fARB"); - glad_glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)load("glMultiTexCoord3fvARB"); - glad_glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)load("glMultiTexCoord3iARB"); - glad_glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)load("glMultiTexCoord3ivARB"); - glad_glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)load("glMultiTexCoord3sARB"); - glad_glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)load("glMultiTexCoord3svARB"); - glad_glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)load("glMultiTexCoord4dARB"); - glad_glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)load("glMultiTexCoord4dvARB"); - glad_glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)load("glMultiTexCoord4fARB"); - glad_glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)load("glMultiTexCoord4fvARB"); - glad_glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)load("glMultiTexCoord4iARB"); - glad_glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)load("glMultiTexCoord4ivARB"); - glad_glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)load("glMultiTexCoord4sARB"); - glad_glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)load("glMultiTexCoord4svARB"); -} -static void load_GL_SGIX_polynomial_ffd(GLADloadproc load) { - if(!GLAD_GL_SGIX_polynomial_ffd) return; - glad_glDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC)load("glDeformationMap3dSGIX"); - glad_glDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC)load("glDeformationMap3fSGIX"); - glad_glDeformSGIX = (PFNGLDEFORMSGIXPROC)load("glDeformSGIX"); - glad_glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)load("glLoadIdentityDeformationMapSGIX"); -} -static void load_GL_EXT_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_provoking_vertex) return; - glad_glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)load("glProvokingVertexEXT"); -} -static void load_GL_ARB_point_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_point_parameters) return; - glad_glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)load("glPointParameterfARB"); - glad_glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)load("glPointParameterfvARB"); -} -static void load_GL_ARB_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_image_load_store) return; - glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); - glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); -} -static void load_GL_ARB_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_barrier) return; - glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); -} -static void load_GL_NV_bindless_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)load("glMultiDrawArraysIndirectBindlessNV"); - glad_glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)load("glMultiDrawElementsIndirectBindlessNV"); -} -static void load_GL_EXT_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_EXT_transform_feedback) return; - glad_glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)load("glBeginTransformFeedbackEXT"); - glad_glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)load("glEndTransformFeedbackEXT"); - glad_glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)load("glBindBufferRangeEXT"); - glad_glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)load("glBindBufferOffsetEXT"); - glad_glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)load("glBindBufferBaseEXT"); - glad_glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)load("glTransformFeedbackVaryingsEXT"); - glad_glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)load("glGetTransformFeedbackVaryingEXT"); -} -static void load_GL_NV_gpu_program4(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program4) return; - glad_glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)load("glProgramLocalParameterI4iNV"); - glad_glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)load("glProgramLocalParameterI4ivNV"); - glad_glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)load("glProgramLocalParametersI4ivNV"); - glad_glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)load("glProgramLocalParameterI4uiNV"); - glad_glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)load("glProgramLocalParameterI4uivNV"); - glad_glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)load("glProgramLocalParametersI4uivNV"); - glad_glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)load("glProgramEnvParameterI4iNV"); - glad_glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)load("glProgramEnvParameterI4ivNV"); - glad_glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)load("glProgramEnvParametersI4ivNV"); - glad_glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)load("glProgramEnvParameterI4uiNV"); - glad_glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)load("glProgramEnvParameterI4uivNV"); - glad_glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)load("glProgramEnvParametersI4uivNV"); - glad_glGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)load("glGetProgramLocalParameterIivNV"); - glad_glGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)load("glGetProgramLocalParameterIuivNV"); - glad_glGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)load("glGetProgramEnvParameterIivNV"); - glad_glGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)load("glGetProgramEnvParameterIuivNV"); -} -static void load_GL_NV_gpu_program5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program5) return; - glad_glProgramSubroutineParametersuivNV = (PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)load("glProgramSubroutineParametersuivNV"); - glad_glGetProgramSubroutineParameteruivNV = (PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)load("glGetProgramSubroutineParameteruivNV"); -} -static void load_GL_ARB_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_ARB_geometry_shader4) return; - glad_glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)load("glProgramParameteriARB"); - glad_glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)load("glFramebufferTextureARB"); - glad_glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)load("glFramebufferTextureLayerARB"); - glad_glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)load("glFramebufferTextureFaceARB"); -} -static void load_GL_NV_conservative_raster(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster) return; - glad_glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)load("glSubpixelPrecisionBiasNV"); -} -static void load_GL_SGIX_sprite(GLADloadproc load) { - if(!GLAD_GL_SGIX_sprite) return; - glad_glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)load("glSpriteParameterfSGIX"); - glad_glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)load("glSpriteParameterfvSGIX"); - glad_glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)load("glSpriteParameteriSGIX"); - glad_glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)load("glSpriteParameterivSGIX"); -} -static void load_GL_ARB_get_program_binary(GLADloadproc load) { - if(!GLAD_GL_ARB_get_program_binary) return; - glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); - glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); - glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); -} -static void load_GL_AMD_occlusion_query_event(GLADloadproc load) { - if(!GLAD_GL_AMD_occlusion_query_event) return; - glad_glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)load("glQueryObjectParameteruiAMD"); -} -static void load_GL_SGIS_multisample(GLADloadproc load) { - if(!GLAD_GL_SGIS_multisample) return; - glad_glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)load("glSampleMaskSGIS"); - glad_glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)load("glSamplePatternSGIS"); -} -static void load_GL_EXT_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_object) return; - glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); - glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); - glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); - glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); - glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); - glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); - glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); - glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); - glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); - glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); - glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); - glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); - glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); - glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); - glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); - glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); - glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); -} -static void load_GL_APPLE_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_range) return; - glad_glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)load("glVertexArrayRangeAPPLE"); - glad_glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)load("glFlushVertexArrayRangeAPPLE"); - glad_glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)load("glVertexArrayParameteriAPPLE"); -} -static void load_GL_NV_register_combiners(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners) return; - glad_glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)load("glCombinerParameterfvNV"); - glad_glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)load("glCombinerParameterfNV"); - glad_glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)load("glCombinerParameterivNV"); - glad_glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)load("glCombinerParameteriNV"); - glad_glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)load("glCombinerInputNV"); - glad_glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)load("glCombinerOutputNV"); - glad_glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)load("glFinalCombinerInputNV"); - glad_glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)load("glGetCombinerInputParameterfvNV"); - glad_glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)load("glGetCombinerInputParameterivNV"); - glad_glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)load("glGetCombinerOutputParameterfvNV"); - glad_glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)load("glGetCombinerOutputParameterivNV"); - glad_glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)load("glGetFinalCombinerInputParameterfvNV"); - glad_glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)load("glGetFinalCombinerInputParameterivNV"); -} -static void load_GL_ARB_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers) return; - glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); -} -static void load_GL_ARB_clear_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_texture) return; - glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); - glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); -} -static void load_GL_ARB_debug_output(GLADloadproc load) { - if(!GLAD_GL_ARB_debug_output) return; - glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); - glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); - glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); - glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); -} -static void load_GL_EXT_cull_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_cull_vertex) return; - glad_glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)load("glCullParameterdvEXT"); - glad_glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)load("glCullParameterfvEXT"); -} -static void load_GL_IBM_multimode_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_IBM_multimode_draw_arrays) return; - glad_glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)load("glMultiModeDrawArraysIBM"); - glad_glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)load("glMultiModeDrawElementsIBM"); -} -static void load_GL_APPLE_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_object) return; - glad_glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)load("glBindVertexArrayAPPLE"); - glad_glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)load("glDeleteVertexArraysAPPLE"); - glad_glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)load("glGenVertexArraysAPPLE"); - glad_glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)load("glIsVertexArrayAPPLE"); -} -static void load_GL_SGIS_detail_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_detail_texture) return; - glad_glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)load("glDetailTexFuncSGIS"); - glad_glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)load("glGetDetailTexFuncSGIS"); -} -static void load_GL_ARB_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_instanced) return; - glad_glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)load("glDrawArraysInstancedARB"); - glad_glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)load("glDrawElementsInstancedARB"); -} -static void load_GL_ARB_shading_language_include(GLADloadproc load) { - if(!GLAD_GL_ARB_shading_language_include) return; - glad_glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)load("glNamedStringARB"); - glad_glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)load("glDeleteNamedStringARB"); - glad_glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)load("glCompileShaderIncludeARB"); - glad_glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)load("glIsNamedStringARB"); - glad_glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)load("glGetNamedStringARB"); - glad_glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)load("glGetNamedStringivARB"); -} -static void load_GL_INGR_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_INGR_blend_func_separate) return; - glad_glBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC)load("glBlendFuncSeparateINGR"); -} -static void load_GL_NV_path_rendering(GLADloadproc load) { - if(!GLAD_GL_NV_path_rendering) return; - glad_glGenPathsNV = (PFNGLGENPATHSNVPROC)load("glGenPathsNV"); - glad_glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)load("glDeletePathsNV"); - glad_glIsPathNV = (PFNGLISPATHNVPROC)load("glIsPathNV"); - glad_glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)load("glPathCommandsNV"); - glad_glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)load("glPathCoordsNV"); - glad_glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)load("glPathSubCommandsNV"); - glad_glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)load("glPathSubCoordsNV"); - glad_glPathStringNV = (PFNGLPATHSTRINGNVPROC)load("glPathStringNV"); - glad_glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)load("glPathGlyphsNV"); - glad_glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)load("glPathGlyphRangeNV"); - glad_glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)load("glWeightPathsNV"); - glad_glCopyPathNV = (PFNGLCOPYPATHNVPROC)load("glCopyPathNV"); - glad_glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)load("glInterpolatePathsNV"); - glad_glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)load("glTransformPathNV"); - glad_glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)load("glPathParameterivNV"); - glad_glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)load("glPathParameteriNV"); - glad_glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)load("glPathParameterfvNV"); - glad_glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)load("glPathParameterfNV"); - glad_glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)load("glPathDashArrayNV"); - glad_glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)load("glPathStencilFuncNV"); - glad_glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)load("glPathStencilDepthOffsetNV"); - glad_glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)load("glStencilFillPathNV"); - glad_glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)load("glStencilStrokePathNV"); - glad_glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)load("glStencilFillPathInstancedNV"); - glad_glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)load("glStencilStrokePathInstancedNV"); - glad_glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)load("glPathCoverDepthFuncNV"); - glad_glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)load("glCoverFillPathNV"); - glad_glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)load("glCoverStrokePathNV"); - glad_glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)load("glCoverFillPathInstancedNV"); - glad_glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)load("glCoverStrokePathInstancedNV"); - glad_glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)load("glGetPathParameterivNV"); - glad_glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)load("glGetPathParameterfvNV"); - glad_glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)load("glGetPathCommandsNV"); - glad_glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)load("glGetPathCoordsNV"); - glad_glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)load("glGetPathDashArrayNV"); - glad_glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)load("glGetPathMetricsNV"); - glad_glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)load("glGetPathMetricRangeNV"); - glad_glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)load("glGetPathSpacingNV"); - glad_glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)load("glIsPointInFillPathNV"); - glad_glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)load("glIsPointInStrokePathNV"); - glad_glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)load("glGetPathLengthNV"); - glad_glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)load("glPointAlongPathNV"); - glad_glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)load("glMatrixLoad3x2fNV"); - glad_glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)load("glMatrixLoad3x3fNV"); - glad_glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)load("glMatrixLoadTranspose3x3fNV"); - glad_glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)load("glMatrixMult3x2fNV"); - glad_glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)load("glMatrixMult3x3fNV"); - glad_glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)load("glMatrixMultTranspose3x3fNV"); - glad_glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)load("glStencilThenCoverFillPathNV"); - glad_glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)load("glStencilThenCoverStrokePathNV"); - glad_glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)load("glStencilThenCoverFillPathInstancedNV"); - glad_glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)load("glStencilThenCoverStrokePathInstancedNV"); - glad_glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)load("glPathGlyphIndexRangeNV"); - glad_glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)load("glPathGlyphIndexArrayNV"); - glad_glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)load("glPathMemoryGlyphIndexArrayNV"); - glad_glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)load("glProgramPathFragmentInputGenNV"); - glad_glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)load("glGetProgramResourcefvNV"); - glad_glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)load("glPathColorGenNV"); - glad_glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)load("glPathTexGenNV"); - glad_glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)load("glPathFogGenNV"); - glad_glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)load("glGetPathColorGenivNV"); - glad_glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)load("glGetPathColorGenfvNV"); - glad_glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)load("glGetPathTexGenivNV"); - glad_glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)load("glGetPathTexGenfvNV"); -} -static void load_GL_NV_conservative_raster_dilate(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster_dilate) return; - glad_glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)load("glConservativeRasterParameterfNV"); -} -static void load_GL_ATI_vertex_streams(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_streams) return; - glad_glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)load("glVertexStream1sATI"); - glad_glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)load("glVertexStream1svATI"); - glad_glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)load("glVertexStream1iATI"); - glad_glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)load("glVertexStream1ivATI"); - glad_glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)load("glVertexStream1fATI"); - glad_glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)load("glVertexStream1fvATI"); - glad_glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)load("glVertexStream1dATI"); - glad_glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)load("glVertexStream1dvATI"); - glad_glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)load("glVertexStream2sATI"); - glad_glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)load("glVertexStream2svATI"); - glad_glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)load("glVertexStream2iATI"); - glad_glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)load("glVertexStream2ivATI"); - glad_glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)load("glVertexStream2fATI"); - glad_glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)load("glVertexStream2fvATI"); - glad_glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)load("glVertexStream2dATI"); - glad_glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)load("glVertexStream2dvATI"); - glad_glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)load("glVertexStream3sATI"); - glad_glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)load("glVertexStream3svATI"); - glad_glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)load("glVertexStream3iATI"); - glad_glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)load("glVertexStream3ivATI"); - glad_glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)load("glVertexStream3fATI"); - glad_glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)load("glVertexStream3fvATI"); - glad_glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)load("glVertexStream3dATI"); - glad_glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)load("glVertexStream3dvATI"); - glad_glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)load("glVertexStream4sATI"); - glad_glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)load("glVertexStream4svATI"); - glad_glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)load("glVertexStream4iATI"); - glad_glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)load("glVertexStream4ivATI"); - glad_glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)load("glVertexStream4fATI"); - glad_glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)load("glVertexStream4fvATI"); - glad_glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)load("glVertexStream4dATI"); - glad_glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)load("glVertexStream4dvATI"); - glad_glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)load("glNormalStream3bATI"); - glad_glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)load("glNormalStream3bvATI"); - glad_glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)load("glNormalStream3sATI"); - glad_glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)load("glNormalStream3svATI"); - glad_glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)load("glNormalStream3iATI"); - glad_glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)load("glNormalStream3ivATI"); - glad_glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)load("glNormalStream3fATI"); - glad_glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)load("glNormalStream3fvATI"); - glad_glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)load("glNormalStream3dATI"); - glad_glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)load("glNormalStream3dvATI"); - glad_glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)load("glClientActiveVertexStreamATI"); - glad_glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)load("glVertexBlendEnviATI"); - glad_glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)load("glVertexBlendEnvfATI"); -} -static void load_GL_ARB_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_int64) return; - glad_glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)load("glUniform1i64ARB"); - glad_glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)load("glUniform2i64ARB"); - glad_glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)load("glUniform3i64ARB"); - glad_glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)load("glUniform4i64ARB"); - glad_glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)load("glUniform1i64vARB"); - glad_glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)load("glUniform2i64vARB"); - glad_glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)load("glUniform3i64vARB"); - glad_glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)load("glUniform4i64vARB"); - glad_glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)load("glUniform1ui64ARB"); - glad_glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)load("glUniform2ui64ARB"); - glad_glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)load("glUniform3ui64ARB"); - glad_glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)load("glUniform4ui64ARB"); - glad_glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)load("glUniform1ui64vARB"); - glad_glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)load("glUniform2ui64vARB"); - glad_glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)load("glUniform3ui64vARB"); - glad_glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)load("glUniform4ui64vARB"); - glad_glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)load("glGetUniformi64vARB"); - glad_glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)load("glGetUniformui64vARB"); - glad_glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)load("glGetnUniformi64vARB"); - glad_glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)load("glGetnUniformui64vARB"); - glad_glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)load("glProgramUniform1i64ARB"); - glad_glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)load("glProgramUniform2i64ARB"); - glad_glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)load("glProgramUniform3i64ARB"); - glad_glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)load("glProgramUniform4i64ARB"); - glad_glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)load("glProgramUniform1i64vARB"); - glad_glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)load("glProgramUniform2i64vARB"); - glad_glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)load("glProgramUniform3i64vARB"); - glad_glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)load("glProgramUniform4i64vARB"); - glad_glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)load("glProgramUniform1ui64ARB"); - glad_glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)load("glProgramUniform2ui64ARB"); - glad_glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)load("glProgramUniform3ui64ARB"); - glad_glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)load("glProgramUniform4ui64ARB"); - glad_glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)load("glProgramUniform1ui64vARB"); - glad_glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)load("glProgramUniform2ui64vARB"); - glad_glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)load("glProgramUniform3ui64vARB"); - glad_glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)load("glProgramUniform4ui64vARB"); -} -static void load_GL_NV_vdpau_interop(GLADloadproc load) { - if(!GLAD_GL_NV_vdpau_interop) return; - glad_glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)load("glVDPAUInitNV"); - glad_glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)load("glVDPAUFiniNV"); - glad_glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)load("glVDPAURegisterVideoSurfaceNV"); - glad_glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)load("glVDPAURegisterOutputSurfaceNV"); - glad_glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)load("glVDPAUIsSurfaceNV"); - glad_glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)load("glVDPAUUnregisterSurfaceNV"); - glad_glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)load("glVDPAUGetSurfaceivNV"); - glad_glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)load("glVDPAUSurfaceAccessNV"); - glad_glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)load("glVDPAUMapSurfacesNV"); - glad_glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)load("glVDPAUUnmapSurfacesNV"); -} -static void load_GL_ARB_internalformat_query2(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query2) return; - glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); -} -static void load_GL_SUN_vertex(GLADloadproc load) { - if(!GLAD_GL_SUN_vertex) return; - glad_glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)load("glColor4ubVertex2fSUN"); - glad_glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)load("glColor4ubVertex2fvSUN"); - glad_glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)load("glColor4ubVertex3fSUN"); - glad_glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)load("glColor4ubVertex3fvSUN"); - glad_glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)load("glColor3fVertex3fSUN"); - glad_glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)load("glColor3fVertex3fvSUN"); - glad_glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)load("glNormal3fVertex3fSUN"); - glad_glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)load("glNormal3fVertex3fvSUN"); - glad_glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glColor4fNormal3fVertex3fSUN"); - glad_glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)load("glTexCoord2fVertex3fSUN"); - glad_glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)load("glTexCoord2fVertex3fvSUN"); - glad_glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)load("glTexCoord4fVertex4fSUN"); - glad_glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)load("glTexCoord4fVertex4fvSUN"); - glad_glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)load("glTexCoord2fColor4ubVertex3fSUN"); - glad_glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)load("glTexCoord2fColor4ubVertex3fvSUN"); - glad_glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)load("glTexCoord2fColor3fVertex3fSUN"); - glad_glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)load("glTexCoord2fColor3fVertex3fvSUN"); - glad_glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fNormal3fVertex3fSUN"); - glad_glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fNormal3fVertex3fvSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fvSUN"); - glad_glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)load("glReplacementCodeuiVertex3fSUN"); - glad_glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)load("glReplacementCodeuiVertex3fvSUN"); - glad_glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)load("glReplacementCodeuiColor4ubVertex3fSUN"); - glad_glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4ubVertex3fvSUN"); - glad_glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor3fVertex3fSUN"); - glad_glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor3fVertex3fvSUN"); - glad_glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiNormal3fVertex3fSUN"); - glad_glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"); -} -static void load_GL_SGIX_igloo_interface(GLADloadproc load) { - if(!GLAD_GL_SGIX_igloo_interface) return; - glad_glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)load("glIglooInterfaceSGIX"); -} -static void load_GL_ARB_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_indirect) return; - glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); - glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); -} -static void load_GL_NV_vertex_program4(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program4) return; - glad_glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)load("glVertexAttribI1iEXT"); - glad_glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)load("glVertexAttribI2iEXT"); - glad_glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)load("glVertexAttribI3iEXT"); - glad_glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)load("glVertexAttribI4iEXT"); - glad_glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)load("glVertexAttribI1uiEXT"); - glad_glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)load("glVertexAttribI2uiEXT"); - glad_glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)load("glVertexAttribI3uiEXT"); - glad_glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)load("glVertexAttribI4uiEXT"); - glad_glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)load("glVertexAttribI1ivEXT"); - glad_glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)load("glVertexAttribI2ivEXT"); - glad_glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)load("glVertexAttribI3ivEXT"); - glad_glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)load("glVertexAttribI4ivEXT"); - glad_glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)load("glVertexAttribI1uivEXT"); - glad_glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)load("glVertexAttribI2uivEXT"); - glad_glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)load("glVertexAttribI3uivEXT"); - glad_glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)load("glVertexAttribI4uivEXT"); - glad_glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)load("glVertexAttribI4bvEXT"); - glad_glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)load("glVertexAttribI4svEXT"); - glad_glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)load("glVertexAttribI4ubvEXT"); - glad_glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)load("glVertexAttribI4usvEXT"); - glad_glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)load("glVertexAttribIPointerEXT"); - glad_glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)load("glGetVertexAttribIivEXT"); - glad_glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)load("glGetVertexAttribIuivEXT"); -} -static void load_GL_SGIS_fog_function(GLADloadproc load) { - if(!GLAD_GL_SGIS_fog_function) return; - glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); - glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); -} -static void load_GL_EXT_x11_sync_object(GLADloadproc load) { - if(!GLAD_GL_EXT_x11_sync_object) return; - glad_glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)load("glImportSyncEXT"); -} -static void load_GL_ARB_sync(GLADloadproc load) { - if(!GLAD_GL_ARB_sync) return; - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); -} -static void load_GL_NV_sample_locations(GLADloadproc load) { - if(!GLAD_GL_NV_sample_locations) return; - glad_glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glFramebufferSampleLocationsfvNV"); - glad_glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glNamedFramebufferSampleLocationsfvNV"); - glad_glResolveDepthValuesNV = (PFNGLRESOLVEDEPTHVALUESNVPROC)load("glResolveDepthValuesNV"); -} -static void load_GL_ARB_compute_variable_group_size(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_variable_group_size) return; - glad_glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)load("glDispatchComputeGroupSizeARB"); -} -static void load_GL_OES_fixed_point(GLADloadproc load) { - if(!GLAD_GL_OES_fixed_point) return; - glad_glAlphaFuncxOES = (PFNGLALPHAFUNCXOESPROC)load("glAlphaFuncxOES"); - glad_glClearColorxOES = (PFNGLCLEARCOLORXOESPROC)load("glClearColorxOES"); - glad_glClearDepthxOES = (PFNGLCLEARDEPTHXOESPROC)load("glClearDepthxOES"); - glad_glClipPlanexOES = (PFNGLCLIPPLANEXOESPROC)load("glClipPlanexOES"); - glad_glColor4xOES = (PFNGLCOLOR4XOESPROC)load("glColor4xOES"); - glad_glDepthRangexOES = (PFNGLDEPTHRANGEXOESPROC)load("glDepthRangexOES"); - glad_glFogxOES = (PFNGLFOGXOESPROC)load("glFogxOES"); - glad_glFogxvOES = (PFNGLFOGXVOESPROC)load("glFogxvOES"); - glad_glFrustumxOES = (PFNGLFRUSTUMXOESPROC)load("glFrustumxOES"); - glad_glGetClipPlanexOES = (PFNGLGETCLIPPLANEXOESPROC)load("glGetClipPlanexOES"); - glad_glGetFixedvOES = (PFNGLGETFIXEDVOESPROC)load("glGetFixedvOES"); - glad_glGetTexEnvxvOES = (PFNGLGETTEXENVXVOESPROC)load("glGetTexEnvxvOES"); - glad_glGetTexParameterxvOES = (PFNGLGETTEXPARAMETERXVOESPROC)load("glGetTexParameterxvOES"); - glad_glLightModelxOES = (PFNGLLIGHTMODELXOESPROC)load("glLightModelxOES"); - glad_glLightModelxvOES = (PFNGLLIGHTMODELXVOESPROC)load("glLightModelxvOES"); - glad_glLightxOES = (PFNGLLIGHTXOESPROC)load("glLightxOES"); - glad_glLightxvOES = (PFNGLLIGHTXVOESPROC)load("glLightxvOES"); - glad_glLineWidthxOES = (PFNGLLINEWIDTHXOESPROC)load("glLineWidthxOES"); - glad_glLoadMatrixxOES = (PFNGLLOADMATRIXXOESPROC)load("glLoadMatrixxOES"); - glad_glMaterialxOES = (PFNGLMATERIALXOESPROC)load("glMaterialxOES"); - glad_glMaterialxvOES = (PFNGLMATERIALXVOESPROC)load("glMaterialxvOES"); - glad_glMultMatrixxOES = (PFNGLMULTMATRIXXOESPROC)load("glMultMatrixxOES"); - glad_glMultiTexCoord4xOES = (PFNGLMULTITEXCOORD4XOESPROC)load("glMultiTexCoord4xOES"); - glad_glNormal3xOES = (PFNGLNORMAL3XOESPROC)load("glNormal3xOES"); - glad_glOrthoxOES = (PFNGLORTHOXOESPROC)load("glOrthoxOES"); - glad_glPointParameterxvOES = (PFNGLPOINTPARAMETERXVOESPROC)load("glPointParameterxvOES"); - glad_glPointSizexOES = (PFNGLPOINTSIZEXOESPROC)load("glPointSizexOES"); - glad_glPolygonOffsetxOES = (PFNGLPOLYGONOFFSETXOESPROC)load("glPolygonOffsetxOES"); - glad_glRotatexOES = (PFNGLROTATEXOESPROC)load("glRotatexOES"); - glad_glScalexOES = (PFNGLSCALEXOESPROC)load("glScalexOES"); - glad_glTexEnvxOES = (PFNGLTEXENVXOESPROC)load("glTexEnvxOES"); - glad_glTexEnvxvOES = (PFNGLTEXENVXVOESPROC)load("glTexEnvxvOES"); - glad_glTexParameterxOES = (PFNGLTEXPARAMETERXOESPROC)load("glTexParameterxOES"); - glad_glTexParameterxvOES = (PFNGLTEXPARAMETERXVOESPROC)load("glTexParameterxvOES"); - glad_glTranslatexOES = (PFNGLTRANSLATEXOESPROC)load("glTranslatexOES"); - glad_glGetLightxvOES = (PFNGLGETLIGHTXVOESPROC)load("glGetLightxvOES"); - glad_glGetMaterialxvOES = (PFNGLGETMATERIALXVOESPROC)load("glGetMaterialxvOES"); - glad_glPointParameterxOES = (PFNGLPOINTPARAMETERXOESPROC)load("glPointParameterxOES"); - glad_glSampleCoveragexOES = (PFNGLSAMPLECOVERAGEXOESPROC)load("glSampleCoveragexOES"); - glad_glAccumxOES = (PFNGLACCUMXOESPROC)load("glAccumxOES"); - glad_glBitmapxOES = (PFNGLBITMAPXOESPROC)load("glBitmapxOES"); - glad_glBlendColorxOES = (PFNGLBLENDCOLORXOESPROC)load("glBlendColorxOES"); - glad_glClearAccumxOES = (PFNGLCLEARACCUMXOESPROC)load("glClearAccumxOES"); - glad_glColor3xOES = (PFNGLCOLOR3XOESPROC)load("glColor3xOES"); - glad_glColor3xvOES = (PFNGLCOLOR3XVOESPROC)load("glColor3xvOES"); - glad_glColor4xvOES = (PFNGLCOLOR4XVOESPROC)load("glColor4xvOES"); - glad_glConvolutionParameterxOES = (PFNGLCONVOLUTIONPARAMETERXOESPROC)load("glConvolutionParameterxOES"); - glad_glConvolutionParameterxvOES = (PFNGLCONVOLUTIONPARAMETERXVOESPROC)load("glConvolutionParameterxvOES"); - glad_glEvalCoord1xOES = (PFNGLEVALCOORD1XOESPROC)load("glEvalCoord1xOES"); - glad_glEvalCoord1xvOES = (PFNGLEVALCOORD1XVOESPROC)load("glEvalCoord1xvOES"); - glad_glEvalCoord2xOES = (PFNGLEVALCOORD2XOESPROC)load("glEvalCoord2xOES"); - glad_glEvalCoord2xvOES = (PFNGLEVALCOORD2XVOESPROC)load("glEvalCoord2xvOES"); - glad_glFeedbackBufferxOES = (PFNGLFEEDBACKBUFFERXOESPROC)load("glFeedbackBufferxOES"); - glad_glGetConvolutionParameterxvOES = (PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)load("glGetConvolutionParameterxvOES"); - glad_glGetHistogramParameterxvOES = (PFNGLGETHISTOGRAMPARAMETERXVOESPROC)load("glGetHistogramParameterxvOES"); - glad_glGetLightxOES = (PFNGLGETLIGHTXOESPROC)load("glGetLightxOES"); - glad_glGetMapxvOES = (PFNGLGETMAPXVOESPROC)load("glGetMapxvOES"); - glad_glGetMaterialxOES = (PFNGLGETMATERIALXOESPROC)load("glGetMaterialxOES"); - glad_glGetPixelMapxv = (PFNGLGETPIXELMAPXVPROC)load("glGetPixelMapxv"); - glad_glGetTexGenxvOES = (PFNGLGETTEXGENXVOESPROC)load("glGetTexGenxvOES"); - glad_glGetTexLevelParameterxvOES = (PFNGLGETTEXLEVELPARAMETERXVOESPROC)load("glGetTexLevelParameterxvOES"); - glad_glIndexxOES = (PFNGLINDEXXOESPROC)load("glIndexxOES"); - glad_glIndexxvOES = (PFNGLINDEXXVOESPROC)load("glIndexxvOES"); - glad_glLoadTransposeMatrixxOES = (PFNGLLOADTRANSPOSEMATRIXXOESPROC)load("glLoadTransposeMatrixxOES"); - glad_glMap1xOES = (PFNGLMAP1XOESPROC)load("glMap1xOES"); - glad_glMap2xOES = (PFNGLMAP2XOESPROC)load("glMap2xOES"); - glad_glMapGrid1xOES = (PFNGLMAPGRID1XOESPROC)load("glMapGrid1xOES"); - glad_glMapGrid2xOES = (PFNGLMAPGRID2XOESPROC)load("glMapGrid2xOES"); - glad_glMultTransposeMatrixxOES = (PFNGLMULTTRANSPOSEMATRIXXOESPROC)load("glMultTransposeMatrixxOES"); - glad_glMultiTexCoord1xOES = (PFNGLMULTITEXCOORD1XOESPROC)load("glMultiTexCoord1xOES"); - glad_glMultiTexCoord1xvOES = (PFNGLMULTITEXCOORD1XVOESPROC)load("glMultiTexCoord1xvOES"); - glad_glMultiTexCoord2xOES = (PFNGLMULTITEXCOORD2XOESPROC)load("glMultiTexCoord2xOES"); - glad_glMultiTexCoord2xvOES = (PFNGLMULTITEXCOORD2XVOESPROC)load("glMultiTexCoord2xvOES"); - glad_glMultiTexCoord3xOES = (PFNGLMULTITEXCOORD3XOESPROC)load("glMultiTexCoord3xOES"); - glad_glMultiTexCoord3xvOES = (PFNGLMULTITEXCOORD3XVOESPROC)load("glMultiTexCoord3xvOES"); - glad_glMultiTexCoord4xvOES = (PFNGLMULTITEXCOORD4XVOESPROC)load("glMultiTexCoord4xvOES"); - glad_glNormal3xvOES = (PFNGLNORMAL3XVOESPROC)load("glNormal3xvOES"); - glad_glPassThroughxOES = (PFNGLPASSTHROUGHXOESPROC)load("glPassThroughxOES"); - glad_glPixelMapx = (PFNGLPIXELMAPXPROC)load("glPixelMapx"); - glad_glPixelStorex = (PFNGLPIXELSTOREXPROC)load("glPixelStorex"); - glad_glPixelTransferxOES = (PFNGLPIXELTRANSFERXOESPROC)load("glPixelTransferxOES"); - glad_glPixelZoomxOES = (PFNGLPIXELZOOMXOESPROC)load("glPixelZoomxOES"); - glad_glPrioritizeTexturesxOES = (PFNGLPRIORITIZETEXTURESXOESPROC)load("glPrioritizeTexturesxOES"); - glad_glRasterPos2xOES = (PFNGLRASTERPOS2XOESPROC)load("glRasterPos2xOES"); - glad_glRasterPos2xvOES = (PFNGLRASTERPOS2XVOESPROC)load("glRasterPos2xvOES"); - glad_glRasterPos3xOES = (PFNGLRASTERPOS3XOESPROC)load("glRasterPos3xOES"); - glad_glRasterPos3xvOES = (PFNGLRASTERPOS3XVOESPROC)load("glRasterPos3xvOES"); - glad_glRasterPos4xOES = (PFNGLRASTERPOS4XOESPROC)load("glRasterPos4xOES"); - glad_glRasterPos4xvOES = (PFNGLRASTERPOS4XVOESPROC)load("glRasterPos4xvOES"); - glad_glRectxOES = (PFNGLRECTXOESPROC)load("glRectxOES"); - glad_glRectxvOES = (PFNGLRECTXVOESPROC)load("glRectxvOES"); - glad_glTexCoord1xOES = (PFNGLTEXCOORD1XOESPROC)load("glTexCoord1xOES"); - glad_glTexCoord1xvOES = (PFNGLTEXCOORD1XVOESPROC)load("glTexCoord1xvOES"); - glad_glTexCoord2xOES = (PFNGLTEXCOORD2XOESPROC)load("glTexCoord2xOES"); - glad_glTexCoord2xvOES = (PFNGLTEXCOORD2XVOESPROC)load("glTexCoord2xvOES"); - glad_glTexCoord3xOES = (PFNGLTEXCOORD3XOESPROC)load("glTexCoord3xOES"); - glad_glTexCoord3xvOES = (PFNGLTEXCOORD3XVOESPROC)load("glTexCoord3xvOES"); - glad_glTexCoord4xOES = (PFNGLTEXCOORD4XOESPROC)load("glTexCoord4xOES"); - glad_glTexCoord4xvOES = (PFNGLTEXCOORD4XVOESPROC)load("glTexCoord4xvOES"); - glad_glTexGenxOES = (PFNGLTEXGENXOESPROC)load("glTexGenxOES"); - glad_glTexGenxvOES = (PFNGLTEXGENXVOESPROC)load("glTexGenxvOES"); - glad_glVertex2xOES = (PFNGLVERTEX2XOESPROC)load("glVertex2xOES"); - glad_glVertex2xvOES = (PFNGLVERTEX2XVOESPROC)load("glVertex2xvOES"); - glad_glVertex3xOES = (PFNGLVERTEX3XOESPROC)load("glVertex3xOES"); - glad_glVertex3xvOES = (PFNGLVERTEX3XVOESPROC)load("glVertex3xvOES"); - glad_glVertex4xOES = (PFNGLVERTEX4XOESPROC)load("glVertex4xOES"); - glad_glVertex4xvOES = (PFNGLVERTEX4XVOESPROC)load("glVertex4xvOES"); -} -static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_multisample) return; - glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); -} -static void load_GL_SGIS_texture4D(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture4D) return; - glad_glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)load("glTexImage4DSGIS"); - glad_glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)load("glTexSubImage4DSGIS"); -} -static void load_GL_EXT_texture3D(GLADloadproc load) { - if(!GLAD_GL_EXT_texture3D) return; - glad_glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)load("glTexImage3DEXT"); - glad_glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)load("glTexSubImage3DEXT"); -} -static void load_GL_EXT_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_multisample) return; - glad_glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)load("glSampleMaskEXT"); - glad_glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)load("glSamplePatternEXT"); -} -static void load_GL_EXT_secondary_color(GLADloadproc load) { - if(!GLAD_GL_EXT_secondary_color) return; - glad_glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)load("glSecondaryColor3bEXT"); - glad_glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)load("glSecondaryColor3bvEXT"); - glad_glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)load("glSecondaryColor3dEXT"); - glad_glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)load("glSecondaryColor3dvEXT"); - glad_glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)load("glSecondaryColor3fEXT"); - glad_glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)load("glSecondaryColor3fvEXT"); - glad_glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)load("glSecondaryColor3iEXT"); - glad_glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)load("glSecondaryColor3ivEXT"); - glad_glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)load("glSecondaryColor3sEXT"); - glad_glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)load("glSecondaryColor3svEXT"); - glad_glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)load("glSecondaryColor3ubEXT"); - glad_glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)load("glSecondaryColor3ubvEXT"); - glad_glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)load("glSecondaryColor3uiEXT"); - glad_glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)load("glSecondaryColor3uivEXT"); - glad_glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)load("glSecondaryColor3usEXT"); - glad_glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)load("glSecondaryColor3usvEXT"); - glad_glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)load("glSecondaryColorPointerEXT"); -} -static void load_GL_ATI_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_array_object) return; - glad_glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)load("glNewObjectBufferATI"); - glad_glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)load("glIsObjectBufferATI"); - glad_glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)load("glUpdateObjectBufferATI"); - glad_glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)load("glGetObjectBufferfvATI"); - glad_glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)load("glGetObjectBufferivATI"); - glad_glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)load("glFreeObjectBufferATI"); - glad_glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)load("glArrayObjectATI"); - glad_glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)load("glGetArrayObjectfvATI"); - glad_glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)load("glGetArrayObjectivATI"); - glad_glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)load("glVariantArrayObjectATI"); - glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); - glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); -} -static void load_GL_ARB_parallel_shader_compile(GLADloadproc load) { - if(!GLAD_GL_ARB_parallel_shader_compile) return; - glad_glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)load("glMaxShaderCompilerThreadsARB"); -} -static void load_GL_ARB_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_texture) return; - glad_glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)load("glTexPageCommitmentARB"); -} -static void load_GL_ARB_sample_locations(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_locations) return; - glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); - glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); - glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); -} -static void load_GL_ARB_sparse_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_buffer) return; - glad_glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)load("glBufferPageCommitmentARB"); - glad_glNamedBufferPageCommitmentEXT = (PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)load("glNamedBufferPageCommitmentEXT"); - glad_glNamedBufferPageCommitmentARB = (PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)load("glNamedBufferPageCommitmentARB"); -} -static void load_GL_EXT_draw_range_elements(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_range_elements) return; - glad_glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)load("glDrawRangeElementsEXT"); -} -static int find_extensionsGL(void) { - if (!get_exts()) return 0; - GLAD_GL_SGIX_pixel_tiles = has_ext("GL_SGIX_pixel_tiles"); - GLAD_GL_EXT_post_depth_coverage = has_ext("GL_EXT_post_depth_coverage"); - GLAD_GL_APPLE_element_array = has_ext("GL_APPLE_element_array"); - GLAD_GL_AMD_multi_draw_indirect = has_ext("GL_AMD_multi_draw_indirect"); - GLAD_GL_EXT_blend_subtract = has_ext("GL_EXT_blend_subtract"); - GLAD_GL_SGIX_tag_sample_buffer = has_ext("GL_SGIX_tag_sample_buffer"); - GLAD_GL_NV_point_sprite = has_ext("GL_NV_point_sprite"); - GLAD_GL_IBM_texture_mirrored_repeat = has_ext("GL_IBM_texture_mirrored_repeat"); - GLAD_GL_APPLE_transform_hint = has_ext("GL_APPLE_transform_hint"); - GLAD_GL_ATI_separate_stencil = has_ext("GL_ATI_separate_stencil"); - GLAD_GL_NV_shader_atomic_int64 = has_ext("GL_NV_shader_atomic_int64"); - GLAD_GL_NV_vertex_program2_option = has_ext("GL_NV_vertex_program2_option"); - GLAD_GL_EXT_texture_buffer_object = has_ext("GL_EXT_texture_buffer_object"); - GLAD_GL_ARB_vertex_blend = has_ext("GL_ARB_vertex_blend"); - GLAD_GL_OVR_multiview = has_ext("GL_OVR_multiview"); - GLAD_GL_NV_vertex_program2 = has_ext("GL_NV_vertex_program2"); - GLAD_GL_ARB_program_interface_query = has_ext("GL_ARB_program_interface_query"); - GLAD_GL_EXT_misc_attribute = has_ext("GL_EXT_misc_attribute"); - GLAD_GL_NV_multisample_coverage = has_ext("GL_NV_multisample_coverage"); - GLAD_GL_ARB_shading_language_packing = has_ext("GL_ARB_shading_language_packing"); - GLAD_GL_EXT_texture_cube_map = has_ext("GL_EXT_texture_cube_map"); - GLAD_GL_NV_viewport_array2 = has_ext("GL_NV_viewport_array2"); - GLAD_GL_ARB_texture_stencil8 = has_ext("GL_ARB_texture_stencil8"); - GLAD_GL_EXT_index_func = has_ext("GL_EXT_index_func"); - GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); - GLAD_GL_NV_depth_clamp = has_ext("GL_NV_depth_clamp"); - GLAD_GL_NV_shader_buffer_load = has_ext("GL_NV_shader_buffer_load"); - GLAD_GL_EXT_color_subtable = has_ext("GL_EXT_color_subtable"); - GLAD_GL_SUNX_constant_data = has_ext("GL_SUNX_constant_data"); - GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); - GLAD_GL_EXT_multi_draw_arrays = has_ext("GL_EXT_multi_draw_arrays"); - GLAD_GL_ARB_shader_atomic_counters = has_ext("GL_ARB_shader_atomic_counters"); - GLAD_GL_ARB_arrays_of_arrays = has_ext("GL_ARB_arrays_of_arrays"); - GLAD_GL_NV_conditional_render = has_ext("GL_NV_conditional_render"); - GLAD_GL_EXT_texture_env_combine = has_ext("GL_EXT_texture_env_combine"); - GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); - GLAD_GL_SGIX_async_histogram = has_ext("GL_SGIX_async_histogram"); - GLAD_GL_MESA_resize_buffers = has_ext("GL_MESA_resize_buffers"); - GLAD_GL_NV_light_max_exponent = has_ext("GL_NV_light_max_exponent"); - GLAD_GL_NV_texture_env_combine4 = has_ext("GL_NV_texture_env_combine4"); - GLAD_GL_ARB_texture_view = has_ext("GL_ARB_texture_view"); - GLAD_GL_ARB_texture_env_combine = has_ext("GL_ARB_texture_env_combine"); - GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); - GLAD_GL_EXT_convolution = has_ext("GL_EXT_convolution"); - GLAD_GL_NV_compute_program5 = has_ext("GL_NV_compute_program5"); - GLAD_GL_NV_vertex_attrib_integer_64bit = has_ext("GL_NV_vertex_attrib_integer_64bit"); - GLAD_GL_EXT_paletted_texture = has_ext("GL_EXT_paletted_texture"); - GLAD_GL_ARB_texture_buffer_object = has_ext("GL_ARB_texture_buffer_object"); - GLAD_GL_ATI_pn_triangles = has_ext("GL_ATI_pn_triangles"); - GLAD_GL_SGIX_resample = has_ext("GL_SGIX_resample"); - GLAD_GL_SGIX_flush_raster = has_ext("GL_SGIX_flush_raster"); - GLAD_GL_EXT_light_texture = has_ext("GL_EXT_light_texture"); - GLAD_GL_ARB_point_sprite = has_ext("GL_ARB_point_sprite"); - GLAD_GL_SUN_convolution_border_modes = has_ext("GL_SUN_convolution_border_modes"); - GLAD_GL_NV_parameter_buffer_object2 = has_ext("GL_NV_parameter_buffer_object2"); - GLAD_GL_ARB_half_float_pixel = has_ext("GL_ARB_half_float_pixel"); - GLAD_GL_NV_tessellation_program5 = has_ext("GL_NV_tessellation_program5"); - GLAD_GL_REND_screen_coordinates = has_ext("GL_REND_screen_coordinates"); - GLAD_GL_HP_image_transform = has_ext("GL_HP_image_transform"); - GLAD_GL_EXT_packed_float = has_ext("GL_EXT_packed_float"); - GLAD_GL_OML_subsample = has_ext("GL_OML_subsample"); - GLAD_GL_SGIX_vertex_preclip = has_ext("GL_SGIX_vertex_preclip"); - GLAD_GL_SGIX_texture_scale_bias = has_ext("GL_SGIX_texture_scale_bias"); - GLAD_GL_AMD_draw_buffers_blend = has_ext("GL_AMD_draw_buffers_blend"); - GLAD_GL_APPLE_texture_range = has_ext("GL_APPLE_texture_range"); - GLAD_GL_EXT_texture_array = has_ext("GL_EXT_texture_array"); - GLAD_GL_NV_texture_barrier = has_ext("GL_NV_texture_barrier"); - GLAD_GL_ARB_texture_query_levels = has_ext("GL_ARB_texture_query_levels"); - GLAD_GL_NV_texgen_emboss = has_ext("GL_NV_texgen_emboss"); - GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); - GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); - GLAD_GL_ARB_vertex_type_2_10_10_10_rev = has_ext("GL_ARB_vertex_type_2_10_10_10_rev"); - GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); - GLAD_GL_3DFX_tbuffer = has_ext("GL_3DFX_tbuffer"); - GLAD_GL_GREMEDY_frame_terminator = has_ext("GL_GREMEDY_frame_terminator"); - GLAD_GL_ARB_blend_func_extended = has_ext("GL_ARB_blend_func_extended"); - GLAD_GL_EXT_separate_shader_objects = has_ext("GL_EXT_separate_shader_objects"); - GLAD_GL_NV_texture_multisample = has_ext("GL_NV_texture_multisample"); - GLAD_GL_ARB_shader_objects = has_ext("GL_ARB_shader_objects"); - GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); - GLAD_GL_ATI_envmap_bumpmap = has_ext("GL_ATI_envmap_bumpmap"); - GLAD_GL_ARB_robust_buffer_access_behavior = has_ext("GL_ARB_robust_buffer_access_behavior"); - GLAD_GL_ARB_shader_stencil_export = has_ext("GL_ARB_shader_stencil_export"); - GLAD_GL_NV_texture_rectangle = has_ext("GL_NV_texture_rectangle"); - GLAD_GL_ARB_enhanced_layouts = has_ext("GL_ARB_enhanced_layouts"); - GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); - GLAD_GL_SGI_texture_color_table = has_ext("GL_SGI_texture_color_table"); - GLAD_GL_ATI_map_object_buffer = has_ext("GL_ATI_map_object_buffer"); - GLAD_GL_ARB_robustness = has_ext("GL_ARB_robustness"); - GLAD_GL_NV_pixel_data_range = has_ext("GL_NV_pixel_data_range"); - GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); - GLAD_GL_ARB_gpu_shader_fp64 = has_ext("GL_ARB_gpu_shader_fp64"); - GLAD_GL_NV_command_list = has_ext("GL_NV_command_list"); - GLAD_GL_SGIX_depth_texture = has_ext("GL_SGIX_depth_texture"); - GLAD_GL_EXT_vertex_weighting = has_ext("GL_EXT_vertex_weighting"); - GLAD_GL_GREMEDY_string_marker = has_ext("GL_GREMEDY_string_marker"); - GLAD_GL_ARB_texture_compression_bptc = has_ext("GL_ARB_texture_compression_bptc"); - GLAD_GL_EXT_subtexture = has_ext("GL_EXT_subtexture"); - GLAD_GL_EXT_pixel_transform_color_table = has_ext("GL_EXT_pixel_transform_color_table"); - GLAD_GL_EXT_texture_compression_rgtc = has_ext("GL_EXT_texture_compression_rgtc"); - GLAD_GL_ARB_shader_atomic_counter_ops = has_ext("GL_ARB_shader_atomic_counter_ops"); - GLAD_GL_SGIX_depth_pass_instrument = has_ext("GL_SGIX_depth_pass_instrument"); - GLAD_GL_EXT_gpu_program_parameters = has_ext("GL_EXT_gpu_program_parameters"); - GLAD_GL_NV_evaluators = has_ext("GL_NV_evaluators"); - GLAD_GL_SGIS_texture_filter4 = has_ext("GL_SGIS_texture_filter4"); - GLAD_GL_AMD_performance_monitor = has_ext("GL_AMD_performance_monitor"); - GLAD_GL_NV_geometry_shader4 = has_ext("GL_NV_geometry_shader4"); - GLAD_GL_EXT_stencil_clear_tag = has_ext("GL_EXT_stencil_clear_tag"); - GLAD_GL_NV_vertex_program1_1 = has_ext("GL_NV_vertex_program1_1"); - GLAD_GL_NV_present_video = has_ext("GL_NV_present_video"); - GLAD_GL_ARB_texture_compression_rgtc = has_ext("GL_ARB_texture_compression_rgtc"); - GLAD_GL_HP_convolution_border_modes = has_ext("GL_HP_convolution_border_modes"); - GLAD_GL_EXT_shader_integer_mix = has_ext("GL_EXT_shader_integer_mix"); - GLAD_GL_SGIX_framezoom = has_ext("GL_SGIX_framezoom"); - GLAD_GL_ARB_stencil_texturing = has_ext("GL_ARB_stencil_texturing"); - GLAD_GL_ARB_shader_clock = has_ext("GL_ARB_shader_clock"); - GLAD_GL_NV_shader_atomic_fp16_vector = has_ext("GL_NV_shader_atomic_fp16_vector"); - GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); - GLAD_GL_ARB_draw_elements_base_vertex = has_ext("GL_ARB_draw_elements_base_vertex"); - GLAD_GL_INGR_interlace_read = has_ext("GL_INGR_interlace_read"); - GLAD_GL_NV_transform_feedback = has_ext("GL_NV_transform_feedback"); - GLAD_GL_NV_fragment_program = has_ext("GL_NV_fragment_program"); - GLAD_GL_AMD_stencil_operation_extended = has_ext("GL_AMD_stencil_operation_extended"); - GLAD_GL_ARB_seamless_cubemap_per_texture = has_ext("GL_ARB_seamless_cubemap_per_texture"); - GLAD_GL_ARB_instanced_arrays = has_ext("GL_ARB_instanced_arrays"); - GLAD_GL_EXT_polygon_offset = has_ext("GL_EXT_polygon_offset"); - GLAD_GL_NV_vertex_array_range2 = has_ext("GL_NV_vertex_array_range2"); - GLAD_GL_KHR_robustness = has_ext("GL_KHR_robustness"); - GLAD_GL_AMD_sparse_texture = has_ext("GL_AMD_sparse_texture"); - GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control"); - GLAD_GL_NV_fragment_coverage_to_color = has_ext("GL_NV_fragment_coverage_to_color"); - GLAD_GL_NV_fence = has_ext("GL_NV_fence"); - GLAD_GL_ARB_texture_buffer_range = has_ext("GL_ARB_texture_buffer_range"); - GLAD_GL_SUN_mesh_array = has_ext("GL_SUN_mesh_array"); - GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); - GLAD_GL_ARB_framebuffer_no_attachments = has_ext("GL_ARB_framebuffer_no_attachments"); - GLAD_GL_ARB_cl_event = has_ext("GL_ARB_cl_event"); - GLAD_GL_ARB_derivative_control = has_ext("GL_ARB_derivative_control"); - GLAD_GL_NV_packed_depth_stencil = has_ext("GL_NV_packed_depth_stencil"); - GLAD_GL_OES_single_precision = has_ext("GL_OES_single_precision"); - GLAD_GL_NV_primitive_restart = has_ext("GL_NV_primitive_restart"); - GLAD_GL_SUN_global_alpha = has_ext("GL_SUN_global_alpha"); - GLAD_GL_ARB_fragment_shader_interlock = has_ext("GL_ARB_fragment_shader_interlock"); - GLAD_GL_EXT_texture_object = has_ext("GL_EXT_texture_object"); - GLAD_GL_AMD_name_gen_delete = has_ext("GL_AMD_name_gen_delete"); - GLAD_GL_NV_texture_compression_vtc = has_ext("GL_NV_texture_compression_vtc"); - GLAD_GL_NV_sample_mask_override_coverage = has_ext("GL_NV_sample_mask_override_coverage"); - GLAD_GL_NV_texture_shader3 = has_ext("GL_NV_texture_shader3"); - GLAD_GL_NV_texture_shader2 = has_ext("GL_NV_texture_shader2"); - GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); - GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); - GLAD_GL_AMD_shader_atomic_counter_ops = has_ext("GL_AMD_shader_atomic_counter_ops"); - GLAD_GL_APPLE_vertex_program_evaluators = has_ext("GL_APPLE_vertex_program_evaluators"); - GLAD_GL_ARB_multi_bind = has_ext("GL_ARB_multi_bind"); - GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); - GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); - GLAD_GL_NV_path_rendering_shared_edge = has_ext("GL_NV_path_rendering_shared_edge"); - GLAD_GL_SGIX_shadow_ambient = has_ext("GL_SGIX_shadow_ambient"); - GLAD_GL_ARB_texture_cube_map = has_ext("GL_ARB_texture_cube_map"); - GLAD_GL_AMD_vertex_shader_viewport_index = has_ext("GL_AMD_vertex_shader_viewport_index"); - GLAD_GL_SGIX_list_priority = has_ext("GL_SGIX_list_priority"); - GLAD_GL_NV_vertex_buffer_unified_memory = has_ext("GL_NV_vertex_buffer_unified_memory"); - GLAD_GL_NV_uniform_buffer_unified_memory = has_ext("GL_NV_uniform_buffer_unified_memory"); - GLAD_GL_EXT_texture_env_dot3 = has_ext("GL_EXT_texture_env_dot3"); - GLAD_GL_ATI_texture_env_combine3 = has_ext("GL_ATI_texture_env_combine3"); - GLAD_GL_ARB_map_buffer_alignment = has_ext("GL_ARB_map_buffer_alignment"); - GLAD_GL_NV_blend_equation_advanced = has_ext("GL_NV_blend_equation_advanced"); - GLAD_GL_SGIS_sharpen_texture = has_ext("GL_SGIS_sharpen_texture"); - GLAD_GL_KHR_robust_buffer_access_behavior = has_ext("GL_KHR_robust_buffer_access_behavior"); - GLAD_GL_ARB_pipeline_statistics_query = has_ext("GL_ARB_pipeline_statistics_query"); - GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); - GLAD_GL_ARB_texture_rgb10_a2ui = has_ext("GL_ARB_texture_rgb10_a2ui"); - GLAD_GL_OML_interlace = has_ext("GL_OML_interlace"); - GLAD_GL_ATI_pixel_format_float = has_ext("GL_ATI_pixel_format_float"); - GLAD_GL_NV_geometry_shader_passthrough = has_ext("GL_NV_geometry_shader_passthrough"); - GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); - GLAD_GL_EXT_shadow_funcs = has_ext("GL_EXT_shadow_funcs"); - GLAD_GL_ATI_text_fragment_shader = has_ext("GL_ATI_text_fragment_shader"); - GLAD_GL_NV_vertex_array_range = has_ext("GL_NV_vertex_array_range"); - GLAD_GL_SGIX_fragment_lighting = has_ext("GL_SGIX_fragment_lighting"); - GLAD_GL_NV_texture_expand_normal = has_ext("GL_NV_texture_expand_normal"); - GLAD_GL_NV_framebuffer_multisample_coverage = has_ext("GL_NV_framebuffer_multisample_coverage"); - GLAD_GL_EXT_timer_query = has_ext("GL_EXT_timer_query"); - GLAD_GL_EXT_vertex_array_bgra = has_ext("GL_EXT_vertex_array_bgra"); - GLAD_GL_NV_bindless_texture = has_ext("GL_NV_bindless_texture"); - GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); - GLAD_GL_SGIS_texture_border_clamp = has_ext("GL_SGIS_texture_border_clamp"); - GLAD_GL_ATI_vertex_attrib_array_object = has_ext("GL_ATI_vertex_attrib_array_object"); - GLAD_GL_SGIX_clipmap = has_ext("GL_SGIX_clipmap"); - GLAD_GL_EXT_geometry_shader4 = has_ext("GL_EXT_geometry_shader4"); - GLAD_GL_ARB_shader_texture_image_samples = has_ext("GL_ARB_shader_texture_image_samples"); - GLAD_GL_MESA_ycbcr_texture = has_ext("GL_MESA_ycbcr_texture"); - GLAD_GL_MESAX_texture_stack = has_ext("GL_MESAX_texture_stack"); - GLAD_GL_AMD_seamless_cubemap_per_texture = has_ext("GL_AMD_seamless_cubemap_per_texture"); - GLAD_GL_EXT_bindable_uniform = has_ext("GL_EXT_bindable_uniform"); - GLAD_GL_KHR_texture_compression_astc_hdr = has_ext("GL_KHR_texture_compression_astc_hdr"); - GLAD_GL_ARB_shader_ballot = has_ext("GL_ARB_shader_ballot"); - GLAD_GL_KHR_blend_equation_advanced = has_ext("GL_KHR_blend_equation_advanced"); - GLAD_GL_ARB_fragment_program_shadow = has_ext("GL_ARB_fragment_program_shadow"); - GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); - GLAD_GL_AMD_texture_texture4 = has_ext("GL_AMD_texture_texture4"); - GLAD_GL_SGIX_reference_plane = has_ext("GL_SGIX_reference_plane"); - GLAD_GL_EXT_stencil_two_side = has_ext("GL_EXT_stencil_two_side"); - GLAD_GL_ARB_transform_feedback_overflow_query = has_ext("GL_ARB_transform_feedback_overflow_query"); - GLAD_GL_SGIX_texture_lod_bias = has_ext("GL_SGIX_texture_lod_bias"); - GLAD_GL_KHR_no_error = has_ext("GL_KHR_no_error"); - GLAD_GL_NV_explicit_multisample = has_ext("GL_NV_explicit_multisample"); - GLAD_GL_IBM_static_data = has_ext("GL_IBM_static_data"); - GLAD_GL_EXT_clip_volume_hint = has_ext("GL_EXT_clip_volume_hint"); - GLAD_GL_EXT_texture_perturb_normal = has_ext("GL_EXT_texture_perturb_normal"); - GLAD_GL_NV_fragment_program2 = has_ext("GL_NV_fragment_program2"); - GLAD_GL_NV_fragment_program4 = has_ext("GL_NV_fragment_program4"); - GLAD_GL_EXT_point_parameters = has_ext("GL_EXT_point_parameters"); - GLAD_GL_PGI_misc_hints = has_ext("GL_PGI_misc_hints"); - GLAD_GL_SGIX_subsample = has_ext("GL_SGIX_subsample"); - GLAD_GL_AMD_shader_stencil_export = has_ext("GL_AMD_shader_stencil_export"); - GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod"); - GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); - GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); - GLAD_GL_SGIS_texture_select = has_ext("GL_SGIS_texture_select"); - GLAD_GL_NV_texture_shader = has_ext("GL_NV_texture_shader"); - GLAD_GL_ARB_tessellation_shader = has_ext("GL_ARB_tessellation_shader"); - GLAD_GL_EXT_draw_buffers2 = has_ext("GL_EXT_draw_buffers2"); - GLAD_GL_ARB_vertex_attrib_64bit = has_ext("GL_ARB_vertex_attrib_64bit"); - GLAD_GL_EXT_texture_filter_minmax = has_ext("GL_EXT_texture_filter_minmax"); - GLAD_GL_WIN_specular_fog = has_ext("GL_WIN_specular_fog"); - GLAD_GL_AMD_interleaved_elements = has_ext("GL_AMD_interleaved_elements"); - GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); - GLAD_GL_OML_resample = has_ext("GL_OML_resample"); - GLAD_GL_APPLE_ycbcr_422 = has_ext("GL_APPLE_ycbcr_422"); - GLAD_GL_SGIX_texture_add_env = has_ext("GL_SGIX_texture_add_env"); - GLAD_GL_ARB_shadow_ambient = has_ext("GL_ARB_shadow_ambient"); - GLAD_GL_ARB_texture_storage = has_ext("GL_ARB_texture_storage"); - GLAD_GL_EXT_pixel_buffer_object = has_ext("GL_EXT_pixel_buffer_object"); - GLAD_GL_ARB_copy_image = has_ext("GL_ARB_copy_image"); - GLAD_GL_SGIS_pixel_texture = has_ext("GL_SGIS_pixel_texture"); - GLAD_GL_SGIS_generate_mipmap = has_ext("GL_SGIS_generate_mipmap"); - GLAD_GL_SGIX_instruments = has_ext("GL_SGIX_instruments"); - GLAD_GL_HP_texture_lighting = has_ext("GL_HP_texture_lighting"); - GLAD_GL_ARB_shader_storage_buffer_object = has_ext("GL_ARB_shader_storage_buffer_object"); - GLAD_GL_EXT_sparse_texture2 = has_ext("GL_EXT_sparse_texture2"); - GLAD_GL_EXT_blend_minmax = has_ext("GL_EXT_blend_minmax"); - GLAD_GL_MESA_pack_invert = has_ext("GL_MESA_pack_invert"); - GLAD_GL_ARB_base_instance = has_ext("GL_ARB_base_instance"); - GLAD_GL_SGIX_convolution_accuracy = has_ext("GL_SGIX_convolution_accuracy"); - GLAD_GL_PGI_vertex_hints = has_ext("GL_PGI_vertex_hints"); - GLAD_GL_AMD_transform_feedback4 = has_ext("GL_AMD_transform_feedback4"); - GLAD_GL_ARB_ES3_1_compatibility = has_ext("GL_ARB_ES3_1_compatibility"); - GLAD_GL_EXT_texture_integer = has_ext("GL_EXT_texture_integer"); - GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); - GLAD_GL_AMD_gpu_shader_int64 = has_ext("GL_AMD_gpu_shader_int64"); - GLAD_GL_S3_s3tc = has_ext("GL_S3_s3tc"); - GLAD_GL_ARB_query_buffer_object = has_ext("GL_ARB_query_buffer_object"); - GLAD_GL_AMD_vertex_shader_tessellator = has_ext("GL_AMD_vertex_shader_tessellator"); - GLAD_GL_ARB_invalidate_subdata = has_ext("GL_ARB_invalidate_subdata"); - GLAD_GL_EXT_index_material = has_ext("GL_EXT_index_material"); - GLAD_GL_NV_blend_equation_advanced_coherent = has_ext("GL_NV_blend_equation_advanced_coherent"); - GLAD_GL_KHR_texture_compression_astc_sliced_3d = has_ext("GL_KHR_texture_compression_astc_sliced_3d"); - GLAD_GL_INTEL_parallel_arrays = has_ext("GL_INTEL_parallel_arrays"); - GLAD_GL_ATI_draw_buffers = has_ext("GL_ATI_draw_buffers"); - GLAD_GL_EXT_cmyka = has_ext("GL_EXT_cmyka"); - GLAD_GL_SGIX_pixel_texture = has_ext("GL_SGIX_pixel_texture"); - GLAD_GL_APPLE_specular_vector = has_ext("GL_APPLE_specular_vector"); - GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); - GLAD_GL_ARB_timer_query = has_ext("GL_ARB_timer_query"); - GLAD_GL_SGIX_interlace = has_ext("GL_SGIX_interlace"); - GLAD_GL_NV_parameter_buffer_object = has_ext("GL_NV_parameter_buffer_object"); - GLAD_GL_AMD_shader_trinary_minmax = has_ext("GL_AMD_shader_trinary_minmax"); - GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access"); - GLAD_GL_EXT_rescale_normal = has_ext("GL_EXT_rescale_normal"); - GLAD_GL_ARB_pixel_buffer_object = has_ext("GL_ARB_pixel_buffer_object"); - GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); - GLAD_GL_ARB_vertex_type_10f_11f_11f_rev = has_ext("GL_ARB_vertex_type_10f_11f_11f_rev"); - GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); - GLAD_GL_NV_transform_feedback2 = has_ext("GL_NV_transform_feedback2"); - GLAD_GL_SGIX_async_pixel = has_ext("GL_SGIX_async_pixel"); - GLAD_GL_NV_fragment_program_option = has_ext("GL_NV_fragment_program_option"); - GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); - GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); - GLAD_GL_NV_shader_thread_group = has_ext("GL_NV_shader_thread_group"); - GLAD_GL_EXT_stencil_wrap = has_ext("GL_EXT_stencil_wrap"); - GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); - GLAD_GL_OVR_multiview2 = has_ext("GL_OVR_multiview2"); - GLAD_GL_EXT_histogram = has_ext("GL_EXT_histogram"); - GLAD_GL_ARB_get_texture_sub_image = has_ext("GL_ARB_get_texture_sub_image"); - GLAD_GL_SGIS_point_parameters = has_ext("GL_SGIS_point_parameters"); - GLAD_GL_SGIX_ycrcb = has_ext("GL_SGIX_ycrcb"); - GLAD_GL_EXT_direct_state_access = has_ext("GL_EXT_direct_state_access"); - GLAD_GL_ARB_cull_distance = has_ext("GL_ARB_cull_distance"); - GLAD_GL_AMD_sample_positions = has_ext("GL_AMD_sample_positions"); - GLAD_GL_NV_vertex_program = has_ext("GL_NV_vertex_program"); - GLAD_GL_NV_shader_thread_shuffle = has_ext("GL_NV_shader_thread_shuffle"); - GLAD_GL_ARB_shader_precision = has_ext("GL_ARB_shader_precision"); - GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); - GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); - GLAD_GL_APPLE_fence = has_ext("GL_APPLE_fence"); - GLAD_GL_OES_byte_coordinates = has_ext("GL_OES_byte_coordinates"); - GLAD_GL_ARB_transpose_matrix = has_ext("GL_ARB_transpose_matrix"); - GLAD_GL_ARB_provoking_vertex = has_ext("GL_ARB_provoking_vertex"); - GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); - GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); - GLAD_GL_ARB_half_float_vertex = has_ext("GL_ARB_half_float_vertex"); - GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); - GLAD_GL_NV_framebuffer_mixed_samples = has_ext("GL_NV_framebuffer_mixed_samples"); - GLAD_GL_NVX_conditional_render = has_ext("GL_NVX_conditional_render"); - GLAD_GL_ARB_multi_draw_indirect = has_ext("GL_ARB_multi_draw_indirect"); - GLAD_GL_EXT_raster_multisample = has_ext("GL_EXT_raster_multisample"); - GLAD_GL_NV_copy_image = has_ext("GL_NV_copy_image"); - GLAD_GL_ARB_fragment_layer_viewport = has_ext("GL_ARB_fragment_layer_viewport"); - GLAD_GL_INTEL_framebuffer_CMAA = has_ext("GL_INTEL_framebuffer_CMAA"); - GLAD_GL_ARB_transform_feedback2 = has_ext("GL_ARB_transform_feedback2"); - GLAD_GL_ARB_transform_feedback3 = has_ext("GL_ARB_transform_feedback3"); - GLAD_GL_SGIX_ycrcba = has_ext("GL_SGIX_ycrcba"); - GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); - GLAD_GL_EXT_bgra = has_ext("GL_EXT_bgra"); - GLAD_GL_ARB_sparse_texture_clamp = has_ext("GL_ARB_sparse_texture_clamp"); - GLAD_GL_EXT_pixel_transform = has_ext("GL_EXT_pixel_transform"); - GLAD_GL_ARB_conservative_depth = has_ext("GL_ARB_conservative_depth"); - GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); - GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); - GLAD_GL_SUN_triangle_list = has_ext("GL_SUN_triangle_list"); - GLAD_GL_EXT_texture_env_add = has_ext("GL_EXT_texture_env_add"); - GLAD_GL_EXT_packed_depth_stencil = has_ext("GL_EXT_packed_depth_stencil"); - GLAD_GL_EXT_texture_mirror_clamp = has_ext("GL_EXT_texture_mirror_clamp"); - GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); - GLAD_GL_APPLE_float_pixels = has_ext("GL_APPLE_float_pixels"); - GLAD_GL_ARB_transform_feedback_instanced = has_ext("GL_ARB_transform_feedback_instanced"); - GLAD_GL_SGIX_async = has_ext("GL_SGIX_async"); - GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); - GLAD_GL_NV_shader_atomic_float = has_ext("GL_NV_shader_atomic_float"); - GLAD_GL_ARB_shading_language_100 = has_ext("GL_ARB_shading_language_100"); - GLAD_GL_INTEL_performance_query = has_ext("GL_INTEL_performance_query"); - GLAD_GL_ARB_texture_mirror_clamp_to_edge = has_ext("GL_ARB_texture_mirror_clamp_to_edge"); - GLAD_GL_NV_gpu_shader5 = has_ext("GL_NV_gpu_shader5"); - GLAD_GL_NV_bindless_multi_draw_indirect_count = has_ext("GL_NV_bindless_multi_draw_indirect_count"); - GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); - GLAD_GL_ARB_indirect_parameters = has_ext("GL_ARB_indirect_parameters"); - GLAD_GL_NV_half_float = has_ext("GL_NV_half_float"); - GLAD_GL_ARB_ES3_2_compatibility = has_ext("GL_ARB_ES3_2_compatibility"); - GLAD_GL_ATI_texture_mirror_once = has_ext("GL_ATI_texture_mirror_once"); - GLAD_GL_IBM_rasterpos_clip = has_ext("GL_IBM_rasterpos_clip"); - GLAD_GL_SGIX_shadow = has_ext("GL_SGIX_shadow"); - GLAD_GL_EXT_polygon_offset_clamp = has_ext("GL_EXT_polygon_offset_clamp"); - GLAD_GL_NV_deep_texture3D = has_ext("GL_NV_deep_texture3D"); - GLAD_GL_ARB_shader_draw_parameters = has_ext("GL_ARB_shader_draw_parameters"); - GLAD_GL_SGIX_calligraphic_fragment = has_ext("GL_SGIX_calligraphic_fragment"); - GLAD_GL_ARB_shader_bit_encoding = has_ext("GL_ARB_shader_bit_encoding"); - GLAD_GL_EXT_compiled_vertex_array = has_ext("GL_EXT_compiled_vertex_array"); - GLAD_GL_NV_depth_buffer_float = has_ext("GL_NV_depth_buffer_float"); - GLAD_GL_NV_occlusion_query = has_ext("GL_NV_occlusion_query"); - GLAD_GL_APPLE_flush_buffer_range = has_ext("GL_APPLE_flush_buffer_range"); - GLAD_GL_ARB_imaging = has_ext("GL_ARB_imaging"); - GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); - GLAD_GL_AMD_gcn_shader = has_ext("GL_AMD_gcn_shader"); - GLAD_GL_AMD_blend_minmax_factor = has_ext("GL_AMD_blend_minmax_factor"); - GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); - GLAD_GL_ARB_shading_language_420pack = has_ext("GL_ARB_shading_language_420pack"); - GLAD_GL_ARB_shader_viewport_layer_array = has_ext("GL_ARB_shader_viewport_layer_array"); - GLAD_GL_ATI_meminfo = has_ext("GL_ATI_meminfo"); - GLAD_GL_EXT_abgr = has_ext("GL_EXT_abgr"); - GLAD_GL_AMD_pinned_memory = has_ext("GL_AMD_pinned_memory"); - GLAD_GL_EXT_texture_snorm = has_ext("GL_EXT_texture_snorm"); - GLAD_GL_SGIX_texture_coordinate_clamp = has_ext("GL_SGIX_texture_coordinate_clamp"); - GLAD_GL_ARB_clear_buffer_object = has_ext("GL_ARB_clear_buffer_object"); - GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); - GLAD_GL_EXT_debug_label = has_ext("GL_EXT_debug_label"); - GLAD_GL_ARB_sample_shading = has_ext("GL_ARB_sample_shading"); - GLAD_GL_NV_internalformat_sample_query = has_ext("GL_NV_internalformat_sample_query"); - GLAD_GL_INTEL_map_texture = has_ext("GL_INTEL_map_texture"); - GLAD_GL_ARB_texture_env_crossbar = has_ext("GL_ARB_texture_env_crossbar"); - GLAD_GL_EXT_422_pixels = has_ext("GL_EXT_422_pixels"); - GLAD_GL_ARB_compute_shader = has_ext("GL_ARB_compute_shader"); - GLAD_GL_EXT_blend_logic_op = has_ext("GL_EXT_blend_logic_op"); - GLAD_GL_IBM_cull_vertex = has_ext("GL_IBM_cull_vertex"); - GLAD_GL_IBM_vertex_array_lists = has_ext("GL_IBM_vertex_array_lists"); - GLAD_GL_ARB_color_buffer_float = has_ext("GL_ARB_color_buffer_float"); - GLAD_GL_ARB_bindless_texture = has_ext("GL_ARB_bindless_texture"); - GLAD_GL_ARB_window_pos = has_ext("GL_ARB_window_pos"); - GLAD_GL_ARB_internalformat_query = has_ext("GL_ARB_internalformat_query"); - GLAD_GL_ARB_shadow = has_ext("GL_ARB_shadow"); - GLAD_GL_ARB_texture_mirrored_repeat = has_ext("GL_ARB_texture_mirrored_repeat"); - GLAD_GL_EXT_shader_image_load_store = has_ext("GL_EXT_shader_image_load_store"); - GLAD_GL_EXT_copy_texture = has_ext("GL_EXT_copy_texture"); - GLAD_GL_NV_register_combiners2 = has_ext("GL_NV_register_combiners2"); - GLAD_GL_SGIX_ycrcb_subsample = has_ext("GL_SGIX_ycrcb_subsample"); - GLAD_GL_SGIX_ir_instrument1 = has_ext("GL_SGIX_ir_instrument1"); - GLAD_GL_NV_draw_texture = has_ext("GL_NV_draw_texture"); - GLAD_GL_EXT_texture_shared_exponent = has_ext("GL_EXT_texture_shared_exponent"); - GLAD_GL_EXT_draw_instanced = has_ext("GL_EXT_draw_instanced"); - GLAD_GL_NV_copy_depth_to_color = has_ext("GL_NV_copy_depth_to_color"); - GLAD_GL_ARB_viewport_array = has_ext("GL_ARB_viewport_array"); - GLAD_GL_ARB_separate_shader_objects = has_ext("GL_ARB_separate_shader_objects"); - GLAD_GL_EXT_depth_bounds_test = has_ext("GL_EXT_depth_bounds_test"); - GLAD_GL_EXT_shared_texture_palette = has_ext("GL_EXT_shared_texture_palette"); - GLAD_GL_ARB_texture_env_add = has_ext("GL_ARB_texture_env_add"); - GLAD_GL_NV_video_capture = has_ext("GL_NV_video_capture"); - GLAD_GL_ARB_sampler_objects = has_ext("GL_ARB_sampler_objects"); - GLAD_GL_ARB_matrix_palette = has_ext("GL_ARB_matrix_palette"); - GLAD_GL_SGIS_texture_color_mask = has_ext("GL_SGIS_texture_color_mask"); - GLAD_GL_EXT_packed_pixels = has_ext("GL_EXT_packed_pixels"); - GLAD_GL_EXT_coordinate_frame = has_ext("GL_EXT_coordinate_frame"); - GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); - GLAD_GL_APPLE_aux_depth_stencil = has_ext("GL_APPLE_aux_depth_stencil"); - GLAD_GL_ARB_shader_subroutine = has_ext("GL_ARB_shader_subroutine"); - GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); - GLAD_GL_ARB_texture_storage_multisample = has_ext("GL_ARB_texture_storage_multisample"); - GLAD_GL_KHR_blend_equation_advanced_coherent = has_ext("GL_KHR_blend_equation_advanced_coherent"); - GLAD_GL_EXT_vertex_attrib_64bit = has_ext("GL_EXT_vertex_attrib_64bit"); - GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); - GLAD_GL_NV_shader_buffer_store = has_ext("GL_NV_shader_buffer_store"); - GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); - GLAD_GL_MESA_window_pos = has_ext("GL_MESA_window_pos"); - GLAD_GL_NV_fill_rectangle = has_ext("GL_NV_fill_rectangle"); - GLAD_GL_NV_shader_storage_buffer_object = has_ext("GL_NV_shader_storage_buffer_object"); - GLAD_GL_ARB_texture_query_lod = has_ext("GL_ARB_texture_query_lod"); - GLAD_GL_ARB_copy_buffer = has_ext("GL_ARB_copy_buffer"); - GLAD_GL_ARB_shader_image_size = has_ext("GL_ARB_shader_image_size"); - GLAD_GL_NV_shader_atomic_counters = has_ext("GL_NV_shader_atomic_counters"); - GLAD_GL_APPLE_object_purgeable = has_ext("GL_APPLE_object_purgeable"); - GLAD_GL_ARB_occlusion_query = has_ext("GL_ARB_occlusion_query"); - GLAD_GL_INGR_color_clamp = has_ext("GL_INGR_color_clamp"); - GLAD_GL_SGI_color_table = has_ext("GL_SGI_color_table"); - GLAD_GL_NV_gpu_program5_mem_extended = has_ext("GL_NV_gpu_program5_mem_extended"); - GLAD_GL_ARB_texture_cube_map_array = has_ext("GL_ARB_texture_cube_map_array"); - GLAD_GL_SGIX_scalebias_hint = has_ext("GL_SGIX_scalebias_hint"); - GLAD_GL_EXT_gpu_shader4 = has_ext("GL_EXT_gpu_shader4"); - GLAD_GL_NV_geometry_program4 = has_ext("GL_NV_geometry_program4"); - GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); - GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); - GLAD_GL_ARB_texture_border_clamp = has_ext("GL_ARB_texture_border_clamp"); - GLAD_GL_ARB_fragment_coord_conventions = has_ext("GL_ARB_fragment_coord_conventions"); - GLAD_GL_ARB_multitexture = has_ext("GL_ARB_multitexture"); - GLAD_GL_SGIX_polynomial_ffd = has_ext("GL_SGIX_polynomial_ffd"); - GLAD_GL_EXT_provoking_vertex = has_ext("GL_EXT_provoking_vertex"); - GLAD_GL_ARB_point_parameters = has_ext("GL_ARB_point_parameters"); - GLAD_GL_ARB_shader_image_load_store = has_ext("GL_ARB_shader_image_load_store"); - GLAD_GL_ARB_conditional_render_inverted = has_ext("GL_ARB_conditional_render_inverted"); - GLAD_GL_HP_occlusion_test = has_ext("GL_HP_occlusion_test"); - GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); - GLAD_GL_ARB_texture_barrier = has_ext("GL_ARB_texture_barrier"); - GLAD_GL_ARB_texture_buffer_object_rgb32 = has_ext("GL_ARB_texture_buffer_object_rgb32"); - GLAD_GL_NV_bindless_multi_draw_indirect = has_ext("GL_NV_bindless_multi_draw_indirect"); - GLAD_GL_SGIX_texture_multi_buffer = has_ext("GL_SGIX_texture_multi_buffer"); - GLAD_GL_EXT_transform_feedback = has_ext("GL_EXT_transform_feedback"); - GLAD_GL_KHR_texture_compression_astc_ldr = has_ext("GL_KHR_texture_compression_astc_ldr"); - GLAD_GL_3DFX_multisample = has_ext("GL_3DFX_multisample"); - GLAD_GL_INTEL_fragment_shader_ordering = has_ext("GL_INTEL_fragment_shader_ordering"); - GLAD_GL_ARB_texture_env_dot3 = has_ext("GL_ARB_texture_env_dot3"); - GLAD_GL_NV_gpu_program4 = has_ext("GL_NV_gpu_program4"); - GLAD_GL_NV_gpu_program5 = has_ext("GL_NV_gpu_program5"); - GLAD_GL_NV_float_buffer = has_ext("GL_NV_float_buffer"); - GLAD_GL_SGIS_texture_edge_clamp = has_ext("GL_SGIS_texture_edge_clamp"); - GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); - GLAD_GL_SUN_slice_accum = has_ext("GL_SUN_slice_accum"); - GLAD_GL_EXT_index_texture = has_ext("GL_EXT_index_texture"); - GLAD_GL_EXT_shader_image_load_formatted = has_ext("GL_EXT_shader_image_load_formatted"); - GLAD_GL_ARB_geometry_shader4 = has_ext("GL_ARB_geometry_shader4"); - GLAD_GL_EXT_separate_specular_color = has_ext("GL_EXT_separate_specular_color"); - GLAD_GL_AMD_depth_clamp_separate = has_ext("GL_AMD_depth_clamp_separate"); - GLAD_GL_NV_conservative_raster = has_ext("GL_NV_conservative_raster"); - GLAD_GL_ARB_sparse_texture2 = has_ext("GL_ARB_sparse_texture2"); - GLAD_GL_SGIX_sprite = has_ext("GL_SGIX_sprite"); - GLAD_GL_ARB_get_program_binary = has_ext("GL_ARB_get_program_binary"); - GLAD_GL_AMD_occlusion_query_event = has_ext("GL_AMD_occlusion_query_event"); - GLAD_GL_SGIS_multisample = has_ext("GL_SGIS_multisample"); - GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); - GLAD_GL_ARB_robustness_isolation = has_ext("GL_ARB_robustness_isolation"); - GLAD_GL_ARB_vertex_array_bgra = has_ext("GL_ARB_vertex_array_bgra"); - GLAD_GL_APPLE_vertex_array_range = has_ext("GL_APPLE_vertex_array_range"); - GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); - GLAD_GL_NV_register_combiners = has_ext("GL_NV_register_combiners"); - GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); - GLAD_GL_ARB_clear_texture = has_ext("GL_ARB_clear_texture"); - GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); - GLAD_GL_SGI_color_matrix = has_ext("GL_SGI_color_matrix"); - GLAD_GL_EXT_cull_vertex = has_ext("GL_EXT_cull_vertex"); - GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); - GLAD_GL_APPLE_row_bytes = has_ext("GL_APPLE_row_bytes"); - GLAD_GL_NV_texgen_reflection = has_ext("GL_NV_texgen_reflection"); - GLAD_GL_IBM_multimode_draw_arrays = has_ext("GL_IBM_multimode_draw_arrays"); - GLAD_GL_APPLE_vertex_array_object = has_ext("GL_APPLE_vertex_array_object"); - GLAD_GL_3DFX_texture_compression_FXT1 = has_ext("GL_3DFX_texture_compression_FXT1"); - GLAD_GL_NV_fragment_shader_interlock = has_ext("GL_NV_fragment_shader_interlock"); - GLAD_GL_AMD_conservative_depth = has_ext("GL_AMD_conservative_depth"); - GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); - GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); - GLAD_GL_SGIS_detail_texture = has_ext("GL_SGIS_detail_texture"); - GLAD_GL_ARB_draw_instanced = has_ext("GL_ARB_draw_instanced"); - GLAD_GL_OES_read_format = has_ext("GL_OES_read_format"); - GLAD_GL_ATI_texture_float = has_ext("GL_ATI_texture_float"); - GLAD_GL_ARB_texture_gather = has_ext("GL_ARB_texture_gather"); - GLAD_GL_AMD_vertex_shader_layer = has_ext("GL_AMD_vertex_shader_layer"); - GLAD_GL_ARB_shading_language_include = has_ext("GL_ARB_shading_language_include"); - GLAD_GL_APPLE_client_storage = has_ext("GL_APPLE_client_storage"); - GLAD_GL_WIN_phong_shading = has_ext("GL_WIN_phong_shading"); - GLAD_GL_INGR_blend_func_separate = has_ext("GL_INGR_blend_func_separate"); - GLAD_GL_NV_path_rendering = has_ext("GL_NV_path_rendering"); - GLAD_GL_NV_conservative_raster_dilate = has_ext("GL_NV_conservative_raster_dilate"); - GLAD_GL_ATI_vertex_streams = has_ext("GL_ATI_vertex_streams"); - GLAD_GL_ARB_post_depth_coverage = has_ext("GL_ARB_post_depth_coverage"); - GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); - GLAD_GL_APPLE_rgb_422 = has_ext("GL_APPLE_rgb_422"); - GLAD_GL_EXT_texture_lod_bias = has_ext("GL_EXT_texture_lod_bias"); - GLAD_GL_ARB_gpu_shader_int64 = has_ext("GL_ARB_gpu_shader_int64"); - GLAD_GL_ARB_seamless_cube_map = has_ext("GL_ARB_seamless_cube_map"); - GLAD_GL_ARB_shader_group_vote = has_ext("GL_ARB_shader_group_vote"); - GLAD_GL_NV_vdpau_interop = has_ext("GL_NV_vdpau_interop"); - GLAD_GL_ARB_occlusion_query2 = has_ext("GL_ARB_occlusion_query2"); - GLAD_GL_ARB_internalformat_query2 = has_ext("GL_ARB_internalformat_query2"); - GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); - GLAD_GL_SUN_vertex = has_ext("GL_SUN_vertex"); - GLAD_GL_SGIX_igloo_interface = has_ext("GL_SGIX_igloo_interface"); - GLAD_GL_SGIS_texture_lod = has_ext("GL_SGIS_texture_lod"); - GLAD_GL_NV_vertex_program3 = has_ext("GL_NV_vertex_program3"); - GLAD_GL_ARB_draw_indirect = has_ext("GL_ARB_draw_indirect"); - GLAD_GL_NV_vertex_program4 = has_ext("GL_NV_vertex_program4"); - GLAD_GL_AMD_transform_feedback3_lines_triangles = has_ext("GL_AMD_transform_feedback3_lines_triangles"); - GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); - GLAD_GL_EXT_x11_sync_object = has_ext("GL_EXT_x11_sync_object"); - GLAD_GL_ARB_sync = has_ext("GL_ARB_sync"); - GLAD_GL_NV_sample_locations = has_ext("GL_NV_sample_locations"); - GLAD_GL_ARB_compute_variable_group_size = has_ext("GL_ARB_compute_variable_group_size"); - GLAD_GL_OES_fixed_point = has_ext("GL_OES_fixed_point"); - GLAD_GL_NV_blend_square = has_ext("GL_NV_blend_square"); - GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); - GLAD_GL_ARB_gpu_shader5 = has_ext("GL_ARB_gpu_shader5"); - GLAD_GL_SGIS_texture4D = has_ext("GL_SGIS_texture4D"); - GLAD_GL_EXT_texture3D = has_ext("GL_EXT_texture3D"); - GLAD_GL_EXT_multisample = has_ext("GL_EXT_multisample"); - GLAD_GL_EXT_secondary_color = has_ext("GL_EXT_secondary_color"); - GLAD_GL_ARB_texture_filter_minmax = has_ext("GL_ARB_texture_filter_minmax"); - GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); - GLAD_GL_ARB_parallel_shader_compile = has_ext("GL_ARB_parallel_shader_compile"); - GLAD_GL_NVX_gpu_memory_info = has_ext("GL_NVX_gpu_memory_info"); - GLAD_GL_ARB_sparse_texture = has_ext("GL_ARB_sparse_texture"); - GLAD_GL_SGIS_point_line_texgen = has_ext("GL_SGIS_point_line_texgen"); - GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); - GLAD_GL_ARB_sparse_buffer = has_ext("GL_ARB_sparse_buffer"); - GLAD_GL_EXT_draw_range_elements = has_ext("GL_EXT_draw_range_elements"); - GLAD_GL_SGIX_blend_alpha_minmax = has_ext("GL_SGIX_blend_alpha_minmax"); - GLAD_GL_KHR_context_flush_control = has_ext("GL_KHR_context_flush_control"); - free_exts(); - return 1; -} - -static void find_coreGL(void) { - - /* Thank you @elmindreda - * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 - * https://github.com/glfw/glfw/blob/master/src/context.c#L36 - */ - int i, major, minor; - - const char* version; - const char* prefixes[] = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - NULL - }; - - version = (const char*) glGetString(GL_VERSION); - if (!version) return; - - for (i = 0; prefixes[i]; i++) { - const size_t length = strlen(prefixes[i]); - if (strncmp(version, prefixes[i], length) == 0) { - version += length; - break; - } - } - -/* PR #18 */ -#ifdef _MSC_VER - sscanf_s(version, "%d.%d", &major, &minor); -#else - sscanf(version, "%d.%d", &major, &minor); -#endif - - GLVersion.major = major; GLVersion.minor = minor; - max_loaded_major = major; max_loaded_minor = minor; - GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; - GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; - GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; - GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; - GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; - GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; - GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; - GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; - GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; - if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { - max_loaded_major = 3; - max_loaded_minor = 3; - } -} - -int gladLoadGLLoader(GLADloadproc load) { - GLVersion.major = 0; GLVersion.minor = 0; - glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - if(glGetString == NULL) return 0; - if(glGetString(GL_VERSION) == NULL) return 0; - find_coreGL(); - load_GL_VERSION_1_0(load); - load_GL_VERSION_1_1(load); - load_GL_VERSION_1_2(load); - load_GL_VERSION_1_3(load); - load_GL_VERSION_1_4(load); - load_GL_VERSION_1_5(load); - load_GL_VERSION_2_0(load); - load_GL_VERSION_2_1(load); - load_GL_VERSION_3_0(load); - load_GL_VERSION_3_1(load); - load_GL_VERSION_3_2(load); - load_GL_VERSION_3_3(load); - - if (!find_extensionsGL()) return 0; - load_GL_APPLE_element_array(load); - load_GL_AMD_multi_draw_indirect(load); - load_GL_SGIX_tag_sample_buffer(load); - load_GL_NV_point_sprite(load); - load_GL_ATI_separate_stencil(load); - load_GL_EXT_texture_buffer_object(load); - load_GL_ARB_vertex_blend(load); - load_GL_OVR_multiview(load); - load_GL_ARB_program_interface_query(load); - load_GL_EXT_index_func(load); - load_GL_NV_shader_buffer_load(load); - load_GL_EXT_color_subtable(load); - load_GL_SUNX_constant_data(load); - load_GL_EXT_multi_draw_arrays(load); - load_GL_ARB_shader_atomic_counters(load); - load_GL_NV_conditional_render(load); - load_GL_MESA_resize_buffers(load); - load_GL_ARB_texture_view(load); - load_GL_ARB_map_buffer_range(load); - load_GL_EXT_convolution(load); - load_GL_NV_vertex_attrib_integer_64bit(load); - load_GL_EXT_paletted_texture(load); - load_GL_ARB_texture_buffer_object(load); - load_GL_ATI_pn_triangles(load); - load_GL_SGIX_flush_raster(load); - load_GL_EXT_light_texture(load); - load_GL_HP_image_transform(load); - load_GL_AMD_draw_buffers_blend(load); - load_GL_APPLE_texture_range(load); - load_GL_EXT_texture_array(load); - load_GL_NV_texture_barrier(load); - load_GL_ARB_vertex_type_2_10_10_10_rev(load); - load_GL_3DFX_tbuffer(load); - load_GL_GREMEDY_frame_terminator(load); - load_GL_ARB_blend_func_extended(load); - load_GL_EXT_separate_shader_objects(load); - load_GL_NV_texture_multisample(load); - load_GL_ARB_shader_objects(load); - load_GL_ARB_framebuffer_object(load); - load_GL_ATI_envmap_bumpmap(load); - load_GL_ATI_map_object_buffer(load); - load_GL_ARB_robustness(load); - load_GL_NV_pixel_data_range(load); - load_GL_EXT_framebuffer_blit(load); - load_GL_ARB_gpu_shader_fp64(load); - load_GL_NV_command_list(load); - load_GL_EXT_vertex_weighting(load); - load_GL_GREMEDY_string_marker(load); - load_GL_EXT_subtexture(load); - load_GL_EXT_gpu_program_parameters(load); - load_GL_NV_evaluators(load); - load_GL_SGIS_texture_filter4(load); - load_GL_AMD_performance_monitor(load); - load_GL_EXT_stencil_clear_tag(load); - load_GL_NV_present_video(load); - load_GL_SGIX_framezoom(load); - load_GL_ARB_draw_elements_base_vertex(load); - load_GL_NV_transform_feedback(load); - load_GL_NV_fragment_program(load); - load_GL_AMD_stencil_operation_extended(load); - load_GL_ARB_instanced_arrays(load); - load_GL_EXT_polygon_offset(load); - load_GL_KHR_robustness(load); - load_GL_AMD_sparse_texture(load); - load_GL_ARB_clip_control(load); - load_GL_NV_fragment_coverage_to_color(load); - load_GL_NV_fence(load); - load_GL_ARB_texture_buffer_range(load); - load_GL_SUN_mesh_array(load); - load_GL_ARB_vertex_attrib_binding(load); - load_GL_ARB_framebuffer_no_attachments(load); - load_GL_ARB_cl_event(load); - load_GL_OES_single_precision(load); - load_GL_NV_primitive_restart(load); - load_GL_SUN_global_alpha(load); - load_GL_EXT_texture_object(load); - load_GL_AMD_name_gen_delete(load); - load_GL_ARB_buffer_storage(load); - load_GL_APPLE_vertex_program_evaluators(load); - load_GL_ARB_multi_bind(load); - load_GL_SGIX_list_priority(load); - load_GL_NV_vertex_buffer_unified_memory(load); - load_GL_NV_blend_equation_advanced(load); - load_GL_SGIS_sharpen_texture(load); - load_GL_ARB_vertex_program(load); - load_GL_ARB_vertex_buffer_object(load); - load_GL_NV_vertex_array_range(load); - load_GL_SGIX_fragment_lighting(load); - load_GL_NV_framebuffer_multisample_coverage(load); - load_GL_EXT_timer_query(load); - load_GL_NV_bindless_texture(load); - load_GL_KHR_debug(load); - load_GL_ATI_vertex_attrib_array_object(load); - load_GL_EXT_geometry_shader4(load); - load_GL_EXT_bindable_uniform(load); - load_GL_KHR_blend_equation_advanced(load); - load_GL_ATI_element_array(load); - load_GL_SGIX_reference_plane(load); - load_GL_EXT_stencil_two_side(load); - load_GL_NV_explicit_multisample(load); - load_GL_IBM_static_data(load); - load_GL_EXT_texture_perturb_normal(load); - load_GL_EXT_point_parameters(load); - load_GL_PGI_misc_hints(load); - load_GL_ARB_vertex_shader(load); - load_GL_ARB_tessellation_shader(load); - load_GL_EXT_draw_buffers2(load); - load_GL_ARB_vertex_attrib_64bit(load); - load_GL_EXT_texture_filter_minmax(load); - load_GL_AMD_interleaved_elements(load); - load_GL_ARB_fragment_program(load); - load_GL_ARB_texture_storage(load); - load_GL_ARB_copy_image(load); - load_GL_SGIS_pixel_texture(load); - load_GL_SGIX_instruments(load); - load_GL_ARB_shader_storage_buffer_object(load); - load_GL_EXT_blend_minmax(load); - load_GL_ARB_base_instance(load); - load_GL_ARB_ES3_1_compatibility(load); - load_GL_EXT_texture_integer(load); - load_GL_ARB_texture_multisample(load); - load_GL_AMD_gpu_shader_int64(load); - load_GL_AMD_vertex_shader_tessellator(load); - load_GL_ARB_invalidate_subdata(load); - load_GL_EXT_index_material(load); - load_GL_INTEL_parallel_arrays(load); - load_GL_ATI_draw_buffers(load); - load_GL_SGIX_pixel_texture(load); - load_GL_ARB_timer_query(load); - load_GL_NV_parameter_buffer_object(load); - load_GL_ARB_direct_state_access(load); - load_GL_ARB_uniform_buffer_object(load); - load_GL_NV_transform_feedback2(load); - load_GL_EXT_blend_color(load); - load_GL_EXT_histogram(load); - load_GL_ARB_get_texture_sub_image(load); - load_GL_SGIS_point_parameters(load); - load_GL_EXT_direct_state_access(load); - load_GL_AMD_sample_positions(load); - load_GL_NV_vertex_program(load); - load_GL_EXT_vertex_shader(load); - load_GL_EXT_blend_func_separate(load); - load_GL_APPLE_fence(load); - load_GL_OES_byte_coordinates(load); - load_GL_ARB_transpose_matrix(load); - load_GL_ARB_provoking_vertex(load); - load_GL_EXT_fog_coord(load); - load_GL_EXT_vertex_array(load); - load_GL_EXT_blend_equation_separate(load); - load_GL_NV_framebuffer_mixed_samples(load); - load_GL_NVX_conditional_render(load); - load_GL_ARB_multi_draw_indirect(load); - load_GL_EXT_raster_multisample(load); - load_GL_NV_copy_image(load); - load_GL_INTEL_framebuffer_CMAA(load); - load_GL_ARB_transform_feedback2(load); - load_GL_ARB_transform_feedback3(load); - load_GL_EXT_debug_marker(load); - load_GL_EXT_pixel_transform(load); - load_GL_ATI_fragment_shader(load); - load_GL_ARB_vertex_array_object(load); - load_GL_SUN_triangle_list(load); - load_GL_ARB_transform_feedback_instanced(load); - load_GL_SGIX_async(load); - load_GL_INTEL_performance_query(load); - load_GL_NV_gpu_shader5(load); - load_GL_NV_bindless_multi_draw_indirect_count(load); - load_GL_ARB_ES2_compatibility(load); - load_GL_ARB_indirect_parameters(load); - load_GL_NV_half_float(load); - load_GL_ARB_ES3_2_compatibility(load); - load_GL_EXT_polygon_offset_clamp(load); - load_GL_EXT_compiled_vertex_array(load); - load_GL_NV_depth_buffer_float(load); - load_GL_NV_occlusion_query(load); - load_GL_APPLE_flush_buffer_range(load); - load_GL_ARB_imaging(load); - load_GL_ARB_draw_buffers_blend(load); - load_GL_ARB_clear_buffer_object(load); - load_GL_ARB_multisample(load); - load_GL_EXT_debug_label(load); - load_GL_ARB_sample_shading(load); - load_GL_NV_internalformat_sample_query(load); - load_GL_INTEL_map_texture(load); - load_GL_ARB_compute_shader(load); - load_GL_IBM_vertex_array_lists(load); - load_GL_ARB_color_buffer_float(load); - load_GL_ARB_bindless_texture(load); - load_GL_ARB_window_pos(load); - load_GL_ARB_internalformat_query(load); - load_GL_EXT_shader_image_load_store(load); - load_GL_EXT_copy_texture(load); - load_GL_NV_register_combiners2(load); - load_GL_NV_draw_texture(load); - load_GL_EXT_draw_instanced(load); - load_GL_ARB_viewport_array(load); - load_GL_ARB_separate_shader_objects(load); - load_GL_EXT_depth_bounds_test(load); - load_GL_NV_video_capture(load); - load_GL_ARB_sampler_objects(load); - load_GL_ARB_matrix_palette(load); - load_GL_SGIS_texture_color_mask(load); - load_GL_EXT_coordinate_frame(load); - load_GL_ARB_texture_compression(load); - load_GL_ARB_shader_subroutine(load); - load_GL_ARB_texture_storage_multisample(load); - load_GL_EXT_vertex_attrib_64bit(load); - load_GL_OES_query_matrix(load); - load_GL_MESA_window_pos(load); - load_GL_ARB_copy_buffer(load); - load_GL_APPLE_object_purgeable(load); - load_GL_ARB_occlusion_query(load); - load_GL_SGI_color_table(load); - load_GL_EXT_gpu_shader4(load); - load_GL_NV_geometry_program4(load); - load_GL_AMD_debug_output(load); - load_GL_ARB_multitexture(load); - load_GL_SGIX_polynomial_ffd(load); - load_GL_EXT_provoking_vertex(load); - load_GL_ARB_point_parameters(load); - load_GL_ARB_shader_image_load_store(load); - load_GL_ARB_texture_barrier(load); - load_GL_NV_bindless_multi_draw_indirect(load); - load_GL_EXT_transform_feedback(load); - load_GL_NV_gpu_program4(load); - load_GL_NV_gpu_program5(load); - load_GL_ARB_geometry_shader4(load); - load_GL_NV_conservative_raster(load); - load_GL_SGIX_sprite(load); - load_GL_ARB_get_program_binary(load); - load_GL_AMD_occlusion_query_event(load); - load_GL_SGIS_multisample(load); - load_GL_EXT_framebuffer_object(load); - load_GL_APPLE_vertex_array_range(load); - load_GL_NV_register_combiners(load); - load_GL_ARB_draw_buffers(load); - load_GL_ARB_clear_texture(load); - load_GL_ARB_debug_output(load); - load_GL_EXT_cull_vertex(load); - load_GL_IBM_multimode_draw_arrays(load); - load_GL_APPLE_vertex_array_object(load); - load_GL_SGIS_detail_texture(load); - load_GL_ARB_draw_instanced(load); - load_GL_ARB_shading_language_include(load); - load_GL_INGR_blend_func_separate(load); - load_GL_NV_path_rendering(load); - load_GL_NV_conservative_raster_dilate(load); - load_GL_ATI_vertex_streams(load); - load_GL_ARB_gpu_shader_int64(load); - load_GL_NV_vdpau_interop(load); - load_GL_ARB_internalformat_query2(load); - load_GL_SUN_vertex(load); - load_GL_SGIX_igloo_interface(load); - load_GL_ARB_draw_indirect(load); - load_GL_NV_vertex_program4(load); - load_GL_SGIS_fog_function(load); - load_GL_EXT_x11_sync_object(load); - load_GL_ARB_sync(load); - load_GL_NV_sample_locations(load); - load_GL_ARB_compute_variable_group_size(load); - load_GL_OES_fixed_point(load); - load_GL_EXT_framebuffer_multisample(load); - load_GL_SGIS_texture4D(load); - load_GL_EXT_texture3D(load); - load_GL_EXT_multisample(load); - load_GL_EXT_secondary_color(load); - load_GL_ATI_vertex_array_object(load); - load_GL_ARB_parallel_shader_compile(load); - load_GL_ARB_sparse_texture(load); - load_GL_ARB_sample_locations(load); - load_GL_ARB_sparse_buffer(load); - load_GL_EXT_draw_range_elements(load); - return GLVersion.major != 0 || GLVersion.minor != 0; -} - diff --git a/src/glad.h b/src/glad.h deleted file mode 100644 index 56bb622d..00000000 --- a/src/glad.h +++ /dev/null @@ -1,14241 +0,0 @@ -/* - - OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. - - Language/Generator: C/C++ - Specification: gl - APIs: gl=3.3 - Profile: core - Extensions: - GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control - Loader: No - - Commandline: - --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" - Online: - Too many extensions -*/ - - -#ifndef __glad_h_ -#define __glad_h_ - -#ifdef __gl_h_ -#error OpenGL header already included, remove this include, glad already provides it -#endif -#define __gl_h_ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -//#include -#define APIENTRY __stdcall // RAY: Added -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -struct gladGLversionStruct { - int major; - int minor; -}; - -typedef void* (* GLADloadproc)(const char *name); - -#ifndef GLAPI -# if defined(GLAD_GLAPI_EXPORT) -# if defined(WIN32) || defined(__CYGWIN__) -# if defined(GLAD_GLAPI_EXPORT_BUILD) -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllexport)) extern -# else -# define GLAPI __declspec(dllexport) extern -# endif -# else -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllimport)) extern -# else -# define GLAPI __declspec(dllimport) extern -# endif -# endif -# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) -# define GLAPI __attribute__ ((visibility ("default"))) extern -# else -# define GLAPI extern -# endif -# else -# define GLAPI extern -# endif -#endif - -GLAPI struct gladGLversionStruct GLVersion; -GLAPI int gladLoadGLLoader(GLADloadproc); - -#include -//#include // RAY: Not required -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLclampx; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef int GLsizei; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void *GLeglImageOES; -typedef char GLchar; -typedef char GLcharARB; -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef unsigned short GLhalfARB; -typedef unsigned short GLhalf; -typedef GLint GLfixed; -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -typedef int64_t GLint64; -typedef uint64_t GLuint64; -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -typedef struct __GLsync *GLsync; -struct _cl_context; -struct _cl_event; -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -typedef unsigned short GLhalfNV; -typedef GLintptr GLvdpauSurfaceNV; -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_FALSE 0 -#define GL_TRUE 1 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_NONE 0 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_VIEWPORT 0x0BA2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_DOUBLE 0x140A -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_REPEAT 0x2901 -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_COLOR_ATTACHMENT16 0x8CF0 -#define GL_COLOR_ATTACHMENT17 0x8CF1 -#define GL_COLOR_ATTACHMENT18 0x8CF2 -#define GL_COLOR_ATTACHMENT19 0x8CF3 -#define GL_COLOR_ATTACHMENT20 0x8CF4 -#define GL_COLOR_ATTACHMENT21 0x8CF5 -#define GL_COLOR_ATTACHMENT22 0x8CF6 -#define GL_COLOR_ATTACHMENT23 0x8CF7 -#define GL_COLOR_ATTACHMENT24 0x8CF8 -#define GL_COLOR_ATTACHMENT25 0x8CF9 -#define GL_COLOR_ATTACHMENT26 0x8CFA -#define GL_COLOR_ATTACHMENT27 0x8CFB -#define GL_COLOR_ATTACHMENT28 0x8CFC -#define GL_COLOR_ATTACHMENT29 0x8CFD -#define GL_COLOR_ATTACHMENT30 0x8CFE -#define GL_COLOR_ATTACHMENT31 0x8CFF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFF -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_RGB10_A2UI 0x906F -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 -#define GL_INT_2_10_10_10_REV 0x8D9F -#ifndef GL_VERSION_1_0 -#define GL_VERSION_1_0 1 -GLAPI int GLAD_GL_VERSION_1_0; -typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); -GLAPI PFNGLCULLFACEPROC glad_glCullFace; -#define glCullFace glad_glCullFace -typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); -GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; -#define glFrontFace glad_glFrontFace -typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); -GLAPI PFNGLHINTPROC glad_glHint; -#define glHint glad_glHint -typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); -GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; -#define glLineWidth glad_glLineWidth -typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); -GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; -#define glPointSize glad_glPointSize -typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); -GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; -#define glPolygonMode glad_glPolygonMode -typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLSCISSORPROC glad_glScissor; -#define glScissor glad_glScissor -typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -#define glTexParameterf glad_glTexParameterf -typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -#define glTexParameterfv glad_glTexParameterfv -typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -#define glTexParameteri glad_glTexParameteri -typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -#define glTexParameteriv glad_glTexParameteriv -typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -#define glTexImage1D glad_glTexImage1D -typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -#define glTexImage2D glad_glTexImage2D -typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); -GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -#define glDrawBuffer glad_glDrawBuffer -typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); -GLAPI PFNGLCLEARPROC glad_glClear; -#define glClear glad_glClear -typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; -#define glClearColor glad_glClearColor -typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); -GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; -#define glClearStencil glad_glClearStencil -typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); -GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; -#define glClearDepth glad_glClearDepth -typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); -GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; -#define glStencilMask glad_glStencilMask -typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI PFNGLCOLORMASKPROC glad_glColorMask; -#define glColorMask glad_glColorMask -typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); -GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; -#define glDepthMask glad_glDepthMask -typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); -GLAPI PFNGLDISABLEPROC glad_glDisable; -#define glDisable glad_glDisable -typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); -GLAPI PFNGLENABLEPROC glad_glEnable; -#define glEnable glad_glEnable -typedef void (APIENTRYP PFNGLFINISHPROC)(); -GLAPI PFNGLFINISHPROC glad_glFinish; -#define glFinish glad_glFinish -typedef void (APIENTRYP PFNGLFLUSHPROC)(); -GLAPI PFNGLFLUSHPROC glad_glFlush; -#define glFlush glad_glFlush -typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); -GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; -#define glBlendFunc glad_glBlendFunc -typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); -GLAPI PFNGLLOGICOPPROC glad_glLogicOp; -#define glLogicOp glad_glLogicOp -typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; -#define glStencilFunc glad_glStencilFunc -typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); -GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; -#define glStencilOp glad_glStencilOp -typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); -GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; -#define glDepthFunc glad_glDepthFunc -typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; -#define glPixelStoref glad_glPixelStoref -typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; -#define glPixelStorei glad_glPixelStorei -typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); -GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; -#define glReadBuffer glad_glReadBuffer -typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; -#define glReadPixels glad_glReadPixels -typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean* data); -GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -#define glGetBooleanv glad_glGetBooleanv -typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble* data); -GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; -#define glGetDoublev glad_glGetDoublev -typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); -GLAPI PFNGLGETERRORPROC glad_glGetError; -#define glGetError glad_glGetError -typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat* data); -GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; -#define glGetFloatv glad_glGetFloatv -typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint* data); -GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; -#define glGetIntegerv glad_glGetIntegerv -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); -GLAPI PFNGLGETSTRINGPROC glad_glGetString; -#define glGetString glad_glGetString -typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -#define glGetTexImage glad_glGetTexImage -typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -#define glGetTexParameterfv glad_glGetTexParameterfv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -#define glGetTexParameteriv glad_glGetTexParameteriv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv -typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); -GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; -#define glIsEnabled glad_glIsEnabled -typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far); -GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; -#define glDepthRange glad_glDepthRange -typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLVIEWPORTPROC glad_glViewport; -#define glViewport glad_glViewport -#endif -#ifndef GL_VERSION_1_1 -#define GL_VERSION_1_1 1 -GLAPI int GLAD_GL_VERSION_1_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; -#define glDrawArrays glad_glDrawArrays -typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; -#define glDrawElements glad_glDrawElements -typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); -GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -#define glPolygonOffset glad_glPolygonOffset -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -#define glCopyTexImage1D glad_glCopyTexImage1D -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -#define glCopyTexImage2D glad_glCopyTexImage2D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -#define glCopyTexSubImage1D glad_glCopyTexSubImage1D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -#define glCopyTexSubImage2D glad_glCopyTexSubImage2D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -#define glTexSubImage1D glad_glTexSubImage1D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -#define glTexSubImage2D glad_glTexSubImage2D -typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); -GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; -#define glBindTexture glad_glBindTexture -typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint* textures); -GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -#define glDeleteTextures glad_glDeleteTextures -typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint* textures); -GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; -#define glGenTextures glad_glGenTextures -typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); -GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; -#define glIsTexture glad_glIsTexture -#endif -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -GLAPI int GLAD_GL_VERSION_1_2; -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -#define glDrawRangeElements glad_glDrawRangeElements -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -#define glTexImage3D glad_glTexImage3D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -#define glTexSubImage3D glad_glTexSubImage3D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -#define glCopyTexSubImage3D glad_glCopyTexSubImage3D -#endif -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -GLAPI int GLAD_GL_VERSION_1_3; -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); -GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -#define glActiveTexture glad_glActiveTexture -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -#define glSampleCoverage glad_glSampleCoverage -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -#define glCompressedTexImage3D glad_glCompressedTexImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -#define glCompressedTexImage2D glad_glCompressedTexImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -#define glCompressedTexImage1D glad_glCompressedTexImage1D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -#define glGetCompressedTexImage glad_glGetCompressedTexImage -#endif -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -GLAPI int GLAD_GL_VERSION_1_4; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -#define glBlendFuncSeparate glad_glBlendFuncSeparate -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei drawcount); -GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -#define glMultiDrawArrays glad_glMultiDrawArrays -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount); -GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -#define glMultiDrawElements glad_glMultiDrawElements -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -#define glPointParameterf glad_glPointParameterf -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -#define glPointParameterfv glad_glPointParameterfv -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -#define glPointParameteri glad_glPointParameteri -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -#define glPointParameteriv glad_glPointParameteriv -typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; -#define glBlendColor glad_glBlendColor -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); -GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -#define glBlendEquation glad_glBlendEquation -#endif -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -GLAPI int GLAD_GL_VERSION_1_5; -typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; -#define glGenQueries glad_glGenQueries -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -#define glDeleteQueries glad_glDeleteQueries -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); -GLAPI PFNGLISQUERYPROC glad_glIsQuery; -#define glIsQuery glad_glIsQuery -typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); -GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; -#define glBeginQuery glad_glBeginQuery -typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); -GLAPI PFNGLENDQUERYPROC glad_glEndQuery; -#define glEndQuery glad_glEndQuery -typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; -#define glGetQueryiv glad_glGetQueryiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -#define glGetQueryObjectiv glad_glGetQueryObjectiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -#define glGetQueryObjectuiv glad_glGetQueryObjectuiv -typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); -GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; -#define glBindBuffer glad_glBindBuffer -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint* buffers); -GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -#define glDeleteBuffers glad_glDeleteBuffers -typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; -#define glGenBuffers glad_glGenBuffers -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); -GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; -#define glIsBuffer glad_glIsBuffer -typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; -#define glBufferData glad_glBufferData -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -#define glBufferSubData glad_glBufferSubData -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -#define glGetBufferSubData glad_glGetBufferSubData -typedef void* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; -#define glMapBuffer glad_glMapBuffer -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); -GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -#define glUnmapBuffer glad_glUnmapBuffer -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -#define glGetBufferParameteriv glad_glGetBufferParameteriv -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -#define glGetBufferPointerv glad_glGetBufferPointerv -#endif -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -GLAPI int GLAD_GL_VERSION_2_0; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -#define glBlendEquationSeparate glad_glBlendEquationSeparate -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -#define glDrawBuffers glad_glDrawBuffers -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -#define glStencilOpSeparate glad_glStencilOpSeparate -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -#define glStencilFuncSeparate glad_glStencilFuncSeparate -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); -GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -#define glStencilMaskSeparate glad_glStencilMaskSeparate -typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); -GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; -#define glAttachShader glad_glAttachShader -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar* name); -GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -#define glBindAttribLocation glad_glBindAttribLocation -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); -GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; -#define glCompileShader glad_glCompileShader -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); -GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -#define glCreateProgram glad_glCreateProgram -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); -GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; -#define glCreateShader glad_glCreateShader -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); -GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -#define glDeleteProgram glad_glDeleteProgram -typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); -GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; -#define glDeleteShader glad_glDeleteShader -typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); -GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; -#define glDetachShader glad_glDetachShader -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -#define glDisableVertexAttribArray glad_glDisableVertexAttribArray -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -#define glEnableVertexAttribArray glad_glEnableVertexAttribArray -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -#define glGetActiveAttrib glad_glGetActiveAttrib -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -#define glGetActiveUniform glad_glGetActiveUniform -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); -GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -#define glGetAttachedShaders glad_glGetAttachedShaders -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -#define glGetAttribLocation glad_glGetAttribLocation -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -#define glGetProgramiv glad_glGetProgramiv -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -#define glGetProgramInfoLog glad_glGetProgramInfoLog -typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint* params); -GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; -#define glGetShaderiv glad_glGetShaderiv -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -#define glGetShaderInfoLog glad_glGetShaderInfoLog -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* source); -GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -#define glGetShaderSource glad_glGetShaderSource -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -#define glGetUniformLocation glad_glGetUniformLocation -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat* params); -GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -#define glGetUniformfv glad_glGetUniformfv -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint* params); -GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -#define glGetUniformiv glad_glGetUniformiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -#define glGetVertexAttribdv glad_glGetVertexAttribdv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -#define glGetVertexAttribfv glad_glGetVertexAttribfv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -#define glGetVertexAttribiv glad_glGetVertexAttribiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); -GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; -#define glIsProgram glad_glIsProgram -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); -GLAPI PFNGLISSHADERPROC glad_glIsShader; -#define glIsShader glad_glIsShader -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); -GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; -#define glLinkProgram glad_glLinkProgram -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length); -GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; -#define glShaderSource glad_glShaderSource -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); -GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; -#define glUseProgram glad_glUseProgram -typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); -GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; -#define glUniform1f glad_glUniform1f -typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; -#define glUniform2f glad_glUniform2f -typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; -#define glUniform3f glad_glUniform3f -typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; -#define glUniform4f glad_glUniform4f -typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); -GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; -#define glUniform1i glad_glUniform1i -typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); -GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; -#define glUniform2i glad_glUniform2i -typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; -#define glUniform3i glad_glUniform3i -typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; -#define glUniform4i glad_glUniform4i -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; -#define glUniform1fv glad_glUniform1fv -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; -#define glUniform2fv glad_glUniform2fv -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; -#define glUniform3fv glad_glUniform3fv -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; -#define glUniform4fv glad_glUniform4fv -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; -#define glUniform1iv glad_glUniform1iv -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; -#define glUniform2iv glad_glUniform2iv -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; -#define glUniform3iv glad_glUniform3iv -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; -#define glUniform4iv glad_glUniform4iv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -#define glUniformMatrix2fv glad_glUniformMatrix2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -#define glUniformMatrix3fv glad_glUniformMatrix3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -#define glUniformMatrix4fv glad_glUniformMatrix4fv -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); -GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -#define glValidateProgram glad_glValidateProgram -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -#define glVertexAttrib1d glad_glVertexAttrib1d -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -#define glVertexAttrib1dv glad_glVertexAttrib1dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -#define glVertexAttrib1f glad_glVertexAttrib1f -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -#define glVertexAttrib1fv glad_glVertexAttrib1fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -#define glVertexAttrib1s glad_glVertexAttrib1s -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -#define glVertexAttrib1sv glad_glVertexAttrib1sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -#define glVertexAttrib2d glad_glVertexAttrib2d -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -#define glVertexAttrib2dv glad_glVertexAttrib2dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -#define glVertexAttrib2f glad_glVertexAttrib2f -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -#define glVertexAttrib2fv glad_glVertexAttrib2fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -#define glVertexAttrib2s glad_glVertexAttrib2s -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -#define glVertexAttrib2sv glad_glVertexAttrib2sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -#define glVertexAttrib3d glad_glVertexAttrib3d -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -#define glVertexAttrib3dv glad_glVertexAttrib3dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -#define glVertexAttrib3f glad_glVertexAttrib3f -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -#define glVertexAttrib3fv glad_glVertexAttrib3fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -#define glVertexAttrib3s glad_glVertexAttrib3s -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -#define glVertexAttrib3sv glad_glVertexAttrib3sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -#define glVertexAttrib4Niv glad_glVertexAttrib4Niv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -#define glVertexAttrib4Nub glad_glVertexAttrib4Nub -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -#define glVertexAttrib4bv glad_glVertexAttrib4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -#define glVertexAttrib4d glad_glVertexAttrib4d -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -#define glVertexAttrib4dv glad_glVertexAttrib4dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -#define glVertexAttrib4f glad_glVertexAttrib4f -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -#define glVertexAttrib4fv glad_glVertexAttrib4fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -#define glVertexAttrib4iv glad_glVertexAttrib4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -#define glVertexAttrib4s glad_glVertexAttrib4s -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -#define glVertexAttrib4sv glad_glVertexAttrib4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -#define glVertexAttrib4ubv glad_glVertexAttrib4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -#define glVertexAttrib4uiv glad_glVertexAttrib4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -#define glVertexAttrib4usv glad_glVertexAttrib4usv -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -#define glVertexAttribPointer glad_glVertexAttribPointer -#endif -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -GLAPI int GLAD_GL_VERSION_2_1; -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv -#endif -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -GLAPI int GLAD_GL_VERSION_3_0; -typedef void (APIENTRYP PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI PFNGLCOLORMASKIPROC glad_glColorMaski; -#define glColorMaski glad_glColorMaski -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean* data); -GLAPI PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -#define glGetBooleani_v glad_glGetBooleani_v -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint* data); -GLAPI PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -#define glGetIntegeri_v glad_glGetIntegeri_v -typedef void (APIENTRYP PFNGLENABLEIPROC)(GLenum target, GLuint index); -GLAPI PFNGLENABLEIPROC glad_glEnablei; -#define glEnablei glad_glEnablei -typedef void (APIENTRYP PFNGLDISABLEIPROC)(GLenum target, GLuint index); -GLAPI PFNGLDISABLEIPROC glad_glDisablei; -#define glDisablei glad_glDisablei -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC)(GLenum target, GLuint index); -GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; -#define glIsEnabledi glad_glIsEnabledi -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -#define glBeginTransformFeedback glad_glBeginTransformFeedback -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -#define glEndTransformFeedback glad_glEndTransformFeedback -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -#define glBindBufferRange glad_glBindBufferRange -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -#define glBindBufferBase glad_glBindBufferBase -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp); -GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; -#define glClampColor glad_glClampColor -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); -GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -#define glBeginConditionalRender glad_glBeginConditionalRender -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -#define glEndConditionalRender glad_glEndConditionalRender -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -#define glVertexAttribIPointer glad_glVertexAttribIPointer -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -#define glGetVertexAttribIiv glad_glGetVertexAttribIiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint* params); -GLAPI PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x); -GLAPI PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -#define glVertexAttribI1i glad_glVertexAttribI1i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y); -GLAPI PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -#define glVertexAttribI2i glad_glVertexAttribI2i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -#define glVertexAttribI3i glad_glVertexAttribI3i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -#define glVertexAttribI4i glad_glVertexAttribI4i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x); -GLAPI PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -#define glVertexAttribI1ui glad_glVertexAttribI1ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y); -GLAPI PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -#define glVertexAttribI2ui glad_glVertexAttribI2ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -#define glVertexAttribI3ui glad_glVertexAttribI3ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -#define glVertexAttribI4ui glad_glVertexAttribI4ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -#define glVertexAttribI1iv glad_glVertexAttribI1iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -#define glVertexAttribI2iv glad_glVertexAttribI2iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -#define glVertexAttribI3iv glad_glVertexAttribI3iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -#define glVertexAttribI4iv glad_glVertexAttribI4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -#define glVertexAttribI1uiv glad_glVertexAttribI1uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -#define glVertexAttribI2uiv glad_glVertexAttribI2uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -#define glVertexAttribI3uiv glad_glVertexAttribI3uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -#define glVertexAttribI4uiv glad_glVertexAttribI4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -#define glVertexAttribI4bv glad_glVertexAttribI4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -#define glVertexAttribI4sv glad_glVertexAttribI4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -#define glVertexAttribI4ubv glad_glVertexAttribI4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -#define glVertexAttribI4usv glad_glVertexAttribI4usv -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -#define glGetUniformuiv glad_glGetUniformuiv -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -#define glBindFragDataLocation glad_glBindFragDataLocation -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -#define glGetFragDataLocation glad_glGetFragDataLocation -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0); -GLAPI PFNGLUNIFORM1UIPROC glad_glUniform1ui; -#define glUniform1ui glad_glUniform1ui -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLUNIFORM2UIPROC glad_glUniform2ui; -#define glUniform2ui glad_glUniform2ui -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLUNIFORM3UIPROC glad_glUniform3ui; -#define glUniform3ui glad_glUniform3ui -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLUNIFORM4UIPROC glad_glUniform4ui; -#define glUniform4ui glad_glUniform4ui -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -#define glUniform1uiv glad_glUniform1uiv -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -#define glUniform2uiv glad_glUniform2uiv -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -#define glUniform3uiv glad_glUniform3uiv -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -#define glUniform4uiv glad_glUniform4uiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -#define glTexParameterIiv glad_glTexParameterIiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -#define glTexParameterIuiv glad_glTexParameterIuiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -#define glGetTexParameterIiv glad_glGetTexParameterIiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -#define glGetTexParameterIuiv glad_glGetTexParameterIuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint* value); -GLAPI PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -#define glClearBufferiv glad_glClearBufferiv -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint* value); -GLAPI PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -#define glClearBufferuiv glad_glClearBufferuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat* value); -GLAPI PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -#define glClearBufferfv glad_glClearBufferfv -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -#define glClearBufferfi glad_glClearBufferfi -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum name, GLuint index); -GLAPI PFNGLGETSTRINGIPROC glad_glGetStringi; -#define glGetStringi glad_glGetStringi -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); -GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -#define glIsRenderbuffer glad_glIsRenderbuffer -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -#define glBindRenderbuffer glad_glBindRenderbuffer -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint* renderbuffers); -GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -#define glDeleteRenderbuffers glad_glDeleteRenderbuffers -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -#define glGenRenderbuffers glad_glGenRenderbuffers -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -#define glRenderbufferStorage glad_glRenderbufferStorage -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); -GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -#define glIsFramebuffer glad_glIsFramebuffer -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); -GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -#define glBindFramebuffer glad_glBindFramebuffer -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint* framebuffers); -GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -#define glDeleteFramebuffers glad_glDeleteFramebuffers -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -#define glGenFramebuffers glad_glGenFramebuffers -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -#define glCheckFramebufferStatus glad_glCheckFramebufferStatus -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -#define glFramebufferTexture1D glad_glFramebufferTexture1D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -#define glFramebufferTexture2D glad_glFramebufferTexture2D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -#define glFramebufferTexture3D glad_glFramebufferTexture3D -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum target); -GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -#define glGenerateMipmap glad_glGenerateMipmap -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -#define glBlitFramebuffer glad_glBlitFramebuffer -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -#define glFramebufferTextureLayer glad_glFramebufferTextureLayer -typedef void* (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -#define glMapBufferRange glad_glMapBufferRange -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -#define glFlushMappedBufferRange glad_glFlushMappedBufferRange -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC)(GLuint array); -GLAPI PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -#define glBindVertexArray glad_glBindVertexArray -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint* arrays); -GLAPI PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -#define glDeleteVertexArrays glad_glDeleteVertexArrays -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -#define glGenVertexArrays glad_glGenVertexArrays -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint array); -GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -#define glIsVertexArray glad_glIsVertexArray -#endif -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -GLAPI int GLAD_GL_VERSION_3_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -#define glDrawArraysInstanced glad_glDrawArraysInstanced -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -#define glDrawElementsInstanced glad_glDrawElementsInstanced -typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer; -#define glTexBuffer glad_glTexBuffer -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index); -GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -#define glCopyBufferSubData glad_glCopyBufferSubData -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); -GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -#define glGetUniformIndices glad_glGetUniformIndices -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -#define glGetActiveUniformsiv glad_glGetActiveUniformsiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); -GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -#define glGetActiveUniformName glad_glGetActiveUniformName -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar* uniformBlockName); -GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -#define glGetUniformBlockIndex glad_glGetUniformBlockIndex -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -#define glUniformBlockBinding glad_glUniformBlockBinding -#endif -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -GLAPI int GLAD_GL_VERSION_3_2; -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLint basevertex); -GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices, GLint basevertex); -GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawcount, const GLint* basevertex); -GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum mode); -GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -#define glProvokingVertex glad_glProvokingVertex -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags); -GLAPI PFNGLFENCESYNCPROC glad_glFenceSync; -#define glFenceSync glad_glFenceSync -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync); -GLAPI PFNGLISSYNCPROC glad_glIsSync; -#define glIsSync glad_glIsSync -typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync); -GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync; -#define glDeleteSync glad_glDeleteSync -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -#define glClientWaitSync glad_glClientWaitSync -typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; -#define glWaitSync glad_glWaitSync -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64* data); -GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -#define glGetInteger64v glad_glGetInteger64v -typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); -GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; -#define glGetSynciv glad_glGetSynciv -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64* data); -GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -#define glGetInteger64i_v glad_glGetInteger64i_v -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64* params); -GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -#define glGetBufferParameteri64v glad_glGetBufferParameteri64v -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -#define glFramebufferTexture glad_glFramebufferTexture -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -#define glTexImage2DMultisample glad_glTexImage2DMultisample -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -#define glTexImage3DMultisample glad_glTexImage3DMultisample -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat* val); -GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -#define glGetMultisamplefv glad_glGetMultisamplefv -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask); -GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -#define glSampleMaski glad_glSampleMaski -#endif -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 -GLAPI int GLAD_GL_VERSION_3_3; -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed -typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -#define glGetFragDataIndex glad_glGetFragDataIndex -typedef void (APIENTRYP PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint* samplers); -GLAPI PFNGLGENSAMPLERSPROC glad_glGenSamplers; -#define glGenSamplers glad_glGenSamplers -typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint* samplers); -GLAPI PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -#define glDeleteSamplers glad_glDeleteSamplers -typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC)(GLuint sampler); -GLAPI PFNGLISSAMPLERPROC glad_glIsSampler; -#define glIsSampler glad_glIsSampler -typedef void (APIENTRYP PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler); -GLAPI PFNGLBINDSAMPLERPROC glad_glBindSampler; -#define glBindSampler glad_glBindSampler -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param); -GLAPI PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -#define glSamplerParameteri glad_glSamplerParameteri -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint* param); -GLAPI PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -#define glSamplerParameteriv glad_glSamplerParameteriv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param); -GLAPI PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -#define glSamplerParameterf glad_glSamplerParameterf -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat* param); -GLAPI PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -#define glSamplerParameterfv glad_glSamplerParameterfv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint* param); -GLAPI PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -#define glSamplerParameterIiv glad_glSamplerParameterIiv -typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint* param); -GLAPI PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -#define glSamplerParameterIuiv glad_glSamplerParameterIuiv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -#define glGetSamplerParameteriv glad_glGetSamplerParameteriv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat* params); -GLAPI PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -#define glGetSamplerParameterfv glad_glGetSamplerParameterfv -typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint* params); -GLAPI PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv -typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target); -GLAPI PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -#define glQueryCounter glad_glQueryCounter -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64* params); -GLAPI PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -#define glGetQueryObjecti64v glad_glGetQueryObjecti64v -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64* params); -GLAPI PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -#define glGetQueryObjectui64v glad_glGetQueryObjectui64v -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -#define glVertexAttribDivisor glad_glVertexAttribDivisor -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -#define glVertexAttribP1ui glad_glVertexAttribP1ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -#define glVertexAttribP1uiv glad_glVertexAttribP1uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -#define glVertexAttribP2ui glad_glVertexAttribP2ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -#define glVertexAttribP2uiv glad_glVertexAttribP2uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -#define glVertexAttribP3ui glad_glVertexAttribP3ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -#define glVertexAttribP3uiv glad_glVertexAttribP3uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -GLAPI PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -#define glVertexAttribP4ui glad_glVertexAttribP4ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -GLAPI PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -#define glVertexAttribP4uiv glad_glVertexAttribP4uiv -typedef void (APIENTRYP PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -#define glVertexP2ui glad_glVertexP2ui -typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -#define glVertexP2uiv glad_glVertexP2uiv -typedef void (APIENTRYP PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -#define glVertexP3ui glad_glVertexP3ui -typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -#define glVertexP3uiv glad_glVertexP3uiv -typedef void (APIENTRYP PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value); -GLAPI PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -#define glVertexP4ui glad_glVertexP4ui -typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint* value); -GLAPI PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -#define glVertexP4uiv glad_glVertexP4uiv -typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -#define glTexCoordP1ui glad_glTexCoordP1ui -typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -#define glTexCoordP1uiv glad_glTexCoordP1uiv -typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -#define glTexCoordP2ui glad_glTexCoordP2ui -typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -#define glTexCoordP2uiv glad_glTexCoordP2uiv -typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -#define glTexCoordP3ui glad_glTexCoordP3ui -typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -#define glTexCoordP3uiv glad_glTexCoordP3uiv -typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -#define glTexCoordP4ui glad_glTexCoordP4ui -typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -#define glTexCoordP4uiv glad_glTexCoordP4uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords); -GLAPI PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui -typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint* coords); -GLAPI PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv -typedef void (APIENTRYP PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords); -GLAPI PFNGLNORMALP3UIPROC glad_glNormalP3ui; -#define glNormalP3ui glad_glNormalP3ui -typedef void (APIENTRYP PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint* coords); -GLAPI PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -#define glNormalP3uiv glad_glNormalP3uiv -typedef void (APIENTRYP PFNGLCOLORP3UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLCOLORP3UIPROC glad_glColorP3ui; -#define glColorP3ui glad_glColorP3ui -typedef void (APIENTRYP PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -#define glColorP3uiv glad_glColorP3uiv -typedef void (APIENTRYP PFNGLCOLORP4UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLCOLORP4UIPROC glad_glColorP4ui; -#define glColorP4ui glad_glColorP4ui -typedef void (APIENTRYP PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -#define glColorP4uiv glad_glColorP4uiv -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color); -GLAPI PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -#define glSecondaryColorP3ui glad_glSecondaryColorP3ui -typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint* color); -GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv -#endif -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F -#define GL_IS_PER_PATCH 0x92E7 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B -#define GL_SAMPLES_ARB 0x80A9 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#define GL_DEPTH_CLAMP_NV 0x864F -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#define GL_EYE_PLANE 0x2502 -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#define GL_WRAP_BORDER_SUN 0x81D4 -#define GL_HALF_FLOAT_ARB 0x140B -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 -#define GL_NOP_COMMAND_NV 0x0001 -#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 -#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 -#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 -#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 -#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 -#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 -#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 -#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 -#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A -#define GL_BLEND_COLOR_COMMAND_NV 0x000B -#define GL_STENCIL_REF_COMMAND_NV 0x000C -#define GL_LINE_WIDTH_COMMAND_NV 0x000D -#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E -#define GL_ALPHA_REF_COMMAND_NV 0x000F -#define GL_VIEWPORT_COMMAND_NV 0x0010 -#define GL_SCISSOR_COMMAND_NV 0x0011 -#define GL_FRONT_FACE_COMMAND_NV 0x0012 -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#define GL_INTERLACE_READ_INGR 0x8568 -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET 0x8252 -#define GL_GUILTY_CONTEXT_RESET 0x8253 -#define GL_INNOCENT_CONTEXT_RESET 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 -#define GL_NO_RESET_NOTIFICATION 0x8261 -#define GL_CONTEXT_LOST 0x0507 -#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 -#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 -#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 -#define GL_CONTEXT_LOST_KHR 0x0507 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -#define GL_NEGATIVE_ONE_TO_ONE 0x935E -#define GL_ZERO_TO_ONE 0x935F -#define GL_CLIP_ORIGIN 0x935C -#define GL_CLIP_DEPTH_MODE 0x935D -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#define GL_MAP_PERSISTENT_BIT 0x0040 -#define GL_MAP_COHERENT_BIT 0x0080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 -#define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_SHARED_EDGE_NV 0xC0 -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#define GL_LIST_PRIORITY_SGIX 0x8182 -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E -#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F -#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#define GL_VERTICES_SUBMITTED_ARB 0x82EE -#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_VERTEX_ARRAY_KHR 0x8074 -#define GL_QUERY_KHR 0x82E3 -#define GL_PROGRAM_PIPELINE_KHR 0x82E4 -#define GL_SAMPLER_KHR 0x82E6 -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -#define GL_DISPLAY_LIST 0x82E7 -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_QUADS 0x0007 -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF -#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_BLEND_EQUATION_EXT 0x8009 -#define GL_PACK_INVERT_MESA 0x8758 -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#define GL_INTERLACE_SGIX 0x8094 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -#define GL_TEXTURE_TARGET 0x1006 -#define GL_QUERY_TARGET 0x82EA -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_RESCALE_NORMAL_EXT 0x803A -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -#define GL_MAX_CULL_DISTANCES 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -#define GL_MAX_VERTEX_STREAMS 0x8E71 -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#define GL_ASYNC_MARKER_SGIX 0x8329 -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF -#define GL_HALF_FLOAT_NV 0x140B -#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE -#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 -#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_EQUATION 0x8009 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#define GL_ABGR_EXT 0x8000 -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#define GL_CULL_VERTEX_IBM 103050 -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#define GL_UNSIGNED_INT64_ARB 0x140F -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_ALL_SHADER_BITS 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -#define GL_FILL_RECTANGLE_NV 0x933C -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_QUERY_WAIT_INVERTED 0x8E17 -#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 -#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 -#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F -#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 -#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#define GL_SLICE_ACCUM_SUN 0x85CC -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -#define GL_FOG 0x0B60 -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#define GL_CLEAR_TEXTURE 0x9365 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_2_BYTES_NV 0x1407 -#define GL_3_BYTES_NV 0x1408 -#define GL_4_BYTES_NV 0x1409 -#define GL_EYE_LINEAR_NV 0x2400 -#define GL_OBJECT_LINEAR_NV 0x2401 -#define GL_CONSTANT_NV 0x8576 -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D -#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 -#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A -#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_RGB_RAW_422_APPLE 0x8A51 -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#define GL_INT64_ARB 0x140E -#define GL_INT64_VEC2_ARB 0x8FE9 -#define GL_INT64_VEC3_ARB 0x8FEA -#define GL_INT64_VEC4_ARB 0x8FEB -#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_SRGB_DECODE_ARB 0x8299 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -#define GL_FIXED_OES 0x140C -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 -#define GL_WEIGHTED_AVERAGE_ARB 0x9367 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 -#define GL_COMPLETION_STATUS_ARB 0x91B1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 -#define GL_SAMPLE_LOCATION_ARB 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 -#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 -#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -GLAPI int GLAD_GL_SGIX_pixel_tiles; -#endif -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 -GLAPI int GLAD_GL_EXT_post_depth_coverage; -#endif -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -GLAPI int GLAD_GL_APPLE_element_array; -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC)(GLenum type, const void* pointer); -GLAPI PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; -#define glElementPointerAPPLE glad_glElementPointerAPPLE -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; -#define glDrawElementArrayAPPLE glad_glDrawElementArrayAPPLE -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; -#define glDrawRangeElementArrayAPPLE glad_glDrawRangeElementArrayAPPLE -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; -#define glMultiDrawElementArrayAPPLE glad_glMultiDrawElementArrayAPPLE -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; -#define glMultiDrawRangeElementArrayAPPLE glad_glMultiDrawRangeElementArrayAPPLE -#endif -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -GLAPI int GLAD_GL_AMD_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)(GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; -#define glMultiDrawArraysIndirectAMD glad_glMultiDrawArraysIndirectAMD -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; -#define glMultiDrawElementsIndirectAMD glad_glMultiDrawElementsIndirectAMD -#endif -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -GLAPI int GLAD_GL_EXT_blend_subtract; -#endif -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -GLAPI int GLAD_GL_SGIX_tag_sample_buffer; -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC)(); -GLAPI PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; -#define glTagSampleBufferSGIX glad_glTagSampleBufferSGIX -#endif -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -GLAPI int GLAD_GL_NV_point_sprite; -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC)(GLenum pname, GLint param); -GLAPI PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; -#define glPointParameteriNV glad_glPointParameteriNV -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; -#define glPointParameterivNV glad_glPointParameterivNV -#endif -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -GLAPI int GLAD_GL_IBM_texture_mirrored_repeat; -#endif -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -GLAPI int GLAD_GL_APPLE_transform_hint; -#endif -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -GLAPI int GLAD_GL_ATI_separate_stencil; -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; -#define glStencilOpSeparateATI glad_glStencilOpSeparateATI -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; -#define glStencilFuncSeparateATI glad_glStencilFuncSeparateATI -#endif -#ifndef GL_NV_shader_atomic_int64 -#define GL_NV_shader_atomic_int64 1 -GLAPI int GLAD_GL_NV_shader_atomic_int64; -#endif -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -GLAPI int GLAD_GL_NV_vertex_program2_option; -#endif -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -GLAPI int GLAD_GL_EXT_texture_buffer_object; -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; -#define glTexBufferEXT glad_glTexBufferEXT -#endif -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -GLAPI int GLAD_GL_ARB_vertex_blend; -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC)(GLint size, const GLbyte* weights); -GLAPI PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; -#define glWeightbvARB glad_glWeightbvARB -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC)(GLint size, const GLshort* weights); -GLAPI PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; -#define glWeightsvARB glad_glWeightsvARB -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC)(GLint size, const GLint* weights); -GLAPI PFNGLWEIGHTIVARBPROC glad_glWeightivARB; -#define glWeightivARB glad_glWeightivARB -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC)(GLint size, const GLfloat* weights); -GLAPI PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; -#define glWeightfvARB glad_glWeightfvARB -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC)(GLint size, const GLdouble* weights); -GLAPI PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; -#define glWeightdvARB glad_glWeightdvARB -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC)(GLint size, const GLubyte* weights); -GLAPI PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; -#define glWeightubvARB glad_glWeightubvARB -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC)(GLint size, const GLushort* weights); -GLAPI PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; -#define glWeightusvARB glad_glWeightusvARB -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC)(GLint size, const GLuint* weights); -GLAPI PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; -#define glWeightuivARB glad_glWeightuivARB -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; -#define glWeightPointerARB glad_glWeightPointerARB -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC)(GLint count); -GLAPI PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; -#define glVertexBlendARB glad_glVertexBlendARB -#endif -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 -GLAPI int GLAD_GL_OVR_multiview; -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -GLAPI PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; -#define glFramebufferTextureMultiviewOVR glad_glFramebufferTextureMultiviewOVR -#endif -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -GLAPI int GLAD_GL_NV_vertex_program2; -#endif -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 -GLAPI int GLAD_GL_ARB_program_interface_query; -typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC)(GLuint program, GLenum programInterface, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; -#define glGetProgramInterfaceiv glad_glGetProgramInterfaceiv -typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; -#define glGetProgramResourceIndex glad_glGetProgramResourceIndex -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; -#define glGetProgramResourceName glad_glGetProgramResourceName -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params); -GLAPI PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; -#define glGetProgramResourceiv glad_glGetProgramResourceiv -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; -#define glGetProgramResourceLocation glad_glGetProgramResourceLocation -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; -#define glGetProgramResourceLocationIndex glad_glGetProgramResourceLocationIndex -#endif -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -GLAPI int GLAD_GL_EXT_misc_attribute; -#endif -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -GLAPI int GLAD_GL_NV_multisample_coverage; -#endif -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -GLAPI int GLAD_GL_ARB_shading_language_packing; -#endif -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -GLAPI int GLAD_GL_EXT_texture_cube_map; -#endif -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 -GLAPI int GLAD_GL_NV_viewport_array2; -#endif -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 -GLAPI int GLAD_GL_ARB_texture_stencil8; -#endif -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -GLAPI int GLAD_GL_EXT_index_func; -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC)(GLenum func, GLclampf ref); -GLAPI PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; -#define glIndexFuncEXT glad_glIndexFuncEXT -#endif -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -GLAPI int GLAD_GL_OES_compressed_paletted_texture; -#endif -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -GLAPI int GLAD_GL_NV_depth_clamp; -#endif -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -GLAPI int GLAD_GL_NV_shader_buffer_load; -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; -#define glMakeBufferResidentNV glad_glMakeBufferResidentNV -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC)(GLenum target); -GLAPI PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; -#define glMakeBufferNonResidentNV glad_glMakeBufferNonResidentNV -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC)(GLenum target); -GLAPI PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; -#define glIsBufferResidentNV glad_glIsBufferResidentNV -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; -#define glMakeNamedBufferResidentNV glad_glMakeNamedBufferResidentNV -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)(GLuint buffer); -GLAPI PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; -#define glMakeNamedBufferNonResidentNV glad_glMakeNamedBufferNonResidentNV -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC)(GLuint buffer); -GLAPI PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; -#define glIsNamedBufferResidentNV glad_glIsNamedBufferResidentNV -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC)(GLenum target, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; -#define glGetBufferParameterui64vNV glad_glGetBufferParameterui64vNV -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)(GLuint buffer, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; -#define glGetNamedBufferParameterui64vNV glad_glGetNamedBufferParameterui64vNV -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC)(GLenum value, GLuint64EXT* result); -GLAPI PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; -#define glGetIntegerui64vNV glad_glGetIntegerui64vNV -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC)(GLint location, GLuint64EXT value); -GLAPI PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; -#define glUniformui64NV glad_glUniformui64NV -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; -#define glUniformui64vNV glad_glUniformui64vNV -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLuint64EXT* params); -GLAPI PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; -#define glGetUniformui64vNV glad_glGetUniformui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC)(GLuint program, GLint location, GLuint64EXT value); -GLAPI PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; -#define glProgramUniformui64NV glad_glProgramUniformui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; -#define glProgramUniformui64vNV glad_glProgramUniformui64vNV -#endif -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -GLAPI int GLAD_GL_EXT_color_subtable; -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; -#define glColorSubTableEXT glad_glColorSubTableEXT -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; -#define glCopyColorSubTableEXT glad_glCopyColorSubTableEXT -#endif -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -GLAPI int GLAD_GL_SUNX_constant_data; -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC)(); -GLAPI PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; -#define glFinishTextureSUNX glad_glFinishTextureSUNX -#endif -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -GLAPI int GLAD_GL_EXT_texture_compression_s3tc; -#endif -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -GLAPI int GLAD_GL_EXT_multi_draw_arrays; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; -#define glMultiDrawArraysEXT glad_glMultiDrawArraysEXT -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount); -GLAPI PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; -#define glMultiDrawElementsEXT glad_glMultiDrawElementsEXT -#endif -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -GLAPI int GLAD_GL_ARB_shader_atomic_counters; -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)(GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; -#define glGetActiveAtomicCounterBufferiv glad_glGetActiveAtomicCounterBufferiv -#endif -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 -GLAPI int GLAD_GL_ARB_arrays_of_arrays; -#endif -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -GLAPI int GLAD_GL_NV_conditional_render; -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC)(GLuint id, GLenum mode); -GLAPI PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; -#define glBeginConditionalRenderNV glad_glBeginConditionalRenderNV -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; -#define glEndConditionalRenderNV glad_glEndConditionalRenderNV -#endif -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -GLAPI int GLAD_GL_EXT_texture_env_combine; -#endif -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -GLAPI int GLAD_GL_NV_fog_distance; -#endif -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -GLAPI int GLAD_GL_SGIX_async_histogram; -#endif -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -GLAPI int GLAD_GL_MESA_resize_buffers; -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC)(); -GLAPI PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; -#define glResizeBuffersMESA glad_glResizeBuffersMESA -#endif -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -GLAPI int GLAD_GL_NV_light_max_exponent; -#endif -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -GLAPI int GLAD_GL_NV_texture_env_combine4; -#endif -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 -GLAPI int GLAD_GL_ARB_texture_view; -typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -GLAPI PFNGLTEXTUREVIEWPROC glad_glTextureView; -#define glTextureView glad_glTextureView -#endif -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -GLAPI int GLAD_GL_ARB_texture_env_combine; -#endif -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -GLAPI int GLAD_GL_ARB_map_buffer_range; -#endif -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -GLAPI int GLAD_GL_EXT_convolution; -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; -#define glConvolutionFilter1DEXT glad_glConvolutionFilter1DEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; -#define glConvolutionFilter2DEXT glad_glConvolutionFilter2DEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat params); -GLAPI PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; -#define glConvolutionParameterfEXT glad_glConvolutionParameterfEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; -#define glConvolutionParameterfvEXT glad_glConvolutionParameterfvEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint params); -GLAPI PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; -#define glConvolutionParameteriEXT glad_glConvolutionParameteriEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; -#define glConvolutionParameterivEXT glad_glConvolutionParameterivEXT -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; -#define glCopyConvolutionFilter1DEXT glad_glCopyConvolutionFilter1DEXT -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; -#define glCopyConvolutionFilter2DEXT glad_glCopyConvolutionFilter2DEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* image); -GLAPI PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; -#define glGetConvolutionFilterEXT glad_glGetConvolutionFilterEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; -#define glGetConvolutionParameterfvEXT glad_glGetConvolutionParameterfvEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; -#define glGetConvolutionParameterivEXT glad_glGetConvolutionParameterivEXT -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -GLAPI PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; -#define glGetSeparableFilterEXT glad_glGetSeparableFilterEXT -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); -GLAPI PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; -#define glSeparableFilter2DEXT glad_glSeparableFilter2DEXT -#endif -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 -GLAPI int GLAD_GL_NV_compute_program5; -#endif -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -GLAPI int GLAD_GL_NV_vertex_attrib_integer_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC)(GLuint index, GLint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; -#define glVertexAttribL1i64NV glad_glVertexAttribL1i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; -#define glVertexAttribL2i64NV glad_glVertexAttribL2i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; -#define glVertexAttribL3i64NV glad_glVertexAttribL3i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; -#define glVertexAttribL4i64NV glad_glVertexAttribL4i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; -#define glVertexAttribL1i64vNV glad_glVertexAttribL1i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; -#define glVertexAttribL2i64vNV glad_glVertexAttribL2i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; -#define glVertexAttribL3i64vNV glad_glVertexAttribL3i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; -#define glVertexAttribL4i64vNV glad_glVertexAttribL4i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC)(GLuint index, GLuint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; -#define glVertexAttribL1ui64NV glad_glVertexAttribL1ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; -#define glVertexAttribL2ui64NV glad_glVertexAttribL2ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; -#define glVertexAttribL3ui64NV glad_glVertexAttribL3ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; -#define glVertexAttribL4ui64NV glad_glVertexAttribL4ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; -#define glVertexAttribL1ui64vNV glad_glVertexAttribL1ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; -#define glVertexAttribL2ui64vNV glad_glVertexAttribL2ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; -#define glVertexAttribL3ui64vNV glad_glVertexAttribL3ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; -#define glVertexAttribL4ui64vNV glad_glVertexAttribL4ui64vNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC)(GLuint index, GLenum pname, GLint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; -#define glGetVertexAttribLi64vNV glad_glGetVertexAttribLi64vNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC)(GLuint index, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; -#define glGetVertexAttribLui64vNV glad_glGetVertexAttribLui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; -#define glVertexAttribLFormatNV glad_glVertexAttribLFormatNV -#endif -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -GLAPI int GLAD_GL_EXT_paletted_texture; -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; -#define glColorTableEXT glad_glColorTableEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC)(GLenum target, GLenum format, GLenum type, void* data); -GLAPI PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; -#define glGetColorTableEXT glad_glGetColorTableEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; -#define glGetColorTableParameterivEXT glad_glGetColorTableParameterivEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; -#define glGetColorTableParameterfvEXT glad_glGetColorTableParameterfvEXT -#endif -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -GLAPI int GLAD_GL_ARB_texture_buffer_object; -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; -#define glTexBufferARB glad_glTexBufferARB -#endif -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -GLAPI int GLAD_GL_ATI_pn_triangles; -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; -#define glPNTrianglesiATI glad_glPNTrianglesiATI -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; -#define glPNTrianglesfATI glad_glPNTrianglesfATI -#endif -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -GLAPI int GLAD_GL_SGIX_resample; -#endif -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -GLAPI int GLAD_GL_SGIX_flush_raster; -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC)(); -GLAPI PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; -#define glFlushRasterSGIX glad_glFlushRasterSGIX -#endif -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -GLAPI int GLAD_GL_EXT_light_texture; -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC)(GLenum mode); -GLAPI PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; -#define glApplyTextureEXT glad_glApplyTextureEXT -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC)(GLenum pname); -GLAPI PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; -#define glTextureLightEXT glad_glTextureLightEXT -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC)(GLenum face, GLenum mode); -GLAPI PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; -#define glTextureMaterialEXT glad_glTextureMaterialEXT -#endif -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -GLAPI int GLAD_GL_ARB_point_sprite; -#endif -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -GLAPI int GLAD_GL_SUN_convolution_border_modes; -#endif -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -GLAPI int GLAD_GL_NV_parameter_buffer_object2; -#endif -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -GLAPI int GLAD_GL_ARB_half_float_pixel; -#endif -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -GLAPI int GLAD_GL_NV_tessellation_program5; -#endif -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -GLAPI int GLAD_GL_REND_screen_coordinates; -#endif -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -GLAPI int GLAD_GL_HP_image_transform; -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; -#define glImageTransformParameteriHP glad_glImageTransformParameteriHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; -#define glImageTransformParameterfHP glad_glImageTransformParameterfHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; -#define glImageTransformParameterivHP glad_glImageTransformParameterivHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; -#define glImageTransformParameterfvHP glad_glImageTransformParameterfvHP -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; -#define glGetImageTransformParameterivHP glad_glGetImageTransformParameterivHP -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; -#define glGetImageTransformParameterfvHP glad_glGetImageTransformParameterfvHP -#endif -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -GLAPI int GLAD_GL_EXT_packed_float; -#endif -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -GLAPI int GLAD_GL_OML_subsample; -#endif -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -GLAPI int GLAD_GL_SGIX_vertex_preclip; -#endif -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -GLAPI int GLAD_GL_SGIX_texture_scale_bias; -#endif -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -GLAPI int GLAD_GL_AMD_draw_buffers_blend; -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC)(GLuint buf, GLenum src, GLenum dst); -GLAPI PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; -#define glBlendFuncIndexedAMD glad_glBlendFuncIndexedAMD -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; -#define glBlendFuncSeparateIndexedAMD glad_glBlendFuncSeparateIndexedAMD -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC)(GLuint buf, GLenum mode); -GLAPI PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; -#define glBlendEquationIndexedAMD glad_glBlendEquationIndexedAMD -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; -#define glBlendEquationSeparateIndexedAMD glad_glBlendEquationSeparateIndexedAMD -#endif -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -GLAPI int GLAD_GL_APPLE_texture_range; -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC)(GLenum target, GLsizei length, const void* pointer); -GLAPI PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; -#define glTextureRangeAPPLE glad_glTextureRangeAPPLE -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; -#define glGetTexParameterPointervAPPLE glad_glGetTexParameterPointervAPPLE -#endif -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -GLAPI int GLAD_GL_EXT_texture_array; -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; -#define glFramebufferTextureLayerEXT glad_glFramebufferTextureLayerEXT -#endif -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -GLAPI int GLAD_GL_NV_texture_barrier; -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC)(); -GLAPI PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; -#define glTextureBarrierNV glad_glTextureBarrierNV -#endif -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 -GLAPI int GLAD_GL_ARB_texture_query_levels; -#endif -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -GLAPI int GLAD_GL_NV_texgen_emboss; -#endif -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -GLAPI int GLAD_GL_EXT_texture_swizzle; -#endif -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -GLAPI int GLAD_GL_ARB_texture_rg; -#endif -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -GLAPI int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; -#endif -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -GLAPI int GLAD_GL_ARB_fragment_shader; -#endif -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -GLAPI int GLAD_GL_3DFX_tbuffer; -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC)(GLuint mask); -GLAPI PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; -#define glTbufferMask3DFX glad_glTbufferMask3DFX -#endif -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -GLAPI int GLAD_GL_GREMEDY_frame_terminator; -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC)(); -GLAPI PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; -#define glFrameTerminatorGREMEDY glad_glFrameTerminatorGREMEDY -#endif -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -GLAPI int GLAD_GL_ARB_blend_func_extended; -#endif -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -GLAPI int GLAD_GL_EXT_separate_shader_objects; -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC)(GLenum type, GLuint program); -GLAPI PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; -#define glUseShaderProgramEXT glad_glUseShaderProgramEXT -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC)(GLuint program); -GLAPI PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; -#define glActiveProgramEXT glad_glActiveProgramEXT -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC)(GLenum type, const GLchar* string); -GLAPI PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; -#define glCreateShaderProgramEXT glad_glCreateShaderProgramEXT -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC)(GLuint pipeline, GLuint program); -GLAPI PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; -#define glActiveShaderProgramEXT glad_glActiveShaderProgramEXT -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; -#define glBindProgramPipelineEXT glad_glBindProgramPipelineEXT -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC)(GLenum type, GLsizei count, const GLchar** strings); -GLAPI PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; -#define glCreateShaderProgramvEXT glad_glCreateShaderProgramvEXT -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC)(GLsizei n, const GLuint* pipelines); -GLAPI PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; -#define glDeleteProgramPipelinesEXT glad_glDeleteProgramPipelinesEXT -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; -#define glGenProgramPipelinesEXT glad_glGenProgramPipelinesEXT -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; -#define glGetProgramPipelineInfoLogEXT glad_glGetProgramPipelineInfoLogEXT -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC)(GLuint pipeline, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; -#define glGetProgramPipelineivEXT glad_glGetProgramPipelineivEXT -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; -#define glIsProgramPipelineEXT glad_glIsProgramPipelineEXT -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; -#define glProgramParameteriEXT glad_glProgramParameteriEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC)(GLuint program, GLint location, GLfloat v0); -GLAPI PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; -#define glProgramUniform1fEXT glad_glProgramUniform1fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; -#define glProgramUniform1fvEXT glad_glProgramUniform1fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC)(GLuint program, GLint location, GLint v0); -GLAPI PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; -#define glProgramUniform1iEXT glad_glProgramUniform1iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; -#define glProgramUniform1ivEXT glad_glProgramUniform1ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; -#define glProgramUniform2fEXT glad_glProgramUniform2fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; -#define glProgramUniform2fvEXT glad_glProgramUniform2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1); -GLAPI PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; -#define glProgramUniform2iEXT glad_glProgramUniform2iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; -#define glProgramUniform2ivEXT glad_glProgramUniform2ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; -#define glProgramUniform3fEXT glad_glProgramUniform3fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; -#define glProgramUniform3fvEXT glad_glProgramUniform3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; -#define glProgramUniform3iEXT glad_glProgramUniform3iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; -#define glProgramUniform3ivEXT glad_glProgramUniform3ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; -#define glProgramUniform4fEXT glad_glProgramUniform4fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; -#define glProgramUniform4fvEXT glad_glProgramUniform4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; -#define glProgramUniform4iEXT glad_glProgramUniform4iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; -#define glProgramUniform4ivEXT glad_glProgramUniform4ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; -#define glProgramUniformMatrix2fvEXT glad_glProgramUniformMatrix2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; -#define glProgramUniformMatrix3fvEXT glad_glProgramUniformMatrix3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; -#define glProgramUniformMatrix4fvEXT glad_glProgramUniformMatrix4fvEXT -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC)(GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; -#define glUseProgramStagesEXT glad_glUseProgramStagesEXT -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; -#define glValidateProgramPipelineEXT glad_glValidateProgramPipelineEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC)(GLuint program, GLint location, GLuint v0); -GLAPI PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; -#define glProgramUniform1uiEXT glad_glProgramUniform1uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; -#define glProgramUniform2uiEXT glad_glProgramUniform2uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; -#define glProgramUniform3uiEXT glad_glProgramUniform3uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; -#define glProgramUniform4uiEXT glad_glProgramUniform4uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; -#define glProgramUniform1uivEXT glad_glProgramUniform1uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; -#define glProgramUniform2uivEXT glad_glProgramUniform2uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; -#define glProgramUniform3uivEXT glad_glProgramUniform3uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; -#define glProgramUniform4uivEXT glad_glProgramUniform4uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; -#define glProgramUniformMatrix2x3fvEXT glad_glProgramUniformMatrix2x3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; -#define glProgramUniformMatrix3x2fvEXT glad_glProgramUniformMatrix3x2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; -#define glProgramUniformMatrix2x4fvEXT glad_glProgramUniformMatrix2x4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; -#define glProgramUniformMatrix4x2fvEXT glad_glProgramUniformMatrix4x2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; -#define glProgramUniformMatrix3x4fvEXT glad_glProgramUniformMatrix3x4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; -#define glProgramUniformMatrix4x3fvEXT glad_glProgramUniformMatrix4x3fvEXT -#endif -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -GLAPI int GLAD_GL_NV_texture_multisample; -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; -#define glTexImage2DMultisampleCoverageNV glad_glTexImage2DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; -#define glTexImage3DMultisampleCoverageNV glad_glTexImage3DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; -#define glTextureImage2DMultisampleNV glad_glTextureImage2DMultisampleNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; -#define glTextureImage3DMultisampleNV glad_glTextureImage3DMultisampleNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; -#define glTextureImage2DMultisampleCoverageNV glad_glTextureImage2DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; -#define glTextureImage3DMultisampleCoverageNV glad_glTextureImage3DMultisampleCoverageNV -#endif -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -GLAPI int GLAD_GL_ARB_shader_objects; -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC)(GLhandleARB obj); -GLAPI PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; -#define glDeleteObjectARB glad_glDeleteObjectARB -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC)(GLenum pname); -GLAPI PFNGLGETHANDLEARBPROC glad_glGetHandleARB; -#define glGetHandleARB glad_glGetHandleARB -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; -#define glDetachObjectARB glad_glDetachObjectARB -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC)(GLenum shaderType); -GLAPI PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; -#define glCreateShaderObjectARB glad_glCreateShaderObjectARB -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC)(GLhandleARB shaderObj, GLsizei count, const GLcharARB** string, const GLint* length); -GLAPI PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; -#define glShaderSourceARB glad_glShaderSourceARB -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC)(GLhandleARB shaderObj); -GLAPI PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; -#define glCompileShaderARB glad_glCompileShaderARB -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC)(); -GLAPI PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; -#define glCreateProgramObjectARB glad_glCreateProgramObjectARB -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB obj); -GLAPI PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; -#define glAttachObjectARB glad_glAttachObjectARB -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC)(GLhandleARB programObj); -GLAPI PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; -#define glLinkProgramARB glad_glLinkProgramARB -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC)(GLhandleARB programObj); -GLAPI PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; -#define glUseProgramObjectARB glad_glUseProgramObjectARB -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC)(GLhandleARB programObj); -GLAPI PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; -#define glValidateProgramARB glad_glValidateProgramARB -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC)(GLint location, GLfloat v0); -GLAPI PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; -#define glUniform1fARB glad_glUniform1fARB -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC)(GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; -#define glUniform2fARB glad_glUniform2fARB -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; -#define glUniform3fARB glad_glUniform3fARB -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; -#define glUniform4fARB glad_glUniform4fARB -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC)(GLint location, GLint v0); -GLAPI PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; -#define glUniform1iARB glad_glUniform1iARB -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC)(GLint location, GLint v0, GLint v1); -GLAPI PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; -#define glUniform2iARB glad_glUniform2iARB -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; -#define glUniform3iARB glad_glUniform3iARB -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; -#define glUniform4iARB glad_glUniform4iARB -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; -#define glUniform1fvARB glad_glUniform1fvARB -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; -#define glUniform2fvARB glad_glUniform2fvARB -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; -#define glUniform3fvARB glad_glUniform3fvARB -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; -#define glUniform4fvARB glad_glUniform4fvARB -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; -#define glUniform1ivARB glad_glUniform1ivARB -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; -#define glUniform2ivARB glad_glUniform2ivARB -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; -#define glUniform3ivARB glad_glUniform3ivARB -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; -#define glUniform4ivARB glad_glUniform4ivARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; -#define glUniformMatrix2fvARB glad_glUniformMatrix2fvARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; -#define glUniformMatrix3fvARB glad_glUniformMatrix3fvARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; -#define glUniformMatrix4fvARB glad_glUniformMatrix4fvARB -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC)(GLhandleARB obj, GLenum pname, GLfloat* params); -GLAPI PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; -#define glGetObjectParameterfvARB glad_glGetObjectParameterfvARB -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC)(GLhandleARB obj, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; -#define glGetObjectParameterivARB glad_glGetObjectParameterivARB -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* infoLog); -GLAPI PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; -#define glGetInfoLogARB glad_glGetInfoLogARB -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC)(GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB* obj); -GLAPI PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; -#define glGetAttachedObjectsARB glad_glGetAttachedObjectsARB -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); -GLAPI PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; -#define glGetUniformLocationARB glad_glGetUniformLocationARB -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); -GLAPI PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; -#define glGetActiveUniformARB glad_glGetActiveUniformARB -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC)(GLhandleARB programObj, GLint location, GLfloat* params); -GLAPI PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; -#define glGetUniformfvARB glad_glGetUniformfvARB -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC)(GLhandleARB programObj, GLint location, GLint* params); -GLAPI PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; -#define glGetUniformivARB glad_glGetUniformivARB -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* source); -GLAPI PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; -#define glGetShaderSourceARB glad_glGetShaderSourceARB -#endif -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -GLAPI int GLAD_GL_ARB_framebuffer_object; -#endif -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -GLAPI int GLAD_GL_ATI_envmap_bumpmap; -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC)(GLenum pname, const GLint* param); -GLAPI PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; -#define glTexBumpParameterivATI glad_glTexBumpParameterivATI -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC)(GLenum pname, const GLfloat* param); -GLAPI PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; -#define glTexBumpParameterfvATI glad_glTexBumpParameterfvATI -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC)(GLenum pname, GLint* param); -GLAPI PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; -#define glGetTexBumpParameterivATI glad_glGetTexBumpParameterivATI -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC)(GLenum pname, GLfloat* param); -GLAPI PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; -#define glGetTexBumpParameterfvATI glad_glGetTexBumpParameterfvATI -#endif -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 -GLAPI int GLAD_GL_ARB_robust_buffer_access_behavior; -#endif -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -GLAPI int GLAD_GL_ARB_shader_stencil_export; -#endif -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -GLAPI int GLAD_GL_NV_texture_rectangle; -#endif -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 -GLAPI int GLAD_GL_ARB_enhanced_layouts; -#endif -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -GLAPI int GLAD_GL_ARB_texture_rectangle; -#endif -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -GLAPI int GLAD_GL_SGI_texture_color_table; -#endif -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -GLAPI int GLAD_GL_ATI_map_object_buffer; -typedef void* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; -#define glMapObjectBufferATI glad_glMapObjectBufferATI -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; -#define glUnmapObjectBufferATI glad_glUnmapObjectBufferATI -#endif -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -GLAPI int GLAD_GL_ARB_robustness; -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -#define glGetGraphicsResetStatusARB glad_glGetGraphicsResetStatusARB -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); -GLAPI PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -#define glGetnTexImageARB glad_glGetnTexImageARB -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -#define glReadnPixelsARB glad_glReadnPixelsARB -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint lod, GLsizei bufSize, void* img); -GLAPI PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -#define glGetnCompressedTexImageARB glad_glGetnCompressedTexImageARB -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -#define glGetnUniformfvARB glad_glGetnUniformfvARB -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -#define glGetnUniformivARB glad_glGetnUniformivARB -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -#define glGetnUniformuivARB glad_glGetnUniformuivARB -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLdouble* params); -GLAPI PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -#define glGetnUniformdvARB glad_glGetnUniformdvARB -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); -GLAPI PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -#define glGetnMapdvARB glad_glGetnMapdvARB -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); -GLAPI PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -#define glGetnMapfvARB glad_glGetnMapfvARB -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLint* v); -GLAPI PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -#define glGetnMapivARB glad_glGetnMapivARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC)(GLenum map, GLsizei bufSize, GLfloat* values); -GLAPI PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -#define glGetnPixelMapfvARB glad_glGetnPixelMapfvARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC)(GLenum map, GLsizei bufSize, GLuint* values); -GLAPI PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -#define glGetnPixelMapuivARB glad_glGetnPixelMapuivARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC)(GLenum map, GLsizei bufSize, GLushort* values); -GLAPI PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -#define glGetnPixelMapusvARB glad_glGetnPixelMapusvARB -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC)(GLsizei bufSize, GLubyte* pattern); -GLAPI PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -#define glGetnPolygonStippleARB glad_glGetnPolygonStippleARB -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); -GLAPI PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -#define glGetnColorTableARB glad_glGetnColorTableARB -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); -GLAPI PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -#define glGetnConvolutionFilterARB glad_glGetnConvolutionFilterARB -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void* column, void* span); -GLAPI PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -#define glGetnSeparableFilterARB glad_glGetnSeparableFilterARB -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -GLAPI PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -#define glGetnHistogramARB glad_glGetnHistogramARB -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -GLAPI PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -#define glGetnMinmaxARB glad_glGetnMinmaxARB -#endif -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -GLAPI int GLAD_GL_NV_pixel_data_range; -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC)(GLenum target, GLsizei length, const void* pointer); -GLAPI PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; -#define glPixelDataRangeNV glad_glPixelDataRangeNV -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC)(GLenum target); -GLAPI PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; -#define glFlushPixelDataRangeNV glad_glFlushPixelDataRangeNV -#endif -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -GLAPI int GLAD_GL_EXT_framebuffer_blit; -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -#define glBlitFramebufferEXT glad_glBlitFramebufferEXT -#endif -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -GLAPI int GLAD_GL_ARB_gpu_shader_fp64; -typedef void (APIENTRYP PFNGLUNIFORM1DPROC)(GLint location, GLdouble x); -GLAPI PFNGLUNIFORM1DPROC glad_glUniform1d; -#define glUniform1d glad_glUniform1d -typedef void (APIENTRYP PFNGLUNIFORM2DPROC)(GLint location, GLdouble x, GLdouble y); -GLAPI PFNGLUNIFORM2DPROC glad_glUniform2d; -#define glUniform2d glad_glUniform2d -typedef void (APIENTRYP PFNGLUNIFORM3DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLUNIFORM3DPROC glad_glUniform3d; -#define glUniform3d glad_glUniform3d -typedef void (APIENTRYP PFNGLUNIFORM4DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLUNIFORM4DPROC glad_glUniform4d; -#define glUniform4d glad_glUniform4d -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM1DVPROC glad_glUniform1dv; -#define glUniform1dv glad_glUniform1dv -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM2DVPROC glad_glUniform2dv; -#define glUniform2dv glad_glUniform2dv -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM3DVPROC glad_glUniform3dv; -#define glUniform3dv glad_glUniform3dv -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM4DVPROC glad_glUniform4dv; -#define glUniform4dv glad_glUniform4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; -#define glUniformMatrix2dv glad_glUniformMatrix2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; -#define glUniformMatrix3dv glad_glUniformMatrix3dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; -#define glUniformMatrix4dv glad_glUniformMatrix4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; -#define glUniformMatrix2x3dv glad_glUniformMatrix2x3dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; -#define glUniformMatrix2x4dv glad_glUniformMatrix2x4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; -#define glUniformMatrix3x2dv glad_glUniformMatrix3x2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; -#define glUniformMatrix3x4dv glad_glUniformMatrix3x4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; -#define glUniformMatrix4x2dv glad_glUniformMatrix4x2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; -#define glUniformMatrix4x3dv glad_glUniformMatrix4x3dv -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC)(GLuint program, GLint location, GLdouble* params); -GLAPI PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; -#define glGetUniformdv glad_glGetUniformdv -#endif -#ifndef GL_NV_command_list -#define GL_NV_command_list 1 -GLAPI int GLAD_GL_NV_command_list; -typedef void (APIENTRYP PFNGLCREATESTATESNVPROC)(GLsizei n, GLuint* states); -GLAPI PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; -#define glCreateStatesNV glad_glCreateStatesNV -typedef void (APIENTRYP PFNGLDELETESTATESNVPROC)(GLsizei n, const GLuint* states); -GLAPI PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; -#define glDeleteStatesNV glad_glDeleteStatesNV -typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC)(GLuint state); -GLAPI PFNGLISSTATENVPROC glad_glIsStateNV; -#define glIsStateNV glad_glIsStateNV -typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC)(GLuint state, GLenum mode); -GLAPI PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; -#define glStateCaptureNV glad_glStateCaptureNV -typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC)(GLenum tokenID, GLuint size); -GLAPI PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; -#define glGetCommandHeaderNV glad_glGetCommandHeaderNV -typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC)(GLenum shadertype); -GLAPI PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; -#define glGetStageIndexNV glad_glGetStageIndexNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC)(GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); -GLAPI PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; -#define glDrawCommandsNV glad_glDrawCommandsNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC)(GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); -GLAPI PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; -#define glDrawCommandsAddressNV glad_glDrawCommandsAddressNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC)(GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; -#define glDrawCommandsStatesNV glad_glDrawCommandsStatesNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)(const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; -#define glDrawCommandsStatesAddressNV glad_glDrawCommandsStatesAddressNV -typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC)(GLsizei n, GLuint* lists); -GLAPI PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; -#define glCreateCommandListsNV glad_glCreateCommandListsNV -typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC)(GLsizei n, const GLuint* lists); -GLAPI PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; -#define glDeleteCommandListsNV glad_glDeleteCommandListsNV -typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; -#define glIsCommandListNV glad_glIsCommandListNV -typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)(GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; -#define glListDrawCommandsStatesClientNV glad_glListDrawCommandsStatesClientNV -typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC)(GLuint list, GLuint segments); -GLAPI PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; -#define glCommandListSegmentsNV glad_glCommandListSegmentsNV -typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; -#define glCompileCommandListNV glad_glCompileCommandListNV -typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; -#define glCallCommandListNV glad_glCallCommandListNV -#endif -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -GLAPI int GLAD_GL_SGIX_depth_texture; -#endif -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -GLAPI int GLAD_GL_EXT_vertex_weighting; -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC)(GLfloat weight); -GLAPI PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; -#define glVertexWeightfEXT glad_glVertexWeightfEXT -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC)(const GLfloat* weight); -GLAPI PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; -#define glVertexWeightfvEXT glad_glVertexWeightfvEXT -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; -#define glVertexWeightPointerEXT glad_glVertexWeightPointerEXT -#endif -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -GLAPI int GLAD_GL_GREMEDY_string_marker; -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC)(GLsizei len, const void* string); -GLAPI PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; -#define glStringMarkerGREMEDY glad_glStringMarkerGREMEDY -#endif -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -GLAPI int GLAD_GL_ARB_texture_compression_bptc; -#endif -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -GLAPI int GLAD_GL_EXT_subtexture; -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; -#define glTexSubImage1DEXT glad_glTexSubImage1DEXT -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; -#define glTexSubImage2DEXT glad_glTexSubImage2DEXT -#endif -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -GLAPI int GLAD_GL_EXT_pixel_transform_color_table; -#endif -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -GLAPI int GLAD_GL_EXT_texture_compression_rgtc; -#endif -#ifndef GL_ARB_shader_atomic_counter_ops -#define GL_ARB_shader_atomic_counter_ops 1 -GLAPI int GLAD_GL_ARB_shader_atomic_counter_ops; -#endif -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -GLAPI int GLAD_GL_SGIX_depth_pass_instrument; -#endif -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -GLAPI int GLAD_GL_EXT_gpu_program_parameters; -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; -#define glProgramEnvParameters4fvEXT glad_glProgramEnvParameters4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; -#define glProgramLocalParameters4fvEXT glad_glProgramLocalParameters4fvEXT -#endif -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -GLAPI int GLAD_GL_NV_evaluators; -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); -GLAPI PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; -#define glMapControlPointsNV glad_glMapControlPointsNV -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; -#define glMapParameterivNV glad_glMapParameterivNV -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; -#define glMapParameterfvNV glad_glMapParameterfvNV -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); -GLAPI PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; -#define glGetMapControlPointsNV glad_glGetMapControlPointsNV -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; -#define glGetMapParameterivNV glad_glGetMapParameterivNV -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; -#define glGetMapParameterfvNV glad_glGetMapParameterfvNV -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; -#define glGetMapAttribParameterivNV glad_glGetMapAttribParameterivNV -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; -#define glGetMapAttribParameterfvNV glad_glGetMapAttribParameterfvNV -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC)(GLenum target, GLenum mode); -GLAPI PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; -#define glEvalMapsNV glad_glEvalMapsNV -#endif -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -GLAPI int GLAD_GL_SGIS_texture_filter4; -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLfloat* weights); -GLAPI PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; -#define glGetTexFilterFuncSGIS glad_glGetTexFilterFuncSGIS -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); -GLAPI PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; -#define glTexFilterFuncSGIS glad_glTexFilterFuncSGIS -#endif -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -GLAPI int GLAD_GL_AMD_performance_monitor; -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC)(GLint* numGroups, GLsizei groupsSize, GLuint* groups); -GLAPI PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; -#define glGetPerfMonitorGroupsAMD glad_glGetPerfMonitorGroupsAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC)(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters); -GLAPI PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; -#define glGetPerfMonitorCountersAMD glad_glGetPerfMonitorCountersAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString); -GLAPI PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; -#define glGetPerfMonitorGroupStringAMD glad_glGetPerfMonitorGroupStringAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString); -GLAPI PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; -#define glGetPerfMonitorCounterStringAMD glad_glGetPerfMonitorCounterStringAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)(GLuint group, GLuint counter, GLenum pname, void* data); -GLAPI PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; -#define glGetPerfMonitorCounterInfoAMD glad_glGetPerfMonitorCounterInfoAMD -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); -GLAPI PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; -#define glGenPerfMonitorsAMD glad_glGenPerfMonitorsAMD -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); -GLAPI PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; -#define glDeletePerfMonitorsAMD glad_glDeletePerfMonitorsAMD -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); -GLAPI PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; -#define glSelectPerfMonitorCountersAMD glad_glSelectPerfMonitorCountersAMD -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC)(GLuint monitor); -GLAPI PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; -#define glBeginPerfMonitorAMD glad_glBeginPerfMonitorAMD -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC)(GLuint monitor); -GLAPI PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; -#define glEndPerfMonitorAMD glad_glEndPerfMonitorAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten); -GLAPI PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; -#define glGetPerfMonitorCounterDataAMD glad_glGetPerfMonitorCounterDataAMD -#endif -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -GLAPI int GLAD_GL_NV_geometry_shader4; -#endif -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -GLAPI int GLAD_GL_EXT_stencil_clear_tag; -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC)(GLsizei stencilTagBits, GLuint stencilClearTag); -GLAPI PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; -#define glStencilClearTagEXT glad_glStencilClearTagEXT -#endif -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -GLAPI int GLAD_GL_NV_vertex_program1_1; -#endif -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -GLAPI int GLAD_GL_NV_present_video; -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; -#define glPresentFrameKeyedNV glad_glPresentFrameKeyedNV -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; -#define glPresentFrameDualFillNV glad_glPresentFrameDualFillNV -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC)(GLuint video_slot, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; -#define glGetVideoivNV glad_glGetVideoivNV -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC)(GLuint video_slot, GLenum pname, GLuint* params); -GLAPI PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; -#define glGetVideouivNV glad_glGetVideouivNV -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC)(GLuint video_slot, GLenum pname, GLint64EXT* params); -GLAPI PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; -#define glGetVideoi64vNV glad_glGetVideoi64vNV -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC)(GLuint video_slot, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; -#define glGetVideoui64vNV glad_glGetVideoui64vNV -#endif -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -GLAPI int GLAD_GL_ARB_texture_compression_rgtc; -#endif -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -GLAPI int GLAD_GL_HP_convolution_border_modes; -#endif -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -GLAPI int GLAD_GL_EXT_shader_integer_mix; -#endif -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -GLAPI int GLAD_GL_SGIX_framezoom; -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC)(GLint factor); -GLAPI PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; -#define glFrameZoomSGIX glad_glFrameZoomSGIX -#endif -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 -GLAPI int GLAD_GL_ARB_stencil_texturing; -#endif -#ifndef GL_ARB_shader_clock -#define GL_ARB_shader_clock 1 -GLAPI int GLAD_GL_ARB_shader_clock; -#endif -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 -GLAPI int GLAD_GL_NV_shader_atomic_fp16_vector; -#endif -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -GLAPI int GLAD_GL_SGIX_fog_offset; -#endif -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -GLAPI int GLAD_GL_ARB_draw_elements_base_vertex; -#endif -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -GLAPI int GLAD_GL_INGR_interlace_read; -#endif -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -GLAPI int GLAD_GL_NV_transform_feedback; -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; -#define glBeginTransformFeedbackNV glad_glBeginTransformFeedbackNV -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; -#define glEndTransformFeedbackNV glad_glEndTransformFeedbackNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; -#define glTransformFeedbackAttribsNV glad_glTransformFeedbackAttribsNV -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; -#define glBindBufferRangeNV glad_glBindBufferRangeNV -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; -#define glBindBufferOffsetNV glad_glBindBufferOffsetNV -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; -#define glBindBufferBaseNV glad_glBindBufferBaseNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)(GLuint program, GLsizei count, const GLint* locations, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; -#define glTransformFeedbackVaryingsNV glad_glTransformFeedbackVaryingsNV -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; -#define glActiveVaryingNV glad_glActiveVaryingNV -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; -#define glGetVaryingLocationNV glad_glGetVaryingLocationNV -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; -#define glGetActiveVaryingNV glad_glGetActiveVaryingNV -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)(GLuint program, GLuint index, GLint* location); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; -#define glGetTransformFeedbackVaryingNV glad_glGetTransformFeedbackVaryingNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLsizei nbuffers, const GLint* bufstreams, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; -#define glTransformFeedbackStreamAttribsNV glad_glTransformFeedbackStreamAttribsNV -#endif -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -GLAPI int GLAD_GL_NV_fragment_program; -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; -#define glProgramNamedParameter4fNV glad_glProgramNamedParameter4fNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLfloat* v); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; -#define glProgramNamedParameter4fvNV glad_glProgramNamedParameter4fvNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; -#define glProgramNamedParameter4dNV glad_glProgramNamedParameter4dNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLdouble* v); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; -#define glProgramNamedParameter4dvNV glad_glProgramNamedParameter4dvNV -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat* params); -GLAPI PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; -#define glGetProgramNamedParameterfvNV glad_glGetProgramNamedParameterfvNV -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble* params); -GLAPI PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; -#define glGetProgramNamedParameterdvNV glad_glGetProgramNamedParameterdvNV -#endif -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -GLAPI int GLAD_GL_AMD_stencil_operation_extended; -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC)(GLenum face, GLuint value); -GLAPI PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; -#define glStencilOpValueAMD glad_glStencilOpValueAMD -#endif -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 -GLAPI int GLAD_GL_ARB_seamless_cubemap_per_texture; -#endif -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -GLAPI int GLAD_GL_ARB_instanced_arrays; -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC)(GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; -#define glVertexAttribDivisorARB glad_glVertexAttribDivisorARB -#endif -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -GLAPI int GLAD_GL_EXT_polygon_offset; -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC)(GLfloat factor, GLfloat bias); -GLAPI PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; -#define glPolygonOffsetEXT glad_glPolygonOffsetEXT -#endif -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -GLAPI int GLAD_GL_NV_vertex_array_range2; -#endif -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -GLAPI int GLAD_GL_KHR_robustness; -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; -#define glGetGraphicsResetStatus glad_glGetGraphicsResetStatus -typedef void (APIENTRYP PFNGLREADNPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSPROC glad_glReadnPixels; -#define glReadnPixels glad_glReadnPixels -typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; -#define glGetnUniformfv glad_glGetnUniformfv -typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; -#define glGetnUniformiv glad_glGetnUniformiv -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; -#define glGetnUniformuiv glad_glGetnUniformuiv -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; -#define glGetGraphicsResetStatusKHR glad_glGetGraphicsResetStatusKHR -typedef void (APIENTRYP PFNGLREADNPIXELSKHRPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; -#define glReadnPixelsKHR glad_glReadnPixelsKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMFVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; -#define glGetnUniformfvKHR glad_glGetnUniformfvKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; -#define glGetnUniformivKHR glad_glGetnUniformivKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; -#define glGetnUniformuivKHR glad_glGetnUniformuivKHR -#endif -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 -GLAPI int GLAD_GL_AMD_sparse_texture; -typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; -#define glTexStorageSparseAMD glad_glTexStorageSparseAMD -typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC)(GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; -#define glTextureStorageSparseAMD glad_glTextureStorageSparseAMD -#endif -#ifndef GL_ARB_clip_control -#define GL_ARB_clip_control 1 -GLAPI int GLAD_GL_ARB_clip_control; -typedef void (APIENTRYP PFNGLCLIPCONTROLPROC)(GLenum origin, GLenum depth); -GLAPI PFNGLCLIPCONTROLPROC glad_glClipControl; -#define glClipControl glad_glClipControl -#endif -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 -GLAPI int GLAD_GL_NV_fragment_coverage_to_color; -typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC)(GLuint color); -GLAPI PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; -#define glFragmentCoverageColorNV glad_glFragmentCoverageColorNV -#endif -#ifndef GL_NV_fence -#define GL_NV_fence 1 -GLAPI int GLAD_GL_NV_fence; -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC)(GLsizei n, const GLuint* fences); -GLAPI PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; -#define glDeleteFencesNV glad_glDeleteFencesNV -typedef void (APIENTRYP PFNGLGENFENCESNVPROC)(GLsizei n, GLuint* fences); -GLAPI PFNGLGENFENCESNVPROC glad_glGenFencesNV; -#define glGenFencesNV glad_glGenFencesNV -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC)(GLuint fence); -GLAPI PFNGLISFENCENVPROC glad_glIsFenceNV; -#define glIsFenceNV glad_glIsFenceNV -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC)(GLuint fence); -GLAPI PFNGLTESTFENCENVPROC glad_glTestFenceNV; -#define glTestFenceNV glad_glTestFenceNV -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC)(GLuint fence, GLenum pname, GLint* params); -GLAPI PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; -#define glGetFenceivNV glad_glGetFenceivNV -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC)(GLuint fence); -GLAPI PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; -#define glFinishFenceNV glad_glFinishFenceNV -typedef void (APIENTRYP PFNGLSETFENCENVPROC)(GLuint fence, GLenum condition); -GLAPI PFNGLSETFENCENVPROC glad_glSetFenceNV; -#define glSetFenceNV glad_glSetFenceNV -#endif -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 -GLAPI int GLAD_GL_ARB_texture_buffer_range; -typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; -#define glTexBufferRange glad_glTexBufferRange -#endif -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -GLAPI int GLAD_GL_SUN_mesh_array; -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC)(GLenum mode, GLint first, GLsizei count, GLsizei width); -GLAPI PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; -#define glDrawMeshArraysSUN glad_glDrawMeshArraysSUN -#endif -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -GLAPI int GLAD_GL_ARB_vertex_attrib_binding; -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -#define glBindVertexBuffer glad_glBindVertexBuffer -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -#define glVertexAttribFormat glad_glVertexAttribFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -#define glVertexAttribIFormat glad_glVertexAttribIFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -#define glVertexAttribLFormat glad_glVertexAttribLFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC)(GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -#define glVertexAttribBinding glad_glVertexAttribBinding -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC)(GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -#define glVertexBindingDivisor glad_glVertexBindingDivisor -#endif -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 -GLAPI int GLAD_GL_ARB_framebuffer_no_attachments; -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; -#define glFramebufferParameteri glad_glFramebufferParameteri -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; -#define glGetFramebufferParameteriv glad_glGetFramebufferParameteriv -#endif -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -GLAPI int GLAD_GL_ARB_cl_event; -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC)(struct _cl_context* context, struct _cl_event* event, GLbitfield flags); -GLAPI PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; -#define glCreateSyncFromCLeventARB glad_glCreateSyncFromCLeventARB -#endif -#ifndef GL_ARB_derivative_control -#define GL_ARB_derivative_control 1 -GLAPI int GLAD_GL_ARB_derivative_control; -#endif -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -GLAPI int GLAD_GL_NV_packed_depth_stencil; -#endif -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -GLAPI int GLAD_GL_OES_single_precision; -typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC)(GLclampf depth); -GLAPI PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; -#define glClearDepthfOES glad_glClearDepthfOES -typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC)(GLenum plane, const GLfloat* equation); -GLAPI PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; -#define glClipPlanefOES glad_glClipPlanefOES -typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC)(GLclampf n, GLclampf f); -GLAPI PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; -#define glDepthRangefOES glad_glDepthRangefOES -typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; -#define glFrustumfOES glad_glFrustumfOES -typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC)(GLenum plane, GLfloat* equation); -GLAPI PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; -#define glGetClipPlanefOES glad_glGetClipPlanefOES -typedef void (APIENTRYP PFNGLORTHOFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI PFNGLORTHOFOESPROC glad_glOrthofOES; -#define glOrthofOES glad_glOrthofOES -#endif -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -GLAPI int GLAD_GL_NV_primitive_restart; -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC)(); -GLAPI PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; -#define glPrimitiveRestartNV glad_glPrimitiveRestartNV -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC)(GLuint index); -GLAPI PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; -#define glPrimitiveRestartIndexNV glad_glPrimitiveRestartIndexNV -#endif -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -GLAPI int GLAD_GL_SUN_global_alpha; -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC)(GLbyte factor); -GLAPI PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; -#define glGlobalAlphaFactorbSUN glad_glGlobalAlphaFactorbSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC)(GLshort factor); -GLAPI PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; -#define glGlobalAlphaFactorsSUN glad_glGlobalAlphaFactorsSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC)(GLint factor); -GLAPI PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; -#define glGlobalAlphaFactoriSUN glad_glGlobalAlphaFactoriSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC)(GLfloat factor); -GLAPI PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; -#define glGlobalAlphaFactorfSUN glad_glGlobalAlphaFactorfSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC)(GLdouble factor); -GLAPI PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; -#define glGlobalAlphaFactordSUN glad_glGlobalAlphaFactordSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC)(GLubyte factor); -GLAPI PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; -#define glGlobalAlphaFactorubSUN glad_glGlobalAlphaFactorubSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC)(GLushort factor); -GLAPI PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; -#define glGlobalAlphaFactorusSUN glad_glGlobalAlphaFactorusSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC)(GLuint factor); -GLAPI PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; -#define glGlobalAlphaFactoruiSUN glad_glGlobalAlphaFactoruiSUN -#endif -#ifndef GL_ARB_fragment_shader_interlock -#define GL_ARB_fragment_shader_interlock 1 -GLAPI int GLAD_GL_ARB_fragment_shader_interlock; -#endif -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -GLAPI int GLAD_GL_EXT_texture_object; -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC)(GLsizei n, const GLuint* textures, GLboolean* residences); -GLAPI PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; -#define glAreTexturesResidentEXT glad_glAreTexturesResidentEXT -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC)(GLenum target, GLuint texture); -GLAPI PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; -#define glBindTextureEXT glad_glBindTextureEXT -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC)(GLsizei n, const GLuint* textures); -GLAPI PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; -#define glDeleteTexturesEXT glad_glDeleteTexturesEXT -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC)(GLsizei n, GLuint* textures); -GLAPI PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; -#define glGenTexturesEXT glad_glGenTexturesEXT -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC)(GLuint texture); -GLAPI PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; -#define glIsTextureEXT glad_glIsTextureEXT -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC)(GLsizei n, const GLuint* textures, const GLclampf* priorities); -GLAPI PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; -#define glPrioritizeTexturesEXT glad_glPrioritizeTexturesEXT -#endif -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -GLAPI int GLAD_GL_AMD_name_gen_delete; -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC)(GLenum identifier, GLuint num, GLuint* names); -GLAPI PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; -#define glGenNamesAMD glad_glGenNamesAMD -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC)(GLenum identifier, GLuint num, const GLuint* names); -GLAPI PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; -#define glDeleteNamesAMD glad_glDeleteNamesAMD -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC)(GLenum identifier, GLuint name); -GLAPI PFNGLISNAMEAMDPROC glad_glIsNameAMD; -#define glIsNameAMD glad_glIsNameAMD -#endif -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -GLAPI int GLAD_GL_NV_texture_compression_vtc; -#endif -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 -GLAPI int GLAD_GL_NV_sample_mask_override_coverage; -#endif -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -GLAPI int GLAD_GL_NV_texture_shader3; -#endif -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -GLAPI int GLAD_GL_NV_texture_shader2; -#endif -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -GLAPI int GLAD_GL_EXT_texture; -#endif -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -GLAPI int GLAD_GL_ARB_buffer_storage; -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -#define glBufferStorage glad_glBufferStorage -#endif -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -GLAPI int GLAD_GL_AMD_shader_atomic_counter_ops; -#endif -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -GLAPI int GLAD_GL_APPLE_vertex_program_evaluators; -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; -#define glEnableVertexAttribAPPLE glad_glEnableVertexAttribAPPLE -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; -#define glDisableVertexAttribAPPLE glad_glDisableVertexAttribAPPLE -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; -#define glIsVertexAttribEnabledAPPLE glad_glIsVertexAttribEnabledAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); -GLAPI PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; -#define glMapVertexAttrib1dAPPLE glad_glMapVertexAttrib1dAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); -GLAPI PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; -#define glMapVertexAttrib1fAPPLE glad_glMapVertexAttrib1fAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); -GLAPI PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; -#define glMapVertexAttrib2dAPPLE glad_glMapVertexAttrib2dAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); -GLAPI PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; -#define glMapVertexAttrib2fAPPLE glad_glMapVertexAttrib2fAPPLE -#endif -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 -GLAPI int GLAD_GL_ARB_multi_bind; -typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers); -GLAPI PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; -#define glBindBuffersBase glad_glBindBuffersBase -typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizeiptr* sizes); -GLAPI PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; -#define glBindBuffersRange glad_glBindBuffersRange -typedef void (APIENTRYP PFNGLBINDTEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); -GLAPI PFNGLBINDTEXTURESPROC glad_glBindTextures; -#define glBindTextures glad_glBindTextures -typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC)(GLuint first, GLsizei count, const GLuint* samplers); -GLAPI PFNGLBINDSAMPLERSPROC glad_glBindSamplers; -#define glBindSamplers glad_glBindSamplers -typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); -GLAPI PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; -#define glBindImageTextures glad_glBindImageTextures -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC)(GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); -GLAPI PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; -#define glBindVertexBuffers glad_glBindVertexBuffers -#endif -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -GLAPI int GLAD_GL_ARB_explicit_uniform_location; -#endif -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -GLAPI int GLAD_GL_ARB_depth_buffer_float; -#endif -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 -GLAPI int GLAD_GL_NV_path_rendering_shared_edge; -#endif -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -GLAPI int GLAD_GL_SGIX_shadow_ambient; -#endif -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -GLAPI int GLAD_GL_ARB_texture_cube_map; -#endif -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -GLAPI int GLAD_GL_AMD_vertex_shader_viewport_index; -#endif -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -GLAPI int GLAD_GL_SGIX_list_priority; -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, GLfloat* params); -GLAPI PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; -#define glGetListParameterfvSGIX glad_glGetListParameterfvSGIX -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, GLint* params); -GLAPI PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; -#define glGetListParameterivSGIX glad_glGetListParameterivSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC)(GLuint list, GLenum pname, GLfloat param); -GLAPI PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; -#define glListParameterfSGIX glad_glListParameterfSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, const GLfloat* params); -GLAPI PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; -#define glListParameterfvSGIX glad_glListParameterfvSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC)(GLuint list, GLenum pname, GLint param); -GLAPI PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; -#define glListParameteriSGIX glad_glListParameteriSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, const GLint* params); -GLAPI PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; -#define glListParameterivSGIX glad_glListParameterivSGIX -#endif -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -GLAPI int GLAD_GL_NV_vertex_buffer_unified_memory; -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC)(GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; -#define glBufferAddressRangeNV glad_glBufferAddressRangeNV -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; -#define glVertexFormatNV glad_glVertexFormatNV -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; -#define glNormalFormatNV glad_glNormalFormatNV -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; -#define glColorFormatNV glad_glColorFormatNV -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; -#define glIndexFormatNV glad_glIndexFormatNV -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; -#define glTexCoordFormatNV glad_glTexCoordFormatNV -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC)(GLsizei stride); -GLAPI PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; -#define glEdgeFlagFormatNV glad_glEdgeFlagFormatNV -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; -#define glSecondaryColorFormatNV glad_glSecondaryColorFormatNV -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; -#define glFogCoordFormatNV glad_glFogCoordFormatNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; -#define glVertexAttribFormatNV glad_glVertexAttribFormatNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; -#define glVertexAttribIFormatNV glad_glVertexAttribIFormatNV -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC)(GLenum value, GLuint index, GLuint64EXT* result); -GLAPI PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; -#define glGetIntegerui64i_vNV glad_glGetIntegerui64i_vNV -#endif -#ifndef GL_NV_uniform_buffer_unified_memory -#define GL_NV_uniform_buffer_unified_memory 1 -GLAPI int GLAD_GL_NV_uniform_buffer_unified_memory; -#endif -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -GLAPI int GLAD_GL_EXT_texture_env_dot3; -#endif -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -GLAPI int GLAD_GL_ATI_texture_env_combine3; -#endif -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -GLAPI int GLAD_GL_ARB_map_buffer_alignment; -#endif -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -GLAPI int GLAD_GL_NV_blend_equation_advanced; -typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC)(GLenum pname, GLint value); -GLAPI PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; -#define glBlendParameteriNV glad_glBlendParameteriNV -typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC)(); -GLAPI PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; -#define glBlendBarrierNV glad_glBlendBarrierNV -#endif -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -GLAPI int GLAD_GL_SGIS_sharpen_texture; -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); -GLAPI PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; -#define glSharpenTexFuncSGIS glad_glSharpenTexFuncSGIS -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC)(GLenum target, GLfloat* points); -GLAPI PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; -#define glGetSharpenTexFuncSGIS glad_glGetSharpenTexFuncSGIS -#endif -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -GLAPI int GLAD_GL_KHR_robust_buffer_access_behavior; -#endif -#ifndef GL_ARB_pipeline_statistics_query -#define GL_ARB_pipeline_statistics_query 1 -GLAPI int GLAD_GL_ARB_pipeline_statistics_query; -#endif -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -GLAPI int GLAD_GL_ARB_vertex_program; -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -#define glVertexAttrib1dARB glad_glVertexAttrib1dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -#define glVertexAttrib1dvARB glad_glVertexAttrib1dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -#define glVertexAttrib1fARB glad_glVertexAttrib1fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -#define glVertexAttrib1fvARB glad_glVertexAttrib1fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -#define glVertexAttrib1sARB glad_glVertexAttrib1sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -#define glVertexAttrib1svARB glad_glVertexAttrib1svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -#define glVertexAttrib2dARB glad_glVertexAttrib2dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -#define glVertexAttrib2dvARB glad_glVertexAttrib2dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -#define glVertexAttrib2fARB glad_glVertexAttrib2fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -#define glVertexAttrib2fvARB glad_glVertexAttrib2fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -#define glVertexAttrib2sARB glad_glVertexAttrib2sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -#define glVertexAttrib2svARB glad_glVertexAttrib2svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -#define glVertexAttrib3dARB glad_glVertexAttrib3dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -#define glVertexAttrib3dvARB glad_glVertexAttrib3dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -#define glVertexAttrib3fARB glad_glVertexAttrib3fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -#define glVertexAttrib3fvARB glad_glVertexAttrib3fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -#define glVertexAttrib3sARB glad_glVertexAttrib3sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -#define glVertexAttrib3svARB glad_glVertexAttrib3svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -#define glVertexAttrib4NbvARB glad_glVertexAttrib4NbvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -#define glVertexAttrib4NivARB glad_glVertexAttrib4NivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -#define glVertexAttrib4NsvARB glad_glVertexAttrib4NsvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -#define glVertexAttrib4NubARB glad_glVertexAttrib4NubARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -#define glVertexAttrib4NubvARB glad_glVertexAttrib4NubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -#define glVertexAttrib4NuivARB glad_glVertexAttrib4NuivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -#define glVertexAttrib4NusvARB glad_glVertexAttrib4NusvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -#define glVertexAttrib4bvARB glad_glVertexAttrib4bvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -#define glVertexAttrib4dARB glad_glVertexAttrib4dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -#define glVertexAttrib4dvARB glad_glVertexAttrib4dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -#define glVertexAttrib4fARB glad_glVertexAttrib4fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -#define glVertexAttrib4fvARB glad_glVertexAttrib4fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -#define glVertexAttrib4ivARB glad_glVertexAttrib4ivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -#define glVertexAttrib4sARB glad_glVertexAttrib4sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -#define glVertexAttrib4svARB glad_glVertexAttrib4svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -#define glVertexAttrib4ubvARB glad_glVertexAttrib4ubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -#define glVertexAttrib4uivARB glad_glVertexAttrib4uivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -#define glVertexAttrib4usvARB glad_glVertexAttrib4usvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -#define glVertexAttribPointerARB glad_glVertexAttribPointerARB -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -#define glEnableVertexAttribArrayARB glad_glEnableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -#define glDisableVertexAttribArrayARB glad_glDisableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); -GLAPI PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -#define glProgramStringARB glad_glProgramStringARB -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); -GLAPI PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -#define glBindProgramARB glad_glBindProgramARB -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -#define glDeleteProgramsARB glad_glDeleteProgramsARB -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); -GLAPI PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -#define glGenProgramsARB glad_glGenProgramsARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -#define glProgramEnvParameter4dARB glad_glProgramEnvParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -#define glProgramEnvParameter4dvARB glad_glProgramEnvParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -#define glProgramEnvParameter4fARB glad_glProgramEnvParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -#define glProgramEnvParameter4fvARB glad_glProgramEnvParameter4fvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -#define glProgramLocalParameter4dARB glad_glProgramLocalParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -#define glProgramLocalParameter4dvARB glad_glProgramLocalParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -#define glProgramLocalParameter4fARB glad_glProgramLocalParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -#define glProgramLocalParameter4fvARB glad_glProgramLocalParameter4fvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -#define glGetProgramEnvParameterdvARB glad_glGetProgramEnvParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -#define glGetProgramEnvParameterfvARB glad_glGetProgramEnvParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -#define glGetProgramLocalParameterdvARB glad_glGetProgramLocalParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -#define glGetProgramLocalParameterfvARB glad_glGetProgramLocalParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -#define glGetProgramivARB glad_glGetProgramivARB -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); -GLAPI PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -#define glGetProgramStringARB glad_glGetProgramStringARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -#define glGetVertexAttribdvARB glad_glGetVertexAttribdvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -#define glGetVertexAttribfvARB glad_glGetVertexAttribfvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -#define glGetVertexAttribivARB glad_glGetVertexAttribivARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -#define glGetVertexAttribPointervARB glad_glGetVertexAttribPointervARB -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC)(GLuint program); -GLAPI PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -#define glIsProgramARB glad_glIsProgramARB -#endif -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -GLAPI int GLAD_GL_ARB_texture_rgb10_a2ui; -#endif -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -GLAPI int GLAD_GL_OML_interlace; -#endif -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -GLAPI int GLAD_GL_ATI_pixel_format_float; -#endif -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 -GLAPI int GLAD_GL_NV_geometry_shader_passthrough; -#endif -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -GLAPI int GLAD_GL_ARB_vertex_buffer_object; -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); -GLAPI PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -#define glBindBufferARB glad_glBindBufferARB -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); -GLAPI PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -#define glDeleteBuffersARB glad_glDeleteBuffersARB -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -#define glGenBuffersARB glad_glGenBuffersARB -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC)(GLuint buffer); -GLAPI PFNGLISBUFFERARBPROC glad_glIsBufferARB; -#define glIsBufferARB glad_glIsBufferARB -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const void* data, GLenum usage); -GLAPI PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -#define glBufferDataARB glad_glBufferDataARB -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void* data); -GLAPI PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -#define glBufferSubDataARB glad_glBufferSubDataARB -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void* data); -GLAPI PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -#define glGetBufferSubDataARB glad_glGetBufferSubDataARB -typedef void* (APIENTRYP PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -#define glMapBufferARB glad_glMapBufferARB -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC)(GLenum target); -GLAPI PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -#define glUnmapBufferARB glad_glUnmapBufferARB -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -#define glGetBufferParameterivARB glad_glGetBufferParameterivARB -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -#define glGetBufferPointervARB glad_glGetBufferPointervARB -#endif -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -GLAPI int GLAD_GL_EXT_shadow_funcs; -#endif -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -GLAPI int GLAD_GL_ATI_text_fragment_shader; -#endif -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -GLAPI int GLAD_GL_NV_vertex_array_range; -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC)(); -GLAPI PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; -#define glFlushVertexArrayRangeNV glad_glFlushVertexArrayRangeNV -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC)(GLsizei length, const void* pointer); -GLAPI PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; -#define glVertexArrayRangeNV glad_glVertexArrayRangeNV -#endif -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -GLAPI int GLAD_GL_SGIX_fragment_lighting; -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC)(GLenum face, GLenum mode); -GLAPI PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; -#define glFragmentColorMaterialSGIX glad_glFragmentColorMaterialSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC)(GLenum light, GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; -#define glFragmentLightfSGIX glad_glFragmentLightfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; -#define glFragmentLightfvSGIX glad_glFragmentLightfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC)(GLenum light, GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; -#define glFragmentLightiSGIX glad_glFragmentLightiSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; -#define glFragmentLightivSGIX glad_glFragmentLightivSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; -#define glFragmentLightModelfSGIX glad_glFragmentLightModelfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; -#define glFragmentLightModelfvSGIX glad_glFragmentLightModelfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; -#define glFragmentLightModeliSGIX glad_glFragmentLightModeliSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; -#define glFragmentLightModelivSGIX glad_glFragmentLightModelivSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC)(GLenum face, GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; -#define glFragmentMaterialfSGIX glad_glFragmentMaterialfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; -#define glFragmentMaterialfvSGIX glad_glFragmentMaterialfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC)(GLenum face, GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; -#define glFragmentMaterialiSGIX glad_glFragmentMaterialiSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; -#define glFragmentMaterialivSGIX glad_glFragmentMaterialivSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; -#define glGetFragmentLightfvSGIX glad_glGetFragmentLightfvSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; -#define glGetFragmentLightivSGIX glad_glGetFragmentLightivSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; -#define glGetFragmentMaterialfvSGIX glad_glGetFragmentMaterialfvSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; -#define glGetFragmentMaterialivSGIX glad_glGetFragmentMaterialivSGIX -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; -#define glLightEnviSGIX glad_glLightEnviSGIX -#endif -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -GLAPI int GLAD_GL_NV_texture_expand_normal; -#endif -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -GLAPI int GLAD_GL_NV_framebuffer_multisample_coverage; -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; -#define glRenderbufferStorageMultisampleCoverageNV glad_glRenderbufferStorageMultisampleCoverageNV -#endif -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -GLAPI int GLAD_GL_EXT_timer_query; -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC)(GLuint id, GLenum pname, GLint64* params); -GLAPI PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; -#define glGetQueryObjecti64vEXT glad_glGetQueryObjecti64vEXT -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC)(GLuint id, GLenum pname, GLuint64* params); -GLAPI PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; -#define glGetQueryObjectui64vEXT glad_glGetQueryObjectui64vEXT -#endif -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -GLAPI int GLAD_GL_EXT_vertex_array_bgra; -#endif -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -GLAPI int GLAD_GL_NV_bindless_texture; -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC)(GLuint texture); -GLAPI PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; -#define glGetTextureHandleNV glad_glGetTextureHandleNV -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC)(GLuint texture, GLuint sampler); -GLAPI PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; -#define glGetTextureSamplerHandleNV glad_glGetTextureSamplerHandleNV -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; -#define glMakeTextureHandleResidentNV glad_glMakeTextureHandleResidentNV -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; -#define glMakeTextureHandleNonResidentNV glad_glMakeTextureHandleNonResidentNV -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; -#define glGetImageHandleNV glad_glGetImageHandleNV -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle, GLenum access); -GLAPI PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; -#define glMakeImageHandleResidentNV glad_glMakeImageHandleResidentNV -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; -#define glMakeImageHandleNonResidentNV glad_glMakeImageHandleNonResidentNV -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC)(GLint location, GLuint64 value); -GLAPI PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; -#define glUniformHandleui64NV glad_glUniformHandleui64NV -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; -#define glUniformHandleui64vNV glad_glUniformHandleui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)(GLuint program, GLint location, GLuint64 value); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; -#define glProgramUniformHandleui64NV glad_glProgramUniformHandleui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; -#define glProgramUniformHandleui64vNV glad_glProgramUniformHandleui64vNV -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; -#define glIsTextureHandleResidentNV glad_glIsTextureHandleResidentNV -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; -#define glIsImageHandleResidentNV glad_glIsImageHandleResidentNV -#endif -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -GLAPI int GLAD_GL_KHR_debug; -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -#define glDebugMessageControl glad_glDebugMessageControl -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -#define glDebugMessageInsert glad_glDebugMessageInsert -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -#define glDebugMessageCallback glad_glDebugMessageCallback -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -#define glGetDebugMessageLog glad_glGetDebugMessageLog -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); -GLAPI PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -#define glPushDebugGroup glad_glPushDebugGroup -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC)(); -GLAPI PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -#define glPopDebugGroup glad_glPopDebugGroup -typedef void (APIENTRYP PFNGLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTLABELPROC glad_glObjectLabel; -#define glObjectLabel glad_glObjectLabel -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -#define glGetObjectLabel glad_glGetObjectLabel -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC)(const void* ptr, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -#define glObjectPtrLabel glad_glObjectPtrLabel -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -#define glGetObjectPtrLabel glad_glGetObjectPtrLabel -typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; -#define glGetPointerv glad_glGetPointerv -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; -#define glDebugMessageControlKHR glad_glDebugMessageControlKHR -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; -#define glDebugMessageInsertKHR glad_glDebugMessageInsertKHR -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC)(GLDEBUGPROCKHR callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; -#define glDebugMessageCallbackKHR glad_glDebugMessageCallbackKHR -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; -#define glGetDebugMessageLogKHR glad_glGetDebugMessageLogKHR -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); -GLAPI PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; -#define glPushDebugGroupKHR glad_glPushDebugGroupKHR -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC)(); -GLAPI PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; -#define glPopDebugGroupKHR glad_glPopDebugGroupKHR -typedef void (APIENTRYP PFNGLOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; -#define glObjectLabelKHR glad_glObjectLabelKHR -typedef void (APIENTRYP PFNGLGETOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; -#define glGetObjectLabelKHR glad_glGetObjectLabelKHR -typedef void (APIENTRYP PFNGLOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; -#define glObjectPtrLabelKHR glad_glObjectPtrLabelKHR -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; -#define glGetObjectPtrLabelKHR glad_glGetObjectPtrLabelKHR -typedef void (APIENTRYP PFNGLGETPOINTERVKHRPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; -#define glGetPointervKHR glad_glGetPointervKHR -#endif -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -GLAPI int GLAD_GL_SGIS_texture_border_clamp; -#endif -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -GLAPI int GLAD_GL_ATI_vertex_attrib_array_object; -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; -#define glVertexAttribArrayObjectATI glad_glVertexAttribArrayObjectATI -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; -#define glGetVertexAttribArrayObjectfvATI glad_glGetVertexAttribArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; -#define glGetVertexAttribArrayObjectivATI glad_glGetVertexAttribArrayObjectivATI -#endif -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -GLAPI int GLAD_GL_SGIX_clipmap; -#endif -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -GLAPI int GLAD_GL_EXT_geometry_shader4; -#endif -#ifndef GL_ARB_shader_texture_image_samples -#define GL_ARB_shader_texture_image_samples 1 -GLAPI int GLAD_GL_ARB_shader_texture_image_samples; -#endif -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -GLAPI int GLAD_GL_MESA_ycbcr_texture; -#endif -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -GLAPI int GLAD_GL_MESAX_texture_stack; -#endif -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -GLAPI int GLAD_GL_AMD_seamless_cubemap_per_texture; -#endif -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -GLAPI int GLAD_GL_EXT_bindable_uniform; -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC)(GLuint program, GLint location, GLuint buffer); -GLAPI PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; -#define glUniformBufferEXT glad_glUniformBufferEXT -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC)(GLuint program, GLint location); -GLAPI PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; -#define glGetUniformBufferSizeEXT glad_glGetUniformBufferSizeEXT -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC)(GLuint program, GLint location); -GLAPI PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; -#define glGetUniformOffsetEXT glad_glGetUniformOffsetEXT -#endif -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_hdr; -#endif -#ifndef GL_ARB_shader_ballot -#define GL_ARB_shader_ballot 1 -GLAPI int GLAD_GL_ARB_shader_ballot; -#endif -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -GLAPI int GLAD_GL_KHR_blend_equation_advanced; -typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC)(); -GLAPI PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; -#define glBlendBarrierKHR glad_glBlendBarrierKHR -#endif -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -GLAPI int GLAD_GL_ARB_fragment_program_shadow; -#endif -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -GLAPI int GLAD_GL_ATI_element_array; -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC)(GLenum type, const void* pointer); -GLAPI PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -#define glElementPointerATI glad_glElementPointerATI -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC)(GLenum mode, GLsizei count); -GLAPI PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -#define glDrawElementArrayATI glad_glDrawElementArrayATI -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count); -GLAPI PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -#define glDrawRangeElementArrayATI glad_glDrawRangeElementArrayATI -#endif -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -GLAPI int GLAD_GL_AMD_texture_texture4; -#endif -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -GLAPI int GLAD_GL_SGIX_reference_plane; -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC)(const GLdouble* equation); -GLAPI PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; -#define glReferencePlaneSGIX glad_glReferencePlaneSGIX -#endif -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -GLAPI int GLAD_GL_EXT_stencil_two_side; -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC)(GLenum face); -GLAPI PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; -#define glActiveStencilFaceEXT glad_glActiveStencilFaceEXT -#endif -#ifndef GL_ARB_transform_feedback_overflow_query -#define GL_ARB_transform_feedback_overflow_query 1 -GLAPI int GLAD_GL_ARB_transform_feedback_overflow_query; -#endif -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -GLAPI int GLAD_GL_SGIX_texture_lod_bias; -#endif -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 -GLAPI int GLAD_GL_KHR_no_error; -#endif -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -GLAPI int GLAD_GL_NV_explicit_multisample; -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC)(GLenum pname, GLuint index, GLfloat* val); -GLAPI PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; -#define glGetMultisamplefvNV glad_glGetMultisamplefvNV -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC)(GLuint index, GLbitfield mask); -GLAPI PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; -#define glSampleMaskIndexedNV glad_glSampleMaskIndexedNV -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; -#define glTexRenderbufferNV glad_glTexRenderbufferNV -#endif -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -GLAPI int GLAD_GL_IBM_static_data; -typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC)(GLenum target); -GLAPI PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; -#define glFlushStaticDataIBM glad_glFlushStaticDataIBM -#endif -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -GLAPI int GLAD_GL_EXT_clip_volume_hint; -#endif -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -GLAPI int GLAD_GL_EXT_texture_perturb_normal; -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC)(GLenum mode); -GLAPI PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; -#define glTextureNormalEXT glad_glTextureNormalEXT -#endif -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -GLAPI int GLAD_GL_NV_fragment_program2; -#endif -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -GLAPI int GLAD_GL_NV_fragment_program4; -#endif -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -GLAPI int GLAD_GL_EXT_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; -#define glPointParameterfEXT glad_glPointParameterfEXT -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; -#define glPointParameterfvEXT glad_glPointParameterfvEXT -#endif -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -GLAPI int GLAD_GL_PGI_misc_hints; -typedef void (APIENTRYP PFNGLHINTPGIPROC)(GLenum target, GLint mode); -GLAPI PFNGLHINTPGIPROC glad_glHintPGI; -#define glHintPGI glad_glHintPGI -#endif -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -GLAPI int GLAD_GL_SGIX_subsample; -#endif -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -GLAPI int GLAD_GL_AMD_shader_stencil_export; -#endif -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -GLAPI int GLAD_GL_ARB_shader_texture_lod; -#endif -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -GLAPI int GLAD_GL_ARB_vertex_shader; -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC)(GLhandleARB programObj, GLuint index, const GLcharARB* name); -GLAPI PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -#define glBindAttribLocationARB glad_glBindAttribLocationARB -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); -GLAPI PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -#define glGetActiveAttribARB glad_glGetActiveAttribARB -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); -GLAPI PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -#define glGetAttribLocationARB glad_glGetAttribLocationARB -#endif -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -GLAPI int GLAD_GL_ARB_depth_clamp; -#endif -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -GLAPI int GLAD_GL_SGIS_texture_select; -#endif -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -GLAPI int GLAD_GL_NV_texture_shader; -#endif -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -GLAPI int GLAD_GL_ARB_tessellation_shader; -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC)(GLenum pname, GLint value); -GLAPI PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; -#define glPatchParameteri glad_glPatchParameteri -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC)(GLenum pname, const GLfloat* values); -GLAPI PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; -#define glPatchParameterfv glad_glPatchParameterfv -#endif -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -GLAPI int GLAD_GL_EXT_draw_buffers2; -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; -#define glColorMaskIndexedEXT glad_glColorMaskIndexedEXT -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC)(GLenum target, GLuint index, GLboolean* data); -GLAPI PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; -#define glGetBooleanIndexedvEXT glad_glGetBooleanIndexedvEXT -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC)(GLenum target, GLuint index, GLint* data); -GLAPI PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; -#define glGetIntegerIndexedvEXT glad_glGetIntegerIndexedvEXT -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; -#define glEnableIndexedEXT glad_glEnableIndexedEXT -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; -#define glDisableIndexedEXT glad_glDisableIndexedEXT -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; -#define glIsEnabledIndexedEXT glad_glIsEnabledIndexedEXT -#endif -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -GLAPI int GLAD_GL_ARB_vertex_attrib_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; -#define glVertexAttribL1d glad_glVertexAttribL1d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; -#define glVertexAttribL2d glad_glVertexAttribL2d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; -#define glVertexAttribL3d glad_glVertexAttribL3d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; -#define glVertexAttribL4d glad_glVertexAttribL4d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; -#define glVertexAttribL1dv glad_glVertexAttribL1dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; -#define glVertexAttribL2dv glad_glVertexAttribL2dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; -#define glVertexAttribL3dv glad_glVertexAttribL3dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; -#define glVertexAttribL4dv glad_glVertexAttribL4dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; -#define glVertexAttribLPointer glad_glVertexAttribLPointer -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; -#define glGetVertexAttribLdv glad_glGetVertexAttribLdv -#endif -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 -GLAPI int GLAD_GL_EXT_texture_filter_minmax; -typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC)(GLuint samples, GLboolean fixedsamplelocations); -GLAPI PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; -#define glRasterSamplesEXT glad_glRasterSamplesEXT -#endif -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -GLAPI int GLAD_GL_WIN_specular_fog; -#endif -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 -GLAPI int GLAD_GL_AMD_interleaved_elements; -typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC)(GLuint index, GLenum pname, GLint param); -GLAPI PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; -#define glVertexAttribParameteriAMD glad_glVertexAttribParameteriAMD -#endif -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -GLAPI int GLAD_GL_ARB_fragment_program; -#endif -#ifndef GL_OML_resample -#define GL_OML_resample 1 -GLAPI int GLAD_GL_OML_resample; -#endif -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -GLAPI int GLAD_GL_APPLE_ycbcr_422; -#endif -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -GLAPI int GLAD_GL_SGIX_texture_add_env; -#endif -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -GLAPI int GLAD_GL_ARB_shadow_ambient; -#endif -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -GLAPI int GLAD_GL_ARB_texture_storage; -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; -#define glTexStorage1D glad_glTexStorage1D -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; -#define glTexStorage2D glad_glTexStorage2D -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; -#define glTexStorage3D glad_glTexStorage3D -#endif -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -GLAPI int GLAD_GL_EXT_pixel_buffer_object; -#endif -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 -GLAPI int GLAD_GL_ARB_copy_image; -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; -#define glCopyImageSubData glad_glCopyImageSubData -#endif -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -GLAPI int GLAD_GL_SGIS_pixel_texture; -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC)(GLenum pname, GLint param); -GLAPI PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; -#define glPixelTexGenParameteriSGIS glad_glPixelTexGenParameteriSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; -#define glPixelTexGenParameterivSGIS glad_glPixelTexGenParameterivSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; -#define glPixelTexGenParameterfSGIS glad_glPixelTexGenParameterfSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; -#define glPixelTexGenParameterfvSGIS glad_glPixelTexGenParameterfvSGIS -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, GLint* params); -GLAPI PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; -#define glGetPixelTexGenParameterivSGIS glad_glGetPixelTexGenParameterivSGIS -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, GLfloat* params); -GLAPI PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; -#define glGetPixelTexGenParameterfvSGIS glad_glGetPixelTexGenParameterfvSGIS -#endif -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -GLAPI int GLAD_GL_SGIS_generate_mipmap; -#endif -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -GLAPI int GLAD_GL_SGIX_instruments; -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC)(); -GLAPI PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; -#define glGetInstrumentsSGIX glad_glGetInstrumentsSGIX -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC)(GLsizei size, GLint* buffer); -GLAPI PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; -#define glInstrumentsBufferSGIX glad_glInstrumentsBufferSGIX -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC)(GLint* marker_p); -GLAPI PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; -#define glPollInstrumentsSGIX glad_glPollInstrumentsSGIX -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC)(GLint marker); -GLAPI PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; -#define glReadInstrumentsSGIX glad_glReadInstrumentsSGIX -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC)(); -GLAPI PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; -#define glStartInstrumentsSGIX glad_glStartInstrumentsSGIX -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC)(GLint marker); -GLAPI PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; -#define glStopInstrumentsSGIX glad_glStopInstrumentsSGIX -#endif -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -GLAPI int GLAD_GL_HP_texture_lighting; -#endif -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 -GLAPI int GLAD_GL_ARB_shader_storage_buffer_object; -typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -GLAPI PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; -#define glShaderStorageBlockBinding glad_glShaderStorageBlockBinding -#endif -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 -GLAPI int GLAD_GL_EXT_sparse_texture2; -#endif -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -GLAPI int GLAD_GL_EXT_blend_minmax; -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC)(GLenum mode); -GLAPI PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; -#define glBlendEquationEXT glad_glBlendEquationEXT -#endif -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -GLAPI int GLAD_GL_MESA_pack_invert; -#endif -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -GLAPI int GLAD_GL_ARB_base_instance; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GLAPI PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; -#define glDrawArraysInstancedBaseInstance glad_glDrawArraysInstancedBaseInstance -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLuint baseinstance); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; -#define glDrawElementsInstancedBaseInstance glad_glDrawElementsInstancedBaseInstance -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; -#define glDrawElementsInstancedBaseVertexBaseInstance glad_glDrawElementsInstancedBaseVertexBaseInstance -#endif -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -GLAPI int GLAD_GL_SGIX_convolution_accuracy; -#endif -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -GLAPI int GLAD_GL_PGI_vertex_hints; -#endif -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -GLAPI int GLAD_GL_AMD_transform_feedback4; -#endif -#ifndef GL_ARB_ES3_1_compatibility -#define GL_ARB_ES3_1_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_1_compatibility; -typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; -#define glMemoryBarrierByRegion glad_glMemoryBarrierByRegion -#endif -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -GLAPI int GLAD_GL_EXT_texture_integer; -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; -#define glTexParameterIivEXT glad_glTexParameterIivEXT -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; -#define glTexParameterIuivEXT glad_glTexParameterIuivEXT -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; -#define glGetTexParameterIivEXT glad_glGetTexParameterIivEXT -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; -#define glGetTexParameterIuivEXT glad_glGetTexParameterIuivEXT -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC)(GLint red, GLint green, GLint blue, GLint alpha); -GLAPI PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; -#define glClearColorIiEXT glad_glClearColorIiEXT -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLAPI PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; -#define glClearColorIuiEXT glad_glClearColorIuiEXT -#endif -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -GLAPI int GLAD_GL_ARB_texture_multisample; -#endif -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -GLAPI int GLAD_GL_AMD_gpu_shader_int64; -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC)(GLint location, GLint64EXT x); -GLAPI PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; -#define glUniform1i64NV glad_glUniform1i64NV -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; -#define glUniform2i64NV glad_glUniform2i64NV -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; -#define glUniform3i64NV glad_glUniform3i64NV -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; -#define glUniform4i64NV glad_glUniform4i64NV -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; -#define glUniform1i64vNV glad_glUniform1i64vNV -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; -#define glUniform2i64vNV glad_glUniform2i64vNV -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; -#define glUniform3i64vNV glad_glUniform3i64vNV -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; -#define glUniform4i64vNV glad_glUniform4i64vNV -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC)(GLint location, GLuint64EXT x); -GLAPI PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; -#define glUniform1ui64NV glad_glUniform1ui64NV -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; -#define glUniform2ui64NV glad_glUniform2ui64NV -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; -#define glUniform3ui64NV glad_glUniform3ui64NV -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; -#define glUniform4ui64NV glad_glUniform4ui64NV -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; -#define glUniform1ui64vNV glad_glUniform1ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; -#define glUniform2ui64vNV glad_glUniform2ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; -#define glUniform3ui64vNV glad_glUniform3ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; -#define glUniform4ui64vNV glad_glUniform4ui64vNV -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC)(GLuint program, GLint location, GLint64EXT* params); -GLAPI PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; -#define glGetUniformi64vNV glad_glGetUniformi64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC)(GLuint program, GLint location, GLint64EXT x); -GLAPI PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; -#define glProgramUniform1i64NV glad_glProgramUniform1i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; -#define glProgramUniform2i64NV glad_glProgramUniform2i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; -#define glProgramUniform3i64NV glad_glProgramUniform3i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; -#define glProgramUniform4i64NV glad_glProgramUniform4i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; -#define glProgramUniform1i64vNV glad_glProgramUniform1i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; -#define glProgramUniform2i64vNV glad_glProgramUniform2i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; -#define glProgramUniform3i64vNV glad_glProgramUniform3i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; -#define glProgramUniform4i64vNV glad_glProgramUniform4i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x); -GLAPI PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; -#define glProgramUniform1ui64NV glad_glProgramUniform1ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; -#define glProgramUniform2ui64NV glad_glProgramUniform2ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; -#define glProgramUniform3ui64NV glad_glProgramUniform3ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; -#define glProgramUniform4ui64NV glad_glProgramUniform4ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; -#define glProgramUniform1ui64vNV glad_glProgramUniform1ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; -#define glProgramUniform2ui64vNV glad_glProgramUniform2ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; -#define glProgramUniform3ui64vNV glad_glProgramUniform3ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; -#define glProgramUniform4ui64vNV glad_glProgramUniform4ui64vNV -#endif -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -GLAPI int GLAD_GL_S3_s3tc; -#endif -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 -GLAPI int GLAD_GL_ARB_query_buffer_object; -#endif -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 -GLAPI int GLAD_GL_AMD_vertex_shader_tessellator; -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC)(GLfloat factor); -GLAPI PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; -#define glTessellationFactorAMD glad_glTessellationFactorAMD -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC)(GLenum mode); -GLAPI PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; -#define glTessellationModeAMD glad_glTessellationModeAMD -#endif -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 -GLAPI int GLAD_GL_ARB_invalidate_subdata; -typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; -#define glInvalidateTexSubImage glad_glInvalidateTexSubImage -typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC)(GLuint texture, GLint level); -GLAPI PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; -#define glInvalidateTexImage glad_glInvalidateTexImage -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; -#define glInvalidateBufferSubData glad_glInvalidateBufferSubData -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer); -GLAPI PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; -#define glInvalidateBufferData glad_glInvalidateBufferData -typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments); -GLAPI PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; -#define glInvalidateFramebuffer glad_glInvalidateFramebuffer -typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; -#define glInvalidateSubFramebuffer glad_glInvalidateSubFramebuffer -#endif -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -GLAPI int GLAD_GL_EXT_index_material; -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC)(GLenum face, GLenum mode); -GLAPI PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; -#define glIndexMaterialEXT glad_glIndexMaterialEXT -#endif -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -GLAPI int GLAD_GL_NV_blend_equation_advanced_coherent; -#endif -#ifndef GL_KHR_texture_compression_astc_sliced_3d -#define GL_KHR_texture_compression_astc_sliced_3d 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_sliced_3d; -#endif -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -GLAPI int GLAD_GL_INTEL_parallel_arrays; -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; -#define glVertexPointervINTEL glad_glVertexPointervINTEL -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC)(GLenum type, const void** pointer); -GLAPI PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; -#define glNormalPointervINTEL glad_glNormalPointervINTEL -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; -#define glColorPointervINTEL glad_glColorPointervINTEL -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; -#define glTexCoordPointervINTEL glad_glTexCoordPointervINTEL -#endif -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -GLAPI int GLAD_GL_ATI_draw_buffers; -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; -#define glDrawBuffersATI glad_glDrawBuffersATI -#endif -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -GLAPI int GLAD_GL_EXT_cmyka; -#endif -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -GLAPI int GLAD_GL_SGIX_pixel_texture; -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC)(GLenum mode); -GLAPI PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; -#define glPixelTexGenSGIX glad_glPixelTexGenSGIX -#endif -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -GLAPI int GLAD_GL_APPLE_specular_vector; -#endif -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -GLAPI int GLAD_GL_ARB_compatibility; -#endif -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -GLAPI int GLAD_GL_ARB_timer_query; -#endif -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -GLAPI int GLAD_GL_SGIX_interlace; -#endif -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -GLAPI int GLAD_GL_NV_parameter_buffer_object; -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; -#define glProgramBufferParametersfvNV glad_glProgramBufferParametersfvNV -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; -#define glProgramBufferParametersIivNV glad_glProgramBufferParametersIivNV -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; -#define glProgramBufferParametersIuivNV glad_glProgramBufferParametersIuivNV -#endif -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 -GLAPI int GLAD_GL_AMD_shader_trinary_minmax; -#endif -#ifndef GL_ARB_direct_state_access -#define GL_ARB_direct_state_access 1 -GLAPI int GLAD_GL_ARB_direct_state_access; -typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; -#define glCreateTransformFeedbacks glad_glCreateTransformFeedbacks -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)(GLuint xfb, GLuint index, GLuint buffer); -GLAPI PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; -#define glTransformFeedbackBufferBase glad_glTransformFeedbackBufferBase -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; -#define glTransformFeedbackBufferRange glad_glTransformFeedbackBufferRange -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC)(GLuint xfb, GLenum pname, GLint* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; -#define glGetTransformFeedbackiv glad_glGetTransformFeedbackiv -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; -#define glGetTransformFeedbacki_v glad_glGetTransformFeedbacki_v -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint64* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; -#define glGetTransformFeedbacki64_v glad_glGetTransformFeedbacki64_v -typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; -#define glCreateBuffers glad_glCreateBuffers -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; -#define glNamedBufferStorage glad_glNamedBufferStorage -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; -#define glNamedBufferData glad_glNamedBufferData -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; -#define glNamedBufferSubData glad_glNamedBufferSubData -typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; -#define glCopyNamedBufferSubData glad_glCopyNamedBufferSubData -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; -#define glClearNamedBufferData glad_glClearNamedBufferData -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; -#define glClearNamedBufferSubData glad_glClearNamedBufferSubData -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; -#define glMapNamedBuffer glad_glMapNamedBuffer -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; -#define glMapNamedBufferRange glad_glMapNamedBufferRange -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC)(GLuint buffer); -GLAPI PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; -#define glUnmapNamedBuffer glad_glUnmapNamedBuffer -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; -#define glFlushMappedNamedBufferRange glad_glFlushMappedNamedBufferRange -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; -#define glGetNamedBufferParameteriv glad_glGetNamedBufferParameteriv -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)(GLuint buffer, GLenum pname, GLint64* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; -#define glGetNamedBufferParameteri64v glad_glGetNamedBufferParameteri64v -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC)(GLuint buffer, GLenum pname, void** params); -GLAPI PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; -#define glGetNamedBufferPointerv glad_glGetNamedBufferPointerv -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; -#define glGetNamedBufferSubData glad_glGetNamedBufferSubData -typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; -#define glCreateFramebuffers glad_glCreateFramebuffers -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; -#define glNamedFramebufferRenderbuffer glad_glNamedFramebufferRenderbuffer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)(GLuint framebuffer, GLenum pname, GLint param); -GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; -#define glNamedFramebufferParameteri glad_glNamedFramebufferParameteri -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; -#define glNamedFramebufferTexture glad_glNamedFramebufferTexture -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; -#define glNamedFramebufferTextureLayer glad_glNamedFramebufferTextureLayer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)(GLuint framebuffer, GLenum buf); -GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; -#define glNamedFramebufferDrawBuffer glad_glNamedFramebufferDrawBuffer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); -GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; -#define glNamedFramebufferDrawBuffers glad_glNamedFramebufferDrawBuffers -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)(GLuint framebuffer, GLenum src); -GLAPI PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; -#define glNamedFramebufferReadBuffer glad_glNamedFramebufferReadBuffer -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); -GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; -#define glInvalidateNamedFramebufferData glad_glInvalidateNamedFramebufferData -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; -#define glInvalidateNamedFramebufferSubData glad_glInvalidateNamedFramebufferSubData -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; -#define glClearNamedFramebufferiv glad_glClearNamedFramebufferiv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; -#define glClearNamedFramebufferuiv glad_glClearNamedFramebufferuiv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; -#define glClearNamedFramebufferfv glad_glClearNamedFramebufferfv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; -#define glClearNamedFramebufferfi glad_glClearNamedFramebufferfi -typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; -#define glBlitNamedFramebuffer glad_glBlitNamedFramebuffer -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)(GLuint framebuffer, GLenum target); -GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; -#define glCheckNamedFramebufferStatus glad_glCheckNamedFramebufferStatus -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)(GLuint framebuffer, GLenum pname, GLint* param); -GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; -#define glGetNamedFramebufferParameteriv glad_glGetNamedFramebufferParameteriv -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; -#define glGetNamedFramebufferAttachmentParameteriv glad_glGetNamedFramebufferAttachmentParameteriv -typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; -#define glCreateRenderbuffers glad_glCreateRenderbuffers -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; -#define glNamedRenderbufferStorage glad_glNamedRenderbufferStorage -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; -#define glNamedRenderbufferStorageMultisample glad_glNamedRenderbufferStorageMultisample -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)(GLuint renderbuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; -#define glGetNamedRenderbufferParameteriv glad_glGetNamedRenderbufferParameteriv -typedef void (APIENTRYP PFNGLCREATETEXTURESPROC)(GLenum target, GLsizei n, GLuint* textures); -GLAPI PFNGLCREATETEXTURESPROC glad_glCreateTextures; -#define glCreateTextures glad_glCreateTextures -typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC)(GLuint texture, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; -#define glTextureBuffer glad_glTextureBuffer -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; -#define glTextureBufferRange glad_glTextureBufferRange -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; -#define glTextureStorage1D glad_glTextureStorage1D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; -#define glTextureStorage2D glad_glTextureStorage2D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; -#define glTextureStorage3D glad_glTextureStorage3D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; -#define glTextureStorage2DMultisample glad_glTextureStorage2DMultisample -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; -#define glTextureStorage3DMultisample glad_glTextureStorage3DMultisample -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; -#define glTextureSubImage1D glad_glTextureSubImage1D -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; -#define glTextureSubImage2D glad_glTextureSubImage2D -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; -#define glTextureSubImage3D glad_glTextureSubImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; -#define glCompressedTextureSubImage1D glad_glCompressedTextureSubImage1D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; -#define glCompressedTextureSubImage2D glad_glCompressedTextureSubImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; -#define glCompressedTextureSubImage3D glad_glCompressedTextureSubImage3D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; -#define glCopyTextureSubImage1D glad_glCopyTextureSubImage1D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; -#define glCopyTextureSubImage2D glad_glCopyTextureSubImage2D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; -#define glCopyTextureSubImage3D glad_glCopyTextureSubImage3D -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC)(GLuint texture, GLenum pname, GLfloat param); -GLAPI PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; -#define glTextureParameterf glad_glTextureParameterf -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, const GLfloat* param); -GLAPI PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; -#define glTextureParameterfv glad_glTextureParameterfv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC)(GLuint texture, GLenum pname, GLint param); -GLAPI PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; -#define glTextureParameteri glad_glTextureParameteri -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; -#define glTextureParameterIiv glad_glTextureParameterIiv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; -#define glTextureParameterIuiv glad_glTextureParameterIuiv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, const GLint* param); -GLAPI PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; -#define glTextureParameteriv glad_glTextureParameteriv -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC)(GLuint texture); -GLAPI PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; -#define glGenerateTextureMipmap glad_glGenerateTextureMipmap -typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC)(GLuint unit, GLuint texture); -GLAPI PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; -#define glBindTextureUnit glad_glBindTextureUnit -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; -#define glGetTextureImage glad_glGetTextureImage -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; -#define glGetCompressedTextureImage glad_glGetCompressedTextureImage -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC)(GLuint texture, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; -#define glGetTextureLevelParameterfv glad_glGetTextureLevelParameterfv -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC)(GLuint texture, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; -#define glGetTextureLevelParameteriv glad_glGetTextureLevelParameteriv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; -#define glGetTextureParameterfv glad_glGetTextureParameterfv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; -#define glGetTextureParameterIiv glad_glGetTextureParameterIiv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; -#define glGetTextureParameterIuiv glad_glGetTextureParameterIuiv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; -#define glGetTextureParameteriv glad_glGetTextureParameteriv -typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; -#define glCreateVertexArrays glad_glCreateVertexArrays -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; -#define glDisableVertexArrayAttrib glad_glDisableVertexArrayAttrib -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; -#define glEnableVertexArrayAttrib glad_glEnableVertexArrayAttrib -typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint vaobj, GLuint buffer); -GLAPI PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; -#define glVertexArrayElementBuffer glad_glVertexArrayElementBuffer -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; -#define glVertexArrayVertexBuffer glad_glVertexArrayVertexBuffer -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); -GLAPI PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; -#define glVertexArrayVertexBuffers glad_glVertexArrayVertexBuffers -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; -#define glVertexArrayAttribBinding glad_glVertexArrayAttribBinding -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; -#define glVertexArrayAttribFormat glad_glVertexArrayAttribFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; -#define glVertexArrayAttribIFormat glad_glVertexArrayAttribIFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; -#define glVertexArrayAttribLFormat glad_glVertexArrayAttribLFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; -#define glVertexArrayBindingDivisor glad_glVertexArrayBindingDivisor -typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC)(GLuint vaobj, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; -#define glGetVertexArrayiv glad_glGetVertexArrayiv -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; -#define glGetVertexArrayIndexediv glad_glGetVertexArrayIndexediv -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint64* param); -GLAPI PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; -#define glGetVertexArrayIndexed64iv glad_glGetVertexArrayIndexed64iv -typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC)(GLsizei n, GLuint* samplers); -GLAPI PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; -#define glCreateSamplers glad_glCreateSamplers -typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; -#define glCreateProgramPipelines glad_glCreateProgramPipelines -typedef void (APIENTRYP PFNGLCREATEQUERIESPROC)(GLenum target, GLsizei n, GLuint* ids); -GLAPI PFNGLCREATEQUERIESPROC glad_glCreateQueries; -#define glCreateQueries glad_glCreateQueries -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; -#define glGetQueryBufferObjecti64v glad_glGetQueryBufferObjecti64v -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; -#define glGetQueryBufferObjectiv glad_glGetQueryBufferObjectiv -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; -#define glGetQueryBufferObjectui64v glad_glGetQueryBufferObjectui64v -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; -#define glGetQueryBufferObjectuiv glad_glGetQueryBufferObjectuiv -#endif -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -GLAPI int GLAD_GL_EXT_rescale_normal; -#endif -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -GLAPI int GLAD_GL_ARB_pixel_buffer_object; -#endif -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -GLAPI int GLAD_GL_ARB_uniform_buffer_object; -#endif -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 -GLAPI int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; -#endif -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -GLAPI int GLAD_GL_ARB_texture_swizzle; -#endif -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -GLAPI int GLAD_GL_NV_transform_feedback2; -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; -#define glBindTransformFeedbackNV glad_glBindTransformFeedbackNV -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; -#define glDeleteTransformFeedbacksNV glad_glDeleteTransformFeedbacksNV -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; -#define glGenTransformFeedbacksNV glad_glGenTransformFeedbacksNV -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC)(GLuint id); -GLAPI PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; -#define glIsTransformFeedbackNV glad_glIsTransformFeedbackNV -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; -#define glPauseTransformFeedbackNV glad_glPauseTransformFeedbackNV -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; -#define glResumeTransformFeedbackNV glad_glResumeTransformFeedbackNV -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC)(GLenum mode, GLuint id); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; -#define glDrawTransformFeedbackNV glad_glDrawTransformFeedbackNV -#endif -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -GLAPI int GLAD_GL_SGIX_async_pixel; -#endif -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -GLAPI int GLAD_GL_NV_fragment_program_option; -#endif -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -GLAPI int GLAD_GL_ARB_explicit_attrib_location; -#endif -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -GLAPI int GLAD_GL_EXT_blend_color; -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -#define glBlendColorEXT glad_glBlendColorEXT -#endif -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -GLAPI int GLAD_GL_NV_shader_thread_group; -#endif -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -GLAPI int GLAD_GL_EXT_stencil_wrap; -#endif -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -GLAPI int GLAD_GL_EXT_index_array_formats; -#endif -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 -GLAPI int GLAD_GL_OVR_multiview2; -#endif -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -GLAPI int GLAD_GL_EXT_histogram; -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; -#define glGetHistogramEXT glad_glGetHistogramEXT -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; -#define glGetHistogramParameterfvEXT glad_glGetHistogramParameterfvEXT -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; -#define glGetHistogramParameterivEXT glad_glGetHistogramParameterivEXT -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; -#define glGetMinmaxEXT glad_glGetMinmaxEXT -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; -#define glGetMinmaxParameterfvEXT glad_glGetMinmaxParameterfvEXT -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; -#define glGetMinmaxParameterivEXT glad_glGetMinmaxParameterivEXT -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; -#define glHistogramEXT glad_glHistogramEXT -typedef void (APIENTRYP PFNGLMINMAXEXTPROC)(GLenum target, GLenum internalformat, GLboolean sink); -GLAPI PFNGLMINMAXEXTPROC glad_glMinmaxEXT; -#define glMinmaxEXT glad_glMinmaxEXT -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC)(GLenum target); -GLAPI PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; -#define glResetHistogramEXT glad_glResetHistogramEXT -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC)(GLenum target); -GLAPI PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; -#define glResetMinmaxEXT glad_glResetMinmaxEXT -#endif -#ifndef GL_ARB_get_texture_sub_image -#define GL_ARB_get_texture_sub_image 1 -GLAPI int GLAD_GL_ARB_get_texture_sub_image; -typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; -#define glGetTextureSubImage glad_glGetTextureSubImage -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; -#define glGetCompressedTextureSubImage glad_glGetCompressedTextureSubImage -#endif -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -GLAPI int GLAD_GL_SGIS_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; -#define glPointParameterfSGIS glad_glPointParameterfSGIS -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; -#define glPointParameterfvSGIS glad_glPointParameterfvSGIS -#endif -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -GLAPI int GLAD_GL_SGIX_ycrcb; -#endif -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -GLAPI int GLAD_GL_EXT_direct_state_access; -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; -#define glMatrixLoadfEXT glad_glMatrixLoadfEXT -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; -#define glMatrixLoaddEXT glad_glMatrixLoaddEXT -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; -#define glMatrixMultfEXT glad_glMatrixMultfEXT -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; -#define glMatrixMultdEXT glad_glMatrixMultdEXT -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; -#define glMatrixLoadIdentityEXT glad_glMatrixLoadIdentityEXT -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC)(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; -#define glMatrixRotatefEXT glad_glMatrixRotatefEXT -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC)(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; -#define glMatrixRotatedEXT glad_glMatrixRotatedEXT -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; -#define glMatrixScalefEXT glad_glMatrixScalefEXT -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; -#define glMatrixScaledEXT glad_glMatrixScaledEXT -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; -#define glMatrixTranslatefEXT glad_glMatrixTranslatefEXT -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; -#define glMatrixTranslatedEXT glad_glMatrixTranslatedEXT -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; -#define glMatrixFrustumEXT glad_glMatrixFrustumEXT -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; -#define glMatrixOrthoEXT glad_glMatrixOrthoEXT -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; -#define glMatrixPopEXT glad_glMatrixPopEXT -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; -#define glMatrixPushEXT glad_glMatrixPushEXT -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); -GLAPI PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; -#define glClientAttribDefaultEXT glad_glClientAttribDefaultEXT -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); -GLAPI PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; -#define glPushClientAttribDefaultEXT glad_glPushClientAttribDefaultEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; -#define glTextureParameterfEXT glad_glTextureParameterfEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; -#define glTextureParameterfvEXT glad_glTextureParameterfvEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; -#define glTextureParameteriEXT glad_glTextureParameteriEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; -#define glTextureParameterivEXT glad_glTextureParameterivEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; -#define glTextureImage1DEXT glad_glTextureImage1DEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; -#define glTextureImage2DEXT glad_glTextureImage2DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; -#define glTextureSubImage1DEXT glad_glTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; -#define glTextureSubImage2DEXT glad_glTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; -#define glCopyTextureImage1DEXT glad_glCopyTextureImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; -#define glCopyTextureImage2DEXT glad_glCopyTextureImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; -#define glCopyTextureSubImage1DEXT glad_glCopyTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; -#define glCopyTextureSubImage2DEXT glad_glCopyTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; -#define glGetTextureImageEXT glad_glGetTextureImageEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; -#define glGetTextureParameterfvEXT glad_glGetTextureParameterfvEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; -#define glGetTextureParameterivEXT glad_glGetTextureParameterivEXT -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; -#define glGetTextureLevelParameterfvEXT glad_glGetTextureLevelParameterfvEXT -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; -#define glGetTextureLevelParameterivEXT glad_glGetTextureLevelParameterivEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; -#define glTextureImage3DEXT glad_glTextureImage3DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; -#define glTextureSubImage3DEXT glad_glTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; -#define glCopyTextureSubImage3DEXT glad_glCopyTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC)(GLenum texunit, GLenum target, GLuint texture); -GLAPI PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; -#define glBindMultiTextureEXT glad_glBindMultiTextureEXT -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC)(GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; -#define glMultiTexCoordPointerEXT glad_glMultiTexCoordPointerEXT -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; -#define glMultiTexEnvfEXT glad_glMultiTexEnvfEXT -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; -#define glMultiTexEnvfvEXT glad_glMultiTexEnvfvEXT -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; -#define glMultiTexEnviEXT glad_glMultiTexEnviEXT -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; -#define glMultiTexEnvivEXT glad_glMultiTexEnvivEXT -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; -#define glMultiTexGendEXT glad_glMultiTexGendEXT -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); -GLAPI PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; -#define glMultiTexGendvEXT glad_glMultiTexGendvEXT -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; -#define glMultiTexGenfEXT glad_glMultiTexGenfEXT -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; -#define glMultiTexGenfvEXT glad_glMultiTexGenfvEXT -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; -#define glMultiTexGeniEXT glad_glMultiTexGeniEXT -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; -#define glMultiTexGenivEXT glad_glMultiTexGenivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; -#define glGetMultiTexEnvfvEXT glad_glGetMultiTexEnvfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; -#define glGetMultiTexEnvivEXT glad_glGetMultiTexEnvivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); -GLAPI PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; -#define glGetMultiTexGendvEXT glad_glGetMultiTexGendvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; -#define glGetMultiTexGenfvEXT glad_glGetMultiTexGenfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; -#define glGetMultiTexGenivEXT glad_glGetMultiTexGenivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; -#define glMultiTexParameteriEXT glad_glMultiTexParameteriEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; -#define glMultiTexParameterivEXT glad_glMultiTexParameterivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; -#define glMultiTexParameterfEXT glad_glMultiTexParameterfEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; -#define glMultiTexParameterfvEXT glad_glMultiTexParameterfvEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; -#define glMultiTexImage1DEXT glad_glMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; -#define glMultiTexImage2DEXT glad_glMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; -#define glMultiTexSubImage1DEXT glad_glMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; -#define glMultiTexSubImage2DEXT glad_glMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; -#define glCopyMultiTexImage1DEXT glad_glCopyMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; -#define glCopyMultiTexImage2DEXT glad_glCopyMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; -#define glCopyMultiTexSubImage1DEXT glad_glCopyMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; -#define glCopyMultiTexSubImage2DEXT glad_glCopyMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; -#define glGetMultiTexImageEXT glad_glGetMultiTexImageEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; -#define glGetMultiTexParameterfvEXT glad_glGetMultiTexParameterfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; -#define glGetMultiTexParameterivEXT glad_glGetMultiTexParameterivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; -#define glGetMultiTexLevelParameterfvEXT glad_glGetMultiTexLevelParameterfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; -#define glGetMultiTexLevelParameterivEXT glad_glGetMultiTexLevelParameterivEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; -#define glMultiTexImage3DEXT glad_glMultiTexImage3DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; -#define glMultiTexSubImage3DEXT glad_glMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; -#define glCopyMultiTexSubImage3DEXT glad_glCopyMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; -#define glEnableClientStateIndexedEXT glad_glEnableClientStateIndexedEXT -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; -#define glDisableClientStateIndexedEXT glad_glDisableClientStateIndexedEXT -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC)(GLenum target, GLuint index, GLfloat* data); -GLAPI PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; -#define glGetFloatIndexedvEXT glad_glGetFloatIndexedvEXT -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC)(GLenum target, GLuint index, GLdouble* data); -GLAPI PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; -#define glGetDoubleIndexedvEXT glad_glGetDoubleIndexedvEXT -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC)(GLenum target, GLuint index, void** data); -GLAPI PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; -#define glGetPointerIndexedvEXT glad_glGetPointerIndexedvEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; -#define glCompressedTextureImage3DEXT glad_glCompressedTextureImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; -#define glCompressedTextureImage2DEXT glad_glCompressedTextureImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; -#define glCompressedTextureImage1DEXT glad_glCompressedTextureImage1DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; -#define glCompressedTextureSubImage3DEXT glad_glCompressedTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; -#define glCompressedTextureSubImage2DEXT glad_glCompressedTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; -#define glCompressedTextureSubImage1DEXT glad_glCompressedTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint lod, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; -#define glGetCompressedTextureImageEXT glad_glGetCompressedTextureImageEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; -#define glCompressedMultiTexImage3DEXT glad_glCompressedMultiTexImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; -#define glCompressedMultiTexImage2DEXT glad_glCompressedMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; -#define glCompressedMultiTexImage1DEXT glad_glCompressedMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; -#define glCompressedMultiTexSubImage3DEXT glad_glCompressedMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; -#define glCompressedMultiTexSubImage2DEXT glad_glCompressedMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; -#define glCompressedMultiTexSubImage1DEXT glad_glCompressedMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint lod, void* img); -GLAPI PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; -#define glGetCompressedMultiTexImageEXT glad_glGetCompressedMultiTexImageEXT -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; -#define glMatrixLoadTransposefEXT glad_glMatrixLoadTransposefEXT -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; -#define glMatrixLoadTransposedEXT glad_glMatrixLoadTransposedEXT -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; -#define glMatrixMultTransposefEXT glad_glMatrixMultTransposefEXT -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; -#define glMatrixMultTransposedEXT glad_glMatrixMultTransposedEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; -#define glNamedBufferDataEXT glad_glNamedBufferDataEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; -#define glNamedBufferSubDataEXT glad_glNamedBufferSubDataEXT -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; -#define glMapNamedBufferEXT glad_glMapNamedBufferEXT -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC)(GLuint buffer); -GLAPI PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; -#define glUnmapNamedBufferEXT glad_glUnmapNamedBufferEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; -#define glGetNamedBufferParameterivEXT glad_glGetNamedBufferParameterivEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)(GLuint buffer, GLenum pname, void** params); -GLAPI PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; -#define glGetNamedBufferPointervEXT glad_glGetNamedBufferPointervEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; -#define glGetNamedBufferSubDataEXT glad_glGetNamedBufferSubDataEXT -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; -#define glTextureBufferEXT glad_glTextureBufferEXT -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC)(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; -#define glMultiTexBufferEXT glad_glMultiTexBufferEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; -#define glTextureParameterIivEXT glad_glTextureParameterIivEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; -#define glTextureParameterIuivEXT glad_glTextureParameterIuivEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; -#define glGetTextureParameterIivEXT glad_glGetTextureParameterIivEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; -#define glGetTextureParameterIuivEXT glad_glGetTextureParameterIuivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; -#define glMultiTexParameterIivEXT glad_glMultiTexParameterIivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; -#define glMultiTexParameterIuivEXT glad_glMultiTexParameterIuivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; -#define glGetMultiTexParameterIivEXT glad_glGetMultiTexParameterIivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; -#define glGetMultiTexParameterIuivEXT glad_glGetMultiTexParameterIuivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; -#define glNamedProgramLocalParameters4fvEXT glad_glNamedProgramLocalParameters4fvEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; -#define glNamedProgramLocalParameterI4iEXT glad_glNamedProgramLocalParameterI4iEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; -#define glNamedProgramLocalParameterI4ivEXT glad_glNamedProgramLocalParameterI4ivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; -#define glNamedProgramLocalParametersI4ivEXT glad_glNamedProgramLocalParametersI4ivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; -#define glNamedProgramLocalParameterI4uiEXT glad_glNamedProgramLocalParameterI4uiEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; -#define glNamedProgramLocalParameterI4uivEXT glad_glNamedProgramLocalParameterI4uivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; -#define glNamedProgramLocalParametersI4uivEXT glad_glNamedProgramLocalParametersI4uivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; -#define glGetNamedProgramLocalParameterIivEXT glad_glGetNamedProgramLocalParameterIivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; -#define glGetNamedProgramLocalParameterIuivEXT glad_glGetNamedProgramLocalParameterIuivEXT -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; -#define glEnableClientStateiEXT glad_glEnableClientStateiEXT -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; -#define glDisableClientStateiEXT glad_glDisableClientStateiEXT -typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC)(GLenum pname, GLuint index, GLfloat* params); -GLAPI PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; -#define glGetFloati_vEXT glad_glGetFloati_vEXT -typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC)(GLenum pname, GLuint index, GLdouble* params); -GLAPI PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; -#define glGetDoublei_vEXT glad_glGetDoublei_vEXT -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC)(GLenum pname, GLuint index, void** params); -GLAPI PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; -#define glGetPointeri_vEXT glad_glGetPointeri_vEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); -GLAPI PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; -#define glNamedProgramStringEXT glad_glNamedProgramStringEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; -#define glNamedProgramLocalParameter4dEXT glad_glNamedProgramLocalParameter4dEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; -#define glNamedProgramLocalParameter4dvEXT glad_glNamedProgramLocalParameter4dvEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; -#define glNamedProgramLocalParameter4fEXT glad_glNamedProgramLocalParameter4fEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; -#define glNamedProgramLocalParameter4fvEXT glad_glNamedProgramLocalParameter4fvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; -#define glGetNamedProgramLocalParameterdvEXT glad_glGetNamedProgramLocalParameterdvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; -#define glGetNamedProgramLocalParameterfvEXT glad_glGetNamedProgramLocalParameterfvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC)(GLuint program, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; -#define glGetNamedProgramivEXT glad_glGetNamedProgramivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum pname, void* string); -GLAPI PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; -#define glGetNamedProgramStringEXT glad_glGetNamedProgramStringEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; -#define glNamedRenderbufferStorageEXT glad_glNamedRenderbufferStorageEXT -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)(GLuint renderbuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; -#define glGetNamedRenderbufferParameterivEXT glad_glGetNamedRenderbufferParameterivEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; -#define glNamedRenderbufferStorageMultisampleEXT glad_glNamedRenderbufferStorageMultisampleEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; -#define glNamedRenderbufferStorageMultisampleCoverageEXT glad_glNamedRenderbufferStorageMultisampleCoverageEXT -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)(GLuint framebuffer, GLenum target); -GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; -#define glCheckNamedFramebufferStatusEXT glad_glCheckNamedFramebufferStatusEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; -#define glNamedFramebufferTexture1DEXT glad_glNamedFramebufferTexture1DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; -#define glNamedFramebufferTexture2DEXT glad_glNamedFramebufferTexture2DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; -#define glNamedFramebufferTexture3DEXT glad_glNamedFramebufferTexture3DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; -#define glNamedFramebufferRenderbufferEXT glad_glNamedFramebufferRenderbufferEXT -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; -#define glGetNamedFramebufferAttachmentParameterivEXT glad_glGetNamedFramebufferAttachmentParameterivEXT -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC)(GLuint texture, GLenum target); -GLAPI PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; -#define glGenerateTextureMipmapEXT glad_glGenerateTextureMipmapEXT -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC)(GLenum texunit, GLenum target); -GLAPI PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; -#define glGenerateMultiTexMipmapEXT glad_glGenerateMultiTexMipmapEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); -GLAPI PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; -#define glFramebufferDrawBufferEXT glad_glFramebufferDrawBufferEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); -GLAPI PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; -#define glFramebufferDrawBuffersEXT glad_glFramebufferDrawBuffersEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); -GLAPI PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; -#define glFramebufferReadBufferEXT glad_glFramebufferReadBufferEXT -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; -#define glGetFramebufferParameterivEXT glad_glGetFramebufferParameterivEXT -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; -#define glNamedCopyBufferSubDataEXT glad_glNamedCopyBufferSubDataEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; -#define glNamedFramebufferTextureEXT glad_glNamedFramebufferTextureEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; -#define glNamedFramebufferTextureLayerEXT glad_glNamedFramebufferTextureLayerEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; -#define glNamedFramebufferTextureFaceEXT glad_glNamedFramebufferTextureFaceEXT -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC)(GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; -#define glTextureRenderbufferEXT glad_glTextureRenderbufferEXT -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC)(GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; -#define glMultiTexRenderbufferEXT glad_glMultiTexRenderbufferEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; -#define glVertexArrayVertexOffsetEXT glad_glVertexArrayVertexOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; -#define glVertexArrayColorOffsetEXT glad_glVertexArrayColorOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; -#define glVertexArrayEdgeFlagOffsetEXT glad_glVertexArrayEdgeFlagOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; -#define glVertexArrayIndexOffsetEXT glad_glVertexArrayIndexOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; -#define glVertexArrayNormalOffsetEXT glad_glVertexArrayNormalOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; -#define glVertexArrayTexCoordOffsetEXT glad_glVertexArrayTexCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; -#define glVertexArrayMultiTexCoordOffsetEXT glad_glVertexArrayMultiTexCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; -#define glVertexArrayFogCoordOffsetEXT glad_glVertexArrayFogCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; -#define glVertexArraySecondaryColorOffsetEXT glad_glVertexArraySecondaryColorOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; -#define glVertexArrayVertexAttribOffsetEXT glad_glVertexArrayVertexAttribOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; -#define glVertexArrayVertexAttribIOffsetEXT glad_glVertexArrayVertexAttribIOffsetEXT -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); -GLAPI PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; -#define glEnableVertexArrayEXT glad_glEnableVertexArrayEXT -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); -GLAPI PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; -#define glDisableVertexArrayEXT glad_glDisableVertexArrayEXT -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; -#define glEnableVertexArrayAttribEXT glad_glEnableVertexArrayAttribEXT -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; -#define glDisableVertexArrayAttribEXT glad_glDisableVertexArrayAttribEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC)(GLuint vaobj, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; -#define glGetVertexArrayIntegervEXT glad_glGetVertexArrayIntegervEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC)(GLuint vaobj, GLenum pname, void** param); -GLAPI PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; -#define glGetVertexArrayPointervEXT glad_glGetVertexArrayPointervEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; -#define glGetVertexArrayIntegeri_vEXT glad_glGetVertexArrayIntegeri_vEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, void** param); -GLAPI PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; -#define glGetVertexArrayPointeri_vEXT glad_glGetVertexArrayPointeri_vEXT -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; -#define glMapNamedBufferRangeEXT glad_glMapNamedBufferRangeEXT -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; -#define glFlushMappedNamedBufferRangeEXT glad_glFlushMappedNamedBufferRangeEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; -#define glNamedBufferStorageEXT glad_glNamedBufferStorageEXT -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; -#define glClearNamedBufferDataEXT glad_glClearNamedBufferDataEXT -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; -#define glClearNamedBufferSubDataEXT glad_glClearNamedBufferSubDataEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)(GLuint framebuffer, GLenum pname, GLint param); -GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; -#define glNamedFramebufferParameteriEXT glad_glNamedFramebufferParameteriEXT -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; -#define glGetNamedFramebufferParameterivEXT glad_glGetNamedFramebufferParameterivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC)(GLuint program, GLint location, GLdouble x); -GLAPI PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; -#define glProgramUniform1dEXT glad_glProgramUniform1dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; -#define glProgramUniform2dEXT glad_glProgramUniform2dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; -#define glProgramUniform3dEXT glad_glProgramUniform3dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; -#define glProgramUniform4dEXT glad_glProgramUniform4dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; -#define glProgramUniform1dvEXT glad_glProgramUniform1dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; -#define glProgramUniform2dvEXT glad_glProgramUniform2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; -#define glProgramUniform3dvEXT glad_glProgramUniform3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; -#define glProgramUniform4dvEXT glad_glProgramUniform4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; -#define glProgramUniformMatrix2dvEXT glad_glProgramUniformMatrix2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; -#define glProgramUniformMatrix3dvEXT glad_glProgramUniformMatrix3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; -#define glProgramUniformMatrix4dvEXT glad_glProgramUniformMatrix4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; -#define glProgramUniformMatrix2x3dvEXT glad_glProgramUniformMatrix2x3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; -#define glProgramUniformMatrix2x4dvEXT glad_glProgramUniformMatrix2x4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; -#define glProgramUniformMatrix3x2dvEXT glad_glProgramUniformMatrix3x2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; -#define glProgramUniformMatrix3x4dvEXT glad_glProgramUniformMatrix3x4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; -#define glProgramUniformMatrix4x2dvEXT glad_glProgramUniformMatrix4x2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; -#define glProgramUniformMatrix4x3dvEXT glad_glProgramUniformMatrix4x3dvEXT -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; -#define glTextureBufferRangeEXT glad_glTextureBufferRangeEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; -#define glTextureStorage1DEXT glad_glTextureStorage1DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; -#define glTextureStorage2DEXT glad_glTextureStorage2DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; -#define glTextureStorage3DEXT glad_glTextureStorage3DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; -#define glTextureStorage2DMultisampleEXT glad_glTextureStorage2DMultisampleEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; -#define glTextureStorage3DMultisampleEXT glad_glTextureStorage3DMultisampleEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; -#define glVertexArrayBindVertexBufferEXT glad_glVertexArrayBindVertexBufferEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; -#define glVertexArrayVertexAttribFormatEXT glad_glVertexArrayVertexAttribFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; -#define glVertexArrayVertexAttribIFormatEXT glad_glVertexArrayVertexAttribIFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; -#define glVertexArrayVertexAttribLFormatEXT glad_glVertexArrayVertexAttribLFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; -#define glVertexArrayVertexAttribBindingEXT glad_glVertexArrayVertexAttribBindingEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; -#define glVertexArrayVertexBindingDivisorEXT glad_glVertexArrayVertexBindingDivisorEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; -#define glVertexArrayVertexAttribLOffsetEXT glad_glVertexArrayVertexAttribLOffsetEXT -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -GLAPI PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; -#define glTexturePageCommitmentEXT glad_glTexturePageCommitmentEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)(GLuint vaobj, GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; -#define glVertexArrayVertexAttribDivisorEXT glad_glVertexArrayVertexAttribDivisorEXT -#endif -#ifndef GL_ARB_cull_distance -#define GL_ARB_cull_distance 1 -GLAPI int GLAD_GL_ARB_cull_distance; -#endif -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -GLAPI int GLAD_GL_AMD_sample_positions; -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC)(GLenum pname, GLuint index, const GLfloat* val); -GLAPI PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; -#define glSetMultisamplefvAMD glad_glSetMultisamplefvAMD -#endif -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -GLAPI int GLAD_GL_NV_vertex_program; -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC)(GLsizei n, const GLuint* programs, GLboolean* residences); -GLAPI PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; -#define glAreProgramsResidentNV glad_glAreProgramsResidentNV -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; -#define glBindProgramNV glad_glBindProgramNV -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; -#define glDeleteProgramsNV glad_glDeleteProgramsNV -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC)(GLenum target, GLuint id, const GLfloat* params); -GLAPI PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; -#define glExecuteProgramNV glad_glExecuteProgramNV -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC)(GLsizei n, GLuint* programs); -GLAPI PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; -#define glGenProgramsNV glad_glGenProgramsNV -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC)(GLenum target, GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; -#define glGetProgramParameterdvNV glad_glGetProgramParameterdvNV -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; -#define glGetProgramParameterfvNV glad_glGetProgramParameterfvNV -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; -#define glGetProgramivNV glad_glGetProgramivNV -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC)(GLuint id, GLenum pname, GLubyte* program); -GLAPI PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; -#define glGetProgramStringNV glad_glGetProgramStringNV -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC)(GLenum target, GLuint address, GLenum pname, GLint* params); -GLAPI PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; -#define glGetTrackMatrixivNV glad_glGetTrackMatrixivNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; -#define glGetVertexAttribdvNV glad_glGetVertexAttribdvNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; -#define glGetVertexAttribfvNV glad_glGetVertexAttribfvNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; -#define glGetVertexAttribivNV glad_glGetVertexAttribivNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; -#define glGetVertexAttribPointervNV glad_glGetVertexAttribPointervNV -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC)(GLuint id); -GLAPI PFNGLISPROGRAMNVPROC glad_glIsProgramNV; -#define glIsProgramNV glad_glIsProgramNV -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC)(GLenum target, GLuint id, GLsizei len, const GLubyte* program); -GLAPI PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; -#define glLoadProgramNV glad_glLoadProgramNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; -#define glProgramParameter4dNV glad_glProgramParameter4dNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC)(GLenum target, GLuint index, const GLdouble* v); -GLAPI PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; -#define glProgramParameter4dvNV glad_glProgramParameter4dvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; -#define glProgramParameter4fNV glad_glProgramParameter4fNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC)(GLenum target, GLuint index, const GLfloat* v); -GLAPI PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; -#define glProgramParameter4fvNV glad_glProgramParameter4fvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; -#define glProgramParameters4dvNV glad_glProgramParameters4dvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; -#define glProgramParameters4fvNV glad_glProgramParameters4fvNV -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; -#define glRequestResidentProgramsNV glad_glRequestResidentProgramsNV -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC)(GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; -#define glTrackMatrixNV glad_glTrackMatrixNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC)(GLuint index, GLint fsize, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; -#define glVertexAttribPointerNV glad_glVertexAttribPointerNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; -#define glVertexAttrib1dNV glad_glVertexAttrib1dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; -#define glVertexAttrib1dvNV glad_glVertexAttrib1dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; -#define glVertexAttrib1fNV glad_glVertexAttrib1fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; -#define glVertexAttrib1fvNV glad_glVertexAttrib1fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; -#define glVertexAttrib1sNV glad_glVertexAttrib1sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; -#define glVertexAttrib1svNV glad_glVertexAttrib1svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; -#define glVertexAttrib2dNV glad_glVertexAttrib2dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; -#define glVertexAttrib2dvNV glad_glVertexAttrib2dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; -#define glVertexAttrib2fNV glad_glVertexAttrib2fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; -#define glVertexAttrib2fvNV glad_glVertexAttrib2fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; -#define glVertexAttrib2sNV glad_glVertexAttrib2sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; -#define glVertexAttrib2svNV glad_glVertexAttrib2svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; -#define glVertexAttrib3dNV glad_glVertexAttrib3dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; -#define glVertexAttrib3dvNV glad_glVertexAttrib3dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; -#define glVertexAttrib3fNV glad_glVertexAttrib3fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; -#define glVertexAttrib3fvNV glad_glVertexAttrib3fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; -#define glVertexAttrib3sNV glad_glVertexAttrib3sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; -#define glVertexAttrib3svNV glad_glVertexAttrib3svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; -#define glVertexAttrib4dNV glad_glVertexAttrib4dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; -#define glVertexAttrib4dvNV glad_glVertexAttrib4dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; -#define glVertexAttrib4fNV glad_glVertexAttrib4fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; -#define glVertexAttrib4fvNV glad_glVertexAttrib4fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; -#define glVertexAttrib4sNV glad_glVertexAttrib4sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; -#define glVertexAttrib4svNV glad_glVertexAttrib4svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; -#define glVertexAttrib4ubNV glad_glVertexAttrib4ubNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; -#define glVertexAttrib4ubvNV glad_glVertexAttrib4ubvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; -#define glVertexAttribs1dvNV glad_glVertexAttribs1dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; -#define glVertexAttribs1fvNV glad_glVertexAttribs1fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; -#define glVertexAttribs1svNV glad_glVertexAttribs1svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; -#define glVertexAttribs2dvNV glad_glVertexAttribs2dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; -#define glVertexAttribs2fvNV glad_glVertexAttribs2fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; -#define glVertexAttribs2svNV glad_glVertexAttribs2svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; -#define glVertexAttribs3dvNV glad_glVertexAttribs3dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; -#define glVertexAttribs3fvNV glad_glVertexAttribs3fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; -#define glVertexAttribs3svNV glad_glVertexAttribs3svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; -#define glVertexAttribs4dvNV glad_glVertexAttribs4dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; -#define glVertexAttribs4fvNV glad_glVertexAttribs4fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; -#define glVertexAttribs4svNV glad_glVertexAttribs4svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC)(GLuint index, GLsizei count, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; -#define glVertexAttribs4ubvNV glad_glVertexAttribs4ubvNV -#endif -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -GLAPI int GLAD_GL_NV_shader_thread_shuffle; -#endif -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 -GLAPI int GLAD_GL_ARB_shader_precision; -#endif -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -GLAPI int GLAD_GL_EXT_vertex_shader; -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC)(); -GLAPI PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -#define glBeginVertexShaderEXT glad_glBeginVertexShaderEXT -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC)(); -GLAPI PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -#define glEndVertexShaderEXT glad_glEndVertexShaderEXT -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -#define glBindVertexShaderEXT glad_glBindVertexShaderEXT -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC)(GLuint range); -GLAPI PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -#define glGenVertexShadersEXT glad_glGenVertexShadersEXT -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -#define glDeleteVertexShaderEXT glad_glDeleteVertexShaderEXT -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC)(GLenum op, GLuint res, GLuint arg1); -GLAPI PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -#define glShaderOp1EXT glad_glShaderOp1EXT -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -#define glShaderOp2EXT glad_glShaderOp2EXT -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -#define glShaderOp3EXT glad_glShaderOp3EXT -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -#define glSwizzleEXT glad_glSwizzleEXT -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -#define glWriteMaskEXT glad_glWriteMaskEXT -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -#define glInsertComponentEXT glad_glInsertComponentEXT -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -#define glExtractComponentEXT glad_glExtractComponentEXT -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC)(GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -#define glGenSymbolsEXT glad_glGenSymbolsEXT -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -#define glSetInvariantEXT glad_glSetInvariantEXT -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -#define glSetLocalConstantEXT glad_glSetLocalConstantEXT -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC)(GLuint id, const GLbyte* addr); -GLAPI PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -#define glVariantbvEXT glad_glVariantbvEXT -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC)(GLuint id, const GLshort* addr); -GLAPI PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -#define glVariantsvEXT glad_glVariantsvEXT -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC)(GLuint id, const GLint* addr); -GLAPI PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -#define glVariantivEXT glad_glVariantivEXT -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC)(GLuint id, const GLfloat* addr); -GLAPI PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -#define glVariantfvEXT glad_glVariantfvEXT -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC)(GLuint id, const GLdouble* addr); -GLAPI PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -#define glVariantdvEXT glad_glVariantdvEXT -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC)(GLuint id, const GLubyte* addr); -GLAPI PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -#define glVariantubvEXT glad_glVariantubvEXT -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC)(GLuint id, const GLushort* addr); -GLAPI PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -#define glVariantusvEXT glad_glVariantusvEXT -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC)(GLuint id, const GLuint* addr); -GLAPI PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -#define glVariantuivEXT glad_glVariantuivEXT -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC)(GLuint id, GLenum type, GLuint stride, const void* addr); -GLAPI PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -#define glVariantPointerEXT glad_glVariantPointerEXT -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -#define glEnableVariantClientStateEXT glad_glEnableVariantClientStateEXT -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -#define glDisableVariantClientStateEXT glad_glDisableVariantClientStateEXT -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC)(GLenum light, GLenum value); -GLAPI PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -#define glBindLightParameterEXT glad_glBindLightParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC)(GLenum face, GLenum value); -GLAPI PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -#define glBindMaterialParameterEXT glad_glBindMaterialParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC)(GLenum unit, GLenum coord, GLenum value); -GLAPI PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -#define glBindTexGenParameterEXT glad_glBindTexGenParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)(GLenum unit, GLenum value); -GLAPI PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -#define glBindTextureUnitParameterEXT glad_glBindTextureUnitParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC)(GLenum value); -GLAPI PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -#define glBindParameterEXT glad_glBindParameterEXT -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC)(GLuint id, GLenum cap); -GLAPI PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -#define glIsVariantEnabledEXT glad_glIsVariantEnabledEXT -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -#define glGetVariantBooleanvEXT glad_glGetVariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -#define glGetVariantIntegervEXT glad_glGetVariantIntegervEXT -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -#define glGetVariantFloatvEXT glad_glGetVariantFloatvEXT -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC)(GLuint id, GLenum value, void** data); -GLAPI PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -#define glGetVariantPointervEXT glad_glGetVariantPointervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -#define glGetInvariantBooleanvEXT glad_glGetInvariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -#define glGetInvariantIntegervEXT glad_glGetInvariantIntegervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -#define glGetInvariantFloatvEXT glad_glGetInvariantFloatvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -#define glGetLocalConstantBooleanvEXT glad_glGetLocalConstantBooleanvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -#define glGetLocalConstantIntegervEXT glad_glGetLocalConstantIntegervEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -#define glGetLocalConstantFloatvEXT glad_glGetLocalConstantFloatvEXT -#endif -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -GLAPI int GLAD_GL_EXT_blend_func_separate; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -#define glBlendFuncSeparateEXT glad_glBlendFuncSeparateEXT -#endif -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -GLAPI int GLAD_GL_APPLE_fence; -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC)(GLsizei n, GLuint* fences); -GLAPI PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; -#define glGenFencesAPPLE glad_glGenFencesAPPLE -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC)(GLsizei n, const GLuint* fences); -GLAPI PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; -#define glDeleteFencesAPPLE glad_glDeleteFencesAPPLE -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; -#define glSetFenceAPPLE glad_glSetFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; -#define glIsFenceAPPLE glad_glIsFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; -#define glTestFenceAPPLE glad_glTestFenceAPPLE -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; -#define glFinishFenceAPPLE glad_glFinishFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC)(GLenum object, GLuint name); -GLAPI PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; -#define glTestObjectAPPLE glad_glTestObjectAPPLE -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC)(GLenum object, GLint name); -GLAPI PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; -#define glFinishObjectAPPLE glad_glFinishObjectAPPLE -#endif -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -GLAPI int GLAD_GL_OES_byte_coordinates; -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC)(GLenum texture, GLbyte s); -GLAPI PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; -#define glMultiTexCoord1bOES glad_glMultiTexCoord1bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; -#define glMultiTexCoord1bvOES glad_glMultiTexCoord1bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC)(GLenum texture, GLbyte s, GLbyte t); -GLAPI PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; -#define glMultiTexCoord2bOES glad_glMultiTexCoord2bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; -#define glMultiTexCoord2bvOES glad_glMultiTexCoord2bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r); -GLAPI PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; -#define glMultiTexCoord3bOES glad_glMultiTexCoord3bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; -#define glMultiTexCoord3bvOES glad_glMultiTexCoord3bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; -#define glMultiTexCoord4bOES glad_glMultiTexCoord4bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; -#define glMultiTexCoord4bvOES glad_glMultiTexCoord4bvOES -typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC)(GLbyte s); -GLAPI PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; -#define glTexCoord1bOES glad_glTexCoord1bOES -typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; -#define glTexCoord1bvOES glad_glTexCoord1bvOES -typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC)(GLbyte s, GLbyte t); -GLAPI PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; -#define glTexCoord2bOES glad_glTexCoord2bOES -typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; -#define glTexCoord2bvOES glad_glTexCoord2bvOES -typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC)(GLbyte s, GLbyte t, GLbyte r); -GLAPI PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; -#define glTexCoord3bOES glad_glTexCoord3bOES -typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; -#define glTexCoord3bvOES glad_glTexCoord3bvOES -typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC)(GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; -#define glTexCoord4bOES glad_glTexCoord4bOES -typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; -#define glTexCoord4bvOES glad_glTexCoord4bvOES -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC)(GLbyte x, GLbyte y); -GLAPI PFNGLVERTEX2BOESPROC glad_glVertex2bOES; -#define glVertex2bOES glad_glVertex2bOES -typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; -#define glVertex2bvOES glad_glVertex2bvOES -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC)(GLbyte x, GLbyte y, GLbyte z); -GLAPI PFNGLVERTEX3BOESPROC glad_glVertex3bOES; -#define glVertex3bOES glad_glVertex3bOES -typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; -#define glVertex3bvOES glad_glVertex3bvOES -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC)(GLbyte x, GLbyte y, GLbyte z, GLbyte w); -GLAPI PFNGLVERTEX4BOESPROC glad_glVertex4bOES; -#define glVertex4bOES glad_glVertex4bOES -typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; -#define glVertex4bvOES glad_glVertex4bvOES -#endif -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -GLAPI int GLAD_GL_ARB_transpose_matrix; -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; -#define glLoadTransposeMatrixfARB glad_glLoadTransposeMatrixfARB -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; -#define glLoadTransposeMatrixdARB glad_glLoadTransposeMatrixdARB -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; -#define glMultTransposeMatrixfARB glad_glMultTransposeMatrixfARB -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; -#define glMultTransposeMatrixdARB glad_glMultTransposeMatrixdARB -#endif -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -GLAPI int GLAD_GL_ARB_provoking_vertex; -#endif -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -GLAPI int GLAD_GL_EXT_fog_coord; -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC)(GLfloat coord); -GLAPI PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; -#define glFogCoordfEXT glad_glFogCoordfEXT -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC)(const GLfloat* coord); -GLAPI PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; -#define glFogCoordfvEXT glad_glFogCoordfvEXT -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC)(GLdouble coord); -GLAPI PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; -#define glFogCoorddEXT glad_glFogCoorddEXT -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC)(const GLdouble* coord); -GLAPI PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; -#define glFogCoorddvEXT glad_glFogCoorddvEXT -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; -#define glFogCoordPointerEXT glad_glFogCoordPointerEXT -#endif -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -GLAPI int GLAD_GL_EXT_vertex_array; -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC)(GLint i); -GLAPI PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -#define glArrayElementEXT glad_glArrayElementEXT -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -#define glColorPointerEXT glad_glColorPointerEXT -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -#define glDrawArraysEXT glad_glDrawArraysEXT -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); -GLAPI PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -#define glEdgeFlagPointerEXT glad_glEdgeFlagPointerEXT -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -#define glGetPointervEXT glad_glGetPointervEXT -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -#define glIndexPointerEXT glad_glIndexPointerEXT -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -#define glNormalPointerEXT glad_glNormalPointerEXT -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -#define glTexCoordPointerEXT glad_glTexCoordPointerEXT -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -#define glVertexPointerEXT glad_glVertexPointerEXT -#endif -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -GLAPI int GLAD_GL_ARB_half_float_vertex; -#endif -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -GLAPI int GLAD_GL_EXT_blend_equation_separate; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC)(GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -#define glBlendEquationSeparateEXT glad_glBlendEquationSeparateEXT -#endif -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 -GLAPI int GLAD_GL_NV_framebuffer_mixed_samples; -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC)(GLsizei n, const GLfloat* v); -GLAPI PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; -#define glCoverageModulationTableNV glad_glCoverageModulationTableNV -typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC)(GLsizei bufsize, GLfloat* v); -GLAPI PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; -#define glGetCoverageModulationTableNV glad_glGetCoverageModulationTableNV -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC)(GLenum components); -GLAPI PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; -#define glCoverageModulationNV glad_glCoverageModulationNV -#endif -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 -GLAPI int GLAD_GL_NVX_conditional_render; -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC)(GLuint id); -GLAPI PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; -#define glBeginConditionalRenderNVX glad_glBeginConditionalRenderNVX -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; -#define glEndConditionalRenderNVX glad_glEndConditionalRenderNVX -#endif -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 -GLAPI int GLAD_GL_ARB_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect, GLsizei drawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; -#define glMultiDrawArraysIndirect glad_glMultiDrawArraysIndirect -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; -#define glMultiDrawElementsIndirect glad_glMultiDrawElementsIndirect -#endif -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 -GLAPI int GLAD_GL_EXT_raster_multisample; -#endif -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -GLAPI int GLAD_GL_NV_copy_image; -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; -#define glCopyImageSubDataNV glad_glCopyImageSubDataNV -#endif -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 -GLAPI int GLAD_GL_ARB_fragment_layer_viewport; -#endif -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 -GLAPI int GLAD_GL_INTEL_framebuffer_CMAA; -typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)(); -GLAPI PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; -#define glApplyFramebufferAttachmentCMAAINTEL glad_glApplyFramebufferAttachmentCMAAINTEL -#endif -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -GLAPI int GLAD_GL_ARB_transform_feedback2; -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; -#define glBindTransformFeedback glad_glBindTransformFeedback -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; -#define glDeleteTransformFeedbacks glad_glDeleteTransformFeedbacks -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; -#define glGenTransformFeedbacks glad_glGenTransformFeedbacks -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC)(GLuint id); -GLAPI PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; -#define glIsTransformFeedback glad_glIsTransformFeedback -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; -#define glPauseTransformFeedback glad_glPauseTransformFeedback -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; -#define glResumeTransformFeedback glad_glResumeTransformFeedback -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC)(GLenum mode, GLuint id); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; -#define glDrawTransformFeedback glad_glDrawTransformFeedback -#endif -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -GLAPI int GLAD_GL_ARB_transform_feedback3; -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)(GLenum mode, GLuint id, GLuint stream); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; -#define glDrawTransformFeedbackStream glad_glDrawTransformFeedbackStream -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC)(GLenum target, GLuint index, GLuint id); -GLAPI PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; -#define glBeginQueryIndexed glad_glBeginQueryIndexed -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC)(GLenum target, GLuint index); -GLAPI PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; -#define glEndQueryIndexed glad_glEndQueryIndexed -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; -#define glGetQueryIndexediv glad_glGetQueryIndexediv -#endif -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -GLAPI int GLAD_GL_SGIX_ycrcba; -#endif -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -GLAPI int GLAD_GL_EXT_debug_marker; -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC)(GLsizei length, const GLchar* marker); -GLAPI PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -#define glInsertEventMarkerEXT glad_glInsertEventMarkerEXT -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC)(GLsizei length, const GLchar* marker); -GLAPI PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -#define glPushGroupMarkerEXT glad_glPushGroupMarkerEXT -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC)(); -GLAPI PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -#define glPopGroupMarkerEXT glad_glPopGroupMarkerEXT -#endif -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -GLAPI int GLAD_GL_EXT_bgra; -#endif -#ifndef GL_ARB_sparse_texture_clamp -#define GL_ARB_sparse_texture_clamp 1 -GLAPI int GLAD_GL_ARB_sparse_texture_clamp; -#endif -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -GLAPI int GLAD_GL_EXT_pixel_transform; -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; -#define glPixelTransformParameteriEXT glad_glPixelTransformParameteriEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; -#define glPixelTransformParameterfEXT glad_glPixelTransformParameterfEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; -#define glPixelTransformParameterivEXT glad_glPixelTransformParameterivEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; -#define glPixelTransformParameterfvEXT glad_glPixelTransformParameterfvEXT -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; -#define glGetPixelTransformParameterivEXT glad_glGetPixelTransformParameterivEXT -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; -#define glGetPixelTransformParameterfvEXT glad_glGetPixelTransformParameterfvEXT -#endif -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -GLAPI int GLAD_GL_ARB_conservative_depth; -#endif -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -GLAPI int GLAD_GL_ATI_fragment_shader; -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); -GLAPI PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -#define glGenFragmentShadersATI glad_glGenFragmentShadersATI -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -#define glBindFragmentShaderATI glad_glBindFragmentShaderATI -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -#define glDeleteFragmentShaderATI glad_glDeleteFragmentShaderATI -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -#define glBeginFragmentShaderATI glad_glBeginFragmentShaderATI -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -#define glEndFragmentShaderATI glad_glEndFragmentShaderATI -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); -GLAPI PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -#define glPassTexCoordATI glad_glPassTexCoordATI -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); -GLAPI PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -#define glSampleMapATI glad_glSampleMapATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -#define glColorFragmentOp1ATI glad_glColorFragmentOp1ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -#define glColorFragmentOp2ATI glad_glColorFragmentOp2ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -#define glColorFragmentOp3ATI glad_glColorFragmentOp3ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -#define glAlphaFragmentOp1ATI glad_glAlphaFragmentOp1ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -#define glAlphaFragmentOp2ATI glad_glAlphaFragmentOp2ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -#define glAlphaFragmentOp3ATI glad_glAlphaFragmentOp3ATI -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat* value); -GLAPI PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -#define glSetFragmentShaderConstantATI glad_glSetFragmentShaderConstantATI -#endif -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -GLAPI int GLAD_GL_ARB_vertex_array_object; -#endif -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -GLAPI int GLAD_GL_SUN_triangle_list; -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC)(GLuint code); -GLAPI PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; -#define glReplacementCodeuiSUN glad_glReplacementCodeuiSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC)(GLushort code); -GLAPI PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; -#define glReplacementCodeusSUN glad_glReplacementCodeusSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC)(GLubyte code); -GLAPI PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; -#define glReplacementCodeubSUN glad_glReplacementCodeubSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC)(const GLuint* code); -GLAPI PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; -#define glReplacementCodeuivSUN glad_glReplacementCodeuivSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC)(const GLushort* code); -GLAPI PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; -#define glReplacementCodeusvSUN glad_glReplacementCodeusvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC)(const GLubyte* code); -GLAPI PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; -#define glReplacementCodeubvSUN glad_glReplacementCodeubvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC)(GLenum type, GLsizei stride, const void** pointer); -GLAPI PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; -#define glReplacementCodePointerSUN glad_glReplacementCodePointerSUN -#endif -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -GLAPI int GLAD_GL_EXT_texture_env_add; -#endif -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -GLAPI int GLAD_GL_EXT_packed_depth_stencil; -#endif -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -GLAPI int GLAD_GL_EXT_texture_mirror_clamp; -#endif -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -GLAPI int GLAD_GL_NV_multisample_filter_hint; -#endif -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -GLAPI int GLAD_GL_APPLE_float_pixels; -#endif -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -GLAPI int GLAD_GL_ARB_transform_feedback_instanced; -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)(GLenum mode, GLuint id, GLsizei instancecount); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; -#define glDrawTransformFeedbackInstanced glad_glDrawTransformFeedbackInstanced -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; -#define glDrawTransformFeedbackStreamInstanced glad_glDrawTransformFeedbackStreamInstanced -#endif -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -GLAPI int GLAD_GL_SGIX_async; -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC)(GLuint marker); -GLAPI PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; -#define glAsyncMarkerSGIX glad_glAsyncMarkerSGIX -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC)(GLuint* markerp); -GLAPI PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; -#define glFinishAsyncSGIX glad_glFinishAsyncSGIX -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC)(GLuint* markerp); -GLAPI PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; -#define glPollAsyncSGIX glad_glPollAsyncSGIX -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC)(GLsizei range); -GLAPI PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; -#define glGenAsyncMarkersSGIX glad_glGenAsyncMarkersSGIX -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC)(GLuint marker, GLsizei range); -GLAPI PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; -#define glDeleteAsyncMarkersSGIX glad_glDeleteAsyncMarkersSGIX -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC)(GLuint marker); -GLAPI PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; -#define glIsAsyncMarkerSGIX glad_glIsAsyncMarkerSGIX -#endif -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -GLAPI int GLAD_GL_EXT_texture_compression_latc; -#endif -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -GLAPI int GLAD_GL_NV_shader_atomic_float; -#endif -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -GLAPI int GLAD_GL_ARB_shading_language_100; -#endif -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -GLAPI int GLAD_GL_INTEL_performance_query; -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; -#define glBeginPerfQueryINTEL glad_glBeginPerfQueryINTEL -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC)(GLuint queryId, GLuint* queryHandle); -GLAPI PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; -#define glCreatePerfQueryINTEL glad_glCreatePerfQueryINTEL -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; -#define glDeletePerfQueryINTEL glad_glDeletePerfQueryINTEL -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; -#define glEndPerfQueryINTEL glad_glEndPerfQueryINTEL -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC)(GLuint* queryId); -GLAPI PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; -#define glGetFirstPerfQueryIdINTEL glad_glGetFirstPerfQueryIdINTEL -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC)(GLuint queryId, GLuint* nextQueryId); -GLAPI PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; -#define glGetNextPerfQueryIdINTEL glad_glGetNextPerfQueryIdINTEL -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC)(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar* counterDesc, GLuint* counterOffset, GLuint* counterDataSize, GLuint* counterTypeEnum, GLuint* counterDataTypeEnum, GLuint64* rawCounterMaxValue); -GLAPI PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; -#define glGetPerfCounterInfoINTEL glad_glGetPerfCounterInfoINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC)(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid* data, GLuint* bytesWritten); -GLAPI PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; -#define glGetPerfQueryDataINTEL glad_glGetPerfQueryDataINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC)(GLchar* queryName, GLuint* queryId); -GLAPI PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; -#define glGetPerfQueryIdByNameINTEL glad_glGetPerfQueryIdByNameINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC)(GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint* dataSize, GLuint* noCounters, GLuint* noInstances, GLuint* capsMask); -GLAPI PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; -#define glGetPerfQueryInfoINTEL glad_glGetPerfQueryInfoINTEL -#endif -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 -GLAPI int GLAD_GL_ARB_texture_mirror_clamp_to_edge; -#endif -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -GLAPI int GLAD_GL_NV_gpu_shader5; -#endif -#ifndef GL_NV_bindless_multi_draw_indirect_count -#define GL_NV_bindless_multi_draw_indirect_count 1 -GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect_count; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; -#define glMultiDrawArraysIndirectBindlessCountNV glad_glMultiDrawArraysIndirectBindlessCountNV -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; -#define glMultiDrawElementsIndirectBindlessCountNV glad_glMultiDrawElementsIndirectBindlessCountNV -#endif -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -GLAPI int GLAD_GL_ARB_ES2_compatibility; -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(); -GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -#define glReleaseShaderCompiler glad_glReleaseShaderCompiler -typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); -GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; -#define glShaderBinary glad_glShaderBinary -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); -GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -#define glDepthRangef glad_glDepthRangef -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); -GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -#define glClearDepthf glad_glClearDepthf -#endif -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 -GLAPI int GLAD_GL_ARB_indirect_parameters; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; -#define glMultiDrawArraysIndirectCountARB glad_glMultiDrawArraysIndirectCountARB -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; -#define glMultiDrawElementsIndirectCountARB glad_glMultiDrawElementsIndirectCountARB -#endif -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -GLAPI int GLAD_GL_NV_half_float; -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC)(GLhalfNV x, GLhalfNV y); -GLAPI PFNGLVERTEX2HNVPROC glad_glVertex2hNV; -#define glVertex2hNV glad_glVertex2hNV -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; -#define glVertex2hvNV glad_glVertex2hvNV -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI PFNGLVERTEX3HNVPROC glad_glVertex3hNV; -#define glVertex3hNV glad_glVertex3hNV -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; -#define glVertex3hvNV glad_glVertex3hvNV -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI PFNGLVERTEX4HNVPROC glad_glVertex4hNV; -#define glVertex4hNV glad_glVertex4hNV -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; -#define glVertex4hvNV glad_glVertex4hvNV -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC)(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI PFNGLNORMAL3HNVPROC glad_glNormal3hNV; -#define glNormal3hNV glad_glNormal3hNV -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; -#define glNormal3hvNV glad_glNormal3hvNV -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI PFNGLCOLOR3HNVPROC glad_glColor3hNV; -#define glColor3hNV glad_glColor3hNV -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; -#define glColor3hvNV glad_glColor3hvNV -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI PFNGLCOLOR4HNVPROC glad_glColor4hNV; -#define glColor4hNV glad_glColor4hNV -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; -#define glColor4hvNV glad_glColor4hvNV -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC)(GLhalfNV s); -GLAPI PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; -#define glTexCoord1hNV glad_glTexCoord1hNV -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; -#define glTexCoord1hvNV glad_glTexCoord1hvNV -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC)(GLhalfNV s, GLhalfNV t); -GLAPI PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; -#define glTexCoord2hNV glad_glTexCoord2hNV -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; -#define glTexCoord2hvNV glad_glTexCoord2hvNV -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; -#define glTexCoord3hNV glad_glTexCoord3hNV -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; -#define glTexCoord3hvNV glad_glTexCoord3hvNV -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; -#define glTexCoord4hNV glad_glTexCoord4hNV -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; -#define glTexCoord4hvNV glad_glTexCoord4hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC)(GLenum target, GLhalfNV s); -GLAPI PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; -#define glMultiTexCoord1hNV glad_glMultiTexCoord1hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; -#define glMultiTexCoord1hvNV glad_glMultiTexCoord1hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; -#define glMultiTexCoord2hNV glad_glMultiTexCoord2hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; -#define glMultiTexCoord2hvNV glad_glMultiTexCoord2hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; -#define glMultiTexCoord3hNV glad_glMultiTexCoord3hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; -#define glMultiTexCoord3hvNV glad_glMultiTexCoord3hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; -#define glMultiTexCoord4hNV glad_glMultiTexCoord4hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; -#define glMultiTexCoord4hvNV glad_glMultiTexCoord4hvNV -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC)(GLhalfNV fog); -GLAPI PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; -#define glFogCoordhNV glad_glFogCoordhNV -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC)(const GLhalfNV* fog); -GLAPI PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; -#define glFogCoordhvNV glad_glFogCoordhvNV -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; -#define glSecondaryColor3hNV glad_glSecondaryColor3hNV -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; -#define glSecondaryColor3hvNV glad_glSecondaryColor3hvNV -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC)(GLhalfNV weight); -GLAPI PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; -#define glVertexWeighthNV glad_glVertexWeighthNV -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC)(const GLhalfNV* weight); -GLAPI PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; -#define glVertexWeighthvNV glad_glVertexWeighthvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC)(GLuint index, GLhalfNV x); -GLAPI PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; -#define glVertexAttrib1hNV glad_glVertexAttrib1hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; -#define glVertexAttrib1hvNV glad_glVertexAttrib1hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; -#define glVertexAttrib2hNV glad_glVertexAttrib2hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; -#define glVertexAttrib2hvNV glad_glVertexAttrib2hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; -#define glVertexAttrib3hNV glad_glVertexAttrib3hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; -#define glVertexAttrib3hvNV glad_glVertexAttrib3hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; -#define glVertexAttrib4hNV glad_glVertexAttrib4hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; -#define glVertexAttrib4hvNV glad_glVertexAttrib4hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; -#define glVertexAttribs1hvNV glad_glVertexAttribs1hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; -#define glVertexAttribs2hvNV glad_glVertexAttribs2hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; -#define glVertexAttribs3hvNV glad_glVertexAttribs3hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; -#define glVertexAttribs4hvNV glad_glVertexAttribs4hvNV -#endif -#ifndef GL_ARB_ES3_2_compatibility -#define GL_ARB_ES3_2_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_2_compatibility; -typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -GLAPI PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; -#define glPrimitiveBoundingBoxARB glad_glPrimitiveBoundingBoxARB -#endif -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -GLAPI int GLAD_GL_ATI_texture_mirror_once; -#endif -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -GLAPI int GLAD_GL_IBM_rasterpos_clip; -#endif -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -GLAPI int GLAD_GL_SGIX_shadow; -#endif -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 -GLAPI int GLAD_GL_EXT_polygon_offset_clamp; -typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC)(GLfloat factor, GLfloat units, GLfloat clamp); -GLAPI PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; -#define glPolygonOffsetClampEXT glad_glPolygonOffsetClampEXT -#endif -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 -GLAPI int GLAD_GL_NV_deep_texture3D; -#endif -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 -GLAPI int GLAD_GL_ARB_shader_draw_parameters; -#endif -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -GLAPI int GLAD_GL_SGIX_calligraphic_fragment; -#endif -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -GLAPI int GLAD_GL_ARB_shader_bit_encoding; -#endif -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -GLAPI int GLAD_GL_EXT_compiled_vertex_array; -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC)(GLint first, GLsizei count); -GLAPI PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; -#define glLockArraysEXT glad_glLockArraysEXT -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC)(); -GLAPI PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; -#define glUnlockArraysEXT glad_glUnlockArraysEXT -#endif -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -GLAPI int GLAD_GL_NV_depth_buffer_float; -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC)(GLdouble zNear, GLdouble zFar); -GLAPI PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; -#define glDepthRangedNV glad_glDepthRangedNV -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC)(GLdouble depth); -GLAPI PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; -#define glClearDepthdNV glad_glClearDepthdNV -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC)(GLdouble zmin, GLdouble zmax); -GLAPI PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; -#define glDepthBoundsdNV glad_glDepthBoundsdNV -#endif -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -GLAPI int GLAD_GL_NV_occlusion_query; -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; -#define glGenOcclusionQueriesNV glad_glGenOcclusionQueriesNV -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; -#define glDeleteOcclusionQueriesNV glad_glDeleteOcclusionQueriesNV -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC)(GLuint id); -GLAPI PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; -#define glIsOcclusionQueryNV glad_glIsOcclusionQueryNV -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC)(GLuint id); -GLAPI PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; -#define glBeginOcclusionQueryNV glad_glBeginOcclusionQueryNV -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC)(); -GLAPI PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; -#define glEndOcclusionQueryNV glad_glEndOcclusionQueryNV -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; -#define glGetOcclusionQueryivNV glad_glGetOcclusionQueryivNV -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; -#define glGetOcclusionQueryuivNV glad_glGetOcclusionQueryuivNV -#endif -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -GLAPI int GLAD_GL_APPLE_flush_buffer_range; -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; -#define glBufferParameteriAPPLE glad_glBufferParameteriAPPLE -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)(GLenum target, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; -#define glFlushMappedBufferRangeAPPLE glad_glFlushMappedBufferRangeAPPLE -#endif -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -GLAPI int GLAD_GL_ARB_imaging; -typedef void (APIENTRYP PFNGLCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLEPROC glad_glColorTable; -#define glColorTable glad_glColorTable -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; -#define glColorTableParameterfv glad_glColorTableParameterfv -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; -#define glColorTableParameteriv glad_glColorTableParameteriv -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; -#define glCopyColorTable glad_glCopyColorTable -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC)(GLenum target, GLenum format, GLenum type, void* table); -GLAPI PFNGLGETCOLORTABLEPROC glad_glGetColorTable; -#define glGetColorTable glad_glGetColorTable -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; -#define glGetColorTableParameterfv glad_glGetColorTableParameterfv -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; -#define glGetColorTableParameteriv glad_glGetColorTableParameteriv -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; -#define glColorSubTable glad_glColorSubTable -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; -#define glCopyColorSubTable glad_glCopyColorSubTable -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; -#define glConvolutionFilter1D glad_glConvolutionFilter1D -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; -#define glConvolutionFilter2D glad_glConvolutionFilter2D -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat params); -GLAPI PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; -#define glConvolutionParameterf glad_glConvolutionParameterf -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; -#define glConvolutionParameterfv glad_glConvolutionParameterfv -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC)(GLenum target, GLenum pname, GLint params); -GLAPI PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; -#define glConvolutionParameteri glad_glConvolutionParameteri -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; -#define glConvolutionParameteriv glad_glConvolutionParameteriv -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; -#define glCopyConvolutionFilter1D glad_glCopyConvolutionFilter1D -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; -#define glCopyConvolutionFilter2D glad_glCopyConvolutionFilter2D -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC)(GLenum target, GLenum format, GLenum type, void* image); -GLAPI PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; -#define glGetConvolutionFilter glad_glGetConvolutionFilter -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; -#define glGetConvolutionParameterfv glad_glGetConvolutionParameterfv -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; -#define glGetConvolutionParameteriv glad_glGetConvolutionParameteriv -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -GLAPI PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; -#define glGetSeparableFilter glad_glGetSeparableFilter -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); -GLAPI PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; -#define glSeparableFilter2D glad_glSeparableFilter2D -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETHISTOGRAMPROC glad_glGetHistogram; -#define glGetHistogram glad_glGetHistogram -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; -#define glGetHistogramParameterfv glad_glGetHistogramParameterfv -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; -#define glGetHistogramParameteriv glad_glGetHistogramParameteriv -typedef void (APIENTRYP PFNGLGETMINMAXPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETMINMAXPROC glad_glGetMinmax; -#define glGetMinmax glad_glGetMinmax -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; -#define glGetMinmaxParameterfv glad_glGetMinmaxParameterfv -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; -#define glGetMinmaxParameteriv glad_glGetMinmaxParameteriv -typedef void (APIENTRYP PFNGLHISTOGRAMPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI PFNGLHISTOGRAMPROC glad_glHistogram; -#define glHistogram glad_glHistogram -typedef void (APIENTRYP PFNGLMINMAXPROC)(GLenum target, GLenum internalformat, GLboolean sink); -GLAPI PFNGLMINMAXPROC glad_glMinmax; -#define glMinmax glad_glMinmax -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC)(GLenum target); -GLAPI PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; -#define glResetHistogram glad_glResetHistogram -typedef void (APIENTRYP PFNGLRESETMINMAXPROC)(GLenum target); -GLAPI PFNGLRESETMINMAXPROC glad_glResetMinmax; -#define glResetMinmax glad_glResetMinmax -#endif -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -GLAPI int GLAD_GL_ARB_draw_buffers_blend; -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC)(GLuint buf, GLenum mode); -GLAPI PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -#define glBlendEquationiARB glad_glBlendEquationiARB -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -#define glBlendEquationSeparateiARB glad_glBlendEquationSeparateiARB -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC)(GLuint buf, GLenum src, GLenum dst); -GLAPI PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -#define glBlendFunciARB glad_glBlendFunciARB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -#define glBlendFuncSeparateiARB glad_glBlendFuncSeparateiARB -#endif -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -GLAPI int GLAD_GL_AMD_gcn_shader; -#endif -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -GLAPI int GLAD_GL_AMD_blend_minmax_factor; -#endif -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -GLAPI int GLAD_GL_EXT_texture_sRGB_decode; -#endif -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -GLAPI int GLAD_GL_ARB_shading_language_420pack; -#endif -#ifndef GL_ARB_shader_viewport_layer_array -#define GL_ARB_shader_viewport_layer_array 1 -GLAPI int GLAD_GL_ARB_shader_viewport_layer_array; -#endif -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -GLAPI int GLAD_GL_ATI_meminfo; -#endif -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -GLAPI int GLAD_GL_EXT_abgr; -#endif -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -GLAPI int GLAD_GL_AMD_pinned_memory; -#endif -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -GLAPI int GLAD_GL_EXT_texture_snorm; -#endif -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -GLAPI int GLAD_GL_SGIX_texture_coordinate_clamp; -#endif -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 -GLAPI int GLAD_GL_ARB_clear_buffer_object; -typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; -#define glClearBufferData glad_glClearBufferData -typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; -#define glClearBufferSubData glad_glClearBufferSubData -#endif -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -GLAPI int GLAD_GL_ARB_multisample; -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -#define glSampleCoverageARB glad_glSampleCoverageARB -#endif -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -GLAPI int GLAD_GL_EXT_debug_label; -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC)(GLenum type, GLuint object, GLsizei length, const GLchar* label); -GLAPI PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; -#define glLabelObjectEXT glad_glLabelObjectEXT -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC)(GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; -#define glGetObjectLabelEXT glad_glGetObjectLabelEXT -#endif -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -GLAPI int GLAD_GL_ARB_sample_shading; -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC)(GLfloat value); -GLAPI PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; -#define glMinSampleShadingARB glad_glMinSampleShadingARB -#endif -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 -GLAPI int GLAD_GL_NV_internalformat_sample_query; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)(GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; -#define glGetInternalformatSampleivNV glad_glGetInternalformatSampleivNV -#endif -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 -GLAPI int GLAD_GL_INTEL_map_texture; -typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC)(GLuint texture); -GLAPI PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; -#define glSyncTextureINTEL glad_glSyncTextureINTEL -typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level); -GLAPI PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; -#define glUnmapTexture2DINTEL glad_glUnmapTexture2DINTEL -typedef void* (APIENTRYP PFNGLMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum* layout); -GLAPI PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; -#define glMapTexture2DINTEL glad_glMapTexture2DINTEL -#endif -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -GLAPI int GLAD_GL_ARB_texture_env_crossbar; -#endif -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -GLAPI int GLAD_GL_EXT_422_pixels; -#endif -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -GLAPI int GLAD_GL_ARB_compute_shader; -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; -#define glDispatchCompute glad_glDispatchCompute -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC)(GLintptr indirect); -GLAPI PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; -#define glDispatchComputeIndirect glad_glDispatchComputeIndirect -#endif -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -GLAPI int GLAD_GL_EXT_blend_logic_op; -#endif -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -GLAPI int GLAD_GL_IBM_cull_vertex; -#endif -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -GLAPI int GLAD_GL_IBM_vertex_array_lists; -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; -#define glColorPointerListIBM glad_glColorPointerListIBM -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; -#define glSecondaryColorPointerListIBM glad_glSecondaryColorPointerListIBM -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC)(GLint stride, const GLboolean** pointer, GLint ptrstride); -GLAPI PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; -#define glEdgeFlagPointerListIBM glad_glEdgeFlagPointerListIBM -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; -#define glFogCoordPointerListIBM glad_glFogCoordPointerListIBM -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; -#define glIndexPointerListIBM glad_glIndexPointerListIBM -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; -#define glNormalPointerListIBM glad_glNormalPointerListIBM -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; -#define glTexCoordPointerListIBM glad_glTexCoordPointerListIBM -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; -#define glVertexPointerListIBM glad_glVertexPointerListIBM -#endif -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -GLAPI int GLAD_GL_ARB_color_buffer_float; -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC)(GLenum target, GLenum clamp); -GLAPI PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; -#define glClampColorARB glad_glClampColorARB -#endif -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 -GLAPI int GLAD_GL_ARB_bindless_texture; -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC)(GLuint texture); -GLAPI PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; -#define glGetTextureHandleARB glad_glGetTextureHandleARB -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC)(GLuint texture, GLuint sampler); -GLAPI PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; -#define glGetTextureSamplerHandleARB glad_glGetTextureSamplerHandleARB -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; -#define glMakeTextureHandleResidentARB glad_glMakeTextureHandleResidentARB -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; -#define glMakeTextureHandleNonResidentARB glad_glMakeTextureHandleNonResidentARB -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; -#define glGetImageHandleARB glad_glGetImageHandleARB -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle, GLenum access); -GLAPI PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; -#define glMakeImageHandleResidentARB glad_glMakeImageHandleResidentARB -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; -#define glMakeImageHandleNonResidentARB glad_glMakeImageHandleNonResidentARB -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC)(GLint location, GLuint64 value); -GLAPI PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; -#define glUniformHandleui64ARB glad_glUniformHandleui64ARB -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; -#define glUniformHandleui64vARB glad_glUniformHandleui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)(GLuint program, GLint location, GLuint64 value); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; -#define glProgramUniformHandleui64ARB glad_glProgramUniformHandleui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; -#define glProgramUniformHandleui64vARB glad_glProgramUniformHandleui64vARB -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; -#define glIsTextureHandleResidentARB glad_glIsTextureHandleResidentARB -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; -#define glIsImageHandleResidentARB glad_glIsImageHandleResidentARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC)(GLuint index, GLuint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; -#define glVertexAttribL1ui64ARB glad_glVertexAttribL1ui64ARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; -#define glVertexAttribL1ui64vARB glad_glVertexAttribL1ui64vARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC)(GLuint index, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; -#define glGetVertexAttribLui64vARB glad_glGetVertexAttribLui64vARB -#endif -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -GLAPI int GLAD_GL_ARB_window_pos; -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC)(GLdouble x, GLdouble y); -GLAPI PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; -#define glWindowPos2dARB glad_glWindowPos2dARB -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; -#define glWindowPos2dvARB glad_glWindowPos2dvARB -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC)(GLfloat x, GLfloat y); -GLAPI PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; -#define glWindowPos2fARB glad_glWindowPos2fARB -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; -#define glWindowPos2fvARB glad_glWindowPos2fvARB -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC)(GLint x, GLint y); -GLAPI PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; -#define glWindowPos2iARB glad_glWindowPos2iARB -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; -#define glWindowPos2ivARB glad_glWindowPos2ivARB -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC)(GLshort x, GLshort y); -GLAPI PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; -#define glWindowPos2sARB glad_glWindowPos2sARB -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; -#define glWindowPos2svARB glad_glWindowPos2svARB -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC)(GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; -#define glWindowPos3dARB glad_glWindowPos3dARB -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; -#define glWindowPos3dvARB glad_glWindowPos3dvARB -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC)(GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; -#define glWindowPos3fARB glad_glWindowPos3fARB -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; -#define glWindowPos3fvARB glad_glWindowPos3fvARB -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC)(GLint x, GLint y, GLint z); -GLAPI PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; -#define glWindowPos3iARB glad_glWindowPos3iARB -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; -#define glWindowPos3ivARB glad_glWindowPos3ivARB -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC)(GLshort x, GLshort y, GLshort z); -GLAPI PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; -#define glWindowPos3sARB glad_glWindowPos3sARB -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; -#define glWindowPos3svARB glad_glWindowPos3svARB -#endif -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -GLAPI int GLAD_GL_ARB_internalformat_query; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; -#define glGetInternalformativ glad_glGetInternalformativ -#endif -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -GLAPI int GLAD_GL_ARB_shadow; -#endif -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -GLAPI int GLAD_GL_ARB_texture_mirrored_repeat; -#endif -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -GLAPI int GLAD_GL_EXT_shader_image_load_store; -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC)(GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; -#define glBindImageTextureEXT glad_glBindImageTextureEXT -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; -#define glMemoryBarrierEXT glad_glMemoryBarrierEXT -#endif -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -GLAPI int GLAD_GL_EXT_copy_texture; -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; -#define glCopyTexImage1DEXT glad_glCopyTexImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; -#define glCopyTexImage2DEXT glad_glCopyTexImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; -#define glCopyTexSubImage1DEXT glad_glCopyTexSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; -#define glCopyTexSubImage2DEXT glad_glCopyTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; -#define glCopyTexSubImage3DEXT glad_glCopyTexSubImage3DEXT -#endif -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -GLAPI int GLAD_GL_NV_register_combiners2; -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; -#define glCombinerStageParameterfvNV glad_glCombinerStageParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; -#define glGetCombinerStageParameterfvNV glad_glGetCombinerStageParameterfvNV -#endif -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -GLAPI int GLAD_GL_SGIX_ycrcb_subsample; -#endif -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -GLAPI int GLAD_GL_SGIX_ir_instrument1; -#endif -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 -GLAPI int GLAD_GL_NV_draw_texture; -typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC)(GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -GLAPI PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; -#define glDrawTextureNV glad_glDrawTextureNV -#endif -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -GLAPI int GLAD_GL_EXT_texture_shared_exponent; -#endif -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -GLAPI int GLAD_GL_EXT_draw_instanced; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC)(GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; -#define glDrawArraysInstancedEXT glad_glDrawArraysInstancedEXT -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; -#define glDrawElementsInstancedEXT glad_glDrawElementsInstancedEXT -#endif -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -GLAPI int GLAD_GL_NV_copy_depth_to_color; -#endif -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -GLAPI int GLAD_GL_ARB_viewport_array; -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC)(GLuint first, GLsizei count, const GLfloat* v); -GLAPI PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; -#define glViewportArrayv glad_glViewportArrayv -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; -#define glViewportIndexedf glad_glViewportIndexedf -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; -#define glViewportIndexedfv glad_glViewportIndexedfv -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC)(GLuint first, GLsizei count, const GLint* v); -GLAPI PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; -#define glScissorArrayv glad_glScissorArrayv -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; -#define glScissorIndexed glad_glScissorIndexed -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; -#define glScissorIndexedv glad_glScissorIndexedv -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC)(GLuint first, GLsizei count, const GLdouble* v); -GLAPI PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; -#define glDepthRangeArrayv glad_glDepthRangeArrayv -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f); -GLAPI PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; -#define glDepthRangeIndexed glad_glDepthRangeIndexed -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat* data); -GLAPI PFNGLGETFLOATI_VPROC glad_glGetFloati_v; -#define glGetFloati_v glad_glGetFloati_v -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC)(GLenum target, GLuint index, GLdouble* data); -GLAPI PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; -#define glGetDoublei_v glad_glGetDoublei_v -#endif -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -GLAPI int GLAD_GL_ARB_separate_shader_objects; -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC)(GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; -#define glUseProgramStages glad_glUseProgramStages -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC)(GLuint pipeline, GLuint program); -GLAPI PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; -#define glActiveShaderProgram glad_glActiveShaderProgram -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC)(GLenum type, GLsizei count, const GLchar** strings); -GLAPI PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; -#define glCreateShaderProgramv glad_glCreateShaderProgramv -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; -#define glBindProgramPipeline glad_glBindProgramPipeline -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC)(GLsizei n, const GLuint* pipelines); -GLAPI PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; -#define glDeleteProgramPipelines glad_glDeleteProgramPipelines -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; -#define glGenProgramPipelines glad_glGenProgramPipelines -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; -#define glIsProgramPipeline glad_glIsProgramPipeline -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC)(GLuint pipeline, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; -#define glGetProgramPipelineiv glad_glGetProgramPipelineiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC)(GLuint program, GLint location, GLint v0); -GLAPI PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; -#define glProgramUniform1i glad_glProgramUniform1i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; -#define glProgramUniform1iv glad_glProgramUniform1iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC)(GLuint program, GLint location, GLfloat v0); -GLAPI PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; -#define glProgramUniform1f glad_glProgramUniform1f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; -#define glProgramUniform1fv glad_glProgramUniform1fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC)(GLuint program, GLint location, GLdouble v0); -GLAPI PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; -#define glProgramUniform1d glad_glProgramUniform1d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; -#define glProgramUniform1dv glad_glProgramUniform1dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC)(GLuint program, GLint location, GLuint v0); -GLAPI PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; -#define glProgramUniform1ui glad_glProgramUniform1ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; -#define glProgramUniform1uiv glad_glProgramUniform1uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC)(GLuint program, GLint location, GLint v0, GLint v1); -GLAPI PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; -#define glProgramUniform2i glad_glProgramUniform2i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; -#define glProgramUniform2iv glad_glProgramUniform2iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; -#define glProgramUniform2f glad_glProgramUniform2f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; -#define glProgramUniform2fv glad_glProgramUniform2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; -#define glProgramUniform2d glad_glProgramUniform2d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; -#define glProgramUniform2dv glad_glProgramUniform2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; -#define glProgramUniform2ui glad_glProgramUniform2ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; -#define glProgramUniform2uiv glad_glProgramUniform2uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; -#define glProgramUniform3i glad_glProgramUniform3i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; -#define glProgramUniform3iv glad_glProgramUniform3iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; -#define glProgramUniform3f glad_glProgramUniform3f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; -#define glProgramUniform3fv glad_glProgramUniform3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; -#define glProgramUniform3d glad_glProgramUniform3d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; -#define glProgramUniform3dv glad_glProgramUniform3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; -#define glProgramUniform3ui glad_glProgramUniform3ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; -#define glProgramUniform3uiv glad_glProgramUniform3uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; -#define glProgramUniform4i glad_glProgramUniform4i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; -#define glProgramUniform4iv glad_glProgramUniform4iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; -#define glProgramUniform4f glad_glProgramUniform4f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; -#define glProgramUniform4fv glad_glProgramUniform4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; -#define glProgramUniform4d glad_glProgramUniform4d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; -#define glProgramUniform4dv glad_glProgramUniform4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; -#define glProgramUniform4ui glad_glProgramUniform4ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; -#define glProgramUniform4uiv glad_glProgramUniform4uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; -#define glProgramUniformMatrix2fv glad_glProgramUniformMatrix2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; -#define glProgramUniformMatrix3fv glad_glProgramUniformMatrix3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; -#define glProgramUniformMatrix4fv glad_glProgramUniformMatrix4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; -#define glProgramUniformMatrix2dv glad_glProgramUniformMatrix2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; -#define glProgramUniformMatrix3dv glad_glProgramUniformMatrix3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; -#define glProgramUniformMatrix4dv glad_glProgramUniformMatrix4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; -#define glProgramUniformMatrix2x3fv glad_glProgramUniformMatrix2x3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; -#define glProgramUniformMatrix3x2fv glad_glProgramUniformMatrix3x2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; -#define glProgramUniformMatrix2x4fv glad_glProgramUniformMatrix2x4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; -#define glProgramUniformMatrix4x2fv glad_glProgramUniformMatrix4x2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; -#define glProgramUniformMatrix3x4fv glad_glProgramUniformMatrix3x4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; -#define glProgramUniformMatrix4x3fv glad_glProgramUniformMatrix4x3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; -#define glProgramUniformMatrix2x3dv glad_glProgramUniformMatrix2x3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; -#define glProgramUniformMatrix3x2dv glad_glProgramUniformMatrix3x2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; -#define glProgramUniformMatrix2x4dv glad_glProgramUniformMatrix2x4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; -#define glProgramUniformMatrix4x2dv glad_glProgramUniformMatrix4x2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; -#define glProgramUniformMatrix3x4dv glad_glProgramUniformMatrix3x4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; -#define glProgramUniformMatrix4x3dv glad_glProgramUniformMatrix4x3dv -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; -#define glValidateProgramPipeline glad_glValidateProgramPipeline -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; -#define glGetProgramPipelineInfoLog glad_glGetProgramPipelineInfoLog -#endif -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -GLAPI int GLAD_GL_EXT_depth_bounds_test; -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); -GLAPI PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; -#define glDepthBoundsEXT glad_glDepthBoundsEXT -#endif -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -GLAPI int GLAD_GL_EXT_shared_texture_palette; -#endif -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -GLAPI int GLAD_GL_ARB_texture_env_add; -#endif -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -GLAPI int GLAD_GL_NV_video_capture; -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC)(GLuint video_capture_slot); -GLAPI PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; -#define glBeginVideoCaptureNV glad_glBeginVideoCaptureNV -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; -#define glBindVideoCaptureStreamBufferNV glad_glBindVideoCaptureStreamBufferNV -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; -#define glBindVideoCaptureStreamTextureNV glad_glBindVideoCaptureStreamTextureNV -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC)(GLuint video_capture_slot); -GLAPI PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; -#define glEndVideoCaptureNV glad_glEndVideoCaptureNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC)(GLuint video_capture_slot, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; -#define glGetVideoCaptureivNV glad_glGetVideoCaptureivNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; -#define glGetVideoCaptureStreamivNV glad_glGetVideoCaptureStreamivNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; -#define glGetVideoCaptureStreamfvNV glad_glGetVideoCaptureStreamfvNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; -#define glGetVideoCaptureStreamdvNV glad_glGetVideoCaptureStreamdvNV -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC)(GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT* capture_time); -GLAPI PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; -#define glVideoCaptureNV glad_glVideoCaptureNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; -#define glVideoCaptureStreamParameterivNV glad_glVideoCaptureStreamParameterivNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; -#define glVideoCaptureStreamParameterfvNV glad_glVideoCaptureStreamParameterfvNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; -#define glVideoCaptureStreamParameterdvNV glad_glVideoCaptureStreamParameterdvNV -#endif -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -GLAPI int GLAD_GL_ARB_sampler_objects; -#endif -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -GLAPI int GLAD_GL_ARB_matrix_palette; -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC)(GLint index); -GLAPI PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; -#define glCurrentPaletteMatrixARB glad_glCurrentPaletteMatrixARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC)(GLint size, const GLubyte* indices); -GLAPI PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; -#define glMatrixIndexubvARB glad_glMatrixIndexubvARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC)(GLint size, const GLushort* indices); -GLAPI PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; -#define glMatrixIndexusvARB glad_glMatrixIndexusvARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC)(GLint size, const GLuint* indices); -GLAPI PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; -#define glMatrixIndexuivARB glad_glMatrixIndexuivARB -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; -#define glMatrixIndexPointerARB glad_glMatrixIndexPointerARB -#endif -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -GLAPI int GLAD_GL_SGIS_texture_color_mask; -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; -#define glTextureColorMaskSGIS glad_glTextureColorMaskSGIS -#endif -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -GLAPI int GLAD_GL_EXT_packed_pixels; -#endif -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -GLAPI int GLAD_GL_EXT_coordinate_frame; -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC)(GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; -#define glTangent3bEXT glad_glTangent3bEXT -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; -#define glTangent3bvEXT glad_glTangent3bvEXT -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC)(GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; -#define glTangent3dEXT glad_glTangent3dEXT -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; -#define glTangent3dvEXT glad_glTangent3dvEXT -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC)(GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; -#define glTangent3fEXT glad_glTangent3fEXT -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; -#define glTangent3fvEXT glad_glTangent3fvEXT -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC)(GLint tx, GLint ty, GLint tz); -GLAPI PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; -#define glTangent3iEXT glad_glTangent3iEXT -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC)(const GLint* v); -GLAPI PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; -#define glTangent3ivEXT glad_glTangent3ivEXT -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC)(GLshort tx, GLshort ty, GLshort tz); -GLAPI PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; -#define glTangent3sEXT glad_glTangent3sEXT -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; -#define glTangent3svEXT glad_glTangent3svEXT -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC)(GLbyte bx, GLbyte by, GLbyte bz); -GLAPI PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; -#define glBinormal3bEXT glad_glBinormal3bEXT -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; -#define glBinormal3bvEXT glad_glBinormal3bvEXT -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC)(GLdouble bx, GLdouble by, GLdouble bz); -GLAPI PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; -#define glBinormal3dEXT glad_glBinormal3dEXT -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; -#define glBinormal3dvEXT glad_glBinormal3dvEXT -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC)(GLfloat bx, GLfloat by, GLfloat bz); -GLAPI PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; -#define glBinormal3fEXT glad_glBinormal3fEXT -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; -#define glBinormal3fvEXT glad_glBinormal3fvEXT -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC)(GLint bx, GLint by, GLint bz); -GLAPI PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; -#define glBinormal3iEXT glad_glBinormal3iEXT -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC)(const GLint* v); -GLAPI PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; -#define glBinormal3ivEXT glad_glBinormal3ivEXT -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC)(GLshort bx, GLshort by, GLshort bz); -GLAPI PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; -#define glBinormal3sEXT glad_glBinormal3sEXT -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; -#define glBinormal3svEXT glad_glBinormal3svEXT -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; -#define glTangentPointerEXT glad_glTangentPointerEXT -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; -#define glBinormalPointerEXT glad_glBinormalPointerEXT -#endif -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -GLAPI int GLAD_GL_ARB_texture_compression; -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -#define glCompressedTexImage3DARB glad_glCompressedTexImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -#define glCompressedTexImage2DARB glad_glCompressedTexImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -#define glCompressedTexImage1DARB glad_glCompressedTexImage1DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -#define glCompressedTexSubImage3DARB glad_glCompressedTexSubImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -#define glCompressedTexSubImage2DARB glad_glCompressedTexSubImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -#define glCompressedTexSubImage1DARB glad_glCompressedTexSubImage1DARB -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -#define glGetCompressedTexImageARB glad_glGetCompressedTexImageARB -#endif -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -GLAPI int GLAD_GL_APPLE_aux_depth_stencil; -#endif -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -GLAPI int GLAD_GL_ARB_shader_subroutine; -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)(GLuint program, GLenum shadertype, const GLchar* name); -GLAPI PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; -#define glGetSubroutineUniformLocation glad_glGetSubroutineUniformLocation -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC)(GLuint program, GLenum shadertype, const GLchar* name); -GLAPI PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; -#define glGetSubroutineIndex glad_glGetSubroutineIndex -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); -GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; -#define glGetActiveSubroutineUniformiv glad_glGetActiveSubroutineUniformiv -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; -#define glGetActiveSubroutineUniformName glad_glGetActiveSubroutineUniformName -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; -#define glGetActiveSubroutineName glad_glGetActiveSubroutineName -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC)(GLenum shadertype, GLsizei count, const GLuint* indices); -GLAPI PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; -#define glUniformSubroutinesuiv glad_glUniformSubroutinesuiv -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC)(GLenum shadertype, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; -#define glGetUniformSubroutineuiv glad_glGetUniformSubroutineuiv -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC)(GLuint program, GLenum shadertype, GLenum pname, GLint* values); -GLAPI PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; -#define glGetProgramStageiv glad_glGetProgramStageiv -#endif -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -GLAPI int GLAD_GL_EXT_framebuffer_sRGB; -#endif -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 -GLAPI int GLAD_GL_ARB_texture_storage_multisample; -typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; -#define glTexStorage2DMultisample glad_glTexStorage2DMultisample -typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; -#define glTexStorage3DMultisample glad_glTexStorage3DMultisample -#endif -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -GLAPI int GLAD_GL_KHR_blend_equation_advanced_coherent; -#endif -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -GLAPI int GLAD_GL_EXT_vertex_attrib_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; -#define glVertexAttribL1dEXT glad_glVertexAttribL1dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; -#define glVertexAttribL2dEXT glad_glVertexAttribL2dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; -#define glVertexAttribL3dEXT glad_glVertexAttribL3dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; -#define glVertexAttribL4dEXT glad_glVertexAttribL4dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; -#define glVertexAttribL1dvEXT glad_glVertexAttribL1dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; -#define glVertexAttribL2dvEXT glad_glVertexAttribL2dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; -#define glVertexAttribL3dvEXT glad_glVertexAttribL3dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; -#define glVertexAttribL4dvEXT glad_glVertexAttribL4dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; -#define glVertexAttribLPointerEXT glad_glVertexAttribLPointerEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; -#define glGetVertexAttribLdvEXT glad_glGetVertexAttribLdvEXT -#endif -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -GLAPI int GLAD_GL_ARB_depth_texture; -#endif -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -GLAPI int GLAD_GL_NV_shader_buffer_store; -#endif -#ifndef GL_OES_query_matrix -#define GL_OES_query_matrix 1 -GLAPI int GLAD_GL_OES_query_matrix; -typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC)(GLfixed* mantissa, GLint* exponent); -GLAPI PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; -#define glQueryMatrixxOES glad_glQueryMatrixxOES -#endif -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -GLAPI int GLAD_GL_MESA_window_pos; -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC)(GLdouble x, GLdouble y); -GLAPI PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; -#define glWindowPos2dMESA glad_glWindowPos2dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; -#define glWindowPos2dvMESA glad_glWindowPos2dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC)(GLfloat x, GLfloat y); -GLAPI PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; -#define glWindowPos2fMESA glad_glWindowPos2fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; -#define glWindowPos2fvMESA glad_glWindowPos2fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC)(GLint x, GLint y); -GLAPI PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; -#define glWindowPos2iMESA glad_glWindowPos2iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; -#define glWindowPos2ivMESA glad_glWindowPos2ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC)(GLshort x, GLshort y); -GLAPI PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; -#define glWindowPos2sMESA glad_glWindowPos2sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; -#define glWindowPos2svMESA glad_glWindowPos2svMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC)(GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; -#define glWindowPos3dMESA glad_glWindowPos3dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; -#define glWindowPos3dvMESA glad_glWindowPos3dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC)(GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; -#define glWindowPos3fMESA glad_glWindowPos3fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; -#define glWindowPos3fvMESA glad_glWindowPos3fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC)(GLint x, GLint y, GLint z); -GLAPI PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; -#define glWindowPos3iMESA glad_glWindowPos3iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; -#define glWindowPos3ivMESA glad_glWindowPos3ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC)(GLshort x, GLshort y, GLshort z); -GLAPI PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; -#define glWindowPos3sMESA glad_glWindowPos3sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; -#define glWindowPos3svMESA glad_glWindowPos3svMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; -#define glWindowPos4dMESA glad_glWindowPos4dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; -#define glWindowPos4dvMESA glad_glWindowPos4dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; -#define glWindowPos4fMESA glad_glWindowPos4fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; -#define glWindowPos4fvMESA glad_glWindowPos4fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC)(GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; -#define glWindowPos4iMESA glad_glWindowPos4iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; -#define glWindowPos4ivMESA glad_glWindowPos4ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC)(GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; -#define glWindowPos4sMESA glad_glWindowPos4sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; -#define glWindowPos4svMESA glad_glWindowPos4svMESA -#endif -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 -GLAPI int GLAD_GL_NV_fill_rectangle; -#endif -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 -GLAPI int GLAD_GL_NV_shader_storage_buffer_object; -#endif -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -GLAPI int GLAD_GL_ARB_texture_query_lod; -#endif -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -GLAPI int GLAD_GL_ARB_copy_buffer; -#endif -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 -GLAPI int GLAD_GL_ARB_shader_image_size; -#endif -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 -GLAPI int GLAD_GL_NV_shader_atomic_counters; -#endif -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -GLAPI int GLAD_GL_APPLE_object_purgeable; -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); -GLAPI PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; -#define glObjectPurgeableAPPLE glad_glObjectPurgeableAPPLE -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); -GLAPI PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; -#define glObjectUnpurgeableAPPLE glad_glObjectUnpurgeableAPPLE -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC)(GLenum objectType, GLuint name, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; -#define glGetObjectParameterivAPPLE glad_glGetObjectParameterivAPPLE -#endif -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -GLAPI int GLAD_GL_ARB_occlusion_query; -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; -#define glGenQueriesARB glad_glGenQueriesARB -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; -#define glDeleteQueriesARB glad_glDeleteQueriesARB -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC)(GLuint id); -GLAPI PFNGLISQUERYARBPROC glad_glIsQueryARB; -#define glIsQueryARB glad_glIsQueryARB -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); -GLAPI PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; -#define glBeginQueryARB glad_glBeginQueryARB -typedef void (APIENTRYP PFNGLENDQUERYARBPROC)(GLenum target); -GLAPI PFNGLENDQUERYARBPROC glad_glEndQueryARB; -#define glEndQueryARB glad_glEndQueryARB -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; -#define glGetQueryivARB glad_glGetQueryivARB -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; -#define glGetQueryObjectivARB glad_glGetQueryObjectivARB -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; -#define glGetQueryObjectuivARB glad_glGetQueryObjectuivARB -#endif -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -GLAPI int GLAD_GL_INGR_color_clamp; -#endif -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -GLAPI int GLAD_GL_SGI_color_table; -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; -#define glColorTableSGI glad_glColorTableSGI -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; -#define glColorTableParameterfvSGI glad_glColorTableParameterfvSGI -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; -#define glColorTableParameterivSGI glad_glColorTableParameterivSGI -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; -#define glCopyColorTableSGI glad_glCopyColorTableSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC)(GLenum target, GLenum format, GLenum type, void* table); -GLAPI PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; -#define glGetColorTableSGI glad_glGetColorTableSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; -#define glGetColorTableParameterfvSGI glad_glGetColorTableParameterfvSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; -#define glGetColorTableParameterivSGI glad_glGetColorTableParameterivSGI -#endif -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 -GLAPI int GLAD_GL_NV_gpu_program5_mem_extended; -#endif -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -GLAPI int GLAD_GL_ARB_texture_cube_map_array; -#endif -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -GLAPI int GLAD_GL_SGIX_scalebias_hint; -#endif -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -GLAPI int GLAD_GL_EXT_gpu_shader4; -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC)(GLuint program, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; -#define glGetUniformuivEXT glad_glGetUniformuivEXT -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC)(GLuint program, GLuint color, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; -#define glBindFragDataLocationEXT glad_glBindFragDataLocationEXT -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; -#define glGetFragDataLocationEXT glad_glGetFragDataLocationEXT -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC)(GLint location, GLuint v0); -GLAPI PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; -#define glUniform1uiEXT glad_glUniform1uiEXT -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC)(GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; -#define glUniform2uiEXT glad_glUniform2uiEXT -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; -#define glUniform3uiEXT glad_glUniform3uiEXT -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; -#define glUniform4uiEXT glad_glUniform4uiEXT -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; -#define glUniform1uivEXT glad_glUniform1uivEXT -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; -#define glUniform2uivEXT glad_glUniform2uivEXT -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; -#define glUniform3uivEXT glad_glUniform3uivEXT -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; -#define glUniform4uivEXT glad_glUniform4uivEXT -#endif -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -GLAPI int GLAD_GL_NV_geometry_program4; -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC)(GLenum target, GLint limit); -GLAPI PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; -#define glProgramVertexLimitNV glad_glProgramVertexLimitNV -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; -#define glFramebufferTextureEXT glad_glFramebufferTextureEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; -#define glFramebufferTextureFaceEXT glad_glFramebufferTextureFaceEXT -#endif -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -#endif -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -GLAPI int GLAD_GL_AMD_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC)(GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -#define glDebugMessageEnableAMD glad_glDebugMessageEnableAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC)(GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -#define glDebugMessageInsertAMD glad_glDebugMessageInsertAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC)(GLDEBUGPROCAMD callback, void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -#define glDebugMessageCallbackAMD glad_glDebugMessageCallbackAMD -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC)(GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); -GLAPI PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -#define glGetDebugMessageLogAMD glad_glGetDebugMessageLogAMD -#endif -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -GLAPI int GLAD_GL_ARB_texture_border_clamp; -#endif -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -GLAPI int GLAD_GL_ARB_fragment_coord_conventions; -#endif -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -GLAPI int GLAD_GL_ARB_multitexture; -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC)(GLenum texture); -GLAPI PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; -#define glActiveTextureARB glad_glActiveTextureARB -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC)(GLenum texture); -GLAPI PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; -#define glClientActiveTextureARB glad_glClientActiveTextureARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC)(GLenum target, GLdouble s); -GLAPI PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; -#define glMultiTexCoord1dARB glad_glMultiTexCoord1dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; -#define glMultiTexCoord1dvARB glad_glMultiTexCoord1dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC)(GLenum target, GLfloat s); -GLAPI PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; -#define glMultiTexCoord1fARB glad_glMultiTexCoord1fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; -#define glMultiTexCoord1fvARB glad_glMultiTexCoord1fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC)(GLenum target, GLint s); -GLAPI PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; -#define glMultiTexCoord1iARB glad_glMultiTexCoord1iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; -#define glMultiTexCoord1ivARB glad_glMultiTexCoord1ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC)(GLenum target, GLshort s); -GLAPI PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; -#define glMultiTexCoord1sARB glad_glMultiTexCoord1sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; -#define glMultiTexCoord1svARB glad_glMultiTexCoord1svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC)(GLenum target, GLdouble s, GLdouble t); -GLAPI PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; -#define glMultiTexCoord2dARB glad_glMultiTexCoord2dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; -#define glMultiTexCoord2dvARB glad_glMultiTexCoord2dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC)(GLenum target, GLfloat s, GLfloat t); -GLAPI PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; -#define glMultiTexCoord2fARB glad_glMultiTexCoord2fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; -#define glMultiTexCoord2fvARB glad_glMultiTexCoord2fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC)(GLenum target, GLint s, GLint t); -GLAPI PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; -#define glMultiTexCoord2iARB glad_glMultiTexCoord2iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; -#define glMultiTexCoord2ivARB glad_glMultiTexCoord2ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC)(GLenum target, GLshort s, GLshort t); -GLAPI PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; -#define glMultiTexCoord2sARB glad_glMultiTexCoord2sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; -#define glMultiTexCoord2svARB glad_glMultiTexCoord2svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; -#define glMultiTexCoord3dARB glad_glMultiTexCoord3dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; -#define glMultiTexCoord3dvARB glad_glMultiTexCoord3dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; -#define glMultiTexCoord3fARB glad_glMultiTexCoord3fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; -#define glMultiTexCoord3fvARB glad_glMultiTexCoord3fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC)(GLenum target, GLint s, GLint t, GLint r); -GLAPI PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; -#define glMultiTexCoord3iARB glad_glMultiTexCoord3iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; -#define glMultiTexCoord3ivARB glad_glMultiTexCoord3ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; -#define glMultiTexCoord3sARB glad_glMultiTexCoord3sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; -#define glMultiTexCoord3svARB glad_glMultiTexCoord3svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; -#define glMultiTexCoord4dARB glad_glMultiTexCoord4dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; -#define glMultiTexCoord4dvARB glad_glMultiTexCoord4dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; -#define glMultiTexCoord4fARB glad_glMultiTexCoord4fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; -#define glMultiTexCoord4fvARB glad_glMultiTexCoord4fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; -#define glMultiTexCoord4iARB glad_glMultiTexCoord4iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; -#define glMultiTexCoord4ivARB glad_glMultiTexCoord4ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; -#define glMultiTexCoord4sARB glad_glMultiTexCoord4sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; -#define glMultiTexCoord4svARB glad_glMultiTexCoord4svARB -#endif -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -GLAPI int GLAD_GL_SGIX_polynomial_ffd; -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble* points); -GLAPI PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; -#define glDeformationMap3dSGIX glad_glDeformationMap3dSGIX -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat* points); -GLAPI PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; -#define glDeformationMap3fSGIX glad_glDeformationMap3fSGIX -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC)(GLbitfield mask); -GLAPI PFNGLDEFORMSGIXPROC glad_glDeformSGIX; -#define glDeformSGIX glad_glDeformSGIX -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)(GLbitfield mask); -GLAPI PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; -#define glLoadIdentityDeformationMapSGIX glad_glLoadIdentityDeformationMapSGIX -#endif -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -GLAPI int GLAD_GL_EXT_provoking_vertex; -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC)(GLenum mode); -GLAPI PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; -#define glProvokingVertexEXT glad_glProvokingVertexEXT -#endif -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -GLAPI int GLAD_GL_ARB_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; -#define glPointParameterfARB glad_glPointParameterfARB -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; -#define glPointParameterfvARB glad_glPointParameterfvARB -#endif -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -GLAPI int GLAD_GL_ARB_shader_image_load_store; -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; -#define glBindImageTexture glad_glBindImageTexture -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; -#define glMemoryBarrier glad_glMemoryBarrier -#endif -#ifndef GL_ARB_conditional_render_inverted -#define GL_ARB_conditional_render_inverted 1 -GLAPI int GLAD_GL_ARB_conditional_render_inverted; -#endif -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -GLAPI int GLAD_GL_HP_occlusion_test; -#endif -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_compatibility; -#endif -#ifndef GL_ARB_texture_barrier -#define GL_ARB_texture_barrier 1 -GLAPI int GLAD_GL_ARB_texture_barrier; -typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC)(); -GLAPI PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; -#define glTextureBarrier glad_glTextureBarrier -#endif -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -GLAPI int GLAD_GL_ARB_texture_buffer_object_rgb32; -#endif -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 -GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; -#define glMultiDrawArraysIndirectBindlessNV glad_glMultiDrawArraysIndirectBindlessNV -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; -#define glMultiDrawElementsIndirectBindlessNV glad_glMultiDrawElementsIndirectBindlessNV -#endif -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -GLAPI int GLAD_GL_SGIX_texture_multi_buffer; -#endif -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -GLAPI int GLAD_GL_EXT_transform_feedback; -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; -#define glBeginTransformFeedbackEXT glad_glBeginTransformFeedbackEXT -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; -#define glEndTransformFeedbackEXT glad_glEndTransformFeedbackEXT -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; -#define glBindBufferRangeEXT glad_glBindBufferRangeEXT -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; -#define glBindBufferOffsetEXT glad_glBindBufferOffsetEXT -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; -#define glBindBufferBaseEXT glad_glBindBufferBaseEXT -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; -#define glTransformFeedbackVaryingsEXT glad_glTransformFeedbackVaryingsEXT -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; -#define glGetTransformFeedbackVaryingEXT glad_glGetTransformFeedbackVaryingEXT -#endif -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_ldr; -#endif -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -GLAPI int GLAD_GL_3DFX_multisample; -#endif -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -GLAPI int GLAD_GL_INTEL_fragment_shader_ordering; -#endif -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -GLAPI int GLAD_GL_ARB_texture_env_dot3; -#endif -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -GLAPI int GLAD_GL_NV_gpu_program4; -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; -#define glProgramLocalParameterI4iNV glad_glProgramLocalParameterI4iNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; -#define glProgramLocalParameterI4ivNV glad_glProgramLocalParameterI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; -#define glProgramLocalParametersI4ivNV glad_glProgramLocalParametersI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; -#define glProgramLocalParameterI4uiNV glad_glProgramLocalParameterI4uiNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; -#define glProgramLocalParameterI4uivNV glad_glProgramLocalParameterI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; -#define glProgramLocalParametersI4uivNV glad_glProgramLocalParametersI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; -#define glProgramEnvParameterI4iNV glad_glProgramEnvParameterI4iNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; -#define glProgramEnvParameterI4ivNV glad_glProgramEnvParameterI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; -#define glProgramEnvParametersI4ivNV glad_glProgramEnvParametersI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; -#define glProgramEnvParameterI4uiNV glad_glProgramEnvParameterI4uiNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; -#define glProgramEnvParameterI4uivNV glad_glProgramEnvParameterI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; -#define glProgramEnvParametersI4uivNV glad_glProgramEnvParametersI4uivNV -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; -#define glGetProgramLocalParameterIivNV glad_glGetProgramLocalParameterIivNV -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; -#define glGetProgramLocalParameterIuivNV glad_glGetProgramLocalParameterIuivNV -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; -#define glGetProgramEnvParameterIivNV glad_glGetProgramEnvParameterIivNV -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; -#define glGetProgramEnvParameterIuivNV glad_glGetProgramEnvParameterIuivNV -#endif -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -GLAPI int GLAD_GL_NV_gpu_program5; -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)(GLenum target, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; -#define glProgramSubroutineParametersuivNV glad_glProgramSubroutineParametersuivNV -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)(GLenum target, GLuint index, GLuint* param); -GLAPI PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; -#define glGetProgramSubroutineParameteruivNV glad_glGetProgramSubroutineParameteruivNV -#endif -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -GLAPI int GLAD_GL_NV_float_buffer; -#endif -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -GLAPI int GLAD_GL_SGIS_texture_edge_clamp; -#endif -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -GLAPI int GLAD_GL_ARB_framebuffer_sRGB; -#endif -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -GLAPI int GLAD_GL_SUN_slice_accum; -#endif -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -GLAPI int GLAD_GL_EXT_index_texture; -#endif -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -GLAPI int GLAD_GL_EXT_shader_image_load_formatted; -#endif -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -GLAPI int GLAD_GL_ARB_geometry_shader4; -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; -#define glProgramParameteriARB glad_glProgramParameteriARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; -#define glFramebufferTextureARB glad_glFramebufferTextureARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; -#define glFramebufferTextureLayerARB glad_glFramebufferTextureLayerARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; -#define glFramebufferTextureFaceARB glad_glFramebufferTextureFaceARB -#endif -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -GLAPI int GLAD_GL_EXT_separate_specular_color; -#endif -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -GLAPI int GLAD_GL_AMD_depth_clamp_separate; -#endif -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 -GLAPI int GLAD_GL_NV_conservative_raster; -typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC)(GLuint xbits, GLuint ybits); -GLAPI PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; -#define glSubpixelPrecisionBiasNV glad_glSubpixelPrecisionBiasNV -#endif -#ifndef GL_ARB_sparse_texture2 -#define GL_ARB_sparse_texture2 1 -GLAPI int GLAD_GL_ARB_sparse_texture2; -#endif -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -GLAPI int GLAD_GL_SGIX_sprite; -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; -#define glSpriteParameterfSGIX glad_glSpriteParameterfSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; -#define glSpriteParameterfvSGIX glad_glSpriteParameterfvSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; -#define glSpriteParameteriSGIX glad_glSpriteParameteriSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; -#define glSpriteParameterivSGIX glad_glSpriteParameterivSGIX -#endif -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -GLAPI int GLAD_GL_ARB_get_program_binary; -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary); -GLAPI PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; -#define glGetProgramBinary glad_glGetProgramBinary -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); -GLAPI PFNGLPROGRAMBINARYPROC glad_glProgramBinary; -#define glProgramBinary glad_glProgramBinary -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; -#define glProgramParameteri glad_glProgramParameteri -#endif -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -GLAPI int GLAD_GL_AMD_occlusion_query_event; -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC)(GLenum target, GLuint id, GLenum pname, GLuint param); -GLAPI PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; -#define glQueryObjectParameteruiAMD glad_glQueryObjectParameteruiAMD -#endif -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -GLAPI int GLAD_GL_SGIS_multisample; -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC)(GLclampf value, GLboolean invert); -GLAPI PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; -#define glSampleMaskSGIS glad_glSampleMaskSGIS -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC)(GLenum pattern); -GLAPI PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; -#define glSamplePatternSGIS glad_glSamplePatternSGIS -#endif -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -GLAPI int GLAD_GL_EXT_framebuffer_object; -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); -GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -#define glIsRenderbufferEXT glad_glIsRenderbufferEXT -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -#define glBindRenderbufferEXT glad_glBindRenderbufferEXT -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint* renderbuffers); -GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); -GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -#define glIsFramebufferEXT glad_glIsFramebufferEXT -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); -GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -#define glBindFramebufferEXT glad_glBindFramebufferEXT -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint* framebuffers); -GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -#define glGenFramebuffersEXT glad_glGenFramebuffersEXT -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); -GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -#define glGenerateMipmapEXT glad_glGenerateMipmapEXT -#endif -#ifndef GL_ARB_robustness_isolation -#define GL_ARB_robustness_isolation 1 -GLAPI int GLAD_GL_ARB_robustness_isolation; -#endif -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -GLAPI int GLAD_GL_ARB_vertex_array_bgra; -#endif -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -GLAPI int GLAD_GL_APPLE_vertex_array_range; -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); -GLAPI PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; -#define glVertexArrayRangeAPPLE glad_glVertexArrayRangeAPPLE -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); -GLAPI PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; -#define glFlushVertexArrayRangeAPPLE glad_glFlushVertexArrayRangeAPPLE -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)(GLenum pname, GLint param); -GLAPI PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; -#define glVertexArrayParameteriAPPLE glad_glVertexArrayParameteriAPPLE -#endif -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -GLAPI int GLAD_GL_AMD_query_buffer_object; -#endif -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -GLAPI int GLAD_GL_NV_register_combiners; -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; -#define glCombinerParameterfvNV glad_glCombinerParameterfvNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; -#define glCombinerParameterfNV glad_glCombinerParameterfNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; -#define glCombinerParameterivNV glad_glCombinerParameterivNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC)(GLenum pname, GLint param); -GLAPI PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; -#define glCombinerParameteriNV glad_glCombinerParameteriNV -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; -#define glCombinerInputNV glad_glCombinerInputNV -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; -#define glCombinerOutputNV glad_glCombinerOutputNV -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; -#define glFinalCombinerInputNV glad_glFinalCombinerInputNV -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; -#define glGetCombinerInputParameterfvNV glad_glGetCombinerInputParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); -GLAPI PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; -#define glGetCombinerInputParameterivNV glad_glGetCombinerInputParameterivNV -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; -#define glGetCombinerOutputParameterfvNV glad_glGetCombinerOutputParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLint* params); -GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; -#define glGetCombinerOutputParameterivNV glad_glGetCombinerOutputParameterivNV -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)(GLenum variable, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; -#define glGetFinalCombinerInputParameterfvNV glad_glGetFinalCombinerInputParameterfvNV -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)(GLenum variable, GLenum pname, GLint* params); -GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; -#define glGetFinalCombinerInputParameterivNV glad_glGetFinalCombinerInputParameterivNV -#endif -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -GLAPI int GLAD_GL_ARB_draw_buffers; -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -#define glDrawBuffersARB glad_glDrawBuffersARB -#endif -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 -GLAPI int GLAD_GL_ARB_clear_texture; -typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; -#define glClearTexImage glad_glClearTexImage -typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; -#define glClearTexSubImage glad_glClearTexSubImage -#endif -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -GLAPI int GLAD_GL_ARB_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -#define glDebugMessageControlARB glad_glDebugMessageControlARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -#define glDebugMessageInsertARB glad_glDebugMessageInsertARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB -#endif -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -GLAPI int GLAD_GL_SGI_color_matrix; -#endif -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -GLAPI int GLAD_GL_EXT_cull_vertex; -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC)(GLenum pname, GLdouble* params); -GLAPI PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; -#define glCullParameterdvEXT glad_glCullParameterdvEXT -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC)(GLenum pname, GLfloat* params); -GLAPI PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; -#define glCullParameterfvEXT glad_glCullParameterfvEXT -#endif -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -GLAPI int GLAD_GL_EXT_texture_sRGB; -#endif -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -GLAPI int GLAD_GL_APPLE_row_bytes; -#endif -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -GLAPI int GLAD_GL_NV_texgen_reflection; -#endif -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -GLAPI int GLAD_GL_IBM_multimode_draw_arrays; -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC)(const GLenum* mode, const GLint* first, const GLsizei* count, GLsizei primcount, GLint modestride); -GLAPI PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; -#define glMultiModeDrawArraysIBM glad_glMultiModeDrawArraysIBM -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC)(const GLenum* mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount, GLint modestride); -GLAPI PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; -#define glMultiModeDrawElementsIBM glad_glMultiModeDrawElementsIBM -#endif -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -GLAPI int GLAD_GL_APPLE_vertex_array_object; -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC)(GLuint array); -GLAPI PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; -#define glBindVertexArrayAPPLE glad_glBindVertexArrayAPPLE -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC)(GLsizei n, const GLuint* arrays); -GLAPI PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; -#define glDeleteVertexArraysAPPLE glad_glDeleteVertexArraysAPPLE -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; -#define glGenVertexArraysAPPLE glad_glGenVertexArraysAPPLE -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC)(GLuint array); -GLAPI PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; -#define glIsVertexArrayAPPLE glad_glIsVertexArrayAPPLE -#endif -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -GLAPI int GLAD_GL_3DFX_texture_compression_FXT1; -#endif -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 -GLAPI int GLAD_GL_NV_fragment_shader_interlock; -#endif -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -GLAPI int GLAD_GL_AMD_conservative_depth; -#endif -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -GLAPI int GLAD_GL_ARB_texture_float; -#endif -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -GLAPI int GLAD_GL_ARB_compressed_texture_pixel_storage; -#endif -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -GLAPI int GLAD_GL_SGIS_detail_texture; -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); -GLAPI PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; -#define glDetailTexFuncSGIS glad_glDetailTexFuncSGIS -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC)(GLenum target, GLfloat* points); -GLAPI PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; -#define glGetDetailTexFuncSGIS glad_glGetDetailTexFuncSGIS -#endif -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -GLAPI int GLAD_GL_ARB_draw_instanced; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; -#define glDrawArraysInstancedARB glad_glDrawArraysInstancedARB -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; -#define glDrawElementsInstancedARB glad_glDrawElementsInstancedARB -#endif -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -GLAPI int GLAD_GL_OES_read_format; -#endif -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -GLAPI int GLAD_GL_ATI_texture_float; -#endif -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -GLAPI int GLAD_GL_ARB_texture_gather; -#endif -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -GLAPI int GLAD_GL_AMD_vertex_shader_layer; -#endif -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -GLAPI int GLAD_GL_ARB_shading_language_include; -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC)(GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar* string); -GLAPI PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; -#define glNamedStringARB glad_glNamedStringARB -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); -GLAPI PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; -#define glDeleteNamedStringARB glad_glDeleteNamedStringARB -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC)(GLuint shader, GLsizei count, const GLchar** path, const GLint* length); -GLAPI PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; -#define glCompileShaderIncludeARB glad_glCompileShaderIncludeARB -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); -GLAPI PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; -#define glIsNamedStringARB glad_glIsNamedStringARB -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name, GLsizei bufSize, GLint* stringlen, GLchar* string); -GLAPI PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; -#define glGetNamedStringARB glad_glGetNamedStringARB -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC)(GLint namelen, const GLchar* name, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; -#define glGetNamedStringivARB glad_glGetNamedStringivARB -#endif -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -GLAPI int GLAD_GL_APPLE_client_storage; -#endif -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -GLAPI int GLAD_GL_WIN_phong_shading; -#endif -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -GLAPI int GLAD_GL_INGR_blend_func_separate; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; -#define glBlendFuncSeparateINGR glad_glBlendFuncSeparateINGR -#endif -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -GLAPI int GLAD_GL_NV_path_rendering; -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC)(GLsizei range); -GLAPI PFNGLGENPATHSNVPROC glad_glGenPathsNV; -#define glGenPathsNV glad_glGenPathsNV -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC)(GLuint path, GLsizei range); -GLAPI PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; -#define glDeletePathsNV glad_glDeletePathsNV -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC)(GLuint path); -GLAPI PFNGLISPATHNVPROC glad_glIsPathNV; -#define glIsPathNV glad_glIsPathNV -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC)(GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; -#define glPathCommandsNV glad_glPathCommandsNV -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC)(GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; -#define glPathCoordsNV glad_glPathCoordsNV -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC)(GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; -#define glPathSubCommandsNV glad_glPathSubCommandsNV -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC)(GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; -#define glPathSubCoordsNV glad_glPathSubCoordsNV -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC)(GLuint path, GLenum format, GLsizei length, const void* pathString); -GLAPI PFNGLPATHSTRINGNVPROC glad_glPathStringNV; -#define glPathStringNV glad_glPathStringNV -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void* charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; -#define glPathGlyphsNV glad_glPathGlyphsNV -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; -#define glPathGlyphRangeNV glad_glPathGlyphRangeNV -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC)(GLuint resultPath, GLsizei numPaths, const GLuint* paths, const GLfloat* weights); -GLAPI PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; -#define glWeightPathsNV glad_glWeightPathsNV -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC)(GLuint resultPath, GLuint srcPath); -GLAPI PFNGLCOPYPATHNVPROC glad_glCopyPathNV; -#define glCopyPathNV glad_glCopyPathNV -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC)(GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; -#define glInterpolatePathsNV glad_glInterpolatePathsNV -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC)(GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; -#define glTransformPathNV glad_glTransformPathNV -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, const GLint* value); -GLAPI PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; -#define glPathParameterivNV glad_glPathParameterivNV -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC)(GLuint path, GLenum pname, GLint value); -GLAPI PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; -#define glPathParameteriNV glad_glPathParameteriNV -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, const GLfloat* value); -GLAPI PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; -#define glPathParameterfvNV glad_glPathParameterfvNV -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC)(GLuint path, GLenum pname, GLfloat value); -GLAPI PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; -#define glPathParameterfNV glad_glPathParameterfNV -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC)(GLuint path, GLsizei dashCount, const GLfloat* dashArray); -GLAPI PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; -#define glPathDashArrayNV glad_glPathDashArrayNV -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC)(GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; -#define glPathStencilFuncNV glad_glPathStencilFuncNV -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC)(GLfloat factor, GLfloat units); -GLAPI PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; -#define glPathStencilDepthOffsetNV glad_glPathStencilDepthOffsetNV -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask); -GLAPI PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; -#define glStencilFillPathNV glad_glStencilFillPathNV -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask); -GLAPI PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; -#define glStencilStrokePathNV glad_glStencilStrokePathNV -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; -#define glStencilFillPathInstancedNV glad_glStencilFillPathInstancedNV -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; -#define glStencilStrokePathInstancedNV glad_glStencilStrokePathInstancedNV -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC)(GLenum func); -GLAPI PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; -#define glPathCoverDepthFuncNV glad_glPathCoverDepthFuncNV -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC)(GLuint path, GLenum coverMode); -GLAPI PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; -#define glCoverFillPathNV glad_glCoverFillPathNV -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC)(GLuint path, GLenum coverMode); -GLAPI PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; -#define glCoverStrokePathNV glad_glCoverStrokePathNV -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; -#define glCoverFillPathInstancedNV glad_glCoverFillPathInstancedNV -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; -#define glCoverStrokePathInstancedNV glad_glCoverStrokePathInstancedNV -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; -#define glGetPathParameterivNV glad_glGetPathParameterivNV -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; -#define glGetPathParameterfvNV glad_glGetPathParameterfvNV -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC)(GLuint path, GLubyte* commands); -GLAPI PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; -#define glGetPathCommandsNV glad_glGetPathCommandsNV -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC)(GLuint path, GLfloat* coords); -GLAPI PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; -#define glGetPathCoordsNV glad_glGetPathCoordsNV -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC)(GLuint path, GLfloat* dashArray); -GLAPI PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; -#define glGetPathDashArrayNV glad_glGetPathDashArrayNV -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC)(GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat* metrics); -GLAPI PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; -#define glGetPathMetricsNV glad_glGetPathMetricsNV -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC)(GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); -GLAPI PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; -#define glGetPathMetricRangeNV glad_glGetPathMetricRangeNV -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC)(GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat* returnedSpacing); -GLAPI PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; -#define glGetPathSpacingNV glad_glGetPathSpacingNV -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC)(GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; -#define glIsPointInFillPathNV glad_glIsPointInFillPathNV -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC)(GLuint path, GLfloat x, GLfloat y); -GLAPI PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; -#define glIsPointInStrokePathNV glad_glIsPointInStrokePathNV -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; -#define glGetPathLengthNV glad_glGetPathLengthNV -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat* y, GLfloat* tangentX, GLfloat* tangentY); -GLAPI PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; -#define glPointAlongPathNV glad_glPointAlongPathNV -typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; -#define glMatrixLoad3x2fNV glad_glMatrixLoad3x2fNV -typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; -#define glMatrixLoad3x3fNV glad_glMatrixLoad3x3fNV -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; -#define glMatrixLoadTranspose3x3fNV glad_glMatrixLoadTranspose3x3fNV -typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; -#define glMatrixMult3x2fNV glad_glMatrixMult3x2fNV -typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; -#define glMatrixMult3x3fNV glad_glMatrixMult3x3fNV -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; -#define glMatrixMultTranspose3x3fNV glad_glMatrixMultTranspose3x3fNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GLAPI PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; -#define glStencilThenCoverFillPathNV glad_glStencilThenCoverFillPathNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; -#define glStencilThenCoverStrokePathNV glad_glStencilThenCoverStrokePathNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; -#define glStencilThenCoverFillPathInstancedNV glad_glStencilThenCoverFillPathInstancedNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; -#define glStencilThenCoverStrokePathInstancedNV glad_glStencilThenCoverStrokePathInstancedNV -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC)(GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint* baseAndCount); -GLAPI PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; -#define glPathGlyphIndexRangeNV glad_glPathGlyphIndexRangeNV -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; -#define glPathGlyphIndexArrayNV glad_glPathGlyphIndexArrayNV -typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void* fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; -#define glPathMemoryGlyphIndexArrayNV glad_glPathMemoryGlyphIndexArrayNV -typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)(GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); -GLAPI PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; -#define glProgramPathFragmentInputGenNV glad_glProgramPathFragmentInputGenNV -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLfloat* params); -GLAPI PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; -#define glGetProgramResourcefvNV glad_glGetProgramResourcefvNV -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC)(GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); -GLAPI PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; -#define glPathColorGenNV glad_glPathColorGenNV -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC)(GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); -GLAPI PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; -#define glPathTexGenNV glad_glPathTexGenNV -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC)(GLenum genMode); -GLAPI PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; -#define glPathFogGenNV glad_glPathFogGenNV -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC)(GLenum color, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; -#define glGetPathColorGenivNV glad_glGetPathColorGenivNV -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC)(GLenum color, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; -#define glGetPathColorGenfvNV glad_glGetPathColorGenfvNV -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC)(GLenum texCoordSet, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; -#define glGetPathTexGenivNV glad_glGetPathTexGenivNV -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC)(GLenum texCoordSet, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; -#define glGetPathTexGenfvNV glad_glGetPathTexGenfvNV -#endif -#ifndef GL_NV_conservative_raster_dilate -#define GL_NV_conservative_raster_dilate 1 -GLAPI int GLAD_GL_NV_conservative_raster_dilate; -typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)(GLenum pname, GLfloat value); -GLAPI PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; -#define glConservativeRasterParameterfNV glad_glConservativeRasterParameterfNV -#endif -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -GLAPI int GLAD_GL_ATI_vertex_streams; -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC)(GLenum stream, GLshort x); -GLAPI PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; -#define glVertexStream1sATI glad_glVertexStream1sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; -#define glVertexStream1svATI glad_glVertexStream1svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC)(GLenum stream, GLint x); -GLAPI PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; -#define glVertexStream1iATI glad_glVertexStream1iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; -#define glVertexStream1ivATI glad_glVertexStream1ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC)(GLenum stream, GLfloat x); -GLAPI PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; -#define glVertexStream1fATI glad_glVertexStream1fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; -#define glVertexStream1fvATI glad_glVertexStream1fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC)(GLenum stream, GLdouble x); -GLAPI PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; -#define glVertexStream1dATI glad_glVertexStream1dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; -#define glVertexStream1dvATI glad_glVertexStream1dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC)(GLenum stream, GLshort x, GLshort y); -GLAPI PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; -#define glVertexStream2sATI glad_glVertexStream2sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; -#define glVertexStream2svATI glad_glVertexStream2svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC)(GLenum stream, GLint x, GLint y); -GLAPI PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; -#define glVertexStream2iATI glad_glVertexStream2iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; -#define glVertexStream2ivATI glad_glVertexStream2ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC)(GLenum stream, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; -#define glVertexStream2fATI glad_glVertexStream2fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; -#define glVertexStream2fvATI glad_glVertexStream2fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC)(GLenum stream, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; -#define glVertexStream2dATI glad_glVertexStream2dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; -#define glVertexStream2dvATI glad_glVertexStream2dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; -#define glVertexStream3sATI glad_glVertexStream3sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; -#define glVertexStream3svATI glad_glVertexStream3svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC)(GLenum stream, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; -#define glVertexStream3iATI glad_glVertexStream3iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; -#define glVertexStream3ivATI glad_glVertexStream3ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; -#define glVertexStream3fATI glad_glVertexStream3fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; -#define glVertexStream3fvATI glad_glVertexStream3fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; -#define glVertexStream3dATI glad_glVertexStream3dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; -#define glVertexStream3dvATI glad_glVertexStream3dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; -#define glVertexStream4sATI glad_glVertexStream4sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; -#define glVertexStream4svATI glad_glVertexStream4svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC)(GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; -#define glVertexStream4iATI glad_glVertexStream4iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; -#define glVertexStream4ivATI glad_glVertexStream4ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; -#define glVertexStream4fATI glad_glVertexStream4fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; -#define glVertexStream4fvATI glad_glVertexStream4fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; -#define glVertexStream4dATI glad_glVertexStream4dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; -#define glVertexStream4dvATI glad_glVertexStream4dvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC)(GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; -#define glNormalStream3bATI glad_glNormalStream3bATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC)(GLenum stream, const GLbyte* coords); -GLAPI PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; -#define glNormalStream3bvATI glad_glNormalStream3bvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC)(GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; -#define glNormalStream3sATI glad_glNormalStream3sATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; -#define glNormalStream3svATI glad_glNormalStream3svATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC)(GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; -#define glNormalStream3iATI glad_glNormalStream3iATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; -#define glNormalStream3ivATI glad_glNormalStream3ivATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC)(GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; -#define glNormalStream3fATI glad_glNormalStream3fATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; -#define glNormalStream3fvATI glad_glNormalStream3fvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC)(GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; -#define glNormalStream3dATI glad_glNormalStream3dATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; -#define glNormalStream3dvATI glad_glNormalStream3dvATI -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)(GLenum stream); -GLAPI PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; -#define glClientActiveVertexStreamATI glad_glClientActiveVertexStreamATI -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC)(GLenum pname, GLint param); -GLAPI PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; -#define glVertexBlendEnviATI glad_glVertexBlendEnviATI -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; -#define glVertexBlendEnvfATI glad_glVertexBlendEnvfATI -#endif -#ifndef GL_ARB_post_depth_coverage -#define GL_ARB_post_depth_coverage 1 -GLAPI int GLAD_GL_ARB_post_depth_coverage; -#endif -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -GLAPI int GLAD_GL_ARB_texture_non_power_of_two; -#endif -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -GLAPI int GLAD_GL_APPLE_rgb_422; -#endif -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -GLAPI int GLAD_GL_EXT_texture_lod_bias; -#endif -#ifndef GL_ARB_gpu_shader_int64 -#define GL_ARB_gpu_shader_int64 1 -GLAPI int GLAD_GL_ARB_gpu_shader_int64; -typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC)(GLint location, GLint64 x); -GLAPI PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; -#define glUniform1i64ARB glad_glUniform1i64ARB -typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC)(GLint location, GLint64 x, GLint64 y); -GLAPI PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; -#define glUniform2i64ARB glad_glUniform2i64ARB -typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; -#define glUniform3i64ARB glad_glUniform3i64ARB -typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; -#define glUniform4i64ARB glad_glUniform4i64ARB -typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; -#define glUniform1i64vARB glad_glUniform1i64vARB -typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; -#define glUniform2i64vARB glad_glUniform2i64vARB -typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; -#define glUniform3i64vARB glad_glUniform3i64vARB -typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; -#define glUniform4i64vARB glad_glUniform4i64vARB -typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC)(GLint location, GLuint64 x); -GLAPI PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; -#define glUniform1ui64ARB glad_glUniform1ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y); -GLAPI PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; -#define glUniform2ui64ARB glad_glUniform2ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; -#define glUniform3ui64ARB glad_glUniform3ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; -#define glUniform4ui64ARB glad_glUniform4ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; -#define glUniform1ui64vARB glad_glUniform1ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; -#define glUniform2ui64vARB glad_glUniform2ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; -#define glUniform3ui64vARB glad_glUniform3ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; -#define glUniform4ui64vARB glad_glUniform4ui64vARB -typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC)(GLuint program, GLint location, GLint64* params); -GLAPI PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; -#define glGetUniformi64vARB glad_glGetUniformi64vARB -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLuint64* params); -GLAPI PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; -#define glGetUniformui64vARB glad_glGetUniformui64vARB -typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint64* params); -GLAPI PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; -#define glGetnUniformi64vARB glad_glGetnUniformi64vARB -typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint64* params); -GLAPI PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; -#define glGetnUniformui64vARB glad_glGetnUniformui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC)(GLuint program, GLint location, GLint64 x); -GLAPI PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; -#define glProgramUniform1i64ARB glad_glProgramUniform1i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y); -GLAPI PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; -#define glProgramUniform2i64ARB glad_glProgramUniform2i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; -#define glProgramUniform3i64ARB glad_glProgramUniform3i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; -#define glProgramUniform4i64ARB glad_glProgramUniform4i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; -#define glProgramUniform1i64vARB glad_glProgramUniform1i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; -#define glProgramUniform2i64vARB glad_glProgramUniform2i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; -#define glProgramUniform3i64vARB glad_glProgramUniform3i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; -#define glProgramUniform4i64vARB glad_glProgramUniform4i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC)(GLuint program, GLint location, GLuint64 x); -GLAPI PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; -#define glProgramUniform1ui64ARB glad_glProgramUniform1ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y); -GLAPI PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; -#define glProgramUniform2ui64ARB glad_glProgramUniform2ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; -#define glProgramUniform3ui64ARB glad_glProgramUniform3ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; -#define glProgramUniform4ui64ARB glad_glProgramUniform4ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; -#define glProgramUniform1ui64vARB glad_glProgramUniform1ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; -#define glProgramUniform2ui64vARB glad_glProgramUniform2ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; -#define glProgramUniform3ui64vARB glad_glProgramUniform3ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; -#define glProgramUniform4ui64vARB glad_glProgramUniform4ui64vARB -#endif -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -GLAPI int GLAD_GL_ARB_seamless_cube_map; -#endif -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 -GLAPI int GLAD_GL_ARB_shader_group_vote; -#endif -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -GLAPI int GLAD_GL_NV_vdpau_interop; -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC)(const void* vdpDevice, const void* getProcAddress); -GLAPI PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; -#define glVDPAUInitNV glad_glVDPAUInitNV -typedef void (APIENTRYP PFNGLVDPAUFININVPROC)(); -GLAPI PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; -#define glVDPAUFiniNV glad_glVDPAUFiniNV -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); -GLAPI PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; -#define glVDPAURegisterVideoSurfaceNV glad_glVDPAURegisterVideoSurfaceNV -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); -GLAPI PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; -#define glVDPAURegisterOutputSurfaceNV glad_glVDPAURegisterOutputSurfaceNV -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC)(GLvdpauSurfaceNV surface); -GLAPI PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; -#define glVDPAUIsSurfaceNV glad_glVDPAUIsSurfaceNV -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC)(GLvdpauSurfaceNV surface); -GLAPI PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; -#define glVDPAUUnregisterSurfaceNV glad_glVDPAUUnregisterSurfaceNV -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC)(GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); -GLAPI PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; -#define glVDPAUGetSurfaceivNV glad_glVDPAUGetSurfaceivNV -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC)(GLvdpauSurfaceNV surface, GLenum access); -GLAPI PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; -#define glVDPAUSurfaceAccessNV glad_glVDPAUSurfaceAccessNV -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC)(GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); -GLAPI PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; -#define glVDPAUMapSurfacesNV glad_glVDPAUMapSurfacesNV -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC)(GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); -GLAPI PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; -#define glVDPAUUnmapSurfacesNV glad_glVDPAUUnmapSurfacesNV -#endif -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -GLAPI int GLAD_GL_ARB_occlusion_query2; -#endif -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 -GLAPI int GLAD_GL_ARB_internalformat_query2; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); -GLAPI PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; -#define glGetInternalformati64v glad_glGetInternalformati64v -#endif -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; -#endif -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -GLAPI int GLAD_GL_SUN_vertex; -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; -#define glColor4ubVertex2fSUN glad_glColor4ubVertex2fSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC)(const GLubyte* c, const GLfloat* v); -GLAPI PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; -#define glColor4ubVertex2fvSUN glad_glColor4ubVertex2fvSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; -#define glColor4ubVertex3fSUN glad_glColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC)(const GLubyte* c, const GLfloat* v); -GLAPI PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; -#define glColor4ubVertex3fvSUN glad_glColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; -#define glColor3fVertex3fSUN glad_glColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* v); -GLAPI PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; -#define glColor3fVertex3fvSUN glad_glColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC)(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; -#define glNormal3fVertex3fSUN glad_glNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* n, const GLfloat* v); -GLAPI PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; -#define glNormal3fVertex3fvSUN glad_glNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; -#define glColor4fNormal3fVertex3fSUN glad_glColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; -#define glColor4fNormal3fVertex3fvSUN glad_glColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; -#define glTexCoord2fVertex3fSUN glad_glTexCoord2fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; -#define glTexCoord2fVertex3fvSUN glad_glTexCoord2fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; -#define glTexCoord4fVertex4fSUN glad_glTexCoord4fVertex4fSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; -#define glTexCoord4fVertex4fvSUN glad_glTexCoord4fVertex4fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; -#define glTexCoord2fColor4ubVertex3fSUN glad_glTexCoord2fColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)(const GLfloat* tc, const GLubyte* c, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; -#define glTexCoord2fColor4ubVertex3fvSUN glad_glTexCoord2fColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; -#define glTexCoord2fColor3fVertex3fSUN glad_glTexCoord2fColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; -#define glTexCoord2fColor3fVertex3fvSUN glad_glTexCoord2fColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; -#define glTexCoord2fNormal3fVertex3fSUN glad_glTexCoord2fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; -#define glTexCoord2fNormal3fVertex3fvSUN glad_glTexCoord2fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; -#define glTexCoord2fColor4fNormal3fVertex3fSUN glad_glTexCoord2fColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; -#define glTexCoord2fColor4fNormal3fVertex3fvSUN glad_glTexCoord2fColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; -#define glTexCoord4fColor4fNormal3fVertex4fSUN glad_glTexCoord4fColor4fNormal3fVertex4fSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; -#define glTexCoord4fColor4fNormal3fVertex4fvSUN glad_glTexCoord4fColor4fNormal3fVertex4fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)(GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; -#define glReplacementCodeuiVertex3fSUN glad_glReplacementCodeuiVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; -#define glReplacementCodeuiVertex3fvSUN glad_glReplacementCodeuiVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; -#define glReplacementCodeuiColor4ubVertex3fSUN glad_glReplacementCodeuiColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)(const GLuint* rc, const GLubyte* c, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; -#define glReplacementCodeuiColor4ubVertex3fvSUN glad_glReplacementCodeuiColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; -#define glReplacementCodeuiColor3fVertex3fSUN glad_glReplacementCodeuiColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; -#define glReplacementCodeuiColor3fVertex3fvSUN glad_glReplacementCodeuiColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; -#define glReplacementCodeuiNormal3fVertex3fSUN glad_glReplacementCodeuiNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; -#define glReplacementCodeuiNormal3fVertex3fvSUN glad_glReplacementCodeuiNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -#define glReplacementCodeuiColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fVertex3fSUN glad_glReplacementCodeuiTexCoord2fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN -#endif -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -GLAPI int GLAD_GL_SGIX_igloo_interface; -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC)(GLenum pname, const void* params); -GLAPI PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; -#define glIglooInterfaceSGIX glad_glIglooInterfaceSGIX -#endif -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -GLAPI int GLAD_GL_SGIS_texture_lod; -#endif -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -GLAPI int GLAD_GL_NV_vertex_program3; -#endif -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -GLAPI int GLAD_GL_ARB_draw_indirect; -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect); -GLAPI PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; -#define glDrawArraysIndirect glad_glDrawArraysIndirect -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect); -GLAPI PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; -#define glDrawElementsIndirect glad_glDrawElementsIndirect -#endif -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -GLAPI int GLAD_GL_NV_vertex_program4; -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC)(GLuint index, GLint x); -GLAPI PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; -#define glVertexAttribI1iEXT glad_glVertexAttribI1iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC)(GLuint index, GLint x, GLint y); -GLAPI PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; -#define glVertexAttribI2iEXT glad_glVertexAttribI2iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC)(GLuint index, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; -#define glVertexAttribI3iEXT glad_glVertexAttribI3iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; -#define glVertexAttribI4iEXT glad_glVertexAttribI4iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC)(GLuint index, GLuint x); -GLAPI PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; -#define glVertexAttribI1uiEXT glad_glVertexAttribI1uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC)(GLuint index, GLuint x, GLuint y); -GLAPI PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; -#define glVertexAttribI2uiEXT glad_glVertexAttribI2uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; -#define glVertexAttribI3uiEXT glad_glVertexAttribI3uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; -#define glVertexAttribI4uiEXT glad_glVertexAttribI4uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; -#define glVertexAttribI1ivEXT glad_glVertexAttribI1ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; -#define glVertexAttribI2ivEXT glad_glVertexAttribI2ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; -#define glVertexAttribI3ivEXT glad_glVertexAttribI3ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; -#define glVertexAttribI4ivEXT glad_glVertexAttribI4ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; -#define glVertexAttribI1uivEXT glad_glVertexAttribI1uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; -#define glVertexAttribI2uivEXT glad_glVertexAttribI2uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; -#define glVertexAttribI3uivEXT glad_glVertexAttribI3uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; -#define glVertexAttribI4uivEXT glad_glVertexAttribI4uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; -#define glVertexAttribI4bvEXT glad_glVertexAttribI4bvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; -#define glVertexAttribI4svEXT glad_glVertexAttribI4svEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; -#define glVertexAttribI4ubvEXT glad_glVertexAttribI4ubvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; -#define glVertexAttribI4usvEXT glad_glVertexAttribI4usvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; -#define glVertexAttribIPointerEXT glad_glVertexAttribIPointerEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; -#define glGetVertexAttribIivEXT glad_glGetVertexAttribIivEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC)(GLuint index, GLenum pname, GLuint* params); -GLAPI PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; -#define glGetVertexAttribIuivEXT glad_glGetVertexAttribIuivEXT -#endif -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -GLAPI int GLAD_GL_AMD_transform_feedback3_lines_triangles; -#endif -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -GLAPI int GLAD_GL_SGIS_fog_function; -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC)(GLsizei n, const GLfloat* points); -GLAPI PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; -#define glFogFuncSGIS glad_glFogFuncSGIS -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC)(GLfloat* points); -GLAPI PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; -#define glGetFogFuncSGIS glad_glGetFogFuncSGIS -#endif -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -GLAPI int GLAD_GL_EXT_x11_sync_object; -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC)(GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -GLAPI PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; -#define glImportSyncEXT glad_glImportSyncEXT -#endif -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -GLAPI int GLAD_GL_ARB_sync; -#endif -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 -GLAPI int GLAD_GL_NV_sample_locations; -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; -#define glFramebufferSampleLocationsfvNV glad_glFramebufferSampleLocationsfvNV -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; -#define glNamedFramebufferSampleLocationsfvNV glad_glNamedFramebufferSampleLocationsfvNV -typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC)(); -GLAPI PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; -#define glResolveDepthValuesNV glad_glResolveDepthValuesNV -#endif -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 -GLAPI int GLAD_GL_ARB_compute_variable_group_size; -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -GLAPI PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; -#define glDispatchComputeGroupSizeARB glad_glDispatchComputeGroupSizeARB -#endif -#ifndef GL_OES_fixed_point -#define GL_OES_fixed_point 1 -GLAPI int GLAD_GL_OES_fixed_point; -typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC)(GLenum func, GLfixed ref); -GLAPI PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; -#define glAlphaFuncxOES glad_glAlphaFuncxOES -typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; -#define glClearColorxOES glad_glClearColorxOES -typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC)(GLfixed depth); -GLAPI PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; -#define glClearDepthxOES glad_glClearDepthxOES -typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC)(GLenum plane, const GLfixed* equation); -GLAPI PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; -#define glClipPlanexOES glad_glClipPlanexOES -typedef void (APIENTRYP PFNGLCOLOR4XOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCOLOR4XOESPROC glad_glColor4xOES; -#define glColor4xOES glad_glColor4xOES -typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC)(GLfixed n, GLfixed f); -GLAPI PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; -#define glDepthRangexOES glad_glDepthRangexOES -typedef void (APIENTRYP PFNGLFOGXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLFOGXOESPROC glad_glFogxOES; -#define glFogxOES glad_glFogxOES -typedef void (APIENTRYP PFNGLFOGXVOESPROC)(GLenum pname, const GLfixed* param); -GLAPI PFNGLFOGXVOESPROC glad_glFogxvOES; -#define glFogxvOES glad_glFogxvOES -typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; -#define glFrustumxOES glad_glFrustumxOES -typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC)(GLenum plane, GLfixed* equation); -GLAPI PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; -#define glGetClipPlanexOES glad_glGetClipPlanexOES -typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC)(GLenum pname, GLfixed* params); -GLAPI PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; -#define glGetFixedvOES glad_glGetFixedvOES -typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; -#define glGetTexEnvxvOES glad_glGetTexEnvxvOES -typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; -#define glGetTexParameterxvOES glad_glGetTexParameterxvOES -typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; -#define glLightModelxOES glad_glLightModelxOES -typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC)(GLenum pname, const GLfixed* param); -GLAPI PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; -#define glLightModelxvOES glad_glLightModelxvOES -typedef void (APIENTRYP PFNGLLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed param); -GLAPI PFNGLLIGHTXOESPROC glad_glLightxOES; -#define glLightxOES glad_glLightxOES -typedef void (APIENTRYP PFNGLLIGHTXVOESPROC)(GLenum light, GLenum pname, const GLfixed* params); -GLAPI PFNGLLIGHTXVOESPROC glad_glLightxvOES; -#define glLightxvOES glad_glLightxvOES -typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC)(GLfixed width); -GLAPI PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; -#define glLineWidthxOES glad_glLineWidthxOES -typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; -#define glLoadMatrixxOES glad_glLoadMatrixxOES -typedef void (APIENTRYP PFNGLMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); -GLAPI PFNGLMATERIALXOESPROC glad_glMaterialxOES; -#define glMaterialxOES glad_glMaterialxOES -typedef void (APIENTRYP PFNGLMATERIALXVOESPROC)(GLenum face, GLenum pname, const GLfixed* param); -GLAPI PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; -#define glMaterialxvOES glad_glMaterialxvOES -typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; -#define glMultMatrixxOES glad_glMultMatrixxOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; -#define glMultiTexCoord4xOES glad_glMultiTexCoord4xOES -typedef void (APIENTRYP PFNGLNORMAL3XOESPROC)(GLfixed nx, GLfixed ny, GLfixed nz); -GLAPI PFNGLNORMAL3XOESPROC glad_glNormal3xOES; -#define glNormal3xOES glad_glNormal3xOES -typedef void (APIENTRYP PFNGLORTHOXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI PFNGLORTHOXOESPROC glad_glOrthoxOES; -#define glOrthoxOES glad_glOrthoxOES -typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC)(GLenum pname, const GLfixed* params); -GLAPI PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; -#define glPointParameterxvOES glad_glPointParameterxvOES -typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC)(GLfixed size); -GLAPI PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; -#define glPointSizexOES glad_glPointSizexOES -typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC)(GLfixed factor, GLfixed units); -GLAPI PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; -#define glPolygonOffsetxOES glad_glPolygonOffsetxOES -typedef void (APIENTRYP PFNGLROTATEXOESPROC)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLROTATEXOESPROC glad_glRotatexOES; -#define glRotatexOES glad_glRotatexOES -typedef void (APIENTRYP PFNGLSCALEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLSCALEXOESPROC glad_glScalexOES; -#define glScalexOES glad_glScalexOES -typedef void (APIENTRYP PFNGLTEXENVXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLTEXENVXOESPROC glad_glTexEnvxOES; -#define glTexEnvxOES glad_glTexEnvxOES -typedef void (APIENTRYP PFNGLTEXENVXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; -#define glTexEnvxvOES glad_glTexEnvxvOES -typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; -#define glTexParameterxOES glad_glTexParameterxOES -typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; -#define glTexParameterxvOES glad_glTexParameterxvOES -typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; -#define glTranslatexOES glad_glTranslatexOES -typedef void (APIENTRYP PFNGLGETLIGHTXVOESPROC)(GLenum light, GLenum pname, GLfixed* params); -GLAPI PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; -#define glGetLightxvOES glad_glGetLightxvOES -typedef void (APIENTRYP PFNGLGETMATERIALXVOESPROC)(GLenum face, GLenum pname, GLfixed* params); -GLAPI PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; -#define glGetMaterialxvOES glad_glGetMaterialxvOES -typedef void (APIENTRYP PFNGLPOINTPARAMETERXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; -#define glPointParameterxOES glad_glPointParameterxOES -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC)(GLclampx value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; -#define glSampleCoveragexOES glad_glSampleCoveragexOES -typedef void (APIENTRYP PFNGLACCUMXOESPROC)(GLenum op, GLfixed value); -GLAPI PFNGLACCUMXOESPROC glad_glAccumxOES; -#define glAccumxOES glad_glAccumxOES -typedef void (APIENTRYP PFNGLBITMAPXOESPROC)(GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte* bitmap); -GLAPI PFNGLBITMAPXOESPROC glad_glBitmapxOES; -#define glBitmapxOES glad_glBitmapxOES -typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; -#define glBlendColorxOES glad_glBlendColorxOES -typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; -#define glClearAccumxOES glad_glClearAccumxOES -typedef void (APIENTRYP PFNGLCOLOR3XOESPROC)(GLfixed red, GLfixed green, GLfixed blue); -GLAPI PFNGLCOLOR3XOESPROC glad_glColor3xOES; -#define glColor3xOES glad_glColor3xOES -typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC)(const GLfixed* components); -GLAPI PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; -#define glColor3xvOES glad_glColor3xvOES -typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC)(const GLfixed* components); -GLAPI PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; -#define glColor4xvOES glad_glColor4xvOES -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; -#define glConvolutionParameterxOES glad_glConvolutionParameterxOES -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; -#define glConvolutionParameterxvOES glad_glConvolutionParameterxvOES -typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC)(GLfixed u); -GLAPI PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; -#define glEvalCoord1xOES glad_glEvalCoord1xOES -typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; -#define glEvalCoord1xvOES glad_glEvalCoord1xvOES -typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC)(GLfixed u, GLfixed v); -GLAPI PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; -#define glEvalCoord2xOES glad_glEvalCoord2xOES -typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; -#define glEvalCoord2xvOES glad_glEvalCoord2xvOES -typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC)(GLsizei n, GLenum type, const GLfixed* buffer); -GLAPI PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; -#define glFeedbackBufferxOES glad_glFeedbackBufferxOES -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; -#define glGetConvolutionParameterxvOES glad_glGetConvolutionParameterxvOES -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; -#define glGetHistogramParameterxvOES glad_glGetHistogramParameterxvOES -typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed* params); -GLAPI PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; -#define glGetLightxOES glad_glGetLightxOES -typedef void (APIENTRYP PFNGLGETMAPXVOESPROC)(GLenum target, GLenum query, GLfixed* v); -GLAPI PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; -#define glGetMapxvOES glad_glGetMapxvOES -typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); -GLAPI PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; -#define glGetMaterialxOES glad_glGetMaterialxOES -typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC)(GLenum map, GLint size, GLfixed* values); -GLAPI PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; -#define glGetPixelMapxv glad_glGetPixelMapxv -typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC)(GLenum coord, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; -#define glGetTexGenxvOES glad_glGetTexGenxvOES -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC)(GLenum target, GLint level, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; -#define glGetTexLevelParameterxvOES glad_glGetTexLevelParameterxvOES -typedef void (APIENTRYP PFNGLINDEXXOESPROC)(GLfixed component); -GLAPI PFNGLINDEXXOESPROC glad_glIndexxOES; -#define glIndexxOES glad_glIndexxOES -typedef void (APIENTRYP PFNGLINDEXXVOESPROC)(const GLfixed* component); -GLAPI PFNGLINDEXXVOESPROC glad_glIndexxvOES; -#define glIndexxvOES glad_glIndexxvOES -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; -#define glLoadTransposeMatrixxOES glad_glLoadTransposeMatrixxOES -typedef void (APIENTRYP PFNGLMAP1XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -GLAPI PFNGLMAP1XOESPROC glad_glMap1xOES; -#define glMap1xOES glad_glMap1xOES -typedef void (APIENTRYP PFNGLMAP2XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -GLAPI PFNGLMAP2XOESPROC glad_glMap2xOES; -#define glMap2xOES glad_glMap2xOES -typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC)(GLint n, GLfixed u1, GLfixed u2); -GLAPI PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; -#define glMapGrid1xOES glad_glMapGrid1xOES -typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC)(GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -GLAPI PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; -#define glMapGrid2xOES glad_glMapGrid2xOES -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; -#define glMultTransposeMatrixxOES glad_glMultTransposeMatrixxOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC)(GLenum texture, GLfixed s); -GLAPI PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; -#define glMultiTexCoord1xOES glad_glMultiTexCoord1xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; -#define glMultiTexCoord1xvOES glad_glMultiTexCoord1xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC)(GLenum texture, GLfixed s, GLfixed t); -GLAPI PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; -#define glMultiTexCoord2xOES glad_glMultiTexCoord2xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; -#define glMultiTexCoord2xvOES glad_glMultiTexCoord2xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r); -GLAPI PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; -#define glMultiTexCoord3xOES glad_glMultiTexCoord3xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; -#define glMultiTexCoord3xvOES glad_glMultiTexCoord3xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; -#define glMultiTexCoord4xvOES glad_glMultiTexCoord4xvOES -typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; -#define glNormal3xvOES glad_glNormal3xvOES -typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC)(GLfixed token); -GLAPI PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; -#define glPassThroughxOES glad_glPassThroughxOES -typedef void (APIENTRYP PFNGLPIXELMAPXPROC)(GLenum map, GLint size, const GLfixed* values); -GLAPI PFNGLPIXELMAPXPROC glad_glPixelMapx; -#define glPixelMapx glad_glPixelMapx -typedef void (APIENTRYP PFNGLPIXELSTOREXPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPIXELSTOREXPROC glad_glPixelStorex; -#define glPixelStorex glad_glPixelStorex -typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; -#define glPixelTransferxOES glad_glPixelTransferxOES -typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC)(GLfixed xfactor, GLfixed yfactor); -GLAPI PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; -#define glPixelZoomxOES glad_glPixelZoomxOES -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC)(GLsizei n, const GLuint* textures, const GLfixed* priorities); -GLAPI PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; -#define glPrioritizeTexturesxOES glad_glPrioritizeTexturesxOES -typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC)(GLfixed x, GLfixed y); -GLAPI PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; -#define glRasterPos2xOES glad_glRasterPos2xOES -typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; -#define glRasterPos2xvOES glad_glRasterPos2xvOES -typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; -#define glRasterPos3xOES glad_glRasterPos3xOES -typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; -#define glRasterPos3xvOES glad_glRasterPos3xvOES -typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC)(GLfixed x, GLfixed y, GLfixed z, GLfixed w); -GLAPI PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; -#define glRasterPos4xOES glad_glRasterPos4xOES -typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; -#define glRasterPos4xvOES glad_glRasterPos4xvOES -typedef void (APIENTRYP PFNGLRECTXOESPROC)(GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -GLAPI PFNGLRECTXOESPROC glad_glRectxOES; -#define glRectxOES glad_glRectxOES -typedef void (APIENTRYP PFNGLRECTXVOESPROC)(const GLfixed* v1, const GLfixed* v2); -GLAPI PFNGLRECTXVOESPROC glad_glRectxvOES; -#define glRectxvOES glad_glRectxvOES -typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC)(GLfixed s); -GLAPI PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; -#define glTexCoord1xOES glad_glTexCoord1xOES -typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; -#define glTexCoord1xvOES glad_glTexCoord1xvOES -typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC)(GLfixed s, GLfixed t); -GLAPI PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; -#define glTexCoord2xOES glad_glTexCoord2xOES -typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; -#define glTexCoord2xvOES glad_glTexCoord2xvOES -typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC)(GLfixed s, GLfixed t, GLfixed r); -GLAPI PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; -#define glTexCoord3xOES glad_glTexCoord3xOES -typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; -#define glTexCoord3xvOES glad_glTexCoord3xvOES -typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC)(GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; -#define glTexCoord4xOES glad_glTexCoord4xOES -typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; -#define glTexCoord4xvOES glad_glTexCoord4xvOES -typedef void (APIENTRYP PFNGLTEXGENXOESPROC)(GLenum coord, GLenum pname, GLfixed param); -GLAPI PFNGLTEXGENXOESPROC glad_glTexGenxOES; -#define glTexGenxOES glad_glTexGenxOES -typedef void (APIENTRYP PFNGLTEXGENXVOESPROC)(GLenum coord, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; -#define glTexGenxvOES glad_glTexGenxvOES -typedef void (APIENTRYP PFNGLVERTEX2XOESPROC)(GLfixed x); -GLAPI PFNGLVERTEX2XOESPROC glad_glVertex2xOES; -#define glVertex2xOES glad_glVertex2xOES -typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; -#define glVertex2xvOES glad_glVertex2xvOES -typedef void (APIENTRYP PFNGLVERTEX3XOESPROC)(GLfixed x, GLfixed y); -GLAPI PFNGLVERTEX3XOESPROC glad_glVertex3xOES; -#define glVertex3xOES glad_glVertex3xOES -typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; -#define glVertex3xvOES glad_glVertex3xvOES -typedef void (APIENTRYP PFNGLVERTEX4XOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLVERTEX4XOESPROC glad_glVertex4xOES; -#define glVertex4xOES glad_glVertex4xOES -typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; -#define glVertex4xvOES glad_glVertex4xvOES -#endif -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -GLAPI int GLAD_GL_NV_blend_square; -#endif -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample; -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT -#endif -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -GLAPI int GLAD_GL_ARB_gpu_shader5; -#endif -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -GLAPI int GLAD_GL_SGIS_texture4D; -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; -#define glTexImage4DSGIS glad_glTexImage4DSGIS -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; -#define glTexSubImage4DSGIS glad_glTexSubImage4DSGIS -#endif -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -GLAPI int GLAD_GL_EXT_texture3D; -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; -#define glTexImage3DEXT glad_glTexImage3DEXT -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; -#define glTexSubImage3DEXT glad_glTexSubImage3DEXT -#endif -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -GLAPI int GLAD_GL_EXT_multisample; -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC)(GLclampf value, GLboolean invert); -GLAPI PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; -#define glSampleMaskEXT glad_glSampleMaskEXT -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC)(GLenum pattern); -GLAPI PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; -#define glSamplePatternEXT glad_glSamplePatternEXT -#endif -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -GLAPI int GLAD_GL_EXT_secondary_color; -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC)(GLbyte red, GLbyte green, GLbyte blue); -GLAPI PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; -#define glSecondaryColor3bEXT glad_glSecondaryColor3bEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; -#define glSecondaryColor3bvEXT glad_glSecondaryColor3bvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC)(GLdouble red, GLdouble green, GLdouble blue); -GLAPI PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; -#define glSecondaryColor3dEXT glad_glSecondaryColor3dEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; -#define glSecondaryColor3dvEXT glad_glSecondaryColor3dvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC)(GLfloat red, GLfloat green, GLfloat blue); -GLAPI PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; -#define glSecondaryColor3fEXT glad_glSecondaryColor3fEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; -#define glSecondaryColor3fvEXT glad_glSecondaryColor3fvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC)(GLint red, GLint green, GLint blue); -GLAPI PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; -#define glSecondaryColor3iEXT glad_glSecondaryColor3iEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC)(const GLint* v); -GLAPI PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; -#define glSecondaryColor3ivEXT glad_glSecondaryColor3ivEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC)(GLshort red, GLshort green, GLshort blue); -GLAPI PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; -#define glSecondaryColor3sEXT glad_glSecondaryColor3sEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; -#define glSecondaryColor3svEXT glad_glSecondaryColor3svEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC)(GLubyte red, GLubyte green, GLubyte blue); -GLAPI PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; -#define glSecondaryColor3ubEXT glad_glSecondaryColor3ubEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC)(const GLubyte* v); -GLAPI PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; -#define glSecondaryColor3ubvEXT glad_glSecondaryColor3ubvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC)(GLuint red, GLuint green, GLuint blue); -GLAPI PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; -#define glSecondaryColor3uiEXT glad_glSecondaryColor3uiEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC)(const GLuint* v); -GLAPI PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; -#define glSecondaryColor3uivEXT glad_glSecondaryColor3uivEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC)(GLushort red, GLushort green, GLushort blue); -GLAPI PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; -#define glSecondaryColor3usEXT glad_glSecondaryColor3usEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC)(const GLushort* v); -GLAPI PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; -#define glSecondaryColor3usvEXT glad_glSecondaryColor3usvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; -#define glSecondaryColorPointerEXT glad_glSecondaryColorPointerEXT -#endif -#ifndef GL_ARB_texture_filter_minmax -#define GL_ARB_texture_filter_minmax 1 -GLAPI int GLAD_GL_ARB_texture_filter_minmax; -#endif -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -GLAPI int GLAD_GL_ATI_vertex_array_object; -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC)(GLsizei size, const void* pointer, GLenum usage); -GLAPI PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -#define glNewObjectBufferATI glad_glNewObjectBufferATI -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -#define glIsObjectBufferATI glad_glIsObjectBufferATI -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC)(GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); -GLAPI PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -#define glUpdateObjectBufferATI glad_glUpdateObjectBufferATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC)(GLuint buffer, GLenum pname, GLfloat* params); -GLAPI PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -#define glGetObjectBufferfvATI glad_glGetObjectBufferfvATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -#define glGetObjectBufferivATI glad_glGetObjectBufferivATI -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -#define glFreeObjectBufferATI glad_glFreeObjectBufferATI -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC)(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -#define glArrayObjectATI glad_glArrayObjectATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC)(GLenum array, GLenum pname, GLfloat* params); -GLAPI PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -#define glGetArrayObjectfvATI glad_glGetArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC)(GLenum array, GLenum pname, GLint* params); -GLAPI PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -#define glGetArrayObjectivATI glad_glGetArrayObjectivATI -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC)(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -#define glVariantArrayObjectATI glad_glVariantArrayObjectATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC)(GLuint id, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -#define glGetVariantArrayObjectfvATI glad_glGetVariantArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -#define glGetVariantArrayObjectivATI glad_glGetVariantArrayObjectivATI -#endif -#ifndef GL_ARB_parallel_shader_compile -#define GL_ARB_parallel_shader_compile 1 -GLAPI int GLAD_GL_ARB_parallel_shader_compile; -typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC)(GLuint count); -GLAPI PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; -#define glMaxShaderCompilerThreadsARB glad_glMaxShaderCompilerThreadsARB -#endif -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -GLAPI int GLAD_GL_NVX_gpu_memory_info; -#endif -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 -GLAPI int GLAD_GL_ARB_sparse_texture; -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -GLAPI PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; -#define glTexPageCommitmentARB glad_glTexPageCommitmentARB -#endif -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -GLAPI int GLAD_GL_SGIS_point_line_texgen; -#endif -#ifndef GL_ARB_sample_locations -#define GL_ARB_sample_locations 1 -GLAPI int GLAD_GL_ARB_sample_locations; -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -#define glFramebufferSampleLocationsfvARB glad_glFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -#define glNamedFramebufferSampleLocationsfvARB glad_glNamedFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC)(); -GLAPI PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -#define glEvaluateDepthValuesARB glad_glEvaluateDepthValuesARB -#endif -#ifndef GL_ARB_sparse_buffer -#define GL_ARB_sparse_buffer 1 -GLAPI int GLAD_GL_ARB_sparse_buffer; -typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC)(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; -#define glBufferPageCommitmentARB glad_glBufferPageCommitmentARB -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; -#define glNamedBufferPageCommitmentEXT glad_glNamedBufferPageCommitmentEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; -#define glNamedBufferPageCommitmentARB glad_glNamedBufferPageCommitmentARB -#endif -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -GLAPI int GLAD_GL_EXT_draw_range_elements; -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; -#define glDrawRangeElementsEXT glad_glDrawRangeElementsEXT -#endif -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -GLAPI int GLAD_GL_SGIX_blend_alpha_minmax; -#endif -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -GLAPI int GLAD_GL_KHR_context_flush_control; -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/jar_mod.h b/src/jar_mod.h deleted file mode 100644 index 2ddc61d1..00000000 --- a/src/jar_mod.h +++ /dev/null @@ -1,1587 +0,0 @@ -// jar_mod.h - v0.01 - public domain C0 - Joshua Reisenauer -// -// HISTORY: -// -// v0.01 2016-03-12 Setup -// -// -// USAGE: -// -// In ONE source file, put: -// -// #define JAR_MOD_IMPLEMENTATION -// #include "jar_mod.h" -// -// Other source files should just include jar_mod.h -// -// SAMPLE CODE: -// jar_mod_context_t modctx; -// short samplebuff[4096]; -// bool bufferFull = false; -// int intro_load(void) -// { -// jar_mod_init(&modctx); -// jar_mod_load_file(&modctx, "file.mod"); -// return 1; -// } -// int intro_unload(void) -// { -// jar_mod_unload(&modctx); -// return 1; -// } -// int intro_tick(long counter) -// { -// if(!bufferFull) -// { -// jar_mod_fillbuffer(&modctx, samplebuff, 4096, 0); -// bufferFull=true; -// } -// if(IsKeyDown(KEY_ENTER)) -// return 1; -// return 0; -// } -// -// -// LISCENSE: -// -// Written by: Jean-François DEL NERO (http://hxc2001.com/) free.fr> -// Adapted to jar_mod by: Joshua Adam Reisenauer -// This program is free software. It comes without any warranty, to the -// extent permitted by applicable law. You can redistribute it and/or -// modify it under the terms of the Do What The Fuck You Want To Public -// License, Version 2, as published by Sam Hocevar. See -// http://sam.zoy.org/wtfpl/COPYING for more details. -/////////////////////////////////////////////////////////////////////////////////// -// HxCMOD Core API: -// ------------------------------------------- -// int jar_mod_init(jar_mod_context_t * modctx) -// -// - Initialize the jar_mod_context_t buffer. Must be called before doing anything else. -// Return 1 if success. 0 in case of error. -// ------------------------------------------- -// mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) -// -// - "Load" a MOD from file, context must already be initialized. -// Return size of file in bytes. -// ------------------------------------------- -// void jar_mod_fillbuffer( jar_mod_context_t * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) -// -// - Generate and return the next samples chunk to outbuffer. -// nbsample specify the number of stereo 16bits samples you want. -// The output format is by default signed 48000Hz 16-bit Stereo PCM samples, otherwise it is changed with jar_mod_setcfg(). -// The output buffer size in bytes must be equal to ( nbsample * 2 * channels ). -// The optional trkbuf parameter can be used to get detailed status of the player. Put NULL/0 is unused. -// ------------------------------------------- -// void jar_mod_unload( jar_mod_context_t * modctx ) -// - "Unload" / clear the player status. -// ------------------------------------------- -/////////////////////////////////////////////////////////////////////////////////// - - -#ifndef INCLUDE_JAR_MOD_H -#define INCLUDE_JAR_MOD_H - -#include -#include -#include - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -// Basic type -typedef unsigned char muchar; -typedef unsigned short muint; -typedef short mint; -typedef unsigned long mulong; - -#define NUMMAXCHANNELS 32 -#define MAXNOTES 12*12 -#define DEFAULT_SAMPLE_RATE 48000 -// -// MOD file structures -// - -#pragma pack(1) - -typedef struct { - muchar name[22]; - muint length; - muchar finetune; - muchar volume; - muint reppnt; - muint replen; -} sample; - -typedef struct { - muchar sampperiod; - muchar period; - muchar sampeffect; - muchar effect; -} note; - -typedef struct { - muchar title[20]; - sample samples[31]; - muchar length; // length of tablepos - muchar protracker; - muchar patterntable[128]; - muchar signature[4]; - muchar speed; -} module; - -#pragma pack() - -// -// HxCMod Internal structures -// -typedef struct { - char* sampdata; - muint sampnum; - muint length; - muint reppnt; - muint replen; - mulong samppos; - muint period; - muchar volume; - mulong ticks; - muchar effect; - muchar parameffect; - muint effect_code; - mint decalperiod; - mint portaspeed; - mint portaperiod; - mint vibraperiod; - mint Arpperiods[3]; - muchar ArpIndex; - mint oldk; - muchar volumeslide; - muchar vibraparam; - muchar vibrapointeur; - muchar finetune; - muchar cut_param; - muint patternloopcnt; - muint patternloopstartpoint; -} channel; - -typedef struct { - module song; - char* sampledata[31]; - note* patterndata[128]; - - mulong playrate; - muint tablepos; - muint patternpos; - muint patterndelay; - muint jump_loop_effect; - muchar bpm; - mulong patternticks; - mulong patterntickse; - mulong patternticksaim; - mulong sampleticksconst; - mulong samplenb; - channel channels[NUMMAXCHANNELS]; - muint number_of_channels; - muint fullperiod[MAXNOTES * 8]; - muint mod_loaded; - mint last_r_sample; - mint last_l_sample; - mint stereo; - mint stereo_separation; - mint bits; - mint filter; - - muchar *modfile; // the raw mod file - mulong modfilesize; - muint loopcount; -} jar_mod_context_t; - -// -// Player states structures -// -typedef struct track_state_ -{ - unsigned char instrument_number; - unsigned short cur_period; - unsigned char cur_volume; - unsigned short cur_effect; - unsigned short cur_parameffect; -}track_state; - -typedef struct tracker_state_ -{ - int number_of_tracks; - int bpm; - int speed; - int cur_pattern; - int cur_pattern_pos; - int cur_pattern_table_pos; - unsigned int buf_index; - track_state tracks[32]; -}tracker_state; - -typedef struct tracker_state_instrument_ -{ - char name[22]; - int active; -}tracker_state_instrument; - -typedef struct jar_mod_tracker_buffer_state_ -{ - int nb_max_of_state; - int nb_of_state; - int cur_rd_index; - int sample_step; - char name[64]; - tracker_state_instrument instruments[31]; - tracker_state * track_state_buf; -}jar_mod_tracker_buffer_state; - - - -bool jar_mod_init(jar_mod_context_t * modctx); -bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); -void jar_mod_fillbuffer(jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); -void jar_mod_unload(jar_mod_context_t * modctx); -mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename); -mulong jar_mod_current_samples(jar_mod_context_t * modctx); -mulong jar_mod_max_samples(jar_mod_context_t * modctx); -void jar_mod_seek_start(jar_mod_context_t * ctx); - -#ifdef __cplusplus -} -#endif -//-------------------------------------------------------------------- - - - -//------------------------------------------------------------------------------- -#ifdef JAR_MOD_IMPLEMENTATION - -// Effects list -#define EFFECT_ARPEGGIO 0x0 // Supported -#define EFFECT_PORTAMENTO_UP 0x1 // Supported -#define EFFECT_PORTAMENTO_DOWN 0x2 // Supported -#define EFFECT_TONE_PORTAMENTO 0x3 // Supported -#define EFFECT_VIBRATO 0x4 // Supported -#define EFFECT_VOLSLIDE_TONEPORTA 0x5 // Supported -#define EFFECT_VOLSLIDE_VIBRATO 0x6 // Supported -#define EFFECT_VOLSLIDE_TREMOLO 0x7 // - TO BE DONE - -#define EFFECT_SET_PANNING 0x8 // - TO BE DONE - -#define EFFECT_SET_OFFSET 0x9 // Supported -#define EFFECT_VOLUME_SLIDE 0xA // Supported -#define EFFECT_JUMP_POSITION 0xB // Supported -#define EFFECT_SET_VOLUME 0xC // Supported -#define EFFECT_PATTERN_BREAK 0xD // Supported - -#define EFFECT_EXTENDED 0xE -#define EFFECT_E_FINE_PORTA_UP 0x1 // Supported -#define EFFECT_E_FINE_PORTA_DOWN 0x2 // Supported -#define EFFECT_E_GLISSANDO_CTRL 0x3 // - TO BE DONE - -#define EFFECT_E_VIBRATO_WAVEFORM 0x4 // - TO BE DONE - -#define EFFECT_E_SET_FINETUNE 0x5 // - TO BE DONE - -#define EFFECT_E_PATTERN_LOOP 0x6 // Supported -#define EFFECT_E_TREMOLO_WAVEFORM 0x7 // - TO BE DONE - -#define EFFECT_E_SET_PANNING_2 0x8 // - TO BE DONE - -#define EFFECT_E_RETRIGGER_NOTE 0x9 // - TO BE DONE - -#define EFFECT_E_FINE_VOLSLIDE_UP 0xA // Supported -#define EFFECT_E_FINE_VOLSLIDE_DOWN 0xB // Supported -#define EFFECT_E_NOTE_CUT 0xC // Supported -#define EFFECT_E_NOTE_DELAY 0xD // - TO BE DONE - -#define EFFECT_E_PATTERN_DELAY 0xE // Supported -#define EFFECT_E_INVERT_LOOP 0xF // - TO BE DONE - -#define EFFECT_SET_SPEED 0xF0 // Supported -#define EFFECT_SET_TEMPO 0xF2 // Supported - -#define PERIOD_TABLE_LENGTH MAXNOTES -#define FULL_PERIOD_TABLE_LENGTH ( PERIOD_TABLE_LENGTH * 8 ) - -static const short periodtable[]= -{ - 27392, 25856, 24384, 23040, 21696, 20480, 19328, 18240, 17216, 16256, 15360, 14496, - 13696, 12928, 12192, 11520, 10848, 10240, 9664, 9120, 8606, 8128, 7680, 7248, - 6848, 6464, 6096, 5760, 5424, 5120, 4832, 4560, 4304, 4064, 3840, 3624, - 3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812, - 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 906, - 856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453, - 428, 404, 381, 360, 339, 320, 302, 285, 269, 254, 240, 226, - 214, 202, 190, 180, 170, 160, 151, 143, 135, 127, 120, 113, - 107, 101, 95, 90, 85, 80, 75, 71, 67, 63, 60, 56, - 53, 50, 47, 45, 42, 40, 37, 35, 33, 31, 30, 28, - 27, 25, 24, 22, 21, 20, 19, 18, 17, 16, 15, 14, - 13, 13, 12, 11, 11, 10, 9, 9, 8, 8, 7, 7 -}; - -static const short sintable[]={ - 0, 24, 49, 74, 97, 120, 141,161, - 180, 197, 212, 224, 235, 244, 250,253, - 255, 253, 250, 244, 235, 224, 212,197, - 180, 161, 141, 120, 97, 74, 49, 24 -}; - -typedef struct modtype_ -{ - unsigned char signature[5]; - int numberofchannels; -}modtype; - -modtype modlist[]= -{ - { "M!K!",4}, - { "M.K.",4}, - { "FLT4",4}, - { "FLT8",8}, - { "4CHN",4}, - { "6CHN",6}, - { "8CHN",8}, - { "10CH",10}, - { "12CH",12}, - { "14CH",14}, - { "16CH",16}, - { "18CH",18}, - { "20CH",20}, - { "22CH",22}, - { "24CH",24}, - { "26CH",26}, - { "28CH",28}, - { "30CH",30}, - { "32CH",32}, - { "",0} -}; - -/////////////////////////////////////////////////////////////////////////////////// - -static void memcopy( void * dest, void *source, unsigned long size ) -{ - unsigned long i; - unsigned char * d,*s; - - d=(unsigned char*)dest; - s=(unsigned char*)source; - for(i=0;i= mod->fullperiod[i]) - { - return i; - } - } - - return MAXNOTES; -} - -static void worknote( note * nptr, channel * cptr, char t, jar_mod_context_t * mod ) -{ - muint sample, period, effect, operiod; - muint curnote, arpnote; - - sample = (nptr->sampperiod & 0xF0) | (nptr->sampeffect >> 4); - period = ((nptr->sampperiod & 0xF) << 8) | nptr->period; - effect = ((nptr->sampeffect & 0xF) << 8) | nptr->effect; - - operiod = cptr->period; - - if ( period || sample ) - { - if( sample && sample < 32 ) - { - cptr->sampnum = sample - 1; - } - - if( period || sample ) - { - cptr->sampdata = (char *) mod->sampledata[cptr->sampnum]; - cptr->length = mod->song.samples[cptr->sampnum].length; - cptr->reppnt = mod->song.samples[cptr->sampnum].reppnt; - cptr->replen = mod->song.samples[cptr->sampnum].replen; - - cptr->finetune = (mod->song.samples[cptr->sampnum].finetune)&0xF; - - if(effect>>8!=4 && effect>>8!=6) - { - cptr->vibraperiod=0; - cptr->vibrapointeur=0; - } - } - - if( (sample != 0) && ( (effect>>8) != EFFECT_VOLSLIDE_TONEPORTA ) ) - { - cptr->volume = mod->song.samples[cptr->sampnum].volume; - cptr->volumeslide = 0; - } - - if( ( (effect>>8) != EFFECT_TONE_PORTAMENTO && (effect>>8)!=EFFECT_VOLSLIDE_TONEPORTA) ) - { - if (period!=0) - cptr->samppos = 0; - } - - cptr->decalperiod = 0; - if( period ) - { - if(cptr->finetune) - { - if( cptr->finetune <= 7 ) - { - period = mod->fullperiod[getnote(mod,period,0) + cptr->finetune]; - } - else - { - period = mod->fullperiod[getnote(mod,period,0) - (16 - (cptr->finetune)) ]; - } - } - - cptr->period = period; - } - - } - - cptr->effect = 0; - cptr->parameffect = 0; - cptr->effect_code = effect; - - switch (effect >> 8) - { - case EFFECT_ARPEGGIO: - /* - [0]: Arpeggio - Where [0][x][y] means "play note, note+x semitones, note+y - semitones, then return to original note". The fluctuations are - carried out evenly spaced in one pattern division. They are usually - used to simulate chords, but this doesn't work too well. They are - also used to produce heavy vibrato. A major chord is when x=4, y=7. - A minor chord is when x=3, y=7. - */ - - if(effect&0xff) - { - cptr->effect = EFFECT_ARPEGGIO; - cptr->parameffect = effect&0xff; - - cptr->ArpIndex = 0; - - curnote = getnote(mod,cptr->period,cptr->finetune); - - cptr->Arpperiods[0] = cptr->period; - - arpnote = curnote + (((cptr->parameffect>>4)&0xF)*8); - if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) - arpnote = FULL_PERIOD_TABLE_LENGTH - 1; - - cptr->Arpperiods[1] = mod->fullperiod[arpnote]; - - arpnote = curnote + (((cptr->parameffect)&0xF)*8); - if( arpnote >= FULL_PERIOD_TABLE_LENGTH ) - arpnote = FULL_PERIOD_TABLE_LENGTH - 1; - - cptr->Arpperiods[2] = mod->fullperiod[arpnote]; - } - break; - - case EFFECT_PORTAMENTO_UP: - /* - [1]: Slide up - Where [1][x][y] means "smoothly decrease the period of current - sample by x*16+y after each tick in the division". The - ticks/division are set with the 'set speed' effect (see below). If - the period of the note being played is z, then the final period - will be z - (x*16 + y)*(ticks - 1). As the slide rate depends on - the speed, changing the speed will change the slide. You cannot - slide beyond the note B3 (period 113). - */ - - cptr->effect = EFFECT_PORTAMENTO_UP; - cptr->parameffect = effect&0xff; - break; - - case EFFECT_PORTAMENTO_DOWN: - /* - [2]: Slide down - Where [2][x][y] means "smoothly increase the period of current - sample by x*16+y after each tick in the division". Similar to [1], - but lowers the pitch. You cannot slide beyond the note C1 (period - 856). - */ - - cptr->effect = EFFECT_PORTAMENTO_DOWN; - cptr->parameffect = effect&0xff; - break; - - case EFFECT_TONE_PORTAMENTO: - /* - [3]: Slide to note - Where [3][x][y] means "smoothly change the period of current sample - by x*16+y after each tick in the division, never sliding beyond - current period". The period-length in this channel's division is a - parameter to this effect, and hence is not played. Sliding to a - note is similar to effects [1] and [2], but the slide will not go - beyond the given period, and the direction is implied by that - period. If x and y are both 0, then the old slide will continue. - */ - - cptr->effect = EFFECT_TONE_PORTAMENTO; - if( (effect&0xff) != 0 ) - { - cptr->portaspeed = (short)(effect&0xff); - } - - if(period!=0) - { - cptr->portaperiod = period; - cptr->period = operiod; - } - break; - - case EFFECT_VIBRATO: - /* - [4]: Vibrato - Where [4][x][y] means "oscillate the sample pitch using a - particular waveform with amplitude y/16 semitones, such that (x * - ticks)/64 cycles occur in the division". The waveform is set using - effect [14][4]. By placing vibrato effects on consecutive - divisions, the vibrato effect can be maintained. If either x or y - are 0, then the old vibrato values will be used. - */ - - cptr->effect = EFFECT_VIBRATO; - if( ( effect & 0x0F ) != 0 ) // Depth continue or change ? - cptr->vibraparam = (cptr->vibraparam & 0xF0) | ( effect & 0x0F ); - if( ( effect & 0xF0 ) != 0 ) // Speed continue or change ? - cptr->vibraparam = (cptr->vibraparam & 0x0F) | ( effect & 0xF0 ); - - break; - - case EFFECT_VOLSLIDE_TONEPORTA: - /* - [5]: Continue 'Slide to note', but also do Volume slide - Where [5][x][y] means "either slide the volume up x*(ticks - 1) or - slide the volume down y*(ticks - 1), at the same time as continuing - the last 'Slide to note'". It is illegal for both x and y to be - non-zero. You cannot slide outside the volume range 0..64. The - period-length in this channel's division is a parameter to this - effect, and hence is not played. - */ - - if( period != 0 ) - { - cptr->portaperiod = period; - cptr->period = operiod; - } - - cptr->effect = EFFECT_VOLSLIDE_TONEPORTA; - if( ( effect & 0xFF ) != 0 ) - cptr->volumeslide = ( effect & 0xFF ); - - break; - - case EFFECT_VOLSLIDE_VIBRATO: - /* - [6]: Continue 'Vibrato', but also do Volume slide - Where [6][x][y] means "either slide the volume up x*(ticks - 1) or - slide the volume down y*(ticks - 1), at the same time as continuing - the last 'Vibrato'". It is illegal for both x and y to be non-zero. - You cannot slide outside the volume range 0..64. - */ - - cptr->effect = EFFECT_VOLSLIDE_VIBRATO; - if( (effect & 0xFF) != 0 ) - cptr->volumeslide = (effect & 0xFF); - break; - - case EFFECT_SET_OFFSET: - /* - [9]: Set sample offset - Where [9][x][y] means "play the sample from offset x*4096 + y*256". - The offset is measured in words. If no sample is given, yet one is - still playing on this channel, it should be retriggered to the new - offset using the current volume. - */ - - cptr->samppos = ((effect>>4) * 4096) + ((effect&0xF)*256); - - break; - - case EFFECT_VOLUME_SLIDE: - /* - [10]: Volume slide - Where [10][x][y] means "either slide the volume up x*(ticks - 1) or - slide the volume down y*(ticks - 1)". If both x and y are non-zero, - then the y value is ignored (assumed to be 0). You cannot slide - outside the volume range 0..64. - */ - - cptr->effect = EFFECT_VOLUME_SLIDE; - cptr->volumeslide = (effect & 0xFF); - break; - - case EFFECT_JUMP_POSITION: - /* - [11]: Position Jump - Where [11][x][y] means "stop the pattern after this division, and - continue the song at song-position x*16+y". This shifts the - 'pattern-cursor' in the pattern table (see above). Legal values for - x*16+y are from 0 to 127. - */ - - mod->tablepos = (effect & 0xFF); - if(mod->tablepos >= mod->song.length) - { - mod->tablepos = 0; - } - mod->patternpos = 0; - mod->jump_loop_effect = 1; - - break; - - case EFFECT_SET_VOLUME: - /* - [12]: Set volume - Where [12][x][y] means "set current sample's volume to x*16+y". - Legal volumes are 0..64. - */ - - cptr->volume = (effect & 0xFF); - break; - - case EFFECT_PATTERN_BREAK: - /* - [13]: Pattern Break - Where [13][x][y] means "stop the pattern after this division, and - continue the song at the next pattern at division x*10+y" (the 10 - is not a typo). Legal divisions are from 0 to 63 (note Protracker - exception above). - */ - - mod->patternpos = ( ((effect>>4)&0xF)*10 + (effect&0xF) ) * mod->number_of_channels; - mod->jump_loop_effect = 1; - mod->tablepos++; - if(mod->tablepos >= mod->song.length) - { - mod->tablepos = 0; - } - - break; - - case EFFECT_EXTENDED: - switch( (effect>>4) & 0xF ) - { - case EFFECT_E_FINE_PORTA_UP: - /* - [14][1]: Fineslide up - Where [14][1][x] means "decrement the period of the current sample - by x". The incrementing takes place at the beginning of the - division, and hence there is no actual sliding. You cannot slide - beyond the note B3 (period 113). - */ - - cptr->period -= (effect & 0xF); - if( cptr->period < 113 ) - cptr->period = 113; - break; - - case EFFECT_E_FINE_PORTA_DOWN: - /* - [14][2]: Fineslide down - Where [14][2][x] means "increment the period of the current sample - by x". Similar to [14][1] but shifts the pitch down. You cannot - slide beyond the note C1 (period 856). - */ - - cptr->period += (effect & 0xF); - if( cptr->period > 856 ) - cptr->period = 856; - break; - - case EFFECT_E_FINE_VOLSLIDE_UP: - /* - [14][10]: Fine volume slide up - Where [14][10][x] means "increment the volume of the current sample - by x". The incrementing takes place at the beginning of the - division, and hence there is no sliding. You cannot slide beyond - volume 64. - */ - - cptr->volume += (effect & 0xF); - if( cptr->volume>64 ) - cptr->volume = 64; - break; - - case EFFECT_E_FINE_VOLSLIDE_DOWN: - /* - [14][11]: Fine volume slide down - Where [14][11][x] means "decrement the volume of the current sample - by x". Similar to [14][10] but lowers volume. You cannot slide - beyond volume 0. - */ - - cptr->volume -= (effect & 0xF); - if( cptr->volume > 200 ) - cptr->volume = 0; - break; - - case EFFECT_E_PATTERN_LOOP: - /* - [14][6]: Loop pattern - Where [14][6][x] means "set the start of a loop to this division if - x is 0, otherwise after this division, jump back to the start of a - loop and play it another x times before continuing". If the start - of the loop was not set, it will default to the start of the - current pattern. Hence 'loop pattern' cannot be performed across - multiple patterns. Note that loops do not support nesting, and you - may generate an infinite loop if you try to nest 'loop pattern's. - */ - - if( effect & 0xF ) - { - if( cptr->patternloopcnt ) - { - cptr->patternloopcnt--; - if( cptr->patternloopcnt ) - { - mod->patternpos = cptr->patternloopstartpoint; - mod->jump_loop_effect = 1; - } - else - { - cptr->patternloopstartpoint = mod->patternpos ; - } - } - else - { - cptr->patternloopcnt = (effect & 0xF); - mod->patternpos = cptr->patternloopstartpoint; - mod->jump_loop_effect = 1; - } - } - else // Start point - { - cptr->patternloopstartpoint = mod->patternpos; - } - - break; - - case EFFECT_E_PATTERN_DELAY: - /* - [14][14]: Delay pattern - Where [14][14][x] means "after this division there will be a delay - equivalent to the time taken to play x divisions after which the - pattern will be resumed". The delay only relates to the - interpreting of new divisions, and all effects and previous notes - continue during delay. - */ - - mod->patterndelay = (effect & 0xF); - break; - - case EFFECT_E_NOTE_CUT: - /* - [14][12]: Cut sample - Where [14][12][x] means "after the current sample has been played - for x ticks in this division, its volume will be set to 0". This - implies that if x is 0, then you will not hear any of the sample. - If you wish to insert "silence" in a pattern, it is better to use a - "silence"-sample (see above) due to the lack of proper support for - this effect. - */ - cptr->effect = EFFECT_E_NOTE_CUT; - cptr->cut_param = (effect & 0xF); - if(!cptr->cut_param) - cptr->volume = 0; - break; - - default: - - break; - } - break; - - case 0xF: - /* - [15]: Set speed - Where [15][x][y] means "set speed to x*16+y". Though it is nowhere - near that simple. Let z = x*16+y. Depending on what values z takes, - different units of speed are set, there being two: ticks/division - and beats/minute (though this one is only a label and not strictly - true). If z=0, then what should technically happen is that the - module stops, but in practice it is treated as if z=1, because - there is already a method for stopping the module (running out of - patterns). If z<=32, then it means "set ticks/division to z" - otherwise it means "set beats/minute to z" (convention says that - this should read "If z<32.." but there are some composers out there - that defy conventions). Default values are 6 ticks/division, and - 125 beats/minute (4 divisions = 1 beat). The beats/minute tag is - only meaningful for 6 ticks/division. To get a more accurate view - of how things work, use the following formula: - 24 * beats/minute - divisions/minute = ----------------- - ticks/division - Hence divisions/minute range from 24.75 to 6120, eg. to get a value - of 2000 divisions/minute use 3 ticks/division and 250 beats/minute. - If multiple "set speed" effects are performed in a single division, - the ones on higher-numbered channels take precedence over the ones - on lower-numbered channels. This effect has a large number of - different implementations, but the one described here has the - widest usage. - */ - - if( (effect&0xFF) < 0x21 ) - { - if( effect&0xFF ) - { - mod->song.speed = effect&0xFF; - mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); - } - } - - if( (effect&0xFF) >= 0x21 ) - { - /// HZ = 2 * BPM / 5 - mod->bpm = effect&0xFF; - mod->patternticksaim = (long)mod->song.speed * ((mod->playrate * 5 ) / (((long)2 * (long)mod->bpm))); - } - - break; - - default: - // Unsupported effect - break; - - } - -} - -static void workeffect( note * nptr, channel * cptr ) -{ - switch(cptr->effect) - { - case EFFECT_ARPEGGIO: - - if( cptr->parameffect ) - { - cptr->decalperiod = cptr->period - cptr->Arpperiods[cptr->ArpIndex]; - - cptr->ArpIndex++; - if( cptr->ArpIndex>2 ) - cptr->ArpIndex = 0; - } - break; - - case EFFECT_PORTAMENTO_UP: - - if(cptr->period) - { - cptr->period -= cptr->parameffect; - - if( cptr->period < 113 || cptr->period > 20000 ) - cptr->period = 113; - } - - break; - - case EFFECT_PORTAMENTO_DOWN: - - if(cptr->period) - { - cptr->period += cptr->parameffect; - - if( cptr->period > 20000 ) - cptr->period = 20000; - } - - break; - - case EFFECT_VOLSLIDE_TONEPORTA: - case EFFECT_TONE_PORTAMENTO: - - if( cptr->period && ( cptr->period != cptr->portaperiod ) && cptr->portaperiod ) - { - if( cptr->period > cptr->portaperiod ) - { - if( cptr->period - cptr->portaperiod >= cptr->portaspeed ) - { - cptr->period -= cptr->portaspeed; - } - else - { - cptr->period = cptr->portaperiod; - } - } - else - { - if( cptr->portaperiod - cptr->period >= cptr->portaspeed ) - { - cptr->period += cptr->portaspeed; - } - else - { - cptr->period = cptr->portaperiod; - } - } - - if( cptr->period == cptr->portaperiod ) - { - // If the slide is over, don't let it to be retriggered. - cptr->portaperiod = 0; - } - } - - if( cptr->effect == EFFECT_VOLSLIDE_TONEPORTA ) - { - if( cptr->volumeslide > 0x0F ) - { - cptr->volume = cptr->volume + (cptr->volumeslide>>4); - - if(cptr->volume>63) - cptr->volume = 63; - } - else - { - cptr->volume = cptr->volume - (cptr->volumeslide); - - if(cptr->volume>63) - cptr->volume=0; - } - } - break; - - case EFFECT_VOLSLIDE_VIBRATO: - case EFFECT_VIBRATO: - - cptr->vibraperiod = ( (cptr->vibraparam&0xF) * sintable[cptr->vibrapointeur&0x1F] )>>7; - - if( cptr->vibrapointeur > 31 ) - cptr->vibraperiod = -cptr->vibraperiod; - - cptr->vibrapointeur = (cptr->vibrapointeur+(((cptr->vibraparam>>4))&0xf)) & 0x3F; - - if( cptr->effect == EFFECT_VOLSLIDE_VIBRATO ) - { - if( cptr->volumeslide > 0xF ) - { - cptr->volume = cptr->volume+(cptr->volumeslide>>4); - - if( cptr->volume > 64 ) - cptr->volume = 64; - } - else - { - cptr->volume = cptr->volume - cptr->volumeslide; - - if( cptr->volume > 64 ) - cptr->volume = 0; - } - } - - break; - - case EFFECT_VOLUME_SLIDE: - - if( cptr->volumeslide > 0xF ) - { - cptr->volume += (cptr->volumeslide>>4); - - if( cptr->volume > 64 ) - cptr->volume = 64; - } - else - { - cptr->volume -= (cptr->volumeslide&0xf); - - if( cptr->volume > 64 ) - cptr->volume = 0; - } - break; - - case EFFECT_E_NOTE_CUT: - if(cptr->cut_param) - cptr->cut_param--; - - if(!cptr->cut_param) - cptr->volume = 0; - break; - - default: - break; - - } - -} - -/////////////////////////////////////////////////////////////////////////////////// -bool jar_mod_init(jar_mod_context_t * modctx) -{ - muint i,j; - - if( modctx ) - { - memclear(modctx, 0, sizeof(jar_mod_context_t)); - modctx->playrate = DEFAULT_SAMPLE_RATE; - modctx->stereo = 1; - modctx->stereo_separation = 1; - modctx->bits = 16; - modctx->filter = 1; - modctx->loopcount = 0; - - for(i=0; i < PERIOD_TABLE_LENGTH - 1; i++) - { - for(j=0; j < 8; j++) - { - modctx->fullperiod[(i*8) + j] = periodtable[i] - ((( periodtable[i] - periodtable[i+1] ) / 8) * j); - } - } - - return 1; - } - - return 0; -} - -bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter) -{ - if( modctx ) - { - modctx->playrate = samplerate; - - if( stereo ) - modctx->stereo = 1; - else - modctx->stereo = 0; - - if(stereo_separation < 4) - { - modctx->stereo_separation = stereo_separation; - } - - if( bits == 8 || bits == 16 ) - modctx->bits = bits; - else - modctx->bits = 16; - - if( filter ) - modctx->filter = 1; - else - modctx->filter = 0; - - return 1; - } - - return 0; -} - -// make certain that mod_data stays in memory while playing -static bool jar_mod_load( jar_mod_context_t * modctx, void * mod_data, int mod_data_size ) -{ - muint i, max; - unsigned short t; - sample *sptr; - unsigned char * modmemory,* endmodmemory; - - modmemory = (unsigned char *)mod_data; - endmodmemory = modmemory + mod_data_size; - - - - if(modmemory) - { - if( modctx ) - { - memcopy(&(modctx->song.title),modmemory,1084); - - i = 0; - modctx->number_of_channels = 0; - while(modlist[i].numberofchannels) - { - if(memcompare(modctx->song.signature,modlist[i].signature,4)) - { - modctx->number_of_channels = modlist[i].numberofchannels; - } - - i++; - } - - if( !modctx->number_of_channels ) - { - // 15 Samples modules support - // Shift the whole datas to make it look likes a standard 4 channels mod. - memcopy(&(modctx->song.signature), "M.K.", 4); - memcopy(&(modctx->song.length), &(modctx->song.samples[15]), 130); - memclear(&(modctx->song.samples[15]), 0, 480); - modmemory += 600; - modctx->number_of_channels = 4; - } - else - { - modmemory += 1084; - } - - if( modmemory >= endmodmemory ) - return 0; // End passed ? - Probably a bad file ! - - // Patterns loading - for (i = max = 0; i < 128; i++) - { - while (max <= modctx->song.patterntable[i]) - { - modctx->patterndata[max] = (note*)modmemory; - modmemory += (256*modctx->number_of_channels); - max++; - - if( modmemory >= endmodmemory ) - return 0; // End passed ? - Probably a bad file ! - } - } - - for (i = 0; i < 31; i++) - modctx->sampledata[i]=0; - - // Samples loading - for (i = 0, sptr = modctx->song.samples; i <31; i++, sptr++) - { - t= (sptr->length &0xFF00)>>8 | (sptr->length &0xFF)<<8; - sptr->length = t*2; - - t= (sptr->reppnt &0xFF00)>>8 | (sptr->reppnt &0xFF)<<8; - sptr->reppnt = t*2; - - t= (sptr->replen &0xFF00)>>8 | (sptr->replen &0xFF)<<8; - sptr->replen = t*2; - - - if (sptr->length == 0) continue; - - modctx->sampledata[i] = (char*)modmemory; - modmemory += sptr->length; - - if (sptr->replen + sptr->reppnt > sptr->length) - sptr->replen = sptr->length - sptr->reppnt; - - if( modmemory > endmodmemory ) - return 0; // End passed ? - Probably a bad file ! - } - - // States init - - modctx->tablepos = 0; - modctx->patternpos = 0; - modctx->song.speed = 6; - modctx->bpm = 125; - modctx->samplenb = 0; - - modctx->patternticks = (((long)modctx->song.speed * modctx->playrate * 5)/ (2 * modctx->bpm)) + 1; - modctx->patternticksaim = ((long)modctx->song.speed * modctx->playrate * 5) / (2 * modctx->bpm); - - modctx->sampleticksconst = 3546894UL / modctx->playrate; //8448*428/playrate; - - for(i=0; i < modctx->number_of_channels; i++) - { - modctx->channels[i].volume = 0; - modctx->channels[i].period = 0; - } - - modctx->mod_loaded = 1; - - return 1; - } - } - - return 0; -} - -void jar_mod_fillbuffer( jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) -{ - unsigned long i, j; - unsigned long k; - unsigned char c; - unsigned int state_remaining_steps; - int l,r; - int ll,lr; - int tl,tr; - short finalperiod; - note *nptr; - channel *cptr; - - if( modctx && outbuffer ) - { - if(modctx->mod_loaded) - { - state_remaining_steps = 0; - - if( trkbuf ) - { - trkbuf->cur_rd_index = 0; - - memcopy(trkbuf->name,modctx->song.title,sizeof(modctx->song.title)); - - for(i=0;i<31;i++) - { - memcopy(trkbuf->instruments[i].name,modctx->song.samples[i].name,sizeof(trkbuf->instruments[i].name)); - } - } - - ll = modctx->last_l_sample; - lr = modctx->last_r_sample; - - for (i = 0; i < nbsample; i++) - { - //--------------------------------------- - if( modctx->patternticks++ > modctx->patternticksaim ) - { - if( !modctx->patterndelay ) - { - nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; - nptr = nptr + modctx->patternpos; - cptr = modctx->channels; - - modctx->patternticks = 0; - modctx->patterntickse = 0; - - for(c=0;cnumber_of_channels;c++) - { - worknote((note*)(nptr+c), (channel*)(cptr+c),(char)(c+1),modctx); - } - - if( !modctx->jump_loop_effect ) - modctx->patternpos += modctx->number_of_channels; - else - modctx->jump_loop_effect = 0; - - if( modctx->patternpos == 64*modctx->number_of_channels ) - { - modctx->tablepos++; - modctx->patternpos = 0; - if(modctx->tablepos >= modctx->song.length) - { - modctx->tablepos = 0; - modctx->loopcount++; // count next loop - } - } - } - else - { - modctx->patterndelay--; - modctx->patternticks = 0; - modctx->patterntickse = 0; - } - - } - - if( modctx->patterntickse++ > (modctx->patternticksaim/modctx->song.speed) ) - { - nptr = modctx->patterndata[modctx->song.patterntable[modctx->tablepos]]; - nptr = nptr + modctx->patternpos; - cptr = modctx->channels; - - for(c=0;cnumber_of_channels;c++) - { - workeffect(nptr+c, cptr+c); - } - - modctx->patterntickse = 0; - } - - //--------------------------------------- - - if( trkbuf && !state_remaining_steps ) - { - if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) - { - memclear(&trkbuf->track_state_buf[trkbuf->nb_of_state], 0, sizeof(tracker_state)); - } - } - - l=0; - r=0; - - for(j =0, cptr = modctx->channels; j < modctx->number_of_channels ; j++, cptr++) - { - if( cptr->period != 0 ) - { - finalperiod = cptr->period - cptr->decalperiod - cptr->vibraperiod; - if( finalperiod ) - { - cptr->samppos += ( (modctx->sampleticksconst<<10) / finalperiod ); - } - - cptr->ticks++; - - if( cptr->replen<=2 ) - { - if( (cptr->samppos>>10) >= (cptr->length) ) - { - cptr->length = 0; - cptr->reppnt = 0; - - if( cptr->length ) - cptr->samppos = cptr->samppos % (((unsigned long)cptr->length)<<10); - else - cptr->samppos = 0; - } - } - else - { - if( (cptr->samppos>>10) >= (unsigned long)(cptr->replen+cptr->reppnt) ) - { - cptr->samppos = ((unsigned long)(cptr->reppnt)<<10) + (cptr->samppos % ((unsigned long)(cptr->replen+cptr->reppnt)<<10)); - } - } - - k = cptr->samppos >> 10; - - if( cptr->sampdata!=0 && ( ((j&3)==1) || ((j&3)==2) ) ) - { - r += ( cptr->sampdata[k] * cptr->volume ); - } - - if( cptr->sampdata!=0 && ( ((j&3)==0) || ((j&3)==3) ) ) - { - l += ( cptr->sampdata[k] * cptr->volume ); - } - - if( trkbuf && !state_remaining_steps ) - { - if( trkbuf->nb_of_state < trkbuf->nb_max_of_state ) - { - trkbuf->track_state_buf[trkbuf->nb_of_state].number_of_tracks = modctx->number_of_channels; - trkbuf->track_state_buf[trkbuf->nb_of_state].buf_index = i; - trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern = modctx->song.patterntable[modctx->tablepos]; - trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_pos = modctx->patternpos / modctx->number_of_channels; - trkbuf->track_state_buf[trkbuf->nb_of_state].cur_pattern_table_pos = modctx->tablepos; - trkbuf->track_state_buf[trkbuf->nb_of_state].bpm = modctx->bpm; - trkbuf->track_state_buf[trkbuf->nb_of_state].speed = modctx->song.speed; - trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_effect = cptr->effect_code; - trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_parameffect = cptr->parameffect; - trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_period = finalperiod; - trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].cur_volume = cptr->volume; - trkbuf->track_state_buf[trkbuf->nb_of_state].tracks[j].instrument_number = (unsigned char)cptr->sampnum; - } - } - } - } - - if( trkbuf && !state_remaining_steps ) - { - state_remaining_steps = trkbuf->sample_step; - - if(trkbuf->nb_of_state < trkbuf->nb_max_of_state) - trkbuf->nb_of_state++; - } - else - { - state_remaining_steps--; - } - - tl = (short)l; - tr = (short)r; - - if ( modctx->filter ) - { - // Filter - l = (l+ll)>>1; - r = (r+lr)>>1; - } - - if ( modctx->stereo_separation == 1 ) - { - // Left & Right Stereo panning - l = (l+(r>>1)); - r = (r+(l>>1)); - } - - // Level limitation - if( l > 32767 ) l = 32767; - if( l < -32768 ) l = -32768; - if( r > 32767 ) r = 32767; - if( r < -32768 ) r = -32768; - - // Store the final sample. - outbuffer[(i*2)] = l; - outbuffer[(i*2)+1] = r; - - ll = tl; - lr = tr; - - } - - modctx->last_l_sample = ll; - modctx->last_r_sample = lr; - - modctx->samplenb = modctx->samplenb+nbsample; - } - else - { - for (i = 0; i < nbsample; i++) - { - // Mod not loaded. Return blank buffer. - outbuffer[(i*2)] = 0; - outbuffer[(i*2)+1] = 0; - } - - if(trkbuf) - { - trkbuf->nb_of_state = 0; - trkbuf->cur_rd_index = 0; - trkbuf->name[0] = 0; - memclear(trkbuf->track_state_buf, 0, sizeof(tracker_state) * trkbuf->nb_max_of_state); - memclear(trkbuf->instruments, 0, sizeof(trkbuf->instruments)); - } - } - } -} - -//resets internals for mod context -static void jar_mod_reset( jar_mod_context_t * modctx) -{ - if(modctx) - { - memclear(&modctx->song, 0, sizeof(modctx->song)); - memclear(&modctx->sampledata, 0, sizeof(modctx->sampledata)); - memclear(&modctx->patterndata, 0, sizeof(modctx->patterndata)); - modctx->tablepos = 0; - modctx->patternpos = 0; - modctx->patterndelay = 0; - modctx->jump_loop_effect = 0; - modctx->bpm = 0; - modctx->patternticks = 0; - modctx->patterntickse = 0; - modctx->patternticksaim = 0; - modctx->sampleticksconst = 0; - modctx->loopcount = 0; - modctx->samplenb = 0; - memclear(modctx->channels, 0, sizeof(modctx->channels)); - modctx->number_of_channels = 0; - modctx->mod_loaded = 0; - modctx->last_r_sample = 0; - modctx->last_l_sample = 0; - - jar_mod_init(modctx); - } -} - -void jar_mod_unload( jar_mod_context_t * modctx) -{ - if(modctx) - { - if(modctx->modfile) - { - free(modctx->modfile); - modctx->modfile = 0; - } - jar_mod_reset(modctx); - } -} - - - -mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) -{ - mulong fsize = 0; - if(modctx->modfile) - { - free(modctx->modfile); - modctx->modfile = 0; - } - - FILE *f = fopen(filename, "rb"); - if(f) - { - fseek(f,0,SEEK_END); - fsize = ftell(f); - fseek(f,0,SEEK_SET); - - if(fsize && fsize < 32*1024*1024) - { - modctx->modfile = malloc(fsize); - modctx->modfilesize = fsize; - memset(modctx->modfile, 0, fsize); - fread(modctx->modfile, fsize, 1, f); - fclose(f); - - if(!jar_mod_load(modctx, (void*)modctx->modfile, fsize)) fsize = 0; - } else fsize = 0; - } - return fsize; -} - -mulong jar_mod_current_samples(jar_mod_context_t * modctx) -{ - if(modctx) - return modctx->samplenb; - - return 0; -} - -// Works, however it is very slow, this data should be cached to ensure it is run only once per file -mulong jar_mod_max_samples(jar_mod_context_t * ctx) -{ - jar_mod_context_t tmpctx; - jar_mod_init(&tmpctx); - if(!jar_mod_load(&tmpctx, (void*)ctx->modfile, ctx->modfilesize)) return 0; - - muint buff[2]; - mulong lastcount = tmpctx.loopcount; - - while(1){ - jar_mod_fillbuffer( &tmpctx, buff, 1, 0 ); - if(tmpctx.loopcount > lastcount) break; - } - return tmpctx.samplenb; -} - -// move seek_val to sample index, 0 -> jar_mod_max_samples is the range -void jar_mod_seek_start(jar_mod_context_t * ctx) -{ - if(ctx) - { - jar_mod_reset(ctx); - jar_mod_load(ctx, ctx->modfile, ctx->modfilesize); - } -} - -#endif // end of JAR_MOD_IMPLEMENTATION -//------------------------------------------------------------------------------- - - -#endif //end of header file \ No newline at end of file diff --git a/src/jar_xm.h b/src/jar_xm.h deleted file mode 100644 index f9ddb511..00000000 --- a/src/jar_xm.h +++ /dev/null @@ -1,2666 +0,0 @@ -// jar_xm.h - v0.01 - public domain - Joshua Reisenauer, MAR 2016 -// -// HISTORY: -// -// v0.01 2016-02-22 Setup -// -// -// USAGE: -// -// In ONE source file, put: -// -// #define JAR_XM_IMPLEMENTATION -// #include "jar_xm.h" -// -// Other source files should just include jar_xm.h -// -// SAMPLE CODE: -// -// jar_xm_context_t *musicptr; -// float musicBuffer[48000 / 60]; -// int intro_load(void) -// { -// jar_xm_create_context_from_file(&musicptr, 48000, "Song.XM"); -// return 1; -// } -// int intro_unload(void) -// { -// jar_xm_free_context(musicptr); -// return 1; -// } -// int intro_tick(long counter) -// { -// jar_xm_generate_samples(musicptr, musicBuffer, (48000 / 60) / 2); -// if(IsKeyDown(KEY_ENTER)) -// return 1; -// return 0; -// } -// -// -// LISCENSE - FOR LIBXM: -// -// Author: Romain "Artefact2" Dalmaso -// Contributor: Dan Spencer -// Repackaged into jar_xm.h By: Joshua Adam Reisenauer -// This program is free software. It comes without any warranty, to the -// extent permitted by applicable law. You can redistribute it and/or -// modify it under the terms of the Do What The Fuck You Want To Public -// License, Version 2, as published by Sam Hocevar. See -// http://sam.zoy.org/wtfpl/COPYING for more details. - -#ifndef INCLUDE_JAR_XM_H -#define INCLUDE_JAR_XM_H - -#define JAR_XM_DEBUG 0 -#define JAR_XM_LINEAR_INTERPOLATION 1 // speed increase with decrease in quality -#define JAR_XM_DEFENSIVE 1 -#define JAR_XM_RAMPING 1 - -#include -#include -#include -#include -#include - - - -//------------------------------------------------------------------------------- -#ifdef __cplusplus -extern "C" { -#endif - -struct jar_xm_context_s; -typedef struct jar_xm_context_s jar_xm_context_t; - -/** Create a XM context. - * - * @param moddata the contents of the module - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - * @returns 3 unable to open input file - * @returns 4 fseek() failed - * @returns 5 fread() failed - * @returns 6 unkown error - * - * @deprecated This function is unsafe! - * @see jar_xm_create_context_safe() - */ -int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename); - -/** Create a XM context. - * - * @param moddata the contents of the module - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - * - * @deprecated This function is unsafe! - * @see jar_xm_create_context_safe() - */ -int jar_xm_create_context(jar_xm_context_t**, const char* moddata, uint32_t rate); - -/** Create a XM context. - * - * @param moddata the contents of the module - * @param moddata_length the length of the contents of the module, in bytes - * @param rate play rate in Hz, recommended value of 48000 - * - * @returns 0 on success - * @returns 1 if module data is not sane - * @returns 2 if memory allocation failed - */ -int jar_xm_create_context_safe(jar_xm_context_t**, const char* moddata, size_t moddata_length, uint32_t rate); - -/** Free a XM context created by jar_xm_create_context(). */ -void jar_xm_free_context(jar_xm_context_t*); - -/** Play the module and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ -void jar_xm_generate_samples(jar_xm_context_t*, float* output, size_t numsamples); - -/** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ -void jar_xm_generate_samples_16bit(jar_xm_context_t* ctx, short* output, size_t numsamples) -{ - float* musicBuffer = malloc((2*numsamples)*sizeof(float)); - jar_xm_generate_samples(ctx, musicBuffer, numsamples); - - if(output){ - int x; - for(x=0;x<2*numsamples;x++) - output[x] = musicBuffer[x] * SHRT_MAX; - } - - free(musicBuffer); -} - -/** Play the module, resample from 32 bit to 8 bit, and put the sound samples in an output buffer. - * - * @param output buffer of 2*numsamples elements (A left and right value for each sample) - * @param numsamples number of samples to generate - */ -void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t numsamples) -{ - float* musicBuffer = malloc((2*numsamples)*sizeof(float)); - jar_xm_generate_samples(ctx, musicBuffer, numsamples); - - if(output){ - int x; - for(x=0;x<2*numsamples;x++) - output[x] = musicBuffer[x] * CHAR_MAX; - } - - free(musicBuffer); -} - - - -/** Set the maximum number of times a module can loop. After the - * specified number of loops, calls to jar_xm_generate_samples will only - * generate silence. You can control the current number of loops with - * jar_xm_get_loop_count(). - * - * @param loopcnt maximum number of loops. Use 0 to loop - * indefinitely. */ -void jar_xm_set_max_loop_count(jar_xm_context_t*, uint8_t loopcnt); - -/** Get the loop count of the currently playing module. This value is - * 0 when the module is still playing, 1 when the module has looped - * once, etc. */ -uint8_t jar_xm_get_loop_count(jar_xm_context_t*); - - - -/** Mute or unmute a channel. - * - * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). - * - * @return whether the channel was muted. - */ -bool jar_xm_mute_channel(jar_xm_context_t*, uint16_t, bool); - -/** Mute or unmute an instrument. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - * - * @return whether the instrument was muted. - */ -bool jar_xm_mute_instrument(jar_xm_context_t*, uint16_t, bool); - - - -/** Get the module name as a NUL-terminated string. */ -const char* jar_xm_get_module_name(jar_xm_context_t*); - -/** Get the tracker name as a NUL-terminated string. */ -const char* jar_xm_get_tracker_name(jar_xm_context_t*); - - - -/** Get the number of channels. */ -uint16_t jar_xm_get_number_of_channels(jar_xm_context_t*); - -/** Get the module length (in patterns). */ -uint16_t jar_xm_get_module_length(jar_xm_context_t*); - -/** Get the number of patterns. */ -uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t*); - -/** Get the number of rows of a pattern. - * - * @note Pattern numbers go from 0 to - * jar_xm_get_number_of_patterns(...)-1. - */ -uint16_t jar_xm_get_number_of_rows(jar_xm_context_t*, uint16_t); - -/** Get the number of instruments. */ -uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t*); - -/** Get the number of samples of an instrument. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - */ -uint16_t jar_xm_get_number_of_samples(jar_xm_context_t*, uint16_t); - - - -/** Get the current module speed. - * - * @param bpm will receive the current BPM - * @param tempo will receive the current tempo (ticks per line) - */ -void jar_xm_get_playing_speed(jar_xm_context_t*, uint16_t* bpm, uint16_t* tempo); - -/** Get the current position in the module being played. - * - * @param pattern_index if not NULL, will receive the current pattern - * index in the POT (pattern order table) - * - * @param pattern if not NULL, will receive the current pattern number - * - * @param row if not NULL, will receive the current row - * - * @param samples if not NULL, will receive the total number of - * generated samples (divide by sample rate to get seconds of - * generated audio) - */ -void jar_xm_get_position(jar_xm_context_t*, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); - -/** Get the latest time (in number of generated samples) when a - * particular instrument was triggered in any channel. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - */ -uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t*, uint16_t); - -/** Get the latest time (in number of generated samples) when a - * particular sample was triggered in any channel. - * - * @note Instrument numbers go from 1 to - * jar_xm_get_number_of_instruments(...). - * - * @note Sample numbers go from 0 to - * jar_xm_get_nubmer_of_samples(...,instr)-1. - */ -uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t*, uint16_t instr, uint16_t sample); - -/** Get the latest time (in number of generated samples) when any - * instrument was triggered in a given channel. - * - * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). - */ -uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t*, uint16_t); - -/** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. - * - * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. - * @note This function is very slow and should only be run once, if at all. - */ -uint64_t jar_xm_get_remaining_samples(jar_xm_context_t*); - -#ifdef __cplusplus -} -#endif -//------------------------------------------------------------------------------- - - - - - - -//Function Definitions----------------------------------------------------------- -#ifdef JAR_XM_IMPLEMENTATION - -#include -#include - -#if JAR_XM_DEBUG -#include -#define DEBUG(fmt, ...) do { \ - fprintf(stderr, "%s(): " fmt "\n", __func__, __VA_ARGS__); \ - fflush(stderr); \ - } while(0) -#else -#define DEBUG(...) -#endif - -#if jar_xm_BIG_ENDIAN -#error "Big endian platforms are not yet supported, sorry" -/* Make sure the compiler stops, even if #error is ignored */ -extern int __fail[-1]; -#endif - -/* ----- XM constants ----- */ - -#define SAMPLE_NAME_LENGTH 22 -#define INSTRUMENT_NAME_LENGTH 22 -#define MODULE_NAME_LENGTH 20 -#define TRACKER_NAME_LENGTH 20 -#define PATTERN_ORDER_TABLE_LENGTH 256 -#define NUM_NOTES 96 -#define NUM_ENVELOPE_POINTS 12 -#define MAX_NUM_ROWS 256 - -#if JAR_XM_RAMPING -#define jar_xm_SAMPLE_RAMPING_POINTS 0x20 -#endif - -/* ----- Data types ----- */ - -enum jar_xm_waveform_type_e { - jar_xm_SINE_WAVEFORM = 0, - jar_xm_RAMP_DOWN_WAVEFORM = 1, - jar_xm_SQUARE_WAVEFORM = 2, - jar_xm_RANDOM_WAVEFORM = 3, - jar_xm_RAMP_UP_WAVEFORM = 4, -}; -typedef enum jar_xm_waveform_type_e jar_xm_waveform_type_t; - -enum jar_xm_loop_type_e { - jar_xm_NO_LOOP, - jar_xm_FORWARD_LOOP, - jar_xm_PING_PONG_LOOP, -}; -typedef enum jar_xm_loop_type_e jar_xm_loop_type_t; - -enum jar_xm_frequency_type_e { - jar_xm_LINEAR_FREQUENCIES, - jar_xm_AMIGA_FREQUENCIES, -}; -typedef enum jar_xm_frequency_type_e jar_xm_frequency_type_t; - -struct jar_xm_envelope_point_s { - uint16_t frame; - uint16_t value; -}; -typedef struct jar_xm_envelope_point_s jar_xm_envelope_point_t; - -struct jar_xm_envelope_s { - jar_xm_envelope_point_t points[NUM_ENVELOPE_POINTS]; - uint8_t num_points; - uint8_t sustain_point; - uint8_t loop_start_point; - uint8_t loop_end_point; - bool enabled; - bool sustain_enabled; - bool loop_enabled; -}; -typedef struct jar_xm_envelope_s jar_xm_envelope_t; - -struct jar_xm_sample_s { - char name[SAMPLE_NAME_LENGTH + 1]; - int8_t bits; /* Either 8 or 16 */ - - uint32_t length; - uint32_t loop_start; - uint32_t loop_length; - uint32_t loop_end; - float volume; - int8_t finetune; - jar_xm_loop_type_t loop_type; - float panning; - int8_t relative_note; - uint64_t latest_trigger; - - float* data; - }; - typedef struct jar_xm_sample_s jar_xm_sample_t; - - struct jar_xm_instrument_s { - char name[INSTRUMENT_NAME_LENGTH + 1]; - uint16_t num_samples; - uint8_t sample_of_notes[NUM_NOTES]; - jar_xm_envelope_t volume_envelope; - jar_xm_envelope_t panning_envelope; - jar_xm_waveform_type_t vibrato_type; - uint8_t vibrato_sweep; - uint8_t vibrato_depth; - uint8_t vibrato_rate; - uint16_t volume_fadeout; - uint64_t latest_trigger; - bool muted; - - jar_xm_sample_t* samples; - }; - typedef struct jar_xm_instrument_s jar_xm_instrument_t; - - struct jar_xm_pattern_slot_s { - uint8_t note; /* 1-96, 97 = Key Off note */ - uint8_t instrument; /* 1-128 */ - uint8_t volume_column; - uint8_t effect_type; - uint8_t effect_param; - }; - typedef struct jar_xm_pattern_slot_s jar_xm_pattern_slot_t; - - struct jar_xm_pattern_s { - uint16_t num_rows; - jar_xm_pattern_slot_t* slots; /* Array of size num_rows * num_channels */ - }; - typedef struct jar_xm_pattern_s jar_xm_pattern_t; - - struct jar_xm_module_s { - char name[MODULE_NAME_LENGTH + 1]; - char trackername[TRACKER_NAME_LENGTH + 1]; - uint16_t length; - uint16_t restart_position; - uint16_t num_channels; - uint16_t num_patterns; - uint16_t num_instruments; - jar_xm_frequency_type_t frequency_type; - uint8_t pattern_table[PATTERN_ORDER_TABLE_LENGTH]; - - jar_xm_pattern_t* patterns; - jar_xm_instrument_t* instruments; /* Instrument 1 has index 0, - * instrument 2 has index 1, etc. */ - }; - typedef struct jar_xm_module_s jar_xm_module_t; - - struct jar_xm_channel_context_s { - float note; - float orig_note; /* The original note before effect modifications, as read in the pattern. */ - jar_xm_instrument_t* instrument; /* Could be NULL */ - jar_xm_sample_t* sample; /* Could be NULL */ - jar_xm_pattern_slot_t* current; - - float sample_position; - float period; - float frequency; - float step; - bool ping; /* For ping-pong samples: true is -->, false is <-- */ - - float volume; /* Ideally between 0 (muted) and 1 (loudest) */ - float panning; /* Between 0 (left) and 1 (right); 0.5 is centered */ - - uint16_t autovibrato_ticks; - - bool sustained; - float fadeout_volume; - float volume_envelope_volume; - float panning_envelope_panning; - uint16_t volume_envelope_frame_count; - uint16_t panning_envelope_frame_count; - - float autovibrato_note_offset; - - bool arp_in_progress; - uint8_t arp_note_offset; - uint8_t volume_slide_param; - uint8_t fine_volume_slide_param; - uint8_t global_volume_slide_param; - uint8_t panning_slide_param; - uint8_t portamento_up_param; - uint8_t portamento_down_param; - uint8_t fine_portamento_up_param; - uint8_t fine_portamento_down_param; - uint8_t extra_fine_portamento_up_param; - uint8_t extra_fine_portamento_down_param; - uint8_t tone_portamento_param; - float tone_portamento_target_period; - uint8_t multi_retrig_param; - uint8_t note_delay_param; - uint8_t pattern_loop_origin; /* Where to restart a E6y loop */ - uint8_t pattern_loop_count; /* How many loop passes have been done */ - bool vibrato_in_progress; - jar_xm_waveform_type_t vibrato_waveform; - bool vibrato_waveform_retrigger; /* True if a new note retriggers the waveform */ - uint8_t vibrato_param; - uint16_t vibrato_ticks; /* Position in the waveform */ - float vibrato_note_offset; - jar_xm_waveform_type_t tremolo_waveform; - bool tremolo_waveform_retrigger; - uint8_t tremolo_param; - uint8_t tremolo_ticks; - float tremolo_volume; - uint8_t tremor_param; - bool tremor_on; - - uint64_t latest_trigger; - bool muted; - -#if JAR_XM_RAMPING - /* These values are updated at the end of each tick, to save - * a couple of float operations on every generated sample. */ - float target_panning; - float target_volume; - - unsigned long frame_count; - float end_of_previous_sample[jar_xm_SAMPLE_RAMPING_POINTS]; -#endif - - float actual_panning; - float actual_volume; - }; - typedef struct jar_xm_channel_context_s jar_xm_channel_context_t; - - struct jar_xm_context_s { - void* allocated_memory; - jar_xm_module_t module; - uint32_t rate; - - uint16_t tempo; - uint16_t bpm; - float global_volume; - float amplification; - -#if JAR_XM_RAMPING - /* How much is a channel final volume allowed to change per - * sample; this is used to avoid abrubt volume changes which - * manifest as "clicks" in the generated sound. */ - float volume_ramp; - float panning_ramp; /* Same for panning. */ -#endif - - uint8_t current_table_index; - uint8_t current_row; - uint16_t current_tick; /* Can go below 255, with high tempo and a pattern delay */ - float remaining_samples_in_tick; - uint64_t generated_samples; - - bool position_jump; - bool pattern_break; - uint8_t jump_dest; - uint8_t jump_row; - - /* Extra ticks to be played before going to the next row - - * Used for EEy effect */ - uint16_t extra_ticks; - - uint8_t* row_loop_count; /* Array of size MAX_NUM_ROWS * module_length */ - uint8_t loop_count; - uint8_t max_loop_count; - - jar_xm_channel_context_t* channels; -}; - -/* ----- Internal API ----- */ - -#if JAR_XM_DEFENSIVE - -/** Check the module data for errors/inconsistencies. - * - * @returns 0 if everything looks OK. Module should be safe to load. - */ -int jar_xm_check_sanity_preload(const char*, size_t); - -/** Check a loaded module for errors/inconsistencies. - * - * @returns 0 if everything looks OK. - */ -int jar_xm_check_sanity_postload(jar_xm_context_t*); - -#endif - -/** Get the number of bytes needed to store the module data in a - * dynamically allocated blank context. - * - * Things that are dynamically allocated: - * - sample data - * - sample structures in instruments - * - pattern data - * - row loop count arrays - * - pattern structures in module - * - instrument structures in module - * - channel contexts - * - context structure itself - - * @returns 0 if everything looks OK. - */ -size_t jar_xm_get_memory_needed_for_context(const char*, size_t); - -/** Populate the context from module data. - * - * @returns pointer to the memory pool - */ -char* jar_xm_load_module(jar_xm_context_t*, const char*, size_t, char*); - -int jar_xm_create_context(jar_xm_context_t** ctxp, const char* moddata, uint32_t rate) { - return jar_xm_create_context_safe(ctxp, moddata, SIZE_MAX, rate); -} - -int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, size_t moddata_length, uint32_t rate) { -#if JAR_XM_DEFENSIVE - int ret; -#endif - size_t bytes_needed; - char* mempool; - jar_xm_context_t* ctx; - -#if JAR_XM_DEFENSIVE - if((ret = jar_xm_check_sanity_preload(moddata, moddata_length))) { - DEBUG("jar_xm_check_sanity_preload() returned %i, module is not safe to load", ret); - return 1; - } -#endif - - bytes_needed = jar_xm_get_memory_needed_for_context(moddata, moddata_length); - mempool = malloc(bytes_needed); - if(mempool == NULL && bytes_needed > 0) { - /* malloc() failed, trouble ahead */ - DEBUG("call to malloc() failed, returned %p", (void*)mempool); - return 2; - } - - /* Initialize most of the fields to 0, 0.f, NULL or false depending on type */ - memset(mempool, 0, bytes_needed); - - ctx = (*ctxp = (jar_xm_context_t*)mempool); - ctx->allocated_memory = mempool; /* Keep original pointer for free() */ - mempool += sizeof(jar_xm_context_t); - - ctx->rate = rate; - mempool = jar_xm_load_module(ctx, moddata, moddata_length, mempool); - - ctx->channels = (jar_xm_channel_context_t*)mempool; - mempool += ctx->module.num_channels * sizeof(jar_xm_channel_context_t); - - ctx->global_volume = 1.f; - ctx->amplification = .25f; /* XXX: some bad modules may still clip. Find out something better. */ - -#if JAR_XM_RAMPING - ctx->volume_ramp = (1.f / 128.f); - ctx->panning_ramp = (1.f / 128.f); -#endif - - for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { - jar_xm_channel_context_t* ch = ctx->channels + i; - - ch->ping = true; - ch->vibrato_waveform = jar_xm_SINE_WAVEFORM; - ch->vibrato_waveform_retrigger = true; - ch->tremolo_waveform = jar_xm_SINE_WAVEFORM; - ch->tremolo_waveform_retrigger = true; - - ch->volume = ch->volume_envelope_volume = ch->fadeout_volume = 1.0f; - ch->panning = ch->panning_envelope_panning = .5f; - ch->actual_volume = .0f; - ch->actual_panning = .5f; - } - - ctx->row_loop_count = (uint8_t*)mempool; - mempool += MAX_NUM_ROWS * sizeof(uint8_t); - -#if JAR_XM_DEFENSIVE - if((ret = jar_xm_check_sanity_postload(ctx))) { - DEBUG("jar_xm_check_sanity_postload() returned %i, module is not safe to play", ret); - jar_xm_free_context(ctx); - return 1; - } -#endif - - return 0; -} - -void jar_xm_free_context(jar_xm_context_t* context) { - free(context->allocated_memory); -} - -void jar_xm_set_max_loop_count(jar_xm_context_t* context, uint8_t loopcnt) { - context->max_loop_count = loopcnt; -} - -uint8_t jar_xm_get_loop_count(jar_xm_context_t* context) { - return context->loop_count; -} - - - -bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t channel, bool mute) { - bool old = ctx->channels[channel - 1].muted; - ctx->channels[channel - 1].muted = mute; - return old; -} - -bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t instr, bool mute) { - bool old = ctx->module.instruments[instr - 1].muted; - ctx->module.instruments[instr - 1].muted = mute; - return old; -} - - - -const char* jar_xm_get_module_name(jar_xm_context_t* ctx) { - return ctx->module.name; -} - -const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx) { - return ctx->module.trackername; -} - - - -uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx) { - return ctx->module.num_channels; -} - -uint16_t jar_xm_get_module_length(jar_xm_context_t* ctx) { - return ctx->module.length; -} - -uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx) { - return ctx->module.num_patterns; -} - -uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t pattern) { - return ctx->module.patterns[pattern].num_rows; -} - -uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx) { - return ctx->module.num_instruments; -} - -uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t instrument) { - return ctx->module.instruments[instrument - 1].num_samples; -} - - - -void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo) { - if(bpm) *bpm = ctx->bpm; - if(tempo) *tempo = ctx->tempo; -} - -void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples) { - if(pattern_index) *pattern_index = ctx->current_table_index; - if(pattern) *pattern = ctx->module.pattern_table[ctx->current_table_index]; - if(row) *row = ctx->current_row; - if(samples) *samples = ctx->generated_samples; -} - -uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t instr) { - return ctx->module.instruments[instr - 1].latest_trigger; -} - -uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample) { - return ctx->module.instruments[instr - 1].samples[sample].latest_trigger; -} - -uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t chn) { - return ctx->channels[chn - 1].latest_trigger; -} - -/* .xm files are little-endian. (XXX: Are they really?) */ - -/* Bounded reader macros. - * If we attempt to read the buffer out-of-bounds, pretend that the buffer is - * infinitely padded with zeroes. - */ -#define READ_U8(offset) (((offset) < moddata_length) ? (*(uint8_t*)(moddata + (offset))) : 0) -#define READ_U16(offset) ((uint16_t)READ_U8(offset) | ((uint16_t)READ_U8((offset) + 1) << 8)) -#define READ_U32(offset) ((uint32_t)READ_U16(offset) | ((uint32_t)READ_U16((offset) + 2) << 16)) -#define READ_MEMCPY(ptr, offset, length) memcpy_pad(ptr, length, moddata, moddata_length, offset) - -static inline void memcpy_pad(void* dst, size_t dst_len, const void* src, size_t src_len, size_t offset) { - uint8_t* dst_c = dst; - const uint8_t* src_c = src; - - /* how many bytes can be copied without overrunning `src` */ - size_t copy_bytes = (src_len >= offset) ? (src_len - offset) : 0; - copy_bytes = copy_bytes > dst_len ? dst_len : copy_bytes; - - memcpy(dst_c, src_c + offset, copy_bytes); - /* padded bytes */ - memset(dst_c + copy_bytes, 0, dst_len - copy_bytes); -} - -#if JAR_XM_DEFENSIVE - -int jar_xm_check_sanity_preload(const char* module, size_t module_length) { - if(module_length < 60) { - return 4; - } - - if(memcmp("Extended Module: ", module, 17) != 0) { - return 1; - } - - if(module[37] != 0x1A) { - return 2; - } - - if(module[59] != 0x01 || module[58] != 0x04) { - /* Not XM 1.04 */ - return 3; - } - - return 0; -} - -int jar_xm_check_sanity_postload(jar_xm_context_t* ctx) { - /* @todo: plenty of stuff to do here… */ - - /* Check the POT */ - for(uint8_t i = 0; i < ctx->module.length; ++i) { - if(ctx->module.pattern_table[i] >= ctx->module.num_patterns) { - if(i+1 == ctx->module.length && ctx->module.length > 1) { - /* Cheap fix */ - --ctx->module.length; - DEBUG("trimming invalid POT at pos %X", i); - } else { - DEBUG("module has invalid POT, pos %X references nonexistent pattern %X", - i, - ctx->module.pattern_table[i]); - return 1; - } - } - } - - return 0; -} - -#endif - -size_t jar_xm_get_memory_needed_for_context(const char* moddata, size_t moddata_length) { - size_t memory_needed = 0; - size_t offset = 60; /* Skip the first header */ - uint16_t num_channels; - uint16_t num_patterns; - uint16_t num_instruments; - - /* Read the module header */ - - num_channels = READ_U16(offset + 8); - num_channels = READ_U16(offset + 8); - - num_patterns = READ_U16(offset + 10); - memory_needed += num_patterns * sizeof(jar_xm_pattern_t); - - num_instruments = READ_U16(offset + 12); - memory_needed += num_instruments * sizeof(jar_xm_instrument_t); - - memory_needed += MAX_NUM_ROWS * READ_U16(offset + 4) * sizeof(uint8_t); /* Module length */ - - /* Header size */ - offset += READ_U32(offset); - - /* Read pattern headers */ - for(uint16_t i = 0; i < num_patterns; ++i) { - uint16_t num_rows; - - num_rows = READ_U16(offset + 5); - memory_needed += num_rows * num_channels * sizeof(jar_xm_pattern_slot_t); - - /* Pattern header length + packed pattern data size */ - offset += READ_U32(offset) + READ_U16(offset + 7); - } - - /* Read instrument headers */ - for(uint16_t i = 0; i < num_instruments; ++i) { - uint16_t num_samples; - uint32_t sample_header_size = 0; - uint32_t sample_size_aggregate = 0; - - num_samples = READ_U16(offset + 27); - memory_needed += num_samples * sizeof(jar_xm_sample_t); - - if(num_samples > 0) { - sample_header_size = READ_U32(offset + 29); - } - - /* Instrument header size */ - offset += READ_U32(offset); - - for(uint16_t j = 0; j < num_samples; ++j) { - uint32_t sample_size; - uint8_t flags; - - sample_size = READ_U32(offset); - flags = READ_U8(offset + 14); - sample_size_aggregate += sample_size; - - if(flags & (1 << 4)) { - /* 16 bit sample */ - memory_needed += sample_size * (sizeof(float) >> 1); - } else { - /* 8 bit sample */ - memory_needed += sample_size * sizeof(float); - } - - offset += sample_header_size; - } - - offset += sample_size_aggregate; - } - - memory_needed += num_channels * sizeof(jar_xm_channel_context_t); - memory_needed += sizeof(jar_xm_context_t); - - return memory_needed; -} - -char* jar_xm_load_module(jar_xm_context_t* ctx, const char* moddata, size_t moddata_length, char* mempool) { - size_t offset = 0; - jar_xm_module_t* mod = &(ctx->module); - - /* Read XM header */ - READ_MEMCPY(mod->name, offset + 17, MODULE_NAME_LENGTH); - READ_MEMCPY(mod->trackername, offset + 38, TRACKER_NAME_LENGTH); - offset += 60; - - /* Read module header */ - uint32_t header_size = READ_U32(offset); - - mod->length = READ_U16(offset + 4); - mod->restart_position = READ_U16(offset + 6); - mod->num_channels = READ_U16(offset + 8); - mod->num_patterns = READ_U16(offset + 10); - mod->num_instruments = READ_U16(offset + 12); - - mod->patterns = (jar_xm_pattern_t*)mempool; - mempool += mod->num_patterns * sizeof(jar_xm_pattern_t); - - mod->instruments = (jar_xm_instrument_t*)mempool; - mempool += mod->num_instruments * sizeof(jar_xm_instrument_t); - - uint16_t flags = READ_U32(offset + 14); - mod->frequency_type = (flags & (1 << 0)) ? jar_xm_LINEAR_FREQUENCIES : jar_xm_AMIGA_FREQUENCIES; - - ctx->tempo = READ_U16(offset + 16); - ctx->bpm = READ_U16(offset + 18); - - READ_MEMCPY(mod->pattern_table, offset + 20, PATTERN_ORDER_TABLE_LENGTH); - offset += header_size; - - /* Read patterns */ - for(uint16_t i = 0; i < mod->num_patterns; ++i) { - uint16_t packed_patterndata_size = READ_U16(offset + 7); - jar_xm_pattern_t* pat = mod->patterns + i; - - pat->num_rows = READ_U16(offset + 5); - - pat->slots = (jar_xm_pattern_slot_t*)mempool; - mempool += mod->num_channels * pat->num_rows * sizeof(jar_xm_pattern_slot_t); - - /* Pattern header length */ - offset += READ_U32(offset); - - if(packed_patterndata_size == 0) { - /* No pattern data is present */ - memset(pat->slots, 0, sizeof(jar_xm_pattern_slot_t) * pat->num_rows * mod->num_channels); - } else { - /* This isn't your typical for loop */ - for(uint16_t j = 0, k = 0; j < packed_patterndata_size; ++k) { - uint8_t note = READ_U8(offset + j); - jar_xm_pattern_slot_t* slot = pat->slots + k; - - if(note & (1 << 7)) { - /* MSB is set, this is a compressed packet */ - ++j; - - if(note & (1 << 0)) { - /* Note follows */ - slot->note = READ_U8(offset + j); - ++j; - } else { - slot->note = 0; - } - - if(note & (1 << 1)) { - /* Instrument follows */ - slot->instrument = READ_U8(offset + j); - ++j; - } else { - slot->instrument = 0; - } - - if(note & (1 << 2)) { - /* Volume column follows */ - slot->volume_column = READ_U8(offset + j); - ++j; - } else { - slot->volume_column = 0; - } - - if(note & (1 << 3)) { - /* Effect follows */ - slot->effect_type = READ_U8(offset + j); - ++j; - } else { - slot->effect_type = 0; - } - - if(note & (1 << 4)) { - /* Effect parameter follows */ - slot->effect_param = READ_U8(offset + j); - ++j; - } else { - slot->effect_param = 0; - } - } else { - /* Uncompressed packet */ - slot->note = note; - slot->instrument = READ_U8(offset + j + 1); - slot->volume_column = READ_U8(offset + j + 2); - slot->effect_type = READ_U8(offset + j + 3); - slot->effect_param = READ_U8(offset + j + 4); - j += 5; - } - } - } - - offset += packed_patterndata_size; - } - - /* Read instruments */ - for(uint16_t i = 0; i < ctx->module.num_instruments; ++i) { - uint32_t sample_header_size = 0; - jar_xm_instrument_t* instr = mod->instruments + i; - - READ_MEMCPY(instr->name, offset + 4, INSTRUMENT_NAME_LENGTH); - instr->num_samples = READ_U16(offset + 27); - - if(instr->num_samples > 0) { - /* Read extra header properties */ - sample_header_size = READ_U32(offset + 29); - READ_MEMCPY(instr->sample_of_notes, offset + 33, NUM_NOTES); - - instr->volume_envelope.num_points = READ_U8(offset + 225); - instr->panning_envelope.num_points = READ_U8(offset + 226); - - for(uint8_t j = 0; j < instr->volume_envelope.num_points; ++j) { - instr->volume_envelope.points[j].frame = READ_U16(offset + 129 + 4 * j); - instr->volume_envelope.points[j].value = READ_U16(offset + 129 + 4 * j + 2); - } - - for(uint8_t j = 0; j < instr->panning_envelope.num_points; ++j) { - instr->panning_envelope.points[j].frame = READ_U16(offset + 177 + 4 * j); - instr->panning_envelope.points[j].value = READ_U16(offset + 177 + 4 * j + 2); - } - - instr->volume_envelope.sustain_point = READ_U8(offset + 227); - instr->volume_envelope.loop_start_point = READ_U8(offset + 228); - instr->volume_envelope.loop_end_point = READ_U8(offset + 229); - - instr->panning_envelope.sustain_point = READ_U8(offset + 230); - instr->panning_envelope.loop_start_point = READ_U8(offset + 231); - instr->panning_envelope.loop_end_point = READ_U8(offset + 232); - - uint8_t flags = READ_U8(offset + 233); - instr->volume_envelope.enabled = flags & (1 << 0); - instr->volume_envelope.sustain_enabled = flags & (1 << 1); - instr->volume_envelope.loop_enabled = flags & (1 << 2); - - flags = READ_U8(offset + 234); - instr->panning_envelope.enabled = flags & (1 << 0); - instr->panning_envelope.sustain_enabled = flags & (1 << 1); - instr->panning_envelope.loop_enabled = flags & (1 << 2); - - instr->vibrato_type = READ_U8(offset + 235); - if(instr->vibrato_type == 2) { - instr->vibrato_type = 1; - } else if(instr->vibrato_type == 1) { - instr->vibrato_type = 2; - } - instr->vibrato_sweep = READ_U8(offset + 236); - instr->vibrato_depth = READ_U8(offset + 237); - instr->vibrato_rate = READ_U8(offset + 238); - instr->volume_fadeout = READ_U16(offset + 239); - - instr->samples = (jar_xm_sample_t*)mempool; - mempool += instr->num_samples * sizeof(jar_xm_sample_t); - } else { - instr->samples = NULL; - } - - /* Instrument header size */ - offset += READ_U32(offset); - - for(uint16_t j = 0; j < instr->num_samples; ++j) { - /* Read sample header */ - jar_xm_sample_t* sample = instr->samples + j; - - sample->length = READ_U32(offset); - sample->loop_start = READ_U32(offset + 4); - sample->loop_length = READ_U32(offset + 8); - sample->loop_end = sample->loop_start + sample->loop_length; - sample->volume = (float)READ_U8(offset + 12) / (float)0x40; - sample->finetune = (int8_t)READ_U8(offset + 13); - - uint8_t flags = READ_U8(offset + 14); - if((flags & 3) == 0) { - sample->loop_type = jar_xm_NO_LOOP; - } else if((flags & 3) == 1) { - sample->loop_type = jar_xm_FORWARD_LOOP; - } else { - sample->loop_type = jar_xm_PING_PONG_LOOP; - } - - sample->bits = (flags & (1 << 4)) ? 16 : 8; - - sample->panning = (float)READ_U8(offset + 15) / (float)0xFF; - sample->relative_note = (int8_t)READ_U8(offset + 16); - READ_MEMCPY(sample->name, 18, SAMPLE_NAME_LENGTH); - sample->data = (float*)mempool; - - if(sample->bits == 16) { - /* 16 bit sample */ - mempool += sample->length * (sizeof(float) >> 1); - sample->loop_start >>= 1; - sample->loop_length >>= 1; - sample->loop_end >>= 1; - sample->length >>= 1; - } else { - /* 8 bit sample */ - mempool += sample->length * sizeof(float); - } - - offset += sample_header_size; - } - - for(uint16_t j = 0; j < instr->num_samples; ++j) { - /* Read sample data */ - jar_xm_sample_t* sample = instr->samples + j; - uint32_t length = sample->length; - - if(sample->bits == 16) { - int16_t v = 0; - for(uint32_t k = 0; k < length; ++k) { - v = v + (int16_t)READ_U16(offset + (k << 1)); - sample->data[k] = (float)v / (float)(1 << 15); - } - offset += sample->length << 1; - } else { - int8_t v = 0; - for(uint32_t k = 0; k < length; ++k) { - v = v + (int8_t)READ_U8(offset + k); - sample->data[k] = (float)v / (float)(1 << 7); - } - offset += sample->length; - } - } - } - - return mempool; -} - -//------------------------------------------------------------------------------- -//THE FOLLOWING IS FOR PLAYING -//------------------------------------------------------------------------------- - -/* ----- Static functions ----- */ - -static float jar_xm_waveform(jar_xm_waveform_type_t, uint8_t); -static void jar_xm_autovibrato(jar_xm_context_t*, jar_xm_channel_context_t*); -static void jar_xm_vibrato(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); -static void jar_xm_tremolo(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); -static void jar_xm_arpeggio(jar_xm_context_t*, jar_xm_channel_context_t*, uint8_t, uint16_t); -static void jar_xm_tone_portamento(jar_xm_context_t*, jar_xm_channel_context_t*); -static void jar_xm_pitch_slide(jar_xm_context_t*, jar_xm_channel_context_t*, float); -static void jar_xm_panning_slide(jar_xm_channel_context_t*, uint8_t); -static void jar_xm_volume_slide(jar_xm_channel_context_t*, uint8_t); - -static float jar_xm_envelope_lerp(jar_xm_envelope_point_t*, jar_xm_envelope_point_t*, uint16_t); -static void jar_xm_envelope_tick(jar_xm_channel_context_t*, jar_xm_envelope_t*, uint16_t*, float*); -static void jar_xm_envelopes(jar_xm_channel_context_t*); - -static float jar_xm_linear_period(float); -static float jar_xm_linear_frequency(float); -static float jar_xm_amiga_period(float); -static float jar_xm_amiga_frequency(float); -static float jar_xm_period(jar_xm_context_t*, float); -static float jar_xm_frequency(jar_xm_context_t*, float, float); -static void jar_xm_update_frequency(jar_xm_context_t*, jar_xm_channel_context_t*); - -static void jar_xm_handle_note_and_instrument(jar_xm_context_t*, jar_xm_channel_context_t*, jar_xm_pattern_slot_t*); -static void jar_xm_trigger_note(jar_xm_context_t*, jar_xm_channel_context_t*, unsigned int flags); -static void jar_xm_cut_note(jar_xm_channel_context_t*); -static void jar_xm_key_off(jar_xm_channel_context_t*); - -static void jar_xm_post_pattern_change(jar_xm_context_t*); -static void jar_xm_row(jar_xm_context_t*); -static void jar_xm_tick(jar_xm_context_t*); - -static float jar_xm_next_of_sample(jar_xm_channel_context_t*); -static void jar_xm_sample(jar_xm_context_t*, float*, float*); - -/* ----- Other oddities ----- */ - -#define jar_xm_TRIGGER_KEEP_VOLUME (1 << 0) -#define jar_xm_TRIGGER_KEEP_PERIOD (1 << 1) -#define jar_xm_TRIGGER_KEEP_SAMPLE_POSITION (1 << 2) - -static const uint16_t amiga_frequencies[] = { - 1712, 1616, 1525, 1440, /* C-2, C#2, D-2, D#2 */ - 1357, 1281, 1209, 1141, /* E-2, F-2, F#2, G-2 */ - 1077, 1017, 961, 907, /* G#2, A-2, A#2, B-2 */ - 856, /* C-3 */ -}; - -static const float multi_retrig_add[] = { - 0.f, -1.f, -2.f, -4.f, /* 0, 1, 2, 3 */ - -8.f, -16.f, 0.f, 0.f, /* 4, 5, 6, 7 */ - 0.f, 1.f, 2.f, 4.f, /* 8, 9, A, B */ - 8.f, 16.f, 0.f, 0.f /* C, D, E, F */ -}; - -static const float multi_retrig_multiply[] = { - 1.f, 1.f, 1.f, 1.f, /* 0, 1, 2, 3 */ - 1.f, 1.f, .6666667f, .5f, /* 4, 5, 6, 7 */ - 1.f, 1.f, 1.f, 1.f, /* 8, 9, A, B */ - 1.f, 1.f, 1.5f, 2.f /* C, D, E, F */ -}; - -#define jar_xm_CLAMP_UP1F(vol, limit) do { \ - if((vol) > (limit)) (vol) = (limit); \ - } while(0) -#define jar_xm_CLAMP_UP(vol) jar_xm_CLAMP_UP1F((vol), 1.f) - -#define jar_xm_CLAMP_DOWN1F(vol, limit) do { \ - if((vol) < (limit)) (vol) = (limit); \ - } while(0) -#define jar_xm_CLAMP_DOWN(vol) jar_xm_CLAMP_DOWN1F((vol), .0f) - -#define jar_xm_CLAMP2F(vol, up, down) do { \ - if((vol) > (up)) (vol) = (up); \ - else if((vol) < (down)) (vol) = (down); \ - } while(0) -#define jar_xm_CLAMP(vol) jar_xm_CLAMP2F((vol), 1.f, .0f) - -#define jar_xm_SLIDE_TOWARDS(val, goal, incr) do { \ - if((val) > (goal)) { \ - (val) -= (incr); \ - jar_xm_CLAMP_DOWN1F((val), (goal)); \ - } else if((val) < (goal)) { \ - (val) += (incr); \ - jar_xm_CLAMP_UP1F((val), (goal)); \ - } \ - } while(0) - -#define jar_xm_LERP(u, v, t) ((u) + (t) * ((v) - (u))) -#define jar_xm_INVERSE_LERP(u, v, lerp) (((lerp) - (u)) / ((v) - (u))) - -#define HAS_TONE_PORTAMENTO(s) ((s)->effect_type == 3 \ - || (s)->effect_type == 5 \ - || ((s)->volume_column >> 4) == 0xF) -#define HAS_ARPEGGIO(s) ((s)->effect_type == 0 \ - && (s)->effect_param != 0) -#define HAS_VIBRATO(s) ((s)->effect_type == 4 \ - || (s)->effect_param == 6 \ - || ((s)->volume_column >> 4) == 0xB) -#define NOTE_IS_VALID(n) ((n) > 0 && (n) < 97) - -/* ----- Function definitions ----- */ - -static float jar_xm_waveform(jar_xm_waveform_type_t waveform, uint8_t step) { - static unsigned int next_rand = 24492; - step %= 0x40; - - switch(waveform) { - - case jar_xm_SINE_WAVEFORM: - /* Why not use a table? For saving space, and because there's - * very very little actual performance gain. */ - return -sinf(2.f * 3.141592f * (float)step / (float)0x40); - - case jar_xm_RAMP_DOWN_WAVEFORM: - /* Ramp down: 1.0f when step = 0; -1.0f when step = 0x40 */ - return (float)(0x20 - step) / 0x20; - - case jar_xm_SQUARE_WAVEFORM: - /* Square with a 50% duty */ - return (step >= 0x20) ? 1.f : -1.f; - - case jar_xm_RANDOM_WAVEFORM: - /* Use the POSIX.1-2001 example, just to be deterministic - * across different machines */ - next_rand = next_rand * 1103515245 + 12345; - return (float)((next_rand >> 16) & 0x7FFF) / (float)0x4000 - 1.f; - - case jar_xm_RAMP_UP_WAVEFORM: - /* Ramp up: -1.f when step = 0; 1.f when step = 0x40 */ - return (float)(step - 0x20) / 0x20; - - default: - break; - - } - - return .0f; -} - -static void jar_xm_autovibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { - if(ch->instrument == NULL || ch->instrument->vibrato_depth == 0) return; - jar_xm_instrument_t* instr = ch->instrument; - float sweep = 1.f; - - if(ch->autovibrato_ticks < instr->vibrato_sweep) { - /* No idea if this is correct, but it sounds close enough… */ - sweep = jar_xm_LERP(0.f, 1.f, (float)ch->autovibrato_ticks / (float)instr->vibrato_sweep); - } - - unsigned int step = ((ch->autovibrato_ticks++) * instr->vibrato_rate) >> 2; - ch->autovibrato_note_offset = .25f * jar_xm_waveform(instr->vibrato_type, step) - * (float)instr->vibrato_depth / (float)0xF * sweep; - jar_xm_update_frequency(ctx, ch); -} - -static void jar_xm_vibrato(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { - unsigned int step = pos * (param >> 4); - ch->vibrato_note_offset = - 2.f - * jar_xm_waveform(ch->vibrato_waveform, step) - * (float)(param & 0x0F) / (float)0xF; - jar_xm_update_frequency(ctx, ch); -} - -static void jar_xm_tremolo(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t pos) { - unsigned int step = pos * (param >> 4); - /* Not so sure about this, it sounds correct by ear compared with - * MilkyTracker, but it could come from other bugs */ - ch->tremolo_volume = -1.f * jar_xm_waveform(ch->tremolo_waveform, step) - * (float)(param & 0x0F) / (float)0xF; -} - -static void jar_xm_arpeggio(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, uint8_t param, uint16_t tick) { - switch(tick % 3) { - case 0: - ch->arp_in_progress = false; - ch->arp_note_offset = 0; - break; - case 2: - ch->arp_in_progress = true; - ch->arp_note_offset = param >> 4; - break; - case 1: - ch->arp_in_progress = true; - ch->arp_note_offset = param & 0x0F; - break; - } - - jar_xm_update_frequency(ctx, ch); -} - -static void jar_xm_tone_portamento(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { - /* 3xx called without a note, wait until we get an actual - * target note. */ - if(ch->tone_portamento_target_period == 0.f) return; - - if(ch->period != ch->tone_portamento_target_period) { - jar_xm_SLIDE_TOWARDS(ch->period, - ch->tone_portamento_target_period, - (ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES ? - 4.f : 1.f) * ch->tone_portamento_param - ); - jar_xm_update_frequency(ctx, ch); - } -} - -static void jar_xm_pitch_slide(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, float period_offset) { - /* Don't ask about the 4.f coefficient. I found mention of it - * nowhere. Found by ear™. */ - if(ctx->module.frequency_type == jar_xm_LINEAR_FREQUENCIES) { - period_offset *= 4.f; - } - - ch->period += period_offset; - jar_xm_CLAMP_DOWN(ch->period); - /* XXX: upper bound of period ? */ - - jar_xm_update_frequency(ctx, ch); -} - -static void jar_xm_panning_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { - float f; - - if((rawval & 0xF0) && (rawval & 0x0F)) { - /* Illegal state */ - return; - } - - if(rawval & 0xF0) { - /* Slide right */ - f = (float)(rawval >> 4) / (float)0xFF; - ch->panning += f; - jar_xm_CLAMP_UP(ch->panning); - } else { - /* Slide left */ - f = (float)(rawval & 0x0F) / (float)0xFF; - ch->panning -= f; - jar_xm_CLAMP_DOWN(ch->panning); - } -} - -static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { - float f; - - if((rawval & 0xF0) && (rawval & 0x0F)) { - /* Illegal state */ - return; - } - - if(rawval & 0xF0) { - /* Slide up */ - f = (float)(rawval >> 4) / (float)0x40; - ch->volume += f; - jar_xm_CLAMP_UP(ch->volume); - } else { - /* Slide down */ - f = (float)(rawval & 0x0F) / (float)0x40; - ch->volume -= f; - jar_xm_CLAMP_DOWN(ch->volume); - } -} - -static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* restrict a, jar_xm_envelope_point_t* restrict b, uint16_t pos) { - /* Linear interpolation between two envelope points */ - if(pos <= a->frame) return a->value; - else if(pos >= b->frame) return b->value; - else { - float p = (float)(pos - a->frame) / (float)(b->frame - a->frame); - return a->value * (1 - p) + b->value * p; - } -} - -static void jar_xm_post_pattern_change(jar_xm_context_t* ctx) { - /* Loop if necessary */ - if(ctx->current_table_index >= ctx->module.length) { - ctx->current_table_index = ctx->module.restart_position; - } -} - -static float jar_xm_linear_period(float note) { - return 7680.f - note * 64.f; -} - -static float jar_xm_linear_frequency(float period) { - return 8363.f * powf(2.f, (4608.f - period) / 768.f); -} - -static float jar_xm_amiga_period(float note) { - unsigned int intnote = note; - uint8_t a = intnote % 12; - int8_t octave = note / 12.f - 2; - uint16_t p1 = amiga_frequencies[a], p2 = amiga_frequencies[a + 1]; - - if(octave > 0) { - p1 >>= octave; - p2 >>= octave; - } else if(octave < 0) { - p1 <<= (-octave); - p2 <<= (-octave); - } - - return jar_xm_LERP(p1, p2, note - intnote); -} - -static float jar_xm_amiga_frequency(float period) { - if(period == .0f) return .0f; - - /* This is the PAL value. No reason to choose this one over the - * NTSC value. */ - return 7093789.2f / (period * 2.f); -} - -static float jar_xm_period(jar_xm_context_t* ctx, float note) { - switch(ctx->module.frequency_type) { - case jar_xm_LINEAR_FREQUENCIES: - return jar_xm_linear_period(note); - case jar_xm_AMIGA_FREQUENCIES: - return jar_xm_amiga_period(note); - } - return .0f; -} - -static float jar_xm_frequency(jar_xm_context_t* ctx, float period, float note_offset) { - uint8_t a; - int8_t octave; - float note; - uint16_t p1, p2; - - switch(ctx->module.frequency_type) { - - case jar_xm_LINEAR_FREQUENCIES: - return jar_xm_linear_frequency(period - 64.f * note_offset); - - case jar_xm_AMIGA_FREQUENCIES: - if(note_offset == 0) { - /* A chance to escape from insanity */ - return jar_xm_amiga_frequency(period); - } - - /* FIXME: this is very crappy at best */ - a = octave = 0; - - /* Find the octave of the current period */ - if(period > amiga_frequencies[0]) { - --octave; - while(period > (amiga_frequencies[0] << (-octave))) --octave; - } else if(period < amiga_frequencies[12]) { - ++octave; - while(period < (amiga_frequencies[12] >> octave)) ++octave; - } - - /* Find the smallest note closest to the current period */ - for(uint8_t i = 0; i < 12; ++i) { - p1 = amiga_frequencies[i], p2 = amiga_frequencies[i + 1]; - - if(octave > 0) { - p1 >>= octave; - p2 >>= octave; - } else if(octave < 0) { - p1 <<= (-octave); - p2 <<= (-octave); - } - - if(p2 <= period && period <= p1) { - a = i; - break; - } - } - - if(JAR_XM_DEBUG && (p1 < period || p2 > period)) { - DEBUG("%i <= %f <= %i should hold but doesn't, this is a bug", p2, period, p1); - } - - note = 12.f * (octave + 2) + a + jar_xm_INVERSE_LERP(p1, p2, period); - - return jar_xm_amiga_frequency(jar_xm_amiga_period(note + note_offset)); - - } - - return .0f; -} - -static void jar_xm_update_frequency(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch) { - ch->frequency = jar_xm_frequency( - ctx, ch->period, - (ch->arp_note_offset > 0 ? ch->arp_note_offset : ( - ch->vibrato_note_offset + ch->autovibrato_note_offset - )) - ); - ch->step = ch->frequency / ctx->rate; -} - -static void jar_xm_handle_note_and_instrument(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, - jar_xm_pattern_slot_t* s) { - if(s->instrument > 0) { - if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) { - /* Tone portamento in effect, unclear stuff happens */ - jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_PERIOD | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); - } else if(s->instrument > ctx->module.num_instruments) { - /* Invalid instrument, Cut current note */ - jar_xm_cut_note(ch); - ch->instrument = NULL; - ch->sample = NULL; - } else { - ch->instrument = ctx->module.instruments + (s->instrument - 1); - if(s->note == 0 && ch->sample != NULL) { - /* Ghost instrument, trigger note */ - /* Sample position is kept, but envelopes are reset */ - jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_SAMPLE_POSITION); - } - } - } - - if(NOTE_IS_VALID(s->note)) { - /* Yes, the real note number is s->note -1. Try finding - * THAT in any of the specs! :-) */ - - jar_xm_instrument_t* instr = ch->instrument; - - if(HAS_TONE_PORTAMENTO(ch->current) && instr != NULL && ch->sample != NULL) { - /* Tone portamento in effect */ - ch->note = s->note + ch->sample->relative_note + ch->sample->finetune / 128.f - 1.f; - ch->tone_portamento_target_period = jar_xm_period(ctx, ch->note); - } else if(instr == NULL || ch->instrument->num_samples == 0) { - /* Bad instrument */ - jar_xm_cut_note(ch); - } else { - if(instr->sample_of_notes[s->note - 1] < instr->num_samples) { -#if JAR_XM_RAMPING - for(unsigned int z = 0; z < jar_xm_SAMPLE_RAMPING_POINTS; ++z) { - ch->end_of_previous_sample[z] = jar_xm_next_of_sample(ch); - } - ch->frame_count = 0; -#endif - ch->sample = instr->samples + instr->sample_of_notes[s->note - 1]; - ch->orig_note = ch->note = s->note + ch->sample->relative_note - + ch->sample->finetune / 128.f - 1.f; - if(s->instrument > 0) { - jar_xm_trigger_note(ctx, ch, 0); - } else { - /* Ghost note: keep old volume */ - jar_xm_trigger_note(ctx, ch, jar_xm_TRIGGER_KEEP_VOLUME); - } - } else { - /* Bad sample */ - jar_xm_cut_note(ch); - } - } - } else if(s->note == 97) { - /* Key Off */ - jar_xm_key_off(ch); - } - - switch(s->volume_column >> 4) { - - case 0x5: - if(s->volume_column > 0x50) break; - case 0x1: - case 0x2: - case 0x3: - case 0x4: - /* Set volume */ - ch->volume = (float)(s->volume_column - 0x10) / (float)0x40; - break; - - case 0x8: /* Fine volume slide down */ - jar_xm_volume_slide(ch, s->volume_column & 0x0F); - break; - - case 0x9: /* Fine volume slide up */ - jar_xm_volume_slide(ch, s->volume_column << 4); - break; - - case 0xA: /* Set vibrato speed */ - ch->vibrato_param = (ch->vibrato_param & 0x0F) | ((s->volume_column & 0x0F) << 4); - break; - - case 0xC: /* Set panning */ - ch->panning = (float)( - ((s->volume_column & 0x0F) << 4) | (s->volume_column & 0x0F) - ) / (float)0xFF; - break; - - case 0xF: /* Tone portamento */ - if(s->volume_column & 0x0F) { - ch->tone_portamento_param = ((s->volume_column & 0x0F) << 4) - | (s->volume_column & 0x0F); - } - break; - - default: - break; - - } - - switch(s->effect_type) { - - case 1: /* 1xx: Portamento up */ - if(s->effect_param > 0) { - ch->portamento_up_param = s->effect_param; - } - break; - - case 2: /* 2xx: Portamento down */ - if(s->effect_param > 0) { - ch->portamento_down_param = s->effect_param; - } - break; - - case 3: /* 3xx: Tone portamento */ - if(s->effect_param > 0) { - ch->tone_portamento_param = s->effect_param; - } - break; - - case 4: /* 4xy: Vibrato */ - if(s->effect_param & 0x0F) { - /* Set vibrato depth */ - ch->vibrato_param = (ch->vibrato_param & 0xF0) | (s->effect_param & 0x0F); - } - if(s->effect_param >> 4) { - /* Set vibrato speed */ - ch->vibrato_param = (s->effect_param & 0xF0) | (ch->vibrato_param & 0x0F); - } - break; - - case 5: /* 5xy: Tone portamento + Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } - break; - - case 6: /* 6xy: Vibrato + Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } - break; - - case 7: /* 7xy: Tremolo */ - if(s->effect_param & 0x0F) { - /* Set tremolo depth */ - ch->tremolo_param = (ch->tremolo_param & 0xF0) | (s->effect_param & 0x0F); - } - if(s->effect_param >> 4) { - /* Set tremolo speed */ - ch->tremolo_param = (s->effect_param & 0xF0) | (ch->tremolo_param & 0x0F); - } - break; - - case 8: /* 8xx: Set panning */ - ch->panning = (float)s->effect_param / (float)0xFF; - break; - - case 9: /* 9xx: Sample offset */ - if(ch->sample != NULL && NOTE_IS_VALID(s->note)) { - uint32_t final_offset = s->effect_param << (ch->sample->bits == 16 ? 7 : 8); - if(final_offset >= ch->sample->length) { - /* Pretend the sample dosen't loop and is done playing */ - ch->sample_position = -1; - break; - } - ch->sample_position = final_offset; - } - break; - - case 0xA: /* Axy: Volume slide */ - if(s->effect_param > 0) { - ch->volume_slide_param = s->effect_param; - } - break; - - case 0xB: /* Bxx: Position jump */ - if(s->effect_param < ctx->module.length) { - ctx->position_jump = true; - ctx->jump_dest = s->effect_param; - } - break; - - case 0xC: /* Cxx: Set volume */ - ch->volume = (float)((s->effect_param > 0x40) - ? 0x40 : s->effect_param) / (float)0x40; - break; - - case 0xD: /* Dxx: Pattern break */ - /* Jump after playing this line */ - ctx->pattern_break = true; - ctx->jump_row = (s->effect_param >> 4) * 10 + (s->effect_param & 0x0F); - break; - - case 0xE: /* EXy: Extended command */ - switch(s->effect_param >> 4) { - - case 1: /* E1y: Fine portamento up */ - if(s->effect_param & 0x0F) { - ch->fine_portamento_up_param = s->effect_param & 0x0F; - } - jar_xm_pitch_slide(ctx, ch, -ch->fine_portamento_up_param); - break; - - case 2: /* E2y: Fine portamento down */ - if(s->effect_param & 0x0F) { - ch->fine_portamento_down_param = s->effect_param & 0x0F; - } - jar_xm_pitch_slide(ctx, ch, ch->fine_portamento_down_param); - break; - - case 4: /* E4y: Set vibrato control */ - ch->vibrato_waveform = s->effect_param & 3; - ch->vibrato_waveform_retrigger = !((s->effect_param >> 2) & 1); - break; - - case 5: /* E5y: Set finetune */ - if(NOTE_IS_VALID(ch->current->note) && ch->sample != NULL) { - ch->note = ch->current->note + ch->sample->relative_note + - (float)(((s->effect_param & 0x0F) - 8) << 4) / 128.f - 1.f; - ch->period = jar_xm_period(ctx, ch->note); - jar_xm_update_frequency(ctx, ch); - } - break; - - case 6: /* E6y: Pattern loop */ - if(s->effect_param & 0x0F) { - if((s->effect_param & 0x0F) == ch->pattern_loop_count) { - /* Loop is over */ - ch->pattern_loop_count = 0; - break; - } - - /* Jump to the beginning of the loop */ - ch->pattern_loop_count++; - ctx->position_jump = true; - ctx->jump_row = ch->pattern_loop_origin; - ctx->jump_dest = ctx->current_table_index; - } else { - /* Set loop start point */ - ch->pattern_loop_origin = ctx->current_row; - /* Replicate FT2 E60 bug */ - ctx->jump_row = ch->pattern_loop_origin; - } - break; - - case 7: /* E7y: Set tremolo control */ - ch->tremolo_waveform = s->effect_param & 3; - ch->tremolo_waveform_retrigger = !((s->effect_param >> 2) & 1); - break; - - case 0xA: /* EAy: Fine volume slide up */ - if(s->effect_param & 0x0F) { - ch->fine_volume_slide_param = s->effect_param & 0x0F; - } - jar_xm_volume_slide(ch, ch->fine_volume_slide_param << 4); - break; - - case 0xB: /* EBy: Fine volume slide down */ - if(s->effect_param & 0x0F) { - ch->fine_volume_slide_param = s->effect_param & 0x0F; - } - jar_xm_volume_slide(ch, ch->fine_volume_slide_param); - break; - - case 0xD: /* EDy: Note delay */ - /* XXX: figure this out better. EDx triggers - * the note even when there no note and no - * instrument. But ED0 acts like like a ghost - * note, EDx (x ≠ 0) does not. */ - if(s->note == 0 && s->instrument == 0) { - unsigned int flags = jar_xm_TRIGGER_KEEP_VOLUME; - - if(ch->current->effect_param & 0x0F) { - ch->note = ch->orig_note; - jar_xm_trigger_note(ctx, ch, flags); - } else { - jar_xm_trigger_note( - ctx, ch, - flags - | jar_xm_TRIGGER_KEEP_PERIOD - | jar_xm_TRIGGER_KEEP_SAMPLE_POSITION - ); - } - } - break; - - case 0xE: /* EEy: Pattern delay */ - ctx->extra_ticks = (ch->current->effect_param & 0x0F) * ctx->tempo; - break; - - default: - break; - - } - break; - - case 0xF: /* Fxx: Set tempo/BPM */ - if(s->effect_param > 0) { - if(s->effect_param <= 0x1F) { - ctx->tempo = s->effect_param; - } else { - ctx->bpm = s->effect_param; - } - } - break; - - case 16: /* Gxx: Set global volume */ - ctx->global_volume = (float)((s->effect_param > 0x40) - ? 0x40 : s->effect_param) / (float)0x40; - break; - - case 17: /* Hxy: Global volume slide */ - if(s->effect_param > 0) { - ch->global_volume_slide_param = s->effect_param; - } - break; - - case 21: /* Lxx: Set envelope position */ - ch->volume_envelope_frame_count = s->effect_param; - ch->panning_envelope_frame_count = s->effect_param; - break; - - case 25: /* Pxy: Panning slide */ - if(s->effect_param > 0) { - ch->panning_slide_param = s->effect_param; - } - break; - - case 27: /* Rxy: Multi retrig note */ - if(s->effect_param > 0) { - if((s->effect_param >> 4) == 0) { - /* Keep previous x value */ - ch->multi_retrig_param = (ch->multi_retrig_param & 0xF0) | (s->effect_param & 0x0F); - } else { - ch->multi_retrig_param = s->effect_param; - } - } - break; - - case 29: /* Txy: Tremor */ - if(s->effect_param > 0) { - /* Tremor x and y params do not appear to be separately - * kept in memory, unlike Rxy */ - ch->tremor_param = s->effect_param; - } - break; - - case 33: /* Xxy: Extra stuff */ - switch(s->effect_param >> 4) { - - case 1: /* X1y: Extra fine portamento up */ - if(s->effect_param & 0x0F) { - ch->extra_fine_portamento_up_param = s->effect_param & 0x0F; - } - jar_xm_pitch_slide(ctx, ch, -1.0f * ch->extra_fine_portamento_up_param); - break; - - case 2: /* X2y: Extra fine portamento down */ - if(s->effect_param & 0x0F) { - ch->extra_fine_portamento_down_param = s->effect_param & 0x0F; - } - jar_xm_pitch_slide(ctx, ch, ch->extra_fine_portamento_down_param); - break; - - default: - break; - - } - break; - - default: - break; - - } -} - -static void jar_xm_trigger_note(jar_xm_context_t* ctx, jar_xm_channel_context_t* ch, unsigned int flags) { - if(!(flags & jar_xm_TRIGGER_KEEP_SAMPLE_POSITION)) { - ch->sample_position = 0.f; - ch->ping = true; - } - - if(ch->sample != NULL) { - if(!(flags & jar_xm_TRIGGER_KEEP_VOLUME)) { - ch->volume = ch->sample->volume; - } - - ch->panning = ch->sample->panning; - } - - ch->sustained = true; - ch->fadeout_volume = ch->volume_envelope_volume = 1.0f; - ch->panning_envelope_panning = .5f; - ch->volume_envelope_frame_count = ch->panning_envelope_frame_count = 0; - ch->vibrato_note_offset = 0.f; - ch->tremolo_volume = 0.f; - ch->tremor_on = false; - - ch->autovibrato_ticks = 0; - - if(ch->vibrato_waveform_retrigger) { - ch->vibrato_ticks = 0; /* XXX: should the waveform itself also - * be reset to sine? */ - } - if(ch->tremolo_waveform_retrigger) { - ch->tremolo_ticks = 0; - } - - if(!(flags & jar_xm_TRIGGER_KEEP_PERIOD)) { - ch->period = jar_xm_period(ctx, ch->note); - jar_xm_update_frequency(ctx, ch); - } - - ch->latest_trigger = ctx->generated_samples; - if(ch->instrument != NULL) { - ch->instrument->latest_trigger = ctx->generated_samples; - } - if(ch->sample != NULL) { - ch->sample->latest_trigger = ctx->generated_samples; - } -} - -static void jar_xm_cut_note(jar_xm_channel_context_t* ch) { - /* NB: this is not the same as Key Off */ - ch->volume = .0f; -} - -static void jar_xm_key_off(jar_xm_channel_context_t* ch) { - /* Key Off */ - ch->sustained = false; - - /* If no volume envelope is used, also cut the note */ - if(ch->instrument == NULL || !ch->instrument->volume_envelope.enabled) { - jar_xm_cut_note(ch); - } -} - -static void jar_xm_row(jar_xm_context_t* ctx) { - if(ctx->position_jump) { - ctx->current_table_index = ctx->jump_dest; - ctx->current_row = ctx->jump_row; - ctx->position_jump = false; - ctx->pattern_break = false; - ctx->jump_row = 0; - jar_xm_post_pattern_change(ctx); - } else if(ctx->pattern_break) { - ctx->current_table_index++; - ctx->current_row = ctx->jump_row; - ctx->pattern_break = false; - ctx->jump_row = 0; - jar_xm_post_pattern_change(ctx); - } - - jar_xm_pattern_t* cur = ctx->module.patterns + ctx->module.pattern_table[ctx->current_table_index]; - bool in_a_loop = false; - - /* Read notes… */ - for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { - jar_xm_pattern_slot_t* s = cur->slots + ctx->current_row * ctx->module.num_channels + i; - jar_xm_channel_context_t* ch = ctx->channels + i; - - ch->current = s; - - if(s->effect_type != 0xE || s->effect_param >> 4 != 0xD) { - jar_xm_handle_note_and_instrument(ctx, ch, s); - } else { - ch->note_delay_param = s->effect_param & 0x0F; - } - - if(!in_a_loop && ch->pattern_loop_count > 0) { - in_a_loop = true; - } - } - - if(!in_a_loop) { - /* No E6y loop is in effect (or we are in the first pass) */ - ctx->loop_count = (ctx->row_loop_count[MAX_NUM_ROWS * ctx->current_table_index + ctx->current_row]++); - } - - ctx->current_row++; /* Since this is an uint8, this line can - * increment from 255 to 0, in which case it - * is still necessary to go the next - * pattern. */ - if(!ctx->position_jump && !ctx->pattern_break && - (ctx->current_row >= cur->num_rows || ctx->current_row == 0)) { - ctx->current_table_index++; - ctx->current_row = ctx->jump_row; /* This will be 0 most of - * the time, except when E60 - * is used */ - ctx->jump_row = 0; - jar_xm_post_pattern_change(ctx); - } -} - -static void jar_xm_envelope_tick(jar_xm_channel_context_t* ch, - jar_xm_envelope_t* env, - uint16_t* counter, - float* outval) { - if(env->num_points < 2) { - /* Don't really know what to do… */ - if(env->num_points == 1) { - /* XXX I am pulling this out of my ass */ - *outval = (float)env->points[0].value / (float)0x40; - if(*outval > 1) { - *outval = 1; - } - } - - return; - } else { - uint8_t j; - - if(env->loop_enabled) { - uint16_t loop_start = env->points[env->loop_start_point].frame; - uint16_t loop_end = env->points[env->loop_end_point].frame; - uint16_t loop_length = loop_end - loop_start; - - if(*counter >= loop_end) { - *counter -= loop_length; - } - } - - for(j = 0; j < (env->num_points - 2); ++j) { - if(env->points[j].frame <= *counter && - env->points[j+1].frame >= *counter) { - break; - } - } - - *outval = jar_xm_envelope_lerp(env->points + j, env->points + j + 1, *counter) / (float)0x40; - - /* Make sure it is safe to increment frame count */ - if(!ch->sustained || !env->sustain_enabled || - *counter != env->points[env->sustain_point].frame) { - (*counter)++; - } - } -} - -static void jar_xm_envelopes(jar_xm_channel_context_t* ch) { - if(ch->instrument != NULL) { - if(ch->instrument->volume_envelope.enabled) { - if(!ch->sustained) { - ch->fadeout_volume -= (float)ch->instrument->volume_fadeout / 65536.f; - jar_xm_CLAMP_DOWN(ch->fadeout_volume); - } - - jar_xm_envelope_tick(ch, - &(ch->instrument->volume_envelope), - &(ch->volume_envelope_frame_count), - &(ch->volume_envelope_volume)); - } - - if(ch->instrument->panning_envelope.enabled) { - jar_xm_envelope_tick(ch, - &(ch->instrument->panning_envelope), - &(ch->panning_envelope_frame_count), - &(ch->panning_envelope_panning)); - } - } -} - -static void jar_xm_tick(jar_xm_context_t* ctx) { - if(ctx->current_tick == 0) { - jar_xm_row(ctx); - } - - for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { - jar_xm_channel_context_t* ch = ctx->channels + i; - - jar_xm_envelopes(ch); - jar_xm_autovibrato(ctx, ch); - - if(ch->arp_in_progress && !HAS_ARPEGGIO(ch->current)) { - ch->arp_in_progress = false; - ch->arp_note_offset = 0; - jar_xm_update_frequency(ctx, ch); - } - if(ch->vibrato_in_progress && !HAS_VIBRATO(ch->current)) { - ch->vibrato_in_progress = false; - ch->vibrato_note_offset = 0.f; - jar_xm_update_frequency(ctx, ch); - } - - switch(ch->current->volume_column >> 4) { - - case 0x6: /* Volume slide down */ - if(ctx->current_tick == 0) break; - jar_xm_volume_slide(ch, ch->current->volume_column & 0x0F); - break; - - case 0x7: /* Volume slide up */ - if(ctx->current_tick == 0) break; - jar_xm_volume_slide(ch, ch->current->volume_column << 4); - break; - - case 0xB: /* Vibrato */ - if(ctx->current_tick == 0) break; - ch->vibrato_in_progress = false; - jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); - break; - - case 0xD: /* Panning slide left */ - if(ctx->current_tick == 0) break; - jar_xm_panning_slide(ch, ch->current->volume_column & 0x0F); - break; - - case 0xE: /* Panning slide right */ - if(ctx->current_tick == 0) break; - jar_xm_panning_slide(ch, ch->current->volume_column << 4); - break; - - case 0xF: /* Tone portamento */ - if(ctx->current_tick == 0) break; - jar_xm_tone_portamento(ctx, ch); - break; - - default: - break; - - } - - switch(ch->current->effect_type) { - - case 0: /* 0xy: Arpeggio */ - if(ch->current->effect_param > 0) { - char arp_offset = ctx->tempo % 3; - switch(arp_offset) { - case 2: /* 0 -> x -> 0 -> y -> x -> … */ - if(ctx->current_tick == 1) { - ch->arp_in_progress = true; - ch->arp_note_offset = ch->current->effect_param >> 4; - jar_xm_update_frequency(ctx, ch); - break; - } - /* No break here, this is intended */ - case 1: /* 0 -> 0 -> y -> x -> … */ - if(ctx->current_tick == 0) { - ch->arp_in_progress = false; - ch->arp_note_offset = 0; - jar_xm_update_frequency(ctx, ch); - break; - } - /* No break here, this is intended */ - case 0: /* 0 -> y -> x -> … */ - jar_xm_arpeggio(ctx, ch, ch->current->effect_param, ctx->current_tick - arp_offset); - default: - break; - } - } - break; - - case 1: /* 1xx: Portamento up */ - if(ctx->current_tick == 0) break; - jar_xm_pitch_slide(ctx, ch, -ch->portamento_up_param); - break; - - case 2: /* 2xx: Portamento down */ - if(ctx->current_tick == 0) break; - jar_xm_pitch_slide(ctx, ch, ch->portamento_down_param); - break; - - case 3: /* 3xx: Tone portamento */ - if(ctx->current_tick == 0) break; - jar_xm_tone_portamento(ctx, ch); - break; - - case 4: /* 4xy: Vibrato */ - if(ctx->current_tick == 0) break; - ch->vibrato_in_progress = true; - jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); - break; - - case 5: /* 5xy: Tone portamento + Volume slide */ - if(ctx->current_tick == 0) break; - jar_xm_tone_portamento(ctx, ch); - jar_xm_volume_slide(ch, ch->volume_slide_param); - break; - - case 6: /* 6xy: Vibrato + Volume slide */ - if(ctx->current_tick == 0) break; - ch->vibrato_in_progress = true; - jar_xm_vibrato(ctx, ch, ch->vibrato_param, ch->vibrato_ticks++); - jar_xm_volume_slide(ch, ch->volume_slide_param); - break; - - case 7: /* 7xy: Tremolo */ - if(ctx->current_tick == 0) break; - jar_xm_tremolo(ctx, ch, ch->tremolo_param, ch->tremolo_ticks++); - break; - - case 0xA: /* Axy: Volume slide */ - if(ctx->current_tick == 0) break; - jar_xm_volume_slide(ch, ch->volume_slide_param); - break; - - case 0xE: /* EXy: Extended command */ - switch(ch->current->effect_param >> 4) { - - case 0x9: /* E9y: Retrigger note */ - if(ctx->current_tick != 0 && ch->current->effect_param & 0x0F) { - if(!(ctx->current_tick % (ch->current->effect_param & 0x0F))) { - jar_xm_trigger_note(ctx, ch, 0); - jar_xm_envelopes(ch); - } - } - break; - - case 0xC: /* ECy: Note cut */ - if((ch->current->effect_param & 0x0F) == ctx->current_tick) { - jar_xm_cut_note(ch); - } - break; - - case 0xD: /* EDy: Note delay */ - if(ch->note_delay_param == ctx->current_tick) { - jar_xm_handle_note_and_instrument(ctx, ch, ch->current); - jar_xm_envelopes(ch); - } - break; - - default: - break; - - } - break; - - case 17: /* Hxy: Global volume slide */ - if(ctx->current_tick == 0) break; - if((ch->global_volume_slide_param & 0xF0) && - (ch->global_volume_slide_param & 0x0F)) { - /* Illegal state */ - break; - } - if(ch->global_volume_slide_param & 0xF0) { - /* Global slide up */ - float f = (float)(ch->global_volume_slide_param >> 4) / (float)0x40; - ctx->global_volume += f; - jar_xm_CLAMP_UP(ctx->global_volume); - } else { - /* Global slide down */ - float f = (float)(ch->global_volume_slide_param & 0x0F) / (float)0x40; - ctx->global_volume -= f; - jar_xm_CLAMP_DOWN(ctx->global_volume); - } - break; - - case 20: /* Kxx: Key off */ - /* Most documentations will tell you the parameter has no - * use. Don't be fooled. */ - if(ctx->current_tick == ch->current->effect_param) { - jar_xm_key_off(ch); - } - break; - - case 25: /* Pxy: Panning slide */ - if(ctx->current_tick == 0) break; - jar_xm_panning_slide(ch, ch->panning_slide_param); - break; - - case 27: /* Rxy: Multi retrig note */ - if(ctx->current_tick == 0) break; - if(((ch->multi_retrig_param) & 0x0F) == 0) break; - if((ctx->current_tick % (ch->multi_retrig_param & 0x0F)) == 0) { - float v = ch->volume * multi_retrig_multiply[ch->multi_retrig_param >> 4] - + multi_retrig_add[ch->multi_retrig_param >> 4]; - jar_xm_CLAMP(v); - jar_xm_trigger_note(ctx, ch, 0); - ch->volume = v; - } - break; - - case 29: /* Txy: Tremor */ - if(ctx->current_tick == 0) break; - ch->tremor_on = ( - (ctx->current_tick - 1) % ((ch->tremor_param >> 4) + (ch->tremor_param & 0x0F) + 2) - > - (ch->tremor_param >> 4) - ); - break; - - default: - break; - - } - - float panning, volume; - - panning = ch->panning + - (ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; - - if(ch->tremor_on) { - volume = .0f; - } else { - volume = ch->volume + ch->tremolo_volume; - jar_xm_CLAMP(volume); - volume *= ch->fadeout_volume * ch->volume_envelope_volume; - } - -#if JAR_XM_RAMPING - ch->target_panning = panning; - ch->target_volume = volume; -#else - ch->actual_panning = panning; - ch->actual_volume = volume; -#endif - } - - ctx->current_tick++; - if(ctx->current_tick >= ctx->tempo + ctx->extra_ticks) { - ctx->current_tick = 0; - ctx->extra_ticks = 0; - } - - /* FT2 manual says number of ticks / second = BPM * 0.4 */ - ctx->remaining_samples_in_tick += (float)ctx->rate / ((float)ctx->bpm * 0.4f); -} - -static float jar_xm_next_of_sample(jar_xm_channel_context_t* ch) { - if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { -#if JAR_XM_RAMPING - if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { - return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], .0f, - (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); - } -#endif - return .0f; - } - if(ch->sample->length == 0) { - return .0f; - } - - float u, v, t; - uint32_t a, b; - a = (uint32_t)ch->sample_position; /* This cast is fine, - * sample_position will not - * go above integer - * ranges */ - if(JAR_XM_LINEAR_INTERPOLATION) { - b = a + 1; - t = ch->sample_position - a; /* Cheaper than fmodf(., 1.f) */ - } - u = ch->sample->data[a]; - - switch(ch->sample->loop_type) { - - case jar_xm_NO_LOOP: - if(JAR_XM_LINEAR_INTERPOLATION) { - v = (b < ch->sample->length) ? ch->sample->data[b] : .0f; - } - ch->sample_position += ch->step; - if(ch->sample_position >= ch->sample->length) { - ch->sample_position = -1; - } - break; - - case jar_xm_FORWARD_LOOP: - if(JAR_XM_LINEAR_INTERPOLATION) { - v = ch->sample->data[ - (b == ch->sample->loop_end) ? ch->sample->loop_start : b - ]; - } - ch->sample_position += ch->step; - while(ch->sample_position >= ch->sample->loop_end) { - ch->sample_position -= ch->sample->loop_length; - } - break; - - case jar_xm_PING_PONG_LOOP: - if(ch->ping) { - ch->sample_position += ch->step; - } else { - ch->sample_position -= ch->step; - } - /* XXX: this may not work for very tight ping-pong loops - * (ie switches direction more than once per sample */ - if(ch->ping) { - if(JAR_XM_LINEAR_INTERPOLATION) { - v = (b >= ch->sample->loop_end) ? ch->sample->data[a] : ch->sample->data[b]; - } - if(ch->sample_position >= ch->sample->loop_end) { - ch->ping = false; - ch->sample_position = (ch->sample->loop_end << 1) - ch->sample_position; - } - /* sanity checking */ - if(ch->sample_position >= ch->sample->length) { - ch->ping = false; - ch->sample_position -= ch->sample->length - 1; - } - } else { - if(JAR_XM_LINEAR_INTERPOLATION) { - v = u; - u = (b == 1 || b - 2 <= ch->sample->loop_start) ? ch->sample->data[a] : ch->sample->data[b - 2]; - } - if(ch->sample_position <= ch->sample->loop_start) { - ch->ping = true; - ch->sample_position = (ch->sample->loop_start << 1) - ch->sample_position; - } - /* sanity checking */ - if(ch->sample_position <= .0f) { - ch->ping = true; - ch->sample_position = .0f; - } - } - break; - - default: - v = .0f; - break; - } - - float endval = JAR_XM_LINEAR_INTERPOLATION ? jar_xm_LERP(u, v, t) : u; - -#if JAR_XM_RAMPING - if(ch->frame_count < jar_xm_SAMPLE_RAMPING_POINTS) { - /* Smoothly transition between old and new sample. */ - return jar_xm_LERP(ch->end_of_previous_sample[ch->frame_count], endval, - (float)ch->frame_count / (float)jar_xm_SAMPLE_RAMPING_POINTS); - } -#endif - - return endval; -} - -static void jar_xm_sample(jar_xm_context_t* ctx, float* left, float* right) { - if(ctx->remaining_samples_in_tick <= 0) { - jar_xm_tick(ctx); - } - ctx->remaining_samples_in_tick--; - - *left = 0.f; - *right = 0.f; - - if(ctx->max_loop_count > 0 && ctx->loop_count >= ctx->max_loop_count) { - return; - } - - for(uint8_t i = 0; i < ctx->module.num_channels; ++i) { - jar_xm_channel_context_t* ch = ctx->channels + i; - - if(ch->instrument == NULL || ch->sample == NULL || ch->sample_position < 0) { - continue; - } - - const float fval = jar_xm_next_of_sample(ch); - - if(!ch->muted && !ch->instrument->muted) { - *left += fval * ch->actual_volume * (1.f - ch->actual_panning); - *right += fval * ch->actual_volume * ch->actual_panning; - } - -#if JAR_XM_RAMPING - ch->frame_count++; - jar_xm_SLIDE_TOWARDS(ch->actual_volume, ch->target_volume, ctx->volume_ramp); - jar_xm_SLIDE_TOWARDS(ch->actual_panning, ch->target_panning, ctx->panning_ramp); -#endif - } - - const float fgvol = ctx->global_volume * ctx->amplification; - *left *= fgvol; - *right *= fgvol; - -#if JAR_XM_DEBUG - if(fabs(*left) > 1 || fabs(*right) > 1) { - DEBUG("clipping frame: %f %f, this is a bad module or a libxm bug", *left, *right); - } -#endif -} - -void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples) { - if(ctx && output) { - ctx->generated_samples += numsamples; - for(size_t i = 0; i < numsamples; i++) { - jar_xm_sample(ctx, output + (2 * i), output + (2 * i + 1)); - } - } -} - -uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx) -{ - uint64_t total = 0; - uint8_t currentLoopCount = jar_xm_get_loop_count(ctx); - jar_xm_set_max_loop_count(ctx, 0); - - while(jar_xm_get_loop_count(ctx) == currentLoopCount) - { - total += ctx->remaining_samples_in_tick; - ctx->remaining_samples_in_tick = 0; - jar_xm_tick(ctx); - } - - ctx->loop_count = currentLoopCount; - return total; -} - - - - - -//-------------------------------------------- -//FILE LOADER - TODO - NEEDS TO BE CLEANED UP -//-------------------------------------------- - - - -#undef DEBUG -#define DEBUG(...) do { \ - fprintf(stderr, __VA_ARGS__); \ - fflush(stderr); \ - } while(0) - -#define DEBUG_ERR(...) do { \ - fprintf(stderr, __VA_ARGS__); \ - fflush(stderr); \ - } while(0) - -#define FATAL(...) do { \ - fprintf(stderr, __VA_ARGS__); \ - fflush(stderr); \ - exit(1); \ - } while(0) - -#define FATAL_ERR(...) do { \ - fprintf(stderr, __VA_ARGS__); \ - fflush(stderr); \ - exit(1); \ - } while(0) - - -int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const char* filename) { - FILE* xmf; - int size; - - xmf = fopen(filename, "rb"); - if(xmf == NULL) { - DEBUG_ERR("Could not open input file"); - *ctx = NULL; - return 3; - } - - fseek(xmf, 0, SEEK_END); - size = ftell(xmf); - rewind(xmf); - if(size == -1) { - fclose(xmf); - DEBUG_ERR("fseek() failed"); - *ctx = NULL; - return 4; - } - - char* data = malloc(size + 1); - if(fread(data, 1, size, xmf) < size) { - fclose(xmf); - DEBUG_ERR("fread() failed"); - *ctx = NULL; - return 5; - } - - fclose(xmf); - - switch(jar_xm_create_context_safe(ctx, data, size, rate)) { - case 0: - break; - - case 1: - DEBUG("could not create context: module is not sane\n"); - *ctx = NULL; - return 1; - break; - - case 2: - FATAL("could not create context: malloc failed\n"); - return 2; - break; - - default: - FATAL("could not create context: unknown error\n"); - return 6; - break; - - } - - return 0; -} - - - - -#endif//end of JAR_XM_IMPLEMENTATION -//------------------------------------------------------------------------------- - - - - -#endif//end of INCLUDE_JAR_XM_H diff --git a/src/libraylib.bc b/src/libraylib.bc index 21039250..0b385eb8 100644 Binary files a/src/libraylib.bc and b/src/libraylib.bc differ diff --git a/src/rlgl.c b/src/rlgl.c index 756fba75..9a102c01 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -48,7 +48,7 @@ #ifdef __APPLE__ #include // OpenGL 3 library for OSX #else - #include "glad.h" // GLAD library, includes OpenGL headers + #include "external/glad.h" // GLAD library, includes OpenGL headers #endif #endif diff --git a/src/stb_image.h b/src/stb_image.h deleted file mode 100644 index ce87646d..00000000 --- a/src/stb_image.h +++ /dev/null @@ -1,6763 +0,0 @@ -/* stb_image - v2.12 - public domain image loader - http://nothings.org/stb_image.h - no warranty implied; use at your own risk - - Do this: - #define STB_IMAGE_IMPLEMENTATION - before you include this file in *one* C or C++ file to create the implementation. - - // i.e. it should look like this: - #include ... - #include ... - #include ... - #define STB_IMAGE_IMPLEMENTATION - #include "stb_image.h" - - You can #define STBI_ASSERT(x) before the #include to avoid using assert.h. - And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free - - - QUICK NOTES: - Primarily of interest to game developers and other people who can - avoid problematic images and only need the trivial interface - - JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib) - PNG 1/2/4/8-bit-per-channel (16 bpc not supported) - - TGA (not sure what subset, if a subset) - BMP non-1bpp, non-RLE - PSD (composited view only, no extra channels, 8/16 bit-per-channel) - - GIF (*comp always reports as 4-channel) - HDR (radiance rgbE format) - PIC (Softimage PIC) - PNM (PPM and PGM binary only) - - Animated GIF still needs a proper API, but here's one way to do it: - http://gist.github.com/urraka/685d9a6340b26b830d49 - - - decode from memory or through FILE (define STBI_NO_STDIO to remove code) - - decode from arbitrary I/O callbacks - - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON) - - Full documentation under "DOCUMENTATION" below. - - - Revision 2.00 release notes: - - - Progressive JPEG is now supported. - - - PPM and PGM binary formats are now supported, thanks to Ken Miller. - - - x86 platforms now make use of SSE2 SIMD instructions for - JPEG decoding, and ARM platforms can use NEON SIMD if requested. - This work was done by Fabian "ryg" Giesen. SSE2 is used by - default, but NEON must be enabled explicitly; see docs. - - With other JPEG optimizations included in this version, we see - 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup - on a JPEG on an ARM machine, relative to previous versions of this - library. The same results will not obtain for all JPGs and for all - x86/ARM machines. (Note that progressive JPEGs are significantly - slower to decode than regular JPEGs.) This doesn't mean that this - is the fastest JPEG decoder in the land; rather, it brings it - closer to parity with standard libraries. If you want the fastest - decode, look elsewhere. (See "Philosophy" section of docs below.) - - See final bullet items below for more info on SIMD. - - - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing - the memory allocator. Unlike other STBI libraries, these macros don't - support a context parameter, so if you need to pass a context in to - the allocator, you'll have to store it in a global or a thread-local - variable. - - - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and - STBI_NO_LINEAR. - STBI_NO_HDR: suppress implementation of .hdr reader format - STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API - - - You can suppress implementation of any of the decoders to reduce - your code footprint by #defining one or more of the following - symbols before creating the implementation. - - STBI_NO_JPEG - STBI_NO_PNG - STBI_NO_BMP - STBI_NO_PSD - STBI_NO_TGA - STBI_NO_GIF - STBI_NO_HDR - STBI_NO_PIC - STBI_NO_PNM (.ppm and .pgm) - - - You can request *only* certain decoders and suppress all other ones - (this will be more forward-compatible, as addition of new decoders - doesn't require you to disable them explicitly): - - STBI_ONLY_JPEG - STBI_ONLY_PNG - STBI_ONLY_BMP - STBI_ONLY_PSD - STBI_ONLY_TGA - STBI_ONLY_GIF - STBI_ONLY_HDR - STBI_ONLY_PIC - STBI_ONLY_PNM (.ppm and .pgm) - - Note that you can define multiples of these, and you will get all - of them ("only x" and "only y" is interpreted to mean "only x&y"). - - - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still - want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB - - - Compilation of all SIMD code can be suppressed with - #define STBI_NO_SIMD - It should not be necessary to disable SIMD unless you have issues - compiling (e.g. using an x86 compiler which doesn't support SSE - intrinsics or that doesn't support the method used to detect - SSE2 support at run-time), and even those can be reported as - bugs so I can refine the built-in compile-time checking to be - smarter. - - - The old STBI_SIMD system which allowed installing a user-defined - IDCT etc. has been removed. If you need this, don't upgrade. My - assumption is that almost nobody was doing this, and those who - were will find the built-in SIMD more satisfactory anyway. - - - RGB values computed for JPEG images are slightly different from - previous versions of stb_image. (This is due to using less - integer precision in SIMD.) The C code has been adjusted so - that the same RGB values will be computed regardless of whether - SIMD support is available, so your app should always produce - consistent results. But these results are slightly different from - previous versions. (Specifically, about 3% of available YCbCr values - will compute different RGB results from pre-1.49 versions by +-1; - most of the deviating values are one smaller in the G channel.) - - - If you must produce consistent results with previous versions of - stb_image, #define STBI_JPEG_OLD and you will get the same results - you used to; however, you will not get the SIMD speedups for - the YCbCr-to-RGB conversion step (although you should still see - significant JPEG speedup from the other changes). - - Please note that STBI_JPEG_OLD is a temporary feature; it will be - removed in future versions of the library. It is only intended for - near-term back-compatibility use. - - - Latest revision history: - 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes - 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 - RGB-format JPEG; remove white matting in PSD; - allocate large structures on the stack; - correct channel count for PNG & BMP - 2.10 (2016-01-22) avoid warning introduced in 2.09 - 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED - 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA - 2.07 (2015-09-13) partial animated GIF support - limited 16-bit PSD support - minor bugs, code cleanup, and compiler warnings - 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value - 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning - 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit - 2.03 (2015-04-12) additional corruption checking - stbi_set_flip_vertically_on_load - fix NEON support; fix mingw support - 2.02 (2015-01-19) fix incorrect assert, fix warning - 2.01 (2015-01-17) fix various warnings - 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG - 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD - progressive JPEG - PGM/PPM support - STBI_MALLOC,STBI_REALLOC,STBI_FREE - STBI_NO_*, STBI_ONLY_* - GIF bugfix - - See end of file for full revision history. - - - ============================ Contributors ========================= - - Image formats Extensions, features - Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info) - Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info) - Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG) - Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks) - Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG) - Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip) - Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD) - urraka@github (animated gif) Junggon Kim (PNM comments) - Daniel Gibson (16-bit TGA) - - Optimizations & bugfixes - Fabian "ryg" Giesen - Arseny Kapoulkine - - Bug & warning fixes - Marc LeBlanc David Woo Guillaume George Martins Mozeiko - Christpher Lloyd Martin Golini Jerry Jansson Joseph Thomson - Dave Moore Roy Eltham Hayaki Saito Phil Jordan - Won Chun Luke Graham Johan Duparc Nathan Reed - the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis - Janez Zemva John Bartholomew Michal Cichon svdijk@github - Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson - Laurent Gomila Cort Stratton Sergio Gonzalez romigrou@github - Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan - Ryamond Barbiero Paul Du Bois Engin Manap snagar@github - Michaelangel007@github Oriol Ferrer Mesia socks-the-fox - Blazej Dariusz Roszkowski - - -LICENSE - -This software is dual-licensed to the public domain and under the following -license: you are granted a perpetual, irrevocable license to copy, modify, -publish, and distribute this file as you see fit. - -*/ - -#ifndef STBI_INCLUDE_STB_IMAGE_H -#define STBI_INCLUDE_STB_IMAGE_H - -// DOCUMENTATION -// -// Limitations: -// - no 16-bit-per-channel PNG -// - no 12-bit-per-channel JPEG -// - no JPEGs with arithmetic coding -// - no 1-bit BMP -// - GIF always returns *comp=4 -// -// Basic usage (see HDR discussion below for HDR usage): -// int x,y,n; -// unsigned char *data = stbi_load(filename, &x, &y, &n, 0); -// // ... process data if not NULL ... -// // ... x = width, y = height, n = # 8-bit components per pixel ... -// // ... replace '0' with '1'..'4' to force that many components per pixel -// // ... but 'n' will always be the number that it would have been if you said 0 -// stbi_image_free(data) -// -// Standard parameters: -// int *x -- outputs image width in pixels -// int *y -- outputs image height in pixels -// int *comp -- outputs # of image components in image file -// int req_comp -- if non-zero, # of image components requested in result -// -// The return value from an image loader is an 'unsigned char *' which points -// to the pixel data, or NULL on an allocation failure or if the image is -// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels, -// with each pixel consisting of N interleaved 8-bit components; the first -// pixel pointed to is top-left-most in the image. There is no padding between -// image scanlines or between pixels, regardless of format. The number of -// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise. -// If req_comp is non-zero, *comp has the number of components that _would_ -// have been output otherwise. E.g. if you set req_comp to 4, you will always -// get RGBA output, but you can check *comp to see if it's trivially opaque -// because e.g. there were only 3 channels in the source image. -// -// An output image with N components has the following components interleaved -// in this order in each pixel: -// -// N=#comp components -// 1 grey -// 2 grey, alpha -// 3 red, green, blue -// 4 red, green, blue, alpha -// -// If image loading fails for any reason, the return value will be NULL, -// and *x, *y, *comp will be unchanged. The function stbi_failure_reason() -// can be queried for an extremely brief, end-user unfriendly explanation -// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid -// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly -// more user-friendly ones. -// -// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. -// -// =========================================================================== -// -// Philosophy -// -// stb libraries are designed with the following priorities: -// -// 1. easy to use -// 2. easy to maintain -// 3. good performance -// -// Sometimes I let "good performance" creep up in priority over "easy to maintain", -// and for best performance I may provide less-easy-to-use APIs that give higher -// performance, in addition to the easy to use ones. Nevertheless, it's important -// to keep in mind that from the standpoint of you, a client of this library, -// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all. -// -// Some secondary priorities arise directly from the first two, some of which -// make more explicit reasons why performance can't be emphasized. -// -// - Portable ("ease of use") -// - Small footprint ("easy to maintain") -// - No dependencies ("ease of use") -// -// =========================================================================== -// -// I/O callbacks -// -// I/O callbacks allow you to read from arbitrary sources, like packaged -// files or some other source. Data read from callbacks are processed -// through a small internal buffer (currently 128 bytes) to try to reduce -// overhead. -// -// The three functions you must define are "read" (reads some bytes of data), -// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end). -// -// =========================================================================== -// -// SIMD support -// -// The JPEG decoder will try to automatically use SIMD kernels on x86 when -// supported by the compiler. For ARM Neon support, you must explicitly -// request it. -// -// (The old do-it-yourself SIMD API is no longer supported in the current -// code.) -// -// On x86, SSE2 will automatically be used when available based on a run-time -// test; if not, the generic C versions are used as a fall-back. On ARM targets, -// the typical path is to have separate builds for NEON and non-NEON devices -// (at least this is true for iOS and Android). Therefore, the NEON support is -// toggled by a build flag: define STBI_NEON to get NEON loops. -// -// The output of the JPEG decoder is slightly different from versions where -// SIMD support was introduced (that is, for versions before 1.49). The -// difference is only +-1 in the 8-bit RGB channels, and only on a small -// fraction of pixels. You can force the pre-1.49 behavior by defining -// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path -// and hence cost some performance. -// -// If for some reason you do not want to use any of SIMD code, or if -// you have issues compiling it, you can disable it entirely by -// defining STBI_NO_SIMD. -// -// =========================================================================== -// -// HDR image support (disable by defining STBI_NO_HDR) -// -// stb_image now supports loading HDR images in general, and currently -// the Radiance .HDR file format, although the support is provided -// generically. You can still load any file through the existing interface; -// if you attempt to load an HDR file, it will be automatically remapped to -// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; -// both of these constants can be reconfigured through this interface: -// -// stbi_hdr_to_ldr_gamma(2.2f); -// stbi_hdr_to_ldr_scale(1.0f); -// -// (note, do not use _inverse_ constants; stbi_image will invert them -// appropriately). -// -// Additionally, there is a new, parallel interface for loading files as -// (linear) floats to preserve the full dynamic range: -// -// float *data = stbi_loadf(filename, &x, &y, &n, 0); -// -// If you load LDR images through this interface, those images will -// be promoted to floating point values, run through the inverse of -// constants corresponding to the above: -// -// stbi_ldr_to_hdr_scale(1.0f); -// stbi_ldr_to_hdr_gamma(2.2f); -// -// Finally, given a filename (or an open file or memory block--see header -// file for details) containing image data, you can query for the "most -// appropriate" interface to use (that is, whether the image is HDR or -// not), using: -// -// stbi_is_hdr(char *filename); -// -// =========================================================================== -// -// iPhone PNG support: -// -// By default we convert iphone-formatted PNGs back to RGB, even though -// they are internally encoded differently. You can disable this conversion -// by by calling stbi_convert_iphone_png_to_rgb(0), in which case -// you will always just get the native iphone "format" through (which -// is BGR stored in RGB). -// -// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per -// pixel to remove any premultiplied alpha *only* if the image file explicitly -// says there's premultiplied data (currently only happens in iPhone images, -// and only if iPhone convert-to-rgb processing is on). -// - - -#define STBI_NO_HDR // RaySan: not required by raylib -#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 - -#ifndef STBI_NO_STDIO -#include -#endif // STBI_NO_STDIO - -// NOTE: Added to work with raylib on Android -#if defined(PLATFORM_ANDROID) - #include "utils.h" // Android fopen function map -#endif - -#define STBI_VERSION 1 - -enum -{ - STBI_default = 0, // only used for req_comp - - STBI_grey = 1, - STBI_grey_alpha = 2, - STBI_rgb = 3, - STBI_rgb_alpha = 4 -}; - -typedef unsigned char stbi_uc; - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef STB_IMAGE_STATIC -#define STBIDEF static -#else -#define STBIDEF extern -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// PRIMARY API - works on images of any type -// - -// -// load image by filename, open file, or memory buffer -// - -typedef struct -{ - int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read - void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative - int (*eof) (void *user); // returns nonzero if we are at end of file/data -} stbi_io_callbacks; - -STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); -STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp); -STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp); - -#ifndef STBI_NO_STDIO -STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); -// for stbi_load_from_file, file pointer is left pointing immediately after image -#endif - -#ifndef STBI_NO_LINEAR - STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); - STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); - STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); - - #ifndef STBI_NO_STDIO - STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); - #endif -#endif - -#ifndef STBI_NO_HDR - STBIDEF void stbi_hdr_to_ldr_gamma(float gamma); - STBIDEF void stbi_hdr_to_ldr_scale(float scale); -#endif // STBI_NO_HDR - -#ifndef STBI_NO_LINEAR - STBIDEF void stbi_ldr_to_hdr_gamma(float gamma); - STBIDEF void stbi_ldr_to_hdr_scale(float scale); -#endif // STBI_NO_LINEAR - -// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR -STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); -STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); -#ifndef STBI_NO_STDIO -STBIDEF int stbi_is_hdr (char const *filename); -STBIDEF int stbi_is_hdr_from_file(FILE *f); -#endif // STBI_NO_STDIO - - -// get a VERY brief reason for failure -// NOT THREADSAFE -STBIDEF const char *stbi_failure_reason (void); - -// free the loaded image -- this is just free() -STBIDEF void stbi_image_free (void *retval_from_stbi_load); - -// get image dimensions & components without fully decoding -STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); -STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); -STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); - -#endif - - - -// for image formats that explicitly notate that they have premultiplied alpha, -// we just return the colors as stored in the file. set this flag to force -// unpremultiplication. results are undefined if the unpremultiply overflow. -STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); - -// indicate whether we should process iphone images back to canonical format, -// or just pass them through "as-is" -STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); - -// flip the image vertically, so the first pixel in the output array is the bottom left -STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); - -// ZLIB client - used by PNG, available for other purposes - -STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); -STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header); -STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); -STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - -STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); -STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - - -#ifdef __cplusplus -} -#endif - -// -// -//// end header file ///////////////////////////////////////////////////// -#endif // STBI_INCLUDE_STB_IMAGE_H - -#ifdef STB_IMAGE_IMPLEMENTATION - -#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \ - || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \ - || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \ - || defined(STBI_ONLY_ZLIB) - #ifndef STBI_ONLY_JPEG - #define STBI_NO_JPEG - #endif - #ifndef STBI_ONLY_PNG - #define STBI_NO_PNG - #endif - #ifndef STBI_ONLY_BMP - #define STBI_NO_BMP - #endif - #ifndef STBI_ONLY_PSD - #define STBI_NO_PSD - #endif - #ifndef STBI_ONLY_TGA - #define STBI_NO_TGA - #endif - #ifndef STBI_ONLY_GIF - #define STBI_NO_GIF - #endif - #ifndef STBI_ONLY_HDR - #define STBI_NO_HDR - #endif - #ifndef STBI_ONLY_PIC - #define STBI_NO_PIC - #endif - #ifndef STBI_ONLY_PNM - #define STBI_NO_PNM - #endif -#endif - -#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB) -#define STBI_NO_ZLIB -#endif - - -#include -#include // ptrdiff_t on osx -#include -#include - -#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) -#include // ldexp -#endif - -#ifndef STBI_NO_STDIO -#include -#endif - -#ifndef STBI_ASSERT -#include -#define STBI_ASSERT(x) assert(x) -#endif - - -#ifndef _MSC_VER - #ifdef __cplusplus - #define stbi_inline inline - #else - #define stbi_inline - #endif -#else - #define stbi_inline __forceinline -#endif - - -#ifdef _MSC_VER -typedef unsigned short stbi__uint16; -typedef signed short stbi__int16; -typedef unsigned int stbi__uint32; -typedef signed int stbi__int32; -#else -#include -typedef uint16_t stbi__uint16; -typedef int16_t stbi__int16; -typedef uint32_t stbi__uint32; -typedef int32_t stbi__int32; -#endif - -// should produce compiler error if size is wrong -typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; - -#ifdef _MSC_VER -#define STBI_NOTUSED(v) (void)(v) -#else -#define STBI_NOTUSED(v) (void)sizeof(v) -#endif - -#ifdef _MSC_VER -#define STBI_HAS_LROTL -#endif - -#ifdef STBI_HAS_LROTL - #define stbi_lrot(x,y) _lrotl(x,y) -#else - #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y)))) -#endif - -#if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) -// ok -#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED) -// ok -#else -#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)." -#endif - -#ifndef STBI_MALLOC -#define STBI_MALLOC(sz) malloc(sz) -#define STBI_REALLOC(p,newsz) realloc(p,newsz) -#define STBI_FREE(p) free(p) -#endif - -#ifndef STBI_REALLOC_SIZED -#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz) -#endif - -// x86/x64 detection -#if defined(__x86_64__) || defined(_M_X64) -#define STBI__X64_TARGET -#elif defined(__i386) || defined(_M_IX86) -#define STBI__X86_TARGET -#endif - -#if defined(__GNUC__) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) && !defined(__SSE2__) && !defined(STBI_NO_SIMD) -// NOTE: not clear do we actually need this for the 64-bit path? -// gcc doesn't support sse2 intrinsics unless you compile with -msse2, -// (but compiling with -msse2 allows the compiler to use SSE2 everywhere; -// this is just broken and gcc are jerks for not fixing it properly -// http://www.virtualdub.org/blog/pivot/entry.php?id=363 ) -#define STBI_NO_SIMD -#endif - -#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD) -// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET -// -// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the -// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant. -// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not -// simultaneously enabling "-mstackrealign". -// -// See https://github.com/nothings/stb/issues/81 for more information. -// -// So default to no SSE2 on 32-bit MinGW. If you've read this far and added -// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2. -#define STBI_NO_SIMD -#endif - -#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) -#define STBI_SSE2 -#include - -#ifdef _MSC_VER - -#if _MSC_VER >= 1400 // not VC6 -#include // __cpuid -static int stbi__cpuid3(void) -{ - int info[4]; - __cpuid(info,1); - return info[3]; -} -#else -static int stbi__cpuid3(void) -{ - int res; - __asm { - mov eax,1 - cpuid - mov res,edx - } - return res; -} -#endif - -#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name - -static int stbi__sse2_available() -{ - int info3 = stbi__cpuid3(); - return ((info3 >> 26) & 1) != 0; -} -#else // assume GCC-style if not VC++ -#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) - -static int stbi__sse2_available() -{ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later - // GCC 4.8+ has a nice way to do this - return __builtin_cpu_supports("sse2"); -#else - // portable way to do this, preferably without using GCC inline ASM? - // just bail for now. - return 0; -#endif -} -#endif -#endif - -// ARM NEON -#if defined(STBI_NO_SIMD) && defined(STBI_NEON) -#undef STBI_NEON -#endif - -#ifdef STBI_NEON -#include -// assume GCC or Clang on ARM targets -#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) -#endif - -#ifndef STBI_SIMD_ALIGN -#define STBI_SIMD_ALIGN(type, name) type name -#endif - -/////////////////////////////////////////////// -// -// stbi__context struct and start_xxx functions - -// stbi__context structure is our basic context used by all images, so it -// contains all the IO context, plus some basic image information -typedef struct -{ - stbi__uint32 img_x, img_y; - int img_n, img_out_n; - - stbi_io_callbacks io; - void *io_user_data; - - int read_from_callbacks; - int buflen; - stbi_uc buffer_start[128]; - - stbi_uc *img_buffer, *img_buffer_end; - stbi_uc *img_buffer_original, *img_buffer_original_end; -} stbi__context; - - -static void stbi__refill_buffer(stbi__context *s); - -// initialize a memory-decode context -static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len) -{ - s->io.read = NULL; - s->read_from_callbacks = 0; - s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer; - s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len; -} - -// initialize a callback-based context -static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user) -{ - s->io = *c; - s->io_user_data = user; - s->buflen = sizeof(s->buffer_start); - s->read_from_callbacks = 1; - s->img_buffer_original = s->buffer_start; - stbi__refill_buffer(s); - s->img_buffer_original_end = s->img_buffer_end; -} - -#ifndef STBI_NO_STDIO - -static int stbi__stdio_read(void *user, char *data, int size) -{ - return (int) fread(data,1,size,(FILE*) user); -} - -static void stbi__stdio_skip(void *user, int n) -{ - fseek((FILE*) user, n, SEEK_CUR); -} - -static int stbi__stdio_eof(void *user) -{ - return feof((FILE*) user); -} - -static stbi_io_callbacks stbi__stdio_callbacks = -{ - stbi__stdio_read, - stbi__stdio_skip, - stbi__stdio_eof, -}; - -static void stbi__start_file(stbi__context *s, FILE *f) -{ - stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f); -} - -//static void stop_file(stbi__context *s) { } - -#endif // !STBI_NO_STDIO - -static void stbi__rewind(stbi__context *s) -{ - // conceptually rewind SHOULD rewind to the beginning of the stream, - // but we just rewind to the beginning of the initial buffer, because - // we only use it after doing 'test', which only ever looks at at most 92 bytes - s->img_buffer = s->img_buffer_original; - s->img_buffer_end = s->img_buffer_original_end; -} - -#ifndef STBI_NO_JPEG -static int stbi__jpeg_test(stbi__context *s); -static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PNG -static int stbi__png_test(stbi__context *s); -static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_BMP -static int stbi__bmp_test(stbi__context *s); -static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_TGA -static int stbi__tga_test(stbi__context *s); -static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PSD -static int stbi__psd_test(stbi__context *s); -static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_HDR -static int stbi__hdr_test(stbi__context *s); -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PIC -static int stbi__pic_test(stbi__context *s); -static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_GIF -static int stbi__gif_test(stbi__context *s); -static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PNM -static int stbi__pnm_test(stbi__context *s); -static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); -static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -// this is not threadsafe -static const char *stbi__g_failure_reason; - -STBIDEF const char *stbi_failure_reason(void) -{ - return stbi__g_failure_reason; -} - -static int stbi__err(const char *str) -{ - stbi__g_failure_reason = str; - return 0; -} - -static void *stbi__malloc(size_t size) -{ - return STBI_MALLOC(size); -} - -// stbi__err - error -// stbi__errpf - error returning pointer to float -// stbi__errpuc - error returning pointer to unsigned char - -#ifdef STBI_NO_FAILURE_STRINGS - #define stbi__err(x,y) 0 -#elif defined(STBI_FAILURE_USERMSG) - #define stbi__err(x,y) stbi__err(y) -#else - #define stbi__err(x,y) stbi__err(x) -#endif - -#define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL)) -#define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL)) - -STBIDEF void stbi_image_free(void *retval_from_stbi_load) -{ - STBI_FREE(retval_from_stbi_load); -} - -#ifndef STBI_NO_LINEAR -static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp); -#endif - -#ifndef STBI_NO_HDR -static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp); -#endif - -static int stbi__vertically_flip_on_load = 0; - -STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) -{ - stbi__vertically_flip_on_load = flag_true_if_should_flip; -} - -static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - #ifndef STBI_NO_JPEG - if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_PNG - if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_BMP - if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_GIF - if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_PSD - if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_PIC - if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp); - #endif - #ifndef STBI_NO_PNM - if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp); - #endif - - #ifndef STBI_NO_HDR - if (stbi__hdr_test(s)) { - float *hdr = stbi__hdr_load(s, x,y,comp,req_comp); - return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); - } - #endif - - #ifndef STBI_NO_TGA - // test tga last because it's a crappy test! - if (stbi__tga_test(s)) - return stbi__tga_load(s,x,y,comp,req_comp); - #endif - - return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); -} - -static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *result = stbi__load_main(s, x, y, comp, req_comp); - - if (stbi__vertically_flip_on_load && result != NULL) { - int w = *x, h = *y; - int depth = req_comp ? req_comp : *comp; - int row,col,z; - stbi_uc temp; - - // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once - for (row = 0; row < (h>>1); row++) { - for (col = 0; col < w; col++) { - for (z = 0; z < depth; z++) { - temp = result[(row * w + col) * depth + z]; - result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; - result[((h - row - 1) * w + col) * depth + z] = temp; - } - } - } - } - - return result; -} - -#ifndef STBI_NO_HDR -static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) -{ - if (stbi__vertically_flip_on_load && result != NULL) { - int w = *x, h = *y; - int depth = req_comp ? req_comp : *comp; - int row,col,z; - float temp; - - // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once - for (row = 0; row < (h>>1); row++) { - for (col = 0; col < w; col++) { - for (z = 0; z < depth; z++) { - temp = result[(row * w + col) * depth + z]; - result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; - result[((h - row - 1) * w + col) * depth + z] = temp; - } - } - } - } -} -#endif - -#ifndef STBI_NO_STDIO - -static FILE *stbi__fopen(char const *filename, char const *mode) -{ - FILE *f; -#if defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f=0; -#else - f = fopen(filename, mode); -#endif - return f; -} - - -STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - FILE *f = stbi__fopen(filename, "rb"); - unsigned char *result; - if (!f) return stbi__errpuc("can't fopen", "Unable to open file"); - result = stbi_load_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *result; - stbi__context s; - stbi__start_file(&s,f); - result = stbi__load_flip(&s,x,y,comp,req_comp); - if (result) { - // need to 'unget' all the characters in the IO buffer - fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); - } - return result; -} -#endif //!STBI_NO_STDIO - -STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__load_flip(&s,x,y,comp,req_comp); -} - -STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__load_flip(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_LINEAR -static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *data; - #ifndef STBI_NO_HDR - if (stbi__hdr_test(s)) { - float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp); - if (hdr_data) - stbi__float_postprocess(hdr_data,x,y,comp,req_comp); - return hdr_data; - } - #endif - data = stbi__load_flip(s, x, y, comp, req_comp); - if (data) - return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); - return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); -} - -STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} - -STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_STDIO -STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - float *result; - FILE *f = stbi__fopen(filename, "rb"); - if (!f) return stbi__errpf("can't fopen", "Unable to open file"); - result = stbi_loadf_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_file(&s,f); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} -#endif // !STBI_NO_STDIO - -#endif // !STBI_NO_LINEAR - -// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is -// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always -// reports false! - -STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) -{ - #ifndef STBI_NO_HDR - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__hdr_test(&s); - #else - STBI_NOTUSED(buffer); - STBI_NOTUSED(len); - return 0; - #endif -} - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_is_hdr (char const *filename) -{ - FILE *f = stbi__fopen(filename, "rb"); - int result=0; - if (f) { - result = stbi_is_hdr_from_file(f); - fclose(f); - } - return result; -} - -STBIDEF int stbi_is_hdr_from_file(FILE *f) -{ - #ifndef STBI_NO_HDR - stbi__context s; - stbi__start_file(&s,f); - return stbi__hdr_test(&s); - #else - STBI_NOTUSED(f); - return 0; - #endif -} -#endif // !STBI_NO_STDIO - -STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user) -{ - #ifndef STBI_NO_HDR - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__hdr_test(&s); - #else - STBI_NOTUSED(clbk); - STBI_NOTUSED(user); - return 0; - #endif -} - -#ifndef STBI_NO_LINEAR -static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f; - -STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } -STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } -#endif - -static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; - -STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; } -STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; } - - -////////////////////////////////////////////////////////////////////////////// -// -// Common code used by all image loaders -// - -enum -{ - STBI__SCAN_load=0, - STBI__SCAN_type, - STBI__SCAN_header -}; - -static void stbi__refill_buffer(stbi__context *s) -{ - int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); - if (n == 0) { - // at end of file, treat same as if from memory, but need to handle case - // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file - s->read_from_callbacks = 0; - s->img_buffer = s->buffer_start; - s->img_buffer_end = s->buffer_start+1; - *s->img_buffer = 0; - } else { - s->img_buffer = s->buffer_start; - s->img_buffer_end = s->buffer_start + n; - } -} - -stbi_inline static stbi_uc stbi__get8(stbi__context *s) -{ - if (s->img_buffer < s->img_buffer_end) - return *s->img_buffer++; - if (s->read_from_callbacks) { - stbi__refill_buffer(s); - return *s->img_buffer++; - } - return 0; -} - -stbi_inline static int stbi__at_eof(stbi__context *s) -{ - if (s->io.read) { - if (!(s->io.eof)(s->io_user_data)) return 0; - // if feof() is true, check if buffer = end - // special case: we've only got the special 0 character at the end - if (s->read_from_callbacks == 0) return 1; - } - - return s->img_buffer >= s->img_buffer_end; -} - -static void stbi__skip(stbi__context *s, int n) -{ - if (n < 0) { - s->img_buffer = s->img_buffer_end; - return; - } - if (s->io.read) { - int blen = (int) (s->img_buffer_end - s->img_buffer); - if (blen < n) { - s->img_buffer = s->img_buffer_end; - (s->io.skip)(s->io_user_data, n - blen); - return; - } - } - s->img_buffer += n; -} - -static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) -{ - if (s->io.read) { - int blen = (int) (s->img_buffer_end - s->img_buffer); - if (blen < n) { - int res, count; - - memcpy(buffer, s->img_buffer, blen); - - count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen); - res = (count == (n-blen)); - s->img_buffer = s->img_buffer_end; - return res; - } - } - - if (s->img_buffer+n <= s->img_buffer_end) { - memcpy(buffer, s->img_buffer, n); - s->img_buffer += n; - return 1; - } else - return 0; -} - -static int stbi__get16be(stbi__context *s) -{ - int z = stbi__get8(s); - return (z << 8) + stbi__get8(s); -} - -static stbi__uint32 stbi__get32be(stbi__context *s) -{ - stbi__uint32 z = stbi__get16be(s); - return (z << 16) + stbi__get16be(s); -} - -#if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) -// nothing -#else -static int stbi__get16le(stbi__context *s) -{ - int z = stbi__get8(s); - return z + (stbi__get8(s) << 8); -} -#endif - -#ifndef STBI_NO_BMP -static stbi__uint32 stbi__get32le(stbi__context *s) -{ - stbi__uint32 z = stbi__get16le(s); - return z + (stbi__get16le(s) << 16); -} -#endif - -#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings - - -////////////////////////////////////////////////////////////////////////////// -// -// generic converter from built-in img_n to req_comp -// individual types do this automatically as much as possible (e.g. jpeg -// does all cases internally since it needs to colorspace convert anyway, -// and it never has alpha, so very few cases ). png can automatically -// interleave an alpha=255 channel, but falls back to this for other cases -// -// assume data buffer is malloced, so malloc a new one and free that one -// only failure mode is malloc failing - -static stbi_uc stbi__compute_y(int r, int g, int b) -{ - return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); -} - -static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) -{ - int i,j; - unsigned char *good; - - if (req_comp == img_n) return data; - STBI_ASSERT(req_comp >= 1 && req_comp <= 4); - - good = (unsigned char *) stbi__malloc(req_comp * x * y); - if (good == NULL) { - STBI_FREE(data); - return stbi__errpuc("outofmem", "Out of memory"); - } - - for (j=0; j < (int) y; ++j) { - unsigned char *src = data + j * x * img_n ; - unsigned char *dest = good + j * x * req_comp; - - #define COMBO(a,b) ((a)*8+(b)) - #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (COMBO(img_n, req_comp)) { - CASE(1,2) dest[0]=src[0], dest[1]=255; break; - CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; - CASE(2,1) dest[0]=src[0]; break; - CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; - CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; - CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; - CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break; - CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; - CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; - CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; - default: STBI_ASSERT(0); - } - #undef CASE - } - - STBI_FREE(data); - return good; -} - -#ifndef STBI_NO_LINEAR -static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) -{ - int i,k,n; - float *output = (float *) stbi__malloc(x * y * comp * sizeof(float)); - if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale); - } - if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; - } - STBI_FREE(data); - return output; -} -#endif - -#ifndef STBI_NO_HDR -#define stbi__float2int(x) ((int) (x)) -static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) -{ - int i,k,n; - stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp); - if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (stbi_uc) stbi__float2int(z); - } - if (k < comp) { - float z = data[i*comp+k] * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (stbi_uc) stbi__float2int(z); - } - } - STBI_FREE(data); - return output; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// "baseline" JPEG/JFIF decoder -// -// simple implementation -// - doesn't support delayed output of y-dimension -// - simple interface (only one output format: 8-bit interleaved RGB) -// - doesn't try to recover corrupt jpegs -// - doesn't allow partial loading, loading multiple at once -// - still fast on x86 (copying globals into locals doesn't help x86) -// - allocates lots of intermediate memory (full size of all components) -// - non-interleaved case requires this anyway -// - allows good upsampling (see next) -// high-quality -// - upsampled channels are bilinearly interpolated, even across blocks -// - quality integer IDCT derived from IJG's 'slow' -// performance -// - fast huffman; reasonable integer IDCT -// - some SIMD kernels for common paths on targets with SSE2/NEON -// - uses a lot of intermediate memory, could cache poorly - -#ifndef STBI_NO_JPEG - -// huffman decoding acceleration -#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache - -typedef struct -{ - stbi_uc fast[1 << FAST_BITS]; - // weirdly, repacking this into AoS is a 10% speed loss, instead of a win - stbi__uint16 code[256]; - stbi_uc values[256]; - stbi_uc size[257]; - unsigned int maxcode[18]; - int delta[17]; // old 'firstsymbol' - old 'firstcode' -} stbi__huffman; - -typedef struct -{ - stbi__context *s; - stbi__huffman huff_dc[4]; - stbi__huffman huff_ac[4]; - stbi_uc dequant[4][64]; - stbi__int16 fast_ac[4][1 << FAST_BITS]; - -// sizes for components, interleaved MCUs - int img_h_max, img_v_max; - int img_mcu_x, img_mcu_y; - int img_mcu_w, img_mcu_h; - -// definition of jpeg image component - struct - { - int id; - int h,v; - int tq; - int hd,ha; - int dc_pred; - - int x,y,w2,h2; - stbi_uc *data; - void *raw_data, *raw_coeff; - stbi_uc *linebuf; - short *coeff; // progressive only - int coeff_w, coeff_h; // number of 8x8 coefficient blocks - } img_comp[4]; - - stbi__uint32 code_buffer; // jpeg entropy-coded buffer - int code_bits; // number of valid bits - unsigned char marker; // marker seen while filling entropy buffer - int nomore; // flag if we saw a marker so must stop - - int progressive; - int spec_start; - int spec_end; - int succ_high; - int succ_low; - int eob_run; - int rgb; - - int scan_n, order[4]; - int restart_interval, todo; - -// kernels - void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]); - void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step); - stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs); -} stbi__jpeg; - -static int stbi__build_huffman(stbi__huffman *h, int *count) -{ - int i,j,k=0,code; - // build size list for each symbol (from JPEG spec) - for (i=0; i < 16; ++i) - for (j=0; j < count[i]; ++j) - h->size[k++] = (stbi_uc) (i+1); - h->size[k] = 0; - - // compute actual symbols (from jpeg spec) - code = 0; - k = 0; - for(j=1; j <= 16; ++j) { - // compute delta to add to code to compute symbol id - h->delta[j] = k - code; - if (h->size[k] == j) { - while (h->size[k] == j) - h->code[k++] = (stbi__uint16) (code++); - if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG"); - } - // compute largest code + 1 for this size, preshifted as needed later - h->maxcode[j] = code << (16-j); - code <<= 1; - } - h->maxcode[j] = 0xffffffff; - - // build non-spec acceleration table; 255 is flag for not-accelerated - memset(h->fast, 255, 1 << FAST_BITS); - for (i=0; i < k; ++i) { - int s = h->size[i]; - if (s <= FAST_BITS) { - int c = h->code[i] << (FAST_BITS-s); - int m = 1 << (FAST_BITS-s); - for (j=0; j < m; ++j) { - h->fast[c+j] = (stbi_uc) i; - } - } - } - return 1; -} - -// build a table that decodes both magnitude and value of small ACs in -// one go. -static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) -{ - int i; - for (i=0; i < (1 << FAST_BITS); ++i) { - stbi_uc fast = h->fast[i]; - fast_ac[i] = 0; - if (fast < 255) { - int rs = h->values[fast]; - int run = (rs >> 4) & 15; - int magbits = rs & 15; - int len = h->size[fast]; - - if (magbits && len + magbits <= FAST_BITS) { - // magnitude code followed by receive_extend code - int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits); - int m = 1 << (magbits - 1); - if (k < m) k += (-1 << magbits) + 1; - // if the result is small enough, we can fit it in fast_ac table - if (k >= -128 && k <= 127) - fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits)); - } - } - } -} - -static void stbi__grow_buffer_unsafe(stbi__jpeg *j) -{ - do { - int b = j->nomore ? 0 : stbi__get8(j->s); - if (b == 0xff) { - int c = stbi__get8(j->s); - if (c != 0) { - j->marker = (unsigned char) c; - j->nomore = 1; - return; - } - } - j->code_buffer |= b << (24 - j->code_bits); - j->code_bits += 8; - } while (j->code_bits <= 24); -} - -// (1 << n) - 1 -static stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; - -// decode a jpeg huffman value from the bitstream -stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) -{ - unsigned int temp; - int c,k; - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - - // look at the top FAST_BITS and determine what symbol ID it is, - // if the code is <= FAST_BITS - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - k = h->fast[c]; - if (k < 255) { - int s = h->size[k]; - if (s > j->code_bits) - return -1; - j->code_buffer <<= s; - j->code_bits -= s; - return h->values[k]; - } - - // naive test is to shift the code_buffer down so k bits are - // valid, then test against maxcode. To speed this up, we've - // preshifted maxcode left so that it has (16-k) 0s at the - // end; in other words, regardless of the number of bits, it - // wants to be compared against something shifted to have 16; - // that way we don't need to shift inside the loop. - temp = j->code_buffer >> 16; - for (k=FAST_BITS+1 ; ; ++k) - if (temp < h->maxcode[k]) - break; - if (k == 17) { - // error! code not found - j->code_bits -= 16; - return -1; - } - - if (k > j->code_bits) - return -1; - - // convert the huffman code to the symbol id - c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; - STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]); - - // convert the id to a symbol - j->code_bits -= k; - j->code_buffer <<= k; - return h->values[c]; -} - -// bias[n] = (-1<code_bits < n) stbi__grow_buffer_unsafe(j); - - sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB - k = stbi_lrot(j->code_buffer, n); - STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask))); - j->code_buffer = k & ~stbi__bmask[n]; - k &= stbi__bmask[n]; - j->code_bits -= n; - return k + (stbi__jbias[n] & ~sgn); -} - -// get some unsigned bits -stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) -{ - unsigned int k; - if (j->code_bits < n) stbi__grow_buffer_unsafe(j); - k = stbi_lrot(j->code_buffer, n); - j->code_buffer = k & ~stbi__bmask[n]; - k &= stbi__bmask[n]; - j->code_bits -= n; - return k; -} - -stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) -{ - unsigned int k; - if (j->code_bits < 1) stbi__grow_buffer_unsafe(j); - k = j->code_buffer; - j->code_buffer <<= 1; - --j->code_bits; - return k & 0x80000000; -} - -// given a value that's at position X in the zigzag stream, -// where does it appear in the 8x8 matrix coded as row-major? -static stbi_uc stbi__jpeg_dezigzag[64+15] = -{ - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - // let corrupt input sample past end - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63 -}; - -// decode one 64-entry block-- -static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant) -{ - int diff,dc,k; - int t; - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - t = stbi__jpeg_huff_decode(j, hdc); - if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - - // 0 all the ac values now so we can do it 32-bits at a time - memset(data,0,64*sizeof(data[0])); - - diff = t ? stbi__extend_receive(j, t) : 0; - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; - data[0] = (short) (dc * dequant[0]); - - // decode AC components, see JPEG spec - k = 1; - do { - unsigned int zig; - int c,r,s; - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - r = fac[c]; - if (r) { // fast-AC path - k += (r >> 4) & 15; // run - s = r & 15; // combined length - j->code_buffer <<= s; - j->code_bits -= s; - // decode into unzigzag'd location - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) ((r >> 8) * dequant[zig]); - } else { - int rs = stbi__jpeg_huff_decode(j, hac); - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (rs != 0xf0) break; // end block - k += 16; - } else { - k += r; - // decode into unzigzag'd location - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]); - } - } - } while (k < 64); - return 1; -} - -static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b) -{ - int diff,dc; - int t; - if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - - if (j->succ_high == 0) { - // first scan for DC coefficient, must be first - memset(data,0,64*sizeof(data[0])); // 0 all the ac values now - t = stbi__jpeg_huff_decode(j, hdc); - diff = t ? stbi__extend_receive(j, t) : 0; - - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; - data[0] = (short) (dc << j->succ_low); - } else { - // refinement scan for DC coefficient - if (stbi__jpeg_get_bit(j)) - data[0] += (short) (1 << j->succ_low); - } - return 1; -} - -// @OPTIMIZE: store non-zigzagged during the decode passes, -// and only de-zigzag when dequantizing -static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac) -{ - int k; - if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - - if (j->succ_high == 0) { - int shift = j->succ_low; - - if (j->eob_run) { - --j->eob_run; - return 1; - } - - k = j->spec_start; - do { - unsigned int zig; - int c,r,s; - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - r = fac[c]; - if (r) { // fast-AC path - k += (r >> 4) & 15; // run - s = r & 15; // combined length - j->code_buffer <<= s; - j->code_bits -= s; - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) ((r >> 8) << shift); - } else { - int rs = stbi__jpeg_huff_decode(j, hac); - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (r < 15) { - j->eob_run = (1 << r); - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); - --j->eob_run; - break; - } - k += 16; - } else { - k += r; - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) (stbi__extend_receive(j,s) << shift); - } - } - } while (k <= j->spec_end); - } else { - // refinement scan for these AC coefficients - - short bit = (short) (1 << j->succ_low); - - if (j->eob_run) { - --j->eob_run; - for (k = j->spec_start; k <= j->spec_end; ++k) { - short *p = &data[stbi__jpeg_dezigzag[k]]; - if (*p != 0) - if (stbi__jpeg_get_bit(j)) - if ((*p & bit)==0) { - if (*p > 0) - *p += bit; - else - *p -= bit; - } - } - } else { - k = j->spec_start; - do { - int r,s; - int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (r < 15) { - j->eob_run = (1 << r) - 1; - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); - r = 64; // force end of block - } else { - // r=15 s=0 should write 16 0s, so we just do - // a run of 15 0s and then write s (which is 0), - // so we don't have to do anything special here - } - } else { - if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG"); - // sign bit - if (stbi__jpeg_get_bit(j)) - s = bit; - else - s = -bit; - } - - // advance by r - while (k <= j->spec_end) { - short *p = &data[stbi__jpeg_dezigzag[k++]]; - if (*p != 0) { - if (stbi__jpeg_get_bit(j)) - if ((*p & bit)==0) { - if (*p > 0) - *p += bit; - else - *p -= bit; - } - } else { - if (r == 0) { - *p = (short) s; - break; - } - --r; - } - } - } while (k <= j->spec_end); - } - } - return 1; -} - -// take a -128..127 value and stbi__clamp it and convert to 0..255 -stbi_inline static stbi_uc stbi__clamp(int x) -{ - // trick to use a single test to catch both cases - if ((unsigned int) x > 255) { - if (x < 0) return 0; - if (x > 255) return 255; - } - return (stbi_uc) x; -} - -#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) -#define stbi__fsh(x) ((x) << 12) - -// derived from jidctint -- DCT_ISLOW -#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ - int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ - p2 = s2; \ - p3 = s6; \ - p1 = (p2+p3) * stbi__f2f(0.5411961f); \ - t2 = p1 + p3*stbi__f2f(-1.847759065f); \ - t3 = p1 + p2*stbi__f2f( 0.765366865f); \ - p2 = s0; \ - p3 = s4; \ - t0 = stbi__fsh(p2+p3); \ - t1 = stbi__fsh(p2-p3); \ - x0 = t0+t3; \ - x3 = t0-t3; \ - x1 = t1+t2; \ - x2 = t1-t2; \ - t0 = s7; \ - t1 = s5; \ - t2 = s3; \ - t3 = s1; \ - p3 = t0+t2; \ - p4 = t1+t3; \ - p1 = t0+t3; \ - p2 = t1+t2; \ - p5 = (p3+p4)*stbi__f2f( 1.175875602f); \ - t0 = t0*stbi__f2f( 0.298631336f); \ - t1 = t1*stbi__f2f( 2.053119869f); \ - t2 = t2*stbi__f2f( 3.072711026f); \ - t3 = t3*stbi__f2f( 1.501321110f); \ - p1 = p5 + p1*stbi__f2f(-0.899976223f); \ - p2 = p5 + p2*stbi__f2f(-2.562915447f); \ - p3 = p3*stbi__f2f(-1.961570560f); \ - p4 = p4*stbi__f2f(-0.390180644f); \ - t3 += p1+p4; \ - t2 += p2+p3; \ - t1 += p2+p4; \ - t0 += p1+p3; - -static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) -{ - int i,val[64],*v=val; - stbi_uc *o; - short *d = data; - - // columns - for (i=0; i < 8; ++i,++d, ++v) { - // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing - if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 - && d[40]==0 && d[48]==0 && d[56]==0) { - // no shortcut 0 seconds - // (1|2|3|4|5|6|7)==0 0 seconds - // all separate -0.047 seconds - // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds - int dcterm = d[0] << 2; - v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; - } else { - STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56]) - // constants scaled things up by 1<<12; let's bring them back - // down, but keep 2 extra bits of precision - x0 += 512; x1 += 512; x2 += 512; x3 += 512; - v[ 0] = (x0+t3) >> 10; - v[56] = (x0-t3) >> 10; - v[ 8] = (x1+t2) >> 10; - v[48] = (x1-t2) >> 10; - v[16] = (x2+t1) >> 10; - v[40] = (x2-t1) >> 10; - v[24] = (x3+t0) >> 10; - v[32] = (x3-t0) >> 10; - } - } - - for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { - // no fast case since the first 1D IDCT spread components out - STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) - // constants scaled things up by 1<<12, plus we had 1<<2 from first - // loop, plus horizontal and vertical each scale by sqrt(8) so together - // we've got an extra 1<<3, so 1<<17 total we need to remove. - // so we want to round that, which means adding 0.5 * 1<<17, - // aka 65536. Also, we'll end up with -128 to 127 that we want - // to encode as 0..255 by adding 128, so we'll add that before the shift - x0 += 65536 + (128<<17); - x1 += 65536 + (128<<17); - x2 += 65536 + (128<<17); - x3 += 65536 + (128<<17); - // tried computing the shifts into temps, or'ing the temps to see - // if any were out of range, but that was slower - o[0] = stbi__clamp((x0+t3) >> 17); - o[7] = stbi__clamp((x0-t3) >> 17); - o[1] = stbi__clamp((x1+t2) >> 17); - o[6] = stbi__clamp((x1-t2) >> 17); - o[2] = stbi__clamp((x2+t1) >> 17); - o[5] = stbi__clamp((x2-t1) >> 17); - o[3] = stbi__clamp((x3+t0) >> 17); - o[4] = stbi__clamp((x3-t0) >> 17); - } -} - -#ifdef STBI_SSE2 -// sse2 integer IDCT. not the fastest possible implementation but it -// produces bit-identical results to the generic C version so it's -// fully "transparent". -static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) -{ - // This is constructed to match our regular (generic) integer IDCT exactly. - __m128i row0, row1, row2, row3, row4, row5, row6, row7; - __m128i tmp; - - // dot product constant: even elems=x, odd elems=y - #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y)) - - // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) - // out(1) = c1[even]*x + c1[odd]*y - #define dct_rot(out0,out1, x,y,c0,c1) \ - __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \ - __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \ - __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ - __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ - __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ - __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) - - // out = in << 12 (in 16-bit, out 32-bit) - #define dct_widen(out, in) \ - __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ - __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) - - // wide add - #define dct_wadd(out, a, b) \ - __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ - __m128i out##_h = _mm_add_epi32(a##_h, b##_h) - - // wide sub - #define dct_wsub(out, a, b) \ - __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ - __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) - - // butterfly a/b, add bias, then shift by "s" and pack - #define dct_bfly32o(out0, out1, a,b,bias,s) \ - { \ - __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ - __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ - dct_wadd(sum, abiased, b); \ - dct_wsub(dif, abiased, b); \ - out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ - out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ - } - - // 8-bit interleave step (for transposes) - #define dct_interleave8(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi8(a, b); \ - b = _mm_unpackhi_epi8(tmp, b) - - // 16-bit interleave step (for transposes) - #define dct_interleave16(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi16(a, b); \ - b = _mm_unpackhi_epi16(tmp, b) - - #define dct_pass(bias,shift) \ - { \ - /* even part */ \ - dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \ - __m128i sum04 = _mm_add_epi16(row0, row4); \ - __m128i dif04 = _mm_sub_epi16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \ - dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \ - __m128i sum17 = _mm_add_epi16(row1, row7); \ - __m128i sum35 = _mm_add_epi16(row3, row5); \ - dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \ - dct_wadd(x4, y0o, y4o); \ - dct_wadd(x5, y1o, y5o); \ - dct_wadd(x6, y2o, y5o); \ - dct_wadd(x7, y3o, y4o); \ - dct_bfly32o(row0,row7, x0,x7,bias,shift); \ - dct_bfly32o(row1,row6, x1,x6,bias,shift); \ - dct_bfly32o(row2,row5, x2,x5,bias,shift); \ - dct_bfly32o(row3,row4, x3,x4,bias,shift); \ - } - - __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); - __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f)); - __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f)); - __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f)); - __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f)); - __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f)); - __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f)); - __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f)); - - // rounding biases in column/row passes, see stbi__idct_block for explanation. - __m128i bias_0 = _mm_set1_epi32(512); - __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17)); - - // load - row0 = _mm_load_si128((const __m128i *) (data + 0*8)); - row1 = _mm_load_si128((const __m128i *) (data + 1*8)); - row2 = _mm_load_si128((const __m128i *) (data + 2*8)); - row3 = _mm_load_si128((const __m128i *) (data + 3*8)); - row4 = _mm_load_si128((const __m128i *) (data + 4*8)); - row5 = _mm_load_si128((const __m128i *) (data + 5*8)); - row6 = _mm_load_si128((const __m128i *) (data + 6*8)); - row7 = _mm_load_si128((const __m128i *) (data + 7*8)); - - // column pass - dct_pass(bias_0, 10); - - { - // 16bit 8x8 transpose pass 1 - dct_interleave16(row0, row4); - dct_interleave16(row1, row5); - dct_interleave16(row2, row6); - dct_interleave16(row3, row7); - - // transpose pass 2 - dct_interleave16(row0, row2); - dct_interleave16(row1, row3); - dct_interleave16(row4, row6); - dct_interleave16(row5, row7); - - // transpose pass 3 - dct_interleave16(row0, row1); - dct_interleave16(row2, row3); - dct_interleave16(row4, row5); - dct_interleave16(row6, row7); - } - - // row pass - dct_pass(bias_1, 17); - - { - // pack - __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7 - __m128i p1 = _mm_packus_epi16(row2, row3); - __m128i p2 = _mm_packus_epi16(row4, row5); - __m128i p3 = _mm_packus_epi16(row6, row7); - - // 8bit 8x8 transpose pass 1 - dct_interleave8(p0, p2); // a0e0a1e1... - dct_interleave8(p1, p3); // c0g0c1g1... - - // transpose pass 2 - dct_interleave8(p0, p1); // a0c0e0g0... - dct_interleave8(p2, p3); // b0d0f0h0... - - // transpose pass 3 - dct_interleave8(p0, p2); // a0b0c0d0... - dct_interleave8(p1, p3); // a4b4c4d4... - - // store - _mm_storel_epi64((__m128i *) out, p0); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p2); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p1); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p3); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e)); - } - -#undef dct_const -#undef dct_rot -#undef dct_widen -#undef dct_wadd -#undef dct_wsub -#undef dct_bfly32o -#undef dct_interleave8 -#undef dct_interleave16 -#undef dct_pass -} - -#endif // STBI_SSE2 - -#ifdef STBI_NEON - -// NEON integer IDCT. should produce bit-identical -// results to the generic C version. -static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) -{ - int16x8_t row0, row1, row2, row3, row4, row5, row6, row7; - - int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f)); - int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f)); - int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f)); - int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f)); - int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f)); - int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f)); - int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f)); - int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f)); - int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f)); - int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f)); - int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f)); - int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f)); - -#define dct_long_mul(out, inq, coeff) \ - int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ - int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) - -#define dct_long_mac(out, acc, inq, coeff) \ - int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ - int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) - -#define dct_widen(out, inq) \ - int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ - int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) - -// wide add -#define dct_wadd(out, a, b) \ - int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ - int32x4_t out##_h = vaddq_s32(a##_h, b##_h) - -// wide sub -#define dct_wsub(out, a, b) \ - int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ - int32x4_t out##_h = vsubq_s32(a##_h, b##_h) - -// butterfly a/b, then shift using "shiftop" by "s" and pack -#define dct_bfly32o(out0,out1, a,b,shiftop,s) \ - { \ - dct_wadd(sum, a, b); \ - dct_wsub(dif, a, b); \ - out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ - out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ - } - -#define dct_pass(shiftop, shift) \ - { \ - /* even part */ \ - int16x8_t sum26 = vaddq_s16(row2, row6); \ - dct_long_mul(p1e, sum26, rot0_0); \ - dct_long_mac(t2e, p1e, row6, rot0_1); \ - dct_long_mac(t3e, p1e, row2, rot0_2); \ - int16x8_t sum04 = vaddq_s16(row0, row4); \ - int16x8_t dif04 = vsubq_s16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - int16x8_t sum15 = vaddq_s16(row1, row5); \ - int16x8_t sum17 = vaddq_s16(row1, row7); \ - int16x8_t sum35 = vaddq_s16(row3, row5); \ - int16x8_t sum37 = vaddq_s16(row3, row7); \ - int16x8_t sumodd = vaddq_s16(sum17, sum35); \ - dct_long_mul(p5o, sumodd, rot1_0); \ - dct_long_mac(p1o, p5o, sum17, rot1_1); \ - dct_long_mac(p2o, p5o, sum35, rot1_2); \ - dct_long_mul(p3o, sum37, rot2_0); \ - dct_long_mul(p4o, sum15, rot2_1); \ - dct_wadd(sump13o, p1o, p3o); \ - dct_wadd(sump24o, p2o, p4o); \ - dct_wadd(sump23o, p2o, p3o); \ - dct_wadd(sump14o, p1o, p4o); \ - dct_long_mac(x4, sump13o, row7, rot3_0); \ - dct_long_mac(x5, sump24o, row5, rot3_1); \ - dct_long_mac(x6, sump23o, row3, rot3_2); \ - dct_long_mac(x7, sump14o, row1, rot3_3); \ - dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \ - dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \ - dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \ - dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \ - } - - // load - row0 = vld1q_s16(data + 0*8); - row1 = vld1q_s16(data + 1*8); - row2 = vld1q_s16(data + 2*8); - row3 = vld1q_s16(data + 3*8); - row4 = vld1q_s16(data + 4*8); - row5 = vld1q_s16(data + 5*8); - row6 = vld1q_s16(data + 6*8); - row7 = vld1q_s16(data + 7*8); - - // add DC bias - row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0)); - - // column pass - dct_pass(vrshrn_n_s32, 10); - - // 16bit 8x8 transpose - { -// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. -// whether compilers actually get this is another story, sadly. -#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; } -#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); } -#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); } - - // pass 1 - dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6 - dct_trn16(row2, row3); - dct_trn16(row4, row5); - dct_trn16(row6, row7); - - // pass 2 - dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4 - dct_trn32(row1, row3); - dct_trn32(row4, row6); - dct_trn32(row5, row7); - - // pass 3 - dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0 - dct_trn64(row1, row5); - dct_trn64(row2, row6); - dct_trn64(row3, row7); - -#undef dct_trn16 -#undef dct_trn32 -#undef dct_trn64 - } - - // row pass - // vrshrn_n_s32 only supports shifts up to 16, we need - // 17. so do a non-rounding shift of 16 first then follow - // up with a rounding shift by 1. - dct_pass(vshrn_n_s32, 16); - - { - // pack and round - uint8x8_t p0 = vqrshrun_n_s16(row0, 1); - uint8x8_t p1 = vqrshrun_n_s16(row1, 1); - uint8x8_t p2 = vqrshrun_n_s16(row2, 1); - uint8x8_t p3 = vqrshrun_n_s16(row3, 1); - uint8x8_t p4 = vqrshrun_n_s16(row4, 1); - uint8x8_t p5 = vqrshrun_n_s16(row5, 1); - uint8x8_t p6 = vqrshrun_n_s16(row6, 1); - uint8x8_t p7 = vqrshrun_n_s16(row7, 1); - - // again, these can translate into one instruction, but often don't. -#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; } -#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); } -#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); } - - // sadly can't use interleaved stores here since we only write - // 8 bytes to each scan line! - - // 8x8 8-bit transpose pass 1 - dct_trn8_8(p0, p1); - dct_trn8_8(p2, p3); - dct_trn8_8(p4, p5); - dct_trn8_8(p6, p7); - - // pass 2 - dct_trn8_16(p0, p2); - dct_trn8_16(p1, p3); - dct_trn8_16(p4, p6); - dct_trn8_16(p5, p7); - - // pass 3 - dct_trn8_32(p0, p4); - dct_trn8_32(p1, p5); - dct_trn8_32(p2, p6); - dct_trn8_32(p3, p7); - - // store - vst1_u8(out, p0); out += out_stride; - vst1_u8(out, p1); out += out_stride; - vst1_u8(out, p2); out += out_stride; - vst1_u8(out, p3); out += out_stride; - vst1_u8(out, p4); out += out_stride; - vst1_u8(out, p5); out += out_stride; - vst1_u8(out, p6); out += out_stride; - vst1_u8(out, p7); - -#undef dct_trn8_8 -#undef dct_trn8_16 -#undef dct_trn8_32 - } - -#undef dct_long_mul -#undef dct_long_mac -#undef dct_widen -#undef dct_wadd -#undef dct_wsub -#undef dct_bfly32o -#undef dct_pass -} - -#endif // STBI_NEON - -#define STBI__MARKER_none 0xff -// if there's a pending marker from the entropy stream, return that -// otherwise, fetch from the stream and get a marker. if there's no -// marker, return 0xff, which is never a valid marker value -static stbi_uc stbi__get_marker(stbi__jpeg *j) -{ - stbi_uc x; - if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; } - x = stbi__get8(j->s); - if (x != 0xff) return STBI__MARKER_none; - while (x == 0xff) - x = stbi__get8(j->s); - return x; -} - -// in each scan, we'll have scan_n components, and the order -// of the components is specified by order[] -#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) - -// after a restart interval, stbi__jpeg_reset the entropy decoder and -// the dc prediction -static void stbi__jpeg_reset(stbi__jpeg *j) -{ - j->code_bits = 0; - j->code_buffer = 0; - j->nomore = 0; - j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0; - j->marker = STBI__MARKER_none; - j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; - j->eob_run = 0; - // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, - // since we don't even allow 1<<30 pixels -} - -static int stbi__parse_entropy_coded_data(stbi__jpeg *z) -{ - stbi__jpeg_reset(z); - if (!z->progressive) { - if (z->scan_n == 1) { - int i,j; - STBI_SIMD_ALIGN(short, data[64]); - int n = z->order[0]; - // non-interleaved data, we just need to process one block at a time, - // in trivial scanline order - // number of blocks to do just depends on how many actual "pixels" this - // component has, independent of interleaved MCU blocking and such - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); - // every data block is an MCU, so countdown the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - // if it's NOT a restart, then just bail, so we get corrupt data - // rather than no data - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } else { // interleaved - int i,j,k,x,y; - STBI_SIMD_ALIGN(short, data[64]); - for (j=0; j < z->img_mcu_y; ++j) { - for (i=0; i < z->img_mcu_x; ++i) { - // scan an interleaved mcu... process scan_n components in order - for (k=0; k < z->scan_n; ++k) { - int n = z->order[k]; - // scan out an mcu's worth of this component; that's just determined - // by the basic H and V specified for the component - for (y=0; y < z->img_comp[n].v; ++y) { - for (x=0; x < z->img_comp[n].h; ++x) { - int x2 = (i*z->img_comp[n].h + x)*8; - int y2 = (j*z->img_comp[n].v + y)*8; - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data); - } - } - } - // after all interleaved components, that's an interleaved MCU, - // so now count down the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } - } else { - if (z->scan_n == 1) { - int i,j; - int n = z->order[0]; - // non-interleaved data, we just need to process one block at a time, - // in trivial scanline order - // number of blocks to do just depends on how many actual "pixels" this - // component has, independent of interleaved MCU blocking and such - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); - if (z->spec_start == 0) { - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; - } else { - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) - return 0; - } - // every data block is an MCU, so countdown the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } else { // interleaved - int i,j,k,x,y; - for (j=0; j < z->img_mcu_y; ++j) { - for (i=0; i < z->img_mcu_x; ++i) { - // scan an interleaved mcu... process scan_n components in order - for (k=0; k < z->scan_n; ++k) { - int n = z->order[k]; - // scan out an mcu's worth of this component; that's just determined - // by the basic H and V specified for the component - for (y=0; y < z->img_comp[n].v; ++y) { - for (x=0; x < z->img_comp[n].h; ++x) { - int x2 = (i*z->img_comp[n].h + x); - int y2 = (j*z->img_comp[n].v + y); - short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; - } - } - } - // after all interleaved components, that's an interleaved MCU, - // so now count down the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } - } -} - -static void stbi__jpeg_dequantize(short *data, stbi_uc *dequant) -{ - int i; - for (i=0; i < 64; ++i) - data[i] *= dequant[i]; -} - -static void stbi__jpeg_finish(stbi__jpeg *z) -{ - if (z->progressive) { - // dequantize and idct the data - int i,j,n; - for (n=0; n < z->s->img_n; ++n) { - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); - stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]); - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); - } - } - } - } -} - -static int stbi__process_marker(stbi__jpeg *z, int m) -{ - int L; - switch (m) { - case STBI__MARKER_none: // no marker found - return stbi__err("expected marker","Corrupt JPEG"); - - case 0xDD: // DRI - specify restart interval - if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG"); - z->restart_interval = stbi__get16be(z->s); - return 1; - - case 0xDB: // DQT - define quantization table - L = stbi__get16be(z->s)-2; - while (L > 0) { - int q = stbi__get8(z->s); - int p = q >> 4; - int t = q & 15,i; - if (p != 0) return stbi__err("bad DQT type","Corrupt JPEG"); - if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG"); - for (i=0; i < 64; ++i) - z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s); - L -= 65; - } - return L==0; - - case 0xC4: // DHT - define huffman table - L = stbi__get16be(z->s)-2; - while (L > 0) { - stbi_uc *v; - int sizes[16],i,n=0; - int q = stbi__get8(z->s); - int tc = q >> 4; - int th = q & 15; - if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG"); - for (i=0; i < 16; ++i) { - sizes[i] = stbi__get8(z->s); - n += sizes[i]; - } - L -= 17; - if (tc == 0) { - if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0; - v = z->huff_dc[th].values; - } else { - if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0; - v = z->huff_ac[th].values; - } - for (i=0; i < n; ++i) - v[i] = stbi__get8(z->s); - if (tc != 0) - stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); - L -= n; - } - return L==0; - } - // check for comment block or APP blocks - if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { - stbi__skip(z->s, stbi__get16be(z->s)-2); - return 1; - } - return 0; -} - -// after we see SOS -static int stbi__process_scan_header(stbi__jpeg *z) -{ - int i; - int Ls = stbi__get16be(z->s); - z->scan_n = stbi__get8(z->s); - if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG"); - if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG"); - for (i=0; i < z->scan_n; ++i) { - int id = stbi__get8(z->s), which; - int q = stbi__get8(z->s); - for (which = 0; which < z->s->img_n; ++which) - if (z->img_comp[which].id == id) - break; - if (which == z->s->img_n) return 0; // no match - z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG"); - z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG"); - z->order[i] = which; - } - - { - int aa; - z->spec_start = stbi__get8(z->s); - z->spec_end = stbi__get8(z->s); // should be 63, but might be 0 - aa = stbi__get8(z->s); - z->succ_high = (aa >> 4); - z->succ_low = (aa & 15); - if (z->progressive) { - if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13) - return stbi__err("bad SOS", "Corrupt JPEG"); - } else { - if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG"); - if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG"); - z->spec_end = 63; - } - } - - return 1; -} - -static int stbi__process_frame_header(stbi__jpeg *z, int scan) -{ - stbi__context *s = z->s; - int Lf,p,i,q, h_max=1,v_max=1,c; - Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG - p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline - s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG - s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires - c = stbi__get8(s); - if (c != 3 && c != 1) return stbi__err("bad component count","Corrupt JPEG"); // JFIF requires - s->img_n = c; - for (i=0; i < c; ++i) { - z->img_comp[i].data = NULL; - z->img_comp[i].linebuf = NULL; - } - - if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG"); - - z->rgb = 0; - for (i=0; i < s->img_n; ++i) { - static unsigned char rgb[3] = { 'R', 'G', 'B' }; - z->img_comp[i].id = stbi__get8(s); - if (z->img_comp[i].id != i+1) // JFIF requires - if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files! - // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format) - if (z->img_comp[i].id != rgb[i]) - return stbi__err("bad component ID","Corrupt JPEG"); - ++z->rgb; - } - q = stbi__get8(s); - z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG"); - z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG"); - z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG"); - } - - if (scan != STBI__SCAN_load) return 1; - - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); - - for (i=0; i < s->img_n; ++i) { - if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; - if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; - } - - // compute interleaved mcu info - z->img_h_max = h_max; - z->img_v_max = v_max; - z->img_mcu_w = h_max * 8; - z->img_mcu_h = v_max * 8; - z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; - z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; - - for (i=0; i < s->img_n; ++i) { - // number of effective pixels (e.g. for non-interleaved MCU) - z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; - z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; - // to simplify generation, we'll allocate enough memory to decode - // the bogus oversized data from using interleaved MCUs and their - // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't - // discard the extra data until colorspace conversion - z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; - z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; - z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); - - if (z->img_comp[i].raw_data == NULL) { - for(--i; i >= 0; --i) { - STBI_FREE(z->img_comp[i].raw_data); - z->img_comp[i].raw_data = NULL; - } - return stbi__err("outofmem", "Out of memory"); - } - // align blocks for idct using mmx/sse - z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); - z->img_comp[i].linebuf = NULL; - if (z->progressive) { - z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3; - z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3; - z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15); - z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); - } else { - z->img_comp[i].coeff = 0; - z->img_comp[i].raw_coeff = 0; - } - } - - return 1; -} - -// use comparisons since in some cases we handle more than one case (e.g. SOF) -#define stbi__DNL(x) ((x) == 0xdc) -#define stbi__SOI(x) ((x) == 0xd8) -#define stbi__EOI(x) ((x) == 0xd9) -#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2) -#define stbi__SOS(x) ((x) == 0xda) - -#define stbi__SOF_progressive(x) ((x) == 0xc2) - -static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) -{ - int m; - z->marker = STBI__MARKER_none; // initialize cached marker to empty - m = stbi__get_marker(z); - if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG"); - if (scan == STBI__SCAN_type) return 1; - m = stbi__get_marker(z); - while (!stbi__SOF(m)) { - if (!stbi__process_marker(z,m)) return 0; - m = stbi__get_marker(z); - while (m == STBI__MARKER_none) { - // some files have extra padding after their blocks, so ok, we'll scan - if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG"); - m = stbi__get_marker(z); - } - } - z->progressive = stbi__SOF_progressive(m); - if (!stbi__process_frame_header(z, scan)) return 0; - return 1; -} - -// decode image to YCbCr format -static int stbi__decode_jpeg_image(stbi__jpeg *j) -{ - int m; - for (m = 0; m < 4; m++) { - j->img_comp[m].raw_data = NULL; - j->img_comp[m].raw_coeff = NULL; - } - j->restart_interval = 0; - if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0; - m = stbi__get_marker(j); - while (!stbi__EOI(m)) { - if (stbi__SOS(m)) { - if (!stbi__process_scan_header(j)) return 0; - if (!stbi__parse_entropy_coded_data(j)) return 0; - if (j->marker == STBI__MARKER_none ) { - // handle 0s at the end of image data from IP Kamera 9060 - while (!stbi__at_eof(j->s)) { - int x = stbi__get8(j->s); - if (x == 255) { - j->marker = stbi__get8(j->s); - break; - } else if (x != 0) { - return stbi__err("junk before marker", "Corrupt JPEG"); - } - } - // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0 - } - } else { - if (!stbi__process_marker(j, m)) return 0; - } - m = stbi__get_marker(j); - } - if (j->progressive) - stbi__jpeg_finish(j); - return 1; -} - -// static jfif-centered resampling (across block boundaries) - -typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, - int w, int hs); - -#define stbi__div4(x) ((stbi_uc) ((x) >> 2)) - -static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - STBI_NOTUSED(out); - STBI_NOTUSED(in_far); - STBI_NOTUSED(w); - STBI_NOTUSED(hs); - return in_near; -} - -static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate two samples vertically for every one in input - int i; - STBI_NOTUSED(hs); - for (i=0; i < w; ++i) - out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2); - return out; -} - -static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate two samples horizontally for every one in input - int i; - stbi_uc *input = in_near; - - if (w == 1) { - // if only one sample, can't do any interpolation - out[0] = out[1] = input[0]; - return out; - } - - out[0] = input[0]; - out[1] = stbi__div4(input[0]*3 + input[1] + 2); - for (i=1; i < w-1; ++i) { - int n = 3*input[i]+2; - out[i*2+0] = stbi__div4(n+input[i-1]); - out[i*2+1] = stbi__div4(n+input[i+1]); - } - out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2); - out[i*2+1] = input[w-1]; - - STBI_NOTUSED(in_far); - STBI_NOTUSED(hs); - - return out; -} - -#define stbi__div16(x) ((stbi_uc) ((x) >> 4)) - -static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate 2x2 samples for every one in input - int i,t0,t1; - if (w == 1) { - out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); - return out; - } - - t1 = 3*in_near[0] + in_far[0]; - out[0] = stbi__div4(t1+2); - for (i=1; i < w; ++i) { - t0 = t1; - t1 = 3*in_near[i]+in_far[i]; - out[i*2-1] = stbi__div16(3*t0 + t1 + 8); - out[i*2 ] = stbi__div16(3*t1 + t0 + 8); - } - out[w*2-1] = stbi__div4(t1+2); - - STBI_NOTUSED(hs); - - return out; -} - -#if defined(STBI_SSE2) || defined(STBI_NEON) -static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate 2x2 samples for every one in input - int i=0,t0,t1; - - if (w == 1) { - out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); - return out; - } - - t1 = 3*in_near[0] + in_far[0]; - // process groups of 8 pixels for as long as we can. - // note we can't handle the last pixel in a row in this loop - // because we need to handle the filter boundary conditions. - for (; i < ((w-1) & ~7); i += 8) { -#if defined(STBI_SSE2) - // load and perform the vertical filtering pass - // this uses 3*x + y = 4*x + (y - x) - __m128i zero = _mm_setzero_si128(); - __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i)); - __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i)); - __m128i farw = _mm_unpacklo_epi8(farb, zero); - __m128i nearw = _mm_unpacklo_epi8(nearb, zero); - __m128i diff = _mm_sub_epi16(farw, nearw); - __m128i nears = _mm_slli_epi16(nearw, 2); - __m128i curr = _mm_add_epi16(nears, diff); // current row - - // horizontal filter works the same based on shifted vers of current - // row. "prev" is current row shifted right by 1 pixel; we need to - // insert the previous pixel value (from t1). - // "next" is current row shifted left by 1 pixel, with first pixel - // of next block of 8 pixels added in. - __m128i prv0 = _mm_slli_si128(curr, 2); - __m128i nxt0 = _mm_srli_si128(curr, 2); - __m128i prev = _mm_insert_epi16(prv0, t1, 0); - __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7); - - // horizontal filter, polyphase implementation since it's convenient: - // even pixels = 3*cur + prev = cur*4 + (prev - cur) - // odd pixels = 3*cur + next = cur*4 + (next - cur) - // note the shared term. - __m128i bias = _mm_set1_epi16(8); - __m128i curs = _mm_slli_epi16(curr, 2); - __m128i prvd = _mm_sub_epi16(prev, curr); - __m128i nxtd = _mm_sub_epi16(next, curr); - __m128i curb = _mm_add_epi16(curs, bias); - __m128i even = _mm_add_epi16(prvd, curb); - __m128i odd = _mm_add_epi16(nxtd, curb); - - // interleave even and odd pixels, then undo scaling. - __m128i int0 = _mm_unpacklo_epi16(even, odd); - __m128i int1 = _mm_unpackhi_epi16(even, odd); - __m128i de0 = _mm_srli_epi16(int0, 4); - __m128i de1 = _mm_srli_epi16(int1, 4); - - // pack and write output - __m128i outv = _mm_packus_epi16(de0, de1); - _mm_storeu_si128((__m128i *) (out + i*2), outv); -#elif defined(STBI_NEON) - // load and perform the vertical filtering pass - // this uses 3*x + y = 4*x + (y - x) - uint8x8_t farb = vld1_u8(in_far + i); - uint8x8_t nearb = vld1_u8(in_near + i); - int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb)); - int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2)); - int16x8_t curr = vaddq_s16(nears, diff); // current row - - // horizontal filter works the same based on shifted vers of current - // row. "prev" is current row shifted right by 1 pixel; we need to - // insert the previous pixel value (from t1). - // "next" is current row shifted left by 1 pixel, with first pixel - // of next block of 8 pixels added in. - int16x8_t prv0 = vextq_s16(curr, curr, 7); - int16x8_t nxt0 = vextq_s16(curr, curr, 1); - int16x8_t prev = vsetq_lane_s16(t1, prv0, 0); - int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7); - - // horizontal filter, polyphase implementation since it's convenient: - // even pixels = 3*cur + prev = cur*4 + (prev - cur) - // odd pixels = 3*cur + next = cur*4 + (next - cur) - // note the shared term. - int16x8_t curs = vshlq_n_s16(curr, 2); - int16x8_t prvd = vsubq_s16(prev, curr); - int16x8_t nxtd = vsubq_s16(next, curr); - int16x8_t even = vaddq_s16(curs, prvd); - int16x8_t odd = vaddq_s16(curs, nxtd); - - // undo scaling and round, then store with even/odd phases interleaved - uint8x8x2_t o; - o.val[0] = vqrshrun_n_s16(even, 4); - o.val[1] = vqrshrun_n_s16(odd, 4); - vst2_u8(out + i*2, o); -#endif - - // "previous" value for next iter - t1 = 3*in_near[i+7] + in_far[i+7]; - } - - t0 = t1; - t1 = 3*in_near[i] + in_far[i]; - out[i*2] = stbi__div16(3*t1 + t0 + 8); - - for (++i; i < w; ++i) { - t0 = t1; - t1 = 3*in_near[i]+in_far[i]; - out[i*2-1] = stbi__div16(3*t0 + t1 + 8); - out[i*2 ] = stbi__div16(3*t1 + t0 + 8); - } - out[w*2-1] = stbi__div4(t1+2); - - STBI_NOTUSED(hs); - - return out; -} -#endif - -static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // resample with nearest-neighbor - int i,j; - STBI_NOTUSED(in_far); - for (i=0; i < w; ++i) - for (j=0; j < hs; ++j) - out[i*hs+j] = in_near[i]; - return out; -} - -#ifdef STBI_JPEG_OLD -// this is the same YCbCr-to-RGB calculation that stb_image has used -// historically before the algorithm changes in 1.49 -#define float2fixed(x) ((int) ((x) * 65536 + 0.5)) -static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) -{ - int i; - for (i=0; i < count; ++i) { - int y_fixed = (y[i] << 16) + 32768; // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr*float2fixed(1.40200f); - g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f); - b = y_fixed + cb*float2fixed(1.77200f); - r >>= 16; - g >>= 16; - b >>= 16; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (stbi_uc)r; - out[1] = (stbi_uc)g; - out[2] = (stbi_uc)b; - out[3] = 255; - out += step; - } -} -#else -// this is a reduced-precision calculation of YCbCr-to-RGB introduced -// to make sure the code produces the same results in both SIMD and scalar -#define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) -static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) -{ - int i; - for (i=0; i < count; ++i) { - int y_fixed = (y[i] << 20) + (1<<19); // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr* float2fixed(1.40200f); - g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); - b = y_fixed + cb* float2fixed(1.77200f); - r >>= 20; - g >>= 20; - b >>= 20; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (stbi_uc)r; - out[1] = (stbi_uc)g; - out[2] = (stbi_uc)b; - out[3] = 255; - out += step; - } -} -#endif - -#if defined(STBI_SSE2) || defined(STBI_NEON) -static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step) -{ - int i = 0; - -#ifdef STBI_SSE2 - // step == 3 is pretty ugly on the final interleave, and i'm not convinced - // it's useful in practice (you wouldn't use it for textures, for example). - // so just accelerate step == 4 case. - if (step == 4) { - // this is a fairly straightforward implementation and not super-optimized. - __m128i signflip = _mm_set1_epi8(-0x80); - __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f)); - __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f)); - __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f)); - __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f)); - __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128); - __m128i xw = _mm_set1_epi16(255); // alpha channel - - for (; i+7 < count; i += 8) { - // load - __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i)); - __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i)); - __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i)); - __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128 - __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128 - - // unpack to short (and left-shift cr, cb by 8) - __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes); - __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased); - __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased); - - // color transform - __m128i yws = _mm_srli_epi16(yw, 4); - __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw); - __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw); - __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1); - __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1); - __m128i rws = _mm_add_epi16(cr0, yws); - __m128i gwt = _mm_add_epi16(cb0, yws); - __m128i bws = _mm_add_epi16(yws, cb1); - __m128i gws = _mm_add_epi16(gwt, cr1); - - // descale - __m128i rw = _mm_srai_epi16(rws, 4); - __m128i bw = _mm_srai_epi16(bws, 4); - __m128i gw = _mm_srai_epi16(gws, 4); - - // back to byte, set up for transpose - __m128i brb = _mm_packus_epi16(rw, bw); - __m128i gxb = _mm_packus_epi16(gw, xw); - - // transpose to interleave channels - __m128i t0 = _mm_unpacklo_epi8(brb, gxb); - __m128i t1 = _mm_unpackhi_epi8(brb, gxb); - __m128i o0 = _mm_unpacklo_epi16(t0, t1); - __m128i o1 = _mm_unpackhi_epi16(t0, t1); - - // store - _mm_storeu_si128((__m128i *) (out + 0), o0); - _mm_storeu_si128((__m128i *) (out + 16), o1); - out += 32; - } - } -#endif - -#ifdef STBI_NEON - // in this version, step=3 support would be easy to add. but is there demand? - if (step == 4) { - // this is a fairly straightforward implementation and not super-optimized. - uint8x8_t signflip = vdup_n_u8(0x80); - int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f)); - int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f)); - int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f)); - int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f)); - - for (; i+7 < count; i += 8) { - // load - uint8x8_t y_bytes = vld1_u8(y + i); - uint8x8_t cr_bytes = vld1_u8(pcr + i); - uint8x8_t cb_bytes = vld1_u8(pcb + i); - int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip)); - int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip)); - - // expand to s16 - int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4)); - int16x8_t crw = vshll_n_s8(cr_biased, 7); - int16x8_t cbw = vshll_n_s8(cb_biased, 7); - - // color transform - int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0); - int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0); - int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1); - int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1); - int16x8_t rws = vaddq_s16(yws, cr0); - int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1); - int16x8_t bws = vaddq_s16(yws, cb1); - - // undo scaling, round, convert to byte - uint8x8x4_t o; - o.val[0] = vqrshrun_n_s16(rws, 4); - o.val[1] = vqrshrun_n_s16(gws, 4); - o.val[2] = vqrshrun_n_s16(bws, 4); - o.val[3] = vdup_n_u8(255); - - // store, interleaving r/g/b/a - vst4_u8(out, o); - out += 8*4; - } - } -#endif - - for (; i < count; ++i) { - int y_fixed = (y[i] << 20) + (1<<19); // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr* float2fixed(1.40200f); - g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000); - b = y_fixed + cb* float2fixed(1.77200f); - r >>= 20; - g >>= 20; - b >>= 20; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (stbi_uc)r; - out[1] = (stbi_uc)g; - out[2] = (stbi_uc)b; - out[3] = 255; - out += step; - } -} -#endif - -// set up the kernels -static void stbi__setup_jpeg(stbi__jpeg *j) -{ - j->idct_block_kernel = stbi__idct_block; - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row; - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2; - -#ifdef STBI_SSE2 - if (stbi__sse2_available()) { - j->idct_block_kernel = stbi__idct_simd; - #ifndef STBI_JPEG_OLD - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; - #endif - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; - } -#endif - -#ifdef STBI_NEON - j->idct_block_kernel = stbi__idct_simd; - #ifndef STBI_JPEG_OLD - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; - #endif - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; -#endif -} - -// clean up the temporary component buffers -static void stbi__cleanup_jpeg(stbi__jpeg *j) -{ - int i; - for (i=0; i < j->s->img_n; ++i) { - if (j->img_comp[i].raw_data) { - STBI_FREE(j->img_comp[i].raw_data); - j->img_comp[i].raw_data = NULL; - j->img_comp[i].data = NULL; - } - if (j->img_comp[i].raw_coeff) { - STBI_FREE(j->img_comp[i].raw_coeff); - j->img_comp[i].raw_coeff = 0; - j->img_comp[i].coeff = 0; - } - if (j->img_comp[i].linebuf) { - STBI_FREE(j->img_comp[i].linebuf); - j->img_comp[i].linebuf = NULL; - } - } -} - -typedef struct -{ - resample_row_func resample; - stbi_uc *line0,*line1; - int hs,vs; // expansion factor in each axis - int w_lores; // horizontal pixels pre-expansion - int ystep; // how far through vertical expansion we are - int ypos; // which pre-expansion row we're on -} stbi__resample; - -static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) -{ - int n, decode_n; - z->s->img_n = 0; // make stbi__cleanup_jpeg safe - - // validate req_comp - if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); - - // load a jpeg image from whichever source, but leave in YCbCr format - if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; } - - // determine actual number of components to generate - n = req_comp ? req_comp : z->s->img_n; - - if (z->s->img_n == 3 && n < 3) - decode_n = 1; - else - decode_n = z->s->img_n; - - // resample and color-convert - { - int k; - unsigned int i,j; - stbi_uc *output; - stbi_uc *coutput[4]; - - stbi__resample res_comp[4]; - - for (k=0; k < decode_n; ++k) { - stbi__resample *r = &res_comp[k]; - - // allocate line buffer big enough for upsampling off the edges - // with upsample factor of 4 - z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3); - if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } - - r->hs = z->img_h_max / z->img_comp[k].h; - r->vs = z->img_v_max / z->img_comp[k].v; - r->ystep = r->vs >> 1; - r->w_lores = (z->s->img_x + r->hs-1) / r->hs; - r->ypos = 0; - r->line0 = r->line1 = z->img_comp[k].data; - - if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; - else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; - else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2; - else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel; - else r->resample = stbi__resample_row_generic; - } - - // can't error after this so, this is safe - output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1); - if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } - - // now go ahead and resample - for (j=0; j < z->s->img_y; ++j) { - stbi_uc *out = output + n * z->s->img_x * j; - for (k=0; k < decode_n; ++k) { - stbi__resample *r = &res_comp[k]; - int y_bot = r->ystep >= (r->vs >> 1); - coutput[k] = r->resample(z->img_comp[k].linebuf, - y_bot ? r->line1 : r->line0, - y_bot ? r->line0 : r->line1, - r->w_lores, r->hs); - if (++r->ystep >= r->vs) { - r->ystep = 0; - r->line0 = r->line1; - if (++r->ypos < z->img_comp[k].y) - r->line1 += z->img_comp[k].w2; - } - } - if (n >= 3) { - stbi_uc *y = coutput[0]; - if (z->s->img_n == 3) { - if (z->rgb == 3) { - for (i=0; i < z->s->img_x; ++i) { - out[0] = y[i]; - out[1] = coutput[1][i]; - out[2] = coutput[2][i]; - out[3] = 255; - out += n; - } - } else { - z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); - } - } else - for (i=0; i < z->s->img_x; ++i) { - out[0] = out[1] = out[2] = y[i]; - out[3] = 255; // not used if n==3 - out += n; - } - } else { - stbi_uc *y = coutput[0]; - if (n == 1) - for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; - else - for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255; - } - } - stbi__cleanup_jpeg(z); - *out_x = z->s->img_x; - *out_y = z->s->img_y; - if (comp) *comp = z->s->img_n; // report original components, not output - return output; - } -} - -static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - unsigned char* result; - stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); - j->s = s; - stbi__setup_jpeg(j); - result = load_jpeg_image(j, x,y,comp,req_comp); - STBI_FREE(j); - return result; -} - -static int stbi__jpeg_test(stbi__context *s) -{ - int r; - stbi__jpeg j; - j.s = s; - stbi__setup_jpeg(&j); - r = stbi__decode_jpeg_header(&j, STBI__SCAN_type); - stbi__rewind(s); - return r; -} - -static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp) -{ - if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) { - stbi__rewind( j->s ); - return 0; - } - if (x) *x = j->s->img_x; - if (y) *y = j->s->img_y; - if (comp) *comp = j->s->img_n; - return 1; -} - -static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) -{ - int result; - stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); - j->s = s; - result = stbi__jpeg_info_raw(j, x, y, comp); - STBI_FREE(j); - return result; -} -#endif - -// public domain zlib decode v0.2 Sean Barrett 2006-11-18 -// simple implementation -// - all input must be provided in an upfront buffer -// - all output is written to a single output buffer (can malloc/realloc) -// performance -// - fast huffman - -#ifndef STBI_NO_ZLIB - -// fast-way is faster to check than jpeg huffman, but slow way is slower -#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables -#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) - -// zlib-style huffman encoding -// (jpegs packs from left, zlib from right, so can't share code) -typedef struct -{ - stbi__uint16 fast[1 << STBI__ZFAST_BITS]; - stbi__uint16 firstcode[16]; - int maxcode[17]; - stbi__uint16 firstsymbol[16]; - stbi_uc size[288]; - stbi__uint16 value[288]; -} stbi__zhuffman; - -stbi_inline static int stbi__bitreverse16(int n) -{ - n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); - n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); - n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); - n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); - return n; -} - -stbi_inline static int stbi__bit_reverse(int v, int bits) -{ - STBI_ASSERT(bits <= 16); - // to bit reverse n bits, reverse 16 and shift - // e.g. 11 bits, bit reverse and shift away 5 - return stbi__bitreverse16(v) >> (16-bits); -} - -static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num) -{ - int i,k=0; - int code, next_code[16], sizes[17]; - - // DEFLATE spec for generating codes - memset(sizes, 0, sizeof(sizes)); - memset(z->fast, 0, sizeof(z->fast)); - for (i=0; i < num; ++i) - ++sizes[sizelist[i]]; - sizes[0] = 0; - for (i=1; i < 16; ++i) - if (sizes[i] > (1 << i)) - return stbi__err("bad sizes", "Corrupt PNG"); - code = 0; - for (i=1; i < 16; ++i) { - next_code[i] = code; - z->firstcode[i] = (stbi__uint16) code; - z->firstsymbol[i] = (stbi__uint16) k; - code = (code + sizes[i]); - if (sizes[i]) - if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG"); - z->maxcode[i] = code << (16-i); // preshift for inner loop - code <<= 1; - k += sizes[i]; - } - z->maxcode[16] = 0x10000; // sentinel - for (i=0; i < num; ++i) { - int s = sizelist[i]; - if (s) { - int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; - stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i); - z->size [c] = (stbi_uc ) s; - z->value[c] = (stbi__uint16) i; - if (s <= STBI__ZFAST_BITS) { - int j = stbi__bit_reverse(next_code[s],s); - while (j < (1 << STBI__ZFAST_BITS)) { - z->fast[j] = fastv; - j += (1 << s); - } - } - ++next_code[s]; - } - } - return 1; -} - -// zlib-from-memory implementation for PNG reading -// because PNG allows splitting the zlib stream arbitrarily, -// and it's annoying structurally to have PNG call ZLIB call PNG, -// we require PNG read all the IDATs and combine them into a single -// memory buffer - -typedef struct -{ - stbi_uc *zbuffer, *zbuffer_end; - int num_bits; - stbi__uint32 code_buffer; - - char *zout; - char *zout_start; - char *zout_end; - int z_expandable; - - stbi__zhuffman z_length, z_distance; -} stbi__zbuf; - -stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z) -{ - if (z->zbuffer >= z->zbuffer_end) return 0; - return *z->zbuffer++; -} - -static void stbi__fill_bits(stbi__zbuf *z) -{ - do { - STBI_ASSERT(z->code_buffer < (1U << z->num_bits)); - z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; - z->num_bits += 8; - } while (z->num_bits <= 24); -} - -stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n) -{ - unsigned int k; - if (z->num_bits < n) stbi__fill_bits(z); - k = z->code_buffer & ((1 << n) - 1); - z->code_buffer >>= n; - z->num_bits -= n; - return k; -} - -static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) -{ - int b,s,k; - // not resolved by fast table, so compute it the slow way - // use jpeg approach, which requires MSbits at top - k = stbi__bit_reverse(a->code_buffer, 16); - for (s=STBI__ZFAST_BITS+1; ; ++s) - if (k < z->maxcode[s]) - break; - if (s == 16) return -1; // invalid code! - // code size is s, so: - b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; - STBI_ASSERT(z->size[b] == s); - a->code_buffer >>= s; - a->num_bits -= s; - return z->value[b]; -} - -stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) -{ - int b,s; - if (a->num_bits < 16) stbi__fill_bits(a); - b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; - if (b) { - s = b >> 9; - a->code_buffer >>= s; - a->num_bits -= s; - return b & 511; - } - return stbi__zhuffman_decode_slowpath(a, z); -} - -static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes -{ - char *q; - int cur, limit, old_limit; - z->zout = zout; - if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); - cur = (int) (z->zout - z->zout_start); - limit = old_limit = (int) (z->zout_end - z->zout_start); - while (cur + n > limit) - limit *= 2; - q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); - STBI_NOTUSED(old_limit); - if (q == NULL) return stbi__err("outofmem", "Out of memory"); - z->zout_start = q; - z->zout = q + cur; - z->zout_end = q + limit; - return 1; -} - -static int stbi__zlength_base[31] = { - 3,4,5,6,7,8,9,10,11,13, - 15,17,19,23,27,31,35,43,51,59, - 67,83,99,115,131,163,195,227,258,0,0 }; - -static int stbi__zlength_extra[31]= -{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; - -static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, -257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; - -static int stbi__zdist_extra[32] = -{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -static int stbi__parse_huffman_block(stbi__zbuf *a) -{ - char *zout = a->zout; - for(;;) { - int z = stbi__zhuffman_decode(a, &a->z_length); - if (z < 256) { - if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes - if (zout >= a->zout_end) { - if (!stbi__zexpand(a, zout, 1)) return 0; - zout = a->zout; - } - *zout++ = (char) z; - } else { - stbi_uc *p; - int len,dist; - if (z == 256) { - a->zout = zout; - return 1; - } - z -= 257; - len = stbi__zlength_base[z]; - if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); - z = stbi__zhuffman_decode(a, &a->z_distance); - if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); - dist = stbi__zdist_base[z]; - if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); - if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); - if (zout + len > a->zout_end) { - if (!stbi__zexpand(a, zout, len)) return 0; - zout = a->zout; - } - p = (stbi_uc *) (zout - dist); - if (dist == 1) { // run of one byte; common in images. - stbi_uc v = *p; - if (len) { do *zout++ = v; while (--len); } - } else { - if (len) { do *zout++ = *p++; while (--len); } - } - } - } -} - -static int stbi__compute_huffman_codes(stbi__zbuf *a) -{ - static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; - stbi__zhuffman z_codelength; - stbi_uc lencodes[286+32+137];//padding for maximum single op - stbi_uc codelength_sizes[19]; - int i,n; - - int hlit = stbi__zreceive(a,5) + 257; - int hdist = stbi__zreceive(a,5) + 1; - int hclen = stbi__zreceive(a,4) + 4; - - memset(codelength_sizes, 0, sizeof(codelength_sizes)); - for (i=0; i < hclen; ++i) { - int s = stbi__zreceive(a,3); - codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; - } - if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; - - n = 0; - while (n < hlit + hdist) { - int c = stbi__zhuffman_decode(a, &z_codelength); - if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); - if (c < 16) - lencodes[n++] = (stbi_uc) c; - else if (c == 16) { - c = stbi__zreceive(a,2)+3; - memset(lencodes+n, lencodes[n-1], c); - n += c; - } else if (c == 17) { - c = stbi__zreceive(a,3)+3; - memset(lencodes+n, 0, c); - n += c; - } else { - STBI_ASSERT(c == 18); - c = stbi__zreceive(a,7)+11; - memset(lencodes+n, 0, c); - n += c; - } - } - if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); - if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; - if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; - return 1; -} - -static int stbi__parse_uncompressed_block(stbi__zbuf *a) -{ - stbi_uc header[4]; - int len,nlen,k; - if (a->num_bits & 7) - stbi__zreceive(a, a->num_bits & 7); // discard - // drain the bit-packed data into header - k = 0; - while (a->num_bits > 0) { - header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check - a->code_buffer >>= 8; - a->num_bits -= 8; - } - STBI_ASSERT(a->num_bits == 0); - // now fill header the normal way - while (k < 4) - header[k++] = stbi__zget8(a); - len = header[1] * 256 + header[0]; - nlen = header[3] * 256 + header[2]; - if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); - if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); - if (a->zout + len > a->zout_end) - if (!stbi__zexpand(a, a->zout, len)) return 0; - memcpy(a->zout, a->zbuffer, len); - a->zbuffer += len; - a->zout += len; - return 1; -} - -static int stbi__parse_zlib_header(stbi__zbuf *a) -{ - int cmf = stbi__zget8(a); - int cm = cmf & 15; - /* int cinfo = cmf >> 4; */ - int flg = stbi__zget8(a); - if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec - if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png - if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png - // window = 1 << (8 + cinfo)... but who cares, we fully buffer output - return 1; -} - -// @TODO: should statically initialize these for optimal thread safety -static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32]; -static void stbi__init_zdefaults(void) -{ - int i; // use <= to match clearly with spec - for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8; - for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9; - for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7; - for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8; - - for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5; -} - -static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) -{ - int final, type; - if (parse_header) - if (!stbi__parse_zlib_header(a)) return 0; - a->num_bits = 0; - a->code_buffer = 0; - do { - final = stbi__zreceive(a,1); - type = stbi__zreceive(a,2); - if (type == 0) { - if (!stbi__parse_uncompressed_block(a)) return 0; - } else if (type == 3) { - return 0; - } else { - if (type == 1) { - // use fixed code lengths - if (!stbi__zdefault_distance[31]) stbi__init_zdefaults(); - if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0; - if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; - } else { - if (!stbi__compute_huffman_codes(a)) return 0; - } - if (!stbi__parse_huffman_block(a)) return 0; - } - } while (!final); - return 1; -} - -static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header) -{ - a->zout_start = obuf; - a->zout = obuf; - a->zout_end = obuf + olen; - a->z_expandable = exp; - - return stbi__parse_zlib(a, parse_header); -} - -STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer + len; - if (stbi__do_zlib(&a, p, initial_size, 1, 1)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) -{ - return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); -} - -STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer + len; - if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) -{ - stbi__zbuf a; - a.zbuffer = (stbi_uc *) ibuffer; - a.zbuffer_end = (stbi_uc *) ibuffer + ilen; - if (stbi__do_zlib(&a, obuffer, olen, 0, 1)) - return (int) (a.zout - a.zout_start); - else - return -1; -} - -STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(16384); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer+len; - if (stbi__do_zlib(&a, p, 16384, 1, 0)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) -{ - stbi__zbuf a; - a.zbuffer = (stbi_uc *) ibuffer; - a.zbuffer_end = (stbi_uc *) ibuffer + ilen; - if (stbi__do_zlib(&a, obuffer, olen, 0, 0)) - return (int) (a.zout - a.zout_start); - else - return -1; -} -#endif - -// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 -// simple implementation -// - only 8-bit samples -// - no CRC checking -// - allocates lots of intermediate memory -// - avoids problem of streaming data between subsystems -// - avoids explicit window management -// performance -// - uses stb_zlib, a PD zlib implementation with fast huffman decoding - -#ifndef STBI_NO_PNG -typedef struct -{ - stbi__uint32 length; - stbi__uint32 type; -} stbi__pngchunk; - -static stbi__pngchunk stbi__get_chunk_header(stbi__context *s) -{ - stbi__pngchunk c; - c.length = stbi__get32be(s); - c.type = stbi__get32be(s); - return c; -} - -static int stbi__check_png_header(stbi__context *s) -{ - static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 }; - int i; - for (i=0; i < 8; ++i) - if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG"); - return 1; -} - -typedef struct -{ - stbi__context *s; - stbi_uc *idata, *expanded, *out; - int depth; -} stbi__png; - - -enum { - STBI__F_none=0, - STBI__F_sub=1, - STBI__F_up=2, - STBI__F_avg=3, - STBI__F_paeth=4, - // synthetic filters used for first scanline to avoid needing a dummy row of 0s - STBI__F_avg_first, - STBI__F_paeth_first -}; - -static stbi_uc first_row_filter[5] = -{ - STBI__F_none, - STBI__F_sub, - STBI__F_none, - STBI__F_avg_first, - STBI__F_paeth_first -}; - -static int stbi__paeth(int a, int b, int c) -{ - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; -} - -static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; - -// create the png data from post-deflated data -static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) -{ - int bytes = (depth == 16? 2 : 1); - stbi__context *s = a->s; - stbi__uint32 i,j,stride = x*out_n*bytes; - stbi__uint32 img_len, img_width_bytes; - int k; - int img_n = s->img_n; // copy it into a local for later - - int output_bytes = out_n*bytes; - int filter_bytes = img_n*bytes; - int width = x; - - STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); - a->out = (stbi_uc *) stbi__malloc(x * y * output_bytes); // extra bytes to write off the end into - if (!a->out) return stbi__err("outofmem", "Out of memory"); - - img_width_bytes = (((img_n * x * depth) + 7) >> 3); - img_len = (img_width_bytes + 1) * y; - if (s->img_x == x && s->img_y == y) { - if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG"); - } else { // interlaced: - if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); - } - - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *prior = cur - stride; - int filter = *raw++; - - if (filter > 4) - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { - STBI_ASSERT(img_width_bytes <= x); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; - } - - // if first row, use special filter that doesn't sample previous row - if (j == 0) filter = first_row_filter[filter]; - - // handle first byte explicitly - for (k=0; k < filter_bytes; ++k) { - switch (filter) { - case STBI__F_none : cur[k] = raw[k]; break; - case STBI__F_sub : cur[k] = raw[k]; break; - case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; - case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; - case STBI__F_avg_first : cur[k] = raw[k]; break; - case STBI__F_paeth_first: cur[k] = raw[k]; break; - } - } - - if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255; // first pixel - raw += img_n; - cur += out_n; - prior += out_n; - } else if (depth == 16) { - if (img_n != out_n) { - cur[filter_bytes] = 255; // first pixel top byte - cur[filter_bytes+1] = 255; // first pixel bottom byte - } - raw += filter_bytes; - cur += output_bytes; - prior += output_bytes; - } else { - raw += 1; - cur += 1; - prior += 1; - } - - // this is a little gross, so that we don't switch per-pixel or per-component - if (depth < 8 || img_n == out_n) { - int nk = (width - 1)*filter_bytes; - #define CASE(f) \ - case f: \ - for (k=0; k < nk; ++k) - switch (filter) { - // "none" filter turns into a memcpy here; make that explicit. - case STBI__F_none: memcpy(cur, raw, nk); break; - CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break; - CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break; - CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break; - CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break; - CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break; - } - #undef CASE - raw += nk; - } else { - STBI_ASSERT(img_n+1 == out_n); - #define CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ - for (k=0; k < filter_bytes; ++k) - switch (filter) { - CASE(STBI__F_none) cur[k] = raw[k]; break; - CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; - CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; - CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; - CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; - CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; - } - #undef CASE - - // the loop above sets the high byte of the pixels' alpha, but for - // 16 bit png files we also need the low byte set. we'll do that here. - if (depth == 16) { - cur = a->out + stride*j; // start at the beginning of the row again - for (i=0; i < x; ++i,cur+=output_bytes) { - cur[filter_bytes+1] = 255; - } - } - } - } - - // we make a separate pass to expand bits to pixels; for performance, - // this could run two scanlines behind the above code, so it won't - // intefere with filtering but will still be in the cache. - if (depth < 8) { - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; - // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit - // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop - stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range - - // note that the final byte might overshoot and write more data than desired. - // we can allocate enough data that this never writes out of memory, but it - // could also overwrite the next scanline. can it overwrite non-empty data - // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. - // so we need to explicitly clamp the final ones - - if (depth == 4) { - for (k=x*img_n; k >= 2; k-=2, ++in) { - *cur++ = scale * ((*in >> 4) ); - *cur++ = scale * ((*in ) & 0x0f); - } - if (k > 0) *cur++ = scale * ((*in >> 4) ); - } else if (depth == 2) { - for (k=x*img_n; k >= 4; k-=4, ++in) { - *cur++ = scale * ((*in >> 6) ); - *cur++ = scale * ((*in >> 4) & 0x03); - *cur++ = scale * ((*in >> 2) & 0x03); - *cur++ = scale * ((*in ) & 0x03); - } - if (k > 0) *cur++ = scale * ((*in >> 6) ); - if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); - if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); - } else if (depth == 1) { - for (k=x*img_n; k >= 8; k-=8, ++in) { - *cur++ = scale * ((*in >> 7) ); - *cur++ = scale * ((*in >> 6) & 0x01); - *cur++ = scale * ((*in >> 5) & 0x01); - *cur++ = scale * ((*in >> 4) & 0x01); - *cur++ = scale * ((*in >> 3) & 0x01); - *cur++ = scale * ((*in >> 2) & 0x01); - *cur++ = scale * ((*in >> 1) & 0x01); - *cur++ = scale * ((*in ) & 0x01); - } - if (k > 0) *cur++ = scale * ((*in >> 7) ); - if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); - if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); - if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); - if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); - if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); - if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); - } - if (img_n != out_n) { - int q; - // insert alpha = 255 - cur = a->out + stride*j; - if (img_n == 1) { - for (q=x-1; q >= 0; --q) { - cur[q*2+1] = 255; - cur[q*2+0] = cur[q]; - } - } else { - STBI_ASSERT(img_n == 3); - for (q=x-1; q >= 0; --q) { - cur[q*4+3] = 255; - cur[q*4+2] = cur[q*3+2]; - cur[q*4+1] = cur[q*3+1]; - cur[q*4+0] = cur[q*3+0]; - } - } - } - } - } else if (depth == 16) { - // force the image data from big-endian to platform-native. - // this is done in a separate pass due to the decoding relying - // on the data being untouched, but could probably be done - // per-line during decode if care is taken. - stbi_uc *cur = a->out; - stbi__uint16 *cur16 = (stbi__uint16*)cur; - - for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { - *cur16 = (cur[0] << 8) | cur[1]; - } - } - - return 1; -} - -static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) -{ - stbi_uc *final; - int p; - if (!interlaced) - return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); - - // de-interlacing - final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n); - for (p=0; p < 7; ++p) { - int xorig[] = { 0,4,0,2,0,1,0 }; - int yorig[] = { 0,0,4,0,2,0,1 }; - int xspc[] = { 8,8,4,4,2,2,1 }; - int yspc[] = { 8,8,8,4,4,2,2 }; - int i,j,x,y; - // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 - x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; - y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; - if (x && y) { - stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y; - if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) { - STBI_FREE(final); - return 0; - } - for (j=0; j < y; ++j) { - for (i=0; i < x; ++i) { - int out_y = j*yspc[p]+yorig[p]; - int out_x = i*xspc[p]+xorig[p]; - memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n, - a->out + (j*x+i)*out_n, out_n); - } - } - STBI_FREE(a->out); - image_data += img_len; - image_data_len -= img_len; - } - } - a->out = final; - - return 1; -} - -static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi_uc *p = z->out; - - // compute color-based transparency, assuming we've - // already got 255 as the alpha value in the output - STBI_ASSERT(out_n == 2 || out_n == 4); - - if (out_n == 2) { - for (i=0; i < pixel_count; ++i) { - p[1] = (p[0] == tc[0] ? 0 : 255); - p += 2; - } - } else { - for (i=0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; - p += 4; - } - } - return 1; -} - -static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi__uint16 *p = (stbi__uint16*) z->out; - - // compute color-based transparency, assuming we've - // already got 65535 as the alpha value in the output - STBI_ASSERT(out_n == 2 || out_n == 4); - - if (out_n == 2) { - for (i = 0; i < pixel_count; ++i) { - p[1] = (p[0] == tc[0] ? 0 : 65535); - p += 2; - } - } else { - for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; - p += 4; - } - } - return 1; -} - -static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) -{ - stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; - stbi_uc *p, *temp_out, *orig = a->out; - - p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n); - if (p == NULL) return stbi__err("outofmem", "Out of memory"); - - // between here and free(out) below, exitting would leak - temp_out = p; - - if (pal_img_n == 3) { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p += 3; - } - } else { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p[3] = palette[n+3]; - p += 4; - } - } - STBI_FREE(a->out); - a->out = temp_out; - - STBI_NOTUSED(len); - - return 1; -} - -static int stbi__reduce_png(stbi__png *p) -{ - int i; - int img_len = p->s->img_x * p->s->img_y * p->s->img_out_n; - stbi_uc *reduced; - stbi__uint16 *orig = (stbi__uint16*)p->out; - - if (p->depth != 16) return 1; // don't need to do anything if not 16-bit data - - reduced = (stbi_uc *)stbi__malloc(img_len); - if (p == NULL) return stbi__err("outofmem", "Out of memory"); - - for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is a decent approx of 16->8 bit scaling - - p->out = reduced; - STBI_FREE(orig); - - return 1; -} - -static int stbi__unpremultiply_on_load = 0; -static int stbi__de_iphone_flag = 0; - -STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) -{ - stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply; -} - -STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) -{ - stbi__de_iphone_flag = flag_true_if_should_convert; -} - -static void stbi__de_iphone(stbi__png *z) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi_uc *p = z->out; - - if (s->img_out_n == 3) { // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - stbi_uc t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 3; - } - } else { - STBI_ASSERT(s->img_out_n == 4); - if (stbi__unpremultiply_on_load) { - // convert bgr to rgb and unpremultiply - for (i=0; i < pixel_count; ++i) { - stbi_uc a = p[3]; - stbi_uc t = p[0]; - if (a) { - p[0] = p[2] * 255 / a; - p[1] = p[1] * 255 / a; - p[2] = t * 255 / a; - } else { - p[0] = p[2]; - p[2] = t; - } - p += 4; - } - } else { - // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - stbi_uc t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 4; - } - } - } -} - -#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) - -static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) -{ - stbi_uc palette[1024], pal_img_n=0; - stbi_uc has_trans=0, tc[3]; - stbi__uint16 tc16[3]; - stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; - int first=1,k,interlace=0, color=0, is_iphone=0; - stbi__context *s = z->s; - - z->expanded = NULL; - z->idata = NULL; - z->out = NULL; - - if (!stbi__check_png_header(s)) return 0; - - if (scan == STBI__SCAN_type) return 1; - - for (;;) { - stbi__pngchunk c = stbi__get_chunk_header(s); - switch (c.type) { - case STBI__PNG_TYPE('C','g','B','I'): - is_iphone = 1; - stbi__skip(s, c.length); - break; - case STBI__PNG_TYPE('I','H','D','R'): { - int comp,filter; - if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); - first = 0; - if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); - s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); - s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); - z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); - color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); - if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); - if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); - comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); - filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); - interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG"); - if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG"); - if (!pal_img_n) { - s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); - if (scan == STBI__SCAN_header) return 1; - } else { - // if paletted, then pal_n is our final components, and - // img_n is # components to decompress/filter. - s->img_n = 1; - if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG"); - // if SCAN_header, have to scan to see if we have a tRNS - } - break; - } - - case STBI__PNG_TYPE('P','L','T','E'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG"); - pal_len = c.length / 3; - if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG"); - for (i=0; i < pal_len; ++i) { - palette[i*4+0] = stbi__get8(s); - palette[i*4+1] = stbi__get8(s); - palette[i*4+2] = stbi__get8(s); - palette[i*4+3] = 255; - } - break; - } - - case STBI__PNG_TYPE('t','R','N','S'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG"); - if (pal_img_n) { - if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; } - if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG"); - if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG"); - pal_img_n = 4; - for (i=0; i < c.length; ++i) - palette[i*4+3] = stbi__get8(s); - } else { - if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); - if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); - has_trans = 1; - if (z->depth == 16) { - for (k = 0; k < s->img_n; ++k) tc16[k] = stbi__get16be(s); // copy the values as-is - } else { - for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger - } - } - break; - } - - case STBI__PNG_TYPE('I','D','A','T'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); - if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; } - if ((int)(ioff + c.length) < (int)ioff) return 0; - if (ioff + c.length > idata_limit) { - stbi__uint32 idata_limit_old = idata_limit; - stbi_uc *p; - if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; - while (ioff + c.length > idata_limit) - idata_limit *= 2; - STBI_NOTUSED(idata_limit_old); - p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); - z->idata = p; - } - if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG"); - ioff += c.length; - break; - } - - case STBI__PNG_TYPE('I','E','N','D'): { - stbi__uint32 raw_len, bpl; - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (scan != STBI__SCAN_load) return 1; - if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); - // initial guess for decoded data size to avoid unnecessary reallocs - bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component - raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; - z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); - if (z->expanded == NULL) return 0; // zlib should set error - STBI_FREE(z->idata); z->idata = NULL; - if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) - s->img_out_n = s->img_n+1; - else - s->img_out_n = s->img_n; - if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; - if (has_trans) { - if (z->depth == 16) { - if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; - } else { - if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; - } - } - if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) - stbi__de_iphone(z); - if (pal_img_n) { - // pal_img_n == 3 or 4 - s->img_n = pal_img_n; // record the actual colors we had - s->img_out_n = pal_img_n; - if (req_comp >= 3) s->img_out_n = req_comp; - if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) - return 0; - } - STBI_FREE(z->expanded); z->expanded = NULL; - return 1; - } - - default: - // if critical, fail - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if ((c.type & (1 << 29)) == 0) { - #ifndef STBI_NO_FAILURE_STRINGS - // not threadsafe - static char invalid_chunk[] = "XXXX PNG chunk not known"; - invalid_chunk[0] = STBI__BYTECAST(c.type >> 24); - invalid_chunk[1] = STBI__BYTECAST(c.type >> 16); - invalid_chunk[2] = STBI__BYTECAST(c.type >> 8); - invalid_chunk[3] = STBI__BYTECAST(c.type >> 0); - #endif - return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type"); - } - stbi__skip(s, c.length); - break; - } - // end of PNG chunk, read and skip CRC - stbi__get32be(s); - } -} - -static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp) -{ - unsigned char *result=NULL; - if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); - if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { - if (p->depth == 16) { - if (!stbi__reduce_png(p)) { - return result; - } - } - result = p->out; - p->out = NULL; - if (req_comp && req_comp != p->s->img_out_n) { - result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); - p->s->img_out_n = req_comp; - if (result == NULL) return result; - } - *x = p->s->img_x; - *y = p->s->img_y; - if (n) *n = p->s->img_n; - } - STBI_FREE(p->out); p->out = NULL; - STBI_FREE(p->expanded); p->expanded = NULL; - STBI_FREE(p->idata); p->idata = NULL; - - return result; -} - -static unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi__png p; - p.s = s; - return stbi__do_png(&p, x,y,comp,req_comp); -} - -static int stbi__png_test(stbi__context *s) -{ - int r; - r = stbi__check_png_header(s); - stbi__rewind(s); - return r; -} - -static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) -{ - if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { - stbi__rewind( p->s ); - return 0; - } - if (x) *x = p->s->img_x; - if (y) *y = p->s->img_y; - if (comp) *comp = p->s->img_n; - return 1; -} - -static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) -{ - stbi__png p; - p.s = s; - return stbi__png_info_raw(&p, x, y, comp); -} -#endif - -// Microsoft/Windows BMP image - -#ifndef STBI_NO_BMP -static int stbi__bmp_test_raw(stbi__context *s) -{ - int r; - int sz; - if (stbi__get8(s) != 'B') return 0; - if (stbi__get8(s) != 'M') return 0; - stbi__get32le(s); // discard filesize - stbi__get16le(s); // discard reserved - stbi__get16le(s); // discard reserved - stbi__get32le(s); // discard data offset - sz = stbi__get32le(s); - r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124); - return r; -} - -static int stbi__bmp_test(stbi__context *s) -{ - int r = stbi__bmp_test_raw(s); - stbi__rewind(s); - return r; -} - - -// returns 0..31 for the highest set bit -static int stbi__high_bit(unsigned int z) -{ - int n=0; - if (z == 0) return -1; - if (z >= 0x10000) n += 16, z >>= 16; - if (z >= 0x00100) n += 8, z >>= 8; - if (z >= 0x00010) n += 4, z >>= 4; - if (z >= 0x00004) n += 2, z >>= 2; - if (z >= 0x00002) n += 1, z >>= 1; - return n; -} - -static int stbi__bitcount(unsigned int a) -{ - a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 - a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits - a = (a + (a >> 8)); // max 16 per 8 bits - a = (a + (a >> 16)); // max 32 per 8 bits - return a & 0xff; -} - -static int stbi__shiftsigned(int v, int shift, int bits) -{ - int result; - int z=0; - - if (shift < 0) v <<= -shift; - else v >>= shift; - result = v; - - z = bits; - while (z < 8) { - result += v >> z; - z += bits; - } - return result; -} - -typedef struct -{ - int bpp, offset, hsz; - unsigned int mr,mg,mb,ma, all_a; -} stbi__bmp_data; - -static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) -{ - int hsz; - if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP"); - stbi__get32le(s); // discard filesize - stbi__get16le(s); // discard reserved - stbi__get16le(s); // discard reserved - info->offset = stbi__get32le(s); - info->hsz = hsz = stbi__get32le(s); - info->mr = info->mg = info->mb = info->ma = 0; - - if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); - if (hsz == 12) { - s->img_x = stbi__get16le(s); - s->img_y = stbi__get16le(s); - } else { - s->img_x = stbi__get32le(s); - s->img_y = stbi__get32le(s); - } - if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP"); - info->bpp = stbi__get16le(s); - if (info->bpp == 1) return stbi__errpuc("monochrome", "BMP type not supported: 1-bit"); - if (hsz != 12) { - int compress = stbi__get32le(s); - if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); - stbi__get32le(s); // discard sizeof - stbi__get32le(s); // discard hres - stbi__get32le(s); // discard vres - stbi__get32le(s); // discard colorsused - stbi__get32le(s); // discard max important - if (hsz == 40 || hsz == 56) { - if (hsz == 56) { - stbi__get32le(s); - stbi__get32le(s); - stbi__get32le(s); - stbi__get32le(s); - } - if (info->bpp == 16 || info->bpp == 32) { - if (compress == 0) { - if (info->bpp == 32) { - info->mr = 0xffu << 16; - info->mg = 0xffu << 8; - info->mb = 0xffu << 0; - info->ma = 0xffu << 24; - info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 - } else { - info->mr = 31u << 10; - info->mg = 31u << 5; - info->mb = 31u << 0; - } - } else if (compress == 3) { - info->mr = stbi__get32le(s); - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); - // not documented, but generated by photoshop and handled by mspaint - if (info->mr == info->mg && info->mg == info->mb) { - // ?!?!? - return stbi__errpuc("bad BMP", "bad BMP"); - } - } else - return stbi__errpuc("bad BMP", "bad BMP"); - } - } else { - int i; - if (hsz != 108 && hsz != 124) - return stbi__errpuc("bad BMP", "bad BMP"); - info->mr = stbi__get32le(s); - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); - info->ma = stbi__get32le(s); - stbi__get32le(s); // discard color space - for (i=0; i < 12; ++i) - stbi__get32le(s); // discard color space parameters - if (hsz == 124) { - stbi__get32le(s); // discard rendering intent - stbi__get32le(s); // discard offset of profile data - stbi__get32le(s); // discard size of profile data - stbi__get32le(s); // discard reserved - } - } - } - return (void *) 1; -} - - -static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi_uc *out; - unsigned int mr=0,mg=0,mb=0,ma=0, all_a; - stbi_uc pal[256][4]; - int psize=0,i,j,width; - int flip_vertically, pad, target; - stbi__bmp_data info; - - info.all_a = 255; - if (stbi__bmp_parse_header(s, &info) == NULL) - return NULL; // error code already set - - flip_vertically = ((int) s->img_y) > 0; - s->img_y = abs((int) s->img_y); - - mr = info.mr; - mg = info.mg; - mb = info.mb; - ma = info.ma; - all_a = info.all_a; - - if (info.hsz == 12) { - if (info.bpp < 24) - psize = (info.offset - 14 - 24) / 3; - } else { - if (info.bpp < 16) - psize = (info.offset - 14 - info.hsz) >> 2; - } - - s->img_n = ma ? 4 : 3; - if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 - target = req_comp; - else - target = s->img_n; // if they want monochrome, we'll post-convert - - out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - if (info.bpp < 16) { - int z=0; - if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); } - for (i=0; i < psize; ++i) { - pal[i][2] = stbi__get8(s); - pal[i][1] = stbi__get8(s); - pal[i][0] = stbi__get8(s); - if (info.hsz != 12) stbi__get8(s); - pal[i][3] = 255; - } - stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); - if (info.bpp == 4) width = (s->img_x + 1) >> 1; - else if (info.bpp == 8) width = s->img_x; - else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); } - pad = (-width)&3; - for (j=0; j < (int) s->img_y; ++j) { - for (i=0; i < (int) s->img_x; i += 2) { - int v=stbi__get8(s),v2=0; - if (info.bpp == 4) { - v2 = v & 15; - v >>= 4; - } - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - if (i+1 == (int) s->img_x) break; - v = (info.bpp == 8) ? stbi__get8(s) : v2; - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - } - stbi__skip(s, pad); - } - } else { - int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; - int z = 0; - int easy=0; - stbi__skip(s, info.offset - 14 - info.hsz); - if (info.bpp == 24) width = 3 * s->img_x; - else if (info.bpp == 16) width = 2*s->img_x; - else /* bpp = 32 and pad = 0 */ width=0; - pad = (-width) & 3; - if (info.bpp == 24) { - easy = 1; - } else if (info.bpp == 32) { - if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) - easy = 2; - } - if (!easy) { - if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } - // right shift amt to put high bit in position #7 - rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr); - gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg); - bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb); - ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma); - } - for (j=0; j < (int) s->img_y; ++j) { - if (easy) { - for (i=0; i < (int) s->img_x; ++i) { - unsigned char a; - out[z+2] = stbi__get8(s); - out[z+1] = stbi__get8(s); - out[z+0] = stbi__get8(s); - z += 3; - a = (easy == 2 ? stbi__get8(s) : 255); - all_a |= a; - if (target == 4) out[z++] = a; - } - } else { - int bpp = info.bpp; - for (i=0; i < (int) s->img_x; ++i) { - stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s)); - int a; - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount)); - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount)); - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount)); - a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255); - all_a |= a; - if (target == 4) out[z++] = STBI__BYTECAST(a); - } - } - stbi__skip(s, pad); - } - } - - // if alpha channel is all 0s, replace with all 255s - if (target == 4 && all_a == 0) - for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4) - out[i] = 255; - - if (flip_vertically) { - stbi_uc t; - for (j=0; j < (int) s->img_y>>1; ++j) { - stbi_uc *p1 = out + j *s->img_x*target; - stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; - for (i=0; i < (int) s->img_x*target; ++i) { - t = p1[i], p1[i] = p2[i], p2[i] = t; - } - } - } - - if (req_comp && req_comp != target) { - out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y); - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - - *x = s->img_x; - *y = s->img_y; - if (comp) *comp = s->img_n; - return out; -} -#endif - -// Targa Truevision - TGA -// by Jonathan Dummer -#ifndef STBI_NO_TGA -// returns STBI_rgb or whatever, 0 on error -static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16) -{ - // only RGB or RGBA (incl. 16bit) or grey allowed - if(is_rgb16) *is_rgb16 = 0; - switch(bits_per_pixel) { - case 8: return STBI_grey; - case 16: if(is_grey) return STBI_grey_alpha; - // else: fall-through - case 15: if(is_rgb16) *is_rgb16 = 1; - return STBI_rgb; - case 24: // fall-through - case 32: return bits_per_pixel/8; - default: return 0; - } -} - -static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp) -{ - int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp; - int sz, tga_colormap_type; - stbi__get8(s); // discard Offset - tga_colormap_type = stbi__get8(s); // colormap type - if( tga_colormap_type > 1 ) { - stbi__rewind(s); - return 0; // only RGB or indexed allowed - } - tga_image_type = stbi__get8(s); // image type - if ( tga_colormap_type == 1 ) { // colormapped (paletted) image - if (tga_image_type != 1 && tga_image_type != 9) { - stbi__rewind(s); - return 0; - } - stbi__skip(s,4); // skip index of first colormap entry and number of entries - sz = stbi__get8(s); // check bits per palette color entry - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) { - stbi__rewind(s); - return 0; - } - stbi__skip(s,4); // skip image x and y origin - tga_colormap_bpp = sz; - } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE - if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) { - stbi__rewind(s); - return 0; // only RGB or grey allowed, +/- RLE - } - stbi__skip(s,9); // skip colormap specification and image x/y origin - tga_colormap_bpp = 0; - } - tga_w = stbi__get16le(s); - if( tga_w < 1 ) { - stbi__rewind(s); - return 0; // test width - } - tga_h = stbi__get16le(s); - if( tga_h < 1 ) { - stbi__rewind(s); - return 0; // test height - } - tga_bits_per_pixel = stbi__get8(s); // bits per pixel - stbi__get8(s); // ignore alpha bits - if (tga_colormap_bpp != 0) { - if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) { - // when using a colormap, tga_bits_per_pixel is the size of the indexes - // I don't think anything but 8 or 16bit indexes makes sense - stbi__rewind(s); - return 0; - } - tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL); - } else { - tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL); - } - if(!tga_comp) { - stbi__rewind(s); - return 0; - } - if (x) *x = tga_w; - if (y) *y = tga_h; - if (comp) *comp = tga_comp; - return 1; // seems to have passed everything -} - -static int stbi__tga_test(stbi__context *s) -{ - int res = 0; - int sz, tga_color_type; - stbi__get8(s); // discard Offset - tga_color_type = stbi__get8(s); // color type - if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed - sz = stbi__get8(s); // image type - if ( tga_color_type == 1 ) { // colormapped (paletted) image - if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9 - stbi__skip(s,4); // skip index of first colormap entry and number of entries - sz = stbi__get8(s); // check bits per palette color entry - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; - stbi__skip(s,4); // skip image x and y origin - } else { // "normal" image w/o colormap - if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE - stbi__skip(s,9); // skip colormap specification and image x/y origin - } - if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width - if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height - sz = stbi__get8(s); // bits per pixel - if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; - - res = 1; // if we got this far, everything's good and we can return 1 instead of 0 - -errorEnd: - stbi__rewind(s); - return res; -} - -// read 16bit value and convert to 24bit RGB -void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) -{ - stbi__uint16 px = stbi__get16le(s); - stbi__uint16 fiveBitMask = 31; - // we have 3 channels with 5bits each - int r = (px >> 10) & fiveBitMask; - int g = (px >> 5) & fiveBitMask; - int b = px & fiveBitMask; - // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later - out[0] = (r * 255)/31; - out[1] = (g * 255)/31; - out[2] = (b * 255)/31; - - // some people claim that the most significant bit might be used for alpha - // (possibly if an alpha-bit is set in the "image descriptor byte") - // but that only made 16bit test images completely translucent.. - // so let's treat all 15 and 16bit TGAs as RGB with no alpha. -} - -static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - // read in the TGA header stuff - int tga_offset = stbi__get8(s); - int tga_indexed = stbi__get8(s); - int tga_image_type = stbi__get8(s); - int tga_is_RLE = 0; - int tga_palette_start = stbi__get16le(s); - int tga_palette_len = stbi__get16le(s); - int tga_palette_bits = stbi__get8(s); - int tga_x_origin = stbi__get16le(s); - int tga_y_origin = stbi__get16le(s); - int tga_width = stbi__get16le(s); - int tga_height = stbi__get16le(s); - int tga_bits_per_pixel = stbi__get8(s); - int tga_comp, tga_rgb16=0; - int tga_inverted = stbi__get8(s); - // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?) - // image data - unsigned char *tga_data; - unsigned char *tga_palette = NULL; - int i, j; - unsigned char raw_data[4]; - int RLE_count = 0; - int RLE_repeating = 0; - int read_next_pixel = 1; - - // do a tiny bit of precessing - if ( tga_image_type >= 8 ) - { - tga_image_type -= 8; - tga_is_RLE = 1; - } - tga_inverted = 1 - ((tga_inverted >> 5) & 1); - - // If I'm paletted, then I'll use the number of bits from the palette - if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); - else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); - - if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency - return stbi__errpuc("bad format", "Can't find out TGA pixelformat"); - - // tga info - *x = tga_width; - *y = tga_height; - if (comp) *comp = tga_comp; - - tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp ); - if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); - - // skip to the data's starting position (offset usually = 0) - stbi__skip(s, tga_offset ); - - if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) { - for (i=0; i < tga_height; ++i) { - int row = tga_inverted ? tga_height -i - 1 : i; - stbi_uc *tga_row = tga_data + row*tga_width*tga_comp; - stbi__getn(s, tga_row, tga_width * tga_comp); - } - } else { - // do I need to load a palette? - if ( tga_indexed) - { - // any data to skip? (offset usually = 0) - stbi__skip(s, tga_palette_start ); - // load the palette - tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_comp ); - if (!tga_palette) { - STBI_FREE(tga_data); - return stbi__errpuc("outofmem", "Out of memory"); - } - if (tga_rgb16) { - stbi_uc *pal_entry = tga_palette; - STBI_ASSERT(tga_comp == STBI_rgb); - for (i=0; i < tga_palette_len; ++i) { - stbi__tga_read_rgb16(s, pal_entry); - pal_entry += tga_comp; - } - } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) { - STBI_FREE(tga_data); - STBI_FREE(tga_palette); - return stbi__errpuc("bad palette", "Corrupt TGA"); - } - } - // load the data - for (i=0; i < tga_width * tga_height; ++i) - { - // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk? - if ( tga_is_RLE ) - { - if ( RLE_count == 0 ) - { - // yep, get the next byte as a RLE command - int RLE_cmd = stbi__get8(s); - RLE_count = 1 + (RLE_cmd & 127); - RLE_repeating = RLE_cmd >> 7; - read_next_pixel = 1; - } else if ( !RLE_repeating ) - { - read_next_pixel = 1; - } - } else - { - read_next_pixel = 1; - } - // OK, if I need to read a pixel, do it now - if ( read_next_pixel ) - { - // load however much data we did have - if ( tga_indexed ) - { - // read in index, then perform the lookup - int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s); - if ( pal_idx >= tga_palette_len ) { - // invalid index - pal_idx = 0; - } - pal_idx *= tga_comp; - for (j = 0; j < tga_comp; ++j) { - raw_data[j] = tga_palette[pal_idx+j]; - } - } else if(tga_rgb16) { - STBI_ASSERT(tga_comp == STBI_rgb); - stbi__tga_read_rgb16(s, raw_data); - } else { - // read in the data raw - for (j = 0; j < tga_comp; ++j) { - raw_data[j] = stbi__get8(s); - } - } - // clear the reading flag for the next pixel - read_next_pixel = 0; - } // end of reading a pixel - - // copy data - for (j = 0; j < tga_comp; ++j) - tga_data[i*tga_comp+j] = raw_data[j]; - - // in case we're in RLE mode, keep counting down - --RLE_count; - } - // do I need to invert the image? - if ( tga_inverted ) - { - for (j = 0; j*2 < tga_height; ++j) - { - int index1 = j * tga_width * tga_comp; - int index2 = (tga_height - 1 - j) * tga_width * tga_comp; - for (i = tga_width * tga_comp; i > 0; --i) - { - unsigned char temp = tga_data[index1]; - tga_data[index1] = tga_data[index2]; - tga_data[index2] = temp; - ++index1; - ++index2; - } - } - } - // clear my palette, if I had one - if ( tga_palette != NULL ) - { - STBI_FREE( tga_palette ); - } - } - - // swap RGB - if the source data was RGB16, it already is in the right order - if (tga_comp >= 3 && !tga_rgb16) - { - unsigned char* tga_pixel = tga_data; - for (i=0; i < tga_width * tga_height; ++i) - { - unsigned char temp = tga_pixel[0]; - tga_pixel[0] = tga_pixel[2]; - tga_pixel[2] = temp; - tga_pixel += tga_comp; - } - } - - // convert to target component count - if (req_comp && req_comp != tga_comp) - tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); - - // the things I do to get rid of an error message, and yet keep - // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; - // OK, done - return tga_data; -} -#endif - -// ************************************************************************************************* -// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB - -#ifndef STBI_NO_PSD -static int stbi__psd_test(stbi__context *s) -{ - int r = (stbi__get32be(s) == 0x38425053); - stbi__rewind(s); - return r; -} - -static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - int pixelCount; - int channelCount, compression; - int channel, i, count, len; - int bitdepth; - int w,h; - stbi_uc *out; - - // Check identifier - if (stbi__get32be(s) != 0x38425053) // "8BPS" - return stbi__errpuc("not PSD", "Corrupt PSD image"); - - // Check file type version. - if (stbi__get16be(s) != 1) - return stbi__errpuc("wrong version", "Unsupported version of PSD image"); - - // Skip 6 reserved bytes. - stbi__skip(s, 6 ); - - // Read the number of channels (R, G, B, A, etc). - channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) - return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); - - // Read the rows and columns of the image. - h = stbi__get32be(s); - w = stbi__get32be(s); - - // Make sure the depth is 8 bits. - bitdepth = stbi__get16be(s); - if (bitdepth != 8 && bitdepth != 16) - return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); - - // Make sure the color mode is RGB. - // Valid options are: - // 0: Bitmap - // 1: Grayscale - // 2: Indexed color - // 3: RGB color - // 4: CMYK color - // 7: Multichannel - // 8: Duotone - // 9: Lab color - if (stbi__get16be(s) != 3) - return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); - - // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) - stbi__skip(s,stbi__get32be(s) ); - - // Skip the image resources. (resolution, pen tool paths, etc) - stbi__skip(s, stbi__get32be(s) ); - - // Skip the reserved data. - stbi__skip(s, stbi__get32be(s) ); - - // Find out if the data is compressed. - // Known values: - // 0: no compression - // 1: RLE compressed - compression = stbi__get16be(s); - if (compression > 1) - return stbi__errpuc("bad compression", "PSD has an unknown compression format"); - - // Create the destination image. - out = (stbi_uc *) stbi__malloc(4 * w*h); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - pixelCount = w*h; - - // Initialize the data to zero. - //memset( out, 0, pixelCount * 4 ); - - // Finally, the image data. - if (compression) { - // RLE as used by .PSD and .TIFF - // Loop until you get the number of unpacked bytes you are expecting: - // Read the next source byte into n. - // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. - // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. - // Else if n is 128, noop. - // Endloop - - // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, - // which we're going to just skip. - stbi__skip(s, h * channelCount * 2 ); - - // Read the RLE data by channel. - for (channel = 0; channel < 4; channel++) { - stbi_uc *p; - - p = out+channel; - if (channel >= channelCount) { - // Fill this channel with default data. - for (i = 0; i < pixelCount; i++, p += 4) - *p = (channel == 3 ? 255 : 0); - } else { - // Read the RLE data. - count = 0; - while (count < pixelCount) { - len = stbi__get8(s); - if (len == 128) { - // No-op. - } else if (len < 128) { - // Copy next len+1 bytes literally. - len++; - count += len; - while (len) { - *p = stbi__get8(s); - p += 4; - len--; - } - } else if (len > 128) { - stbi_uc val; - // Next -len+1 bytes in the dest are replicated from next source byte. - // (Interpret len as a negative 8-bit int.) - len ^= 0x0FF; - len += 2; - val = stbi__get8(s); - count += len; - while (len) { - *p = val; - p += 4; - len--; - } - } - } - } - } - - } else { - // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) - // where each channel consists of an 8-bit value for each pixel in the image. - - // Read the data by channel. - for (channel = 0; channel < 4; channel++) { - stbi_uc *p; - - p = out + channel; - if (channel >= channelCount) { - // Fill this channel with default data. - stbi_uc val = channel == 3 ? 255 : 0; - for (i = 0; i < pixelCount; i++, p += 4) - *p = val; - } else { - // Read the data. - if (bitdepth == 16) { - for (i = 0; i < pixelCount; i++, p += 4) - *p = (stbi_uc) (stbi__get16be(s) >> 8); - } else { - for (i = 0; i < pixelCount; i++, p += 4) - *p = stbi__get8(s); - } - } - } - } - - if (channelCount >= 4) { - for (i=0; i < w*h; ++i) { - unsigned char *pixel = out + 4*i; - if (pixel[3] != 0 && pixel[3] != 255) { - // remove weird white matte from PSD - float a = pixel[3] / 255.0f; - float ra = 1.0f / a; - float inv_a = 255.0f * (1 - ra); - pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); - pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); - pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); - } - } - } - - if (req_comp && req_comp != 4) { - out = stbi__convert_format(out, 4, req_comp, w, h); - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - - if (comp) *comp = 4; - *y = h; - *x = w; - - return out; -} -#endif - -// ************************************************************************************************* -// Softimage PIC loader -// by Tom Seddon -// -// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format -// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/ - -#ifndef STBI_NO_PIC -static int stbi__pic_is4(stbi__context *s,const char *str) -{ - int i; - for (i=0; i<4; ++i) - if (stbi__get8(s) != (stbi_uc)str[i]) - return 0; - - return 1; -} - -static int stbi__pic_test_core(stbi__context *s) -{ - int i; - - if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) - return 0; - - for(i=0;i<84;++i) - stbi__get8(s); - - if (!stbi__pic_is4(s,"PICT")) - return 0; - - return 1; -} - -typedef struct -{ - stbi_uc size,type,channel; -} stbi__pic_packet; - -static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest) -{ - int mask=0x80, i; - - for (i=0; i<4; ++i, mask>>=1) { - if (channel & mask) { - if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short"); - dest[i]=stbi__get8(s); - } - } - - return dest; -} - -static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src) -{ - int mask=0x80,i; - - for (i=0;i<4; ++i, mask>>=1) - if (channel&mask) - dest[i]=src[i]; -} - -static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result) -{ - int act_comp=0,num_packets=0,y,chained; - stbi__pic_packet packets[10]; - - // this will (should...) cater for even some bizarre stuff like having data - // for the same channel in multiple packets. - do { - stbi__pic_packet *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return stbi__errpuc("bad format","too many packets"); - - packet = &packets[num_packets++]; - - chained = stbi__get8(s); - packet->size = stbi__get8(s); - packet->type = stbi__get8(s); - packet->channel = stbi__get8(s); - - act_comp |= packet->channel; - - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)"); - if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp"); - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? - - for(y=0; ytype) { - default: - return stbi__errpuc("bad format","packet has bad compression type"); - - case 0: {//uncompressed - int x; - - for(x=0;xchannel,dest)) - return 0; - break; - } - - case 1://Pure RLE - { - int left=width, i; - - while (left>0) { - stbi_uc count,value[4]; - - count=stbi__get8(s); - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)"); - - if (count > left) - count = (stbi_uc) left; - - if (!stbi__readval(s,packet->channel,value)) return 0; - - for(i=0; ichannel,dest,value); - left -= count; - } - } - break; - - case 2: {//Mixed RLE - int left=width; - while (left>0) { - int count = stbi__get8(s), i; - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)"); - - if (count >= 128) { // Repeated - stbi_uc value[4]; - - if (count==128) - count = stbi__get16be(s); - else - count -= 127; - if (count > left) - return stbi__errpuc("bad file","scanline overrun"); - - if (!stbi__readval(s,packet->channel,value)) - return 0; - - for(i=0;ichannel,dest,value); - } else { // Raw - ++count; - if (count>left) return stbi__errpuc("bad file","scanline overrun"); - - for(i=0;ichannel,dest)) - return 0; - } - left-=count; - } - break; - } - } - } - } - - return result; -} - -static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp) -{ - stbi_uc *result; - int i, x,y; - - for (i=0; i<92; ++i) - stbi__get8(s); - - x = stbi__get16be(s); - y = stbi__get16be(s); - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); - if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode"); - - stbi__get32be(s); //skip `ratio' - stbi__get16be(s); //skip `fields' - stbi__get16be(s); //skip `pad' - - // intermediate buffer is RGBA - result = (stbi_uc *) stbi__malloc(x*y*4); - memset(result, 0xff, x*y*4); - - if (!stbi__pic_load_core(s,x,y,comp, result)) { - STBI_FREE(result); - result=0; - } - *px = x; - *py = y; - if (req_comp == 0) req_comp = *comp; - result=stbi__convert_format(result,4,req_comp,x,y); - - return result; -} - -static int stbi__pic_test(stbi__context *s) -{ - int r = stbi__pic_test_core(s); - stbi__rewind(s); - return r; -} -#endif - -// ************************************************************************************************* -// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb - -#ifndef STBI_NO_GIF -typedef struct -{ - stbi__int16 prefix; - stbi_uc first; - stbi_uc suffix; -} stbi__gif_lzw; - -typedef struct -{ - int w,h; - stbi_uc *out, *old_out; // output buffer (always 4 components) - int flags, bgindex, ratio, transparent, eflags, delay; - stbi_uc pal[256][4]; - stbi_uc lpal[256][4]; - stbi__gif_lzw codes[4096]; - stbi_uc *color_table; - int parse, step; - int lflags; - int start_x, start_y; - int max_x, max_y; - int cur_x, cur_y; - int line_size; -} stbi__gif; - -static int stbi__gif_test_raw(stbi__context *s) -{ - int sz; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0; - sz = stbi__get8(s); - if (sz != '9' && sz != '7') return 0; - if (stbi__get8(s) != 'a') return 0; - return 1; -} - -static int stbi__gif_test(stbi__context *s) -{ - int r = stbi__gif_test_raw(s); - stbi__rewind(s); - return r; -} - -static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp) -{ - int i; - for (i=0; i < num_entries; ++i) { - pal[i][2] = stbi__get8(s); - pal[i][1] = stbi__get8(s); - pal[i][0] = stbi__get8(s); - pal[i][3] = transp == i ? 0 : 255; - } -} - -static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) -{ - stbi_uc version; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') - return stbi__err("not GIF", "Corrupt GIF"); - - version = stbi__get8(s); - if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); - if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF"); - - stbi__g_failure_reason = ""; - g->w = stbi__get16le(s); - g->h = stbi__get16le(s); - g->flags = stbi__get8(s); - g->bgindex = stbi__get8(s); - g->ratio = stbi__get8(s); - g->transparent = -1; - - if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments - - if (is_info) return 1; - - if (g->flags & 0x80) - stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1); - - return 1; -} - -static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) -{ - stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); - if (!stbi__gif_header(s, g, comp, 1)) { - STBI_FREE(g); - stbi__rewind( s ); - return 0; - } - if (x) *x = g->w; - if (y) *y = g->h; - STBI_FREE(g); - return 1; -} - -static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) -{ - stbi_uc *p, *c; - - // recurse to decode the prefixes, since the linked-list is backwards, - // and working backwards through an interleaved image would be nasty - if (g->codes[code].prefix >= 0) - stbi__out_gif_code(g, g->codes[code].prefix); - - if (g->cur_y >= g->max_y) return; - - p = &g->out[g->cur_x + g->cur_y]; - c = &g->color_table[g->codes[code].suffix * 4]; - - if (c[3] >= 128) { - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; - p[3] = c[3]; - } - g->cur_x += 4; - - if (g->cur_x >= g->max_x) { - g->cur_x = g->start_x; - g->cur_y += g->step; - - while (g->cur_y >= g->max_y && g->parse > 0) { - g->step = (1 << g->parse) * g->line_size; - g->cur_y = g->start_y + (g->step >> 1); - --g->parse; - } - } -} - -static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) -{ - stbi_uc lzw_cs; - stbi__int32 len, init_code; - stbi__uint32 first; - stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; - stbi__gif_lzw *p; - - lzw_cs = stbi__get8(s); - if (lzw_cs > 12) return NULL; - clear = 1 << lzw_cs; - first = 1; - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - bits = 0; - valid_bits = 0; - for (init_code = 0; init_code < clear; init_code++) { - g->codes[init_code].prefix = -1; - g->codes[init_code].first = (stbi_uc) init_code; - g->codes[init_code].suffix = (stbi_uc) init_code; - } - - // support no starting clear code - avail = clear+2; - oldcode = -1; - - len = 0; - for(;;) { - if (valid_bits < codesize) { - if (len == 0) { - len = stbi__get8(s); // start new block - if (len == 0) - return g->out; - } - --len; - bits |= (stbi__int32) stbi__get8(s) << valid_bits; - valid_bits += 8; - } else { - stbi__int32 code = bits & codemask; - bits >>= codesize; - valid_bits -= codesize; - // @OPTIMIZE: is there some way we can accelerate the non-clear path? - if (code == clear) { // clear code - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - avail = clear + 2; - oldcode = -1; - first = 0; - } else if (code == clear + 1) { // end of stream code - stbi__skip(s, len); - while ((len = stbi__get8(s)) > 0) - stbi__skip(s,len); - return g->out; - } else if (code <= avail) { - if (first) return stbi__errpuc("no clear code", "Corrupt GIF"); - - if (oldcode >= 0) { - p = &g->codes[avail++]; - if (avail > 4096) return stbi__errpuc("too many codes", "Corrupt GIF"); - p->prefix = (stbi__int16) oldcode; - p->first = g->codes[oldcode].first; - p->suffix = (code == avail) ? p->first : g->codes[code].first; - } else if (code == avail) - return stbi__errpuc("illegal code in raster", "Corrupt GIF"); - - stbi__out_gif_code(g, (stbi__uint16) code); - - if ((avail & codemask) == 0 && avail <= 0x0FFF) { - codesize++; - codemask = (1 << codesize) - 1; - } - - oldcode = code; - } else { - return stbi__errpuc("illegal code in raster", "Corrupt GIF"); - } - } - } -} - -static void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1, int y1) -{ - int x, y; - stbi_uc *c = g->pal[g->bgindex]; - for (y = y0; y < y1; y += 4 * g->w) { - for (x = x0; x < x1; x += 4) { - stbi_uc *p = &g->out[y + x]; - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; - p[3] = 0; - } - } -} - -// this function is designed to support animated gifs, although stb_image doesn't support it -static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp) -{ - int i; - stbi_uc *prev_out = 0; - - if (g->out == 0 && !stbi__gif_header(s, g, comp,0)) - return 0; // stbi__g_failure_reason set by stbi__gif_header - - prev_out = g->out; - g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h); - if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory"); - - switch ((g->eflags & 0x1C) >> 2) { - case 0: // unspecified (also always used on 1st frame) - stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h); - break; - case 1: // do not dispose - if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); - g->old_out = prev_out; - break; - case 2: // dispose to background - if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h); - stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x, g->max_y); - break; - case 3: // dispose to previous - if (g->old_out) { - for (i = g->start_y; i < g->max_y; i += 4 * g->w) - memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x], g->max_x - g->start_x); - } - break; - } - - for (;;) { - switch (stbi__get8(s)) { - case 0x2C: /* Image Descriptor */ - { - int prev_trans = -1; - stbi__int32 x, y, w, h; - stbi_uc *o; - - x = stbi__get16le(s); - y = stbi__get16le(s); - w = stbi__get16le(s); - h = stbi__get16le(s); - if (((x + w) > (g->w)) || ((y + h) > (g->h))) - return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); - - g->line_size = g->w * 4; - g->start_x = x * 4; - g->start_y = y * g->line_size; - g->max_x = g->start_x + w * 4; - g->max_y = g->start_y + h * g->line_size; - g->cur_x = g->start_x; - g->cur_y = g->start_y; - - g->lflags = stbi__get8(s); - - if (g->lflags & 0x40) { - g->step = 8 * g->line_size; // first interlaced spacing - g->parse = 3; - } else { - g->step = g->line_size; - g->parse = 0; - } - - if (g->lflags & 0x80) { - stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1); - g->color_table = (stbi_uc *) g->lpal; - } else if (g->flags & 0x80) { - if (g->transparent >= 0 && (g->eflags & 0x01)) { - prev_trans = g->pal[g->transparent][3]; - g->pal[g->transparent][3] = 0; - } - g->color_table = (stbi_uc *) g->pal; - } else - return stbi__errpuc("missing color table", "Corrupt GIF"); - - o = stbi__process_gif_raster(s, g); - if (o == NULL) return NULL; - - if (prev_trans != -1) - g->pal[g->transparent][3] = (stbi_uc) prev_trans; - - return o; - } - - case 0x21: // Comment Extension. - { - int len; - if (stbi__get8(s) == 0xF9) { // Graphic Control Extension. - len = stbi__get8(s); - if (len == 4) { - g->eflags = stbi__get8(s); - g->delay = stbi__get16le(s); - g->transparent = stbi__get8(s); - } else { - stbi__skip(s, len); - break; - } - } - while ((len = stbi__get8(s)) != 0) - stbi__skip(s, len); - break; - } - - case 0x3B: // gif stream termination code - return (stbi_uc *) s; // using '1' causes warning on some compilers - - default: - return stbi__errpuc("unknown code", "Corrupt GIF"); - } - } - - STBI_NOTUSED(req_comp); -} - -static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi_uc *u = 0; - stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); - memset(g, 0, sizeof(*g)); - - u = stbi__gif_load_next(s, g, comp, req_comp); - if (u == (stbi_uc *) s) u = 0; // end of animated gif marker - if (u) { - *x = g->w; - *y = g->h; - if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g->w, g->h); - } - else if (g->out) - STBI_FREE(g->out); - STBI_FREE(g); - return u; -} - -static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) -{ - return stbi__gif_info_raw(s,x,y,comp); -} -#endif - -// ************************************************************************************************* -// Radiance RGBE HDR loader -// originally by Nicolas Schulz -#ifndef STBI_NO_HDR -static int stbi__hdr_test_core(stbi__context *s) -{ - const char *signature = "#?RADIANCE\n"; - int i; - for (i=0; signature[i]; ++i) - if (stbi__get8(s) != signature[i]) - return 0; - return 1; -} - -static int stbi__hdr_test(stbi__context* s) -{ - int r = stbi__hdr_test_core(s); - stbi__rewind(s); - return r; -} - -#define STBI__HDR_BUFLEN 1024 -static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) -{ - int len=0; - char c = '\0'; - - c = (char) stbi__get8(z); - - while (!stbi__at_eof(z) && c != '\n') { - buffer[len++] = c; - if (len == STBI__HDR_BUFLEN-1) { - // flush to end of line - while (!stbi__at_eof(z) && stbi__get8(z) != '\n') - ; - break; - } - c = (char) stbi__get8(z); - } - - buffer[len] = 0; - return buffer; -} - -static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp) -{ - if ( input[3] != 0 ) { - float f1; - // Exponent - f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); - if (req_comp <= 2) - output[0] = (input[0] + input[1] + input[2]) * f1 / 3; - else { - output[0] = input[0] * f1; - output[1] = input[1] * f1; - output[2] = input[2] * f1; - } - if (req_comp == 2) output[1] = 1; - if (req_comp == 4) output[3] = 1; - } else { - switch (req_comp) { - case 4: output[3] = 1; /* fallthrough */ - case 3: output[0] = output[1] = output[2] = 0; - break; - case 2: output[1] = 1; /* fallthrough */ - case 1: output[0] = 0; - break; - } - } -} - -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - char buffer[STBI__HDR_BUFLEN]; - char *token; - int valid = 0; - int width, height; - stbi_uc *scanline; - float *hdr_data; - int len; - unsigned char count, value; - int i, j, k, c1,c2, z; - - - // Check identifier - if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0) - return stbi__errpf("not HDR", "Corrupt HDR image"); - - // Parse header - for(;;) { - token = stbi__hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format"); - - // Parse width and height - // can't use sscanf() if we're not using stdio! - token = stbi__hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); - token += 3; - height = (int) strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); - token += 3; - width = (int) strtol(token, NULL, 10); - - *x = width; - *y = height; - - if (comp) *comp = 3; - if (req_comp == 0) req_comp = 3; - - // Read data - hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float)); - - // Load image data - // image data is stored as some number of sca - if ( width < 8 || width >= 32768) { - // Read flat data - for (j=0; j < height; ++j) { - for (i=0; i < width; ++i) { - stbi_uc rgbe[4]; - main_decode_loop: - stbi__getn(s, rgbe, 4); - stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); - } - } - } else { - // Read RLE-encoded data - scanline = NULL; - - for (j = 0; j < height; ++j) { - c1 = stbi__get8(s); - c2 = stbi__get8(s); - len = stbi__get8(s); - if (c1 != 2 || c2 != 2 || (len & 0x80)) { - // not run-length encoded, so we have to actually use THIS data as a decoded - // pixel (note this can't be a valid pixel--one of RGB must be >= 128) - stbi_uc rgbe[4]; - rgbe[0] = (stbi_uc) c1; - rgbe[1] = (stbi_uc) c2; - rgbe[2] = (stbi_uc) len; - rgbe[3] = (stbi_uc) stbi__get8(s); - stbi__hdr_convert(hdr_data, rgbe, req_comp); - i = 1; - j = 0; - STBI_FREE(scanline); - goto main_decode_loop; // yes, this makes no sense - } - len <<= 8; - len |= stbi__get8(s); - if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); } - if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4); - - for (k = 0; k < 4; ++k) { - i = 0; - while (i < width) { - count = stbi__get8(s); - if (count > 128) { - // Run - value = stbi__get8(s); - count -= 128; - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = value; - } else { - // Dump - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = stbi__get8(s); - } - } - } - for (i=0; i < width; ++i) - stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); - } - STBI_FREE(scanline); - } - - return hdr_data; -} - -static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp) -{ - char buffer[STBI__HDR_BUFLEN]; - char *token; - int valid = 0; - - if (stbi__hdr_test(s) == 0) { - stbi__rewind( s ); - return 0; - } - - for(;;) { - token = stbi__hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) { - stbi__rewind( s ); - return 0; - } - token = stbi__hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) { - stbi__rewind( s ); - return 0; - } - token += 3; - *y = (int) strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) { - stbi__rewind( s ); - return 0; - } - token += 3; - *x = (int) strtol(token, NULL, 10); - *comp = 3; - return 1; -} -#endif // STBI_NO_HDR - -#ifndef STBI_NO_BMP -static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) -{ - void *p; - stbi__bmp_data info; - - info.all_a = 255; - p = stbi__bmp_parse_header(s, &info); - stbi__rewind( s ); - if (p == NULL) - return 0; - *x = s->img_x; - *y = s->img_y; - *comp = info.ma ? 4 : 3; - return 1; -} -#endif - -#ifndef STBI_NO_PSD -static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) -{ - int channelCount; - if (stbi__get32be(s) != 0x38425053) { - stbi__rewind( s ); - return 0; - } - if (stbi__get16be(s) != 1) { - stbi__rewind( s ); - return 0; - } - stbi__skip(s, 6); - channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) { - stbi__rewind( s ); - return 0; - } - *y = stbi__get32be(s); - *x = stbi__get32be(s); - if (stbi__get16be(s) != 8) { - stbi__rewind( s ); - return 0; - } - if (stbi__get16be(s) != 3) { - stbi__rewind( s ); - return 0; - } - *comp = 4; - return 1; -} -#endif - -#ifndef STBI_NO_PIC -static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) -{ - int act_comp=0,num_packets=0,chained; - stbi__pic_packet packets[10]; - - if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) { - stbi__rewind(s); - return 0; - } - - stbi__skip(s, 88); - - *x = stbi__get16be(s); - *y = stbi__get16be(s); - if (stbi__at_eof(s)) { - stbi__rewind( s); - return 0; - } - if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) { - stbi__rewind( s ); - return 0; - } - - stbi__skip(s, 8); - - do { - stbi__pic_packet *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return 0; - - packet = &packets[num_packets++]; - chained = stbi__get8(s); - packet->size = stbi__get8(s); - packet->type = stbi__get8(s); - packet->channel = stbi__get8(s); - act_comp |= packet->channel; - - if (stbi__at_eof(s)) { - stbi__rewind( s ); - return 0; - } - if (packet->size != 8) { - stbi__rewind( s ); - return 0; - } - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); - - return 1; -} -#endif - -// ************************************************************************************************* -// Portable Gray Map and Portable Pixel Map loader -// by Ken Miller -// -// PGM: http://netpbm.sourceforge.net/doc/pgm.html -// PPM: http://netpbm.sourceforge.net/doc/ppm.html -// -// Known limitations: -// Does not support comments in the header section -// Does not support ASCII image data (formats P2 and P3) -// Does not support 16-bit-per-channel - -#ifndef STBI_NO_PNM - -static int stbi__pnm_test(stbi__context *s) -{ - char p, t; - p = (char) stbi__get8(s); - t = (char) stbi__get8(s); - if (p != 'P' || (t != '5' && t != '6')) { - stbi__rewind( s ); - return 0; - } - return 1; -} - -static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi_uc *out; - if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n)) - return 0; - *x = s->img_x; - *y = s->img_y; - *comp = s->img_n; - - out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - stbi__getn(s, out, s->img_n * s->img_x * s->img_y); - - if (req_comp && req_comp != s->img_n) { - out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y); - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - return out; -} - -static int stbi__pnm_isspace(char c) -{ - return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'; -} - -static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) -{ - for (;;) { - while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) - *c = (char) stbi__get8(s); - - if (stbi__at_eof(s) || *c != '#') - break; - - while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' ) - *c = (char) stbi__get8(s); - } -} - -static int stbi__pnm_isdigit(char c) -{ - return c >= '0' && c <= '9'; -} - -static int stbi__pnm_getinteger(stbi__context *s, char *c) -{ - int value = 0; - - while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) { - value = value*10 + (*c - '0'); - *c = (char) stbi__get8(s); - } - - return value; -} - -static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) -{ - int maxv; - char c, p, t; - - stbi__rewind( s ); - - // Get identifier - p = (char) stbi__get8(s); - t = (char) stbi__get8(s); - if (p != 'P' || (t != '5' && t != '6')) { - stbi__rewind( s ); - return 0; - } - - *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm - - c = (char) stbi__get8(s); - stbi__pnm_skip_whitespace(s, &c); - - *x = stbi__pnm_getinteger(s, &c); // read width - stbi__pnm_skip_whitespace(s, &c); - - *y = stbi__pnm_getinteger(s, &c); // read height - stbi__pnm_skip_whitespace(s, &c); - - maxv = stbi__pnm_getinteger(s, &c); // read max value - - if (maxv > 255) - return stbi__err("max value > 255", "PPM image not 8-bit"); - else - return 1; -} -#endif - -static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) -{ - #ifndef STBI_NO_JPEG - if (stbi__jpeg_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PNG - if (stbi__png_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_GIF - if (stbi__gif_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_BMP - if (stbi__bmp_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PSD - if (stbi__psd_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PIC - if (stbi__pic_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PNM - if (stbi__pnm_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_HDR - if (stbi__hdr_info(s, x, y, comp)) return 1; - #endif - - // test tga last because it's a crappy test! - #ifndef STBI_NO_TGA - if (stbi__tga_info(s, x, y, comp)) - return 1; - #endif - return stbi__err("unknown image type", "Image not of any known type, or corrupt"); -} - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) -{ - FILE *f = stbi__fopen(filename, "rb"); - int result; - if (!f) return stbi__err("can't fopen", "Unable to open file"); - result = stbi_info_from_file(f, x, y, comp); - fclose(f); - return result; -} - -STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) -{ - int r; - stbi__context s; - long pos = ftell(f); - stbi__start_file(&s, f); - r = stbi__info_main(&s,x,y,comp); - fseek(f,pos,SEEK_SET); - return r; -} -#endif // !STBI_NO_STDIO - -STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__info_main(&s,x,y,comp); -} - -STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); - return stbi__info_main(&s,x,y,comp); -} - -#endif // STB_IMAGE_IMPLEMENTATION - -/* - revision history: - 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes - 2.11 (2016-04-02) allocate large structures on the stack - remove white matting for transparent PSD - fix reported channel count for PNG & BMP - re-enable SSE2 in non-gcc 64-bit - support RGB-formatted JPEG - read 16-bit PNGs (only as 8-bit) - 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED - 2.09 (2016-01-16) allow comments in PNM files - 16-bit-per-pixel TGA (not bit-per-component) - info() for TGA could break due to .hdr handling - info() for BMP to shares code instead of sloppy parse - can use STBI_REALLOC_SIZED if allocator doesn't support realloc - code cleanup - 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA - 2.07 (2015-09-13) fix compiler warnings - partial animated GIF support - limited 16-bpc PSD support - #ifdef unused functions - bug with < 92 byte PIC,PNM,HDR,TGA - 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value - 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning - 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit - 2.03 (2015-04-12) extra corruption checking (mmozeiko) - stbi_set_flip_vertically_on_load (nguillemot) - fix NEON support; fix mingw support - 2.02 (2015-01-19) fix incorrect assert, fix warning - 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2 - 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG - 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg) - progressive JPEG (stb) - PGM/PPM support (Ken Miller) - STBI_MALLOC,STBI_REALLOC,STBI_FREE - GIF bugfix -- seemingly never worked - STBI_NO_*, STBI_ONLY_* - 1.48 (2014-12-14) fix incorrectly-named assert() - 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb) - optimize PNG (ryg) - fix bug in interlaced PNG with user-specified channel count (stb) - 1.46 (2014-08-26) - fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG - 1.45 (2014-08-16) - fix MSVC-ARM internal compiler error by wrapping malloc - 1.44 (2014-08-07) - various warning fixes from Ronny Chevalier - 1.43 (2014-07-15) - fix MSVC-only compiler problem in code changed in 1.42 - 1.42 (2014-07-09) - don't define _CRT_SECURE_NO_WARNINGS (affects user code) - fixes to stbi__cleanup_jpeg path - added STBI_ASSERT to avoid requiring assert.h - 1.41 (2014-06-25) - fix search&replace from 1.36 that messed up comments/error messages - 1.40 (2014-06-22) - fix gcc struct-initialization warning - 1.39 (2014-06-15) - fix to TGA optimization when req_comp != number of components in TGA; - fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite) - add support for BMP version 5 (more ignored fields) - 1.38 (2014-06-06) - suppress MSVC warnings on integer casts truncating values - fix accidental rename of 'skip' field of I/O - 1.37 (2014-06-04) - remove duplicate typedef - 1.36 (2014-06-03) - convert to header file single-file library - if de-iphone isn't set, load iphone images color-swapped instead of returning NULL - 1.35 (2014-05-27) - various warnings - fix broken STBI_SIMD path - fix bug where stbi_load_from_file no longer left file pointer in correct place - fix broken non-easy path for 32-bit BMP (possibly never used) - TGA optimization by Arseny Kapoulkine - 1.34 (unknown) - use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case - 1.33 (2011-07-14) - make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements - 1.32 (2011-07-13) - support for "info" function for all supported filetypes (SpartanJ) - 1.31 (2011-06-20) - a few more leak fixes, bug in PNG handling (SpartanJ) - 1.30 (2011-06-11) - added ability to load files via callbacks to accomidate custom input streams (Ben Wenger) - removed deprecated format-specific test/load functions - removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway - error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) - fix inefficiency in decoding 32-bit BMP (David Woo) - 1.29 (2010-08-16) - various warning fixes from Aurelien Pocheville - 1.28 (2010-08-01) - fix bug in GIF palette transparency (SpartanJ) - 1.27 (2010-08-01) - cast-to-stbi_uc to fix warnings - 1.26 (2010-07-24) - fix bug in file buffering for PNG reported by SpartanJ - 1.25 (2010-07-17) - refix trans_data warning (Won Chun) - 1.24 (2010-07-12) - perf improvements reading from files on platforms with lock-heavy fgetc() - minor perf improvements for jpeg - deprecated type-specific functions so we'll get feedback if they're needed - attempt to fix trans_data warning (Won Chun) - 1.23 fixed bug in iPhone support - 1.22 (2010-07-10) - removed image *writing* support - stbi_info support from Jetro Lauha - GIF support from Jean-Marc Lienher - iPhone PNG-extensions from James Brown - warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva) - 1.21 fix use of 'stbi_uc' in header (reported by jon blow) - 1.20 added support for Softimage PIC, by Tom Seddon - 1.19 bug in interlaced PNG corruption check (found by ryg) - 1.18 (2008-08-02) - fix a threading bug (local mutable static) - 1.17 support interlaced PNG - 1.16 major bugfix - stbi__convert_format converted one too many pixels - 1.15 initialize some fields for thread safety - 1.14 fix threadsafe conversion bug - header-file-only version (#define STBI_HEADER_FILE_ONLY before including) - 1.13 threadsafe - 1.12 const qualifiers in the API - 1.11 Support installable IDCT, colorspace conversion routines - 1.10 Fixes for 64-bit (don't use "unsigned long") - optimized upsampling by Fabian "ryg" Giesen - 1.09 Fix format-conversion for PSD code (bad global variables!) - 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz - 1.07 attempt to fix C++ warning/errors again - 1.06 attempt to fix C++ warning/errors again - 1.05 fix TGA loading to return correct *comp and use good luminance calc - 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free - 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR - 1.02 support for (subset of) HDR files, float interface for preferred access to them - 1.01 fix bug: possible bug in handling right-side up bmps... not sure - fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all - 1.00 interface to zlib that skips zlib header - 0.99 correct handling of alpha in palette - 0.98 TGA loader by lonesock; dynamically add loaders (untested) - 0.97 jpeg errors on too large a file; also catch another malloc failure - 0.96 fix detection of invalid v value - particleman@mollyrocket forum - 0.95 during header scan, seek to markers in case of padding - 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same - 0.93 handle jpegtran output; verbose errors - 0.92 read 4,8,16,24,32-bit BMP files of several formats - 0.91 output 24-bit Windows 3.0 BMP files - 0.90 fix a few more warnings; bump version number to approach 1.0 - 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd - 0.60 fix compiling as c++ - 0.59 fix warnings: merge Dave Moore's -Wall fixes - 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian - 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available - 0.56 fix bug: zlib uncompressed mode len vs. nlen - 0.55 fix bug: restart_interval not initialized to 0 - 0.54 allow NULL for 'int *comp' - 0.53 fix bug in png 3->4; speedup png decoding - 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments - 0.51 obey req_comp requests, 1-component jpegs return as 1-component, - on 'test' only check type, not whether we support this variant - 0.50 (2006-11-19) - first released version -*/ diff --git a/src/stb_image_resize.h b/src/stb_image_resize.h deleted file mode 100644 index 4cabe540..00000000 --- a/src/stb_image_resize.h +++ /dev/null @@ -1,2578 +0,0 @@ -/* stb_image_resize - v0.91 - public domain image resizing - by Jorge L Rodriguez (@VinoBS) - 2014 - http://github.com/nothings/stb - - Written with emphasis on usability, portability, and efficiency. (No - SIMD or threads, so it be easily outperformed by libs that use those.) - Only scaling and translation is supported, no rotations or shears. - Easy API downsamples w/Mitchell filter, upsamples w/cubic interpolation. - - COMPILING & LINKING - In one C/C++ file that #includes this file, do this: - #define STB_IMAGE_RESIZE_IMPLEMENTATION - before the #include. That will create the implementation in that file. - - QUICKSTART - stbir_resize_uint8( input_pixels , in_w , in_h , 0, - output_pixels, out_w, out_h, 0, num_channels) - stbir_resize_float(...) - stbir_resize_uint8_srgb( input_pixels , in_w , in_h , 0, - output_pixels, out_w, out_h, 0, - num_channels , alpha_chan , 0) - stbir_resize_uint8_srgb_edgemode( - input_pixels , in_w , in_h , 0, - output_pixels, out_w, out_h, 0, - num_channels , alpha_chan , 0, STBIR_EDGE_CLAMP) - // WRAP/REFLECT/ZERO - - FULL API - See the "header file" section of the source for API documentation. - - ADDITIONAL DOCUMENTATION - - SRGB & FLOATING POINT REPRESENTATION - The sRGB functions presume IEEE floating point. If you do not have - IEEE floating point, define STBIR_NON_IEEE_FLOAT. This will use - a slower implementation. - - MEMORY ALLOCATION - The resize functions here perform a single memory allocation using - malloc. To control the memory allocation, before the #include that - triggers the implementation, do: - - #define STBIR_MALLOC(size,context) ... - #define STBIR_FREE(ptr,context) ... - - Each resize function makes exactly one call to malloc/free, so to use - temp memory, store the temp memory in the context and return that. - - ASSERT - Define STBIR_ASSERT(boolval) to override assert() and not use assert.h - - OPTIMIZATION - Define STBIR_SATURATE_INT to compute clamp values in-range using - integer operations instead of float operations. This may be faster - on some platforms. - - DEFAULT FILTERS - For functions which don't provide explicit control over what filters - to use, you can change the compile-time defaults with - - #define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_something - #define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_something - - See stbir_filter in the header-file section for the list of filters. - - NEW FILTERS - A number of 1D filter kernels are used. For a list of - supported filters see the stbir_filter enum. To add a new filter, - write a filter function and add it to stbir__filter_info_table. - - PROGRESS - For interactive use with slow resize operations, you can install - a progress-report callback: - - #define STBIR_PROGRESS_REPORT(val) some_func(val) - - The parameter val is a float which goes from 0 to 1 as progress is made. - - For example: - - static void my_progress_report(float progress); - #define STBIR_PROGRESS_REPORT(val) my_progress_report(val) - - #define STB_IMAGE_RESIZE_IMPLEMENTATION - #include "stb_image_resize.h" - - static void my_progress_report(float progress) - { - printf("Progress: %f%%\n", progress*100); - } - - MAX CHANNELS - If your image has more than 64 channels, define STBIR_MAX_CHANNELS - to the max you'll have. - - ALPHA CHANNEL - Most of the resizing functions provide the ability to control how - the alpha channel of an image is processed. The important things - to know about this: - - 1. The best mathematically-behaved version of alpha to use is - called "premultiplied alpha", in which the other color channels - have had the alpha value multiplied in. If you use premultiplied - alpha, linear filtering (such as image resampling done by this - library, or performed in texture units on GPUs) does the "right - thing". While premultiplied alpha is standard in the movie CGI - industry, it is still uncommon in the videogame/real-time world. - - If you linearly filter non-premultiplied alpha, strange effects - occur. (For example, the average of 1% opaque bright green - and 99% opaque black produces 50% transparent dark green when - non-premultiplied, whereas premultiplied it produces 50% - transparent near-black. The former introduces green energy - that doesn't exist in the source image.) - - 2. Artists should not edit premultiplied-alpha images; artists - want non-premultiplied alpha images. Thus, art tools generally output - non-premultiplied alpha images. - - 3. You will get best results in most cases by converting images - to premultiplied alpha before processing them mathematically. - - 4. If you pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED, the - resizer does not do anything special for the alpha channel; - it is resampled identically to other channels. This produces - the correct results for premultiplied-alpha images, but produces - less-than-ideal results for non-premultiplied-alpha images. - - 5. If you do not pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED, - then the resizer weights the contribution of input pixels - based on their alpha values, or, equivalently, it multiplies - the alpha value into the color channels, resamples, then divides - by the resultant alpha value. Input pixels which have alpha=0 do - not contribute at all to output pixels unless _all_ of the input - pixels affecting that output pixel have alpha=0, in which case - the result for that pixel is the same as it would be without - STBIR_FLAG_ALPHA_PREMULTIPLIED. However, this is only true for - input images in integer formats. For input images in float format, - input pixels with alpha=0 have no effect, and output pixels - which have alpha=0 will be 0 in all channels. (For float images, - you can manually achieve the same result by adding a tiny epsilon - value to the alpha channel of every image, and then subtracting - or clamping it at the end.) - - 6. You can suppress the behavior described in #5 and make - all-0-alpha pixels have 0 in all channels by #defining - STBIR_NO_ALPHA_EPSILON. - - 7. You can separately control whether the alpha channel is - interpreted as linear or affected by the colorspace. By default - it is linear; you almost never want to apply the colorspace. - (For example, graphics hardware does not apply sRGB conversion - to the alpha channel.) - - ADDITIONAL CONTRIBUTORS - Sean Barrett: API design, optimizations - - REVISIONS - 0.91 (2016-04-02) fix warnings; fix handling of subpixel regions - 0.90 (2014-09-17) first released version - - LICENSE - - This software is dual-licensed to the public domain and under the following - license: you are granted a perpetual, irrevocable license to copy, modify, - publish, and distribute this file as you see fit. - - TODO - Don't decode all of the image data when only processing a partial tile - Don't use full-width decode buffers when only processing a partial tile - When processing wide images, break processing into tiles so data fits in L1 cache - Installable filters? - Resize that respects alpha test coverage - (Reference code: FloatImage::alphaTestCoverage and FloatImage::scaleAlphaToCoverage: - https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp ) -*/ - -#ifndef STBIR_INCLUDE_STB_IMAGE_RESIZE_H -#define STBIR_INCLUDE_STB_IMAGE_RESIZE_H - -#ifdef _MSC_VER -typedef unsigned char stbir_uint8; -typedef unsigned short stbir_uint16; -typedef unsigned int stbir_uint32; -#else -#include -typedef uint8_t stbir_uint8; -typedef uint16_t stbir_uint16; -typedef uint32_t stbir_uint32; -#endif - -#ifdef STB_IMAGE_RESIZE_STATIC -#define STBIRDEF static -#else -#ifdef __cplusplus -#define STBIRDEF extern "C" -#else -#define STBIRDEF extern -#endif -#endif - - -////////////////////////////////////////////////////////////////////////////// -// -// Easy-to-use API: -// -// * "input pixels" points to an array of image data with 'num_channels' channels (e.g. RGB=3, RGBA=4) -// * input_w is input image width (x-axis), input_h is input image height (y-axis) -// * stride is the offset between successive rows of image data in memory, in bytes. you can -// specify 0 to mean packed continuously in memory -// * alpha channel is treated identically to other channels. -// * colorspace is linear or sRGB as specified by function name -// * returned result is 1 for success or 0 in case of an error. -// #define STBIR_ASSERT() to trigger an assert on parameter validation errors. -// * Memory required grows approximately linearly with input and output size, but with -// discontinuities at input_w == output_w and input_h == output_h. -// * These functions use a "default" resampling filter defined at compile time. To change the filter, -// you can change the compile-time defaults by #defining STBIR_DEFAULT_FILTER_UPSAMPLE -// and STBIR_DEFAULT_FILTER_DOWNSAMPLE, or you can use the medium-complexity API. - -STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels); - -STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels); - - -// The following functions interpret image data as gamma-corrected sRGB. -// Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel, -// or otherwise provide the index of the alpha channel. Flags value -// of 0 will probably do the right thing if you're not sure what -// the flags mean. - -#define STBIR_ALPHA_CHANNEL_NONE -1 - -// Set this flag if your texture has premultiplied alpha. Otherwise, stbir will -// use alpha-weighted resampling (effectively premultiplying, resampling, -// then unpremultiplying). -#define STBIR_FLAG_ALPHA_PREMULTIPLIED (1 << 0) -// The specified alpha channel should be handled as gamma-corrected value even -// when doing sRGB operations. -#define STBIR_FLAG_ALPHA_USES_COLORSPACE (1 << 1) - -STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags); - - -typedef enum -{ - STBIR_EDGE_CLAMP = 1, - STBIR_EDGE_REFLECT = 2, - STBIR_EDGE_WRAP = 3, - STBIR_EDGE_ZERO = 4, -} stbir_edge; - -// This function adds the ability to specify how requests to sample off the edge of the image are handled. -STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode); - -////////////////////////////////////////////////////////////////////////////// -// -// Medium-complexity API -// -// This extends the easy-to-use API as follows: -// -// * Alpha-channel can be processed separately -// * If alpha_channel is not STBIR_ALPHA_CHANNEL_NONE -// * Alpha channel will not be gamma corrected (unless flags&STBIR_FLAG_GAMMA_CORRECT) -// * Filters will be weighted by alpha channel (unless flags&STBIR_FLAG_ALPHA_PREMULTIPLIED) -// * Filter can be selected explicitly -// * uint16 image type -// * sRGB colorspace available for all types -// * context parameter for passing to STBIR_MALLOC - -typedef enum -{ - STBIR_FILTER_DEFAULT = 0, // use same filter type that easy-to-use API chooses - STBIR_FILTER_BOX = 1, // A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios - STBIR_FILTER_TRIANGLE = 2, // On upsampling, produces same results as bilinear texture filtering - STBIR_FILTER_CUBICBSPLINE = 3, // The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque - STBIR_FILTER_CATMULLROM = 4, // An interpolating cubic spline - STBIR_FILTER_MITCHELL = 5, // Mitchell-Netrevalli filter with B=1/3, C=1/3 -} stbir_filter; - -typedef enum -{ - STBIR_COLORSPACE_LINEAR, - STBIR_COLORSPACE_SRGB, - - STBIR_MAX_COLORSPACES, -} stbir_colorspace; - -// The following functions are all identical except for the type of the image data - -STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - -STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - -STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - - - -////////////////////////////////////////////////////////////////////////////// -// -// Full-complexity API -// -// This extends the medium API as follows: -// -// * uint32 image type -// * not typesafe -// * separate filter types for each axis -// * separate edge modes for each axis -// * can specify scale explicitly for subpixel correctness -// * can specify image source tile using texture coordinates - -typedef enum -{ - STBIR_TYPE_UINT8 , - STBIR_TYPE_UINT16, - STBIR_TYPE_UINT32, - STBIR_TYPE_FLOAT , - - STBIR_MAX_TYPES -} stbir_datatype; - -STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context); - -STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, - float x_offset, float y_offset); - -STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1); -// (s0, t0) & (s1, t1) are the top-left and bottom right corner (uv addressing style: [0, 1]x[0, 1]) of a region of the input image to use. - -// -// -//// end header file ///////////////////////////////////////////////////// -#endif // STBIR_INCLUDE_STB_IMAGE_RESIZE_H - - - - - -#ifdef STB_IMAGE_RESIZE_IMPLEMENTATION - -#ifndef STBIR_ASSERT -#include -#define STBIR_ASSERT(x) assert(x) -#endif - -// For memset -#include - -#include - -#ifndef STBIR_MALLOC -#include -#define STBIR_MALLOC(size,c) malloc(size) -#define STBIR_FREE(ptr,c) free(ptr) -#endif - -#ifndef _MSC_VER -#ifdef __cplusplus -#define stbir__inline inline -#else -#define stbir__inline -#endif -#else -#define stbir__inline __forceinline -#endif - - -// should produce compiler error if size is wrong -typedef unsigned char stbir__validate_uint32[sizeof(stbir_uint32) == 4 ? 1 : -1]; - -#ifdef _MSC_VER -#define STBIR__NOTUSED(v) (void)(v) -#else -#define STBIR__NOTUSED(v) (void)sizeof(v) -#endif - -#define STBIR__ARRAY_SIZE(a) (sizeof((a))/sizeof((a)[0])) - -#ifndef STBIR_DEFAULT_FILTER_UPSAMPLE -#define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM -#endif - -#ifndef STBIR_DEFAULT_FILTER_DOWNSAMPLE -#define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL -#endif - -#ifndef STBIR_PROGRESS_REPORT -#define STBIR_PROGRESS_REPORT(float_0_to_1) -#endif - -#ifndef STBIR_MAX_CHANNELS -#define STBIR_MAX_CHANNELS 64 -#endif - -#if STBIR_MAX_CHANNELS > 65536 -#error "Too many channels; STBIR_MAX_CHANNELS must be no more than 65536." -// because we store the indices in 16-bit variables -#endif - -// This value is added to alpha just before premultiplication to avoid -// zeroing out color values. It is equivalent to 2^-80. If you don't want -// that behavior (it may interfere if you have floating point images with -// very small alpha values) then you can define STBIR_NO_ALPHA_EPSILON to -// disable it. -#ifndef STBIR_ALPHA_EPSILON -#define STBIR_ALPHA_EPSILON ((float)1 / (1 << 20) / (1 << 20) / (1 << 20) / (1 << 20)) -#endif - - - -#ifdef _MSC_VER -#define STBIR__UNUSED_PARAM(v) (void)(v) -#else -#define STBIR__UNUSED_PARAM(v) (void)sizeof(v) -#endif - -// must match stbir_datatype -static unsigned char stbir__type_size[] = { - 1, // STBIR_TYPE_UINT8 - 2, // STBIR_TYPE_UINT16 - 4, // STBIR_TYPE_UINT32 - 4, // STBIR_TYPE_FLOAT -}; - -// Kernel function centered at 0 -typedef float (stbir__kernel_fn)(float x, float scale); -typedef float (stbir__support_fn)(float scale); - -typedef struct -{ - stbir__kernel_fn* kernel; - stbir__support_fn* support; -} stbir__filter_info; - -// When upsampling, the contributors are which source pixels contribute. -// When downsampling, the contributors are which destination pixels are contributed to. -typedef struct -{ - int n0; // First contributing pixel - int n1; // Last contributing pixel -} stbir__contributors; - -typedef struct -{ - const void* input_data; - int input_w; - int input_h; - int input_stride_bytes; - - void* output_data; - int output_w; - int output_h; - int output_stride_bytes; - - float s0, t0, s1, t1; - - float horizontal_shift; // Units: output pixels - float vertical_shift; // Units: output pixels - float horizontal_scale; - float vertical_scale; - - int channels; - int alpha_channel; - stbir_uint32 flags; - stbir_datatype type; - stbir_filter horizontal_filter; - stbir_filter vertical_filter; - stbir_edge edge_horizontal; - stbir_edge edge_vertical; - stbir_colorspace colorspace; - - stbir__contributors* horizontal_contributors; - float* horizontal_coefficients; - - stbir__contributors* vertical_contributors; - float* vertical_coefficients; - - int decode_buffer_pixels; - float* decode_buffer; - - float* horizontal_buffer; - - // cache these because ceil/floor are inexplicably showing up in profile - int horizontal_coefficient_width; - int vertical_coefficient_width; - int horizontal_filter_pixel_width; - int vertical_filter_pixel_width; - int horizontal_filter_pixel_margin; - int vertical_filter_pixel_margin; - int horizontal_num_contributors; - int vertical_num_contributors; - - int ring_buffer_length_bytes; // The length of an individual entry in the ring buffer. The total number of ring buffers is stbir__get_filter_pixel_width(filter) - int ring_buffer_first_scanline; - int ring_buffer_last_scanline; - int ring_buffer_begin_index; - float* ring_buffer; - - float* encode_buffer; // A temporary buffer to store floats so we don't lose precision while we do multiply-adds. - - int horizontal_contributors_size; - int horizontal_coefficients_size; - int vertical_contributors_size; - int vertical_coefficients_size; - int decode_buffer_size; - int horizontal_buffer_size; - int ring_buffer_size; - int encode_buffer_size; -} stbir__info; - -static stbir__inline int stbir__min(int a, int b) -{ - return a < b ? a : b; -} - -static stbir__inline int stbir__max(int a, int b) -{ - return a > b ? a : b; -} - -static stbir__inline float stbir__saturate(float x) -{ - if (x < 0) - return 0; - - if (x > 1) - return 1; - - return x; -} - -#ifdef STBIR_SATURATE_INT -static stbir__inline stbir_uint8 stbir__saturate8(int x) -{ - if ((unsigned int) x <= 255) - return x; - - if (x < 0) - return 0; - - return 255; -} - -static stbir__inline stbir_uint16 stbir__saturate16(int x) -{ - if ((unsigned int) x <= 65535) - return x; - - if (x < 0) - return 0; - - return 65535; -} -#endif - -static float stbir__srgb_uchar_to_linear_float[256] = { - 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f, - 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f, - 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f, - 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f, - 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f, - 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f, - 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f, - 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f, - 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f, - 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f, - 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f, - 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f, - 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f, - 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f, - 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f, - 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f, - 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f, - 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f, - 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f, - 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f, - 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f, - 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f, - 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f, - 0.982251f, 0.991102f, 1.0f -}; - -static float stbir__srgb_to_linear(float f) -{ - if (f <= 0.04045f) - return f / 12.92f; - else - return (float)pow((f + 0.055f) / 1.055f, 2.4f); -} - -static float stbir__linear_to_srgb(float f) -{ - if (f <= 0.0031308f) - return f * 12.92f; - else - return 1.055f * (float)pow(f, 1 / 2.4f) - 0.055f; -} - -#ifndef STBIR_NON_IEEE_FLOAT -// From https://gist.github.com/rygorous/2203834 - -typedef union -{ - stbir_uint32 u; - float f; -} stbir__FP32; - -static const stbir_uint32 fp32_to_srgb8_tab4[104] = { - 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d, - 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a, - 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033, - 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067, - 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5, - 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2, - 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143, - 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af, - 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240, - 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300, - 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401, - 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559, - 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723, -}; - -static stbir_uint8 stbir__linear_to_srgb_uchar(float in) -{ - static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps - static const stbir__FP32 minval = { (127-13) << 23 }; - stbir_uint32 tab,bias,scale,t; - stbir__FP32 f; - - // Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively. - // The tests are carefully written so that NaNs map to 0, same as in the reference - // implementation. - if (!(in > minval.f)) // written this way to catch NaNs - in = minval.f; - if (in > almostone.f) - in = almostone.f; - - // Do the table lookup and unpack bias, scale - f.f = in; - tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20]; - bias = (tab >> 16) << 9; - scale = tab & 0xffff; - - // Grab next-highest mantissa bits and perform linear interpolation - t = (f.u >> 12) & 0xff; - return (unsigned char) ((bias + scale*t) >> 16); -} - -#else -// sRGB transition values, scaled by 1<<28 -static int stbir__srgb_offset_to_linear_scaled[256] = -{ - 0, 40738, 122216, 203693, 285170, 366648, 448125, 529603, - 611080, 692557, 774035, 855852, 942009, 1033024, 1128971, 1229926, - 1335959, 1447142, 1563542, 1685229, 1812268, 1944725, 2082664, 2226148, - 2375238, 2529996, 2690481, 2856753, 3028870, 3206888, 3390865, 3580856, - 3776916, 3979100, 4187460, 4402049, 4622919, 4850123, 5083710, 5323731, - 5570236, 5823273, 6082892, 6349140, 6622065, 6901714, 7188133, 7481369, - 7781466, 8088471, 8402427, 8723380, 9051372, 9386448, 9728650, 10078021, - 10434603, 10798439, 11169569, 11548036, 11933879, 12327139, 12727857, 13136073, - 13551826, 13975156, 14406100, 14844697, 15290987, 15745007, 16206795, 16676389, - 17153826, 17639142, 18132374, 18633560, 19142734, 19659934, 20185196, 20718552, - 21260042, 21809696, 22367554, 22933648, 23508010, 24090680, 24681686, 25281066, - 25888850, 26505076, 27129772, 27762974, 28404716, 29055026, 29713942, 30381490, - 31057708, 31742624, 32436272, 33138682, 33849884, 34569912, 35298800, 36036568, - 36783260, 37538896, 38303512, 39077136, 39859796, 40651528, 41452360, 42262316, - 43081432, 43909732, 44747252, 45594016, 46450052, 47315392, 48190064, 49074096, - 49967516, 50870356, 51782636, 52704392, 53635648, 54576432, 55526772, 56486700, - 57456236, 58435408, 59424248, 60422780, 61431036, 62449032, 63476804, 64514376, - 65561776, 66619028, 67686160, 68763192, 69850160, 70947088, 72053992, 73170912, - 74297864, 75434880, 76581976, 77739184, 78906536, 80084040, 81271736, 82469648, - 83677792, 84896192, 86124888, 87363888, 88613232, 89872928, 91143016, 92423512, - 93714432, 95015816, 96327688, 97650056, 98982952, 100326408, 101680440, 103045072, - 104420320, 105806224, 107202800, 108610064, 110028048, 111456776, 112896264, 114346544, - 115807632, 117279552, 118762328, 120255976, 121760536, 123276016, 124802440, 126339832, - 127888216, 129447616, 131018048, 132599544, 134192112, 135795792, 137410592, 139036528, - 140673648, 142321952, 143981456, 145652208, 147334208, 149027488, 150732064, 152447968, - 154175200, 155913792, 157663776, 159425168, 161197984, 162982240, 164777968, 166585184, - 168403904, 170234160, 172075968, 173929344, 175794320, 177670896, 179559120, 181458992, - 183370528, 185293776, 187228736, 189175424, 191133888, 193104112, 195086128, 197079968, - 199085648, 201103184, 203132592, 205173888, 207227120, 209292272, 211369392, 213458480, - 215559568, 217672656, 219797792, 221934976, 224084240, 226245600, 228419056, 230604656, - 232802400, 235012320, 237234432, 239468736, 241715280, 243974080, 246245120, 248528464, - 250824112, 253132064, 255452368, 257785040, 260130080, 262487520, 264857376, 267239664, -}; - -static stbir_uint8 stbir__linear_to_srgb_uchar(float f) -{ - int x = (int) (f * (1 << 28)); // has headroom so you don't need to clamp - int v = 0; - int i; - - // Refine the guess with a short binary search. - i = v + 128; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 64; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 32; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 16; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 8; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 4; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 2; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 1; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - - return (stbir_uint8) v; -} -#endif - -static float stbir__filter_trapezoid(float x, float scale) -{ - float halfscale = scale / 2; - float t = 0.5f + halfscale; - STBIR_ASSERT(scale <= 1); - - x = (float)fabs(x); - - if (x >= t) - return 0; - else - { - float r = 0.5f - halfscale; - if (x <= r) - return 1; - else - return (t - x) / scale; - } -} - -static float stbir__support_trapezoid(float scale) -{ - STBIR_ASSERT(scale <= 1); - return 0.5f + scale / 2; -} - -static float stbir__filter_triangle(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x <= 1.0f) - return 1 - x; - else - return 0; -} - -static float stbir__filter_cubic(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return (4 + x*x*(3*x - 6))/6; - else if (x < 2.0f) - return (8 + x*(-12 + x*(6 - x)))/6; - - return (0.0f); -} - -static float stbir__filter_catmullrom(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return 1 - x*x*(2.5f - 1.5f*x); - else if (x < 2.0f) - return 2 - x*(4 + x*(0.5f*x - 2.5f)); - - return (0.0f); -} - -static float stbir__filter_mitchell(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return (16 + x*x*(21 * x - 36))/18; - else if (x < 2.0f) - return (32 + x*(-60 + x*(36 - 7*x)))/18; - - return (0.0f); -} - -static float stbir__support_zero(float s) -{ - STBIR__UNUSED_PARAM(s); - return 0; -} - -static float stbir__support_one(float s) -{ - STBIR__UNUSED_PARAM(s); - return 1; -} - -static float stbir__support_two(float s) -{ - STBIR__UNUSED_PARAM(s); - return 2; -} - -static stbir__filter_info stbir__filter_info_table[] = { - { NULL, stbir__support_zero }, - { stbir__filter_trapezoid, stbir__support_trapezoid }, - { stbir__filter_triangle, stbir__support_one }, - { stbir__filter_cubic, stbir__support_two }, - { stbir__filter_catmullrom, stbir__support_two }, - { stbir__filter_mitchell, stbir__support_two }, -}; - -stbir__inline static int stbir__use_upsampling(float ratio) -{ - return ratio > 1; -} - -stbir__inline static int stbir__use_width_upsampling(stbir__info* stbir_info) -{ - return stbir__use_upsampling(stbir_info->horizontal_scale); -} - -stbir__inline static int stbir__use_height_upsampling(stbir__info* stbir_info) -{ - return stbir__use_upsampling(stbir_info->vertical_scale); -} - -// This is the maximum number of input samples that can affect an output sample -// with the given filter -static int stbir__get_filter_pixel_width(stbir_filter filter, float scale) -{ - STBIR_ASSERT(filter != 0); - STBIR_ASSERT(filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - - if (stbir__use_upsampling(scale)) - return (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2); - else - return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2 / scale); -} - -// This is how much to expand buffers to account for filters seeking outside -// the image boundaries. -static int stbir__get_filter_pixel_margin(stbir_filter filter, float scale) -{ - return stbir__get_filter_pixel_width(filter, scale) / 2; -} - -static int stbir__get_coefficient_width(stbir_filter filter, float scale) -{ - if (stbir__use_upsampling(scale)) - return (int)ceil(stbir__filter_info_table[filter].support(1 / scale) * 2); - else - return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2); -} - -static int stbir__get_contributors(float scale, stbir_filter filter, int input_size, int output_size) -{ - if (stbir__use_upsampling(scale)) - return output_size; - else - return (input_size + stbir__get_filter_pixel_margin(filter, scale) * 2); -} - -static int stbir__get_total_horizontal_coefficients(stbir__info* info) -{ - return info->horizontal_num_contributors - * stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); -} - -static int stbir__get_total_vertical_coefficients(stbir__info* info) -{ - return info->vertical_num_contributors - * stbir__get_coefficient_width (info->vertical_filter, info->vertical_scale); -} - -static stbir__contributors* stbir__get_contributor(stbir__contributors* contributors, int n) -{ - return &contributors[n]; -} - -// For perf reasons this code is duplicated in stbir__resample_horizontal_upsample/downsample, -// if you change it here change it there too. -static float* stbir__get_coefficient(float* coefficients, stbir_filter filter, float scale, int n, int c) -{ - int width = stbir__get_coefficient_width(filter, scale); - return &coefficients[width*n + c]; -} - -static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max) -{ - switch (edge) - { - case STBIR_EDGE_ZERO: - return 0; // we'll decode the wrong pixel here, and then overwrite with 0s later - - case STBIR_EDGE_CLAMP: - if (n < 0) - return 0; - - if (n >= max) - return max - 1; - - return n; // NOTREACHED - - case STBIR_EDGE_REFLECT: - { - if (n < 0) - { - if (n < max) - return -n; - else - return max - 1; - } - - if (n >= max) - { - int max2 = max * 2; - if (n >= max2) - return 0; - else - return max2 - n - 1; - } - - return n; // NOTREACHED - } - - case STBIR_EDGE_WRAP: - if (n >= 0) - return (n % max); - else - { - int m = (-n) % max; - - if (m != 0) - m = max - m; - - return (m); - } - return n; // NOTREACHED - - default: - STBIR_ASSERT(!"Unimplemented edge type"); - return 0; - } -} - -stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max) -{ - // avoid per-pixel switch - if (n >= 0 && n < max) - return n; - return stbir__edge_wrap_slow(edge, n, max); -} - -// What input pixels contribute to this output pixel? -static void stbir__calculate_sample_range_upsample(int n, float out_filter_radius, float scale_ratio, float out_shift, int* in_first_pixel, int* in_last_pixel, float* in_center_of_out) -{ - float out_pixel_center = (float)n + 0.5f; - float out_pixel_influence_lowerbound = out_pixel_center - out_filter_radius; - float out_pixel_influence_upperbound = out_pixel_center + out_filter_radius; - - float in_pixel_influence_lowerbound = (out_pixel_influence_lowerbound + out_shift) / scale_ratio; - float in_pixel_influence_upperbound = (out_pixel_influence_upperbound + out_shift) / scale_ratio; - - *in_center_of_out = (out_pixel_center + out_shift) / scale_ratio; - *in_first_pixel = (int)(floor(in_pixel_influence_lowerbound + 0.5)); - *in_last_pixel = (int)(floor(in_pixel_influence_upperbound - 0.5)); -} - -// What output pixels does this input pixel contribute to? -static void stbir__calculate_sample_range_downsample(int n, float in_pixels_radius, float scale_ratio, float out_shift, int* out_first_pixel, int* out_last_pixel, float* out_center_of_in) -{ - float in_pixel_center = (float)n + 0.5f; - float in_pixel_influence_lowerbound = in_pixel_center - in_pixels_radius; - float in_pixel_influence_upperbound = in_pixel_center + in_pixels_radius; - - float out_pixel_influence_lowerbound = in_pixel_influence_lowerbound * scale_ratio - out_shift; - float out_pixel_influence_upperbound = in_pixel_influence_upperbound * scale_ratio - out_shift; - - *out_center_of_in = in_pixel_center * scale_ratio - out_shift; - *out_first_pixel = (int)(floor(out_pixel_influence_lowerbound + 0.5)); - *out_last_pixel = (int)(floor(out_pixel_influence_upperbound - 0.5)); -} - -static void stbir__calculate_coefficients_upsample(stbir__info* stbir_info, stbir_filter filter, float scale, int in_first_pixel, int in_last_pixel, float in_center_of_out, stbir__contributors* contributor, float* coefficient_group) -{ - int i; - float total_filter = 0; - float filter_scale; - - STBIR_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. - - contributor->n0 = in_first_pixel; - contributor->n1 = in_last_pixel; - - STBIR_ASSERT(contributor->n1 >= contributor->n0); - - for (i = 0; i <= in_last_pixel - in_first_pixel; i++) - { - float in_pixel_center = (float)(i + in_first_pixel) + 0.5f; - coefficient_group[i] = stbir__filter_info_table[filter].kernel(in_center_of_out - in_pixel_center, 1 / scale); - - // If the coefficient is zero, skip it. (Don't do the <0 check here, we want the influence of those outside pixels.) - if (i == 0 && !coefficient_group[i]) - { - contributor->n0 = ++in_first_pixel; - i--; - continue; - } - - total_filter += coefficient_group[i]; - } - - STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); - - STBIR_ASSERT(total_filter > 0.9); - STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. - - // Make sure the sum of all coefficients is 1. - filter_scale = 1 / total_filter; - - for (i = 0; i <= in_last_pixel - in_first_pixel; i++) - coefficient_group[i] *= filter_scale; - - for (i = in_last_pixel - in_first_pixel; i >= 0; i--) - { - if (coefficient_group[i]) - break; - - // This line has no weight. We can skip it. - contributor->n1 = contributor->n0 + i - 1; - } -} - -static void stbir__calculate_coefficients_downsample(stbir__info* stbir_info, stbir_filter filter, float scale_ratio, int out_first_pixel, int out_last_pixel, float out_center_of_in, stbir__contributors* contributor, float* coefficient_group) -{ - int i; - - STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. - - contributor->n0 = out_first_pixel; - contributor->n1 = out_last_pixel; - - STBIR_ASSERT(contributor->n1 >= contributor->n0); - - for (i = 0; i <= out_last_pixel - out_first_pixel; i++) - { - float out_pixel_center = (float)(i + out_first_pixel) + 0.5f; - float x = out_pixel_center - out_center_of_in; - coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; - } - - STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); - - for (i = out_last_pixel - out_first_pixel; i >= 0; i--) - { - if (coefficient_group[i]) - break; - - // This line has no weight. We can skip it. - contributor->n1 = contributor->n0 + i - 1; - } -} - -static void stbir__normalize_downsample_coefficients(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size) -{ - int num_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); - int num_coefficients = stbir__get_coefficient_width(filter, scale_ratio); - int i, j; - int skip; - - for (i = 0; i < output_size; i++) - { - float scale; - float total = 0; - - for (j = 0; j < num_contributors; j++) - { - if (i >= contributors[j].n0 && i <= contributors[j].n1) - { - float coefficient = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0); - total += coefficient; - } - else if (i < contributors[j].n0) - break; - } - - STBIR_ASSERT(total > 0.9f); - STBIR_ASSERT(total < 1.1f); - - scale = 1 / total; - - for (j = 0; j < num_contributors; j++) - { - if (i >= contributors[j].n0 && i <= contributors[j].n1) - *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0) *= scale; - else if (i < contributors[j].n0) - break; - } - } - - // Optimize: Skip zero coefficients and contributions outside of image bounds. - // Do this after normalizing because normalization depends on the n0/n1 values. - for (j = 0; j < num_contributors; j++) - { - int range, max, width; - - skip = 0; - while (*stbir__get_coefficient(coefficients, filter, scale_ratio, j, skip) == 0) - skip++; - - contributors[j].n0 += skip; - - while (contributors[j].n0 < 0) - { - contributors[j].n0++; - skip++; - } - - range = contributors[j].n1 - contributors[j].n0 + 1; - max = stbir__min(num_coefficients, range); - - width = stbir__get_coefficient_width(filter, scale_ratio); - for (i = 0; i < max; i++) - { - if (i + skip >= width) - break; - - *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i) = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i + skip); - } - - continue; - } - - // Using min to avoid writing into invalid pixels. - for (i = 0; i < num_contributors; i++) - contributors[i].n1 = stbir__min(contributors[i].n1, output_size - 1); -} - -// Each scan line uses the same kernel values so we should calculate the kernel -// values once and then we can use them for every scan line. -static void stbir__calculate_filters(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size) -{ - int n; - int total_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); - - if (stbir__use_upsampling(scale_ratio)) - { - float out_pixels_radius = stbir__filter_info_table[filter].support(1 / scale_ratio) * scale_ratio; - - // Looping through out pixels - for (n = 0; n < total_contributors; n++) - { - float in_center_of_out; // Center of the current out pixel in the in pixel space - int in_first_pixel, in_last_pixel; - - stbir__calculate_sample_range_upsample(n, out_pixels_radius, scale_ratio, shift, &in_first_pixel, &in_last_pixel, &in_center_of_out); - - stbir__calculate_coefficients_upsample(stbir_info, filter, scale_ratio, in_first_pixel, in_last_pixel, in_center_of_out, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); - } - } - else - { - float in_pixels_radius = stbir__filter_info_table[filter].support(scale_ratio) / scale_ratio; - - // Looping through in pixels - for (n = 0; n < total_contributors; n++) - { - float out_center_of_in; // Center of the current out pixel in the in pixel space - int out_first_pixel, out_last_pixel; - int n_adjusted = n - stbir__get_filter_pixel_margin(filter, scale_ratio); - - stbir__calculate_sample_range_downsample(n_adjusted, in_pixels_radius, scale_ratio, shift, &out_first_pixel, &out_last_pixel, &out_center_of_in); - - stbir__calculate_coefficients_downsample(stbir_info, filter, scale_ratio, out_first_pixel, out_last_pixel, out_center_of_in, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); - } - - stbir__normalize_downsample_coefficients(stbir_info, contributors, coefficients, filter, scale_ratio, shift, input_size, output_size); - } -} - -static float* stbir__get_decode_buffer(stbir__info* stbir_info) -{ - // The 0 index of the decode buffer starts after the margin. This makes - // it okay to use negative indexes on the decode buffer. - return &stbir_info->decode_buffer[stbir_info->horizontal_filter_pixel_margin * stbir_info->channels]; -} - -#define STBIR__DECODE(type, colorspace) ((type) * (STBIR_MAX_COLORSPACES) + (colorspace)) - -static void stbir__decode_scanline(stbir__info* stbir_info, int n) -{ - int c; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int input_w = stbir_info->input_w; - int input_stride_bytes = stbir_info->input_stride_bytes; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir_edge edge_horizontal = stbir_info->edge_horizontal; - stbir_edge edge_vertical = stbir_info->edge_vertical; - int in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes; - const void* input_data = (char *) stbir_info->input_data + in_buffer_row_offset; - int max_x = input_w + stbir_info->horizontal_filter_pixel_margin; - int decode = STBIR__DECODE(type, colorspace); - - int x = -stbir_info->horizontal_filter_pixel_margin; - - // special handling for STBIR_EDGE_ZERO because it needs to return an item that doesn't appear in the input, - // and we want to avoid paying overhead on every pixel if not STBIR_EDGE_ZERO - if (edge_vertical == STBIR_EDGE_ZERO && (n < 0 || n >= stbir_info->input_h)) - { - for (; x < max_x; x++) - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - return; - } - - switch (decode) - { - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((float)((const unsigned char*)input_data)[input_pixel_index + c]) / 255; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_uchar_to_linear_float[((const unsigned char*)input_data)[input_pixel_index + c]]; - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned char*)input_data)[input_pixel_index + alpha_channel]) / 255; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned short*)input_data)[input_pixel_index + alpha_channel]) / 65535; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295); - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear((float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295)); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + alpha_channel]) / 4294967295); - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((const float*)input_data)[input_pixel_index + c]; - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((const float*)input_data)[input_pixel_index + c]); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((const float*)input_data)[input_pixel_index + alpha_channel]; - } - - break; - - default: - STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); - break; - } - - if (!(stbir_info->flags & STBIR_FLAG_ALPHA_PREMULTIPLIED)) - { - for (x = -stbir_info->horizontal_filter_pixel_margin; x < max_x; x++) - { - int decode_pixel_index = x * channels; - - // If the alpha value is 0 it will clobber the color values. Make sure it's not. - float alpha = decode_buffer[decode_pixel_index + alpha_channel]; -#ifndef STBIR_NO_ALPHA_EPSILON - if (stbir_info->type != STBIR_TYPE_FLOAT) { - alpha += STBIR_ALPHA_EPSILON; - decode_buffer[decode_pixel_index + alpha_channel] = alpha; - } -#endif - for (c = 0; c < channels; c++) - { - if (c == alpha_channel) - continue; - - decode_buffer[decode_pixel_index + c] *= alpha; - } - } - } - - if (edge_horizontal == STBIR_EDGE_ZERO) - { - for (x = -stbir_info->horizontal_filter_pixel_margin; x < 0; x++) - { - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - } - for (x = input_w; x < max_x; x++) - { - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - } - } -} - -static float* stbir__get_ring_buffer_entry(float* ring_buffer, int index, int ring_buffer_length) -{ - return &ring_buffer[index * ring_buffer_length]; -} - -static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n) -{ - int ring_buffer_index; - float* ring_buffer; - - if (stbir_info->ring_buffer_begin_index < 0) - { - ring_buffer_index = stbir_info->ring_buffer_begin_index = 0; - stbir_info->ring_buffer_first_scanline = n; - } - else - { - ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline) + 1) % stbir_info->vertical_filter_pixel_width; - STBIR_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index); - } - - ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float)); - memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes); - - stbir_info->ring_buffer_last_scanline = n; - - return ring_buffer; -} - - -static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, float* output_buffer) -{ - int x, k; - int output_w = stbir_info->output_w; - int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width; - int channels = stbir_info->channels; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; - float* horizontal_coefficients = stbir_info->horizontal_coefficients; - int coefficient_width = stbir_info->horizontal_coefficient_width; - - for (x = 0; x < output_w; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int out_pixel_index = x * channels; - int coefficient_group = coefficient_width * x; - int coefficient_counter = 0; - - STBIR_ASSERT(n1 >= n0); - STBIR_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); - - switch (channels) { - case 1: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 1; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - } - break; - case 2: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 2; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - } - break; - case 3: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 3; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - } - break; - case 4: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 4; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; - } - break; - default: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * channels; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - int c; - STBIR_ASSERT(coefficient != 0); - for (c = 0; c < channels; c++) - output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; - } - break; - } - } -} - -static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n, float* output_buffer) -{ - int x, k; - int input_w = stbir_info->input_w; - int output_w = stbir_info->output_w; - int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width; - int channels = stbir_info->channels; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; - float* horizontal_coefficients = stbir_info->horizontal_coefficients; - int coefficient_width = stbir_info->horizontal_coefficient_width; - int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin; - int max_x = input_w + filter_pixel_margin * 2; - - STBIR_ASSERT(!stbir__use_width_upsampling(stbir_info)); - - switch (channels) { - case 1: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 1; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 1; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - } - } - break; - - case 2: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 2; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 2; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - } - } - break; - - case 3: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 3; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 3; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - } - } - break; - - case 4: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 4; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 4; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; - } - } - break; - - default: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * channels; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int c; - int out_pixel_index = k * channels; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - STBIR_ASSERT(coefficient != 0); - for (c = 0; c < channels; c++) - output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; - } - } - break; - } -} - -static void stbir__decode_and_resample_upsample(stbir__info* stbir_info, int n) -{ - // Decode the nth scanline from the source image into the decode buffer. - stbir__decode_scanline(stbir_info, n); - - // Now resample it into the ring buffer. - if (stbir__use_width_upsampling(stbir_info)) - stbir__resample_horizontal_upsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n)); - else - stbir__resample_horizontal_downsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n)); - - // Now it's sitting in the ring buffer ready to be used as source for the vertical sampling. -} - -static void stbir__decode_and_resample_downsample(stbir__info* stbir_info, int n) -{ - // Decode the nth scanline from the source image into the decode buffer. - stbir__decode_scanline(stbir_info, n); - - memset(stbir_info->horizontal_buffer, 0, stbir_info->output_w * stbir_info->channels * sizeof(float)); - - // Now resample it into the horizontal buffer. - if (stbir__use_width_upsampling(stbir_info)) - stbir__resample_horizontal_upsample(stbir_info, n, stbir_info->horizontal_buffer); - else - stbir__resample_horizontal_downsample(stbir_info, n, stbir_info->horizontal_buffer); - - // Now it's sitting in the horizontal buffer ready to be distributed into the ring buffers. -} - -// Get the specified scan line from the ring buffer. -static float* stbir__get_ring_buffer_scanline(int get_scanline, float* ring_buffer, int begin_index, int first_scanline, int ring_buffer_size, int ring_buffer_length) -{ - int ring_buffer_index = (begin_index + (get_scanline - first_scanline)) % ring_buffer_size; - return stbir__get_ring_buffer_entry(ring_buffer, ring_buffer_index, ring_buffer_length); -} - - -static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixels, void *output_buffer, float *encode_buffer, int channels, int alpha_channel, int decode) -{ - int x; - int n; - int num_nonalpha; - stbir_uint16 nonalpha[STBIR_MAX_CHANNELS]; - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) - { - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - float alpha = encode_buffer[pixel_index + alpha_channel]; - float reciprocal_alpha = alpha ? 1.0f / alpha : 0; - - // unrolling this produced a 1% slowdown upscaling a large RGBA linear-space image on my machine - stb - for (n = 0; n < channels; n++) - if (n != alpha_channel) - encode_buffer[pixel_index + n] *= reciprocal_alpha; - - // We added in a small epsilon to prevent the color channel from being deleted with zero alpha. - // Because we only add it for integer types, it will automatically be discarded on integer - // conversion, so we don't need to subtract it back out (which would be problematic for - // numeric precision reasons). - } - } - - // build a table of all channels that need colorspace correction, so - // we don't perform colorspace correction on channels that don't need it. - for (x=0, num_nonalpha=0; x < channels; ++x) - if (x != alpha_channel || (stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) - nonalpha[num_nonalpha++] = x; - - #define STBIR__ROUND_INT(f) ((int) ((f)+0.5)) - #define STBIR__ROUND_UINT(f) ((stbir_uint32) ((f)+0.5)) - - #ifdef STBIR__SATURATE_INT - #define STBIR__ENCODE_LINEAR8(f) stbir__saturate8 (STBIR__ROUND_INT((f) * 255 )) - #define STBIR__ENCODE_LINEAR16(f) stbir__saturate16(STBIR__ROUND_INT((f) * 65535)) - #else - #define STBIR__ENCODE_LINEAR8(f) (unsigned char ) STBIR__ROUND_INT(stbir__saturate(f) * 255 ) - #define STBIR__ENCODE_LINEAR16(f) (unsigned short) STBIR__ROUND_INT(stbir__saturate(f) * 65535) - #endif - - switch (decode) - { - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned char*)output_buffer)[index] = STBIR__ENCODE_LINEAR8(encode_buffer[index]); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned char*)output_buffer)[index] = stbir__linear_to_srgb_uchar(encode_buffer[index]); - } - - if (!(stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned char *)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR8(encode_buffer[pixel_index+alpha_channel]); - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned short*)output_buffer)[index] = STBIR__ENCODE_LINEAR16(encode_buffer[index]); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned short*)output_buffer)[index] = (unsigned short)STBIR__ROUND_INT(stbir__linear_to_srgb(stbir__saturate(encode_buffer[index])) * 65535); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned short*)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR16(encode_buffer[pixel_index + alpha_channel]); - } - - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__saturate(encode_buffer[index])) * 4294967295); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__linear_to_srgb(stbir__saturate(encode_buffer[index]))) * 4294967295); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned int*)output_buffer)[pixel_index + alpha_channel] = (unsigned int)STBIR__ROUND_INT(((double)stbir__saturate(encode_buffer[pixel_index + alpha_channel])) * 4294967295); - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((float*)output_buffer)[index] = encode_buffer[index]; - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((float*)output_buffer)[index] = stbir__linear_to_srgb(encode_buffer[index]); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((float*)output_buffer)[pixel_index + alpha_channel] = encode_buffer[pixel_index + alpha_channel]; - } - break; - - default: - STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); - break; - } -} - -static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out) -{ - int x, k; - int output_w = stbir_info->output_w; - stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; - float* vertical_coefficients = stbir_info->vertical_coefficients; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int kernel_pixel_width = stbir_info->vertical_filter_pixel_width; - void* output_data = stbir_info->output_data; - float* encode_buffer = stbir_info->encode_buffer; - int decode = STBIR__DECODE(type, colorspace); - int coefficient_width = stbir_info->vertical_coefficient_width; - int coefficient_counter; - int contributor = n; - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; - int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; - int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - - int n0,n1, output_row_start; - int coefficient_group = coefficient_width * contributor; - - n0 = vertical_contributors[contributor].n0; - n1 = vertical_contributors[contributor].n1; - - output_row_start = n * stbir_info->output_stride_bytes; - - STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); - - memset(encode_buffer, 0, output_w * sizeof(float) * channels); - - // I tried reblocking this for better cache usage of encode_buffer - // (using x_outer, k, x_inner), but it lost speed. -- stb - - coefficient_counter = 0; - switch (channels) { - case 1: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 1; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - } - } - break; - case 2: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 2; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - } - } - break; - case 3: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 3; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; - } - } - break; - case 4: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 4; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; - encode_buffer[in_pixel_index + 3] += ring_buffer_entry[in_pixel_index + 3] * coefficient; - } - } - break; - default: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * channels; - int c; - for (c = 0; c < channels; c++) - encode_buffer[in_pixel_index + c] += ring_buffer_entry[in_pixel_index + c] * coefficient; - } - } - break; - } - stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, encode_buffer, channels, alpha_channel, decode); -} - -static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out) -{ - int x, k; - int output_w = stbir_info->output_w; - int output_h = stbir_info->output_h; - stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; - float* vertical_coefficients = stbir_info->vertical_coefficients; - int channels = stbir_info->channels; - int kernel_pixel_width = stbir_info->vertical_filter_pixel_width; - void* output_data = stbir_info->output_data; - float* horizontal_buffer = stbir_info->horizontal_buffer; - int coefficient_width = stbir_info->vertical_coefficient_width; - int contributor = n + stbir_info->vertical_filter_pixel_margin; - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; - int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; - int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - int n0,n1; - - n0 = vertical_contributors[contributor].n0; - n1 = vertical_contributors[contributor].n1; - - STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); - - for (k = n0; k <= n1; k++) - { - int coefficient_index = k - n0; - int coefficient_group = coefficient_width * contributor; - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length); - - switch (channels) { - case 1: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 1; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - } - break; - case 2: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 2; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - } - break; - case 3: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 3; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; - } - break; - case 4: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 4; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; - ring_buffer_entry[in_pixel_index + 3] += horizontal_buffer[in_pixel_index + 3] * coefficient; - } - break; - default: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * channels; - - int c; - for (c = 0; c < channels; c++) - ring_buffer_entry[in_pixel_index + c] += horizontal_buffer[in_pixel_index + c] * coefficient; - } - break; - } - } -} - -static void stbir__buffer_loop_upsample(stbir__info* stbir_info) -{ - int y; - float scale_ratio = stbir_info->vertical_scale; - float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio; - - STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); - - for (y = 0; y < stbir_info->output_h; y++) - { - float in_center_of_out = 0; // Center of the current out scanline in the in scanline space - int in_first_scanline = 0, in_last_scanline = 0; - - stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out); - - STBIR_ASSERT(in_last_scanline - in_first_scanline <= stbir_info->vertical_filter_pixel_width); - - if (stbir_info->ring_buffer_begin_index >= 0) - { - // Get rid of whatever we don't need anymore. - while (in_first_scanline > stbir_info->ring_buffer_first_scanline) - { - if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) - { - // We just popped the last scanline off the ring buffer. - // Reset it to the empty state. - stbir_info->ring_buffer_begin_index = -1; - stbir_info->ring_buffer_first_scanline = 0; - stbir_info->ring_buffer_last_scanline = 0; - break; - } - else - { - stbir_info->ring_buffer_first_scanline++; - stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width; - } - } - } - - // Load in new ones. - if (stbir_info->ring_buffer_begin_index < 0) - stbir__decode_and_resample_upsample(stbir_info, in_first_scanline); - - while (in_last_scanline > stbir_info->ring_buffer_last_scanline) - stbir__decode_and_resample_upsample(stbir_info, stbir_info->ring_buffer_last_scanline + 1); - - // Now all buffers should be ready to write a row of vertical sampling. - stbir__resample_vertical_upsample(stbir_info, y, in_first_scanline, in_last_scanline, in_center_of_out); - - STBIR_PROGRESS_REPORT((float)y / stbir_info->output_h); - } -} - -static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_necessary_scanline) -{ - int output_stride_bytes = stbir_info->output_stride_bytes; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int output_w = stbir_info->output_w; - void* output_data = stbir_info->output_data; - int decode = STBIR__DECODE(type, colorspace); - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - - if (stbir_info->ring_buffer_begin_index >= 0) - { - // Get rid of whatever we don't need anymore. - while (first_necessary_scanline > stbir_info->ring_buffer_first_scanline) - { - if (stbir_info->ring_buffer_first_scanline >= 0 && stbir_info->ring_buffer_first_scanline < stbir_info->output_h) - { - int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes; - float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length); - stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode); - STBIR_PROGRESS_REPORT((float)stbir_info->ring_buffer_first_scanline / stbir_info->output_h); - } - - if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) - { - // We just popped the last scanline off the ring buffer. - // Reset it to the empty state. - stbir_info->ring_buffer_begin_index = -1; - stbir_info->ring_buffer_first_scanline = 0; - stbir_info->ring_buffer_last_scanline = 0; - break; - } - else - { - stbir_info->ring_buffer_first_scanline++; - stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width; - } - } - } -} - -static void stbir__buffer_loop_downsample(stbir__info* stbir_info) -{ - int y; - float scale_ratio = stbir_info->vertical_scale; - int output_h = stbir_info->output_h; - float in_pixels_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(scale_ratio) / scale_ratio; - int pixel_margin = stbir_info->vertical_filter_pixel_margin; - int max_y = stbir_info->input_h + pixel_margin; - - STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); - - for (y = -pixel_margin; y < max_y; y++) - { - float out_center_of_in; // Center of the current out scanline in the in scanline space - int out_first_scanline, out_last_scanline; - - stbir__calculate_sample_range_downsample(y, in_pixels_radius, scale_ratio, stbir_info->vertical_shift, &out_first_scanline, &out_last_scanline, &out_center_of_in); - - STBIR_ASSERT(out_last_scanline - out_first_scanline <= stbir_info->vertical_filter_pixel_width); - - if (out_last_scanline < 0 || out_first_scanline >= output_h) - continue; - - stbir__empty_ring_buffer(stbir_info, out_first_scanline); - - stbir__decode_and_resample_downsample(stbir_info, y); - - // Load in new ones. - if (stbir_info->ring_buffer_begin_index < 0) - stbir__add_empty_ring_buffer_entry(stbir_info, out_first_scanline); - - while (out_last_scanline > stbir_info->ring_buffer_last_scanline) - stbir__add_empty_ring_buffer_entry(stbir_info, stbir_info->ring_buffer_last_scanline + 1); - - // Now the horizontal buffer is ready to write to all ring buffer rows. - stbir__resample_vertical_downsample(stbir_info, y, out_first_scanline, out_last_scanline, out_center_of_in); - } - - stbir__empty_ring_buffer(stbir_info, stbir_info->output_h); -} - -static void stbir__setup(stbir__info *info, int input_w, int input_h, int output_w, int output_h, int channels) -{ - info->input_w = input_w; - info->input_h = input_h; - info->output_w = output_w; - info->output_h = output_h; - info->channels = channels; -} - -static void stbir__calculate_transform(stbir__info *info, float s0, float t0, float s1, float t1, float *transform) -{ - info->s0 = s0; - info->t0 = t0; - info->s1 = s1; - info->t1 = t1; - - if (transform) - { - info->horizontal_scale = transform[0]; - info->vertical_scale = transform[1]; - info->horizontal_shift = transform[2]; - info->vertical_shift = transform[3]; - } - else - { - info->horizontal_scale = ((float)info->output_w / info->input_w) / (s1 - s0); - info->vertical_scale = ((float)info->output_h / info->input_h) / (t1 - t0); - - info->horizontal_shift = s0 * info->output_w / (s1 - s0); - info->vertical_shift = t0 * info->output_h / (t1 - t0); - } -} - -static void stbir__choose_filter(stbir__info *info, stbir_filter h_filter, stbir_filter v_filter) -{ - if (h_filter == 0) - h_filter = stbir__use_upsampling(info->horizontal_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; - if (v_filter == 0) - v_filter = stbir__use_upsampling(info->vertical_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; - info->horizontal_filter = h_filter; - info->vertical_filter = v_filter; -} - -static stbir_uint32 stbir__calculate_memory(stbir__info *info) -{ - int pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); - int filter_height = stbir__get_filter_pixel_width(info->vertical_filter, info->vertical_scale); - - info->horizontal_num_contributors = stbir__get_contributors(info->horizontal_scale, info->horizontal_filter, info->input_w, info->output_w); - info->vertical_num_contributors = stbir__get_contributors(info->vertical_scale , info->vertical_filter , info->input_h, info->output_h); - - info->horizontal_contributors_size = info->horizontal_num_contributors * sizeof(stbir__contributors); - info->horizontal_coefficients_size = stbir__get_total_horizontal_coefficients(info) * sizeof(float); - info->vertical_contributors_size = info->vertical_num_contributors * sizeof(stbir__contributors); - info->vertical_coefficients_size = stbir__get_total_vertical_coefficients(info) * sizeof(float); - info->decode_buffer_size = (info->input_w + pixel_margin * 2) * info->channels * sizeof(float); - info->horizontal_buffer_size = info->output_w * info->channels * sizeof(float); - info->ring_buffer_size = info->output_w * info->channels * filter_height * sizeof(float); - info->encode_buffer_size = info->output_w * info->channels * sizeof(float); - - STBIR_ASSERT(info->horizontal_filter != 0); - STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late - STBIR_ASSERT(info->vertical_filter != 0); - STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late - - if (stbir__use_height_upsampling(info)) - // The horizontal buffer is for when we're downsampling the height and we - // can't output the result of sampling the decode buffer directly into the - // ring buffers. - info->horizontal_buffer_size = 0; - else - // The encode buffer is to retain precision in the height upsampling method - // and isn't used when height downsampling. - info->encode_buffer_size = 0; - - return info->horizontal_contributors_size + info->horizontal_coefficients_size - + info->vertical_contributors_size + info->vertical_coefficients_size - + info->decode_buffer_size + info->horizontal_buffer_size - + info->ring_buffer_size + info->encode_buffer_size; -} - -static int stbir__resize_allocated(stbir__info *info, - const void* input_data, int input_stride_in_bytes, - void* output_data, int output_stride_in_bytes, - int alpha_channel, stbir_uint32 flags, stbir_datatype type, - stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace, - void* tempmem, size_t tempmem_size_in_bytes) -{ - size_t memory_required = stbir__calculate_memory(info); - - int width_stride_input = input_stride_in_bytes ? input_stride_in_bytes : info->channels * info->input_w * stbir__type_size[type]; - int width_stride_output = output_stride_in_bytes ? output_stride_in_bytes : info->channels * info->output_w * stbir__type_size[type]; - -#ifdef STBIR_DEBUG_OVERWRITE_TEST -#define OVERWRITE_ARRAY_SIZE 8 - unsigned char overwrite_output_before_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_tempmem_before_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_output_after_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_tempmem_after_pre[OVERWRITE_ARRAY_SIZE]; - - size_t begin_forbidden = width_stride_output * (info->output_h - 1) + info->output_w * info->channels * stbir__type_size[type]; - memcpy(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE); -#endif - - STBIR_ASSERT(info->channels >= 0); - STBIR_ASSERT(info->channels <= STBIR_MAX_CHANNELS); - - if (info->channels < 0 || info->channels > STBIR_MAX_CHANNELS) - return 0; - - STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - - if (info->horizontal_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) - return 0; - if (info->vertical_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) - return 0; - - if (alpha_channel < 0) - flags |= STBIR_FLAG_ALPHA_USES_COLORSPACE | STBIR_FLAG_ALPHA_PREMULTIPLIED; - - if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) - STBIR_ASSERT(alpha_channel >= 0 && alpha_channel < info->channels); - - if (alpha_channel >= info->channels) - return 0; - - STBIR_ASSERT(tempmem); - - if (!tempmem) - return 0; - - STBIR_ASSERT(tempmem_size_in_bytes >= memory_required); - - if (tempmem_size_in_bytes < memory_required) - return 0; - - memset(tempmem, 0, tempmem_size_in_bytes); - - info->input_data = input_data; - info->input_stride_bytes = width_stride_input; - - info->output_data = output_data; - info->output_stride_bytes = width_stride_output; - - info->alpha_channel = alpha_channel; - info->flags = flags; - info->type = type; - info->edge_horizontal = edge_horizontal; - info->edge_vertical = edge_vertical; - info->colorspace = colorspace; - - info->horizontal_coefficient_width = stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); - info->vertical_coefficient_width = stbir__get_coefficient_width (info->vertical_filter , info->vertical_scale ); - info->horizontal_filter_pixel_width = stbir__get_filter_pixel_width (info->horizontal_filter, info->horizontal_scale); - info->vertical_filter_pixel_width = stbir__get_filter_pixel_width (info->vertical_filter , info->vertical_scale ); - info->horizontal_filter_pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); - info->vertical_filter_pixel_margin = stbir__get_filter_pixel_margin(info->vertical_filter , info->vertical_scale ); - - info->ring_buffer_length_bytes = info->output_w * info->channels * sizeof(float); - info->decode_buffer_pixels = info->input_w + info->horizontal_filter_pixel_margin * 2; - -#define STBIR__NEXT_MEMPTR(current, newtype) (newtype*)(((unsigned char*)current) + current##_size) - - info->horizontal_contributors = (stbir__contributors *) tempmem; - info->horizontal_coefficients = STBIR__NEXT_MEMPTR(info->horizontal_contributors, float); - info->vertical_contributors = STBIR__NEXT_MEMPTR(info->horizontal_coefficients, stbir__contributors); - info->vertical_coefficients = STBIR__NEXT_MEMPTR(info->vertical_contributors, float); - info->decode_buffer = STBIR__NEXT_MEMPTR(info->vertical_coefficients, float); - - if (stbir__use_height_upsampling(info)) - { - info->horizontal_buffer = NULL; - info->ring_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); - info->encode_buffer = STBIR__NEXT_MEMPTR(info->ring_buffer, float); - - STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); - } - else - { - info->horizontal_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); - info->ring_buffer = STBIR__NEXT_MEMPTR(info->horizontal_buffer, float); - info->encode_buffer = NULL; - - STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); - } - -#undef STBIR__NEXT_MEMPTR - - // This signals that the ring buffer is empty - info->ring_buffer_begin_index = -1; - - stbir__calculate_filters(info, info->horizontal_contributors, info->horizontal_coefficients, info->horizontal_filter, info->horizontal_scale, info->horizontal_shift, info->input_w, info->output_w); - stbir__calculate_filters(info, info->vertical_contributors, info->vertical_coefficients, info->vertical_filter, info->vertical_scale, info->vertical_shift, info->input_h, info->output_h); - - STBIR_PROGRESS_REPORT(0); - - if (stbir__use_height_upsampling(info)) - stbir__buffer_loop_upsample(info); - else - stbir__buffer_loop_downsample(info); - - STBIR_PROGRESS_REPORT(1); - -#ifdef STBIR_DEBUG_OVERWRITE_TEST - STBIR_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0); -#endif - - return 1; -} - - -static int stbir__resize_arbitrary( - void *alloc_context, - const void* input_data, int input_w, int input_h, int input_stride_in_bytes, - void* output_data, int output_w, int output_h, int output_stride_in_bytes, - float s0, float t0, float s1, float t1, float *transform, - int channels, int alpha_channel, stbir_uint32 flags, stbir_datatype type, - stbir_filter h_filter, stbir_filter v_filter, - stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace) -{ - stbir__info info; - int result; - size_t memory_required; - void* extra_memory; - - stbir__setup(&info, input_w, input_h, output_w, output_h, channels); - stbir__calculate_transform(&info, s0,t0,s1,t1,transform); - stbir__choose_filter(&info, h_filter, v_filter); - memory_required = stbir__calculate_memory(&info); - extra_memory = STBIR_MALLOC(memory_required, alloc_context); - - if (!extra_memory) - return 0; - - result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes, - output_data, output_stride_in_bytes, - alpha_channel, flags, type, - edge_horizontal, edge_vertical, - colorspace, extra_memory, memory_required); - - STBIR_FREE(extra_memory, alloc_context); - - return result; -} - -STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); -} - -STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_FLOAT, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); -} - -STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_SRGB); -} - -STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - edge_wrap_mode, edge_wrap_mode, STBIR_COLORSPACE_SRGB); -} - -STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - -STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT16, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - - -STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_FLOAT, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - - -STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - - -STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, - float x_offset, float y_offset) -{ - float transform[4]; - transform[0] = x_scale; - transform[1] = y_scale; - transform[2] = x_offset; - transform[3] = y_offset; - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,transform,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - -STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - s0,t0,s1,t1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - -#endif // STB_IMAGE_RESIZE_IMPLEMENTATION diff --git a/src/stb_image_write.h b/src/stb_image_write.h deleted file mode 100644 index 4319c0de..00000000 --- a/src/stb_image_write.h +++ /dev/null @@ -1,1048 +0,0 @@ -/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h - writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 - no warranty implied; use at your own risk - - Before #including, - - #define STB_IMAGE_WRITE_IMPLEMENTATION - - in the file that you want to have the implementation. - - Will probably not work correctly with strict-aliasing optimizations. - -ABOUT: - - This header file is a library for writing images to C stdio. It could be - adapted to write to memory or a general streaming interface; let me know. - - The PNG output is not optimal; it is 20-50% larger than the file - written by a decent optimizing implementation. This library is designed - for source code compactness and simplicity, not optimal image file size - or run-time performance. - -BUILDING: - - You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. - You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace - malloc,realloc,free. - You can define STBIW_MEMMOVE() to replace memmove() - -USAGE: - - There are four functions, one for each image file format: - - int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); - int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); - int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); - int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); - - There are also four equivalent functions that use an arbitrary write function. You are - expected to open/close your file-equivalent before and after calling these: - - int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); - int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); - int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); - int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); - - where the callback is: - void stbi_write_func(void *context, void *data, int size); - - You can define STBI_WRITE_NO_STDIO to disable the file variant of these - functions, so the library will not use stdio.h at all. However, this will - also disable HDR writing, because it requires stdio for formatted output. - - Each function returns 0 on failure and non-0 on success. - - The functions create an image file defined by the parameters. The image - is a rectangle of pixels stored from left-to-right, top-to-bottom. - Each pixel contains 'comp' channels of data stored interleaved with 8-bits - per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is - monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall. - The *data pointer points to the first byte of the top-left-most pixel. - For PNG, "stride_in_bytes" is the distance in bytes from the first byte of - a row of pixels to the first byte of the next row of pixels. - - PNG creates output files with the same number of components as the input. - The BMP format expands Y to RGB in the file format and does not - output alpha. - - PNG supports writing rectangles of data even when the bytes storing rows of - data are not consecutive in memory (e.g. sub-rectangles of a larger image), - by supplying the stride between the beginning of adjacent rows. The other - formats do not. (Thus you cannot write a native-format BMP through the BMP - writer, both because it is in BGR order and because it may have padding - at the end of the line.) - - HDR expects linear float data. Since the format is always 32-bit rgb(e) - data, alpha (if provided) is discarded, and for monochrome data it is - replicated across all three channels. - - TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed - data, set the global variable 'stbi_write_tga_with_rle' to 0. - -CREDITS: - - PNG/BMP/TGA - Sean Barrett - HDR - Baldur Karlsson - TGA monochrome: - Jean-Sebastien Guay - misc enhancements: - Tim Kelsey - TGA RLE - Alan Hickman - initial file IO callback implementation - Emmanuel Julien - bugfixes: - github:Chribba - Guillaume Chereau - github:jry2 - github:romigrou - Sergio Gonzalez - Jonas Karlsson - Filip Wasil - Thatcher Ulrich - -LICENSE - -This software is dual-licensed to the public domain and under the following -license: you are granted a perpetual, irrevocable license to copy, modify, -publish, and distribute this file as you see fit. - -*/ - -#ifndef INCLUDE_STB_IMAGE_WRITE_H -#define INCLUDE_STB_IMAGE_WRITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef STB_IMAGE_WRITE_STATIC -#define STBIWDEF static -#else -#define STBIWDEF extern -extern int stbi_write_tga_with_rle; -#endif - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); -STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); -#endif - -typedef void stbi_write_func(void *context, void *data, int size); - -STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); - -#ifdef __cplusplus -} -#endif - -#endif//INCLUDE_STB_IMAGE_WRITE_H - -#ifdef STB_IMAGE_WRITE_IMPLEMENTATION - -#ifdef _WIN32 - #ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS - #endif - #ifndef _CRT_NONSTDC_NO_DEPRECATE - #define _CRT_NONSTDC_NO_DEPRECATE - #endif -#endif - -#ifndef STBI_WRITE_NO_STDIO -#include -#endif // STBI_WRITE_NO_STDIO - -#include -#include -#include -#include - -#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) -// ok -#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) -// ok -#else -#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." -#endif - -#ifndef STBIW_MALLOC -#define STBIW_MALLOC(sz) malloc(sz) -#define STBIW_REALLOC(p,newsz) realloc(p,newsz) -#define STBIW_FREE(p) free(p) -#endif - -#ifndef STBIW_REALLOC_SIZED -#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) -#endif - - -#ifndef STBIW_MEMMOVE -#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) -#endif - - -#ifndef STBIW_ASSERT -#include -#define STBIW_ASSERT(x) assert(x) -#endif - -#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) - -typedef struct -{ - stbi_write_func *func; - void *context; -} stbi__write_context; - -// initialize a callback-based context -static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) -{ - s->func = c; - s->context = context; -} - -#ifndef STBI_WRITE_NO_STDIO - -static void stbi__stdio_write(void *context, void *data, int size) -{ - fwrite(data,1,size,(FILE*) context); -} - -static int stbi__start_write_file(stbi__write_context *s, const char *filename) -{ - FILE *f = fopen(filename, "wb"); - stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); - return f != NULL; -} - -static void stbi__end_write_file(stbi__write_context *s) -{ - fclose((FILE *)s->context); -} - -#endif // !STBI_WRITE_NO_STDIO - -typedef unsigned int stbiw_uint32; -typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; - -#ifdef STB_IMAGE_WRITE_STATIC -static int stbi_write_tga_with_rle = 1; -#else -int stbi_write_tga_with_rle = 1; -#endif - -static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) -{ - while (*fmt) { - switch (*fmt++) { - case ' ': break; - case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); - s->func(s->context,&x,1); - break; } - case '2': { int x = va_arg(v,int); - unsigned char b[2]; - b[0] = STBIW_UCHAR(x); - b[1] = STBIW_UCHAR(x>>8); - s->func(s->context,b,2); - break; } - case '4': { stbiw_uint32 x = va_arg(v,int); - unsigned char b[4]; - b[0]=STBIW_UCHAR(x); - b[1]=STBIW_UCHAR(x>>8); - b[2]=STBIW_UCHAR(x>>16); - b[3]=STBIW_UCHAR(x>>24); - s->func(s->context,b,4); - break; } - default: - STBIW_ASSERT(0); - return; - } - } -} - -static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) -{ - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); -} - -static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) -{ - unsigned char arr[3]; - arr[0] = a, arr[1] = b, arr[2] = c; - s->func(s->context, arr, 3); -} - -static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) -{ - unsigned char bg[3] = { 255, 0, 255}, px[3]; - int k; - - if (write_alpha < 0) - s->func(s->context, &d[comp - 1], 1); - - switch (comp) { - case 1: - s->func(s->context,d,1); - break; - case 2: - if (expand_mono) - stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp - else - s->func(s->context, d, 1); // monochrome TGA - break; - case 4: - if (!write_alpha) { - // composite against pink background - for (k = 0; k < 3; ++k) - px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; - stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); - break; - } - /* FALLTHROUGH */ - case 3: - stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); - break; - } - if (write_alpha > 0) - s->func(s->context, &d[comp - 1], 1); -} - -static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) -{ - stbiw_uint32 zero = 0; - int i,j, j_end; - - if (y <= 0) - return; - - if (vdir < 0) - j_end = -1, j = y-1; - else - j_end = y, j = 0; - - for (; j != j_end; j += vdir) { - for (i=0; i < x; ++i) { - unsigned char *d = (unsigned char *) data + (j*x+i)*comp; - stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); - } - s->func(s->context, &zero, scanline_pad); - } -} - -static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) -{ - if (y < 0 || x < 0) { - return 0; - } else { - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); - stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); - return 1; - } -} - -static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) -{ - int pad = (-x*3) & 3; - return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, - "11 4 22 4" "4 44 22 444444", - 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header - 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header -} - -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_bmp_core(&s, x, y, comp, data); -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_bmp_core(&s, x, y, comp, data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif //!STBI_WRITE_NO_STDIO - -static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) -{ - int has_alpha = (comp == 2 || comp == 4); - int colorbytes = has_alpha ? comp-1 : comp; - int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 - - if (y < 0 || x < 0) - return 0; - - if (!stbi_write_tga_with_rle) { - return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, - "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); - } else { - int i,j,k; - - stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); - - for (j = y - 1; j >= 0; --j) { - unsigned char *row = (unsigned char *) data + j * x * comp; - int len; - - for (i = 0; i < x; i += len) { - unsigned char *begin = row + i * comp; - int diff = 1; - len = 1; - - if (i < x - 1) { - ++len; - diff = memcmp(begin, row + (i + 1) * comp, comp); - if (diff) { - const unsigned char *prev = begin; - for (k = i + 2; k < x && len < 128; ++k) { - if (memcmp(prev, row + k * comp, comp)) { - prev += comp; - ++len; - } else { - --len; - break; - } - } - } else { - for (k = i + 2; k < x && len < 128; ++k) { - if (!memcmp(begin, row + k * comp, comp)) { - ++len; - } else { - break; - } - } - } - } - - if (diff) { - unsigned char header = STBIW_UCHAR(len - 1); - s->func(s->context, &header, 1); - for (k = 0; k < len; ++k) { - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); - } - } else { - unsigned char header = STBIW_UCHAR(len - 129); - s->func(s->context, &header, 1); - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); - } - } - } - } - return 1; -} - -int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_tga_core(&s, x, y, comp, (void *) data); -} - -#ifndef STBI_WRITE_NO_STDIO -int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif - -// ************************************************************************************************* -// Radiance RGBE HDR writer -// by Baldur Karlsson -#ifndef STBI_WRITE_NO_STDIO - -#define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) - -void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) -{ - int exponent; - float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); - - if (maxcomp < 1e-32f) { - rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; - } else { - float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; - - rgbe[0] = (unsigned char)(linear[0] * normalize); - rgbe[1] = (unsigned char)(linear[1] * normalize); - rgbe[2] = (unsigned char)(linear[2] * normalize); - rgbe[3] = (unsigned char)(exponent + 128); - } -} - -void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) -{ - unsigned char lengthbyte = STBIW_UCHAR(length+128); - STBIW_ASSERT(length+128 <= 255); - s->func(s->context, &lengthbyte, 1); - s->func(s->context, &databyte, 1); -} - -void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) -{ - unsigned char lengthbyte = STBIW_UCHAR(length); - STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code - s->func(s->context, &lengthbyte, 1); - s->func(s->context, data, length); -} - -void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) -{ - unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; - unsigned char rgbe[4]; - float linear[3]; - int x; - - scanlineheader[2] = (width&0xff00)>>8; - scanlineheader[3] = (width&0x00ff); - - /* skip RLE for images too small or large */ - if (width < 8 || width >= 32768) { - for (x=0; x < width; x++) { - switch (ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - s->func(s->context, rgbe, 4); - } - } else { - int c,r; - /* encode into scratch buffer */ - for (x=0; x < width; x++) { - switch(ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - scratch[x + width*0] = rgbe[0]; - scratch[x + width*1] = rgbe[1]; - scratch[x + width*2] = rgbe[2]; - scratch[x + width*3] = rgbe[3]; - } - - s->func(s->context, scanlineheader, 4); - - /* RLE each component separately */ - for (c=0; c < 4; c++) { - unsigned char *comp = &scratch[width*c]; - - x = 0; - while (x < width) { - // find first run - r = x; - while (r+2 < width) { - if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) - break; - ++r; - } - if (r+2 >= width) - r = width; - // dump up to first run - while (x < r) { - int len = r-x; - if (len > 128) len = 128; - stbiw__write_dump_data(s, len, &comp[x]); - x += len; - } - // if there's a run, output it - if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd - // find next byte after run - while (r < width && comp[r] == comp[x]) - ++r; - // output run up to r - while (x < r) { - int len = r-x; - if (len > 127) len = 127; - stbiw__write_run_data(s, len, comp[x]); - x += len; - } - } - } - } - } -} - -static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) -{ - if (y <= 0 || x <= 0 || data == NULL) - return 0; - else { - // Each component is stored separately. Allocate scratch space for full output scanline. - unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); - int i, len; - char buffer[128]; - char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; - s->func(s->context, header, sizeof(header)-1); - - len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); - s->func(s->context, buffer, len); - - for(i=0; i < y; i++) - stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x); - STBIW_FREE(scratch); - return 1; - } -} - -int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_hdr_core(&s, x, y, comp, (float *) data); -} - -int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif // STBI_WRITE_NO_STDIO - - -////////////////////////////////////////////////////////////////////////////// -// -// PNG writer -// - -// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() -#define stbiw__sbraw(a) ((int *) (a) - 2) -#define stbiw__sbm(a) stbiw__sbraw(a)[0] -#define stbiw__sbn(a) stbiw__sbraw(a)[1] - -#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) -#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) -#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) - -#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) -#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) -#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) - -static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) -{ - int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; - void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); - STBIW_ASSERT(p); - if (p) { - if (!*arr) ((int *) p)[1] = 0; - *arr = (void *) ((int *) p + 2); - stbiw__sbm(*arr) = m; - } - return *arr; -} - -static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) -{ - while (*bitcount >= 8) { - stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); - *bitbuffer >>= 8; - *bitcount -= 8; - } - return data; -} - -static int stbiw__zlib_bitrev(int code, int codebits) -{ - int res=0; - while (codebits--) { - res = (res << 1) | (code & 1); - code >>= 1; - } - return res; -} - -static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) -{ - int i; - for (i=0; i < limit && i < 258; ++i) - if (a[i] != b[i]) break; - return i; -} - -static unsigned int stbiw__zhash(unsigned char *data) -{ - stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - return hash; -} - -#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) -#define stbiw__zlib_add(code,codebits) \ - (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) -#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) -// default huffman tables -#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) -#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) -#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) -#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) -#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) -#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) - -#define stbiw__ZHASH 16384 - -unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) -{ - static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; - static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; - static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; - static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; - unsigned int bitbuf=0; - int i,j, bitcount=0; - unsigned char *out = NULL; - unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); - if (quality < 5) quality = 5; - - stbiw__sbpush(out, 0x78); // DEFLATE 32K window - stbiw__sbpush(out, 0x5e); // FLEVEL = 1 - stbiw__zlib_add(1,1); // BFINAL = 1 - stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman - - for (i=0; i < stbiw__ZHASH; ++i) - hash_table[i] = NULL; - - i=0; - while (i < data_len-3) { - // hash next 3 bytes of data to be compressed - int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; - unsigned char *bestloc = 0; - unsigned char **hlist = hash_table[h]; - int n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32768) { // if entry lies within window - int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); - if (d >= best) best=d,bestloc=hlist[j]; - } - } - // when hash table entry is too long, delete half the entries - if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { - STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); - stbiw__sbn(hash_table[h]) = quality; - } - stbiw__sbpush(hash_table[h],data+i); - - if (bestloc) { - // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal - h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); - hlist = hash_table[h]; - n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32767) { - int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); - if (e > best) { // if next match is better, bail on current match - bestloc = NULL; - break; - } - } - } - } - - if (bestloc) { - int d = (int) (data+i - bestloc); // distance back - STBIW_ASSERT(d <= 32767 && best <= 258); - for (j=0; best > lengthc[j+1]-1; ++j); - stbiw__zlib_huff(j+257); - if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); - for (j=0; d > distc[j+1]-1; ++j); - stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); - if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); - i += best; - } else { - stbiw__zlib_huffb(data[i]); - ++i; - } - } - // write out final bytes - for (;i < data_len; ++i) - stbiw__zlib_huffb(data[i]); - stbiw__zlib_huff(256); // end of block - // pad with 0 bits to byte boundary - while (bitcount) - stbiw__zlib_add(0,1); - - for (i=0; i < stbiw__ZHASH; ++i) - (void) stbiw__sbfree(hash_table[i]); - STBIW_FREE(hash_table); - - { - // compute adler32 on input - unsigned int s1=1, s2=0; - int blocklen = (int) (data_len % 5552); - j=0; - while (j < data_len) { - for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; - s1 %= 65521, s2 %= 65521; - j += blocklen; - blocklen = 5552; - } - stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s2)); - stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s1)); - } - *out_len = stbiw__sbn(out); - // make returned pointer freeable - STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); - return (unsigned char *) stbiw__sbraw(out); -} - -static unsigned int stbiw__crc32(unsigned char *buffer, int len) -{ - static unsigned int crc_table[256] = - { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D - }; - - unsigned int crc = ~0u; - int i; - for (i=0; i < len; ++i) - crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; - return ~crc; -} - -#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) -#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); -#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) - -static void stbiw__wpcrc(unsigned char **data, int len) -{ - unsigned int crc = stbiw__crc32(*data - len - 4, len+4); - stbiw__wp32(*data, crc); -} - -static unsigned char stbiw__paeth(int a, int b, int c) -{ - int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); - if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); - if (pb <= pc) return STBIW_UCHAR(b); - return STBIW_UCHAR(c); -} - -unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) -{ - int ctype[5] = { -1, 0, 4, 2, 6 }; - unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; - unsigned char *out,*o, *filt, *zlib; - signed char *line_buffer; - int i,j,k,p,zlen; - - if (stride_bytes == 0) - stride_bytes = x * n; - - filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; - line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } - for (j=0; j < y; ++j) { - static int mapping[] = { 0,1,2,3,4 }; - static int firstmap[] = { 0,1,0,5,6 }; - int *mymap = j ? mapping : firstmap; - int best = 0, bestval = 0x7fffffff; - for (p=0; p < 2; ++p) { - for (k= p?best:0; k < 5; ++k) { - int type = mymap[k],est=0; - unsigned char *z = pixels + stride_bytes*j; - for (i=0; i < n; ++i) - switch (type) { - case 0: line_buffer[i] = z[i]; break; - case 1: line_buffer[i] = z[i]; break; - case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; - case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break; - case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break; - case 5: line_buffer[i] = z[i]; break; - case 6: line_buffer[i] = z[i]; break; - } - for (i=n; i < x*n; ++i) { - switch (type) { - case 0: line_buffer[i] = z[i]; break; - case 1: line_buffer[i] = z[i] - z[i-n]; break; - case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; - case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break; - case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break; - case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break; - case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; - } - } - if (p) break; - for (i=0; i < x*n; ++i) - est += abs((signed char) line_buffer[i]); - if (est < bestval) { bestval = est; best = k; } - } - } - // when we get here, best contains the filter type, and line_buffer contains the data - filt[j*(x*n+1)] = (unsigned char) best; - STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); - } - STBIW_FREE(line_buffer); - zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory - STBIW_FREE(filt); - if (!zlib) return 0; - - // each tag requires 12 bytes of overhead - out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); - if (!out) return 0; - *out_len = 8 + 12+13 + 12+zlen + 12; - - o=out; - STBIW_MEMMOVE(o,sig,8); o+= 8; - stbiw__wp32(o, 13); // header length - stbiw__wptag(o, "IHDR"); - stbiw__wp32(o, x); - stbiw__wp32(o, y); - *o++ = 8; - *o++ = STBIW_UCHAR(ctype[n]); - *o++ = 0; - *o++ = 0; - *o++ = 0; - stbiw__wpcrc(&o,13); - - stbiw__wp32(o, zlen); - stbiw__wptag(o, "IDAT"); - STBIW_MEMMOVE(o, zlib, zlen); - o += zlen; - STBIW_FREE(zlib); - stbiw__wpcrc(&o, zlen); - - stbiw__wp32(o,0); - stbiw__wptag(o, "IEND"); - stbiw__wpcrc(&o,0); - - STBIW_ASSERT(o == out + *out_len); - - return out; -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) -{ - FILE *f; - int len; - unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - f = fopen(filename, "wb"); - if (!f) { STBIW_FREE(png); return 0; } - fwrite(png, 1, len, f); - fclose(f); - STBIW_FREE(png); - return 1; -} -#endif - -STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) -{ - int len; - unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - func(context, png, len); - STBIW_FREE(png); - return 1; -} - -#endif // STB_IMAGE_WRITE_IMPLEMENTATION - -/* Revision history - 1.02 (2016-04-02) - avoid allocating large structures on the stack - 1.01 (2016-01-16) - STBIW_REALLOC_SIZED: support allocators with no realloc support - avoid race-condition in crc initialization - minor compile issues - 1.00 (2015-09-14) - installable file IO function - 0.99 (2015-09-13) - warning fixes; TGA rle support - 0.98 (2015-04-08) - added STBIW_MALLOC, STBIW_ASSERT etc - 0.97 (2015-01-18) - fixed HDR asserts, rewrote HDR rle logic - 0.96 (2015-01-17) - add HDR output - fix monochrome BMP - 0.95 (2014-08-17) - add monochrome TGA output - 0.94 (2014-05-31) - rename private functions to avoid conflicts with stb_image.h - 0.93 (2014-05-27) - warning fixes - 0.92 (2010-08-01) - casts to unsigned char to fix warnings - 0.91 (2010-07-17) - first public release - 0.90 first internal release -*/ diff --git a/src/stb_rect_pack.h b/src/stb_rect_pack.h deleted file mode 100644 index bd1cfc60..00000000 --- a/src/stb_rect_pack.h +++ /dev/null @@ -1,572 +0,0 @@ -// stb_rect_pack.h - v0.08 - public domain - rectangle packing -// Sean Barrett 2014 -// -// Useful for e.g. packing rectangular textures into an atlas. -// Does not do rotation. -// -// Not necessarily the awesomest packing method, but better than -// the totally naive one in stb_truetype (which is primarily what -// this is meant to replace). -// -// Has only had a few tests run, may have issues. -// -// More docs to come. -// -// No memory allocations; uses qsort() and assert() from stdlib. -// Can override those by defining STBRP_SORT and STBRP_ASSERT. -// -// This library currently uses the Skyline Bottom-Left algorithm. -// -// Please note: better rectangle packers are welcome! Please -// implement them to the same API, but with a different init -// function. -// -// Credits -// -// Library -// Sean Barrett -// Minor features -// Martins Mozeiko -// Bugfixes / warning fixes -// Jeremy Jaussaud -// -// Version history: -// -// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) -// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) -// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort -// 0.05: added STBRP_ASSERT to allow replacing assert -// 0.04: fixed minor bug in STBRP_LARGE_RECTS support -// 0.01: initial release -// -// LICENSE -// -// This software is dual-licensed to the public domain and under the following -// license: you are granted a perpetual, irrevocable license to copy, modify, -// publish, and distribute this file as you see fit. - -////////////////////////////////////////////////////////////////////////////// -// -// INCLUDE SECTION -// - -#ifndef STB_INCLUDE_STB_RECT_PACK_H -#define STB_INCLUDE_STB_RECT_PACK_H - -#define STB_RECT_PACK_VERSION 1 - -#ifdef STBRP_STATIC -#define STBRP_DEF static -#else -#define STBRP_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct stbrp_context stbrp_context; -typedef struct stbrp_node stbrp_node; -typedef struct stbrp_rect stbrp_rect; - -#ifdef STBRP_LARGE_RECTS -typedef int stbrp_coord; -#else -typedef unsigned short stbrp_coord; -#endif - -STBRP_DEF void stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); -// Assign packed locations to rectangles. The rectangles are of type -// 'stbrp_rect' defined below, stored in the array 'rects', and there -// are 'num_rects' many of them. -// -// Rectangles which are successfully packed have the 'was_packed' flag -// set to a non-zero value and 'x' and 'y' store the minimum location -// on each axis (i.e. bottom-left in cartesian coordinates, top-left -// if you imagine y increasing downwards). Rectangles which do not fit -// have the 'was_packed' flag set to 0. -// -// You should not try to access the 'rects' array from another thread -// while this function is running, as the function temporarily reorders -// the array while it executes. -// -// To pack into another rectangle, you need to call stbrp_init_target -// again. To continue packing into the same rectangle, you can call -// this function again. Calling this multiple times with multiple rect -// arrays will probably produce worse packing results than calling it -// a single time with the full rectangle array, but the option is -// available. - -struct stbrp_rect -{ - // reserved for your use: - int id; - - // input: - stbrp_coord w, h; - - // output: - stbrp_coord x, y; - int was_packed; // non-zero if valid packing - -}; // 16 bytes, nominally - - -STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); -// Initialize a rectangle packer to: -// pack a rectangle that is 'width' by 'height' in dimensions -// using temporary storage provided by the array 'nodes', which is 'num_nodes' long -// -// You must call this function every time you start packing into a new target. -// -// There is no "shutdown" function. The 'nodes' memory must stay valid for -// the following stbrp_pack_rects() call (or calls), but can be freed after -// the call (or calls) finish. -// -// Note: to guarantee best results, either: -// 1. make sure 'num_nodes' >= 'width' -// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' -// -// If you don't do either of the above things, widths will be quantized to multiples -// of small integers to guarantee the algorithm doesn't run out of temporary storage. -// -// If you do #2, then the non-quantized algorithm will be used, but the algorithm -// may run out of temporary storage and be unable to pack some rectangles. - -STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem); -// Optionally call this function after init but before doing any packing to -// change the handling of the out-of-temp-memory scenario, described above. -// If you call init again, this will be reset to the default (false). - - -STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic); -// Optionally select which packing heuristic the library should use. Different -// heuristics will produce better/worse results for different data sets. -// If you call init again, this will be reset to the default. - -enum -{ - STBRP_HEURISTIC_Skyline_default=0, - STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, - STBRP_HEURISTIC_Skyline_BF_sortHeight, -}; - - -////////////////////////////////////////////////////////////////////////////// -// -// the details of the following structures don't matter to you, but they must -// be visible so you can handle the memory allocations for them - -struct stbrp_node -{ - stbrp_coord x,y; - stbrp_node *next; -}; - -struct stbrp_context -{ - int width; - int height; - int align; - int init_mode; - int heuristic; - int num_nodes; - stbrp_node *active_head; - stbrp_node *free_head; - stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' -}; - -#ifdef __cplusplus -} -#endif - -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// IMPLEMENTATION SECTION -// - -#ifdef STB_RECT_PACK_IMPLEMENTATION -#ifndef STBRP_SORT -#include -#define STBRP_SORT qsort -#endif - -#ifndef STBRP_ASSERT -#include -#define STBRP_ASSERT assert -#endif - -enum -{ - STBRP__INIT_skyline = 1, -}; - -STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) -{ - switch (context->init_mode) { - case STBRP__INIT_skyline: - STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); - context->heuristic = heuristic; - break; - default: - STBRP_ASSERT(0); - } -} - -STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) -{ - if (allow_out_of_mem) - // if it's ok to run out of memory, then don't bother aligning them; - // this gives better packing, but may fail due to OOM (even though - // the rectangles easily fit). @TODO a smarter approach would be to only - // quantize once we've hit OOM, then we could get rid of this parameter. - context->align = 1; - else { - // if it's not ok to run out of memory, then quantize the widths - // so that num_nodes is always enough nodes. - // - // I.e. num_nodes * align >= width - // align >= width / num_nodes - // align = ceil(width/num_nodes) - - context->align = (context->width + context->num_nodes-1) / context->num_nodes; - } -} - -STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) -{ - int i; -#ifndef STBRP_LARGE_RECTS - STBRP_ASSERT(width <= 0xffff && height <= 0xffff); -#endif - - for (i=0; i < num_nodes-1; ++i) - nodes[i].next = &nodes[i+1]; - nodes[i].next = NULL; - context->init_mode = STBRP__INIT_skyline; - context->heuristic = STBRP_HEURISTIC_Skyline_default; - context->free_head = &nodes[0]; - context->active_head = &context->extra[0]; - context->width = width; - context->height = height; - context->num_nodes = num_nodes; - stbrp_setup_allow_out_of_mem(context, 0); - - // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) - context->extra[0].x = 0; - context->extra[0].y = 0; - context->extra[0].next = &context->extra[1]; - context->extra[1].x = (stbrp_coord) width; -#ifdef STBRP_LARGE_RECTS - context->extra[1].y = (1<<30); -#else - context->extra[1].y = 65535; -#endif - context->extra[1].next = NULL; -} - -// find minimum y position if it starts at x1 -static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) -{ - stbrp_node *node = first; - int x1 = x0 + width; - int min_y, visited_width, waste_area; - STBRP_ASSERT(first->x <= x0); - - #if 0 - // skip in case we're past the node - while (node->next->x <= x0) - ++node; - #else - STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency - #endif - - STBRP_ASSERT(node->x <= x0); - - min_y = 0; - waste_area = 0; - visited_width = 0; - while (node->x < x1) { - if (node->y > min_y) { - // raise min_y higher. - // we've accounted for all waste up to min_y, - // but we'll now add more waste for everything we've visted - waste_area += visited_width * (node->y - min_y); - min_y = node->y; - // the first time through, visited_width might be reduced - if (node->x < x0) - visited_width += node->next->x - x0; - else - visited_width += node->next->x - node->x; - } else { - // add waste area - int under_width = node->next->x - node->x; - if (under_width + visited_width > width) - under_width = width - visited_width; - waste_area += under_width * (min_y - node->y); - visited_width += under_width; - } - node = node->next; - } - - *pwaste = waste_area; - return min_y; -} - -typedef struct -{ - int x,y; - stbrp_node **prev_link; -} stbrp__findresult; - -static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) -{ - int best_waste = (1<<30), best_x, best_y = (1 << 30); - stbrp__findresult fr; - stbrp_node **prev, *node, *tail, **best = NULL; - - // align to multiple of c->align - width = (width + c->align - 1); - width -= width % c->align; - STBRP_ASSERT(width % c->align == 0); - - node = c->active_head; - prev = &c->active_head; - while (node->x + width <= c->width) { - int y,waste; - y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); - if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL - // bottom left - if (y < best_y) { - best_y = y; - best = prev; - } - } else { - // best-fit - if (y + height <= c->height) { - // can only use it if it first vertically - if (y < best_y || (y == best_y && waste < best_waste)) { - best_y = y; - best_waste = waste; - best = prev; - } - } - } - prev = &node->next; - node = node->next; - } - - best_x = (best == NULL) ? 0 : (*best)->x; - - // if doing best-fit (BF), we also have to try aligning right edge to each node position - // - // e.g, if fitting - // - // ____________________ - // |____________________| - // - // into - // - // | | - // | ____________| - // |____________| - // - // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned - // - // This makes BF take about 2x the time - - if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { - tail = c->active_head; - node = c->active_head; - prev = &c->active_head; - // find first node that's admissible - while (tail->x < width) - tail = tail->next; - while (tail) { - int xpos = tail->x - width; - int y,waste; - STBRP_ASSERT(xpos >= 0); - // find the left position that matches this - while (node->next->x <= xpos) { - prev = &node->next; - node = node->next; - } - STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); - y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); - if (y + height < c->height) { - if (y <= best_y) { - if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { - best_x = xpos; - STBRP_ASSERT(y <= best_y); - best_y = y; - best_waste = waste; - best = prev; - } - } - } - tail = tail->next; - } - } - - fr.prev_link = best; - fr.x = best_x; - fr.y = best_y; - return fr; -} - -static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) -{ - // find best position according to heuristic - stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); - stbrp_node *node, *cur; - - // bail if: - // 1. it failed - // 2. the best node doesn't fit (we don't always check this) - // 3. we're out of memory - if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { - res.prev_link = NULL; - return res; - } - - // on success, create new node - node = context->free_head; - node->x = (stbrp_coord) res.x; - node->y = (stbrp_coord) (res.y + height); - - context->free_head = node->next; - - // insert the new node into the right starting point, and - // let 'cur' point to the remaining nodes needing to be - // stiched back in - - cur = *res.prev_link; - if (cur->x < res.x) { - // preserve the existing one, so start testing with the next one - stbrp_node *next = cur->next; - cur->next = node; - cur = next; - } else { - *res.prev_link = node; - } - - // from here, traverse cur and free the nodes, until we get to one - // that shouldn't be freed - while (cur->next && cur->next->x <= res.x + width) { - stbrp_node *next = cur->next; - // move the current node to the free list - cur->next = context->free_head; - context->free_head = cur; - cur = next; - } - - // stitch the list back in - node->next = cur; - - if (cur->x < res.x + width) - cur->x = (stbrp_coord) (res.x + width); - -#ifdef _DEBUG - cur = context->active_head; - while (cur->x < context->width) { - STBRP_ASSERT(cur->x < cur->next->x); - cur = cur->next; - } - STBRP_ASSERT(cur->next == NULL); - - { - stbrp_node *L1 = NULL, *L2 = NULL; - int count=0; - cur = context->active_head; - while (cur) { - L1 = cur; - cur = cur->next; - ++count; - } - cur = context->free_head; - while (cur) { - L2 = cur; - cur = cur->next; - ++count; - } - STBRP_ASSERT(count == context->num_nodes+2); - } -#endif - - return res; -} - -static int rect_height_compare(const void *a, const void *b) -{ - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; - if (p->h > q->h) - return -1; - if (p->h < q->h) - return 1; - return (p->w > q->w) ? -1 : (p->w < q->w); -} - -static int rect_width_compare(const void *a, const void *b) -{ - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; - if (p->w > q->w) - return -1; - if (p->w < q->w) - return 1; - return (p->h > q->h) ? -1 : (p->h < q->h); -} - -static int rect_original_order(const void *a, const void *b) -{ - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; - return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); -} - -#ifdef STBRP_LARGE_RECTS -#define STBRP__MAXVAL 0xffffffff -#else -#define STBRP__MAXVAL 0xffff -#endif - -STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) -{ - int i; - - // we use the 'was_packed' field internally to allow sorting/unsorting - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = i; - #ifndef STBRP_LARGE_RECTS - STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff); - #endif - } - - // sort according to heuristic - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); - - for (i=0; i < num_rects; ++i) { - if (rects[i].w == 0 || rects[i].h == 0) { - rects[i].x = rects[i].y = 0; // empty rect needs no space - } else { - stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); - if (fr.prev_link) { - rects[i].x = (stbrp_coord) fr.x; - rects[i].y = (stbrp_coord) fr.y; - } else { - rects[i].x = rects[i].y = STBRP__MAXVAL; - } - } - } - - // unsort - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); - - // set was_packed flags - for (i=0; i < num_rects; ++i) - rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); -} -#endif diff --git a/src/stb_truetype.h b/src/stb_truetype.h deleted file mode 100644 index d360d609..00000000 --- a/src/stb_truetype.h +++ /dev/null @@ -1,3267 +0,0 @@ -// stb_truetype.h - v1.11 - public domain -// authored from 2009-2015 by Sean Barrett / RAD Game Tools -// -// This library processes TrueType files: -// parse files -// extract glyph metrics -// extract glyph shapes -// render glyphs to one-channel bitmaps with antialiasing (box filter) -// -// Todo: -// non-MS cmaps -// crashproof on bad data -// hinting? (no longer patented) -// cleartype-style AA? -// optimize: use simple memory allocator for intermediates -// optimize: build edge-list directly from curves -// optimize: rasterize directly from curves? -// -// ADDITIONAL CONTRIBUTORS -// -// Mikko Mononen: compound shape support, more cmap formats -// Tor Andersson: kerning, subpixel rendering -// -// Misc other: -// Ryan Gordon -// Simon Glass -// -// Bug/warning reports/fixes: -// "Zer" on mollyrocket (with fix) -// Cass Everitt -// stoiko (Haemimont Games) -// Brian Hook -// Walter van Niftrik -// David Gow -// David Given -// Ivan-Assen Ivanov -// Anthony Pesch -// Johan Duparc -// Hou Qiming -// Fabian "ryg" Giesen -// Martins Mozeiko -// Cap Petschulat -// Omar Cornut -// github:aloucks -// Peter LaValle -// Sergey Popov -// Giumo X. Clanjor -// Higor Euripedes -// Thomas Fields -// Derek Vinyard -// -// VERSION HISTORY -// -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// variant PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) -// also more precise AA rasterizer, except if shapes overlap -// remove need for STBTT_sort -// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC -// 1.04 (2015-04-15) typo in example -// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes -// -// Full history can be found at the end of this file. -// -// LICENSE -// -// This software is dual-licensed to the public domain and under the following -// license: you are granted a perpetual, irrevocable license to copy, modify, -// publish, and distribute this file as you see fit. -// -// USAGE -// -// Include this file in whatever places neeed to refer to it. In ONE C/C++ -// file, write: -// #define STB_TRUETYPE_IMPLEMENTATION -// before the #include of this file. This expands out the actual -// implementation into that C/C++ file. -// -// To make the implementation private to the file that generates the implementation, -// #define STBTT_STATIC -// -// Simple 3D API (don't ship this, but it's fine for tools and quick start) -// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture -// stbtt_GetBakedQuad() -- compute quad to draw for a given char -// -// Improved 3D API (more shippable): -// #include "stb_rect_pack.h" -- optional, but you really want it -// stbtt_PackBegin() -// stbtt_PackSetOversample() -- for improved quality on small fonts -// stbtt_PackFontRanges() -- pack and renders -// stbtt_PackEnd() -// stbtt_GetPackedQuad() -// -// "Load" a font file from a memory buffer (you have to keep the buffer loaded) -// stbtt_InitFont() -// stbtt_GetFontOffsetForIndex() -- use for TTC font collections -// -// Render a unicode codepoint to a bitmap -// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap -// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide -// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be -// -// Character advance/positioning -// stbtt_GetCodepointHMetrics() -// stbtt_GetFontVMetrics() -// stbtt_GetCodepointKernAdvance() -// -// Starting with version 1.06, the rasterizer was replaced with a new, -// faster and generally-more-precise rasterizer. The new rasterizer more -// accurately measures pixel coverage for anti-aliasing, except in the case -// where multiple shapes overlap, in which case it overestimates the AA pixel -// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If -// this turns out to be a problem, you can re-enable the old rasterizer with -// #define STBTT_RASTERIZER_VERSION 1 -// which will incur about a 15% speed hit. -// -// ADDITIONAL DOCUMENTATION -// -// Immediately after this block comment are a series of sample programs. -// -// After the sample programs is the "header file" section. This section -// includes documentation for each API function. -// -// Some important concepts to understand to use this library: -// -// Codepoint -// Characters are defined by unicode codepoints, e.g. 65 is -// uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is -// the hiragana for "ma". -// -// Glyph -// A visual character shape (every codepoint is rendered as -// some glyph) -// -// Glyph index -// A font-specific integer ID representing a glyph -// -// Baseline -// Glyph shapes are defined relative to a baseline, which is the -// bottom of uppercase characters. Characters extend both above -// and below the baseline. -// -// Current Point -// As you draw text to the screen, you keep track of a "current point" -// which is the origin of each character. The current point's vertical -// position is the baseline. Even "baked fonts" use this model. -// -// Vertical Font Metrics -// The vertical qualities of the font, used to vertically position -// and space the characters. See docs for stbtt_GetFontVMetrics. -// -// Font Size in Pixels or Points -// The preferred interface for specifying font sizes in stb_truetype -// is to specify how tall the font's vertical extent should be in pixels. -// If that sounds good enough, skip the next paragraph. -// -// Most font APIs instead use "points", which are a common typographic -// measurement for describing font size, defined as 72 points per inch. -// stb_truetype provides a point API for compatibility. However, true -// "per inch" conventions don't make much sense on computer displays -// since they different monitors have different number of pixels per -// inch. For example, Windows traditionally uses a convention that -// there are 96 pixels per inch, thus making 'inch' measurements have -// nothing to do with inches, and thus effectively defining a point to -// be 1.333 pixels. Additionally, the TrueType font data provides -// an explicit scale factor to scale a given font's glyphs to points, -// but the author has observed that this scale factor is often wrong -// for non-commercial fonts, thus making fonts scaled in points -// according to the TrueType spec incoherently sized in practice. -// -// ADVANCED USAGE -// -// Quality: -// -// - Use the functions with Subpixel at the end to allow your characters -// to have subpixel positioning. Since the font is anti-aliased, not -// hinted, this is very import for quality. (This is not possible with -// baked fonts.) -// -// - Kerning is now supported, and if you're supporting subpixel rendering -// then kerning is worth using to give your text a polished look. -// -// Performance: -// -// - Convert Unicode codepoints to glyph indexes and operate on the glyphs; -// if you don't do this, stb_truetype is forced to do the conversion on -// every call. -// -// - There are a lot of memory allocations. We should modify it to take -// a temp buffer and allocate from the temp buffer (without freeing), -// should help performance a lot. -// -// NOTES -// -// The system uses the raw data found in the .ttf file without changing it -// and without building auxiliary data structures. This is a bit inefficient -// on little-endian systems (the data is big-endian), but assuming you're -// caching the bitmaps or glyph shapes this shouldn't be a big deal. -// -// It appears to be very hard to programmatically determine what font a -// given file is in a general way. I provide an API for this, but I don't -// recommend it. -// -// -// SOURCE STATISTICS (based on v0.6c, 2050 LOC) -// -// Documentation & header file 520 LOC \___ 660 LOC documentation -// Sample code 140 LOC / -// Truetype parsing 620 LOC ---- 620 LOC TrueType -// Software rasterization 240 LOC \ . -// Curve tesselation 120 LOC \__ 550 LOC Bitmap creation -// Bitmap management 100 LOC / -// Baked bitmap interface 70 LOC / -// Font name matching & access 150 LOC ---- 150 -// C runtime library abstraction 60 LOC ---- 60 -// -// -// PERFORMANCE MEASUREMENTS FOR 1.06: -// -// 32-bit 64-bit -// Previous release: 8.83 s 7.68 s -// Pool allocations: 7.72 s 6.34 s -// Inline sort : 6.54 s 5.65 s -// New rasterizer : 5.63 s 5.00 s - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -//// -//// SAMPLE PROGRAMS -//// -// -// Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless -// -#if 0 -#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation -#include "stb_truetype.h" - -unsigned char ttf_buffer[1<<20]; -unsigned char temp_bitmap[512*512]; - -stbtt_bakedchar cdata[96]; // ASCII 32..126 is 95 glyphs -GLuint ftex; - -void my_stbtt_initfont(void) -{ - fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb")); - stbtt_BakeFontBitmap(ttf_buffer,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits! - // can free ttf_buffer at this point - glGenTextures(1, &ftex); - glBindTexture(GL_TEXTURE_2D, ftex); - glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, temp_bitmap); - // can free temp_bitmap at this point - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -} - -void my_stbtt_print(float x, float y, char *text) -{ - // assume orthographic projection with units = screen pixels, origin at top left - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, ftex); - glBegin(GL_QUADS); - while (*text) { - if (*text >= 32 && *text < 128) { - stbtt_aligned_quad q; - stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9 - glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0); - glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0); - glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1); - glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1); - } - ++text; - } - glEnd(); -} -#endif -// -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program (this compiles): get a single bitmap, print as ASCII art -// -#if 0 -#include -#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation -#include "stb_truetype.h" - -char ttf_buffer[1<<25]; - -int main(int argc, char **argv) -{ - stbtt_fontinfo font; - unsigned char *bitmap; - int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20); - - fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb")); - - stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0)); - bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0); - - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) - putchar(" .:ioVM@"[bitmap[j*w+i]>>5]); - putchar('\n'); - } - return 0; -} -#endif -// -// Output: -// -// .ii. -// @@@@@@. -// V@Mio@@o -// :i. V@V -// :oM@@M -// :@@@MM@M -// @@o o@M -// :@@. M@M -// @@@o@@@@ -// :M@@V:@@. -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program: print "Hello World!" banner, with bugs -// -#if 0 -char buffer[24<<20]; -unsigned char screen[20][79]; - -int main(int arg, char **argv) -{ - stbtt_fontinfo font; - int i,j,ascent,baseline,ch=0; - float scale, xpos=2; // leave a little padding in case the character extends left - char *text = "Heljo World!"; // intentionally misspelled to show 'lj' brokenness - - fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb")); - stbtt_InitFont(&font, buffer, 0); - - scale = stbtt_ScaleForPixelHeight(&font, 15); - stbtt_GetFontVMetrics(&font, &ascent,0,0); - baseline = (int) (ascent*scale); - - while (text[ch]) { - int advance,lsb,x0,y0,x1,y1; - float x_shift = xpos - (float) floor(xpos); - stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb); - stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1); - stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]); - // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong - // because this API is really for baking character bitmaps into textures. if you want to render - // a sequence of characters, you really need to render each bitmap to a temp buffer, then - // "alpha blend" that into the working buffer - xpos += (advance * scale); - if (text[ch+1]) - xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]); - ++ch; - } - - for (j=0; j < 20; ++j) { - for (i=0; i < 78; ++i) - putchar(" .:ioVM@"[screen[j][i]>>5]); - putchar('\n'); - } - - return 0; -} -#endif - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -//// -//// INTEGRATION WITH YOUR CODEBASE -//// -//// The following sections allow you to supply alternate definitions -//// of C library functions used by stb_truetype. - -#ifdef STB_TRUETYPE_IMPLEMENTATION - // #define your own (u)stbtt_int8/16/32 before including to override this - #ifndef stbtt_uint8 - typedef unsigned char stbtt_uint8; - typedef signed char stbtt_int8; - typedef unsigned short stbtt_uint16; - typedef signed short stbtt_int16; - typedef unsigned int stbtt_uint32; - typedef signed int stbtt_int32; - #endif - - typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; - typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; - - // #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h - #ifndef STBTT_ifloor - #include - #define STBTT_ifloor(x) ((int) floor(x)) - #define STBTT_iceil(x) ((int) ceil(x)) - #endif - - #ifndef STBTT_sqrt - #include - #define STBTT_sqrt(x) sqrt(x) - #endif - - #ifndef STBTT_fabs - #include - #define STBTT_fabs(x) fabs(x) - #endif - - // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h - #ifndef STBTT_malloc - #include - #define STBTT_malloc(x,u) ((void)(u),malloc(x)) - #define STBTT_free(x,u) ((void)(u),free(x)) - #endif - - #ifndef STBTT_assert - #include - #define STBTT_assert(x) assert(x) - #endif - - #ifndef STBTT_strlen - #include - #define STBTT_strlen(x) strlen(x) - #endif - - #ifndef STBTT_memcpy - #include - #define STBTT_memcpy memcpy - #define STBTT_memset memset - #endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// INTERFACE -//// -//// - -#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ -#define __STB_INCLUDE_STB_TRUETYPE_H__ - -#ifdef STBTT_STATIC -#define STBTT_DEF static -#else -#define STBTT_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// TEXTURE BAKING API -// -// If you use this API, you only have to call two functions ever. -// - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; -} stbtt_bakedchar; - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata); // you allocate this, it's num_chars long -// if return is positive, the first unused row of the bitmap -// if return is negative, returns the negative of the number of characters that fit -// if return is 0, no characters fit and no rows were used -// This uses a very crappy packing. - -typedef struct -{ - float x0,y0,s0,t0; // top-left - float x1,y1,s1,t1; // bottom-right -} stbtt_aligned_quad; - -STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier -// Call GetBakedQuad with char_index = 'character - first_char', and it -// creates the quad you need to draw and advances the current position. -// -// The coordinate system used assumes y increases downwards. -// -// Characters will extend both above and below the current position; -// see discussion of "BASELINE" above. -// -// It's inefficient; you might want to c&p it and optimize it. - - - -////////////////////////////////////////////////////////////////////////////// -// -// NEW TEXTURE BAKING API -// -// This provides options for packing multiple fonts into one atlas, not -// perfectly but better than nothing. - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; - float xoff2,yoff2; -} stbtt_packedchar; - -typedef struct stbtt_pack_context stbtt_pack_context; -typedef struct stbtt_fontinfo stbtt_fontinfo; -#ifndef STB_RECT_PACK_VERSION -typedef struct stbrp_rect stbrp_rect; -#endif - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); -// Initializes a packing context stored in the passed-in stbtt_pack_context. -// Future calls using this context will pack characters into the bitmap passed -// in here: a 1-channel bitmap that is weight x height. stride_in_bytes is -// the distance from one row to the next (or 0 to mean they are packed tightly -// together). "padding" is the amount of padding to leave between each -// character (normally you want '1' for bitmaps you'll use as textures with -// bilinear filtering). -// -// Returns 0 on failure, 1 on success. - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); -// Cleans up the packing context and frees all memory. - -#define STBTT_POINT_SIZE(x) (-(x)) - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, float font_size, - int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); -// Creates character bitmaps from the font_index'th font found in fontdata (use -// font_index=0 if you don't know what that is). It creates num_chars_in_range -// bitmaps for characters with unicode values starting at first_unicode_char_in_range -// and increasing. Data for how to render them is stored in chardata_for_range; -// pass these to stbtt_GetPackedQuad to get back renderable quads. -// -// font_size is the full height of the character from ascender to descender, -// as computed by stbtt_ScaleForPixelHeight. To use a point size as computed -// by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() -// and pass that result as 'font_size': -// ..., 20 , ... // font max minus min y is 20 pixels tall -// ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall - -typedef struct -{ - float font_size; - int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint - int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints - int num_chars; - stbtt_packedchar *chardata_for_range; // output - unsigned char h_oversample, v_oversample; // don't set these, they're used internally -} stbtt_pack_range; - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges); -// Creates character bitmaps from multiple ranges of characters stored in -// ranges. This will usually create a better-packed bitmap than multiple -// calls to stbtt_PackFontRange. Note that you can call this multiple -// times within a single PackBegin/PackEnd. - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample); -// Oversampling a font increases the quality by allowing higher-quality subpixel -// positioning, and is especially valuable at smaller text sizes. -// -// This function sets the amount of oversampling for all following calls to -// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given -// pack context. The default (no oversampling) is achieved by h_oversample=1 -// and v_oversample=1. The total number of pixels required is -// h_oversample*v_oversample larger than the default; for example, 2x2 -// oversampling requires 4x the storage of 1x1. For best results, render -// oversampled textures with bilinear filtering. Look at the readme in -// stb/tests/oversample for information about oversampled fonts -// -// To use with PackFontRangesGather etc., you must set it before calls -// call to PackFontRangesGatherRects. - -STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int align_to_integer); - -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -// Calling these functions in sequence is roughly equivalent to calling -// stbtt_PackFontRanges(). If you more control over the packing of multiple -// fonts, or if you want to pack custom data into a font texture, take a look -// at the source to of stbtt_PackFontRanges() and create a custom version -// using these functions, e.g. call GatherRects multiple times, -// building up a single array of rects, then call PackRects once, -// then call RenderIntoRects repeatedly. This may result in a -// better packing than calling PackFontRanges multiple times -// (or it may not). - -// this is an opaque structure that you shouldn't mess with which holds -// all the context needed from PackBegin to PackEnd. -struct stbtt_pack_context { - void *user_allocator_context; - void *pack_info; - int width; - int height; - int stride_in_bytes; - int padding; - unsigned int h_oversample, v_oversample; - unsigned char *pixels; - void *nodes; -}; - -////////////////////////////////////////////////////////////////////////////// -// -// FONT LOADING -// -// - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); -// Each .ttf/.ttc file may have more than one font. Each font has a sequential -// index number starting from 0. Call this function to get the font offset for -// a given index; it returns -1 if the index is out of range. A regular .ttf -// file will only define one font and it always be at offset 0, so it will -// return '0' for index 0, and -1 for all other indices. You can just skip -// this step if you know it's that kind of font. - - -// The following structure is defined publically so you can declare one on -// the stack or as a global or etc, but you should treat it as opaque. -struct stbtt_fontinfo -{ - void * userdata; - unsigned char * data; // pointer to .ttf file - int fontstart; // offset of start of font - - int numGlyphs; // number of glyphs, needed for range checking - - int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf - int index_map; // a cmap mapping for our chosen character encoding - int indexToLocFormat; // format needed to map from glyph index to glyph -}; - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); -// Given an offset into the file that defines a font, this function builds -// the necessary cached info for the rest of the system. You must allocate -// the stbtt_fontinfo yourself, and stbtt_InitFont will fill it out. You don't -// need to do anything special to free it, because the contents are pure -// value data with no additional data structures. Returns 0 on failure. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER TO GLYPH-INDEX CONVERSIOn - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint); -// If you're going to perform multiple operations on the same character -// and you want a speed-up, call this function with the character you're -// going to process, then use glyph-based functions instead of the -// codepoint-based functions. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER PROPERTIES -// - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose "height" is 'pixels' tall. -// Height is measured as the distance from the highest ascender to the lowest -// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics -// and computing: -// scale = pixels / (ascent - descent) -// so if you prefer to measure height by the ascent only, use a similar calculation. - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose EM size is mapped to -// 'pixels' tall. This is probably what traditional APIs compute, but -// I'm not positive. - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); -// ascent is the coordinate above the baseline the font extends; descent -// is the coordinate below the baseline the font extends (i.e. it is typically negative) -// lineGap is the spacing between one row's descent and the next row's ascent... -// so you should advance the vertical position by "*ascent - *descent + *lineGap" -// these are expressed in unscaled coordinates, so you must multiply by -// the scale factor for a given size - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); -// the bounding box around all possible characters - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); -// leftSideBearing is the offset from the current horizontal position to the left edge of the character -// advanceWidth is the offset from the current horizontal position to the next horizontal position -// these are expressed in unscaled coordinates - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); -// an additional amount to add to the 'advance' value between ch1 and ch2 - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); -// Gets the bounding box of the visible part of the glyph, in unscaled coordinates - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); -// as above, but takes one or more glyph indices for greater efficiency - - -////////////////////////////////////////////////////////////////////////////// -// -// GLYPH SHAPES (you probably don't need these, but they have to go before -// the bitmaps for C declaration-order reasons) -// - -#ifndef STBTT_vmove // you can predefine these to use different values (but why?) - enum { - STBTT_vmove=1, - STBTT_vline, - STBTT_vcurve - }; -#endif - -#ifndef stbtt_vertex // you can predefine this to use different values - // (we share this with other code at RAD) - #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file - typedef struct - { - stbtt_vertex_type x,y,cx,cy; - unsigned char type,padding; - } stbtt_vertex; -#endif - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); -// returns non-zero if nothing is drawn for this glyph - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); -// returns # of vertices and fills *vertices with the pointer to them -// these are expressed in "unscaled" coordinates -// -// The shape is a series of countours. Each one starts with -// a STBTT_moveto, then consists of a series of mixed -// STBTT_lineto and STBTT_curveto segments. A lineto -// draws a line from previous endpoint to its x,y; a curveto -// draws a quadratic bezier from previous endpoint to -// its x,y, using cx,cy as the bezier control point. - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); -// frees the data allocated above - -////////////////////////////////////////////////////////////////////////////// -// -// BITMAP RENDERING -// - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); -// frees the bitmap allocated below - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// allocates a large-enough single-channel 8bpp bitmap and renders the -// specified character/glyph at the specified scale into it, with -// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). -// *width & *height are filled out with the width & height of the bitmap, -// which is stored left-to-right, top-to-bottom. -// -// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); -// the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap -// in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap -// is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the -// width and height and positioning info for it first. - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); -// same as stbtt_MakeCodepointBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -// get the bbox of the bitmap centered around the glyph origin; so the -// bitmap width is ix1-ix0, height is iy1-iy0, and location to place -// the bitmap top left is (leftSideBearing*scale,iy0). -// (Note that the bitmap uses y-increases-down, but the shape uses -// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); -// same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel -// shift for the character - -// the following functions are equivalent to the above functions, but operate -// on glyph indices instead of Unicode codepoints (for efficiency) -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); - - -// @TODO: don't expose this structure -typedef struct -{ - int w,h,stride; - unsigned char *pixels; -} stbtt__bitmap; - -// rasterize a shape with quadratic beziers into a bitmap -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into - float flatness_in_pixels, // allowable error of curve in pixels - stbtt_vertex *vertices, // array of vertices defining shape - int num_verts, // number of vertices in above array - float scale_x, float scale_y, // scale applied to input vertices - float shift_x, float shift_y, // translation applied to input vertices - int x_off, int y_off, // another translation applied to input - int invert, // if non-zero, vertically flip shape - void *userdata); // context for to STBTT_MALLOC - -////////////////////////////////////////////////////////////////////////////// -// -// Finding the right font... -// -// You should really just solve this offline, keep your own tables -// of what font is what, and don't try to get it out of the .ttf file. -// That's because getting it out of the .ttf file is really hard, because -// the names in the file can appear in many possible encodings, in many -// possible languages, and e.g. if you need a case-insensitive comparison, -// the details of that depend on the encoding & language in a complex way -// (actually underspecified in truetype, but also gigantic). -// -// But you can use the provided functions in two possible ways: -// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on -// unicode-encoded names to try to find the font you want; -// you can run this before calling stbtt_InitFont() -// -// stbtt_GetFontNameString() lets you get any of the various strings -// from the file yourself and do your own comparisons on them. -// You have to have called stbtt_InitFont() first. - - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags); -// returns the offset (not index) of the font that matches, or -1 if none -// if you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". -// if you use any other flag, use a font name like "Arial"; this checks -// the 'macStyle' header field; i don't know if fonts set this consistently -#define STBTT_MACSTYLE_DONTCARE 0 -#define STBTT_MACSTYLE_BOLD 1 -#define STBTT_MACSTYLE_ITALIC 2 -#define STBTT_MACSTYLE_UNDERSCORE 4 -#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2); -// returns 1/0 whether the first string interpreted as utf8 is identical to -// the second string interpreted as big-endian utf16... useful for strings from next func - -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID); -// returns the string (which may be big-endian double byte, e.g. for unicode) -// and puts the length in bytes in *length. -// -// some of the values for the IDs are below; for more see the truetype spec: -// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html -// http://www.microsoft.com/typography/otspec/name.htm - -enum { // platformID - STBTT_PLATFORM_ID_UNICODE =0, - STBTT_PLATFORM_ID_MAC =1, - STBTT_PLATFORM_ID_ISO =2, - STBTT_PLATFORM_ID_MICROSOFT =3 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_UNICODE - STBTT_UNICODE_EID_UNICODE_1_0 =0, - STBTT_UNICODE_EID_UNICODE_1_1 =1, - STBTT_UNICODE_EID_ISO_10646 =2, - STBTT_UNICODE_EID_UNICODE_2_0_BMP=3, - STBTT_UNICODE_EID_UNICODE_2_0_FULL=4 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT - STBTT_MS_EID_SYMBOL =0, - STBTT_MS_EID_UNICODE_BMP =1, - STBTT_MS_EID_SHIFTJIS =2, - STBTT_MS_EID_UNICODE_FULL =10 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes - STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, - STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, - STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, - STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 -}; - -enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... - // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs - STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, - STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, - STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, - STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, - STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, - STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D -}; - -enum { // languageID for STBTT_PLATFORM_ID_MAC - STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, - STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, - STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, - STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , - STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , - STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, - STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 -}; - -#ifdef __cplusplus -} -#endif - -#endif // __STB_INCLUDE_STB_TRUETYPE_H__ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// IMPLEMENTATION -//// -//// - -#ifdef STB_TRUETYPE_IMPLEMENTATION - -#ifndef STBTT_MAX_OVERSAMPLE -#define STBTT_MAX_OVERSAMPLE 8 -#endif - -#if STBTT_MAX_OVERSAMPLE > 255 -#error "STBTT_MAX_OVERSAMPLE cannot be > 255" -#endif - -typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; - -#ifndef STBTT_RASTERIZER_VERSION -#define STBTT_RASTERIZER_VERSION 2 -#endif - -#ifdef _MSC_VER -#define STBTT__NOTUSED(v) (void)(v) -#else -#define STBTT__NOTUSED(v) (void)sizeof(v) -#endif - -////////////////////////////////////////////////////////////////////////// -// -// accessors to parse data from file -// - -// on platforms that don't allow misaligned reads, if we want to allow -// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE - -#define ttBYTE(p) (* (stbtt_uint8 *) (p)) -#define ttCHAR(p) (* (stbtt_int8 *) (p)) -#define ttFixed(p) ttLONG(p) - -#if defined(STB_TRUETYPE_BIGENDIAN) && !defined(ALLOW_UNALIGNED_TRUETYPE) - - #define ttUSHORT(p) (* (stbtt_uint16 *) (p)) - #define ttSHORT(p) (* (stbtt_int16 *) (p)) - #define ttULONG(p) (* (stbtt_uint32 *) (p)) - #define ttLONG(p) (* (stbtt_int32 *) (p)) - -#else - - static stbtt_uint16 ttUSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } - static stbtt_int16 ttSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } - static stbtt_uint32 ttULONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - static stbtt_int32 ttLONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - -#endif - -#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) -#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) - -static int stbtt__isfont(const stbtt_uint8 *font) -{ - // check the version number - if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 - if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! - if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF - if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 - return 0; -} - -// @OPTIMIZE: binary search -static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) -{ - stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); - stbtt_uint32 tabledir = fontstart + 12; - stbtt_int32 i; - for (i=0; i < num_tables; ++i) { - stbtt_uint32 loc = tabledir + 16*i; - if (stbtt_tag(data+loc+0, tag)) - return ttULONG(data+loc+8); - } - return 0; -} - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, int index) -{ - // if it's just a font, there's only one valid index - if (stbtt__isfont(font_collection)) - return index == 0 ? 0 : -1; - - // check if it's a TTC - if (stbtt_tag(font_collection, "ttcf")) { - // version 1? - if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { - stbtt_int32 n = ttLONG(font_collection+8); - if (index >= n) - return -1; - return ttULONG(font_collection+12+index*4); - } - } - return -1; -} - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data2, int fontstart) -{ - stbtt_uint8 *data = (stbtt_uint8 *) data2; - stbtt_uint32 cmap, t; - stbtt_int32 i,numTables; - - info->data = data; - info->fontstart = fontstart; - - cmap = stbtt__find_table(data, fontstart, "cmap"); // required - info->loca = stbtt__find_table(data, fontstart, "loca"); // required - info->head = stbtt__find_table(data, fontstart, "head"); // required - info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required - info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required - info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required - info->kern = stbtt__find_table(data, fontstart, "kern"); // not required - if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx) - return 0; - - t = stbtt__find_table(data, fontstart, "maxp"); - if (t) - info->numGlyphs = ttUSHORT(data+t+4); - else - info->numGlyphs = 0xffff; - - // find a cmap encoding table we understand *now* to avoid searching - // later. (todo: could make this installable) - // the same regardless of glyph. - numTables = ttUSHORT(data + cmap + 2); - info->index_map = 0; - for (i=0; i < numTables; ++i) { - stbtt_uint32 encoding_record = cmap + 4 + 8 * i; - // find an encoding we understand: - switch(ttUSHORT(data+encoding_record)) { - case STBTT_PLATFORM_ID_MICROSOFT: - switch (ttUSHORT(data+encoding_record+2)) { - case STBTT_MS_EID_UNICODE_BMP: - case STBTT_MS_EID_UNICODE_FULL: - // MS/Unicode - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - break; - case STBTT_PLATFORM_ID_UNICODE: - // Mac/iOS has these - // all the encodingIDs are unicode, so we don't bother to check it - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - } - if (info->index_map == 0) - return 0; - - info->indexToLocFormat = ttUSHORT(data+info->head + 50); - return 1; -} - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) -{ - stbtt_uint8 *data = info->data; - stbtt_uint32 index_map = info->index_map; - - stbtt_uint16 format = ttUSHORT(data + index_map + 0); - if (format == 0) { // apple byte encoding - stbtt_int32 bytes = ttUSHORT(data + index_map + 2); - if (unicode_codepoint < bytes-6) - return ttBYTE(data + index_map + 6 + unicode_codepoint); - return 0; - } else if (format == 6) { - stbtt_uint32 first = ttUSHORT(data + index_map + 6); - stbtt_uint32 count = ttUSHORT(data + index_map + 8); - if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) - return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); - return 0; - } else if (format == 2) { - STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean - return 0; - } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges - stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; - stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; - stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); - stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; - - // do a binary search of the segments - stbtt_uint32 endCount = index_map + 14; - stbtt_uint32 search = endCount; - - if (unicode_codepoint > 0xffff) - return 0; - - // they lie from endCount .. endCount + segCount - // but searchRange is the nearest power of two, so... - if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) - search += rangeShift*2; - - // now decrement to bias correctly to find smallest - search -= 2; - while (entrySelector) { - stbtt_uint16 end; - searchRange >>= 1; - end = ttUSHORT(data + search + searchRange*2); - if (unicode_codepoint > end) - search += searchRange*2; - --entrySelector; - } - search += 2; - - { - stbtt_uint16 offset, start; - stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); - - STBTT_assert(unicode_codepoint <= ttUSHORT(data + endCount + 2*item)); - start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); - if (unicode_codepoint < start) - return 0; - - offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); - if (offset == 0) - return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); - - return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); - } - } else if (format == 12 || format == 13) { - stbtt_uint32 ngroups = ttULONG(data+index_map+12); - stbtt_int32 low,high; - low = 0; high = (stbtt_int32)ngroups; - // Binary search the right group. - while (low < high) { - stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high - stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); - stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); - if ((stbtt_uint32) unicode_codepoint < start_char) - high = mid; - else if ((stbtt_uint32) unicode_codepoint > end_char) - low = mid+1; - else { - stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); - if (format == 12) - return start_glyph + unicode_codepoint-start_char; - else // format == 13 - return start_glyph; - } - } - return 0; // not found - } - // @TODO - STBTT_assert(0); - return 0; -} - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) -{ - return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); -} - -static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) -{ - v->type = type; - v->x = (stbtt_int16) x; - v->y = (stbtt_int16) y; - v->cx = (stbtt_int16) cx; - v->cy = (stbtt_int16) cy; -} - -static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) -{ - int g1,g2; - - if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range - if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format - - if (info->indexToLocFormat == 0) { - g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; - g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; - } else { - g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); - g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); - } - - return g1==g2 ? -1 : g1; // if length is 0, return -1 -} - -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) -{ - int g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 0; - - if (x0) *x0 = ttSHORT(info->data + g + 2); - if (y0) *y0 = ttSHORT(info->data + g + 4); - if (x1) *x1 = ttSHORT(info->data + g + 6); - if (y1) *y1 = ttSHORT(info->data + g + 8); - return 1; -} - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) -{ - return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); -} - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) -{ - stbtt_int16 numberOfContours; - int g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 1; - numberOfContours = ttSHORT(info->data + g); - return numberOfContours == 0; -} - -static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, - stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) -{ - if (start_off) { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); - } - return num_vertices; -} - -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - stbtt_int16 numberOfContours; - stbtt_uint8 *endPtsOfContours; - stbtt_uint8 *data = info->data; - stbtt_vertex *vertices=0; - int num_vertices=0; - int g = stbtt__GetGlyfOffset(info, glyph_index); - - *pvertices = NULL; - - if (g < 0) return 0; - - numberOfContours = ttSHORT(data + g); - - if (numberOfContours > 0) { - stbtt_uint8 flags=0,flagcount; - stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; - stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; - stbtt_uint8 *points; - endPtsOfContours = (data + g + 10); - ins = ttUSHORT(data + g + 10 + numberOfContours * 2); - points = data + g + 10 + numberOfContours * 2 + 2 + ins; - - n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); - - m = n + 2*numberOfContours; // a loose bound on how many vertices we might need - vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); - if (vertices == 0) - return 0; - - next_move = 0; - flagcount=0; - - // in first pass, we load uninterpreted data into the allocated array - // above, shifted to the end of the array so we won't overwrite it when - // we create our final data starting from the front - - off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated - - // first load flags - - for (i=0; i < n; ++i) { - if (flagcount == 0) { - flags = *points++; - if (flags & 8) - flagcount = *points++; - } else - --flagcount; - vertices[off+i].type = flags; - } - - // now load x coordinates - x=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 2) { - stbtt_int16 dx = *points++; - x += (flags & 16) ? dx : -dx; // ??? - } else { - if (!(flags & 16)) { - x = x + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].x = (stbtt_int16) x; - } - - // now load y coordinates - y=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 4) { - stbtt_int16 dy = *points++; - y += (flags & 32) ? dy : -dy; // ??? - } else { - if (!(flags & 32)) { - y = y + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].y = (stbtt_int16) y; - } - - // now convert them to our format - num_vertices=0; - sx = sy = cx = cy = scx = scy = 0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - x = (stbtt_int16) vertices[off+i].x; - y = (stbtt_int16) vertices[off+i].y; - - if (next_move == i) { - if (i != 0) - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - - // now start the new one - start_off = !(flags & 1); - if (start_off) { - // if we start off with an off-curve point, then when we need to find a point on the curve - // where we can start, and we need to save some state for when we wraparound. - scx = x; - scy = y; - if (!(vertices[off+i+1].type & 1)) { - // next point is also a curve point, so interpolate an on-point curve - sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; - sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; - } else { - // otherwise just use the next point as our start point - sx = (stbtt_int32) vertices[off+i+1].x; - sy = (stbtt_int32) vertices[off+i+1].y; - ++i; // we're using point i+1 as the starting point, so skip it - } - } else { - sx = x; - sy = y; - } - stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); - was_off = 0; - next_move = 1 + ttUSHORT(endPtsOfContours+j*2); - ++j; - } else { - if (!(flags & 1)) { // if it's a curve - if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); - cx = x; - cy = y; - was_off = 1; - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); - was_off = 0; - } - } - } - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - } else if (numberOfContours == -1) { - // Compound shapes. - int more = 1; - stbtt_uint8 *comp = data + g + 10; - num_vertices = 0; - vertices = 0; - while (more) { - stbtt_uint16 flags, gidx; - int comp_num_verts = 0, i; - stbtt_vertex *comp_verts = 0, *tmp = 0; - float mtx[6] = {1,0,0,1,0,0}, m, n; - - flags = ttSHORT(comp); comp+=2; - gidx = ttSHORT(comp); comp+=2; - - if (flags & 2) { // XY values - if (flags & 1) { // shorts - mtx[4] = ttSHORT(comp); comp+=2; - mtx[5] = ttSHORT(comp); comp+=2; - } else { - mtx[4] = ttCHAR(comp); comp+=1; - mtx[5] = ttCHAR(comp); comp+=1; - } - } - else { - // @TODO handle matching point - STBTT_assert(0); - } - if (flags & (1<<3)) { // WE_HAVE_A_SCALE - mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } - - // Find transformation scales. - m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); - n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); - - // Get indexed glyph. - comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); - if (comp_num_verts > 0) { - // Transform vertices. - for (i = 0; i < comp_num_verts; ++i) { - stbtt_vertex* v = &comp_verts[i]; - stbtt_vertex_type x,y; - x=v->x; y=v->y; - v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - x=v->cx; y=v->cy; - v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - } - // Append vertices. - tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); - if (!tmp) { - if (vertices) STBTT_free(vertices, info->userdata); - if (comp_verts) STBTT_free(comp_verts, info->userdata); - return 0; - } - if (num_vertices > 0) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); - STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); - if (vertices) STBTT_free(vertices, info->userdata); - vertices = tmp; - STBTT_free(comp_verts, info->userdata); - num_vertices += comp_num_verts; - } - // More components ? - more = flags & (1<<5); - } - } else if (numberOfContours < 0) { - // @TODO other compound variations? - STBTT_assert(0); - } else { - // numberOfCounters == 0, do nothing - } - - *pvertices = vertices; - return num_vertices; -} - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) -{ - stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); - if (glyph_index < numOfLongHorMetrics) { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); - } else { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); - } -} - -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint8 *data = info->data + info->kern; - stbtt_uint32 needle, straw; - int l, r, m; - - // we only look at the first table. it must be 'horizontal' and format 0. - if (!info->kern) - return 0; - if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 - return 0; - if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format - return 0; - - l = 0; - r = ttUSHORT(data+10) - 1; - needle = glyph1 << 16 | glyph2; - while (l <= r) { - m = (l + r) >> 1; - straw = ttULONG(data+18+(m*6)); // note: unaligned read - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else - return ttSHORT(data+22+(m*6)); - } - return 0; -} - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) -{ - if (!info->kern) // if no kerning table, don't waste time looking up both codepoint->glyphs - return 0; - return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); -} - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) -{ - stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); -} - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) -{ - if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); - if (descent) *descent = ttSHORT(info->data+info->hhea + 6); - if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); -} - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) -{ - *x0 = ttSHORT(info->data + info->head + 36); - *y0 = ttSHORT(info->data + info->head + 38); - *x1 = ttSHORT(info->data + info->head + 40); - *y1 = ttSHORT(info->data + info->head + 42); -} - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) -{ - int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); - return (float) height / fheight; -} - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) -{ - int unitsPerEm = ttUSHORT(info->data + info->head + 18); - return pixels / unitsPerEm; -} - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) -{ - STBTT_free(v, info->userdata); -} - -////////////////////////////////////////////////////////////////////////////// -// -// antialiasing software rasterizer -// - -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning - if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { - // e.g. space character - if (ix0) *ix0 = 0; - if (iy0) *iy0 = 0; - if (ix1) *ix1 = 0; - if (iy1) *iy1 = 0; - } else { - // move to integral bboxes (treating pixels as little squares, what pixels get touched)? - if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); - if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); - if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); - if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); - } -} - -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); -} - -////////////////////////////////////////////////////////////////////////////// -// -// Rasterizer - -typedef struct stbtt__hheap_chunk -{ - struct stbtt__hheap_chunk *next; -} stbtt__hheap_chunk; - -typedef struct stbtt__hheap -{ - struct stbtt__hheap_chunk *head; - void *first_free; - int num_remaining_in_head_chunk; -} stbtt__hheap; - -static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) -{ - if (hh->first_free) { - void *p = hh->first_free; - hh->first_free = * (void **) p; - return p; - } else { - if (hh->num_remaining_in_head_chunk == 0) { - int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); - stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); - if (c == NULL) - return NULL; - c->next = hh->head; - hh->head = c; - hh->num_remaining_in_head_chunk = count; - } - --hh->num_remaining_in_head_chunk; - return (char *) (hh->head) + size * hh->num_remaining_in_head_chunk; - } -} - -static void stbtt__hheap_free(stbtt__hheap *hh, void *p) -{ - *(void **) p = hh->first_free; - hh->first_free = p; -} - -static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) -{ - stbtt__hheap_chunk *c = hh->head; - while (c) { - stbtt__hheap_chunk *n = c->next; - STBTT_free(c, userdata); - c = n; - } -} - -typedef struct stbtt__edge { - float x0,y0, x1,y1; - int invert; -} stbtt__edge; - - -typedef struct stbtt__active_edge -{ - struct stbtt__active_edge *next; - #if STBTT_RASTERIZER_VERSION==1 - int x,dx; - float ey; - int direction; - #elif STBTT_RASTERIZER_VERSION==2 - float fx,fdx,fdy; - float direction; - float sy; - float ey; - #else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" - #endif -} stbtt__active_edge; - -#if STBTT_RASTERIZER_VERSION == 1 -#define STBTT_FIXSHIFT 10 -#define STBTT_FIX (1 << STBTT_FIXSHIFT) -#define STBTT_FIXMASK (STBTT_FIX-1) - -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - if (!z) return z; - - // round dx down to avoid overshooting - if (dxdy < 0) - z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); - else - z->dx = STBTT_ifloor(STBTT_FIX * dxdy); - - z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount - z->x -= off_x * STBTT_FIX; - - z->ey = e->y1; - z->next = 0; - z->direction = e->invert ? 1 : -1; - return z; -} -#elif STBTT_RASTERIZER_VERSION == 2 -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - //STBTT_assert(e->y0 <= start_point); - if (!z) return z; - z->fdx = dxdy; - z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; - z->fx = e->x0 + dxdy * (start_point - e->y0); - z->fx -= off_x; - z->direction = e->invert ? 1.0f : -1.0f; - z->sy = e->y0; - z->ey = e->y1; - z->next = 0; - return z; -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#if STBTT_RASTERIZER_VERSION == 1 -// note: this routine clips fills that extend off the edges... ideally this -// wouldn't happen, but it could happen if the truetype glyph bounding boxes -// are wrong, or if the user supplies a too-small bitmap -static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) -{ - // non-zero winding fill - int x0=0, w=0; - - while (e) { - if (w == 0) { - // if we're currently at zero, we need to record the edge start point - x0 = e->x; w += e->direction; - } else { - int x1 = e->x; w += e->direction; - // if we went to zero, we need to draw - if (w == 0) { - int i = x0 >> STBTT_FIXSHIFT; - int j = x1 >> STBTT_FIXSHIFT; - - if (i < len && j >= 0) { - if (i == j) { - // x0,x1 are the same pixel, so compute combined coverage - scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); - } else { - if (i >= 0) // add antialiasing for x0 - scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); - else - i = -1; // clip - - if (j < len) // add antialiasing for x1 - scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); - else - j = len; // clip - - for (++i; i < j; ++i) // fill pixels between x0 and x1 - scanline[i] = scanline[i] + (stbtt_uint8) max_weight; - } - } - } - } - - e = e->next; - } -} - -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0; - int max_weight = (255 / vsubsample); // weight per vertical scanline - int s; // vertical subsample index - unsigned char scanline_data[512], *scanline; - - if (result->w > 512) - scanline = (unsigned char *) STBTT_malloc(result->w, userdata); - else - scanline = scanline_data; - - y = off_y * vsubsample; - e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; - - while (j < result->h) { - STBTT_memset(scanline, 0, result->w); - for (s=0; s < vsubsample; ++s) { - // find center of pixel for this scanline - float scan_y = y + 0.5f; - stbtt__active_edge **step = &active; - - // update all active edges; - // remove all active edges that terminate before the center of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - z->x += z->dx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - } - - // resort the list if needed - for(;;) { - int changed=0; - step = &active; - while (*step && (*step)->next) { - if ((*step)->x > (*step)->next->x) { - stbtt__active_edge *t = *step; - stbtt__active_edge *q = t->next; - - t->next = q->next; - q->next = t; - *step = q; - changed = 1; - } - step = &(*step)->next; - } - if (!changed) break; - } - - // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline - while (e->y0 <= scan_y) { - if (e->y1 > scan_y) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); - if (z != NULL) { - // find insertion point - if (active == NULL) - active = z; - else if (z->x < active->x) { - // insert at front - z->next = active; - active = z; - } else { - // find thing to insert AFTER - stbtt__active_edge *p = active; - while (p->next && p->next->x < z->x) - p = p->next; - // at this point, p->next->x is NOT < z->x - z->next = p->next; - p->next = z; - } - } - } - ++e; - } - - // now process all active edges in XOR fashion - if (active) - stbtt__fill_active_edges(scanline, result->w, active, max_weight); - - ++y; - } - STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} - -#elif STBTT_RASTERIZER_VERSION == 2 - -// the edge passed in here does not cross the vertical line at x or the vertical line at x+1 -// (i.e. it has already been clipped to those) -static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) -{ - if (y0 == y1) return; - STBTT_assert(y0 < y1); - STBTT_assert(e->sy <= e->ey); - if (y0 > e->ey) return; - if (y1 < e->sy) return; - if (y0 < e->sy) { - x0 += (x1-x0) * (e->sy - y0) / (y1-y0); - y0 = e->sy; - } - if (y1 > e->ey) { - x1 += (x1-x0) * (e->ey - y1) / (y1-y0); - y1 = e->ey; - } - - if (x0 == x) - STBTT_assert(x1 <= x+1); - else if (x0 == x+1) - STBTT_assert(x1 >= x); - else if (x0 <= x) - STBTT_assert(x1 <= x); - else if (x0 >= x+1) - STBTT_assert(x1 >= x+1); - else - STBTT_assert(x1 >= x && x1 <= x+1); - - if (x0 <= x && x1 <= x) - scanline[x] += e->direction * (y1-y0); - else if (x0 >= x+1 && x1 >= x+1) - ; - else { - STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); - scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position - } -} - -static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) -{ - float y_bottom = y_top+1; - - while (e) { - // brute force every pixel - - // compute intersection points with top & bottom - STBTT_assert(e->ey >= y_top); - - if (e->fdx == 0) { - float x0 = e->fx; - if (x0 < len) { - if (x0 >= 0) { - stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); - stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); - } else { - stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); - } - } - } else { - float x0 = e->fx; - float dx = e->fdx; - float xb = x0 + dx; - float x_top, x_bottom; - float sy0,sy1; - float dy = e->fdy; - STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); - - // compute endpoints of line segment clipped to this scanline (if the - // line segment starts on this scanline. x0 is the intersection of the - // line with y_top, but that may be off the line segment. - if (e->sy > y_top) { - x_top = x0 + dx * (e->sy - y_top); - sy0 = e->sy; - } else { - x_top = x0; - sy0 = y_top; - } - if (e->ey < y_bottom) { - x_bottom = x0 + dx * (e->ey - y_top); - sy1 = e->ey; - } else { - x_bottom = xb; - sy1 = y_bottom; - } - - if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { - // from here on, we don't have to range check x values - - if ((int) x_top == (int) x_bottom) { - float height; - // simple case, only spans one pixel - int x = (int) x_top; - height = sy1 - sy0; - STBTT_assert(x >= 0 && x < len); - scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height; - scanline_fill[x] += e->direction * height; // everything right of this pixel is filled - } else { - int x,x1,x2; - float y_crossing, step, sign, area; - // covers 2+ pixels - if (x_top > x_bottom) { - // flip scanline vertically; signed area is the same - float t; - sy0 = y_bottom - (sy0 - y_top); - sy1 = y_bottom - (sy1 - y_top); - t = sy0, sy0 = sy1, sy1 = t; - t = x_bottom, x_bottom = x_top, x_top = t; - dx = -dx; - dy = -dy; - t = x0, x0 = xb, xb = t; - } - - x1 = (int) x_top; - x2 = (int) x_bottom; - // compute intersection with y axis at x1+1 - y_crossing = (x1+1 - x0) * dy + y_top; - - sign = e->direction; - // area of the rectangle covered from y0..y_crossing - area = sign * (y_crossing-sy0); - // area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) - scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2); - - step = sign * dy; - for (x = x1+1; x < x2; ++x) { - scanline[x] += area + step/2; - area += step; - } - y_crossing += dy * (x2 - (x1+1)); - - STBTT_assert(STBTT_fabs(area) <= 1.01f); - - scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing); - - scanline_fill[x2] += sign * (sy1-sy0); - } - } else { - // if edge goes outside of box we're drawing, we require - // clipping logic. since this does not match the intended use - // of this library, we use a different, very slow brute - // force implementation - int x; - for (x=0; x < len; ++x) { - // cases: - // - // there can be up to two intersections with the pixel. any intersection - // with left or right edges can be handled by splitting into two (or three) - // regions. intersections with top & bottom do not necessitate case-wise logic. - // - // the old way of doing this found the intersections with the left & right edges, - // then used some simple logic to produce up to three segments in sorted order - // from top-to-bottom. however, this had a problem: if an x edge was epsilon - // across the x border, then the corresponding y position might not be distinct - // from the other y segment, and it might ignored as an empty segment. to avoid - // that, we need to explicitly produce segments based on x positions. - - // rename variables to clear pairs - float y0 = y_top; - float x1 = (float) (x); - float x2 = (float) (x+1); - float x3 = xb; - float y3 = y_bottom; - float y1,y2; - - // x = e->x + e->dx * (y-y_top) - // (y-y_top) = (x - e->x) / e->dx - // y = (x - e->x) / e->dx + y_top - y1 = (x - x0) / dx + y_top; - y2 = (x+1 - x0) / dx + y_top; - - if (x0 < x1 && x3 > x2) { // three segments descending down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x1 && x0 > x2) { // three segments descending down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else { // one segment - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); - } - } - } - } - e = e->next; - } -} - -// directly AA rasterize edges w/o supersampling -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0, i; - float scanline_data[129], *scanline, *scanline2; - - STBTT__NOTUSED(vsubsample); - - if (result->w > 64) - scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); - else - scanline = scanline_data; - - scanline2 = scanline + result->w; - - y = off_y; - e[n].y0 = (float) (off_y + result->h) + 1; - - while (j < result->h) { - // find center of pixel for this scanline - float scan_y_top = y + 0.0f; - float scan_y_bottom = y + 1.0f; - stbtt__active_edge **step = &active; - - STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); - STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); - - // update all active edges; - // remove all active edges that terminate before the top of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y_top) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - step = &((*step)->next); // advance through list - } - } - - // insert all edges that start before the bottom of this scanline - while (e->y0 <= scan_y_bottom) { - if (e->y0 != e->y1) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); - if (z != NULL) { - STBTT_assert(z->ey >= scan_y_top); - // insert at front - z->next = active; - active = z; - } - } - ++e; - } - - // now process all active edges - if (active) - stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); - - { - float sum = 0; - for (i=0; i < result->w; ++i) { - float k; - int m; - sum += scanline2[i]; - k = scanline[i] + sum; - k = (float) STBTT_fabs(k)*255 + 0.5f; - m = (int) k; - if (m > 255) m = 255; - result->pixels[j*result->stride + i] = (unsigned char) m; - } - } - // advance all the edges - step = &active; - while (*step) { - stbtt__active_edge *z = *step; - z->fx += z->fdx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - - ++y; - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) - -static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) -{ - int i,j; - for (i=1; i < n; ++i) { - stbtt__edge t = p[i], *a = &t; - j = i; - while (j > 0) { - stbtt__edge *b = &p[j-1]; - int c = STBTT__COMPARE(a,b); - if (!c) break; - p[j] = p[j-1]; - --j; - } - if (i != j) - p[j] = t; - } -} - -static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) -{ - /* threshhold for transitioning to insertion sort */ - while (n > 12) { - stbtt__edge t; - int c01,c12,c,m,i,j; - - /* compute median of three */ - m = n >> 1; - c01 = STBTT__COMPARE(&p[0],&p[m]); - c12 = STBTT__COMPARE(&p[m],&p[n-1]); - /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ - if (c01 != c12) { - /* otherwise, we'll need to swap something else to middle */ - int z; - c = STBTT__COMPARE(&p[0],&p[n-1]); - /* 0>mid && midn => n; 0 0 */ - /* 0n: 0>n => 0; 0 n */ - z = (c == c12) ? 0 : n-1; - t = p[z]; - p[z] = p[m]; - p[m] = t; - } - /* now p[m] is the median-of-three */ - /* swap it to the beginning so it won't move around */ - t = p[0]; - p[0] = p[m]; - p[m] = t; - - /* partition loop */ - i=1; - j=n-1; - for(;;) { - /* handling of equality is crucial here */ - /* for sentinels & efficiency with duplicates */ - for (;;++i) { - if (!STBTT__COMPARE(&p[i], &p[0])) break; - } - for (;;--j) { - if (!STBTT__COMPARE(&p[0], &p[j])) break; - } - /* make sure we haven't crossed */ - if (i >= j) break; - t = p[i]; - p[i] = p[j]; - p[j] = t; - - ++i; - --j; - } - /* recurse on smaller side, iterate on larger */ - if (j < (n-i)) { - stbtt__sort_edges_quicksort(p,j); - p = p+i; - n = n-i; - } else { - stbtt__sort_edges_quicksort(p+i, n-i); - n = j; - } - } -} - -static void stbtt__sort_edges(stbtt__edge *p, int n) -{ - stbtt__sort_edges_quicksort(p, n); - stbtt__sort_edges_ins_sort(p, n); -} - -typedef struct -{ - float x,y; -} stbtt__point; - -static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) -{ - float y_scale_inv = invert ? -scale_y : scale_y; - stbtt__edge *e; - int n,i,j,k,m; -#if STBTT_RASTERIZER_VERSION == 1 - int vsubsample = result->h < 8 ? 15 : 5; -#elif STBTT_RASTERIZER_VERSION == 2 - int vsubsample = 1; -#else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - // vsubsample should divide 255 evenly; otherwise we won't reach full opacity - - // now we have to blow out the windings into explicit edge lists - n = 0; - for (i=0; i < windings; ++i) - n += wcount[i]; - - e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel - if (e == 0) return; - n = 0; - - m=0; - for (i=0; i < windings; ++i) { - stbtt__point *p = pts + m; - m += wcount[i]; - j = wcount[i]-1; - for (k=0; k < wcount[i]; j=k++) { - int a=k,b=j; - // skip the edge if horizontal - if (p[j].y == p[k].y) - continue; - // add edge from j to k to the list - e[n].invert = 0; - if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { - e[n].invert = 1; - a=j,b=k; - } - e[n].x0 = p[a].x * scale_x + shift_x; - e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; - e[n].x1 = p[b].x * scale_x + shift_x; - e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; - ++n; - } - } - - // now sort the edges by their highest point (should snap to integer, and then by x) - //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); - stbtt__sort_edges(e, n); - - // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule - stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); - - STBTT_free(e, userdata); -} - -static void stbtt__add_point(stbtt__point *points, int n, float x, float y) -{ - if (!points) return; // during first pass, it's unallocated - points[n].x = x; - points[n].y = y; -} - -// tesselate until threshhold p is happy... @TODO warped to compensate for non-linear stretching -static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) -{ - // midpoint - float mx = (x0 + 2*x1 + x2)/4; - float my = (y0 + 2*y1 + y2)/4; - // versus directly drawn line - float dx = (x0+x2)/2 - mx; - float dy = (y0+y2)/2 - my; - if (n > 16) // 65536 segments on one curve better be enough! - return 1; - if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA - stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); - stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); - } else { - stbtt__add_point(points, *num_points,x2,y2); - *num_points = *num_points+1; - } - return 1; -} - -// returns number of contours -static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) -{ - stbtt__point *points=0; - int num_points=0; - - float objspace_flatness_squared = objspace_flatness * objspace_flatness; - int i,n=0,start=0, pass; - - // count how many "moves" there are to get the contour count - for (i=0; i < num_verts; ++i) - if (vertices[i].type == STBTT_vmove) - ++n; - - *num_contours = n; - if (n == 0) return 0; - - *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); - - if (*contour_lengths == 0) { - *num_contours = 0; - return 0; - } - - // make two passes through the points so we don't need to realloc - for (pass=0; pass < 2; ++pass) { - float x=0,y=0; - if (pass == 1) { - points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); - if (points == NULL) goto error; - } - num_points = 0; - n= -1; - for (i=0; i < num_verts; ++i) { - switch (vertices[i].type) { - case STBTT_vmove: - // start the next contour - if (n >= 0) - (*contour_lengths)[n] = num_points - start; - ++n; - start = num_points; - - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x,y); - break; - case STBTT_vline: - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x, y); - break; - case STBTT_vcurve: - stbtt__tesselate_curve(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - } - } - (*contour_lengths)[n] = num_points - start; - } - - return points; -error: - STBTT_free(points, userdata); - STBTT_free(*contour_lengths, userdata); - *contour_lengths = 0; - *num_contours = 0; - return NULL; -} - -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) -{ - float scale = scale_x > scale_y ? scale_y : scale_x; - int winding_count, *winding_lengths; - stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); - if (windings) { - stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); - STBTT_free(winding_lengths, userdata); - STBTT_free(windings, userdata); - } -} - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) -{ - STBTT_free(bitmap, userdata); -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - int ix0,iy0,ix1,iy1; - stbtt__bitmap gbm; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - - if (scale_x == 0) scale_x = scale_y; - if (scale_y == 0) { - if (scale_x == 0) { - STBTT_free(vertices, info->userdata); - return NULL; - } - scale_y = scale_x; - } - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); - - // now we get the size - gbm.w = (ix1 - ix0); - gbm.h = (iy1 - iy0); - gbm.pixels = NULL; // in case we error - - if (width ) *width = gbm.w; - if (height) *height = gbm.h; - if (xoff ) *xoff = ix0; - if (yoff ) *yoff = iy0; - - if (gbm.w && gbm.h) { - gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); - if (gbm.pixels) { - gbm.stride = gbm.w; - - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); - } - } - STBTT_free(vertices, info->userdata); - return gbm.pixels; -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); -} - -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) -{ - int ix0,iy0; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); - gbm.pixels = output; - gbm.w = out_w; - gbm.h = out_h; - gbm.stride = out_stride; - - if (gbm.w && gbm.h) - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); - - STBTT_free(vertices, info->userdata); -} - -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) -{ - stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); -} - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-CRAPPY packing to keep source code small - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata) -{ - float scale; - int x,y,bottom_y, i; - stbtt_fontinfo f; - f.userdata = NULL; - if (!stbtt_InitFont(&f, data, offset)) - return -1; - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - x=y=1; - bottom_y = 1; - - scale = stbtt_ScaleForPixelHeight(&f, pixel_height); - - for (i=0; i < num_chars; ++i) { - int advance, lsb, x0,y0,x1,y1,gw,gh; - int g = stbtt_FindGlyphIndex(&f, first_char + i); - stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); - stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); - gw = x1-x0; - gh = y1-y0; - if (x + gw + 1 >= pw) - y = bottom_y, x = 1; // advance to next row - if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row - return -i; - STBTT_assert(x+gw < pw); - STBTT_assert(y+gh < ph); - stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); - chardata[i].x0 = (stbtt_int16) x; - chardata[i].y0 = (stbtt_int16) y; - chardata[i].x1 = (stbtt_int16) (x + gw); - chardata[i].y1 = (stbtt_int16) (y + gh); - chardata[i].xadvance = scale * advance; - chardata[i].xoff = (float) x0; - chardata[i].yoff = (float) y0; - x = x + gw + 1; - if (y+gh+1 > bottom_y) - bottom_y = y+gh+1; - } - return bottom_y; -} - -STBTT_DEF void stbtt_GetBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) -{ - float d3d_bias = opengl_fillrule ? 0 : -0.5f; - float ipw = 1.0f / pw, iph = 1.0f / ph; - stbtt_bakedchar *b = chardata + char_index; - int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); - int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); - - q->x0 = round_x + d3d_bias; - q->y0 = round_y + d3d_bias; - q->x1 = round_x + b->x1 - b->x0 + d3d_bias; - q->y1 = round_y + b->y1 - b->y0 + d3d_bias; - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - -////////////////////////////////////////////////////////////////////////////// -// -// rectangle packing replacement routines if you don't have stb_rect_pack.h -// - -#ifndef STB_RECT_PACK_VERSION - -typedef int stbrp_coord; - -//////////////////////////////////////////////////////////////////////////////////// -// // -// // -// COMPILER WARNING ?!?!? // -// // -// // -// if you get a compile warning due to these symbols being defined more than // -// once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // -// // -//////////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ - int width,height; - int x,y,bottom_y; -} stbrp_context; - -typedef struct -{ - unsigned char x; -} stbrp_node; - -struct stbrp_rect -{ - stbrp_coord x,y; - int id,w,h,was_packed; -}; - -static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) -{ - con->width = pw; - con->height = ph; - con->x = 0; - con->y = 0; - con->bottom_y = 0; - STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); -} - -static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) -{ - int i; - for (i=0; i < num_rects; ++i) { - if (con->x + rects[i].w > con->width) { - con->x = 0; - con->y = con->bottom_y; - } - if (con->y + rects[i].h > con->height) - break; - rects[i].x = con->x; - rects[i].y = con->y; - rects[i].was_packed = 1; - con->x += rects[i].w; - if (con->y + rects[i].h > con->bottom_y) - con->bottom_y = con->y + rects[i].h; - } - for ( ; i < num_rects; ++i) - rects[i].was_packed = 0; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If -// stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) -{ - stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); - int num_nodes = pw - padding; - stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); - - if (context == NULL || nodes == NULL) { - if (context != NULL) STBTT_free(context, alloc_context); - if (nodes != NULL) STBTT_free(nodes , alloc_context); - return 0; - } - - spc->user_allocator_context = alloc_context; - spc->width = pw; - spc->height = ph; - spc->pixels = pixels; - spc->pack_info = context; - spc->nodes = nodes; - spc->padding = padding; - spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; - spc->h_oversample = 1; - spc->v_oversample = 1; - - stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); - - if (pixels) - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - - return 1; -} - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) -{ - STBTT_free(spc->nodes , spc->user_allocator_context); - STBTT_free(spc->pack_info, spc->user_allocator_context); -} - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) -{ - STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); - STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); - if (h_oversample <= STBTT_MAX_OVERSAMPLE) - spc->h_oversample = h_oversample; - if (v_oversample <= STBTT_MAX_OVERSAMPLE) - spc->v_oversample = v_oversample; -} - -#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) - -static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_w = w - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < h; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < w; ++i) { - STBTT_assert(pixels[i] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i] = (unsigned char) (total / kernel_width); - } - - pixels += stride_in_bytes; - } -} - -static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_h = h - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < w; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < h; ++i) { - STBTT_assert(pixels[i*stride_in_bytes] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - - pixels += 1; - } -} - -static float stbtt__oversample_shift(int oversample) -{ - if (!oversample) - return 0.0f; - - // The prefilter is a box filter of width "oversample", - // which shifts phase by (oversample - 1)/2 pixels in - // oversampled space. We want to shift in the opposite - // direction to counter this. - return (float)-(oversample - 1) / (2.0f * (float)oversample); -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k; - - k=0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - ranges[i].h_oversample = (unsigned char) spc->h_oversample; - ranges[i].v_oversample = (unsigned char) spc->v_oversample; - for (j=0; j < ranges[i].num_chars; ++j) { - int x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - &x0,&y0,&x1,&y1); - rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); - rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); - ++k; - } - } - - return k; -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k, return_value = 1; - - // save current values - int old_h_over = spc->h_oversample; - int old_v_over = spc->v_oversample; - - k = 0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - float recip_h,recip_v,sub_x,sub_y; - spc->h_oversample = ranges[i].h_oversample; - spc->v_oversample = ranges[i].v_oversample; - recip_h = 1.0f / spc->h_oversample; - recip_v = 1.0f / spc->v_oversample; - sub_x = stbtt__oversample_shift(spc->h_oversample); - sub_y = stbtt__oversample_shift(spc->v_oversample); - for (j=0; j < ranges[i].num_chars; ++j) { - stbrp_rect *r = &rects[k]; - if (r->was_packed) { - stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; - int advance, lsb, x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - stbrp_coord pad = (stbrp_coord) spc->padding; - - // pad on left and top - r->x += pad; - r->y += pad; - r->w -= pad; - r->h -= pad; - stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); - stbtt_GetGlyphBitmapBox(info, glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - &x0,&y0,&x1,&y1); - stbtt_MakeGlyphBitmapSubpixel(info, - spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w - spc->h_oversample+1, - r->h - spc->v_oversample+1, - spc->stride_in_bytes, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - glyph); - - if (spc->h_oversample > 1) - stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->h_oversample); - - if (spc->v_oversample > 1) - stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->v_oversample); - - bc->x0 = (stbtt_int16) r->x; - bc->y0 = (stbtt_int16) r->y; - bc->x1 = (stbtt_int16) (r->x + r->w); - bc->y1 = (stbtt_int16) (r->y + r->h); - bc->xadvance = scale * advance; - bc->xoff = (float) x0 * recip_h + sub_x; - bc->yoff = (float) y0 * recip_v + sub_y; - bc->xoff2 = (x0 + r->w) * recip_h + sub_x; - bc->yoff2 = (y0 + r->h) * recip_v + sub_y; - } else { - return_value = 0; // if any fail, report failure - } - - ++k; - } - } - - // restore original values - spc->h_oversample = old_h_over; - spc->v_oversample = old_v_over; - - return return_value; -} - -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) -{ - stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); -} - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) -{ - stbtt_fontinfo info; - int i,j,n, return_value = 1; - //stbrp_context *context = (stbrp_context *) spc->pack_info; - stbrp_rect *rects; - - // flag all characters as NOT packed - for (i=0; i < num_ranges; ++i) - for (j=0; j < ranges[i].num_chars; ++j) - ranges[i].chardata_for_range[j].x0 = - ranges[i].chardata_for_range[j].y0 = - ranges[i].chardata_for_range[j].x1 = - ranges[i].chardata_for_range[j].y1 = 0; - - n = 0; - for (i=0; i < num_ranges; ++i) - n += ranges[i].num_chars; - - rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); - if (rects == NULL) - return 0; - - info.userdata = spc->user_allocator_context; - stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); - - n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); - - stbtt_PackFontRangesPackRects(spc, rects, n); - - return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); - - STBTT_free(rects, spc->user_allocator_context); - return return_value; -} - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, unsigned char *fontdata, int font_index, float font_size, - int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) -{ - stbtt_pack_range range; - range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; - range.array_of_unicode_codepoints = NULL; - range.num_chars = num_chars_in_range; - range.chardata_for_range = chardata_for_range; - range.font_size = font_size; - return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); -} - -STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) -{ - float ipw = 1.0f / pw, iph = 1.0f / ph; - stbtt_packedchar *b = chardata + char_index; - - if (align_to_integer) { - float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); - float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); - q->x0 = x; - q->y0 = y; - q->x1 = x + b->xoff2 - b->xoff; - q->y1 = y + b->yoff2 - b->yoff; - } else { - q->x0 = *xpos + b->xoff; - q->y0 = *ypos + b->yoff; - q->x1 = *xpos + b->xoff2; - q->y1 = *ypos + b->yoff2; - } - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - - -////////////////////////////////////////////////////////////////////////////// -// -// font name matching -- recommended not to use this -// - -// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) -{ - stbtt_int32 i=0; - - // convert utf16 to utf8 and compare the results while converting - while (len2) { - stbtt_uint16 ch = s2[0]*256 + s2[1]; - if (ch < 0x80) { - if (i >= len1) return -1; - if (s1[i++] != ch) return -1; - } else if (ch < 0x800) { - if (i+1 >= len1) return -1; - if (s1[i++] != 0xc0 + (ch >> 6)) return -1; - if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; - } else if (ch >= 0xd800 && ch < 0xdc00) { - stbtt_uint32 c; - stbtt_uint16 ch2 = s2[2]*256 + s2[3]; - if (i+3 >= len1) return -1; - c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; - if (s1[i++] != 0xf0 + (c >> 18)) return -1; - if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; - s2 += 2; // plus another 2 below - len2 -= 2; - } else if (ch >= 0xdc00 && ch < 0xe000) { - return -1; - } else { - if (i+2 >= len1) return -1; - if (s1[i++] != 0xe0 + (ch >> 12)) return -1; - if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; - } - s2 += 2; - len2 -= 2; - } - return i; -} - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) -{ - return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((const stbtt_uint8*) s1, len1, (const stbtt_uint8*) s2, len2); -} - -// returns results in whatever encoding you request... but note that 2-byte encodings -// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) -{ - stbtt_int32 i,count,stringOffset; - stbtt_uint8 *fc = font->data; - stbtt_uint32 offset = font->fontstart; - stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return NULL; - - count = ttUSHORT(fc+nm+2); - stringOffset = nm + ttUSHORT(fc+nm+4); - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) - && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { - *length = ttUSHORT(fc+loc+8); - return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); - } - } - return NULL; -} - -static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) -{ - stbtt_int32 i; - stbtt_int32 count = ttUSHORT(fc+nm+2); - stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); - - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - stbtt_int32 id = ttUSHORT(fc+loc+6); - if (id == target_id) { - // find the encoding - stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); - - // is this a Unicode encoding? - if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { - stbtt_int32 slen = ttUSHORT(fc+loc+8); - stbtt_int32 off = ttUSHORT(fc+loc+10); - - // check if there's a prefix match - stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); - if (matchlen >= 0) { - // check for target_id+1 immediately following, with same encoding & language - if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { - slen = ttUSHORT(fc+loc+12+8); - off = ttUSHORT(fc+loc+12+10); - if (slen == 0) { - if (matchlen == nlen) - return 1; - } else if (matchlen < nlen && name[matchlen] == ' ') { - ++matchlen; - if (stbtt_CompareUTF8toUTF16_bigendian((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) - return 1; - } - } else { - // if nothing immediately following - if (matchlen == nlen) - return 1; - } - } - } - - // @TODO handle other encodings - } - } - return 0; -} - -static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) -{ - stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); - stbtt_uint32 nm,hd; - if (!stbtt__isfont(fc+offset)) return 0; - - // check italics/bold/underline flags in macStyle... - if (flags) { - hd = stbtt__find_table(fc, offset, "head"); - if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; - } - - nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return 0; - - if (flags) { - // if we checked the macStyle flags, then just check the family and ignore the subfamily - if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } else { - if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } - - return 0; -} - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const char *name_utf8, stbtt_int32 flags) -{ - stbtt_int32 i; - for (i=0;;++i) { - stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); - if (off < 0) return off; - if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) - return off; - } -} - -#endif // STB_TRUETYPE_IMPLEMENTATION - - -// FULL VERSION HISTORY -// -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) allow user-defined fabs() replacement -// fix memory leak if fontsize=0.0 -// fix warning from duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// allow PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) -// also more precise AA rasterizer, except if shapes overlap -// remove need for STBTT_sort -// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC -// 1.04 (2015-04-15) typo in example -// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes -// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ -// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match -// non-oversampled; STBTT_POINT_SIZE for packed case only -// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling -// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) -// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID -// 0.8b (2014-07-07) fix a warning -// 0.8 (2014-05-25) fix a few more warnings -// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back -// 0.6c (2012-07-24) improve documentation -// 0.6b (2012-07-20) fix a few more warnings -// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, -// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty -// 0.5 (2011-12-09) bugfixes: -// subpixel glyph renderer computed wrong bounding box -// first vertex of shape can be off-curve (FreeSans) -// 0.4b (2011-12-03) fixed an error in the font baking example -// 0.4 (2011-12-01) kerning, subpixel rendering (tor) -// bugfixes for: -// codepoint-to-glyph conversion using table fmt=12 -// codepoint-to-glyph conversion using table fmt=4 -// stbtt_GetBakedQuad with non-square texture (Zer) -// updated Hello World! sample to use kerning and subpixel -// fixed some warnings -// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) -// userdata, malloc-from-userdata, non-zero fill (stb) -// 0.2 (2009-03-11) Fix unsigned/signed char warnings -// 0.1 (2009-03-09) First public release -// diff --git a/src/stb_vorbis.c b/src/stb_vorbis.c deleted file mode 100644 index 07d79318..00000000 --- a/src/stb_vorbis.c +++ /dev/null @@ -1,5010 +0,0 @@ -#include "stb_vorbis.h" - -#ifndef STB_VORBIS_HEADER_ONLY - -// global configuration settings (e.g. set these in the project/makefile), -// or just set them in this file at the top (although ideally the first few -// should be visible when the header file is compiled too, although it's not -// crucial) - -// STB_VORBIS_NO_PUSHDATA_API -// does not compile the code for the various stb_vorbis_*_pushdata() -// functions -// #define STB_VORBIS_NO_PUSHDATA_API - -// STB_VORBIS_NO_PULLDATA_API -// does not compile the code for the non-pushdata APIs -// #define STB_VORBIS_NO_PULLDATA_API - -// STB_VORBIS_NO_STDIO -// does not compile the code for the APIs that use FILE *s internally -// or externally (implied by STB_VORBIS_NO_PULLDATA_API) -// #define STB_VORBIS_NO_STDIO - -// STB_VORBIS_NO_INTEGER_CONVERSION -// does not compile the code for converting audio sample data from -// float to integer (implied by STB_VORBIS_NO_PULLDATA_API) -// #define STB_VORBIS_NO_INTEGER_CONVERSION - -// STB_VORBIS_NO_FAST_SCALED_FLOAT -// does not use a fast float-to-int trick to accelerate float-to-int on -// most platforms which requires endianness be defined correctly. -//#define STB_VORBIS_NO_FAST_SCALED_FLOAT - - -// STB_VORBIS_MAX_CHANNELS [number] -// globally define this to the maximum number of channels you need. -// The spec does not put a restriction on channels except that -// the count is stored in a byte, so 255 is the hard limit. -// Reducing this saves about 16 bytes per value, so using 16 saves -// (255-16)*16 or around 4KB. Plus anything other memory usage -// I forgot to account for. Can probably go as low as 8 (7.1 audio), -// 6 (5.1 audio), or 2 (stereo only). -#ifndef STB_VORBIS_MAX_CHANNELS -#define STB_VORBIS_MAX_CHANNELS 16 // enough for anyone? -#endif - -// STB_VORBIS_PUSHDATA_CRC_COUNT [number] -// after a flush_pushdata(), stb_vorbis begins scanning for the -// next valid page, without backtracking. when it finds something -// that looks like a page, it streams through it and verifies its -// CRC32. Should that validation fail, it keeps scanning. But it's -// possible that _while_ streaming through to check the CRC32 of -// one candidate page, it sees another candidate page. This #define -// determines how many "overlapping" candidate pages it can search -// at once. Note that "real" pages are typically ~4KB to ~8KB, whereas -// garbage pages could be as big as 64KB, but probably average ~16KB. -// So don't hose ourselves by scanning an apparent 64KB page and -// missing a ton of real ones in the interim; so minimum of 2 -#ifndef STB_VORBIS_PUSHDATA_CRC_COUNT -#define STB_VORBIS_PUSHDATA_CRC_COUNT 4 -#endif - -// STB_VORBIS_FAST_HUFFMAN_LENGTH [number] -// sets the log size of the huffman-acceleration table. Maximum -// supported value is 24. with larger numbers, more decodings are O(1), -// but the table size is larger so worse cache missing, so you'll have -// to probe (and try multiple ogg vorbis files) to find the sweet spot. -#ifndef STB_VORBIS_FAST_HUFFMAN_LENGTH -#define STB_VORBIS_FAST_HUFFMAN_LENGTH 10 -#endif - -// STB_VORBIS_FAST_BINARY_LENGTH [number] -// sets the log size of the binary-search acceleration table. this -// is used in similar fashion to the fast-huffman size to set initial -// parameters for the binary search - -// STB_VORBIS_FAST_HUFFMAN_INT -// The fast huffman tables are much more efficient if they can be -// stored as 16-bit results instead of 32-bit results. This restricts -// the codebooks to having only 65535 possible outcomes, though. -// (At least, accelerated by the huffman table.) -#ifndef STB_VORBIS_FAST_HUFFMAN_INT -#define STB_VORBIS_FAST_HUFFMAN_SHORT -#endif - -// STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH -// If the 'fast huffman' search doesn't succeed, then stb_vorbis falls -// back on binary searching for the correct one. This requires storing -// extra tables with the huffman codes in sorted order. Defining this -// symbol trades off space for speed by forcing a linear search in the -// non-fast case, except for "sparse" codebooks. -// #define STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH - -// STB_VORBIS_DIVIDES_IN_RESIDUE -// stb_vorbis precomputes the result of the scalar residue decoding -// that would otherwise require a divide per chunk. you can trade off -// space for time by defining this symbol. -// #define STB_VORBIS_DIVIDES_IN_RESIDUE - -// STB_VORBIS_DIVIDES_IN_CODEBOOK -// vorbis VQ codebooks can be encoded two ways: with every case explicitly -// stored, or with all elements being chosen from a small range of values, -// and all values possible in all elements. By default, stb_vorbis expands -// this latter kind out to look like the former kind for ease of decoding, -// because otherwise an integer divide-per-vector-element is required to -// unpack the index. If you define STB_VORBIS_DIVIDES_IN_CODEBOOK, you can -// trade off storage for speed. -//#define STB_VORBIS_DIVIDES_IN_CODEBOOK - -#ifdef STB_VORBIS_CODEBOOK_SHORTS -#error "STB_VORBIS_CODEBOOK_SHORTS is no longer supported as it produced incorrect results for some input formats" -#endif - -// STB_VORBIS_DIVIDE_TABLE -// this replaces small integer divides in the floor decode loop with -// table lookups. made less than 1% difference, so disabled by default. - -// STB_VORBIS_NO_INLINE_DECODE -// disables the inlining of the scalar codebook fast-huffman decode. -// might save a little codespace; useful for debugging -// #define STB_VORBIS_NO_INLINE_DECODE - -// STB_VORBIS_NO_DEFER_FLOOR -// Normally we only decode the floor without synthesizing the actual -// full curve. We can instead synthesize the curve immediately. This -// requires more memory and is very likely slower, so I don't think -// you'd ever want to do it except for debugging. -// #define STB_VORBIS_NO_DEFER_FLOOR - - - - -////////////////////////////////////////////////////////////////////////////// - -#ifdef STB_VORBIS_NO_PULLDATA_API - #define STB_VORBIS_NO_INTEGER_CONVERSION - #define STB_VORBIS_NO_STDIO -#endif - -#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) - #define STB_VORBIS_NO_STDIO 1 -#endif - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT - - // only need endianness for fast-float-to-int, which we don't - // use for pushdata - - #ifndef STB_VORBIS_BIG_ENDIAN - #define STB_VORBIS_ENDIAN 0 - #else - #define STB_VORBIS_ENDIAN 1 - #endif - -#endif -#endif - - -#ifndef STB_VORBIS_NO_STDIO -#include -#endif - -#ifndef STB_VORBIS_NO_CRT -#include -#include -#include -#include -#if !(defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)) -#include -#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) -#include -#endif -#endif -#else // STB_VORBIS_NO_CRT -#define NULL 0 -#define malloc(s) 0 -#define free(s) ((void) 0) -#define realloc(s) 0 -#endif // STB_VORBIS_NO_CRT - -#include - -#ifdef __MINGW32__ - // eff you mingw: - // "fixed": - // http://sourceforge.net/p/mingw-w64/mailman/message/32882927/ - // "no that broke the build, reverted, who cares about C": - // http://sourceforge.net/p/mingw-w64/mailman/message/32890381/ - #ifdef __forceinline - #undef __forceinline - #endif - #define __forceinline -#elif !defined(_MSC_VER) - #if __GNUC__ - #define __forceinline inline - #else - #define __forceinline - #endif -#endif - -#if STB_VORBIS_MAX_CHANNELS > 256 -#error "Value of STB_VORBIS_MAX_CHANNELS outside of allowed range" -#endif - -#if STB_VORBIS_FAST_HUFFMAN_LENGTH > 24 -#error "Value of STB_VORBIS_FAST_HUFFMAN_LENGTH outside of allowed range" -#endif - - -#if 0 -#include -#define CHECK(f) _CrtIsValidHeapPointer(f->channel_buffers[1]) -#else -#define CHECK(f) ((void) 0) -#endif - -#define MAX_BLOCKSIZE_LOG 13 // from specification -#define MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) - - -typedef unsigned char uint8; -typedef signed char int8; -typedef unsigned short uint16; -typedef signed short int16; -typedef unsigned int uint32; -typedef signed int int32; - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -typedef float codetype; - -// @NOTE -// -// Some arrays below are tagged "//varies", which means it's actually -// a variable-sized piece of data, but rather than malloc I assume it's -// small enough it's better to just allocate it all together with the -// main thing -// -// Most of the variables are specified with the smallest size I could pack -// them into. It might give better performance to make them all full-sized -// integers. It should be safe to freely rearrange the structures or change -// the sizes larger--nothing relies on silently truncating etc., nor the -// order of variables. - -#define FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) -#define FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) - -typedef struct -{ - int dimensions, entries; - uint8 *codeword_lengths; - float minimum_value; - float delta_value; - uint8 value_bits; - uint8 lookup_type; - uint8 sequence_p; - uint8 sparse; - uint32 lookup_values; - codetype *multiplicands; - uint32 *codewords; - #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT - int16 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; - #else - int32 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; - #endif - uint32 *sorted_codewords; - int *sorted_values; - int sorted_entries; -} Codebook; - -typedef struct -{ - uint8 order; - uint16 rate; - uint16 bark_map_size; - uint8 amplitude_bits; - uint8 amplitude_offset; - uint8 number_of_books; - uint8 book_list[16]; // varies -} Floor0; - -typedef struct -{ - uint8 partitions; - uint8 partition_class_list[32]; // varies - uint8 class_dimensions[16]; // varies - uint8 class_subclasses[16]; // varies - uint8 class_masterbooks[16]; // varies - int16 subclass_books[16][8]; // varies - uint16 Xlist[31*8+2]; // varies - uint8 sorted_order[31*8+2]; - uint8 neighbors[31*8+2][2]; - uint8 floor1_multiplier; - uint8 rangebits; - int values; -} Floor1; - -typedef union -{ - Floor0 floor0; - Floor1 floor1; -} Floor; - -typedef struct -{ - uint32 begin, end; - uint32 part_size; - uint8 classifications; - uint8 classbook; - uint8 **classdata; - int16 (*residue_books)[8]; -} Residue; - -typedef struct -{ - uint8 magnitude; - uint8 angle; - uint8 mux; -} MappingChannel; - -typedef struct -{ - uint16 coupling_steps; - MappingChannel *chan; - uint8 submaps; - uint8 submap_floor[15]; // varies - uint8 submap_residue[15]; // varies -} Mapping; - -typedef struct -{ - uint8 blockflag; - uint8 mapping; - uint16 windowtype; - uint16 transformtype; -} Mode; - -typedef struct -{ - uint32 goal_crc; // expected crc if match - int bytes_left; // bytes left in packet - uint32 crc_so_far; // running crc - int bytes_done; // bytes processed in _current_ chunk - uint32 sample_loc; // granule pos encoded in page -} CRCscan; - -typedef struct -{ - uint32 page_start, page_end; - uint32 last_decoded_sample; -} ProbedPage; - -struct stb_vorbis -{ - // user-accessible info - unsigned int sample_rate; - int channels; - - unsigned int setup_memory_required; - unsigned int temp_memory_required; - unsigned int setup_temp_memory_required; - - // input config -#ifndef STB_VORBIS_NO_STDIO - FILE *f; - uint32 f_start; - int close_on_free; -#endif - - uint8 *stream; - uint8 *stream_start; - uint8 *stream_end; - - uint32 stream_len; - - uint8 push_mode; - - uint32 first_audio_page_offset; - - ProbedPage p_first, p_last; - - // memory management - stb_vorbis_alloc alloc; - int setup_offset; - int temp_offset; - - // run-time results - int eof; - enum STBVorbisError error; - - // user-useful data - - // header info - int blocksize[2]; - int blocksize_0, blocksize_1; - int codebook_count; - Codebook *codebooks; - int floor_count; - uint16 floor_types[64]; // varies - Floor *floor_config; - int residue_count; - uint16 residue_types[64]; // varies - Residue *residue_config; - int mapping_count; - Mapping *mapping; - int mode_count; - Mode mode_config[64]; // varies - - uint32 total_samples; - - // decode buffer - float *channel_buffers[STB_VORBIS_MAX_CHANNELS]; - float *outputs [STB_VORBIS_MAX_CHANNELS]; - - float *previous_window[STB_VORBIS_MAX_CHANNELS]; - int previous_length; - - #ifndef STB_VORBIS_NO_DEFER_FLOOR - int16 *finalY[STB_VORBIS_MAX_CHANNELS]; - #else - float *floor_buffers[STB_VORBIS_MAX_CHANNELS]; - #endif - - uint32 current_loc; // sample location of next frame to decode - int current_loc_valid; - - // per-blocksize precomputed data - - // twiddle factors - float *A[2],*B[2],*C[2]; - float *window[2]; - uint16 *bit_reverse[2]; - - // current page/packet/segment streaming info - uint32 serial; // stream serial number for verification - int last_page; - int segment_count; - uint8 segments[255]; - uint8 page_flag; - uint8 bytes_in_seg; - uint8 first_decode; - int next_seg; - int last_seg; // flag that we're on the last segment - int last_seg_which; // what was the segment number of the last seg? - uint32 acc; - int valid_bits; - int packet_bytes; - int end_seg_with_known_loc; - uint32 known_loc_for_packet; - int discard_samples_deferred; - uint32 samples_output; - - // push mode scanning - int page_crc_tests; // only in push_mode: number of tests active; -1 if not searching -#ifndef STB_VORBIS_NO_PUSHDATA_API - CRCscan scan[STB_VORBIS_PUSHDATA_CRC_COUNT]; -#endif - - // sample-access - int channel_buffer_start; - int channel_buffer_end; -}; - -#if defined(STB_VORBIS_NO_PUSHDATA_API) - #define IS_PUSH_MODE(f) FALSE -#elif defined(STB_VORBIS_NO_PULLDATA_API) - #define IS_PUSH_MODE(f) TRUE -#else - #define IS_PUSH_MODE(f) ((f)->push_mode) -#endif - -typedef struct stb_vorbis vorb; - -static int error(vorb *f, enum STBVorbisError e) -{ - f->error = e; - if (!f->eof && e != VORBIS_need_more_data) { - f->error=e; // breakpoint for debugging - } - return 0; -} - - -// these functions are used for allocating temporary memory -// while decoding. if you can afford the stack space, use -// alloca(); otherwise, provide a temp buffer and it will -// allocate out of those. - -#define array_size_required(count,size) (count*(sizeof(void *)+(size))) - -#define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) -#ifdef dealloca -#define temp_free(f,p) (f->alloc.alloc_buffer ? 0 : dealloca(size)) -#else -#define temp_free(f,p) 0 -#endif -#define temp_alloc_save(f) ((f)->temp_offset) -#define temp_alloc_restore(f,p) ((f)->temp_offset = (p)) - -#define temp_block_array(f,count,size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) - -// given a sufficiently large block of memory, make an array of pointers to subblocks of it -static void *make_block_array(void *mem, int count, int size) -{ - int i; - void ** p = (void **) mem; - char *q = (char *) (p + count); - for (i=0; i < count; ++i) { - p[i] = q; - q += size; - } - return p; -} - -static void *setup_malloc(vorb *f, int sz) -{ - sz = (sz+3) & ~3; - f->setup_memory_required += sz; - if (f->alloc.alloc_buffer) { - void *p = (char *) f->alloc.alloc_buffer + f->setup_offset; - if (f->setup_offset + sz > f->temp_offset) return NULL; - f->setup_offset += sz; - return p; - } - return sz ? malloc(sz) : NULL; -} - -static void setup_free(vorb *f, void *p) -{ - if (f->alloc.alloc_buffer) return; // do nothing; setup mem is a stack - free(p); -} - -static void *setup_temp_malloc(vorb *f, int sz) -{ - sz = (sz+3) & ~3; - if (f->alloc.alloc_buffer) { - if (f->temp_offset - sz < f->setup_offset) return NULL; - f->temp_offset -= sz; - return (char *) f->alloc.alloc_buffer + f->temp_offset; - } - return malloc(sz); -} - -static void setup_temp_free(vorb *f, void *p, int sz) -{ - if (f->alloc.alloc_buffer) { - f->temp_offset += (sz+3)&~3; - return; - } - free(p); -} - -#define CRC32_POLY 0x04c11db7 // from spec - -static uint32 crc_table[256]; -static void crc32_init(void) -{ - int i,j; - uint32 s; - for(i=0; i < 256; i++) { - for (s=(uint32) i << 24, j=0; j < 8; ++j) - s = (s << 1) ^ (s >= (1U<<31) ? CRC32_POLY : 0); - crc_table[i] = s; - } -} - -static __forceinline uint32 crc32_update(uint32 crc, uint8 byte) -{ - return (crc << 8) ^ crc_table[byte ^ (crc >> 24)]; -} - - -// used in setup, and for huffman that doesn't go fast path -static unsigned int bit_reverse(unsigned int n) -{ - n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1); - n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2); - n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4); - n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8); - return (n >> 16) | (n << 16); -} - -static float square(float x) -{ - return x*x; -} - -// this is a weird definition of log2() for which log2(1) = 1, log2(2) = 2, log2(4) = 3 -// as required by the specification. fast(?) implementation from stb.h -// @OPTIMIZE: called multiple times per-packet with "constants"; move to setup -static int ilog(int32 n) -{ - static signed char log2_4[16] = { 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 }; - - // 2 compares if n < 16, 3 compares otherwise (4 if signed or n > 1<<29) - if (n < (1 << 14)) - if (n < (1 << 4)) return 0 + log2_4[n ]; - else if (n < (1 << 9)) return 5 + log2_4[n >> 5]; - else return 10 + log2_4[n >> 10]; - else if (n < (1 << 24)) - if (n < (1 << 19)) return 15 + log2_4[n >> 15]; - else return 20 + log2_4[n >> 20]; - else if (n < (1 << 29)) return 25 + log2_4[n >> 25]; - else if (n < (1 << 31)) return 30 + log2_4[n >> 30]; - else return 0; // signed n returns 0 -} - -#ifndef M_PI - #define M_PI 3.14159265358979323846264f // from CRC -#endif - -// code length assigned to a value with no huffman encoding -#define NO_CODE 255 - -/////////////////////// LEAF SETUP FUNCTIONS ////////////////////////// -// -// these functions are only called at setup, and only a few times -// per file - -static float float32_unpack(uint32 x) -{ - // from the specification - uint32 mantissa = x & 0x1fffff; - uint32 sign = x & 0x80000000; - uint32 exp = (x & 0x7fe00000) >> 21; - double res = sign ? -(double)mantissa : (double)mantissa; - return (float) ldexp((float)res, exp-788); -} - - -// zlib & jpeg huffman tables assume that the output symbols -// can either be arbitrarily arranged, or have monotonically -// increasing frequencies--they rely on the lengths being sorted; -// this makes for a very simple generation algorithm. -// vorbis allows a huffman table with non-sorted lengths. This -// requires a more sophisticated construction, since symbols in -// order do not map to huffman codes "in order". -static void add_entry(Codebook *c, uint32 huff_code, int symbol, int count, int len, uint32 *values) -{ - if (!c->sparse) { - c->codewords [symbol] = huff_code; - } else { - c->codewords [count] = huff_code; - c->codeword_lengths[count] = len; - values [count] = symbol; - } -} - -static int compute_codewords(Codebook *c, uint8 *len, int n, uint32 *values) -{ - int i,k,m=0; - uint32 available[32]; - - memset(available, 0, sizeof(available)); - // find the first entry - for (k=0; k < n; ++k) if (len[k] < NO_CODE) break; - if (k == n) { assert(c->sorted_entries == 0); return TRUE; } - // add to the list - add_entry(c, 0, k, m++, len[k], values); - // add all available leaves - for (i=1; i <= len[k]; ++i) - available[i] = 1U << (32-i); - // note that the above code treats the first case specially, - // but it's really the same as the following code, so they - // could probably be combined (except the initial code is 0, - // and I use 0 in available[] to mean 'empty') - for (i=k+1; i < n; ++i) { - uint32 res; - int z = len[i], y; - if (z == NO_CODE) continue; - // find lowest available leaf (should always be earliest, - // which is what the specification calls for) - // note that this property, and the fact we can never have - // more than one free leaf at a given level, isn't totally - // trivial to prove, but it seems true and the assert never - // fires, so! - while (z > 0 && !available[z]) --z; - if (z == 0) { return FALSE; } - res = available[z]; - assert(z >= 0 && z < 32); - available[z] = 0; - add_entry(c, bit_reverse(res), i, m++, len[i], values); - // propogate availability up the tree - if (z != len[i]) { - assert(len[i] >= 0 && len[i] < 32); - for (y=len[i]; y > z; --y) { - assert(available[y] == 0); - available[y] = res + (1 << (32-y)); - } - } - } - return TRUE; -} - -// accelerated huffman table allows fast O(1) match of all symbols -// of length <= STB_VORBIS_FAST_HUFFMAN_LENGTH -static void compute_accelerated_huffman(Codebook *c) -{ - int i, len; - for (i=0; i < FAST_HUFFMAN_TABLE_SIZE; ++i) - c->fast_huffman[i] = -1; - - len = c->sparse ? c->sorted_entries : c->entries; - #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT - if (len > 32767) len = 32767; // largest possible value we can encode! - #endif - for (i=0; i < len; ++i) { - if (c->codeword_lengths[i] <= STB_VORBIS_FAST_HUFFMAN_LENGTH) { - uint32 z = c->sparse ? bit_reverse(c->sorted_codewords[i]) : c->codewords[i]; - // set table entries for all bit combinations in the higher bits - while (z < FAST_HUFFMAN_TABLE_SIZE) { - c->fast_huffman[z] = i; - z += 1 << c->codeword_lengths[i]; - } - } - } -} - -#ifdef _MSC_VER -#define STBV_CDECL __cdecl -#else -#define STBV_CDECL -#endif - -static int STBV_CDECL uint32_compare(const void *p, const void *q) -{ - uint32 x = * (uint32 *) p; - uint32 y = * (uint32 *) q; - return x < y ? -1 : x > y; -} - -static int include_in_sort(Codebook *c, uint8 len) -{ - if (c->sparse) { assert(len != NO_CODE); return TRUE; } - if (len == NO_CODE) return FALSE; - if (len > STB_VORBIS_FAST_HUFFMAN_LENGTH) return TRUE; - return FALSE; -} - -// if the fast table above doesn't work, we want to binary -// search them... need to reverse the bits -static void compute_sorted_huffman(Codebook *c, uint8 *lengths, uint32 *values) -{ - int i, len; - // build a list of all the entries - // OPTIMIZATION: don't include the short ones, since they'll be caught by FAST_HUFFMAN. - // this is kind of a frivolous optimization--I don't see any performance improvement, - // but it's like 4 extra lines of code, so. - if (!c->sparse) { - int k = 0; - for (i=0; i < c->entries; ++i) - if (include_in_sort(c, lengths[i])) - c->sorted_codewords[k++] = bit_reverse(c->codewords[i]); - assert(k == c->sorted_entries); - } else { - for (i=0; i < c->sorted_entries; ++i) - c->sorted_codewords[i] = bit_reverse(c->codewords[i]); - } - - qsort(c->sorted_codewords, c->sorted_entries, sizeof(c->sorted_codewords[0]), uint32_compare); - c->sorted_codewords[c->sorted_entries] = 0xffffffff; - - len = c->sparse ? c->sorted_entries : c->entries; - // now we need to indicate how they correspond; we could either - // #1: sort a different data structure that says who they correspond to - // #2: for each sorted entry, search the original list to find who corresponds - // #3: for each original entry, find the sorted entry - // #1 requires extra storage, #2 is slow, #3 can use binary search! - for (i=0; i < len; ++i) { - int huff_len = c->sparse ? lengths[values[i]] : lengths[i]; - if (include_in_sort(c,huff_len)) { - uint32 code = bit_reverse(c->codewords[i]); - int x=0, n=c->sorted_entries; - while (n > 1) { - // invariant: sc[x] <= code < sc[x+n] - int m = x + (n >> 1); - if (c->sorted_codewords[m] <= code) { - x = m; - n -= (n>>1); - } else { - n >>= 1; - } - } - assert(c->sorted_codewords[x] == code); - if (c->sparse) { - c->sorted_values[x] = values[i]; - c->codeword_lengths[x] = huff_len; - } else { - c->sorted_values[x] = i; - } - } - } -} - -// only run while parsing the header (3 times) -static int vorbis_validate(uint8 *data) -{ - static uint8 vorbis[6] = { 'v', 'o', 'r', 'b', 'i', 's' }; - return memcmp(data, vorbis, 6) == 0; -} - -// called from setup only, once per code book -// (formula implied by specification) -static int lookup1_values(int entries, int dim) -{ - int r = (int) floor(exp((float) log((float) entries) / dim)); - if ((int) floor(pow((float) r+1, dim)) <= entries) // (int) cast for MinGW warning; - ++r; // floor() to avoid _ftol() when non-CRT - assert(pow((float) r+1, dim) > entries); - assert((int) floor(pow((float) r, dim)) <= entries); // (int),floor() as above - return r; -} - -// called twice per file -static void compute_twiddle_factors(int n, float *A, float *B, float *C) -{ - int n4 = n >> 2, n8 = n >> 3; - int k,k2; - - for (k=k2=0; k < n4; ++k,k2+=2) { - A[k2 ] = (float) cos(4*k*M_PI/n); - A[k2+1] = (float) -sin(4*k*M_PI/n); - B[k2 ] = (float) cos((k2+1)*M_PI/n/2) * 0.5f; - B[k2+1] = (float) sin((k2+1)*M_PI/n/2) * 0.5f; - } - for (k=k2=0; k < n8; ++k,k2+=2) { - C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); - C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); - } -} - -static void compute_window(int n, float *window) -{ - int n2 = n >> 1, i; - for (i=0; i < n2; ++i) - window[i] = (float) sin(0.5 * M_PI * square((float) sin((i - 0 + 0.5) / n2 * 0.5 * M_PI))); -} - -static void compute_bitreverse(int n, uint16 *rev) -{ - int ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - int i, n8 = n >> 3; - for (i=0; i < n8; ++i) - rev[i] = (bit_reverse(i) >> (32-ld+3)) << 2; -} - -static int init_blocksize(vorb *f, int b, int n) -{ - int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3; - f->A[b] = (float *) setup_malloc(f, sizeof(float) * n2); - f->B[b] = (float *) setup_malloc(f, sizeof(float) * n2); - f->C[b] = (float *) setup_malloc(f, sizeof(float) * n4); - if (!f->A[b] || !f->B[b] || !f->C[b]) return error(f, VORBIS_outofmem); - compute_twiddle_factors(n, f->A[b], f->B[b], f->C[b]); - f->window[b] = (float *) setup_malloc(f, sizeof(float) * n2); - if (!f->window[b]) return error(f, VORBIS_outofmem); - compute_window(n, f->window[b]); - f->bit_reverse[b] = (uint16 *) setup_malloc(f, sizeof(uint16) * n8); - if (!f->bit_reverse[b]) return error(f, VORBIS_outofmem); - compute_bitreverse(n, f->bit_reverse[b]); - return TRUE; -} - -static void neighbors(uint16 *x, int n, int *plow, int *phigh) -{ - int low = -1; - int high = 65536; - int i; - for (i=0; i < n; ++i) { - if (x[i] > low && x[i] < x[n]) { *plow = i; low = x[i]; } - if (x[i] < high && x[i] > x[n]) { *phigh = i; high = x[i]; } - } -} - -// this has been repurposed so y is now the original index instead of y -typedef struct -{ - uint16 x,y; -} Point; - -static int STBV_CDECL point_compare(const void *p, const void *q) -{ - Point *a = (Point *) p; - Point *b = (Point *) q; - return a->x < b->x ? -1 : a->x > b->x; -} - -// -/////////////////////// END LEAF SETUP FUNCTIONS ////////////////////////// - - -#if defined(STB_VORBIS_NO_STDIO) - #define USE_MEMORY(z) TRUE -#else - #define USE_MEMORY(z) ((z)->stream) -#endif - -static uint8 get8(vorb *z) -{ - if (USE_MEMORY(z)) { - if (z->stream >= z->stream_end) { z->eof = TRUE; return 0; } - return *z->stream++; - } - - #ifndef STB_VORBIS_NO_STDIO - { - int c = fgetc(z->f); - if (c == EOF) { z->eof = TRUE; return 0; } - return c; - } - #endif -} - -static uint32 get32(vorb *f) -{ - uint32 x; - x = get8(f); - x += get8(f) << 8; - x += get8(f) << 16; - x += (uint32) get8(f) << 24; - return x; -} - -static int getn(vorb *z, uint8 *data, int n) -{ - if (USE_MEMORY(z)) { - if (z->stream+n > z->stream_end) { z->eof = 1; return 0; } - memcpy(data, z->stream, n); - z->stream += n; - return 1; - } - - #ifndef STB_VORBIS_NO_STDIO - if (fread(data, n, 1, z->f) == 1) - return 1; - else { - z->eof = 1; - return 0; - } - #endif -} - -static void skip(vorb *z, int n) -{ - if (USE_MEMORY(z)) { - z->stream += n; - if (z->stream >= z->stream_end) z->eof = 1; - return; - } - #ifndef STB_VORBIS_NO_STDIO - { - long x = ftell(z->f); - fseek(z->f, x+n, SEEK_SET); - } - #endif -} - -static int set_file_offset(stb_vorbis *f, unsigned int loc) -{ - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (f->push_mode) return 0; - #endif - f->eof = 0; - if (USE_MEMORY(f)) { - if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) { - f->stream = f->stream_end; - f->eof = 1; - return 0; - } else { - f->stream = f->stream_start + loc; - return 1; - } - } - #ifndef STB_VORBIS_NO_STDIO - if (loc + f->f_start < loc || loc >= 0x80000000) { - loc = 0x7fffffff; - f->eof = 1; - } else { - loc += f->f_start; - } - if (!fseek(f->f, loc, SEEK_SET)) - return 1; - f->eof = 1; - fseek(f->f, f->f_start, SEEK_END); - return 0; - #endif -} - - -static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 }; - -static int capture_pattern(vorb *f) -{ - if (0x4f != get8(f)) return FALSE; - if (0x67 != get8(f)) return FALSE; - if (0x67 != get8(f)) return FALSE; - if (0x53 != get8(f)) return FALSE; - return TRUE; -} - -#define PAGEFLAG_continued_packet 1 -#define PAGEFLAG_first_page 2 -#define PAGEFLAG_last_page 4 - -static int start_page_no_capturepattern(vorb *f) -{ - uint32 loc0,loc1,n; - // stream structure version - if (0 != get8(f)) return error(f, VORBIS_invalid_stream_structure_version); - // header flag - f->page_flag = get8(f); - // absolute granule position - loc0 = get32(f); - loc1 = get32(f); - // @TODO: validate loc0,loc1 as valid positions? - // stream serial number -- vorbis doesn't interleave, so discard - get32(f); - //if (f->serial != get32(f)) return error(f, VORBIS_incorrect_stream_serial_number); - // page sequence number - n = get32(f); - f->last_page = n; - // CRC32 - get32(f); - // page_segments - f->segment_count = get8(f); - if (!getn(f, f->segments, f->segment_count)) - return error(f, VORBIS_unexpected_eof); - // assume we _don't_ know any the sample position of any segments - f->end_seg_with_known_loc = -2; - if (loc0 != ~0U || loc1 != ~0U) { - int i; - // determine which packet is the last one that will complete - for (i=f->segment_count-1; i >= 0; --i) - if (f->segments[i] < 255) - break; - // 'i' is now the index of the _last_ segment of a packet that ends - if (i >= 0) { - f->end_seg_with_known_loc = i; - f->known_loc_for_packet = loc0; - } - } - if (f->first_decode) { - int i,len; - ProbedPage p; - len = 0; - for (i=0; i < f->segment_count; ++i) - len += f->segments[i]; - len += 27 + f->segment_count; - p.page_start = f->first_audio_page_offset; - p.page_end = p.page_start + len; - p.last_decoded_sample = loc0; - f->p_first = p; - } - f->next_seg = 0; - return TRUE; -} - -static int start_page(vorb *f) -{ - if (!capture_pattern(f)) return error(f, VORBIS_missing_capture_pattern); - return start_page_no_capturepattern(f); -} - -static int start_packet(vorb *f) -{ - while (f->next_seg == -1) { - if (!start_page(f)) return FALSE; - if (f->page_flag & PAGEFLAG_continued_packet) - return error(f, VORBIS_continued_packet_flag_invalid); - } - f->last_seg = FALSE; - f->valid_bits = 0; - f->packet_bytes = 0; - f->bytes_in_seg = 0; - // f->next_seg is now valid - return TRUE; -} - -static int maybe_start_packet(vorb *f) -{ - if (f->next_seg == -1) { - int x = get8(f); - if (f->eof) return FALSE; // EOF at page boundary is not an error! - if (0x4f != x ) return error(f, VORBIS_missing_capture_pattern); - if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (0x53 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (!start_page_no_capturepattern(f)) return FALSE; - if (f->page_flag & PAGEFLAG_continued_packet) { - // set up enough state that we can read this packet if we want, - // e.g. during recovery - f->last_seg = FALSE; - f->bytes_in_seg = 0; - return error(f, VORBIS_continued_packet_flag_invalid); - } - } - return start_packet(f); -} - -static int next_segment(vorb *f) -{ - int len; - if (f->last_seg) return 0; - if (f->next_seg == -1) { - f->last_seg_which = f->segment_count-1; // in case start_page fails - if (!start_page(f)) { f->last_seg = 1; return 0; } - if (!(f->page_flag & PAGEFLAG_continued_packet)) return error(f, VORBIS_continued_packet_flag_invalid); - } - len = f->segments[f->next_seg++]; - if (len < 255) { - f->last_seg = TRUE; - f->last_seg_which = f->next_seg-1; - } - if (f->next_seg >= f->segment_count) - f->next_seg = -1; - assert(f->bytes_in_seg == 0); - f->bytes_in_seg = len; - return len; -} - -#define EOP (-1) -#define INVALID_BITS (-1) - -static int get8_packet_raw(vorb *f) -{ - if (!f->bytes_in_seg) { // CLANG! - if (f->last_seg) return EOP; - else if (!next_segment(f)) return EOP; - } - assert(f->bytes_in_seg > 0); - --f->bytes_in_seg; - ++f->packet_bytes; - return get8(f); -} - -static int get8_packet(vorb *f) -{ - int x = get8_packet_raw(f); - f->valid_bits = 0; - return x; -} - -static void flush_packet(vorb *f) -{ - while (get8_packet_raw(f) != EOP); -} - -// @OPTIMIZE: this is the secondary bit decoder, so it's probably not as important -// as the huffman decoder? -static uint32 get_bits(vorb *f, int n) -{ - uint32 z; - - if (f->valid_bits < 0) return 0; - if (f->valid_bits < n) { - if (n > 24) { - // the accumulator technique below would not work correctly in this case - z = get_bits(f, 24); - z += get_bits(f, n-24) << 24; - return z; - } - if (f->valid_bits == 0) f->acc = 0; - while (f->valid_bits < n) { - int z = get8_packet_raw(f); - if (z == EOP) { - f->valid_bits = INVALID_BITS; - return 0; - } - f->acc += z << f->valid_bits; - f->valid_bits += 8; - } - } - if (f->valid_bits < 0) return 0; - z = f->acc & ((1 << n)-1); - f->acc >>= n; - f->valid_bits -= n; - return z; -} - -// @OPTIMIZE: primary accumulator for huffman -// expand the buffer to as many bits as possible without reading off end of packet -// it might be nice to allow f->valid_bits and f->acc to be stored in registers, -// e.g. cache them locally and decode locally -static __forceinline void prep_huffman(vorb *f) -{ - if (f->valid_bits <= 24) { - if (f->valid_bits == 0) f->acc = 0; - do { - int z; - if (f->last_seg && !f->bytes_in_seg) return; - z = get8_packet_raw(f); - if (z == EOP) return; - f->acc += (unsigned) z << f->valid_bits; - f->valid_bits += 8; - } while (f->valid_bits <= 24); - } -} - -enum -{ - VORBIS_packet_id = 1, - VORBIS_packet_comment = 3, - VORBIS_packet_setup = 5 -}; - -static int codebook_decode_scalar_raw(vorb *f, Codebook *c) -{ - int i; - prep_huffman(f); - - if (c->codewords == NULL && c->sorted_codewords == NULL) - return -1; - - // cases to use binary search: sorted_codewords && !c->codewords - // sorted_codewords && c->entries > 8 - if (c->entries > 8 ? c->sorted_codewords!=NULL : !c->codewords) { - // binary search - uint32 code = bit_reverse(f->acc); - int x=0, n=c->sorted_entries, len; - - while (n > 1) { - // invariant: sc[x] <= code < sc[x+n] - int m = x + (n >> 1); - if (c->sorted_codewords[m] <= code) { - x = m; - n -= (n>>1); - } else { - n >>= 1; - } - } - // x is now the sorted index - if (!c->sparse) x = c->sorted_values[x]; - // x is now sorted index if sparse, or symbol otherwise - len = c->codeword_lengths[x]; - if (f->valid_bits >= len) { - f->acc >>= len; - f->valid_bits -= len; - return x; - } - - f->valid_bits = 0; - return -1; - } - - // if small, linear search - assert(!c->sparse); - for (i=0; i < c->entries; ++i) { - if (c->codeword_lengths[i] == NO_CODE) continue; - if (c->codewords[i] == (f->acc & ((1 << c->codeword_lengths[i])-1))) { - if (f->valid_bits >= c->codeword_lengths[i]) { - f->acc >>= c->codeword_lengths[i]; - f->valid_bits -= c->codeword_lengths[i]; - return i; - } - f->valid_bits = 0; - return -1; - } - } - - error(f, VORBIS_invalid_stream); - f->valid_bits = 0; - return -1; -} - -#ifndef STB_VORBIS_NO_INLINE_DECODE - -#define DECODE_RAW(var, f,c) \ - if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) \ - prep_huffman(f); \ - var = f->acc & FAST_HUFFMAN_TABLE_MASK; \ - var = c->fast_huffman[var]; \ - if (var >= 0) { \ - int n = c->codeword_lengths[var]; \ - f->acc >>= n; \ - f->valid_bits -= n; \ - if (f->valid_bits < 0) { f->valid_bits = 0; var = -1; } \ - } else { \ - var = codebook_decode_scalar_raw(f,c); \ - } - -#else - -static int codebook_decode_scalar(vorb *f, Codebook *c) -{ - int i; - if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) - prep_huffman(f); - // fast huffman table lookup - i = f->acc & FAST_HUFFMAN_TABLE_MASK; - i = c->fast_huffman[i]; - if (i >= 0) { - f->acc >>= c->codeword_lengths[i]; - f->valid_bits -= c->codeword_lengths[i]; - if (f->valid_bits < 0) { f->valid_bits = 0; return -1; } - return i; - } - return codebook_decode_scalar_raw(f,c); -} - -#define DECODE_RAW(var,f,c) var = codebook_decode_scalar(f,c); - -#endif - -#define DECODE(var,f,c) \ - DECODE_RAW(var,f,c) \ - if (c->sparse) var = c->sorted_values[var]; - -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - #define DECODE_VQ(var,f,c) DECODE_RAW(var,f,c) -#else - #define DECODE_VQ(var,f,c) DECODE(var,f,c) -#endif - - - - - - -// CODEBOOK_ELEMENT_FAST is an optimization for the CODEBOOK_FLOATS case -// where we avoid one addition -#define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off]) -#define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off]) -#define CODEBOOK_ELEMENT_BASE(c) (0) - -static int codebook_decode_start(vorb *f, Codebook *c) -{ - int z = -1; - - // type 0 is only legal in a scalar context - if (c->lookup_type == 0) - error(f, VORBIS_invalid_stream); - else { - DECODE_VQ(z,f,c); - if (c->sparse) assert(z < c->sorted_entries); - if (z < 0) { // check for EOP - if (!f->bytes_in_seg) - if (f->last_seg) - return z; - error(f, VORBIS_invalid_stream); - } - } - return z; -} - -static int codebook_decode(vorb *f, Codebook *c, float *output, int len) -{ - int i,z = codebook_decode_start(f,c); - if (z < 0) return FALSE; - if (len > c->dimensions) len = c->dimensions; - -#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - float last = CODEBOOK_ELEMENT_BASE(c); - int div = 1; - for (i=0; i < len; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - output[i] += val; - if (c->sequence_p) last = val + c->minimum_value; - div *= c->lookup_values; - } - return TRUE; - } -#endif - - z *= c->dimensions; - if (c->sequence_p) { - float last = CODEBOOK_ELEMENT_BASE(c); - for (i=0; i < len; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - output[i] += val; - last = val + c->minimum_value; - } - } else { - float last = CODEBOOK_ELEMENT_BASE(c); - for (i=0; i < len; ++i) { - output[i] += CODEBOOK_ELEMENT_FAST(c,z+i) + last; - } - } - - return TRUE; -} - -static int codebook_decode_step(vorb *f, Codebook *c, float *output, int len, int step) -{ - int i,z = codebook_decode_start(f,c); - float last = CODEBOOK_ELEMENT_BASE(c); - if (z < 0) return FALSE; - if (len > c->dimensions) len = c->dimensions; - -#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int div = 1; - for (i=0; i < len; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - output[i*step] += val; - if (c->sequence_p) last = val; - div *= c->lookup_values; - } - return TRUE; - } -#endif - - z *= c->dimensions; - for (i=0; i < len; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - output[i*step] += val; - if (c->sequence_p) last = val; - } - - return TRUE; -} - -static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **outputs, int ch, int *c_inter_p, int *p_inter_p, int len, int total_decode) -{ - int c_inter = *c_inter_p; - int p_inter = *p_inter_p; - int i,z, effective = c->dimensions; - - // type 0 is only legal in a scalar context - if (c->lookup_type == 0) return error(f, VORBIS_invalid_stream); - - while (total_decode > 0) { - float last = CODEBOOK_ELEMENT_BASE(c); - DECODE_VQ(z,f,c); - #ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - assert(!c->sparse || z < c->sorted_entries); - #endif - if (z < 0) { - if (!f->bytes_in_seg) - if (f->last_seg) return FALSE; - return error(f, VORBIS_invalid_stream); - } - - // if this will take us off the end of the buffers, stop short! - // we check by computing the length of the virtual interleaved - // buffer (len*ch), our current offset within it (p_inter*ch)+(c_inter), - // and the length we'll be using (effective) - if (c_inter + p_inter*ch + effective > len * ch) { - effective = len*ch - (p_inter*ch - c_inter); - } - - #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int div = 1; - for (i=0; i < effective; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - if (c->sequence_p) last = val; - div *= c->lookup_values; - } - } else - #endif - { - z *= c->dimensions; - if (c->sequence_p) { - for (i=0; i < effective; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - last = val; - } - } else { - for (i=0; i < effective; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - } - } - } - - total_decode -= effective; - } - *c_inter_p = c_inter; - *p_inter_p = p_inter; - return TRUE; -} - -static int predict_point(int x, int x0, int x1, int y0, int y1) -{ - int dy = y1 - y0; - int adx = x1 - x0; - // @OPTIMIZE: force int division to round in the right direction... is this necessary on x86? - int err = abs(dy) * (x - x0); - int off = err / adx; - return dy < 0 ? y0 - off : y0 + off; -} - -// the following table is block-copied from the specification -static float inverse_db_table[256] = -{ - 1.0649863e-07f, 1.1341951e-07f, 1.2079015e-07f, 1.2863978e-07f, - 1.3699951e-07f, 1.4590251e-07f, 1.5538408e-07f, 1.6548181e-07f, - 1.7623575e-07f, 1.8768855e-07f, 1.9988561e-07f, 2.1287530e-07f, - 2.2670913e-07f, 2.4144197e-07f, 2.5713223e-07f, 2.7384213e-07f, - 2.9163793e-07f, 3.1059021e-07f, 3.3077411e-07f, 3.5226968e-07f, - 3.7516214e-07f, 3.9954229e-07f, 4.2550680e-07f, 4.5315863e-07f, - 4.8260743e-07f, 5.1396998e-07f, 5.4737065e-07f, 5.8294187e-07f, - 6.2082472e-07f, 6.6116941e-07f, 7.0413592e-07f, 7.4989464e-07f, - 7.9862701e-07f, 8.5052630e-07f, 9.0579828e-07f, 9.6466216e-07f, - 1.0273513e-06f, 1.0941144e-06f, 1.1652161e-06f, 1.2409384e-06f, - 1.3215816e-06f, 1.4074654e-06f, 1.4989305e-06f, 1.5963394e-06f, - 1.7000785e-06f, 1.8105592e-06f, 1.9282195e-06f, 2.0535261e-06f, - 2.1869758e-06f, 2.3290978e-06f, 2.4804557e-06f, 2.6416497e-06f, - 2.8133190e-06f, 2.9961443e-06f, 3.1908506e-06f, 3.3982101e-06f, - 3.6190449e-06f, 3.8542308e-06f, 4.1047004e-06f, 4.3714470e-06f, - 4.6555282e-06f, 4.9580707e-06f, 5.2802740e-06f, 5.6234160e-06f, - 5.9888572e-06f, 6.3780469e-06f, 6.7925283e-06f, 7.2339451e-06f, - 7.7040476e-06f, 8.2047000e-06f, 8.7378876e-06f, 9.3057248e-06f, - 9.9104632e-06f, 1.0554501e-05f, 1.1240392e-05f, 1.1970856e-05f, - 1.2748789e-05f, 1.3577278e-05f, 1.4459606e-05f, 1.5399272e-05f, - 1.6400004e-05f, 1.7465768e-05f, 1.8600792e-05f, 1.9809576e-05f, - 2.1096914e-05f, 2.2467911e-05f, 2.3928002e-05f, 2.5482978e-05f, - 2.7139006e-05f, 2.8902651e-05f, 3.0780908e-05f, 3.2781225e-05f, - 3.4911534e-05f, 3.7180282e-05f, 3.9596466e-05f, 4.2169667e-05f, - 4.4910090e-05f, 4.7828601e-05f, 5.0936773e-05f, 5.4246931e-05f, - 5.7772202e-05f, 6.1526565e-05f, 6.5524908e-05f, 6.9783085e-05f, - 7.4317983e-05f, 7.9147585e-05f, 8.4291040e-05f, 8.9768747e-05f, - 9.5602426e-05f, 0.00010181521f, 0.00010843174f, 0.00011547824f, - 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f, - 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f, - 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f, - 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f, - 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f, - 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f, - 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f, - 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f, - 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f, - 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f, - 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f, - 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f, - 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f, - 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f, - 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f, - 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f, - 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f, - 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f, - 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f, - 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f, - 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f, - 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f, - 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f, - 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f, - 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f, - 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f, - 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f, - 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f, - 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f, - 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f, - 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f, - 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f, - 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f, - 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f, - 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f, - 0.82788260f, 0.88168307f, 0.9389798f, 1.0f -}; - - -// @OPTIMIZE: if you want to replace this bresenham line-drawing routine, -// note that you must produce bit-identical output to decode correctly; -// this specific sequence of operations is specified in the spec (it's -// drawing integer-quantized frequency-space lines that the encoder -// expects to be exactly the same) -// ... also, isn't the whole point of Bresenham's algorithm to NOT -// have to divide in the setup? sigh. -#ifndef STB_VORBIS_NO_DEFER_FLOOR -#define LINE_OP(a,b) a *= b -#else -#define LINE_OP(a,b) a = b -#endif - -#ifdef STB_VORBIS_DIVIDE_TABLE -#define DIVTAB_NUMER 32 -#define DIVTAB_DENOM 64 -int8 integer_divide_table[DIVTAB_NUMER][DIVTAB_DENOM]; // 2KB -#endif - -static __forceinline void draw_line(float *output, int x0, int y0, int x1, int y1, int n) -{ - int dy = y1 - y0; - int adx = x1 - x0; - int ady = abs(dy); - int base; - int x=x0,y=y0; - int err = 0; - int sy; - -#ifdef STB_VORBIS_DIVIDE_TABLE - if (adx < DIVTAB_DENOM && ady < DIVTAB_NUMER) { - if (dy < 0) { - base = -integer_divide_table[ady][adx]; - sy = base-1; - } else { - base = integer_divide_table[ady][adx]; - sy = base+1; - } - } else { - base = dy / adx; - if (dy < 0) - sy = base - 1; - else - sy = base+1; - } -#else - base = dy / adx; - if (dy < 0) - sy = base - 1; - else - sy = base+1; -#endif - ady -= abs(base) * adx; - if (x1 > n) x1 = n; - if (x < x1) { - LINE_OP(output[x], inverse_db_table[y]); - for (++x; x < x1; ++x) { - err += ady; - if (err >= adx) { - err -= adx; - y += sy; - } else - y += base; - LINE_OP(output[x], inverse_db_table[y]); - } - } -} - -static int residue_decode(vorb *f, Codebook *book, float *target, int offset, int n, int rtype) -{ - int k; - if (rtype == 0) { - int step = n / book->dimensions; - for (k=0; k < step; ++k) - if (!codebook_decode_step(f, book, target+offset+k, n-offset-k, step)) - return FALSE; - } else { - for (k=0; k < n; ) { - if (!codebook_decode(f, book, target+offset, n-k)) - return FALSE; - k += book->dimensions; - offset += book->dimensions; - } - } - return TRUE; -} - -static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8 *do_not_decode) -{ - int i,j,pass; - Residue *r = f->residue_config + rn; - int rtype = f->residue_types[rn]; - int c = r->classbook; - int classwords = f->codebooks[c].dimensions; - int n_read = r->end - r->begin; - int part_read = n_read / r->part_size; - int temp_alloc_point = temp_alloc_save(f); - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - uint8 ***part_classdata = (uint8 ***) temp_block_array(f,f->channels, part_read * sizeof(**part_classdata)); - #else - int **classifications = (int **) temp_block_array(f,f->channels, part_read * sizeof(**classifications)); - #endif - - CHECK(f); - - for (i=0; i < ch; ++i) - if (!do_not_decode[i]) - memset(residue_buffers[i], 0, sizeof(float) * n); - - if (rtype == 2 && ch != 1) { - for (j=0; j < ch; ++j) - if (!do_not_decode[j]) - break; - if (j == ch) - goto done; - - for (pass=0; pass < 8; ++pass) { - int pcount = 0, class_set = 0; - if (ch == 2) { - while (pcount < part_read) { - int z = r->begin + pcount*r->part_size; - int c_inter = (z & 1), p_inter = z>>1; - if (pass == 0) { - Codebook *c = f->codebooks+r->classbook; - int q; - DECODE(q,f,c); - if (q == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[0][class_set] = r->classdata[q]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[0][i+pcount] = q % r->classifications; - q /= r->classifications; - } - #endif - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - int z = r->begin + pcount*r->part_size; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[0][class_set][i]; - #else - int c = classifications[0][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - Codebook *book = f->codebooks + b; - #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - #else - // saves 1% - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - #endif - } else { - z += r->part_size; - c_inter = z & 1; - p_inter = z >> 1; - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } else if (ch == 1) { - while (pcount < part_read) { - int z = r->begin + pcount*r->part_size; - int c_inter = 0, p_inter = z; - if (pass == 0) { - Codebook *c = f->codebooks+r->classbook; - int q; - DECODE(q,f,c); - if (q == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[0][class_set] = r->classdata[q]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[0][i+pcount] = q % r->classifications; - q /= r->classifications; - } - #endif - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - int z = r->begin + pcount*r->part_size; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[0][class_set][i]; - #else - int c = classifications[0][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - Codebook *book = f->codebooks + b; - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - } else { - z += r->part_size; - c_inter = 0; - p_inter = z; - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } else { - while (pcount < part_read) { - int z = r->begin + pcount*r->part_size; - int c_inter = z % ch, p_inter = z/ch; - if (pass == 0) { - Codebook *c = f->codebooks+r->classbook; - int q; - DECODE(q,f,c); - if (q == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[0][class_set] = r->classdata[q]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[0][i+pcount] = q % r->classifications; - q /= r->classifications; - } - #endif - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - int z = r->begin + pcount*r->part_size; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[0][class_set][i]; - #else - int c = classifications[0][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - Codebook *book = f->codebooks + b; - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - } else { - z += r->part_size; - c_inter = z % ch; - p_inter = z / ch; - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } - } - goto done; - } - CHECK(f); - - for (pass=0; pass < 8; ++pass) { - int pcount = 0, class_set=0; - while (pcount < part_read) { - if (pass == 0) { - for (j=0; j < ch; ++j) { - if (!do_not_decode[j]) { - Codebook *c = f->codebooks+r->classbook; - int temp; - DECODE(temp,f,c); - if (temp == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[j][class_set] = r->classdata[temp]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[j][i+pcount] = temp % r->classifications; - temp /= r->classifications; - } - #endif - } - } - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - for (j=0; j < ch; ++j) { - if (!do_not_decode[j]) { - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[j][class_set][i]; - #else - int c = classifications[j][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - float *target = residue_buffers[j]; - int offset = r->begin + pcount * r->part_size; - int n = r->part_size; - Codebook *book = f->codebooks + b; - if (!residue_decode(f, book, target, offset, n, rtype)) - goto done; - } - } - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } - done: - CHECK(f); - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - temp_free(f,part_classdata); - #else - temp_free(f,classifications); - #endif - temp_alloc_restore(f,temp_alloc_point); -} - - -#if 0 -// slow way for debugging -void inverse_mdct_slow(float *buffer, int n) -{ - int i,j; - int n2 = n >> 1; - float *x = (float *) malloc(sizeof(*x) * n2); - memcpy(x, buffer, sizeof(*x) * n2); - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n2; ++j) - // formula from paper: - //acc += n/4.0f * x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); - // formula from wikipedia - //acc += 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); - // these are equivalent, except the formula from the paper inverts the multiplier! - // however, what actually works is NO MULTIPLIER!?! - //acc += 64 * 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); - acc += x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); - buffer[i] = acc; - } - free(x); -} -#elif 0 -// same as above, but just barely able to run in real time on modern machines -void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) -{ - float mcos[16384]; - int i,j; - int n2 = n >> 1, nmask = (n << 2) -1; - float *x = (float *) malloc(sizeof(*x) * n2); - memcpy(x, buffer, sizeof(*x) * n2); - for (i=0; i < 4*n; ++i) - mcos[i] = (float) cos(M_PI / 2 * i / n); - - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n2; ++j) - acc += x[j] * mcos[(2 * i + 1 + n2)*(2*j+1) & nmask]; - buffer[i] = acc; - } - free(x); -} -#elif 0 -// transform to use a slow dct-iv; this is STILL basically trivial, -// but only requires half as many ops -void dct_iv_slow(float *buffer, int n) -{ - float mcos[16384]; - float x[2048]; - int i,j; - int n2 = n >> 1, nmask = (n << 3) - 1; - memcpy(x, buffer, sizeof(*x) * n); - for (i=0; i < 8*n; ++i) - mcos[i] = (float) cos(M_PI / 4 * i / n); - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n; ++j) - acc += x[j] * mcos[((2 * i + 1)*(2*j+1)) & nmask]; - buffer[i] = acc; - } -} - -void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) -{ - int i, n4 = n >> 2, n2 = n >> 1, n3_4 = n - n4; - float temp[4096]; - - memcpy(temp, buffer, n2 * sizeof(float)); - dct_iv_slow(temp, n2); // returns -c'-d, a-b' - - for (i=0; i < n4 ; ++i) buffer[i] = temp[i+n4]; // a-b' - for ( ; i < n3_4; ++i) buffer[i] = -temp[n3_4 - i - 1]; // b-a', c+d' - for ( ; i < n ; ++i) buffer[i] = -temp[i - n3_4]; // c'+d -} -#endif - -#ifndef LIBVORBIS_MDCT -#define LIBVORBIS_MDCT 0 -#endif - -#if LIBVORBIS_MDCT -// directly call the vorbis MDCT using an interface documented -// by Jeff Roberts... useful for performance comparison -typedef struct -{ - int n; - int log2n; - - float *trig; - int *bitrev; - - float scale; -} mdct_lookup; - -extern void mdct_init(mdct_lookup *lookup, int n); -extern void mdct_clear(mdct_lookup *l); -extern void mdct_backward(mdct_lookup *init, float *in, float *out); - -mdct_lookup M1,M2; - -void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) -{ - mdct_lookup *M; - if (M1.n == n) M = &M1; - else if (M2.n == n) M = &M2; - else if (M1.n == 0) { mdct_init(&M1, n); M = &M1; } - else { - if (M2.n) __asm int 3; - mdct_init(&M2, n); - M = &M2; - } - - mdct_backward(M, buffer, buffer); -} -#endif - - -// the following were split out into separate functions while optimizing; -// they could be pushed back up but eh. __forceinline showed no change; -// they're probably already being inlined. -static void imdct_step3_iter0_loop(int n, float *e, int i_off, int k_off, float *A) -{ - float *ee0 = e + i_off; - float *ee2 = ee0 + k_off; - int i; - - assert((n & 3) == 0); - for (i=(n>>2); i > 0; --i) { - float k00_20, k01_21; - k00_20 = ee0[ 0] - ee2[ 0]; - k01_21 = ee0[-1] - ee2[-1]; - ee0[ 0] += ee2[ 0];//ee0[ 0] = ee0[ 0] + ee2[ 0]; - ee0[-1] += ee2[-1];//ee0[-1] = ee0[-1] + ee2[-1]; - ee2[ 0] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-1] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-2] - ee2[-2]; - k01_21 = ee0[-3] - ee2[-3]; - ee0[-2] += ee2[-2];//ee0[-2] = ee0[-2] + ee2[-2]; - ee0[-3] += ee2[-3];//ee0[-3] = ee0[-3] + ee2[-3]; - ee2[-2] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-3] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-4] - ee2[-4]; - k01_21 = ee0[-5] - ee2[-5]; - ee0[-4] += ee2[-4];//ee0[-4] = ee0[-4] + ee2[-4]; - ee0[-5] += ee2[-5];//ee0[-5] = ee0[-5] + ee2[-5]; - ee2[-4] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-5] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-6] - ee2[-6]; - k01_21 = ee0[-7] - ee2[-7]; - ee0[-6] += ee2[-6];//ee0[-6] = ee0[-6] + ee2[-6]; - ee0[-7] += ee2[-7];//ee0[-7] = ee0[-7] + ee2[-7]; - ee2[-6] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-7] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - ee0 -= 8; - ee2 -= 8; - } -} - -static void imdct_step3_inner_r_loop(int lim, float *e, int d0, int k_off, float *A, int k1) -{ - int i; - float k00_20, k01_21; - - float *e0 = e + d0; - float *e2 = e0 + k_off; - - for (i=lim >> 2; i > 0; --i) { - k00_20 = e0[-0] - e2[-0]; - k01_21 = e0[-1] - e2[-1]; - e0[-0] += e2[-0];//e0[-0] = e0[-0] + e2[-0]; - e0[-1] += e2[-1];//e0[-1] = e0[-1] + e2[-1]; - e2[-0] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-1] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-2] - e2[-2]; - k01_21 = e0[-3] - e2[-3]; - e0[-2] += e2[-2];//e0[-2] = e0[-2] + e2[-2]; - e0[-3] += e2[-3];//e0[-3] = e0[-3] + e2[-3]; - e2[-2] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-3] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-4] - e2[-4]; - k01_21 = e0[-5] - e2[-5]; - e0[-4] += e2[-4];//e0[-4] = e0[-4] + e2[-4]; - e0[-5] += e2[-5];//e0[-5] = e0[-5] + e2[-5]; - e2[-4] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-5] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-6] - e2[-6]; - k01_21 = e0[-7] - e2[-7]; - e0[-6] += e2[-6];//e0[-6] = e0[-6] + e2[-6]; - e0[-7] += e2[-7];//e0[-7] = e0[-7] + e2[-7]; - e2[-6] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-7] = (k01_21)*A[0] + (k00_20) * A[1]; - - e0 -= 8; - e2 -= 8; - - A += k1; - } -} - -static void imdct_step3_inner_s_loop(int n, float *e, int i_off, int k_off, float *A, int a_off, int k0) -{ - int i; - float A0 = A[0]; - float A1 = A[0+1]; - float A2 = A[0+a_off]; - float A3 = A[0+a_off+1]; - float A4 = A[0+a_off*2+0]; - float A5 = A[0+a_off*2+1]; - float A6 = A[0+a_off*3+0]; - float A7 = A[0+a_off*3+1]; - - float k00,k11; - - float *ee0 = e +i_off; - float *ee2 = ee0+k_off; - - for (i=n; i > 0; --i) { - k00 = ee0[ 0] - ee2[ 0]; - k11 = ee0[-1] - ee2[-1]; - ee0[ 0] = ee0[ 0] + ee2[ 0]; - ee0[-1] = ee0[-1] + ee2[-1]; - ee2[ 0] = (k00) * A0 - (k11) * A1; - ee2[-1] = (k11) * A0 + (k00) * A1; - - k00 = ee0[-2] - ee2[-2]; - k11 = ee0[-3] - ee2[-3]; - ee0[-2] = ee0[-2] + ee2[-2]; - ee0[-3] = ee0[-3] + ee2[-3]; - ee2[-2] = (k00) * A2 - (k11) * A3; - ee2[-3] = (k11) * A2 + (k00) * A3; - - k00 = ee0[-4] - ee2[-4]; - k11 = ee0[-5] - ee2[-5]; - ee0[-4] = ee0[-4] + ee2[-4]; - ee0[-5] = ee0[-5] + ee2[-5]; - ee2[-4] = (k00) * A4 - (k11) * A5; - ee2[-5] = (k11) * A4 + (k00) * A5; - - k00 = ee0[-6] - ee2[-6]; - k11 = ee0[-7] - ee2[-7]; - ee0[-6] = ee0[-6] + ee2[-6]; - ee0[-7] = ee0[-7] + ee2[-7]; - ee2[-6] = (k00) * A6 - (k11) * A7; - ee2[-7] = (k11) * A6 + (k00) * A7; - - ee0 -= k0; - ee2 -= k0; - } -} - -static __forceinline void iter_54(float *z) -{ - float k00,k11,k22,k33; - float y0,y1,y2,y3; - - k00 = z[ 0] - z[-4]; - y0 = z[ 0] + z[-4]; - y2 = z[-2] + z[-6]; - k22 = z[-2] - z[-6]; - - z[-0] = y0 + y2; // z0 + z4 + z2 + z6 - z[-2] = y0 - y2; // z0 + z4 - z2 - z6 - - // done with y0,y2 - - k33 = z[-3] - z[-7]; - - z[-4] = k00 + k33; // z0 - z4 + z3 - z7 - z[-6] = k00 - k33; // z0 - z4 - z3 + z7 - - // done with k33 - - k11 = z[-1] - z[-5]; - y1 = z[-1] + z[-5]; - y3 = z[-3] + z[-7]; - - z[-1] = y1 + y3; // z1 + z5 + z3 + z7 - z[-3] = y1 - y3; // z1 + z5 - z3 - z7 - z[-5] = k11 - k22; // z1 - z5 + z2 - z6 - z[-7] = k11 + k22; // z1 - z5 - z2 + z6 -} - -static void imdct_step3_inner_s_loop_ld654(int n, float *e, int i_off, float *A, int base_n) -{ - int a_off = base_n >> 3; - float A2 = A[0+a_off]; - float *z = e + i_off; - float *base = z - 16 * n; - - while (z > base) { - float k00,k11; - - k00 = z[-0] - z[-8]; - k11 = z[-1] - z[-9]; - z[-0] = z[-0] + z[-8]; - z[-1] = z[-1] + z[-9]; - z[-8] = k00; - z[-9] = k11 ; - - k00 = z[ -2] - z[-10]; - k11 = z[ -3] - z[-11]; - z[ -2] = z[ -2] + z[-10]; - z[ -3] = z[ -3] + z[-11]; - z[-10] = (k00+k11) * A2; - z[-11] = (k11-k00) * A2; - - k00 = z[-12] - z[ -4]; // reverse to avoid a unary negation - k11 = z[ -5] - z[-13]; - z[ -4] = z[ -4] + z[-12]; - z[ -5] = z[ -5] + z[-13]; - z[-12] = k11; - z[-13] = k00; - - k00 = z[-14] - z[ -6]; // reverse to avoid a unary negation - k11 = z[ -7] - z[-15]; - z[ -6] = z[ -6] + z[-14]; - z[ -7] = z[ -7] + z[-15]; - z[-14] = (k00+k11) * A2; - z[-15] = (k00-k11) * A2; - - iter_54(z); - iter_54(z-8); - z -= 16; - } -} - -static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) -{ - int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; - int ld; - // @OPTIMIZE: reduce register pressure by using fewer variables? - int save_point = temp_alloc_save(f); - float *buf2 = (float *) temp_alloc(f, n2 * sizeof(*buf2)); - float *u=NULL,*v=NULL; - // twiddle factors - float *A = f->A[blocktype]; - - // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" - // See notes about bugs in that paper in less-optimal implementation 'inverse_mdct_old' after this function. - - // kernel from paper - - - // merged: - // copy and reflect spectral data - // step 0 - - // note that it turns out that the items added together during - // this step are, in fact, being added to themselves (as reflected - // by step 0). inexplicable inefficiency! this became obvious - // once I combined the passes. - - // so there's a missing 'times 2' here (for adding X to itself). - // this propogates through linearly to the end, where the numbers - // are 1/2 too small, and need to be compensated for. - - { - float *d,*e, *AA, *e_stop; - d = &buf2[n2-2]; - AA = A; - e = &buffer[0]; - e_stop = &buffer[n2]; - while (e != e_stop) { - d[1] = (e[0] * AA[0] - e[2]*AA[1]); - d[0] = (e[0] * AA[1] + e[2]*AA[0]); - d -= 2; - AA += 2; - e += 4; - } - - e = &buffer[n2-3]; - while (d >= buf2) { - d[1] = (-e[2] * AA[0] - -e[0]*AA[1]); - d[0] = (-e[2] * AA[1] + -e[0]*AA[0]); - d -= 2; - AA += 2; - e -= 4; - } - } - - // now we use symbolic names for these, so that we can - // possibly swap their meaning as we change which operations - // are in place - - u = buffer; - v = buf2; - - // step 2 (paper output is w, now u) - // this could be in place, but the data ends up in the wrong - // place... _somebody_'s got to swap it, so this is nominated - { - float *AA = &A[n2-8]; - float *d0,*d1, *e0, *e1; - - e0 = &v[n4]; - e1 = &v[0]; - - d0 = &u[n4]; - d1 = &u[0]; - - while (AA >= A) { - float v40_20, v41_21; - - v41_21 = e0[1] - e1[1]; - v40_20 = e0[0] - e1[0]; - d0[1] = e0[1] + e1[1]; - d0[0] = e0[0] + e1[0]; - d1[1] = v41_21*AA[4] - v40_20*AA[5]; - d1[0] = v40_20*AA[4] + v41_21*AA[5]; - - v41_21 = e0[3] - e1[3]; - v40_20 = e0[2] - e1[2]; - d0[3] = e0[3] + e1[3]; - d0[2] = e0[2] + e1[2]; - d1[3] = v41_21*AA[0] - v40_20*AA[1]; - d1[2] = v40_20*AA[0] + v41_21*AA[1]; - - AA -= 8; - - d0 += 4; - d1 += 4; - e0 += 4; - e1 += 4; - } - } - - // step 3 - ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - - // optimized step 3: - - // the original step3 loop can be nested r inside s or s inside r; - // it's written originally as s inside r, but this is dumb when r - // iterates many times, and s few. So I have two copies of it and - // switch between them halfway. - - // this is iteration 0 of step 3 - imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*0, -(n >> 3), A); - imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*1, -(n >> 3), A); - - // this is iteration 1 of step 3 - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*0, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*1, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*2, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*3, -(n >> 4), A, 16); - - l=2; - for (; l < (ld-3)>>1; ++l) { - int k0 = n >> (l+2), k0_2 = k0>>1; - int lim = 1 << (l+1); - int i; - for (i=0; i < lim; ++i) - imdct_step3_inner_r_loop(n >> (l+4), u, n2-1 - k0*i, -k0_2, A, 1 << (l+3)); - } - - for (; l < ld-6; ++l) { - int k0 = n >> (l+2), k1 = 1 << (l+3), k0_2 = k0>>1; - int rlim = n >> (l+6), r; - int lim = 1 << (l+1); - int i_off; - float *A0 = A; - i_off = n2-1; - for (r=rlim; r > 0; --r) { - imdct_step3_inner_s_loop(lim, u, i_off, -k0_2, A0, k1, k0); - A0 += k1*4; - i_off -= 8; - } - } - - // iterations with count: - // ld-6,-5,-4 all interleaved together - // the big win comes from getting rid of needless flops - // due to the constants on pass 5 & 4 being all 1 and 0; - // combining them to be simultaneous to improve cache made little difference - imdct_step3_inner_s_loop_ld654(n >> 5, u, n2-1, A, n); - - // output is u - - // step 4, 5, and 6 - // cannot be in-place because of step 5 - { - uint16 *bitrev = f->bit_reverse[blocktype]; - // weirdly, I'd have thought reading sequentially and writing - // erratically would have been better than vice-versa, but in - // fact that's not what my testing showed. (That is, with - // j = bitreverse(i), do you read i and write j, or read j and write i.) - - float *d0 = &v[n4-4]; - float *d1 = &v[n2-4]; - while (d0 >= v) { - int k4; - - k4 = bitrev[0]; - d1[3] = u[k4+0]; - d1[2] = u[k4+1]; - d0[3] = u[k4+2]; - d0[2] = u[k4+3]; - - k4 = bitrev[1]; - d1[1] = u[k4+0]; - d1[0] = u[k4+1]; - d0[1] = u[k4+2]; - d0[0] = u[k4+3]; - - d0 -= 4; - d1 -= 4; - bitrev += 2; - } - } - // (paper output is u, now v) - - - // data must be in buf2 - assert(v == buf2); - - // step 7 (paper output is v, now v) - // this is now in place - { - float *C = f->C[blocktype]; - float *d, *e; - - d = v; - e = v + n2 - 4; - - while (d < e) { - float a02,a11,b0,b1,b2,b3; - - a02 = d[0] - e[2]; - a11 = d[1] + e[3]; - - b0 = C[1]*a02 + C[0]*a11; - b1 = C[1]*a11 - C[0]*a02; - - b2 = d[0] + e[ 2]; - b3 = d[1] - e[ 3]; - - d[0] = b2 + b0; - d[1] = b3 + b1; - e[2] = b2 - b0; - e[3] = b1 - b3; - - a02 = d[2] - e[0]; - a11 = d[3] + e[1]; - - b0 = C[3]*a02 + C[2]*a11; - b1 = C[3]*a11 - C[2]*a02; - - b2 = d[2] + e[ 0]; - b3 = d[3] - e[ 1]; - - d[2] = b2 + b0; - d[3] = b3 + b1; - e[0] = b2 - b0; - e[1] = b1 - b3; - - C += 4; - d += 4; - e -= 4; - } - } - - // data must be in buf2 - - - // step 8+decode (paper output is X, now buffer) - // this generates pairs of data a la 8 and pushes them directly through - // the decode kernel (pushing rather than pulling) to avoid having - // to make another pass later - - // this cannot POSSIBLY be in place, so we refer to the buffers directly - - { - float *d0,*d1,*d2,*d3; - - float *B = f->B[blocktype] + n2 - 8; - float *e = buf2 + n2 - 8; - d0 = &buffer[0]; - d1 = &buffer[n2-4]; - d2 = &buffer[n2]; - d3 = &buffer[n-4]; - while (e >= v) { - float p0,p1,p2,p3; - - p3 = e[6]*B[7] - e[7]*B[6]; - p2 = -e[6]*B[6] - e[7]*B[7]; - - d0[0] = p3; - d1[3] = - p3; - d2[0] = p2; - d3[3] = p2; - - p1 = e[4]*B[5] - e[5]*B[4]; - p0 = -e[4]*B[4] - e[5]*B[5]; - - d0[1] = p1; - d1[2] = - p1; - d2[1] = p0; - d3[2] = p0; - - p3 = e[2]*B[3] - e[3]*B[2]; - p2 = -e[2]*B[2] - e[3]*B[3]; - - d0[2] = p3; - d1[1] = - p3; - d2[2] = p2; - d3[1] = p2; - - p1 = e[0]*B[1] - e[1]*B[0]; - p0 = -e[0]*B[0] - e[1]*B[1]; - - d0[3] = p1; - d1[0] = - p1; - d2[3] = p0; - d3[0] = p0; - - B -= 8; - e -= 8; - d0 += 4; - d2 += 4; - d1 -= 4; - d3 -= 4; - } - } - - temp_free(f,buf2); - temp_alloc_restore(f,save_point); -} - -#if 0 -// this is the original version of the above code, if you want to optimize it from scratch -void inverse_mdct_naive(float *buffer, int n) -{ - float s; - float A[1 << 12], B[1 << 12], C[1 << 11]; - int i,k,k2,k4, n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; - int n3_4 = n - n4, ld; - // how can they claim this only uses N words?! - // oh, because they're only used sparsely, whoops - float u[1 << 13], X[1 << 13], v[1 << 13], w[1 << 13]; - // set up twiddle factors - - for (k=k2=0; k < n4; ++k,k2+=2) { - A[k2 ] = (float) cos(4*k*M_PI/n); - A[k2+1] = (float) -sin(4*k*M_PI/n); - B[k2 ] = (float) cos((k2+1)*M_PI/n/2); - B[k2+1] = (float) sin((k2+1)*M_PI/n/2); - } - for (k=k2=0; k < n8; ++k,k2+=2) { - C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); - C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); - } - - // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" - // Note there are bugs in that pseudocode, presumably due to them attempting - // to rename the arrays nicely rather than representing the way their actual - // implementation bounces buffers back and forth. As a result, even in the - // "some formulars corrected" version, a direct implementation fails. These - // are noted below as "paper bug". - - // copy and reflect spectral data - for (k=0; k < n2; ++k) u[k] = buffer[k]; - for ( ; k < n ; ++k) u[k] = -buffer[n - k - 1]; - // kernel from paper - // step 1 - for (k=k2=k4=0; k < n4; k+=1, k2+=2, k4+=4) { - v[n-k4-1] = (u[k4] - u[n-k4-1]) * A[k2] - (u[k4+2] - u[n-k4-3])*A[k2+1]; - v[n-k4-3] = (u[k4] - u[n-k4-1]) * A[k2+1] + (u[k4+2] - u[n-k4-3])*A[k2]; - } - // step 2 - for (k=k4=0; k < n8; k+=1, k4+=4) { - w[n2+3+k4] = v[n2+3+k4] + v[k4+3]; - w[n2+1+k4] = v[n2+1+k4] + v[k4+1]; - w[k4+3] = (v[n2+3+k4] - v[k4+3])*A[n2-4-k4] - (v[n2+1+k4]-v[k4+1])*A[n2-3-k4]; - w[k4+1] = (v[n2+1+k4] - v[k4+1])*A[n2-4-k4] + (v[n2+3+k4]-v[k4+3])*A[n2-3-k4]; - } - // step 3 - ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - for (l=0; l < ld-3; ++l) { - int k0 = n >> (l+2), k1 = 1 << (l+3); - int rlim = n >> (l+4), r4, r; - int s2lim = 1 << (l+2), s2; - for (r=r4=0; r < rlim; r4+=4,++r) { - for (s2=0; s2 < s2lim; s2+=2) { - u[n-1-k0*s2-r4] = w[n-1-k0*s2-r4] + w[n-1-k0*(s2+1)-r4]; - u[n-3-k0*s2-r4] = w[n-3-k0*s2-r4] + w[n-3-k0*(s2+1)-r4]; - u[n-1-k0*(s2+1)-r4] = (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1] - - (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1+1]; - u[n-3-k0*(s2+1)-r4] = (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1] - + (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1+1]; - } - } - if (l+1 < ld-3) { - // paper bug: ping-ponging of u&w here is omitted - memcpy(w, u, sizeof(u)); - } - } - - // step 4 - for (i=0; i < n8; ++i) { - int j = bit_reverse(i) >> (32-ld+3); - assert(j < n8); - if (i == j) { - // paper bug: original code probably swapped in place; if copying, - // need to directly copy in this case - int i8 = i << 3; - v[i8+1] = u[i8+1]; - v[i8+3] = u[i8+3]; - v[i8+5] = u[i8+5]; - v[i8+7] = u[i8+7]; - } else if (i < j) { - int i8 = i << 3, j8 = j << 3; - v[j8+1] = u[i8+1], v[i8+1] = u[j8 + 1]; - v[j8+3] = u[i8+3], v[i8+3] = u[j8 + 3]; - v[j8+5] = u[i8+5], v[i8+5] = u[j8 + 5]; - v[j8+7] = u[i8+7], v[i8+7] = u[j8 + 7]; - } - } - // step 5 - for (k=0; k < n2; ++k) { - w[k] = v[k*2+1]; - } - // step 6 - for (k=k2=k4=0; k < n8; ++k, k2 += 2, k4 += 4) { - u[n-1-k2] = w[k4]; - u[n-2-k2] = w[k4+1]; - u[n3_4 - 1 - k2] = w[k4+2]; - u[n3_4 - 2 - k2] = w[k4+3]; - } - // step 7 - for (k=k2=0; k < n8; ++k, k2 += 2) { - v[n2 + k2 ] = ( u[n2 + k2] + u[n-2-k2] + C[k2+1]*(u[n2+k2]-u[n-2-k2]) + C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; - v[n-2 - k2] = ( u[n2 + k2] + u[n-2-k2] - C[k2+1]*(u[n2+k2]-u[n-2-k2]) - C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; - v[n2+1+ k2] = ( u[n2+1+k2] - u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; - v[n-1 - k2] = (-u[n2+1+k2] + u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; - } - // step 8 - for (k=k2=0; k < n4; ++k,k2 += 2) { - X[k] = v[k2+n2]*B[k2 ] + v[k2+1+n2]*B[k2+1]; - X[n2-1-k] = v[k2+n2]*B[k2+1] - v[k2+1+n2]*B[k2 ]; - } - - // decode kernel to output - // determined the following value experimentally - // (by first figuring out what made inverse_mdct_slow work); then matching that here - // (probably vorbis encoder premultiplies by n or n/2, to save it on the decoder?) - s = 0.5; // theoretically would be n4 - - // [[[ note! the s value of 0.5 is compensated for by the B[] in the current code, - // so it needs to use the "old" B values to behave correctly, or else - // set s to 1.0 ]]] - for (i=0; i < n4 ; ++i) buffer[i] = s * X[i+n4]; - for ( ; i < n3_4; ++i) buffer[i] = -s * X[n3_4 - i - 1]; - for ( ; i < n ; ++i) buffer[i] = -s * X[i - n3_4]; -} -#endif - -static float *get_window(vorb *f, int len) -{ - len <<= 1; - if (len == f->blocksize_0) return f->window[0]; - if (len == f->blocksize_1) return f->window[1]; - assert(0); - return NULL; -} - -#ifndef STB_VORBIS_NO_DEFER_FLOOR -typedef int16 YTYPE; -#else -typedef int YTYPE; -#endif -static int do_floor(vorb *f, Mapping *map, int i, int n, float *target, YTYPE *finalY, uint8 *step2_flag) -{ - int n2 = n >> 1; - int s = map->chan[i].mux, floor; - floor = map->submap_floor[s]; - if (f->floor_types[floor] == 0) { - return error(f, VORBIS_invalid_stream); - } else { - Floor1 *g = &f->floor_config[floor].floor1; - int j,q; - int lx = 0, ly = finalY[0] * g->floor1_multiplier; - for (q=1; q < g->values; ++q) { - j = g->sorted_order[q]; - #ifndef STB_VORBIS_NO_DEFER_FLOOR - if (finalY[j] >= 0) - #else - if (step2_flag[j]) - #endif - { - int hy = finalY[j] * g->floor1_multiplier; - int hx = g->Xlist[j]; - if (lx != hx) - draw_line(target, lx,ly, hx,hy, n2); - CHECK(f); - lx = hx, ly = hy; - } - } - if (lx < n2) { - // optimization of: draw_line(target, lx,ly, n,ly, n2); - for (j=lx; j < n2; ++j) - LINE_OP(target[j], inverse_db_table[ly]); - CHECK(f); - } - } - return TRUE; -} - -// The meaning of "left" and "right" -// -// For a given frame: -// we compute samples from 0..n -// window_center is n/2 -// we'll window and mix the samples from left_start to left_end with data from the previous frame -// all of the samples from left_end to right_start can be output without mixing; however, -// this interval is 0-length except when transitioning between short and long frames -// all of the samples from right_start to right_end need to be mixed with the next frame, -// which we don't have, so those get saved in a buffer -// frame N's right_end-right_start, the number of samples to mix with the next frame, -// has to be the same as frame N+1's left_end-left_start (which they are by -// construction) - -static int vorbis_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) -{ - Mode *m; - int i, n, prev, next, window_center; - f->channel_buffer_start = f->channel_buffer_end = 0; - - retry: - if (f->eof) return FALSE; - if (!maybe_start_packet(f)) - return FALSE; - // check packet type - if (get_bits(f,1) != 0) { - if (IS_PUSH_MODE(f)) - return error(f,VORBIS_bad_packet_type); - while (EOP != get8_packet(f)); - goto retry; - } - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - - i = get_bits(f, ilog(f->mode_count-1)); - if (i == EOP) return FALSE; - if (i >= f->mode_count) return FALSE; - *mode = i; - m = f->mode_config + i; - if (m->blockflag) { - n = f->blocksize_1; - prev = get_bits(f,1); - next = get_bits(f,1); - } else { - prev = next = 0; - n = f->blocksize_0; - } - -// WINDOWING - - window_center = n >> 1; - if (m->blockflag && !prev) { - *p_left_start = (n - f->blocksize_0) >> 2; - *p_left_end = (n + f->blocksize_0) >> 2; - } else { - *p_left_start = 0; - *p_left_end = window_center; - } - if (m->blockflag && !next) { - *p_right_start = (n*3 - f->blocksize_0) >> 2; - *p_right_end = (n*3 + f->blocksize_0) >> 2; - } else { - *p_right_start = window_center; - *p_right_end = n; - } - - return TRUE; -} - -static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start, int left_end, int right_start, int right_end, int *p_left) -{ - Mapping *map; - int i,j,k,n,n2; - int zero_channel[256]; - int really_zero_channel[256]; - -// WINDOWING - - n = f->blocksize[m->blockflag]; - map = &f->mapping[m->mapping]; - -// FLOORS - n2 = n >> 1; - - CHECK(f); - - for (i=0; i < f->channels; ++i) { - int s = map->chan[i].mux, floor; - zero_channel[i] = FALSE; - floor = map->submap_floor[s]; - if (f->floor_types[floor] == 0) { - return error(f, VORBIS_invalid_stream); - } else { - Floor1 *g = &f->floor_config[floor].floor1; - if (get_bits(f, 1)) { - short *finalY; - uint8 step2_flag[256]; - static int range_list[4] = { 256, 128, 86, 64 }; - int range = range_list[g->floor1_multiplier-1]; - int offset = 2; - finalY = f->finalY[i]; - finalY[0] = get_bits(f, ilog(range)-1); - finalY[1] = get_bits(f, ilog(range)-1); - for (j=0; j < g->partitions; ++j) { - int pclass = g->partition_class_list[j]; - int cdim = g->class_dimensions[pclass]; - int cbits = g->class_subclasses[pclass]; - int csub = (1 << cbits)-1; - int cval = 0; - if (cbits) { - Codebook *c = f->codebooks + g->class_masterbooks[pclass]; - DECODE(cval,f,c); - } - for (k=0; k < cdim; ++k) { - int book = g->subclass_books[pclass][cval & csub]; - cval = cval >> cbits; - if (book >= 0) { - int temp; - Codebook *c = f->codebooks + book; - DECODE(temp,f,c); - finalY[offset++] = temp; - } else - finalY[offset++] = 0; - } - } - if (f->valid_bits == INVALID_BITS) goto error; // behavior according to spec - step2_flag[0] = step2_flag[1] = 1; - for (j=2; j < g->values; ++j) { - int low, high, pred, highroom, lowroom, room, val; - low = g->neighbors[j][0]; - high = g->neighbors[j][1]; - //neighbors(g->Xlist, j, &low, &high); - pred = predict_point(g->Xlist[j], g->Xlist[low], g->Xlist[high], finalY[low], finalY[high]); - val = finalY[j]; - highroom = range - pred; - lowroom = pred; - if (highroom < lowroom) - room = highroom * 2; - else - room = lowroom * 2; - if (val) { - step2_flag[low] = step2_flag[high] = 1; - step2_flag[j] = 1; - if (val >= room) - if (highroom > lowroom) - finalY[j] = val - lowroom + pred; - else - finalY[j] = pred - val + highroom - 1; - else - if (val & 1) - finalY[j] = pred - ((val+1)>>1); - else - finalY[j] = pred + (val>>1); - } else { - step2_flag[j] = 0; - finalY[j] = pred; - } - } - -#ifdef STB_VORBIS_NO_DEFER_FLOOR - do_floor(f, map, i, n, f->floor_buffers[i], finalY, step2_flag); -#else - // defer final floor computation until _after_ residue - for (j=0; j < g->values; ++j) { - if (!step2_flag[j]) - finalY[j] = -1; - } -#endif - } else { - error: - zero_channel[i] = TRUE; - } - // So we just defer everything else to later - - // at this point we've decoded the floor into buffer - } - } - CHECK(f); - // at this point we've decoded all floors - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - - // re-enable coupled channels if necessary - memcpy(really_zero_channel, zero_channel, sizeof(really_zero_channel[0]) * f->channels); - for (i=0; i < map->coupling_steps; ++i) - if (!zero_channel[map->chan[i].magnitude] || !zero_channel[map->chan[i].angle]) { - zero_channel[map->chan[i].magnitude] = zero_channel[map->chan[i].angle] = FALSE; - } - - CHECK(f); -// RESIDUE DECODE - for (i=0; i < map->submaps; ++i) { - float *residue_buffers[STB_VORBIS_MAX_CHANNELS]; - int r; - uint8 do_not_decode[256]; - int ch = 0; - for (j=0; j < f->channels; ++j) { - if (map->chan[j].mux == i) { - if (zero_channel[j]) { - do_not_decode[ch] = TRUE; - residue_buffers[ch] = NULL; - } else { - do_not_decode[ch] = FALSE; - residue_buffers[ch] = f->channel_buffers[j]; - } - ++ch; - } - } - r = map->submap_residue[i]; - decode_residue(f, residue_buffers, ch, n2, r, do_not_decode); - } - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - CHECK(f); - -// INVERSE COUPLING - for (i = map->coupling_steps-1; i >= 0; --i) { - int n2 = n >> 1; - float *m = f->channel_buffers[map->chan[i].magnitude]; - float *a = f->channel_buffers[map->chan[i].angle ]; - for (j=0; j < n2; ++j) { - float a2,m2; - if (m[j] > 0) - if (a[j] > 0) - m2 = m[j], a2 = m[j] - a[j]; - else - a2 = m[j], m2 = m[j] + a[j]; - else - if (a[j] > 0) - m2 = m[j], a2 = m[j] + a[j]; - else - a2 = m[j], m2 = m[j] - a[j]; - m[j] = m2; - a[j] = a2; - } - } - CHECK(f); - - // finish decoding the floors -#ifndef STB_VORBIS_NO_DEFER_FLOOR - for (i=0; i < f->channels; ++i) { - if (really_zero_channel[i]) { - memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); - } else { - do_floor(f, map, i, n, f->channel_buffers[i], f->finalY[i], NULL); - } - } -#else - for (i=0; i < f->channels; ++i) { - if (really_zero_channel[i]) { - memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); - } else { - for (j=0; j < n2; ++j) - f->channel_buffers[i][j] *= f->floor_buffers[i][j]; - } - } -#endif - -// INVERSE MDCT - CHECK(f); - for (i=0; i < f->channels; ++i) - inverse_mdct(f->channel_buffers[i], n, f, m->blockflag); - CHECK(f); - - // this shouldn't be necessary, unless we exited on an error - // and want to flush to get to the next packet - flush_packet(f); - - if (f->first_decode) { - // assume we start so first non-discarded sample is sample 0 - // this isn't to spec, but spec would require us to read ahead - // and decode the size of all current frames--could be done, - // but presumably it's not a commonly used feature - f->current_loc = -n2; // start of first frame is positioned for discard - // we might have to discard samples "from" the next frame too, - // if we're lapping a large block then a small at the start? - f->discard_samples_deferred = n - right_end; - f->current_loc_valid = TRUE; - f->first_decode = FALSE; - } else if (f->discard_samples_deferred) { - if (f->discard_samples_deferred >= right_start - left_start) { - f->discard_samples_deferred -= (right_start - left_start); - left_start = right_start; - *p_left = left_start; - } else { - left_start += f->discard_samples_deferred; - *p_left = left_start; - f->discard_samples_deferred = 0; - } - } else if (f->previous_length == 0 && f->current_loc_valid) { - // we're recovering from a seek... that means we're going to discard - // the samples from this packet even though we know our position from - // the last page header, so we need to update the position based on - // the discarded samples here - // but wait, the code below is going to add this in itself even - // on a discard, so we don't need to do it here... - } - - // check if we have ogg information about the sample # for this packet - if (f->last_seg_which == f->end_seg_with_known_loc) { - // if we have a valid current loc, and this is final: - if (f->current_loc_valid && (f->page_flag & PAGEFLAG_last_page)) { - uint32 current_end = f->known_loc_for_packet - (n-right_end); - // then let's infer the size of the (probably) short final frame - if (current_end < f->current_loc + (right_end-left_start)) { - if (current_end < f->current_loc) { - // negative truncation, that's impossible! - *len = 0; - } else { - *len = current_end - f->current_loc; - } - *len += left_start; - if (*len > right_end) *len = right_end; // this should never happen - f->current_loc += *len; - return TRUE; - } - } - // otherwise, just set our sample loc - // guess that the ogg granule pos refers to the _middle_ of the - // last frame? - // set f->current_loc to the position of left_start - f->current_loc = f->known_loc_for_packet - (n2-left_start); - f->current_loc_valid = TRUE; - } - if (f->current_loc_valid) - f->current_loc += (right_start - left_start); - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - *len = right_end; // ignore samples after the window goes to 0 - CHECK(f); - - return TRUE; -} - -static int vorbis_decode_packet(vorb *f, int *len, int *p_left, int *p_right) -{ - int mode, left_end, right_end; - if (!vorbis_decode_initial(f, p_left, &left_end, p_right, &right_end, &mode)) return 0; - return vorbis_decode_packet_rest(f, len, f->mode_config + mode, *p_left, left_end, *p_right, right_end, p_left); -} - -static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right) -{ - int prev,i,j; - // we use right&left (the start of the right- and left-window sin()-regions) - // to determine how much to return, rather than inferring from the rules - // (same result, clearer code); 'left' indicates where our sin() window - // starts, therefore where the previous window's right edge starts, and - // therefore where to start mixing from the previous buffer. 'right' - // indicates where our sin() ending-window starts, therefore that's where - // we start saving, and where our returned-data ends. - - // mixin from previous window - if (f->previous_length) { - int i,j, n = f->previous_length; - float *w = get_window(f, n); - for (i=0; i < f->channels; ++i) { - for (j=0; j < n; ++j) - f->channel_buffers[i][left+j] = - f->channel_buffers[i][left+j]*w[ j] + - f->previous_window[i][ j]*w[n-1-j]; - } - } - - prev = f->previous_length; - - // last half of this data becomes previous window - f->previous_length = len - right; - - // @OPTIMIZE: could avoid this copy by double-buffering the - // output (flipping previous_window with channel_buffers), but - // then previous_window would have to be 2x as large, and - // channel_buffers couldn't be temp mem (although they're NOT - // currently temp mem, they could be (unless we want to level - // performance by spreading out the computation)) - for (i=0; i < f->channels; ++i) - for (j=0; right+j < len; ++j) - f->previous_window[i][j] = f->channel_buffers[i][right+j]; - - if (!prev) - // there was no previous packet, so this data isn't valid... - // this isn't entirely true, only the would-have-overlapped data - // isn't valid, but this seems to be what the spec requires - return 0; - - // truncate a short frame - if (len < right) right = len; - - f->samples_output += right-left; - - return right - left; -} - -static void vorbis_pump_first_frame(stb_vorbis *f) -{ - int len, right, left; - if (vorbis_decode_packet(f, &len, &left, &right)) - vorbis_finish_frame(f, len, left, right); -} - -#ifndef STB_VORBIS_NO_PUSHDATA_API -static int is_whole_packet_present(stb_vorbis *f, int end_page) -{ - // make sure that we have the packet available before continuing... - // this requires a full ogg parse, but we know we can fetch from f->stream - - // instead of coding this out explicitly, we could save the current read state, - // read the next packet with get8() until end-of-packet, check f->eof, then - // reset the state? but that would be slower, esp. since we'd have over 256 bytes - // of state to restore (primarily the page segment table) - - int s = f->next_seg, first = TRUE; - uint8 *p = f->stream; - - if (s != -1) { // if we're not starting the packet with a 'continue on next page' flag - for (; s < f->segment_count; ++s) { - p += f->segments[s]; - if (f->segments[s] < 255) // stop at first short segment - break; - } - // either this continues, or it ends it... - if (end_page) - if (s < f->segment_count-1) return error(f, VORBIS_invalid_stream); - if (s == f->segment_count) - s = -1; // set 'crosses page' flag - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - first = FALSE; - } - for (; s == -1;) { - uint8 *q; - int n; - - // check that we have the page header ready - if (p + 26 >= f->stream_end) return error(f, VORBIS_need_more_data); - // validate the page - if (memcmp(p, ogg_page_header, 4)) return error(f, VORBIS_invalid_stream); - if (p[4] != 0) return error(f, VORBIS_invalid_stream); - if (first) { // the first segment must NOT have 'continued_packet', later ones MUST - if (f->previous_length) - if ((p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); - // if no previous length, we're resynching, so we can come in on a continued-packet, - // which we'll just drop - } else { - if (!(p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); - } - n = p[26]; // segment counts - q = p+27; // q points to segment table - p = q + n; // advance past header - // make sure we've read the segment table - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - for (s=0; s < n; ++s) { - p += q[s]; - if (q[s] < 255) - break; - } - if (end_page) - if (s < n-1) return error(f, VORBIS_invalid_stream); - if (s == n) - s = -1; // set 'crosses page' flag - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - first = FALSE; - } - return TRUE; -} -#endif // !STB_VORBIS_NO_PUSHDATA_API - -static int start_decoder(vorb *f) -{ - uint8 header[6], x,y; - int len,i,j,k, max_submaps = 0; - int longest_floorlist=0; - - // first page, first packet - - if (!start_page(f)) return FALSE; - // validate page flag - if (!(f->page_flag & PAGEFLAG_first_page)) return error(f, VORBIS_invalid_first_page); - if (f->page_flag & PAGEFLAG_last_page) return error(f, VORBIS_invalid_first_page); - if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page); - // check for expected packet length - if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page); - if (f->segments[0] != 30) return error(f, VORBIS_invalid_first_page); - // read packet - // check packet header - if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page); - if (!getn(f, header, 6)) return error(f, VORBIS_unexpected_eof); - if (!vorbis_validate(header)) return error(f, VORBIS_invalid_first_page); - // vorbis_version - if (get32(f) != 0) return error(f, VORBIS_invalid_first_page); - f->channels = get8(f); if (!f->channels) return error(f, VORBIS_invalid_first_page); - if (f->channels > STB_VORBIS_MAX_CHANNELS) return error(f, VORBIS_too_many_channels); - f->sample_rate = get32(f); if (!f->sample_rate) return error(f, VORBIS_invalid_first_page); - get32(f); // bitrate_maximum - get32(f); // bitrate_nominal - get32(f); // bitrate_minimum - x = get8(f); - { - int log0,log1; - log0 = x & 15; - log1 = x >> 4; - f->blocksize_0 = 1 << log0; - f->blocksize_1 = 1 << log1; - if (log0 < 6 || log0 > 13) return error(f, VORBIS_invalid_setup); - if (log1 < 6 || log1 > 13) return error(f, VORBIS_invalid_setup); - if (log0 > log1) return error(f, VORBIS_invalid_setup); - } - - // framing_flag - x = get8(f); - if (!(x & 1)) return error(f, VORBIS_invalid_first_page); - - // second packet! - if (!start_page(f)) return FALSE; - - if (!start_packet(f)) return FALSE; - do { - len = next_segment(f); - skip(f, len); - f->bytes_in_seg = 0; - } while (len); - - // third packet! - if (!start_packet(f)) return FALSE; - - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (IS_PUSH_MODE(f)) { - if (!is_whole_packet_present(f, TRUE)) { - // convert error in ogg header to write type - if (f->error == VORBIS_invalid_stream) - f->error = VORBIS_invalid_setup; - return FALSE; - } - } - #endif - - crc32_init(); // always init it, to avoid multithread race conditions - - if (get8_packet(f) != VORBIS_packet_setup) return error(f, VORBIS_invalid_setup); - for (i=0; i < 6; ++i) header[i] = get8_packet(f); - if (!vorbis_validate(header)) return error(f, VORBIS_invalid_setup); - - // codebooks - - f->codebook_count = get_bits(f,8) + 1; - f->codebooks = (Codebook *) setup_malloc(f, sizeof(*f->codebooks) * f->codebook_count); - if (f->codebooks == NULL) return error(f, VORBIS_outofmem); - memset(f->codebooks, 0, sizeof(*f->codebooks) * f->codebook_count); - for (i=0; i < f->codebook_count; ++i) { - uint32 *values; - int ordered, sorted_count; - int total=0; - uint8 *lengths; - Codebook *c = f->codebooks+i; - CHECK(f); - x = get_bits(f, 8); if (x != 0x42) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); if (x != 0x43) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); if (x != 0x56) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); - c->dimensions = (get_bits(f, 8)<<8) + x; - x = get_bits(f, 8); - y = get_bits(f, 8); - c->entries = (get_bits(f, 8)<<16) + (y<<8) + x; - ordered = get_bits(f,1); - c->sparse = ordered ? 0 : get_bits(f,1); - - if (c->dimensions == 0 && c->entries != 0) return error(f, VORBIS_invalid_setup); - - if (c->sparse) - lengths = (uint8 *) setup_temp_malloc(f, c->entries); - else - lengths = c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); - - if (!lengths) return error(f, VORBIS_outofmem); - - if (ordered) { - int current_entry = 0; - int current_length = get_bits(f,5) + 1; - while (current_entry < c->entries) { - int limit = c->entries - current_entry; - int n = get_bits(f, ilog(limit)); - if (current_entry + n > (int) c->entries) { return error(f, VORBIS_invalid_setup); } - memset(lengths + current_entry, current_length, n); - current_entry += n; - ++current_length; - } - } else { - for (j=0; j < c->entries; ++j) { - int present = c->sparse ? get_bits(f,1) : 1; - if (present) { - lengths[j] = get_bits(f, 5) + 1; - ++total; - if (lengths[j] == 32) - return error(f, VORBIS_invalid_setup); - } else { - lengths[j] = NO_CODE; - } - } - } - - if (c->sparse && total >= c->entries >> 2) { - // convert sparse items to non-sparse! - if (c->entries > (int) f->setup_temp_memory_required) - f->setup_temp_memory_required = c->entries; - - c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); - if (c->codeword_lengths == NULL) return error(f, VORBIS_outofmem); - memcpy(c->codeword_lengths, lengths, c->entries); - setup_temp_free(f, lengths, c->entries); // note this is only safe if there have been no intervening temp mallocs! - lengths = c->codeword_lengths; - c->sparse = 0; - } - - // compute the size of the sorted tables - if (c->sparse) { - sorted_count = total; - } else { - sorted_count = 0; - #ifndef STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH - for (j=0; j < c->entries; ++j) - if (lengths[j] > STB_VORBIS_FAST_HUFFMAN_LENGTH && lengths[j] != NO_CODE) - ++sorted_count; - #endif - } - - c->sorted_entries = sorted_count; - values = NULL; - - CHECK(f); - if (!c->sparse) { - c->codewords = (uint32 *) setup_malloc(f, sizeof(c->codewords[0]) * c->entries); - if (!c->codewords) return error(f, VORBIS_outofmem); - } else { - unsigned int size; - if (c->sorted_entries) { - c->codeword_lengths = (uint8 *) setup_malloc(f, c->sorted_entries); - if (!c->codeword_lengths) return error(f, VORBIS_outofmem); - c->codewords = (uint32 *) setup_temp_malloc(f, sizeof(*c->codewords) * c->sorted_entries); - if (!c->codewords) return error(f, VORBIS_outofmem); - values = (uint32 *) setup_temp_malloc(f, sizeof(*values) * c->sorted_entries); - if (!values) return error(f, VORBIS_outofmem); - } - size = c->entries + (sizeof(*c->codewords) + sizeof(*values)) * c->sorted_entries; - if (size > f->setup_temp_memory_required) - f->setup_temp_memory_required = size; - } - - if (!compute_codewords(c, lengths, c->entries, values)) { - if (c->sparse) setup_temp_free(f, values, 0); - return error(f, VORBIS_invalid_setup); - } - - if (c->sorted_entries) { - // allocate an extra slot for sentinels - c->sorted_codewords = (uint32 *) setup_malloc(f, sizeof(*c->sorted_codewords) * (c->sorted_entries+1)); - if (c->sorted_codewords == NULL) return error(f, VORBIS_outofmem); - // allocate an extra slot at the front so that c->sorted_values[-1] is defined - // so that we can catch that case without an extra if - c->sorted_values = ( int *) setup_malloc(f, sizeof(*c->sorted_values ) * (c->sorted_entries+1)); - if (c->sorted_values == NULL) return error(f, VORBIS_outofmem); - ++c->sorted_values; - c->sorted_values[-1] = -1; - compute_sorted_huffman(c, lengths, values); - } - - if (c->sparse) { - setup_temp_free(f, values, sizeof(*values)*c->sorted_entries); - setup_temp_free(f, c->codewords, sizeof(*c->codewords)*c->sorted_entries); - setup_temp_free(f, lengths, c->entries); - c->codewords = NULL; - } - - compute_accelerated_huffman(c); - - CHECK(f); - c->lookup_type = get_bits(f, 4); - if (c->lookup_type > 2) return error(f, VORBIS_invalid_setup); - if (c->lookup_type > 0) { - uint16 *mults; - c->minimum_value = float32_unpack(get_bits(f, 32)); - c->delta_value = float32_unpack(get_bits(f, 32)); - c->value_bits = get_bits(f, 4)+1; - c->sequence_p = get_bits(f,1); - if (c->lookup_type == 1) { - c->lookup_values = lookup1_values(c->entries, c->dimensions); - } else { - c->lookup_values = c->entries * c->dimensions; - } - if (c->lookup_values == 0) return error(f, VORBIS_invalid_setup); - mults = (uint16 *) setup_temp_malloc(f, sizeof(mults[0]) * c->lookup_values); - if (mults == NULL) return error(f, VORBIS_outofmem); - for (j=0; j < (int) c->lookup_values; ++j) { - int q = get_bits(f, c->value_bits); - if (q == EOP) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_invalid_setup); } - mults[j] = q; - } - -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int len, sparse = c->sparse; - float last=0; - // pre-expand the lookup1-style multiplicands, to avoid a divide in the inner loop - if (sparse) { - if (c->sorted_entries == 0) goto skip; - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->sorted_entries * c->dimensions); - } else - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->entries * c->dimensions); - if (c->multiplicands == NULL) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } - len = sparse ? c->sorted_entries : c->entries; - for (j=0; j < len; ++j) { - unsigned int z = sparse ? c->sorted_values[j] : j; - unsigned int div=1; - for (k=0; k < c->dimensions; ++k) { - int off = (z / div) % c->lookup_values; - float val = mults[off]; - val = mults[off]*c->delta_value + c->minimum_value + last; - c->multiplicands[j*c->dimensions + k] = val; - if (c->sequence_p) - last = val; - if (k+1 < c->dimensions) { - if (div > UINT_MAX / (unsigned int) c->lookup_values) { - setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); - return error(f, VORBIS_invalid_setup); - } - div *= c->lookup_values; - } - } - } - c->lookup_type = 2; - } - else -#endif - { - float last=0; - CHECK(f); - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->lookup_values); - if (c->multiplicands == NULL) { setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } - for (j=0; j < (int) c->lookup_values; ++j) { - float val = mults[j] * c->delta_value + c->minimum_value + last; - c->multiplicands[j] = val; - if (c->sequence_p) - last = val; - } - } -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - skip:; -#endif - setup_temp_free(f, mults, sizeof(mults[0])*c->lookup_values); - - CHECK(f); - } - CHECK(f); - } - - // time domain transfers (notused) - - x = get_bits(f, 6) + 1; - for (i=0; i < x; ++i) { - uint32 z = get_bits(f, 16); - if (z != 0) return error(f, VORBIS_invalid_setup); - } - - // Floors - f->floor_count = get_bits(f, 6)+1; - f->floor_config = (Floor *) setup_malloc(f, f->floor_count * sizeof(*f->floor_config)); - if (f->floor_config == NULL) return error(f, VORBIS_outofmem); - for (i=0; i < f->floor_count; ++i) { - f->floor_types[i] = get_bits(f, 16); - if (f->floor_types[i] > 1) return error(f, VORBIS_invalid_setup); - if (f->floor_types[i] == 0) { - Floor0 *g = &f->floor_config[i].floor0; - g->order = get_bits(f,8); - g->rate = get_bits(f,16); - g->bark_map_size = get_bits(f,16); - g->amplitude_bits = get_bits(f,6); - g->amplitude_offset = get_bits(f,8); - g->number_of_books = get_bits(f,4) + 1; - for (j=0; j < g->number_of_books; ++j) - g->book_list[j] = get_bits(f,8); - return error(f, VORBIS_feature_not_supported); - } else { - Point p[31*8+2]; - Floor1 *g = &f->floor_config[i].floor1; - int max_class = -1; - g->partitions = get_bits(f, 5); - for (j=0; j < g->partitions; ++j) { - g->partition_class_list[j] = get_bits(f, 4); - if (g->partition_class_list[j] > max_class) - max_class = g->partition_class_list[j]; - } - for (j=0; j <= max_class; ++j) { - g->class_dimensions[j] = get_bits(f, 3)+1; - g->class_subclasses[j] = get_bits(f, 2); - if (g->class_subclasses[j]) { - g->class_masterbooks[j] = get_bits(f, 8); - if (g->class_masterbooks[j] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } - for (k=0; k < 1 << g->class_subclasses[j]; ++k) { - g->subclass_books[j][k] = get_bits(f,8)-1; - if (g->subclass_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } - } - g->floor1_multiplier = get_bits(f,2)+1; - g->rangebits = get_bits(f,4); - g->Xlist[0] = 0; - g->Xlist[1] = 1 << g->rangebits; - g->values = 2; - for (j=0; j < g->partitions; ++j) { - int c = g->partition_class_list[j]; - for (k=0; k < g->class_dimensions[c]; ++k) { - g->Xlist[g->values] = get_bits(f, g->rangebits); - ++g->values; - } - } - // precompute the sorting - for (j=0; j < g->values; ++j) { - p[j].x = g->Xlist[j]; - p[j].y = j; - } - qsort(p, g->values, sizeof(p[0]), point_compare); - for (j=0; j < g->values; ++j) - g->sorted_order[j] = (uint8) p[j].y; - // precompute the neighbors - for (j=2; j < g->values; ++j) { - int low,hi; - neighbors(g->Xlist, j, &low,&hi); - g->neighbors[j][0] = low; - g->neighbors[j][1] = hi; - } - - if (g->values > longest_floorlist) - longest_floorlist = g->values; - } - } - - // Residue - f->residue_count = get_bits(f, 6)+1; - f->residue_config = (Residue *) setup_malloc(f, f->residue_count * sizeof(f->residue_config[0])); - if (f->residue_config == NULL) return error(f, VORBIS_outofmem); - memset(f->residue_config, 0, f->residue_count * sizeof(f->residue_config[0])); - for (i=0; i < f->residue_count; ++i) { - uint8 residue_cascade[64]; - Residue *r = f->residue_config+i; - f->residue_types[i] = get_bits(f, 16); - if (f->residue_types[i] > 2) return error(f, VORBIS_invalid_setup); - r->begin = get_bits(f, 24); - r->end = get_bits(f, 24); - if (r->end < r->begin) return error(f, VORBIS_invalid_setup); - r->part_size = get_bits(f,24)+1; - r->classifications = get_bits(f,6)+1; - r->classbook = get_bits(f,8); - if (r->classbook >= f->codebook_count) return error(f, VORBIS_invalid_setup); - for (j=0; j < r->classifications; ++j) { - uint8 high_bits=0; - uint8 low_bits=get_bits(f,3); - if (get_bits(f,1)) - high_bits = get_bits(f,5); - residue_cascade[j] = high_bits*8 + low_bits; - } - r->residue_books = (short (*)[8]) setup_malloc(f, sizeof(r->residue_books[0]) * r->classifications); - if (r->residue_books == NULL) return error(f, VORBIS_outofmem); - for (j=0; j < r->classifications; ++j) { - for (k=0; k < 8; ++k) { - if (residue_cascade[j] & (1 << k)) { - r->residue_books[j][k] = get_bits(f, 8); - if (r->residue_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } else { - r->residue_books[j][k] = -1; - } - } - } - // precompute the classifications[] array to avoid inner-loop mod/divide - // call it 'classdata' since we already have r->classifications - r->classdata = (uint8 **) setup_malloc(f, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); - if (!r->classdata) return error(f, VORBIS_outofmem); - memset(r->classdata, 0, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); - for (j=0; j < f->codebooks[r->classbook].entries; ++j) { - int classwords = f->codebooks[r->classbook].dimensions; - int temp = j; - r->classdata[j] = (uint8 *) setup_malloc(f, sizeof(r->classdata[j][0]) * classwords); - if (r->classdata[j] == NULL) return error(f, VORBIS_outofmem); - for (k=classwords-1; k >= 0; --k) { - r->classdata[j][k] = temp % r->classifications; - temp /= r->classifications; - } - } - } - - f->mapping_count = get_bits(f,6)+1; - f->mapping = (Mapping *) setup_malloc(f, f->mapping_count * sizeof(*f->mapping)); - if (f->mapping == NULL) return error(f, VORBIS_outofmem); - memset(f->mapping, 0, f->mapping_count * sizeof(*f->mapping)); - for (i=0; i < f->mapping_count; ++i) { - Mapping *m = f->mapping + i; - int mapping_type = get_bits(f,16); - if (mapping_type != 0) return error(f, VORBIS_invalid_setup); - m->chan = (MappingChannel *) setup_malloc(f, f->channels * sizeof(*m->chan)); - if (m->chan == NULL) return error(f, VORBIS_outofmem); - if (get_bits(f,1)) - m->submaps = get_bits(f,4)+1; - else - m->submaps = 1; - if (m->submaps > max_submaps) - max_submaps = m->submaps; - if (get_bits(f,1)) { - m->coupling_steps = get_bits(f,8)+1; - for (k=0; k < m->coupling_steps; ++k) { - m->chan[k].magnitude = get_bits(f, ilog(f->channels-1)); - m->chan[k].angle = get_bits(f, ilog(f->channels-1)); - if (m->chan[k].magnitude >= f->channels) return error(f, VORBIS_invalid_setup); - if (m->chan[k].angle >= f->channels) return error(f, VORBIS_invalid_setup); - if (m->chan[k].magnitude == m->chan[k].angle) return error(f, VORBIS_invalid_setup); - } - } else - m->coupling_steps = 0; - - // reserved field - if (get_bits(f,2)) return error(f, VORBIS_invalid_setup); - if (m->submaps > 1) { - for (j=0; j < f->channels; ++j) { - m->chan[j].mux = get_bits(f, 4); - if (m->chan[j].mux >= m->submaps) return error(f, VORBIS_invalid_setup); - } - } else - // @SPECIFICATION: this case is missing from the spec - for (j=0; j < f->channels; ++j) - m->chan[j].mux = 0; - - for (j=0; j < m->submaps; ++j) { - get_bits(f,8); // discard - m->submap_floor[j] = get_bits(f,8); - m->submap_residue[j] = get_bits(f,8); - if (m->submap_floor[j] >= f->floor_count) return error(f, VORBIS_invalid_setup); - if (m->submap_residue[j] >= f->residue_count) return error(f, VORBIS_invalid_setup); - } - } - - // Modes - f->mode_count = get_bits(f, 6)+1; - for (i=0; i < f->mode_count; ++i) { - Mode *m = f->mode_config+i; - m->blockflag = get_bits(f,1); - m->windowtype = get_bits(f,16); - m->transformtype = get_bits(f,16); - m->mapping = get_bits(f,8); - if (m->windowtype != 0) return error(f, VORBIS_invalid_setup); - if (m->transformtype != 0) return error(f, VORBIS_invalid_setup); - if (m->mapping >= f->mapping_count) return error(f, VORBIS_invalid_setup); - } - - flush_packet(f); - - f->previous_length = 0; - - for (i=0; i < f->channels; ++i) { - f->channel_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1); - f->previous_window[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); - f->finalY[i] = (int16 *) setup_malloc(f, sizeof(int16) * longest_floorlist); - if (f->channel_buffers[i] == NULL || f->previous_window[i] == NULL || f->finalY[i] == NULL) return error(f, VORBIS_outofmem); - #ifdef STB_VORBIS_NO_DEFER_FLOOR - f->floor_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); - if (f->floor_buffers[i] == NULL) return error(f, VORBIS_outofmem); - #endif - } - - if (!init_blocksize(f, 0, f->blocksize_0)) return FALSE; - if (!init_blocksize(f, 1, f->blocksize_1)) return FALSE; - f->blocksize[0] = f->blocksize_0; - f->blocksize[1] = f->blocksize_1; - -#ifdef STB_VORBIS_DIVIDE_TABLE - if (integer_divide_table[1][1]==0) - for (i=0; i < DIVTAB_NUMER; ++i) - for (j=1; j < DIVTAB_DENOM; ++j) - integer_divide_table[i][j] = i / j; -#endif - - // compute how much temporary memory is needed - - // 1. - { - uint32 imdct_mem = (f->blocksize_1 * sizeof(float) >> 1); - uint32 classify_mem; - int i,max_part_read=0; - for (i=0; i < f->residue_count; ++i) { - Residue *r = f->residue_config + i; - int n_read = r->end - r->begin; - int part_read = n_read / r->part_size; - if (part_read > max_part_read) - max_part_read = part_read; - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(uint8 *)); - #else - classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(int *)); - #endif - - f->temp_memory_required = classify_mem; - if (imdct_mem > f->temp_memory_required) - f->temp_memory_required = imdct_mem; - } - - f->first_decode = TRUE; - - if (f->alloc.alloc_buffer) { - assert(f->temp_offset == f->alloc.alloc_buffer_length_in_bytes); - // check if there's enough temp memory so we don't error later - if (f->setup_offset + sizeof(*f) + f->temp_memory_required > (unsigned) f->temp_offset) - return error(f, VORBIS_outofmem); - } - - f->first_audio_page_offset = stb_vorbis_get_file_offset(f); - - return TRUE; -} - -static void vorbis_deinit(stb_vorbis *p) -{ - int i,j; - if (p->residue_config) { - for (i=0; i < p->residue_count; ++i) { - Residue *r = p->residue_config+i; - if (r->classdata) { - for (j=0; j < p->codebooks[r->classbook].entries; ++j) - setup_free(p, r->classdata[j]); - setup_free(p, r->classdata); - } - setup_free(p, r->residue_books); - } - } - - if (p->codebooks) { - CHECK(p); - for (i=0; i < p->codebook_count; ++i) { - Codebook *c = p->codebooks + i; - setup_free(p, c->codeword_lengths); - setup_free(p, c->multiplicands); - setup_free(p, c->codewords); - setup_free(p, c->sorted_codewords); - // c->sorted_values[-1] is the first entry in the array - setup_free(p, c->sorted_values ? c->sorted_values-1 : NULL); - } - setup_free(p, p->codebooks); - } - setup_free(p, p->floor_config); - setup_free(p, p->residue_config); - if (p->mapping) { - for (i=0; i < p->mapping_count; ++i) - setup_free(p, p->mapping[i].chan); - setup_free(p, p->mapping); - } - CHECK(p); - for (i=0; i < p->channels && i < STB_VORBIS_MAX_CHANNELS; ++i) { - setup_free(p, p->channel_buffers[i]); - setup_free(p, p->previous_window[i]); - #ifdef STB_VORBIS_NO_DEFER_FLOOR - setup_free(p, p->floor_buffers[i]); - #endif - setup_free(p, p->finalY[i]); - } - for (i=0; i < 2; ++i) { - setup_free(p, p->A[i]); - setup_free(p, p->B[i]); - setup_free(p, p->C[i]); - setup_free(p, p->window[i]); - setup_free(p, p->bit_reverse[i]); - } - #ifndef STB_VORBIS_NO_STDIO - if (p->close_on_free) fclose(p->f); - #endif -} - -void stb_vorbis_close(stb_vorbis *p) -{ - if (p == NULL) return; - vorbis_deinit(p); - setup_free(p,p); -} - -static void vorbis_init(stb_vorbis *p, const stb_vorbis_alloc *z) -{ - memset(p, 0, sizeof(*p)); // NULL out all malloc'd pointers to start - if (z) { - p->alloc = *z; - p->alloc.alloc_buffer_length_in_bytes = (p->alloc.alloc_buffer_length_in_bytes+3) & ~3; - p->temp_offset = p->alloc.alloc_buffer_length_in_bytes; - } - p->eof = 0; - p->error = VORBIS__no_error; - p->stream = NULL; - p->codebooks = NULL; - p->page_crc_tests = -1; - #ifndef STB_VORBIS_NO_STDIO - p->close_on_free = FALSE; - p->f = NULL; - #endif -} - -int stb_vorbis_get_sample_offset(stb_vorbis *f) -{ - if (f->current_loc_valid) - return f->current_loc; - else - return -1; -} - -stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f) -{ - stb_vorbis_info d; - d.channels = f->channels; - d.sample_rate = f->sample_rate; - d.setup_memory_required = f->setup_memory_required; - d.setup_temp_memory_required = f->setup_temp_memory_required; - d.temp_memory_required = f->temp_memory_required; - d.max_frame_size = f->blocksize_1 >> 1; - return d; -} - -int stb_vorbis_get_error(stb_vorbis *f) -{ - int e = f->error; - f->error = VORBIS__no_error; - return e; -} - -static stb_vorbis * vorbis_alloc(stb_vorbis *f) -{ - stb_vorbis *p = (stb_vorbis *) setup_malloc(f, sizeof(*p)); - return p; -} - -#ifndef STB_VORBIS_NO_PUSHDATA_API - -void stb_vorbis_flush_pushdata(stb_vorbis *f) -{ - f->previous_length = 0; - f->page_crc_tests = 0; - f->discard_samples_deferred = 0; - f->current_loc_valid = FALSE; - f->first_decode = FALSE; - f->samples_output = 0; - f->channel_buffer_start = 0; - f->channel_buffer_end = 0; -} - -static int vorbis_search_for_page_pushdata(vorb *f, uint8 *data, int data_len) -{ - int i,n; - for (i=0; i < f->page_crc_tests; ++i) - f->scan[i].bytes_done = 0; - - // if we have room for more scans, search for them first, because - // they may cause us to stop early if their header is incomplete - if (f->page_crc_tests < STB_VORBIS_PUSHDATA_CRC_COUNT) { - if (data_len < 4) return 0; - data_len -= 3; // need to look for 4-byte sequence, so don't miss - // one that straddles a boundary - for (i=0; i < data_len; ++i) { - if (data[i] == 0x4f) { - if (0==memcmp(data+i, ogg_page_header, 4)) { - int j,len; - uint32 crc; - // make sure we have the whole page header - if (i+26 >= data_len || i+27+data[i+26] >= data_len) { - // only read up to this page start, so hopefully we'll - // have the whole page header start next time - data_len = i; - break; - } - // ok, we have it all; compute the length of the page - len = 27 + data[i+26]; - for (j=0; j < data[i+26]; ++j) - len += data[i+27+j]; - // scan everything up to the embedded crc (which we must 0) - crc = 0; - for (j=0; j < 22; ++j) - crc = crc32_update(crc, data[i+j]); - // now process 4 0-bytes - for ( ; j < 26; ++j) - crc = crc32_update(crc, 0); - // len is the total number of bytes we need to scan - n = f->page_crc_tests++; - f->scan[n].bytes_left = len-j; - f->scan[n].crc_so_far = crc; - f->scan[n].goal_crc = data[i+22] + (data[i+23] << 8) + (data[i+24]<<16) + (data[i+25]<<24); - // if the last frame on a page is continued to the next, then - // we can't recover the sample_loc immediately - if (data[i+27+data[i+26]-1] == 255) - f->scan[n].sample_loc = ~0; - else - f->scan[n].sample_loc = data[i+6] + (data[i+7] << 8) + (data[i+ 8]<<16) + (data[i+ 9]<<24); - f->scan[n].bytes_done = i+j; - if (f->page_crc_tests == STB_VORBIS_PUSHDATA_CRC_COUNT) - break; - // keep going if we still have room for more - } - } - } - } - - for (i=0; i < f->page_crc_tests;) { - uint32 crc; - int j; - int n = f->scan[i].bytes_done; - int m = f->scan[i].bytes_left; - if (m > data_len - n) m = data_len - n; - // m is the bytes to scan in the current chunk - crc = f->scan[i].crc_so_far; - for (j=0; j < m; ++j) - crc = crc32_update(crc, data[n+j]); - f->scan[i].bytes_left -= m; - f->scan[i].crc_so_far = crc; - if (f->scan[i].bytes_left == 0) { - // does it match? - if (f->scan[i].crc_so_far == f->scan[i].goal_crc) { - // Houston, we have page - data_len = n+m; // consumption amount is wherever that scan ended - f->page_crc_tests = -1; // drop out of page scan mode - f->previous_length = 0; // decode-but-don't-output one frame - f->next_seg = -1; // start a new page - f->current_loc = f->scan[i].sample_loc; // set the current sample location - // to the amount we'd have decoded had we decoded this page - f->current_loc_valid = f->current_loc != ~0U; - return data_len; - } - // delete entry - f->scan[i] = f->scan[--f->page_crc_tests]; - } else { - ++i; - } - } - - return data_len; -} - -// return value: number of bytes we used -int stb_vorbis_decode_frame_pushdata( - stb_vorbis *f, // the file we're decoding - const uint8 *data, int data_len, // the memory available for decoding - int *channels, // place to write number of float * buffers - float ***output, // place to write float ** array of float * buffers - int *samples // place to write number of output samples - ) -{ - int i; - int len,right,left; - - if (!IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - if (f->page_crc_tests >= 0) { - *samples = 0; - return vorbis_search_for_page_pushdata(f, (uint8 *) data, data_len); - } - - f->stream = (uint8 *) data; - f->stream_end = (uint8 *) data + data_len; - f->error = VORBIS__no_error; - - // check that we have the entire packet in memory - if (!is_whole_packet_present(f, FALSE)) { - *samples = 0; - return 0; - } - - if (!vorbis_decode_packet(f, &len, &left, &right)) { - // save the actual error we encountered - enum STBVorbisError error = f->error; - if (error == VORBIS_bad_packet_type) { - // flush and resynch - f->error = VORBIS__no_error; - while (get8_packet(f) != EOP) - if (f->eof) break; - *samples = 0; - return (int) (f->stream - data); - } - if (error == VORBIS_continued_packet_flag_invalid) { - if (f->previous_length == 0) { - // we may be resynching, in which case it's ok to hit one - // of these; just discard the packet - f->error = VORBIS__no_error; - while (get8_packet(f) != EOP) - if (f->eof) break; - *samples = 0; - return (int) (f->stream - data); - } - } - // if we get an error while parsing, what to do? - // well, it DEFINITELY won't work to continue from where we are! - stb_vorbis_flush_pushdata(f); - // restore the error that actually made us bail - f->error = error; - *samples = 0; - return 1; - } - - // success! - len = vorbis_finish_frame(f, len, left, right); - for (i=0; i < f->channels; ++i) - f->outputs[i] = f->channel_buffers[i] + left; - - if (channels) *channels = f->channels; - *samples = len; - *output = f->outputs; - return (int) (f->stream - data); -} - -stb_vorbis *stb_vorbis_open_pushdata( - const unsigned char *data, int data_len, // the memory available for decoding - int *data_used, // only defined if result is not NULL - int *error, const stb_vorbis_alloc *alloc) -{ - stb_vorbis *f, p; - vorbis_init(&p, alloc); - p.stream = (uint8 *) data; - p.stream_end = (uint8 *) data + data_len; - p.push_mode = TRUE; - if (!start_decoder(&p)) { - if (p.eof) - *error = VORBIS_need_more_data; - else - *error = p.error; - return NULL; - } - f = vorbis_alloc(&p); - if (f) { - *f = p; - *data_used = (int) (f->stream - data); - *error = 0; - return f; - } else { - vorbis_deinit(&p); - return NULL; - } -} -#endif // STB_VORBIS_NO_PUSHDATA_API - -unsigned int stb_vorbis_get_file_offset(stb_vorbis *f) -{ - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (f->push_mode) return 0; - #endif - if (USE_MEMORY(f)) return (unsigned int) (f->stream - f->stream_start); - #ifndef STB_VORBIS_NO_STDIO - return (unsigned int) (ftell(f->f) - f->f_start); - #endif -} - -#ifndef STB_VORBIS_NO_PULLDATA_API -// -// DATA-PULLING API -// - -static uint32 vorbis_find_page(stb_vorbis *f, uint32 *end, uint32 *last) -{ - for(;;) { - int n; - if (f->eof) return 0; - n = get8(f); - if (n == 0x4f) { // page header candidate - unsigned int retry_loc = stb_vorbis_get_file_offset(f); - int i; - // check if we're off the end of a file_section stream - if (retry_loc - 25 > f->stream_len) - return 0; - // check the rest of the header - for (i=1; i < 4; ++i) - if (get8(f) != ogg_page_header[i]) - break; - if (f->eof) return 0; - if (i == 4) { - uint8 header[27]; - uint32 i, crc, goal, len; - for (i=0; i < 4; ++i) - header[i] = ogg_page_header[i]; - for (; i < 27; ++i) - header[i] = get8(f); - if (f->eof) return 0; - if (header[4] != 0) goto invalid; - goal = header[22] + (header[23] << 8) + (header[24]<<16) + (header[25]<<24); - for (i=22; i < 26; ++i) - header[i] = 0; - crc = 0; - for (i=0; i < 27; ++i) - crc = crc32_update(crc, header[i]); - len = 0; - for (i=0; i < header[26]; ++i) { - int s = get8(f); - crc = crc32_update(crc, s); - len += s; - } - if (len && f->eof) return 0; - for (i=0; i < len; ++i) - crc = crc32_update(crc, get8(f)); - // finished parsing probable page - if (crc == goal) { - // we could now check that it's either got the last - // page flag set, OR it's followed by the capture - // pattern, but I guess TECHNICALLY you could have - // a file with garbage between each ogg page and recover - // from it automatically? So even though that paranoia - // might decrease the chance of an invalid decode by - // another 2^32, not worth it since it would hose those - // invalid-but-useful files? - if (end) - *end = stb_vorbis_get_file_offset(f); - if (last) { - if (header[5] & 0x04) - *last = 1; - else - *last = 0; - } - set_file_offset(f, retry_loc-1); - return 1; - } - } - invalid: - // not a valid page, so rewind and look for next one - set_file_offset(f, retry_loc); - } - } -} - - -#define SAMPLE_unknown 0xffffffff - -// seeking is implemented with a binary search, which narrows down the range to -// 64K, before using a linear search (because finding the synchronization -// pattern can be expensive, and the chance we'd find the end page again is -// relatively high for small ranges) -// -// two initial interpolation-style probes are used at the start of the search -// to try to bound either side of the binary search sensibly, while still -// working in O(log n) time if they fail. - -static int get_seek_page_info(stb_vorbis *f, ProbedPage *z) -{ - uint8 header[27], lacing[255]; - int i,len; - - // record where the page starts - z->page_start = stb_vorbis_get_file_offset(f); - - // parse the header - getn(f, header, 27); - if (header[0] != 'O' || header[1] != 'g' || header[2] != 'g' || header[3] != 'S') - return 0; - getn(f, lacing, header[26]); - - // determine the length of the payload - len = 0; - for (i=0; i < header[26]; ++i) - len += lacing[i]; - - // this implies where the page ends - z->page_end = z->page_start + 27 + header[26] + len; - - // read the last-decoded sample out of the data - z->last_decoded_sample = header[6] + (header[7] << 8) + (header[8] << 16) + (header[9] << 24); - - // restore file state to where we were - set_file_offset(f, z->page_start); - return 1; -} - -// rarely used function to seek back to the preceeding page while finding the -// start of a packet -static int go_to_page_before(stb_vorbis *f, unsigned int limit_offset) -{ - unsigned int previous_safe, end; - - // now we want to seek back 64K from the limit - if (limit_offset >= 65536 && limit_offset-65536 >= f->first_audio_page_offset) - previous_safe = limit_offset - 65536; - else - previous_safe = f->first_audio_page_offset; - - set_file_offset(f, previous_safe); - - while (vorbis_find_page(f, &end, NULL)) { - if (end >= limit_offset && stb_vorbis_get_file_offset(f) < limit_offset) - return 1; - set_file_offset(f, end); - } - - return 0; -} - -// implements the search logic for finding a page and starting decoding. if -// the function succeeds, current_loc_valid will be true and current_loc will -// be less than or equal to the provided sample number (the closer the -// better). -static int seek_to_sample_coarse(stb_vorbis *f, uint32 sample_number) -{ - ProbedPage left, right, mid; - int i, start_seg_with_known_loc, end_pos, page_start; - uint32 delta, stream_length, padding; - double offset, bytes_per_sample; - int probe = 0; - - // find the last page and validate the target sample - stream_length = stb_vorbis_stream_length_in_samples(f); - if (stream_length == 0) return error(f, VORBIS_seek_without_length); - if (sample_number > stream_length) return error(f, VORBIS_seek_invalid); - - // this is the maximum difference between the window-center (which is the - // actual granule position value), and the right-start (which the spec - // indicates should be the granule position (give or take one)). - padding = ((f->blocksize_1 - f->blocksize_0) >> 2); - if (sample_number < padding) - sample_number = 0; - else - sample_number -= padding; - - left = f->p_first; - while (left.last_decoded_sample == ~0U) { - // (untested) the first page does not have a 'last_decoded_sample' - set_file_offset(f, left.page_end); - if (!get_seek_page_info(f, &left)) goto error; - } - - right = f->p_last; - assert(right.last_decoded_sample != ~0U); - - // starting from the start is handled differently - if (sample_number <= left.last_decoded_sample) { - stb_vorbis_seek_start(f); - return 1; - } - - while (left.page_end != right.page_start) { - assert(left.page_end < right.page_start); - // search range in bytes - delta = right.page_start - left.page_end; - if (delta <= 65536) { - // there's only 64K left to search - handle it linearly - set_file_offset(f, left.page_end); - } else { - if (probe < 2) { - if (probe == 0) { - // first probe (interpolate) - double data_bytes = right.page_end - left.page_start; - bytes_per_sample = data_bytes / right.last_decoded_sample; - offset = left.page_start + bytes_per_sample * (sample_number - left.last_decoded_sample); - } else { - // second probe (try to bound the other side) - double error = ((double) sample_number - mid.last_decoded_sample) * bytes_per_sample; - if (error >= 0 && error < 8000) error = 8000; - if (error < 0 && error > -8000) error = -8000; - offset += error * 2; - } - - // ensure the offset is valid - if (offset < left.page_end) - offset = left.page_end; - if (offset > right.page_start - 65536) - offset = right.page_start - 65536; - - set_file_offset(f, (unsigned int) offset); - } else { - // binary search for large ranges (offset by 32K to ensure - // we don't hit the right page) - set_file_offset(f, left.page_end + (delta / 2) - 32768); - } - - if (!vorbis_find_page(f, NULL, NULL)) goto error; - } - - for (;;) { - if (!get_seek_page_info(f, &mid)) goto error; - if (mid.last_decoded_sample != ~0U) break; - // (untested) no frames end on this page - set_file_offset(f, mid.page_end); - assert(mid.page_start < right.page_start); - } - - // if we've just found the last page again then we're in a tricky file, - // and we're close enough. - if (mid.page_start == right.page_start) - break; - - if (sample_number < mid.last_decoded_sample) - right = mid; - else - left = mid; - - ++probe; - } - - // seek back to start of the last packet - page_start = left.page_start; - set_file_offset(f, page_start); - if (!start_page(f)) return error(f, VORBIS_seek_failed); - end_pos = f->end_seg_with_known_loc; - assert(end_pos >= 0); - - for (;;) { - for (i = end_pos; i > 0; --i) - if (f->segments[i-1] != 255) - break; - - start_seg_with_known_loc = i; - - if (start_seg_with_known_loc > 0 || !(f->page_flag & PAGEFLAG_continued_packet)) - break; - - // (untested) the final packet begins on an earlier page - if (!go_to_page_before(f, page_start)) - goto error; - - page_start = stb_vorbis_get_file_offset(f); - if (!start_page(f)) goto error; - end_pos = f->segment_count - 1; - } - - // prepare to start decoding - f->current_loc_valid = FALSE; - f->last_seg = FALSE; - f->valid_bits = 0; - f->packet_bytes = 0; - f->bytes_in_seg = 0; - f->previous_length = 0; - f->next_seg = start_seg_with_known_loc; - - for (i = 0; i < start_seg_with_known_loc; i++) - skip(f, f->segments[i]); - - // start decoding (optimizable - this frame is generally discarded) - vorbis_pump_first_frame(f); - return 1; - -error: - // try to restore the file to a valid state - stb_vorbis_seek_start(f); - return error(f, VORBIS_seek_failed); -} - -// the same as vorbis_decode_initial, but without advancing -static int peek_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) -{ - int bits_read, bytes_read; - - if (!vorbis_decode_initial(f, p_left_start, p_left_end, p_right_start, p_right_end, mode)) - return 0; - - // either 1 or 2 bytes were read, figure out which so we can rewind - bits_read = 1 + ilog(f->mode_count-1); - if (f->mode_config[*mode].blockflag) - bits_read += 2; - bytes_read = (bits_read + 7) / 8; - - f->bytes_in_seg += bytes_read; - f->packet_bytes -= bytes_read; - skip(f, -bytes_read); - if (f->next_seg == -1) - f->next_seg = f->segment_count - 1; - else - f->next_seg--; - f->valid_bits = 0; - - return 1; -} - -int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number) -{ - uint32 max_frame_samples; - - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - // fast page-level search - if (!seek_to_sample_coarse(f, sample_number)) - return 0; - - assert(f->current_loc_valid); - assert(f->current_loc <= sample_number); - - // linear search for the relevant packet - max_frame_samples = (f->blocksize_1*3 - f->blocksize_0) >> 2; - while (f->current_loc < sample_number) { - int left_start, left_end, right_start, right_end, mode, frame_samples; - if (!peek_decode_initial(f, &left_start, &left_end, &right_start, &right_end, &mode)) - return error(f, VORBIS_seek_failed); - // calculate the number of samples returned by the next frame - frame_samples = right_start - left_start; - if (f->current_loc + frame_samples > sample_number) { - return 1; // the next frame will contain the sample - } else if (f->current_loc + frame_samples + max_frame_samples > sample_number) { - // there's a chance the frame after this could contain the sample - vorbis_pump_first_frame(f); - } else { - // this frame is too early to be relevant - f->current_loc += frame_samples; - f->previous_length = 0; - maybe_start_packet(f); - flush_packet(f); - } - } - // the next frame will start with the sample - assert(f->current_loc == sample_number); - return 1; -} - -int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number) -{ - if (!stb_vorbis_seek_frame(f, sample_number)) - return 0; - - if (sample_number != f->current_loc) { - int n; - uint32 frame_start = f->current_loc; - stb_vorbis_get_frame_float(f, &n, NULL); - assert(sample_number > frame_start); - assert(f->channel_buffer_start + (int) (sample_number-frame_start) <= f->channel_buffer_end); - f->channel_buffer_start += (sample_number - frame_start); - } - - return 1; -} - -void stb_vorbis_seek_start(stb_vorbis *f) -{ - if (IS_PUSH_MODE(f)) { error(f, VORBIS_invalid_api_mixing); return; } - set_file_offset(f, f->first_audio_page_offset); - f->previous_length = 0; - f->first_decode = TRUE; - f->next_seg = -1; - vorbis_pump_first_frame(f); -} - -unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f) -{ - unsigned int restore_offset, previous_safe; - unsigned int end, last_page_loc; - - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - if (!f->total_samples) { - unsigned int last; - uint32 lo,hi; - char header[6]; - - // first, store the current decode position so we can restore it - restore_offset = stb_vorbis_get_file_offset(f); - - // now we want to seek back 64K from the end (the last page must - // be at most a little less than 64K, but let's allow a little slop) - if (f->stream_len >= 65536 && f->stream_len-65536 >= f->first_audio_page_offset) - previous_safe = f->stream_len - 65536; - else - previous_safe = f->first_audio_page_offset; - - set_file_offset(f, previous_safe); - // previous_safe is now our candidate 'earliest known place that seeking - // to will lead to the final page' - - if (!vorbis_find_page(f, &end, &last)) { - // if we can't find a page, we're hosed! - f->error = VORBIS_cant_find_last_page; - f->total_samples = 0xffffffff; - goto done; - } - - // check if there are more pages - last_page_loc = stb_vorbis_get_file_offset(f); - - // stop when the last_page flag is set, not when we reach eof; - // this allows us to stop short of a 'file_section' end without - // explicitly checking the length of the section - while (!last) { - set_file_offset(f, end); - if (!vorbis_find_page(f, &end, &last)) { - // the last page we found didn't have the 'last page' flag - // set. whoops! - break; - } - previous_safe = last_page_loc+1; - last_page_loc = stb_vorbis_get_file_offset(f); - } - - set_file_offset(f, last_page_loc); - - // parse the header - getn(f, (unsigned char *)header, 6); - // extract the absolute granule position - lo = get32(f); - hi = get32(f); - if (lo == 0xffffffff && hi == 0xffffffff) { - f->error = VORBIS_cant_find_last_page; - f->total_samples = SAMPLE_unknown; - goto done; - } - if (hi) - lo = 0xfffffffe; // saturate - f->total_samples = lo; - - f->p_last.page_start = last_page_loc; - f->p_last.page_end = end; - f->p_last.last_decoded_sample = lo; - - done: - set_file_offset(f, restore_offset); - } - return f->total_samples == SAMPLE_unknown ? 0 : f->total_samples; -} - -float stb_vorbis_stream_length_in_seconds(stb_vorbis *f) -{ - return stb_vorbis_stream_length_in_samples(f) / (float) f->sample_rate; -} - - - -int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output) -{ - int len, right,left,i; - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - if (!vorbis_decode_packet(f, &len, &left, &right)) { - f->channel_buffer_start = f->channel_buffer_end = 0; - return 0; - } - - len = vorbis_finish_frame(f, len, left, right); - for (i=0; i < f->channels; ++i) - f->outputs[i] = f->channel_buffers[i] + left; - - f->channel_buffer_start = left; - f->channel_buffer_end = left+len; - - if (channels) *channels = f->channels; - if (output) *output = f->outputs; - return len; -} - -#ifndef STB_VORBIS_NO_STDIO - -stb_vorbis * stb_vorbis_open_file_section(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc, unsigned int length) -{ - stb_vorbis *f, p; - vorbis_init(&p, alloc); - p.f = file; - p.f_start = (uint32) ftell(file); - p.stream_len = length; - p.close_on_free = close_on_free; - if (start_decoder(&p)) { - f = vorbis_alloc(&p); - if (f) { - *f = p; - vorbis_pump_first_frame(f); - return f; - } - } - if (error) *error = p.error; - vorbis_deinit(&p); - return NULL; -} - -stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc) -{ - unsigned int len, start; - start = (unsigned int) ftell(file); - fseek(file, 0, SEEK_END); - len = (unsigned int) (ftell(file) - start); - fseek(file, start, SEEK_SET); - return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len); -} - -stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const stb_vorbis_alloc *alloc) -{ - FILE *f = fopen(filename, "rb"); - if (f) - return stb_vorbis_open_file(f, TRUE, error, alloc); - if (error) *error = VORBIS_file_open_failure; - return NULL; -} -#endif // STB_VORBIS_NO_STDIO - -stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, int *error, const stb_vorbis_alloc *alloc) -{ - stb_vorbis *f, p; - if (data == NULL) return NULL; - vorbis_init(&p, alloc); - p.stream = (uint8 *) data; - p.stream_end = (uint8 *) data + len; - p.stream_start = (uint8 *) p.stream; - p.stream_len = len; - p.push_mode = FALSE; - if (start_decoder(&p)) { - f = vorbis_alloc(&p); - if (f) { - *f = p; - vorbis_pump_first_frame(f); - return f; - } - } - if (error) *error = p.error; - vorbis_deinit(&p); - return NULL; -} - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -#define PLAYBACK_MONO 1 -#define PLAYBACK_LEFT 2 -#define PLAYBACK_RIGHT 4 - -#define L (PLAYBACK_LEFT | PLAYBACK_MONO) -#define C (PLAYBACK_LEFT | PLAYBACK_RIGHT | PLAYBACK_MONO) -#define R (PLAYBACK_RIGHT | PLAYBACK_MONO) - -static int8 channel_position[7][6] = -{ - { 0 }, - { C }, - { L, R }, - { L, C, R }, - { L, R, L, R }, - { L, C, R, L, R }, - { L, C, R, L, R, C }, -}; - - -#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT - typedef union { - float f; - int i; - } float_conv; - typedef char stb_vorbis_float_size_test[sizeof(float)==4 && sizeof(int) == 4]; - #define FASTDEF(x) float_conv x - // add (1<<23) to convert to int, then divide by 2^SHIFT, then add 0.5/2^SHIFT to round - #define MAGIC(SHIFT) (1.5f * (1 << (23-SHIFT)) + 0.5f/(1 << SHIFT)) - #define ADDEND(SHIFT) (((150-SHIFT) << 23) + (1 << 22)) - #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) (temp.f = (x) + MAGIC(s), temp.i - ADDEND(s)) - #define check_endianness() -#else - #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) ((int) ((x) * (1 << (s)))) - #define check_endianness() - #define FASTDEF(x) -#endif - -static void copy_samples(short *dest, float *src, int len) -{ - int i; - check_endianness(); - for (i=0; i < len; ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp, src[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - dest[i] = v; - } -} - -static void compute_samples(int mask, short *output, int num_c, float **data, int d_offset, int len) -{ - #define BUFFER_SIZE 32 - float buffer[BUFFER_SIZE]; - int i,j,o,n = BUFFER_SIZE; - check_endianness(); - for (o = 0; o < len; o += BUFFER_SIZE) { - memset(buffer, 0, sizeof(buffer)); - if (o + n > len) n = len - o; - for (j=0; j < num_c; ++j) { - if (channel_position[num_c][j] & mask) { - for (i=0; i < n; ++i) - buffer[i] += data[j][d_offset+o+i]; - } - } - for (i=0; i < n; ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - output[o+i] = v; - } - } -} - -static void compute_stereo_samples(short *output, int num_c, float **data, int d_offset, int len) -{ - #define BUFFER_SIZE 32 - float buffer[BUFFER_SIZE]; - int i,j,o,n = BUFFER_SIZE >> 1; - // o is the offset in the source data - check_endianness(); - for (o = 0; o < len; o += BUFFER_SIZE >> 1) { - // o2 is the offset in the output data - int o2 = o << 1; - memset(buffer, 0, sizeof(buffer)); - if (o + n > len) n = len - o; - for (j=0; j < num_c; ++j) { - int m = channel_position[num_c][j] & (PLAYBACK_LEFT | PLAYBACK_RIGHT); - if (m == (PLAYBACK_LEFT | PLAYBACK_RIGHT)) { - for (i=0; i < n; ++i) { - buffer[i*2+0] += data[j][d_offset+o+i]; - buffer[i*2+1] += data[j][d_offset+o+i]; - } - } else if (m == PLAYBACK_LEFT) { - for (i=0; i < n; ++i) { - buffer[i*2+0] += data[j][d_offset+o+i]; - } - } else if (m == PLAYBACK_RIGHT) { - for (i=0; i < n; ++i) { - buffer[i*2+1] += data[j][d_offset+o+i]; - } - } - } - for (i=0; i < (n<<1); ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - output[o2+i] = v; - } - } -} - -static void convert_samples_short(int buf_c, short **buffer, int b_offset, int data_c, float **data, int d_offset, int samples) -{ - int i; - if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { - static int channel_selector[3][2] = { {0}, {PLAYBACK_MONO}, {PLAYBACK_LEFT, PLAYBACK_RIGHT} }; - for (i=0; i < buf_c; ++i) - compute_samples(channel_selector[buf_c][i], buffer[i]+b_offset, data_c, data, d_offset, samples); - } else { - int limit = buf_c < data_c ? buf_c : data_c; - for (i=0; i < limit; ++i) - copy_samples(buffer[i]+b_offset, data[i]+d_offset, samples); - for ( ; i < buf_c; ++i) - memset(buffer[i]+b_offset, 0, sizeof(short) * samples); - } -} - -int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples) -{ - float **output; - int len = stb_vorbis_get_frame_float(f, NULL, &output); - if (len > num_samples) len = num_samples; - if (len) - convert_samples_short(num_c, buffer, 0, f->channels, output, 0, len); - return len; -} - -static void convert_channels_short_interleaved(int buf_c, short *buffer, int data_c, float **data, int d_offset, int len) -{ - int i; - check_endianness(); - if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { - assert(buf_c == 2); - for (i=0; i < buf_c; ++i) - compute_stereo_samples(buffer, data_c, data, d_offset, len); - } else { - int limit = buf_c < data_c ? buf_c : data_c; - int j; - for (j=0; j < len; ++j) { - for (i=0; i < limit; ++i) { - FASTDEF(temp); - float f = data[i][d_offset+j]; - int v = FAST_SCALED_FLOAT_TO_INT(temp, f,15);//data[i][d_offset+j],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - *buffer++ = v; - } - for ( ; i < buf_c; ++i) - *buffer++ = 0; - } - } -} - -int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts) -{ - float **output; - int len; - if (num_c == 1) return stb_vorbis_get_frame_short(f,num_c,&buffer, num_shorts); - len = stb_vorbis_get_frame_float(f, NULL, &output); - if (len) { - if (len*num_c > num_shorts) len = num_shorts / num_c; - convert_channels_short_interleaved(num_c, buffer, f->channels, output, 0, len); - } - return len; -} - -int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts) -{ - float **outputs; - int len = num_shorts / channels; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < len) { - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - if (k) - convert_channels_short_interleaved(channels, buffer, f->channels, f->channel_buffers, f->channel_buffer_start, k); - buffer += k*channels; - n += k; - f->channel_buffer_start += k; - if (n == len) break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; - } - return n; -} - -int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int len) -{ - float **outputs; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < len) { - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - if (k) - convert_samples_short(channels, buffer, n, f->channels, f->channel_buffers, f->channel_buffer_start, k); - n += k; - f->channel_buffer_start += k; - if (n == len) break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; - } - return n; -} - -#ifndef STB_VORBIS_NO_STDIO -int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output) -{ - int data_len, offset, total, limit, error; - short *data; - stb_vorbis *v = stb_vorbis_open_filename(filename, &error, NULL); - if (v == NULL) return -1; - limit = v->channels * 4096; - *channels = v->channels; - if (sample_rate) - *sample_rate = v->sample_rate; - offset = data_len = 0; - total = limit; - data = (short *) malloc(total * sizeof(*data)); - if (data == NULL) { - stb_vorbis_close(v); - return -2; - } - for (;;) { - int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); - if (n == 0) break; - data_len += n; - offset += n * v->channels; - if (offset + limit > total) { - short *data2; - total *= 2; - data2 = (short *) realloc(data, total * sizeof(*data)); - if (data2 == NULL) { - free(data); - stb_vorbis_close(v); - return -2; - } - data = data2; - } - } - *output = data; - stb_vorbis_close(v); - return data_len; -} -#endif // NO_STDIO - -int stb_vorbis_decode_memory(const uint8 *mem, int len, int *channels, int *sample_rate, short **output) -{ - int data_len, offset, total, limit, error; - short *data; - stb_vorbis *v = stb_vorbis_open_memory(mem, len, &error, NULL); - if (v == NULL) return -1; - limit = v->channels * 4096; - *channels = v->channels; - if (sample_rate) - *sample_rate = v->sample_rate; - offset = data_len = 0; - total = limit; - data = (short *) malloc(total * sizeof(*data)); - if (data == NULL) { - stb_vorbis_close(v); - return -2; - } - for (;;) { - int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); - if (n == 0) break; - data_len += n; - offset += n * v->channels; - if (offset + limit > total) { - short *data2; - total *= 2; - data2 = (short *) realloc(data, total * sizeof(*data)); - if (data2 == NULL) { - free(data); - stb_vorbis_close(v); - return -2; - } - data = data2; - } - } - *output = data; - stb_vorbis_close(v); - return data_len; -} -#endif // STB_VORBIS_NO_INTEGER_CONVERSION - -int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats) -{ - float **outputs; - int len = num_floats / channels; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < len) { - int i,j; - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - for (j=0; j < k; ++j) { - for (i=0; i < z; ++i) - *buffer++ = f->channel_buffers[i][f->channel_buffer_start+j]; - for ( ; i < channels; ++i) - *buffer++ = 0; - } - n += k; - f->channel_buffer_start += k; - if (n == len) - break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) - break; - } - return n; -} - -int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples) -{ - float **outputs; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < num_samples) { - int i; - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= num_samples) k = num_samples - n; - if (k) { - for (i=0; i < z; ++i) - memcpy(buffer[i]+n, f->channel_buffers[i]+f->channel_buffer_start, sizeof(float)*k); - for ( ; i < channels; ++i) - memset(buffer[i]+n, 0, sizeof(float) * k); - } - n += k; - f->channel_buffer_start += k; - if (n == num_samples) - break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) - break; - } - return n; -} -#endif // STB_VORBIS_NO_PULLDATA_API - -/* Version history - 1.09 - 2016/04/04 - back out 'avoid discarding last frame' fix from previous version - 1.08 - 2016/04/02 - fixed multiple warnings; fix setup memory leaks; - avoid discarding last frame of audio data - 1.07 - 2015/01/16 - fixed some warnings, fix mingw, const-correct API - some more crash fixes when out of memory or with corrupt files - 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) - some crash fixes when out of memory or with corrupt files - 1.05 - 2015/04/19 - don't define __forceinline if it's redundant - 1.04 - 2014/08/27 - fix missing const-correct case in API - 1.03 - 2014/08/07 - Warning fixes - 1.02 - 2014/07/09 - Declare qsort compare function _cdecl on windows - 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float - 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in multichannel - (API change) report sample rate for decode-full-file funcs - 0.99996 - bracket #include for macintosh compilation by Laurent Gomila - 0.99995 - use union instead of pointer-cast for fast-float-to-int to avoid alias-optimization problem - 0.99994 - change fast-float-to-int to work in single-precision FPU mode, remove endian-dependence - 0.99993 - remove assert that fired on legal files with empty tables - 0.99992 - rewind-to-start - 0.99991 - bugfix to stb_vorbis_get_samples_short by Bernhard Wodo - 0.9999 - (should have been 0.99990) fix no-CRT support, compiling as C++ - 0.9998 - add a full-decode function with a memory source - 0.9997 - fix a bug in the read-from-FILE case in 0.9996 addition - 0.9996 - query length of vorbis stream in samples/seconds - 0.9995 - bugfix to another optimization that only happened in certain files - 0.9994 - bugfix to one of the optimizations that caused significant (but inaudible?) errors - 0.9993 - performance improvements; runs in 99% to 104% of time of reference implementation - 0.9992 - performance improvement of IMDCT; now performs close to reference implementation - 0.9991 - performance improvement of IMDCT - 0.999 - (should have been 0.9990) performance improvement of IMDCT - 0.998 - no-CRT support from Casey Muratori - 0.997 - bugfixes for bugs found by Terje Mathisen - 0.996 - bugfix: fast-huffman decode initialized incorrectly for sparse codebooks; fixing gives 10% speedup - found by Terje Mathisen - 0.995 - bugfix: fix to 'effective' overrun detection - found by Terje Mathisen - 0.994 - bugfix: garbage decode on final VQ symbol of a non-multiple - found by Terje Mathisen - 0.993 - bugfix: pushdata API required 1 extra byte for empty page (failed to consume final page if empty) - found by Terje Mathisen - 0.992 - fixes for MinGW warning - 0.991 - turn fast-float-conversion on by default - 0.990 - fix push-mode seek recovery if you seek into the headers - 0.98b - fix to bad release of 0.98 - 0.98 - fix push-mode seek recovery; robustify float-to-int and support non-fast mode - 0.97 - builds under c++ (typecasting, don't use 'class' keyword) - 0.96 - somehow MY 0.95 was right, but the web one was wrong, so here's my 0.95 rereleased as 0.96, fixes a typo in the clamping code - 0.95 - clamping code for 16-bit functions - 0.94 - not publically released - 0.93 - fixed all-zero-floor case (was decoding garbage) - 0.92 - fixed a memory leak - 0.91 - conditional compiles to omit parts of the API and the infrastructure to support them: STB_VORBIS_NO_PULLDATA_API, STB_VORBIS_NO_PUSHDATA_API, STB_VORBIS_NO_STDIO, STB_VORBIS_NO_INTEGER_CONVERSION - 0.90 - first public release -*/ - -#endif // STB_VORBIS_HEADER_ONLY diff --git a/src/stb_vorbis.h b/src/stb_vorbis.h deleted file mode 100644 index 624ce4bc..00000000 --- a/src/stb_vorbis.h +++ /dev/null @@ -1,393 +0,0 @@ -// Ogg Vorbis audio decoder - v1.09 - public domain -// http://nothings.org/stb_vorbis/ -// -// Original version written by Sean Barrett in 2007. -// -// Originally sponsored by RAD Game Tools. Seeking sponsored -// by Phillip Bennefall, Marc Andersen, Aaron Baker, Elias Software, -// Aras Pranckevicius, and Sean Barrett. -// -// LICENSE -// -// This software is dual-licensed to the public domain and under the following -// license: you are granted a perpetual, irrevocable license to copy, modify, -// publish, and distribute this file as you see fit. -// -// No warranty for any purpose is expressed or implied by the author (nor -// by RAD Game Tools). Report bugs and send enhancements to the author. -// -// Limitations: -// -// - floor 0 not supported (used in old ogg vorbis files pre-2004) -// - lossless sample-truncation at beginning ignored -// - cannot concatenate multiple vorbis streams -// - sample positions are 32-bit, limiting seekable 192Khz -// files to around 6 hours (Ogg supports 64-bit) -// -// Feature contributors: -// Dougall Johnson (sample-exact seeking) -// -// Bugfix/warning contributors: -// Terje Mathisen Niklas Frykholm Andy Hill -// Casey Muratori John Bolton Gargaj -// Laurent Gomila Marc LeBlanc Ronny Chevalier -// Bernhard Wodo Evan Balster alxprd@github -// Tom Beaumont Ingo Leitgeb Nicolas Guillemot -// Phillip Bennefall Rohit Thiago Goulart -// manxorist@github saga musix -// -// Partial history: -// 1.09 - 2016/04/04 - back out 'truncation of last frame' fix from previous version -// 1.08 - 2016/04/02 - warnings; setup memory leaks; truncation of last frame -// 1.07 - 2015/01/16 - fixes for crashes on invalid files; warning fixes; const -// 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson) -// some crash fixes when out of memory or with corrupt files -// fix some inappropriately signed shifts -// 1.05 - 2015/04/19 - don't define __forceinline if it's redundant -// 1.04 - 2014/08/27 - fix missing const-correct case in API -// 1.03 - 2014/08/07 - warning fixes -// 1.02 - 2014/07/09 - declare qsort comparison as explicitly _cdecl in Windows -// 1.01 - 2014/06/18 - fix stb_vorbis_get_samples_float (interleaved was correct) -// 1.0 - 2014/05/26 - fix memory leaks; fix warnings; fix bugs in >2-channel; -// (API change) report sample rate for decode-full-file funcs -// -// See end of file for full version history. - - -////////////////////////////////////////////////////////////////////////////// -// -// HEADER BEGINS HERE -// - -#ifndef STB_VORBIS_INCLUDE_STB_VORBIS_H -#define STB_VORBIS_INCLUDE_STB_VORBIS_H - -#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) -#define STB_VORBIS_NO_STDIO 1 -#endif - -#ifndef STB_VORBIS_NO_STDIO -#include -#endif - -// NOTE: Added to work with raylib on Android -#if defined(PLATFORM_ANDROID) - #include "utils.h" // Android fopen function map -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/////////// THREAD SAFETY - -// Individual stb_vorbis* handles are not thread-safe; you cannot decode from -// them from multiple threads at the same time. However, you can have multiple -// stb_vorbis* handles and decode from them independently in multiple thrads. - - -/////////// MEMORY ALLOCATION - -// normally stb_vorbis uses malloc() to allocate memory at startup, -// and alloca() to allocate temporary memory during a frame on the -// stack. (Memory consumption will depend on the amount of setup -// data in the file and how you set the compile flags for speed -// vs. size. In my test files the maximal-size usage is ~150KB.) -// -// You can modify the wrapper functions in the source (setup_malloc, -// setup_temp_malloc, temp_malloc) to change this behavior, or you -// can use a simpler allocation model: you pass in a buffer from -// which stb_vorbis will allocate _all_ its memory (including the -// temp memory). "open" may fail with a VORBIS_outofmem if you -// do not pass in enough data; there is no way to determine how -// much you do need except to succeed (at which point you can -// query get_info to find the exact amount required. yes I know -// this is lame). -// -// If you pass in a non-NULL buffer of the type below, allocation -// will occur from it as described above. Otherwise just pass NULL -// to use malloc()/alloca() - -typedef struct -{ - char *alloc_buffer; - int alloc_buffer_length_in_bytes; -} stb_vorbis_alloc; - - -/////////// FUNCTIONS USEABLE WITH ALL INPUT MODES - -typedef struct stb_vorbis stb_vorbis; - -typedef struct -{ - unsigned int sample_rate; - int channels; - - unsigned int setup_memory_required; - unsigned int setup_temp_memory_required; - unsigned int temp_memory_required; - - int max_frame_size; -} stb_vorbis_info; - -// get general information about the file -extern stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f); - -// get the last error detected (clears it, too) -extern int stb_vorbis_get_error(stb_vorbis *f); - -// close an ogg vorbis file and free all memory in use -extern void stb_vorbis_close(stb_vorbis *f); - -// this function returns the offset (in samples) from the beginning of the -// file that will be returned by the next decode, if it is known, or -1 -// otherwise. after a flush_pushdata() call, this may take a while before -// it becomes valid again. -// NOT WORKING YET after a seek with PULLDATA API -extern int stb_vorbis_get_sample_offset(stb_vorbis *f); - -// returns the current seek point within the file, or offset from the beginning -// of the memory buffer. In pushdata mode it returns 0. -extern unsigned int stb_vorbis_get_file_offset(stb_vorbis *f); - -/////////// PUSHDATA API - -#ifndef STB_VORBIS_NO_PUSHDATA_API - -// this API allows you to get blocks of data from any source and hand -// them to stb_vorbis. you have to buffer them; stb_vorbis will tell -// you how much it used, and you have to give it the rest next time; -// and stb_vorbis may not have enough data to work with and you will -// need to give it the same data again PLUS more. Note that the Vorbis -// specification does not bound the size of an individual frame. - -extern stb_vorbis *stb_vorbis_open_pushdata( - const unsigned char * datablock, int datablock_length_in_bytes, - int *datablock_memory_consumed_in_bytes, - int *error, - const stb_vorbis_alloc *alloc_buffer); -// create a vorbis decoder by passing in the initial data block containing -// the ogg&vorbis headers (you don't need to do parse them, just provide -// the first N bytes of the file--you're told if it's not enough, see below) -// on success, returns an stb_vorbis *, does not set error, returns the amount of -// data parsed/consumed on this call in *datablock_memory_consumed_in_bytes; -// on failure, returns NULL on error and sets *error, does not change *datablock_memory_consumed -// if returns NULL and *error is VORBIS_need_more_data, then the input block was -// incomplete and you need to pass in a larger block from the start of the file - -extern int stb_vorbis_decode_frame_pushdata( - stb_vorbis *f, - const unsigned char *datablock, int datablock_length_in_bytes, - int *channels, // place to write number of float * buffers - float ***output, // place to write float ** array of float * buffers - int *samples // place to write number of output samples - ); -// decode a frame of audio sample data if possible from the passed-in data block -// -// return value: number of bytes we used from datablock -// -// possible cases: -// 0 bytes used, 0 samples output (need more data) -// N bytes used, 0 samples output (resynching the stream, keep going) -// N bytes used, M samples output (one frame of data) -// note that after opening a file, you will ALWAYS get one N-bytes,0-sample -// frame, because Vorbis always "discards" the first frame. -// -// Note that on resynch, stb_vorbis will rarely consume all of the buffer, -// instead only datablock_length_in_bytes-3 or less. This is because it wants -// to avoid missing parts of a page header if they cross a datablock boundary, -// without writing state-machiney code to record a partial detection. -// -// The number of channels returned are stored in *channels (which can be -// NULL--it is always the same as the number of channels reported by -// get_info). *output will contain an array of float* buffers, one per -// channel. In other words, (*output)[0][0] contains the first sample from -// the first channel, and (*output)[1][0] contains the first sample from -// the second channel. - -extern void stb_vorbis_flush_pushdata(stb_vorbis *f); -// inform stb_vorbis that your next datablock will not be contiguous with -// previous ones (e.g. you've seeked in the data); future attempts to decode -// frames will cause stb_vorbis to resynchronize (as noted above), and -// once it sees a valid Ogg page (typically 4-8KB, as large as 64KB), it -// will begin decoding the _next_ frame. -// -// if you want to seek using pushdata, you need to seek in your file, then -// call stb_vorbis_flush_pushdata(), then start calling decoding, then once -// decoding is returning you data, call stb_vorbis_get_sample_offset, and -// if you don't like the result, seek your file again and repeat. -#endif - - -////////// PULLING INPUT API - -#ifndef STB_VORBIS_NO_PULLDATA_API -// This API assumes stb_vorbis is allowed to pull data from a source-- -// either a block of memory containing the _entire_ vorbis stream, or a -// FILE * that you or it create, or possibly some other reading mechanism -// if you go modify the source to replace the FILE * case with some kind -// of callback to your code. (But if you don't support seeking, you may -// just want to go ahead and use pushdata.) - -#if !defined(STB_VORBIS_NO_STDIO) && !defined(STB_VORBIS_NO_INTEGER_CONVERSION) -extern int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output); -#endif -#if !defined(STB_VORBIS_NO_INTEGER_CONVERSION) -extern int stb_vorbis_decode_memory(const unsigned char *mem, int len, int *channels, int *sample_rate, short **output); -#endif -// decode an entire file and output the data interleaved into a malloc()ed -// buffer stored in *output. The return value is the number of samples -// decoded, or -1 if the file could not be opened or was not an ogg vorbis file. -// When you're done with it, just free() the pointer returned in *output. - -extern stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from an ogg vorbis stream in memory (note -// this must be the entire stream!). on failure, returns NULL and sets *error - -#ifndef STB_VORBIS_NO_STDIO -extern stb_vorbis * stb_vorbis_open_filename(const char *filename, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from a filename via fopen(). on failure, -// returns NULL and sets *error (possibly to VORBIS_file_open_failure). - -extern stb_vorbis * stb_vorbis_open_file(FILE *f, int close_handle_on_close, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from an open FILE *, looking for a stream at -// the _current_ seek point (ftell). on failure, returns NULL and sets *error. -// note that stb_vorbis must "own" this stream; if you seek it in between -// calls to stb_vorbis, it will become confused. Morever, if you attempt to -// perform stb_vorbis_seek_*() operations on this file, it will assume it -// owns the _entire_ rest of the file after the start point. Use the next -// function, stb_vorbis_open_file_section(), to limit it. - -extern stb_vorbis * stb_vorbis_open_file_section(FILE *f, int close_handle_on_close, - int *error, const stb_vorbis_alloc *alloc_buffer, unsigned int len); -// create an ogg vorbis decoder from an open FILE *, looking for a stream at -// the _current_ seek point (ftell); the stream will be of length 'len' bytes. -// on failure, returns NULL and sets *error. note that stb_vorbis must "own" -// this stream; if you seek it in between calls to stb_vorbis, it will become -// confused. -#endif - -extern int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number); -extern int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number); -// these functions seek in the Vorbis file to (approximately) 'sample_number'. -// after calling seek_frame(), the next call to get_frame_*() will include -// the specified sample. after calling stb_vorbis_seek(), the next call to -// stb_vorbis_get_samples_* will start with the specified sample. If you -// do not need to seek to EXACTLY the target sample when using get_samples_*, -// you can also use seek_frame(). - -extern void stb_vorbis_seek_start(stb_vorbis *f); -// this function is equivalent to stb_vorbis_seek(f,0) - -extern unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f); -extern float stb_vorbis_stream_length_in_seconds(stb_vorbis *f); -// these functions return the total length of the vorbis stream - -extern int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output); -// decode the next frame and return the number of samples. the number of -// channels returned are stored in *channels (which can be NULL--it is always -// the same as the number of channels reported by get_info). *output will -// contain an array of float* buffers, one per channel. These outputs will -// be overwritten on the next call to stb_vorbis_get_frame_*. -// -// You generally should not intermix calls to stb_vorbis_get_frame_*() -// and stb_vorbis_get_samples_*(), since the latter calls the former. - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -extern int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts); -extern int stb_vorbis_get_frame_short (stb_vorbis *f, int num_c, short **buffer, int num_samples); -#endif -// decode the next frame and return the number of *samples* per channel. -// Note that for interleaved data, you pass in the number of shorts (the -// size of your array), but the return value is the number of samples per -// channel, not the total number of samples. -// -// The data is coerced to the number of channels you request according to the -// channel coercion rules (see below). You must pass in the size of your -// buffer(s) so that stb_vorbis will not overwrite the end of the buffer. -// The maximum buffer size needed can be gotten from get_info(); however, -// the Vorbis I specification implies an absolute maximum of 4096 samples -// per channel. - -// Channel coercion rules: -// Let M be the number of channels requested, and N the number of channels present, -// and Cn be the nth channel; let stereo L be the sum of all L and center channels, -// and stereo R be the sum of all R and center channels (channel assignment from the -// vorbis spec). -// M N output -// 1 k sum(Ck) for all k -// 2 * stereo L, stereo R -// k l k > l, the first l channels, then 0s -// k l k <= l, the first k channels -// Note that this is not _good_ surround etc. mixing at all! It's just so -// you get something useful. - -extern int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats); -extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples); -// gets num_samples samples, not necessarily on a frame boundary--this requires -// buffering so you have to supply the buffers. DOES NOT APPLY THE COERCION RULES. -// Returns the number of samples stored per channel; it may be less than requested -// at the end of the file. If there are no more samples in the file, returns 0. - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -extern int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts); -extern int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int num_samples); -#endif -// gets num_samples samples, not necessarily on a frame boundary--this requires -// buffering so you have to supply the buffers. Applies the coercion rules above -// to produce 'channels' channels. Returns the number of samples stored per channel; -// it may be less than requested at the end of the file. If there are no more -// samples in the file, returns 0. - -#endif - -//////// ERROR CODES - -enum STBVorbisError -{ - VORBIS__no_error, - - VORBIS_need_more_data=1, // not a real error - - VORBIS_invalid_api_mixing, // can't mix API modes - VORBIS_outofmem, // not enough memory - VORBIS_feature_not_supported, // uses floor 0 - VORBIS_too_many_channels, // STB_VORBIS_MAX_CHANNELS is too small - VORBIS_file_open_failure, // fopen() failed - VORBIS_seek_without_length, // can't seek in unknown-length file - - VORBIS_unexpected_eof=10, // file is truncated? - VORBIS_seek_invalid, // seek past EOF - - // decoding errors (corrupt/invalid stream) -- you probably - // don't care about the exact details of these - - // vorbis errors: - VORBIS_invalid_setup=20, - VORBIS_invalid_stream, - - // ogg errors: - VORBIS_missing_capture_pattern=30, - VORBIS_invalid_stream_structure_version, - VORBIS_continued_packet_flag_invalid, - VORBIS_incorrect_stream_serial_number, - VORBIS_invalid_first_page, - VORBIS_bad_packet_type, - VORBIS_cant_find_last_page, - VORBIS_seek_failed -}; - - -#ifdef __cplusplus -} -#endif - -#endif // STB_VORBIS_INCLUDE_STB_VORBIS_H -// -// HEADER ENDS HERE -// -////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/text.c b/src/text.c index cef0ebcb..b5f7ad0c 100644 --- a/src/text.c +++ b/src/text.c @@ -34,7 +34,7 @@ // Following libs are used on LoadTTF() #define STB_TRUETYPE_IMPLEMENTATION -#include "stb_truetype.h" // Required for: stbtt_BakeFontBitmap() +#include "external/stb_truetype.h" // Required for: stbtt_BakeFontBitmap() // Rectangle packing functions (not used at the moment) //#define STB_RECT_PACK_IMPLEMENTATION diff --git a/src/textures.c b/src/textures.c index 432d3426..518348f4 100644 --- a/src/textures.c +++ b/src/textures.c @@ -40,12 +40,12 @@ // NOTE: Includes Android fopen function map #define STB_IMAGE_IMPLEMENTATION -#include "stb_image.h" // Required for: stbi_load() +#include "external/stb_image.h" // Required for: stbi_load() // NOTE: Used to read image data (multiple formats support) #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "stb_image_resize.h" // Required for: stbir_resize_uint8() - // NOTE: Used for image scaling on ImageResize() +#include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() + // NOTE: Used for image scaling on ImageResize() //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/tinfl.c b/src/tinfl.c deleted file mode 100644 index a17a156b..00000000 --- a/src/tinfl.c +++ /dev/null @@ -1,592 +0,0 @@ -/* tinfl.c v1.11 - public domain inflate with zlib header parsing/adler32 checking (inflate-only subset of miniz.c) - See "unlicense" statement at the end of this file. - Rich Geldreich , last updated May 20, 2011 - Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt - - The entire decompressor coroutine is implemented in tinfl_decompress(). The other functions are optional high-level helpers. -*/ -#ifndef TINFL_HEADER_INCLUDED -#define TINFL_HEADER_INCLUDED - -#include - -typedef unsigned char mz_uint8; -typedef signed short mz_int16; -typedef unsigned short mz_uint16; -typedef unsigned int mz_uint32; -typedef unsigned int mz_uint; -typedef unsigned long long mz_uint64; - -#if defined(_M_IX86) || defined(_M_X64) -// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 if integer loads and stores to unaligned addresses are acceptable on the target platform (slightly faster). -#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 -// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. -#define MINIZ_LITTLE_ENDIAN 1 -#endif - -#if defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) -// Set MINIZ_HAS_64BIT_REGISTERS to 1 if the processor has 64-bit general purpose registers (enables 64-bit bitbuffer in inflator) -#define MINIZ_HAS_64BIT_REGISTERS 1 -#endif - -// Works around MSVC's spammy "warning C4127: conditional expression is constant" message. -#ifdef _MSC_VER - #define MZ_MACRO_END while (0, 0) -#else - #define MZ_MACRO_END while (0) -#endif - -// Decompression flags used by tinfl_decompress(). -// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. -// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. -// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). -// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. -enum -{ - TINFL_FLAG_PARSE_ZLIB_HEADER = 1, - TINFL_FLAG_HAS_MORE_INPUT = 2, - TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, - TINFL_FLAG_COMPUTE_ADLER32 = 8 -}; - -// High level decompression functions: -// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). -// On entry: -// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. -// On return: -// Function returns a pointer to the decompressed data, or NULL on failure. -// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. -// The caller must free() the returned block when it's no longer needed. -void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); - -// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. -// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. -#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); - -// tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. -// Returns 1 on success or 0 on failure. -typedef int (*tinfl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); -int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); - -struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; - -// Max size of LZ dictionary. -#define TINFL_LZ_DICT_SIZE 32768 - -// Return status. -typedef enum -{ - TINFL_STATUS_BAD_PARAM = -3, - TINFL_STATUS_ADLER32_MISMATCH = -2, - TINFL_STATUS_FAILED = -1, - TINFL_STATUS_DONE = 0, - TINFL_STATUS_NEEDS_MORE_INPUT = 1, - TINFL_STATUS_HAS_MORE_OUTPUT = 2 -} tinfl_status; - -// Initializes the decompressor to its initial state. -#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END -#define tinfl_get_adler32(r) (r)->m_check_adler32 - -// Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. -// This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. -tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); - -// Internal/private bits follow. -enum -{ - TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, - TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS -}; - -typedef struct -{ - mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; - mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; -} tinfl_huff_table; - -#if MINIZ_HAS_64BIT_REGISTERS - #define TINFL_USE_64BIT_BITBUF 1 -#endif - -#if TINFL_USE_64BIT_BITBUF - typedef mz_uint64 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (64) -#else - typedef mz_uint32 tinfl_bit_buf_t; - #define TINFL_BITBUF_SIZE (32) -#endif - -struct tinfl_decompressor_tag -{ - mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; - tinfl_bit_buf_t m_bit_buf; - size_t m_dist_from_out_buf_start; - tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; - mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; -}; - -#endif // #ifdef TINFL_HEADER_INCLUDED - -// ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) - -#ifndef TINFL_HEADER_FILE_ONLY - -#include - -// MZ_MALLOC, etc. are only used by the optional high-level helper functions. -#ifdef MINIZ_NO_MALLOC - #define MZ_MALLOC(x) NULL - #define MZ_FREE(x) x, ((void)0) - #define MZ_REALLOC(p, x) NULL -#else - #define MZ_MALLOC(x) malloc(x) - #define MZ_FREE(x) free(x) - #define MZ_REALLOC(p, x) realloc(p, x) -#endif - -#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) -#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) -#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) - -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN - #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) - #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) -#else - #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) - #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) -#endif - -#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) -#define TINFL_MEMSET(p, c, l) memset(p, c, l) - -#define TINFL_CR_BEGIN switch(r->m_state) { case 0: -#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END -#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END -#define TINFL_CR_FINISH } - -// TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never -// reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. -#define TINFL_GET_BYTE(state_index, c) do { \ - if (pIn_buf_cur >= pIn_buf_end) { \ - for ( ; ; ) { \ - if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ - TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ - if (pIn_buf_cur < pIn_buf_end) { \ - c = *pIn_buf_cur++; \ - break; \ - } \ - } else { \ - c = 0; \ - break; \ - } \ - } \ - } else c = *pIn_buf_cur++; } MZ_MACRO_END - -#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) -#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END -#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END - -// TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. -// It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a -// Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the -// bit buffer contains >=15 bits (deflate's max. Huffman code size). -#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ - do { \ - temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ - if (temp >= 0) { \ - code_len = temp >> 9; \ - if ((code_len) && (num_bits >= code_len)) \ - break; \ - } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ - code_len = TINFL_FAST_LOOKUP_BITS; \ - do { \ - temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ - } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ - } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ - } while (num_bits < 15); - -// TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read -// beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully -// decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. -// The slow path is only executed at the very end of the input buffer. -#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ - int temp; mz_uint code_len, c; \ - if (num_bits < 15) { \ - if ((pIn_buf_end - pIn_buf_cur) < 2) { \ - TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ - } else { \ - bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ - } \ - } \ - if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ - code_len = temp >> 9, temp &= 511; \ - else { \ - code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ - } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END - -tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) -{ - static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; - static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; - static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; - static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; - static const int s_min_table_sizes[3] = { 257, 1, 4 }; - - tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; - const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; - mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; - size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; - - // Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). - if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } - - num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; - TINFL_CR_BEGIN - - bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; - if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) - { - TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); - counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); - if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); - if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } - } - - do - { - TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; - if (r->m_type == 0) - { - TINFL_SKIP_BITS(5, num_bits & 7); - for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } - if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } - while ((counter) && (num_bits)) - { - TINFL_GET_BITS(51, dist, 8); - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = (mz_uint8)dist; - counter--; - } - while (counter) - { - size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } - while (pIn_buf_cur >= pIn_buf_end) - { - if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) - { - TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); - } - else - { - TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); - } - } - n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); - TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; - } - } - else if (r->m_type == 3) - { - TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); - } - else - { - if (r->m_type == 1) - { - mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; - r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); - for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8; - } - else - { - for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } - MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } - r->m_table_sizes[2] = 19; - } - for ( ; (int)r->m_type >= 0; r->m_type--) - { - int tree_next, tree_cur; tinfl_huff_table *pTable; - mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); - for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; - used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; - for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } - if ((65536 != total) && (used_syms > 1)) - { - TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); - } - for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) - { - mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; - cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); - if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } - if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } - rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); - for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) - { - tree_cur -= ((rev_code >>= 1) & 1); - if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; - } - tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; - } - if (r->m_type == 2) - { - for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) - { - mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } - if ((dist == 16) && (!counter)) - { - TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); - } - num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; - TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; - } - if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) - { - TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); - } - TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); - } - } - for ( ; ; ) - { - mz_uint8 *pSrc; - for ( ; ; ) - { - if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) - { - TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); - if (counter >= 256) - break; - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = (mz_uint8)counter; - } - else - { - int sym2; mz_uint code_len; -#if TINFL_USE_64BIT_BITBUF - if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } -#else - if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } -#endif - if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) - code_len = sym2 >> 9; - else - { - code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); - } - counter = sym2; bit_buf >>= code_len; num_bits -= code_len; - if (counter & 256) - break; - -#if !TINFL_USE_64BIT_BITBUF - if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } -#endif - if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) - code_len = sym2 >> 9; - else - { - code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); - } - bit_buf >>= code_len; num_bits -= code_len; - - pOut_buf_cur[0] = (mz_uint8)counter; - if (sym2 & 256) - { - pOut_buf_cur++; - counter = sym2; - break; - } - pOut_buf_cur[1] = (mz_uint8)sym2; - pOut_buf_cur += 2; - } - } - if ((counter &= 511) == 256) break; - - num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; - if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } - - TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); - num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; - if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } - - dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; - if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) - { - TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); - } - - pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); - - if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) - { - while (counter--) - { - while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } - *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; - } - continue; - } -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES - else if ((counter >= 9) && (counter <= dist)) - { - const mz_uint8 *pSrc_end = pSrc + (counter & ~7); - do - { - ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; - ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; - pOut_buf_cur += 8; - } while ((pSrc += 8) < pSrc_end); - if ((counter &= 7) < 3) - { - if (counter) - { - pOut_buf_cur[0] = pSrc[0]; - if (counter > 1) - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur += counter; - } - continue; - } - } -#endif - do - { - pOut_buf_cur[0] = pSrc[0]; - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur[2] = pSrc[2]; - pOut_buf_cur += 3; pSrc += 3; - } while ((int)(counter -= 3) > 2); - if ((int)counter > 0) - { - pOut_buf_cur[0] = pSrc[0]; - if ((int)counter > 1) - pOut_buf_cur[1] = pSrc[1]; - pOut_buf_cur += counter; - } - } - } - } while (!(r->m_final & 1)); - if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) - { - TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } - } - TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); - TINFL_CR_FINISH - -common_exit: - r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; - *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; - if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) - { - const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; - mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; - while (buf_len) - { - for (i = 0; i + 7 < block_len; i += 8, ptr += 8) - { - s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; - s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; - } - for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; - s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; - } - r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; - } - return status; -} - -// Higher level helper functions. -void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) -{ - tinfl_decompressor decomp; void *pBuf = NULL, *pNew_buf; size_t src_buf_ofs = 0, out_buf_capacity = 0; - *pOut_len = 0; - tinfl_init(&decomp); - for ( ; ; ) - { - size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity; - tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8*)pBuf, pBuf ? (mz_uint8*)pBuf + *pOut_len : NULL, &dst_buf_size, - (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); - if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) - { - MZ_FREE(pBuf); *pOut_len = 0; return NULL; - } - src_buf_ofs += src_buf_size; - *pOut_len += dst_buf_size; - if (status == TINFL_STATUS_DONE) break; - new_out_buf_capacity = out_buf_capacity * 2; if (new_out_buf_capacity < 128) new_out_buf_capacity = 128; - pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity); - if (!pNew_buf) - { - MZ_FREE(pBuf); *pOut_len = 0; return NULL; - } - pBuf = pNew_buf; out_buf_capacity = new_out_buf_capacity; - } - return pBuf; -} - -size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) -{ - tinfl_decompressor decomp; tinfl_status status; tinfl_init(&decomp); - status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf, &src_buf_len, (mz_uint8*)pOut_buf, (mz_uint8*)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); - return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len; -} - -int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) -{ - int result = 0; - tinfl_decompressor decomp; - mz_uint8 *pDict = (mz_uint8*)MZ_MALLOC(TINFL_LZ_DICT_SIZE); size_t in_buf_ofs = 0, dict_ofs = 0; - if (!pDict) - return TINFL_STATUS_FAILED; - tinfl_init(&decomp); - for ( ; ; ) - { - size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs; - tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, - (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); - in_buf_ofs += in_buf_size; - if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) - break; - if (status != TINFL_STATUS_HAS_MORE_OUTPUT) - { - result = (status == TINFL_STATUS_DONE); - break; - } - dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1); - } - MZ_FREE(pDict); - *pIn_buf_size = in_buf_ofs; - return result; -} - -#endif // #ifndef TINFL_HEADER_FILE_ONLY - -/* - This is free and unencumbered software released into the public domain. - - Anyone is free to copy, modify, publish, use, compile, sell, or - distribute this software, either in source code form or as a compiled - binary, for any purpose, commercial or non-commercial, and by any - means. - - In jurisdictions that recognize copyright laws, the author or authors - of this software dedicate any and all copyright interest in the - software to the public domain. We make this dedication for the benefit - of the public at large and to the detriment of our heirs and - successors. We intend this dedication to be an overt act of - relinquishment in perpetuity of all present and future rights to this - software under copyright law. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - For more information, please refer to -*/ diff --git a/src/utils.c b/src/utils.c index 97561ee6..5340b3e5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -42,10 +42,11 @@ #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) #define STB_IMAGE_WRITE_IMPLEMENTATION - #include "stb_image_write.h" // Required for: stbi_write_png() + #include "external/stb_image_write.h" // Required for: stbi_write_png() #endif -#include "tinfl.c" +#include "external/tinfl.c" // Required for: tinfl_decompress_mem_to_mem() + // NOTE: Deflate algorythm data decompression //---------------------------------------------------------------------------------- // Global Variables Definition -- cgit v1.2.3 From ad8a5a95b2524291ffd4aaaef17ef7c28b4ee3ab Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 14:38:54 +0200 Subject: Move and update CMakeList --- src/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..c094ad96 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required (VERSION 3.0) +project (raylib) +SET(PLATFORM_TO_USE "PLATFORM_DESKTOP" CACHE STRING "Platform to compile for") +SET_PROPERTY(CACHE PLATFORM_TO_USE PROPERTY STRINGS PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB) + +set(CMAKE_C_FLAGS "-O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces") + +IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_DESKTOP") + + add_definitions(-DPLATFORM_DESKTOP, -DGRAPHICS_API_OPENGL_33) + include_directories("." "external/" "external/openal_soft/include" "external/glfw3/include") + +ENDIF() + +IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_RPI") + + add_definitions(-DPLATFORM_RPI, -GRAPHICS_API_OPENGL_ES2) + include_directories("." "external/" "/opt/vc/include" "/opt/vc/include/interface/vmcs_host/linux" "/opt/vc/include/interface/vcos/pthreads") + +ENDIF() + +IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_WEB") + + add_definitions(-DPLATFORM_WEB, -GRAPHICS_API_OPENGL_ES2) + include_directories("." "external/" "external/openal_soft/include" "external/glfw3/include") + +ENDIF() + + +file(GLOB SOURCES "*.c" "external/*.c") +add_library(raylib STATIC ${SOURCES}) +install(TARGETS raylib DESTINATION ../lib/) \ No newline at end of file -- cgit v1.2.3 From 302d84cedc334087efa9395d71499118b74b2031 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Mon, 6 Jun 2016 19:26:30 +0200 Subject: Fix mistake in Makefile --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 7f15bd2f..92e37cfb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -101,7 +101,7 @@ endif # typing 'make' will invoke the default target entry called 'all', -# in this case, the 'default' target entry is basic_game +# in this case, the 'default' target entry is raylib all: raylib # compile raylib library -- cgit v1.2.3 From 5f5d191d8869b2b3424e68c3dc80cf8fd74f0ba8 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 20:26:02 +0200 Subject: Updated to GLFW 3.2 --- src/external/glfw3/COPYING.txt | 5 +- src/external/glfw3/include/GLFW/glfw3.h | 2040 ++++++++++++++++++------- src/external/glfw3/include/GLFW/glfw3native.h | 244 ++- src/external/glfw3/lib/win32/libglfw3.a | Bin 83834 -> 148800 bytes src/external/glfw3/lib/win32/libglfw3dll.a | Bin 54834 -> 67426 bytes 5 files changed, 1635 insertions(+), 654 deletions(-) (limited to 'src') diff --git a/src/external/glfw3/COPYING.txt b/src/external/glfw3/COPYING.txt index 8e1af084..ad16462a 100644 --- a/src/external/glfw3/COPYING.txt +++ b/src/external/glfw3/COPYING.txt @@ -1,5 +1,5 @@ Copyright (c) 2002-2006 Marcus Geelnard -Copyright (c) 2006-2010 Camilla Berglund +Copyright (c) 2006-2016 Camilla Berglund This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,4 +18,5 @@ freely, subject to the following restrictions: be misrepresented as being the original software. 3. This notice may not be removed or altered from any source - distribution. \ No newline at end of file + distribution. + diff --git a/src/external/glfw3/include/GLFW/glfw3.h b/src/external/glfw3/include/GLFW/glfw3.h index 89414491..5a0c4508 100644 --- a/src/external/glfw3/include/GLFW/glfw3.h +++ b/src/external/glfw3/include/GLFW/glfw3.h @@ -1,9 +1,9 @@ /************************************************************************* - * GLFW 3.1 - www.glfw.org + * GLFW 3.2 - www.glfw.org * A library for OpenGL, window and input *------------------------------------------------------------------------ * Copyright (c) 2002-2006 Marcus Geelnard - * Copyright (c) 2006-2010 Camilla Berglund + * Copyright (c) 2006-2016 Camilla Berglund * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -38,58 +38,60 @@ extern "C" { * Doxygen documentation *************************************************************************/ -/*! @defgroup context Context handling +/*! @file glfw3.h + * @brief The header of the GLFW 3 API. * - * This is the reference documentation for context related functions. For more - * information, see the @ref context. + * This is the header file of the GLFW 3 API. It defines all its types and + * declares all its functions. + * + * For more information about how to use this file, see @ref build_include. + */ +/*! @defgroup context Context reference + * + * This is the reference documentation for OpenGL and OpenGL ES context related + * functions. For more task-oriented information, see the @ref context_guide. + */ +/*! @defgroup vulkan Vulkan reference + * + * This is the reference documentation for Vulkan related functions and types. + * For more task-oriented information, see the @ref vulkan_guide. */ -/*! @defgroup init Initialization, version and errors +/*! @defgroup init Initialization, version and error reference * * This is the reference documentation for initialization and termination of - * the library, version management and error handling. For more information, - * see the @ref intro. + * the library, version management and error handling. For more task-oriented + * information, see the @ref intro_guide. */ -/*! @defgroup input Input handling +/*! @defgroup input Input reference * * This is the reference documentation for input related functions and types. - * For more information, see the @ref input. + * For more task-oriented information, see the @ref input_guide. */ -/*! @defgroup monitor Monitor handling +/*! @defgroup monitor Monitor reference * * This is the reference documentation for monitor related functions and types. - * For more information, see the @ref monitor. + * For more task-oriented information, see the @ref monitor_guide. */ -/*! @defgroup window Window handling +/*! @defgroup window Window reference * * This is the reference documentation for window related functions and types, - * including creation, deletion and event polling. For more information, see - * the @ref window. + * including creation, deletion and event polling. For more task-oriented + * information, see the @ref window_guide. */ /************************************************************************* - * Global definitions + * Compiler- and platform-specific preprocessor work *************************************************************************/ -/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ - -/* Please report any problems that you find with your compiler, which may - * be solved in this section! There are several compilers that I have not - * been able to test this file with yet. - * - * First: If we are we on Windows, we want a single define for it (_WIN32) - * (Note: For Cygwin the compiler flag -mwin32 should be used, but to - * make sure that things run smoothly for Cygwin users, we add __CYGWIN__ - * to the list of "valid Win32 identifiers", which removes the need for - * -mwin32) +/* If we are we on Windows, we want a single define for it. */ -#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) +#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)) #define _WIN32 #endif /* _WIN32 */ -/* In order for extension support to be portable, we need to define an - * OpenGL function call method. We use the keyword APIENTRY, which is - * defined for Win32. (Note: Windows also needs this for ) +/* It is customary to use APIENTRY for OpenGL function pointer declarations on + * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. */ #ifndef APIENTRY #ifdef _WIN32 @@ -99,51 +101,30 @@ extern "C" { #endif #endif /* APIENTRY */ -/* The following three defines are here solely to make some Windows-based - * files happy. Theoretically we could include , but - * it has the major drawback of severely polluting our namespace. +/* Some Windows OpenGL headers need this. */ - -/* Under Windows, we need WINGDIAPI defined */ #if !defined(WINGDIAPI) && defined(_WIN32) - #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__) - /* Microsoft Visual C++, Borland C++ Builder and Pelles C */ - #define WINGDIAPI __declspec(dllimport) - #elif defined(__LCC__) - /* LCC-Win32 */ - #define WINGDIAPI __stdcall - #else - /* Others (e.g. MinGW, Cygwin) */ - #define WINGDIAPI extern - #endif + #define WINGDIAPI __declspec(dllimport) #define GLFW_WINGDIAPI_DEFINED #endif /* WINGDIAPI */ -/* Some files also need CALLBACK defined */ +/* Some Windows GLU headers need this. + */ #if !defined(CALLBACK) && defined(_WIN32) - #if defined(_MSC_VER) - /* Microsoft Visual C++ */ - #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) - #define CALLBACK __stdcall - #else - #define CALLBACK - #endif - #else - /* Other Windows compilers */ - #define CALLBACK __stdcall - #endif + #define CALLBACK __stdcall #define GLFW_CALLBACK_DEFINED #endif /* CALLBACK */ -/* Most GL/glu.h variants on Windows need wchar_t - * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */ -#if !defined(GLFW_INCLUDE_NONE) - #include -#endif +/* Most Windows GLU headers need wchar_t. + * The OS X OpenGL header blocks the definition of ptrdiff_t by glext.h. + * Include it unconditionally to avoid surprising side-effects. + */ +#include +#include /* Include the chosen client API headers. */ -#if defined(__APPLE_CC__) +#if defined(__APPLE__) #if defined(GLFW_INCLUDE_GLCOREARB) #include #if defined(GLFW_INCLUDE_GLEXT) @@ -174,13 +155,15 @@ extern "C" { #elif defined(GLFW_INCLUDE_ES3) #include #if defined(GLFW_INCLUDE_GLEXT) - #include + #include #endif #elif defined(GLFW_INCLUDE_ES31) #include #if defined(GLFW_INCLUDE_GLEXT) - #include + #include #endif + #elif defined(GLFW_INCLUDE_VULKAN) + #include #elif !defined(GLFW_INCLUDE_NONE) #include #if defined(GLFW_INCLUDE_GLEXT) @@ -208,11 +191,7 @@ extern "C" { #define GLFWAPI __declspec(dllexport) #elif defined(_WIN32) && defined(GLFW_DLL) /* We are calling GLFW as a Win32 DLL */ - #if defined(__LCC__) - #define GLFWAPI extern - #else - #define GLFWAPI __declspec(dllimport) - #endif + #define GLFWAPI __declspec(dllimport) #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) /* We are building GLFW as a shared / dynamic library */ #define GLFWAPI __attribute__((visibility("default"))) @@ -221,8 +200,6 @@ extern "C" { #define GLFWAPI #endif -/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ - /************************************************************************* * GLFW API tokens @@ -242,7 +219,7 @@ extern "C" { * backward-compatible. * @ingroup init */ -#define GLFW_VERSION_MINOR 1 +#define GLFW_VERSION_MINOR 2 /*! @brief The revision number of the GLFW library. * * This is incremented when a bug fix release is made that does not contain any @@ -252,6 +229,24 @@ extern "C" { #define GLFW_VERSION_REVISION 0 /*! @} */ +/*! @name Boolean values + * @{ */ +/*! @brief One. + * + * One. Seriously. You don't _need_ to use this symbol in your code. It's + * just semantic sugar for the number 1. You can use `1` or `true` or `_True` + * or `GL_TRUE` or whatever you want. + */ +#define GLFW_TRUE 1 +/*! @brief Zero. + * + * Zero. Seriously. You don't _need_ to use this symbol in your code. It's + * just just semantic sugar for the number 0. You can use `0` or `false` or + * `_False` or `GL_FALSE` or whatever you want. + */ +#define GLFW_FALSE 0 +/*! @} */ + /*! @name Key and button actions * @{ */ /*! @brief The key or mouse button was released. @@ -426,6 +421,7 @@ extern "C" { #define GLFW_KEY_RIGHT_ALT 346 #define GLFW_KEY_RIGHT_SUPER 347 #define GLFW_KEY_MENU 348 + #define GLFW_KEY_LAST GLFW_KEY_MENU /*! @} */ @@ -505,12 +501,11 @@ extern "C" { * @{ */ /*! @brief GLFW has not been initialized. * - * This occurs if a GLFW function was called that may not be called unless the + * This occurs if a GLFW function was called that must not be called unless the * library is [initialized](@ref intro_init). * - * @par Analysis - * Application programmer error. Initialize GLFW before calling any function - * that requires initialization. + * @analysis Application programmer error. Initialize GLFW before calling any + * function that requires initialization. */ #define GLFW_NOT_INITIALIZED 0x00010001 /*! @brief No context is current for this thread. @@ -519,9 +514,8 @@ extern "C" { * current OpenGL or OpenGL ES context but no context is current on the calling * thread. One such function is @ref glfwSwapInterval. * - * @par Analysis - * Application programmer error. Ensure a context is current before calling - * functions that require a current context. + * @analysis Application programmer error. Ensure a context is current before + * calling functions that require a current context. */ #define GLFW_NO_CURRENT_CONTEXT 0x00010002 /*! @brief One of the arguments to the function was an invalid enum value. @@ -530,8 +524,7 @@ extern "C" { * requesting [GLFW_RED_BITS](@ref window_hints_fb) with @ref * glfwGetWindowAttrib. * - * @par Analysis - * Application programmer error. Fix the offending call. + * @analysis Application programmer error. Fix the offending call. */ #define GLFW_INVALID_ENUM 0x00010003 /*! @brief One of the arguments to the function was an invalid value. @@ -542,46 +535,41 @@ extern "C" { * Requesting a valid but unavailable OpenGL or OpenGL ES version will instead * result in a @ref GLFW_VERSION_UNAVAILABLE error. * - * @par Analysis - * Application programmer error. Fix the offending call. + * @analysis Application programmer error. Fix the offending call. */ #define GLFW_INVALID_VALUE 0x00010004 /*! @brief A memory allocation failed. * * A memory allocation failed. * - * @par Analysis - * A bug in GLFW or the underlying operating system. Report the bug to our - * [issue tracker](https://github.com/glfw/glfw/issues). + * @analysis A bug in GLFW or the underlying operating system. Report the bug + * to our [issue tracker](https://github.com/glfw/glfw/issues). */ #define GLFW_OUT_OF_MEMORY 0x00010005 -/*! @brief GLFW could not find support for the requested client API on the - * system. +/*! @brief GLFW could not find support for the requested API on the system. * - * GLFW could not find support for the requested client API on the system. + * GLFW could not find support for the requested API on the system. * - * @par Analysis - * The installed graphics driver does not support the requested client API, or - * does not support it via the chosen context creation backend. Below are - * a few examples. + * @analysis The installed graphics driver does not support the requested + * API, or does not support it via the chosen context creation backend. + * Below are a few examples. * * @par * Some pre-installed Windows graphics drivers do not support OpenGL. AMD only - * supports OpenGL ES via EGL, while Nvidia and Intel only supports it via + * supports OpenGL ES via EGL, while Nvidia and Intel only support it via * a WGL or GLX extension. OS X does not provide OpenGL ES at all. The Mesa * EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary - * driver. + * driver. Older graphics drivers do not support Vulkan. */ #define GLFW_API_UNAVAILABLE 0x00010006 /*! @brief The requested OpenGL or OpenGL ES version is not available. * - * The requested OpenGL or OpenGL ES version (including any requested profile - * or context option) is not available on this machine. + * The requested OpenGL or OpenGL ES version (including any requested context + * or framebuffer hints) is not available on this machine. * - * @par Analysis - * The machine does not support your requirements. If your application is - * sufficiently flexible, downgrade your requirements and try again. - * Otherwise, inform the user that their machine does not match your + * @analysis The machine does not support your requirements. If your + * application is sufficiently flexible, downgrade your requirements and try + * again. Otherwise, inform the user that their machine does not match your * requirements. * * @par @@ -597,9 +585,9 @@ extern "C" { * A platform-specific error occurred that does not match any of the more * specific categories. * - * @par Analysis - * A bug in GLFW or the underlying operating system. Report the bug to our - * [issue tracker](https://github.com/glfw/glfw/issues). + * @analysis A bug or configuration error in GLFW, the underlying operating + * system or its drivers, or a lack of required resources. Report the issue to + * our [issue tracker](https://github.com/glfw/glfw/issues). */ #define GLFW_PLATFORM_ERROR 0x00010008 /*! @brief The requested format is not supported or available. @@ -610,8 +598,7 @@ extern "C" { * If emitted when querying the clipboard, the contents of the clipboard could * not be converted to the requested format. * - * @par Analysis - * If emitted during window creation, one or more + * @analysis If emitted during window creation, one or more * [hard constraints](@ref window_hints_hard) did not match any of the * available pixel formats. If your application is sufficiently flexible, * downgrade your requirements and try again. Otherwise, inform the user that @@ -622,6 +609,14 @@ extern "C" { * the user, as appropriate. */ #define GLFW_FORMAT_UNAVAILABLE 0x00010009 +/*! @brief The specified window does not have an OpenGL or OpenGL ES context. + * + * A window that does not have an OpenGL or OpenGL ES context was passed to + * a function that requires it to have one. + * + * @analysis Application programmer error. Fix the offending call. + */ +#define GLFW_NO_WINDOW_CONTEXT 0x0001000A /*! @} */ #define GLFW_FOCUSED 0x00020001 @@ -631,6 +626,7 @@ extern "C" { #define GLFW_DECORATED 0x00020005 #define GLFW_AUTO_ICONIFY 0x00020006 #define GLFW_FLOATING 0x00020007 +#define GLFW_MAXIMIZED 0x00020008 #define GLFW_RED_BITS 0x00021001 #define GLFW_GREEN_BITS 0x00021002 @@ -658,7 +654,10 @@ extern "C" { #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 #define GLFW_OPENGL_PROFILE 0x00022008 #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 +#define GLFW_CONTEXT_NO_ERROR 0x0002200A +#define GLFW_CONTEXT_CREATION_API 0x0002200B +#define GLFW_NO_API 0 #define GLFW_OPENGL_API 0x00030001 #define GLFW_OPENGL_ES_API 0x00030002 @@ -682,6 +681,9 @@ extern "C" { #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 #define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 +#define GLFW_NATIVE_CONTEXT_API 0x00036001 +#define GLFW_EGL_CONTEXT_API 0x00036002 + /*! @defgroup shapes Standard cursor shapes * * See [standard cursor creation](@ref cursor_standard) for how these are used. @@ -736,14 +738,37 @@ extern "C" { * Generic function pointer used for returning client API function pointers * without forcing a cast from a regular pointer. * + * @sa @ref context_glext + * @sa glfwGetProcAddress + * + * @since Added in version 3.0. + * @ingroup context */ typedef void (*GLFWglproc)(void); +/*! @brief Vulkan API function pointer type. + * + * Generic function pointer used for returning Vulkan API function pointers + * without forcing a cast from a regular pointer. + * + * @sa @ref vulkan_proc + * @sa glfwGetInstanceProcAddress + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +typedef void (*GLFWvkproc)(void); + /*! @brief Opaque monitor object. * * Opaque monitor object. * + * @see @ref monitor_object + * + * @since Added in version 3.0. + * * @ingroup monitor */ typedef struct GLFWmonitor GLFWmonitor; @@ -752,6 +777,10 @@ typedef struct GLFWmonitor GLFWmonitor; * * Opaque window object. * + * @see @ref window_object + * + * @since Added in version 3.0. + * * @ingroup window */ typedef struct GLFWwindow GLFWwindow; @@ -760,6 +789,10 @@ typedef struct GLFWwindow GLFWwindow; * * Opaque cursor object. * + * @see @ref cursor_object + * + * @since Added in version 3.1. + * * @ingroup cursor */ typedef struct GLFWcursor GLFWcursor; @@ -771,8 +804,11 @@ typedef struct GLFWcursor GLFWcursor; * @param[in] error An [error code](@ref errors). * @param[in] description A UTF-8 encoded string describing the error. * + * @sa @ref error_handling * @sa glfwSetErrorCallback * + * @since Added in version 3.0. + * * @ingroup init */ typedef void (* GLFWerrorfun)(int,const char*); @@ -787,8 +823,11 @@ typedef void (* GLFWerrorfun)(int,const char*); * @param[in] ypos The new y-coordinate, in screen coordinates, of the * upper-left corner of the client area of the window. * + * @sa @ref window_pos * @sa glfwSetWindowPosCallback * + * @since Added in version 3.0. + * * @ingroup window */ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); @@ -801,8 +840,12 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); * @param[in] width The new width, in screen coordinates, of the window. * @param[in] height The new height, in screen coordinates, of the window. * + * @sa @ref window_size * @sa glfwSetWindowSizeCallback * + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. + * * @ingroup window */ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); @@ -813,8 +856,12 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); * * @param[in] window The window that the user attempted to close. * + * @sa @ref window_close * @sa glfwSetWindowCloseCallback * + * @since Added in version 2.5. + * @glfw3 Added window handle parameter. + * * @ingroup window */ typedef void (* GLFWwindowclosefun)(GLFWwindow*); @@ -825,8 +872,12 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*); * * @param[in] window The window whose content needs to be refreshed. * + * @sa @ref window_refresh * @sa glfwSetWindowRefreshCallback * + * @since Added in version 2.5. + * @glfw3 Added window handle parameter. + * * @ingroup window */ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); @@ -836,11 +887,14 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); * This is the function signature for window focus callback functions. * * @param[in] window The window that gained or lost input focus. - * @param[in] focused `GL_TRUE` if the window was given input focus, or - * `GL_FALSE` if it lost it. + * @param[in] focused `GLFW_TRUE` if the window was given input focus, or + * `GLFW_FALSE` if it lost it. * + * @sa @ref window_focus * @sa glfwSetWindowFocusCallback * + * @since Added in version 3.0. + * * @ingroup window */ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); @@ -851,11 +905,14 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); * functions. * * @param[in] window The window that was iconified or restored. - * @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE` - * if it was restored. + * @param[in] iconified `GLFW_TRUE` if the window was iconified, or + * `GLFW_FALSE` if it was restored. * + * @sa @ref window_iconify * @sa glfwSetWindowIconifyCallback * + * @since Added in version 3.0. + * * @ingroup window */ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); @@ -869,8 +926,11 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); * @param[in] width The new width, in pixels, of the framebuffer. * @param[in] height The new height, in pixels, of the framebuffer. * + * @sa @ref window_fbsize * @sa glfwSetFramebufferSizeCallback * + * @since Added in version 3.0. + * * @ingroup window */ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); @@ -886,8 +946,12 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * + * @sa @ref input_mouse_button * @sa glfwSetMouseButtonCallback * + * @since Added in version 1.0. + * @glfw3 Added window handle and modifier mask parameters. + * * @ingroup input */ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); @@ -897,11 +961,16 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); * This is the function signature for cursor position callback functions. * * @param[in] window The window that received the event. - * @param[in] xpos The new x-coordinate, in screen coordinates, of the cursor. - * @param[in] ypos The new y-coordinate, in screen coordinates, of the cursor. + * @param[in] xpos The new cursor x-coordinate, relative to the left edge of + * the client area. + * @param[in] ypos The new cursor y-coordinate, relative to the top edge of the + * client area. * + * @sa @ref cursor_pos * @sa glfwSetCursorPosCallback * + * @since Added in version 3.0. Replaces `GLFWmouseposfun`. + * * @ingroup input */ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); @@ -911,11 +980,14 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); * This is the function signature for cursor enter/leave callback functions. * * @param[in] window The window that received the event. - * @param[in] entered `GL_TRUE` if the cursor entered the window's client - * area, or `GL_FALSE` if it left it. + * @param[in] entered `GLFW_TRUE` if the cursor entered the window's client + * area, or `GLFW_FALSE` if it left it. * + * @sa @ref cursor_enter * @sa glfwSetCursorEnterCallback * + * @since Added in version 3.0. + * * @ingroup input */ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); @@ -928,8 +1000,11 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); * @param[in] xoffset The scroll offset along the x-axis. * @param[in] yoffset The scroll offset along the y-axis. * + * @sa @ref scrolling * @sa glfwSetScrollCallback * + * @since Added in version 3.0. Replaces `GLFWmousewheelfun`. + * * @ingroup input */ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); @@ -945,8 +1020,12 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * + * @sa @ref input_key * @sa glfwSetKeyCallback * + * @since Added in version 1.0. + * @glfw3 Added window handle, scancode and modifier mask parameters. + * * @ingroup input */ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); @@ -958,8 +1037,12 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. * + * @sa @ref input_char * @sa glfwSetCharCallback * + * @since Added in version 2.4. + * @glfw3 Added window handle parameter. + * * @ingroup input */ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); @@ -976,8 +1059,11 @@ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * + * @sa @ref input_char * @sa glfwSetCharModsCallback * + * @since Added in version 3.1. + * * @ingroup input */ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); @@ -988,10 +1074,13 @@ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); * * @param[in] window The window that received the event. * @param[in] count The number of dropped files. - * @param[in] names The UTF-8 encoded path names of the dropped files. + * @param[in] paths The UTF-8 encoded file and/or directory path names. * + * @sa @ref path_drop * @sa glfwSetDropCallback * + * @since Added in version 3.1. + * * @ingroup input */ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); @@ -1003,16 +1092,42 @@ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); * @param[in] monitor The monitor that was connected or disconnected. * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. * + * @sa @ref monitor_event * @sa glfwSetMonitorCallback * + * @since Added in version 3.0. + * * @ingroup monitor */ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); +/*! @brief The function signature for joystick configuration callbacks. + * + * This is the function signature for joystick configuration callback + * functions. + * + * @param[in] joy The joystick that was connected or disconnected. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. + * + * @sa @ref joystick_event + * @sa glfwSetJoystickCallback + * + * @since Added in version 3.2. + * + * @ingroup input + */ +typedef void (* GLFWjoystickfun)(int,int); + /*! @brief Video mode type. * * This describes a single video mode. * + * @sa @ref monitor_modes + * @sa glfwGetVideoMode glfwGetVideoModes + * + * @since Added in version 1.0. + * @glfw3 Added refresh rate member. + * * @ingroup monitor */ typedef struct GLFWvidmode @@ -1041,8 +1156,11 @@ typedef struct GLFWvidmode * * This describes the gamma ramp for a monitor. * + * @sa @ref monitor_gamma * @sa glfwGetGammaRamp glfwSetGammaRamp * + * @since Added in version 3.0. + * * @ingroup monitor */ typedef struct GLFWgammaramp @@ -1062,6 +1180,11 @@ typedef struct GLFWgammaramp } GLFWgammaramp; /*! @brief Image data. + * + * @sa @ref cursor_custom + * + * @since Added in version 2.1. + * @glfw3 Removed format and bytes-per-pixel members. */ typedef struct GLFWimage { @@ -1092,29 +1215,24 @@ typedef struct GLFWimage * succeeds, you should call @ref glfwTerminate before the application exits. * * Additional calls to this function after successful initialization but before - * termination will return `GL_TRUE` immediately. + * termination will return `GLFW_TRUE` immediately. * - * @return `GL_TRUE` if successful, or `GL_FALSE` if an + * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an * [error](@ref error_handling) occurred. * - * @remarks __OS X:__ This function will change the current directory of the + * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. + * + * @remark @osx This function will change the current directory of the * application to the `Contents/Resources` subdirectory of the application's * bundle, if present. This can be disabled with a * [compile-time option](@ref compile_options_osx). * - * @remarks __X11:__ If the `LC_CTYPE` category of the current locale is set to - * `"C"` then the environment's locale will be applied to that category. This - * is done because character input will not function when `LC_CTYPE` is set to - * `"C"`. If another locale was set before this function was called, it will - * be left untouched. - * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref intro_init * @sa glfwTerminate * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup init */ @@ -1132,21 +1250,21 @@ GLFWAPI int glfwInit(void); * call this function, as it is called by @ref glfwInit before it returns * failure. * - * @remarks This function may be called before @ref glfwInit. + * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. * - * @warning No window's context may be current on another thread when this - * function is called. + * @remark This function may be called before @ref glfwInit. * - * @par Reentrancy - * This function may not be called from a callback. + * @warning The contexts of any remaining windows must not be current on any + * other thread when this function is called. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref intro_init * @sa glfwInit * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup init */ @@ -1158,22 +1276,22 @@ GLFWAPI void glfwTerminate(void); * library. It is intended for when you are using GLFW as a shared library and * want to ensure that you are using the minimum required version. * - * Any or all of the version arguments may be `NULL`. This function always - * succeeds. + * Any or all of the version arguments may be `NULL`. * * @param[out] major Where to store the major version number, or `NULL`. * @param[out] minor Where to store the minor version number, or `NULL`. * @param[out] rev Where to store the revision number, or `NULL`. * - * @remarks This function may be called before @ref glfwInit. + * @errors None. * - * @par Thread Safety - * This function may be called from any thread. + * @remark This function may be called before @ref glfwInit. + * + * @thread_safety This function may be called from any thread. * * @sa @ref intro_version * @sa glfwGetVersionString * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup init */ @@ -1184,28 +1302,27 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); * This function returns the compile-time generated * [version string](@ref intro_version_string) of the GLFW library binary. It * describes the version, platform, compiler and any platform-specific - * compile-time options. + * compile-time options. It should not be confused with the OpenGL or OpenGL + * ES version string, queried with `glGetString`. * * __Do not use the version string__ to parse the GLFW library version. The - * @ref glfwGetVersion function already provides the version of the running - * library binary. + * @ref glfwGetVersion function provides the version of the running library + * binary in numerical format. * - * This function always succeeds. + * @return The ASCII encoded GLFW version string. * - * @return The GLFW version string. + * @errors None. * - * @remarks This function may be called before @ref glfwInit. + * @remark This function may be called before @ref glfwInit. * - * @par Pointer Lifetime - * The returned string is static and compile-time generated. + * @pointer_lifetime The returned string is static and compile-time generated. * - * @par Thread Safety - * This function may be called from any thread. + * @thread_safety This function may be called from any thread. * * @sa @ref intro_version * @sa glfwGetVersion * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup init */ @@ -1231,14 +1348,15 @@ GLFWAPI const char* glfwGetVersionString(void); * callback. * @return The previously set callback, or `NULL` if no callback was set. * - * @remarks This function may be called before @ref glfwInit. + * @errors None. * - * @par Thread Safety - * This function may only be called from the main thread. + * @remark This function may be called before @ref glfwInit. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref error_handling * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup init */ @@ -1247,26 +1365,27 @@ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); /*! @brief Returns the currently connected monitors. * * This function returns an array of handles for all currently connected - * monitors. + * monitors. The primary monitor is always first in the returned array. If no + * monitors were found, this function returns `NULL`. * * @param[out] count Where to store the number of monitors in the returned * array. This is set to zero if an error occurred. - * @return An array of monitor handles, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return An array of monitor handles, or `NULL` if no monitors were found or + * if an [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is guaranteed to be valid only until the monitor configuration - * changes or the library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is guaranteed to be valid only until the + * monitor configuration changes or the library is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_monitors * @sa @ref monitor_event * @sa glfwGetPrimaryMonitor * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1275,18 +1394,22 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); /*! @brief Returns the primary monitor. * * This function returns the primary monitor. This is usually the monitor - * where elements like the Windows task bar or the OS X menu bar is located. + * where elements like the task bar or global menu bar are located. * - * @return The primary monitor, or `NULL` if an [error](@ref error_handling) - * occurred. + * @return The primary monitor, or `NULL` if no monitors were found or if an + * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. + * + * @remark The primary monitor is always first in the array returned by @ref + * glfwGetMonitors. * * @sa @ref monitor_monitors * @sa glfwGetMonitors * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1304,12 +1427,14 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_properties * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1334,15 +1459,16 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); * @param[out] heightMM Where to store the height, in millimetres, of the * monitor's display area, or `NULL`. * - * @remarks __Windows:__ The OS calculates the returned physical size from the + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @remark @win32 calculates the returned physical size from the * current resolution and system DPI instead of querying the monitor EDID data. * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_properties * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1358,17 +1484,17 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* * @return The UTF-8 encoded name of the monitor, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified monitor is disconnected or the - * library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned string is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified monitor is + * disconnected or the library is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_properties * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1385,15 +1511,13 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @bug __X11:__ This callback is not yet called on monitor configuration - * changes. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_event * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1412,21 +1536,21 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); * @return An array of video modes, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified monitor is disconnected, this - * function is called again for that monitor or the library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified monitor is + * disconnected, this function is called again for that monitor or the library + * is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_modes * @sa glfwGetVideoMode * - * @since Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Changed to return an array of modes for a specific monitor. + * @since Added in version 1.0. + * @glfw3 Changed to return an array of modes for a specific monitor. * * @ingroup monitor */ @@ -1442,18 +1566,19 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); * @return The current mode of the monitor, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified monitor is disconnected or the - * library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified monitor is + * disconnected or the library is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_modes * @sa glfwGetVideoModes * - * @since Added in GLFW 3.0. Replaces `glfwGetDesktopMode`. + * @since Added in version 3.0. Replaces `glfwGetDesktopMode`. * * @ingroup monitor */ @@ -1462,17 +1587,20 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); /*! @brief Generates a gamma ramp and sets it for the specified monitor. * * This function generates a 256-element gamma ramp from the specified exponent - * and then calls @ref glfwSetGammaRamp with it. + * and then calls @ref glfwSetGammaRamp with it. The value must be a finite + * number greater than zero. * * @param[in] monitor The monitor whose gamma ramp to set. * @param[in] gamma The desired exponent. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_gamma * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1486,18 +1614,19 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); * @return The current gamma ramp, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned structure and its arrays are allocated and freed by GLFW. You - * should not free them yourself. They are valid until the specified monitor - * is disconnected, this function is called again for that monitor or the - * library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned structure and its arrays are allocated and + * freed by GLFW. You should not free them yourself. They are valid until the + * specified monitor is disconnected, this function is called again for that + * monitor or the library is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_gamma * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1512,17 +1641,22 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); * @param[in] monitor The monitor whose gamma ramp to set. * @param[in] ramp The gamma ramp to use. * - * @note Gamma ramp sizes other than 256 are not supported by all hardware. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Pointer Lifetime - * The specified gamma ramp is copied before this function returns. + * @remark Gamma ramp sizes other than 256 are not supported by all platforms + * or graphics hardware. * - * @par Thread Safety - * This function may only be called from the main thread. + * @remark @win32 The gamma ramp size must be 256. + * + * @pointer_lifetime The specified gamma ramp is copied before this function + * returns. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref monitor_gamma * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup monitor */ @@ -1533,13 +1667,14 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); * This function resets all window hints to their * [default values](@ref window_hints_values). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_hints * @sa glfwWindowHint * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -1552,20 +1687,26 @@ GLFWAPI void glfwDefaultWindowHints(void); * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is * terminated. * - * @param[in] target The [window hint](@ref window_hints) to set. - * @param[in] hint The new value of the window hint. + * This function does not check whether the specified hint values are valid. + * If you set hints to invalid values this will instead be reported by the next + * call to @ref glfwCreateWindow. * - * @par Thread Safety - * This function may only be called from the main thread. + * @param[in] hint The [window hint](@ref window_hints) to set. + * @param[in] value The new value of the window hint. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_INVALID_ENUM. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_hints * @sa glfwDefaultWindowHints * - * @since Added in GLFW 3.0. Replaces `glfwOpenWindowHint`. + * @since Added in version 3.0. Replaces `glfwOpenWindowHint`. * * @ingroup window */ -GLFWAPI void glfwWindowHint(int target, int hint); +GLFWAPI void glfwWindowHint(int hint, int value); /*! @brief Creates a window and its associated context. * @@ -1582,21 +1723,21 @@ GLFWAPI void glfwWindowHint(int target, int hint); * requested, as not all parameters and hints are * [hard constraints](@ref window_hints_hard). This includes the size of the * window, especially for full screen windows. To query the actual attributes - * of the created window, framebuffer and context, use queries like @ref - * glfwGetWindowAttrib and @ref glfwGetWindowSize. + * of the created window, framebuffer and context, see @ref + * glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize. * * To create a full screen window, you need to specify the monitor the window - * will cover. If no monitor is specified, windowed mode will be used. Unless - * you have a way for the user to choose a specific monitor, it is recommended - * that you pick the primary monitor. For more information on how to query - * connected monitors, see @ref monitor_monitors. + * will cover. If no monitor is specified, the window will be windowed mode. + * Unless you have a way for the user to choose a specific monitor, it is + * recommended that you pick the primary monitor. For more information on how + * to query connected monitors, see @ref monitor_monitors. * * For full screen windows, the specified size becomes the resolution of the - * window's _desired video mode_. As long as a full screen window has input - * focus, the supported video mode most closely matching the desired video mode - * is set for the specified monitor. For more information about full screen - * windows, including the creation of so called _windowed full screen_ or - * _borderless full screen_ windows, see @ref window_windowed_full_screen. + * window's _desired video mode_. As long as a full screen window is not + * iconified, the supported video mode most closely matching the desired video + * mode is set for the specified monitor. For more information about full + * screen windows, including the creation of so called _windowed full screen_ + * or _borderless full screen_ windows, see @ref window_windowed_full_screen. * * By default, newly created windows use the placement recommended by the * window system. To create the window at a specific position, make it @@ -1604,8 +1745,8 @@ GLFWAPI void glfwWindowHint(int target, int hint); * hint, set its [position](@ref window_pos) and then [show](@ref window_hide) * it. * - * If a full screen window has input focus, the screensaver is prohibited from - * starting. + * As long as at least one full screen window is not iconified, the screensaver + * is prohibited from starting. * * Window systems put limits on window sizes. Very large or very small window * dimensions may be overridden by the window system on creation. Check the @@ -1619,50 +1760,66 @@ GLFWAPI void glfwWindowHint(int target, int hint); * @param[in] height The desired height, in screen coordinates, of the window. * This must be greater than zero. * @param[in] title The initial, UTF-8 encoded window title. - * @param[in] monitor The monitor to use for full screen mode, or `NULL` to use + * @param[in] monitor The monitor to use for full screen mode, or `NULL` for * windowed mode. * @param[in] share The window whose context to share resources with, or `NULL` * to not share resources. * @return The handle of the created window, or `NULL` if an * [error](@ref error_handling) occurred. * - * @remarks __Windows:__ Window creation will fail if the Microsoft GDI - * software OpenGL implementation is the only one available. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref + * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref + * GLFW_PLATFORM_ERROR. * - * @remarks __Windows:__ If the executable has an icon resource named - * `GLFW_ICON,` it will be set as the icon for the window. If no such icon is - * present, the `IDI_WINLOGO` icon will be used instead. + * @remark @win32 Window creation will fail if the Microsoft GDI software + * OpenGL implementation is the only one available. * - * @remarks __Windows:__ The context to share resources with may not be current - * on any other thread. + * @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it + * will be set as the initial icon for the window. If no such icon is present, + * the `IDI_WINLOGO` icon will be used instead. To set a different icon, see + * @ref glfwSetWindowIcon. * - * @remarks __OS X:__ The GLFW window has no icon, as it is not a document + * @remark @win32 The context to share resources with must not be current on + * any other thread. + * + * @remark @osx The GLFW window has no icon, as it is not a document * window, but the dock icon will be the same as the application bundle's icon. * For more information on bundles, see the * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) * in the Mac Developer Library. * - * @remarks __OS X:__ The first time a window is created the menu bar is - * populated with common commands like Hide, Quit and About. The About entry - * opens a minimal about dialog with information from the application's bundle. - * The menu bar can be disabled with a + * @remark @osx The first time a window is created the menu bar is populated + * with common commands like Hide, Quit and About. The About entry opens + * a minimal about dialog with information from the application's bundle. The + * menu bar can be disabled with a * [compile-time option](@ref compile_options_osx). * - * @remarks __X11:__ There is no mechanism for setting the window icon yet. + * @remark @osx On OS X 10.10 and later the window frame will not be rendered + * at full resolution on Retina displays unless the `NSHighResolutionCapable` + * key is enabled in the application bundle's `Info.plist`. For more + * information, see + * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) + * in the Mac Developer Library. The GLFW test and example programs use + * a custom `Info.plist` template for this, which can be found as + * `CMake/MacOSXBundleInfo.plist.in` in the source tree. * - * @remarks __X11:__ Some window managers will not respect the placement of + * @remark @x11 Some window managers will not respect the placement of * initially hidden windows. * - * @par Reentrancy - * This function may not be called from a callback. + * @remark @x11 Due to the asynchronous nature of X11, it may take a moment for + * a window to reach its requested state. This means you may not be able to + * query the final size, position or other attributes directly after window + * creation. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_creation * @sa glfwDestroyWindow * - * @since Added in GLFW 3.0. Replaces `glfwOpenWindow`. + * @since Added in version 3.0. Replaces `glfwOpenWindow`. * * @ingroup window */ @@ -1678,19 +1835,20 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, G * * @param[in] window The window to destroy. * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * * @note The context of the specified window must not be current on any other * thread when this function is called. * - * @par Reentrancy - * This function may not be called from a callback. + * @reentrancy This function must not be called from a callback. * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_creation * @sa glfwCreateWindow * - * @since Added in GLFW 3.0. Replaces `glfwCloseWindow`. + * @since Added in version 3.0. Replaces `glfwCloseWindow`. * * @ingroup window */ @@ -1703,12 +1861,14 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* window); * @param[in] window The window to query. * @return The value of the close flag. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * * @sa @ref window_close * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -1723,12 +1883,14 @@ GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); * @param[in] window The window whose flag to change. * @param[in] value The new value. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * * @sa @ref window_close * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -1742,20 +1904,62 @@ GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); * @param[in] window The window whose title to change. * @param[in] title The UTF-8 encoded window title. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @sa @ref window_title + * @remark @osx The window title will not be updated until the next time you + * process events. * - * @since Added in GLFW 1.0. + * @thread_safety This function must only be called from the main thread. * - * @par - * __GLFW 3:__ Added window handle parameter. + * @sa @ref window_title + * + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup window */ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); +/*! @brief Sets the icon for the specified window. + * + * This function sets the icon of the specified window. If passed an array of + * candidate images, those of or closest to the sizes desired by the system are + * selected. If no images are specified, the window reverts to its default + * icon. + * + * The desired image sizes varies depending on platform and system settings. + * The selected images will be rescaled as needed. Good sizes include 16x16, + * 32x32 and 48x48. + * + * @param[in] window The window whose icon to set. + * @param[in] count The number of images in the specified array, or zero to + * revert to the default window icon. + * @param[in] images The images to create the icon from. This is ignored if + * count is zero. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @pointer_lifetime The specified image data is copied before this function + * returns. + * + * @remark @osx The GLFW window has no icon, as it is not a document + * window, so this function does nothing. The dock icon will be the same as + * the application bundle's icon. For more information on bundles, see the + * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) + * in the Mac Developer Library. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_icon + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images); + /*! @brief Retrieves the position of the client area of the specified window. * * This function retrieves the position, in screen coordinates, of the @@ -1770,13 +1974,15 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); * @param[out] ypos Where to store the y-coordinate of the upper-left corner of * the client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_pos * @sa glfwSetWindowPos * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -1798,16 +2004,16 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); * @param[in] xpos The x-coordinate of the upper-left corner of the client area. * @param[in] ypos The y-coordinate of the upper-left corner of the client area. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_pos * @sa glfwGetWindowPos * - * @since Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup window */ @@ -1828,48 +2034,134 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); * @param[out] height Where to store the height, in screen coordinates, of the * client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_size * @sa glfwSetWindowSize * - * @since Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup window */ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); +/*! @brief Sets the size limits of the specified window. + * + * This function sets the size limits of the client area of the specified + * window. If the window is full screen, the size limits only take effect + * once it is made windowed. If the window is not resizable, this function + * does nothing. + * + * The size limits are applied immediately to a windowed mode window and may + * cause it to be resized. + * + * The maximum dimensions must be greater than or equal to the minimum + * dimensions and all must be greater than or equal to zero. + * + * @param[in] window The window to set limits for. + * @param[in] minwidth The minimum width, in screen coordinates, of the client + * area, or `GLFW_DONT_CARE`. + * @param[in] minheight The minimum height, in screen coordinates, of the + * client area, or `GLFW_DONT_CARE`. + * @param[in] maxwidth The maximum width, in screen coordinates, of the client + * area, or `GLFW_DONT_CARE`. + * @param[in] maxheight The maximum height, in screen coordinates, of the + * client area, or `GLFW_DONT_CARE`. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. + * + * @remark If you set size limits and an aspect ratio that conflict, the + * results are undefined. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_sizelimits + * @sa glfwSetWindowAspectRatio + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); + +/*! @brief Sets the aspect ratio of the specified window. + * + * This function sets the required aspect ratio of the client area of the + * specified window. If the window is full screen, the aspect ratio only takes + * effect once it is made windowed. If the window is not resizable, this + * function does nothing. + * + * The aspect ratio is specified as a numerator and a denominator and both + * values must be greater than zero. For example, the common 16:9 aspect ratio + * is specified as 16 and 9, respectively. + * + * If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect + * ratio limit is disabled. + * + * The aspect ratio is applied immediately to a windowed mode window and may + * cause it to be resized. + * + * @param[in] window The window to set limits for. + * @param[in] numer The numerator of the desired aspect ratio, or + * `GLFW_DONT_CARE`. + * @param[in] denom The denominator of the desired aspect ratio, or + * `GLFW_DONT_CARE`. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. + * + * @remark If you set size limits and an aspect ratio that conflict, the + * results are undefined. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_sizelimits + * @sa glfwSetWindowSizeLimits + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom); + /*! @brief Sets the size of the client area of the specified window. * * This function sets the size, in screen coordinates, of the client area of * the specified window. * - * For full screen windows, this function selects and switches to the resolution - * closest to the specified size, without affecting the window's context. As - * the context is unaffected, the bit depths of the framebuffer remain - * unchanged. + * For full screen windows, this function updates the resolution of its desired + * video mode and switches to the video mode closest to it, without affecting + * the window's context. As the context is unaffected, the bit depths of the + * framebuffer remain unchanged. + * + * If you wish to update the refresh rate of the desired video mode in addition + * to its resolution, see @ref glfwSetWindowMonitor. * * The window manager may put limits on what sizes are allowed. GLFW cannot * and should not override these limits. * * @param[in] window The window to resize. - * @param[in] width The desired width of the specified window. - * @param[in] height The desired height of the specified window. + * @param[in] width The desired width, in screen coordinates, of the window + * client area. + * @param[in] height The desired height, in screen coordinates, of the window + * client area. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_size * @sa glfwGetWindowSize + * @sa glfwSetWindowMonitor * - * @since Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup window */ @@ -1890,13 +2182,15 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); * @param[out] height Where to store the height, in pixels, of the framebuffer, * or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_fbsize * @sa glfwSetFramebufferSizeCallback * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -1926,12 +2220,14 @@ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height) * @param[out] bottom Where to store the size, in screen coordinates, of the * bottom edge of the window frame, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_size * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup window */ @@ -1948,16 +2244,17 @@ GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int * * @param[in] window The window to iconify. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_iconify * @sa glfwRestoreWindow + * @sa glfwMaximizeWindow * - * @since Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 2.1. + * @glfw3 Added window handle parameter. * * @ingroup window */ @@ -1966,27 +2263,54 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow* window); /*! @brief Restores the specified window. * * This function restores the specified window if it was previously iconified - * (minimized). If the window is already restored, this function does nothing. + * (minimized) or maximized. If the window is already restored, this function + * does nothing. * * If the specified window is a full screen window, the resolution chosen for * the window is restored on the selected monitor. * * @param[in] window The window to restore. * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_iconify + * @sa glfwIconifyWindow + * @sa glfwMaximizeWindow + * + * @since Added in version 2.1. + * @glfw3 Added window handle parameter. + * + * @ingroup window + */ +GLFWAPI void glfwRestoreWindow(GLFWwindow* window); + +/*! @brief Maximizes the specified window. + * + * This function maximizes the specified window if it was previously not + * maximized. If the window is already maximized, this function does nothing. + * + * If the specified window is a full screen window, this function does nothing. + * + * @param[in] window The window to maximize. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * * @par Thread Safety * This function may only be called from the main thread. * * @sa @ref window_iconify * @sa glfwIconifyWindow + * @sa glfwRestoreWindow * - * @since Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in GLFW 3.2. * * @ingroup window */ -GLFWAPI void glfwRestoreWindow(GLFWwindow* window); +GLFWAPI void glfwMaximizeWindow(GLFWwindow* window); /*! @brief Makes the specified window visible. * @@ -1996,13 +2320,15 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow* window); * * @param[in] window The window to make visible. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_hide * @sa glfwHideWindow * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2016,18 +2342,48 @@ GLFWAPI void glfwShowWindow(GLFWwindow* window); * * @param[in] window The window to hide. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_hide * @sa glfwShowWindow * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ GLFWAPI void glfwHideWindow(GLFWwindow* window); +/*! @brief Brings the specified window to front and sets input focus. + * + * This function brings the specified window to front and sets input focus. + * The window should already be visible and not iconified. + * + * By default, both windowed and full screen mode windows are focused when + * initially created. Set the [GLFW_FOCUSED](@ref window_hints_wnd) to disable + * this behavior. + * + * __Do not use this function__ to steal focus from other applications unless + * you are certain that is what the user wants. Focus stealing can be + * extremely disruptive. + * + * @param[in] window The window to give input focus. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_focus + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwFocusWindow(GLFWwindow* window); + /*! @brief Returns the monitor that the window uses for full screen mode. * * This function returns the handle of the monitor that the specified window is @@ -2037,17 +2393,68 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window); * @return The monitor, or `NULL` if the window is in windowed mode or an error * occurred. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_monitor + * @sa glfwSetWindowMonitor * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); +/*! @brief Sets the mode, monitor, video mode and placement of a window. + * + * This function sets the monitor that the window uses for full screen mode or, + * if the monitor is `NULL`, makes it windowed mode. + * + * When setting a monitor, this function updates the width, height and refresh + * rate of the desired video mode and switches to the video mode closest to it. + * The window position is ignored when setting a monitor. + * + * When the monitor is `NULL`, the position, width and height are used to + * place the window client area. The refresh rate is ignored when no monitor + * is specified. + * + * If you only wish to update the resolution of a full screen window or the + * size of a windowed mode window, see @ref glfwSetWindowSize. + * + * When a window transitions from full screen to windowed mode, this function + * restores any previous window settings such as whether it is decorated, + * floating, resizable, has size or aspect ratio limits, etc.. + * + * @param[in] window The window whose monitor, size or video mode to set. + * @param[in] monitor The desired monitor, or `NULL` to set windowed mode. + * @param[in] xpos The desired x-coordinate of the upper-left corner of the + * client area. + * @param[in] ypos The desired y-coordinate of the upper-left corner of the + * client area. + * @param[in] width The desired with, in screen coordinates, of the client area + * or video mode. + * @param[in] height The desired height, in screen coordinates, of the client + * area or video mode. + * @param[in] refreshRate The desired refresh rate, in Hz, of the video mode, + * or `GLFW_DONT_CARE`. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref window_monitor + * @sa @ref window_full_screen + * @sa glfwGetWindowMonitor + * @sa glfwSetWindowSize + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); + /*! @brief Returns an attribute of the specified window. * * This function returns the value of an attribute of the specified window or @@ -2059,12 +2466,22 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); * @return The value of the attribute, or zero if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. + * + * @remark Framebuffer related hints are not window attributes. See @ref + * window_attribs_fb for more information. + * + * @remark Zero is a valid value for many window and context related + * attributes so you cannot use a return value of zero as an indication of + * errors. However, this function should not fail as long as it is passed + * valid arguments and the library has been [initialized](@ref intro_init). + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_attribs * - * @since Added in GLFW 3.0. Replaces `glfwGetWindowParam` and + * @since Added in version 3.0. Replaces `glfwGetWindowParam` and * `glfwGetGLVersion`. * * @ingroup window @@ -2080,13 +2497,15 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * @param[in] window The window whose pointer to set. * @param[in] pointer The new value. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * * @sa @ref window_userptr * @sa glfwGetWindowUserPointer * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2099,13 +2518,15 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); * * @param[in] window The window whose pointer to return. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * * @sa @ref window_userptr * @sa glfwSetWindowUserPointer * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2123,12 +2544,13 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_pos * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2146,15 +2568,14 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @sa @ref window_size + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 1.0. + * @sa @ref window_size * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter and return value. * * @ingroup window */ @@ -2177,18 +2598,17 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @remarks __OS X:__ Selecting Quit from the application menu will - * trigger the close callback for all windows. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @par Thread Safety - * This function may only be called from the main thread. + * @remark @osx Selecting Quit from the application menu will trigger the close + * callback for all windows. * - * @sa @ref window_close + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 2.5. + * @sa @ref window_close * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 2.5. + * @glfw3 Added window handle parameter and return value. * * @ingroup window */ @@ -2210,15 +2630,14 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_refresh * - * @since Added in GLFW 2.5. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 2.5. + * @glfw3 Added window handle parameter and return value. * * @ingroup window */ @@ -2240,12 +2659,13 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_focus * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2262,12 +2682,13 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_iconify * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2284,12 +2705,13 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref window_fbsize * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup window */ @@ -2313,16 +2735,18 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * * Event processing is not required for joystick input to work. * - * @par Reentrancy - * This function may not be called from a callback. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref events * @sa glfwWaitEvents + * @sa glfwWaitEventsTimeout * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup window */ @@ -2356,21 +2780,69 @@ GLFWAPI void glfwPollEvents(void); * * Event processing is not required for joystick input to work. * - * @par Reentrancy - * This function may not be called from a callback. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref events * @sa glfwPollEvents + * @sa glfwWaitEventsTimeout * - * @since Added in GLFW 2.5. + * @since Added in version 2.5. * * @ingroup window */ GLFWAPI void glfwWaitEvents(void); +/*! @brief Waits with timeout until events are queued and processes them. + * + * This function puts the calling thread to sleep until at least one event is + * available in the event queue, or until the specified timeout is reached. If + * one or more events are available, it behaves exactly like @ref + * glfwPollEvents, i.e. the events in the queue are processed and the function + * then returns immediately. Processing events will cause the window and input + * callbacks associated with those events to be called. + * + * The timeout value must be a positive finite number. + * + * Since not all events are associated with callbacks, this function may return + * without a callback having been called even if you are monitoring all + * callbacks. + * + * On some platforms, a window move, resize or menu operation will cause event + * processing to block. This is due to how event processing is designed on + * those platforms. You can use the + * [window refresh callback](@ref window_refresh) to redraw the contents of + * your window when necessary during such operations. + * + * On some platforms, certain callbacks may be called outside of a call to one + * of the event processing functions. + * + * If no windows exist, this function returns immediately. For synchronization + * of threads in applications that do not create windows, use your threading + * library of choice. + * + * Event processing is not required for joystick input to work. + * + * @param[in] timeout The maximum amount of time, in seconds, to wait. + * + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref events + * @sa glfwPollEvents + * @sa glfwWaitEvents + * + * @since Added in version 3.2. + * + * @ingroup window + */ +GLFWAPI void glfwWaitEventsTimeout(double timeout); + /*! @brief Posts an empty event to the event queue. * * This function posts an empty event from the current thread to the event @@ -2380,13 +2852,15 @@ GLFWAPI void glfwWaitEvents(void); * of threads in applications that do not create windows, use your threading * library of choice. * - * @par Thread Safety - * This function may be called from any thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function may be called from any thread. * * @sa @ref events * @sa glfwWaitEvents * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup window */ @@ -2402,12 +2876,14 @@ GLFWAPI void glfwPostEmptyEvent(void); * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or * `GLFW_STICKY_MOUSE_BUTTONS`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_INVALID_ENUM. + * + * @thread_safety This function must only be called from the main thread. * * @sa glfwSetInputMode * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup input */ @@ -2428,37 +2904,96 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); * and unlimited cursor movement. This is useful for implementing for * example 3D camera controls. * - * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to - * enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are + * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to + * enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS` * the next time it is called even if the key had been released before the * call. This is useful when you are only interested in whether keys have been * pressed but not when or in which order. * * If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either - * `GL_TRUE` to enable sticky mouse buttons, or `GL_FALSE` to disable it. If - * sticky mouse buttons are enabled, a mouse button press will ensure that @ref - * glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even if - * the mouse button had been released before the call. This is useful when you - * are only interested in whether mouse buttons have been pressed but not when - * or in which order. + * `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it. + * If sticky mouse buttons are enabled, a mouse button press will ensure that + * @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even + * if the mouse button had been released before the call. This is useful when + * you are only interested in whether mouse buttons have been pressed but not + * when or in which order. * * @param[in] window The window whose input mode to set. * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or * `GLFW_STICKY_MOUSE_BUTTONS`. * @param[in] value The new value of the specified input mode. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa glfwGetInputMode * - * @since Added in GLFW 3.0. Replaces `glfwEnable` and `glfwDisable`. + * @since Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`. * * @ingroup input */ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); +/*! @brief Returns the localized name of the specified printable key. + * + * This function returns the localized name of the specified printable key. + * This is intended for displaying key bindings to the user. + * + * If the key is `GLFW_KEY_UNKNOWN`, the scancode is used instead, otherwise + * the scancode is ignored. If a non-printable key or (if the key is + * `GLFW_KEY_UNKNOWN`) a scancode that maps to a non-printable key is + * specified, this function returns `NULL`. + * + * This behavior allows you to pass in the arguments passed to the + * [key callback](@ref input_key) without modification. + * + * The printable keys are: + * - `GLFW_KEY_APOSTROPHE` + * - `GLFW_KEY_COMMA` + * - `GLFW_KEY_MINUS` + * - `GLFW_KEY_PERIOD` + * - `GLFW_KEY_SLASH` + * - `GLFW_KEY_SEMICOLON` + * - `GLFW_KEY_EQUAL` + * - `GLFW_KEY_LEFT_BRACKET` + * - `GLFW_KEY_RIGHT_BRACKET` + * - `GLFW_KEY_BACKSLASH` + * - `GLFW_KEY_WORLD_1` + * - `GLFW_KEY_WORLD_2` + * - `GLFW_KEY_0` to `GLFW_KEY_9` + * - `GLFW_KEY_A` to `GLFW_KEY_Z` + * - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9` + * - `GLFW_KEY_KP_DECIMAL` + * - `GLFW_KEY_KP_DIVIDE` + * - `GLFW_KEY_KP_MULTIPLY` + * - `GLFW_KEY_KP_SUBTRACT` + * - `GLFW_KEY_KP_ADD` + * - `GLFW_KEY_KP_EQUAL` + * + * @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`. + * @param[in] scancode The scancode of the key to query. + * @return The localized name of the key, or `NULL`. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @pointer_lifetime The returned string is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the next call to @ref + * glfwGetKeyName, or until the library is terminated. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref input_key_name + * + * @since Added in version 3.2. + * + * @ingroup input + */ +GLFWAPI const char* glfwGetKeyName(int key, int scancode); + /*! @brief Returns the last reported state of a keyboard key for the specified * window. * @@ -2478,20 +3013,22 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); * The [modifier key bit masks](@ref mods) are not key tokens and cannot be * used with this function. * + * __Do not use this function__ to implement [text input](@ref input_char). + * * @param[in] window The desired window. * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is * not a valid key for this function. * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_INVALID_ENUM. * - * @sa @ref input_key + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 1.0. + * @sa @ref input_key * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup input */ @@ -2512,15 +3049,15 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key); * @param[in] button The desired [mouse button](@ref buttons). * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_INVALID_ENUM. * - * @sa @ref input_mouse_button + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 1.0. + * @sa @ref input_mouse_button * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup input */ @@ -2550,13 +3087,15 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); * @param[out] ypos Where to store the cursor y-coordinate, relative to the to * top edge of the client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_pos * @sa glfwSetCursorPos * - * @since Added in GLFW 3.0. Replaces `glfwGetMousePos`. + * @since Added in version 3.0. Replaces `glfwGetMousePos`. * * @ingroup input */ @@ -2585,17 +3124,15 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); * @param[in] ypos The desired y-coordinate, relative to the top edge of the * client area. * - * @remarks __X11:__ Due to the asynchronous nature of a modern X desktop, it - * may take a moment for the window focus event to arrive. This means you will - * not be able to set the cursor position directly after window creation. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_pos * @sa glfwGetCursorPos * - * @since Added in GLFW 3.0. Replaces `glfwSetMousePos`. + * @since Added in version 3.0. Replaces `glfwSetMousePos`. * * @ingroup input */ @@ -2607,9 +3144,9 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor. * Any remaining cursors are destroyed by @ref glfwTerminate. * - * The pixels are 32-bit little-endian RGBA, i.e. eight bits per channel. They - * are arranged canonically as packed sequential rows, starting from the - * top-left corner. + * The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight + * bits per channel. They are arranged canonically as packed sequential rows, + * starting from the top-left corner. * * The cursor hotspot is specified in pixels, relative to the upper-left corner * of the cursor image. Like all other coordinate systems in GLFW, the X-axis @@ -2618,24 +3155,24 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); * @param[in] image The desired cursor image. * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot. * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot. - * * @return The handle of the created cursor, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The specified image data is copied before this function returns. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Reentrancy - * This function may not be called from a callback. + * @pointer_lifetime The specified image data is copied before this function + * returns. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_object * @sa glfwDestroyCursor * @sa glfwCreateStandardCursor * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2647,20 +3184,20 @@ GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) * a window with @ref glfwSetCursor. * * @param[in] shape One of the [standard shapes](@ref shapes). - * * @return A new cursor ready to use or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Reentrancy - * This function may not be called from a callback. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_object * @sa glfwCreateCursor * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2674,16 +3211,17 @@ GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape); * * @param[in] cursor The cursor object to destroy. * - * @par Reentrancy - * This function may not be called from a callback. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @reentrancy This function must not be called from a callback. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_object * @sa glfwCreateCursor * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2703,12 +3241,14 @@ GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); * @param[in] cursor The cursor to set, or `NULL` to switch back to the default * arrow cursor. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_object * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2744,15 +3284,14 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @sa @ref input_key + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 1.0. + * @sa @ref input_key * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter and return value. * * @ingroup input */ @@ -2783,15 +3322,14 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @sa @ref input_char + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 2.4. + * @sa @ref input_char * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 2.4. + * @glfw3 Added window handle parameter and return value. * * @ingroup input */ @@ -2818,12 +3356,13 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * @return The previously set callback, or `NULL` if no callback was set or an * error occurred. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref input_char * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2846,15 +3385,14 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * - * @sa @ref input_mouse_button + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 1.0. + * @sa @ref input_mouse_button * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter and return value. * * @ingroup input */ @@ -2873,12 +3411,13 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_pos * - * @since Added in GLFW 3.0. Replaces `glfwSetMousePosCallback`. + * @since Added in version 3.0. Replaces `glfwSetMousePosCallback`. * * @ingroup input */ @@ -2896,12 +3435,13 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref cursor_enter * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup input */ @@ -2922,12 +3462,13 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref scrolling * - * @since Added in GLFW 3.0. Replaces `glfwSetMouseWheelCallback`. + * @since Added in version 3.0. Replaces `glfwSetMouseWheelCallback`. * * @ingroup input */ @@ -2949,12 +3490,13 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref path_drop * - * @since Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup input */ @@ -2965,14 +3507,16 @@ GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); * This function returns whether the specified joystick is present. * * @param[in] joy The [joystick](@ref joysticks) to query. - * @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise. + * @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref joystick * - * @since Added in GLFW 3.0. Replaces `glfwGetJoystickParam`. + * @since Added in version 3.0. Replaces `glfwGetJoystickParam`. * * @ingroup input */ @@ -2983,22 +3527,28 @@ GLFWAPI int glfwJoystickPresent(int joy); * This function returns the values of all axes of the specified joystick. * Each element in the array is a value between -1.0 and 1.0. * + * Querying a joystick slot with no device present is not an error, but will + * cause this function to return `NULL`. Call @ref glfwJoystickPresent to + * check device presence. + * * @param[in] joy The [joystick](@ref joysticks) to query. * @param[out] count Where to store the number of axis values in the returned * array. This is set to zero if an error occurred. * @return An array of axis values, or `NULL` if the joystick is not present. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified joystick is + * disconnected, this function is called again for that joystick or the library + * is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref joystick_axis * - * @since Added in GLFW 3.0. Replaces `glfwGetJoystickPos`. + * @since Added in version 3.0. Replaces `glfwGetJoystickPos`. * * @ingroup input */ @@ -3009,25 +3559,29 @@ GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); * This function returns the state of all buttons of the specified joystick. * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. * + * Querying a joystick slot with no device present is not an error, but will + * cause this function to return `NULL`. Call @ref glfwJoystickPresent to + * check device presence. + * * @param[in] joy The [joystick](@ref joysticks) to query. * @param[out] count Where to store the number of button states in the returned * array. This is set to zero if an error occurred. * @return An array of button states, or `NULL` if the joystick is not present. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified joystick is + * disconnected, this function is called again for that joystick or the library + * is terminated. * - * @sa @ref joystick_button + * @thread_safety This function must only be called from the main thread. * - * @since Added in GLFW 2.2. + * @sa @ref joystick_button * - * @par - * __GLFW 3:__ Changed to return a dynamic array. + * @since Added in version 2.2. + * @glfw3 Changed to return a dynamic array. * * @ingroup input */ @@ -3039,26 +3593,55 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count); * The returned string is allocated and freed by GLFW. You should not free it * yourself. * + * Querying a joystick slot with no device present is not an error, but will + * cause this function to return `NULL`. Call @ref glfwJoystickPresent to + * check device presence. + * * @param[in] joy The [joystick](@ref joysticks) to query. * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick * is not present. * - * @par Pointer Lifetime - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The returned string is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the specified joystick is + * disconnected, this function is called again for that joystick or the library + * is terminated. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref joystick_name * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup input */ GLFWAPI const char* glfwGetJoystickName(int joy); +/*! @brief Sets the joystick configuration callback. + * + * This function sets the joystick configuration callback, or removes the + * currently set callback. This is called when a joystick is connected to or + * disconnected from the system. + * + * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * callback. + * @return The previously set callback, or `NULL` if no callback was set or the + * library had not been [initialized](@ref intro_init). + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function must only be called from the main thread. + * + * @sa @ref joystick_event + * + * @since Added in version 3.2. + * + * @ingroup input + */ +GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun); + /*! @brief Sets the clipboard to the specified string. * * This function sets the system clipboard to the specified, UTF-8 encoded @@ -3067,16 +3650,18 @@ GLFWAPI const char* glfwGetJoystickName(int joy); * @param[in] window The window that will own the clipboard contents. * @param[in] string A UTF-8 encoded string. * - * @par Pointer Lifetime - * The specified string is copied before this function returns. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. * - * @par Thread Safety - * This function may only be called from the main thread. + * @pointer_lifetime The specified string is copied before this function + * returns. + * + * @thread_safety This function must only be called from the main thread. * * @sa @ref clipboard * @sa glfwGetClipboardString * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup input */ @@ -3085,25 +3670,28 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); /*! @brief Returns the contents of the clipboard as a string. * * This function returns the contents of the system clipboard, if it contains - * or is convertible to a UTF-8 encoded string. + * or is convertible to a UTF-8 encoded string. If the clipboard is empty or + * if its contents cannot be converted, `NULL` is returned and a @ref + * GLFW_FORMAT_UNAVAILABLE error is generated. * * @param[in] window The window that will request the clipboard contents. * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL` * if an [error](@ref error_handling) occurred. * - * @par Pointer Lifetime - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the next call to @ref + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_PLATFORM_ERROR. + * + * @pointer_lifetime The returned string is allocated and freed by GLFW. You + * should not free it yourself. It is valid until the next call to @ref * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library * is terminated. * - * @par Thread Safety - * This function may only be called from the main thread. + * @thread_safety This function must only be called from the main thread. * * @sa @ref clipboard * @sa glfwSetClipboardString * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup input */ @@ -3122,12 +3710,15 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); * @return The current value, in seconds, or zero if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. Reading and + * writing of the internal timer offset is not atomic, so it needs to be + * externally synchronized with calls to @ref glfwSetTime. * * @sa @ref time * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup input */ @@ -3136,21 +3727,72 @@ GLFWAPI double glfwGetTime(void); /*! @brief Sets the GLFW timer. * * This function sets the value of the GLFW timer. It then continues to count - * up from that value. + * up from that value. The value must be a positive finite number less than + * or equal to 18446744073.0, which is approximately 584.5 years. * * @param[in] time The new value, in seconds. * - * @par Thread Safety - * This function may only be called from the main thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_INVALID_VALUE. + * + * @remark The upper limit of the timer is calculated as + * floor((264 - 1) / 109) and is due to implementations + * storing nanoseconds in 64 bits. The limit may be increased in the future. + * + * @thread_safety This function may be called from any thread. Reading and + * writing of the internal timer offset is not atomic, so it needs to be + * externally synchronized with calls to @ref glfwGetTime. * * @sa @ref time * - * @since Added in GLFW 2.2. + * @since Added in version 2.2. * * @ingroup input */ GLFWAPI void glfwSetTime(double time); +/*! @brief Returns the current value of the raw timer. + * + * This function returns the current value of the raw timer, measured in + * 1 / frequency seconds. To get the frequency, call @ref + * glfwGetTimerFrequency. + * + * @return The value of the timer, or zero if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. + * + * @sa @ref time + * @sa glfwGetTimerFrequency + * + * @since Added in version 3.2. + * + * @ingroup input + */ +GLFWAPI uint64_t glfwGetTimerValue(void); + +/*! @brief Returns the frequency, in Hz, of the raw timer. + * + * This function returns the frequency, in Hz, of the raw timer. + * + * @return The frequency of the timer, in Hz, or zero if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. + * + * @sa @ref time + * @sa glfwGetTimerValue + * + * @since Added in version 3.2. + * + * @ingroup input + */ +GLFWAPI uint64_t glfwGetTimerFrequency(void); + /*! @brief Makes the context of the specified window current for the calling * thread. * @@ -3164,16 +3806,22 @@ GLFWAPI void glfwSetTime(double time); * whether a context performs this flush by setting the * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint. * + * The specified window must have an OpenGL or OpenGL ES context. Specifying + * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT + * error. + * * @param[in] window The window whose context to make current, or `NULL` to * detach the current context. * - * @par Thread Safety - * This function may be called from any thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. + * + * @thread_safety This function may be called from any thread. * * @sa @ref context_current * @sa glfwGetCurrentContext * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup context */ @@ -3187,13 +3835,14 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); * @return The window whose context is current, or `NULL` if no window's * context is current. * - * @par Thread Safety - * This function may be called from any thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. * * @sa @ref context_current * @sa glfwMakeContextCurrent * - * @since Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup context */ @@ -3201,22 +3850,33 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void); /*! @brief Swaps the front and back buffers of the specified window. * - * This function swaps the front and back buffers of the specified window. If - * the swap interval is greater than zero, the GPU driver waits the specified - * number of screen updates before swapping the buffers. + * This function swaps the front and back buffers of the specified window when + * rendering with OpenGL or OpenGL ES. If the swap interval is greater than + * zero, the GPU driver waits the specified number of screen updates before + * swapping the buffers. + * + * The specified window must have an OpenGL or OpenGL ES context. Specifying + * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT + * error. + * + * This function does not apply to Vulkan. If you are rendering with Vulkan, + * see `vkQueuePresentKHR` instead. * * @param[in] window The window whose buffers to swap. * - * @par Thread Safety - * This function may be called from any thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. + * + * @remark __EGL:__ The context of the specified window must be current on the + * calling thread. + * + * @thread_safety This function may be called from any thread. * * @sa @ref buffer_swap * @sa glfwSwapInterval * - * @since Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @since Added in version 1.0. + * @glfw3 Added window handle parameter. * * @ingroup window */ @@ -3224,11 +3884,11 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); /*! @brief Sets the swap interval for the current context. * - * This function sets the swap interval for the current context, i.e. the - * number of screen updates to wait from the time @ref glfwSwapBuffers was - * called before swapping the buffers and returning. This is sometimes called - * _vertical synchronization_, _vertical retrace synchronization_ or just - * _vsync_. + * This function sets the swap interval for the current OpenGL or OpenGL ES + * context, i.e. the number of screen updates to wait from the time @ref + * glfwSwapBuffers was called before swapping the buffers and returning. This + * is sometimes called _vertical synchronization_, _vertical retrace + * synchronization_ or just _vsync_. * * Contexts that support either of the `WGL_EXT_swap_control_tear` and * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals, @@ -3240,25 +3900,30 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); * A context must be current on the calling thread. Calling this function * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. * + * This function does not apply to Vulkan. If you are rendering with Vulkan, + * see the present mode of your swapchain instead. + * * @param[in] interval The minimum number of screen updates to wait for * until the buffers are swapped by @ref glfwSwapBuffers. * - * @note This function is not called during window creation, leaving the swap - * interval set to whatever is the default on that platform. This is done + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. + * + * @remark This function is not called during context creation, leaving the + * swap interval set to whatever is the default on that platform. This is done * because some swap interval extensions used by GLFW do not allow the swap * interval to be reset to zero once it has been set to a non-zero value. * - * @note Some GPU drivers do not honor the requested swap interval, either - * because of user settings that override the request or due to bugs in the - * driver. + * @remark Some GPU drivers do not honor the requested swap interval, either + * because of a user setting that overrides the application's request or due to + * bugs in the driver. * - * @par Thread Safety - * This function may be called from any thread. + * @thread_safety This function may be called from any thread. * * @sa @ref buffer_swap * @sa glfwSwapBuffers * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup context */ @@ -3268,8 +3933,8 @@ GLFWAPI void glfwSwapInterval(int interval); * * This function returns whether the specified * [API extension](@ref context_glext) is supported by the current OpenGL or - * OpenGL ES context. It searches both for OpenGL and OpenGL ES extension and - * platform-specific context creation API extensions. + * OpenGL ES context. It searches both for client API extension and context + * creation API extensions. * * A context must be current on the calling thread. Calling this function * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. @@ -3279,16 +3944,24 @@ GLFWAPI void glfwSwapInterval(int interval); * frequently. The extension strings will not change during the lifetime of * a context, so there is no danger in doing this. * + * This function does not apply to Vulkan. If you are using Vulkan, see @ref + * glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties` + * and `vkEnumerateDeviceExtensionProperties` instead. + * * @param[in] extension The ASCII encoded name of the extension. - * @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise. + * @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE` + * otherwise. * - * @par Thread Safety - * This function may be called from any thread. + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref + * GLFW_PLATFORM_ERROR. + * + * @thread_safety This function may be called from any thread. * * @sa @ref context_glext * @sa glfwGetProcAddress * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup context */ @@ -3297,36 +3970,243 @@ GLFWAPI int glfwExtensionSupported(const char* extension); /*! @brief Returns the address of the specified function for the current * context. * - * This function returns the address of the specified - * [client API or extension function](@ref context_glext), if it is supported + * This function returns the address of the specified OpenGL or OpenGL ES + * [core or extension function](@ref context_glext), if it is supported * by the current context. * * A context must be current on the calling thread. Calling this function * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. * + * This function does not apply to Vulkan. If you are rendering with Vulkan, + * see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and + * `vkGetDeviceProcAddr` instead. + * * @param[in] procname The ASCII encoded name of the function. - * @return The address of the function, or `NULL` if the function is - * unavailable or an [error](@ref error_handling) occurred. + * @return The address of the function, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. * - * @note The addresses of a given function is not guaranteed to be the same + * @remark The address of a given function is not guaranteed to be the same * between contexts. * - * @par Pointer Lifetime - * The returned function pointer is valid until the context is destroyed or the - * library is terminated. + * @remark This function may return a non-`NULL` address despite the + * associated version or extension not being available. Always check the + * context version or extension string first. * - * @par Thread Safety - * This function may be called from any thread. + * @pointer_lifetime The returned function pointer is valid until the context + * is destroyed or the library is terminated. + * + * @thread_safety This function may be called from any thread. * * @sa @ref context_glext * @sa glfwExtensionSupported * - * @since Added in GLFW 1.0. + * @since Added in version 1.0. * * @ingroup context */ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); +/*! @brief Returns whether the Vulkan loader has been found. + * + * This function returns whether the Vulkan loader has been found. This check + * is performed by @ref glfwInit. + * + * The availability of a Vulkan loader does not by itself guarantee that window + * surface creation or even device creation is possible. Call @ref + * glfwGetRequiredInstanceExtensions to check whether the extensions necessary + * for Vulkan surface creation are available and @ref + * glfwGetPhysicalDevicePresentationSupport to check whether a queue family of + * a physical device supports image presentation. + * + * @return `GLFW_TRUE` if Vulkan is available, or `GLFW_FALSE` otherwise. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. + * + * @thread_safety This function may be called from any thread. + * + * @sa @ref vulkan_support + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +GLFWAPI int glfwVulkanSupported(void); + +/*! @brief Returns the Vulkan instance extensions required by GLFW. + * + * This function returns an array of names of Vulkan instance extensions required + * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the + * list will always contains `VK_KHR_surface`, so if you don't require any + * additional extensions you can pass this list directly to the + * `VkInstanceCreateInfo` struct. + * + * If Vulkan is not available on the machine, this function returns `NULL` and + * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported + * to check whether Vulkan is available. + * + * If Vulkan is available but no set of extensions allowing window surface + * creation was found, this function returns `NULL`. You may still use Vulkan + * for off-screen rendering and compute work. + * + * @param[out] count Where to store the number of extensions in the returned + * array. This is set to zero if an error occurred. + * @return An array of ASCII encoded extension names, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_API_UNAVAILABLE. + * + * @remarks Additional extensions may be required by future versions of GLFW. + * You should check if any extensions you wish to enable are already in the + * returned array, as it is an error to specify an extension more than once in + * the `VkInstanceCreateInfo` struct. + * + * @pointer_lifetime The returned array is allocated and freed by GLFW. You + * should not free it yourself. It is guaranteed to be valid only until the + * library is terminated. + * + * @thread_safety This function may be called from any thread. + * + * @sa @ref vulkan_ext + * @sa glfwCreateWindowSurface + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count); + +#if defined(VK_VERSION_1_0) + +/*! @brief Returns the address of the specified Vulkan instance function. + * + * This function returns the address of the specified Vulkan core or extension + * function for the specified instance. If instance is set to `NULL` it can + * return any function exported from the Vulkan loader, including at least the + * following functions: + * + * - `vkEnumerateInstanceExtensionProperties` + * - `vkEnumerateInstanceLayerProperties` + * - `vkCreateInstance` + * - `vkGetInstanceProcAddr` + * + * If Vulkan is not available on the machine, this function returns `NULL` and + * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported + * to check whether Vulkan is available. + * + * This function is equivalent to calling `vkGetInstanceProcAddr` with + * a platform-specific query of the Vulkan loader as a fallback. + * + * @param[in] instance The Vulkan instance to query, or `NULL` to retrieve + * functions related to instance creation. + * @param[in] procname The ASCII encoded name of the function. + * @return The address of the function, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref + * GLFW_API_UNAVAILABLE. + * + * @pointer_lifetime The returned function pointer is valid until the library + * is terminated. + * + * @thread_safety This function may be called from any thread. + * + * @sa @ref vulkan_proc + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname); + +/*! @brief Returns whether the specified queue family can present images. + * + * This function returns whether the specified queue family of the specified + * physical device supports presentation to the platform GLFW was built for. + * + * If Vulkan or the required window surface creation instance extensions are + * not available on the machine, or if the specified instance was not created + * with the required extensions, this function returns `GLFW_FALSE` and + * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported + * to check whether Vulkan is available and @ref + * glfwGetRequiredInstanceExtensions to check what instance extensions are + * required. + * + * @param[in] instance The instance that the physical device belongs to. + * @param[in] device The physical device that the queue family belongs to. + * @param[in] queuefamily The index of the queue family to query. + * @return `GLFW_TRUE` if the queue family supports presentation, or + * `GLFW_FALSE` otherwise. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. + * + * @thread_safety This function may be called from any thread. For + * synchronization details of Vulkan objects, see the Vulkan specification. + * + * @sa @ref vulkan_present + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); + +/*! @brief Creates a Vulkan surface for the specified window. + * + * This function creates a Vulkan surface for the specified window. + * + * If the Vulkan loader was not found at initialization, this function returns + * `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref GLFW_API_UNAVAILABLE + * error. Call @ref glfwVulkanSupported to check whether the Vulkan loader was + * found. + * + * If the required window surface creation instance extensions are not + * available or if the specified instance was not created with these extensions + * enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and + * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref + * glfwGetRequiredInstanceExtensions to check what instance extensions are + * required. + * + * The window surface must be destroyed before the specified Vulkan instance. + * It is the responsibility of the caller to destroy the window surface. GLFW + * does not destroy it for you. Call `vkDestroySurfaceKHR` to destroy the + * surface. + * + * @param[in] instance The Vulkan instance to create the surface in. + * @param[in] window The window to create the surface for. + * @param[in] allocator The allocator to use, or `NULL` to use the default + * allocator. + * @param[out] surface Where to store the handle of the surface. This is set + * to `VK_NULL_HANDLE` if an error occurred. + * @return `VK_SUCCESS` if successful, or a Vulkan error code if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref + * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. + * + * @remarks If an error occurs before the creation call is made, GLFW returns + * the Vulkan error code most appropriate for the error. Appropriate use of + * @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should + * eliminate almost all occurrences of these errors. + * + * @thread_safety This function may be called from any thread. For + * synchronization details of Vulkan objects, see the Vulkan specification. + * + * @sa @ref vulkan_surface + * @sa glfwGetRequiredInstanceExtensions + * + * @since Added in version 3.2. + * + * @ingroup vulkan + */ +GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); + +#endif /*VK_VERSION_1_0*/ + /************************************************************************* * Global definition cleanup diff --git a/src/external/glfw3/include/GLFW/glfw3native.h b/src/external/glfw3/include/GLFW/glfw3native.h index b3ce7482..30e1a570 100644 --- a/src/external/glfw3/include/GLFW/glfw3native.h +++ b/src/external/glfw3/include/GLFW/glfw3native.h @@ -1,9 +1,9 @@ /************************************************************************* - * GLFW 3.1 - www.glfw.org + * GLFW 3.2 - www.glfw.org * A library for OpenGL, window and input *------------------------------------------------------------------------ * Copyright (c) 2002-2006 Marcus Geelnard - * Copyright (c) 2006-2010 Camilla Berglund + * Copyright (c) 2006-2016 Camilla Berglund * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -38,20 +38,30 @@ extern "C" { * Doxygen documentation *************************************************************************/ +/*! @file glfw3native.h + * @brief The header of the native access functions. + * + * This is the header file of the native access functions. See @ref native for + * more information. + */ /*! @defgroup native Native access * * **By using the native access functions you assert that you know what you're * doing and how to fix problems caused by using them. If you don't, you * shouldn't be using them.** * - * Before the inclusion of @ref glfw3native.h, you must define exactly one - * window system API macro and exactly one context creation API macro. Failure - * to do this will cause a compile-time error. + * Before the inclusion of @ref glfw3native.h, you may define exactly one + * window system API macro and zero or more context creation API macros. + * + * The chosen backends must match those the library was compiled for. Failure + * to do this will cause a link-time error. * * The available window API macros are: * * `GLFW_EXPOSE_NATIVE_WIN32` * * `GLFW_EXPOSE_NATIVE_COCOA` * * `GLFW_EXPOSE_NATIVE_X11` + * * `GLFW_EXPOSE_NATIVE_WAYLAND` + * * `GLFW_EXPOSE_NATIVE_MIR` * * The available context API macros are: * * `GLFW_EXPOSE_NATIVE_WGL` @@ -86,20 +96,23 @@ extern "C" { #elif defined(GLFW_EXPOSE_NATIVE_X11) #include #include -#else - #error "No window API selected" +#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND) + #include +#elif defined(GLFW_EXPOSE_NATIVE_MIR) + #include #endif #if defined(GLFW_EXPOSE_NATIVE_WGL) /* WGL is declared by windows.h */ -#elif defined(GLFW_EXPOSE_NATIVE_NSGL) +#endif +#if defined(GLFW_EXPOSE_NATIVE_NSGL) /* NSGL is declared by Cocoa.h */ -#elif defined(GLFW_EXPOSE_NATIVE_GLX) +#endif +#if defined(GLFW_EXPOSE_NATIVE_GLX) #include -#elif defined(GLFW_EXPOSE_NATIVE_EGL) +#endif +#if defined(GLFW_EXPOSE_NATIVE_EGL) #include -#else - #error "No context API selected" #endif @@ -114,11 +127,10 @@ extern "C" { * of the specified monitor, or `NULL` if an [error](@ref error_handling) * occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup native */ @@ -130,11 +142,10 @@ GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup native */ @@ -145,11 +156,10 @@ GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); * @return The `HWND` of the specified window, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -162,11 +172,10 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); * @return The `HGLRC` of the specified window, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -179,11 +188,10 @@ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); * @return The `CGDirectDisplayID` of the specified monitor, or * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup native */ @@ -194,11 +202,10 @@ GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); * @return The `NSWindow` of the specified window, or `nil` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -211,11 +218,10 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); * @return The `NSOpenGLContext` of the specified window, or `nil` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -228,11 +234,10 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); * @return The `Display` used by GLFW, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -243,11 +248,10 @@ GLFWAPI Display* glfwGetX11Display(void); * @return The `RRCrtc` of the specified monitor, or `None` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup native */ @@ -258,11 +262,10 @@ GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); * @return The `RROutput` of the specified monitor, or `None` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.1. + * @since Added in version 3.1. * * @ingroup native */ @@ -273,11 +276,10 @@ GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); * @return The `Window` of the specified window, or `None` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -290,15 +292,116 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* window); * @return The `GLXContext` of the specified window, or `NULL` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); + +/*! @brief Returns the `GLXWindow` of the specified window. + * + * @return The `GLXWindow` of the specified window, or `None` if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_WAYLAND) +/*! @brief Returns the `struct wl_display*` used by GLFW. + * + * @return The `struct wl_display*` used by GLFW, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI struct wl_display* glfwGetWaylandDisplay(void); + +/*! @brief Returns the `struct wl_output*` of the specified monitor. + * + * @return The `struct wl_output*` of the specified monitor, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor); + +/*! @brief Returns the main `struct wl_surface*` of the specified window. + * + * @return The main `struct wl_surface*` of the specified window, or `NULL` if + * an [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window); +#endif + +#if defined(GLFW_EXPOSE_NATIVE_MIR) +/*! @brief Returns the `MirConnection*` used by GLFW. + * + * @return The `MirConnection*` used by GLFW, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI MirConnection* glfwGetMirDisplay(void); + +/*! @brief Returns the Mir output ID of the specified monitor. + * + * @return The Mir output ID of the specified monitor, or zero if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI int glfwGetMirMonitor(GLFWmonitor* monitor); + +/*! @brief Returns the `MirSurface*` of the specified window. + * + * @return The `MirSurface*` of the specified window, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.2. + * + * @ingroup native + */ +GLFWAPI MirSurface* glfwGetMirWindow(GLFWwindow* window); #endif #if defined(GLFW_EXPOSE_NATIVE_EGL) @@ -307,11 +410,10 @@ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -322,11 +424,10 @@ GLFWAPI EGLDisplay glfwGetEGLDisplay(void); * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ @@ -337,11 +438,10 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an * [error](@ref error_handling) occurred. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @thread_safety This function may be called from any thread. Access is not + * synchronized. * - * @par History - * Added in GLFW 3.0. + * @since Added in version 3.0. * * @ingroup native */ diff --git a/src/external/glfw3/lib/win32/libglfw3.a b/src/external/glfw3/lib/win32/libglfw3.a index fc920396..d50ffa72 100644 Binary files a/src/external/glfw3/lib/win32/libglfw3.a and b/src/external/glfw3/lib/win32/libglfw3.a differ diff --git a/src/external/glfw3/lib/win32/libglfw3dll.a b/src/external/glfw3/lib/win32/libglfw3dll.a index f1bd73b1..a42a400b 100644 Binary files a/src/external/glfw3/lib/win32/libglfw3dll.a and b/src/external/glfw3/lib/win32/libglfw3dll.a differ -- cgit v1.2.3 From 6b2823775ef05ec4e5356caa813b2b51e012b773 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 20:34:11 +0200 Subject: Remove OpenAL Soft --- src/external/openal_soft/COPYING | 484 ------------- src/external/openal_soft/include/AL/al.h | 656 ------------------ src/external/openal_soft/include/AL/alc.h | 237 ------- src/external/openal_soft/include/AL/alext.h | 438 ------------ src/external/openal_soft/include/AL/efx-creative.h | 3 - src/external/openal_soft/include/AL/efx-presets.h | 402 ----------- src/external/openal_soft/include/AL/efx.h | 761 --------------------- .../openal_soft/lib/win32/libOpenAL32.dll.a | Bin 100246 -> 0 bytes 8 files changed, 2981 deletions(-) delete mode 100644 src/external/openal_soft/COPYING delete mode 100644 src/external/openal_soft/include/AL/al.h delete mode 100644 src/external/openal_soft/include/AL/alc.h delete mode 100644 src/external/openal_soft/include/AL/alext.h delete mode 100644 src/external/openal_soft/include/AL/efx-creative.h delete mode 100644 src/external/openal_soft/include/AL/efx-presets.h delete mode 100644 src/external/openal_soft/include/AL/efx.h delete mode 100644 src/external/openal_soft/lib/win32/libOpenAL32.dll.a (limited to 'src') diff --git a/src/external/openal_soft/COPYING b/src/external/openal_soft/COPYING deleted file mode 100644 index d0c89786..00000000 --- a/src/external/openal_soft/COPYING +++ /dev/null @@ -1,484 +0,0 @@ - - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - - Copyright (C) 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - diff --git a/src/external/openal_soft/include/AL/al.h b/src/external/openal_soft/include/AL/al.h deleted file mode 100644 index 413b3833..00000000 --- a/src/external/openal_soft/include/AL/al.h +++ /dev/null @@ -1,656 +0,0 @@ -#ifndef AL_AL_H -#define AL_AL_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef AL_API - #if defined(AL_LIBTYPE_STATIC) - #define AL_API - #elif defined(_WIN32) - #define AL_API __declspec(dllimport) - #else - #define AL_API extern - #endif -#endif - -#if defined(_WIN32) - #define AL_APIENTRY __cdecl -#else - #define AL_APIENTRY -#endif - - -/** Deprecated macro. */ -#define OPENAL -#define ALAPI AL_API -#define ALAPIENTRY AL_APIENTRY -#define AL_INVALID (-1) -#define AL_ILLEGAL_ENUM AL_INVALID_ENUM -#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION - -/** Supported AL version. */ -#define AL_VERSION_1_0 -#define AL_VERSION_1_1 - -/** 8-bit boolean */ -typedef char ALboolean; - -/** character */ -typedef char ALchar; - -/** signed 8-bit 2's complement integer */ -typedef signed char ALbyte; - -/** unsigned 8-bit integer */ -typedef unsigned char ALubyte; - -/** signed 16-bit 2's complement integer */ -typedef short ALshort; - -/** unsigned 16-bit integer */ -typedef unsigned short ALushort; - -/** signed 32-bit 2's complement integer */ -typedef int ALint; - -/** unsigned 32-bit integer */ -typedef unsigned int ALuint; - -/** non-negative 32-bit binary integer size */ -typedef int ALsizei; - -/** enumerated 32-bit value */ -typedef int ALenum; - -/** 32-bit IEEE754 floating-point */ -typedef float ALfloat; - -/** 64-bit IEEE754 floating-point */ -typedef double ALdouble; - -/** void type (for opaque pointers only) */ -typedef void ALvoid; - - -/* Enumerant values begin at column 50. No tabs. */ - -/** "no distance model" or "no buffer" */ -#define AL_NONE 0 - -/** Boolean False. */ -#define AL_FALSE 0 - -/** Boolean True. */ -#define AL_TRUE 1 - - -/** - * Relative source. - * Type: ALboolean - * Range: [AL_TRUE, AL_FALSE] - * Default: AL_FALSE - * - * Specifies if the Source has relative coordinates. - */ -#define AL_SOURCE_RELATIVE 0x202 - - -/** - * Inner cone angle, in degrees. - * Type: ALint, ALfloat - * Range: [0 - 360] - * Default: 360 - * - * The angle covered by the inner cone, where the source will not attenuate. - */ -#define AL_CONE_INNER_ANGLE 0x1001 - -/** - * Outer cone angle, in degrees. - * Range: [0 - 360] - * Default: 360 - * - * The angle covered by the outer cone, where the source will be fully - * attenuated. - */ -#define AL_CONE_OUTER_ANGLE 0x1002 - -/** - * Source pitch. - * Type: ALfloat - * Range: [0.5 - 2.0] - * Default: 1.0 - * - * A multiplier for the frequency (sample rate) of the source's buffer. - */ -#define AL_PITCH 0x1003 - -/** - * Source or listener position. - * Type: ALfloat[3], ALint[3] - * Default: {0, 0, 0} - * - * The source or listener location in three dimensional space. - * - * OpenAL, like OpenGL, uses a right handed coordinate system, where in a - * frontal default view X (thumb) points right, Y points up (index finger), and - * Z points towards the viewer/camera (middle finger). - * - * To switch from a left handed coordinate system, flip the sign on the Z - * coordinate. - */ -#define AL_POSITION 0x1004 - -/** - * Source direction. - * Type: ALfloat[3], ALint[3] - * Default: {0, 0, 0} - * - * Specifies the current direction in local space. - * A zero-length vector specifies an omni-directional source (cone is ignored). - */ -#define AL_DIRECTION 0x1005 - -/** - * Source or listener velocity. - * Type: ALfloat[3], ALint[3] - * Default: {0, 0, 0} - * - * Specifies the current velocity in local space. - */ -#define AL_VELOCITY 0x1006 - -/** - * Source looping. - * Type: ALboolean - * Range: [AL_TRUE, AL_FALSE] - * Default: AL_FALSE - * - * Specifies whether source is looping. - */ -#define AL_LOOPING 0x1007 - -/** - * Source buffer. - * Type: ALuint - * Range: any valid Buffer. - * - * Specifies the buffer to provide sound samples. - */ -#define AL_BUFFER 0x1009 - -/** - * Source or listener gain. - * Type: ALfloat - * Range: [0.0 - ] - * - * A value of 1.0 means unattenuated. Each division by 2 equals an attenuation - * of about -6dB. Each multiplicaton by 2 equals an amplification of about - * +6dB. - * - * A value of 0.0 is meaningless with respect to a logarithmic scale; it is - * silent. - */ -#define AL_GAIN 0x100A - -/** - * Minimum source gain. - * Type: ALfloat - * Range: [0.0 - 1.0] - * - * The minimum gain allowed for a source, after distance and cone attenation is - * applied (if applicable). - */ -#define AL_MIN_GAIN 0x100D - -/** - * Maximum source gain. - * Type: ALfloat - * Range: [0.0 - 1.0] - * - * The maximum gain allowed for a source, after distance and cone attenation is - * applied (if applicable). - */ -#define AL_MAX_GAIN 0x100E - -/** - * Listener orientation. - * Type: ALfloat[6] - * Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0} - * - * Effectively two three dimensional vectors. The first vector is the front (or - * "at") and the second is the top (or "up"). - * - * Both vectors are in local space. - */ -#define AL_ORIENTATION 0x100F - -/** - * Source state (query only). - * Type: ALint - * Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED] - */ -#define AL_SOURCE_STATE 0x1010 - -/** Source state value. */ -#define AL_INITIAL 0x1011 -#define AL_PLAYING 0x1012 -#define AL_PAUSED 0x1013 -#define AL_STOPPED 0x1014 - -/** - * Source Buffer Queue size (query only). - * Type: ALint - * - * The number of buffers queued using alSourceQueueBuffers, minus the buffers - * removed with alSourceUnqueueBuffers. - */ -#define AL_BUFFERS_QUEUED 0x1015 - -/** - * Source Buffer Queue processed count (query only). - * Type: ALint - * - * The number of queued buffers that have been fully processed, and can be - * removed with alSourceUnqueueBuffers. - * - * Looping sources will never fully process buffers because they will be set to - * play again for when the source loops. - */ -#define AL_BUFFERS_PROCESSED 0x1016 - -/** - * Source reference distance. - * Type: ALfloat - * Range: [0.0 - ] - * Default: 1.0 - * - * The distance in units that no attenuation occurs. - * - * At 0.0, no distance attenuation ever occurs on non-linear attenuation models. - */ -#define AL_REFERENCE_DISTANCE 0x1020 - -/** - * Source rolloff factor. - * Type: ALfloat - * Range: [0.0 - ] - * Default: 1.0 - * - * Multiplier to exaggerate or diminish distance attenuation. - * - * At 0.0, no distance attenuation ever occurs. - */ -#define AL_ROLLOFF_FACTOR 0x1021 - -/** - * Outer cone gain. - * Type: ALfloat - * Range: [0.0 - 1.0] - * Default: 0.0 - * - * The gain attenuation applied when the listener is outside of the source's - * outer cone. - */ -#define AL_CONE_OUTER_GAIN 0x1022 - -/** - * Source maximum distance. - * Type: ALfloat - * Range: [0.0 - ] - * Default: +inf - * - * The distance above which the source is not attenuated any further with a - * clamped distance model, or where attenuation reaches 0.0 gain for linear - * distance models with a default rolloff factor. - */ -#define AL_MAX_DISTANCE 0x1023 - -/** Source buffer position, in seconds */ -#define AL_SEC_OFFSET 0x1024 -/** Source buffer position, in sample frames */ -#define AL_SAMPLE_OFFSET 0x1025 -/** Source buffer position, in bytes */ -#define AL_BYTE_OFFSET 0x1026 - -/** - * Source type (query only). - * Type: ALint - * Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED] - * - * A Source is Static if a Buffer has been attached using AL_BUFFER. - * - * A Source is Streaming if one or more Buffers have been attached using - * alSourceQueueBuffers. - * - * A Source is Undetermined when it has the NULL buffer attached using - * AL_BUFFER. - */ -#define AL_SOURCE_TYPE 0x1027 - -/** Source type value. */ -#define AL_STATIC 0x1028 -#define AL_STREAMING 0x1029 -#define AL_UNDETERMINED 0x1030 - -/** Buffer format specifier. */ -#define AL_FORMAT_MONO8 0x1100 -#define AL_FORMAT_MONO16 0x1101 -#define AL_FORMAT_STEREO8 0x1102 -#define AL_FORMAT_STEREO16 0x1103 - -/** Buffer frequency (query only). */ -#define AL_FREQUENCY 0x2001 -/** Buffer bits per sample (query only). */ -#define AL_BITS 0x2002 -/** Buffer channel count (query only). */ -#define AL_CHANNELS 0x2003 -/** Buffer data size (query only). */ -#define AL_SIZE 0x2004 - -/** - * Buffer state. - * - * Not for public use. - */ -#define AL_UNUSED 0x2010 -#define AL_PENDING 0x2011 -#define AL_PROCESSED 0x2012 - - -/** No error. */ -#define AL_NO_ERROR 0 - -/** Invalid name paramater passed to AL call. */ -#define AL_INVALID_NAME 0xA001 - -/** Invalid enum parameter passed to AL call. */ -#define AL_INVALID_ENUM 0xA002 - -/** Invalid value parameter passed to AL call. */ -#define AL_INVALID_VALUE 0xA003 - -/** Illegal AL call. */ -#define AL_INVALID_OPERATION 0xA004 - -/** Not enough memory. */ -#define AL_OUT_OF_MEMORY 0xA005 - - -/** Context string: Vendor ID. */ -#define AL_VENDOR 0xB001 -/** Context string: Version. */ -#define AL_VERSION 0xB002 -/** Context string: Renderer ID. */ -#define AL_RENDERER 0xB003 -/** Context string: Space-separated extension list. */ -#define AL_EXTENSIONS 0xB004 - - -/** - * Doppler scale. - * Type: ALfloat - * Range: [0.0 - ] - * Default: 1.0 - * - * Scale for source and listener velocities. - */ -#define AL_DOPPLER_FACTOR 0xC000 -AL_API void AL_APIENTRY alDopplerFactor(ALfloat value); - -/** - * Doppler velocity (deprecated). - * - * A multiplier applied to the Speed of Sound. - */ -#define AL_DOPPLER_VELOCITY 0xC001 -AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value); - -/** - * Speed of Sound, in units per second. - * Type: ALfloat - * Range: [0.0001 - ] - * Default: 343.3 - * - * The speed at which sound waves are assumed to travel, when calculating the - * doppler effect. - */ -#define AL_SPEED_OF_SOUND 0xC003 -AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value); - -/** - * Distance attenuation model. - * Type: ALint - * Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, - * AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, - * AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED] - * Default: AL_INVERSE_DISTANCE_CLAMPED - * - * The model by which sources attenuate with distance. - * - * None - No distance attenuation. - * Inverse - Doubling the distance halves the source gain. - * Linear - Linear gain scaling between the reference and max distances. - * Exponent - Exponential gain dropoff. - * - * Clamped variations work like the non-clamped counterparts, except the - * distance calculated is clamped between the reference and max distances. - */ -#define AL_DISTANCE_MODEL 0xD000 -AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); - -/** Distance model value. */ -#define AL_INVERSE_DISTANCE 0xD001 -#define AL_INVERSE_DISTANCE_CLAMPED 0xD002 -#define AL_LINEAR_DISTANCE 0xD003 -#define AL_LINEAR_DISTANCE_CLAMPED 0xD004 -#define AL_EXPONENT_DISTANCE 0xD005 -#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 - -/** Renderer State management. */ -AL_API void AL_APIENTRY alEnable(ALenum capability); -AL_API void AL_APIENTRY alDisable(ALenum capability); -AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability); - -/** State retrieval. */ -AL_API const ALchar* AL_APIENTRY alGetString(ALenum param); -AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values); -AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values); -AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values); -AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values); -AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param); -AL_API ALint AL_APIENTRY alGetInteger(ALenum param); -AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param); -AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param); - -/** - * Error retrieval. - * - * Obtain the first error generated in the AL context since the last check. - */ -AL_API ALenum AL_APIENTRY alGetError(void); - -/** - * Extension support. - * - * Query for the presence of an extension, and obtain any appropriate function - * pointers and enum values. - */ -AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); -AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname); -AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename); - - -/** Set Listener parameters */ -AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value); -AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values); -AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value); -AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3); -AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values); - -/** Get Listener parameters */ -AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value); -AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values); -AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value); -AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3); -AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values); - - -/** Create Source objects. */ -AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources); -/** Delete Source objects. */ -AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources); -/** Verify a handle is a valid Source. */ -AL_API ALboolean AL_APIENTRY alIsSource(ALuint source); - -/** Set Source parameters. */ -AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value); -AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values); -AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value); -AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); -AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values); - -/** Get Source parameters. */ -AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value); -AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values); -AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value); -AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); -AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values); - - -/** Play, replay, or resume (if paused) a list of Sources */ -AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources); -/** Stop a list of Sources */ -AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources); -/** Rewind a list of Sources */ -AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources); -/** Pause a list of Sources */ -AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources); - -/** Play, replay, or resume a Source */ -AL_API void AL_APIENTRY alSourcePlay(ALuint source); -/** Stop a Source */ -AL_API void AL_APIENTRY alSourceStop(ALuint source); -/** Rewind a Source (set playback postiton to beginning) */ -AL_API void AL_APIENTRY alSourceRewind(ALuint source); -/** Pause a Source */ -AL_API void AL_APIENTRY alSourcePause(ALuint source); - -/** Queue buffers onto a source */ -AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers); -/** Unqueue processed buffers from a source */ -AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers); - - -/** Create Buffer objects */ -AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers); -/** Delete Buffer objects */ -AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers); -/** Verify a handle is a valid Buffer */ -AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer); - -/** Specifies the data to be copied into a buffer */ -AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); - -/** Set Buffer parameters, */ -AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value); -AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values); -AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value); -AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); -AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values); - -/** Get Buffer parameters. */ -AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value); -AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values); -AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value); -AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); -AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values); - -/** Pointer-to-function type, useful for dynamically getting AL entry points. */ -typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability); -typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability); -typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability); -typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param); -typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values); -typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values); -typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values); -typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values); -typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param); -typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param); -typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param); -typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param); -typedef ALenum (AL_APIENTRY *LPALGETERROR)(void); -typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname); -typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname); -typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename); -typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value); -typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values); -typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value); -typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3); -typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values); -typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value); -typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values); -typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value); -typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3); -typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values); -typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources); -typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources); -typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source); -typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value); -typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values); -typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value); -typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); -typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values); -typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value); -typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values); -typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value); -typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); -typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values); -typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources); -typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources); -typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources); -typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources); -typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source); -typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source); -typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source); -typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source); -typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers); -typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers); -typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers); -typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers); -typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer); -typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); -typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value); -typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); -typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values); -typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value); -typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); -typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values); -typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value); -typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); -typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values); -typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value); -typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); -typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values); -typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value); -typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value); -typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value); -typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel); - -#if defined(__cplusplus) -} /* extern "C" */ -#endif - -#endif /* AL_AL_H */ diff --git a/src/external/openal_soft/include/AL/alc.h b/src/external/openal_soft/include/AL/alc.h deleted file mode 100644 index 294e8b33..00000000 --- a/src/external/openal_soft/include/AL/alc.h +++ /dev/null @@ -1,237 +0,0 @@ -#ifndef AL_ALC_H -#define AL_ALC_H - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef ALC_API - #if defined(AL_LIBTYPE_STATIC) - #define ALC_API - #elif defined(_WIN32) - #define ALC_API __declspec(dllimport) - #else - #define ALC_API extern - #endif -#endif - -#if defined(_WIN32) - #define ALC_APIENTRY __cdecl -#else - #define ALC_APIENTRY -#endif - - -/** Deprecated macro. */ -#define ALCAPI ALC_API -#define ALCAPIENTRY ALC_APIENTRY -#define ALC_INVALID 0 - -/** Supported ALC version? */ -#define ALC_VERSION_0_1 1 - -/** Opaque device handle */ -typedef struct ALCdevice_struct ALCdevice; -/** Opaque context handle */ -typedef struct ALCcontext_struct ALCcontext; - -/** 8-bit boolean */ -typedef char ALCboolean; - -/** character */ -typedef char ALCchar; - -/** signed 8-bit 2's complement integer */ -typedef signed char ALCbyte; - -/** unsigned 8-bit integer */ -typedef unsigned char ALCubyte; - -/** signed 16-bit 2's complement integer */ -typedef short ALCshort; - -/** unsigned 16-bit integer */ -typedef unsigned short ALCushort; - -/** signed 32-bit 2's complement integer */ -typedef int ALCint; - -/** unsigned 32-bit integer */ -typedef unsigned int ALCuint; - -/** non-negative 32-bit binary integer size */ -typedef int ALCsizei; - -/** enumerated 32-bit value */ -typedef int ALCenum; - -/** 32-bit IEEE754 floating-point */ -typedef float ALCfloat; - -/** 64-bit IEEE754 floating-point */ -typedef double ALCdouble; - -/** void type (for opaque pointers only) */ -typedef void ALCvoid; - - -/* Enumerant values begin at column 50. No tabs. */ - -/** Boolean False. */ -#define ALC_FALSE 0 - -/** Boolean True. */ -#define ALC_TRUE 1 - -/** Context attribute: Hz. */ -#define ALC_FREQUENCY 0x1007 - -/** Context attribute: Hz. */ -#define ALC_REFRESH 0x1008 - -/** Context attribute: AL_TRUE or AL_FALSE. */ -#define ALC_SYNC 0x1009 - -/** Context attribute: requested Mono (3D) Sources. */ -#define ALC_MONO_SOURCES 0x1010 - -/** Context attribute: requested Stereo Sources. */ -#define ALC_STEREO_SOURCES 0x1011 - -/** No error. */ -#define ALC_NO_ERROR 0 - -/** Invalid device handle. */ -#define ALC_INVALID_DEVICE 0xA001 - -/** Invalid context handle. */ -#define ALC_INVALID_CONTEXT 0xA002 - -/** Invalid enum parameter passed to an ALC call. */ -#define ALC_INVALID_ENUM 0xA003 - -/** Invalid value parameter passed to an ALC call. */ -#define ALC_INVALID_VALUE 0xA004 - -/** Out of memory. */ -#define ALC_OUT_OF_MEMORY 0xA005 - - -/** Runtime ALC version. */ -#define ALC_MAJOR_VERSION 0x1000 -#define ALC_MINOR_VERSION 0x1001 - -/** Context attribute list properties. */ -#define ALC_ATTRIBUTES_SIZE 0x1002 -#define ALC_ALL_ATTRIBUTES 0x1003 - -/** String for the default device specifier. */ -#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 -/** - * String for the given device's specifier. - * - * If device handle is NULL, it is instead a null-char separated list of - * strings of known device specifiers (list ends with an empty string). - */ -#define ALC_DEVICE_SPECIFIER 0x1005 -/** String for space-separated list of ALC extensions. */ -#define ALC_EXTENSIONS 0x1006 - - -/** Capture extension */ -#define ALC_EXT_CAPTURE 1 -/** - * String for the given capture device's specifier. - * - * If device handle is NULL, it is instead a null-char separated list of - * strings of known capture device specifiers (list ends with an empty string). - */ -#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 -/** String for the default capture device specifier. */ -#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 -/** Number of sample frames available for capture. */ -#define ALC_CAPTURE_SAMPLES 0x312 - - -/** Enumerate All extension */ -#define ALC_ENUMERATE_ALL_EXT 1 -/** String for the default extended device specifier. */ -#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 -/** - * String for the given extended device's specifier. - * - * If device handle is NULL, it is instead a null-char separated list of - * strings of known extended device specifiers (list ends with an empty string). - */ -#define ALC_ALL_DEVICES_SPECIFIER 0x1013 - - -/** Context management. */ -ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist); -ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context); -ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context); -ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context); -ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context); -ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void); -ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context); - -/** Device management. */ -ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename); -ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device); - - -/** - * Error support. - * - * Obtain the most recent Device error. - */ -ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device); - -/** - * Extension support. - * - * Query for the presence of an extension, and obtain any appropriate - * function pointers and enum values. - */ -ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname); -ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); -ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname); - -/** Query function. */ -ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param); -ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); - -/** Capture function. */ -ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); -ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device); -ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device); -ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device); -ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); - -/** Pointer-to-function type, useful for dynamically getting ALC entry points. */ -typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist); -typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context); -typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context); -typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context); -typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context); -typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void); -typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context); -typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename); -typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device); -typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device); -typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname); -typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); -typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname); -typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param); -typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); -typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); -typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device); -typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device); -typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device); -typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); - -#if defined(__cplusplus) -} -#endif - -#endif /* AL_ALC_H */ diff --git a/src/external/openal_soft/include/AL/alext.h b/src/external/openal_soft/include/AL/alext.h deleted file mode 100644 index 6af581aa..00000000 --- a/src/external/openal_soft/include/AL/alext.h +++ /dev/null @@ -1,438 +0,0 @@ -/** - * OpenAL cross platform audio library - * Copyright (C) 2008 by authors. - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Or go to http://www.gnu.org/copyleft/lgpl.html - */ - -#ifndef AL_ALEXT_H -#define AL_ALEXT_H - -#include -/* Define int64_t and uint64_t types */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif - -#include "alc.h" -#include "al.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef AL_LOKI_IMA_ADPCM_format -#define AL_LOKI_IMA_ADPCM_format 1 -#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000 -#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001 -#endif - -#ifndef AL_LOKI_WAVE_format -#define AL_LOKI_WAVE_format 1 -#define AL_FORMAT_WAVE_EXT 0x10002 -#endif - -#ifndef AL_EXT_vorbis -#define AL_EXT_vorbis 1 -#define AL_FORMAT_VORBIS_EXT 0x10003 -#endif - -#ifndef AL_LOKI_quadriphonic -#define AL_LOKI_quadriphonic 1 -#define AL_FORMAT_QUAD8_LOKI 0x10004 -#define AL_FORMAT_QUAD16_LOKI 0x10005 -#endif - -#ifndef AL_EXT_float32 -#define AL_EXT_float32 1 -#define AL_FORMAT_MONO_FLOAT32 0x10010 -#define AL_FORMAT_STEREO_FLOAT32 0x10011 -#endif - -#ifndef AL_EXT_double -#define AL_EXT_double 1 -#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012 -#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013 -#endif - -#ifndef AL_EXT_MULAW -#define AL_EXT_MULAW 1 -#define AL_FORMAT_MONO_MULAW_EXT 0x10014 -#define AL_FORMAT_STEREO_MULAW_EXT 0x10015 -#endif - -#ifndef AL_EXT_ALAW -#define AL_EXT_ALAW 1 -#define AL_FORMAT_MONO_ALAW_EXT 0x10016 -#define AL_FORMAT_STEREO_ALAW_EXT 0x10017 -#endif - -#ifndef ALC_LOKI_audio_channel -#define ALC_LOKI_audio_channel 1 -#define ALC_CHAN_MAIN_LOKI 0x500001 -#define ALC_CHAN_PCM_LOKI 0x500002 -#define ALC_CHAN_CD_LOKI 0x500003 -#endif - -#ifndef AL_EXT_MCFORMATS -#define AL_EXT_MCFORMATS 1 -#define AL_FORMAT_QUAD8 0x1204 -#define AL_FORMAT_QUAD16 0x1205 -#define AL_FORMAT_QUAD32 0x1206 -#define AL_FORMAT_REAR8 0x1207 -#define AL_FORMAT_REAR16 0x1208 -#define AL_FORMAT_REAR32 0x1209 -#define AL_FORMAT_51CHN8 0x120A -#define AL_FORMAT_51CHN16 0x120B -#define AL_FORMAT_51CHN32 0x120C -#define AL_FORMAT_61CHN8 0x120D -#define AL_FORMAT_61CHN16 0x120E -#define AL_FORMAT_61CHN32 0x120F -#define AL_FORMAT_71CHN8 0x1210 -#define AL_FORMAT_71CHN16 0x1211 -#define AL_FORMAT_71CHN32 0x1212 -#endif - -#ifndef AL_EXT_MULAW_MCFORMATS -#define AL_EXT_MULAW_MCFORMATS 1 -#define AL_FORMAT_MONO_MULAW 0x10014 -#define AL_FORMAT_STEREO_MULAW 0x10015 -#define AL_FORMAT_QUAD_MULAW 0x10021 -#define AL_FORMAT_REAR_MULAW 0x10022 -#define AL_FORMAT_51CHN_MULAW 0x10023 -#define AL_FORMAT_61CHN_MULAW 0x10024 -#define AL_FORMAT_71CHN_MULAW 0x10025 -#endif - -#ifndef AL_EXT_IMA4 -#define AL_EXT_IMA4 1 -#define AL_FORMAT_MONO_IMA4 0x1300 -#define AL_FORMAT_STEREO_IMA4 0x1301 -#endif - -#ifndef AL_EXT_STATIC_BUFFER -#define AL_EXT_STATIC_BUFFER 1 -typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); -#ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); -#endif -#endif - -#ifndef ALC_EXT_EFX -#define ALC_EXT_EFX 1 -#include "efx.h" -#endif - -#ifndef ALC_EXT_disconnect -#define ALC_EXT_disconnect 1 -#define ALC_CONNECTED 0x313 -#endif - -#ifndef ALC_EXT_thread_local_context -#define ALC_EXT_thread_local_context 1 -typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); -typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); -#ifdef AL_ALEXT_PROTOTYPES -ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context); -ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); -#endif -#endif - -#ifndef AL_EXT_source_distance_model -#define AL_EXT_source_distance_model 1 -#define AL_SOURCE_DISTANCE_MODEL 0x200 -#endif - -#ifndef AL_SOFT_buffer_sub_data -#define AL_SOFT_buffer_sub_data 1 -#define AL_BYTE_RW_OFFSETS_SOFT 0x1031 -#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 -typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); -#ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); -#endif -#endif - -#ifndef AL_SOFT_loop_points -#define AL_SOFT_loop_points 1 -#define AL_LOOP_POINTS_SOFT 0x2015 -#endif - -#ifndef AL_EXT_FOLDBACK -#define AL_EXT_FOLDBACK 1 -#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK" -#define AL_FOLDBACK_EVENT_BLOCK 0x4112 -#define AL_FOLDBACK_EVENT_START 0x4111 -#define AL_FOLDBACK_EVENT_STOP 0x4113 -#define AL_FOLDBACK_MODE_MONO 0x4101 -#define AL_FOLDBACK_MODE_STEREO 0x4102 -typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei); -typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK); -typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void); -#ifdef AL_ALEXT_PROTOTYPES -AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback); -AL_API void AL_APIENTRY alRequestFoldbackStop(void); -#endif -#endif - -#ifndef ALC_EXT_DEDICATED -#define ALC_EXT_DEDICATED 1 -#define AL_DEDICATED_GAIN 0x0001 -#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001 -#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000 -#endif - -#ifndef AL_SOFT_buffer_samples -#define AL_SOFT_buffer_samples 1 -/* Channel configurations */ -#define AL_MONO_SOFT 0x1500 -#define AL_STEREO_SOFT 0x1501 -#define AL_REAR_SOFT 0x1502 -#define AL_QUAD_SOFT 0x1503 -#define AL_5POINT1_SOFT 0x1504 -#define AL_6POINT1_SOFT 0x1505 -#define AL_7POINT1_SOFT 0x1506 - -/* Sample types */ -#define AL_BYTE_SOFT 0x1400 -#define AL_UNSIGNED_BYTE_SOFT 0x1401 -#define AL_SHORT_SOFT 0x1402 -#define AL_UNSIGNED_SHORT_SOFT 0x1403 -#define AL_INT_SOFT 0x1404 -#define AL_UNSIGNED_INT_SOFT 0x1405 -#define AL_FLOAT_SOFT 0x1406 -#define AL_DOUBLE_SOFT 0x1407 -#define AL_BYTE3_SOFT 0x1408 -#define AL_UNSIGNED_BYTE3_SOFT 0x1409 - -/* Storage formats */ -#define AL_MONO8_SOFT 0x1100 -#define AL_MONO16_SOFT 0x1101 -#define AL_MONO32F_SOFT 0x10010 -#define AL_STEREO8_SOFT 0x1102 -#define AL_STEREO16_SOFT 0x1103 -#define AL_STEREO32F_SOFT 0x10011 -#define AL_QUAD8_SOFT 0x1204 -#define AL_QUAD16_SOFT 0x1205 -#define AL_QUAD32F_SOFT 0x1206 -#define AL_REAR8_SOFT 0x1207 -#define AL_REAR16_SOFT 0x1208 -#define AL_REAR32F_SOFT 0x1209 -#define AL_5POINT1_8_SOFT 0x120A -#define AL_5POINT1_16_SOFT 0x120B -#define AL_5POINT1_32F_SOFT 0x120C -#define AL_6POINT1_8_SOFT 0x120D -#define AL_6POINT1_16_SOFT 0x120E -#define AL_6POINT1_32F_SOFT 0x120F -#define AL_7POINT1_8_SOFT 0x1210 -#define AL_7POINT1_16_SOFT 0x1211 -#define AL_7POINT1_32F_SOFT 0x1212 - -/* Buffer attributes */ -#define AL_INTERNAL_FORMAT_SOFT 0x2008 -#define AL_BYTE_LENGTH_SOFT 0x2009 -#define AL_SAMPLE_LENGTH_SOFT 0x200A -#define AL_SEC_LENGTH_SOFT 0x200B - -typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); -typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); -typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); -typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); -#ifdef AL_ALEXT_PROTOTYPES -AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); -AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); -AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data); -AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); -#endif -#endif - -#ifndef AL_SOFT_direct_channels -#define AL_SOFT_direct_channels 1 -#define AL_DIRECT_CHANNELS_SOFT 0x1033 -#endif - -#ifndef ALC_SOFT_loopback -#define ALC_SOFT_loopback 1 -#define ALC_FORMAT_CHANNELS_SOFT 0x1990 -#define ALC_FORMAT_TYPE_SOFT 0x1991 - -/* Sample types */ -#define ALC_BYTE_SOFT 0x1400 -#define ALC_UNSIGNED_BYTE_SOFT 0x1401 -#define ALC_SHORT_SOFT 0x1402 -#define ALC_UNSIGNED_SHORT_SOFT 0x1403 -#define ALC_INT_SOFT 0x1404 -#define ALC_UNSIGNED_INT_SOFT 0x1405 -#define ALC_FLOAT_SOFT 0x1406 - -/* Channel configurations */ -#define ALC_MONO_SOFT 0x1500 -#define ALC_STEREO_SOFT 0x1501 -#define ALC_QUAD_SOFT 0x1503 -#define ALC_5POINT1_SOFT 0x1504 -#define ALC_6POINT1_SOFT 0x1505 -#define ALC_7POINT1_SOFT 0x1506 - -typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); -typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); -typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); -#ifdef AL_ALEXT_PROTOTYPES -ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName); -ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); -ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); -#endif -#endif - -#ifndef AL_EXT_STEREO_ANGLES -#define AL_EXT_STEREO_ANGLES 1 -#define AL_STEREO_ANGLES 0x1030 -#endif - -#ifndef AL_EXT_SOURCE_RADIUS -#define AL_EXT_SOURCE_RADIUS 1 -#define AL_SOURCE_RADIUS 0x1031 -#endif - -#ifndef AL_SOFT_source_latency -#define AL_SOFT_source_latency 1 -#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200 -#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201 -typedef int64_t ALint64SOFT; -typedef uint64_t ALuint64SOFT; -typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble); -typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble); -typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*); -typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*); -typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*); -typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*); -typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT); -typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT); -typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*); -typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*); -typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*); -typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*); -#ifdef AL_ALEXT_PROTOTYPES -AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value); -AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3); -AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values); -AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value); -AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3); -AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values); -AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value); -AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3); -AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values); -AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value); -AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3); -AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values); -#endif -#endif - -#ifndef ALC_EXT_DEFAULT_FILTER_ORDER -#define ALC_EXT_DEFAULT_FILTER_ORDER 1 -#define ALC_DEFAULT_FILTER_ORDER 0x1100 -#endif - -#ifndef AL_SOFT_deferred_updates -#define AL_SOFT_deferred_updates 1 -#define AL_DEFERRED_UPDATES_SOFT 0xC002 -typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); -typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); -#ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); -AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); -#endif -#endif - -#ifndef AL_SOFT_block_alignment -#define AL_SOFT_block_alignment 1 -#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C -#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D -#endif - -#ifndef AL_SOFT_MSADPCM -#define AL_SOFT_MSADPCM 1 -#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302 -#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303 -#endif - -#ifndef AL_SOFT_source_length -#define AL_SOFT_source_length 1 -/*#define AL_BYTE_LENGTH_SOFT 0x2009*/ -/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ -/*#define AL_SEC_LENGTH_SOFT 0x200B*/ -#endif - -#ifndef ALC_SOFT_pause_device -#define ALC_SOFT_pause_device 1 -typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device); -typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device); -#ifdef AL_ALEXT_PROTOTYPES -ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device); -ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device); -#endif -#endif - -#ifndef AL_EXT_BFORMAT -#define AL_EXT_BFORMAT 1 -#define AL_FORMAT_BFORMAT2D_8 0x20021 -#define AL_FORMAT_BFORMAT2D_16 0x20022 -#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023 -#define AL_FORMAT_BFORMAT3D_8 0x20031 -#define AL_FORMAT_BFORMAT3D_16 0x20032 -#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033 -#endif - -#ifndef AL_EXT_MULAW_BFORMAT -#define AL_EXT_MULAW_BFORMAT 1 -#define AL_FORMAT_BFORMAT2D_MULAW 0x10031 -#define AL_FORMAT_BFORMAT3D_MULAW 0x10032 -#endif - -#ifndef ALC_SOFT_HRTF -#define ALC_SOFT_HRTF 1 -#define ALC_HRTF_SOFT 0x1992 -#define ALC_DONT_CARE_SOFT 0x0002 -#define ALC_HRTF_STATUS_SOFT 0x1993 -#define ALC_HRTF_DISABLED_SOFT 0x0000 -#define ALC_HRTF_ENABLED_SOFT 0x0001 -#define ALC_HRTF_DENIED_SOFT 0x0002 -#define ALC_HRTF_REQUIRED_SOFT 0x0003 -#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004 -#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005 -#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994 -#define ALC_HRTF_SPECIFIER_SOFT 0x1995 -#define ALC_HRTF_ID_SOFT 0x1996 -typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index); -typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs); -#ifdef AL_ALEXT_PROTOTYPES -ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index); -ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs); -#endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/external/openal_soft/include/AL/efx-creative.h b/src/external/openal_soft/include/AL/efx-creative.h deleted file mode 100644 index 0a04c982..00000000 --- a/src/external/openal_soft/include/AL/efx-creative.h +++ /dev/null @@ -1,3 +0,0 @@ -/* The tokens that would be defined here are already defined in efx.h. This - * empty file is here to provide compatibility with Windows-based projects - * that would include it. */ diff --git a/src/external/openal_soft/include/AL/efx-presets.h b/src/external/openal_soft/include/AL/efx-presets.h deleted file mode 100644 index 8539fd51..00000000 --- a/src/external/openal_soft/include/AL/efx-presets.h +++ /dev/null @@ -1,402 +0,0 @@ -/* Reverb presets for EFX */ - -#ifndef EFX_PRESETS_H -#define EFX_PRESETS_H - -#ifndef EFXEAXREVERBPROPERTIES_DEFINED -#define EFXEAXREVERBPROPERTIES_DEFINED -typedef struct { - float flDensity; - float flDiffusion; - float flGain; - float flGainHF; - float flGainLF; - float flDecayTime; - float flDecayHFRatio; - float flDecayLFRatio; - float flReflectionsGain; - float flReflectionsDelay; - float flReflectionsPan[3]; - float flLateReverbGain; - float flLateReverbDelay; - float flLateReverbPan[3]; - float flEchoTime; - float flEchoDepth; - float flModulationTime; - float flModulationDepth; - float flAirAbsorptionGainHF; - float flHFReference; - float flLFReference; - float flRoomRolloffFactor; - int iDecayHFLimit; -} EFXEAXREVERBPROPERTIES, *LPEFXEAXREVERBPROPERTIES; -#endif - -/* Default Presets */ - -#define EFX_REVERB_PRESET_GENERIC \ - { 1.0000f, 1.0000f, 0.3162f, 0.8913f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PADDEDCELL \ - { 0.1715f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.1700f, 0.1000f, 1.0000f, 0.2500f, 0.0010f, { 0.0000f, 0.0000f, 0.0000f }, 1.2691f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ROOM \ - { 0.4287f, 1.0000f, 0.3162f, 0.5929f, 1.0000f, 0.4000f, 0.8300f, 1.0000f, 0.1503f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.0629f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_BATHROOM \ - { 0.1715f, 1.0000f, 0.3162f, 0.2512f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.6531f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 3.2734f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_LIVINGROOM \ - { 0.9766f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.5000f, 0.1000f, 1.0000f, 0.2051f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2805f, 0.0040f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_STONEROOM \ - { 1.0000f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 2.3100f, 0.6400f, 1.0000f, 0.4411f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1003f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_AUDITORIUM \ - { 1.0000f, 1.0000f, 0.3162f, 0.5781f, 1.0000f, 4.3200f, 0.5900f, 1.0000f, 0.4032f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7170f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CONCERTHALL \ - { 1.0000f, 1.0000f, 0.3162f, 0.5623f, 1.0000f, 3.9200f, 0.7000f, 1.0000f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.9977f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CAVE \ - { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 2.9100f, 1.3000f, 1.0000f, 0.5000f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.7063f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_ARENA \ - { 1.0000f, 1.0000f, 0.3162f, 0.4477f, 1.0000f, 7.2400f, 0.3300f, 1.0000f, 0.2612f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.0186f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_HANGAR \ - { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 10.0500f, 0.2300f, 1.0000f, 0.5000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2560f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CARPETEDHALLWAY \ - { 0.4287f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 0.3000f, 0.1000f, 1.0000f, 0.1215f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.1531f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_HALLWAY \ - { 0.3645f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 1.4900f, 0.5900f, 1.0000f, 0.2458f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.6615f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_STONECORRIDOR \ - { 1.0000f, 1.0000f, 0.3162f, 0.7612f, 1.0000f, 2.7000f, 0.7900f, 1.0000f, 0.2472f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 1.5758f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ALLEY \ - { 1.0000f, 0.3000f, 0.3162f, 0.7328f, 1.0000f, 1.4900f, 0.8600f, 1.0000f, 0.2500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.9954f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.9500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FOREST \ - { 1.0000f, 0.3000f, 0.3162f, 0.0224f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.0525f, 0.1620f, { 0.0000f, 0.0000f, 0.0000f }, 0.7682f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CITY \ - { 1.0000f, 0.5000f, 0.3162f, 0.3981f, 1.0000f, 1.4900f, 0.6700f, 1.0000f, 0.0730f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1427f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_MOUNTAINS \ - { 1.0000f, 0.2700f, 0.3162f, 0.0562f, 1.0000f, 1.4900f, 0.2100f, 1.0000f, 0.0407f, 0.3000f, { 0.0000f, 0.0000f, 0.0000f }, 0.1919f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_QUARRY \ - { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0000f, 0.0610f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.7000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PLAIN \ - { 1.0000f, 0.2100f, 0.3162f, 0.1000f, 1.0000f, 1.4900f, 0.5000f, 1.0000f, 0.0585f, 0.1790f, { 0.0000f, 0.0000f, 0.0000f }, 0.1089f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PARKINGLOT \ - { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 1.6500f, 1.5000f, 1.0000f, 0.2082f, 0.0080f, { 0.0000f, 0.0000f, 0.0000f }, 0.2652f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_SEWERPIPE \ - { 0.3071f, 0.8000f, 0.3162f, 0.3162f, 1.0000f, 2.8100f, 0.1400f, 1.0000f, 1.6387f, 0.0140f, { 0.0000f, 0.0000f, 0.0000f }, 3.2471f, 0.0210f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_UNDERWATER \ - { 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DRUGGED \ - { 0.4287f, 0.5000f, 0.3162f, 1.0000f, 1.0000f, 8.3900f, 1.3900f, 1.0000f, 0.8760f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 3.1081f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_DIZZY \ - { 0.3645f, 0.6000f, 0.3162f, 0.6310f, 1.0000f, 17.2300f, 0.5600f, 1.0000f, 0.1392f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4937f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.8100f, 0.3100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_PSYCHOTIC \ - { 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -/* Castle Presets */ - -#define EFX_REVERB_PRESET_CASTLE_SMALLROOM \ - { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 1.2200f, 0.8300f, 0.3100f, 0.8913f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_SHORTPASSAGE \ - { 1.0000f, 0.8900f, 0.3162f, 0.3162f, 0.1000f, 2.3200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_MEDIUMROOM \ - { 1.0000f, 0.9300f, 0.3162f, 0.2818f, 0.1000f, 2.0400f, 0.8300f, 0.4600f, 0.6310f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1550f, 0.0300f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_LARGEROOM \ - { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.1259f, 2.5300f, 0.8300f, 0.5000f, 0.4467f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1850f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_LONGPASSAGE \ - { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 3.4200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_HALL \ - { 1.0000f, 0.8100f, 0.3162f, 0.2818f, 0.1778f, 3.1400f, 0.7900f, 0.6200f, 0.1778f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_CUPBOARD \ - { 1.0000f, 0.8900f, 0.3162f, 0.2818f, 0.1000f, 0.6700f, 0.8700f, 0.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 3.5481f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CASTLE_COURTYARD \ - { 1.0000f, 0.4200f, 0.3162f, 0.4467f, 0.1995f, 2.1300f, 0.6100f, 0.2300f, 0.2239f, 0.1600f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3700f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_CASTLE_ALCOVE \ - { 1.0000f, 0.8900f, 0.3162f, 0.5012f, 0.1000f, 1.6400f, 0.8700f, 0.3100f, 1.0000f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } - -/* Factory Presets */ - -#define EFX_REVERB_PRESET_FACTORY_SMALLROOM \ - { 0.3645f, 0.8200f, 0.3162f, 0.7943f, 0.5012f, 1.7200f, 0.6500f, 1.3100f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.1190f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_SHORTPASSAGE \ - { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 2.5300f, 0.6500f, 1.3100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_MEDIUMROOM \ - { 0.4287f, 0.8200f, 0.2512f, 0.7943f, 0.5012f, 2.7600f, 0.6500f, 1.3100f, 0.2818f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1740f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_LARGEROOM \ - { 0.4287f, 0.7500f, 0.2512f, 0.7079f, 0.6310f, 4.2400f, 0.5100f, 1.3100f, 0.1778f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2310f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_LONGPASSAGE \ - { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 4.0600f, 0.6500f, 1.3100f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_HALL \ - { 0.4287f, 0.7500f, 0.3162f, 0.7079f, 0.6310f, 7.4300f, 0.5100f, 1.3100f, 0.0631f, 0.0730f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_CUPBOARD \ - { 0.3071f, 0.6300f, 0.2512f, 0.7943f, 0.5012f, 0.4900f, 0.6500f, 1.3100f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.1070f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_COURTYARD \ - { 0.3071f, 0.5700f, 0.3162f, 0.3162f, 0.6310f, 2.3200f, 0.2900f, 0.5600f, 0.2239f, 0.1400f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2900f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_FACTORY_ALCOVE \ - { 0.3645f, 0.5900f, 0.2512f, 0.7943f, 0.5012f, 3.1400f, 0.6500f, 1.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1140f, 0.1000f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } - -/* Ice Palace Presets */ - -#define EFX_REVERB_PRESET_ICEPALACE_SMALLROOM \ - { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 1.5100f, 1.5300f, 0.2700f, 0.8913f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1640f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_SHORTPASSAGE \ - { 1.0000f, 0.7500f, 0.3162f, 0.5623f, 0.2818f, 1.7900f, 1.4600f, 0.2800f, 0.5012f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_MEDIUMROOM \ - { 1.0000f, 0.8700f, 0.3162f, 0.5623f, 0.4467f, 2.2200f, 1.5300f, 0.3200f, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_LARGEROOM \ - { 1.0000f, 0.8100f, 0.3162f, 0.5623f, 0.4467f, 3.1400f, 1.5300f, 0.3200f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_LONGPASSAGE \ - { 1.0000f, 0.7700f, 0.3162f, 0.5623f, 0.3981f, 3.0100f, 1.4600f, 0.2800f, 0.7943f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.0400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_HALL \ - { 1.0000f, 0.7600f, 0.3162f, 0.4467f, 0.5623f, 5.4900f, 1.5300f, 0.3800f, 0.1122f, 0.0540f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0520f, { 0.0000f, 0.0000f, 0.0000f }, 0.2260f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_CUPBOARD \ - { 1.0000f, 0.8300f, 0.3162f, 0.5012f, 0.2239f, 0.7600f, 1.5300f, 0.2600f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1430f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_COURTYARD \ - { 1.0000f, 0.5900f, 0.3162f, 0.2818f, 0.3162f, 2.0400f, 1.2000f, 0.3800f, 0.3162f, 0.1730f, { 0.0000f, 0.0000f, 0.0000f }, 0.3162f, 0.0430f, { 0.0000f, 0.0000f, 0.0000f }, 0.2350f, 0.4800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_ICEPALACE_ALCOVE \ - { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 2.7600f, 1.4600f, 0.2800f, 1.1220f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1610f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } - -/* Space Station Presets */ - -#define EFX_REVERB_PRESET_SPACESTATION_SMALLROOM \ - { 0.2109f, 0.7000f, 0.3162f, 0.7079f, 0.8913f, 1.7200f, 0.8200f, 0.5500f, 0.7943f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 0.1880f, 0.2600f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_SHORTPASSAGE \ - { 0.2109f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 3.5700f, 0.5000f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1720f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_MEDIUMROOM \ - { 0.2109f, 0.7500f, 0.3162f, 0.6310f, 0.8913f, 3.0100f, 0.5000f, 0.5500f, 0.3981f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2090f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_LARGEROOM \ - { 0.3645f, 0.8100f, 0.3162f, 0.6310f, 0.8913f, 3.8900f, 0.3800f, 0.6100f, 0.3162f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2330f, 0.2800f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_LONGPASSAGE \ - { 0.4287f, 0.8200f, 0.3162f, 0.6310f, 0.8913f, 4.6200f, 0.6200f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_HALL \ - { 0.4287f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 7.1100f, 0.3800f, 0.6100f, 0.1778f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2500f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_CUPBOARD \ - { 0.1715f, 0.5600f, 0.3162f, 0.7079f, 0.8913f, 0.7900f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1810f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPACESTATION_ALCOVE \ - { 0.2109f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.1600f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1920f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } - -/* Wooden Galleon Presets */ - -#define EFX_REVERB_PRESET_WOODEN_SMALLROOM \ - { 1.0000f, 1.0000f, 0.3162f, 0.1122f, 0.3162f, 0.7900f, 0.3200f, 0.8700f, 1.0000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_SHORTPASSAGE \ - { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.7500f, 0.5000f, 0.8700f, 0.8913f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_MEDIUMROOM \ - { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.2818f, 1.4700f, 0.4200f, 0.8200f, 0.8913f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_LARGEROOM \ - { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.2818f, 2.6500f, 0.3300f, 0.8200f, 0.8913f, 0.0660f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_LONGPASSAGE \ - { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.3162f, 1.9900f, 0.4000f, 0.7900f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4467f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_HALL \ - { 1.0000f, 1.0000f, 0.3162f, 0.0794f, 0.2818f, 3.4500f, 0.3000f, 0.8200f, 0.8913f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_CUPBOARD \ - { 1.0000f, 1.0000f, 0.3162f, 0.1413f, 0.3162f, 0.5600f, 0.4600f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_COURTYARD \ - { 1.0000f, 0.6500f, 0.3162f, 0.0794f, 0.3162f, 1.7900f, 0.3500f, 0.7900f, 0.5623f, 0.1230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_WOODEN_ALCOVE \ - { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.2200f, 0.6200f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } - -/* Sports Presets */ - -#define EFX_REVERB_PRESET_SPORT_EMPTYSTADIUM \ - { 1.0000f, 1.0000f, 0.3162f, 0.4467f, 0.7943f, 6.2600f, 0.5100f, 1.1000f, 0.0631f, 0.1830f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPORT_SQUASHCOURT \ - { 1.0000f, 0.7500f, 0.3162f, 0.3162f, 0.7943f, 2.2200f, 0.9100f, 1.1600f, 0.4467f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1260f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPORT_SMALLSWIMMINGPOOL \ - { 1.0000f, 0.7000f, 0.3162f, 0.7943f, 0.8913f, 2.7600f, 1.2500f, 1.1400f, 0.6310f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_SPORT_LARGESWIMMINGPOOL \ - { 1.0000f, 0.8200f, 0.3162f, 0.7943f, 1.0000f, 5.4900f, 1.3100f, 1.1400f, 0.4467f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2220f, 0.5500f, 1.1590f, 0.2100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_SPORT_GYMNASIUM \ - { 1.0000f, 0.8100f, 0.3162f, 0.4467f, 0.8913f, 3.1400f, 1.0600f, 1.3500f, 0.3981f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0450f, { 0.0000f, 0.0000f, 0.0000f }, 0.1460f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPORT_FULLSTADIUM \ - { 1.0000f, 1.0000f, 0.3162f, 0.0708f, 0.7943f, 5.2500f, 0.1700f, 0.8000f, 0.1000f, 0.1880f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SPORT_STADIUMTANNOY \ - { 1.0000f, 0.7800f, 0.3162f, 0.5623f, 0.5012f, 2.5300f, 0.8800f, 0.6800f, 0.2818f, 0.2300f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -/* Prefab Presets */ - -#define EFX_REVERB_PRESET_PREFAB_WORKSHOP \ - { 0.4287f, 1.0000f, 0.3162f, 0.1413f, 0.3981f, 0.7600f, 1.0000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_PREFAB_SCHOOLROOM \ - { 0.4022f, 0.6900f, 0.3162f, 0.6310f, 0.5012f, 0.9800f, 0.4500f, 0.1800f, 1.4125f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PREFAB_PRACTISEROOM \ - { 0.4022f, 0.8700f, 0.3162f, 0.3981f, 0.5012f, 1.1200f, 0.5600f, 0.1800f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PREFAB_OUTHOUSE \ - { 1.0000f, 0.8200f, 0.3162f, 0.1122f, 0.1585f, 1.3800f, 0.3800f, 0.3500f, 0.8913f, 0.0240f, { 0.0000f, 0.0000f, -0.0000f }, 0.6310f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.1210f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_PREFAB_CARAVAN \ - { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.1259f, 0.4300f, 1.5000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -/* Dome and Pipe Presets */ - -#define EFX_REVERB_PRESET_DOME_TOMB \ - { 1.0000f, 0.7900f, 0.3162f, 0.3548f, 0.2239f, 4.1800f, 0.2100f, 0.1000f, 0.3868f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 1.6788f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_PIPE_SMALL \ - { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 5.0400f, 0.1000f, 0.1000f, 0.5012f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 2.5119f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DOME_SAINTPAULS \ - { 1.0000f, 0.8700f, 0.3162f, 0.3548f, 0.2239f, 10.4800f, 0.1900f, 0.1000f, 0.1778f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0420f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PIPE_LONGTHIN \ - { 0.2560f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 9.2100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_PIPE_LARGE \ - { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 8.4500f, 0.1000f, 0.1000f, 0.3981f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_PIPE_RESONANT \ - { 0.1373f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 6.8100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } - -/* Outdoors Presets */ - -#define EFX_REVERB_PRESET_OUTDOORS_BACKYARD \ - { 1.0000f, 0.4500f, 0.3162f, 0.2512f, 0.5012f, 1.1200f, 0.3400f, 0.4600f, 0.4467f, 0.0690f, { 0.0000f, 0.0000f, -0.0000f }, 0.7079f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_OUTDOORS_ROLLINGPLAINS \ - { 1.0000f, 0.0000f, 0.3162f, 0.0112f, 0.6310f, 2.1300f, 0.2100f, 0.4600f, 0.1778f, 0.3000f, { 0.0000f, 0.0000f, -0.0000f }, 0.4467f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_OUTDOORS_DEEPCANYON \ - { 1.0000f, 0.7400f, 0.3162f, 0.1778f, 0.6310f, 3.8900f, 0.2100f, 0.4600f, 0.3162f, 0.2230f, { 0.0000f, 0.0000f, -0.0000f }, 0.3548f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_OUTDOORS_CREEK \ - { 1.0000f, 0.3500f, 0.3162f, 0.1778f, 0.5012f, 2.1300f, 0.2100f, 0.4600f, 0.3981f, 0.1150f, { 0.0000f, 0.0000f, -0.0000f }, 0.1995f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_OUTDOORS_VALLEY \ - { 1.0000f, 0.2800f, 0.3162f, 0.0282f, 0.1585f, 2.8800f, 0.2600f, 0.3500f, 0.1413f, 0.2630f, { 0.0000f, 0.0000f, -0.0000f }, 0.3981f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } - -/* Mood Presets */ - -#define EFX_REVERB_PRESET_MOOD_HEAVEN \ - { 1.0000f, 0.9400f, 0.3162f, 0.7943f, 0.4467f, 5.0400f, 1.1200f, 0.5600f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0800f, 2.7420f, 0.0500f, 0.9977f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_MOOD_HELL \ - { 1.0000f, 0.5700f, 0.3162f, 0.3548f, 0.4467f, 3.5700f, 0.4900f, 2.0000f, 0.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1100f, 0.0400f, 2.1090f, 0.5200f, 0.9943f, 5000.0000f, 139.5000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_MOOD_MEMORY \ - { 1.0000f, 0.8500f, 0.3162f, 0.6310f, 0.3548f, 4.0600f, 0.8200f, 0.5600f, 0.0398f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.4740f, 0.4500f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -/* Driving Presets */ - -#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \ - { 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \ - { 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_DRIVING_INCAR_RACER \ - { 0.0832f, 0.8000f, 0.3162f, 1.0000f, 0.7943f, 0.1700f, 2.0000f, 0.4100f, 1.7783f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DRIVING_INCAR_SPORTS \ - { 0.0832f, 0.8000f, 0.3162f, 0.6310f, 1.0000f, 0.1700f, 0.7500f, 0.4100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DRIVING_INCAR_LUXURY \ - { 0.2560f, 1.0000f, 0.3162f, 0.1000f, 0.5012f, 0.1300f, 0.4100f, 0.4600f, 0.7943f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_DRIVING_FULLGRANDSTAND \ - { 1.0000f, 1.0000f, 0.3162f, 0.2818f, 0.6310f, 3.0100f, 1.3700f, 1.2800f, 0.3548f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.1778f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_DRIVING_EMPTYGRANDSTAND \ - { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 0.7943f, 4.6200f, 1.7500f, 1.4000f, 0.2082f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_DRIVING_TUNNEL \ - { 1.0000f, 0.8100f, 0.3162f, 0.3981f, 0.8913f, 3.4200f, 0.9400f, 1.3100f, 0.7079f, 0.0510f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.0500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 155.3000f, 0.0000f, 0x1 } - -/* City Presets */ - -#define EFX_REVERB_PRESET_CITY_STREETS \ - { 1.0000f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.7900f, 1.1200f, 0.9100f, 0.2818f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 0.1995f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CITY_SUBWAY \ - { 1.0000f, 0.7400f, 0.3162f, 0.7079f, 0.8913f, 3.0100f, 1.2300f, 0.9100f, 0.7079f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CITY_MUSEUM \ - { 1.0000f, 0.8200f, 0.3162f, 0.1778f, 0.1778f, 3.2800f, 1.4000f, 0.5700f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_CITY_LIBRARY \ - { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.0891f, 2.7600f, 0.8900f, 0.4100f, 0.3548f, 0.0290f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } - -#define EFX_REVERB_PRESET_CITY_UNDERPASS \ - { 1.0000f, 0.8200f, 0.3162f, 0.4467f, 0.8913f, 3.5700f, 1.1200f, 0.9100f, 0.3981f, 0.0590f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1400f, 0.2500f, 0.0000f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CITY_ABANDONED \ - { 1.0000f, 0.6900f, 0.3162f, 0.7943f, 0.8913f, 3.2800f, 1.1700f, 0.9100f, 0.4467f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9966f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -/* Misc. Presets */ - -#define EFX_REVERB_PRESET_DUSTYROOM \ - { 0.3645f, 0.5600f, 0.3162f, 0.7943f, 0.7079f, 1.7900f, 0.3800f, 0.2100f, 0.5012f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0060f, { 0.0000f, 0.0000f, 0.0000f }, 0.2020f, 0.0500f, 0.2500f, 0.0000f, 0.9886f, 13046.0000f, 163.3000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_CHAPEL \ - { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 1.0000f, 4.6200f, 0.6400f, 1.2300f, 0.4467f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.1100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } - -#define EFX_REVERB_PRESET_SMALLWATERROOM \ - { 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } - -#endif /* EFX_PRESETS_H */ diff --git a/src/external/openal_soft/include/AL/efx.h b/src/external/openal_soft/include/AL/efx.h deleted file mode 100644 index 57766983..00000000 --- a/src/external/openal_soft/include/AL/efx.h +++ /dev/null @@ -1,761 +0,0 @@ -#ifndef AL_EFX_H -#define AL_EFX_H - - -#include "alc.h" -#include "al.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ALC_EXT_EFX_NAME "ALC_EXT_EFX" - -#define ALC_EFX_MAJOR_VERSION 0x20001 -#define ALC_EFX_MINOR_VERSION 0x20002 -#define ALC_MAX_AUXILIARY_SENDS 0x20003 - - -/* Listener properties. */ -#define AL_METERS_PER_UNIT 0x20004 - -/* Source properties. */ -#define AL_DIRECT_FILTER 0x20005 -#define AL_AUXILIARY_SEND_FILTER 0x20006 -#define AL_AIR_ABSORPTION_FACTOR 0x20007 -#define AL_ROOM_ROLLOFF_FACTOR 0x20008 -#define AL_CONE_OUTER_GAINHF 0x20009 -#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A -#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B -#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C - - -/* Effect properties. */ - -/* Reverb effect parameters */ -#define AL_REVERB_DENSITY 0x0001 -#define AL_REVERB_DIFFUSION 0x0002 -#define AL_REVERB_GAIN 0x0003 -#define AL_REVERB_GAINHF 0x0004 -#define AL_REVERB_DECAY_TIME 0x0005 -#define AL_REVERB_DECAY_HFRATIO 0x0006 -#define AL_REVERB_REFLECTIONS_GAIN 0x0007 -#define AL_REVERB_REFLECTIONS_DELAY 0x0008 -#define AL_REVERB_LATE_REVERB_GAIN 0x0009 -#define AL_REVERB_LATE_REVERB_DELAY 0x000A -#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B -#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C -#define AL_REVERB_DECAY_HFLIMIT 0x000D - -/* EAX Reverb effect parameters */ -#define AL_EAXREVERB_DENSITY 0x0001 -#define AL_EAXREVERB_DIFFUSION 0x0002 -#define AL_EAXREVERB_GAIN 0x0003 -#define AL_EAXREVERB_GAINHF 0x0004 -#define AL_EAXREVERB_GAINLF 0x0005 -#define AL_EAXREVERB_DECAY_TIME 0x0006 -#define AL_EAXREVERB_DECAY_HFRATIO 0x0007 -#define AL_EAXREVERB_DECAY_LFRATIO 0x0008 -#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009 -#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A -#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B -#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C -#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D -#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E -#define AL_EAXREVERB_ECHO_TIME 0x000F -#define AL_EAXREVERB_ECHO_DEPTH 0x0010 -#define AL_EAXREVERB_MODULATION_TIME 0x0011 -#define AL_EAXREVERB_MODULATION_DEPTH 0x0012 -#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013 -#define AL_EAXREVERB_HFREFERENCE 0x0014 -#define AL_EAXREVERB_LFREFERENCE 0x0015 -#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016 -#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017 - -/* Chorus effect parameters */ -#define AL_CHORUS_WAVEFORM 0x0001 -#define AL_CHORUS_PHASE 0x0002 -#define AL_CHORUS_RATE 0x0003 -#define AL_CHORUS_DEPTH 0x0004 -#define AL_CHORUS_FEEDBACK 0x0005 -#define AL_CHORUS_DELAY 0x0006 - -/* Distortion effect parameters */ -#define AL_DISTORTION_EDGE 0x0001 -#define AL_DISTORTION_GAIN 0x0002 -#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003 -#define AL_DISTORTION_EQCENTER 0x0004 -#define AL_DISTORTION_EQBANDWIDTH 0x0005 - -/* Echo effect parameters */ -#define AL_ECHO_DELAY 0x0001 -#define AL_ECHO_LRDELAY 0x0002 -#define AL_ECHO_DAMPING 0x0003 -#define AL_ECHO_FEEDBACK 0x0004 -#define AL_ECHO_SPREAD 0x0005 - -/* Flanger effect parameters */ -#define AL_FLANGER_WAVEFORM 0x0001 -#define AL_FLANGER_PHASE 0x0002 -#define AL_FLANGER_RATE 0x0003 -#define AL_FLANGER_DEPTH 0x0004 -#define AL_FLANGER_FEEDBACK 0x0005 -#define AL_FLANGER_DELAY 0x0006 - -/* Frequency shifter effect parameters */ -#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001 -#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002 -#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003 - -/* Vocal morpher effect parameters */ -#define AL_VOCAL_MORPHER_PHONEMEA 0x0001 -#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002 -#define AL_VOCAL_MORPHER_PHONEMEB 0x0003 -#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004 -#define AL_VOCAL_MORPHER_WAVEFORM 0x0005 -#define AL_VOCAL_MORPHER_RATE 0x0006 - -/* Pitchshifter effect parameters */ -#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001 -#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002 - -/* Ringmodulator effect parameters */ -#define AL_RING_MODULATOR_FREQUENCY 0x0001 -#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002 -#define AL_RING_MODULATOR_WAVEFORM 0x0003 - -/* Autowah effect parameters */ -#define AL_AUTOWAH_ATTACK_TIME 0x0001 -#define AL_AUTOWAH_RELEASE_TIME 0x0002 -#define AL_AUTOWAH_RESONANCE 0x0003 -#define AL_AUTOWAH_PEAK_GAIN 0x0004 - -/* Compressor effect parameters */ -#define AL_COMPRESSOR_ONOFF 0x0001 - -/* Equalizer effect parameters */ -#define AL_EQUALIZER_LOW_GAIN 0x0001 -#define AL_EQUALIZER_LOW_CUTOFF 0x0002 -#define AL_EQUALIZER_MID1_GAIN 0x0003 -#define AL_EQUALIZER_MID1_CENTER 0x0004 -#define AL_EQUALIZER_MID1_WIDTH 0x0005 -#define AL_EQUALIZER_MID2_GAIN 0x0006 -#define AL_EQUALIZER_MID2_CENTER 0x0007 -#define AL_EQUALIZER_MID2_WIDTH 0x0008 -#define AL_EQUALIZER_HIGH_GAIN 0x0009 -#define AL_EQUALIZER_HIGH_CUTOFF 0x000A - -/* Effect type */ -#define AL_EFFECT_FIRST_PARAMETER 0x0000 -#define AL_EFFECT_LAST_PARAMETER 0x8000 -#define AL_EFFECT_TYPE 0x8001 - -/* Effect types, used with the AL_EFFECT_TYPE property */ -#define AL_EFFECT_NULL 0x0000 -#define AL_EFFECT_REVERB 0x0001 -#define AL_EFFECT_CHORUS 0x0002 -#define AL_EFFECT_DISTORTION 0x0003 -#define AL_EFFECT_ECHO 0x0004 -#define AL_EFFECT_FLANGER 0x0005 -#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006 -#define AL_EFFECT_VOCAL_MORPHER 0x0007 -#define AL_EFFECT_PITCH_SHIFTER 0x0008 -#define AL_EFFECT_RING_MODULATOR 0x0009 -#define AL_EFFECT_AUTOWAH 0x000A -#define AL_EFFECT_COMPRESSOR 0x000B -#define AL_EFFECT_EQUALIZER 0x000C -#define AL_EFFECT_EAXREVERB 0x8000 - -/* Auxiliary Effect Slot properties. */ -#define AL_EFFECTSLOT_EFFECT 0x0001 -#define AL_EFFECTSLOT_GAIN 0x0002 -#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003 - -/* NULL Auxiliary Slot ID to disable a source send. */ -#define AL_EFFECTSLOT_NULL 0x0000 - - -/* Filter properties. */ - -/* Lowpass filter parameters */ -#define AL_LOWPASS_GAIN 0x0001 -#define AL_LOWPASS_GAINHF 0x0002 - -/* Highpass filter parameters */ -#define AL_HIGHPASS_GAIN 0x0001 -#define AL_HIGHPASS_GAINLF 0x0002 - -/* Bandpass filter parameters */ -#define AL_BANDPASS_GAIN 0x0001 -#define AL_BANDPASS_GAINLF 0x0002 -#define AL_BANDPASS_GAINHF 0x0003 - -/* Filter type */ -#define AL_FILTER_FIRST_PARAMETER 0x0000 -#define AL_FILTER_LAST_PARAMETER 0x8000 -#define AL_FILTER_TYPE 0x8001 - -/* Filter types, used with the AL_FILTER_TYPE property */ -#define AL_FILTER_NULL 0x0000 -#define AL_FILTER_LOWPASS 0x0001 -#define AL_FILTER_HIGHPASS 0x0002 -#define AL_FILTER_BANDPASS 0x0003 - - -/* Effect object function types. */ -typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*); -typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*); -typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint); -typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint); -typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*); -typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat); -typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*); -typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*); -typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*); - -/* Filter object function types. */ -typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*); -typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*); -typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint); -typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint); -typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*); -typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat); -typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*); -typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*); -typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*); - -/* Auxiliary Effect Slot object function types. */ -typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); -typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*); -typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint); -typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint); -typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*); -typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat); -typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*); -typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); -typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*); -typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); - -#ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); -AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects); -AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect); -AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); - -AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); -AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters); -AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter); -AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); - -AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); -AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots); -AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); -#endif - -/* Filter ranges and defaults. */ - -/* Lowpass filter */ -#define AL_LOWPASS_MIN_GAIN (0.0f) -#define AL_LOWPASS_MAX_GAIN (1.0f) -#define AL_LOWPASS_DEFAULT_GAIN (1.0f) - -#define AL_LOWPASS_MIN_GAINHF (0.0f) -#define AL_LOWPASS_MAX_GAINHF (1.0f) -#define AL_LOWPASS_DEFAULT_GAINHF (1.0f) - -/* Highpass filter */ -#define AL_HIGHPASS_MIN_GAIN (0.0f) -#define AL_HIGHPASS_MAX_GAIN (1.0f) -#define AL_HIGHPASS_DEFAULT_GAIN (1.0f) - -#define AL_HIGHPASS_MIN_GAINLF (0.0f) -#define AL_HIGHPASS_MAX_GAINLF (1.0f) -#define AL_HIGHPASS_DEFAULT_GAINLF (1.0f) - -/* Bandpass filter */ -#define AL_BANDPASS_MIN_GAIN (0.0f) -#define AL_BANDPASS_MAX_GAIN (1.0f) -#define AL_BANDPASS_DEFAULT_GAIN (1.0f) - -#define AL_BANDPASS_MIN_GAINHF (0.0f) -#define AL_BANDPASS_MAX_GAINHF (1.0f) -#define AL_BANDPASS_DEFAULT_GAINHF (1.0f) - -#define AL_BANDPASS_MIN_GAINLF (0.0f) -#define AL_BANDPASS_MAX_GAINLF (1.0f) -#define AL_BANDPASS_DEFAULT_GAINLF (1.0f) - - -/* Effect parameter ranges and defaults. */ - -/* Standard reverb effect */ -#define AL_REVERB_MIN_DENSITY (0.0f) -#define AL_REVERB_MAX_DENSITY (1.0f) -#define AL_REVERB_DEFAULT_DENSITY (1.0f) - -#define AL_REVERB_MIN_DIFFUSION (0.0f) -#define AL_REVERB_MAX_DIFFUSION (1.0f) -#define AL_REVERB_DEFAULT_DIFFUSION (1.0f) - -#define AL_REVERB_MIN_GAIN (0.0f) -#define AL_REVERB_MAX_GAIN (1.0f) -#define AL_REVERB_DEFAULT_GAIN (0.32f) - -#define AL_REVERB_MIN_GAINHF (0.0f) -#define AL_REVERB_MAX_GAINHF (1.0f) -#define AL_REVERB_DEFAULT_GAINHF (0.89f) - -#define AL_REVERB_MIN_DECAY_TIME (0.1f) -#define AL_REVERB_MAX_DECAY_TIME (20.0f) -#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f) - -#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f) -#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f) -#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f) - -#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f) -#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f) -#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) - -#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f) -#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f) -#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) - -#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f) -#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f) -#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) - -#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f) -#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f) -#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) - -#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) -#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) -#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) - -#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) -#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) -#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) - -#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE -#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE -#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE - -/* EAX reverb effect */ -#define AL_EAXREVERB_MIN_DENSITY (0.0f) -#define AL_EAXREVERB_MAX_DENSITY (1.0f) -#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f) - -#define AL_EAXREVERB_MIN_DIFFUSION (0.0f) -#define AL_EAXREVERB_MAX_DIFFUSION (1.0f) -#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f) - -#define AL_EAXREVERB_MIN_GAIN (0.0f) -#define AL_EAXREVERB_MAX_GAIN (1.0f) -#define AL_EAXREVERB_DEFAULT_GAIN (0.32f) - -#define AL_EAXREVERB_MIN_GAINHF (0.0f) -#define AL_EAXREVERB_MAX_GAINHF (1.0f) -#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f) - -#define AL_EAXREVERB_MIN_GAINLF (0.0f) -#define AL_EAXREVERB_MAX_GAINLF (1.0f) -#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f) - -#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f) -#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f) -#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f) - -#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f) -#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f) -#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f) - -#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f) -#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f) -#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f) - -#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f) -#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f) -#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) - -#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f) -#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f) -#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) - -#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f) - -#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f) -#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f) -#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) - -#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f) -#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f) -#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) - -#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f) - -#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f) -#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f) -#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f) - -#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f) -#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f) -#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f) - -#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f) -#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f) -#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f) - -#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f) -#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f) -#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f) - -#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) -#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) -#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) - -#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f) -#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f) -#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f) - -#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f) -#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f) -#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f) - -#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) -#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) -#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) - -#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE -#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE -#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE - -/* Chorus effect */ -#define AL_CHORUS_WAVEFORM_SINUSOID (0) -#define AL_CHORUS_WAVEFORM_TRIANGLE (1) - -#define AL_CHORUS_MIN_WAVEFORM (0) -#define AL_CHORUS_MAX_WAVEFORM (1) -#define AL_CHORUS_DEFAULT_WAVEFORM (1) - -#define AL_CHORUS_MIN_PHASE (-180) -#define AL_CHORUS_MAX_PHASE (180) -#define AL_CHORUS_DEFAULT_PHASE (90) - -#define AL_CHORUS_MIN_RATE (0.0f) -#define AL_CHORUS_MAX_RATE (10.0f) -#define AL_CHORUS_DEFAULT_RATE (1.1f) - -#define AL_CHORUS_MIN_DEPTH (0.0f) -#define AL_CHORUS_MAX_DEPTH (1.0f) -#define AL_CHORUS_DEFAULT_DEPTH (0.1f) - -#define AL_CHORUS_MIN_FEEDBACK (-1.0f) -#define AL_CHORUS_MAX_FEEDBACK (1.0f) -#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f) - -#define AL_CHORUS_MIN_DELAY (0.0f) -#define AL_CHORUS_MAX_DELAY (0.016f) -#define AL_CHORUS_DEFAULT_DELAY (0.016f) - -/* Distortion effect */ -#define AL_DISTORTION_MIN_EDGE (0.0f) -#define AL_DISTORTION_MAX_EDGE (1.0f) -#define AL_DISTORTION_DEFAULT_EDGE (0.2f) - -#define AL_DISTORTION_MIN_GAIN (0.01f) -#define AL_DISTORTION_MAX_GAIN (1.0f) -#define AL_DISTORTION_DEFAULT_GAIN (0.05f) - -#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f) -#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f) -#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f) - -#define AL_DISTORTION_MIN_EQCENTER (80.0f) -#define AL_DISTORTION_MAX_EQCENTER (24000.0f) -#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f) - -#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f) -#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f) -#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f) - -/* Echo effect */ -#define AL_ECHO_MIN_DELAY (0.0f) -#define AL_ECHO_MAX_DELAY (0.207f) -#define AL_ECHO_DEFAULT_DELAY (0.1f) - -#define AL_ECHO_MIN_LRDELAY (0.0f) -#define AL_ECHO_MAX_LRDELAY (0.404f) -#define AL_ECHO_DEFAULT_LRDELAY (0.1f) - -#define AL_ECHO_MIN_DAMPING (0.0f) -#define AL_ECHO_MAX_DAMPING (0.99f) -#define AL_ECHO_DEFAULT_DAMPING (0.5f) - -#define AL_ECHO_MIN_FEEDBACK (0.0f) -#define AL_ECHO_MAX_FEEDBACK (1.0f) -#define AL_ECHO_DEFAULT_FEEDBACK (0.5f) - -#define AL_ECHO_MIN_SPREAD (-1.0f) -#define AL_ECHO_MAX_SPREAD (1.0f) -#define AL_ECHO_DEFAULT_SPREAD (-1.0f) - -/* Flanger effect */ -#define AL_FLANGER_WAVEFORM_SINUSOID (0) -#define AL_FLANGER_WAVEFORM_TRIANGLE (1) - -#define AL_FLANGER_MIN_WAVEFORM (0) -#define AL_FLANGER_MAX_WAVEFORM (1) -#define AL_FLANGER_DEFAULT_WAVEFORM (1) - -#define AL_FLANGER_MIN_PHASE (-180) -#define AL_FLANGER_MAX_PHASE (180) -#define AL_FLANGER_DEFAULT_PHASE (0) - -#define AL_FLANGER_MIN_RATE (0.0f) -#define AL_FLANGER_MAX_RATE (10.0f) -#define AL_FLANGER_DEFAULT_RATE (0.27f) - -#define AL_FLANGER_MIN_DEPTH (0.0f) -#define AL_FLANGER_MAX_DEPTH (1.0f) -#define AL_FLANGER_DEFAULT_DEPTH (1.0f) - -#define AL_FLANGER_MIN_FEEDBACK (-1.0f) -#define AL_FLANGER_MAX_FEEDBACK (1.0f) -#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f) - -#define AL_FLANGER_MIN_DELAY (0.0f) -#define AL_FLANGER_MAX_DELAY (0.004f) -#define AL_FLANGER_DEFAULT_DELAY (0.002f) - -/* Frequency shifter effect */ -#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f) -#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f) -#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f) - -#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0) -#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2) -#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0) - -#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0) -#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1) -#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2) - -#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0) -#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2) -#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0) - -/* Vocal morpher effect */ -#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0) -#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29) -#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0) - -#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24) -#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24) -#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0) - -#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0) -#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29) -#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10) - -#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24) -#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24) -#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0) - -#define AL_VOCAL_MORPHER_PHONEME_A (0) -#define AL_VOCAL_MORPHER_PHONEME_E (1) -#define AL_VOCAL_MORPHER_PHONEME_I (2) -#define AL_VOCAL_MORPHER_PHONEME_O (3) -#define AL_VOCAL_MORPHER_PHONEME_U (4) -#define AL_VOCAL_MORPHER_PHONEME_AA (5) -#define AL_VOCAL_MORPHER_PHONEME_AE (6) -#define AL_VOCAL_MORPHER_PHONEME_AH (7) -#define AL_VOCAL_MORPHER_PHONEME_AO (8) -#define AL_VOCAL_MORPHER_PHONEME_EH (9) -#define AL_VOCAL_MORPHER_PHONEME_ER (10) -#define AL_VOCAL_MORPHER_PHONEME_IH (11) -#define AL_VOCAL_MORPHER_PHONEME_IY (12) -#define AL_VOCAL_MORPHER_PHONEME_UH (13) -#define AL_VOCAL_MORPHER_PHONEME_UW (14) -#define AL_VOCAL_MORPHER_PHONEME_B (15) -#define AL_VOCAL_MORPHER_PHONEME_D (16) -#define AL_VOCAL_MORPHER_PHONEME_F (17) -#define AL_VOCAL_MORPHER_PHONEME_G (18) -#define AL_VOCAL_MORPHER_PHONEME_J (19) -#define AL_VOCAL_MORPHER_PHONEME_K (20) -#define AL_VOCAL_MORPHER_PHONEME_L (21) -#define AL_VOCAL_MORPHER_PHONEME_M (22) -#define AL_VOCAL_MORPHER_PHONEME_N (23) -#define AL_VOCAL_MORPHER_PHONEME_P (24) -#define AL_VOCAL_MORPHER_PHONEME_R (25) -#define AL_VOCAL_MORPHER_PHONEME_S (26) -#define AL_VOCAL_MORPHER_PHONEME_T (27) -#define AL_VOCAL_MORPHER_PHONEME_V (28) -#define AL_VOCAL_MORPHER_PHONEME_Z (29) - -#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0) -#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1) -#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2) - -#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0) -#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2) -#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0) - -#define AL_VOCAL_MORPHER_MIN_RATE (0.0f) -#define AL_VOCAL_MORPHER_MAX_RATE (10.0f) -#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f) - -/* Pitch shifter effect */ -#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12) -#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12) -#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12) - -#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50) -#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50) -#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0) - -/* Ring modulator effect */ -#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f) -#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f) -#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f) - -#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f) -#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f) -#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f) - -#define AL_RING_MODULATOR_SINUSOID (0) -#define AL_RING_MODULATOR_SAWTOOTH (1) -#define AL_RING_MODULATOR_SQUARE (2) - -#define AL_RING_MODULATOR_MIN_WAVEFORM (0) -#define AL_RING_MODULATOR_MAX_WAVEFORM (2) -#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0) - -/* Autowah effect */ -#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f) -#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f) -#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f) - -#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f) -#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f) -#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f) - -#define AL_AUTOWAH_MIN_RESONANCE (2.0f) -#define AL_AUTOWAH_MAX_RESONANCE (1000.0f) -#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f) - -#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f) -#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f) -#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f) - -/* Compressor effect */ -#define AL_COMPRESSOR_MIN_ONOFF (0) -#define AL_COMPRESSOR_MAX_ONOFF (1) -#define AL_COMPRESSOR_DEFAULT_ONOFF (1) - -/* Equalizer effect */ -#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f) -#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f) -#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f) - -#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f) -#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f) -#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f) - -#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f) -#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f) -#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f) - -#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f) -#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f) -#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f) - -#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f) -#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f) -#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f) - -#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f) -#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f) -#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f) - -#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f) -#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f) -#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f) - -#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f) -#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f) -#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f) - -#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f) -#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f) -#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f) - -#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f) -#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f) -#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f) - - -/* Source parameter value ranges and defaults. */ -#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f) -#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f) -#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f) - -#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f) -#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f) -#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) - -#define AL_MIN_CONE_OUTER_GAINHF (0.0f) -#define AL_MAX_CONE_OUTER_GAINHF (1.0f) -#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f) - -#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE -#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE -#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE - -#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE -#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE -#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE - -#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE -#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE -#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE - - -/* Listener parameter value ranges and defaults. */ -#define AL_MIN_METERS_PER_UNIT FLT_MIN -#define AL_MAX_METERS_PER_UNIT FLT_MAX -#define AL_DEFAULT_METERS_PER_UNIT (1.0f) - - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* AL_EFX_H */ diff --git a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a deleted file mode 100644 index 1c4c63c8..00000000 Binary files a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a and /dev/null differ -- cgit v1.2.3 From 34aea08ba26e286e820473c499a31957f77db1a5 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 20:39:59 +0200 Subject: Update to OpenAL Soft 1.17.2 --- src/external/openal_soft/COPYING | 484 +++++++++++++ src/external/openal_soft/include/AL/al.h | 656 ++++++++++++++++++ src/external/openal_soft/include/AL/alc.h | 237 +++++++ src/external/openal_soft/include/AL/alext.h | 438 ++++++++++++ src/external/openal_soft/include/AL/efx-creative.h | 3 + src/external/openal_soft/include/AL/efx-presets.h | 402 +++++++++++ src/external/openal_soft/include/AL/efx.h | 761 +++++++++++++++++++++ src/external/openal_soft/lib/win32/OpenAL32.dll | Bin 0 -> 845045 bytes .../openal_soft/lib/win32/libOpenAL32.dll.a | Bin 0 -> 100246 bytes 9 files changed, 2981 insertions(+) create mode 100644 src/external/openal_soft/COPYING create mode 100644 src/external/openal_soft/include/AL/al.h create mode 100644 src/external/openal_soft/include/AL/alc.h create mode 100644 src/external/openal_soft/include/AL/alext.h create mode 100644 src/external/openal_soft/include/AL/efx-creative.h create mode 100644 src/external/openal_soft/include/AL/efx-presets.h create mode 100644 src/external/openal_soft/include/AL/efx.h create mode 100644 src/external/openal_soft/lib/win32/OpenAL32.dll create mode 100644 src/external/openal_soft/lib/win32/libOpenAL32.dll.a (limited to 'src') diff --git a/src/external/openal_soft/COPYING b/src/external/openal_soft/COPYING new file mode 100644 index 00000000..d0c89786 --- /dev/null +++ b/src/external/openal_soft/COPYING @@ -0,0 +1,484 @@ + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + + Copyright (C) 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/src/external/openal_soft/include/AL/al.h b/src/external/openal_soft/include/AL/al.h new file mode 100644 index 00000000..413b3833 --- /dev/null +++ b/src/external/openal_soft/include/AL/al.h @@ -0,0 +1,656 @@ +#ifndef AL_AL_H +#define AL_AL_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef AL_API + #if defined(AL_LIBTYPE_STATIC) + #define AL_API + #elif defined(_WIN32) + #define AL_API __declspec(dllimport) + #else + #define AL_API extern + #endif +#endif + +#if defined(_WIN32) + #define AL_APIENTRY __cdecl +#else + #define AL_APIENTRY +#endif + + +/** Deprecated macro. */ +#define OPENAL +#define ALAPI AL_API +#define ALAPIENTRY AL_APIENTRY +#define AL_INVALID (-1) +#define AL_ILLEGAL_ENUM AL_INVALID_ENUM +#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION + +/** Supported AL version. */ +#define AL_VERSION_1_0 +#define AL_VERSION_1_1 + +/** 8-bit boolean */ +typedef char ALboolean; + +/** character */ +typedef char ALchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALsizei; + +/** enumerated 32-bit value */ +typedef int ALenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALdouble; + +/** void type (for opaque pointers only) */ +typedef void ALvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/** "no distance model" or "no buffer" */ +#define AL_NONE 0 + +/** Boolean False. */ +#define AL_FALSE 0 + +/** Boolean True. */ +#define AL_TRUE 1 + + +/** + * Relative source. + * Type: ALboolean + * Range: [AL_TRUE, AL_FALSE] + * Default: AL_FALSE + * + * Specifies if the Source has relative coordinates. + */ +#define AL_SOURCE_RELATIVE 0x202 + + +/** + * Inner cone angle, in degrees. + * Type: ALint, ALfloat + * Range: [0 - 360] + * Default: 360 + * + * The angle covered by the inner cone, where the source will not attenuate. + */ +#define AL_CONE_INNER_ANGLE 0x1001 + +/** + * Outer cone angle, in degrees. + * Range: [0 - 360] + * Default: 360 + * + * The angle covered by the outer cone, where the source will be fully + * attenuated. + */ +#define AL_CONE_OUTER_ANGLE 0x1002 + +/** + * Source pitch. + * Type: ALfloat + * Range: [0.5 - 2.0] + * Default: 1.0 + * + * A multiplier for the frequency (sample rate) of the source's buffer. + */ +#define AL_PITCH 0x1003 + +/** + * Source or listener position. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * The source or listener location in three dimensional space. + * + * OpenAL, like OpenGL, uses a right handed coordinate system, where in a + * frontal default view X (thumb) points right, Y points up (index finger), and + * Z points towards the viewer/camera (middle finger). + * + * To switch from a left handed coordinate system, flip the sign on the Z + * coordinate. + */ +#define AL_POSITION 0x1004 + +/** + * Source direction. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * Specifies the current direction in local space. + * A zero-length vector specifies an omni-directional source (cone is ignored). + */ +#define AL_DIRECTION 0x1005 + +/** + * Source or listener velocity. + * Type: ALfloat[3], ALint[3] + * Default: {0, 0, 0} + * + * Specifies the current velocity in local space. + */ +#define AL_VELOCITY 0x1006 + +/** + * Source looping. + * Type: ALboolean + * Range: [AL_TRUE, AL_FALSE] + * Default: AL_FALSE + * + * Specifies whether source is looping. + */ +#define AL_LOOPING 0x1007 + +/** + * Source buffer. + * Type: ALuint + * Range: any valid Buffer. + * + * Specifies the buffer to provide sound samples. + */ +#define AL_BUFFER 0x1009 + +/** + * Source or listener gain. + * Type: ALfloat + * Range: [0.0 - ] + * + * A value of 1.0 means unattenuated. Each division by 2 equals an attenuation + * of about -6dB. Each multiplicaton by 2 equals an amplification of about + * +6dB. + * + * A value of 0.0 is meaningless with respect to a logarithmic scale; it is + * silent. + */ +#define AL_GAIN 0x100A + +/** + * Minimum source gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * The minimum gain allowed for a source, after distance and cone attenation is + * applied (if applicable). + */ +#define AL_MIN_GAIN 0x100D + +/** + * Maximum source gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * The maximum gain allowed for a source, after distance and cone attenation is + * applied (if applicable). + */ +#define AL_MAX_GAIN 0x100E + +/** + * Listener orientation. + * Type: ALfloat[6] + * Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0} + * + * Effectively two three dimensional vectors. The first vector is the front (or + * "at") and the second is the top (or "up"). + * + * Both vectors are in local space. + */ +#define AL_ORIENTATION 0x100F + +/** + * Source state (query only). + * Type: ALint + * Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED] + */ +#define AL_SOURCE_STATE 0x1010 + +/** Source state value. */ +#define AL_INITIAL 0x1011 +#define AL_PLAYING 0x1012 +#define AL_PAUSED 0x1013 +#define AL_STOPPED 0x1014 + +/** + * Source Buffer Queue size (query only). + * Type: ALint + * + * The number of buffers queued using alSourceQueueBuffers, minus the buffers + * removed with alSourceUnqueueBuffers. + */ +#define AL_BUFFERS_QUEUED 0x1015 + +/** + * Source Buffer Queue processed count (query only). + * Type: ALint + * + * The number of queued buffers that have been fully processed, and can be + * removed with alSourceUnqueueBuffers. + * + * Looping sources will never fully process buffers because they will be set to + * play again for when the source loops. + */ +#define AL_BUFFERS_PROCESSED 0x1016 + +/** + * Source reference distance. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * The distance in units that no attenuation occurs. + * + * At 0.0, no distance attenuation ever occurs on non-linear attenuation models. + */ +#define AL_REFERENCE_DISTANCE 0x1020 + +/** + * Source rolloff factor. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * Multiplier to exaggerate or diminish distance attenuation. + * + * At 0.0, no distance attenuation ever occurs. + */ +#define AL_ROLLOFF_FACTOR 0x1021 + +/** + * Outer cone gain. + * Type: ALfloat + * Range: [0.0 - 1.0] + * Default: 0.0 + * + * The gain attenuation applied when the listener is outside of the source's + * outer cone. + */ +#define AL_CONE_OUTER_GAIN 0x1022 + +/** + * Source maximum distance. + * Type: ALfloat + * Range: [0.0 - ] + * Default: +inf + * + * The distance above which the source is not attenuated any further with a + * clamped distance model, or where attenuation reaches 0.0 gain for linear + * distance models with a default rolloff factor. + */ +#define AL_MAX_DISTANCE 0x1023 + +/** Source buffer position, in seconds */ +#define AL_SEC_OFFSET 0x1024 +/** Source buffer position, in sample frames */ +#define AL_SAMPLE_OFFSET 0x1025 +/** Source buffer position, in bytes */ +#define AL_BYTE_OFFSET 0x1026 + +/** + * Source type (query only). + * Type: ALint + * Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED] + * + * A Source is Static if a Buffer has been attached using AL_BUFFER. + * + * A Source is Streaming if one or more Buffers have been attached using + * alSourceQueueBuffers. + * + * A Source is Undetermined when it has the NULL buffer attached using + * AL_BUFFER. + */ +#define AL_SOURCE_TYPE 0x1027 + +/** Source type value. */ +#define AL_STATIC 0x1028 +#define AL_STREAMING 0x1029 +#define AL_UNDETERMINED 0x1030 + +/** Buffer format specifier. */ +#define AL_FORMAT_MONO8 0x1100 +#define AL_FORMAT_MONO16 0x1101 +#define AL_FORMAT_STEREO8 0x1102 +#define AL_FORMAT_STEREO16 0x1103 + +/** Buffer frequency (query only). */ +#define AL_FREQUENCY 0x2001 +/** Buffer bits per sample (query only). */ +#define AL_BITS 0x2002 +/** Buffer channel count (query only). */ +#define AL_CHANNELS 0x2003 +/** Buffer data size (query only). */ +#define AL_SIZE 0x2004 + +/** + * Buffer state. + * + * Not for public use. + */ +#define AL_UNUSED 0x2010 +#define AL_PENDING 0x2011 +#define AL_PROCESSED 0x2012 + + +/** No error. */ +#define AL_NO_ERROR 0 + +/** Invalid name paramater passed to AL call. */ +#define AL_INVALID_NAME 0xA001 + +/** Invalid enum parameter passed to AL call. */ +#define AL_INVALID_ENUM 0xA002 + +/** Invalid value parameter passed to AL call. */ +#define AL_INVALID_VALUE 0xA003 + +/** Illegal AL call. */ +#define AL_INVALID_OPERATION 0xA004 + +/** Not enough memory. */ +#define AL_OUT_OF_MEMORY 0xA005 + + +/** Context string: Vendor ID. */ +#define AL_VENDOR 0xB001 +/** Context string: Version. */ +#define AL_VERSION 0xB002 +/** Context string: Renderer ID. */ +#define AL_RENDERER 0xB003 +/** Context string: Space-separated extension list. */ +#define AL_EXTENSIONS 0xB004 + + +/** + * Doppler scale. + * Type: ALfloat + * Range: [0.0 - ] + * Default: 1.0 + * + * Scale for source and listener velocities. + */ +#define AL_DOPPLER_FACTOR 0xC000 +AL_API void AL_APIENTRY alDopplerFactor(ALfloat value); + +/** + * Doppler velocity (deprecated). + * + * A multiplier applied to the Speed of Sound. + */ +#define AL_DOPPLER_VELOCITY 0xC001 +AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value); + +/** + * Speed of Sound, in units per second. + * Type: ALfloat + * Range: [0.0001 - ] + * Default: 343.3 + * + * The speed at which sound waves are assumed to travel, when calculating the + * doppler effect. + */ +#define AL_SPEED_OF_SOUND 0xC003 +AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value); + +/** + * Distance attenuation model. + * Type: ALint + * Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, + * AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, + * AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED] + * Default: AL_INVERSE_DISTANCE_CLAMPED + * + * The model by which sources attenuate with distance. + * + * None - No distance attenuation. + * Inverse - Doubling the distance halves the source gain. + * Linear - Linear gain scaling between the reference and max distances. + * Exponent - Exponential gain dropoff. + * + * Clamped variations work like the non-clamped counterparts, except the + * distance calculated is clamped between the reference and max distances. + */ +#define AL_DISTANCE_MODEL 0xD000 +AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); + +/** Distance model value. */ +#define AL_INVERSE_DISTANCE 0xD001 +#define AL_INVERSE_DISTANCE_CLAMPED 0xD002 +#define AL_LINEAR_DISTANCE 0xD003 +#define AL_LINEAR_DISTANCE_CLAMPED 0xD004 +#define AL_EXPONENT_DISTANCE 0xD005 +#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 + +/** Renderer State management. */ +AL_API void AL_APIENTRY alEnable(ALenum capability); +AL_API void AL_APIENTRY alDisable(ALenum capability); +AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability); + +/** State retrieval. */ +AL_API const ALchar* AL_APIENTRY alGetString(ALenum param); +AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values); +AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values); +AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values); +AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param); +AL_API ALint AL_APIENTRY alGetInteger(ALenum param); +AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param); +AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param); + +/** + * Error retrieval. + * + * Obtain the first error generated in the AL context since the last check. + */ +AL_API ALenum AL_APIENTRY alGetError(void); + +/** + * Extension support. + * + * Query for the presence of an extension, and obtain any appropriate function + * pointers and enum values. + */ +AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); +AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname); +AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename); + + +/** Set Listener parameters */ +AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value); +AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value); +AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values); + +/** Get Listener parameters */ +AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values); + + +/** Create Source objects. */ +AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources); +/** Delete Source objects. */ +AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources); +/** Verify a handle is a valid Source. */ +AL_API ALboolean AL_APIENTRY alIsSource(ALuint source); + +/** Set Source parameters. */ +AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value); +AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value); +AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values); + +/** Get Source parameters. */ +AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values); + + +/** Play, replay, or resume (if paused) a list of Sources */ +AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources); +/** Stop a list of Sources */ +AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources); +/** Rewind a list of Sources */ +AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources); +/** Pause a list of Sources */ +AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources); + +/** Play, replay, or resume a Source */ +AL_API void AL_APIENTRY alSourcePlay(ALuint source); +/** Stop a Source */ +AL_API void AL_APIENTRY alSourceStop(ALuint source); +/** Rewind a Source (set playback postiton to beginning) */ +AL_API void AL_APIENTRY alSourceRewind(ALuint source); +/** Pause a Source */ +AL_API void AL_APIENTRY alSourcePause(ALuint source); + +/** Queue buffers onto a source */ +AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers); +/** Unqueue processed buffers from a source */ +AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers); + + +/** Create Buffer objects */ +AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers); +/** Delete Buffer objects */ +AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers); +/** Verify a handle is a valid Buffer */ +AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer); + +/** Specifies the data to be copied into a buffer */ +AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); + +/** Set Buffer parameters, */ +AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value); +AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values); +AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value); +AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); +AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values); + +/** Get Buffer parameters. */ +AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value); +AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values); +AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value); +AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); +AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values); + +/** Pointer-to-function type, useful for dynamically getting AL entry points. */ +typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability); +typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability); +typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability); +typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param); +typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values); +typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values); +typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param); +typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param); +typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param); +typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param); +typedef ALenum (AL_APIENTRY *LPALGETERROR)(void); +typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname); +typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname); +typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename); +typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources); +typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources); +typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources); +typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source); +typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers); +typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers); +typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers); +typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers); +typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer); +typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); +typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); +typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values); +typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); +typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values); +typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value); +typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); +typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values); +typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value); +typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); +typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values); +typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value); +typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value); +typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value); +typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel); + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#endif /* AL_AL_H */ diff --git a/src/external/openal_soft/include/AL/alc.h b/src/external/openal_soft/include/AL/alc.h new file mode 100644 index 00000000..294e8b33 --- /dev/null +++ b/src/external/openal_soft/include/AL/alc.h @@ -0,0 +1,237 @@ +#ifndef AL_ALC_H +#define AL_ALC_H + +#if defined(__cplusplus) +extern "C" { +#endif + +#ifndef ALC_API + #if defined(AL_LIBTYPE_STATIC) + #define ALC_API + #elif defined(_WIN32) + #define ALC_API __declspec(dllimport) + #else + #define ALC_API extern + #endif +#endif + +#if defined(_WIN32) + #define ALC_APIENTRY __cdecl +#else + #define ALC_APIENTRY +#endif + + +/** Deprecated macro. */ +#define ALCAPI ALC_API +#define ALCAPIENTRY ALC_APIENTRY +#define ALC_INVALID 0 + +/** Supported ALC version? */ +#define ALC_VERSION_0_1 1 + +/** Opaque device handle */ +typedef struct ALCdevice_struct ALCdevice; +/** Opaque context handle */ +typedef struct ALCcontext_struct ALCcontext; + +/** 8-bit boolean */ +typedef char ALCboolean; + +/** character */ +typedef char ALCchar; + +/** signed 8-bit 2's complement integer */ +typedef signed char ALCbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALCubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALCshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALCushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALCint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALCuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALCsizei; + +/** enumerated 32-bit value */ +typedef int ALCenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALCfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALCdouble; + +/** void type (for opaque pointers only) */ +typedef void ALCvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/** Boolean False. */ +#define ALC_FALSE 0 + +/** Boolean True. */ +#define ALC_TRUE 1 + +/** Context attribute: Hz. */ +#define ALC_FREQUENCY 0x1007 + +/** Context attribute: Hz. */ +#define ALC_REFRESH 0x1008 + +/** Context attribute: AL_TRUE or AL_FALSE. */ +#define ALC_SYNC 0x1009 + +/** Context attribute: requested Mono (3D) Sources. */ +#define ALC_MONO_SOURCES 0x1010 + +/** Context attribute: requested Stereo Sources. */ +#define ALC_STEREO_SOURCES 0x1011 + +/** No error. */ +#define ALC_NO_ERROR 0 + +/** Invalid device handle. */ +#define ALC_INVALID_DEVICE 0xA001 + +/** Invalid context handle. */ +#define ALC_INVALID_CONTEXT 0xA002 + +/** Invalid enum parameter passed to an ALC call. */ +#define ALC_INVALID_ENUM 0xA003 + +/** Invalid value parameter passed to an ALC call. */ +#define ALC_INVALID_VALUE 0xA004 + +/** Out of memory. */ +#define ALC_OUT_OF_MEMORY 0xA005 + + +/** Runtime ALC version. */ +#define ALC_MAJOR_VERSION 0x1000 +#define ALC_MINOR_VERSION 0x1001 + +/** Context attribute list properties. */ +#define ALC_ATTRIBUTES_SIZE 0x1002 +#define ALC_ALL_ATTRIBUTES 0x1003 + +/** String for the default device specifier. */ +#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 +/** + * String for the given device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known device specifiers (list ends with an empty string). + */ +#define ALC_DEVICE_SPECIFIER 0x1005 +/** String for space-separated list of ALC extensions. */ +#define ALC_EXTENSIONS 0x1006 + + +/** Capture extension */ +#define ALC_EXT_CAPTURE 1 +/** + * String for the given capture device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known capture device specifiers (list ends with an empty string). + */ +#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 +/** String for the default capture device specifier. */ +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 +/** Number of sample frames available for capture. */ +#define ALC_CAPTURE_SAMPLES 0x312 + + +/** Enumerate All extension */ +#define ALC_ENUMERATE_ALL_EXT 1 +/** String for the default extended device specifier. */ +#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 +/** + * String for the given extended device's specifier. + * + * If device handle is NULL, it is instead a null-char separated list of + * strings of known extended device specifiers (list ends with an empty string). + */ +#define ALC_ALL_DEVICES_SPECIFIER 0x1013 + + +/** Context management. */ +ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist); +ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context); +ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context); +ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context); +ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context); +ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void); +ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context); + +/** Device management. */ +ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename); +ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device); + + +/** + * Error support. + * + * Obtain the most recent Device error. + */ +ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device); + +/** + * Extension support. + * + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. + */ +ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname); +ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); +ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname); + +/** Query function. */ +ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param); +ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); + +/** Capture function. */ +ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); +ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device); +ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); + +/** Pointer-to-function type, useful for dynamically getting ALC entry points. */ +typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist); +typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context); +typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context); +typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void); +typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context); +typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename); +typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device); +typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device); +typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname); +typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); +typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname); +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param); +typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); +typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); +typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device); +typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); + +#if defined(__cplusplus) +} +#endif + +#endif /* AL_ALC_H */ diff --git a/src/external/openal_soft/include/AL/alext.h b/src/external/openal_soft/include/AL/alext.h new file mode 100644 index 00000000..6af581aa --- /dev/null +++ b/src/external/openal_soft/include/AL/alext.h @@ -0,0 +1,438 @@ +/** + * OpenAL cross platform audio library + * Copyright (C) 2008 by authors. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Or go to http://www.gnu.org/copyleft/lgpl.html + */ + +#ifndef AL_ALEXT_H +#define AL_ALEXT_H + +#include +/* Define int64_t and uint64_t types */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif + +#include "alc.h" +#include "al.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef AL_LOKI_IMA_ADPCM_format +#define AL_LOKI_IMA_ADPCM_format 1 +#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000 +#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001 +#endif + +#ifndef AL_LOKI_WAVE_format +#define AL_LOKI_WAVE_format 1 +#define AL_FORMAT_WAVE_EXT 0x10002 +#endif + +#ifndef AL_EXT_vorbis +#define AL_EXT_vorbis 1 +#define AL_FORMAT_VORBIS_EXT 0x10003 +#endif + +#ifndef AL_LOKI_quadriphonic +#define AL_LOKI_quadriphonic 1 +#define AL_FORMAT_QUAD8_LOKI 0x10004 +#define AL_FORMAT_QUAD16_LOKI 0x10005 +#endif + +#ifndef AL_EXT_float32 +#define AL_EXT_float32 1 +#define AL_FORMAT_MONO_FLOAT32 0x10010 +#define AL_FORMAT_STEREO_FLOAT32 0x10011 +#endif + +#ifndef AL_EXT_double +#define AL_EXT_double 1 +#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012 +#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013 +#endif + +#ifndef AL_EXT_MULAW +#define AL_EXT_MULAW 1 +#define AL_FORMAT_MONO_MULAW_EXT 0x10014 +#define AL_FORMAT_STEREO_MULAW_EXT 0x10015 +#endif + +#ifndef AL_EXT_ALAW +#define AL_EXT_ALAW 1 +#define AL_FORMAT_MONO_ALAW_EXT 0x10016 +#define AL_FORMAT_STEREO_ALAW_EXT 0x10017 +#endif + +#ifndef ALC_LOKI_audio_channel +#define ALC_LOKI_audio_channel 1 +#define ALC_CHAN_MAIN_LOKI 0x500001 +#define ALC_CHAN_PCM_LOKI 0x500002 +#define ALC_CHAN_CD_LOKI 0x500003 +#endif + +#ifndef AL_EXT_MCFORMATS +#define AL_EXT_MCFORMATS 1 +#define AL_FORMAT_QUAD8 0x1204 +#define AL_FORMAT_QUAD16 0x1205 +#define AL_FORMAT_QUAD32 0x1206 +#define AL_FORMAT_REAR8 0x1207 +#define AL_FORMAT_REAR16 0x1208 +#define AL_FORMAT_REAR32 0x1209 +#define AL_FORMAT_51CHN8 0x120A +#define AL_FORMAT_51CHN16 0x120B +#define AL_FORMAT_51CHN32 0x120C +#define AL_FORMAT_61CHN8 0x120D +#define AL_FORMAT_61CHN16 0x120E +#define AL_FORMAT_61CHN32 0x120F +#define AL_FORMAT_71CHN8 0x1210 +#define AL_FORMAT_71CHN16 0x1211 +#define AL_FORMAT_71CHN32 0x1212 +#endif + +#ifndef AL_EXT_MULAW_MCFORMATS +#define AL_EXT_MULAW_MCFORMATS 1 +#define AL_FORMAT_MONO_MULAW 0x10014 +#define AL_FORMAT_STEREO_MULAW 0x10015 +#define AL_FORMAT_QUAD_MULAW 0x10021 +#define AL_FORMAT_REAR_MULAW 0x10022 +#define AL_FORMAT_51CHN_MULAW 0x10023 +#define AL_FORMAT_61CHN_MULAW 0x10024 +#define AL_FORMAT_71CHN_MULAW 0x10025 +#endif + +#ifndef AL_EXT_IMA4 +#define AL_EXT_IMA4 1 +#define AL_FORMAT_MONO_IMA4 0x1300 +#define AL_FORMAT_STEREO_IMA4 0x1301 +#endif + +#ifndef AL_EXT_STATIC_BUFFER +#define AL_EXT_STATIC_BUFFER 1 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); +#endif +#endif + +#ifndef ALC_EXT_EFX +#define ALC_EXT_EFX 1 +#include "efx.h" +#endif + +#ifndef ALC_EXT_disconnect +#define ALC_EXT_disconnect 1 +#define ALC_CONNECTED 0x313 +#endif + +#ifndef ALC_EXT_thread_local_context +#define ALC_EXT_thread_local_context 1 +typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context); +typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context); +ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); +#endif +#endif + +#ifndef AL_EXT_source_distance_model +#define AL_EXT_source_distance_model 1 +#define AL_SOURCE_DISTANCE_MODEL 0x200 +#endif + +#ifndef AL_SOFT_buffer_sub_data +#define AL_SOFT_buffer_sub_data 1 +#define AL_BYTE_RW_OFFSETS_SOFT 0x1031 +#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 +typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); +#endif +#endif + +#ifndef AL_SOFT_loop_points +#define AL_SOFT_loop_points 1 +#define AL_LOOP_POINTS_SOFT 0x2015 +#endif + +#ifndef AL_EXT_FOLDBACK +#define AL_EXT_FOLDBACK 1 +#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK" +#define AL_FOLDBACK_EVENT_BLOCK 0x4112 +#define AL_FOLDBACK_EVENT_START 0x4111 +#define AL_FOLDBACK_EVENT_STOP 0x4113 +#define AL_FOLDBACK_MODE_MONO 0x4101 +#define AL_FOLDBACK_MODE_STEREO 0x4102 +typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei); +typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK); +typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback); +AL_API void AL_APIENTRY alRequestFoldbackStop(void); +#endif +#endif + +#ifndef ALC_EXT_DEDICATED +#define ALC_EXT_DEDICATED 1 +#define AL_DEDICATED_GAIN 0x0001 +#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001 +#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000 +#endif + +#ifndef AL_SOFT_buffer_samples +#define AL_SOFT_buffer_samples 1 +/* Channel configurations */ +#define AL_MONO_SOFT 0x1500 +#define AL_STEREO_SOFT 0x1501 +#define AL_REAR_SOFT 0x1502 +#define AL_QUAD_SOFT 0x1503 +#define AL_5POINT1_SOFT 0x1504 +#define AL_6POINT1_SOFT 0x1505 +#define AL_7POINT1_SOFT 0x1506 + +/* Sample types */ +#define AL_BYTE_SOFT 0x1400 +#define AL_UNSIGNED_BYTE_SOFT 0x1401 +#define AL_SHORT_SOFT 0x1402 +#define AL_UNSIGNED_SHORT_SOFT 0x1403 +#define AL_INT_SOFT 0x1404 +#define AL_UNSIGNED_INT_SOFT 0x1405 +#define AL_FLOAT_SOFT 0x1406 +#define AL_DOUBLE_SOFT 0x1407 +#define AL_BYTE3_SOFT 0x1408 +#define AL_UNSIGNED_BYTE3_SOFT 0x1409 + +/* Storage formats */ +#define AL_MONO8_SOFT 0x1100 +#define AL_MONO16_SOFT 0x1101 +#define AL_MONO32F_SOFT 0x10010 +#define AL_STEREO8_SOFT 0x1102 +#define AL_STEREO16_SOFT 0x1103 +#define AL_STEREO32F_SOFT 0x10011 +#define AL_QUAD8_SOFT 0x1204 +#define AL_QUAD16_SOFT 0x1205 +#define AL_QUAD32F_SOFT 0x1206 +#define AL_REAR8_SOFT 0x1207 +#define AL_REAR16_SOFT 0x1208 +#define AL_REAR32F_SOFT 0x1209 +#define AL_5POINT1_8_SOFT 0x120A +#define AL_5POINT1_16_SOFT 0x120B +#define AL_5POINT1_32F_SOFT 0x120C +#define AL_6POINT1_8_SOFT 0x120D +#define AL_6POINT1_16_SOFT 0x120E +#define AL_6POINT1_32F_SOFT 0x120F +#define AL_7POINT1_8_SOFT 0x1210 +#define AL_7POINT1_16_SOFT 0x1211 +#define AL_7POINT1_32F_SOFT 0x1212 + +/* Buffer attributes */ +#define AL_INTERNAL_FORMAT_SOFT 0x2008 +#define AL_BYTE_LENGTH_SOFT 0x2009 +#define AL_SAMPLE_LENGTH_SOFT 0x200A +#define AL_SEC_LENGTH_SOFT 0x200B + +typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*); +typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*); +typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*); +typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); +AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data); +AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data); +AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); +#endif +#endif + +#ifndef AL_SOFT_direct_channels +#define AL_SOFT_direct_channels 1 +#define AL_DIRECT_CHANNELS_SOFT 0x1033 +#endif + +#ifndef ALC_SOFT_loopback +#define ALC_SOFT_loopback 1 +#define ALC_FORMAT_CHANNELS_SOFT 0x1990 +#define ALC_FORMAT_TYPE_SOFT 0x1991 + +/* Sample types */ +#define ALC_BYTE_SOFT 0x1400 +#define ALC_UNSIGNED_BYTE_SOFT 0x1401 +#define ALC_SHORT_SOFT 0x1402 +#define ALC_UNSIGNED_SHORT_SOFT 0x1403 +#define ALC_INT_SOFT 0x1404 +#define ALC_UNSIGNED_INT_SOFT 0x1405 +#define ALC_FLOAT_SOFT 0x1406 + +/* Channel configurations */ +#define ALC_MONO_SOFT 0x1500 +#define ALC_STEREO_SOFT 0x1501 +#define ALC_QUAD_SOFT 0x1503 +#define ALC_5POINT1_SOFT 0x1504 +#define ALC_6POINT1_SOFT 0x1505 +#define ALC_7POINT1_SOFT 0x1506 + +typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*); +typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum); +typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName); +ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type); +ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); +#endif +#endif + +#ifndef AL_EXT_STEREO_ANGLES +#define AL_EXT_STEREO_ANGLES 1 +#define AL_STEREO_ANGLES 0x1030 +#endif + +#ifndef AL_EXT_SOURCE_RADIUS +#define AL_EXT_SOURCE_RADIUS 1 +#define AL_SOURCE_RADIUS 0x1031 +#endif + +#ifndef AL_SOFT_source_latency +#define AL_SOFT_source_latency 1 +#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200 +#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201 +typedef int64_t ALint64SOFT; +typedef uint64_t ALuint64SOFT; +typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble); +typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble); +typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*); +typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*); +typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT); +typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT); +typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*); +typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value); +AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3); +AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values); +AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value); +AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3); +AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values); +AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value); +AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3); +AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values); +AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value); +AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3); +AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values); +#endif +#endif + +#ifndef ALC_EXT_DEFAULT_FILTER_ORDER +#define ALC_EXT_DEFAULT_FILTER_ORDER 1 +#define ALC_DEFAULT_FILTER_ORDER 0x1100 +#endif + +#ifndef AL_SOFT_deferred_updates +#define AL_SOFT_deferred_updates 1 +#define AL_DEFERRED_UPDATES_SOFT 0xC002 +typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); +typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); +AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); +#endif +#endif + +#ifndef AL_SOFT_block_alignment +#define AL_SOFT_block_alignment 1 +#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C +#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D +#endif + +#ifndef AL_SOFT_MSADPCM +#define AL_SOFT_MSADPCM 1 +#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302 +#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303 +#endif + +#ifndef AL_SOFT_source_length +#define AL_SOFT_source_length 1 +/*#define AL_BYTE_LENGTH_SOFT 0x2009*/ +/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/ +/*#define AL_SEC_LENGTH_SOFT 0x200B*/ +#endif + +#ifndef ALC_SOFT_pause_device +#define ALC_SOFT_pause_device 1 +typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device); +typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device); +ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device); +#endif +#endif + +#ifndef AL_EXT_BFORMAT +#define AL_EXT_BFORMAT 1 +#define AL_FORMAT_BFORMAT2D_8 0x20021 +#define AL_FORMAT_BFORMAT2D_16 0x20022 +#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023 +#define AL_FORMAT_BFORMAT3D_8 0x20031 +#define AL_FORMAT_BFORMAT3D_16 0x20032 +#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033 +#endif + +#ifndef AL_EXT_MULAW_BFORMAT +#define AL_EXT_MULAW_BFORMAT 1 +#define AL_FORMAT_BFORMAT2D_MULAW 0x10031 +#define AL_FORMAT_BFORMAT3D_MULAW 0x10032 +#endif + +#ifndef ALC_SOFT_HRTF +#define ALC_SOFT_HRTF 1 +#define ALC_HRTF_SOFT 0x1992 +#define ALC_DONT_CARE_SOFT 0x0002 +#define ALC_HRTF_STATUS_SOFT 0x1993 +#define ALC_HRTF_DISABLED_SOFT 0x0000 +#define ALC_HRTF_ENABLED_SOFT 0x0001 +#define ALC_HRTF_DENIED_SOFT 0x0002 +#define ALC_HRTF_REQUIRED_SOFT 0x0003 +#define ALC_HRTF_HEADPHONES_DETECTED_SOFT 0x0004 +#define ALC_HRTF_UNSUPPORTED_FORMAT_SOFT 0x0005 +#define ALC_NUM_HRTF_SPECIFIERS_SOFT 0x1994 +#define ALC_HRTF_SPECIFIER_SOFT 0x1995 +#define ALC_HRTF_ID_SOFT 0x1996 +typedef const ALCchar* (ALC_APIENTRY*LPALCGETSTRINGISOFT)(ALCdevice *device, ALCenum paramName, ALCsizei index); +typedef ALCboolean (ALC_APIENTRY*LPALCRESETDEVICESOFT)(ALCdevice *device, const ALCint *attribs); +#ifdef AL_ALEXT_PROTOTYPES +ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index); +ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs); +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/external/openal_soft/include/AL/efx-creative.h b/src/external/openal_soft/include/AL/efx-creative.h new file mode 100644 index 00000000..0a04c982 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx-creative.h @@ -0,0 +1,3 @@ +/* The tokens that would be defined here are already defined in efx.h. This + * empty file is here to provide compatibility with Windows-based projects + * that would include it. */ diff --git a/src/external/openal_soft/include/AL/efx-presets.h b/src/external/openal_soft/include/AL/efx-presets.h new file mode 100644 index 00000000..8539fd51 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx-presets.h @@ -0,0 +1,402 @@ +/* Reverb presets for EFX */ + +#ifndef EFX_PRESETS_H +#define EFX_PRESETS_H + +#ifndef EFXEAXREVERBPROPERTIES_DEFINED +#define EFXEAXREVERBPROPERTIES_DEFINED +typedef struct { + float flDensity; + float flDiffusion; + float flGain; + float flGainHF; + float flGainLF; + float flDecayTime; + float flDecayHFRatio; + float flDecayLFRatio; + float flReflectionsGain; + float flReflectionsDelay; + float flReflectionsPan[3]; + float flLateReverbGain; + float flLateReverbDelay; + float flLateReverbPan[3]; + float flEchoTime; + float flEchoDepth; + float flModulationTime; + float flModulationDepth; + float flAirAbsorptionGainHF; + float flHFReference; + float flLFReference; + float flRoomRolloffFactor; + int iDecayHFLimit; +} EFXEAXREVERBPROPERTIES, *LPEFXEAXREVERBPROPERTIES; +#endif + +/* Default Presets */ + +#define EFX_REVERB_PRESET_GENERIC \ + { 1.0000f, 1.0000f, 0.3162f, 0.8913f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PADDEDCELL \ + { 0.1715f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.1700f, 0.1000f, 1.0000f, 0.2500f, 0.0010f, { 0.0000f, 0.0000f, 0.0000f }, 1.2691f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ROOM \ + { 0.4287f, 1.0000f, 0.3162f, 0.5929f, 1.0000f, 0.4000f, 0.8300f, 1.0000f, 0.1503f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.0629f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_BATHROOM \ + { 0.1715f, 1.0000f, 0.3162f, 0.2512f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.6531f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 3.2734f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_LIVINGROOM \ + { 0.9766f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.5000f, 0.1000f, 1.0000f, 0.2051f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2805f, 0.0040f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_STONEROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 2.3100f, 0.6400f, 1.0000f, 0.4411f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1003f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_AUDITORIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.5781f, 1.0000f, 4.3200f, 0.5900f, 1.0000f, 0.4032f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7170f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CONCERTHALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.5623f, 1.0000f, 3.9200f, 0.7000f, 1.0000f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.9977f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CAVE \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 2.9100f, 1.3000f, 1.0000f, 0.5000f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.7063f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_ARENA \ + { 1.0000f, 1.0000f, 0.3162f, 0.4477f, 1.0000f, 7.2400f, 0.3300f, 1.0000f, 0.2612f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.0186f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_HANGAR \ + { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 10.0500f, 0.2300f, 1.0000f, 0.5000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2560f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CARPETEDHALLWAY \ + { 0.4287f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 0.3000f, 0.1000f, 1.0000f, 0.1215f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.1531f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_HALLWAY \ + { 0.3645f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 1.4900f, 0.5900f, 1.0000f, 0.2458f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.6615f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_STONECORRIDOR \ + { 1.0000f, 1.0000f, 0.3162f, 0.7612f, 1.0000f, 2.7000f, 0.7900f, 1.0000f, 0.2472f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 1.5758f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ALLEY \ + { 1.0000f, 0.3000f, 0.3162f, 0.7328f, 1.0000f, 1.4900f, 0.8600f, 1.0000f, 0.2500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.9954f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.9500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FOREST \ + { 1.0000f, 0.3000f, 0.3162f, 0.0224f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.0525f, 0.1620f, { 0.0000f, 0.0000f, 0.0000f }, 0.7682f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY \ + { 1.0000f, 0.5000f, 0.3162f, 0.3981f, 1.0000f, 1.4900f, 0.6700f, 1.0000f, 0.0730f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1427f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_MOUNTAINS \ + { 1.0000f, 0.2700f, 0.3162f, 0.0562f, 1.0000f, 1.4900f, 0.2100f, 1.0000f, 0.0407f, 0.3000f, { 0.0000f, 0.0000f, 0.0000f }, 0.1919f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_QUARRY \ + { 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0000f, 0.0610f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.7000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PLAIN \ + { 1.0000f, 0.2100f, 0.3162f, 0.1000f, 1.0000f, 1.4900f, 0.5000f, 1.0000f, 0.0585f, 0.1790f, { 0.0000f, 0.0000f, 0.0000f }, 0.1089f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PARKINGLOT \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 1.6500f, 1.5000f, 1.0000f, 0.2082f, 0.0080f, { 0.0000f, 0.0000f, 0.0000f }, 0.2652f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SEWERPIPE \ + { 0.3071f, 0.8000f, 0.3162f, 0.3162f, 1.0000f, 2.8100f, 0.1400f, 1.0000f, 1.6387f, 0.0140f, { 0.0000f, 0.0000f, 0.0000f }, 3.2471f, 0.0210f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_UNDERWATER \ + { 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRUGGED \ + { 0.4287f, 0.5000f, 0.3162f, 1.0000f, 1.0000f, 8.3900f, 1.3900f, 1.0000f, 0.8760f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 3.1081f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DIZZY \ + { 0.3645f, 0.6000f, 0.3162f, 0.6310f, 1.0000f, 17.2300f, 0.5600f, 1.0000f, 0.1392f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4937f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.8100f, 0.3100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PSYCHOTIC \ + { 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Castle Presets */ + +#define EFX_REVERB_PRESET_CASTLE_SMALLROOM \ + { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 1.2200f, 0.8300f, 0.3100f, 0.8913f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_SHORTPASSAGE \ + { 1.0000f, 0.8900f, 0.3162f, 0.3162f, 0.1000f, 2.3200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_MEDIUMROOM \ + { 1.0000f, 0.9300f, 0.3162f, 0.2818f, 0.1000f, 2.0400f, 0.8300f, 0.4600f, 0.6310f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1550f, 0.0300f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_LARGEROOM \ + { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.1259f, 2.5300f, 0.8300f, 0.5000f, 0.4467f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1850f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_LONGPASSAGE \ + { 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 3.4200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_HALL \ + { 1.0000f, 0.8100f, 0.3162f, 0.2818f, 0.1778f, 3.1400f, 0.7900f, 0.6200f, 0.1778f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_CUPBOARD \ + { 1.0000f, 0.8900f, 0.3162f, 0.2818f, 0.1000f, 0.6700f, 0.8700f, 0.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 3.5481f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CASTLE_COURTYARD \ + { 1.0000f, 0.4200f, 0.3162f, 0.4467f, 0.1995f, 2.1300f, 0.6100f, 0.2300f, 0.2239f, 0.1600f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3700f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CASTLE_ALCOVE \ + { 1.0000f, 0.8900f, 0.3162f, 0.5012f, 0.1000f, 1.6400f, 0.8700f, 0.3100f, 1.0000f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 } + +/* Factory Presets */ + +#define EFX_REVERB_PRESET_FACTORY_SMALLROOM \ + { 0.3645f, 0.8200f, 0.3162f, 0.7943f, 0.5012f, 1.7200f, 0.6500f, 1.3100f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.1190f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_SHORTPASSAGE \ + { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 2.5300f, 0.6500f, 1.3100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_MEDIUMROOM \ + { 0.4287f, 0.8200f, 0.2512f, 0.7943f, 0.5012f, 2.7600f, 0.6500f, 1.3100f, 0.2818f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1740f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_LARGEROOM \ + { 0.4287f, 0.7500f, 0.2512f, 0.7079f, 0.6310f, 4.2400f, 0.5100f, 1.3100f, 0.1778f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2310f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_LONGPASSAGE \ + { 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 4.0600f, 0.6500f, 1.3100f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_HALL \ + { 0.4287f, 0.7500f, 0.3162f, 0.7079f, 0.6310f, 7.4300f, 0.5100f, 1.3100f, 0.0631f, 0.0730f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_CUPBOARD \ + { 0.3071f, 0.6300f, 0.2512f, 0.7943f, 0.5012f, 0.4900f, 0.6500f, 1.3100f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.1070f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_COURTYARD \ + { 0.3071f, 0.5700f, 0.3162f, 0.3162f, 0.6310f, 2.3200f, 0.2900f, 0.5600f, 0.2239f, 0.1400f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2900f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_FACTORY_ALCOVE \ + { 0.3645f, 0.5900f, 0.2512f, 0.7943f, 0.5012f, 3.1400f, 0.6500f, 1.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1140f, 0.1000f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 } + +/* Ice Palace Presets */ + +#define EFX_REVERB_PRESET_ICEPALACE_SMALLROOM \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 1.5100f, 1.5300f, 0.2700f, 0.8913f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1640f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_SHORTPASSAGE \ + { 1.0000f, 0.7500f, 0.3162f, 0.5623f, 0.2818f, 1.7900f, 1.4600f, 0.2800f, 0.5012f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_MEDIUMROOM \ + { 1.0000f, 0.8700f, 0.3162f, 0.5623f, 0.4467f, 2.2200f, 1.5300f, 0.3200f, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_LARGEROOM \ + { 1.0000f, 0.8100f, 0.3162f, 0.5623f, 0.4467f, 3.1400f, 1.5300f, 0.3200f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_LONGPASSAGE \ + { 1.0000f, 0.7700f, 0.3162f, 0.5623f, 0.3981f, 3.0100f, 1.4600f, 0.2800f, 0.7943f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.0400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_HALL \ + { 1.0000f, 0.7600f, 0.3162f, 0.4467f, 0.5623f, 5.4900f, 1.5300f, 0.3800f, 0.1122f, 0.0540f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0520f, { 0.0000f, 0.0000f, 0.0000f }, 0.2260f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_CUPBOARD \ + { 1.0000f, 0.8300f, 0.3162f, 0.5012f, 0.2239f, 0.7600f, 1.5300f, 0.2600f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1430f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_COURTYARD \ + { 1.0000f, 0.5900f, 0.3162f, 0.2818f, 0.3162f, 2.0400f, 1.2000f, 0.3800f, 0.3162f, 0.1730f, { 0.0000f, 0.0000f, 0.0000f }, 0.3162f, 0.0430f, { 0.0000f, 0.0000f, 0.0000f }, 0.2350f, 0.4800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_ICEPALACE_ALCOVE \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 2.7600f, 1.4600f, 0.2800f, 1.1220f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1610f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 } + +/* Space Station Presets */ + +#define EFX_REVERB_PRESET_SPACESTATION_SMALLROOM \ + { 0.2109f, 0.7000f, 0.3162f, 0.7079f, 0.8913f, 1.7200f, 0.8200f, 0.5500f, 0.7943f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 0.1880f, 0.2600f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_SHORTPASSAGE \ + { 0.2109f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 3.5700f, 0.5000f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1720f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_MEDIUMROOM \ + { 0.2109f, 0.7500f, 0.3162f, 0.6310f, 0.8913f, 3.0100f, 0.5000f, 0.5500f, 0.3981f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2090f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_LARGEROOM \ + { 0.3645f, 0.8100f, 0.3162f, 0.6310f, 0.8913f, 3.8900f, 0.3800f, 0.6100f, 0.3162f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2330f, 0.2800f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_LONGPASSAGE \ + { 0.4287f, 0.8200f, 0.3162f, 0.6310f, 0.8913f, 4.6200f, 0.6200f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_HALL \ + { 0.4287f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 7.1100f, 0.3800f, 0.6100f, 0.1778f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2500f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_CUPBOARD \ + { 0.1715f, 0.5600f, 0.3162f, 0.7079f, 0.8913f, 0.7900f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1810f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPACESTATION_ALCOVE \ + { 0.2109f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.1600f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1920f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 } + +/* Wooden Galleon Presets */ + +#define EFX_REVERB_PRESET_WOODEN_SMALLROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.1122f, 0.3162f, 0.7900f, 0.3200f, 0.8700f, 1.0000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_SHORTPASSAGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.7500f, 0.5000f, 0.8700f, 0.8913f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_MEDIUMROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.2818f, 1.4700f, 0.4200f, 0.8200f, 0.8913f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_LARGEROOM \ + { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.2818f, 2.6500f, 0.3300f, 0.8200f, 0.8913f, 0.0660f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_LONGPASSAGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.3162f, 1.9900f, 0.4000f, 0.7900f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4467f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_HALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.0794f, 0.2818f, 3.4500f, 0.3000f, 0.8200f, 0.8913f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_CUPBOARD \ + { 1.0000f, 1.0000f, 0.3162f, 0.1413f, 0.3162f, 0.5600f, 0.4600f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_COURTYARD \ + { 1.0000f, 0.6500f, 0.3162f, 0.0794f, 0.3162f, 1.7900f, 0.3500f, 0.7900f, 0.5623f, 0.1230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_WOODEN_ALCOVE \ + { 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.2200f, 0.6200f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 } + +/* Sports Presets */ + +#define EFX_REVERB_PRESET_SPORT_EMPTYSTADIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.4467f, 0.7943f, 6.2600f, 0.5100f, 1.1000f, 0.0631f, 0.1830f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_SQUASHCOURT \ + { 1.0000f, 0.7500f, 0.3162f, 0.3162f, 0.7943f, 2.2200f, 0.9100f, 1.1600f, 0.4467f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1260f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_SMALLSWIMMINGPOOL \ + { 1.0000f, 0.7000f, 0.3162f, 0.7943f, 0.8913f, 2.7600f, 1.2500f, 1.1400f, 0.6310f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SPORT_LARGESWIMMINGPOOL \ + { 1.0000f, 0.8200f, 0.3162f, 0.7943f, 1.0000f, 5.4900f, 1.3100f, 1.1400f, 0.4467f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2220f, 0.5500f, 1.1590f, 0.2100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_SPORT_GYMNASIUM \ + { 1.0000f, 0.8100f, 0.3162f, 0.4467f, 0.8913f, 3.1400f, 1.0600f, 1.3500f, 0.3981f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0450f, { 0.0000f, 0.0000f, 0.0000f }, 0.1460f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_FULLSTADIUM \ + { 1.0000f, 1.0000f, 0.3162f, 0.0708f, 0.7943f, 5.2500f, 0.1700f, 0.8000f, 0.1000f, 0.1880f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SPORT_STADIUMTANNOY \ + { 1.0000f, 0.7800f, 0.3162f, 0.5623f, 0.5012f, 2.5300f, 0.8800f, 0.6800f, 0.2818f, 0.2300f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +/* Prefab Presets */ + +#define EFX_REVERB_PRESET_PREFAB_WORKSHOP \ + { 0.4287f, 1.0000f, 0.3162f, 0.1413f, 0.3981f, 0.7600f, 1.0000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PREFAB_SCHOOLROOM \ + { 0.4022f, 0.6900f, 0.3162f, 0.6310f, 0.5012f, 0.9800f, 0.4500f, 0.1800f, 1.4125f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PREFAB_PRACTISEROOM \ + { 0.4022f, 0.8700f, 0.3162f, 0.3981f, 0.5012f, 1.1200f, 0.5600f, 0.1800f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PREFAB_OUTHOUSE \ + { 1.0000f, 0.8200f, 0.3162f, 0.1122f, 0.1585f, 1.3800f, 0.3800f, 0.3500f, 0.8913f, 0.0240f, { 0.0000f, 0.0000f, -0.0000f }, 0.6310f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.1210f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PREFAB_CARAVAN \ + { 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.1259f, 0.4300f, 1.5000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Dome and Pipe Presets */ + +#define EFX_REVERB_PRESET_DOME_TOMB \ + { 1.0000f, 0.7900f, 0.3162f, 0.3548f, 0.2239f, 4.1800f, 0.2100f, 0.1000f, 0.3868f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 1.6788f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PIPE_SMALL \ + { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 5.0400f, 0.1000f, 0.1000f, 0.5012f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 2.5119f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DOME_SAINTPAULS \ + { 1.0000f, 0.8700f, 0.3162f, 0.3548f, 0.2239f, 10.4800f, 0.1900f, 0.1000f, 0.1778f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0420f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PIPE_LONGTHIN \ + { 0.2560f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 9.2100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_PIPE_LARGE \ + { 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 8.4500f, 0.1000f, 0.1000f, 0.3981f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_PIPE_RESONANT \ + { 0.1373f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 6.8100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 } + +/* Outdoors Presets */ + +#define EFX_REVERB_PRESET_OUTDOORS_BACKYARD \ + { 1.0000f, 0.4500f, 0.3162f, 0.2512f, 0.5012f, 1.1200f, 0.3400f, 0.4600f, 0.4467f, 0.0690f, { 0.0000f, 0.0000f, -0.0000f }, 0.7079f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_ROLLINGPLAINS \ + { 1.0000f, 0.0000f, 0.3162f, 0.0112f, 0.6310f, 2.1300f, 0.2100f, 0.4600f, 0.1778f, 0.3000f, { 0.0000f, 0.0000f, -0.0000f }, 0.4467f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_DEEPCANYON \ + { 1.0000f, 0.7400f, 0.3162f, 0.1778f, 0.6310f, 3.8900f, 0.2100f, 0.4600f, 0.3162f, 0.2230f, { 0.0000f, 0.0000f, -0.0000f }, 0.3548f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_CREEK \ + { 1.0000f, 0.3500f, 0.3162f, 0.1778f, 0.5012f, 2.1300f, 0.2100f, 0.4600f, 0.3981f, 0.1150f, { 0.0000f, 0.0000f, -0.0000f }, 0.1995f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_OUTDOORS_VALLEY \ + { 1.0000f, 0.2800f, 0.3162f, 0.0282f, 0.1585f, 2.8800f, 0.2600f, 0.3500f, 0.1413f, 0.2630f, { 0.0000f, 0.0000f, -0.0000f }, 0.3981f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +/* Mood Presets */ + +#define EFX_REVERB_PRESET_MOOD_HEAVEN \ + { 1.0000f, 0.9400f, 0.3162f, 0.7943f, 0.4467f, 5.0400f, 1.1200f, 0.5600f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0800f, 2.7420f, 0.0500f, 0.9977f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_MOOD_HELL \ + { 1.0000f, 0.5700f, 0.3162f, 0.3548f, 0.4467f, 3.5700f, 0.4900f, 2.0000f, 0.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1100f, 0.0400f, 2.1090f, 0.5200f, 0.9943f, 5000.0000f, 139.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_MOOD_MEMORY \ + { 1.0000f, 0.8500f, 0.3162f, 0.6310f, 0.3548f, 4.0600f, 0.8200f, 0.5600f, 0.0398f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.4740f, 0.4500f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +/* Driving Presets */ + +#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \ + { 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \ + { 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_RACER \ + { 0.0832f, 0.8000f, 0.3162f, 1.0000f, 0.7943f, 0.1700f, 2.0000f, 0.4100f, 1.7783f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_SPORTS \ + { 0.0832f, 0.8000f, 0.3162f, 0.6310f, 1.0000f, 0.1700f, 0.7500f, 0.4100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_INCAR_LUXURY \ + { 0.2560f, 1.0000f, 0.3162f, 0.1000f, 0.5012f, 0.1300f, 0.4100f, 0.4600f, 0.7943f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_DRIVING_FULLGRANDSTAND \ + { 1.0000f, 1.0000f, 0.3162f, 0.2818f, 0.6310f, 3.0100f, 1.3700f, 1.2800f, 0.3548f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.1778f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_EMPTYGRANDSTAND \ + { 1.0000f, 1.0000f, 0.3162f, 1.0000f, 0.7943f, 4.6200f, 1.7500f, 1.4000f, 0.2082f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_DRIVING_TUNNEL \ + { 1.0000f, 0.8100f, 0.3162f, 0.3981f, 0.8913f, 3.4200f, 0.9400f, 1.3100f, 0.7079f, 0.0510f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.0500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 155.3000f, 0.0000f, 0x1 } + +/* City Presets */ + +#define EFX_REVERB_PRESET_CITY_STREETS \ + { 1.0000f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.7900f, 1.1200f, 0.9100f, 0.2818f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 0.1995f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_SUBWAY \ + { 1.0000f, 0.7400f, 0.3162f, 0.7079f, 0.8913f, 3.0100f, 1.2300f, 0.9100f, 0.7079f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_MUSEUM \ + { 1.0000f, 0.8200f, 0.3162f, 0.1778f, 0.1778f, 3.2800f, 1.4000f, 0.5700f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CITY_LIBRARY \ + { 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.0891f, 2.7600f, 0.8900f, 0.4100f, 0.3548f, 0.0290f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 } + +#define EFX_REVERB_PRESET_CITY_UNDERPASS \ + { 1.0000f, 0.8200f, 0.3162f, 0.4467f, 0.8913f, 3.5700f, 1.1200f, 0.9100f, 0.3981f, 0.0590f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1400f, 0.2500f, 0.0000f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CITY_ABANDONED \ + { 1.0000f, 0.6900f, 0.3162f, 0.7943f, 0.8913f, 3.2800f, 1.1700f, 0.9100f, 0.4467f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9966f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +/* Misc. Presets */ + +#define EFX_REVERB_PRESET_DUSTYROOM \ + { 0.3645f, 0.5600f, 0.3162f, 0.7943f, 0.7079f, 1.7900f, 0.3800f, 0.2100f, 0.5012f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0060f, { 0.0000f, 0.0000f, 0.0000f }, 0.2020f, 0.0500f, 0.2500f, 0.0000f, 0.9886f, 13046.0000f, 163.3000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_CHAPEL \ + { 1.0000f, 0.8400f, 0.3162f, 0.5623f, 1.0000f, 4.6200f, 0.6400f, 1.2300f, 0.4467f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.1100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 } + +#define EFX_REVERB_PRESET_SMALLWATERROOM \ + { 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 } + +#endif /* EFX_PRESETS_H */ diff --git a/src/external/openal_soft/include/AL/efx.h b/src/external/openal_soft/include/AL/efx.h new file mode 100644 index 00000000..57766983 --- /dev/null +++ b/src/external/openal_soft/include/AL/efx.h @@ -0,0 +1,761 @@ +#ifndef AL_EFX_H +#define AL_EFX_H + + +#include "alc.h" +#include "al.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ALC_EXT_EFX_NAME "ALC_EXT_EFX" + +#define ALC_EFX_MAJOR_VERSION 0x20001 +#define ALC_EFX_MINOR_VERSION 0x20002 +#define ALC_MAX_AUXILIARY_SENDS 0x20003 + + +/* Listener properties. */ +#define AL_METERS_PER_UNIT 0x20004 + +/* Source properties. */ +#define AL_DIRECT_FILTER 0x20005 +#define AL_AUXILIARY_SEND_FILTER 0x20006 +#define AL_AIR_ABSORPTION_FACTOR 0x20007 +#define AL_ROOM_ROLLOFF_FACTOR 0x20008 +#define AL_CONE_OUTER_GAINHF 0x20009 +#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A +#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B +#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C + + +/* Effect properties. */ + +/* Reverb effect parameters */ +#define AL_REVERB_DENSITY 0x0001 +#define AL_REVERB_DIFFUSION 0x0002 +#define AL_REVERB_GAIN 0x0003 +#define AL_REVERB_GAINHF 0x0004 +#define AL_REVERB_DECAY_TIME 0x0005 +#define AL_REVERB_DECAY_HFRATIO 0x0006 +#define AL_REVERB_REFLECTIONS_GAIN 0x0007 +#define AL_REVERB_REFLECTIONS_DELAY 0x0008 +#define AL_REVERB_LATE_REVERB_GAIN 0x0009 +#define AL_REVERB_LATE_REVERB_DELAY 0x000A +#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B +#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C +#define AL_REVERB_DECAY_HFLIMIT 0x000D + +/* EAX Reverb effect parameters */ +#define AL_EAXREVERB_DENSITY 0x0001 +#define AL_EAXREVERB_DIFFUSION 0x0002 +#define AL_EAXREVERB_GAIN 0x0003 +#define AL_EAXREVERB_GAINHF 0x0004 +#define AL_EAXREVERB_GAINLF 0x0005 +#define AL_EAXREVERB_DECAY_TIME 0x0006 +#define AL_EAXREVERB_DECAY_HFRATIO 0x0007 +#define AL_EAXREVERB_DECAY_LFRATIO 0x0008 +#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009 +#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A +#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B +#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C +#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D +#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E +#define AL_EAXREVERB_ECHO_TIME 0x000F +#define AL_EAXREVERB_ECHO_DEPTH 0x0010 +#define AL_EAXREVERB_MODULATION_TIME 0x0011 +#define AL_EAXREVERB_MODULATION_DEPTH 0x0012 +#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013 +#define AL_EAXREVERB_HFREFERENCE 0x0014 +#define AL_EAXREVERB_LFREFERENCE 0x0015 +#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016 +#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017 + +/* Chorus effect parameters */ +#define AL_CHORUS_WAVEFORM 0x0001 +#define AL_CHORUS_PHASE 0x0002 +#define AL_CHORUS_RATE 0x0003 +#define AL_CHORUS_DEPTH 0x0004 +#define AL_CHORUS_FEEDBACK 0x0005 +#define AL_CHORUS_DELAY 0x0006 + +/* Distortion effect parameters */ +#define AL_DISTORTION_EDGE 0x0001 +#define AL_DISTORTION_GAIN 0x0002 +#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003 +#define AL_DISTORTION_EQCENTER 0x0004 +#define AL_DISTORTION_EQBANDWIDTH 0x0005 + +/* Echo effect parameters */ +#define AL_ECHO_DELAY 0x0001 +#define AL_ECHO_LRDELAY 0x0002 +#define AL_ECHO_DAMPING 0x0003 +#define AL_ECHO_FEEDBACK 0x0004 +#define AL_ECHO_SPREAD 0x0005 + +/* Flanger effect parameters */ +#define AL_FLANGER_WAVEFORM 0x0001 +#define AL_FLANGER_PHASE 0x0002 +#define AL_FLANGER_RATE 0x0003 +#define AL_FLANGER_DEPTH 0x0004 +#define AL_FLANGER_FEEDBACK 0x0005 +#define AL_FLANGER_DELAY 0x0006 + +/* Frequency shifter effect parameters */ +#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001 +#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002 +#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003 + +/* Vocal morpher effect parameters */ +#define AL_VOCAL_MORPHER_PHONEMEA 0x0001 +#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002 +#define AL_VOCAL_MORPHER_PHONEMEB 0x0003 +#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004 +#define AL_VOCAL_MORPHER_WAVEFORM 0x0005 +#define AL_VOCAL_MORPHER_RATE 0x0006 + +/* Pitchshifter effect parameters */ +#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001 +#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002 + +/* Ringmodulator effect parameters */ +#define AL_RING_MODULATOR_FREQUENCY 0x0001 +#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002 +#define AL_RING_MODULATOR_WAVEFORM 0x0003 + +/* Autowah effect parameters */ +#define AL_AUTOWAH_ATTACK_TIME 0x0001 +#define AL_AUTOWAH_RELEASE_TIME 0x0002 +#define AL_AUTOWAH_RESONANCE 0x0003 +#define AL_AUTOWAH_PEAK_GAIN 0x0004 + +/* Compressor effect parameters */ +#define AL_COMPRESSOR_ONOFF 0x0001 + +/* Equalizer effect parameters */ +#define AL_EQUALIZER_LOW_GAIN 0x0001 +#define AL_EQUALIZER_LOW_CUTOFF 0x0002 +#define AL_EQUALIZER_MID1_GAIN 0x0003 +#define AL_EQUALIZER_MID1_CENTER 0x0004 +#define AL_EQUALIZER_MID1_WIDTH 0x0005 +#define AL_EQUALIZER_MID2_GAIN 0x0006 +#define AL_EQUALIZER_MID2_CENTER 0x0007 +#define AL_EQUALIZER_MID2_WIDTH 0x0008 +#define AL_EQUALIZER_HIGH_GAIN 0x0009 +#define AL_EQUALIZER_HIGH_CUTOFF 0x000A + +/* Effect type */ +#define AL_EFFECT_FIRST_PARAMETER 0x0000 +#define AL_EFFECT_LAST_PARAMETER 0x8000 +#define AL_EFFECT_TYPE 0x8001 + +/* Effect types, used with the AL_EFFECT_TYPE property */ +#define AL_EFFECT_NULL 0x0000 +#define AL_EFFECT_REVERB 0x0001 +#define AL_EFFECT_CHORUS 0x0002 +#define AL_EFFECT_DISTORTION 0x0003 +#define AL_EFFECT_ECHO 0x0004 +#define AL_EFFECT_FLANGER 0x0005 +#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006 +#define AL_EFFECT_VOCAL_MORPHER 0x0007 +#define AL_EFFECT_PITCH_SHIFTER 0x0008 +#define AL_EFFECT_RING_MODULATOR 0x0009 +#define AL_EFFECT_AUTOWAH 0x000A +#define AL_EFFECT_COMPRESSOR 0x000B +#define AL_EFFECT_EQUALIZER 0x000C +#define AL_EFFECT_EAXREVERB 0x8000 + +/* Auxiliary Effect Slot properties. */ +#define AL_EFFECTSLOT_EFFECT 0x0001 +#define AL_EFFECTSLOT_GAIN 0x0002 +#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003 + +/* NULL Auxiliary Slot ID to disable a source send. */ +#define AL_EFFECTSLOT_NULL 0x0000 + + +/* Filter properties. */ + +/* Lowpass filter parameters */ +#define AL_LOWPASS_GAIN 0x0001 +#define AL_LOWPASS_GAINHF 0x0002 + +/* Highpass filter parameters */ +#define AL_HIGHPASS_GAIN 0x0001 +#define AL_HIGHPASS_GAINLF 0x0002 + +/* Bandpass filter parameters */ +#define AL_BANDPASS_GAIN 0x0001 +#define AL_BANDPASS_GAINLF 0x0002 +#define AL_BANDPASS_GAINHF 0x0003 + +/* Filter type */ +#define AL_FILTER_FIRST_PARAMETER 0x0000 +#define AL_FILTER_LAST_PARAMETER 0x8000 +#define AL_FILTER_TYPE 0x8001 + +/* Filter types, used with the AL_FILTER_TYPE property */ +#define AL_FILTER_NULL 0x0000 +#define AL_FILTER_LOWPASS 0x0001 +#define AL_FILTER_HIGHPASS 0x0002 +#define AL_FILTER_BANDPASS 0x0003 + + +/* Effect object function types. */ +typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint); +typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*); + +/* Filter object function types. */ +typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint); +typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*); + +/* Auxiliary Effect Slot object function types. */ +typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*); +typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*); +typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat); +typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*); +typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); + +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); +AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects); +AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect); +AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); +AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters); +AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter); +AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); + +AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); +AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots); +AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); +AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); +AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); +#endif + +/* Filter ranges and defaults. */ + +/* Lowpass filter */ +#define AL_LOWPASS_MIN_GAIN (0.0f) +#define AL_LOWPASS_MAX_GAIN (1.0f) +#define AL_LOWPASS_DEFAULT_GAIN (1.0f) + +#define AL_LOWPASS_MIN_GAINHF (0.0f) +#define AL_LOWPASS_MAX_GAINHF (1.0f) +#define AL_LOWPASS_DEFAULT_GAINHF (1.0f) + +/* Highpass filter */ +#define AL_HIGHPASS_MIN_GAIN (0.0f) +#define AL_HIGHPASS_MAX_GAIN (1.0f) +#define AL_HIGHPASS_DEFAULT_GAIN (1.0f) + +#define AL_HIGHPASS_MIN_GAINLF (0.0f) +#define AL_HIGHPASS_MAX_GAINLF (1.0f) +#define AL_HIGHPASS_DEFAULT_GAINLF (1.0f) + +/* Bandpass filter */ +#define AL_BANDPASS_MIN_GAIN (0.0f) +#define AL_BANDPASS_MAX_GAIN (1.0f) +#define AL_BANDPASS_DEFAULT_GAIN (1.0f) + +#define AL_BANDPASS_MIN_GAINHF (0.0f) +#define AL_BANDPASS_MAX_GAINHF (1.0f) +#define AL_BANDPASS_DEFAULT_GAINHF (1.0f) + +#define AL_BANDPASS_MIN_GAINLF (0.0f) +#define AL_BANDPASS_MAX_GAINLF (1.0f) +#define AL_BANDPASS_DEFAULT_GAINLF (1.0f) + + +/* Effect parameter ranges and defaults. */ + +/* Standard reverb effect */ +#define AL_REVERB_MIN_DENSITY (0.0f) +#define AL_REVERB_MAX_DENSITY (1.0f) +#define AL_REVERB_DEFAULT_DENSITY (1.0f) + +#define AL_REVERB_MIN_DIFFUSION (0.0f) +#define AL_REVERB_MAX_DIFFUSION (1.0f) +#define AL_REVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_REVERB_MIN_GAIN (0.0f) +#define AL_REVERB_MAX_GAIN (1.0f) +#define AL_REVERB_DEFAULT_GAIN (0.32f) + +#define AL_REVERB_MIN_GAINHF (0.0f) +#define AL_REVERB_MAX_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_GAINHF (0.89f) + +#define AL_REVERB_MIN_DECAY_TIME (0.1f) +#define AL_REVERB_MAX_DECAY_TIME (20.0f) +#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* EAX reverb effect */ +#define AL_EAXREVERB_MIN_DENSITY (0.0f) +#define AL_EAXREVERB_MAX_DENSITY (1.0f) +#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f) + +#define AL_EAXREVERB_MIN_DIFFUSION (0.0f) +#define AL_EAXREVERB_MAX_DIFFUSION (1.0f) +#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f) + +#define AL_EAXREVERB_MIN_GAIN (0.0f) +#define AL_EAXREVERB_MAX_GAIN (1.0f) +#define AL_EAXREVERB_DEFAULT_GAIN (0.32f) + +#define AL_EAXREVERB_MIN_GAINHF (0.0f) +#define AL_EAXREVERB_MAX_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f) + +#define AL_EAXREVERB_MIN_GAINLF (0.0f) +#define AL_EAXREVERB_MAX_GAINLF (1.0f) +#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f) + +#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f) +#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f) + +#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f) + +#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f) +#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f) +#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f) + +#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f) +#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f) +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f) + +#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f) + +#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f) +#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f) +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f) + +#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f) + +#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f) +#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f) +#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f) + +#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f) +#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f) + +#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f) +#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f) +#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f) + +#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f) +#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f) +#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f) + +#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f) +#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f) +#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f) + +#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f) +#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f) +#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f) + +#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE +#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE +#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE + +/* Chorus effect */ +#define AL_CHORUS_WAVEFORM_SINUSOID (0) +#define AL_CHORUS_WAVEFORM_TRIANGLE (1) + +#define AL_CHORUS_MIN_WAVEFORM (0) +#define AL_CHORUS_MAX_WAVEFORM (1) +#define AL_CHORUS_DEFAULT_WAVEFORM (1) + +#define AL_CHORUS_MIN_PHASE (-180) +#define AL_CHORUS_MAX_PHASE (180) +#define AL_CHORUS_DEFAULT_PHASE (90) + +#define AL_CHORUS_MIN_RATE (0.0f) +#define AL_CHORUS_MAX_RATE (10.0f) +#define AL_CHORUS_DEFAULT_RATE (1.1f) + +#define AL_CHORUS_MIN_DEPTH (0.0f) +#define AL_CHORUS_MAX_DEPTH (1.0f) +#define AL_CHORUS_DEFAULT_DEPTH (0.1f) + +#define AL_CHORUS_MIN_FEEDBACK (-1.0f) +#define AL_CHORUS_MAX_FEEDBACK (1.0f) +#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f) + +#define AL_CHORUS_MIN_DELAY (0.0f) +#define AL_CHORUS_MAX_DELAY (0.016f) +#define AL_CHORUS_DEFAULT_DELAY (0.016f) + +/* Distortion effect */ +#define AL_DISTORTION_MIN_EDGE (0.0f) +#define AL_DISTORTION_MAX_EDGE (1.0f) +#define AL_DISTORTION_DEFAULT_EDGE (0.2f) + +#define AL_DISTORTION_MIN_GAIN (0.01f) +#define AL_DISTORTION_MAX_GAIN (1.0f) +#define AL_DISTORTION_DEFAULT_GAIN (0.05f) + +#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f) +#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f) +#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f) + +#define AL_DISTORTION_MIN_EQCENTER (80.0f) +#define AL_DISTORTION_MAX_EQCENTER (24000.0f) +#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f) + +#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f) +#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f) +#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f) + +/* Echo effect */ +#define AL_ECHO_MIN_DELAY (0.0f) +#define AL_ECHO_MAX_DELAY (0.207f) +#define AL_ECHO_DEFAULT_DELAY (0.1f) + +#define AL_ECHO_MIN_LRDELAY (0.0f) +#define AL_ECHO_MAX_LRDELAY (0.404f) +#define AL_ECHO_DEFAULT_LRDELAY (0.1f) + +#define AL_ECHO_MIN_DAMPING (0.0f) +#define AL_ECHO_MAX_DAMPING (0.99f) +#define AL_ECHO_DEFAULT_DAMPING (0.5f) + +#define AL_ECHO_MIN_FEEDBACK (0.0f) +#define AL_ECHO_MAX_FEEDBACK (1.0f) +#define AL_ECHO_DEFAULT_FEEDBACK (0.5f) + +#define AL_ECHO_MIN_SPREAD (-1.0f) +#define AL_ECHO_MAX_SPREAD (1.0f) +#define AL_ECHO_DEFAULT_SPREAD (-1.0f) + +/* Flanger effect */ +#define AL_FLANGER_WAVEFORM_SINUSOID (0) +#define AL_FLANGER_WAVEFORM_TRIANGLE (1) + +#define AL_FLANGER_MIN_WAVEFORM (0) +#define AL_FLANGER_MAX_WAVEFORM (1) +#define AL_FLANGER_DEFAULT_WAVEFORM (1) + +#define AL_FLANGER_MIN_PHASE (-180) +#define AL_FLANGER_MAX_PHASE (180) +#define AL_FLANGER_DEFAULT_PHASE (0) + +#define AL_FLANGER_MIN_RATE (0.0f) +#define AL_FLANGER_MAX_RATE (10.0f) +#define AL_FLANGER_DEFAULT_RATE (0.27f) + +#define AL_FLANGER_MIN_DEPTH (0.0f) +#define AL_FLANGER_MAX_DEPTH (1.0f) +#define AL_FLANGER_DEFAULT_DEPTH (1.0f) + +#define AL_FLANGER_MIN_FEEDBACK (-1.0f) +#define AL_FLANGER_MAX_FEEDBACK (1.0f) +#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f) + +#define AL_FLANGER_MIN_DELAY (0.0f) +#define AL_FLANGER_MAX_DELAY (0.004f) +#define AL_FLANGER_DEFAULT_DELAY (0.002f) + +/* Frequency shifter effect */ +#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f) +#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f) +#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f) + +#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0) + +#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0) +#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1) +#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2) + +#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0) +#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2) +#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0) + +/* Vocal morpher effect */ +#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10) + +#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24) +#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24) +#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0) + +#define AL_VOCAL_MORPHER_PHONEME_A (0) +#define AL_VOCAL_MORPHER_PHONEME_E (1) +#define AL_VOCAL_MORPHER_PHONEME_I (2) +#define AL_VOCAL_MORPHER_PHONEME_O (3) +#define AL_VOCAL_MORPHER_PHONEME_U (4) +#define AL_VOCAL_MORPHER_PHONEME_AA (5) +#define AL_VOCAL_MORPHER_PHONEME_AE (6) +#define AL_VOCAL_MORPHER_PHONEME_AH (7) +#define AL_VOCAL_MORPHER_PHONEME_AO (8) +#define AL_VOCAL_MORPHER_PHONEME_EH (9) +#define AL_VOCAL_MORPHER_PHONEME_ER (10) +#define AL_VOCAL_MORPHER_PHONEME_IH (11) +#define AL_VOCAL_MORPHER_PHONEME_IY (12) +#define AL_VOCAL_MORPHER_PHONEME_UH (13) +#define AL_VOCAL_MORPHER_PHONEME_UW (14) +#define AL_VOCAL_MORPHER_PHONEME_B (15) +#define AL_VOCAL_MORPHER_PHONEME_D (16) +#define AL_VOCAL_MORPHER_PHONEME_F (17) +#define AL_VOCAL_MORPHER_PHONEME_G (18) +#define AL_VOCAL_MORPHER_PHONEME_J (19) +#define AL_VOCAL_MORPHER_PHONEME_K (20) +#define AL_VOCAL_MORPHER_PHONEME_L (21) +#define AL_VOCAL_MORPHER_PHONEME_M (22) +#define AL_VOCAL_MORPHER_PHONEME_N (23) +#define AL_VOCAL_MORPHER_PHONEME_P (24) +#define AL_VOCAL_MORPHER_PHONEME_R (25) +#define AL_VOCAL_MORPHER_PHONEME_S (26) +#define AL_VOCAL_MORPHER_PHONEME_T (27) +#define AL_VOCAL_MORPHER_PHONEME_V (28) +#define AL_VOCAL_MORPHER_PHONEME_Z (29) + +#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0) +#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1) +#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2) + +#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0) +#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2) +#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0) + +#define AL_VOCAL_MORPHER_MIN_RATE (0.0f) +#define AL_VOCAL_MORPHER_MAX_RATE (10.0f) +#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f) + +/* Pitch shifter effect */ +#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12) +#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12) +#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12) + +#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50) +#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50) +#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0) + +/* Ring modulator effect */ +#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f) +#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f) +#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f) + +#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f) +#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f) +#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f) + +#define AL_RING_MODULATOR_SINUSOID (0) +#define AL_RING_MODULATOR_SAWTOOTH (1) +#define AL_RING_MODULATOR_SQUARE (2) + +#define AL_RING_MODULATOR_MIN_WAVEFORM (0) +#define AL_RING_MODULATOR_MAX_WAVEFORM (2) +#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0) + +/* Autowah effect */ +#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f) +#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f) +#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f) +#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f) + +#define AL_AUTOWAH_MIN_RESONANCE (2.0f) +#define AL_AUTOWAH_MAX_RESONANCE (1000.0f) +#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f) + +#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f) +#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f) +#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f) + +/* Compressor effect */ +#define AL_COMPRESSOR_MIN_ONOFF (0) +#define AL_COMPRESSOR_MAX_ONOFF (1) +#define AL_COMPRESSOR_DEFAULT_ONOFF (1) + +/* Equalizer effect */ +#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f) +#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f) +#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f) +#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f) + +#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f) +#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f) +#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f) + +#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f) +#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f) +#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f) +#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f) + +#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f) +#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f) +#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f) +#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f) +#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f) + +#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f) +#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f) +#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f) + + +/* Source parameter value ranges and defaults. */ +#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f) +#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f) +#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f) + +#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f) +#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f) +#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f) + +#define AL_MIN_CONE_OUTER_GAINHF (0.0f) +#define AL_MAX_CONE_OUTER_GAINHF (1.0f) +#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f) + +#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE + +#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE +#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE +#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE + + +/* Listener parameter value ranges and defaults. */ +#define AL_MIN_METERS_PER_UNIT FLT_MIN +#define AL_MAX_METERS_PER_UNIT FLT_MAX +#define AL_DEFAULT_METERS_PER_UNIT (1.0f) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* AL_EFX_H */ diff --git a/src/external/openal_soft/lib/win32/OpenAL32.dll b/src/external/openal_soft/lib/win32/OpenAL32.dll new file mode 100644 index 00000000..1e3bddd5 Binary files /dev/null and b/src/external/openal_soft/lib/win32/OpenAL32.dll differ diff --git a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a new file mode 100644 index 00000000..1c4c63c8 Binary files /dev/null and b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a differ -- cgit v1.2.3 From 4dada3269374a82fa2c4a06bd29dfc0f37a64380 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 20:40:17 +0200 Subject: Include GLFW3 DLL --- src/external/glfw3/lib/win32/glfw3.dll | Bin 0 -> 305452 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/external/glfw3/lib/win32/glfw3.dll (limited to 'src') diff --git a/src/external/glfw3/lib/win32/glfw3.dll b/src/external/glfw3/lib/win32/glfw3.dll new file mode 100644 index 00000000..9f5d40f6 Binary files /dev/null and b/src/external/glfw3/lib/win32/glfw3.dll differ -- cgit v1.2.3 From 522af9f477247be0a1ac6f079ec155c699a0c5c0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 23:16:14 +0200 Subject: Fallback to default shader --- src/rlgl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 9a102c01..f21f8075 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2579,6 +2579,7 @@ static Shader LoadStandardShader(void) else TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded", shader.id); if (shader.id != 0) LoadDefaultShaderLocations(&shader); + else shader = GetDefaultShader(); return shader; } -- cgit v1.2.3 From 1bcf500ecac076892c4eac0594b997add6dcac71 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Jun 2016 23:19:40 +0200 Subject: Review fallback mechanism --- src/rlgl.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index f21f8075..8d230550 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2575,11 +2575,16 @@ static Shader LoadStandardShader(void) // Load standard shader (TODO: rewrite as char pointers) Shader shader = LoadShader("resources/shaders/standard.vs", "resources/shaders/standard.fs"); - if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); - else TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded", shader.id); - - if (shader.id != 0) LoadDefaultShaderLocations(&shader); - else shader = GetDefaultShader(); + if (shader.id != 0) + { + LoadDefaultShaderLocations(&shader); + TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); + } + else + { + TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded, using default shader", shader.id); + shader = GetDefaultShader(); + } return shader; } -- cgit v1.2.3 From 9281e477eb3845b4a375836bcd00df99ff4b6af1 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Jun 2016 00:32:45 +0200 Subject: Embed standard shader into raylib --- src/rlgl.c | 58 +++++++++++------- src/standard_shader.h | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 21 deletions(-) create mode 100644 src/standard_shader.h (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 8d230550..3dda77b1 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -62,6 +62,10 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() [Used only on TraceLog()] #endif +#if !defined(GRAPHICS_API_OPENGL_11) + #include "standard_shader.h" // Standard shader to embed +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -189,26 +193,27 @@ static bool useTempBuffer = false; // Shader Programs static Shader defaultShader; -static Shader standardShader; -static Shader currentShader; // By default, defaultShader +static Shader standardShader; // Lazy initialization when GetStandardShader() +static Shader currentShader; // By default, defaultShader +static bool standardShaderLoaded = false; // Flags for supported extensions -static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) +static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) // Compressed textures support flags -static bool texCompETC1Supported = false; // ETC1 texture compression support -static bool texCompETC2Supported = false; // ETC2/EAC texture compression support -static bool texCompPVRTSupported = false; // PVR texture compression support -static bool texCompASTCSupported = false; // ASTC texture compression support +static bool texCompETC1Supported = false; // ETC1 texture compression support +static bool texCompETC2Supported = false; // ETC2/EAC texture compression support +static bool texCompPVRTSupported = false; // PVR texture compression support +static bool texCompASTCSupported = false; // ASTC texture compression support // Lighting data -static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount; // Counts current enabled physic objects +static Light lights[MAX_LIGHTS]; // Lights pool +static int lightsCount; // Counts current enabled physic objects #endif // Compressed textures support flags -static bool texCompDXTSupported = false; // DDS texture compression support -static bool npotSupported = false; // NPOT textures full support +static bool texCompDXTSupported = false; // DDS texture compression support +static bool npotSupported = false; // NPOT textures full support #if defined(GRAPHICS_API_OPENGL_ES2) // NOTE: VAO functionality is exposed through extensions (OES) @@ -1031,7 +1036,6 @@ void rlglInit(void) // Init default Shader (customized for GL 3.3 and ES2) defaultShader = LoadDefaultShader(); - standardShader = LoadStandardShader(); currentShader = defaultShader; LoadDefaultBuffers(); // Initialize default vertex arrays buffers (lines, triangles, quads) @@ -2184,14 +2188,22 @@ Shader GetDefaultShader(void) } // Get default shader +// NOTE: Inits global variable standardShader Shader GetStandardShader(void) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - return standardShader; -#else Shader shader = { 0 }; - return shader; + +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + if (standardShaderLoaded) shader = standardShader; + else + { + // Lazy initialization of standard shader + standardShader = LoadStandardShader(); + shader = standardShader; + } #endif + + return shader; } // Get shader uniform location @@ -2567,18 +2579,22 @@ static Shader LoadDefaultShader(void) // Load standard shader // NOTE: This shader supports: -// - Up to 3 different maps: diffuse, normal, specular -// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness -// - Up to 8 lights: Point, Directional or Spot +// - Up to 3 different maps: diffuse, normal, specular +// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness +// - Up to 8 lights: Point, Directional or Spot static Shader LoadStandardShader(void) { - // Load standard shader (TODO: rewrite as char pointers) - Shader shader = LoadShader("resources/shaders/standard.vs", "resources/shaders/standard.fs"); + Shader shader; + + // Load standard shader (embeded in standard_shader.h) + shader.id = LoadShaderProgram(vStandardShaderStr, fStandardShaderStr); if (shader.id != 0) { LoadDefaultShaderLocations(&shader); TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); + + standardShaderLoaded = true; } else { diff --git a/src/standard_shader.h b/src/standard_shader.h new file mode 100644 index 00000000..956b5c32 --- /dev/null +++ b/src/standard_shader.h @@ -0,0 +1,166 @@ + +// Vertex shader definition to embed, no external file required +const static unsigned char vStandardShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"attribute vec3 vertexPosition; \n" +"attribute vec3 vertexNormal; \n" +"attribute vec2 vertexTexCoord; \n" +"attribute vec4 vertexColor; \n" +"varying vec3 fragPosition; \n" +"varying vec3 fragNormal; \n" +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec3 vertexPosition; \n" +"in vec3 vertexNormal; \n" +"in vec2 vertexTexCoord; \n" +"in vec4 vertexColor; \n" +"out vec3 fragPosition; \n" +"out vec3 fragNormal; \n" +"out vec2 fragTexCoord; \n" +"out vec4 fragColor; \n" +#endif +"uniform mat4 mvpMatrix; \n" +"void main() \n" +"{ \n" +" fragPosition = vertexPosition; \n" +" fragNormal = vertexNormal; \n" +" fragTexCoord = vertexTexCoord; \n" +" fragColor = vertexColor; \n" +" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" +"} \n"; + +// Fragment shader definition to embed, no external file required +const static unsigned char fStandardShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +"precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"varying vec3 fragPosition; \n" +"varying vec3 fragNormal; \n" +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec3 fragPosition; \n" +"in vec3 fragNormal; \n" +"in vec2 fragTexCoord; \n" +"in vec4 fragColor; \n" +"out vec4 finalColor; \n" +#endif +"uniform sampler2D texture0; \n" +"uniform sampler2D texture1; \n" +"uniform sampler2D texture2; \n" +"uniform vec4 colAmbient; \n" +"uniform vec4 colDiffuse; \n" +"uniform vec4 colSpecular; \n" +"uniform float glossiness; \n" +"uniform int useNormal; \n" +"uniform int useSpecular; \n" +"uniform mat4 modelMatrix; \n" +"uniform vec3 viewDir; \n" +"struct Light { \n" +" int enabled; \n" +" int type; \n" +" vec3 position; \n" +" vec3 direction; \n" +" vec4 diffuse; \n" +" float intensity; \n" +" float radius; \n" +" float coneAngle; }; \n" +"const int maxLights = 8; \n" +"uniform int lightsCount; \n" +"uniform Light lights[maxLights]; \n" +"\n" +"vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s) \n" +"{\n" +" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" +" vec3 surfaceToLight = l.position - surfacePos;\n" +" float brightness = clamp(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n)), 0, 1);\n" +" float diff = 1.0/dot(surfaceToLight/l.radius, surfaceToLight/l.radius)*brightness*l.intensity;\n" +" float spec = 0.0;\n" +" if (diff > 0.0)\n" +" {\n" +" vec3 h = normalize(-l.direction + v);\n" +" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" }\n" +" return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" +"}\n" +"\n" +"vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)\n" +"{\n" +" vec3 lightDir = normalize(-l.direction);\n" +" float diff = clamp(dot(n, lightDir), 0.0, 1.0)*l.intensity;\n" +" float spec = 0.0;\n" +" if (diff > 0.0)\n" +" {\n" +" vec3 h = normalize(lightDir + v);\n" +" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" }\n" +" return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" +"}\n" +"\n" +"vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)\n" +"{\n" +" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" +" vec3 lightToSurface = normalize(surfacePos - l.position);\n" +" vec3 lightDir = normalize(-l.direction);\n" +" float diff = clamp(dot(n, lightDir), 0.0, 1.0)*l.intensity;\n" +" float attenuation = clamp(dot(n, lightToSurface), 0.0, 1.0);\n" +" attenuation = dot(lightToSurface, -lightDir);\n" +" float lightToSurfaceAngle = degrees(acos(attenuation));\n" +" if (lightToSurfaceAngle > l.coneAngle) attenuation = 0.0;\n" +" float falloff = (l.coneAngle - lightToSurfaceAngle)/l.coneAngle;\n" +" float diffAttenuation = diff*attenuation;\n" +" float spec = 0.0;\n" +" if (diffAttenuation > 0.0)\n" +" {\n" +" vec3 h = normalize(lightDir + v);\n" +" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" }\n" +" return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" +"}\n" +"\n" +"void main()\n" +"{\n" +" mat3 normalMatrix = transpose(inverse(mat3(modelMatrix)));\n" +" vec3 normal = normalize(normalMatrix*fragNormal);\n" +" vec3 n = normalize(normal);\n" +" vec3 v = normalize(viewDir);\n" +" vec4 texelColor = texture(texture0, fragTexCoord);\n" +" vec3 lighting = colAmbient.rgb;\n" +" if (useNormal == 1)\n" +" {\n" +" n *= texture(texture1, fragTexCoord).rgb;\n" +" n = normalize(n);\n" +" }\n" +" float spec = 1.0;\n" +" if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" +" for (int i = 0; i < lightsCount; i++)\n" +" {\n" +" if (lights[i].enabled == 1)\n" +" {\n" +" switch (lights[i].type)\n" +" {\n" +" case 0: lighting += CalcPointLight(lights[i], n, v, spec); break;\n" +" case 1: lighting += CalcDirectionalLight(lights[i], n, v, spec); break;\n" +" case 2: lighting += CalcSpotLight(lights[i], n, v, spec); break;\n" +" default: break;\n" +" }\n" +" }\n" +" }\n" +#if defined(GRAPHICS_API_OPENGL_33) +" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" +#endif +"} \n"; \ No newline at end of file -- cgit v1.2.3 From 3d5a4081775633a3b13b04b0a594059b3e3b494e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 7 Jun 2016 18:53:47 +0200 Subject: Remove DEBUG flag for raylib lib compilation ...on Android --- src/android/jni/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk index 0325d1f5..a9178dac 100644 --- a/src/android/jni/Android.mk +++ b/src/android/jni/Android.mk @@ -52,7 +52,7 @@ LOCAL_SRC_FILES :=\ LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/../.. # Required flags for compilation: defines PLATFORM_ANDROID and GRAPHICS_API_OPENGL_ES2 -LOCAL_CFLAGS := -Wall -std=c99 -Wno-missing-braces -g -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2 +LOCAL_CFLAGS := -Wall -std=c99 -Wno-missing-braces -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2 # Build the static library libraylib.a include $(BUILD_STATIC_LIBRARY) -- cgit v1.2.3 From 058af472ea68d0e18e46a44bd0bd44445aa4587b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 7 Jun 2016 18:57:20 +0200 Subject: Converted GLAD to header only --- src/Makefile | 12 +- src/external/glad.c | 7684 --------------------------------------------------- src/external/glad.h | 7678 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/rlgl.c | 3 +- 4 files changed, 7681 insertions(+), 7696 deletions(-) delete mode 100644 src/external/glad.c (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 92e37cfb..ce703c3a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -92,13 +92,7 @@ else endif # define all object files required -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - OBJS = core.o rlgl.o glad.o shapes.o text.o textures.o models.o audio.o utils.o camera.o gestures.o stb_vorbis.o -else - #GLAD only required on desktop platform - OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o stb_vorbis.o utils.o camera.o gestures.o -endif - +OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o utils.o camera.o gestures.o stb_vorbis.o # typing 'make' will invoke the default target entry called 'all', # in this case, the 'default' target entry is raylib @@ -153,10 +147,6 @@ camera.o: camera.c gestures.o: gestures.c $(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -# compile glad module -glad.o: external/glad.c - $(CC) -c external/glad.c $(CFLAGS) $(INCLUDES) - # compile stb_vorbis library stb_vorbis.o: external/stb_vorbis.c $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) diff --git a/src/external/glad.c b/src/external/glad.c deleted file mode 100644 index aace05a7..00000000 --- a/src/external/glad.c +++ /dev/null @@ -1,7684 +0,0 @@ -/* - - OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. - - Language/Generator: C/C++ - Specification: gl - APIs: gl=3.3 - Profile: core - Extensions: - GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control - Loader: No - - Commandline: - --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" - Online: - Too many extensions -*/ - -#include -#include -#include -#include "glad.h" - -struct gladGLversionStruct GLVersion; - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define _GLAD_IS_SOME_NEW_VERSION 1 -#endif - -static int max_loaded_major; -static int max_loaded_minor; - -static const char *exts = NULL; -static int num_exts_i = 0; -static const char **exts_i = NULL; - -static int get_exts(void) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - exts = (const char *)glGetString(GL_EXTENSIONS); -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - num_exts_i = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); - if (num_exts_i > 0) { - exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); - } - - if (exts_i == NULL) { - return 0; - } - - for(index = 0; index < num_exts_i; index++) { - exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); - } - } -#endif - return 1; -} - -static void free_exts(void) { - if (exts_i != NULL) { - free(exts_i); - exts_i = NULL; - } -} - -static int has_ext(const char *ext) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - - if(strcmp(e, ext) == 0) { - return 1; - } - } - } -#endif - - return 0; -} -int GLAD_GL_VERSION_1_0; -int GLAD_GL_VERSION_1_1; -int GLAD_GL_VERSION_1_2; -int GLAD_GL_VERSION_1_3; -int GLAD_GL_VERSION_1_4; -int GLAD_GL_VERSION_1_5; -int GLAD_GL_VERSION_2_0; -int GLAD_GL_VERSION_2_1; -int GLAD_GL_VERSION_3_0; -int GLAD_GL_VERSION_3_1; -int GLAD_GL_VERSION_3_2; -int GLAD_GL_VERSION_3_3; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -PFNGLBINDSAMPLERPROC glad_glBindSampler; -PFNGLLINEWIDTHPROC glad_glLineWidth; -PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -PFNGLCOMPILESHADERPROC glad_glCompileShader; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -PFNGLENABLEIPROC glad_glEnablei; -PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -PFNGLCREATESHADERPROC glad_glCreateShader; -PFNGLISBUFFERPROC glad_glIsBuffer; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -PFNGLHINTPROC glad_glHint; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -PFNGLPOINTSIZEPROC glad_glPointSize; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -PFNGLWAITSYNCPROC glad_glWaitSync; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -PFNGLUNIFORM3IPROC glad_glUniform3i; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -PFNGLUNIFORM3FPROC glad_glUniform3f; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -PFNGLCOLORMASKIPROC glad_glColorMaski; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -PFNGLDRAWARRAYSPROC glad_glDrawArrays; -PFNGLUNIFORM1UIPROC glad_glUniform1ui; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -PFNGLCLEARPROC glad_glClear; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -PFNGLISENABLEDPROC glad_glIsEnabled; -PFNGLSTENCILOPPROC glad_glStencilOp; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -PFNGLGETQUERYIVPROC glad_glGetQueryiv; -PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -PFNGLISSHADERPROC glad_glIsShader; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -PFNGLENABLEPROC glad_glEnable; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -PFNGLFLUSHPROC glad_glFlush; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -PFNGLFENCESYNCPROC glad_glFenceSync; -PFNGLCOLORP3UIPROC glad_glColorP3ui; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -PFNGLGENSAMPLERSPROC glad_glGenSamplers; -PFNGLCLAMPCOLORPROC glad_glClampColor; -PFNGLUNIFORM4IVPROC glad_glUniform4iv; -PFNGLCLEARSTENCILPROC glad_glClearStencil; -PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -PFNGLGENTEXTURESPROC glad_glGenTextures; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -PFNGLISSYNCPROC glad_glIsSync; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -PFNGLUNIFORM2IPROC glad_glUniform2i; -PFNGLUNIFORM2FPROC glad_glUniform2f; -PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -PFNGLGENQUERIESPROC glad_glGenQueries; -PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -PFNGLISENABLEDIPROC glad_glIsEnabledi; -PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -PFNGLUNIFORM2IVPROC glad_glUniform2iv; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -PFNGLGETSHADERIVPROC glad_glGetShaderiv; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -PFNGLGETDOUBLEVPROC glad_glGetDoublev; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -PFNGLUNIFORM3FVPROC glad_glUniform3fv; -PFNGLDEPTHRANGEPROC glad_glDepthRange; -PFNGLMAPBUFFERPROC glad_glMapBuffer; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -PFNGLDELETESYNCPROC glad_glDeleteSync; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -PFNGLUNIFORM3IVPROC glad_glUniform3iv; -PFNGLPOLYGONMODEPROC glad_glPolygonMode; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -PFNGLUSEPROGRAMPROC glad_glUseProgram; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -PFNGLFINISHPROC glad_glFinish; -PFNGLDELETESHADERPROC glad_glDeleteShader; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -PFNGLVIEWPORTPROC glad_glViewport; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -PFNGLUNIFORM2UIPROC glad_glUniform2ui; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -PFNGLCLEARDEPTHPROC glad_glClearDepth; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -PFNGLTEXBUFFERPROC glad_glTexBuffer; -PFNGLPIXELSTOREIPROC glad_glPixelStorei; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -PFNGLPIXELSTOREFPROC glad_glPixelStoref; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -PFNGLLINKPROGRAMPROC glad_glLinkProgram; -PFNGLBINDTEXTUREPROC glad_glBindTexture; -PFNGLGETSTRINGPROC glad_glGetString; -PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -PFNGLDETACHSHADERPROC glad_glDetachShader; -PFNGLENDQUERYPROC glad_glEndQuery; -PFNGLNORMALP3UIPROC glad_glNormalP3ui; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -PFNGLUNIFORM1FPROC glad_glUniform1f; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -PFNGLUNIFORM1IPROC glad_glUniform1i; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -PFNGLDISABLEPROC glad_glDisable; -PFNGLLOGICOPPROC glad_glLogicOp; -PFNGLUNIFORM4UIPROC glad_glUniform4ui; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -PFNGLCULLFACEPROC glad_glCullFace; -PFNGLGETSTRINGIPROC glad_glGetStringi; -PFNGLATTACHSHADERPROC glad_glAttachShader; -PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -PFNGLDRAWELEMENTSPROC glad_glDrawElements; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -PFNGLUNIFORM1IVPROC glad_glUniform1iv; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -PFNGLREADBUFFERPROC glad_glReadBuffer; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -PFNGLBLENDCOLORPROC glad_glBlendColor; -PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -PFNGLISPROGRAMPROC glad_glIsProgram; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -PFNGLUNIFORM4IPROC glad_glUniform4i; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -PFNGLREADPIXELSPROC glad_glReadPixels; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -PFNGLUNIFORM4FPROC glad_glUniform4f; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -PFNGLSTENCILFUNCPROC glad_glStencilFunc; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -PFNGLCOLORP4UIPROC glad_glColorP4ui; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -PFNGLGENBUFFERSPROC glad_glGenBuffers; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -PFNGLBLENDFUNCPROC glad_glBlendFunc; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -PFNGLSCISSORPROC glad_glScissor; -PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -PFNGLCLEARCOLORPROC glad_glClearColor; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -PFNGLUNIFORM3UIPROC glad_glUniform3ui; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -PFNGLUNIFORM2FVPROC glad_glUniform2fv; -PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -PFNGLDEPTHFUNCPROC glad_glDepthFunc; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -PFNGLCOLORMASKPROC glad_glColorMask; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -PFNGLUNIFORM4FVPROC glad_glUniform4fv; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -PFNGLISSAMPLERPROC glad_glIsSampler; -PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -PFNGLDISABLEIPROC glad_glDisablei; -PFNGLSHADERSOURCEPROC glad_glShaderSource; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -PFNGLGETSYNCIVPROC glad_glGetSynciv; -PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -PFNGLBEGINQUERYPROC glad_glBeginQuery; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -PFNGLBINDBUFFERPROC glad_glBindBuffer; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -PFNGLBUFFERDATAPROC glad_glBufferData; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -PFNGLGETERRORPROC glad_glGetError; -PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -PFNGLGETFLOATVPROC glad_glGetFloatv; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -PFNGLGETINTEGERVPROC glad_glGetIntegerv; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -PFNGLISQUERYPROC glad_glIsQuery; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -PFNGLSTENCILMASKPROC glad_glStencilMask; -PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -PFNGLISTEXTUREPROC glad_glIsTexture; -PFNGLUNIFORM1FVPROC glad_glUniform1fv; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -PFNGLDEPTHMASKPROC glad_glDepthMask; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -PFNGLFRONTFACEPROC glad_glFrontFace; -int GLAD_GL_SGIX_pixel_tiles; -int GLAD_GL_NV_point_sprite; -int GLAD_GL_APPLE_element_array; -int GLAD_GL_AMD_multi_draw_indirect; -int GLAD_GL_EXT_blend_subtract; -int GLAD_GL_SGIX_tag_sample_buffer; -int GLAD_GL_IBM_texture_mirrored_repeat; -int GLAD_GL_APPLE_transform_hint; -int GLAD_GL_ATI_separate_stencil; -int GLAD_GL_NV_shader_atomic_int64; -int GLAD_GL_NV_vertex_program2_option; -int GLAD_GL_EXT_texture_buffer_object; -int GLAD_GL_ARB_vertex_blend; -int GLAD_GL_OVR_multiview; -int GLAD_GL_ARB_program_interface_query; -int GLAD_GL_EXT_misc_attribute; -int GLAD_GL_NV_multisample_coverage; -int GLAD_GL_ARB_shading_language_packing; -int GLAD_GL_EXT_texture_cube_map; -int GLAD_GL_NV_viewport_array2; -int GLAD_GL_KHR_robustness; -int GLAD_GL_EXT_index_func; -int GLAD_GL_OES_compressed_paletted_texture; -int GLAD_GL_NV_depth_clamp; -int GLAD_GL_NV_shader_buffer_load; -int GLAD_GL_EXT_color_subtable; -int GLAD_GL_SUNX_constant_data; -int GLAD_GL_EXT_multi_draw_arrays; -int GLAD_GL_ARB_shader_atomic_counters; -int GLAD_GL_ARB_arrays_of_arrays; -int GLAD_GL_NV_conditional_render; -int GLAD_GL_EXT_texture_env_combine; -int GLAD_GL_AMD_depth_clamp_separate; -int GLAD_GL_SGIX_async_histogram; -int GLAD_GL_MESA_resize_buffers; -int GLAD_GL_ARB_sample_shading; -int GLAD_GL_NV_texture_env_combine4; -int GLAD_GL_ARB_texture_view; -int GLAD_GL_ARB_texture_env_combine; -int GLAD_GL_ARB_map_buffer_range; -int GLAD_GL_EXT_convolution; -int GLAD_GL_NV_compute_program5; -int GLAD_GL_EXT_paletted_texture; -int GLAD_GL_ARB_texture_buffer_object; -int GLAD_GL_SUN_triangle_list; -int GLAD_GL_SGIX_resample; -int GLAD_GL_SGIX_flush_raster; -int GLAD_GL_EXT_light_texture; -int GLAD_GL_ARB_point_sprite; -int GLAD_GL_ARB_sparse_texture2; -int GLAD_GL_ARB_half_float_pixel; -int GLAD_GL_NV_tessellation_program5; -int GLAD_GL_REND_screen_coordinates; -int GLAD_GL_HP_image_transform; -int GLAD_GL_EXT_packed_float; -int GLAD_GL_ATI_vertex_attrib_array_object; -int GLAD_GL_SGIX_vertex_preclip; -int GLAD_GL_SGIX_texture_scale_bias; -int GLAD_GL_AMD_draw_buffers_blend; -int GLAD_GL_APPLE_texture_range; -int GLAD_GL_SGIX_framezoom; -int GLAD_GL_NV_texture_barrier; -int GLAD_GL_ARB_texture_query_levels; -int GLAD_GL_EXT_blend_logic_op; -int GLAD_GL_EXT_texture_swizzle; -int GLAD_GL_ARB_texture_rg; -int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; -int GLAD_GL_ARB_fragment_shader; -int GLAD_GL_3DFX_tbuffer; -int GLAD_GL_SGIX_ycrcb; -int GLAD_GL_IBM_cull_vertex; -int GLAD_GL_EXT_separate_shader_objects; -int GLAD_GL_NV_texture_multisample; -int GLAD_GL_ARB_shader_objects; -int GLAD_GL_ARB_framebuffer_object; -int GLAD_GL_ATI_envmap_bumpmap; -int GLAD_GL_ARB_robust_buffer_access_behavior; -int GLAD_GL_ARB_shader_stencil_export; -int GLAD_GL_AMD_sample_positions; -int GLAD_GL_ARB_enhanced_layouts; -int GLAD_GL_ARB_texture_rectangle; -int GLAD_GL_SGI_texture_color_table; -int GLAD_GL_ATI_map_object_buffer; -int GLAD_GL_ARB_robustness; -int GLAD_GL_NV_pixel_data_range; -int GLAD_GL_EXT_framebuffer_blit; -int GLAD_GL_ARB_gpu_shader_fp64; -int GLAD_GL_NV_command_list; -int GLAD_GL_ARB_window_pos; -int GLAD_GL_ARB_robustness_isolation; -int GLAD_GL_GREMEDY_string_marker; -int GLAD_GL_ARB_texture_compression_bptc; -int GLAD_GL_EXT_subtexture; -int GLAD_GL_EXT_pixel_transform_color_table; -int GLAD_GL_EXT_texture_compression_rgtc; -int GLAD_GL_ARB_shadow; -int GLAD_GL_SGIX_depth_pass_instrument; -int GLAD_GL_NVX_conditional_render; -int GLAD_GL_NV_evaluators; -int GLAD_GL_SGIS_texture_filter4; -int GLAD_GL_AMD_performance_monitor; -int GLAD_GL_NV_geometry_shader4; -int GLAD_GL_EXT_stencil_clear_tag; -int GLAD_GL_NV_vertex_program1_1; -int GLAD_GL_NV_present_video; -int GLAD_GL_ARB_texture_compression_rgtc; -int GLAD_GL_ARB_texture_filter_minmax; -int GLAD_GL_HP_convolution_border_modes; -int GLAD_GL_EXT_gpu_program_parameters; -int GLAD_GL_SGIX_list_priority; -int GLAD_GL_ARB_stencil_texturing; -int GLAD_GL_ARB_shader_clock; -int GLAD_GL_NV_shader_atomic_fp16_vector; -int GLAD_GL_SGIX_fog_offset; -int GLAD_GL_ARB_draw_elements_base_vertex; -int GLAD_GL_INGR_interlace_read; -int GLAD_GL_NV_transform_feedback; -int GLAD_GL_EXT_post_depth_coverage; -int GLAD_GL_ARB_debug_output; -int GLAD_GL_AMD_stencil_operation_extended; -int GLAD_GL_ARB_compatibility; -int GLAD_GL_ARB_instanced_arrays; -int GLAD_GL_ARB_get_texture_sub_image; -int GLAD_GL_NV_vertex_array_range2; -int GLAD_GL_ARB_texture_stencil8; -int GLAD_GL_AMD_sparse_texture; -int GLAD_GL_ARB_clip_control; -int GLAD_GL_NV_fragment_coverage_to_color; -int GLAD_GL_NV_fence; -int GLAD_GL_ARB_texture_buffer_range; -int GLAD_GL_SUN_mesh_array; -int GLAD_GL_ARB_vertex_attrib_binding; -int GLAD_GL_EXT_texture_compression_s3tc; -int GLAD_GL_ARB_cl_event; -int GLAD_GL_ARB_derivative_control; -int GLAD_GL_NV_packed_depth_stencil; -int GLAD_GL_OES_single_precision; -int GLAD_GL_NV_primitive_restart; -int GLAD_GL_ARB_fragment_shader_interlock; -int GLAD_GL_EXT_texture_object; -int GLAD_GL_AMD_name_gen_delete; -int GLAD_GL_NV_texture_compression_vtc; -int GLAD_GL_NV_sample_mask_override_coverage; -int GLAD_GL_NV_texture_shader3; -int GLAD_GL_NV_texture_shader2; -int GLAD_GL_EXT_texture; -int GLAD_GL_ARB_buffer_storage; -int GLAD_GL_AMD_shader_atomic_counter_ops; -int GLAD_GL_APPLE_vertex_program_evaluators; -int GLAD_GL_ARB_multi_bind; -int GLAD_GL_ARB_explicit_uniform_location; -int GLAD_GL_ARB_depth_buffer_float; -int GLAD_GL_NV_path_rendering_shared_edge; -int GLAD_GL_SGIX_shadow_ambient; -int GLAD_GL_ARB_texture_cube_map; -int GLAD_GL_AMD_vertex_shader_viewport_index; -int GLAD_GL_EXT_shader_integer_mix; -int GLAD_GL_NV_vertex_buffer_unified_memory; -int GLAD_GL_EXT_fog_coord; -int GLAD_GL_EXT_texture_env_dot3; -int GLAD_GL_ATI_texture_env_combine3; -int GLAD_GL_ARB_map_buffer_alignment; -int GLAD_GL_NV_blend_equation_advanced; -int GLAD_GL_SGIS_sharpen_texture; -int GLAD_GL_KHR_robust_buffer_access_behavior; -int GLAD_GL_ARB_pipeline_statistics_query; -int GLAD_GL_ARB_vertex_program; -int GLAD_GL_ARB_texture_rgb10_a2ui; -int GLAD_GL_OML_interlace; -int GLAD_GL_ATI_pixel_format_float; -int GLAD_GL_ARB_vertex_buffer_object; -int GLAD_GL_EXT_shadow_funcs; -int GLAD_GL_ATI_text_fragment_shader; -int GLAD_GL_NV_vertex_array_range; -int GLAD_GL_SGIX_fragment_lighting; -int GLAD_GL_NV_texture_expand_normal; -int GLAD_GL_NV_framebuffer_multisample_coverage; -int GLAD_GL_ARB_framebuffer_no_attachments; -int GLAD_GL_EXT_timer_query; -int GLAD_GL_EXT_vertex_array_bgra; -int GLAD_GL_NV_bindless_texture; -int GLAD_GL_KHR_debug; -int GLAD_GL_SGIS_texture_border_clamp; -int GLAD_GL_OML_subsample; -int GLAD_GL_SGIX_clipmap; -int GLAD_GL_EXT_geometry_shader4; -int GLAD_GL_ARB_shader_texture_image_samples; -int GLAD_GL_MESA_ycbcr_texture; -int GLAD_GL_MESAX_texture_stack; -int GLAD_GL_AMD_seamless_cubemap_per_texture; -int GLAD_GL_EXT_bindable_uniform; -int GLAD_GL_KHR_texture_compression_astc_hdr; -int GLAD_GL_ARB_shader_ballot; -int GLAD_GL_KHR_blend_equation_advanced; -int GLAD_GL_ARB_fragment_program_shadow; -int GLAD_GL_ATI_element_array; -int GLAD_GL_ARB_sparse_texture_clamp; -int GLAD_GL_AMD_texture_texture4; -int GLAD_GL_SGIX_reference_plane; -int GLAD_GL_EXT_stencil_two_side; -int GLAD_GL_ARB_transform_feedback_overflow_query; -int GLAD_GL_SGIX_texture_lod_bias; -int GLAD_GL_KHR_no_error; -int GLAD_GL_NV_explicit_multisample; -int GLAD_GL_IBM_static_data; -int GLAD_GL_EXT_clip_volume_hint; -int GLAD_GL_EXT_texture_perturb_normal; -int GLAD_GL_NV_fragment_program2; -int GLAD_GL_NV_fragment_program4; -int GLAD_GL_EXT_point_parameters; -int GLAD_GL_PGI_misc_hints; -int GLAD_GL_SGIX_subsample; -int GLAD_GL_AMD_shader_stencil_export; -int GLAD_GL_ARB_shader_texture_lod; -int GLAD_GL_ARB_vertex_shader; -int GLAD_GL_ARB_depth_clamp; -int GLAD_GL_SGIS_texture_select; -int GLAD_GL_NV_texture_shader; -int GLAD_GL_ARB_tessellation_shader; -int GLAD_GL_EXT_draw_buffers2; -int GLAD_GL_ARB_vertex_attrib_64bit; -int GLAD_GL_EXT_texture_filter_minmax; -int GLAD_GL_ARB_texture_gather; -int GLAD_GL_AMD_interleaved_elements; -int GLAD_GL_ARB_fragment_program; -int GLAD_GL_OML_resample; -int GLAD_GL_APPLE_ycbcr_422; -int GLAD_GL_SGIX_texture_add_env; -int GLAD_GL_ARB_shadow_ambient; -int GLAD_GL_ARB_texture_storage; -int GLAD_GL_EXT_pixel_buffer_object; -int GLAD_GL_NV_vertex_program; -int GLAD_GL_SGIS_pixel_texture; -int GLAD_GL_SGIS_generate_mipmap; -int GLAD_GL_SGIX_instruments; -int GLAD_GL_ARB_fragment_layer_viewport; -int GLAD_GL_ARB_shader_storage_buffer_object; -int GLAD_GL_EXT_sparse_texture2; -int GLAD_GL_EXT_blend_minmax; -int GLAD_GL_MESA_pack_invert; -int GLAD_GL_ARB_base_instance; -int GLAD_GL_SUN_global_alpha; -int GLAD_GL_PGI_vertex_hints; -int GLAD_GL_AMD_transform_feedback4; -int GLAD_GL_ARB_ES3_1_compatibility; -int GLAD_GL_EXT_texture_integer; -int GLAD_GL_ARB_texture_multisample; -int GLAD_GL_AMD_gpu_shader_int64; -int GLAD_GL_S3_s3tc; -int GLAD_GL_ARB_query_buffer_object; -int GLAD_GL_AMD_vertex_shader_tessellator; -int GLAD_GL_ARB_invalidate_subdata; -int GLAD_GL_ARB_draw_indirect; -int GLAD_GL_ARB_transform_feedback2; -int GLAD_GL_EXT_index_material; -int GLAD_GL_NV_blend_equation_advanced_coherent; -int GLAD_GL_ARB_texture_non_power_of_two; -int GLAD_GL_KHR_texture_compression_astc_sliced_3d; -int GLAD_GL_ATI_draw_buffers; -int GLAD_GL_EXT_cmyka; -int GLAD_GL_SGIX_pixel_texture; -int GLAD_GL_APPLE_specular_vector; -int GLAD_GL_ARB_seamless_cubemap_per_texture; -int GLAD_GL_ARB_conservative_depth; -int GLAD_GL_SGIX_interlace; -int GLAD_GL_NV_parameter_buffer_object; -int GLAD_GL_AMD_shader_trinary_minmax; -int GLAD_GL_EXT_texture_lod_bias; -int GLAD_GL_EXT_rescale_normal; -int GLAD_GL_ARB_pixel_buffer_object; -int GLAD_GL_ARB_uniform_buffer_object; -int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; -int GLAD_GL_ARB_texture_swizzle; -int GLAD_GL_ARB_texture_compression; -int GLAD_GL_SGIX_async_pixel; -int GLAD_GL_NV_fragment_program_option; -int GLAD_GL_ARB_explicit_attrib_location; -int GLAD_GL_EXT_blend_color; -int GLAD_GL_NV_shader_thread_group; -int GLAD_GL_EXT_stencil_wrap; -int GLAD_GL_EXT_index_array_formats; -int GLAD_GL_OVR_multiview2; -int GLAD_GL_EXT_histogram; -int GLAD_GL_EXT_polygon_offset; -int GLAD_GL_SGIS_point_parameters; -int GLAD_GL_EXT_direct_state_access; -int GLAD_GL_ARB_shader_group_vote; -int GLAD_GL_NV_texture_rectangle; -int GLAD_GL_ARB_copy_image; -int GLAD_GL_NV_shader_thread_shuffle; -int GLAD_GL_ARB_shader_precision; -int GLAD_GL_EXT_vertex_shader; -int GLAD_GL_EXT_blend_func_separate; -int GLAD_GL_APPLE_fence; -int GLAD_GL_OES_byte_coordinates; -int GLAD_GL_ARB_transpose_matrix; -int GLAD_GL_ARB_provoking_vertex; -int GLAD_GL_NV_uniform_buffer_unified_memory; -int GLAD_GL_NV_fragment_shader_interlock; -int GLAD_GL_EXT_vertex_array; -int GLAD_GL_ARB_half_float_vertex; -int GLAD_GL_EXT_blend_equation_separate; -int GLAD_GL_NV_framebuffer_mixed_samples; -int GLAD_GL_ARB_multi_draw_indirect; -int GLAD_GL_EXT_raster_multisample; -int GLAD_GL_NV_copy_image; -int GLAD_GL_NV_geometry_shader_passthrough; -int GLAD_GL_INTEL_framebuffer_CMAA; -int GLAD_GL_SGIX_convolution_accuracy; -int GLAD_GL_ARB_transform_feedback3; -int GLAD_GL_SGIX_ycrcba; -int GLAD_GL_EXT_debug_marker; -int GLAD_GL_EXT_bgra; -int GLAD_GL_INTEL_parallel_arrays; -int GLAD_GL_EXT_pixel_transform; -int GLAD_GL_NV_vertex_attrib_integer_64bit; -int GLAD_GL_ATI_fragment_shader; -int GLAD_GL_ARB_vertex_array_object; -int GLAD_GL_ATI_pn_triangles; -int GLAD_GL_EXT_texture_env_add; -int GLAD_GL_EXT_packed_depth_stencil; -int GLAD_GL_EXT_texture_mirror_clamp; -int GLAD_GL_NV_multisample_filter_hint; -int GLAD_GL_INTEL_performance_query; -int GLAD_GL_ARB_transform_feedback_instanced; -int GLAD_GL_SGIX_async; -int GLAD_GL_EXT_texture_compression_latc; -int GLAD_GL_NV_shader_atomic_float; -int GLAD_GL_ARB_shading_language_100; -int GLAD_GL_APPLE_float_pixels; -int GLAD_GL_ARB_texture_mirror_clamp_to_edge; -int GLAD_GL_NV_vertex_program2; -int GLAD_GL_NV_bindless_multi_draw_indirect_count; -int GLAD_GL_ARB_depth_texture; -int GLAD_GL_ARB_ES2_compatibility; -int GLAD_GL_ARB_indirect_parameters; -int GLAD_GL_NV_half_float; -int GLAD_GL_ARB_ES3_2_compatibility; -int GLAD_GL_ATI_texture_mirror_once; -int GLAD_GL_IBM_rasterpos_clip; -int GLAD_GL_SGIX_shadow; -int GLAD_GL_EXT_polygon_offset_clamp; -int GLAD_GL_NV_deep_texture3D; -int GLAD_GL_ARB_shader_draw_parameters; -int GLAD_GL_SGIX_calligraphic_fragment; -int GLAD_GL_ARB_shader_bit_encoding; -int GLAD_GL_EXT_compiled_vertex_array; -int GLAD_GL_NV_depth_buffer_float; -int GLAD_GL_APPLE_flush_buffer_range; -int GLAD_GL_ARB_imaging; -int GLAD_GL_ARB_draw_buffers_blend; -int GLAD_GL_AMD_gcn_shader; -int GLAD_GL_AMD_blend_minmax_factor; -int GLAD_GL_EXT_texture_sRGB_decode; -int GLAD_GL_ARB_shading_language_420pack; -int GLAD_GL_ARB_shader_viewport_layer_array; -int GLAD_GL_ATI_meminfo; -int GLAD_GL_EXT_abgr; -int GLAD_GL_AMD_pinned_memory; -int GLAD_GL_EXT_texture_snorm; -int GLAD_GL_SGIX_texture_coordinate_clamp; -int GLAD_GL_ARB_clear_buffer_object; -int GLAD_GL_ARB_multisample; -int GLAD_GL_EXT_debug_label; -int GLAD_GL_NV_light_max_exponent; -int GLAD_GL_NV_internalformat_sample_query; -int GLAD_GL_INTEL_map_texture; -int GLAD_GL_ARB_texture_env_crossbar; -int GLAD_GL_EXT_422_pixels; -int GLAD_GL_ARB_compute_shader; -int GLAD_GL_NV_texgen_emboss; -int GLAD_GL_ARB_blend_func_extended; -int GLAD_GL_IBM_vertex_array_lists; -int GLAD_GL_ARB_color_buffer_float; -int GLAD_GL_ARB_bindless_texture; -int GLAD_GL_SGIX_depth_texture; -int GLAD_GL_ARB_internalformat_query; -int GLAD_GL_ARB_shader_atomic_counter_ops; -int GLAD_GL_ARB_texture_mirrored_repeat; -int GLAD_GL_EXT_shader_image_load_store; -int GLAD_GL_EXT_copy_texture; -int GLAD_GL_NV_register_combiners2; -int GLAD_GL_SGIX_ycrcb_subsample; -int GLAD_GL_ARB_copy_buffer; -int GLAD_GL_NV_draw_texture; -int GLAD_GL_EXT_texture_shared_exponent; -int GLAD_GL_EXT_draw_instanced; -int GLAD_GL_NV_copy_depth_to_color; -int GLAD_GL_ARB_viewport_array; -int GLAD_GL_ARB_separate_shader_objects; -int GLAD_GL_EXT_multisample; -int GLAD_GL_EXT_depth_bounds_test; -int GLAD_GL_EXT_shared_texture_palette; -int GLAD_GL_ARB_texture_env_add; -int GLAD_GL_NV_video_capture; -int GLAD_GL_ARB_sampler_objects; -int GLAD_GL_ARB_matrix_palette; -int GLAD_GL_SGIS_texture_color_mask; -int GLAD_GL_EXT_packed_pixels; -int GLAD_GL_EXT_coordinate_frame; -int GLAD_GL_NV_transform_feedback2; -int GLAD_GL_APPLE_aux_depth_stencil; -int GLAD_GL_ARB_shader_subroutine; -int GLAD_GL_EXT_framebuffer_sRGB; -int GLAD_GL_ARB_texture_storage_multisample; -int GLAD_GL_KHR_blend_equation_advanced_coherent; -int GLAD_GL_EXT_vertex_attrib_64bit; -int GLAD_GL_HP_texture_lighting; -int GLAD_GL_NV_shader_buffer_store; -int GLAD_GL_OES_query_matrix; -int GLAD_GL_MESA_window_pos; -int GLAD_GL_NV_fill_rectangle; -int GLAD_GL_NV_shader_storage_buffer_object; -int GLAD_GL_ARB_texture_query_lod; -int GLAD_GL_SGIX_ir_instrument1; -int GLAD_GL_ARB_shader_image_size; -int GLAD_GL_NV_shader_atomic_counters; -int GLAD_GL_APPLE_object_purgeable; -int GLAD_GL_ARB_occlusion_query; -int GLAD_GL_INGR_color_clamp; -int GLAD_GL_SGI_color_table; -int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -int GLAD_GL_ARB_texture_cube_map_array; -int GLAD_GL_AMD_debug_output; -int GLAD_GL_EXT_gpu_shader4; -int GLAD_GL_NV_geometry_program4; -int GLAD_GL_NV_gpu_program5_mem_extended; -int GLAD_GL_SGIX_scalebias_hint; -int GLAD_GL_ARB_texture_border_clamp; -int GLAD_GL_ARB_fragment_coord_conventions; -int GLAD_GL_SGIX_polynomial_ffd; -int GLAD_GL_EXT_provoking_vertex; -int GLAD_GL_ARB_point_parameters; -int GLAD_GL_ARB_shader_image_load_store; -int GLAD_GL_ARB_conditional_render_inverted; -int GLAD_GL_HP_occlusion_test; -int GLAD_GL_ARB_ES3_compatibility; -int GLAD_GL_EXT_texture_array; -int GLAD_GL_ARB_texture_buffer_object_rgb32; -int GLAD_GL_NV_bindless_multi_draw_indirect; -int GLAD_GL_SGIX_texture_multi_buffer; -int GLAD_GL_EXT_transform_feedback; -int GLAD_GL_KHR_texture_compression_astc_ldr; -int GLAD_GL_3DFX_multisample; -int GLAD_GL_INTEL_fragment_shader_ordering; -int GLAD_GL_ARB_texture_env_dot3; -int GLAD_GL_NV_gpu_program4; -int GLAD_GL_NV_gpu_program5; -int GLAD_GL_NV_float_buffer; -int GLAD_GL_SGIS_texture_edge_clamp; -int GLAD_GL_ARB_framebuffer_sRGB; -int GLAD_GL_SUN_slice_accum; -int GLAD_GL_EXT_index_texture; -int GLAD_GL_EXT_shader_image_load_formatted; -int GLAD_GL_ARB_geometry_shader4; -int GLAD_GL_EXT_separate_specular_color; -int GLAD_GL_NV_fog_distance; -int GLAD_GL_NV_conservative_raster; -int GLAD_GL_SUN_convolution_border_modes; -int GLAD_GL_SGIX_sprite; -int GLAD_GL_ARB_get_program_binary; -int GLAD_GL_ARB_timer_query; -int GLAD_GL_AMD_occlusion_query_event; -int GLAD_GL_SGIS_multisample; -int GLAD_GL_EXT_framebuffer_object; -int GLAD_GL_EXT_vertex_weighting; -int GLAD_GL_ARB_vertex_array_bgra; -int GLAD_GL_APPLE_vertex_array_range; -int GLAD_GL_AMD_query_buffer_object; -int GLAD_GL_NV_register_combiners; -int GLAD_GL_ARB_draw_buffers; -int GLAD_GL_ARB_clear_texture; -int GLAD_GL_NV_fragment_program; -int GLAD_GL_SGI_color_matrix; -int GLAD_GL_EXT_cull_vertex; -int GLAD_GL_EXT_texture_sRGB; -int GLAD_GL_APPLE_row_bytes; -int GLAD_GL_NV_texgen_reflection; -int GLAD_GL_IBM_multimode_draw_arrays; -int GLAD_GL_APPLE_vertex_array_object; -int GLAD_GL_3DFX_texture_compression_FXT1; -int GLAD_GL_GREMEDY_frame_terminator; -int GLAD_GL_AMD_conservative_depth; -int GLAD_GL_ARB_texture_float; -int GLAD_GL_ARB_compressed_texture_pixel_storage; -int GLAD_GL_SGIS_detail_texture; -int GLAD_GL_ARB_draw_instanced; -int GLAD_GL_OES_read_format; -int GLAD_GL_ATI_texture_float; -int GLAD_GL_WIN_specular_fog; -int GLAD_GL_AMD_vertex_shader_layer; -int GLAD_GL_ARB_shading_language_include; -int GLAD_GL_APPLE_client_storage; -int GLAD_GL_WIN_phong_shading; -int GLAD_GL_INGR_blend_func_separate; -int GLAD_GL_NV_path_rendering; -int GLAD_GL_NV_conservative_raster_dilate; -int GLAD_GL_ARB_texture_barrier; -int GLAD_GL_ATI_vertex_streams; -int GLAD_GL_ARB_post_depth_coverage; -int GLAD_GL_NV_occlusion_query; -int GLAD_GL_APPLE_rgb_422; -int GLAD_GL_ARB_direct_state_access; -int GLAD_GL_ARB_gpu_shader_int64; -int GLAD_GL_ARB_seamless_cube_map; -int GLAD_GL_ARB_cull_distance; -int GLAD_GL_NV_vdpau_interop; -int GLAD_GL_ARB_occlusion_query2; -int GLAD_GL_ARB_internalformat_query2; -int GLAD_GL_EXT_texture_filter_anisotropic; -int GLAD_GL_SUN_vertex; -int GLAD_GL_ARB_sparse_texture; -int GLAD_GL_SGIS_texture_lod; -int GLAD_GL_NV_vertex_program3; -int GLAD_GL_NV_gpu_shader5; -int GLAD_GL_NV_vertex_program4; -int GLAD_GL_AMD_transform_feedback3_lines_triangles; -int GLAD_GL_SGIS_fog_function; -int GLAD_GL_EXT_x11_sync_object; -int GLAD_GL_ARB_sync; -int GLAD_GL_NV_sample_locations; -int GLAD_GL_ARB_compute_variable_group_size; -int GLAD_GL_OES_fixed_point; -int GLAD_GL_NV_blend_square; -int GLAD_GL_EXT_framebuffer_multisample; -int GLAD_GL_ARB_gpu_shader5; -int GLAD_GL_SGIS_texture4D; -int GLAD_GL_EXT_texture3D; -int GLAD_GL_ARB_multitexture; -int GLAD_GL_EXT_secondary_color; -int GLAD_GL_NV_parameter_buffer_object2; -int GLAD_GL_ATI_vertex_array_object; -int GLAD_GL_ARB_parallel_shader_compile; -int GLAD_GL_NVX_gpu_memory_info; -int GLAD_GL_SGIX_igloo_interface; -int GLAD_GL_SGIS_point_line_texgen; -int GLAD_GL_ARB_sample_locations; -int GLAD_GL_ARB_sparse_buffer; -int GLAD_GL_EXT_draw_range_elements; -int GLAD_GL_SGIX_blend_alpha_minmax; -int GLAD_GL_KHR_context_flush_control; -PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; -PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; -PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; -PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; -PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; -PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; -PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; -PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; -PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; -PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; -PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; -PFNGLWEIGHTIVARBPROC glad_glWeightivARB; -PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; -PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; -PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; -PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; -PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; -PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; -PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; -PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; -PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; -PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; -PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; -PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; -PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; -PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; -PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; -PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; -PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; -PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; -PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; -PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; -PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; -PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; -PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; -PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; -PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; -PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; -PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; -PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; -PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; -PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; -PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; -PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; -PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; -PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; -PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; -PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; -PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; -PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; -PFNGLTEXTUREVIEWPROC glad_glTextureView; -PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; -PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; -PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; -PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; -PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; -PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; -PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; -PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; -PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; -PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; -PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; -PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; -PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; -PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; -PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; -PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; -PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; -PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; -PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; -PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; -PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; -PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; -PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; -PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; -PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; -PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; -PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; -PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; -PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; -PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; -PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; -PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; -PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; -PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; -PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; -PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; -PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; -PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; -PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; -PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; -PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; -PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; -PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; -PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; -PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; -PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; -PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; -PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; -PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; -PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; -PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; -PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; -PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; -PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; -PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; -PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; -PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; -PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; -PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; -PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; -PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; -PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; -PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; -PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; -PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; -PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; -PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; -PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; -PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; -PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; -PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; -PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; -PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; -PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; -PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; -PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; -PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; -PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; -PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; -PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; -PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; -PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; -PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; -PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; -PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; -PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; -PFNGLGETHANDLEARBPROC glad_glGetHandleARB; -PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; -PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; -PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; -PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; -PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; -PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; -PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; -PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; -PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; -PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; -PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; -PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; -PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; -PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; -PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; -PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; -PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; -PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; -PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; -PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; -PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; -PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; -PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; -PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; -PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; -PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; -PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; -PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; -PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; -PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; -PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; -PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; -PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; -PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; -PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; -PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; -PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; -PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; -PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; -PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; -PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; -PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; -PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; -PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; -PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; -PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -PFNGLUNIFORM1DPROC glad_glUniform1d; -PFNGLUNIFORM2DPROC glad_glUniform2d; -PFNGLUNIFORM3DPROC glad_glUniform3d; -PFNGLUNIFORM4DPROC glad_glUniform4d; -PFNGLUNIFORM1DVPROC glad_glUniform1dv; -PFNGLUNIFORM2DVPROC glad_glUniform2dv; -PFNGLUNIFORM3DVPROC glad_glUniform3dv; -PFNGLUNIFORM4DVPROC glad_glUniform4dv; -PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; -PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; -PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; -PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; -PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; -PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; -PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; -PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; -PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; -PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; -PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; -PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; -PFNGLISSTATENVPROC glad_glIsStateNV; -PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; -PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; -PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; -PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; -PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; -PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; -PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; -PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; -PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; -PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; -PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; -PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; -PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; -PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; -PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; -PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; -PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; -PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; -PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; -PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; -PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; -PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; -PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; -PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; -PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; -PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; -PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; -PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; -PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; -PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; -PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; -PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; -PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; -PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; -PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; -PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; -PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; -PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; -PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; -PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; -PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; -PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; -PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; -PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; -PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; -PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; -PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; -PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; -PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; -PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; -PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; -PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; -PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; -PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; -PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; -PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; -PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; -PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; -PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; -PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; -PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; -PFNGLREADNPIXELSPROC glad_glReadnPixels; -PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; -PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; -PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; -PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; -PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; -PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; -PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; -PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; -PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; -PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; -PFNGLCLIPCONTROLPROC glad_glClipControl; -PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; -PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; -PFNGLGENFENCESNVPROC glad_glGenFencesNV; -PFNGLISFENCENVPROC glad_glIsFenceNV; -PFNGLTESTFENCENVPROC glad_glTestFenceNV; -PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; -PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; -PFNGLSETFENCENVPROC glad_glSetFenceNV; -PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; -PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; -PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; -PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; -PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; -PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; -PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; -PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; -PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; -PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; -PFNGLORTHOFOESPROC glad_glOrthofOES; -PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; -PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; -PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; -PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; -PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; -PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; -PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; -PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; -PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; -PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; -PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; -PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; -PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; -PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; -PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; -PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; -PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; -PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; -PFNGLISNAMEAMDPROC glad_glIsNameAMD; -PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; -PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; -PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; -PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; -PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; -PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; -PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; -PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; -PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; -PFNGLBINDTEXTURESPROC glad_glBindTextures; -PFNGLBINDSAMPLERSPROC glad_glBindSamplers; -PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; -PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; -PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; -PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; -PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; -PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; -PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; -PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; -PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; -PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; -PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; -PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; -PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; -PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; -PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; -PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; -PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; -PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; -PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; -PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; -PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; -PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; -PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; -PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; -PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -PFNGLISBUFFERARBPROC glad_glIsBufferARB; -PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; -PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; -PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; -PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; -PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; -PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; -PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; -PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; -PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; -PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; -PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; -PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; -PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; -PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; -PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; -PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; -PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; -PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; -PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; -PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; -PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; -PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; -PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; -PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; -PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; -PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; -PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; -PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; -PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -PFNGLOBJECTLABELPROC glad_glObjectLabel; -PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -PFNGLGETPOINTERVPROC glad_glGetPointerv; -PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; -PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; -PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; -PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; -PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; -PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; -PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; -PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; -PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; -PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; -PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; -PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; -PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; -PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; -PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; -PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; -PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; -PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; -PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; -PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; -PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; -PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; -PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; -PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; -PFNGLHINTPGIPROC glad_glHintPGI; -PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; -PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; -PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; -PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; -PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; -PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; -PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; -PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; -PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; -PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; -PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; -PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; -PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; -PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; -PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; -PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; -PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; -PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; -PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; -PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; -PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; -PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; -PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; -PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; -PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; -PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; -PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; -PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; -PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; -PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; -PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; -PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; -PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; -PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; -PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; -PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; -PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; -PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; -PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; -PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; -PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; -PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; -PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; -PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; -PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; -PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; -PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; -PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; -PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; -PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; -PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; -PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; -PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; -PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; -PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; -PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; -PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; -PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; -PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; -PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; -PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; -PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; -PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; -PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; -PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; -PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; -PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; -PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; -PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; -PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; -PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; -PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; -PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; -PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; -PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; -PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; -PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; -PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; -PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; -PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; -PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; -PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; -PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; -PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; -PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; -PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; -PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; -PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; -PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; -PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; -PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; -PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; -PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; -PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; -PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; -PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; -PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; -PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; -PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; -PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; -PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; -PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; -PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; -PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; -PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; -PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; -PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; -PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; -PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; -PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; -PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; -PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; -PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; -PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; -PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; -PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; -PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; -PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; -PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; -PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; -PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; -PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; -PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; -PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; -PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; -PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; -PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; -PFNGLCREATETEXTURESPROC glad_glCreateTextures; -PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; -PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; -PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; -PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; -PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; -PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; -PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; -PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; -PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; -PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; -PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; -PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; -PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; -PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; -PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; -PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; -PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; -PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; -PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; -PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; -PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; -PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; -PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; -PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; -PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; -PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; -PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; -PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; -PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; -PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; -PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; -PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; -PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; -PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; -PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; -PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; -PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; -PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; -PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; -PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; -PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; -PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; -PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; -PFNGLCREATEQUERIESPROC glad_glCreateQueries; -PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; -PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; -PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; -PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; -PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; -PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; -PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; -PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; -PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; -PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; -PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; -PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; -PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; -PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; -PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; -PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; -PFNGLMINMAXEXTPROC glad_glMinmaxEXT; -PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; -PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; -PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; -PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; -PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; -PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; -PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; -PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; -PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; -PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; -PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; -PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; -PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; -PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; -PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; -PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; -PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; -PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; -PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; -PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; -PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; -PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; -PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; -PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; -PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; -PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; -PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; -PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; -PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; -PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; -PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; -PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; -PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; -PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; -PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; -PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; -PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; -PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; -PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; -PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; -PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; -PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; -PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; -PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; -PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; -PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; -PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; -PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; -PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; -PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; -PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; -PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; -PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; -PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; -PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; -PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; -PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; -PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; -PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; -PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; -PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; -PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; -PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; -PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; -PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; -PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; -PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; -PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; -PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; -PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; -PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; -PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; -PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; -PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; -PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; -PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; -PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; -PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; -PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; -PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; -PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; -PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; -PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; -PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; -PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; -PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; -PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; -PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; -PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; -PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; -PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; -PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; -PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; -PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; -PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; -PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; -PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; -PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; -PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; -PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; -PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; -PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; -PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; -PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; -PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; -PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; -PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; -PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; -PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; -PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; -PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; -PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; -PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; -PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; -PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; -PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; -PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; -PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; -PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; -PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; -PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; -PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; -PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; -PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; -PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; -PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; -PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; -PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; -PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; -PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; -PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; -PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; -PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; -PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; -PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; -PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; -PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; -PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; -PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; -PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; -PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; -PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; -PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; -PFNGLISPROGRAMNVPROC glad_glIsProgramNV; -PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; -PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; -PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; -PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; -PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; -PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; -PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; -PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; -PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; -PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; -PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; -PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; -PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; -PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; -PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; -PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; -PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; -PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; -PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; -PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; -PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; -PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; -PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; -PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; -PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; -PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; -PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; -PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; -PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; -PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; -PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; -PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; -PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; -PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; -PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; -PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; -PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; -PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; -PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; -PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; -PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; -PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; -PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; -PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; -PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; -PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; -PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; -PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; -PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; -PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; -PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; -PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; -PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; -PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; -PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; -PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; -PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; -PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; -PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; -PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; -PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; -PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; -PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; -PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; -PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; -PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; -PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; -PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; -PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; -PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; -PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; -PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; -PFNGLVERTEX2BOESPROC glad_glVertex2bOES; -PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; -PFNGLVERTEX3BOESPROC glad_glVertex3bOES; -PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; -PFNGLVERTEX4BOESPROC glad_glVertex4bOES; -PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; -PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; -PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; -PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; -PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; -PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; -PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; -PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; -PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; -PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; -PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; -PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; -PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; -PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; -PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; -PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; -PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; -PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; -PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; -PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; -PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; -PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; -PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; -PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; -PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; -PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; -PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; -PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; -PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; -PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; -PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; -PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; -PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; -PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; -PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; -PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; -PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; -PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; -PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; -PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; -PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; -PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; -PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; -PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; -PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; -PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; -PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; -PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; -PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; -PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; -PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; -PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; -PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; -PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; -PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; -PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -PFNGLSHADERBINARYPROC glad_glShaderBinary; -PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; -PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; -PFNGLVERTEX2HNVPROC glad_glVertex2hNV; -PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; -PFNGLVERTEX3HNVPROC glad_glVertex3hNV; -PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; -PFNGLVERTEX4HNVPROC glad_glVertex4hNV; -PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; -PFNGLNORMAL3HNVPROC glad_glNormal3hNV; -PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; -PFNGLCOLOR3HNVPROC glad_glColor3hNV; -PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; -PFNGLCOLOR4HNVPROC glad_glColor4hNV; -PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; -PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; -PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; -PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; -PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; -PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; -PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; -PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; -PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; -PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; -PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; -PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; -PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; -PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; -PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; -PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; -PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; -PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; -PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; -PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; -PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; -PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; -PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; -PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; -PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; -PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; -PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; -PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; -PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; -PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; -PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; -PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; -PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; -PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; -PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; -PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; -PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; -PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; -PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; -PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; -PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; -PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; -PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; -PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; -PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; -PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; -PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; -PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; -PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; -PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; -PFNGLCOLORTABLEPROC glad_glColorTable; -PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; -PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; -PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; -PFNGLGETCOLORTABLEPROC glad_glGetColorTable; -PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; -PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; -PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; -PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; -PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; -PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; -PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; -PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; -PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; -PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; -PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; -PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; -PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; -PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; -PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; -PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; -PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; -PFNGLGETHISTOGRAMPROC glad_glGetHistogram; -PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; -PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; -PFNGLGETMINMAXPROC glad_glGetMinmax; -PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; -PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; -PFNGLHISTOGRAMPROC glad_glHistogram; -PFNGLMINMAXPROC glad_glMinmax; -PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; -PFNGLRESETMINMAXPROC glad_glResetMinmax; -PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; -PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; -PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; -PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; -PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; -PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; -PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; -PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; -PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; -PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; -PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; -PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; -PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; -PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; -PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; -PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; -PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; -PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; -PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; -PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; -PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; -PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; -PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; -PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; -PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; -PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; -PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; -PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; -PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; -PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; -PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; -PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; -PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; -PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; -PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; -PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; -PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; -PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; -PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; -PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; -PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; -PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; -PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; -PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; -PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; -PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; -PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; -PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; -PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; -PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; -PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; -PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; -PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; -PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; -PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; -PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; -PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; -PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; -PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; -PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; -PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; -PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; -PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; -PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; -PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; -PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; -PFNGLGETFLOATI_VPROC glad_glGetFloati_v; -PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; -PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; -PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; -PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; -PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; -PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; -PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; -PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; -PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; -PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; -PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; -PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; -PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; -PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; -PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; -PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; -PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; -PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; -PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; -PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; -PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; -PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; -PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; -PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; -PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; -PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; -PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; -PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; -PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; -PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; -PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; -PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; -PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; -PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; -PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; -PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; -PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; -PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; -PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; -PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; -PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; -PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; -PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; -PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; -PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; -PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; -PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; -PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; -PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; -PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; -PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; -PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; -PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; -PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; -PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; -PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; -PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; -PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; -PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; -PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; -PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; -PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; -PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; -PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; -PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; -PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; -PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; -PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; -PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; -PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; -PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; -PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; -PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; -PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; -PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; -PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; -PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; -PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; -PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; -PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; -PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; -PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; -PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; -PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; -PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; -PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; -PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; -PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; -PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; -PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; -PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; -PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; -PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; -PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; -PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; -PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; -PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; -PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; -PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; -PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; -PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; -PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; -PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; -PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; -PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; -PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; -PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; -PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; -PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; -PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; -PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; -PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; -PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; -PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; -PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; -PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; -PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; -PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; -PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; -PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; -PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; -PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; -PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; -PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; -PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; -PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; -PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; -PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; -PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; -PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; -PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; -PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; -PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; -PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; -PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; -PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; -PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; -PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; -PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; -PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; -PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; -PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; -PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; -PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; -PFNGLISQUERYARBPROC glad_glIsQueryARB; -PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; -PFNGLENDQUERYARBPROC glad_glEndQueryARB; -PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; -PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; -PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; -PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; -PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; -PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; -PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; -PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; -PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; -PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; -PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; -PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; -PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; -PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; -PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; -PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; -PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; -PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; -PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; -PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; -PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; -PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; -PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; -PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; -PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; -PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; -PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; -PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; -PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; -PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; -PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; -PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; -PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; -PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; -PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; -PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; -PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; -PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; -PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; -PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; -PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; -PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; -PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; -PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; -PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; -PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; -PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; -PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; -PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; -PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; -PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; -PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; -PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; -PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; -PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; -PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; -PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; -PFNGLDEFORMSGIXPROC glad_glDeformSGIX; -PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; -PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; -PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; -PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; -PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; -PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; -PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; -PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; -PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; -PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; -PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; -PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; -PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; -PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; -PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; -PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; -PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; -PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; -PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; -PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; -PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; -PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; -PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; -PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; -PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; -PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; -PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; -PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; -PFNGLPROGRAMBINARYPROC glad_glProgramBinary; -PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; -PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; -PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; -PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; -PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; -PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; -PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; -PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; -PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; -PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; -PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; -PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; -PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; -PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; -PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; -PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; -PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; -PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; -PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; -PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; -PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; -PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; -PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; -PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; -PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; -PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; -PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; -PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; -PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; -PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; -PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; -PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; -PFNGLGENPATHSNVPROC glad_glGenPathsNV; -PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; -PFNGLISPATHNVPROC glad_glIsPathNV; -PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; -PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; -PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; -PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; -PFNGLPATHSTRINGNVPROC glad_glPathStringNV; -PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; -PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; -PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; -PFNGLCOPYPATHNVPROC glad_glCopyPathNV; -PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; -PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; -PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; -PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; -PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; -PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; -PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; -PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; -PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; -PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; -PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; -PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; -PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; -PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; -PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; -PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; -PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; -PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; -PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; -PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; -PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; -PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; -PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; -PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; -PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; -PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; -PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; -PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; -PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; -PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; -PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; -PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; -PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; -PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; -PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; -PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; -PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; -PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; -PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; -PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; -PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; -PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; -PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; -PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; -PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; -PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; -PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; -PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; -PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; -PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; -PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; -PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; -PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; -PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; -PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; -PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; -PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; -PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; -PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; -PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; -PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; -PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; -PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; -PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; -PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; -PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; -PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; -PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; -PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; -PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; -PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; -PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; -PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; -PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; -PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; -PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; -PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; -PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; -PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; -PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; -PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; -PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; -PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; -PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; -PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; -PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; -PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; -PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; -PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; -PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; -PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; -PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; -PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; -PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; -PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; -PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; -PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; -PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; -PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; -PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; -PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; -PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; -PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; -PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; -PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; -PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; -PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; -PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; -PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; -PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; -PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; -PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; -PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; -PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; -PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; -PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; -PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; -PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; -PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; -PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; -PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; -PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; -PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; -PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; -PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; -PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; -PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; -PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; -PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; -PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; -PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; -PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; -PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; -PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; -PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; -PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; -PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; -PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; -PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; -PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; -PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; -PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; -PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; -PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; -PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; -PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; -PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; -PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; -PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; -PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; -PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; -PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; -PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; -PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; -PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; -PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; -PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; -PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; -PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; -PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; -PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; -PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; -PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; -PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; -PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; -PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; -PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; -PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; -PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; -PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; -PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; -PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; -PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; -PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; -PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; -PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; -PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; -PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; -PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; -PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; -PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; -PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; -PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; -PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; -PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; -PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; -PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; -PFNGLCOLOR4XOESPROC glad_glColor4xOES; -PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; -PFNGLFOGXOESPROC glad_glFogxOES; -PFNGLFOGXVOESPROC glad_glFogxvOES; -PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; -PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; -PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; -PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; -PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; -PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; -PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; -PFNGLLIGHTXOESPROC glad_glLightxOES; -PFNGLLIGHTXVOESPROC glad_glLightxvOES; -PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; -PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; -PFNGLMATERIALXOESPROC glad_glMaterialxOES; -PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; -PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; -PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; -PFNGLNORMAL3XOESPROC glad_glNormal3xOES; -PFNGLORTHOXOESPROC glad_glOrthoxOES; -PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; -PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; -PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; -PFNGLROTATEXOESPROC glad_glRotatexOES; -PFNGLSCALEXOESPROC glad_glScalexOES; -PFNGLTEXENVXOESPROC glad_glTexEnvxOES; -PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; -PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; -PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; -PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; -PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; -PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; -PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; -PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; -PFNGLACCUMXOESPROC glad_glAccumxOES; -PFNGLBITMAPXOESPROC glad_glBitmapxOES; -PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; -PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; -PFNGLCOLOR3XOESPROC glad_glColor3xOES; -PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; -PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; -PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; -PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; -PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; -PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; -PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; -PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; -PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; -PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; -PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; -PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; -PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; -PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; -PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; -PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; -PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; -PFNGLINDEXXOESPROC glad_glIndexxOES; -PFNGLINDEXXVOESPROC glad_glIndexxvOES; -PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; -PFNGLMAP1XOESPROC glad_glMap1xOES; -PFNGLMAP2XOESPROC glad_glMap2xOES; -PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; -PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; -PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; -PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; -PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; -PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; -PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; -PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; -PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; -PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; -PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; -PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; -PFNGLPIXELMAPXPROC glad_glPixelMapx; -PFNGLPIXELSTOREXPROC glad_glPixelStorex; -PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; -PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; -PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; -PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; -PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; -PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; -PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; -PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; -PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; -PFNGLRECTXOESPROC glad_glRectxOES; -PFNGLRECTXVOESPROC glad_glRectxvOES; -PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; -PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; -PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; -PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; -PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; -PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; -PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; -PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; -PFNGLTEXGENXOESPROC glad_glTexGenxOES; -PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; -PFNGLVERTEX2XOESPROC glad_glVertex2xOES; -PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; -PFNGLVERTEX3XOESPROC glad_glVertex3xOES; -PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; -PFNGLVERTEX4XOESPROC glad_glVertex4xOES; -PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; -PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; -PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; -PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; -PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; -PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; -PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; -PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; -PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; -PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; -PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; -PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; -PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; -PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; -PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; -PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; -PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; -PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; -PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; -PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; -PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; -PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; -PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; -PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; -PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; -PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; -PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; -PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; -static void load_GL_VERSION_1_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); - glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); - glad_glHint = (PFNGLHINTPROC)load("glHint"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); - glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); - glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); - glad_glClear = (PFNGLCLEARPROC)load("glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); - glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); - glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); - glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); - glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); - glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); - glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); - glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); - glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); - glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); - glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); -} -static void load_GL_VERSION_1_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); - glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); -} -static void load_GL_VERSION_1_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); -} -static void load_GL_VERSION_1_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); -} -static void load_GL_VERSION_1_4(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); -} -static void load_GL_VERSION_1_5(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); - glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); - glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); - glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); - glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); -} -static void load_GL_VERSION_2_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); -} -static void load_GL_VERSION_2_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); -} -static void load_GL_VERSION_3_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); - glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); - glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_VERSION_3_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_VERSION_3_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_VERSION_3_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_3) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); - glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_APPLE_element_array(GLADloadproc load) { - if(!GLAD_GL_APPLE_element_array) return; - glad_glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)load("glElementPointerAPPLE"); - glad_glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)load("glDrawElementArrayAPPLE"); - glad_glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)load("glDrawRangeElementArrayAPPLE"); - glad_glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)load("glMultiDrawElementArrayAPPLE"); - glad_glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)load("glMultiDrawRangeElementArrayAPPLE"); -} -static void load_GL_AMD_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_AMD_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)load("glMultiDrawArraysIndirectAMD"); - glad_glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)load("glMultiDrawElementsIndirectAMD"); -} -static void load_GL_SGIX_tag_sample_buffer(GLADloadproc load) { - if(!GLAD_GL_SGIX_tag_sample_buffer) return; - glad_glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)load("glTagSampleBufferSGIX"); -} -static void load_GL_NV_point_sprite(GLADloadproc load) { - if(!GLAD_GL_NV_point_sprite) return; - glad_glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)load("glPointParameteriNV"); - glad_glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)load("glPointParameterivNV"); -} -static void load_GL_ATI_separate_stencil(GLADloadproc load) { - if(!GLAD_GL_ATI_separate_stencil) return; - glad_glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)load("glStencilOpSeparateATI"); - glad_glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)load("glStencilFuncSeparateATI"); -} -static void load_GL_EXT_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_buffer_object) return; - glad_glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)load("glTexBufferEXT"); -} -static void load_GL_ARB_vertex_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_blend) return; - glad_glWeightbvARB = (PFNGLWEIGHTBVARBPROC)load("glWeightbvARB"); - glad_glWeightsvARB = (PFNGLWEIGHTSVARBPROC)load("glWeightsvARB"); - glad_glWeightivARB = (PFNGLWEIGHTIVARBPROC)load("glWeightivARB"); - glad_glWeightfvARB = (PFNGLWEIGHTFVARBPROC)load("glWeightfvARB"); - glad_glWeightdvARB = (PFNGLWEIGHTDVARBPROC)load("glWeightdvARB"); - glad_glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)load("glWeightubvARB"); - glad_glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)load("glWeightusvARB"); - glad_glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)load("glWeightuivARB"); - glad_glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)load("glWeightPointerARB"); - glad_glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)load("glVertexBlendARB"); -} -static void load_GL_OVR_multiview(GLADloadproc load) { - if(!GLAD_GL_OVR_multiview) return; - glad_glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)load("glFramebufferTextureMultiviewOVR"); -} -static void load_GL_ARB_program_interface_query(GLADloadproc load) { - if(!GLAD_GL_ARB_program_interface_query) return; - glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); - glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); - glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); - glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); - glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); - glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); -} -static void load_GL_EXT_index_func(GLADloadproc load) { - if(!GLAD_GL_EXT_index_func) return; - glad_glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)load("glIndexFuncEXT"); -} -static void load_GL_NV_shader_buffer_load(GLADloadproc load) { - if(!GLAD_GL_NV_shader_buffer_load) return; - glad_glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)load("glMakeBufferResidentNV"); - glad_glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)load("glMakeBufferNonResidentNV"); - glad_glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)load("glIsBufferResidentNV"); - glad_glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)load("glMakeNamedBufferResidentNV"); - glad_glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)load("glMakeNamedBufferNonResidentNV"); - glad_glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)load("glIsNamedBufferResidentNV"); - glad_glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)load("glGetBufferParameterui64vNV"); - glad_glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)load("glGetNamedBufferParameterui64vNV"); - glad_glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)load("glGetIntegerui64vNV"); - glad_glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)load("glUniformui64NV"); - glad_glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)load("glUniformui64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)load("glProgramUniformui64NV"); - glad_glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)load("glProgramUniformui64vNV"); -} -static void load_GL_EXT_color_subtable(GLADloadproc load) { - if(!GLAD_GL_EXT_color_subtable) return; - glad_glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)load("glColorSubTableEXT"); - glad_glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)load("glCopyColorSubTableEXT"); -} -static void load_GL_SUNX_constant_data(GLADloadproc load) { - if(!GLAD_GL_SUNX_constant_data) return; - glad_glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)load("glFinishTextureSUNX"); -} -static void load_GL_EXT_multi_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_EXT_multi_draw_arrays) return; - glad_glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)load("glMultiDrawArraysEXT"); - glad_glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)load("glMultiDrawElementsEXT"); -} -static void load_GL_ARB_shader_atomic_counters(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_atomic_counters) return; - glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); -} -static void load_GL_NV_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NV_conditional_render) return; - glad_glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)load("glBeginConditionalRenderNV"); - glad_glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)load("glEndConditionalRenderNV"); -} -static void load_GL_MESA_resize_buffers(GLADloadproc load) { - if(!GLAD_GL_MESA_resize_buffers) return; - glad_glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)load("glResizeBuffersMESA"); -} -static void load_GL_ARB_texture_view(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_view) return; - glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); -} -static void load_GL_ARB_map_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_map_buffer_range) return; - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); -} -static void load_GL_EXT_convolution(GLADloadproc load) { - if(!GLAD_GL_EXT_convolution) return; - glad_glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)load("glConvolutionFilter1DEXT"); - glad_glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)load("glConvolutionFilter2DEXT"); - glad_glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)load("glConvolutionParameterfEXT"); - glad_glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)load("glConvolutionParameterfvEXT"); - glad_glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)load("glConvolutionParameteriEXT"); - glad_glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)load("glConvolutionParameterivEXT"); - glad_glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)load("glCopyConvolutionFilter1DEXT"); - glad_glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)load("glCopyConvolutionFilter2DEXT"); - glad_glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)load("glGetConvolutionFilterEXT"); - glad_glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)load("glGetConvolutionParameterfvEXT"); - glad_glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)load("glGetConvolutionParameterivEXT"); - glad_glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)load("glGetSeparableFilterEXT"); - glad_glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)load("glSeparableFilter2DEXT"); -} -static void load_GL_NV_vertex_attrib_integer_64bit(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_attrib_integer_64bit) return; - glad_glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)load("glVertexAttribL1i64NV"); - glad_glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)load("glVertexAttribL2i64NV"); - glad_glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)load("glVertexAttribL3i64NV"); - glad_glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)load("glVertexAttribL4i64NV"); - glad_glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)load("glVertexAttribL1i64vNV"); - glad_glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)load("glVertexAttribL2i64vNV"); - glad_glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)load("glVertexAttribL3i64vNV"); - glad_glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)load("glVertexAttribL4i64vNV"); - glad_glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)load("glVertexAttribL1ui64NV"); - glad_glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)load("glVertexAttribL2ui64NV"); - glad_glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)load("glVertexAttribL3ui64NV"); - glad_glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)load("glVertexAttribL4ui64NV"); - glad_glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)load("glVertexAttribL1ui64vNV"); - glad_glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)load("glVertexAttribL2ui64vNV"); - glad_glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)load("glVertexAttribL3ui64vNV"); - glad_glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)load("glVertexAttribL4ui64vNV"); - glad_glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)load("glGetVertexAttribLi64vNV"); - glad_glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)load("glGetVertexAttribLui64vNV"); - glad_glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)load("glVertexAttribLFormatNV"); -} -static void load_GL_EXT_paletted_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_paletted_texture) return; - glad_glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)load("glColorTableEXT"); - glad_glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)load("glGetColorTableEXT"); - glad_glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)load("glGetColorTableParameterivEXT"); - glad_glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)load("glGetColorTableParameterfvEXT"); -} -static void load_GL_ARB_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_object) return; - glad_glTexBufferARB = (PFNGLTEXBUFFERARBPROC)load("glTexBufferARB"); -} -static void load_GL_ATI_pn_triangles(GLADloadproc load) { - if(!GLAD_GL_ATI_pn_triangles) return; - glad_glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)load("glPNTrianglesiATI"); - glad_glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)load("glPNTrianglesfATI"); -} -static void load_GL_SGIX_flush_raster(GLADloadproc load) { - if(!GLAD_GL_SGIX_flush_raster) return; - glad_glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)load("glFlushRasterSGIX"); -} -static void load_GL_EXT_light_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_light_texture) return; - glad_glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)load("glApplyTextureEXT"); - glad_glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)load("glTextureLightEXT"); - glad_glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)load("glTextureMaterialEXT"); -} -static void load_GL_HP_image_transform(GLADloadproc load) { - if(!GLAD_GL_HP_image_transform) return; - glad_glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)load("glImageTransformParameteriHP"); - glad_glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)load("glImageTransformParameterfHP"); - glad_glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)load("glImageTransformParameterivHP"); - glad_glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)load("glImageTransformParameterfvHP"); - glad_glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)load("glGetImageTransformParameterivHP"); - glad_glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)load("glGetImageTransformParameterfvHP"); -} -static void load_GL_AMD_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_AMD_draw_buffers_blend) return; - glad_glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)load("glBlendFuncIndexedAMD"); - glad_glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)load("glBlendFuncSeparateIndexedAMD"); - glad_glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)load("glBlendEquationIndexedAMD"); - glad_glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)load("glBlendEquationSeparateIndexedAMD"); -} -static void load_GL_APPLE_texture_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_texture_range) return; - glad_glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)load("glTextureRangeAPPLE"); - glad_glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)load("glGetTexParameterPointervAPPLE"); -} -static void load_GL_EXT_texture_array(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_array) return; - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); -} -static void load_GL_NV_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_NV_texture_barrier) return; - glad_glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)load("glTextureBarrierNV"); -} -static void load_GL_ARB_vertex_type_2_10_10_10_rev(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_type_2_10_10_10_rev) return; - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_3DFX_tbuffer(GLADloadproc load) { - if(!GLAD_GL_3DFX_tbuffer) return; - glad_glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)load("glTbufferMask3DFX"); -} -static void load_GL_GREMEDY_frame_terminator(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_frame_terminator) return; - glad_glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)load("glFrameTerminatorGREMEDY"); -} -static void load_GL_ARB_blend_func_extended(GLADloadproc load) { - if(!GLAD_GL_ARB_blend_func_extended) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); -} -static void load_GL_EXT_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_EXT_separate_shader_objects) return; - glad_glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)load("glUseShaderProgramEXT"); - glad_glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)load("glActiveProgramEXT"); - glad_glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)load("glCreateShaderProgramEXT"); - glad_glActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC)load("glActiveShaderProgramEXT"); - glad_glBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC)load("glBindProgramPipelineEXT"); - glad_glCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC)load("glCreateShaderProgramvEXT"); - glad_glDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC)load("glDeleteProgramPipelinesEXT"); - glad_glGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC)load("glGenProgramPipelinesEXT"); - glad_glGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)load("glGetProgramPipelineInfoLogEXT"); - glad_glGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC)load("glGetProgramPipelineivEXT"); - glad_glIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC)load("glIsProgramPipelineEXT"); - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC)load("glUseProgramStagesEXT"); - glad_glValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)load("glValidateProgramPipelineEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); -} -static void load_GL_NV_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_texture_multisample) return; - glad_glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTexImage2DMultisampleCoverageNV"); - glad_glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTexImage3DMultisampleCoverageNV"); - glad_glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)load("glTextureImage2DMultisampleNV"); - glad_glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)load("glTextureImage3DMultisampleNV"); - glad_glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTextureImage2DMultisampleCoverageNV"); - glad_glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTextureImage3DMultisampleCoverageNV"); -} -static void load_GL_ARB_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_objects) return; - glad_glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)load("glDeleteObjectARB"); - glad_glGetHandleARB = (PFNGLGETHANDLEARBPROC)load("glGetHandleARB"); - glad_glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)load("glDetachObjectARB"); - glad_glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)load("glCreateShaderObjectARB"); - glad_glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)load("glShaderSourceARB"); - glad_glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)load("glCompileShaderARB"); - glad_glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)load("glCreateProgramObjectARB"); - glad_glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)load("glAttachObjectARB"); - glad_glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)load("glLinkProgramARB"); - glad_glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)load("glUseProgramObjectARB"); - glad_glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)load("glValidateProgramARB"); - glad_glUniform1fARB = (PFNGLUNIFORM1FARBPROC)load("glUniform1fARB"); - glad_glUniform2fARB = (PFNGLUNIFORM2FARBPROC)load("glUniform2fARB"); - glad_glUniform3fARB = (PFNGLUNIFORM3FARBPROC)load("glUniform3fARB"); - glad_glUniform4fARB = (PFNGLUNIFORM4FARBPROC)load("glUniform4fARB"); - glad_glUniform1iARB = (PFNGLUNIFORM1IARBPROC)load("glUniform1iARB"); - glad_glUniform2iARB = (PFNGLUNIFORM2IARBPROC)load("glUniform2iARB"); - glad_glUniform3iARB = (PFNGLUNIFORM3IARBPROC)load("glUniform3iARB"); - glad_glUniform4iARB = (PFNGLUNIFORM4IARBPROC)load("glUniform4iARB"); - glad_glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)load("glUniform1fvARB"); - glad_glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)load("glUniform2fvARB"); - glad_glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)load("glUniform3fvARB"); - glad_glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)load("glUniform4fvARB"); - glad_glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)load("glUniform1ivARB"); - glad_glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)load("glUniform2ivARB"); - glad_glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)load("glUniform3ivARB"); - glad_glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)load("glUniform4ivARB"); - glad_glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)load("glUniformMatrix2fvARB"); - glad_glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)load("glUniformMatrix3fvARB"); - glad_glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)load("glUniformMatrix4fvARB"); - glad_glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)load("glGetObjectParameterfvARB"); - glad_glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)load("glGetObjectParameterivARB"); - glad_glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)load("glGetInfoLogARB"); - glad_glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)load("glGetAttachedObjectsARB"); - glad_glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)load("glGetUniformLocationARB"); - glad_glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)load("glGetActiveUniformARB"); - glad_glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)load("glGetUniformfvARB"); - glad_glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)load("glGetUniformivARB"); - glad_glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)load("glGetShaderSourceARB"); -} -static void load_GL_ARB_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_object) return; - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); -} -static void load_GL_ATI_envmap_bumpmap(GLADloadproc load) { - if(!GLAD_GL_ATI_envmap_bumpmap) return; - glad_glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)load("glTexBumpParameterivATI"); - glad_glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)load("glTexBumpParameterfvATI"); - glad_glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)load("glGetTexBumpParameterivATI"); - glad_glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)load("glGetTexBumpParameterfvATI"); -} -static void load_GL_ATI_map_object_buffer(GLADloadproc load) { - if(!GLAD_GL_ATI_map_object_buffer) return; - glad_glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)load("glMapObjectBufferATI"); - glad_glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)load("glUnmapObjectBufferATI"); -} -static void load_GL_ARB_robustness(GLADloadproc load) { - if(!GLAD_GL_ARB_robustness) return; - glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)load("glGetGraphicsResetStatusARB"); - glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)load("glGetnTexImageARB"); - glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)load("glReadnPixelsARB"); - glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)load("glGetnCompressedTexImageARB"); - glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)load("glGetnUniformfvARB"); - glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)load("glGetnUniformivARB"); - glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)load("glGetnUniformuivARB"); - glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)load("glGetnUniformdvARB"); - glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)load("glGetnMapdvARB"); - glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)load("glGetnMapfvARB"); - glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)load("glGetnMapivARB"); - glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)load("glGetnPixelMapfvARB"); - glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)load("glGetnPixelMapuivARB"); - glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)load("glGetnPixelMapusvARB"); - glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)load("glGetnPolygonStippleARB"); - glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)load("glGetnColorTableARB"); - glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)load("glGetnConvolutionFilterARB"); - glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)load("glGetnSeparableFilterARB"); - glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)load("glGetnHistogramARB"); - glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)load("glGetnMinmaxARB"); -} -static void load_GL_NV_pixel_data_range(GLADloadproc load) { - if(!GLAD_GL_NV_pixel_data_range) return; - glad_glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)load("glPixelDataRangeNV"); - glad_glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)load("glFlushPixelDataRangeNV"); -} -static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_blit) return; - glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); -} -static void load_GL_ARB_gpu_shader_fp64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_fp64) return; - glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); - glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); - glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); - glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); - glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); - glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); - glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); - glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); - glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); - glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); - glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); - glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); - glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); - glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); - glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); - glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); - glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); - glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); -} -static void load_GL_NV_command_list(GLADloadproc load) { - if(!GLAD_GL_NV_command_list) return; - glad_glCreateStatesNV = (PFNGLCREATESTATESNVPROC)load("glCreateStatesNV"); - glad_glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)load("glDeleteStatesNV"); - glad_glIsStateNV = (PFNGLISSTATENVPROC)load("glIsStateNV"); - glad_glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)load("glStateCaptureNV"); - glad_glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)load("glGetCommandHeaderNV"); - glad_glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)load("glGetStageIndexNV"); - glad_glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)load("glDrawCommandsNV"); - glad_glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)load("glDrawCommandsAddressNV"); - glad_glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)load("glDrawCommandsStatesNV"); - glad_glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)load("glDrawCommandsStatesAddressNV"); - glad_glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)load("glCreateCommandListsNV"); - glad_glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)load("glDeleteCommandListsNV"); - glad_glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)load("glIsCommandListNV"); - glad_glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)load("glListDrawCommandsStatesClientNV"); - glad_glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)load("glCommandListSegmentsNV"); - glad_glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)load("glCompileCommandListNV"); - glad_glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)load("glCallCommandListNV"); -} -static void load_GL_EXT_vertex_weighting(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_weighting) return; - glad_glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)load("glVertexWeightfEXT"); - glad_glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)load("glVertexWeightfvEXT"); - glad_glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)load("glVertexWeightPointerEXT"); -} -static void load_GL_GREMEDY_string_marker(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_string_marker) return; - glad_glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)load("glStringMarkerGREMEDY"); -} -static void load_GL_EXT_subtexture(GLADloadproc load) { - if(!GLAD_GL_EXT_subtexture) return; - glad_glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)load("glTexSubImage1DEXT"); - glad_glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)load("glTexSubImage2DEXT"); -} -static void load_GL_EXT_gpu_program_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_program_parameters) return; - glad_glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)load("glProgramEnvParameters4fvEXT"); - glad_glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glProgramLocalParameters4fvEXT"); -} -static void load_GL_NV_evaluators(GLADloadproc load) { - if(!GLAD_GL_NV_evaluators) return; - glad_glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)load("glMapControlPointsNV"); - glad_glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)load("glMapParameterivNV"); - glad_glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)load("glMapParameterfvNV"); - glad_glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)load("glGetMapControlPointsNV"); - glad_glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)load("glGetMapParameterivNV"); - glad_glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)load("glGetMapParameterfvNV"); - glad_glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)load("glGetMapAttribParameterivNV"); - glad_glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)load("glGetMapAttribParameterfvNV"); - glad_glEvalMapsNV = (PFNGLEVALMAPSNVPROC)load("glEvalMapsNV"); -} -static void load_GL_SGIS_texture_filter4(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_filter4) return; - glad_glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)load("glGetTexFilterFuncSGIS"); - glad_glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)load("glTexFilterFuncSGIS"); -} -static void load_GL_AMD_performance_monitor(GLADloadproc load) { - if(!GLAD_GL_AMD_performance_monitor) return; - glad_glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)load("glGetPerfMonitorGroupsAMD"); - glad_glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)load("glGetPerfMonitorCountersAMD"); - glad_glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)load("glGetPerfMonitorGroupStringAMD"); - glad_glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)load("glGetPerfMonitorCounterStringAMD"); - glad_glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)load("glGetPerfMonitorCounterInfoAMD"); - glad_glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)load("glGenPerfMonitorsAMD"); - glad_glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)load("glDeletePerfMonitorsAMD"); - glad_glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)load("glSelectPerfMonitorCountersAMD"); - glad_glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)load("glBeginPerfMonitorAMD"); - glad_glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)load("glEndPerfMonitorAMD"); - glad_glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)load("glGetPerfMonitorCounterDataAMD"); -} -static void load_GL_EXT_stencil_clear_tag(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_clear_tag) return; - glad_glStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC)load("glStencilClearTagEXT"); -} -static void load_GL_NV_present_video(GLADloadproc load) { - if(!GLAD_GL_NV_present_video) return; - glad_glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)load("glPresentFrameKeyedNV"); - glad_glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)load("glPresentFrameDualFillNV"); - glad_glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)load("glGetVideoivNV"); - glad_glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)load("glGetVideouivNV"); - glad_glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)load("glGetVideoi64vNV"); - glad_glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)load("glGetVideoui64vNV"); -} -static void load_GL_SGIX_framezoom(GLADloadproc load) { - if(!GLAD_GL_SGIX_framezoom) return; - glad_glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)load("glFrameZoomSGIX"); -} -static void load_GL_ARB_draw_elements_base_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_elements_base_vertex) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); -} -static void load_GL_NV_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback) return; - glad_glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)load("glBeginTransformFeedbackNV"); - glad_glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)load("glEndTransformFeedbackNV"); - glad_glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)load("glTransformFeedbackAttribsNV"); - glad_glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)load("glBindBufferRangeNV"); - glad_glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)load("glBindBufferOffsetNV"); - glad_glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)load("glBindBufferBaseNV"); - glad_glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)load("glTransformFeedbackVaryingsNV"); - glad_glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)load("glActiveVaryingNV"); - glad_glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)load("glGetVaryingLocationNV"); - glad_glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)load("glGetActiveVaryingNV"); - glad_glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)load("glGetTransformFeedbackVaryingNV"); - glad_glTransformFeedbackStreamAttribsNV = (PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)load("glTransformFeedbackStreamAttribsNV"); -} -static void load_GL_NV_fragment_program(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_program) return; - glad_glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)load("glProgramNamedParameter4fNV"); - glad_glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)load("glProgramNamedParameter4fvNV"); - glad_glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)load("glProgramNamedParameter4dNV"); - glad_glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)load("glProgramNamedParameter4dvNV"); - glad_glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)load("glGetProgramNamedParameterfvNV"); - glad_glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)load("glGetProgramNamedParameterdvNV"); -} -static void load_GL_AMD_stencil_operation_extended(GLADloadproc load) { - if(!GLAD_GL_AMD_stencil_operation_extended) return; - glad_glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)load("glStencilOpValueAMD"); -} -static void load_GL_ARB_instanced_arrays(GLADloadproc load) { - if(!GLAD_GL_ARB_instanced_arrays) return; - glad_glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)load("glVertexAttribDivisorARB"); -} -static void load_GL_EXT_polygon_offset(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset) return; - glad_glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)load("glPolygonOffsetEXT"); -} -static void load_GL_KHR_robustness(GLADloadproc load) { - if(!GLAD_GL_KHR_robustness) return; - glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); - glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); - glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); - glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); - glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); - glad_glGetGraphicsResetStatusKHR = (PFNGLGETGRAPHICSRESETSTATUSKHRPROC)load("glGetGraphicsResetStatusKHR"); - glad_glReadnPixelsKHR = (PFNGLREADNPIXELSKHRPROC)load("glReadnPixelsKHR"); - glad_glGetnUniformfvKHR = (PFNGLGETNUNIFORMFVKHRPROC)load("glGetnUniformfvKHR"); - glad_glGetnUniformivKHR = (PFNGLGETNUNIFORMIVKHRPROC)load("glGetnUniformivKHR"); - glad_glGetnUniformuivKHR = (PFNGLGETNUNIFORMUIVKHRPROC)load("glGetnUniformuivKHR"); -} -static void load_GL_AMD_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_AMD_sparse_texture) return; - glad_glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)load("glTexStorageSparseAMD"); - glad_glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)load("glTextureStorageSparseAMD"); -} -static void load_GL_ARB_clip_control(GLADloadproc load) { - if(!GLAD_GL_ARB_clip_control) return; - glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); -} -static void load_GL_NV_fragment_coverage_to_color(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_coverage_to_color) return; - glad_glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)load("glFragmentCoverageColorNV"); -} -static void load_GL_NV_fence(GLADloadproc load) { - if(!GLAD_GL_NV_fence) return; - glad_glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)load("glDeleteFencesNV"); - glad_glGenFencesNV = (PFNGLGENFENCESNVPROC)load("glGenFencesNV"); - glad_glIsFenceNV = (PFNGLISFENCENVPROC)load("glIsFenceNV"); - glad_glTestFenceNV = (PFNGLTESTFENCENVPROC)load("glTestFenceNV"); - glad_glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)load("glGetFenceivNV"); - glad_glFinishFenceNV = (PFNGLFINISHFENCENVPROC)load("glFinishFenceNV"); - glad_glSetFenceNV = (PFNGLSETFENCENVPROC)load("glSetFenceNV"); -} -static void load_GL_ARB_texture_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_range) return; - glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); -} -static void load_GL_SUN_mesh_array(GLADloadproc load) { - if(!GLAD_GL_SUN_mesh_array) return; - glad_glDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC)load("glDrawMeshArraysSUN"); -} -static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_binding) return; - glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); - glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); - glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); - glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); - glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); - glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); -} -static void load_GL_ARB_framebuffer_no_attachments(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_no_attachments) return; - glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); - glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); -} -static void load_GL_ARB_cl_event(GLADloadproc load) { - if(!GLAD_GL_ARB_cl_event) return; - glad_glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)load("glCreateSyncFromCLeventARB"); -} -static void load_GL_OES_single_precision(GLADloadproc load) { - if(!GLAD_GL_OES_single_precision) return; - glad_glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)load("glClearDepthfOES"); - glad_glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)load("glClipPlanefOES"); - glad_glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)load("glDepthRangefOES"); - glad_glFrustumfOES = (PFNGLFRUSTUMFOESPROC)load("glFrustumfOES"); - glad_glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)load("glGetClipPlanefOES"); - glad_glOrthofOES = (PFNGLORTHOFOESPROC)load("glOrthofOES"); -} -static void load_GL_NV_primitive_restart(GLADloadproc load) { - if(!GLAD_GL_NV_primitive_restart) return; - glad_glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)load("glPrimitiveRestartNV"); - glad_glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)load("glPrimitiveRestartIndexNV"); -} -static void load_GL_SUN_global_alpha(GLADloadproc load) { - if(!GLAD_GL_SUN_global_alpha) return; - glad_glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)load("glGlobalAlphaFactorbSUN"); - glad_glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)load("glGlobalAlphaFactorsSUN"); - glad_glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)load("glGlobalAlphaFactoriSUN"); - glad_glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)load("glGlobalAlphaFactorfSUN"); - glad_glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)load("glGlobalAlphaFactordSUN"); - glad_glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)load("glGlobalAlphaFactorubSUN"); - glad_glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)load("glGlobalAlphaFactorusSUN"); - glad_glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)load("glGlobalAlphaFactoruiSUN"); -} -static void load_GL_EXT_texture_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_object) return; - glad_glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)load("glAreTexturesResidentEXT"); - glad_glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)load("glBindTextureEXT"); - glad_glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)load("glDeleteTexturesEXT"); - glad_glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)load("glGenTexturesEXT"); - glad_glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)load("glIsTextureEXT"); - glad_glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)load("glPrioritizeTexturesEXT"); -} -static void load_GL_AMD_name_gen_delete(GLADloadproc load) { - if(!GLAD_GL_AMD_name_gen_delete) return; - glad_glGenNamesAMD = (PFNGLGENNAMESAMDPROC)load("glGenNamesAMD"); - glad_glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)load("glDeleteNamesAMD"); - glad_glIsNameAMD = (PFNGLISNAMEAMDPROC)load("glIsNameAMD"); -} -static void load_GL_ARB_buffer_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_buffer_storage) return; - glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); -} -static void load_GL_APPLE_vertex_program_evaluators(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_program_evaluators) return; - glad_glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)load("glEnableVertexAttribAPPLE"); - glad_glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)load("glDisableVertexAttribAPPLE"); - glad_glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)load("glIsVertexAttribEnabledAPPLE"); - glad_glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)load("glMapVertexAttrib1dAPPLE"); - glad_glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)load("glMapVertexAttrib1fAPPLE"); - glad_glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)load("glMapVertexAttrib2dAPPLE"); - glad_glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)load("glMapVertexAttrib2fAPPLE"); -} -static void load_GL_ARB_multi_bind(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_bind) return; - glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); - glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); - glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); - glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); - glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); - glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); -} -static void load_GL_SGIX_list_priority(GLADloadproc load) { - if(!GLAD_GL_SGIX_list_priority) return; - glad_glGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC)load("glGetListParameterfvSGIX"); - glad_glGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC)load("glGetListParameterivSGIX"); - glad_glListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC)load("glListParameterfSGIX"); - glad_glListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC)load("glListParameterfvSGIX"); - glad_glListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC)load("glListParameteriSGIX"); - glad_glListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC)load("glListParameterivSGIX"); -} -static void load_GL_NV_vertex_buffer_unified_memory(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_buffer_unified_memory) return; - glad_glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)load("glBufferAddressRangeNV"); - glad_glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)load("glVertexFormatNV"); - glad_glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)load("glNormalFormatNV"); - glad_glColorFormatNV = (PFNGLCOLORFORMATNVPROC)load("glColorFormatNV"); - glad_glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)load("glIndexFormatNV"); - glad_glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)load("glTexCoordFormatNV"); - glad_glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)load("glEdgeFlagFormatNV"); - glad_glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)load("glSecondaryColorFormatNV"); - glad_glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)load("glFogCoordFormatNV"); - glad_glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)load("glVertexAttribFormatNV"); - glad_glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)load("glVertexAttribIFormatNV"); - glad_glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)load("glGetIntegerui64i_vNV"); -} -static void load_GL_NV_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_NV_blend_equation_advanced) return; - glad_glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)load("glBlendParameteriNV"); - glad_glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)load("glBlendBarrierNV"); -} -static void load_GL_SGIS_sharpen_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_sharpen_texture) return; - glad_glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)load("glSharpenTexFuncSGIS"); - glad_glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)load("glGetSharpenTexFuncSGIS"); -} -static void load_GL_ARB_vertex_program(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_program) return; - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_buffer_object) return; - glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); - glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); - glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); - glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); - glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); - glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); - glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); - glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); - glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); - glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); - glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); -} -static void load_GL_NV_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_array_range) return; - glad_glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)load("glFlushVertexArrayRangeNV"); - glad_glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)load("glVertexArrayRangeNV"); -} -static void load_GL_SGIX_fragment_lighting(GLADloadproc load) { - if(!GLAD_GL_SGIX_fragment_lighting) return; - glad_glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)load("glFragmentColorMaterialSGIX"); - glad_glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)load("glFragmentLightfSGIX"); - glad_glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)load("glFragmentLightfvSGIX"); - glad_glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)load("glFragmentLightiSGIX"); - glad_glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)load("glFragmentLightivSGIX"); - glad_glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)load("glFragmentLightModelfSGIX"); - glad_glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)load("glFragmentLightModelfvSGIX"); - glad_glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)load("glFragmentLightModeliSGIX"); - glad_glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)load("glFragmentLightModelivSGIX"); - glad_glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)load("glFragmentMaterialfSGIX"); - glad_glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)load("glFragmentMaterialfvSGIX"); - glad_glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)load("glFragmentMaterialiSGIX"); - glad_glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)load("glFragmentMaterialivSGIX"); - glad_glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)load("glGetFragmentLightfvSGIX"); - glad_glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)load("glGetFragmentLightivSGIX"); - glad_glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)load("glGetFragmentMaterialfvSGIX"); - glad_glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)load("glGetFragmentMaterialivSGIX"); - glad_glLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC)load("glLightEnviSGIX"); -} -static void load_GL_NV_framebuffer_multisample_coverage(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_multisample_coverage) return; - glad_glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)load("glRenderbufferStorageMultisampleCoverageNV"); -} -static void load_GL_EXT_timer_query(GLADloadproc load) { - if(!GLAD_GL_EXT_timer_query) return; - glad_glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)load("glGetQueryObjecti64vEXT"); - glad_glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)load("glGetQueryObjectui64vEXT"); -} -static void load_GL_NV_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_texture) return; - glad_glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)load("glGetTextureHandleNV"); - glad_glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)load("glGetTextureSamplerHandleNV"); - glad_glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)load("glMakeTextureHandleResidentNV"); - glad_glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)load("glMakeTextureHandleNonResidentNV"); - glad_glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)load("glGetImageHandleNV"); - glad_glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)load("glMakeImageHandleResidentNV"); - glad_glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)load("glMakeImageHandleNonResidentNV"); - glad_glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)load("glUniformHandleui64NV"); - glad_glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)load("glUniformHandleui64vNV"); - glad_glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)load("glProgramUniformHandleui64NV"); - glad_glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)load("glProgramUniformHandleui64vNV"); - glad_glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)load("glIsTextureHandleResidentNV"); - glad_glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)load("glIsImageHandleResidentNV"); -} -static void load_GL_KHR_debug(GLADloadproc load) { - if(!GLAD_GL_KHR_debug) return; - glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); - glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); - glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); - glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); - glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); - glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); - glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); - glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); - glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); - glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); - glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); - glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); - glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); - glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); - glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); - glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); - glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); - glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); - glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); - glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); - glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); - glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); -} -static void load_GL_ATI_vertex_attrib_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_attrib_array_object) return; - glad_glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)load("glVertexAttribArrayObjectATI"); - glad_glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)load("glGetVertexAttribArrayObjectfvATI"); - glad_glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)load("glGetVertexAttribArrayObjectivATI"); -} -static void load_GL_EXT_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_geometry_shader4) return; - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); -} -static void load_GL_EXT_bindable_uniform(GLADloadproc load) { - if(!GLAD_GL_EXT_bindable_uniform) return; - glad_glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)load("glUniformBufferEXT"); - glad_glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)load("glGetUniformBufferSizeEXT"); - glad_glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)load("glGetUniformOffsetEXT"); -} -static void load_GL_KHR_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_KHR_blend_equation_advanced) return; - glad_glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)load("glBlendBarrierKHR"); -} -static void load_GL_ATI_element_array(GLADloadproc load) { - if(!GLAD_GL_ATI_element_array) return; - glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); - glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); - glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); -} -static void load_GL_SGIX_reference_plane(GLADloadproc load) { - if(!GLAD_GL_SGIX_reference_plane) return; - glad_glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)load("glReferencePlaneSGIX"); -} -static void load_GL_EXT_stencil_two_side(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_two_side) return; - glad_glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)load("glActiveStencilFaceEXT"); -} -static void load_GL_NV_explicit_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_explicit_multisample) return; - glad_glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)load("glGetMultisamplefvNV"); - glad_glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)load("glSampleMaskIndexedNV"); - glad_glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)load("glTexRenderbufferNV"); -} -static void load_GL_IBM_static_data(GLADloadproc load) { - if(!GLAD_GL_IBM_static_data) return; - glad_glFlushStaticDataIBM = (PFNGLFLUSHSTATICDATAIBMPROC)load("glFlushStaticDataIBM"); -} -static void load_GL_EXT_texture_perturb_normal(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_perturb_normal) return; - glad_glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)load("glTextureNormalEXT"); -} -static void load_GL_EXT_point_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_point_parameters) return; - glad_glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)load("glPointParameterfEXT"); - glad_glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)load("glPointParameterfvEXT"); -} -static void load_GL_PGI_misc_hints(GLADloadproc load) { - if(!GLAD_GL_PGI_misc_hints) return; - glad_glHintPGI = (PFNGLHINTPGIPROC)load("glHintPGI"); -} -static void load_GL_ARB_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_shader) return; - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); - glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); - glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); -} -static void load_GL_ARB_tessellation_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_tessellation_shader) return; - glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); - glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); -} -static void load_GL_EXT_draw_buffers2(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_buffers2) return; - glad_glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)load("glColorMaskIndexedEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); -} -static void load_GL_ARB_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_64bit) return; - glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); - glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); - glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); - glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); - glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); - glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); - glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); - glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); - glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); - glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); -} -static void load_GL_EXT_texture_filter_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_filter_minmax) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); -} -static void load_GL_AMD_interleaved_elements(GLADloadproc load) { - if(!GLAD_GL_AMD_interleaved_elements) return; - glad_glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)load("glVertexAttribParameteriAMD"); -} -static void load_GL_ARB_fragment_program(GLADloadproc load) { - if(!GLAD_GL_ARB_fragment_program) return; - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_texture_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage) return; - glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); - glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); - glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); -} -static void load_GL_ARB_copy_image(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_image) return; - glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); -} -static void load_GL_SGIS_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_pixel_texture) return; - glad_glPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC)load("glPixelTexGenParameteriSGIS"); - glad_glPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC)load("glPixelTexGenParameterivSGIS"); - glad_glPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC)load("glPixelTexGenParameterfSGIS"); - glad_glPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC)load("glPixelTexGenParameterfvSGIS"); - glad_glGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)load("glGetPixelTexGenParameterivSGIS"); - glad_glGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)load("glGetPixelTexGenParameterfvSGIS"); -} -static void load_GL_SGIX_instruments(GLADloadproc load) { - if(!GLAD_GL_SGIX_instruments) return; - glad_glGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC)load("glGetInstrumentsSGIX"); - glad_glInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC)load("glInstrumentsBufferSGIX"); - glad_glPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC)load("glPollInstrumentsSGIX"); - glad_glReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC)load("glReadInstrumentsSGIX"); - glad_glStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC)load("glStartInstrumentsSGIX"); - glad_glStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC)load("glStopInstrumentsSGIX"); -} -static void load_GL_ARB_shader_storage_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_storage_buffer_object) return; - glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); -} -static void load_GL_EXT_blend_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_minmax) return; - glad_glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)load("glBlendEquationEXT"); -} -static void load_GL_ARB_base_instance(GLADloadproc load) { - if(!GLAD_GL_ARB_base_instance) return; - glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); -} -static void load_GL_ARB_ES3_1_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_1_compatibility) return; - glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); -} -static void load_GL_EXT_texture_integer(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_integer) return; - glad_glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)load("glTexParameterIivEXT"); - glad_glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)load("glTexParameterIuivEXT"); - glad_glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)load("glGetTexParameterIivEXT"); - glad_glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)load("glGetTexParameterIuivEXT"); - glad_glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)load("glClearColorIiEXT"); - glad_glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)load("glClearColorIuiEXT"); -} -static void load_GL_ARB_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_multisample) return; - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_AMD_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_AMD_gpu_shader_int64) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_AMD_vertex_shader_tessellator(GLADloadproc load) { - if(!GLAD_GL_AMD_vertex_shader_tessellator) return; - glad_glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)load("glTessellationFactorAMD"); - glad_glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)load("glTessellationModeAMD"); -} -static void load_GL_ARB_invalidate_subdata(GLADloadproc load) { - if(!GLAD_GL_ARB_invalidate_subdata) return; - glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); - glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); - glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); - glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); - glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); - glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); -} -static void load_GL_EXT_index_material(GLADloadproc load) { - if(!GLAD_GL_EXT_index_material) return; - glad_glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)load("glIndexMaterialEXT"); -} -static void load_GL_INTEL_parallel_arrays(GLADloadproc load) { - if(!GLAD_GL_INTEL_parallel_arrays) return; - glad_glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)load("glVertexPointervINTEL"); - glad_glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)load("glNormalPointervINTEL"); - glad_glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)load("glColorPointervINTEL"); - glad_glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)load("glTexCoordPointervINTEL"); -} -static void load_GL_ATI_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ATI_draw_buffers) return; - glad_glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)load("glDrawBuffersATI"); -} -static void load_GL_SGIX_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIX_pixel_texture) return; - glad_glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)load("glPixelTexGenSGIX"); -} -static void load_GL_ARB_timer_query(GLADloadproc load) { - if(!GLAD_GL_ARB_timer_query) return; - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); -} -static void load_GL_NV_parameter_buffer_object(GLADloadproc load) { - if(!GLAD_GL_NV_parameter_buffer_object) return; - glad_glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)load("glProgramBufferParametersfvNV"); - glad_glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)load("glProgramBufferParametersIivNV"); - glad_glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)load("glProgramBufferParametersIuivNV"); -} -static void load_GL_ARB_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_ARB_direct_state_access) return; - glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); - glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); - glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); - glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); - glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); - glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); - glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); - glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); - glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); - glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); - glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); - glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); - glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); - glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); - glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); - glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); - glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); - glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); - glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); - glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); - glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); - glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); - glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); - glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); - glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); - glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); - glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); - glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); - glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); - glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); - glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); - glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); - glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); - glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); - glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); - glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); - glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); - glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); - glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); - glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); - glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); - glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); - glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); - glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); - glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); - glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); - glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); - glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); - glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); - glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); - glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); - glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); - glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); - glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); - glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); - glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); - glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); - glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); - glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); - glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); - glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); - glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); - glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); - glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); - glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); - glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); - glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); - glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); - glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); - glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); - glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); - glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); - glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); - glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); - glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); - glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); - glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); - glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); - glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); - glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); - glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); - glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); - glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); - glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); - glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); - glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); - glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); - glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); - glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); - glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); - glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); - glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); - glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); - glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); - glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); - glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); - glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); -} -static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_uniform_buffer_object) return; - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_NV_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback2) return; - glad_glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)load("glBindTransformFeedbackNV"); - glad_glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)load("glDeleteTransformFeedbacksNV"); - glad_glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)load("glGenTransformFeedbacksNV"); - glad_glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)load("glIsTransformFeedbackNV"); - glad_glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)load("glPauseTransformFeedbackNV"); - glad_glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)load("glResumeTransformFeedbackNV"); - glad_glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)load("glDrawTransformFeedbackNV"); -} -static void load_GL_EXT_blend_color(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_color) return; - glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); -} -static void load_GL_EXT_histogram(GLADloadproc load) { - if(!GLAD_GL_EXT_histogram) return; - glad_glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)load("glGetHistogramEXT"); - glad_glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)load("glGetHistogramParameterfvEXT"); - glad_glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)load("glGetHistogramParameterivEXT"); - glad_glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)load("glGetMinmaxEXT"); - glad_glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)load("glGetMinmaxParameterfvEXT"); - glad_glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)load("glGetMinmaxParameterivEXT"); - glad_glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)load("glHistogramEXT"); - glad_glMinmaxEXT = (PFNGLMINMAXEXTPROC)load("glMinmaxEXT"); - glad_glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)load("glResetHistogramEXT"); - glad_glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)load("glResetMinmaxEXT"); -} -static void load_GL_ARB_get_texture_sub_image(GLADloadproc load) { - if(!GLAD_GL_ARB_get_texture_sub_image) return; - glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); - glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); -} -static void load_GL_SGIS_point_parameters(GLADloadproc load) { - if(!GLAD_GL_SGIS_point_parameters) return; - glad_glPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC)load("glPointParameterfSGIS"); - glad_glPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC)load("glPointParameterfvSGIS"); -} -static void load_GL_EXT_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_EXT_direct_state_access) return; - glad_glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)load("glMatrixLoadfEXT"); - glad_glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)load("glMatrixLoaddEXT"); - glad_glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)load("glMatrixMultfEXT"); - glad_glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)load("glMatrixMultdEXT"); - glad_glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)load("glMatrixLoadIdentityEXT"); - glad_glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)load("glMatrixRotatefEXT"); - glad_glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)load("glMatrixRotatedEXT"); - glad_glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)load("glMatrixScalefEXT"); - glad_glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)load("glMatrixScaledEXT"); - glad_glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)load("glMatrixTranslatefEXT"); - glad_glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)load("glMatrixTranslatedEXT"); - glad_glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)load("glMatrixFrustumEXT"); - glad_glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)load("glMatrixOrthoEXT"); - glad_glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)load("glMatrixPopEXT"); - glad_glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)load("glMatrixPushEXT"); - glad_glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)load("glClientAttribDefaultEXT"); - glad_glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)load("glPushClientAttribDefaultEXT"); - glad_glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)load("glTextureParameterfEXT"); - glad_glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)load("glTextureParameterfvEXT"); - glad_glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)load("glTextureParameteriEXT"); - glad_glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)load("glTextureParameterivEXT"); - glad_glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)load("glTextureImage1DEXT"); - glad_glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)load("glTextureImage2DEXT"); - glad_glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)load("glTextureSubImage1DEXT"); - glad_glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)load("glTextureSubImage2DEXT"); - glad_glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)load("glCopyTextureImage1DEXT"); - glad_glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)load("glCopyTextureImage2DEXT"); - glad_glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)load("glCopyTextureSubImage1DEXT"); - glad_glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)load("glCopyTextureSubImage2DEXT"); - glad_glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)load("glGetTextureImageEXT"); - glad_glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)load("glGetTextureParameterfvEXT"); - glad_glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)load("glGetTextureParameterivEXT"); - glad_glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)load("glGetTextureLevelParameterfvEXT"); - glad_glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)load("glGetTextureLevelParameterivEXT"); - glad_glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)load("glTextureImage3DEXT"); - glad_glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)load("glTextureSubImage3DEXT"); - glad_glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)load("glCopyTextureSubImage3DEXT"); - glad_glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)load("glBindMultiTextureEXT"); - glad_glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)load("glMultiTexCoordPointerEXT"); - glad_glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)load("glMultiTexEnvfEXT"); - glad_glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)load("glMultiTexEnvfvEXT"); - glad_glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)load("glMultiTexEnviEXT"); - glad_glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)load("glMultiTexEnvivEXT"); - glad_glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)load("glMultiTexGendEXT"); - glad_glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)load("glMultiTexGendvEXT"); - glad_glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)load("glMultiTexGenfEXT"); - glad_glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)load("glMultiTexGenfvEXT"); - glad_glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)load("glMultiTexGeniEXT"); - glad_glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)load("glMultiTexGenivEXT"); - glad_glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)load("glGetMultiTexEnvfvEXT"); - glad_glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)load("glGetMultiTexEnvivEXT"); - glad_glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)load("glGetMultiTexGendvEXT"); - glad_glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)load("glGetMultiTexGenfvEXT"); - glad_glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)load("glGetMultiTexGenivEXT"); - glad_glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)load("glMultiTexParameteriEXT"); - glad_glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)load("glMultiTexParameterivEXT"); - glad_glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)load("glMultiTexParameterfEXT"); - glad_glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)load("glMultiTexParameterfvEXT"); - glad_glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)load("glMultiTexImage1DEXT"); - glad_glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)load("glMultiTexImage2DEXT"); - glad_glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)load("glMultiTexSubImage1DEXT"); - glad_glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)load("glMultiTexSubImage2DEXT"); - glad_glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)load("glCopyMultiTexImage1DEXT"); - glad_glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)load("glCopyMultiTexImage2DEXT"); - glad_glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)load("glCopyMultiTexSubImage1DEXT"); - glad_glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)load("glCopyMultiTexSubImage2DEXT"); - glad_glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)load("glGetMultiTexImageEXT"); - glad_glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)load("glGetMultiTexParameterfvEXT"); - glad_glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)load("glGetMultiTexParameterivEXT"); - glad_glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)load("glGetMultiTexLevelParameterfvEXT"); - glad_glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)load("glGetMultiTexLevelParameterivEXT"); - glad_glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)load("glMultiTexImage3DEXT"); - glad_glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)load("glMultiTexSubImage3DEXT"); - glad_glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)load("glCopyMultiTexSubImage3DEXT"); - glad_glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)load("glEnableClientStateIndexedEXT"); - glad_glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)load("glDisableClientStateIndexedEXT"); - glad_glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)load("glGetFloatIndexedvEXT"); - glad_glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)load("glGetDoubleIndexedvEXT"); - glad_glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)load("glGetPointerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)load("glCompressedTextureImage3DEXT"); - glad_glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)load("glCompressedTextureImage2DEXT"); - glad_glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)load("glCompressedTextureImage1DEXT"); - glad_glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)load("glCompressedTextureSubImage3DEXT"); - glad_glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)load("glCompressedTextureSubImage2DEXT"); - glad_glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)load("glCompressedTextureSubImage1DEXT"); - glad_glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)load("glGetCompressedTextureImageEXT"); - glad_glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)load("glCompressedMultiTexImage3DEXT"); - glad_glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)load("glCompressedMultiTexImage2DEXT"); - glad_glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)load("glCompressedMultiTexImage1DEXT"); - glad_glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)load("glCompressedMultiTexSubImage3DEXT"); - glad_glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)load("glCompressedMultiTexSubImage2DEXT"); - glad_glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)load("glCompressedMultiTexSubImage1DEXT"); - glad_glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)load("glGetCompressedMultiTexImageEXT"); - glad_glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)load("glMatrixLoadTransposefEXT"); - glad_glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)load("glMatrixLoadTransposedEXT"); - glad_glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)load("glMatrixMultTransposefEXT"); - glad_glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)load("glMatrixMultTransposedEXT"); - glad_glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)load("glNamedBufferDataEXT"); - glad_glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)load("glNamedBufferSubDataEXT"); - glad_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)load("glMapNamedBufferEXT"); - glad_glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)load("glUnmapNamedBufferEXT"); - glad_glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)load("glGetNamedBufferParameterivEXT"); - glad_glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)load("glGetNamedBufferPointervEXT"); - glad_glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)load("glGetNamedBufferSubDataEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); - glad_glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)load("glTextureBufferEXT"); - glad_glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)load("glMultiTexBufferEXT"); - glad_glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)load("glTextureParameterIivEXT"); - glad_glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)load("glTextureParameterIuivEXT"); - glad_glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)load("glGetTextureParameterIivEXT"); - glad_glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)load("glGetTextureParameterIuivEXT"); - glad_glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)load("glMultiTexParameterIivEXT"); - glad_glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)load("glMultiTexParameterIuivEXT"); - glad_glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)load("glGetMultiTexParameterIivEXT"); - glad_glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)load("glGetMultiTexParameterIuivEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glNamedProgramLocalParameters4fvEXT"); - glad_glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)load("glNamedProgramLocalParameterI4iEXT"); - glad_glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)load("glNamedProgramLocalParameterI4ivEXT"); - glad_glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)load("glNamedProgramLocalParametersI4ivEXT"); - glad_glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)load("glNamedProgramLocalParameterI4uiEXT"); - glad_glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)load("glNamedProgramLocalParameterI4uivEXT"); - glad_glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)load("glNamedProgramLocalParametersI4uivEXT"); - glad_glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)load("glGetNamedProgramLocalParameterIivEXT"); - glad_glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)load("glGetNamedProgramLocalParameterIuivEXT"); - glad_glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)load("glEnableClientStateiEXT"); - glad_glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)load("glDisableClientStateiEXT"); - glad_glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)load("glGetFloati_vEXT"); - glad_glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)load("glGetDoublei_vEXT"); - glad_glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)load("glGetPointeri_vEXT"); - glad_glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)load("glNamedProgramStringEXT"); - glad_glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)load("glNamedProgramLocalParameter4dEXT"); - glad_glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)load("glNamedProgramLocalParameter4dvEXT"); - glad_glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)load("glNamedProgramLocalParameter4fEXT"); - glad_glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)load("glNamedProgramLocalParameter4fvEXT"); - glad_glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)load("glGetNamedProgramLocalParameterdvEXT"); - glad_glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)load("glGetNamedProgramLocalParameterfvEXT"); - glad_glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)load("glGetNamedProgramivEXT"); - glad_glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)load("glGetNamedProgramStringEXT"); - glad_glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)load("glNamedRenderbufferStorageEXT"); - glad_glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)load("glGetNamedRenderbufferParameterivEXT"); - glad_glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glNamedRenderbufferStorageMultisampleEXT"); - glad_glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)load("glNamedRenderbufferStorageMultisampleCoverageEXT"); - glad_glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)load("glCheckNamedFramebufferStatusEXT"); - glad_glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)load("glNamedFramebufferTexture1DEXT"); - glad_glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)load("glNamedFramebufferTexture2DEXT"); - glad_glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)load("glNamedFramebufferTexture3DEXT"); - glad_glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)load("glNamedFramebufferRenderbufferEXT"); - glad_glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetNamedFramebufferAttachmentParameterivEXT"); - glad_glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)load("glGenerateTextureMipmapEXT"); - glad_glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)load("glGenerateMultiTexMipmapEXT"); - glad_glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)load("glFramebufferDrawBufferEXT"); - glad_glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)load("glFramebufferDrawBuffersEXT"); - glad_glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)load("glFramebufferReadBufferEXT"); - glad_glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetFramebufferParameterivEXT"); - glad_glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)load("glNamedCopyBufferSubDataEXT"); - glad_glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)load("glNamedFramebufferTextureEXT"); - glad_glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)load("glNamedFramebufferTextureLayerEXT"); - glad_glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)load("glNamedFramebufferTextureFaceEXT"); - glad_glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)load("glTextureRenderbufferEXT"); - glad_glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)load("glMultiTexRenderbufferEXT"); - glad_glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)load("glVertexArrayVertexOffsetEXT"); - glad_glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)load("glVertexArrayColorOffsetEXT"); - glad_glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)load("glVertexArrayEdgeFlagOffsetEXT"); - glad_glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)load("glVertexArrayIndexOffsetEXT"); - glad_glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)load("glVertexArrayNormalOffsetEXT"); - glad_glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)load("glVertexArrayTexCoordOffsetEXT"); - glad_glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)load("glVertexArrayMultiTexCoordOffsetEXT"); - glad_glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)load("glVertexArrayFogCoordOffsetEXT"); - glad_glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)load("glVertexArraySecondaryColorOffsetEXT"); - glad_glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)load("glVertexArrayVertexAttribOffsetEXT"); - glad_glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)load("glVertexArrayVertexAttribIOffsetEXT"); - glad_glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)load("glEnableVertexArrayEXT"); - glad_glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)load("glDisableVertexArrayEXT"); - glad_glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)load("glEnableVertexArrayAttribEXT"); - glad_glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)load("glDisableVertexArrayAttribEXT"); - glad_glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)load("glGetVertexArrayIntegervEXT"); - glad_glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)load("glGetVertexArrayPointervEXT"); - glad_glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)load("glGetVertexArrayIntegeri_vEXT"); - glad_glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)load("glGetVertexArrayPointeri_vEXT"); - glad_glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)load("glMapNamedBufferRangeEXT"); - glad_glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)load("glFlushMappedNamedBufferRangeEXT"); - glad_glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)load("glNamedBufferStorageEXT"); - glad_glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)load("glClearNamedBufferDataEXT"); - glad_glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)load("glClearNamedBufferSubDataEXT"); - glad_glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)load("glNamedFramebufferParameteriEXT"); - glad_glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetNamedFramebufferParameterivEXT"); - glad_glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)load("glProgramUniform1dEXT"); - glad_glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)load("glProgramUniform2dEXT"); - glad_glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)load("glProgramUniform3dEXT"); - glad_glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)load("glProgramUniform4dEXT"); - glad_glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)load("glProgramUniform1dvEXT"); - glad_glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)load("glProgramUniform2dvEXT"); - glad_glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)load("glProgramUniform3dvEXT"); - glad_glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)load("glProgramUniform4dvEXT"); - glad_glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)load("glProgramUniformMatrix2dvEXT"); - glad_glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)load("glProgramUniformMatrix3dvEXT"); - glad_glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)load("glProgramUniformMatrix4dvEXT"); - glad_glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)load("glProgramUniformMatrix2x3dvEXT"); - glad_glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)load("glProgramUniformMatrix2x4dvEXT"); - glad_glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)load("glProgramUniformMatrix3x2dvEXT"); - glad_glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)load("glProgramUniformMatrix3x4dvEXT"); - glad_glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)load("glProgramUniformMatrix4x2dvEXT"); - glad_glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)load("glProgramUniformMatrix4x3dvEXT"); - glad_glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)load("glTextureBufferRangeEXT"); - glad_glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)load("glTextureStorage1DEXT"); - glad_glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)load("glTextureStorage2DEXT"); - glad_glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)load("glTextureStorage3DEXT"); - glad_glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)load("glTextureStorage2DMultisampleEXT"); - glad_glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)load("glTextureStorage3DMultisampleEXT"); - glad_glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)load("glVertexArrayBindVertexBufferEXT"); - glad_glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)load("glVertexArrayVertexAttribFormatEXT"); - glad_glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)load("glVertexArrayVertexAttribIFormatEXT"); - glad_glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)load("glVertexArrayVertexAttribLFormatEXT"); - glad_glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)load("glVertexArrayVertexAttribBindingEXT"); - glad_glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)load("glVertexArrayVertexBindingDivisorEXT"); - glad_glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)load("glVertexArrayVertexAttribLOffsetEXT"); - glad_glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)load("glTexturePageCommitmentEXT"); - glad_glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)load("glVertexArrayVertexAttribDivisorEXT"); -} -static void load_GL_AMD_sample_positions(GLADloadproc load) { - if(!GLAD_GL_AMD_sample_positions) return; - glad_glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)load("glSetMultisamplefvAMD"); -} -static void load_GL_NV_vertex_program(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program) return; - glad_glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)load("glAreProgramsResidentNV"); - glad_glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)load("glBindProgramNV"); - glad_glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)load("glDeleteProgramsNV"); - glad_glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)load("glExecuteProgramNV"); - glad_glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)load("glGenProgramsNV"); - glad_glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)load("glGetProgramParameterdvNV"); - glad_glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)load("glGetProgramParameterfvNV"); - glad_glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)load("glGetProgramivNV"); - glad_glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)load("glGetProgramStringNV"); - glad_glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)load("glGetTrackMatrixivNV"); - glad_glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)load("glGetVertexAttribdvNV"); - glad_glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)load("glGetVertexAttribfvNV"); - glad_glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)load("glGetVertexAttribivNV"); - glad_glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)load("glGetVertexAttribPointervNV"); - glad_glIsProgramNV = (PFNGLISPROGRAMNVPROC)load("glIsProgramNV"); - glad_glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)load("glLoadProgramNV"); - glad_glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)load("glProgramParameter4dNV"); - glad_glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)load("glProgramParameter4dvNV"); - glad_glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)load("glProgramParameter4fNV"); - glad_glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)load("glProgramParameter4fvNV"); - glad_glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)load("glProgramParameters4dvNV"); - glad_glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)load("glProgramParameters4fvNV"); - glad_glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)load("glRequestResidentProgramsNV"); - glad_glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)load("glTrackMatrixNV"); - glad_glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)load("glVertexAttribPointerNV"); - glad_glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)load("glVertexAttrib1dNV"); - glad_glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)load("glVertexAttrib1dvNV"); - glad_glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)load("glVertexAttrib1fNV"); - glad_glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)load("glVertexAttrib1fvNV"); - glad_glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)load("glVertexAttrib1sNV"); - glad_glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)load("glVertexAttrib1svNV"); - glad_glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)load("glVertexAttrib2dNV"); - glad_glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)load("glVertexAttrib2dvNV"); - glad_glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)load("glVertexAttrib2fNV"); - glad_glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)load("glVertexAttrib2fvNV"); - glad_glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)load("glVertexAttrib2sNV"); - glad_glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)load("glVertexAttrib2svNV"); - glad_glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)load("glVertexAttrib3dNV"); - glad_glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)load("glVertexAttrib3dvNV"); - glad_glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)load("glVertexAttrib3fNV"); - glad_glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)load("glVertexAttrib3fvNV"); - glad_glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)load("glVertexAttrib3sNV"); - glad_glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)load("glVertexAttrib3svNV"); - glad_glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)load("glVertexAttrib4dNV"); - glad_glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)load("glVertexAttrib4dvNV"); - glad_glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)load("glVertexAttrib4fNV"); - glad_glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)load("glVertexAttrib4fvNV"); - glad_glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)load("glVertexAttrib4sNV"); - glad_glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)load("glVertexAttrib4svNV"); - glad_glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)load("glVertexAttrib4ubNV"); - glad_glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)load("glVertexAttrib4ubvNV"); - glad_glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)load("glVertexAttribs1dvNV"); - glad_glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)load("glVertexAttribs1fvNV"); - glad_glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)load("glVertexAttribs1svNV"); - glad_glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)load("glVertexAttribs2dvNV"); - glad_glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)load("glVertexAttribs2fvNV"); - glad_glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)load("glVertexAttribs2svNV"); - glad_glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)load("glVertexAttribs3dvNV"); - glad_glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)load("glVertexAttribs3fvNV"); - glad_glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)load("glVertexAttribs3svNV"); - glad_glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)load("glVertexAttribs4dvNV"); - glad_glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)load("glVertexAttribs4fvNV"); - glad_glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)load("glVertexAttribs4svNV"); - glad_glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)load("glVertexAttribs4ubvNV"); -} -static void load_GL_EXT_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_shader) return; - glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); - glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); - glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); - glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); - glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); - glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); - glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); - glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); - glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); - glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); - glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); - glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); - glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); - glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); - glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); - glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); - glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); - glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); - glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); - glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); - glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); - glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); - glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); - glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); - glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); - glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); - glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); - glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); - glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); - glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); - glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); - glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); - glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); - glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); - glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); - glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); - glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); - glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); - glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); - glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); - glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); - glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); -} -static void load_GL_EXT_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_func_separate) return; - glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); -} -static void load_GL_APPLE_fence(GLADloadproc load) { - if(!GLAD_GL_APPLE_fence) return; - glad_glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)load("glGenFencesAPPLE"); - glad_glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)load("glDeleteFencesAPPLE"); - glad_glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)load("glSetFenceAPPLE"); - glad_glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)load("glIsFenceAPPLE"); - glad_glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)load("glTestFenceAPPLE"); - glad_glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)load("glFinishFenceAPPLE"); - glad_glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)load("glTestObjectAPPLE"); - glad_glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)load("glFinishObjectAPPLE"); -} -static void load_GL_OES_byte_coordinates(GLADloadproc load) { - if(!GLAD_GL_OES_byte_coordinates) return; - glad_glMultiTexCoord1bOES = (PFNGLMULTITEXCOORD1BOESPROC)load("glMultiTexCoord1bOES"); - glad_glMultiTexCoord1bvOES = (PFNGLMULTITEXCOORD1BVOESPROC)load("glMultiTexCoord1bvOES"); - glad_glMultiTexCoord2bOES = (PFNGLMULTITEXCOORD2BOESPROC)load("glMultiTexCoord2bOES"); - glad_glMultiTexCoord2bvOES = (PFNGLMULTITEXCOORD2BVOESPROC)load("glMultiTexCoord2bvOES"); - glad_glMultiTexCoord3bOES = (PFNGLMULTITEXCOORD3BOESPROC)load("glMultiTexCoord3bOES"); - glad_glMultiTexCoord3bvOES = (PFNGLMULTITEXCOORD3BVOESPROC)load("glMultiTexCoord3bvOES"); - glad_glMultiTexCoord4bOES = (PFNGLMULTITEXCOORD4BOESPROC)load("glMultiTexCoord4bOES"); - glad_glMultiTexCoord4bvOES = (PFNGLMULTITEXCOORD4BVOESPROC)load("glMultiTexCoord4bvOES"); - glad_glTexCoord1bOES = (PFNGLTEXCOORD1BOESPROC)load("glTexCoord1bOES"); - glad_glTexCoord1bvOES = (PFNGLTEXCOORD1BVOESPROC)load("glTexCoord1bvOES"); - glad_glTexCoord2bOES = (PFNGLTEXCOORD2BOESPROC)load("glTexCoord2bOES"); - glad_glTexCoord2bvOES = (PFNGLTEXCOORD2BVOESPROC)load("glTexCoord2bvOES"); - glad_glTexCoord3bOES = (PFNGLTEXCOORD3BOESPROC)load("glTexCoord3bOES"); - glad_glTexCoord3bvOES = (PFNGLTEXCOORD3BVOESPROC)load("glTexCoord3bvOES"); - glad_glTexCoord4bOES = (PFNGLTEXCOORD4BOESPROC)load("glTexCoord4bOES"); - glad_glTexCoord4bvOES = (PFNGLTEXCOORD4BVOESPROC)load("glTexCoord4bvOES"); - glad_glVertex2bOES = (PFNGLVERTEX2BOESPROC)load("glVertex2bOES"); - glad_glVertex2bvOES = (PFNGLVERTEX2BVOESPROC)load("glVertex2bvOES"); - glad_glVertex3bOES = (PFNGLVERTEX3BOESPROC)load("glVertex3bOES"); - glad_glVertex3bvOES = (PFNGLVERTEX3BVOESPROC)load("glVertex3bvOES"); - glad_glVertex4bOES = (PFNGLVERTEX4BOESPROC)load("glVertex4bOES"); - glad_glVertex4bvOES = (PFNGLVERTEX4BVOESPROC)load("glVertex4bvOES"); -} -static void load_GL_ARB_transpose_matrix(GLADloadproc load) { - if(!GLAD_GL_ARB_transpose_matrix) return; - glad_glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)load("glLoadTransposeMatrixfARB"); - glad_glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)load("glLoadTransposeMatrixdARB"); - glad_glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)load("glMultTransposeMatrixfARB"); - glad_glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)load("glMultTransposeMatrixdARB"); -} -static void load_GL_ARB_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_provoking_vertex) return; - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); -} -static void load_GL_EXT_fog_coord(GLADloadproc load) { - if(!GLAD_GL_EXT_fog_coord) return; - glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); - glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); - glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); - glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); - glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); -} -static void load_GL_EXT_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_array) return; - glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); - glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); - glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); - glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); - glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); - glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); - glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); - glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); - glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); -} -static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_equation_separate) return; - glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); -} -static void load_GL_NV_framebuffer_mixed_samples(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_mixed_samples) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); - glad_glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)load("glCoverageModulationTableNV"); - glad_glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)load("glGetCoverageModulationTableNV"); - glad_glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)load("glCoverageModulationNV"); -} -static void load_GL_NVX_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NVX_conditional_render) return; - glad_glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)load("glBeginConditionalRenderNVX"); - glad_glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)load("glEndConditionalRenderNVX"); -} -static void load_GL_ARB_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); - glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); -} -static void load_GL_EXT_raster_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_raster_multisample) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); -} -static void load_GL_NV_copy_image(GLADloadproc load) { - if(!GLAD_GL_NV_copy_image) return; - glad_glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)load("glCopyImageSubDataNV"); -} -static void load_GL_INTEL_framebuffer_CMAA(GLADloadproc load) { - if(!GLAD_GL_INTEL_framebuffer_CMAA) return; - glad_glApplyFramebufferAttachmentCMAAINTEL = (PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)load("glApplyFramebufferAttachmentCMAAINTEL"); -} -static void load_GL_ARB_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback2) return; - glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); - glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); - glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); - glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); - glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); - glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); - glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); -} -static void load_GL_ARB_transform_feedback3(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback3) return; - glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); - glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); - glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); - glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); -} -static void load_GL_EXT_debug_marker(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_marker) return; - glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); - glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); - glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); -} -static void load_GL_EXT_pixel_transform(GLADloadproc load) { - if(!GLAD_GL_EXT_pixel_transform) return; - glad_glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)load("glPixelTransformParameteriEXT"); - glad_glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)load("glPixelTransformParameterfEXT"); - glad_glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)load("glPixelTransformParameterivEXT"); - glad_glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)load("glPixelTransformParameterfvEXT"); - glad_glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)load("glGetPixelTransformParameterivEXT"); - glad_glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)load("glGetPixelTransformParameterfvEXT"); -} -static void load_GL_ATI_fragment_shader(GLADloadproc load) { - if(!GLAD_GL_ATI_fragment_shader) return; - glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); - glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); - glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); - glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); - glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); - glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); - glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); - glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); - glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); - glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); - glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); - glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); - glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); - glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); -} -static void load_GL_ARB_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_array_object) return; - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_SUN_triangle_list(GLADloadproc load) { - if(!GLAD_GL_SUN_triangle_list) return; - glad_glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)load("glReplacementCodeuiSUN"); - glad_glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)load("glReplacementCodeusSUN"); - glad_glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)load("glReplacementCodeubSUN"); - glad_glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)load("glReplacementCodeuivSUN"); - glad_glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)load("glReplacementCodeusvSUN"); - glad_glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)load("glReplacementCodeubvSUN"); - glad_glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)load("glReplacementCodePointerSUN"); -} -static void load_GL_ARB_transform_feedback_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback_instanced) return; - glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); - glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); -} -static void load_GL_SGIX_async(GLADloadproc load) { - if(!GLAD_GL_SGIX_async) return; - glad_glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)load("glAsyncMarkerSGIX"); - glad_glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)load("glFinishAsyncSGIX"); - glad_glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)load("glPollAsyncSGIX"); - glad_glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)load("glGenAsyncMarkersSGIX"); - glad_glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)load("glDeleteAsyncMarkersSGIX"); - glad_glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)load("glIsAsyncMarkerSGIX"); -} -static void load_GL_INTEL_performance_query(GLADloadproc load) { - if(!GLAD_GL_INTEL_performance_query) return; - glad_glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)load("glBeginPerfQueryINTEL"); - glad_glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)load("glCreatePerfQueryINTEL"); - glad_glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)load("glDeletePerfQueryINTEL"); - glad_glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)load("glEndPerfQueryINTEL"); - glad_glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)load("glGetFirstPerfQueryIdINTEL"); - glad_glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)load("glGetNextPerfQueryIdINTEL"); - glad_glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)load("glGetPerfCounterInfoINTEL"); - glad_glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)load("glGetPerfQueryDataINTEL"); - glad_glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)load("glGetPerfQueryIdByNameINTEL"); - glad_glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)load("glGetPerfQueryInfoINTEL"); -} -static void load_GL_NV_gpu_shader5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_shader5) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_NV_bindless_multi_draw_indirect_count(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect_count) return; - glad_glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawArraysIndirectBindlessCountNV"); - glad_glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawElementsIndirectBindlessCountNV"); -} -static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES2_compatibility) return; - glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); - glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); - glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); - glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); - glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); -} -static void load_GL_ARB_indirect_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_indirect_parameters) return; - glad_glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)load("glMultiDrawArraysIndirectCountARB"); - glad_glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)load("glMultiDrawElementsIndirectCountARB"); -} -static void load_GL_NV_half_float(GLADloadproc load) { - if(!GLAD_GL_NV_half_float) return; - glad_glVertex2hNV = (PFNGLVERTEX2HNVPROC)load("glVertex2hNV"); - glad_glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)load("glVertex2hvNV"); - glad_glVertex3hNV = (PFNGLVERTEX3HNVPROC)load("glVertex3hNV"); - glad_glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)load("glVertex3hvNV"); - glad_glVertex4hNV = (PFNGLVERTEX4HNVPROC)load("glVertex4hNV"); - glad_glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)load("glVertex4hvNV"); - glad_glNormal3hNV = (PFNGLNORMAL3HNVPROC)load("glNormal3hNV"); - glad_glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)load("glNormal3hvNV"); - glad_glColor3hNV = (PFNGLCOLOR3HNVPROC)load("glColor3hNV"); - glad_glColor3hvNV = (PFNGLCOLOR3HVNVPROC)load("glColor3hvNV"); - glad_glColor4hNV = (PFNGLCOLOR4HNVPROC)load("glColor4hNV"); - glad_glColor4hvNV = (PFNGLCOLOR4HVNVPROC)load("glColor4hvNV"); - glad_glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)load("glTexCoord1hNV"); - glad_glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)load("glTexCoord1hvNV"); - glad_glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)load("glTexCoord2hNV"); - glad_glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)load("glTexCoord2hvNV"); - glad_glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)load("glTexCoord3hNV"); - glad_glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)load("glTexCoord3hvNV"); - glad_glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)load("glTexCoord4hNV"); - glad_glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)load("glTexCoord4hvNV"); - glad_glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)load("glMultiTexCoord1hNV"); - glad_glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)load("glMultiTexCoord1hvNV"); - glad_glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)load("glMultiTexCoord2hNV"); - glad_glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)load("glMultiTexCoord2hvNV"); - glad_glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)load("glMultiTexCoord3hNV"); - glad_glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)load("glMultiTexCoord3hvNV"); - glad_glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)load("glMultiTexCoord4hNV"); - glad_glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)load("glMultiTexCoord4hvNV"); - glad_glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)load("glFogCoordhNV"); - glad_glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)load("glFogCoordhvNV"); - glad_glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)load("glSecondaryColor3hNV"); - glad_glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)load("glSecondaryColor3hvNV"); - glad_glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)load("glVertexWeighthNV"); - glad_glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)load("glVertexWeighthvNV"); - glad_glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)load("glVertexAttrib1hNV"); - glad_glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)load("glVertexAttrib1hvNV"); - glad_glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)load("glVertexAttrib2hNV"); - glad_glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)load("glVertexAttrib2hvNV"); - glad_glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)load("glVertexAttrib3hNV"); - glad_glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)load("glVertexAttrib3hvNV"); - glad_glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)load("glVertexAttrib4hNV"); - glad_glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)load("glVertexAttrib4hvNV"); - glad_glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)load("glVertexAttribs1hvNV"); - glad_glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)load("glVertexAttribs2hvNV"); - glad_glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)load("glVertexAttribs3hvNV"); - glad_glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)load("glVertexAttribs4hvNV"); -} -static void load_GL_ARB_ES3_2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_2_compatibility) return; - glad_glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)load("glPrimitiveBoundingBoxARB"); -} -static void load_GL_EXT_polygon_offset_clamp(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset_clamp) return; - glad_glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)load("glPolygonOffsetClampEXT"); -} -static void load_GL_EXT_compiled_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_compiled_vertex_array) return; - glad_glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)load("glLockArraysEXT"); - glad_glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)load("glUnlockArraysEXT"); -} -static void load_GL_NV_depth_buffer_float(GLADloadproc load) { - if(!GLAD_GL_NV_depth_buffer_float) return; - glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); - glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); - glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); -} -static void load_GL_NV_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_NV_occlusion_query) return; - glad_glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)load("glGenOcclusionQueriesNV"); - glad_glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)load("glDeleteOcclusionQueriesNV"); - glad_glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)load("glIsOcclusionQueryNV"); - glad_glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)load("glBeginOcclusionQueryNV"); - glad_glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)load("glEndOcclusionQueryNV"); - glad_glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)load("glGetOcclusionQueryivNV"); - glad_glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)load("glGetOcclusionQueryuivNV"); -} -static void load_GL_APPLE_flush_buffer_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_flush_buffer_range) return; - glad_glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)load("glBufferParameteriAPPLE"); - glad_glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)load("glFlushMappedBufferRangeAPPLE"); -} -static void load_GL_ARB_imaging(GLADloadproc load) { - if(!GLAD_GL_ARB_imaging) return; - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); - glad_glColorTable = (PFNGLCOLORTABLEPROC)load("glColorTable"); - glad_glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)load("glColorTableParameterfv"); - glad_glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)load("glColorTableParameteriv"); - glad_glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)load("glCopyColorTable"); - glad_glGetColorTable = (PFNGLGETCOLORTABLEPROC)load("glGetColorTable"); - glad_glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)load("glGetColorTableParameterfv"); - glad_glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)load("glGetColorTableParameteriv"); - glad_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)load("glColorSubTable"); - glad_glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)load("glCopyColorSubTable"); - glad_glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)load("glConvolutionFilter1D"); - glad_glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)load("glConvolutionFilter2D"); - glad_glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)load("glConvolutionParameterf"); - glad_glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)load("glConvolutionParameterfv"); - glad_glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)load("glConvolutionParameteri"); - glad_glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)load("glConvolutionParameteriv"); - glad_glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)load("glCopyConvolutionFilter1D"); - glad_glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)load("glCopyConvolutionFilter2D"); - glad_glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)load("glGetConvolutionFilter"); - glad_glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)load("glGetConvolutionParameterfv"); - glad_glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)load("glGetConvolutionParameteriv"); - glad_glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)load("glGetSeparableFilter"); - glad_glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)load("glSeparableFilter2D"); - glad_glGetHistogram = (PFNGLGETHISTOGRAMPROC)load("glGetHistogram"); - glad_glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)load("glGetHistogramParameterfv"); - glad_glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)load("glGetHistogramParameteriv"); - glad_glGetMinmax = (PFNGLGETMINMAXPROC)load("glGetMinmax"); - glad_glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)load("glGetMinmaxParameterfv"); - glad_glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)load("glGetMinmaxParameteriv"); - glad_glHistogram = (PFNGLHISTOGRAMPROC)load("glHistogram"); - glad_glMinmax = (PFNGLMINMAXPROC)load("glMinmax"); - glad_glResetHistogram = (PFNGLRESETHISTOGRAMPROC)load("glResetHistogram"); - glad_glResetMinmax = (PFNGLRESETMINMAXPROC)load("glResetMinmax"); -} -static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers_blend) return; - glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); - glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); - glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); - glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); -} -static void load_GL_ARB_clear_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_buffer_object) return; - glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); - glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); -} -static void load_GL_ARB_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_multisample) return; - glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); -} -static void load_GL_EXT_debug_label(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_label) return; - glad_glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)load("glLabelObjectEXT"); - glad_glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)load("glGetObjectLabelEXT"); -} -static void load_GL_ARB_sample_shading(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_shading) return; - glad_glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)load("glMinSampleShadingARB"); -} -static void load_GL_NV_internalformat_sample_query(GLADloadproc load) { - if(!GLAD_GL_NV_internalformat_sample_query) return; - glad_glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)load("glGetInternalformatSampleivNV"); -} -static void load_GL_INTEL_map_texture(GLADloadproc load) { - if(!GLAD_GL_INTEL_map_texture) return; - glad_glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)load("glSyncTextureINTEL"); - glad_glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)load("glUnmapTexture2DINTEL"); - glad_glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)load("glMapTexture2DINTEL"); -} -static void load_GL_ARB_compute_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_shader) return; - glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); - glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); -} -static void load_GL_IBM_vertex_array_lists(GLADloadproc load) { - if(!GLAD_GL_IBM_vertex_array_lists) return; - glad_glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)load("glColorPointerListIBM"); - glad_glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)load("glSecondaryColorPointerListIBM"); - glad_glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)load("glEdgeFlagPointerListIBM"); - glad_glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)load("glFogCoordPointerListIBM"); - glad_glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)load("glIndexPointerListIBM"); - glad_glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)load("glNormalPointerListIBM"); - glad_glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)load("glTexCoordPointerListIBM"); - glad_glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)load("glVertexPointerListIBM"); -} -static void load_GL_ARB_color_buffer_float(GLADloadproc load) { - if(!GLAD_GL_ARB_color_buffer_float) return; - glad_glClampColorARB = (PFNGLCLAMPCOLORARBPROC)load("glClampColorARB"); -} -static void load_GL_ARB_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_bindless_texture) return; - glad_glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)load("glGetTextureHandleARB"); - glad_glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)load("glGetTextureSamplerHandleARB"); - glad_glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)load("glMakeTextureHandleResidentARB"); - glad_glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)load("glMakeTextureHandleNonResidentARB"); - glad_glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)load("glGetImageHandleARB"); - glad_glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)load("glMakeImageHandleResidentARB"); - glad_glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)load("glMakeImageHandleNonResidentARB"); - glad_glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)load("glUniformHandleui64ARB"); - glad_glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)load("glUniformHandleui64vARB"); - glad_glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)load("glProgramUniformHandleui64ARB"); - glad_glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)load("glProgramUniformHandleui64vARB"); - glad_glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)load("glIsTextureHandleResidentARB"); - glad_glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)load("glIsImageHandleResidentARB"); - glad_glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)load("glVertexAttribL1ui64ARB"); - glad_glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)load("glVertexAttribL1ui64vARB"); - glad_glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)load("glGetVertexAttribLui64vARB"); -} -static void load_GL_ARB_window_pos(GLADloadproc load) { - if(!GLAD_GL_ARB_window_pos) return; - glad_glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)load("glWindowPos2dARB"); - glad_glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)load("glWindowPos2dvARB"); - glad_glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)load("glWindowPos2fARB"); - glad_glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)load("glWindowPos2fvARB"); - glad_glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)load("glWindowPos2iARB"); - glad_glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)load("glWindowPos2ivARB"); - glad_glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)load("glWindowPos2sARB"); - glad_glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)load("glWindowPos2svARB"); - glad_glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)load("glWindowPos3dARB"); - glad_glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)load("glWindowPos3dvARB"); - glad_glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)load("glWindowPos3fARB"); - glad_glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)load("glWindowPos3fvARB"); - glad_glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)load("glWindowPos3iARB"); - glad_glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)load("glWindowPos3ivARB"); - glad_glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)load("glWindowPos3sARB"); - glad_glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)load("glWindowPos3svARB"); -} -static void load_GL_ARB_internalformat_query(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query) return; - glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); -} -static void load_GL_EXT_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_EXT_shader_image_load_store) return; - glad_glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)load("glBindImageTextureEXT"); - glad_glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)load("glMemoryBarrierEXT"); -} -static void load_GL_EXT_copy_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_copy_texture) return; - glad_glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)load("glCopyTexImage1DEXT"); - glad_glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)load("glCopyTexImage2DEXT"); - glad_glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)load("glCopyTexSubImage1DEXT"); - glad_glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)load("glCopyTexSubImage2DEXT"); - glad_glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)load("glCopyTexSubImage3DEXT"); -} -static void load_GL_NV_register_combiners2(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners2) return; - glad_glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)load("glCombinerStageParameterfvNV"); - glad_glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)load("glGetCombinerStageParameterfvNV"); -} -static void load_GL_NV_draw_texture(GLADloadproc load) { - if(!GLAD_GL_NV_draw_texture) return; - glad_glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)load("glDrawTextureNV"); -} -static void load_GL_EXT_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_instanced) return; - glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load("glDrawArraysInstancedEXT"); - glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load("glDrawElementsInstancedEXT"); -} -static void load_GL_ARB_viewport_array(GLADloadproc load) { - if(!GLAD_GL_ARB_viewport_array) return; - glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); - glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); - glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); - glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); - glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); - glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); - glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); - glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); - glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); - glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); -} -static void load_GL_ARB_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_separate_shader_objects) return; - glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); - glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); - glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); - glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); - glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); - glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); - glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); - glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); - glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); - glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); - glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); - glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); - glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); - glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); - glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); - glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); - glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); - glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); - glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); - glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); - glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); - glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); - glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); - glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); - glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); - glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); - glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); - glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); - glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); - glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); - glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); - glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); - glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); - glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); - glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); - glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); - glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); - glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); - glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); - glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); - glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); - glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); - glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); - glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); - glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); - glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); - glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); - glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); - glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); - glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); - glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); - glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); - glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); - glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); - glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); - glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); - glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); - glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); - glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); - glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); -} -static void load_GL_EXT_depth_bounds_test(GLADloadproc load) { - if(!GLAD_GL_EXT_depth_bounds_test) return; - glad_glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)load("glDepthBoundsEXT"); -} -static void load_GL_NV_video_capture(GLADloadproc load) { - if(!GLAD_GL_NV_video_capture) return; - glad_glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)load("glBeginVideoCaptureNV"); - glad_glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)load("glBindVideoCaptureStreamBufferNV"); - glad_glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)load("glBindVideoCaptureStreamTextureNV"); - glad_glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)load("glEndVideoCaptureNV"); - glad_glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)load("glGetVideoCaptureivNV"); - glad_glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)load("glGetVideoCaptureStreamivNV"); - glad_glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)load("glGetVideoCaptureStreamfvNV"); - glad_glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)load("glGetVideoCaptureStreamdvNV"); - glad_glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)load("glVideoCaptureNV"); - glad_glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)load("glVideoCaptureStreamParameterivNV"); - glad_glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)load("glVideoCaptureStreamParameterfvNV"); - glad_glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)load("glVideoCaptureStreamParameterdvNV"); -} -static void load_GL_ARB_sampler_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_sampler_objects) return; - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); -} -static void load_GL_ARB_matrix_palette(GLADloadproc load) { - if(!GLAD_GL_ARB_matrix_palette) return; - glad_glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)load("glCurrentPaletteMatrixARB"); - glad_glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)load("glMatrixIndexubvARB"); - glad_glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)load("glMatrixIndexusvARB"); - glad_glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)load("glMatrixIndexuivARB"); - glad_glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)load("glMatrixIndexPointerARB"); -} -static void load_GL_SGIS_texture_color_mask(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_color_mask) return; - glad_glTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC)load("glTextureColorMaskSGIS"); -} -static void load_GL_EXT_coordinate_frame(GLADloadproc load) { - if(!GLAD_GL_EXT_coordinate_frame) return; - glad_glTangent3bEXT = (PFNGLTANGENT3BEXTPROC)load("glTangent3bEXT"); - glad_glTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC)load("glTangent3bvEXT"); - glad_glTangent3dEXT = (PFNGLTANGENT3DEXTPROC)load("glTangent3dEXT"); - glad_glTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC)load("glTangent3dvEXT"); - glad_glTangent3fEXT = (PFNGLTANGENT3FEXTPROC)load("glTangent3fEXT"); - glad_glTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC)load("glTangent3fvEXT"); - glad_glTangent3iEXT = (PFNGLTANGENT3IEXTPROC)load("glTangent3iEXT"); - glad_glTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC)load("glTangent3ivEXT"); - glad_glTangent3sEXT = (PFNGLTANGENT3SEXTPROC)load("glTangent3sEXT"); - glad_glTangent3svEXT = (PFNGLTANGENT3SVEXTPROC)load("glTangent3svEXT"); - glad_glBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC)load("glBinormal3bEXT"); - glad_glBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC)load("glBinormal3bvEXT"); - glad_glBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC)load("glBinormal3dEXT"); - glad_glBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC)load("glBinormal3dvEXT"); - glad_glBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC)load("glBinormal3fEXT"); - glad_glBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC)load("glBinormal3fvEXT"); - glad_glBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC)load("glBinormal3iEXT"); - glad_glBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC)load("glBinormal3ivEXT"); - glad_glBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC)load("glBinormal3sEXT"); - glad_glBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC)load("glBinormal3svEXT"); - glad_glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)load("glTangentPointerEXT"); - glad_glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)load("glBinormalPointerEXT"); -} -static void load_GL_ARB_texture_compression(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_compression) return; - glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); - glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); - glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); - glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); - glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); - glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); - glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); -} -static void load_GL_ARB_shader_subroutine(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_subroutine) return; - glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); - glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); - glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); - glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); - glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); - glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); - glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); - glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); -} -static void load_GL_ARB_texture_storage_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage_multisample) return; - glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); - glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); -} -static void load_GL_EXT_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_attrib_64bit) return; - glad_glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)load("glVertexAttribL1dEXT"); - glad_glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)load("glVertexAttribL2dEXT"); - glad_glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)load("glVertexAttribL3dEXT"); - glad_glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)load("glVertexAttribL4dEXT"); - glad_glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)load("glVertexAttribL1dvEXT"); - glad_glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)load("glVertexAttribL2dvEXT"); - glad_glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)load("glVertexAttribL3dvEXT"); - glad_glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)load("glVertexAttribL4dvEXT"); - glad_glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)load("glVertexAttribLPointerEXT"); - glad_glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)load("glGetVertexAttribLdvEXT"); -} -static void load_GL_OES_query_matrix(GLADloadproc load) { - if(!GLAD_GL_OES_query_matrix) return; - glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); -} -static void load_GL_MESA_window_pos(GLADloadproc load) { - if(!GLAD_GL_MESA_window_pos) return; - glad_glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)load("glWindowPos2dMESA"); - glad_glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)load("glWindowPos2dvMESA"); - glad_glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)load("glWindowPos2fMESA"); - glad_glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)load("glWindowPos2fvMESA"); - glad_glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)load("glWindowPos2iMESA"); - glad_glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)load("glWindowPos2ivMESA"); - glad_glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)load("glWindowPos2sMESA"); - glad_glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)load("glWindowPos2svMESA"); - glad_glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)load("glWindowPos3dMESA"); - glad_glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)load("glWindowPos3dvMESA"); - glad_glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)load("glWindowPos3fMESA"); - glad_glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)load("glWindowPos3fvMESA"); - glad_glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)load("glWindowPos3iMESA"); - glad_glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)load("glWindowPos3ivMESA"); - glad_glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)load("glWindowPos3sMESA"); - glad_glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)load("glWindowPos3svMESA"); - glad_glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)load("glWindowPos4dMESA"); - glad_glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)load("glWindowPos4dvMESA"); - glad_glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)load("glWindowPos4fMESA"); - glad_glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)load("glWindowPos4fvMESA"); - glad_glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)load("glWindowPos4iMESA"); - glad_glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)load("glWindowPos4ivMESA"); - glad_glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)load("glWindowPos4sMESA"); - glad_glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)load("glWindowPos4svMESA"); -} -static void load_GL_ARB_copy_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_buffer) return; - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); -} -static void load_GL_APPLE_object_purgeable(GLADloadproc load) { - if(!GLAD_GL_APPLE_object_purgeable) return; - glad_glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)load("glObjectPurgeableAPPLE"); - glad_glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)load("glObjectUnpurgeableAPPLE"); - glad_glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)load("glGetObjectParameterivAPPLE"); -} -static void load_GL_ARB_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_ARB_occlusion_query) return; - glad_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)load("glGenQueriesARB"); - glad_glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)load("glDeleteQueriesARB"); - glad_glIsQueryARB = (PFNGLISQUERYARBPROC)load("glIsQueryARB"); - glad_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)load("glBeginQueryARB"); - glad_glEndQueryARB = (PFNGLENDQUERYARBPROC)load("glEndQueryARB"); - glad_glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)load("glGetQueryivARB"); - glad_glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)load("glGetQueryObjectivARB"); - glad_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)load("glGetQueryObjectuivARB"); -} -static void load_GL_SGI_color_table(GLADloadproc load) { - if(!GLAD_GL_SGI_color_table) return; - glad_glColorTableSGI = (PFNGLCOLORTABLESGIPROC)load("glColorTableSGI"); - glad_glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)load("glColorTableParameterfvSGI"); - glad_glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)load("glColorTableParameterivSGI"); - glad_glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)load("glCopyColorTableSGI"); - glad_glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)load("glGetColorTableSGI"); - glad_glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)load("glGetColorTableParameterfvSGI"); - glad_glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)load("glGetColorTableParameterivSGI"); -} -static void load_GL_EXT_gpu_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_shader4) return; - glad_glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)load("glGetUniformuivEXT"); - glad_glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)load("glBindFragDataLocationEXT"); - glad_glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)load("glGetFragDataLocationEXT"); - glad_glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)load("glUniform1uiEXT"); - glad_glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)load("glUniform2uiEXT"); - glad_glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)load("glUniform3uiEXT"); - glad_glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)load("glUniform4uiEXT"); - glad_glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)load("glUniform1uivEXT"); - glad_glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)load("glUniform2uivEXT"); - glad_glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)load("glUniform3uivEXT"); - glad_glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)load("glUniform4uivEXT"); -} -static void load_GL_NV_geometry_program4(GLADloadproc load) { - if(!GLAD_GL_NV_geometry_program4) return; - glad_glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)load("glProgramVertexLimitNV"); - glad_glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)load("glFramebufferTextureEXT"); - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); - glad_glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)load("glFramebufferTextureFaceEXT"); -} -static void load_GL_AMD_debug_output(GLADloadproc load) { - if(!GLAD_GL_AMD_debug_output) return; - glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); - glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); - glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); - glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); -} -static void load_GL_ARB_multitexture(GLADloadproc load) { - if(!GLAD_GL_ARB_multitexture) return; - glad_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)load("glActiveTextureARB"); - glad_glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)load("glClientActiveTextureARB"); - glad_glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)load("glMultiTexCoord1dARB"); - glad_glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)load("glMultiTexCoord1dvARB"); - glad_glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)load("glMultiTexCoord1fARB"); - glad_glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)load("glMultiTexCoord1fvARB"); - glad_glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)load("glMultiTexCoord1iARB"); - glad_glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)load("glMultiTexCoord1ivARB"); - glad_glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)load("glMultiTexCoord1sARB"); - glad_glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)load("glMultiTexCoord1svARB"); - glad_glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)load("glMultiTexCoord2dARB"); - glad_glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)load("glMultiTexCoord2dvARB"); - glad_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)load("glMultiTexCoord2fARB"); - glad_glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)load("glMultiTexCoord2fvARB"); - glad_glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)load("glMultiTexCoord2iARB"); - glad_glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)load("glMultiTexCoord2ivARB"); - glad_glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)load("glMultiTexCoord2sARB"); - glad_glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)load("glMultiTexCoord2svARB"); - glad_glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)load("glMultiTexCoord3dARB"); - glad_glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)load("glMultiTexCoord3dvARB"); - glad_glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)load("glMultiTexCoord3fARB"); - glad_glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)load("glMultiTexCoord3fvARB"); - glad_glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)load("glMultiTexCoord3iARB"); - glad_glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)load("glMultiTexCoord3ivARB"); - glad_glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)load("glMultiTexCoord3sARB"); - glad_glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)load("glMultiTexCoord3svARB"); - glad_glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)load("glMultiTexCoord4dARB"); - glad_glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)load("glMultiTexCoord4dvARB"); - glad_glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)load("glMultiTexCoord4fARB"); - glad_glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)load("glMultiTexCoord4fvARB"); - glad_glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)load("glMultiTexCoord4iARB"); - glad_glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)load("glMultiTexCoord4ivARB"); - glad_glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)load("glMultiTexCoord4sARB"); - glad_glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)load("glMultiTexCoord4svARB"); -} -static void load_GL_SGIX_polynomial_ffd(GLADloadproc load) { - if(!GLAD_GL_SGIX_polynomial_ffd) return; - glad_glDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC)load("glDeformationMap3dSGIX"); - glad_glDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC)load("glDeformationMap3fSGIX"); - glad_glDeformSGIX = (PFNGLDEFORMSGIXPROC)load("glDeformSGIX"); - glad_glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)load("glLoadIdentityDeformationMapSGIX"); -} -static void load_GL_EXT_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_provoking_vertex) return; - glad_glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)load("glProvokingVertexEXT"); -} -static void load_GL_ARB_point_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_point_parameters) return; - glad_glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)load("glPointParameterfARB"); - glad_glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)load("glPointParameterfvARB"); -} -static void load_GL_ARB_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_image_load_store) return; - glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); - glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); -} -static void load_GL_ARB_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_barrier) return; - glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); -} -static void load_GL_NV_bindless_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)load("glMultiDrawArraysIndirectBindlessNV"); - glad_glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)load("glMultiDrawElementsIndirectBindlessNV"); -} -static void load_GL_EXT_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_EXT_transform_feedback) return; - glad_glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)load("glBeginTransformFeedbackEXT"); - glad_glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)load("glEndTransformFeedbackEXT"); - glad_glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)load("glBindBufferRangeEXT"); - glad_glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)load("glBindBufferOffsetEXT"); - glad_glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)load("glBindBufferBaseEXT"); - glad_glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)load("glTransformFeedbackVaryingsEXT"); - glad_glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)load("glGetTransformFeedbackVaryingEXT"); -} -static void load_GL_NV_gpu_program4(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program4) return; - glad_glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)load("glProgramLocalParameterI4iNV"); - glad_glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)load("glProgramLocalParameterI4ivNV"); - glad_glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)load("glProgramLocalParametersI4ivNV"); - glad_glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)load("glProgramLocalParameterI4uiNV"); - glad_glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)load("glProgramLocalParameterI4uivNV"); - glad_glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)load("glProgramLocalParametersI4uivNV"); - glad_glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)load("glProgramEnvParameterI4iNV"); - glad_glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)load("glProgramEnvParameterI4ivNV"); - glad_glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)load("glProgramEnvParametersI4ivNV"); - glad_glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)load("glProgramEnvParameterI4uiNV"); - glad_glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)load("glProgramEnvParameterI4uivNV"); - glad_glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)load("glProgramEnvParametersI4uivNV"); - glad_glGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)load("glGetProgramLocalParameterIivNV"); - glad_glGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)load("glGetProgramLocalParameterIuivNV"); - glad_glGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)load("glGetProgramEnvParameterIivNV"); - glad_glGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)load("glGetProgramEnvParameterIuivNV"); -} -static void load_GL_NV_gpu_program5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program5) return; - glad_glProgramSubroutineParametersuivNV = (PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)load("glProgramSubroutineParametersuivNV"); - glad_glGetProgramSubroutineParameteruivNV = (PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)load("glGetProgramSubroutineParameteruivNV"); -} -static void load_GL_ARB_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_ARB_geometry_shader4) return; - glad_glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)load("glProgramParameteriARB"); - glad_glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)load("glFramebufferTextureARB"); - glad_glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)load("glFramebufferTextureLayerARB"); - glad_glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)load("glFramebufferTextureFaceARB"); -} -static void load_GL_NV_conservative_raster(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster) return; - glad_glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)load("glSubpixelPrecisionBiasNV"); -} -static void load_GL_SGIX_sprite(GLADloadproc load) { - if(!GLAD_GL_SGIX_sprite) return; - glad_glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)load("glSpriteParameterfSGIX"); - glad_glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)load("glSpriteParameterfvSGIX"); - glad_glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)load("glSpriteParameteriSGIX"); - glad_glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)load("glSpriteParameterivSGIX"); -} -static void load_GL_ARB_get_program_binary(GLADloadproc load) { - if(!GLAD_GL_ARB_get_program_binary) return; - glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); - glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); - glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); -} -static void load_GL_AMD_occlusion_query_event(GLADloadproc load) { - if(!GLAD_GL_AMD_occlusion_query_event) return; - glad_glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)load("glQueryObjectParameteruiAMD"); -} -static void load_GL_SGIS_multisample(GLADloadproc load) { - if(!GLAD_GL_SGIS_multisample) return; - glad_glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)load("glSampleMaskSGIS"); - glad_glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)load("glSamplePatternSGIS"); -} -static void load_GL_EXT_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_object) return; - glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); - glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); - glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); - glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); - glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); - glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); - glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); - glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); - glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); - glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); - glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); - glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); - glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); - glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); - glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); - glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); - glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); -} -static void load_GL_APPLE_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_range) return; - glad_glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)load("glVertexArrayRangeAPPLE"); - glad_glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)load("glFlushVertexArrayRangeAPPLE"); - glad_glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)load("glVertexArrayParameteriAPPLE"); -} -static void load_GL_NV_register_combiners(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners) return; - glad_glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)load("glCombinerParameterfvNV"); - glad_glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)load("glCombinerParameterfNV"); - glad_glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)load("glCombinerParameterivNV"); - glad_glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)load("glCombinerParameteriNV"); - glad_glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)load("glCombinerInputNV"); - glad_glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)load("glCombinerOutputNV"); - glad_glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)load("glFinalCombinerInputNV"); - glad_glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)load("glGetCombinerInputParameterfvNV"); - glad_glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)load("glGetCombinerInputParameterivNV"); - glad_glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)load("glGetCombinerOutputParameterfvNV"); - glad_glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)load("glGetCombinerOutputParameterivNV"); - glad_glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)load("glGetFinalCombinerInputParameterfvNV"); - glad_glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)load("glGetFinalCombinerInputParameterivNV"); -} -static void load_GL_ARB_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers) return; - glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); -} -static void load_GL_ARB_clear_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_texture) return; - glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); - glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); -} -static void load_GL_ARB_debug_output(GLADloadproc load) { - if(!GLAD_GL_ARB_debug_output) return; - glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); - glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); - glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); - glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); -} -static void load_GL_EXT_cull_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_cull_vertex) return; - glad_glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)load("glCullParameterdvEXT"); - glad_glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)load("glCullParameterfvEXT"); -} -static void load_GL_IBM_multimode_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_IBM_multimode_draw_arrays) return; - glad_glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)load("glMultiModeDrawArraysIBM"); - glad_glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)load("glMultiModeDrawElementsIBM"); -} -static void load_GL_APPLE_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_object) return; - glad_glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)load("glBindVertexArrayAPPLE"); - glad_glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)load("glDeleteVertexArraysAPPLE"); - glad_glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)load("glGenVertexArraysAPPLE"); - glad_glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)load("glIsVertexArrayAPPLE"); -} -static void load_GL_SGIS_detail_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_detail_texture) return; - glad_glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)load("glDetailTexFuncSGIS"); - glad_glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)load("glGetDetailTexFuncSGIS"); -} -static void load_GL_ARB_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_instanced) return; - glad_glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)load("glDrawArraysInstancedARB"); - glad_glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)load("glDrawElementsInstancedARB"); -} -static void load_GL_ARB_shading_language_include(GLADloadproc load) { - if(!GLAD_GL_ARB_shading_language_include) return; - glad_glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)load("glNamedStringARB"); - glad_glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)load("glDeleteNamedStringARB"); - glad_glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)load("glCompileShaderIncludeARB"); - glad_glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)load("glIsNamedStringARB"); - glad_glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)load("glGetNamedStringARB"); - glad_glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)load("glGetNamedStringivARB"); -} -static void load_GL_INGR_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_INGR_blend_func_separate) return; - glad_glBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC)load("glBlendFuncSeparateINGR"); -} -static void load_GL_NV_path_rendering(GLADloadproc load) { - if(!GLAD_GL_NV_path_rendering) return; - glad_glGenPathsNV = (PFNGLGENPATHSNVPROC)load("glGenPathsNV"); - glad_glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)load("glDeletePathsNV"); - glad_glIsPathNV = (PFNGLISPATHNVPROC)load("glIsPathNV"); - glad_glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)load("glPathCommandsNV"); - glad_glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)load("glPathCoordsNV"); - glad_glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)load("glPathSubCommandsNV"); - glad_glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)load("glPathSubCoordsNV"); - glad_glPathStringNV = (PFNGLPATHSTRINGNVPROC)load("glPathStringNV"); - glad_glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)load("glPathGlyphsNV"); - glad_glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)load("glPathGlyphRangeNV"); - glad_glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)load("glWeightPathsNV"); - glad_glCopyPathNV = (PFNGLCOPYPATHNVPROC)load("glCopyPathNV"); - glad_glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)load("glInterpolatePathsNV"); - glad_glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)load("glTransformPathNV"); - glad_glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)load("glPathParameterivNV"); - glad_glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)load("glPathParameteriNV"); - glad_glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)load("glPathParameterfvNV"); - glad_glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)load("glPathParameterfNV"); - glad_glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)load("glPathDashArrayNV"); - glad_glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)load("glPathStencilFuncNV"); - glad_glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)load("glPathStencilDepthOffsetNV"); - glad_glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)load("glStencilFillPathNV"); - glad_glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)load("glStencilStrokePathNV"); - glad_glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)load("glStencilFillPathInstancedNV"); - glad_glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)load("glStencilStrokePathInstancedNV"); - glad_glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)load("glPathCoverDepthFuncNV"); - glad_glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)load("glCoverFillPathNV"); - glad_glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)load("glCoverStrokePathNV"); - glad_glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)load("glCoverFillPathInstancedNV"); - glad_glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)load("glCoverStrokePathInstancedNV"); - glad_glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)load("glGetPathParameterivNV"); - glad_glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)load("glGetPathParameterfvNV"); - glad_glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)load("glGetPathCommandsNV"); - glad_glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)load("glGetPathCoordsNV"); - glad_glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)load("glGetPathDashArrayNV"); - glad_glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)load("glGetPathMetricsNV"); - glad_glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)load("glGetPathMetricRangeNV"); - glad_glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)load("glGetPathSpacingNV"); - glad_glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)load("glIsPointInFillPathNV"); - glad_glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)load("glIsPointInStrokePathNV"); - glad_glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)load("glGetPathLengthNV"); - glad_glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)load("glPointAlongPathNV"); - glad_glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)load("glMatrixLoad3x2fNV"); - glad_glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)load("glMatrixLoad3x3fNV"); - glad_glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)load("glMatrixLoadTranspose3x3fNV"); - glad_glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)load("glMatrixMult3x2fNV"); - glad_glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)load("glMatrixMult3x3fNV"); - glad_glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)load("glMatrixMultTranspose3x3fNV"); - glad_glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)load("glStencilThenCoverFillPathNV"); - glad_glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)load("glStencilThenCoverStrokePathNV"); - glad_glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)load("glStencilThenCoverFillPathInstancedNV"); - glad_glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)load("glStencilThenCoverStrokePathInstancedNV"); - glad_glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)load("glPathGlyphIndexRangeNV"); - glad_glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)load("glPathGlyphIndexArrayNV"); - glad_glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)load("glPathMemoryGlyphIndexArrayNV"); - glad_glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)load("glProgramPathFragmentInputGenNV"); - glad_glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)load("glGetProgramResourcefvNV"); - glad_glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)load("glPathColorGenNV"); - glad_glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)load("glPathTexGenNV"); - glad_glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)load("glPathFogGenNV"); - glad_glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)load("glGetPathColorGenivNV"); - glad_glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)load("glGetPathColorGenfvNV"); - glad_glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)load("glGetPathTexGenivNV"); - glad_glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)load("glGetPathTexGenfvNV"); -} -static void load_GL_NV_conservative_raster_dilate(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster_dilate) return; - glad_glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)load("glConservativeRasterParameterfNV"); -} -static void load_GL_ATI_vertex_streams(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_streams) return; - glad_glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)load("glVertexStream1sATI"); - glad_glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)load("glVertexStream1svATI"); - glad_glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)load("glVertexStream1iATI"); - glad_glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)load("glVertexStream1ivATI"); - glad_glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)load("glVertexStream1fATI"); - glad_glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)load("glVertexStream1fvATI"); - glad_glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)load("glVertexStream1dATI"); - glad_glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)load("glVertexStream1dvATI"); - glad_glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)load("glVertexStream2sATI"); - glad_glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)load("glVertexStream2svATI"); - glad_glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)load("glVertexStream2iATI"); - glad_glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)load("glVertexStream2ivATI"); - glad_glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)load("glVertexStream2fATI"); - glad_glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)load("glVertexStream2fvATI"); - glad_glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)load("glVertexStream2dATI"); - glad_glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)load("glVertexStream2dvATI"); - glad_glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)load("glVertexStream3sATI"); - glad_glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)load("glVertexStream3svATI"); - glad_glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)load("glVertexStream3iATI"); - glad_glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)load("glVertexStream3ivATI"); - glad_glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)load("glVertexStream3fATI"); - glad_glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)load("glVertexStream3fvATI"); - glad_glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)load("glVertexStream3dATI"); - glad_glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)load("glVertexStream3dvATI"); - glad_glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)load("glVertexStream4sATI"); - glad_glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)load("glVertexStream4svATI"); - glad_glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)load("glVertexStream4iATI"); - glad_glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)load("glVertexStream4ivATI"); - glad_glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)load("glVertexStream4fATI"); - glad_glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)load("glVertexStream4fvATI"); - glad_glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)load("glVertexStream4dATI"); - glad_glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)load("glVertexStream4dvATI"); - glad_glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)load("glNormalStream3bATI"); - glad_glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)load("glNormalStream3bvATI"); - glad_glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)load("glNormalStream3sATI"); - glad_glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)load("glNormalStream3svATI"); - glad_glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)load("glNormalStream3iATI"); - glad_glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)load("glNormalStream3ivATI"); - glad_glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)load("glNormalStream3fATI"); - glad_glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)load("glNormalStream3fvATI"); - glad_glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)load("glNormalStream3dATI"); - glad_glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)load("glNormalStream3dvATI"); - glad_glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)load("glClientActiveVertexStreamATI"); - glad_glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)load("glVertexBlendEnviATI"); - glad_glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)load("glVertexBlendEnvfATI"); -} -static void load_GL_ARB_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_int64) return; - glad_glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)load("glUniform1i64ARB"); - glad_glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)load("glUniform2i64ARB"); - glad_glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)load("glUniform3i64ARB"); - glad_glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)load("glUniform4i64ARB"); - glad_glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)load("glUniform1i64vARB"); - glad_glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)load("glUniform2i64vARB"); - glad_glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)load("glUniform3i64vARB"); - glad_glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)load("glUniform4i64vARB"); - glad_glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)load("glUniform1ui64ARB"); - glad_glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)load("glUniform2ui64ARB"); - glad_glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)load("glUniform3ui64ARB"); - glad_glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)load("glUniform4ui64ARB"); - glad_glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)load("glUniform1ui64vARB"); - glad_glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)load("glUniform2ui64vARB"); - glad_glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)load("glUniform3ui64vARB"); - glad_glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)load("glUniform4ui64vARB"); - glad_glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)load("glGetUniformi64vARB"); - glad_glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)load("glGetUniformui64vARB"); - glad_glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)load("glGetnUniformi64vARB"); - glad_glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)load("glGetnUniformui64vARB"); - glad_glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)load("glProgramUniform1i64ARB"); - glad_glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)load("glProgramUniform2i64ARB"); - glad_glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)load("glProgramUniform3i64ARB"); - glad_glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)load("glProgramUniform4i64ARB"); - glad_glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)load("glProgramUniform1i64vARB"); - glad_glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)load("glProgramUniform2i64vARB"); - glad_glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)load("glProgramUniform3i64vARB"); - glad_glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)load("glProgramUniform4i64vARB"); - glad_glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)load("glProgramUniform1ui64ARB"); - glad_glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)load("glProgramUniform2ui64ARB"); - glad_glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)load("glProgramUniform3ui64ARB"); - glad_glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)load("glProgramUniform4ui64ARB"); - glad_glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)load("glProgramUniform1ui64vARB"); - glad_glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)load("glProgramUniform2ui64vARB"); - glad_glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)load("glProgramUniform3ui64vARB"); - glad_glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)load("glProgramUniform4ui64vARB"); -} -static void load_GL_NV_vdpau_interop(GLADloadproc load) { - if(!GLAD_GL_NV_vdpau_interop) return; - glad_glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)load("glVDPAUInitNV"); - glad_glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)load("glVDPAUFiniNV"); - glad_glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)load("glVDPAURegisterVideoSurfaceNV"); - glad_glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)load("glVDPAURegisterOutputSurfaceNV"); - glad_glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)load("glVDPAUIsSurfaceNV"); - glad_glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)load("glVDPAUUnregisterSurfaceNV"); - glad_glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)load("glVDPAUGetSurfaceivNV"); - glad_glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)load("glVDPAUSurfaceAccessNV"); - glad_glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)load("glVDPAUMapSurfacesNV"); - glad_glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)load("glVDPAUUnmapSurfacesNV"); -} -static void load_GL_ARB_internalformat_query2(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query2) return; - glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); -} -static void load_GL_SUN_vertex(GLADloadproc load) { - if(!GLAD_GL_SUN_vertex) return; - glad_glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)load("glColor4ubVertex2fSUN"); - glad_glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)load("glColor4ubVertex2fvSUN"); - glad_glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)load("glColor4ubVertex3fSUN"); - glad_glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)load("glColor4ubVertex3fvSUN"); - glad_glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)load("glColor3fVertex3fSUN"); - glad_glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)load("glColor3fVertex3fvSUN"); - glad_glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)load("glNormal3fVertex3fSUN"); - glad_glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)load("glNormal3fVertex3fvSUN"); - glad_glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glColor4fNormal3fVertex3fSUN"); - glad_glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)load("glTexCoord2fVertex3fSUN"); - glad_glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)load("glTexCoord2fVertex3fvSUN"); - glad_glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)load("glTexCoord4fVertex4fSUN"); - glad_glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)load("glTexCoord4fVertex4fvSUN"); - glad_glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)load("glTexCoord2fColor4ubVertex3fSUN"); - glad_glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)load("glTexCoord2fColor4ubVertex3fvSUN"); - glad_glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)load("glTexCoord2fColor3fVertex3fSUN"); - glad_glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)load("glTexCoord2fColor3fVertex3fvSUN"); - glad_glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fNormal3fVertex3fSUN"); - glad_glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fNormal3fVertex3fvSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fvSUN"); - glad_glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)load("glReplacementCodeuiVertex3fSUN"); - glad_glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)load("glReplacementCodeuiVertex3fvSUN"); - glad_glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)load("glReplacementCodeuiColor4ubVertex3fSUN"); - glad_glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4ubVertex3fvSUN"); - glad_glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor3fVertex3fSUN"); - glad_glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor3fVertex3fvSUN"); - glad_glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiNormal3fVertex3fSUN"); - glad_glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"); -} -static void load_GL_SGIX_igloo_interface(GLADloadproc load) { - if(!GLAD_GL_SGIX_igloo_interface) return; - glad_glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)load("glIglooInterfaceSGIX"); -} -static void load_GL_ARB_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_indirect) return; - glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); - glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); -} -static void load_GL_NV_vertex_program4(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program4) return; - glad_glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)load("glVertexAttribI1iEXT"); - glad_glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)load("glVertexAttribI2iEXT"); - glad_glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)load("glVertexAttribI3iEXT"); - glad_glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)load("glVertexAttribI4iEXT"); - glad_glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)load("glVertexAttribI1uiEXT"); - glad_glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)load("glVertexAttribI2uiEXT"); - glad_glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)load("glVertexAttribI3uiEXT"); - glad_glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)load("glVertexAttribI4uiEXT"); - glad_glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)load("glVertexAttribI1ivEXT"); - glad_glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)load("glVertexAttribI2ivEXT"); - glad_glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)load("glVertexAttribI3ivEXT"); - glad_glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)load("glVertexAttribI4ivEXT"); - glad_glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)load("glVertexAttribI1uivEXT"); - glad_glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)load("glVertexAttribI2uivEXT"); - glad_glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)load("glVertexAttribI3uivEXT"); - glad_glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)load("glVertexAttribI4uivEXT"); - glad_glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)load("glVertexAttribI4bvEXT"); - glad_glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)load("glVertexAttribI4svEXT"); - glad_glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)load("glVertexAttribI4ubvEXT"); - glad_glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)load("glVertexAttribI4usvEXT"); - glad_glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)load("glVertexAttribIPointerEXT"); - glad_glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)load("glGetVertexAttribIivEXT"); - glad_glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)load("glGetVertexAttribIuivEXT"); -} -static void load_GL_SGIS_fog_function(GLADloadproc load) { - if(!GLAD_GL_SGIS_fog_function) return; - glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); - glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); -} -static void load_GL_EXT_x11_sync_object(GLADloadproc load) { - if(!GLAD_GL_EXT_x11_sync_object) return; - glad_glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)load("glImportSyncEXT"); -} -static void load_GL_ARB_sync(GLADloadproc load) { - if(!GLAD_GL_ARB_sync) return; - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); -} -static void load_GL_NV_sample_locations(GLADloadproc load) { - if(!GLAD_GL_NV_sample_locations) return; - glad_glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glFramebufferSampleLocationsfvNV"); - glad_glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glNamedFramebufferSampleLocationsfvNV"); - glad_glResolveDepthValuesNV = (PFNGLRESOLVEDEPTHVALUESNVPROC)load("glResolveDepthValuesNV"); -} -static void load_GL_ARB_compute_variable_group_size(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_variable_group_size) return; - glad_glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)load("glDispatchComputeGroupSizeARB"); -} -static void load_GL_OES_fixed_point(GLADloadproc load) { - if(!GLAD_GL_OES_fixed_point) return; - glad_glAlphaFuncxOES = (PFNGLALPHAFUNCXOESPROC)load("glAlphaFuncxOES"); - glad_glClearColorxOES = (PFNGLCLEARCOLORXOESPROC)load("glClearColorxOES"); - glad_glClearDepthxOES = (PFNGLCLEARDEPTHXOESPROC)load("glClearDepthxOES"); - glad_glClipPlanexOES = (PFNGLCLIPPLANEXOESPROC)load("glClipPlanexOES"); - glad_glColor4xOES = (PFNGLCOLOR4XOESPROC)load("glColor4xOES"); - glad_glDepthRangexOES = (PFNGLDEPTHRANGEXOESPROC)load("glDepthRangexOES"); - glad_glFogxOES = (PFNGLFOGXOESPROC)load("glFogxOES"); - glad_glFogxvOES = (PFNGLFOGXVOESPROC)load("glFogxvOES"); - glad_glFrustumxOES = (PFNGLFRUSTUMXOESPROC)load("glFrustumxOES"); - glad_glGetClipPlanexOES = (PFNGLGETCLIPPLANEXOESPROC)load("glGetClipPlanexOES"); - glad_glGetFixedvOES = (PFNGLGETFIXEDVOESPROC)load("glGetFixedvOES"); - glad_glGetTexEnvxvOES = (PFNGLGETTEXENVXVOESPROC)load("glGetTexEnvxvOES"); - glad_glGetTexParameterxvOES = (PFNGLGETTEXPARAMETERXVOESPROC)load("glGetTexParameterxvOES"); - glad_glLightModelxOES = (PFNGLLIGHTMODELXOESPROC)load("glLightModelxOES"); - glad_glLightModelxvOES = (PFNGLLIGHTMODELXVOESPROC)load("glLightModelxvOES"); - glad_glLightxOES = (PFNGLLIGHTXOESPROC)load("glLightxOES"); - glad_glLightxvOES = (PFNGLLIGHTXVOESPROC)load("glLightxvOES"); - glad_glLineWidthxOES = (PFNGLLINEWIDTHXOESPROC)load("glLineWidthxOES"); - glad_glLoadMatrixxOES = (PFNGLLOADMATRIXXOESPROC)load("glLoadMatrixxOES"); - glad_glMaterialxOES = (PFNGLMATERIALXOESPROC)load("glMaterialxOES"); - glad_glMaterialxvOES = (PFNGLMATERIALXVOESPROC)load("glMaterialxvOES"); - glad_glMultMatrixxOES = (PFNGLMULTMATRIXXOESPROC)load("glMultMatrixxOES"); - glad_glMultiTexCoord4xOES = (PFNGLMULTITEXCOORD4XOESPROC)load("glMultiTexCoord4xOES"); - glad_glNormal3xOES = (PFNGLNORMAL3XOESPROC)load("glNormal3xOES"); - glad_glOrthoxOES = (PFNGLORTHOXOESPROC)load("glOrthoxOES"); - glad_glPointParameterxvOES = (PFNGLPOINTPARAMETERXVOESPROC)load("glPointParameterxvOES"); - glad_glPointSizexOES = (PFNGLPOINTSIZEXOESPROC)load("glPointSizexOES"); - glad_glPolygonOffsetxOES = (PFNGLPOLYGONOFFSETXOESPROC)load("glPolygonOffsetxOES"); - glad_glRotatexOES = (PFNGLROTATEXOESPROC)load("glRotatexOES"); - glad_glScalexOES = (PFNGLSCALEXOESPROC)load("glScalexOES"); - glad_glTexEnvxOES = (PFNGLTEXENVXOESPROC)load("glTexEnvxOES"); - glad_glTexEnvxvOES = (PFNGLTEXENVXVOESPROC)load("glTexEnvxvOES"); - glad_glTexParameterxOES = (PFNGLTEXPARAMETERXOESPROC)load("glTexParameterxOES"); - glad_glTexParameterxvOES = (PFNGLTEXPARAMETERXVOESPROC)load("glTexParameterxvOES"); - glad_glTranslatexOES = (PFNGLTRANSLATEXOESPROC)load("glTranslatexOES"); - glad_glGetLightxvOES = (PFNGLGETLIGHTXVOESPROC)load("glGetLightxvOES"); - glad_glGetMaterialxvOES = (PFNGLGETMATERIALXVOESPROC)load("glGetMaterialxvOES"); - glad_glPointParameterxOES = (PFNGLPOINTPARAMETERXOESPROC)load("glPointParameterxOES"); - glad_glSampleCoveragexOES = (PFNGLSAMPLECOVERAGEXOESPROC)load("glSampleCoveragexOES"); - glad_glAccumxOES = (PFNGLACCUMXOESPROC)load("glAccumxOES"); - glad_glBitmapxOES = (PFNGLBITMAPXOESPROC)load("glBitmapxOES"); - glad_glBlendColorxOES = (PFNGLBLENDCOLORXOESPROC)load("glBlendColorxOES"); - glad_glClearAccumxOES = (PFNGLCLEARACCUMXOESPROC)load("glClearAccumxOES"); - glad_glColor3xOES = (PFNGLCOLOR3XOESPROC)load("glColor3xOES"); - glad_glColor3xvOES = (PFNGLCOLOR3XVOESPROC)load("glColor3xvOES"); - glad_glColor4xvOES = (PFNGLCOLOR4XVOESPROC)load("glColor4xvOES"); - glad_glConvolutionParameterxOES = (PFNGLCONVOLUTIONPARAMETERXOESPROC)load("glConvolutionParameterxOES"); - glad_glConvolutionParameterxvOES = (PFNGLCONVOLUTIONPARAMETERXVOESPROC)load("glConvolutionParameterxvOES"); - glad_glEvalCoord1xOES = (PFNGLEVALCOORD1XOESPROC)load("glEvalCoord1xOES"); - glad_glEvalCoord1xvOES = (PFNGLEVALCOORD1XVOESPROC)load("glEvalCoord1xvOES"); - glad_glEvalCoord2xOES = (PFNGLEVALCOORD2XOESPROC)load("glEvalCoord2xOES"); - glad_glEvalCoord2xvOES = (PFNGLEVALCOORD2XVOESPROC)load("glEvalCoord2xvOES"); - glad_glFeedbackBufferxOES = (PFNGLFEEDBACKBUFFERXOESPROC)load("glFeedbackBufferxOES"); - glad_glGetConvolutionParameterxvOES = (PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)load("glGetConvolutionParameterxvOES"); - glad_glGetHistogramParameterxvOES = (PFNGLGETHISTOGRAMPARAMETERXVOESPROC)load("glGetHistogramParameterxvOES"); - glad_glGetLightxOES = (PFNGLGETLIGHTXOESPROC)load("glGetLightxOES"); - glad_glGetMapxvOES = (PFNGLGETMAPXVOESPROC)load("glGetMapxvOES"); - glad_glGetMaterialxOES = (PFNGLGETMATERIALXOESPROC)load("glGetMaterialxOES"); - glad_glGetPixelMapxv = (PFNGLGETPIXELMAPXVPROC)load("glGetPixelMapxv"); - glad_glGetTexGenxvOES = (PFNGLGETTEXGENXVOESPROC)load("glGetTexGenxvOES"); - glad_glGetTexLevelParameterxvOES = (PFNGLGETTEXLEVELPARAMETERXVOESPROC)load("glGetTexLevelParameterxvOES"); - glad_glIndexxOES = (PFNGLINDEXXOESPROC)load("glIndexxOES"); - glad_glIndexxvOES = (PFNGLINDEXXVOESPROC)load("glIndexxvOES"); - glad_glLoadTransposeMatrixxOES = (PFNGLLOADTRANSPOSEMATRIXXOESPROC)load("glLoadTransposeMatrixxOES"); - glad_glMap1xOES = (PFNGLMAP1XOESPROC)load("glMap1xOES"); - glad_glMap2xOES = (PFNGLMAP2XOESPROC)load("glMap2xOES"); - glad_glMapGrid1xOES = (PFNGLMAPGRID1XOESPROC)load("glMapGrid1xOES"); - glad_glMapGrid2xOES = (PFNGLMAPGRID2XOESPROC)load("glMapGrid2xOES"); - glad_glMultTransposeMatrixxOES = (PFNGLMULTTRANSPOSEMATRIXXOESPROC)load("glMultTransposeMatrixxOES"); - glad_glMultiTexCoord1xOES = (PFNGLMULTITEXCOORD1XOESPROC)load("glMultiTexCoord1xOES"); - glad_glMultiTexCoord1xvOES = (PFNGLMULTITEXCOORD1XVOESPROC)load("glMultiTexCoord1xvOES"); - glad_glMultiTexCoord2xOES = (PFNGLMULTITEXCOORD2XOESPROC)load("glMultiTexCoord2xOES"); - glad_glMultiTexCoord2xvOES = (PFNGLMULTITEXCOORD2XVOESPROC)load("glMultiTexCoord2xvOES"); - glad_glMultiTexCoord3xOES = (PFNGLMULTITEXCOORD3XOESPROC)load("glMultiTexCoord3xOES"); - glad_glMultiTexCoord3xvOES = (PFNGLMULTITEXCOORD3XVOESPROC)load("glMultiTexCoord3xvOES"); - glad_glMultiTexCoord4xvOES = (PFNGLMULTITEXCOORD4XVOESPROC)load("glMultiTexCoord4xvOES"); - glad_glNormal3xvOES = (PFNGLNORMAL3XVOESPROC)load("glNormal3xvOES"); - glad_glPassThroughxOES = (PFNGLPASSTHROUGHXOESPROC)load("glPassThroughxOES"); - glad_glPixelMapx = (PFNGLPIXELMAPXPROC)load("glPixelMapx"); - glad_glPixelStorex = (PFNGLPIXELSTOREXPROC)load("glPixelStorex"); - glad_glPixelTransferxOES = (PFNGLPIXELTRANSFERXOESPROC)load("glPixelTransferxOES"); - glad_glPixelZoomxOES = (PFNGLPIXELZOOMXOESPROC)load("glPixelZoomxOES"); - glad_glPrioritizeTexturesxOES = (PFNGLPRIORITIZETEXTURESXOESPROC)load("glPrioritizeTexturesxOES"); - glad_glRasterPos2xOES = (PFNGLRASTERPOS2XOESPROC)load("glRasterPos2xOES"); - glad_glRasterPos2xvOES = (PFNGLRASTERPOS2XVOESPROC)load("glRasterPos2xvOES"); - glad_glRasterPos3xOES = (PFNGLRASTERPOS3XOESPROC)load("glRasterPos3xOES"); - glad_glRasterPos3xvOES = (PFNGLRASTERPOS3XVOESPROC)load("glRasterPos3xvOES"); - glad_glRasterPos4xOES = (PFNGLRASTERPOS4XOESPROC)load("glRasterPos4xOES"); - glad_glRasterPos4xvOES = (PFNGLRASTERPOS4XVOESPROC)load("glRasterPos4xvOES"); - glad_glRectxOES = (PFNGLRECTXOESPROC)load("glRectxOES"); - glad_glRectxvOES = (PFNGLRECTXVOESPROC)load("glRectxvOES"); - glad_glTexCoord1xOES = (PFNGLTEXCOORD1XOESPROC)load("glTexCoord1xOES"); - glad_glTexCoord1xvOES = (PFNGLTEXCOORD1XVOESPROC)load("glTexCoord1xvOES"); - glad_glTexCoord2xOES = (PFNGLTEXCOORD2XOESPROC)load("glTexCoord2xOES"); - glad_glTexCoord2xvOES = (PFNGLTEXCOORD2XVOESPROC)load("glTexCoord2xvOES"); - glad_glTexCoord3xOES = (PFNGLTEXCOORD3XOESPROC)load("glTexCoord3xOES"); - glad_glTexCoord3xvOES = (PFNGLTEXCOORD3XVOESPROC)load("glTexCoord3xvOES"); - glad_glTexCoord4xOES = (PFNGLTEXCOORD4XOESPROC)load("glTexCoord4xOES"); - glad_glTexCoord4xvOES = (PFNGLTEXCOORD4XVOESPROC)load("glTexCoord4xvOES"); - glad_glTexGenxOES = (PFNGLTEXGENXOESPROC)load("glTexGenxOES"); - glad_glTexGenxvOES = (PFNGLTEXGENXVOESPROC)load("glTexGenxvOES"); - glad_glVertex2xOES = (PFNGLVERTEX2XOESPROC)load("glVertex2xOES"); - glad_glVertex2xvOES = (PFNGLVERTEX2XVOESPROC)load("glVertex2xvOES"); - glad_glVertex3xOES = (PFNGLVERTEX3XOESPROC)load("glVertex3xOES"); - glad_glVertex3xvOES = (PFNGLVERTEX3XVOESPROC)load("glVertex3xvOES"); - glad_glVertex4xOES = (PFNGLVERTEX4XOESPROC)load("glVertex4xOES"); - glad_glVertex4xvOES = (PFNGLVERTEX4XVOESPROC)load("glVertex4xvOES"); -} -static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_multisample) return; - glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); -} -static void load_GL_SGIS_texture4D(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture4D) return; - glad_glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)load("glTexImage4DSGIS"); - glad_glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)load("glTexSubImage4DSGIS"); -} -static void load_GL_EXT_texture3D(GLADloadproc load) { - if(!GLAD_GL_EXT_texture3D) return; - glad_glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)load("glTexImage3DEXT"); - glad_glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)load("glTexSubImage3DEXT"); -} -static void load_GL_EXT_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_multisample) return; - glad_glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)load("glSampleMaskEXT"); - glad_glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)load("glSamplePatternEXT"); -} -static void load_GL_EXT_secondary_color(GLADloadproc load) { - if(!GLAD_GL_EXT_secondary_color) return; - glad_glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)load("glSecondaryColor3bEXT"); - glad_glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)load("glSecondaryColor3bvEXT"); - glad_glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)load("glSecondaryColor3dEXT"); - glad_glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)load("glSecondaryColor3dvEXT"); - glad_glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)load("glSecondaryColor3fEXT"); - glad_glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)load("glSecondaryColor3fvEXT"); - glad_glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)load("glSecondaryColor3iEXT"); - glad_glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)load("glSecondaryColor3ivEXT"); - glad_glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)load("glSecondaryColor3sEXT"); - glad_glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)load("glSecondaryColor3svEXT"); - glad_glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)load("glSecondaryColor3ubEXT"); - glad_glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)load("glSecondaryColor3ubvEXT"); - glad_glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)load("glSecondaryColor3uiEXT"); - glad_glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)load("glSecondaryColor3uivEXT"); - glad_glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)load("glSecondaryColor3usEXT"); - glad_glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)load("glSecondaryColor3usvEXT"); - glad_glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)load("glSecondaryColorPointerEXT"); -} -static void load_GL_ATI_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_array_object) return; - glad_glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)load("glNewObjectBufferATI"); - glad_glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)load("glIsObjectBufferATI"); - glad_glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)load("glUpdateObjectBufferATI"); - glad_glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)load("glGetObjectBufferfvATI"); - glad_glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)load("glGetObjectBufferivATI"); - glad_glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)load("glFreeObjectBufferATI"); - glad_glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)load("glArrayObjectATI"); - glad_glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)load("glGetArrayObjectfvATI"); - glad_glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)load("glGetArrayObjectivATI"); - glad_glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)load("glVariantArrayObjectATI"); - glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); - glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); -} -static void load_GL_ARB_parallel_shader_compile(GLADloadproc load) { - if(!GLAD_GL_ARB_parallel_shader_compile) return; - glad_glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)load("glMaxShaderCompilerThreadsARB"); -} -static void load_GL_ARB_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_texture) return; - glad_glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)load("glTexPageCommitmentARB"); -} -static void load_GL_ARB_sample_locations(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_locations) return; - glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); - glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); - glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); -} -static void load_GL_ARB_sparse_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_buffer) return; - glad_glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)load("glBufferPageCommitmentARB"); - glad_glNamedBufferPageCommitmentEXT = (PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)load("glNamedBufferPageCommitmentEXT"); - glad_glNamedBufferPageCommitmentARB = (PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)load("glNamedBufferPageCommitmentARB"); -} -static void load_GL_EXT_draw_range_elements(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_range_elements) return; - glad_glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)load("glDrawRangeElementsEXT"); -} -static int find_extensionsGL(void) { - if (!get_exts()) return 0; - GLAD_GL_SGIX_pixel_tiles = has_ext("GL_SGIX_pixel_tiles"); - GLAD_GL_EXT_post_depth_coverage = has_ext("GL_EXT_post_depth_coverage"); - GLAD_GL_APPLE_element_array = has_ext("GL_APPLE_element_array"); - GLAD_GL_AMD_multi_draw_indirect = has_ext("GL_AMD_multi_draw_indirect"); - GLAD_GL_EXT_blend_subtract = has_ext("GL_EXT_blend_subtract"); - GLAD_GL_SGIX_tag_sample_buffer = has_ext("GL_SGIX_tag_sample_buffer"); - GLAD_GL_NV_point_sprite = has_ext("GL_NV_point_sprite"); - GLAD_GL_IBM_texture_mirrored_repeat = has_ext("GL_IBM_texture_mirrored_repeat"); - GLAD_GL_APPLE_transform_hint = has_ext("GL_APPLE_transform_hint"); - GLAD_GL_ATI_separate_stencil = has_ext("GL_ATI_separate_stencil"); - GLAD_GL_NV_shader_atomic_int64 = has_ext("GL_NV_shader_atomic_int64"); - GLAD_GL_NV_vertex_program2_option = has_ext("GL_NV_vertex_program2_option"); - GLAD_GL_EXT_texture_buffer_object = has_ext("GL_EXT_texture_buffer_object"); - GLAD_GL_ARB_vertex_blend = has_ext("GL_ARB_vertex_blend"); - GLAD_GL_OVR_multiview = has_ext("GL_OVR_multiview"); - GLAD_GL_NV_vertex_program2 = has_ext("GL_NV_vertex_program2"); - GLAD_GL_ARB_program_interface_query = has_ext("GL_ARB_program_interface_query"); - GLAD_GL_EXT_misc_attribute = has_ext("GL_EXT_misc_attribute"); - GLAD_GL_NV_multisample_coverage = has_ext("GL_NV_multisample_coverage"); - GLAD_GL_ARB_shading_language_packing = has_ext("GL_ARB_shading_language_packing"); - GLAD_GL_EXT_texture_cube_map = has_ext("GL_EXT_texture_cube_map"); - GLAD_GL_NV_viewport_array2 = has_ext("GL_NV_viewport_array2"); - GLAD_GL_ARB_texture_stencil8 = has_ext("GL_ARB_texture_stencil8"); - GLAD_GL_EXT_index_func = has_ext("GL_EXT_index_func"); - GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); - GLAD_GL_NV_depth_clamp = has_ext("GL_NV_depth_clamp"); - GLAD_GL_NV_shader_buffer_load = has_ext("GL_NV_shader_buffer_load"); - GLAD_GL_EXT_color_subtable = has_ext("GL_EXT_color_subtable"); - GLAD_GL_SUNX_constant_data = has_ext("GL_SUNX_constant_data"); - GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); - GLAD_GL_EXT_multi_draw_arrays = has_ext("GL_EXT_multi_draw_arrays"); - GLAD_GL_ARB_shader_atomic_counters = has_ext("GL_ARB_shader_atomic_counters"); - GLAD_GL_ARB_arrays_of_arrays = has_ext("GL_ARB_arrays_of_arrays"); - GLAD_GL_NV_conditional_render = has_ext("GL_NV_conditional_render"); - GLAD_GL_EXT_texture_env_combine = has_ext("GL_EXT_texture_env_combine"); - GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); - GLAD_GL_SGIX_async_histogram = has_ext("GL_SGIX_async_histogram"); - GLAD_GL_MESA_resize_buffers = has_ext("GL_MESA_resize_buffers"); - GLAD_GL_NV_light_max_exponent = has_ext("GL_NV_light_max_exponent"); - GLAD_GL_NV_texture_env_combine4 = has_ext("GL_NV_texture_env_combine4"); - GLAD_GL_ARB_texture_view = has_ext("GL_ARB_texture_view"); - GLAD_GL_ARB_texture_env_combine = has_ext("GL_ARB_texture_env_combine"); - GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); - GLAD_GL_EXT_convolution = has_ext("GL_EXT_convolution"); - GLAD_GL_NV_compute_program5 = has_ext("GL_NV_compute_program5"); - GLAD_GL_NV_vertex_attrib_integer_64bit = has_ext("GL_NV_vertex_attrib_integer_64bit"); - GLAD_GL_EXT_paletted_texture = has_ext("GL_EXT_paletted_texture"); - GLAD_GL_ARB_texture_buffer_object = has_ext("GL_ARB_texture_buffer_object"); - GLAD_GL_ATI_pn_triangles = has_ext("GL_ATI_pn_triangles"); - GLAD_GL_SGIX_resample = has_ext("GL_SGIX_resample"); - GLAD_GL_SGIX_flush_raster = has_ext("GL_SGIX_flush_raster"); - GLAD_GL_EXT_light_texture = has_ext("GL_EXT_light_texture"); - GLAD_GL_ARB_point_sprite = has_ext("GL_ARB_point_sprite"); - GLAD_GL_SUN_convolution_border_modes = has_ext("GL_SUN_convolution_border_modes"); - GLAD_GL_NV_parameter_buffer_object2 = has_ext("GL_NV_parameter_buffer_object2"); - GLAD_GL_ARB_half_float_pixel = has_ext("GL_ARB_half_float_pixel"); - GLAD_GL_NV_tessellation_program5 = has_ext("GL_NV_tessellation_program5"); - GLAD_GL_REND_screen_coordinates = has_ext("GL_REND_screen_coordinates"); - GLAD_GL_HP_image_transform = has_ext("GL_HP_image_transform"); - GLAD_GL_EXT_packed_float = has_ext("GL_EXT_packed_float"); - GLAD_GL_OML_subsample = has_ext("GL_OML_subsample"); - GLAD_GL_SGIX_vertex_preclip = has_ext("GL_SGIX_vertex_preclip"); - GLAD_GL_SGIX_texture_scale_bias = has_ext("GL_SGIX_texture_scale_bias"); - GLAD_GL_AMD_draw_buffers_blend = has_ext("GL_AMD_draw_buffers_blend"); - GLAD_GL_APPLE_texture_range = has_ext("GL_APPLE_texture_range"); - GLAD_GL_EXT_texture_array = has_ext("GL_EXT_texture_array"); - GLAD_GL_NV_texture_barrier = has_ext("GL_NV_texture_barrier"); - GLAD_GL_ARB_texture_query_levels = has_ext("GL_ARB_texture_query_levels"); - GLAD_GL_NV_texgen_emboss = has_ext("GL_NV_texgen_emboss"); - GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); - GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); - GLAD_GL_ARB_vertex_type_2_10_10_10_rev = has_ext("GL_ARB_vertex_type_2_10_10_10_rev"); - GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); - GLAD_GL_3DFX_tbuffer = has_ext("GL_3DFX_tbuffer"); - GLAD_GL_GREMEDY_frame_terminator = has_ext("GL_GREMEDY_frame_terminator"); - GLAD_GL_ARB_blend_func_extended = has_ext("GL_ARB_blend_func_extended"); - GLAD_GL_EXT_separate_shader_objects = has_ext("GL_EXT_separate_shader_objects"); - GLAD_GL_NV_texture_multisample = has_ext("GL_NV_texture_multisample"); - GLAD_GL_ARB_shader_objects = has_ext("GL_ARB_shader_objects"); - GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); - GLAD_GL_ATI_envmap_bumpmap = has_ext("GL_ATI_envmap_bumpmap"); - GLAD_GL_ARB_robust_buffer_access_behavior = has_ext("GL_ARB_robust_buffer_access_behavior"); - GLAD_GL_ARB_shader_stencil_export = has_ext("GL_ARB_shader_stencil_export"); - GLAD_GL_NV_texture_rectangle = has_ext("GL_NV_texture_rectangle"); - GLAD_GL_ARB_enhanced_layouts = has_ext("GL_ARB_enhanced_layouts"); - GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); - GLAD_GL_SGI_texture_color_table = has_ext("GL_SGI_texture_color_table"); - GLAD_GL_ATI_map_object_buffer = has_ext("GL_ATI_map_object_buffer"); - GLAD_GL_ARB_robustness = has_ext("GL_ARB_robustness"); - GLAD_GL_NV_pixel_data_range = has_ext("GL_NV_pixel_data_range"); - GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); - GLAD_GL_ARB_gpu_shader_fp64 = has_ext("GL_ARB_gpu_shader_fp64"); - GLAD_GL_NV_command_list = has_ext("GL_NV_command_list"); - GLAD_GL_SGIX_depth_texture = has_ext("GL_SGIX_depth_texture"); - GLAD_GL_EXT_vertex_weighting = has_ext("GL_EXT_vertex_weighting"); - GLAD_GL_GREMEDY_string_marker = has_ext("GL_GREMEDY_string_marker"); - GLAD_GL_ARB_texture_compression_bptc = has_ext("GL_ARB_texture_compression_bptc"); - GLAD_GL_EXT_subtexture = has_ext("GL_EXT_subtexture"); - GLAD_GL_EXT_pixel_transform_color_table = has_ext("GL_EXT_pixel_transform_color_table"); - GLAD_GL_EXT_texture_compression_rgtc = has_ext("GL_EXT_texture_compression_rgtc"); - GLAD_GL_ARB_shader_atomic_counter_ops = has_ext("GL_ARB_shader_atomic_counter_ops"); - GLAD_GL_SGIX_depth_pass_instrument = has_ext("GL_SGIX_depth_pass_instrument"); - GLAD_GL_EXT_gpu_program_parameters = has_ext("GL_EXT_gpu_program_parameters"); - GLAD_GL_NV_evaluators = has_ext("GL_NV_evaluators"); - GLAD_GL_SGIS_texture_filter4 = has_ext("GL_SGIS_texture_filter4"); - GLAD_GL_AMD_performance_monitor = has_ext("GL_AMD_performance_monitor"); - GLAD_GL_NV_geometry_shader4 = has_ext("GL_NV_geometry_shader4"); - GLAD_GL_EXT_stencil_clear_tag = has_ext("GL_EXT_stencil_clear_tag"); - GLAD_GL_NV_vertex_program1_1 = has_ext("GL_NV_vertex_program1_1"); - GLAD_GL_NV_present_video = has_ext("GL_NV_present_video"); - GLAD_GL_ARB_texture_compression_rgtc = has_ext("GL_ARB_texture_compression_rgtc"); - GLAD_GL_HP_convolution_border_modes = has_ext("GL_HP_convolution_border_modes"); - GLAD_GL_EXT_shader_integer_mix = has_ext("GL_EXT_shader_integer_mix"); - GLAD_GL_SGIX_framezoom = has_ext("GL_SGIX_framezoom"); - GLAD_GL_ARB_stencil_texturing = has_ext("GL_ARB_stencil_texturing"); - GLAD_GL_ARB_shader_clock = has_ext("GL_ARB_shader_clock"); - GLAD_GL_NV_shader_atomic_fp16_vector = has_ext("GL_NV_shader_atomic_fp16_vector"); - GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); - GLAD_GL_ARB_draw_elements_base_vertex = has_ext("GL_ARB_draw_elements_base_vertex"); - GLAD_GL_INGR_interlace_read = has_ext("GL_INGR_interlace_read"); - GLAD_GL_NV_transform_feedback = has_ext("GL_NV_transform_feedback"); - GLAD_GL_NV_fragment_program = has_ext("GL_NV_fragment_program"); - GLAD_GL_AMD_stencil_operation_extended = has_ext("GL_AMD_stencil_operation_extended"); - GLAD_GL_ARB_seamless_cubemap_per_texture = has_ext("GL_ARB_seamless_cubemap_per_texture"); - GLAD_GL_ARB_instanced_arrays = has_ext("GL_ARB_instanced_arrays"); - GLAD_GL_EXT_polygon_offset = has_ext("GL_EXT_polygon_offset"); - GLAD_GL_NV_vertex_array_range2 = has_ext("GL_NV_vertex_array_range2"); - GLAD_GL_KHR_robustness = has_ext("GL_KHR_robustness"); - GLAD_GL_AMD_sparse_texture = has_ext("GL_AMD_sparse_texture"); - GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control"); - GLAD_GL_NV_fragment_coverage_to_color = has_ext("GL_NV_fragment_coverage_to_color"); - GLAD_GL_NV_fence = has_ext("GL_NV_fence"); - GLAD_GL_ARB_texture_buffer_range = has_ext("GL_ARB_texture_buffer_range"); - GLAD_GL_SUN_mesh_array = has_ext("GL_SUN_mesh_array"); - GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); - GLAD_GL_ARB_framebuffer_no_attachments = has_ext("GL_ARB_framebuffer_no_attachments"); - GLAD_GL_ARB_cl_event = has_ext("GL_ARB_cl_event"); - GLAD_GL_ARB_derivative_control = has_ext("GL_ARB_derivative_control"); - GLAD_GL_NV_packed_depth_stencil = has_ext("GL_NV_packed_depth_stencil"); - GLAD_GL_OES_single_precision = has_ext("GL_OES_single_precision"); - GLAD_GL_NV_primitive_restart = has_ext("GL_NV_primitive_restart"); - GLAD_GL_SUN_global_alpha = has_ext("GL_SUN_global_alpha"); - GLAD_GL_ARB_fragment_shader_interlock = has_ext("GL_ARB_fragment_shader_interlock"); - GLAD_GL_EXT_texture_object = has_ext("GL_EXT_texture_object"); - GLAD_GL_AMD_name_gen_delete = has_ext("GL_AMD_name_gen_delete"); - GLAD_GL_NV_texture_compression_vtc = has_ext("GL_NV_texture_compression_vtc"); - GLAD_GL_NV_sample_mask_override_coverage = has_ext("GL_NV_sample_mask_override_coverage"); - GLAD_GL_NV_texture_shader3 = has_ext("GL_NV_texture_shader3"); - GLAD_GL_NV_texture_shader2 = has_ext("GL_NV_texture_shader2"); - GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); - GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); - GLAD_GL_AMD_shader_atomic_counter_ops = has_ext("GL_AMD_shader_atomic_counter_ops"); - GLAD_GL_APPLE_vertex_program_evaluators = has_ext("GL_APPLE_vertex_program_evaluators"); - GLAD_GL_ARB_multi_bind = has_ext("GL_ARB_multi_bind"); - GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); - GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); - GLAD_GL_NV_path_rendering_shared_edge = has_ext("GL_NV_path_rendering_shared_edge"); - GLAD_GL_SGIX_shadow_ambient = has_ext("GL_SGIX_shadow_ambient"); - GLAD_GL_ARB_texture_cube_map = has_ext("GL_ARB_texture_cube_map"); - GLAD_GL_AMD_vertex_shader_viewport_index = has_ext("GL_AMD_vertex_shader_viewport_index"); - GLAD_GL_SGIX_list_priority = has_ext("GL_SGIX_list_priority"); - GLAD_GL_NV_vertex_buffer_unified_memory = has_ext("GL_NV_vertex_buffer_unified_memory"); - GLAD_GL_NV_uniform_buffer_unified_memory = has_ext("GL_NV_uniform_buffer_unified_memory"); - GLAD_GL_EXT_texture_env_dot3 = has_ext("GL_EXT_texture_env_dot3"); - GLAD_GL_ATI_texture_env_combine3 = has_ext("GL_ATI_texture_env_combine3"); - GLAD_GL_ARB_map_buffer_alignment = has_ext("GL_ARB_map_buffer_alignment"); - GLAD_GL_NV_blend_equation_advanced = has_ext("GL_NV_blend_equation_advanced"); - GLAD_GL_SGIS_sharpen_texture = has_ext("GL_SGIS_sharpen_texture"); - GLAD_GL_KHR_robust_buffer_access_behavior = has_ext("GL_KHR_robust_buffer_access_behavior"); - GLAD_GL_ARB_pipeline_statistics_query = has_ext("GL_ARB_pipeline_statistics_query"); - GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); - GLAD_GL_ARB_texture_rgb10_a2ui = has_ext("GL_ARB_texture_rgb10_a2ui"); - GLAD_GL_OML_interlace = has_ext("GL_OML_interlace"); - GLAD_GL_ATI_pixel_format_float = has_ext("GL_ATI_pixel_format_float"); - GLAD_GL_NV_geometry_shader_passthrough = has_ext("GL_NV_geometry_shader_passthrough"); - GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); - GLAD_GL_EXT_shadow_funcs = has_ext("GL_EXT_shadow_funcs"); - GLAD_GL_ATI_text_fragment_shader = has_ext("GL_ATI_text_fragment_shader"); - GLAD_GL_NV_vertex_array_range = has_ext("GL_NV_vertex_array_range"); - GLAD_GL_SGIX_fragment_lighting = has_ext("GL_SGIX_fragment_lighting"); - GLAD_GL_NV_texture_expand_normal = has_ext("GL_NV_texture_expand_normal"); - GLAD_GL_NV_framebuffer_multisample_coverage = has_ext("GL_NV_framebuffer_multisample_coverage"); - GLAD_GL_EXT_timer_query = has_ext("GL_EXT_timer_query"); - GLAD_GL_EXT_vertex_array_bgra = has_ext("GL_EXT_vertex_array_bgra"); - GLAD_GL_NV_bindless_texture = has_ext("GL_NV_bindless_texture"); - GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); - GLAD_GL_SGIS_texture_border_clamp = has_ext("GL_SGIS_texture_border_clamp"); - GLAD_GL_ATI_vertex_attrib_array_object = has_ext("GL_ATI_vertex_attrib_array_object"); - GLAD_GL_SGIX_clipmap = has_ext("GL_SGIX_clipmap"); - GLAD_GL_EXT_geometry_shader4 = has_ext("GL_EXT_geometry_shader4"); - GLAD_GL_ARB_shader_texture_image_samples = has_ext("GL_ARB_shader_texture_image_samples"); - GLAD_GL_MESA_ycbcr_texture = has_ext("GL_MESA_ycbcr_texture"); - GLAD_GL_MESAX_texture_stack = has_ext("GL_MESAX_texture_stack"); - GLAD_GL_AMD_seamless_cubemap_per_texture = has_ext("GL_AMD_seamless_cubemap_per_texture"); - GLAD_GL_EXT_bindable_uniform = has_ext("GL_EXT_bindable_uniform"); - GLAD_GL_KHR_texture_compression_astc_hdr = has_ext("GL_KHR_texture_compression_astc_hdr"); - GLAD_GL_ARB_shader_ballot = has_ext("GL_ARB_shader_ballot"); - GLAD_GL_KHR_blend_equation_advanced = has_ext("GL_KHR_blend_equation_advanced"); - GLAD_GL_ARB_fragment_program_shadow = has_ext("GL_ARB_fragment_program_shadow"); - GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); - GLAD_GL_AMD_texture_texture4 = has_ext("GL_AMD_texture_texture4"); - GLAD_GL_SGIX_reference_plane = has_ext("GL_SGIX_reference_plane"); - GLAD_GL_EXT_stencil_two_side = has_ext("GL_EXT_stencil_two_side"); - GLAD_GL_ARB_transform_feedback_overflow_query = has_ext("GL_ARB_transform_feedback_overflow_query"); - GLAD_GL_SGIX_texture_lod_bias = has_ext("GL_SGIX_texture_lod_bias"); - GLAD_GL_KHR_no_error = has_ext("GL_KHR_no_error"); - GLAD_GL_NV_explicit_multisample = has_ext("GL_NV_explicit_multisample"); - GLAD_GL_IBM_static_data = has_ext("GL_IBM_static_data"); - GLAD_GL_EXT_clip_volume_hint = has_ext("GL_EXT_clip_volume_hint"); - GLAD_GL_EXT_texture_perturb_normal = has_ext("GL_EXT_texture_perturb_normal"); - GLAD_GL_NV_fragment_program2 = has_ext("GL_NV_fragment_program2"); - GLAD_GL_NV_fragment_program4 = has_ext("GL_NV_fragment_program4"); - GLAD_GL_EXT_point_parameters = has_ext("GL_EXT_point_parameters"); - GLAD_GL_PGI_misc_hints = has_ext("GL_PGI_misc_hints"); - GLAD_GL_SGIX_subsample = has_ext("GL_SGIX_subsample"); - GLAD_GL_AMD_shader_stencil_export = has_ext("GL_AMD_shader_stencil_export"); - GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod"); - GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); - GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); - GLAD_GL_SGIS_texture_select = has_ext("GL_SGIS_texture_select"); - GLAD_GL_NV_texture_shader = has_ext("GL_NV_texture_shader"); - GLAD_GL_ARB_tessellation_shader = has_ext("GL_ARB_tessellation_shader"); - GLAD_GL_EXT_draw_buffers2 = has_ext("GL_EXT_draw_buffers2"); - GLAD_GL_ARB_vertex_attrib_64bit = has_ext("GL_ARB_vertex_attrib_64bit"); - GLAD_GL_EXT_texture_filter_minmax = has_ext("GL_EXT_texture_filter_minmax"); - GLAD_GL_WIN_specular_fog = has_ext("GL_WIN_specular_fog"); - GLAD_GL_AMD_interleaved_elements = has_ext("GL_AMD_interleaved_elements"); - GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); - GLAD_GL_OML_resample = has_ext("GL_OML_resample"); - GLAD_GL_APPLE_ycbcr_422 = has_ext("GL_APPLE_ycbcr_422"); - GLAD_GL_SGIX_texture_add_env = has_ext("GL_SGIX_texture_add_env"); - GLAD_GL_ARB_shadow_ambient = has_ext("GL_ARB_shadow_ambient"); - GLAD_GL_ARB_texture_storage = has_ext("GL_ARB_texture_storage"); - GLAD_GL_EXT_pixel_buffer_object = has_ext("GL_EXT_pixel_buffer_object"); - GLAD_GL_ARB_copy_image = has_ext("GL_ARB_copy_image"); - GLAD_GL_SGIS_pixel_texture = has_ext("GL_SGIS_pixel_texture"); - GLAD_GL_SGIS_generate_mipmap = has_ext("GL_SGIS_generate_mipmap"); - GLAD_GL_SGIX_instruments = has_ext("GL_SGIX_instruments"); - GLAD_GL_HP_texture_lighting = has_ext("GL_HP_texture_lighting"); - GLAD_GL_ARB_shader_storage_buffer_object = has_ext("GL_ARB_shader_storage_buffer_object"); - GLAD_GL_EXT_sparse_texture2 = has_ext("GL_EXT_sparse_texture2"); - GLAD_GL_EXT_blend_minmax = has_ext("GL_EXT_blend_minmax"); - GLAD_GL_MESA_pack_invert = has_ext("GL_MESA_pack_invert"); - GLAD_GL_ARB_base_instance = has_ext("GL_ARB_base_instance"); - GLAD_GL_SGIX_convolution_accuracy = has_ext("GL_SGIX_convolution_accuracy"); - GLAD_GL_PGI_vertex_hints = has_ext("GL_PGI_vertex_hints"); - GLAD_GL_AMD_transform_feedback4 = has_ext("GL_AMD_transform_feedback4"); - GLAD_GL_ARB_ES3_1_compatibility = has_ext("GL_ARB_ES3_1_compatibility"); - GLAD_GL_EXT_texture_integer = has_ext("GL_EXT_texture_integer"); - GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); - GLAD_GL_AMD_gpu_shader_int64 = has_ext("GL_AMD_gpu_shader_int64"); - GLAD_GL_S3_s3tc = has_ext("GL_S3_s3tc"); - GLAD_GL_ARB_query_buffer_object = has_ext("GL_ARB_query_buffer_object"); - GLAD_GL_AMD_vertex_shader_tessellator = has_ext("GL_AMD_vertex_shader_tessellator"); - GLAD_GL_ARB_invalidate_subdata = has_ext("GL_ARB_invalidate_subdata"); - GLAD_GL_EXT_index_material = has_ext("GL_EXT_index_material"); - GLAD_GL_NV_blend_equation_advanced_coherent = has_ext("GL_NV_blend_equation_advanced_coherent"); - GLAD_GL_KHR_texture_compression_astc_sliced_3d = has_ext("GL_KHR_texture_compression_astc_sliced_3d"); - GLAD_GL_INTEL_parallel_arrays = has_ext("GL_INTEL_parallel_arrays"); - GLAD_GL_ATI_draw_buffers = has_ext("GL_ATI_draw_buffers"); - GLAD_GL_EXT_cmyka = has_ext("GL_EXT_cmyka"); - GLAD_GL_SGIX_pixel_texture = has_ext("GL_SGIX_pixel_texture"); - GLAD_GL_APPLE_specular_vector = has_ext("GL_APPLE_specular_vector"); - GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); - GLAD_GL_ARB_timer_query = has_ext("GL_ARB_timer_query"); - GLAD_GL_SGIX_interlace = has_ext("GL_SGIX_interlace"); - GLAD_GL_NV_parameter_buffer_object = has_ext("GL_NV_parameter_buffer_object"); - GLAD_GL_AMD_shader_trinary_minmax = has_ext("GL_AMD_shader_trinary_minmax"); - GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access"); - GLAD_GL_EXT_rescale_normal = has_ext("GL_EXT_rescale_normal"); - GLAD_GL_ARB_pixel_buffer_object = has_ext("GL_ARB_pixel_buffer_object"); - GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); - GLAD_GL_ARB_vertex_type_10f_11f_11f_rev = has_ext("GL_ARB_vertex_type_10f_11f_11f_rev"); - GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); - GLAD_GL_NV_transform_feedback2 = has_ext("GL_NV_transform_feedback2"); - GLAD_GL_SGIX_async_pixel = has_ext("GL_SGIX_async_pixel"); - GLAD_GL_NV_fragment_program_option = has_ext("GL_NV_fragment_program_option"); - GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); - GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); - GLAD_GL_NV_shader_thread_group = has_ext("GL_NV_shader_thread_group"); - GLAD_GL_EXT_stencil_wrap = has_ext("GL_EXT_stencil_wrap"); - GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); - GLAD_GL_OVR_multiview2 = has_ext("GL_OVR_multiview2"); - GLAD_GL_EXT_histogram = has_ext("GL_EXT_histogram"); - GLAD_GL_ARB_get_texture_sub_image = has_ext("GL_ARB_get_texture_sub_image"); - GLAD_GL_SGIS_point_parameters = has_ext("GL_SGIS_point_parameters"); - GLAD_GL_SGIX_ycrcb = has_ext("GL_SGIX_ycrcb"); - GLAD_GL_EXT_direct_state_access = has_ext("GL_EXT_direct_state_access"); - GLAD_GL_ARB_cull_distance = has_ext("GL_ARB_cull_distance"); - GLAD_GL_AMD_sample_positions = has_ext("GL_AMD_sample_positions"); - GLAD_GL_NV_vertex_program = has_ext("GL_NV_vertex_program"); - GLAD_GL_NV_shader_thread_shuffle = has_ext("GL_NV_shader_thread_shuffle"); - GLAD_GL_ARB_shader_precision = has_ext("GL_ARB_shader_precision"); - GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); - GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); - GLAD_GL_APPLE_fence = has_ext("GL_APPLE_fence"); - GLAD_GL_OES_byte_coordinates = has_ext("GL_OES_byte_coordinates"); - GLAD_GL_ARB_transpose_matrix = has_ext("GL_ARB_transpose_matrix"); - GLAD_GL_ARB_provoking_vertex = has_ext("GL_ARB_provoking_vertex"); - GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); - GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); - GLAD_GL_ARB_half_float_vertex = has_ext("GL_ARB_half_float_vertex"); - GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); - GLAD_GL_NV_framebuffer_mixed_samples = has_ext("GL_NV_framebuffer_mixed_samples"); - GLAD_GL_NVX_conditional_render = has_ext("GL_NVX_conditional_render"); - GLAD_GL_ARB_multi_draw_indirect = has_ext("GL_ARB_multi_draw_indirect"); - GLAD_GL_EXT_raster_multisample = has_ext("GL_EXT_raster_multisample"); - GLAD_GL_NV_copy_image = has_ext("GL_NV_copy_image"); - GLAD_GL_ARB_fragment_layer_viewport = has_ext("GL_ARB_fragment_layer_viewport"); - GLAD_GL_INTEL_framebuffer_CMAA = has_ext("GL_INTEL_framebuffer_CMAA"); - GLAD_GL_ARB_transform_feedback2 = has_ext("GL_ARB_transform_feedback2"); - GLAD_GL_ARB_transform_feedback3 = has_ext("GL_ARB_transform_feedback3"); - GLAD_GL_SGIX_ycrcba = has_ext("GL_SGIX_ycrcba"); - GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); - GLAD_GL_EXT_bgra = has_ext("GL_EXT_bgra"); - GLAD_GL_ARB_sparse_texture_clamp = has_ext("GL_ARB_sparse_texture_clamp"); - GLAD_GL_EXT_pixel_transform = has_ext("GL_EXT_pixel_transform"); - GLAD_GL_ARB_conservative_depth = has_ext("GL_ARB_conservative_depth"); - GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); - GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); - GLAD_GL_SUN_triangle_list = has_ext("GL_SUN_triangle_list"); - GLAD_GL_EXT_texture_env_add = has_ext("GL_EXT_texture_env_add"); - GLAD_GL_EXT_packed_depth_stencil = has_ext("GL_EXT_packed_depth_stencil"); - GLAD_GL_EXT_texture_mirror_clamp = has_ext("GL_EXT_texture_mirror_clamp"); - GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); - GLAD_GL_APPLE_float_pixels = has_ext("GL_APPLE_float_pixels"); - GLAD_GL_ARB_transform_feedback_instanced = has_ext("GL_ARB_transform_feedback_instanced"); - GLAD_GL_SGIX_async = has_ext("GL_SGIX_async"); - GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); - GLAD_GL_NV_shader_atomic_float = has_ext("GL_NV_shader_atomic_float"); - GLAD_GL_ARB_shading_language_100 = has_ext("GL_ARB_shading_language_100"); - GLAD_GL_INTEL_performance_query = has_ext("GL_INTEL_performance_query"); - GLAD_GL_ARB_texture_mirror_clamp_to_edge = has_ext("GL_ARB_texture_mirror_clamp_to_edge"); - GLAD_GL_NV_gpu_shader5 = has_ext("GL_NV_gpu_shader5"); - GLAD_GL_NV_bindless_multi_draw_indirect_count = has_ext("GL_NV_bindless_multi_draw_indirect_count"); - GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); - GLAD_GL_ARB_indirect_parameters = has_ext("GL_ARB_indirect_parameters"); - GLAD_GL_NV_half_float = has_ext("GL_NV_half_float"); - GLAD_GL_ARB_ES3_2_compatibility = has_ext("GL_ARB_ES3_2_compatibility"); - GLAD_GL_ATI_texture_mirror_once = has_ext("GL_ATI_texture_mirror_once"); - GLAD_GL_IBM_rasterpos_clip = has_ext("GL_IBM_rasterpos_clip"); - GLAD_GL_SGIX_shadow = has_ext("GL_SGIX_shadow"); - GLAD_GL_EXT_polygon_offset_clamp = has_ext("GL_EXT_polygon_offset_clamp"); - GLAD_GL_NV_deep_texture3D = has_ext("GL_NV_deep_texture3D"); - GLAD_GL_ARB_shader_draw_parameters = has_ext("GL_ARB_shader_draw_parameters"); - GLAD_GL_SGIX_calligraphic_fragment = has_ext("GL_SGIX_calligraphic_fragment"); - GLAD_GL_ARB_shader_bit_encoding = has_ext("GL_ARB_shader_bit_encoding"); - GLAD_GL_EXT_compiled_vertex_array = has_ext("GL_EXT_compiled_vertex_array"); - GLAD_GL_NV_depth_buffer_float = has_ext("GL_NV_depth_buffer_float"); - GLAD_GL_NV_occlusion_query = has_ext("GL_NV_occlusion_query"); - GLAD_GL_APPLE_flush_buffer_range = has_ext("GL_APPLE_flush_buffer_range"); - GLAD_GL_ARB_imaging = has_ext("GL_ARB_imaging"); - GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); - GLAD_GL_AMD_gcn_shader = has_ext("GL_AMD_gcn_shader"); - GLAD_GL_AMD_blend_minmax_factor = has_ext("GL_AMD_blend_minmax_factor"); - GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); - GLAD_GL_ARB_shading_language_420pack = has_ext("GL_ARB_shading_language_420pack"); - GLAD_GL_ARB_shader_viewport_layer_array = has_ext("GL_ARB_shader_viewport_layer_array"); - GLAD_GL_ATI_meminfo = has_ext("GL_ATI_meminfo"); - GLAD_GL_EXT_abgr = has_ext("GL_EXT_abgr"); - GLAD_GL_AMD_pinned_memory = has_ext("GL_AMD_pinned_memory"); - GLAD_GL_EXT_texture_snorm = has_ext("GL_EXT_texture_snorm"); - GLAD_GL_SGIX_texture_coordinate_clamp = has_ext("GL_SGIX_texture_coordinate_clamp"); - GLAD_GL_ARB_clear_buffer_object = has_ext("GL_ARB_clear_buffer_object"); - GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); - GLAD_GL_EXT_debug_label = has_ext("GL_EXT_debug_label"); - GLAD_GL_ARB_sample_shading = has_ext("GL_ARB_sample_shading"); - GLAD_GL_NV_internalformat_sample_query = has_ext("GL_NV_internalformat_sample_query"); - GLAD_GL_INTEL_map_texture = has_ext("GL_INTEL_map_texture"); - GLAD_GL_ARB_texture_env_crossbar = has_ext("GL_ARB_texture_env_crossbar"); - GLAD_GL_EXT_422_pixels = has_ext("GL_EXT_422_pixels"); - GLAD_GL_ARB_compute_shader = has_ext("GL_ARB_compute_shader"); - GLAD_GL_EXT_blend_logic_op = has_ext("GL_EXT_blend_logic_op"); - GLAD_GL_IBM_cull_vertex = has_ext("GL_IBM_cull_vertex"); - GLAD_GL_IBM_vertex_array_lists = has_ext("GL_IBM_vertex_array_lists"); - GLAD_GL_ARB_color_buffer_float = has_ext("GL_ARB_color_buffer_float"); - GLAD_GL_ARB_bindless_texture = has_ext("GL_ARB_bindless_texture"); - GLAD_GL_ARB_window_pos = has_ext("GL_ARB_window_pos"); - GLAD_GL_ARB_internalformat_query = has_ext("GL_ARB_internalformat_query"); - GLAD_GL_ARB_shadow = has_ext("GL_ARB_shadow"); - GLAD_GL_ARB_texture_mirrored_repeat = has_ext("GL_ARB_texture_mirrored_repeat"); - GLAD_GL_EXT_shader_image_load_store = has_ext("GL_EXT_shader_image_load_store"); - GLAD_GL_EXT_copy_texture = has_ext("GL_EXT_copy_texture"); - GLAD_GL_NV_register_combiners2 = has_ext("GL_NV_register_combiners2"); - GLAD_GL_SGIX_ycrcb_subsample = has_ext("GL_SGIX_ycrcb_subsample"); - GLAD_GL_SGIX_ir_instrument1 = has_ext("GL_SGIX_ir_instrument1"); - GLAD_GL_NV_draw_texture = has_ext("GL_NV_draw_texture"); - GLAD_GL_EXT_texture_shared_exponent = has_ext("GL_EXT_texture_shared_exponent"); - GLAD_GL_EXT_draw_instanced = has_ext("GL_EXT_draw_instanced"); - GLAD_GL_NV_copy_depth_to_color = has_ext("GL_NV_copy_depth_to_color"); - GLAD_GL_ARB_viewport_array = has_ext("GL_ARB_viewport_array"); - GLAD_GL_ARB_separate_shader_objects = has_ext("GL_ARB_separate_shader_objects"); - GLAD_GL_EXT_depth_bounds_test = has_ext("GL_EXT_depth_bounds_test"); - GLAD_GL_EXT_shared_texture_palette = has_ext("GL_EXT_shared_texture_palette"); - GLAD_GL_ARB_texture_env_add = has_ext("GL_ARB_texture_env_add"); - GLAD_GL_NV_video_capture = has_ext("GL_NV_video_capture"); - GLAD_GL_ARB_sampler_objects = has_ext("GL_ARB_sampler_objects"); - GLAD_GL_ARB_matrix_palette = has_ext("GL_ARB_matrix_palette"); - GLAD_GL_SGIS_texture_color_mask = has_ext("GL_SGIS_texture_color_mask"); - GLAD_GL_EXT_packed_pixels = has_ext("GL_EXT_packed_pixels"); - GLAD_GL_EXT_coordinate_frame = has_ext("GL_EXT_coordinate_frame"); - GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); - GLAD_GL_APPLE_aux_depth_stencil = has_ext("GL_APPLE_aux_depth_stencil"); - GLAD_GL_ARB_shader_subroutine = has_ext("GL_ARB_shader_subroutine"); - GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); - GLAD_GL_ARB_texture_storage_multisample = has_ext("GL_ARB_texture_storage_multisample"); - GLAD_GL_KHR_blend_equation_advanced_coherent = has_ext("GL_KHR_blend_equation_advanced_coherent"); - GLAD_GL_EXT_vertex_attrib_64bit = has_ext("GL_EXT_vertex_attrib_64bit"); - GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); - GLAD_GL_NV_shader_buffer_store = has_ext("GL_NV_shader_buffer_store"); - GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); - GLAD_GL_MESA_window_pos = has_ext("GL_MESA_window_pos"); - GLAD_GL_NV_fill_rectangle = has_ext("GL_NV_fill_rectangle"); - GLAD_GL_NV_shader_storage_buffer_object = has_ext("GL_NV_shader_storage_buffer_object"); - GLAD_GL_ARB_texture_query_lod = has_ext("GL_ARB_texture_query_lod"); - GLAD_GL_ARB_copy_buffer = has_ext("GL_ARB_copy_buffer"); - GLAD_GL_ARB_shader_image_size = has_ext("GL_ARB_shader_image_size"); - GLAD_GL_NV_shader_atomic_counters = has_ext("GL_NV_shader_atomic_counters"); - GLAD_GL_APPLE_object_purgeable = has_ext("GL_APPLE_object_purgeable"); - GLAD_GL_ARB_occlusion_query = has_ext("GL_ARB_occlusion_query"); - GLAD_GL_INGR_color_clamp = has_ext("GL_INGR_color_clamp"); - GLAD_GL_SGI_color_table = has_ext("GL_SGI_color_table"); - GLAD_GL_NV_gpu_program5_mem_extended = has_ext("GL_NV_gpu_program5_mem_extended"); - GLAD_GL_ARB_texture_cube_map_array = has_ext("GL_ARB_texture_cube_map_array"); - GLAD_GL_SGIX_scalebias_hint = has_ext("GL_SGIX_scalebias_hint"); - GLAD_GL_EXT_gpu_shader4 = has_ext("GL_EXT_gpu_shader4"); - GLAD_GL_NV_geometry_program4 = has_ext("GL_NV_geometry_program4"); - GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); - GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); - GLAD_GL_ARB_texture_border_clamp = has_ext("GL_ARB_texture_border_clamp"); - GLAD_GL_ARB_fragment_coord_conventions = has_ext("GL_ARB_fragment_coord_conventions"); - GLAD_GL_ARB_multitexture = has_ext("GL_ARB_multitexture"); - GLAD_GL_SGIX_polynomial_ffd = has_ext("GL_SGIX_polynomial_ffd"); - GLAD_GL_EXT_provoking_vertex = has_ext("GL_EXT_provoking_vertex"); - GLAD_GL_ARB_point_parameters = has_ext("GL_ARB_point_parameters"); - GLAD_GL_ARB_shader_image_load_store = has_ext("GL_ARB_shader_image_load_store"); - GLAD_GL_ARB_conditional_render_inverted = has_ext("GL_ARB_conditional_render_inverted"); - GLAD_GL_HP_occlusion_test = has_ext("GL_HP_occlusion_test"); - GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); - GLAD_GL_ARB_texture_barrier = has_ext("GL_ARB_texture_barrier"); - GLAD_GL_ARB_texture_buffer_object_rgb32 = has_ext("GL_ARB_texture_buffer_object_rgb32"); - GLAD_GL_NV_bindless_multi_draw_indirect = has_ext("GL_NV_bindless_multi_draw_indirect"); - GLAD_GL_SGIX_texture_multi_buffer = has_ext("GL_SGIX_texture_multi_buffer"); - GLAD_GL_EXT_transform_feedback = has_ext("GL_EXT_transform_feedback"); - GLAD_GL_KHR_texture_compression_astc_ldr = has_ext("GL_KHR_texture_compression_astc_ldr"); - GLAD_GL_3DFX_multisample = has_ext("GL_3DFX_multisample"); - GLAD_GL_INTEL_fragment_shader_ordering = has_ext("GL_INTEL_fragment_shader_ordering"); - GLAD_GL_ARB_texture_env_dot3 = has_ext("GL_ARB_texture_env_dot3"); - GLAD_GL_NV_gpu_program4 = has_ext("GL_NV_gpu_program4"); - GLAD_GL_NV_gpu_program5 = has_ext("GL_NV_gpu_program5"); - GLAD_GL_NV_float_buffer = has_ext("GL_NV_float_buffer"); - GLAD_GL_SGIS_texture_edge_clamp = has_ext("GL_SGIS_texture_edge_clamp"); - GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); - GLAD_GL_SUN_slice_accum = has_ext("GL_SUN_slice_accum"); - GLAD_GL_EXT_index_texture = has_ext("GL_EXT_index_texture"); - GLAD_GL_EXT_shader_image_load_formatted = has_ext("GL_EXT_shader_image_load_formatted"); - GLAD_GL_ARB_geometry_shader4 = has_ext("GL_ARB_geometry_shader4"); - GLAD_GL_EXT_separate_specular_color = has_ext("GL_EXT_separate_specular_color"); - GLAD_GL_AMD_depth_clamp_separate = has_ext("GL_AMD_depth_clamp_separate"); - GLAD_GL_NV_conservative_raster = has_ext("GL_NV_conservative_raster"); - GLAD_GL_ARB_sparse_texture2 = has_ext("GL_ARB_sparse_texture2"); - GLAD_GL_SGIX_sprite = has_ext("GL_SGIX_sprite"); - GLAD_GL_ARB_get_program_binary = has_ext("GL_ARB_get_program_binary"); - GLAD_GL_AMD_occlusion_query_event = has_ext("GL_AMD_occlusion_query_event"); - GLAD_GL_SGIS_multisample = has_ext("GL_SGIS_multisample"); - GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); - GLAD_GL_ARB_robustness_isolation = has_ext("GL_ARB_robustness_isolation"); - GLAD_GL_ARB_vertex_array_bgra = has_ext("GL_ARB_vertex_array_bgra"); - GLAD_GL_APPLE_vertex_array_range = has_ext("GL_APPLE_vertex_array_range"); - GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); - GLAD_GL_NV_register_combiners = has_ext("GL_NV_register_combiners"); - GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); - GLAD_GL_ARB_clear_texture = has_ext("GL_ARB_clear_texture"); - GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); - GLAD_GL_SGI_color_matrix = has_ext("GL_SGI_color_matrix"); - GLAD_GL_EXT_cull_vertex = has_ext("GL_EXT_cull_vertex"); - GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); - GLAD_GL_APPLE_row_bytes = has_ext("GL_APPLE_row_bytes"); - GLAD_GL_NV_texgen_reflection = has_ext("GL_NV_texgen_reflection"); - GLAD_GL_IBM_multimode_draw_arrays = has_ext("GL_IBM_multimode_draw_arrays"); - GLAD_GL_APPLE_vertex_array_object = has_ext("GL_APPLE_vertex_array_object"); - GLAD_GL_3DFX_texture_compression_FXT1 = has_ext("GL_3DFX_texture_compression_FXT1"); - GLAD_GL_NV_fragment_shader_interlock = has_ext("GL_NV_fragment_shader_interlock"); - GLAD_GL_AMD_conservative_depth = has_ext("GL_AMD_conservative_depth"); - GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); - GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); - GLAD_GL_SGIS_detail_texture = has_ext("GL_SGIS_detail_texture"); - GLAD_GL_ARB_draw_instanced = has_ext("GL_ARB_draw_instanced"); - GLAD_GL_OES_read_format = has_ext("GL_OES_read_format"); - GLAD_GL_ATI_texture_float = has_ext("GL_ATI_texture_float"); - GLAD_GL_ARB_texture_gather = has_ext("GL_ARB_texture_gather"); - GLAD_GL_AMD_vertex_shader_layer = has_ext("GL_AMD_vertex_shader_layer"); - GLAD_GL_ARB_shading_language_include = has_ext("GL_ARB_shading_language_include"); - GLAD_GL_APPLE_client_storage = has_ext("GL_APPLE_client_storage"); - GLAD_GL_WIN_phong_shading = has_ext("GL_WIN_phong_shading"); - GLAD_GL_INGR_blend_func_separate = has_ext("GL_INGR_blend_func_separate"); - GLAD_GL_NV_path_rendering = has_ext("GL_NV_path_rendering"); - GLAD_GL_NV_conservative_raster_dilate = has_ext("GL_NV_conservative_raster_dilate"); - GLAD_GL_ATI_vertex_streams = has_ext("GL_ATI_vertex_streams"); - GLAD_GL_ARB_post_depth_coverage = has_ext("GL_ARB_post_depth_coverage"); - GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); - GLAD_GL_APPLE_rgb_422 = has_ext("GL_APPLE_rgb_422"); - GLAD_GL_EXT_texture_lod_bias = has_ext("GL_EXT_texture_lod_bias"); - GLAD_GL_ARB_gpu_shader_int64 = has_ext("GL_ARB_gpu_shader_int64"); - GLAD_GL_ARB_seamless_cube_map = has_ext("GL_ARB_seamless_cube_map"); - GLAD_GL_ARB_shader_group_vote = has_ext("GL_ARB_shader_group_vote"); - GLAD_GL_NV_vdpau_interop = has_ext("GL_NV_vdpau_interop"); - GLAD_GL_ARB_occlusion_query2 = has_ext("GL_ARB_occlusion_query2"); - GLAD_GL_ARB_internalformat_query2 = has_ext("GL_ARB_internalformat_query2"); - GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); - GLAD_GL_SUN_vertex = has_ext("GL_SUN_vertex"); - GLAD_GL_SGIX_igloo_interface = has_ext("GL_SGIX_igloo_interface"); - GLAD_GL_SGIS_texture_lod = has_ext("GL_SGIS_texture_lod"); - GLAD_GL_NV_vertex_program3 = has_ext("GL_NV_vertex_program3"); - GLAD_GL_ARB_draw_indirect = has_ext("GL_ARB_draw_indirect"); - GLAD_GL_NV_vertex_program4 = has_ext("GL_NV_vertex_program4"); - GLAD_GL_AMD_transform_feedback3_lines_triangles = has_ext("GL_AMD_transform_feedback3_lines_triangles"); - GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); - GLAD_GL_EXT_x11_sync_object = has_ext("GL_EXT_x11_sync_object"); - GLAD_GL_ARB_sync = has_ext("GL_ARB_sync"); - GLAD_GL_NV_sample_locations = has_ext("GL_NV_sample_locations"); - GLAD_GL_ARB_compute_variable_group_size = has_ext("GL_ARB_compute_variable_group_size"); - GLAD_GL_OES_fixed_point = has_ext("GL_OES_fixed_point"); - GLAD_GL_NV_blend_square = has_ext("GL_NV_blend_square"); - GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); - GLAD_GL_ARB_gpu_shader5 = has_ext("GL_ARB_gpu_shader5"); - GLAD_GL_SGIS_texture4D = has_ext("GL_SGIS_texture4D"); - GLAD_GL_EXT_texture3D = has_ext("GL_EXT_texture3D"); - GLAD_GL_EXT_multisample = has_ext("GL_EXT_multisample"); - GLAD_GL_EXT_secondary_color = has_ext("GL_EXT_secondary_color"); - GLAD_GL_ARB_texture_filter_minmax = has_ext("GL_ARB_texture_filter_minmax"); - GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); - GLAD_GL_ARB_parallel_shader_compile = has_ext("GL_ARB_parallel_shader_compile"); - GLAD_GL_NVX_gpu_memory_info = has_ext("GL_NVX_gpu_memory_info"); - GLAD_GL_ARB_sparse_texture = has_ext("GL_ARB_sparse_texture"); - GLAD_GL_SGIS_point_line_texgen = has_ext("GL_SGIS_point_line_texgen"); - GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); - GLAD_GL_ARB_sparse_buffer = has_ext("GL_ARB_sparse_buffer"); - GLAD_GL_EXT_draw_range_elements = has_ext("GL_EXT_draw_range_elements"); - GLAD_GL_SGIX_blend_alpha_minmax = has_ext("GL_SGIX_blend_alpha_minmax"); - GLAD_GL_KHR_context_flush_control = has_ext("GL_KHR_context_flush_control"); - free_exts(); - return 1; -} - -static void find_coreGL(void) { - - /* Thank you @elmindreda - * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 - * https://github.com/glfw/glfw/blob/master/src/context.c#L36 - */ - int i, major, minor; - - const char* version; - const char* prefixes[] = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - NULL - }; - - version = (const char*) glGetString(GL_VERSION); - if (!version) return; - - for (i = 0; prefixes[i]; i++) { - const size_t length = strlen(prefixes[i]); - if (strncmp(version, prefixes[i], length) == 0) { - version += length; - break; - } - } - -/* PR #18 */ -#ifdef _MSC_VER - sscanf_s(version, "%d.%d", &major, &minor); -#else - sscanf(version, "%d.%d", &major, &minor); -#endif - - GLVersion.major = major; GLVersion.minor = minor; - max_loaded_major = major; max_loaded_minor = minor; - GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; - GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; - GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; - GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; - GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; - GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; - GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; - GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; - GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; - if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { - max_loaded_major = 3; - max_loaded_minor = 3; - } -} - -int gladLoadGLLoader(GLADloadproc load) { - GLVersion.major = 0; GLVersion.minor = 0; - glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - if(glGetString == NULL) return 0; - if(glGetString(GL_VERSION) == NULL) return 0; - find_coreGL(); - load_GL_VERSION_1_0(load); - load_GL_VERSION_1_1(load); - load_GL_VERSION_1_2(load); - load_GL_VERSION_1_3(load); - load_GL_VERSION_1_4(load); - load_GL_VERSION_1_5(load); - load_GL_VERSION_2_0(load); - load_GL_VERSION_2_1(load); - load_GL_VERSION_3_0(load); - load_GL_VERSION_3_1(load); - load_GL_VERSION_3_2(load); - load_GL_VERSION_3_3(load); - - if (!find_extensionsGL()) return 0; - load_GL_APPLE_element_array(load); - load_GL_AMD_multi_draw_indirect(load); - load_GL_SGIX_tag_sample_buffer(load); - load_GL_NV_point_sprite(load); - load_GL_ATI_separate_stencil(load); - load_GL_EXT_texture_buffer_object(load); - load_GL_ARB_vertex_blend(load); - load_GL_OVR_multiview(load); - load_GL_ARB_program_interface_query(load); - load_GL_EXT_index_func(load); - load_GL_NV_shader_buffer_load(load); - load_GL_EXT_color_subtable(load); - load_GL_SUNX_constant_data(load); - load_GL_EXT_multi_draw_arrays(load); - load_GL_ARB_shader_atomic_counters(load); - load_GL_NV_conditional_render(load); - load_GL_MESA_resize_buffers(load); - load_GL_ARB_texture_view(load); - load_GL_ARB_map_buffer_range(load); - load_GL_EXT_convolution(load); - load_GL_NV_vertex_attrib_integer_64bit(load); - load_GL_EXT_paletted_texture(load); - load_GL_ARB_texture_buffer_object(load); - load_GL_ATI_pn_triangles(load); - load_GL_SGIX_flush_raster(load); - load_GL_EXT_light_texture(load); - load_GL_HP_image_transform(load); - load_GL_AMD_draw_buffers_blend(load); - load_GL_APPLE_texture_range(load); - load_GL_EXT_texture_array(load); - load_GL_NV_texture_barrier(load); - load_GL_ARB_vertex_type_2_10_10_10_rev(load); - load_GL_3DFX_tbuffer(load); - load_GL_GREMEDY_frame_terminator(load); - load_GL_ARB_blend_func_extended(load); - load_GL_EXT_separate_shader_objects(load); - load_GL_NV_texture_multisample(load); - load_GL_ARB_shader_objects(load); - load_GL_ARB_framebuffer_object(load); - load_GL_ATI_envmap_bumpmap(load); - load_GL_ATI_map_object_buffer(load); - load_GL_ARB_robustness(load); - load_GL_NV_pixel_data_range(load); - load_GL_EXT_framebuffer_blit(load); - load_GL_ARB_gpu_shader_fp64(load); - load_GL_NV_command_list(load); - load_GL_EXT_vertex_weighting(load); - load_GL_GREMEDY_string_marker(load); - load_GL_EXT_subtexture(load); - load_GL_EXT_gpu_program_parameters(load); - load_GL_NV_evaluators(load); - load_GL_SGIS_texture_filter4(load); - load_GL_AMD_performance_monitor(load); - load_GL_EXT_stencil_clear_tag(load); - load_GL_NV_present_video(load); - load_GL_SGIX_framezoom(load); - load_GL_ARB_draw_elements_base_vertex(load); - load_GL_NV_transform_feedback(load); - load_GL_NV_fragment_program(load); - load_GL_AMD_stencil_operation_extended(load); - load_GL_ARB_instanced_arrays(load); - load_GL_EXT_polygon_offset(load); - load_GL_KHR_robustness(load); - load_GL_AMD_sparse_texture(load); - load_GL_ARB_clip_control(load); - load_GL_NV_fragment_coverage_to_color(load); - load_GL_NV_fence(load); - load_GL_ARB_texture_buffer_range(load); - load_GL_SUN_mesh_array(load); - load_GL_ARB_vertex_attrib_binding(load); - load_GL_ARB_framebuffer_no_attachments(load); - load_GL_ARB_cl_event(load); - load_GL_OES_single_precision(load); - load_GL_NV_primitive_restart(load); - load_GL_SUN_global_alpha(load); - load_GL_EXT_texture_object(load); - load_GL_AMD_name_gen_delete(load); - load_GL_ARB_buffer_storage(load); - load_GL_APPLE_vertex_program_evaluators(load); - load_GL_ARB_multi_bind(load); - load_GL_SGIX_list_priority(load); - load_GL_NV_vertex_buffer_unified_memory(load); - load_GL_NV_blend_equation_advanced(load); - load_GL_SGIS_sharpen_texture(load); - load_GL_ARB_vertex_program(load); - load_GL_ARB_vertex_buffer_object(load); - load_GL_NV_vertex_array_range(load); - load_GL_SGIX_fragment_lighting(load); - load_GL_NV_framebuffer_multisample_coverage(load); - load_GL_EXT_timer_query(load); - load_GL_NV_bindless_texture(load); - load_GL_KHR_debug(load); - load_GL_ATI_vertex_attrib_array_object(load); - load_GL_EXT_geometry_shader4(load); - load_GL_EXT_bindable_uniform(load); - load_GL_KHR_blend_equation_advanced(load); - load_GL_ATI_element_array(load); - load_GL_SGIX_reference_plane(load); - load_GL_EXT_stencil_two_side(load); - load_GL_NV_explicit_multisample(load); - load_GL_IBM_static_data(load); - load_GL_EXT_texture_perturb_normal(load); - load_GL_EXT_point_parameters(load); - load_GL_PGI_misc_hints(load); - load_GL_ARB_vertex_shader(load); - load_GL_ARB_tessellation_shader(load); - load_GL_EXT_draw_buffers2(load); - load_GL_ARB_vertex_attrib_64bit(load); - load_GL_EXT_texture_filter_minmax(load); - load_GL_AMD_interleaved_elements(load); - load_GL_ARB_fragment_program(load); - load_GL_ARB_texture_storage(load); - load_GL_ARB_copy_image(load); - load_GL_SGIS_pixel_texture(load); - load_GL_SGIX_instruments(load); - load_GL_ARB_shader_storage_buffer_object(load); - load_GL_EXT_blend_minmax(load); - load_GL_ARB_base_instance(load); - load_GL_ARB_ES3_1_compatibility(load); - load_GL_EXT_texture_integer(load); - load_GL_ARB_texture_multisample(load); - load_GL_AMD_gpu_shader_int64(load); - load_GL_AMD_vertex_shader_tessellator(load); - load_GL_ARB_invalidate_subdata(load); - load_GL_EXT_index_material(load); - load_GL_INTEL_parallel_arrays(load); - load_GL_ATI_draw_buffers(load); - load_GL_SGIX_pixel_texture(load); - load_GL_ARB_timer_query(load); - load_GL_NV_parameter_buffer_object(load); - load_GL_ARB_direct_state_access(load); - load_GL_ARB_uniform_buffer_object(load); - load_GL_NV_transform_feedback2(load); - load_GL_EXT_blend_color(load); - load_GL_EXT_histogram(load); - load_GL_ARB_get_texture_sub_image(load); - load_GL_SGIS_point_parameters(load); - load_GL_EXT_direct_state_access(load); - load_GL_AMD_sample_positions(load); - load_GL_NV_vertex_program(load); - load_GL_EXT_vertex_shader(load); - load_GL_EXT_blend_func_separate(load); - load_GL_APPLE_fence(load); - load_GL_OES_byte_coordinates(load); - load_GL_ARB_transpose_matrix(load); - load_GL_ARB_provoking_vertex(load); - load_GL_EXT_fog_coord(load); - load_GL_EXT_vertex_array(load); - load_GL_EXT_blend_equation_separate(load); - load_GL_NV_framebuffer_mixed_samples(load); - load_GL_NVX_conditional_render(load); - load_GL_ARB_multi_draw_indirect(load); - load_GL_EXT_raster_multisample(load); - load_GL_NV_copy_image(load); - load_GL_INTEL_framebuffer_CMAA(load); - load_GL_ARB_transform_feedback2(load); - load_GL_ARB_transform_feedback3(load); - load_GL_EXT_debug_marker(load); - load_GL_EXT_pixel_transform(load); - load_GL_ATI_fragment_shader(load); - load_GL_ARB_vertex_array_object(load); - load_GL_SUN_triangle_list(load); - load_GL_ARB_transform_feedback_instanced(load); - load_GL_SGIX_async(load); - load_GL_INTEL_performance_query(load); - load_GL_NV_gpu_shader5(load); - load_GL_NV_bindless_multi_draw_indirect_count(load); - load_GL_ARB_ES2_compatibility(load); - load_GL_ARB_indirect_parameters(load); - load_GL_NV_half_float(load); - load_GL_ARB_ES3_2_compatibility(load); - load_GL_EXT_polygon_offset_clamp(load); - load_GL_EXT_compiled_vertex_array(load); - load_GL_NV_depth_buffer_float(load); - load_GL_NV_occlusion_query(load); - load_GL_APPLE_flush_buffer_range(load); - load_GL_ARB_imaging(load); - load_GL_ARB_draw_buffers_blend(load); - load_GL_ARB_clear_buffer_object(load); - load_GL_ARB_multisample(load); - load_GL_EXT_debug_label(load); - load_GL_ARB_sample_shading(load); - load_GL_NV_internalformat_sample_query(load); - load_GL_INTEL_map_texture(load); - load_GL_ARB_compute_shader(load); - load_GL_IBM_vertex_array_lists(load); - load_GL_ARB_color_buffer_float(load); - load_GL_ARB_bindless_texture(load); - load_GL_ARB_window_pos(load); - load_GL_ARB_internalformat_query(load); - load_GL_EXT_shader_image_load_store(load); - load_GL_EXT_copy_texture(load); - load_GL_NV_register_combiners2(load); - load_GL_NV_draw_texture(load); - load_GL_EXT_draw_instanced(load); - load_GL_ARB_viewport_array(load); - load_GL_ARB_separate_shader_objects(load); - load_GL_EXT_depth_bounds_test(load); - load_GL_NV_video_capture(load); - load_GL_ARB_sampler_objects(load); - load_GL_ARB_matrix_palette(load); - load_GL_SGIS_texture_color_mask(load); - load_GL_EXT_coordinate_frame(load); - load_GL_ARB_texture_compression(load); - load_GL_ARB_shader_subroutine(load); - load_GL_ARB_texture_storage_multisample(load); - load_GL_EXT_vertex_attrib_64bit(load); - load_GL_OES_query_matrix(load); - load_GL_MESA_window_pos(load); - load_GL_ARB_copy_buffer(load); - load_GL_APPLE_object_purgeable(load); - load_GL_ARB_occlusion_query(load); - load_GL_SGI_color_table(load); - load_GL_EXT_gpu_shader4(load); - load_GL_NV_geometry_program4(load); - load_GL_AMD_debug_output(load); - load_GL_ARB_multitexture(load); - load_GL_SGIX_polynomial_ffd(load); - load_GL_EXT_provoking_vertex(load); - load_GL_ARB_point_parameters(load); - load_GL_ARB_shader_image_load_store(load); - load_GL_ARB_texture_barrier(load); - load_GL_NV_bindless_multi_draw_indirect(load); - load_GL_EXT_transform_feedback(load); - load_GL_NV_gpu_program4(load); - load_GL_NV_gpu_program5(load); - load_GL_ARB_geometry_shader4(load); - load_GL_NV_conservative_raster(load); - load_GL_SGIX_sprite(load); - load_GL_ARB_get_program_binary(load); - load_GL_AMD_occlusion_query_event(load); - load_GL_SGIS_multisample(load); - load_GL_EXT_framebuffer_object(load); - load_GL_APPLE_vertex_array_range(load); - load_GL_NV_register_combiners(load); - load_GL_ARB_draw_buffers(load); - load_GL_ARB_clear_texture(load); - load_GL_ARB_debug_output(load); - load_GL_EXT_cull_vertex(load); - load_GL_IBM_multimode_draw_arrays(load); - load_GL_APPLE_vertex_array_object(load); - load_GL_SGIS_detail_texture(load); - load_GL_ARB_draw_instanced(load); - load_GL_ARB_shading_language_include(load); - load_GL_INGR_blend_func_separate(load); - load_GL_NV_path_rendering(load); - load_GL_NV_conservative_raster_dilate(load); - load_GL_ATI_vertex_streams(load); - load_GL_ARB_gpu_shader_int64(load); - load_GL_NV_vdpau_interop(load); - load_GL_ARB_internalformat_query2(load); - load_GL_SUN_vertex(load); - load_GL_SGIX_igloo_interface(load); - load_GL_ARB_draw_indirect(load); - load_GL_NV_vertex_program4(load); - load_GL_SGIS_fog_function(load); - load_GL_EXT_x11_sync_object(load); - load_GL_ARB_sync(load); - load_GL_NV_sample_locations(load); - load_GL_ARB_compute_variable_group_size(load); - load_GL_OES_fixed_point(load); - load_GL_EXT_framebuffer_multisample(load); - load_GL_SGIS_texture4D(load); - load_GL_EXT_texture3D(load); - load_GL_EXT_multisample(load); - load_GL_EXT_secondary_color(load); - load_GL_ATI_vertex_array_object(load); - load_GL_ARB_parallel_shader_compile(load); - load_GL_ARB_sparse_texture(load); - load_GL_ARB_sample_locations(load); - load_GL_ARB_sparse_buffer(load); - load_GL_EXT_draw_range_elements(load); - return GLVersion.major != 0 || GLVersion.minor != 0; -} - diff --git a/src/external/glad.h b/src/external/glad.h index 56bb622d..db1516f8 100644 --- a/src/external/glad.h +++ b/src/external/glad.h @@ -16,6 +16,10 @@ Too many extensions */ +////////////////////////////////////////////////////////////////////////////// +// +// INCLUDE SECTION +// #ifndef __glad_h_ #define __glad_h_ @@ -14239,3 +14243,7677 @@ GLAPI int GLAD_GL_KHR_context_flush_control; #endif #endif + +////////////////////////////////////////////////////////////////////////////// +// +// IMPLEMENTATION SECTION +// + +#ifdef GLAD_IMPLEMENTATION + +#include +#include +#include + +struct gladGLversionStruct GLVersion; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static const char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < num_exts_i; index++) { + exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + free(exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_1_0; +int GLAD_GL_VERSION_1_1; +int GLAD_GL_VERSION_1_2; +int GLAD_GL_VERSION_1_3; +int GLAD_GL_VERSION_1_4; +int GLAD_GL_VERSION_1_5; +int GLAD_GL_VERSION_2_0; +int GLAD_GL_VERSION_2_1; +int GLAD_GL_VERSION_3_0; +int GLAD_GL_VERSION_3_1; +int GLAD_GL_VERSION_3_2; +int GLAD_GL_VERSION_3_3; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +PFNGLBINDSAMPLERPROC glad_glBindSampler; +PFNGLLINEWIDTHPROC glad_glLineWidth; +PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +PFNGLCOMPILESHADERPROC glad_glCompileShader; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +PFNGLENABLEIPROC glad_glEnablei; +PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +PFNGLCREATESHADERPROC glad_glCreateShader; +PFNGLISBUFFERPROC glad_glIsBuffer; +PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +PFNGLHINTPROC glad_glHint; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +PFNGLPOINTSIZEPROC glad_glPointSize; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +PFNGLWAITSYNCPROC glad_glWaitSync; +PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +PFNGLUNIFORM3IPROC glad_glUniform3i; +PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +PFNGLUNIFORM3FPROC glad_glUniform3f; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +PFNGLCOLORMASKIPROC glad_glColorMaski; +PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +PFNGLDRAWARRAYSPROC glad_glDrawArrays; +PFNGLUNIFORM1UIPROC glad_glUniform1ui; +PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +PFNGLCLEARPROC glad_glClear; +PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +PFNGLISENABLEDPROC glad_glIsEnabled; +PFNGLSTENCILOPPROC glad_glStencilOp; +PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +PFNGLGETQUERYIVPROC glad_glGetQueryiv; +PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +PFNGLISSHADERPROC glad_glIsShader; +PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +PFNGLENABLEPROC glad_glEnable; +PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +PFNGLFLUSHPROC glad_glFlush; +PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +PFNGLFENCESYNCPROC glad_glFenceSync; +PFNGLCOLORP3UIPROC glad_glColorP3ui; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +PFNGLGENSAMPLERSPROC glad_glGenSamplers; +PFNGLCLAMPCOLORPROC glad_glClampColor; +PFNGLUNIFORM4IVPROC glad_glUniform4iv; +PFNGLCLEARSTENCILPROC glad_glClearStencil; +PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +PFNGLGENTEXTURESPROC glad_glGenTextures; +PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +PFNGLISSYNCPROC glad_glIsSync; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +PFNGLUNIFORM2IPROC glad_glUniform2i; +PFNGLUNIFORM2FPROC glad_glUniform2f; +PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +PFNGLGENQUERIESPROC glad_glGenQueries; +PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +PFNGLISENABLEDIPROC glad_glIsEnabledi; +PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +PFNGLUNIFORM2IVPROC glad_glUniform2iv; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +PFNGLGETSHADERIVPROC glad_glGetShaderiv; +PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +PFNGLGETDOUBLEVPROC glad_glGetDoublev; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +PFNGLUNIFORM3FVPROC glad_glUniform3fv; +PFNGLDEPTHRANGEPROC glad_glDepthRange; +PFNGLMAPBUFFERPROC glad_glMapBuffer; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +PFNGLDELETESYNCPROC glad_glDeleteSync; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +PFNGLUNIFORM3IVPROC glad_glUniform3iv; +PFNGLPOLYGONMODEPROC glad_glPolygonMode; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +PFNGLUSEPROGRAMPROC glad_glUseProgram; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +PFNGLFINISHPROC glad_glFinish; +PFNGLDELETESHADERPROC glad_glDeleteShader; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +PFNGLVIEWPORTPROC glad_glViewport; +PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +PFNGLUNIFORM2UIPROC glad_glUniform2ui; +PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +PFNGLCLEARDEPTHPROC glad_glClearDepth; +PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +PFNGLTEXBUFFERPROC glad_glTexBuffer; +PFNGLPIXELSTOREIPROC glad_glPixelStorei; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +PFNGLPIXELSTOREFPROC glad_glPixelStoref; +PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +PFNGLLINKPROGRAMPROC glad_glLinkProgram; +PFNGLBINDTEXTUREPROC glad_glBindTexture; +PFNGLGETSTRINGPROC glad_glGetString; +PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +PFNGLDETACHSHADERPROC glad_glDetachShader; +PFNGLENDQUERYPROC glad_glEndQuery; +PFNGLNORMALP3UIPROC glad_glNormalP3ui; +PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +PFNGLUNIFORM1FPROC glad_glUniform1f; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +PFNGLUNIFORM1IPROC glad_glUniform1i; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +PFNGLDISABLEPROC glad_glDisable; +PFNGLLOGICOPPROC glad_glLogicOp; +PFNGLUNIFORM4UIPROC glad_glUniform4ui; +PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +PFNGLCULLFACEPROC glad_glCullFace; +PFNGLGETSTRINGIPROC glad_glGetStringi; +PFNGLATTACHSHADERPROC glad_glAttachShader; +PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +PFNGLDRAWELEMENTSPROC glad_glDrawElements; +PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +PFNGLUNIFORM1IVPROC glad_glUniform1iv; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +PFNGLREADBUFFERPROC glad_glReadBuffer; +PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +PFNGLBLENDCOLORPROC glad_glBlendColor; +PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +PFNGLISPROGRAMPROC glad_glIsProgram; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +PFNGLUNIFORM4IPROC glad_glUniform4i; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +PFNGLREADPIXELSPROC glad_glReadPixels; +PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +PFNGLUNIFORM4FPROC glad_glUniform4f; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +PFNGLSTENCILFUNCPROC glad_glStencilFunc; +PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +PFNGLCOLORP4UIPROC glad_glColorP4ui; +PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +PFNGLGENBUFFERSPROC glad_glGenBuffers; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +PFNGLBLENDFUNCPROC glad_glBlendFunc; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +PFNGLSCISSORPROC glad_glScissor; +PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +PFNGLCLEARCOLORPROC glad_glClearColor; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +PFNGLUNIFORM3UIPROC glad_glUniform3ui; +PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +PFNGLUNIFORM2FVPROC glad_glUniform2fv; +PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +PFNGLDEPTHFUNCPROC glad_glDepthFunc; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +PFNGLCOLORMASKPROC glad_glColorMask; +PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +PFNGLUNIFORM4FVPROC glad_glUniform4fv; +PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +PFNGLISSAMPLERPROC glad_glIsSampler; +PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +PFNGLDISABLEIPROC glad_glDisablei; +PFNGLSHADERSOURCEPROC glad_glShaderSource; +PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +PFNGLGETSYNCIVPROC glad_glGetSynciv; +PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +PFNGLBEGINQUERYPROC glad_glBeginQuery; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +PFNGLBINDBUFFERPROC glad_glBindBuffer; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +PFNGLBUFFERDATAPROC glad_glBufferData; +PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +PFNGLGETERRORPROC glad_glGetError; +PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +PFNGLGETFLOATVPROC glad_glGetFloatv; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +PFNGLGETINTEGERVPROC glad_glGetIntegerv; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +PFNGLISQUERYPROC glad_glIsQuery; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +PFNGLSTENCILMASKPROC glad_glStencilMask; +PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +PFNGLISTEXTUREPROC glad_glIsTexture; +PFNGLUNIFORM1FVPROC glad_glUniform1fv; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +PFNGLDEPTHMASKPROC glad_glDepthMask; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +PFNGLFRONTFACEPROC glad_glFrontFace; +int GLAD_GL_SGIX_pixel_tiles; +int GLAD_GL_NV_point_sprite; +int GLAD_GL_APPLE_element_array; +int GLAD_GL_AMD_multi_draw_indirect; +int GLAD_GL_EXT_blend_subtract; +int GLAD_GL_SGIX_tag_sample_buffer; +int GLAD_GL_IBM_texture_mirrored_repeat; +int GLAD_GL_APPLE_transform_hint; +int GLAD_GL_ATI_separate_stencil; +int GLAD_GL_NV_shader_atomic_int64; +int GLAD_GL_NV_vertex_program2_option; +int GLAD_GL_EXT_texture_buffer_object; +int GLAD_GL_ARB_vertex_blend; +int GLAD_GL_OVR_multiview; +int GLAD_GL_ARB_program_interface_query; +int GLAD_GL_EXT_misc_attribute; +int GLAD_GL_NV_multisample_coverage; +int GLAD_GL_ARB_shading_language_packing; +int GLAD_GL_EXT_texture_cube_map; +int GLAD_GL_NV_viewport_array2; +int GLAD_GL_KHR_robustness; +int GLAD_GL_EXT_index_func; +int GLAD_GL_OES_compressed_paletted_texture; +int GLAD_GL_NV_depth_clamp; +int GLAD_GL_NV_shader_buffer_load; +int GLAD_GL_EXT_color_subtable; +int GLAD_GL_SUNX_constant_data; +int GLAD_GL_EXT_multi_draw_arrays; +int GLAD_GL_ARB_shader_atomic_counters; +int GLAD_GL_ARB_arrays_of_arrays; +int GLAD_GL_NV_conditional_render; +int GLAD_GL_EXT_texture_env_combine; +int GLAD_GL_AMD_depth_clamp_separate; +int GLAD_GL_SGIX_async_histogram; +int GLAD_GL_MESA_resize_buffers; +int GLAD_GL_ARB_sample_shading; +int GLAD_GL_NV_texture_env_combine4; +int GLAD_GL_ARB_texture_view; +int GLAD_GL_ARB_texture_env_combine; +int GLAD_GL_ARB_map_buffer_range; +int GLAD_GL_EXT_convolution; +int GLAD_GL_NV_compute_program5; +int GLAD_GL_EXT_paletted_texture; +int GLAD_GL_ARB_texture_buffer_object; +int GLAD_GL_SUN_triangle_list; +int GLAD_GL_SGIX_resample; +int GLAD_GL_SGIX_flush_raster; +int GLAD_GL_EXT_light_texture; +int GLAD_GL_ARB_point_sprite; +int GLAD_GL_ARB_sparse_texture2; +int GLAD_GL_ARB_half_float_pixel; +int GLAD_GL_NV_tessellation_program5; +int GLAD_GL_REND_screen_coordinates; +int GLAD_GL_HP_image_transform; +int GLAD_GL_EXT_packed_float; +int GLAD_GL_ATI_vertex_attrib_array_object; +int GLAD_GL_SGIX_vertex_preclip; +int GLAD_GL_SGIX_texture_scale_bias; +int GLAD_GL_AMD_draw_buffers_blend; +int GLAD_GL_APPLE_texture_range; +int GLAD_GL_SGIX_framezoom; +int GLAD_GL_NV_texture_barrier; +int GLAD_GL_ARB_texture_query_levels; +int GLAD_GL_EXT_blend_logic_op; +int GLAD_GL_EXT_texture_swizzle; +int GLAD_GL_ARB_texture_rg; +int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; +int GLAD_GL_ARB_fragment_shader; +int GLAD_GL_3DFX_tbuffer; +int GLAD_GL_SGIX_ycrcb; +int GLAD_GL_IBM_cull_vertex; +int GLAD_GL_EXT_separate_shader_objects; +int GLAD_GL_NV_texture_multisample; +int GLAD_GL_ARB_shader_objects; +int GLAD_GL_ARB_framebuffer_object; +int GLAD_GL_ATI_envmap_bumpmap; +int GLAD_GL_ARB_robust_buffer_access_behavior; +int GLAD_GL_ARB_shader_stencil_export; +int GLAD_GL_AMD_sample_positions; +int GLAD_GL_ARB_enhanced_layouts; +int GLAD_GL_ARB_texture_rectangle; +int GLAD_GL_SGI_texture_color_table; +int GLAD_GL_ATI_map_object_buffer; +int GLAD_GL_ARB_robustness; +int GLAD_GL_NV_pixel_data_range; +int GLAD_GL_EXT_framebuffer_blit; +int GLAD_GL_ARB_gpu_shader_fp64; +int GLAD_GL_NV_command_list; +int GLAD_GL_ARB_window_pos; +int GLAD_GL_ARB_robustness_isolation; +int GLAD_GL_GREMEDY_string_marker; +int GLAD_GL_ARB_texture_compression_bptc; +int GLAD_GL_EXT_subtexture; +int GLAD_GL_EXT_pixel_transform_color_table; +int GLAD_GL_EXT_texture_compression_rgtc; +int GLAD_GL_ARB_shadow; +int GLAD_GL_SGIX_depth_pass_instrument; +int GLAD_GL_NVX_conditional_render; +int GLAD_GL_NV_evaluators; +int GLAD_GL_SGIS_texture_filter4; +int GLAD_GL_AMD_performance_monitor; +int GLAD_GL_NV_geometry_shader4; +int GLAD_GL_EXT_stencil_clear_tag; +int GLAD_GL_NV_vertex_program1_1; +int GLAD_GL_NV_present_video; +int GLAD_GL_ARB_texture_compression_rgtc; +int GLAD_GL_ARB_texture_filter_minmax; +int GLAD_GL_HP_convolution_border_modes; +int GLAD_GL_EXT_gpu_program_parameters; +int GLAD_GL_SGIX_list_priority; +int GLAD_GL_ARB_stencil_texturing; +int GLAD_GL_ARB_shader_clock; +int GLAD_GL_NV_shader_atomic_fp16_vector; +int GLAD_GL_SGIX_fog_offset; +int GLAD_GL_ARB_draw_elements_base_vertex; +int GLAD_GL_INGR_interlace_read; +int GLAD_GL_NV_transform_feedback; +int GLAD_GL_EXT_post_depth_coverage; +int GLAD_GL_ARB_debug_output; +int GLAD_GL_AMD_stencil_operation_extended; +int GLAD_GL_ARB_compatibility; +int GLAD_GL_ARB_instanced_arrays; +int GLAD_GL_ARB_get_texture_sub_image; +int GLAD_GL_NV_vertex_array_range2; +int GLAD_GL_ARB_texture_stencil8; +int GLAD_GL_AMD_sparse_texture; +int GLAD_GL_ARB_clip_control; +int GLAD_GL_NV_fragment_coverage_to_color; +int GLAD_GL_NV_fence; +int GLAD_GL_ARB_texture_buffer_range; +int GLAD_GL_SUN_mesh_array; +int GLAD_GL_ARB_vertex_attrib_binding; +int GLAD_GL_EXT_texture_compression_s3tc; +int GLAD_GL_ARB_cl_event; +int GLAD_GL_ARB_derivative_control; +int GLAD_GL_NV_packed_depth_stencil; +int GLAD_GL_OES_single_precision; +int GLAD_GL_NV_primitive_restart; +int GLAD_GL_ARB_fragment_shader_interlock; +int GLAD_GL_EXT_texture_object; +int GLAD_GL_AMD_name_gen_delete; +int GLAD_GL_NV_texture_compression_vtc; +int GLAD_GL_NV_sample_mask_override_coverage; +int GLAD_GL_NV_texture_shader3; +int GLAD_GL_NV_texture_shader2; +int GLAD_GL_EXT_texture; +int GLAD_GL_ARB_buffer_storage; +int GLAD_GL_AMD_shader_atomic_counter_ops; +int GLAD_GL_APPLE_vertex_program_evaluators; +int GLAD_GL_ARB_multi_bind; +int GLAD_GL_ARB_explicit_uniform_location; +int GLAD_GL_ARB_depth_buffer_float; +int GLAD_GL_NV_path_rendering_shared_edge; +int GLAD_GL_SGIX_shadow_ambient; +int GLAD_GL_ARB_texture_cube_map; +int GLAD_GL_AMD_vertex_shader_viewport_index; +int GLAD_GL_EXT_shader_integer_mix; +int GLAD_GL_NV_vertex_buffer_unified_memory; +int GLAD_GL_EXT_fog_coord; +int GLAD_GL_EXT_texture_env_dot3; +int GLAD_GL_ATI_texture_env_combine3; +int GLAD_GL_ARB_map_buffer_alignment; +int GLAD_GL_NV_blend_equation_advanced; +int GLAD_GL_SGIS_sharpen_texture; +int GLAD_GL_KHR_robust_buffer_access_behavior; +int GLAD_GL_ARB_pipeline_statistics_query; +int GLAD_GL_ARB_vertex_program; +int GLAD_GL_ARB_texture_rgb10_a2ui; +int GLAD_GL_OML_interlace; +int GLAD_GL_ATI_pixel_format_float; +int GLAD_GL_ARB_vertex_buffer_object; +int GLAD_GL_EXT_shadow_funcs; +int GLAD_GL_ATI_text_fragment_shader; +int GLAD_GL_NV_vertex_array_range; +int GLAD_GL_SGIX_fragment_lighting; +int GLAD_GL_NV_texture_expand_normal; +int GLAD_GL_NV_framebuffer_multisample_coverage; +int GLAD_GL_ARB_framebuffer_no_attachments; +int GLAD_GL_EXT_timer_query; +int GLAD_GL_EXT_vertex_array_bgra; +int GLAD_GL_NV_bindless_texture; +int GLAD_GL_KHR_debug; +int GLAD_GL_SGIS_texture_border_clamp; +int GLAD_GL_OML_subsample; +int GLAD_GL_SGIX_clipmap; +int GLAD_GL_EXT_geometry_shader4; +int GLAD_GL_ARB_shader_texture_image_samples; +int GLAD_GL_MESA_ycbcr_texture; +int GLAD_GL_MESAX_texture_stack; +int GLAD_GL_AMD_seamless_cubemap_per_texture; +int GLAD_GL_EXT_bindable_uniform; +int GLAD_GL_KHR_texture_compression_astc_hdr; +int GLAD_GL_ARB_shader_ballot; +int GLAD_GL_KHR_blend_equation_advanced; +int GLAD_GL_ARB_fragment_program_shadow; +int GLAD_GL_ATI_element_array; +int GLAD_GL_ARB_sparse_texture_clamp; +int GLAD_GL_AMD_texture_texture4; +int GLAD_GL_SGIX_reference_plane; +int GLAD_GL_EXT_stencil_two_side; +int GLAD_GL_ARB_transform_feedback_overflow_query; +int GLAD_GL_SGIX_texture_lod_bias; +int GLAD_GL_KHR_no_error; +int GLAD_GL_NV_explicit_multisample; +int GLAD_GL_IBM_static_data; +int GLAD_GL_EXT_clip_volume_hint; +int GLAD_GL_EXT_texture_perturb_normal; +int GLAD_GL_NV_fragment_program2; +int GLAD_GL_NV_fragment_program4; +int GLAD_GL_EXT_point_parameters; +int GLAD_GL_PGI_misc_hints; +int GLAD_GL_SGIX_subsample; +int GLAD_GL_AMD_shader_stencil_export; +int GLAD_GL_ARB_shader_texture_lod; +int GLAD_GL_ARB_vertex_shader; +int GLAD_GL_ARB_depth_clamp; +int GLAD_GL_SGIS_texture_select; +int GLAD_GL_NV_texture_shader; +int GLAD_GL_ARB_tessellation_shader; +int GLAD_GL_EXT_draw_buffers2; +int GLAD_GL_ARB_vertex_attrib_64bit; +int GLAD_GL_EXT_texture_filter_minmax; +int GLAD_GL_ARB_texture_gather; +int GLAD_GL_AMD_interleaved_elements; +int GLAD_GL_ARB_fragment_program; +int GLAD_GL_OML_resample; +int GLAD_GL_APPLE_ycbcr_422; +int GLAD_GL_SGIX_texture_add_env; +int GLAD_GL_ARB_shadow_ambient; +int GLAD_GL_ARB_texture_storage; +int GLAD_GL_EXT_pixel_buffer_object; +int GLAD_GL_NV_vertex_program; +int GLAD_GL_SGIS_pixel_texture; +int GLAD_GL_SGIS_generate_mipmap; +int GLAD_GL_SGIX_instruments; +int GLAD_GL_ARB_fragment_layer_viewport; +int GLAD_GL_ARB_shader_storage_buffer_object; +int GLAD_GL_EXT_sparse_texture2; +int GLAD_GL_EXT_blend_minmax; +int GLAD_GL_MESA_pack_invert; +int GLAD_GL_ARB_base_instance; +int GLAD_GL_SUN_global_alpha; +int GLAD_GL_PGI_vertex_hints; +int GLAD_GL_AMD_transform_feedback4; +int GLAD_GL_ARB_ES3_1_compatibility; +int GLAD_GL_EXT_texture_integer; +int GLAD_GL_ARB_texture_multisample; +int GLAD_GL_AMD_gpu_shader_int64; +int GLAD_GL_S3_s3tc; +int GLAD_GL_ARB_query_buffer_object; +int GLAD_GL_AMD_vertex_shader_tessellator; +int GLAD_GL_ARB_invalidate_subdata; +int GLAD_GL_ARB_draw_indirect; +int GLAD_GL_ARB_transform_feedback2; +int GLAD_GL_EXT_index_material; +int GLAD_GL_NV_blend_equation_advanced_coherent; +int GLAD_GL_ARB_texture_non_power_of_two; +int GLAD_GL_KHR_texture_compression_astc_sliced_3d; +int GLAD_GL_ATI_draw_buffers; +int GLAD_GL_EXT_cmyka; +int GLAD_GL_SGIX_pixel_texture; +int GLAD_GL_APPLE_specular_vector; +int GLAD_GL_ARB_seamless_cubemap_per_texture; +int GLAD_GL_ARB_conservative_depth; +int GLAD_GL_SGIX_interlace; +int GLAD_GL_NV_parameter_buffer_object; +int GLAD_GL_AMD_shader_trinary_minmax; +int GLAD_GL_EXT_texture_lod_bias; +int GLAD_GL_EXT_rescale_normal; +int GLAD_GL_ARB_pixel_buffer_object; +int GLAD_GL_ARB_uniform_buffer_object; +int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; +int GLAD_GL_ARB_texture_swizzle; +int GLAD_GL_ARB_texture_compression; +int GLAD_GL_SGIX_async_pixel; +int GLAD_GL_NV_fragment_program_option; +int GLAD_GL_ARB_explicit_attrib_location; +int GLAD_GL_EXT_blend_color; +int GLAD_GL_NV_shader_thread_group; +int GLAD_GL_EXT_stencil_wrap; +int GLAD_GL_EXT_index_array_formats; +int GLAD_GL_OVR_multiview2; +int GLAD_GL_EXT_histogram; +int GLAD_GL_EXT_polygon_offset; +int GLAD_GL_SGIS_point_parameters; +int GLAD_GL_EXT_direct_state_access; +int GLAD_GL_ARB_shader_group_vote; +int GLAD_GL_NV_texture_rectangle; +int GLAD_GL_ARB_copy_image; +int GLAD_GL_NV_shader_thread_shuffle; +int GLAD_GL_ARB_shader_precision; +int GLAD_GL_EXT_vertex_shader; +int GLAD_GL_EXT_blend_func_separate; +int GLAD_GL_APPLE_fence; +int GLAD_GL_OES_byte_coordinates; +int GLAD_GL_ARB_transpose_matrix; +int GLAD_GL_ARB_provoking_vertex; +int GLAD_GL_NV_uniform_buffer_unified_memory; +int GLAD_GL_NV_fragment_shader_interlock; +int GLAD_GL_EXT_vertex_array; +int GLAD_GL_ARB_half_float_vertex; +int GLAD_GL_EXT_blend_equation_separate; +int GLAD_GL_NV_framebuffer_mixed_samples; +int GLAD_GL_ARB_multi_draw_indirect; +int GLAD_GL_EXT_raster_multisample; +int GLAD_GL_NV_copy_image; +int GLAD_GL_NV_geometry_shader_passthrough; +int GLAD_GL_INTEL_framebuffer_CMAA; +int GLAD_GL_SGIX_convolution_accuracy; +int GLAD_GL_ARB_transform_feedback3; +int GLAD_GL_SGIX_ycrcba; +int GLAD_GL_EXT_debug_marker; +int GLAD_GL_EXT_bgra; +int GLAD_GL_INTEL_parallel_arrays; +int GLAD_GL_EXT_pixel_transform; +int GLAD_GL_NV_vertex_attrib_integer_64bit; +int GLAD_GL_ATI_fragment_shader; +int GLAD_GL_ARB_vertex_array_object; +int GLAD_GL_ATI_pn_triangles; +int GLAD_GL_EXT_texture_env_add; +int GLAD_GL_EXT_packed_depth_stencil; +int GLAD_GL_EXT_texture_mirror_clamp; +int GLAD_GL_NV_multisample_filter_hint; +int GLAD_GL_INTEL_performance_query; +int GLAD_GL_ARB_transform_feedback_instanced; +int GLAD_GL_SGIX_async; +int GLAD_GL_EXT_texture_compression_latc; +int GLAD_GL_NV_shader_atomic_float; +int GLAD_GL_ARB_shading_language_100; +int GLAD_GL_APPLE_float_pixels; +int GLAD_GL_ARB_texture_mirror_clamp_to_edge; +int GLAD_GL_NV_vertex_program2; +int GLAD_GL_NV_bindless_multi_draw_indirect_count; +int GLAD_GL_ARB_depth_texture; +int GLAD_GL_ARB_ES2_compatibility; +int GLAD_GL_ARB_indirect_parameters; +int GLAD_GL_NV_half_float; +int GLAD_GL_ARB_ES3_2_compatibility; +int GLAD_GL_ATI_texture_mirror_once; +int GLAD_GL_IBM_rasterpos_clip; +int GLAD_GL_SGIX_shadow; +int GLAD_GL_EXT_polygon_offset_clamp; +int GLAD_GL_NV_deep_texture3D; +int GLAD_GL_ARB_shader_draw_parameters; +int GLAD_GL_SGIX_calligraphic_fragment; +int GLAD_GL_ARB_shader_bit_encoding; +int GLAD_GL_EXT_compiled_vertex_array; +int GLAD_GL_NV_depth_buffer_float; +int GLAD_GL_APPLE_flush_buffer_range; +int GLAD_GL_ARB_imaging; +int GLAD_GL_ARB_draw_buffers_blend; +int GLAD_GL_AMD_gcn_shader; +int GLAD_GL_AMD_blend_minmax_factor; +int GLAD_GL_EXT_texture_sRGB_decode; +int GLAD_GL_ARB_shading_language_420pack; +int GLAD_GL_ARB_shader_viewport_layer_array; +int GLAD_GL_ATI_meminfo; +int GLAD_GL_EXT_abgr; +int GLAD_GL_AMD_pinned_memory; +int GLAD_GL_EXT_texture_snorm; +int GLAD_GL_SGIX_texture_coordinate_clamp; +int GLAD_GL_ARB_clear_buffer_object; +int GLAD_GL_ARB_multisample; +int GLAD_GL_EXT_debug_label; +int GLAD_GL_NV_light_max_exponent; +int GLAD_GL_NV_internalformat_sample_query; +int GLAD_GL_INTEL_map_texture; +int GLAD_GL_ARB_texture_env_crossbar; +int GLAD_GL_EXT_422_pixels; +int GLAD_GL_ARB_compute_shader; +int GLAD_GL_NV_texgen_emboss; +int GLAD_GL_ARB_blend_func_extended; +int GLAD_GL_IBM_vertex_array_lists; +int GLAD_GL_ARB_color_buffer_float; +int GLAD_GL_ARB_bindless_texture; +int GLAD_GL_SGIX_depth_texture; +int GLAD_GL_ARB_internalformat_query; +int GLAD_GL_ARB_shader_atomic_counter_ops; +int GLAD_GL_ARB_texture_mirrored_repeat; +int GLAD_GL_EXT_shader_image_load_store; +int GLAD_GL_EXT_copy_texture; +int GLAD_GL_NV_register_combiners2; +int GLAD_GL_SGIX_ycrcb_subsample; +int GLAD_GL_ARB_copy_buffer; +int GLAD_GL_NV_draw_texture; +int GLAD_GL_EXT_texture_shared_exponent; +int GLAD_GL_EXT_draw_instanced; +int GLAD_GL_NV_copy_depth_to_color; +int GLAD_GL_ARB_viewport_array; +int GLAD_GL_ARB_separate_shader_objects; +int GLAD_GL_EXT_multisample; +int GLAD_GL_EXT_depth_bounds_test; +int GLAD_GL_EXT_shared_texture_palette; +int GLAD_GL_ARB_texture_env_add; +int GLAD_GL_NV_video_capture; +int GLAD_GL_ARB_sampler_objects; +int GLAD_GL_ARB_matrix_palette; +int GLAD_GL_SGIS_texture_color_mask; +int GLAD_GL_EXT_packed_pixels; +int GLAD_GL_EXT_coordinate_frame; +int GLAD_GL_NV_transform_feedback2; +int GLAD_GL_APPLE_aux_depth_stencil; +int GLAD_GL_ARB_shader_subroutine; +int GLAD_GL_EXT_framebuffer_sRGB; +int GLAD_GL_ARB_texture_storage_multisample; +int GLAD_GL_KHR_blend_equation_advanced_coherent; +int GLAD_GL_EXT_vertex_attrib_64bit; +int GLAD_GL_HP_texture_lighting; +int GLAD_GL_NV_shader_buffer_store; +int GLAD_GL_OES_query_matrix; +int GLAD_GL_MESA_window_pos; +int GLAD_GL_NV_fill_rectangle; +int GLAD_GL_NV_shader_storage_buffer_object; +int GLAD_GL_ARB_texture_query_lod; +int GLAD_GL_SGIX_ir_instrument1; +int GLAD_GL_ARB_shader_image_size; +int GLAD_GL_NV_shader_atomic_counters; +int GLAD_GL_APPLE_object_purgeable; +int GLAD_GL_ARB_occlusion_query; +int GLAD_GL_INGR_color_clamp; +int GLAD_GL_SGI_color_table; +int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; +int GLAD_GL_ARB_texture_cube_map_array; +int GLAD_GL_AMD_debug_output; +int GLAD_GL_EXT_gpu_shader4; +int GLAD_GL_NV_geometry_program4; +int GLAD_GL_NV_gpu_program5_mem_extended; +int GLAD_GL_SGIX_scalebias_hint; +int GLAD_GL_ARB_texture_border_clamp; +int GLAD_GL_ARB_fragment_coord_conventions; +int GLAD_GL_SGIX_polynomial_ffd; +int GLAD_GL_EXT_provoking_vertex; +int GLAD_GL_ARB_point_parameters; +int GLAD_GL_ARB_shader_image_load_store; +int GLAD_GL_ARB_conditional_render_inverted; +int GLAD_GL_HP_occlusion_test; +int GLAD_GL_ARB_ES3_compatibility; +int GLAD_GL_EXT_texture_array; +int GLAD_GL_ARB_texture_buffer_object_rgb32; +int GLAD_GL_NV_bindless_multi_draw_indirect; +int GLAD_GL_SGIX_texture_multi_buffer; +int GLAD_GL_EXT_transform_feedback; +int GLAD_GL_KHR_texture_compression_astc_ldr; +int GLAD_GL_3DFX_multisample; +int GLAD_GL_INTEL_fragment_shader_ordering; +int GLAD_GL_ARB_texture_env_dot3; +int GLAD_GL_NV_gpu_program4; +int GLAD_GL_NV_gpu_program5; +int GLAD_GL_NV_float_buffer; +int GLAD_GL_SGIS_texture_edge_clamp; +int GLAD_GL_ARB_framebuffer_sRGB; +int GLAD_GL_SUN_slice_accum; +int GLAD_GL_EXT_index_texture; +int GLAD_GL_EXT_shader_image_load_formatted; +int GLAD_GL_ARB_geometry_shader4; +int GLAD_GL_EXT_separate_specular_color; +int GLAD_GL_NV_fog_distance; +int GLAD_GL_NV_conservative_raster; +int GLAD_GL_SUN_convolution_border_modes; +int GLAD_GL_SGIX_sprite; +int GLAD_GL_ARB_get_program_binary; +int GLAD_GL_ARB_timer_query; +int GLAD_GL_AMD_occlusion_query_event; +int GLAD_GL_SGIS_multisample; +int GLAD_GL_EXT_framebuffer_object; +int GLAD_GL_EXT_vertex_weighting; +int GLAD_GL_ARB_vertex_array_bgra; +int GLAD_GL_APPLE_vertex_array_range; +int GLAD_GL_AMD_query_buffer_object; +int GLAD_GL_NV_register_combiners; +int GLAD_GL_ARB_draw_buffers; +int GLAD_GL_ARB_clear_texture; +int GLAD_GL_NV_fragment_program; +int GLAD_GL_SGI_color_matrix; +int GLAD_GL_EXT_cull_vertex; +int GLAD_GL_EXT_texture_sRGB; +int GLAD_GL_APPLE_row_bytes; +int GLAD_GL_NV_texgen_reflection; +int GLAD_GL_IBM_multimode_draw_arrays; +int GLAD_GL_APPLE_vertex_array_object; +int GLAD_GL_3DFX_texture_compression_FXT1; +int GLAD_GL_GREMEDY_frame_terminator; +int GLAD_GL_AMD_conservative_depth; +int GLAD_GL_ARB_texture_float; +int GLAD_GL_ARB_compressed_texture_pixel_storage; +int GLAD_GL_SGIS_detail_texture; +int GLAD_GL_ARB_draw_instanced; +int GLAD_GL_OES_read_format; +int GLAD_GL_ATI_texture_float; +int GLAD_GL_WIN_specular_fog; +int GLAD_GL_AMD_vertex_shader_layer; +int GLAD_GL_ARB_shading_language_include; +int GLAD_GL_APPLE_client_storage; +int GLAD_GL_WIN_phong_shading; +int GLAD_GL_INGR_blend_func_separate; +int GLAD_GL_NV_path_rendering; +int GLAD_GL_NV_conservative_raster_dilate; +int GLAD_GL_ARB_texture_barrier; +int GLAD_GL_ATI_vertex_streams; +int GLAD_GL_ARB_post_depth_coverage; +int GLAD_GL_NV_occlusion_query; +int GLAD_GL_APPLE_rgb_422; +int GLAD_GL_ARB_direct_state_access; +int GLAD_GL_ARB_gpu_shader_int64; +int GLAD_GL_ARB_seamless_cube_map; +int GLAD_GL_ARB_cull_distance; +int GLAD_GL_NV_vdpau_interop; +int GLAD_GL_ARB_occlusion_query2; +int GLAD_GL_ARB_internalformat_query2; +int GLAD_GL_EXT_texture_filter_anisotropic; +int GLAD_GL_SUN_vertex; +int GLAD_GL_ARB_sparse_texture; +int GLAD_GL_SGIS_texture_lod; +int GLAD_GL_NV_vertex_program3; +int GLAD_GL_NV_gpu_shader5; +int GLAD_GL_NV_vertex_program4; +int GLAD_GL_AMD_transform_feedback3_lines_triangles; +int GLAD_GL_SGIS_fog_function; +int GLAD_GL_EXT_x11_sync_object; +int GLAD_GL_ARB_sync; +int GLAD_GL_NV_sample_locations; +int GLAD_GL_ARB_compute_variable_group_size; +int GLAD_GL_OES_fixed_point; +int GLAD_GL_NV_blend_square; +int GLAD_GL_EXT_framebuffer_multisample; +int GLAD_GL_ARB_gpu_shader5; +int GLAD_GL_SGIS_texture4D; +int GLAD_GL_EXT_texture3D; +int GLAD_GL_ARB_multitexture; +int GLAD_GL_EXT_secondary_color; +int GLAD_GL_NV_parameter_buffer_object2; +int GLAD_GL_ATI_vertex_array_object; +int GLAD_GL_ARB_parallel_shader_compile; +int GLAD_GL_NVX_gpu_memory_info; +int GLAD_GL_SGIX_igloo_interface; +int GLAD_GL_SGIS_point_line_texgen; +int GLAD_GL_ARB_sample_locations; +int GLAD_GL_ARB_sparse_buffer; +int GLAD_GL_EXT_draw_range_elements; +int GLAD_GL_SGIX_blend_alpha_minmax; +int GLAD_GL_KHR_context_flush_control; +PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; +PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; +PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; +PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; +PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; +PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; +PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; +PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; +PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; +PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; +PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; +PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; +PFNGLWEIGHTIVARBPROC glad_glWeightivARB; +PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; +PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; +PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; +PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; +PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; +PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; +PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; +PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; +PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; +PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; +PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; +PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; +PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; +PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; +PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; +PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; +PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; +PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; +PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; +PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; +PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; +PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; +PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; +PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; +PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; +PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; +PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; +PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; +PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; +PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; +PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; +PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; +PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; +PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; +PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; +PFNGLTEXTUREVIEWPROC glad_glTextureView; +PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; +PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; +PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; +PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; +PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; +PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; +PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; +PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; +PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; +PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; +PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; +PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; +PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; +PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; +PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; +PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; +PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; +PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; +PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; +PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; +PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; +PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; +PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; +PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; +PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; +PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; +PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; +PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; +PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; +PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; +PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; +PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; +PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; +PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; +PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; +PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; +PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; +PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; +PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; +PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; +PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; +PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; +PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; +PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; +PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; +PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; +PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; +PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; +PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; +PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; +PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; +PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; +PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; +PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; +PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; +PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; +PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; +PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; +PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; +PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; +PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; +PFNGLGETHANDLEARBPROC glad_glGetHandleARB; +PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; +PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; +PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; +PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; +PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; +PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; +PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; +PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; +PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; +PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; +PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; +PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; +PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; +PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; +PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; +PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; +PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; +PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; +PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; +PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; +PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; +PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; +PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; +PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; +PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; +PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; +PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; +PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; +PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; +PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; +PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; +PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; +PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; +PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; +PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; +PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; +PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; +PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; +PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; +PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; +PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; +PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; +PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; +PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; +PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; +PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; +PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; +PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; +PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; +PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; +PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; +PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; +PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; +PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; +PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; +PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; +PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; +PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; +PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; +PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; +PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; +PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; +PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; +PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; +PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; +PFNGLUNIFORM1DPROC glad_glUniform1d; +PFNGLUNIFORM2DPROC glad_glUniform2d; +PFNGLUNIFORM3DPROC glad_glUniform3d; +PFNGLUNIFORM4DPROC glad_glUniform4d; +PFNGLUNIFORM1DVPROC glad_glUniform1dv; +PFNGLUNIFORM2DVPROC glad_glUniform2dv; +PFNGLUNIFORM3DVPROC glad_glUniform3dv; +PFNGLUNIFORM4DVPROC glad_glUniform4dv; +PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; +PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; +PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; +PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; +PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; +PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; +PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; +PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; +PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; +PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; +PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; +PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; +PFNGLISSTATENVPROC glad_glIsStateNV; +PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; +PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; +PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; +PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; +PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; +PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; +PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; +PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; +PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; +PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; +PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; +PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; +PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; +PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; +PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; +PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; +PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; +PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; +PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; +PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; +PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; +PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; +PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; +PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; +PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; +PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; +PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; +PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; +PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; +PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; +PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; +PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; +PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; +PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; +PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; +PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; +PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; +PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; +PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; +PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; +PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; +PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; +PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; +PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; +PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; +PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; +PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; +PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; +PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; +PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; +PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; +PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; +PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; +PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; +PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; +PFNGLREADNPIXELSPROC glad_glReadnPixels; +PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; +PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; +PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; +PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; +PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; +PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; +PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; +PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; +PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; +PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; +PFNGLCLIPCONTROLPROC glad_glClipControl; +PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; +PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; +PFNGLGENFENCESNVPROC glad_glGenFencesNV; +PFNGLISFENCENVPROC glad_glIsFenceNV; +PFNGLTESTFENCENVPROC glad_glTestFenceNV; +PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; +PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; +PFNGLSETFENCENVPROC glad_glSetFenceNV; +PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; +PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; +PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; +PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; +PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; +PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; +PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; +PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; +PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; +PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; +PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; +PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; +PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; +PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; +PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; +PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; +PFNGLORTHOFOESPROC glad_glOrthofOES; +PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; +PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; +PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; +PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; +PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; +PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; +PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; +PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; +PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; +PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; +PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; +PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; +PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; +PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; +PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; +PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; +PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; +PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; +PFNGLISNAMEAMDPROC glad_glIsNameAMD; +PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; +PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; +PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; +PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; +PFNGLBINDTEXTURESPROC glad_glBindTextures; +PFNGLBINDSAMPLERSPROC glad_glBindSamplers; +PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; +PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; +PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; +PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; +PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; +PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; +PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; +PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; +PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; +PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; +PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; +PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; +PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; +PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; +PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; +PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; +PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; +PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; +PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; +PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; +PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; +PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; +PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; +PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; +PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; +PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; +PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; +PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; +PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; +PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; +PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; +PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; +PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; +PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; +PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; +PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; +PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; +PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; +PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; +PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; +PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; +PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; +PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; +PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; +PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; +PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; +PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; +PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; +PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; +PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; +PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; +PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; +PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; +PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; +PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; +PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; +PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; +PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; +PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; +PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; +PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; +PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; +PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; +PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; +PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; +PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; +PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; +PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; +PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; +PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; +PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; +PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; +PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; +PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; +PFNGLISPROGRAMARBPROC glad_glIsProgramARB; +PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; +PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; +PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; +PFNGLISBUFFERARBPROC glad_glIsBufferARB; +PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; +PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; +PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; +PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; +PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; +PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; +PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; +PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; +PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; +PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; +PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; +PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; +PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; +PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; +PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; +PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; +PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; +PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; +PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; +PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; +PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; +PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; +PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; +PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; +PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; +PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; +PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; +PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; +PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; +PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; +PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; +PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; +PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; +PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; +PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; +PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; +PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; +PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; +PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; +PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; +PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; +PFNGLOBJECTLABELPROC glad_glObjectLabel; +PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; +PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; +PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; +PFNGLGETPOINTERVPROC glad_glGetPointerv; +PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; +PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; +PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; +PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; +PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; +PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; +PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; +PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; +PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; +PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; +PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; +PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; +PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; +PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; +PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; +PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; +PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; +PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; +PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; +PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; +PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; +PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; +PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; +PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; +PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; +PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; +PFNGLHINTPGIPROC glad_glHintPGI; +PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; +PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; +PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; +PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; +PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; +PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; +PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; +PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; +PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; +PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; +PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; +PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; +PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; +PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; +PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; +PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; +PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; +PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; +PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; +PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; +PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; +PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; +PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; +PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; +PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; +PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; +PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; +PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; +PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; +PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; +PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; +PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; +PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; +PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; +PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; +PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; +PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; +PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; +PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; +PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; +PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; +PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; +PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; +PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; +PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; +PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; +PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; +PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; +PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; +PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; +PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; +PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; +PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; +PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; +PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; +PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; +PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; +PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; +PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; +PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; +PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; +PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; +PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; +PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; +PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; +PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; +PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; +PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; +PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; +PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; +PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; +PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; +PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; +PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; +PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; +PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; +PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; +PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; +PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; +PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; +PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; +PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; +PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; +PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; +PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; +PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; +PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; +PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; +PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; +PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; +PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; +PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; +PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; +PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; +PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; +PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; +PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; +PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; +PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; +PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; +PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; +PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; +PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; +PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; +PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; +PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; +PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; +PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; +PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; +PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; +PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; +PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; +PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; +PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; +PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; +PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; +PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; +PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; +PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; +PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; +PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; +PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; +PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; +PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; +PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; +PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; +PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; +PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; +PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; +PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; +PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; +PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; +PFNGLCREATETEXTURESPROC glad_glCreateTextures; +PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; +PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; +PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; +PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; +PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; +PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; +PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; +PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; +PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; +PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; +PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; +PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; +PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; +PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; +PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; +PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; +PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; +PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; +PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; +PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; +PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; +PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; +PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; +PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; +PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; +PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; +PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; +PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; +PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; +PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; +PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; +PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; +PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; +PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; +PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; +PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; +PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; +PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; +PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; +PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; +PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; +PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; +PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; +PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; +PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; +PFNGLCREATEQUERIESPROC glad_glCreateQueries; +PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; +PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; +PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; +PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; +PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; +PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; +PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; +PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; +PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; +PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; +PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; +PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; +PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; +PFNGLMINMAXEXTPROC glad_glMinmaxEXT; +PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; +PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; +PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; +PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; +PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; +PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; +PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; +PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; +PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; +PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; +PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; +PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; +PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; +PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; +PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; +PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; +PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; +PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; +PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; +PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; +PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; +PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; +PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; +PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; +PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; +PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; +PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; +PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; +PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; +PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; +PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; +PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; +PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; +PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; +PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; +PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; +PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; +PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; +PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; +PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; +PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; +PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; +PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; +PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; +PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; +PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; +PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; +PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; +PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; +PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; +PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; +PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; +PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; +PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; +PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; +PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; +PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; +PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; +PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; +PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; +PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; +PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; +PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; +PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; +PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; +PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; +PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; +PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; +PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; +PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; +PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; +PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; +PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; +PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; +PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; +PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; +PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; +PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; +PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; +PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; +PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; +PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; +PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; +PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; +PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; +PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; +PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; +PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; +PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; +PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; +PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; +PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; +PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; +PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; +PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; +PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; +PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; +PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; +PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; +PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; +PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; +PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; +PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; +PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; +PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; +PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; +PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; +PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; +PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; +PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; +PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; +PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; +PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; +PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; +PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; +PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; +PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; +PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; +PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; +PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; +PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; +PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; +PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; +PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; +PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; +PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; +PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; +PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; +PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; +PFNGLISPROGRAMNVPROC glad_glIsProgramNV; +PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; +PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; +PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; +PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; +PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; +PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; +PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; +PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; +PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; +PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; +PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; +PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; +PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; +PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; +PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; +PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; +PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; +PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; +PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; +PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; +PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; +PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; +PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; +PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; +PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; +PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; +PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; +PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; +PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; +PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; +PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; +PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; +PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; +PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; +PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; +PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; +PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; +PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; +PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; +PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; +PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; +PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; +PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; +PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; +PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; +PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; +PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; +PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; +PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; +PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; +PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; +PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; +PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; +PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; +PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; +PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; +PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; +PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; +PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; +PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; +PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; +PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; +PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; +PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; +PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; +PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; +PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; +PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; +PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; +PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; +PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; +PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; +PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; +PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; +PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; +PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; +PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; +PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; +PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; +PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; +PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; +PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; +PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; +PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; +PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; +PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; +PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; +PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; +PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; +PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; +PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; +PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; +PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; +PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; +PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; +PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; +PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; +PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; +PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; +PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; +PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; +PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; +PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; +PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; +PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; +PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; +PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; +PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; +PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; +PFNGLVERTEX2BOESPROC glad_glVertex2bOES; +PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; +PFNGLVERTEX3BOESPROC glad_glVertex3bOES; +PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; +PFNGLVERTEX4BOESPROC glad_glVertex4bOES; +PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; +PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; +PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; +PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; +PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; +PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; +PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; +PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; +PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; +PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; +PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; +PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; +PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; +PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; +PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; +PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; +PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; +PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; +PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; +PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; +PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; +PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; +PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; +PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; +PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; +PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; +PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; +PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; +PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; +PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; +PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; +PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; +PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; +PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; +PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; +PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; +PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; +PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; +PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; +PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; +PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; +PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; +PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; +PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; +PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; +PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; +PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; +PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; +PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; +PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; +PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; +PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; +PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; +PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; +PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; +PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; +PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; +PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; +PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; +PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; +PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; +PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; +PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; +PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; +PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; +PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; +PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; +PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; +PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; +PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; +PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; +PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; +PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; +PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; +PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; +PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; +PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; +PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +PFNGLSHADERBINARYPROC glad_glShaderBinary; +PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; +PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; +PFNGLVERTEX2HNVPROC glad_glVertex2hNV; +PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; +PFNGLVERTEX3HNVPROC glad_glVertex3hNV; +PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; +PFNGLVERTEX4HNVPROC glad_glVertex4hNV; +PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; +PFNGLNORMAL3HNVPROC glad_glNormal3hNV; +PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; +PFNGLCOLOR3HNVPROC glad_glColor3hNV; +PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; +PFNGLCOLOR4HNVPROC glad_glColor4hNV; +PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; +PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; +PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; +PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; +PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; +PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; +PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; +PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; +PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; +PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; +PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; +PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; +PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; +PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; +PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; +PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; +PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; +PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; +PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; +PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; +PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; +PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; +PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; +PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; +PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; +PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; +PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; +PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; +PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; +PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; +PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; +PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; +PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; +PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; +PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; +PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; +PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; +PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; +PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; +PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; +PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; +PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; +PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; +PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; +PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; +PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; +PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; +PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; +PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; +PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; +PFNGLCOLORTABLEPROC glad_glColorTable; +PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; +PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; +PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; +PFNGLGETCOLORTABLEPROC glad_glGetColorTable; +PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; +PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; +PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; +PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; +PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; +PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; +PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; +PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; +PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; +PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; +PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; +PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; +PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; +PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; +PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; +PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; +PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; +PFNGLGETHISTOGRAMPROC glad_glGetHistogram; +PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; +PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; +PFNGLGETMINMAXPROC glad_glGetMinmax; +PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; +PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; +PFNGLHISTOGRAMPROC glad_glHistogram; +PFNGLMINMAXPROC glad_glMinmax; +PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; +PFNGLRESETMINMAXPROC glad_glResetMinmax; +PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; +PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; +PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; +PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; +PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; +PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; +PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; +PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; +PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; +PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; +PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; +PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; +PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; +PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; +PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; +PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; +PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; +PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; +PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; +PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; +PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; +PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; +PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; +PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; +PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; +PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; +PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; +PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; +PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; +PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; +PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; +PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; +PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; +PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; +PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; +PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; +PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; +PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; +PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; +PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; +PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; +PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; +PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; +PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; +PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; +PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; +PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; +PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; +PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; +PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; +PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; +PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; +PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; +PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; +PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; +PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; +PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; +PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; +PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; +PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; +PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; +PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; +PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; +PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; +PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; +PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; +PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; +PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; +PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; +PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; +PFNGLGETFLOATI_VPROC glad_glGetFloati_v; +PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; +PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; +PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; +PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; +PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; +PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; +PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; +PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; +PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; +PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; +PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; +PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; +PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; +PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; +PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; +PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; +PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; +PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; +PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; +PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; +PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; +PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; +PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; +PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; +PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; +PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; +PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; +PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; +PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; +PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; +PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; +PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; +PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; +PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; +PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; +PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; +PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; +PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; +PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; +PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; +PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; +PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; +PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; +PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; +PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; +PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; +PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; +PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; +PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; +PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; +PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; +PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; +PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; +PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; +PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; +PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; +PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; +PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; +PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; +PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; +PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; +PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; +PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; +PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; +PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; +PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; +PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; +PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; +PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; +PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; +PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; +PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; +PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; +PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; +PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; +PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; +PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; +PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; +PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; +PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; +PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; +PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; +PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; +PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; +PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; +PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; +PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; +PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; +PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; +PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; +PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; +PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; +PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; +PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; +PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; +PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; +PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; +PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; +PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; +PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; +PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; +PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; +PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; +PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; +PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; +PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; +PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; +PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; +PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; +PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; +PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; +PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; +PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; +PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; +PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; +PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; +PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; +PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; +PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; +PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; +PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; +PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; +PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; +PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; +PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; +PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; +PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; +PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; +PFNGLISQUERYARBPROC glad_glIsQueryARB; +PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; +PFNGLENDQUERYARBPROC glad_glEndQueryARB; +PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; +PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; +PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; +PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; +PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; +PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; +PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; +PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; +PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; +PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; +PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; +PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; +PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; +PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; +PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; +PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; +PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; +PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; +PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; +PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; +PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; +PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; +PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; +PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; +PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; +PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; +PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; +PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; +PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; +PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; +PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; +PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; +PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; +PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; +PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; +PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; +PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; +PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; +PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; +PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; +PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; +PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; +PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; +PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; +PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; +PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; +PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; +PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; +PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; +PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; +PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; +PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; +PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; +PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; +PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; +PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; +PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; +PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; +PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; +PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; +PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; +PFNGLDEFORMSGIXPROC glad_glDeformSGIX; +PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; +PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; +PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; +PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; +PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; +PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; +PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; +PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; +PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; +PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; +PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; +PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; +PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; +PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; +PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; +PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; +PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; +PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; +PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; +PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; +PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; +PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; +PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; +PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; +PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; +PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; +PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; +PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; +PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; +PFNGLPROGRAMBINARYPROC glad_glProgramBinary; +PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; +PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; +PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; +PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; +PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; +PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; +PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; +PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; +PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; +PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; +PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; +PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; +PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; +PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; +PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; +PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; +PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; +PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; +PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; +PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; +PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; +PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; +PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; +PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; +PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; +PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; +PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; +PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; +PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; +PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; +PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; +PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; +PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; +PFNGLGENPATHSNVPROC glad_glGenPathsNV; +PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; +PFNGLISPATHNVPROC glad_glIsPathNV; +PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; +PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; +PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; +PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; +PFNGLPATHSTRINGNVPROC glad_glPathStringNV; +PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; +PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; +PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; +PFNGLCOPYPATHNVPROC glad_glCopyPathNV; +PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; +PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; +PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; +PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; +PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; +PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; +PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; +PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; +PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; +PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; +PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; +PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; +PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; +PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; +PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; +PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; +PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; +PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; +PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; +PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; +PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; +PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; +PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; +PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; +PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; +PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; +PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; +PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; +PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; +PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; +PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; +PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; +PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; +PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; +PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; +PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; +PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; +PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; +PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; +PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; +PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; +PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; +PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; +PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; +PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; +PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; +PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; +PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; +PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; +PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; +PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; +PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; +PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; +PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; +PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; +PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; +PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; +PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; +PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; +PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; +PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; +PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; +PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; +PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; +PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; +PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; +PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; +PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; +PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; +PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; +PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; +PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; +PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; +PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; +PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; +PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; +PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; +PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; +PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; +PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; +PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; +PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; +PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; +PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; +PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; +PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; +PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; +PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; +PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; +PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; +PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; +PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; +PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; +PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; +PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; +PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; +PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; +PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; +PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; +PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; +PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; +PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; +PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; +PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; +PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; +PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; +PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; +PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; +PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; +PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; +PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; +PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; +PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; +PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; +PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; +PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; +PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; +PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; +PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; +PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; +PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; +PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; +PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; +PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; +PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; +PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; +PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; +PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; +PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; +PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; +PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; +PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; +PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; +PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; +PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; +PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; +PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; +PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; +PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; +PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; +PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; +PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; +PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; +PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; +PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; +PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; +PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; +PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; +PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; +PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; +PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; +PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; +PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; +PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; +PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; +PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; +PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; +PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; +PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; +PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; +PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; +PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; +PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; +PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; +PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; +PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; +PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; +PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; +PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; +PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; +PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; +PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; +PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; +PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; +PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; +PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; +PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; +PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; +PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; +PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; +PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; +PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; +PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; +PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; +PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; +PFNGLCOLOR4XOESPROC glad_glColor4xOES; +PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; +PFNGLFOGXOESPROC glad_glFogxOES; +PFNGLFOGXVOESPROC glad_glFogxvOES; +PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; +PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; +PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; +PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; +PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; +PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; +PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; +PFNGLLIGHTXOESPROC glad_glLightxOES; +PFNGLLIGHTXVOESPROC glad_glLightxvOES; +PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; +PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; +PFNGLMATERIALXOESPROC glad_glMaterialxOES; +PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; +PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; +PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; +PFNGLNORMAL3XOESPROC glad_glNormal3xOES; +PFNGLORTHOXOESPROC glad_glOrthoxOES; +PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; +PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; +PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; +PFNGLROTATEXOESPROC glad_glRotatexOES; +PFNGLSCALEXOESPROC glad_glScalexOES; +PFNGLTEXENVXOESPROC glad_glTexEnvxOES; +PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; +PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; +PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; +PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; +PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; +PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; +PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; +PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; +PFNGLACCUMXOESPROC glad_glAccumxOES; +PFNGLBITMAPXOESPROC glad_glBitmapxOES; +PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; +PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; +PFNGLCOLOR3XOESPROC glad_glColor3xOES; +PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; +PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; +PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; +PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; +PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; +PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; +PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; +PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; +PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; +PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; +PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; +PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; +PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; +PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; +PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; +PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; +PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; +PFNGLINDEXXOESPROC glad_glIndexxOES; +PFNGLINDEXXVOESPROC glad_glIndexxvOES; +PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; +PFNGLMAP1XOESPROC glad_glMap1xOES; +PFNGLMAP2XOESPROC glad_glMap2xOES; +PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; +PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; +PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; +PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; +PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; +PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; +PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; +PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; +PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; +PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; +PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; +PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; +PFNGLPIXELMAPXPROC glad_glPixelMapx; +PFNGLPIXELSTOREXPROC glad_glPixelStorex; +PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; +PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; +PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; +PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; +PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; +PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; +PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; +PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; +PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; +PFNGLRECTXOESPROC glad_glRectxOES; +PFNGLRECTXVOESPROC glad_glRectxvOES; +PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; +PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; +PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; +PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; +PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; +PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; +PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; +PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; +PFNGLTEXGENXOESPROC glad_glTexGenxOES; +PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; +PFNGLVERTEX2XOESPROC glad_glVertex2xOES; +PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; +PFNGLVERTEX3XOESPROC glad_glVertex3xOES; +PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; +PFNGLVERTEX4XOESPROC glad_glVertex4xOES; +PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; +PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; +PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; +PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; +PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; +PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; +PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; +PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; +PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; +PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; +PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; +PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; +PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; +PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; +PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; +PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; +PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; +PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; +PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; +PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; +PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; +PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; +PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; +PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; +PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; +PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; +PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; +PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; +PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; +PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; +PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; +PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; +PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; +PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; +PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; +PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; +PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; +PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; +PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; +PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; +PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); +} +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); +} +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); +} +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); +} +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); +} +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); +} +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); +} +static void load_GL_VERSION_2_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_1) return; + glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); + glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); + glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); + glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); + glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); + glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); +} +static void load_GL_VERSION_3_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_0) return; + glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); + glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); + glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); + glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); + glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); + glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); + glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); + glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); + glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); + glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); + glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); + glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); + glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); + glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); + glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); + glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); + glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); + glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); + glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); + glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); + glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); + glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); + glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); + glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); + glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); + glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); + glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); + glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); + glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); + glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); + glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); + glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); + glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); + glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); + glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); + glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); + glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); + glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); + glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); + glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); + glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); + glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); + glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); + glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); + glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); + glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); + glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); + glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); + glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); + glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); + glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); + glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); + glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); + glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); +} +static void load_GL_VERSION_3_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_1) return; + glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); + glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); + glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); + glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); +} +static void load_GL_VERSION_3_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_2) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); + glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); + glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); + glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); +} +static void load_GL_VERSION_3_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_3) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); + glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); + glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); + glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); + glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); + glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); + glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); + glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); + glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); + glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); + glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); + glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); + glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); + glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); + glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); + glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); +} +static void load_GL_APPLE_element_array(GLADloadproc load) { + if(!GLAD_GL_APPLE_element_array) return; + glad_glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)load("glElementPointerAPPLE"); + glad_glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)load("glDrawElementArrayAPPLE"); + glad_glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)load("glDrawRangeElementArrayAPPLE"); + glad_glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)load("glMultiDrawElementArrayAPPLE"); + glad_glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)load("glMultiDrawRangeElementArrayAPPLE"); +} +static void load_GL_AMD_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_AMD_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)load("glMultiDrawArraysIndirectAMD"); + glad_glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)load("glMultiDrawElementsIndirectAMD"); +} +static void load_GL_SGIX_tag_sample_buffer(GLADloadproc load) { + if(!GLAD_GL_SGIX_tag_sample_buffer) return; + glad_glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)load("glTagSampleBufferSGIX"); +} +static void load_GL_NV_point_sprite(GLADloadproc load) { + if(!GLAD_GL_NV_point_sprite) return; + glad_glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)load("glPointParameteriNV"); + glad_glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)load("glPointParameterivNV"); +} +static void load_GL_ATI_separate_stencil(GLADloadproc load) { + if(!GLAD_GL_ATI_separate_stencil) return; + glad_glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)load("glStencilOpSeparateATI"); + glad_glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)load("glStencilFuncSeparateATI"); +} +static void load_GL_EXT_texture_buffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_buffer_object) return; + glad_glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)load("glTexBufferEXT"); +} +static void load_GL_ARB_vertex_blend(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_blend) return; + glad_glWeightbvARB = (PFNGLWEIGHTBVARBPROC)load("glWeightbvARB"); + glad_glWeightsvARB = (PFNGLWEIGHTSVARBPROC)load("glWeightsvARB"); + glad_glWeightivARB = (PFNGLWEIGHTIVARBPROC)load("glWeightivARB"); + glad_glWeightfvARB = (PFNGLWEIGHTFVARBPROC)load("glWeightfvARB"); + glad_glWeightdvARB = (PFNGLWEIGHTDVARBPROC)load("glWeightdvARB"); + glad_glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)load("glWeightubvARB"); + glad_glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)load("glWeightusvARB"); + glad_glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)load("glWeightuivARB"); + glad_glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)load("glWeightPointerARB"); + glad_glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)load("glVertexBlendARB"); +} +static void load_GL_OVR_multiview(GLADloadproc load) { + if(!GLAD_GL_OVR_multiview) return; + glad_glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)load("glFramebufferTextureMultiviewOVR"); +} +static void load_GL_ARB_program_interface_query(GLADloadproc load) { + if(!GLAD_GL_ARB_program_interface_query) return; + glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); + glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); + glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); + glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); + glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); + glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); +} +static void load_GL_EXT_index_func(GLADloadproc load) { + if(!GLAD_GL_EXT_index_func) return; + glad_glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)load("glIndexFuncEXT"); +} +static void load_GL_NV_shader_buffer_load(GLADloadproc load) { + if(!GLAD_GL_NV_shader_buffer_load) return; + glad_glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)load("glMakeBufferResidentNV"); + glad_glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)load("glMakeBufferNonResidentNV"); + glad_glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)load("glIsBufferResidentNV"); + glad_glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)load("glMakeNamedBufferResidentNV"); + glad_glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)load("glMakeNamedBufferNonResidentNV"); + glad_glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)load("glIsNamedBufferResidentNV"); + glad_glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)load("glGetBufferParameterui64vNV"); + glad_glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)load("glGetNamedBufferParameterui64vNV"); + glad_glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)load("glGetIntegerui64vNV"); + glad_glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)load("glUniformui64NV"); + glad_glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)load("glUniformui64vNV"); + glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); + glad_glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)load("glProgramUniformui64NV"); + glad_glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)load("glProgramUniformui64vNV"); +} +static void load_GL_EXT_color_subtable(GLADloadproc load) { + if(!GLAD_GL_EXT_color_subtable) return; + glad_glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)load("glColorSubTableEXT"); + glad_glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)load("glCopyColorSubTableEXT"); +} +static void load_GL_SUNX_constant_data(GLADloadproc load) { + if(!GLAD_GL_SUNX_constant_data) return; + glad_glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)load("glFinishTextureSUNX"); +} +static void load_GL_EXT_multi_draw_arrays(GLADloadproc load) { + if(!GLAD_GL_EXT_multi_draw_arrays) return; + glad_glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)load("glMultiDrawArraysEXT"); + glad_glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)load("glMultiDrawElementsEXT"); +} +static void load_GL_ARB_shader_atomic_counters(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_atomic_counters) return; + glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); +} +static void load_GL_NV_conditional_render(GLADloadproc load) { + if(!GLAD_GL_NV_conditional_render) return; + glad_glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)load("glBeginConditionalRenderNV"); + glad_glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)load("glEndConditionalRenderNV"); +} +static void load_GL_MESA_resize_buffers(GLADloadproc load) { + if(!GLAD_GL_MESA_resize_buffers) return; + glad_glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)load("glResizeBuffersMESA"); +} +static void load_GL_ARB_texture_view(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_view) return; + glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); +} +static void load_GL_ARB_map_buffer_range(GLADloadproc load) { + if(!GLAD_GL_ARB_map_buffer_range) return; + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); +} +static void load_GL_EXT_convolution(GLADloadproc load) { + if(!GLAD_GL_EXT_convolution) return; + glad_glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)load("glConvolutionFilter1DEXT"); + glad_glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)load("glConvolutionFilter2DEXT"); + glad_glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)load("glConvolutionParameterfEXT"); + glad_glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)load("glConvolutionParameterfvEXT"); + glad_glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)load("glConvolutionParameteriEXT"); + glad_glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)load("glConvolutionParameterivEXT"); + glad_glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)load("glCopyConvolutionFilter1DEXT"); + glad_glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)load("glCopyConvolutionFilter2DEXT"); + glad_glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)load("glGetConvolutionFilterEXT"); + glad_glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)load("glGetConvolutionParameterfvEXT"); + glad_glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)load("glGetConvolutionParameterivEXT"); + glad_glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)load("glGetSeparableFilterEXT"); + glad_glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)load("glSeparableFilter2DEXT"); +} +static void load_GL_NV_vertex_attrib_integer_64bit(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_attrib_integer_64bit) return; + glad_glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)load("glVertexAttribL1i64NV"); + glad_glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)load("glVertexAttribL2i64NV"); + glad_glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)load("glVertexAttribL3i64NV"); + glad_glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)load("glVertexAttribL4i64NV"); + glad_glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)load("glVertexAttribL1i64vNV"); + glad_glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)load("glVertexAttribL2i64vNV"); + glad_glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)load("glVertexAttribL3i64vNV"); + glad_glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)load("glVertexAttribL4i64vNV"); + glad_glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)load("glVertexAttribL1ui64NV"); + glad_glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)load("glVertexAttribL2ui64NV"); + glad_glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)load("glVertexAttribL3ui64NV"); + glad_glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)load("glVertexAttribL4ui64NV"); + glad_glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)load("glVertexAttribL1ui64vNV"); + glad_glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)load("glVertexAttribL2ui64vNV"); + glad_glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)load("glVertexAttribL3ui64vNV"); + glad_glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)load("glVertexAttribL4ui64vNV"); + glad_glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)load("glGetVertexAttribLi64vNV"); + glad_glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)load("glGetVertexAttribLui64vNV"); + glad_glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)load("glVertexAttribLFormatNV"); +} +static void load_GL_EXT_paletted_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_paletted_texture) return; + glad_glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)load("glColorTableEXT"); + glad_glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)load("glGetColorTableEXT"); + glad_glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)load("glGetColorTableParameterivEXT"); + glad_glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)load("glGetColorTableParameterfvEXT"); +} +static void load_GL_ARB_texture_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_buffer_object) return; + glad_glTexBufferARB = (PFNGLTEXBUFFERARBPROC)load("glTexBufferARB"); +} +static void load_GL_ATI_pn_triangles(GLADloadproc load) { + if(!GLAD_GL_ATI_pn_triangles) return; + glad_glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)load("glPNTrianglesiATI"); + glad_glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)load("glPNTrianglesfATI"); +} +static void load_GL_SGIX_flush_raster(GLADloadproc load) { + if(!GLAD_GL_SGIX_flush_raster) return; + glad_glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)load("glFlushRasterSGIX"); +} +static void load_GL_EXT_light_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_light_texture) return; + glad_glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)load("glApplyTextureEXT"); + glad_glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)load("glTextureLightEXT"); + glad_glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)load("glTextureMaterialEXT"); +} +static void load_GL_HP_image_transform(GLADloadproc load) { + if(!GLAD_GL_HP_image_transform) return; + glad_glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)load("glImageTransformParameteriHP"); + glad_glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)load("glImageTransformParameterfHP"); + glad_glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)load("glImageTransformParameterivHP"); + glad_glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)load("glImageTransformParameterfvHP"); + glad_glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)load("glGetImageTransformParameterivHP"); + glad_glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)load("glGetImageTransformParameterfvHP"); +} +static void load_GL_AMD_draw_buffers_blend(GLADloadproc load) { + if(!GLAD_GL_AMD_draw_buffers_blend) return; + glad_glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)load("glBlendFuncIndexedAMD"); + glad_glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)load("glBlendFuncSeparateIndexedAMD"); + glad_glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)load("glBlendEquationIndexedAMD"); + glad_glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)load("glBlendEquationSeparateIndexedAMD"); +} +static void load_GL_APPLE_texture_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_texture_range) return; + glad_glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)load("glTextureRangeAPPLE"); + glad_glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)load("glGetTexParameterPointervAPPLE"); +} +static void load_GL_EXT_texture_array(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_array) return; + glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); +} +static void load_GL_NV_texture_barrier(GLADloadproc load) { + if(!GLAD_GL_NV_texture_barrier) return; + glad_glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)load("glTextureBarrierNV"); +} +static void load_GL_ARB_vertex_type_2_10_10_10_rev(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_type_2_10_10_10_rev) return; + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); +} +static void load_GL_3DFX_tbuffer(GLADloadproc load) { + if(!GLAD_GL_3DFX_tbuffer) return; + glad_glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)load("glTbufferMask3DFX"); +} +static void load_GL_GREMEDY_frame_terminator(GLADloadproc load) { + if(!GLAD_GL_GREMEDY_frame_terminator) return; + glad_glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)load("glFrameTerminatorGREMEDY"); +} +static void load_GL_ARB_blend_func_extended(GLADloadproc load) { + if(!GLAD_GL_ARB_blend_func_extended) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); +} +static void load_GL_EXT_separate_shader_objects(GLADloadproc load) { + if(!GLAD_GL_EXT_separate_shader_objects) return; + glad_glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)load("glUseShaderProgramEXT"); + glad_glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)load("glActiveProgramEXT"); + glad_glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)load("glCreateShaderProgramEXT"); + glad_glActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC)load("glActiveShaderProgramEXT"); + glad_glBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC)load("glBindProgramPipelineEXT"); + glad_glCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC)load("glCreateShaderProgramvEXT"); + glad_glDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC)load("glDeleteProgramPipelinesEXT"); + glad_glGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC)load("glGenProgramPipelinesEXT"); + glad_glGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)load("glGetProgramPipelineInfoLogEXT"); + glad_glGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC)load("glGetProgramPipelineivEXT"); + glad_glIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC)load("glIsProgramPipelineEXT"); + glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); + glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); + glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); + glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); + glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); + glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); + glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); + glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); + glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); + glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); + glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); + glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); + glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); + glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); + glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); + glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); + glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); + glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); + glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC)load("glUseProgramStagesEXT"); + glad_glValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)load("glValidateProgramPipelineEXT"); + glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); + glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); + glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); + glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); + glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); + glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); + glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); + glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); + glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); + glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); + glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); + glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); + glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); +} +static void load_GL_NV_texture_multisample(GLADloadproc load) { + if(!GLAD_GL_NV_texture_multisample) return; + glad_glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTexImage2DMultisampleCoverageNV"); + glad_glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTexImage3DMultisampleCoverageNV"); + glad_glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)load("glTextureImage2DMultisampleNV"); + glad_glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)load("glTextureImage3DMultisampleNV"); + glad_glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTextureImage2DMultisampleCoverageNV"); + glad_glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTextureImage3DMultisampleCoverageNV"); +} +static void load_GL_ARB_shader_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_objects) return; + glad_glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)load("glDeleteObjectARB"); + glad_glGetHandleARB = (PFNGLGETHANDLEARBPROC)load("glGetHandleARB"); + glad_glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)load("glDetachObjectARB"); + glad_glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)load("glCreateShaderObjectARB"); + glad_glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)load("glShaderSourceARB"); + glad_glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)load("glCompileShaderARB"); + glad_glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)load("glCreateProgramObjectARB"); + glad_glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)load("glAttachObjectARB"); + glad_glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)load("glLinkProgramARB"); + glad_glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)load("glUseProgramObjectARB"); + glad_glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)load("glValidateProgramARB"); + glad_glUniform1fARB = (PFNGLUNIFORM1FARBPROC)load("glUniform1fARB"); + glad_glUniform2fARB = (PFNGLUNIFORM2FARBPROC)load("glUniform2fARB"); + glad_glUniform3fARB = (PFNGLUNIFORM3FARBPROC)load("glUniform3fARB"); + glad_glUniform4fARB = (PFNGLUNIFORM4FARBPROC)load("glUniform4fARB"); + glad_glUniform1iARB = (PFNGLUNIFORM1IARBPROC)load("glUniform1iARB"); + glad_glUniform2iARB = (PFNGLUNIFORM2IARBPROC)load("glUniform2iARB"); + glad_glUniform3iARB = (PFNGLUNIFORM3IARBPROC)load("glUniform3iARB"); + glad_glUniform4iARB = (PFNGLUNIFORM4IARBPROC)load("glUniform4iARB"); + glad_glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)load("glUniform1fvARB"); + glad_glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)load("glUniform2fvARB"); + glad_glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)load("glUniform3fvARB"); + glad_glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)load("glUniform4fvARB"); + glad_glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)load("glUniform1ivARB"); + glad_glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)load("glUniform2ivARB"); + glad_glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)load("glUniform3ivARB"); + glad_glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)load("glUniform4ivARB"); + glad_glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)load("glUniformMatrix2fvARB"); + glad_glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)load("glUniformMatrix3fvARB"); + glad_glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)load("glUniformMatrix4fvARB"); + glad_glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)load("glGetObjectParameterfvARB"); + glad_glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)load("glGetObjectParameterivARB"); + glad_glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)load("glGetInfoLogARB"); + glad_glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)load("glGetAttachedObjectsARB"); + glad_glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)load("glGetUniformLocationARB"); + glad_glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)load("glGetActiveUniformARB"); + glad_glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)load("glGetUniformfvARB"); + glad_glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)load("glGetUniformivARB"); + glad_glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)load("glGetShaderSourceARB"); +} +static void load_GL_ARB_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_framebuffer_object) return; + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); +} +static void load_GL_ATI_envmap_bumpmap(GLADloadproc load) { + if(!GLAD_GL_ATI_envmap_bumpmap) return; + glad_glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)load("glTexBumpParameterivATI"); + glad_glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)load("glTexBumpParameterfvATI"); + glad_glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)load("glGetTexBumpParameterivATI"); + glad_glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)load("glGetTexBumpParameterfvATI"); +} +static void load_GL_ATI_map_object_buffer(GLADloadproc load) { + if(!GLAD_GL_ATI_map_object_buffer) return; + glad_glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)load("glMapObjectBufferATI"); + glad_glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)load("glUnmapObjectBufferATI"); +} +static void load_GL_ARB_robustness(GLADloadproc load) { + if(!GLAD_GL_ARB_robustness) return; + glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)load("glGetGraphicsResetStatusARB"); + glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)load("glGetnTexImageARB"); + glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)load("glReadnPixelsARB"); + glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)load("glGetnCompressedTexImageARB"); + glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)load("glGetnUniformfvARB"); + glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)load("glGetnUniformivARB"); + glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)load("glGetnUniformuivARB"); + glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)load("glGetnUniformdvARB"); + glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)load("glGetnMapdvARB"); + glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)load("glGetnMapfvARB"); + glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)load("glGetnMapivARB"); + glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)load("glGetnPixelMapfvARB"); + glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)load("glGetnPixelMapuivARB"); + glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)load("glGetnPixelMapusvARB"); + glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)load("glGetnPolygonStippleARB"); + glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)load("glGetnColorTableARB"); + glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)load("glGetnConvolutionFilterARB"); + glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)load("glGetnSeparableFilterARB"); + glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)load("glGetnHistogramARB"); + glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)load("glGetnMinmaxARB"); +} +static void load_GL_NV_pixel_data_range(GLADloadproc load) { + if(!GLAD_GL_NV_pixel_data_range) return; + glad_glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)load("glPixelDataRangeNV"); + glad_glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)load("glFlushPixelDataRangeNV"); +} +static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_blit) return; + glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); +} +static void load_GL_ARB_gpu_shader_fp64(GLADloadproc load) { + if(!GLAD_GL_ARB_gpu_shader_fp64) return; + glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); + glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); + glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); + glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); + glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); + glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); + glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); + glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); + glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); + glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); + glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); + glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); + glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); + glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); + glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); + glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); + glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); + glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); +} +static void load_GL_NV_command_list(GLADloadproc load) { + if(!GLAD_GL_NV_command_list) return; + glad_glCreateStatesNV = (PFNGLCREATESTATESNVPROC)load("glCreateStatesNV"); + glad_glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)load("glDeleteStatesNV"); + glad_glIsStateNV = (PFNGLISSTATENVPROC)load("glIsStateNV"); + glad_glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)load("glStateCaptureNV"); + glad_glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)load("glGetCommandHeaderNV"); + glad_glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)load("glGetStageIndexNV"); + glad_glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)load("glDrawCommandsNV"); + glad_glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)load("glDrawCommandsAddressNV"); + glad_glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)load("glDrawCommandsStatesNV"); + glad_glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)load("glDrawCommandsStatesAddressNV"); + glad_glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)load("glCreateCommandListsNV"); + glad_glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)load("glDeleteCommandListsNV"); + glad_glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)load("glIsCommandListNV"); + glad_glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)load("glListDrawCommandsStatesClientNV"); + glad_glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)load("glCommandListSegmentsNV"); + glad_glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)load("glCompileCommandListNV"); + glad_glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)load("glCallCommandListNV"); +} +static void load_GL_EXT_vertex_weighting(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_weighting) return; + glad_glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)load("glVertexWeightfEXT"); + glad_glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)load("glVertexWeightfvEXT"); + glad_glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)load("glVertexWeightPointerEXT"); +} +static void load_GL_GREMEDY_string_marker(GLADloadproc load) { + if(!GLAD_GL_GREMEDY_string_marker) return; + glad_glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)load("glStringMarkerGREMEDY"); +} +static void load_GL_EXT_subtexture(GLADloadproc load) { + if(!GLAD_GL_EXT_subtexture) return; + glad_glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)load("glTexSubImage1DEXT"); + glad_glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)load("glTexSubImage2DEXT"); +} +static void load_GL_EXT_gpu_program_parameters(GLADloadproc load) { + if(!GLAD_GL_EXT_gpu_program_parameters) return; + glad_glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)load("glProgramEnvParameters4fvEXT"); + glad_glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glProgramLocalParameters4fvEXT"); +} +static void load_GL_NV_evaluators(GLADloadproc load) { + if(!GLAD_GL_NV_evaluators) return; + glad_glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)load("glMapControlPointsNV"); + glad_glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)load("glMapParameterivNV"); + glad_glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)load("glMapParameterfvNV"); + glad_glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)load("glGetMapControlPointsNV"); + glad_glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)load("glGetMapParameterivNV"); + glad_glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)load("glGetMapParameterfvNV"); + glad_glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)load("glGetMapAttribParameterivNV"); + glad_glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)load("glGetMapAttribParameterfvNV"); + glad_glEvalMapsNV = (PFNGLEVALMAPSNVPROC)load("glEvalMapsNV"); +} +static void load_GL_SGIS_texture_filter4(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture_filter4) return; + glad_glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)load("glGetTexFilterFuncSGIS"); + glad_glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)load("glTexFilterFuncSGIS"); +} +static void load_GL_AMD_performance_monitor(GLADloadproc load) { + if(!GLAD_GL_AMD_performance_monitor) return; + glad_glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)load("glGetPerfMonitorGroupsAMD"); + glad_glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)load("glGetPerfMonitorCountersAMD"); + glad_glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)load("glGetPerfMonitorGroupStringAMD"); + glad_glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)load("glGetPerfMonitorCounterStringAMD"); + glad_glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)load("glGetPerfMonitorCounterInfoAMD"); + glad_glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)load("glGenPerfMonitorsAMD"); + glad_glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)load("glDeletePerfMonitorsAMD"); + glad_glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)load("glSelectPerfMonitorCountersAMD"); + glad_glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)load("glBeginPerfMonitorAMD"); + glad_glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)load("glEndPerfMonitorAMD"); + glad_glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)load("glGetPerfMonitorCounterDataAMD"); +} +static void load_GL_EXT_stencil_clear_tag(GLADloadproc load) { + if(!GLAD_GL_EXT_stencil_clear_tag) return; + glad_glStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC)load("glStencilClearTagEXT"); +} +static void load_GL_NV_present_video(GLADloadproc load) { + if(!GLAD_GL_NV_present_video) return; + glad_glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)load("glPresentFrameKeyedNV"); + glad_glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)load("glPresentFrameDualFillNV"); + glad_glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)load("glGetVideoivNV"); + glad_glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)load("glGetVideouivNV"); + glad_glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)load("glGetVideoi64vNV"); + glad_glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)load("glGetVideoui64vNV"); +} +static void load_GL_SGIX_framezoom(GLADloadproc load) { + if(!GLAD_GL_SGIX_framezoom) return; + glad_glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)load("glFrameZoomSGIX"); +} +static void load_GL_ARB_draw_elements_base_vertex(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_elements_base_vertex) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); +} +static void load_GL_NV_transform_feedback(GLADloadproc load) { + if(!GLAD_GL_NV_transform_feedback) return; + glad_glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)load("glBeginTransformFeedbackNV"); + glad_glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)load("glEndTransformFeedbackNV"); + glad_glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)load("glTransformFeedbackAttribsNV"); + glad_glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)load("glBindBufferRangeNV"); + glad_glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)load("glBindBufferOffsetNV"); + glad_glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)load("glBindBufferBaseNV"); + glad_glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)load("glTransformFeedbackVaryingsNV"); + glad_glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)load("glActiveVaryingNV"); + glad_glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)load("glGetVaryingLocationNV"); + glad_glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)load("glGetActiveVaryingNV"); + glad_glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)load("glGetTransformFeedbackVaryingNV"); + glad_glTransformFeedbackStreamAttribsNV = (PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)load("glTransformFeedbackStreamAttribsNV"); +} +static void load_GL_NV_fragment_program(GLADloadproc load) { + if(!GLAD_GL_NV_fragment_program) return; + glad_glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)load("glProgramNamedParameter4fNV"); + glad_glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)load("glProgramNamedParameter4fvNV"); + glad_glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)load("glProgramNamedParameter4dNV"); + glad_glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)load("glProgramNamedParameter4dvNV"); + glad_glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)load("glGetProgramNamedParameterfvNV"); + glad_glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)load("glGetProgramNamedParameterdvNV"); +} +static void load_GL_AMD_stencil_operation_extended(GLADloadproc load) { + if(!GLAD_GL_AMD_stencil_operation_extended) return; + glad_glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)load("glStencilOpValueAMD"); +} +static void load_GL_ARB_instanced_arrays(GLADloadproc load) { + if(!GLAD_GL_ARB_instanced_arrays) return; + glad_glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)load("glVertexAttribDivisorARB"); +} +static void load_GL_EXT_polygon_offset(GLADloadproc load) { + if(!GLAD_GL_EXT_polygon_offset) return; + glad_glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)load("glPolygonOffsetEXT"); +} +static void load_GL_KHR_robustness(GLADloadproc load) { + if(!GLAD_GL_KHR_robustness) return; + glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); + glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); + glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); + glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); + glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); + glad_glGetGraphicsResetStatusKHR = (PFNGLGETGRAPHICSRESETSTATUSKHRPROC)load("glGetGraphicsResetStatusKHR"); + glad_glReadnPixelsKHR = (PFNGLREADNPIXELSKHRPROC)load("glReadnPixelsKHR"); + glad_glGetnUniformfvKHR = (PFNGLGETNUNIFORMFVKHRPROC)load("glGetnUniformfvKHR"); + glad_glGetnUniformivKHR = (PFNGLGETNUNIFORMIVKHRPROC)load("glGetnUniformivKHR"); + glad_glGetnUniformuivKHR = (PFNGLGETNUNIFORMUIVKHRPROC)load("glGetnUniformuivKHR"); +} +static void load_GL_AMD_sparse_texture(GLADloadproc load) { + if(!GLAD_GL_AMD_sparse_texture) return; + glad_glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)load("glTexStorageSparseAMD"); + glad_glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)load("glTextureStorageSparseAMD"); +} +static void load_GL_ARB_clip_control(GLADloadproc load) { + if(!GLAD_GL_ARB_clip_control) return; + glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); +} +static void load_GL_NV_fragment_coverage_to_color(GLADloadproc load) { + if(!GLAD_GL_NV_fragment_coverage_to_color) return; + glad_glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)load("glFragmentCoverageColorNV"); +} +static void load_GL_NV_fence(GLADloadproc load) { + if(!GLAD_GL_NV_fence) return; + glad_glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)load("glDeleteFencesNV"); + glad_glGenFencesNV = (PFNGLGENFENCESNVPROC)load("glGenFencesNV"); + glad_glIsFenceNV = (PFNGLISFENCENVPROC)load("glIsFenceNV"); + glad_glTestFenceNV = (PFNGLTESTFENCENVPROC)load("glTestFenceNV"); + glad_glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)load("glGetFenceivNV"); + glad_glFinishFenceNV = (PFNGLFINISHFENCENVPROC)load("glFinishFenceNV"); + glad_glSetFenceNV = (PFNGLSETFENCENVPROC)load("glSetFenceNV"); +} +static void load_GL_ARB_texture_buffer_range(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_buffer_range) return; + glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); +} +static void load_GL_SUN_mesh_array(GLADloadproc load) { + if(!GLAD_GL_SUN_mesh_array) return; + glad_glDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC)load("glDrawMeshArraysSUN"); +} +static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_attrib_binding) return; + glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); + glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); + glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); + glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); + glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); + glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); +} +static void load_GL_ARB_framebuffer_no_attachments(GLADloadproc load) { + if(!GLAD_GL_ARB_framebuffer_no_attachments) return; + glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); + glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); +} +static void load_GL_ARB_cl_event(GLADloadproc load) { + if(!GLAD_GL_ARB_cl_event) return; + glad_glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)load("glCreateSyncFromCLeventARB"); +} +static void load_GL_OES_single_precision(GLADloadproc load) { + if(!GLAD_GL_OES_single_precision) return; + glad_glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)load("glClearDepthfOES"); + glad_glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)load("glClipPlanefOES"); + glad_glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)load("glDepthRangefOES"); + glad_glFrustumfOES = (PFNGLFRUSTUMFOESPROC)load("glFrustumfOES"); + glad_glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)load("glGetClipPlanefOES"); + glad_glOrthofOES = (PFNGLORTHOFOESPROC)load("glOrthofOES"); +} +static void load_GL_NV_primitive_restart(GLADloadproc load) { + if(!GLAD_GL_NV_primitive_restart) return; + glad_glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)load("glPrimitiveRestartNV"); + glad_glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)load("glPrimitiveRestartIndexNV"); +} +static void load_GL_SUN_global_alpha(GLADloadproc load) { + if(!GLAD_GL_SUN_global_alpha) return; + glad_glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)load("glGlobalAlphaFactorbSUN"); + glad_glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)load("glGlobalAlphaFactorsSUN"); + glad_glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)load("glGlobalAlphaFactoriSUN"); + glad_glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)load("glGlobalAlphaFactorfSUN"); + glad_glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)load("glGlobalAlphaFactordSUN"); + glad_glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)load("glGlobalAlphaFactorubSUN"); + glad_glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)load("glGlobalAlphaFactorusSUN"); + glad_glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)load("glGlobalAlphaFactoruiSUN"); +} +static void load_GL_EXT_texture_object(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_object) return; + glad_glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)load("glAreTexturesResidentEXT"); + glad_glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)load("glBindTextureEXT"); + glad_glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)load("glDeleteTexturesEXT"); + glad_glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)load("glGenTexturesEXT"); + glad_glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)load("glIsTextureEXT"); + glad_glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)load("glPrioritizeTexturesEXT"); +} +static void load_GL_AMD_name_gen_delete(GLADloadproc load) { + if(!GLAD_GL_AMD_name_gen_delete) return; + glad_glGenNamesAMD = (PFNGLGENNAMESAMDPROC)load("glGenNamesAMD"); + glad_glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)load("glDeleteNamesAMD"); + glad_glIsNameAMD = (PFNGLISNAMEAMDPROC)load("glIsNameAMD"); +} +static void load_GL_ARB_buffer_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_buffer_storage) return; + glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); +} +static void load_GL_APPLE_vertex_program_evaluators(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_program_evaluators) return; + glad_glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)load("glEnableVertexAttribAPPLE"); + glad_glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)load("glDisableVertexAttribAPPLE"); + glad_glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)load("glIsVertexAttribEnabledAPPLE"); + glad_glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)load("glMapVertexAttrib1dAPPLE"); + glad_glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)load("glMapVertexAttrib1fAPPLE"); + glad_glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)load("glMapVertexAttrib2dAPPLE"); + glad_glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)load("glMapVertexAttrib2fAPPLE"); +} +static void load_GL_ARB_multi_bind(GLADloadproc load) { + if(!GLAD_GL_ARB_multi_bind) return; + glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); + glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); + glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); + glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); + glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); + glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); +} +static void load_GL_SGIX_list_priority(GLADloadproc load) { + if(!GLAD_GL_SGIX_list_priority) return; + glad_glGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC)load("glGetListParameterfvSGIX"); + glad_glGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC)load("glGetListParameterivSGIX"); + glad_glListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC)load("glListParameterfSGIX"); + glad_glListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC)load("glListParameterfvSGIX"); + glad_glListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC)load("glListParameteriSGIX"); + glad_glListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC)load("glListParameterivSGIX"); +} +static void load_GL_NV_vertex_buffer_unified_memory(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_buffer_unified_memory) return; + glad_glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)load("glBufferAddressRangeNV"); + glad_glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)load("glVertexFormatNV"); + glad_glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)load("glNormalFormatNV"); + glad_glColorFormatNV = (PFNGLCOLORFORMATNVPROC)load("glColorFormatNV"); + glad_glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)load("glIndexFormatNV"); + glad_glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)load("glTexCoordFormatNV"); + glad_glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)load("glEdgeFlagFormatNV"); + glad_glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)load("glSecondaryColorFormatNV"); + glad_glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)load("glFogCoordFormatNV"); + glad_glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)load("glVertexAttribFormatNV"); + glad_glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)load("glVertexAttribIFormatNV"); + glad_glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)load("glGetIntegerui64i_vNV"); +} +static void load_GL_NV_blend_equation_advanced(GLADloadproc load) { + if(!GLAD_GL_NV_blend_equation_advanced) return; + glad_glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)load("glBlendParameteriNV"); + glad_glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)load("glBlendBarrierNV"); +} +static void load_GL_SGIS_sharpen_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_sharpen_texture) return; + glad_glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)load("glSharpenTexFuncSGIS"); + glad_glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)load("glGetSharpenTexFuncSGIS"); +} +static void load_GL_ARB_vertex_program(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_program) return; + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); +} +static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_buffer_object) return; + glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); + glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); + glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); + glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); + glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); + glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); + glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); + glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); + glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); + glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); + glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); +} +static void load_GL_NV_vertex_array_range(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_array_range) return; + glad_glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)load("glFlushVertexArrayRangeNV"); + glad_glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)load("glVertexArrayRangeNV"); +} +static void load_GL_SGIX_fragment_lighting(GLADloadproc load) { + if(!GLAD_GL_SGIX_fragment_lighting) return; + glad_glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)load("glFragmentColorMaterialSGIX"); + glad_glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)load("glFragmentLightfSGIX"); + glad_glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)load("glFragmentLightfvSGIX"); + glad_glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)load("glFragmentLightiSGIX"); + glad_glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)load("glFragmentLightivSGIX"); + glad_glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)load("glFragmentLightModelfSGIX"); + glad_glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)load("glFragmentLightModelfvSGIX"); + glad_glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)load("glFragmentLightModeliSGIX"); + glad_glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)load("glFragmentLightModelivSGIX"); + glad_glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)load("glFragmentMaterialfSGIX"); + glad_glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)load("glFragmentMaterialfvSGIX"); + glad_glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)load("glFragmentMaterialiSGIX"); + glad_glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)load("glFragmentMaterialivSGIX"); + glad_glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)load("glGetFragmentLightfvSGIX"); + glad_glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)load("glGetFragmentLightivSGIX"); + glad_glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)load("glGetFragmentMaterialfvSGIX"); + glad_glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)load("glGetFragmentMaterialivSGIX"); + glad_glLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC)load("glLightEnviSGIX"); +} +static void load_GL_NV_framebuffer_multisample_coverage(GLADloadproc load) { + if(!GLAD_GL_NV_framebuffer_multisample_coverage) return; + glad_glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)load("glRenderbufferStorageMultisampleCoverageNV"); +} +static void load_GL_EXT_timer_query(GLADloadproc load) { + if(!GLAD_GL_EXT_timer_query) return; + glad_glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)load("glGetQueryObjecti64vEXT"); + glad_glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)load("glGetQueryObjectui64vEXT"); +} +static void load_GL_NV_bindless_texture(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_texture) return; + glad_glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)load("glGetTextureHandleNV"); + glad_glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)load("glGetTextureSamplerHandleNV"); + glad_glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)load("glMakeTextureHandleResidentNV"); + glad_glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)load("glMakeTextureHandleNonResidentNV"); + glad_glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)load("glGetImageHandleNV"); + glad_glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)load("glMakeImageHandleResidentNV"); + glad_glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)load("glMakeImageHandleNonResidentNV"); + glad_glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)load("glUniformHandleui64NV"); + glad_glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)load("glUniformHandleui64vNV"); + glad_glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)load("glProgramUniformHandleui64NV"); + glad_glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)load("glProgramUniformHandleui64vNV"); + glad_glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)load("glIsTextureHandleResidentNV"); + glad_glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)load("glIsImageHandleResidentNV"); +} +static void load_GL_KHR_debug(GLADloadproc load) { + if(!GLAD_GL_KHR_debug) return; + glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); + glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); + glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); + glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); + glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); + glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); + glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); + glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); + glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); + glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); + glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); + glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); + glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); + glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); + glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); + glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); + glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); + glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); + glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); + glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); +} +static void load_GL_ATI_vertex_attrib_array_object(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_attrib_array_object) return; + glad_glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)load("glVertexAttribArrayObjectATI"); + glad_glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)load("glGetVertexAttribArrayObjectfvATI"); + glad_glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)load("glGetVertexAttribArrayObjectivATI"); +} +static void load_GL_EXT_geometry_shader4(GLADloadproc load) { + if(!GLAD_GL_EXT_geometry_shader4) return; + glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); +} +static void load_GL_EXT_bindable_uniform(GLADloadproc load) { + if(!GLAD_GL_EXT_bindable_uniform) return; + glad_glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)load("glUniformBufferEXT"); + glad_glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)load("glGetUniformBufferSizeEXT"); + glad_glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)load("glGetUniformOffsetEXT"); +} +static void load_GL_KHR_blend_equation_advanced(GLADloadproc load) { + if(!GLAD_GL_KHR_blend_equation_advanced) return; + glad_glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)load("glBlendBarrierKHR"); +} +static void load_GL_ATI_element_array(GLADloadproc load) { + if(!GLAD_GL_ATI_element_array) return; + glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); + glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); + glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); +} +static void load_GL_SGIX_reference_plane(GLADloadproc load) { + if(!GLAD_GL_SGIX_reference_plane) return; + glad_glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)load("glReferencePlaneSGIX"); +} +static void load_GL_EXT_stencil_two_side(GLADloadproc load) { + if(!GLAD_GL_EXT_stencil_two_side) return; + glad_glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)load("glActiveStencilFaceEXT"); +} +static void load_GL_NV_explicit_multisample(GLADloadproc load) { + if(!GLAD_GL_NV_explicit_multisample) return; + glad_glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)load("glGetMultisamplefvNV"); + glad_glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)load("glSampleMaskIndexedNV"); + glad_glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)load("glTexRenderbufferNV"); +} +static void load_GL_IBM_static_data(GLADloadproc load) { + if(!GLAD_GL_IBM_static_data) return; + glad_glFlushStaticDataIBM = (PFNGLFLUSHSTATICDATAIBMPROC)load("glFlushStaticDataIBM"); +} +static void load_GL_EXT_texture_perturb_normal(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_perturb_normal) return; + glad_glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)load("glTextureNormalEXT"); +} +static void load_GL_EXT_point_parameters(GLADloadproc load) { + if(!GLAD_GL_EXT_point_parameters) return; + glad_glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)load("glPointParameterfEXT"); + glad_glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)load("glPointParameterfvEXT"); +} +static void load_GL_PGI_misc_hints(GLADloadproc load) { + if(!GLAD_GL_PGI_misc_hints) return; + glad_glHintPGI = (PFNGLHINTPGIPROC)load("glHintPGI"); +} +static void load_GL_ARB_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_shader) return; + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); + glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); + glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); +} +static void load_GL_ARB_tessellation_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_tessellation_shader) return; + glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); + glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); +} +static void load_GL_EXT_draw_buffers2(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_buffers2) return; + glad_glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)load("glColorMaskIndexedEXT"); + glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); + glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); + glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); + glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); + glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); +} +static void load_GL_ARB_vertex_attrib_64bit(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_attrib_64bit) return; + glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); + glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); + glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); + glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); + glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); + glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); + glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); + glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); + glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); + glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); +} +static void load_GL_EXT_texture_filter_minmax(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_filter_minmax) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); +} +static void load_GL_AMD_interleaved_elements(GLADloadproc load) { + if(!GLAD_GL_AMD_interleaved_elements) return; + glad_glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)load("glVertexAttribParameteriAMD"); +} +static void load_GL_ARB_fragment_program(GLADloadproc load) { + if(!GLAD_GL_ARB_fragment_program) return; + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); +} +static void load_GL_ARB_texture_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_storage) return; + glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); + glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); + glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); +} +static void load_GL_ARB_copy_image(GLADloadproc load) { + if(!GLAD_GL_ARB_copy_image) return; + glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); +} +static void load_GL_SGIS_pixel_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_pixel_texture) return; + glad_glPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC)load("glPixelTexGenParameteriSGIS"); + glad_glPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC)load("glPixelTexGenParameterivSGIS"); + glad_glPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC)load("glPixelTexGenParameterfSGIS"); + glad_glPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC)load("glPixelTexGenParameterfvSGIS"); + glad_glGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)load("glGetPixelTexGenParameterivSGIS"); + glad_glGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)load("glGetPixelTexGenParameterfvSGIS"); +} +static void load_GL_SGIX_instruments(GLADloadproc load) { + if(!GLAD_GL_SGIX_instruments) return; + glad_glGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC)load("glGetInstrumentsSGIX"); + glad_glInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC)load("glInstrumentsBufferSGIX"); + glad_glPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC)load("glPollInstrumentsSGIX"); + glad_glReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC)load("glReadInstrumentsSGIX"); + glad_glStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC)load("glStartInstrumentsSGIX"); + glad_glStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC)load("glStopInstrumentsSGIX"); +} +static void load_GL_ARB_shader_storage_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_storage_buffer_object) return; + glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); +} +static void load_GL_EXT_blend_minmax(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_minmax) return; + glad_glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)load("glBlendEquationEXT"); +} +static void load_GL_ARB_base_instance(GLADloadproc load) { + if(!GLAD_GL_ARB_base_instance) return; + glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); + glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); + glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); +} +static void load_GL_ARB_ES3_1_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES3_1_compatibility) return; + glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); +} +static void load_GL_EXT_texture_integer(GLADloadproc load) { + if(!GLAD_GL_EXT_texture_integer) return; + glad_glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)load("glTexParameterIivEXT"); + glad_glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)load("glTexParameterIuivEXT"); + glad_glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)load("glGetTexParameterIivEXT"); + glad_glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)load("glGetTexParameterIuivEXT"); + glad_glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)load("glClearColorIiEXT"); + glad_glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)load("glClearColorIuiEXT"); +} +static void load_GL_ARB_texture_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_multisample) return; + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); +} +static void load_GL_AMD_gpu_shader_int64(GLADloadproc load) { + if(!GLAD_GL_AMD_gpu_shader_int64) return; + glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); + glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); + glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); + glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); + glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); + glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); + glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); + glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); + glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); + glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); + glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); + glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); + glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); + glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); + glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); + glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); + glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); + glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); + glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); + glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); + glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); + glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); + glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); + glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); + glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); + glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); + glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); + glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); + glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); + glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); + glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); + glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); + glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); + glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); +} +static void load_GL_AMD_vertex_shader_tessellator(GLADloadproc load) { + if(!GLAD_GL_AMD_vertex_shader_tessellator) return; + glad_glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)load("glTessellationFactorAMD"); + glad_glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)load("glTessellationModeAMD"); +} +static void load_GL_ARB_invalidate_subdata(GLADloadproc load) { + if(!GLAD_GL_ARB_invalidate_subdata) return; + glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); + glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); + glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); + glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); + glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); + glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); +} +static void load_GL_EXT_index_material(GLADloadproc load) { + if(!GLAD_GL_EXT_index_material) return; + glad_glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)load("glIndexMaterialEXT"); +} +static void load_GL_INTEL_parallel_arrays(GLADloadproc load) { + if(!GLAD_GL_INTEL_parallel_arrays) return; + glad_glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)load("glVertexPointervINTEL"); + glad_glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)load("glNormalPointervINTEL"); + glad_glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)load("glColorPointervINTEL"); + glad_glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)load("glTexCoordPointervINTEL"); +} +static void load_GL_ATI_draw_buffers(GLADloadproc load) { + if(!GLAD_GL_ATI_draw_buffers) return; + glad_glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)load("glDrawBuffersATI"); +} +static void load_GL_SGIX_pixel_texture(GLADloadproc load) { + if(!GLAD_GL_SGIX_pixel_texture) return; + glad_glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)load("glPixelTexGenSGIX"); +} +static void load_GL_ARB_timer_query(GLADloadproc load) { + if(!GLAD_GL_ARB_timer_query) return; + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); +} +static void load_GL_NV_parameter_buffer_object(GLADloadproc load) { + if(!GLAD_GL_NV_parameter_buffer_object) return; + glad_glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)load("glProgramBufferParametersfvNV"); + glad_glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)load("glProgramBufferParametersIivNV"); + glad_glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)load("glProgramBufferParametersIuivNV"); +} +static void load_GL_ARB_direct_state_access(GLADloadproc load) { + if(!GLAD_GL_ARB_direct_state_access) return; + glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); + glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); + glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); + glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); + glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); + glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); + glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); + glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); + glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); + glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); + glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); + glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); + glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); + glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); + glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); + glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); + glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); + glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); + glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); + glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); + glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); + glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); + glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); + glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); + glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); + glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); + glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); + glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); + glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); + glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); + glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); + glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); + glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); + glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); + glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); + glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); + glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); + glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); + glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); + glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); + glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); + glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); + glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); + glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); + glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); + glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); + glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); + glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); + glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); + glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); + glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); + glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); + glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); + glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); + glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); + glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); + glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); + glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); + glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); + glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); + glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); + glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); + glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); + glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); + glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); + glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); + glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); + glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); + glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); + glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); + glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); + glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); + glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); + glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); + glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); + glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); + glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); + glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); + glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); + glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); + glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); + glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); + glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); + glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); + glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); + glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); + glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); + glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); + glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); + glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); + glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); + glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); + glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); + glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); + glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); + glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); + glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); +} +static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_uniform_buffer_object) return; + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); +} +static void load_GL_NV_transform_feedback2(GLADloadproc load) { + if(!GLAD_GL_NV_transform_feedback2) return; + glad_glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)load("glBindTransformFeedbackNV"); + glad_glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)load("glDeleteTransformFeedbacksNV"); + glad_glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)load("glGenTransformFeedbacksNV"); + glad_glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)load("glIsTransformFeedbackNV"); + glad_glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)load("glPauseTransformFeedbackNV"); + glad_glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)load("glResumeTransformFeedbackNV"); + glad_glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)load("glDrawTransformFeedbackNV"); +} +static void load_GL_EXT_blend_color(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_color) return; + glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); +} +static void load_GL_EXT_histogram(GLADloadproc load) { + if(!GLAD_GL_EXT_histogram) return; + glad_glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)load("glGetHistogramEXT"); + glad_glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)load("glGetHistogramParameterfvEXT"); + glad_glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)load("glGetHistogramParameterivEXT"); + glad_glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)load("glGetMinmaxEXT"); + glad_glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)load("glGetMinmaxParameterfvEXT"); + glad_glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)load("glGetMinmaxParameterivEXT"); + glad_glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)load("glHistogramEXT"); + glad_glMinmaxEXT = (PFNGLMINMAXEXTPROC)load("glMinmaxEXT"); + glad_glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)load("glResetHistogramEXT"); + glad_glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)load("glResetMinmaxEXT"); +} +static void load_GL_ARB_get_texture_sub_image(GLADloadproc load) { + if(!GLAD_GL_ARB_get_texture_sub_image) return; + glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); + glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); +} +static void load_GL_SGIS_point_parameters(GLADloadproc load) { + if(!GLAD_GL_SGIS_point_parameters) return; + glad_glPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC)load("glPointParameterfSGIS"); + glad_glPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC)load("glPointParameterfvSGIS"); +} +static void load_GL_EXT_direct_state_access(GLADloadproc load) { + if(!GLAD_GL_EXT_direct_state_access) return; + glad_glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)load("glMatrixLoadfEXT"); + glad_glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)load("glMatrixLoaddEXT"); + glad_glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)load("glMatrixMultfEXT"); + glad_glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)load("glMatrixMultdEXT"); + glad_glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)load("glMatrixLoadIdentityEXT"); + glad_glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)load("glMatrixRotatefEXT"); + glad_glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)load("glMatrixRotatedEXT"); + glad_glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)load("glMatrixScalefEXT"); + glad_glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)load("glMatrixScaledEXT"); + glad_glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)load("glMatrixTranslatefEXT"); + glad_glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)load("glMatrixTranslatedEXT"); + glad_glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)load("glMatrixFrustumEXT"); + glad_glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)load("glMatrixOrthoEXT"); + glad_glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)load("glMatrixPopEXT"); + glad_glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)load("glMatrixPushEXT"); + glad_glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)load("glClientAttribDefaultEXT"); + glad_glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)load("glPushClientAttribDefaultEXT"); + glad_glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)load("glTextureParameterfEXT"); + glad_glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)load("glTextureParameterfvEXT"); + glad_glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)load("glTextureParameteriEXT"); + glad_glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)load("glTextureParameterivEXT"); + glad_glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)load("glTextureImage1DEXT"); + glad_glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)load("glTextureImage2DEXT"); + glad_glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)load("glTextureSubImage1DEXT"); + glad_glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)load("glTextureSubImage2DEXT"); + glad_glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)load("glCopyTextureImage1DEXT"); + glad_glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)load("glCopyTextureImage2DEXT"); + glad_glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)load("glCopyTextureSubImage1DEXT"); + glad_glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)load("glCopyTextureSubImage2DEXT"); + glad_glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)load("glGetTextureImageEXT"); + glad_glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)load("glGetTextureParameterfvEXT"); + glad_glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)load("glGetTextureParameterivEXT"); + glad_glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)load("glGetTextureLevelParameterfvEXT"); + glad_glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)load("glGetTextureLevelParameterivEXT"); + glad_glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)load("glTextureImage3DEXT"); + glad_glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)load("glTextureSubImage3DEXT"); + glad_glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)load("glCopyTextureSubImage3DEXT"); + glad_glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)load("glBindMultiTextureEXT"); + glad_glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)load("glMultiTexCoordPointerEXT"); + glad_glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)load("glMultiTexEnvfEXT"); + glad_glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)load("glMultiTexEnvfvEXT"); + glad_glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)load("glMultiTexEnviEXT"); + glad_glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)load("glMultiTexEnvivEXT"); + glad_glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)load("glMultiTexGendEXT"); + glad_glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)load("glMultiTexGendvEXT"); + glad_glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)load("glMultiTexGenfEXT"); + glad_glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)load("glMultiTexGenfvEXT"); + glad_glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)load("glMultiTexGeniEXT"); + glad_glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)load("glMultiTexGenivEXT"); + glad_glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)load("glGetMultiTexEnvfvEXT"); + glad_glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)load("glGetMultiTexEnvivEXT"); + glad_glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)load("glGetMultiTexGendvEXT"); + glad_glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)load("glGetMultiTexGenfvEXT"); + glad_glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)load("glGetMultiTexGenivEXT"); + glad_glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)load("glMultiTexParameteriEXT"); + glad_glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)load("glMultiTexParameterivEXT"); + glad_glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)load("glMultiTexParameterfEXT"); + glad_glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)load("glMultiTexParameterfvEXT"); + glad_glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)load("glMultiTexImage1DEXT"); + glad_glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)load("glMultiTexImage2DEXT"); + glad_glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)load("glMultiTexSubImage1DEXT"); + glad_glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)load("glMultiTexSubImage2DEXT"); + glad_glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)load("glCopyMultiTexImage1DEXT"); + glad_glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)load("glCopyMultiTexImage2DEXT"); + glad_glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)load("glCopyMultiTexSubImage1DEXT"); + glad_glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)load("glCopyMultiTexSubImage2DEXT"); + glad_glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)load("glGetMultiTexImageEXT"); + glad_glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)load("glGetMultiTexParameterfvEXT"); + glad_glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)load("glGetMultiTexParameterivEXT"); + glad_glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)load("glGetMultiTexLevelParameterfvEXT"); + glad_glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)load("glGetMultiTexLevelParameterivEXT"); + glad_glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)load("glMultiTexImage3DEXT"); + glad_glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)load("glMultiTexSubImage3DEXT"); + glad_glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)load("glCopyMultiTexSubImage3DEXT"); + glad_glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)load("glEnableClientStateIndexedEXT"); + glad_glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)load("glDisableClientStateIndexedEXT"); + glad_glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)load("glGetFloatIndexedvEXT"); + glad_glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)load("glGetDoubleIndexedvEXT"); + glad_glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)load("glGetPointerIndexedvEXT"); + glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); + glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); + glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); + glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); + glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); + glad_glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)load("glCompressedTextureImage3DEXT"); + glad_glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)load("glCompressedTextureImage2DEXT"); + glad_glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)load("glCompressedTextureImage1DEXT"); + glad_glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)load("glCompressedTextureSubImage3DEXT"); + glad_glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)load("glCompressedTextureSubImage2DEXT"); + glad_glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)load("glCompressedTextureSubImage1DEXT"); + glad_glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)load("glGetCompressedTextureImageEXT"); + glad_glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)load("glCompressedMultiTexImage3DEXT"); + glad_glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)load("glCompressedMultiTexImage2DEXT"); + glad_glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)load("glCompressedMultiTexImage1DEXT"); + glad_glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)load("glCompressedMultiTexSubImage3DEXT"); + glad_glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)load("glCompressedMultiTexSubImage2DEXT"); + glad_glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)load("glCompressedMultiTexSubImage1DEXT"); + glad_glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)load("glGetCompressedMultiTexImageEXT"); + glad_glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)load("glMatrixLoadTransposefEXT"); + glad_glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)load("glMatrixLoadTransposedEXT"); + glad_glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)load("glMatrixMultTransposefEXT"); + glad_glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)load("glMatrixMultTransposedEXT"); + glad_glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)load("glNamedBufferDataEXT"); + glad_glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)load("glNamedBufferSubDataEXT"); + glad_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)load("glMapNamedBufferEXT"); + glad_glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)load("glUnmapNamedBufferEXT"); + glad_glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)load("glGetNamedBufferParameterivEXT"); + glad_glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)load("glGetNamedBufferPointervEXT"); + glad_glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)load("glGetNamedBufferSubDataEXT"); + glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); + glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); + glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); + glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); + glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); + glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); + glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); + glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); + glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); + glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); + glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); + glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); + glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); + glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); + glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); + glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); + glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); + glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); + glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); + glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); + glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); + glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); + glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); + glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); + glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); + glad_glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)load("glTextureBufferEXT"); + glad_glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)load("glMultiTexBufferEXT"); + glad_glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)load("glTextureParameterIivEXT"); + glad_glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)load("glTextureParameterIuivEXT"); + glad_glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)load("glGetTextureParameterIivEXT"); + glad_glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)load("glGetTextureParameterIuivEXT"); + glad_glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)load("glMultiTexParameterIivEXT"); + glad_glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)load("glMultiTexParameterIuivEXT"); + glad_glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)load("glGetMultiTexParameterIivEXT"); + glad_glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)load("glGetMultiTexParameterIuivEXT"); + glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); + glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); + glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); + glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); + glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); + glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); + glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); + glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); + glad_glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glNamedProgramLocalParameters4fvEXT"); + glad_glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)load("glNamedProgramLocalParameterI4iEXT"); + glad_glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)load("glNamedProgramLocalParameterI4ivEXT"); + glad_glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)load("glNamedProgramLocalParametersI4ivEXT"); + glad_glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)load("glNamedProgramLocalParameterI4uiEXT"); + glad_glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)load("glNamedProgramLocalParameterI4uivEXT"); + glad_glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)load("glNamedProgramLocalParametersI4uivEXT"); + glad_glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)load("glGetNamedProgramLocalParameterIivEXT"); + glad_glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)load("glGetNamedProgramLocalParameterIuivEXT"); + glad_glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)load("glEnableClientStateiEXT"); + glad_glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)load("glDisableClientStateiEXT"); + glad_glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)load("glGetFloati_vEXT"); + glad_glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)load("glGetDoublei_vEXT"); + glad_glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)load("glGetPointeri_vEXT"); + glad_glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)load("glNamedProgramStringEXT"); + glad_glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)load("glNamedProgramLocalParameter4dEXT"); + glad_glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)load("glNamedProgramLocalParameter4dvEXT"); + glad_glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)load("glNamedProgramLocalParameter4fEXT"); + glad_glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)load("glNamedProgramLocalParameter4fvEXT"); + glad_glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)load("glGetNamedProgramLocalParameterdvEXT"); + glad_glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)load("glGetNamedProgramLocalParameterfvEXT"); + glad_glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)load("glGetNamedProgramivEXT"); + glad_glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)load("glGetNamedProgramStringEXT"); + glad_glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)load("glNamedRenderbufferStorageEXT"); + glad_glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)load("glGetNamedRenderbufferParameterivEXT"); + glad_glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glNamedRenderbufferStorageMultisampleEXT"); + glad_glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)load("glNamedRenderbufferStorageMultisampleCoverageEXT"); + glad_glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)load("glCheckNamedFramebufferStatusEXT"); + glad_glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)load("glNamedFramebufferTexture1DEXT"); + glad_glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)load("glNamedFramebufferTexture2DEXT"); + glad_glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)load("glNamedFramebufferTexture3DEXT"); + glad_glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)load("glNamedFramebufferRenderbufferEXT"); + glad_glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetNamedFramebufferAttachmentParameterivEXT"); + glad_glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)load("glGenerateTextureMipmapEXT"); + glad_glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)load("glGenerateMultiTexMipmapEXT"); + glad_glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)load("glFramebufferDrawBufferEXT"); + glad_glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)load("glFramebufferDrawBuffersEXT"); + glad_glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)load("glFramebufferReadBufferEXT"); + glad_glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetFramebufferParameterivEXT"); + glad_glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)load("glNamedCopyBufferSubDataEXT"); + glad_glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)load("glNamedFramebufferTextureEXT"); + glad_glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)load("glNamedFramebufferTextureLayerEXT"); + glad_glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)load("glNamedFramebufferTextureFaceEXT"); + glad_glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)load("glTextureRenderbufferEXT"); + glad_glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)load("glMultiTexRenderbufferEXT"); + glad_glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)load("glVertexArrayVertexOffsetEXT"); + glad_glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)load("glVertexArrayColorOffsetEXT"); + glad_glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)load("glVertexArrayEdgeFlagOffsetEXT"); + glad_glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)load("glVertexArrayIndexOffsetEXT"); + glad_glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)load("glVertexArrayNormalOffsetEXT"); + glad_glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)load("glVertexArrayTexCoordOffsetEXT"); + glad_glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)load("glVertexArrayMultiTexCoordOffsetEXT"); + glad_glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)load("glVertexArrayFogCoordOffsetEXT"); + glad_glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)load("glVertexArraySecondaryColorOffsetEXT"); + glad_glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)load("glVertexArrayVertexAttribOffsetEXT"); + glad_glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)load("glVertexArrayVertexAttribIOffsetEXT"); + glad_glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)load("glEnableVertexArrayEXT"); + glad_glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)load("glDisableVertexArrayEXT"); + glad_glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)load("glEnableVertexArrayAttribEXT"); + glad_glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)load("glDisableVertexArrayAttribEXT"); + glad_glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)load("glGetVertexArrayIntegervEXT"); + glad_glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)load("glGetVertexArrayPointervEXT"); + glad_glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)load("glGetVertexArrayIntegeri_vEXT"); + glad_glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)load("glGetVertexArrayPointeri_vEXT"); + glad_glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)load("glMapNamedBufferRangeEXT"); + glad_glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)load("glFlushMappedNamedBufferRangeEXT"); + glad_glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)load("glNamedBufferStorageEXT"); + glad_glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)load("glClearNamedBufferDataEXT"); + glad_glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)load("glClearNamedBufferSubDataEXT"); + glad_glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)load("glNamedFramebufferParameteriEXT"); + glad_glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetNamedFramebufferParameterivEXT"); + glad_glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)load("glProgramUniform1dEXT"); + glad_glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)load("glProgramUniform2dEXT"); + glad_glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)load("glProgramUniform3dEXT"); + glad_glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)load("glProgramUniform4dEXT"); + glad_glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)load("glProgramUniform1dvEXT"); + glad_glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)load("glProgramUniform2dvEXT"); + glad_glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)load("glProgramUniform3dvEXT"); + glad_glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)load("glProgramUniform4dvEXT"); + glad_glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)load("glProgramUniformMatrix2dvEXT"); + glad_glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)load("glProgramUniformMatrix3dvEXT"); + glad_glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)load("glProgramUniformMatrix4dvEXT"); + glad_glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)load("glProgramUniformMatrix2x3dvEXT"); + glad_glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)load("glProgramUniformMatrix2x4dvEXT"); + glad_glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)load("glProgramUniformMatrix3x2dvEXT"); + glad_glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)load("glProgramUniformMatrix3x4dvEXT"); + glad_glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)load("glProgramUniformMatrix4x2dvEXT"); + glad_glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)load("glProgramUniformMatrix4x3dvEXT"); + glad_glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)load("glTextureBufferRangeEXT"); + glad_glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)load("glTextureStorage1DEXT"); + glad_glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)load("glTextureStorage2DEXT"); + glad_glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)load("glTextureStorage3DEXT"); + glad_glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)load("glTextureStorage2DMultisampleEXT"); + glad_glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)load("glTextureStorage3DMultisampleEXT"); + glad_glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)load("glVertexArrayBindVertexBufferEXT"); + glad_glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)load("glVertexArrayVertexAttribFormatEXT"); + glad_glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)load("glVertexArrayVertexAttribIFormatEXT"); + glad_glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)load("glVertexArrayVertexAttribLFormatEXT"); + glad_glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)load("glVertexArrayVertexAttribBindingEXT"); + glad_glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)load("glVertexArrayVertexBindingDivisorEXT"); + glad_glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)load("glVertexArrayVertexAttribLOffsetEXT"); + glad_glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)load("glTexturePageCommitmentEXT"); + glad_glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)load("glVertexArrayVertexAttribDivisorEXT"); +} +static void load_GL_AMD_sample_positions(GLADloadproc load) { + if(!GLAD_GL_AMD_sample_positions) return; + glad_glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)load("glSetMultisamplefvAMD"); +} +static void load_GL_NV_vertex_program(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_program) return; + glad_glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)load("glAreProgramsResidentNV"); + glad_glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)load("glBindProgramNV"); + glad_glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)load("glDeleteProgramsNV"); + glad_glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)load("glExecuteProgramNV"); + glad_glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)load("glGenProgramsNV"); + glad_glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)load("glGetProgramParameterdvNV"); + glad_glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)load("glGetProgramParameterfvNV"); + glad_glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)load("glGetProgramivNV"); + glad_glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)load("glGetProgramStringNV"); + glad_glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)load("glGetTrackMatrixivNV"); + glad_glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)load("glGetVertexAttribdvNV"); + glad_glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)load("glGetVertexAttribfvNV"); + glad_glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)load("glGetVertexAttribivNV"); + glad_glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)load("glGetVertexAttribPointervNV"); + glad_glIsProgramNV = (PFNGLISPROGRAMNVPROC)load("glIsProgramNV"); + glad_glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)load("glLoadProgramNV"); + glad_glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)load("glProgramParameter4dNV"); + glad_glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)load("glProgramParameter4dvNV"); + glad_glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)load("glProgramParameter4fNV"); + glad_glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)load("glProgramParameter4fvNV"); + glad_glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)load("glProgramParameters4dvNV"); + glad_glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)load("glProgramParameters4fvNV"); + glad_glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)load("glRequestResidentProgramsNV"); + glad_glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)load("glTrackMatrixNV"); + glad_glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)load("glVertexAttribPointerNV"); + glad_glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)load("glVertexAttrib1dNV"); + glad_glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)load("glVertexAttrib1dvNV"); + glad_glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)load("glVertexAttrib1fNV"); + glad_glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)load("glVertexAttrib1fvNV"); + glad_glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)load("glVertexAttrib1sNV"); + glad_glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)load("glVertexAttrib1svNV"); + glad_glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)load("glVertexAttrib2dNV"); + glad_glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)load("glVertexAttrib2dvNV"); + glad_glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)load("glVertexAttrib2fNV"); + glad_glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)load("glVertexAttrib2fvNV"); + glad_glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)load("glVertexAttrib2sNV"); + glad_glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)load("glVertexAttrib2svNV"); + glad_glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)load("glVertexAttrib3dNV"); + glad_glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)load("glVertexAttrib3dvNV"); + glad_glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)load("glVertexAttrib3fNV"); + glad_glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)load("glVertexAttrib3fvNV"); + glad_glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)load("glVertexAttrib3sNV"); + glad_glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)load("glVertexAttrib3svNV"); + glad_glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)load("glVertexAttrib4dNV"); + glad_glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)load("glVertexAttrib4dvNV"); + glad_glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)load("glVertexAttrib4fNV"); + glad_glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)load("glVertexAttrib4fvNV"); + glad_glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)load("glVertexAttrib4sNV"); + glad_glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)load("glVertexAttrib4svNV"); + glad_glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)load("glVertexAttrib4ubNV"); + glad_glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)load("glVertexAttrib4ubvNV"); + glad_glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)load("glVertexAttribs1dvNV"); + glad_glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)load("glVertexAttribs1fvNV"); + glad_glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)load("glVertexAttribs1svNV"); + glad_glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)load("glVertexAttribs2dvNV"); + glad_glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)load("glVertexAttribs2fvNV"); + glad_glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)load("glVertexAttribs2svNV"); + glad_glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)load("glVertexAttribs3dvNV"); + glad_glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)load("glVertexAttribs3fvNV"); + glad_glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)load("glVertexAttribs3svNV"); + glad_glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)load("glVertexAttribs4dvNV"); + glad_glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)load("glVertexAttribs4fvNV"); + glad_glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)load("glVertexAttribs4svNV"); + glad_glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)load("glVertexAttribs4ubvNV"); +} +static void load_GL_EXT_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_shader) return; + glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); + glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); + glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); + glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); + glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); + glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); + glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); + glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); + glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); + glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); + glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); + glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); + glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); + glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); + glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); + glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); + glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); + glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); + glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); + glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); + glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); + glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); + glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); + glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); + glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); + glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); + glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); + glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); + glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); + glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); + glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); + glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); + glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); + glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); + glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); + glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); + glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); + glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); + glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); + glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); + glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); + glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); +} +static void load_GL_EXT_blend_func_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_func_separate) return; + glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); +} +static void load_GL_APPLE_fence(GLADloadproc load) { + if(!GLAD_GL_APPLE_fence) return; + glad_glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)load("glGenFencesAPPLE"); + glad_glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)load("glDeleteFencesAPPLE"); + glad_glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)load("glSetFenceAPPLE"); + glad_glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)load("glIsFenceAPPLE"); + glad_glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)load("glTestFenceAPPLE"); + glad_glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)load("glFinishFenceAPPLE"); + glad_glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)load("glTestObjectAPPLE"); + glad_glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)load("glFinishObjectAPPLE"); +} +static void load_GL_OES_byte_coordinates(GLADloadproc load) { + if(!GLAD_GL_OES_byte_coordinates) return; + glad_glMultiTexCoord1bOES = (PFNGLMULTITEXCOORD1BOESPROC)load("glMultiTexCoord1bOES"); + glad_glMultiTexCoord1bvOES = (PFNGLMULTITEXCOORD1BVOESPROC)load("glMultiTexCoord1bvOES"); + glad_glMultiTexCoord2bOES = (PFNGLMULTITEXCOORD2BOESPROC)load("glMultiTexCoord2bOES"); + glad_glMultiTexCoord2bvOES = (PFNGLMULTITEXCOORD2BVOESPROC)load("glMultiTexCoord2bvOES"); + glad_glMultiTexCoord3bOES = (PFNGLMULTITEXCOORD3BOESPROC)load("glMultiTexCoord3bOES"); + glad_glMultiTexCoord3bvOES = (PFNGLMULTITEXCOORD3BVOESPROC)load("glMultiTexCoord3bvOES"); + glad_glMultiTexCoord4bOES = (PFNGLMULTITEXCOORD4BOESPROC)load("glMultiTexCoord4bOES"); + glad_glMultiTexCoord4bvOES = (PFNGLMULTITEXCOORD4BVOESPROC)load("glMultiTexCoord4bvOES"); + glad_glTexCoord1bOES = (PFNGLTEXCOORD1BOESPROC)load("glTexCoord1bOES"); + glad_glTexCoord1bvOES = (PFNGLTEXCOORD1BVOESPROC)load("glTexCoord1bvOES"); + glad_glTexCoord2bOES = (PFNGLTEXCOORD2BOESPROC)load("glTexCoord2bOES"); + glad_glTexCoord2bvOES = (PFNGLTEXCOORD2BVOESPROC)load("glTexCoord2bvOES"); + glad_glTexCoord3bOES = (PFNGLTEXCOORD3BOESPROC)load("glTexCoord3bOES"); + glad_glTexCoord3bvOES = (PFNGLTEXCOORD3BVOESPROC)load("glTexCoord3bvOES"); + glad_glTexCoord4bOES = (PFNGLTEXCOORD4BOESPROC)load("glTexCoord4bOES"); + glad_glTexCoord4bvOES = (PFNGLTEXCOORD4BVOESPROC)load("glTexCoord4bvOES"); + glad_glVertex2bOES = (PFNGLVERTEX2BOESPROC)load("glVertex2bOES"); + glad_glVertex2bvOES = (PFNGLVERTEX2BVOESPROC)load("glVertex2bvOES"); + glad_glVertex3bOES = (PFNGLVERTEX3BOESPROC)load("glVertex3bOES"); + glad_glVertex3bvOES = (PFNGLVERTEX3BVOESPROC)load("glVertex3bvOES"); + glad_glVertex4bOES = (PFNGLVERTEX4BOESPROC)load("glVertex4bOES"); + glad_glVertex4bvOES = (PFNGLVERTEX4BVOESPROC)load("glVertex4bvOES"); +} +static void load_GL_ARB_transpose_matrix(GLADloadproc load) { + if(!GLAD_GL_ARB_transpose_matrix) return; + glad_glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)load("glLoadTransposeMatrixfARB"); + glad_glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)load("glLoadTransposeMatrixdARB"); + glad_glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)load("glMultTransposeMatrixfARB"); + glad_glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)load("glMultTransposeMatrixdARB"); +} +static void load_GL_ARB_provoking_vertex(GLADloadproc load) { + if(!GLAD_GL_ARB_provoking_vertex) return; + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); +} +static void load_GL_EXT_fog_coord(GLADloadproc load) { + if(!GLAD_GL_EXT_fog_coord) return; + glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); + glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); + glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); + glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); + glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); +} +static void load_GL_EXT_vertex_array(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_array) return; + glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); + glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); + glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); + glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); + glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); + glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); + glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); + glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); + glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); +} +static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_equation_separate) return; + glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); +} +static void load_GL_NV_framebuffer_mixed_samples(GLADloadproc load) { + if(!GLAD_GL_NV_framebuffer_mixed_samples) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); + glad_glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)load("glCoverageModulationTableNV"); + glad_glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)load("glGetCoverageModulationTableNV"); + glad_glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)load("glCoverageModulationNV"); +} +static void load_GL_NVX_conditional_render(GLADloadproc load) { + if(!GLAD_GL_NVX_conditional_render) return; + glad_glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)load("glBeginConditionalRenderNVX"); + glad_glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)load("glEndConditionalRenderNVX"); +} +static void load_GL_ARB_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_ARB_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); + glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); +} +static void load_GL_EXT_raster_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_raster_multisample) return; + glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); +} +static void load_GL_NV_copy_image(GLADloadproc load) { + if(!GLAD_GL_NV_copy_image) return; + glad_glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)load("glCopyImageSubDataNV"); +} +static void load_GL_INTEL_framebuffer_CMAA(GLADloadproc load) { + if(!GLAD_GL_INTEL_framebuffer_CMAA) return; + glad_glApplyFramebufferAttachmentCMAAINTEL = (PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)load("glApplyFramebufferAttachmentCMAAINTEL"); +} +static void load_GL_ARB_transform_feedback2(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback2) return; + glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); + glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); + glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); + glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); + glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); + glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); + glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); +} +static void load_GL_ARB_transform_feedback3(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback3) return; + glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); + glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); + glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); + glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); +} +static void load_GL_EXT_debug_marker(GLADloadproc load) { + if(!GLAD_GL_EXT_debug_marker) return; + glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); + glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); + glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); +} +static void load_GL_EXT_pixel_transform(GLADloadproc load) { + if(!GLAD_GL_EXT_pixel_transform) return; + glad_glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)load("glPixelTransformParameteriEXT"); + glad_glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)load("glPixelTransformParameterfEXT"); + glad_glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)load("glPixelTransformParameterivEXT"); + glad_glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)load("glPixelTransformParameterfvEXT"); + glad_glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)load("glGetPixelTransformParameterivEXT"); + glad_glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)load("glGetPixelTransformParameterfvEXT"); +} +static void load_GL_ATI_fragment_shader(GLADloadproc load) { + if(!GLAD_GL_ATI_fragment_shader) return; + glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); + glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); + glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); + glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); + glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); + glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); + glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); + glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); + glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); + glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); + glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); + glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); + glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); + glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); +} +static void load_GL_ARB_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_array_object) return; + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); +} +static void load_GL_SUN_triangle_list(GLADloadproc load) { + if(!GLAD_GL_SUN_triangle_list) return; + glad_glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)load("glReplacementCodeuiSUN"); + glad_glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)load("glReplacementCodeusSUN"); + glad_glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)load("glReplacementCodeubSUN"); + glad_glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)load("glReplacementCodeuivSUN"); + glad_glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)load("glReplacementCodeusvSUN"); + glad_glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)load("glReplacementCodeubvSUN"); + glad_glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)load("glReplacementCodePointerSUN"); +} +static void load_GL_ARB_transform_feedback_instanced(GLADloadproc load) { + if(!GLAD_GL_ARB_transform_feedback_instanced) return; + glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); + glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); +} +static void load_GL_SGIX_async(GLADloadproc load) { + if(!GLAD_GL_SGIX_async) return; + glad_glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)load("glAsyncMarkerSGIX"); + glad_glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)load("glFinishAsyncSGIX"); + glad_glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)load("glPollAsyncSGIX"); + glad_glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)load("glGenAsyncMarkersSGIX"); + glad_glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)load("glDeleteAsyncMarkersSGIX"); + glad_glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)load("glIsAsyncMarkerSGIX"); +} +static void load_GL_INTEL_performance_query(GLADloadproc load) { + if(!GLAD_GL_INTEL_performance_query) return; + glad_glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)load("glBeginPerfQueryINTEL"); + glad_glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)load("glCreatePerfQueryINTEL"); + glad_glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)load("glDeletePerfQueryINTEL"); + glad_glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)load("glEndPerfQueryINTEL"); + glad_glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)load("glGetFirstPerfQueryIdINTEL"); + glad_glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)load("glGetNextPerfQueryIdINTEL"); + glad_glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)load("glGetPerfCounterInfoINTEL"); + glad_glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)load("glGetPerfQueryDataINTEL"); + glad_glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)load("glGetPerfQueryIdByNameINTEL"); + glad_glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)load("glGetPerfQueryInfoINTEL"); +} +static void load_GL_NV_gpu_shader5(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_shader5) return; + glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); + glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); + glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); + glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); + glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); + glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); + glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); + glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); + glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); + glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); + glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); + glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); + glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); + glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); + glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); + glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); + glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); + glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); + glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); + glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); + glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); + glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); + glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); + glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); + glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); + glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); + glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); + glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); + glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); + glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); + glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); + glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); + glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); +} +static void load_GL_NV_bindless_multi_draw_indirect_count(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_multi_draw_indirect_count) return; + glad_glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawArraysIndirectBindlessCountNV"); + glad_glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawElementsIndirectBindlessCountNV"); +} +static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES2_compatibility) return; + glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); + glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); + glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); +} +static void load_GL_ARB_indirect_parameters(GLADloadproc load) { + if(!GLAD_GL_ARB_indirect_parameters) return; + glad_glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)load("glMultiDrawArraysIndirectCountARB"); + glad_glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)load("glMultiDrawElementsIndirectCountARB"); +} +static void load_GL_NV_half_float(GLADloadproc load) { + if(!GLAD_GL_NV_half_float) return; + glad_glVertex2hNV = (PFNGLVERTEX2HNVPROC)load("glVertex2hNV"); + glad_glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)load("glVertex2hvNV"); + glad_glVertex3hNV = (PFNGLVERTEX3HNVPROC)load("glVertex3hNV"); + glad_glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)load("glVertex3hvNV"); + glad_glVertex4hNV = (PFNGLVERTEX4HNVPROC)load("glVertex4hNV"); + glad_glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)load("glVertex4hvNV"); + glad_glNormal3hNV = (PFNGLNORMAL3HNVPROC)load("glNormal3hNV"); + glad_glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)load("glNormal3hvNV"); + glad_glColor3hNV = (PFNGLCOLOR3HNVPROC)load("glColor3hNV"); + glad_glColor3hvNV = (PFNGLCOLOR3HVNVPROC)load("glColor3hvNV"); + glad_glColor4hNV = (PFNGLCOLOR4HNVPROC)load("glColor4hNV"); + glad_glColor4hvNV = (PFNGLCOLOR4HVNVPROC)load("glColor4hvNV"); + glad_glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)load("glTexCoord1hNV"); + glad_glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)load("glTexCoord1hvNV"); + glad_glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)load("glTexCoord2hNV"); + glad_glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)load("glTexCoord2hvNV"); + glad_glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)load("glTexCoord3hNV"); + glad_glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)load("glTexCoord3hvNV"); + glad_glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)load("glTexCoord4hNV"); + glad_glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)load("glTexCoord4hvNV"); + glad_glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)load("glMultiTexCoord1hNV"); + glad_glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)load("glMultiTexCoord1hvNV"); + glad_glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)load("glMultiTexCoord2hNV"); + glad_glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)load("glMultiTexCoord2hvNV"); + glad_glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)load("glMultiTexCoord3hNV"); + glad_glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)load("glMultiTexCoord3hvNV"); + glad_glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)load("glMultiTexCoord4hNV"); + glad_glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)load("glMultiTexCoord4hvNV"); + glad_glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)load("glFogCoordhNV"); + glad_glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)load("glFogCoordhvNV"); + glad_glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)load("glSecondaryColor3hNV"); + glad_glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)load("glSecondaryColor3hvNV"); + glad_glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)load("glVertexWeighthNV"); + glad_glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)load("glVertexWeighthvNV"); + glad_glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)load("glVertexAttrib1hNV"); + glad_glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)load("glVertexAttrib1hvNV"); + glad_glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)load("glVertexAttrib2hNV"); + glad_glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)load("glVertexAttrib2hvNV"); + glad_glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)load("glVertexAttrib3hNV"); + glad_glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)load("glVertexAttrib3hvNV"); + glad_glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)load("glVertexAttrib4hNV"); + glad_glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)load("glVertexAttrib4hvNV"); + glad_glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)load("glVertexAttribs1hvNV"); + glad_glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)load("glVertexAttribs2hvNV"); + glad_glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)load("glVertexAttribs3hvNV"); + glad_glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)load("glVertexAttribs4hvNV"); +} +static void load_GL_ARB_ES3_2_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES3_2_compatibility) return; + glad_glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)load("glPrimitiveBoundingBoxARB"); +} +static void load_GL_EXT_polygon_offset_clamp(GLADloadproc load) { + if(!GLAD_GL_EXT_polygon_offset_clamp) return; + glad_glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)load("glPolygonOffsetClampEXT"); +} +static void load_GL_EXT_compiled_vertex_array(GLADloadproc load) { + if(!GLAD_GL_EXT_compiled_vertex_array) return; + glad_glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)load("glLockArraysEXT"); + glad_glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)load("glUnlockArraysEXT"); +} +static void load_GL_NV_depth_buffer_float(GLADloadproc load) { + if(!GLAD_GL_NV_depth_buffer_float) return; + glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); + glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); + glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); +} +static void load_GL_NV_occlusion_query(GLADloadproc load) { + if(!GLAD_GL_NV_occlusion_query) return; + glad_glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)load("glGenOcclusionQueriesNV"); + glad_glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)load("glDeleteOcclusionQueriesNV"); + glad_glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)load("glIsOcclusionQueryNV"); + glad_glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)load("glBeginOcclusionQueryNV"); + glad_glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)load("glEndOcclusionQueryNV"); + glad_glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)load("glGetOcclusionQueryivNV"); + glad_glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)load("glGetOcclusionQueryuivNV"); +} +static void load_GL_APPLE_flush_buffer_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_flush_buffer_range) return; + glad_glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)load("glBufferParameteriAPPLE"); + glad_glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)load("glFlushMappedBufferRangeAPPLE"); +} +static void load_GL_ARB_imaging(GLADloadproc load) { + if(!GLAD_GL_ARB_imaging) return; + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); + glad_glColorTable = (PFNGLCOLORTABLEPROC)load("glColorTable"); + glad_glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)load("glColorTableParameterfv"); + glad_glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)load("glColorTableParameteriv"); + glad_glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)load("glCopyColorTable"); + glad_glGetColorTable = (PFNGLGETCOLORTABLEPROC)load("glGetColorTable"); + glad_glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)load("glGetColorTableParameterfv"); + glad_glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)load("glGetColorTableParameteriv"); + glad_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)load("glColorSubTable"); + glad_glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)load("glCopyColorSubTable"); + glad_glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)load("glConvolutionFilter1D"); + glad_glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)load("glConvolutionFilter2D"); + glad_glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)load("glConvolutionParameterf"); + glad_glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)load("glConvolutionParameterfv"); + glad_glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)load("glConvolutionParameteri"); + glad_glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)load("glConvolutionParameteriv"); + glad_glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)load("glCopyConvolutionFilter1D"); + glad_glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)load("glCopyConvolutionFilter2D"); + glad_glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)load("glGetConvolutionFilter"); + glad_glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)load("glGetConvolutionParameterfv"); + glad_glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)load("glGetConvolutionParameteriv"); + glad_glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)load("glGetSeparableFilter"); + glad_glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)load("glSeparableFilter2D"); + glad_glGetHistogram = (PFNGLGETHISTOGRAMPROC)load("glGetHistogram"); + glad_glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)load("glGetHistogramParameterfv"); + glad_glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)load("glGetHistogramParameteriv"); + glad_glGetMinmax = (PFNGLGETMINMAXPROC)load("glGetMinmax"); + glad_glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)load("glGetMinmaxParameterfv"); + glad_glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)load("glGetMinmaxParameteriv"); + glad_glHistogram = (PFNGLHISTOGRAMPROC)load("glHistogram"); + glad_glMinmax = (PFNGLMINMAXPROC)load("glMinmax"); + glad_glResetHistogram = (PFNGLRESETHISTOGRAMPROC)load("glResetHistogram"); + glad_glResetMinmax = (PFNGLRESETMINMAXPROC)load("glResetMinmax"); +} +static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers_blend) return; + glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); + glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); + glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); + glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); +} +static void load_GL_ARB_clear_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_clear_buffer_object) return; + glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); + glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); +} +static void load_GL_ARB_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_multisample) return; + glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); +} +static void load_GL_EXT_debug_label(GLADloadproc load) { + if(!GLAD_GL_EXT_debug_label) return; + glad_glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)load("glLabelObjectEXT"); + glad_glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)load("glGetObjectLabelEXT"); +} +static void load_GL_ARB_sample_shading(GLADloadproc load) { + if(!GLAD_GL_ARB_sample_shading) return; + glad_glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)load("glMinSampleShadingARB"); +} +static void load_GL_NV_internalformat_sample_query(GLADloadproc load) { + if(!GLAD_GL_NV_internalformat_sample_query) return; + glad_glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)load("glGetInternalformatSampleivNV"); +} +static void load_GL_INTEL_map_texture(GLADloadproc load) { + if(!GLAD_GL_INTEL_map_texture) return; + glad_glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)load("glSyncTextureINTEL"); + glad_glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)load("glUnmapTexture2DINTEL"); + glad_glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)load("glMapTexture2DINTEL"); +} +static void load_GL_ARB_compute_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_compute_shader) return; + glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); + glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); +} +static void load_GL_IBM_vertex_array_lists(GLADloadproc load) { + if(!GLAD_GL_IBM_vertex_array_lists) return; + glad_glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)load("glColorPointerListIBM"); + glad_glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)load("glSecondaryColorPointerListIBM"); + glad_glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)load("glEdgeFlagPointerListIBM"); + glad_glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)load("glFogCoordPointerListIBM"); + glad_glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)load("glIndexPointerListIBM"); + glad_glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)load("glNormalPointerListIBM"); + glad_glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)load("glTexCoordPointerListIBM"); + glad_glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)load("glVertexPointerListIBM"); +} +static void load_GL_ARB_color_buffer_float(GLADloadproc load) { + if(!GLAD_GL_ARB_color_buffer_float) return; + glad_glClampColorARB = (PFNGLCLAMPCOLORARBPROC)load("glClampColorARB"); +} +static void load_GL_ARB_bindless_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_bindless_texture) return; + glad_glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)load("glGetTextureHandleARB"); + glad_glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)load("glGetTextureSamplerHandleARB"); + glad_glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)load("glMakeTextureHandleResidentARB"); + glad_glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)load("glMakeTextureHandleNonResidentARB"); + glad_glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)load("glGetImageHandleARB"); + glad_glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)load("glMakeImageHandleResidentARB"); + glad_glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)load("glMakeImageHandleNonResidentARB"); + glad_glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)load("glUniformHandleui64ARB"); + glad_glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)load("glUniformHandleui64vARB"); + glad_glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)load("glProgramUniformHandleui64ARB"); + glad_glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)load("glProgramUniformHandleui64vARB"); + glad_glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)load("glIsTextureHandleResidentARB"); + glad_glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)load("glIsImageHandleResidentARB"); + glad_glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)load("glVertexAttribL1ui64ARB"); + glad_glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)load("glVertexAttribL1ui64vARB"); + glad_glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)load("glGetVertexAttribLui64vARB"); +} +static void load_GL_ARB_window_pos(GLADloadproc load) { + if(!GLAD_GL_ARB_window_pos) return; + glad_glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)load("glWindowPos2dARB"); + glad_glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)load("glWindowPos2dvARB"); + glad_glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)load("glWindowPos2fARB"); + glad_glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)load("glWindowPos2fvARB"); + glad_glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)load("glWindowPos2iARB"); + glad_glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)load("glWindowPos2ivARB"); + glad_glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)load("glWindowPos2sARB"); + glad_glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)load("glWindowPos2svARB"); + glad_glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)load("glWindowPos3dARB"); + glad_glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)load("glWindowPos3dvARB"); + glad_glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)load("glWindowPos3fARB"); + glad_glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)load("glWindowPos3fvARB"); + glad_glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)load("glWindowPos3iARB"); + glad_glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)load("glWindowPos3ivARB"); + glad_glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)load("glWindowPos3sARB"); + glad_glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)load("glWindowPos3svARB"); +} +static void load_GL_ARB_internalformat_query(GLADloadproc load) { + if(!GLAD_GL_ARB_internalformat_query) return; + glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); +} +static void load_GL_EXT_shader_image_load_store(GLADloadproc load) { + if(!GLAD_GL_EXT_shader_image_load_store) return; + glad_glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)load("glBindImageTextureEXT"); + glad_glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)load("glMemoryBarrierEXT"); +} +static void load_GL_EXT_copy_texture(GLADloadproc load) { + if(!GLAD_GL_EXT_copy_texture) return; + glad_glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)load("glCopyTexImage1DEXT"); + glad_glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)load("glCopyTexImage2DEXT"); + glad_glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)load("glCopyTexSubImage1DEXT"); + glad_glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)load("glCopyTexSubImage2DEXT"); + glad_glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)load("glCopyTexSubImage3DEXT"); +} +static void load_GL_NV_register_combiners2(GLADloadproc load) { + if(!GLAD_GL_NV_register_combiners2) return; + glad_glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)load("glCombinerStageParameterfvNV"); + glad_glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)load("glGetCombinerStageParameterfvNV"); +} +static void load_GL_NV_draw_texture(GLADloadproc load) { + if(!GLAD_GL_NV_draw_texture) return; + glad_glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)load("glDrawTextureNV"); +} +static void load_GL_EXT_draw_instanced(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_instanced) return; + glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load("glDrawArraysInstancedEXT"); + glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load("glDrawElementsInstancedEXT"); +} +static void load_GL_ARB_viewport_array(GLADloadproc load) { + if(!GLAD_GL_ARB_viewport_array) return; + glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); + glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); + glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); + glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); + glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); + glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); + glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); + glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); + glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); + glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); +} +static void load_GL_ARB_separate_shader_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_separate_shader_objects) return; + glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); + glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); + glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); + glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); + glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); + glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); + glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); + glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); + glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); + glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); + glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); + glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); + glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); + glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); + glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); + glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); + glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); + glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); + glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); + glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); + glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); + glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); + glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); + glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); + glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); + glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); + glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); + glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); + glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); + glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); + glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); + glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); + glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); + glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); + glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); + glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); + glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); + glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); + glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); + glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); + glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); + glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); + glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); + glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); + glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); + glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); + glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); + glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); + glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); + glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); + glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); + glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); + glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); + glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); + glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); + glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); + glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); + glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); + glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); + glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); +} +static void load_GL_EXT_depth_bounds_test(GLADloadproc load) { + if(!GLAD_GL_EXT_depth_bounds_test) return; + glad_glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)load("glDepthBoundsEXT"); +} +static void load_GL_NV_video_capture(GLADloadproc load) { + if(!GLAD_GL_NV_video_capture) return; + glad_glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)load("glBeginVideoCaptureNV"); + glad_glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)load("glBindVideoCaptureStreamBufferNV"); + glad_glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)load("glBindVideoCaptureStreamTextureNV"); + glad_glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)load("glEndVideoCaptureNV"); + glad_glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)load("glGetVideoCaptureivNV"); + glad_glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)load("glGetVideoCaptureStreamivNV"); + glad_glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)load("glGetVideoCaptureStreamfvNV"); + glad_glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)load("glGetVideoCaptureStreamdvNV"); + glad_glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)load("glVideoCaptureNV"); + glad_glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)load("glVideoCaptureStreamParameterivNV"); + glad_glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)load("glVideoCaptureStreamParameterfvNV"); + glad_glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)load("glVideoCaptureStreamParameterdvNV"); +} +static void load_GL_ARB_sampler_objects(GLADloadproc load) { + if(!GLAD_GL_ARB_sampler_objects) return; + glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); + glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); + glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); + glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); + glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); + glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); + glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); + glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); + glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); + glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); + glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); + glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); + glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); + glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); +} +static void load_GL_ARB_matrix_palette(GLADloadproc load) { + if(!GLAD_GL_ARB_matrix_palette) return; + glad_glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)load("glCurrentPaletteMatrixARB"); + glad_glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)load("glMatrixIndexubvARB"); + glad_glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)load("glMatrixIndexusvARB"); + glad_glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)load("glMatrixIndexuivARB"); + glad_glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)load("glMatrixIndexPointerARB"); +} +static void load_GL_SGIS_texture_color_mask(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture_color_mask) return; + glad_glTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC)load("glTextureColorMaskSGIS"); +} +static void load_GL_EXT_coordinate_frame(GLADloadproc load) { + if(!GLAD_GL_EXT_coordinate_frame) return; + glad_glTangent3bEXT = (PFNGLTANGENT3BEXTPROC)load("glTangent3bEXT"); + glad_glTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC)load("glTangent3bvEXT"); + glad_glTangent3dEXT = (PFNGLTANGENT3DEXTPROC)load("glTangent3dEXT"); + glad_glTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC)load("glTangent3dvEXT"); + glad_glTangent3fEXT = (PFNGLTANGENT3FEXTPROC)load("glTangent3fEXT"); + glad_glTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC)load("glTangent3fvEXT"); + glad_glTangent3iEXT = (PFNGLTANGENT3IEXTPROC)load("glTangent3iEXT"); + glad_glTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC)load("glTangent3ivEXT"); + glad_glTangent3sEXT = (PFNGLTANGENT3SEXTPROC)load("glTangent3sEXT"); + glad_glTangent3svEXT = (PFNGLTANGENT3SVEXTPROC)load("glTangent3svEXT"); + glad_glBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC)load("glBinormal3bEXT"); + glad_glBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC)load("glBinormal3bvEXT"); + glad_glBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC)load("glBinormal3dEXT"); + glad_glBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC)load("glBinormal3dvEXT"); + glad_glBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC)load("glBinormal3fEXT"); + glad_glBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC)load("glBinormal3fvEXT"); + glad_glBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC)load("glBinormal3iEXT"); + glad_glBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC)load("glBinormal3ivEXT"); + glad_glBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC)load("glBinormal3sEXT"); + glad_glBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC)load("glBinormal3svEXT"); + glad_glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)load("glTangentPointerEXT"); + glad_glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)load("glBinormalPointerEXT"); +} +static void load_GL_ARB_texture_compression(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_compression) return; + glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); + glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); + glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); + glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); + glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); + glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); + glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); +} +static void load_GL_ARB_shader_subroutine(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_subroutine) return; + glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); + glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); + glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); + glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); + glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); + glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); + glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); + glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); +} +static void load_GL_ARB_texture_storage_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_storage_multisample) return; + glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); + glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); +} +static void load_GL_EXT_vertex_attrib_64bit(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_attrib_64bit) return; + glad_glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)load("glVertexAttribL1dEXT"); + glad_glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)load("glVertexAttribL2dEXT"); + glad_glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)load("glVertexAttribL3dEXT"); + glad_glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)load("glVertexAttribL4dEXT"); + glad_glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)load("glVertexAttribL1dvEXT"); + glad_glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)load("glVertexAttribL2dvEXT"); + glad_glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)load("glVertexAttribL3dvEXT"); + glad_glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)load("glVertexAttribL4dvEXT"); + glad_glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)load("glVertexAttribLPointerEXT"); + glad_glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)load("glGetVertexAttribLdvEXT"); +} +static void load_GL_OES_query_matrix(GLADloadproc load) { + if(!GLAD_GL_OES_query_matrix) return; + glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); +} +static void load_GL_MESA_window_pos(GLADloadproc load) { + if(!GLAD_GL_MESA_window_pos) return; + glad_glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)load("glWindowPos2dMESA"); + glad_glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)load("glWindowPos2dvMESA"); + glad_glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)load("glWindowPos2fMESA"); + glad_glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)load("glWindowPos2fvMESA"); + glad_glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)load("glWindowPos2iMESA"); + glad_glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)load("glWindowPos2ivMESA"); + glad_glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)load("glWindowPos2sMESA"); + glad_glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)load("glWindowPos2svMESA"); + glad_glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)load("glWindowPos3dMESA"); + glad_glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)load("glWindowPos3dvMESA"); + glad_glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)load("glWindowPos3fMESA"); + glad_glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)load("glWindowPos3fvMESA"); + glad_glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)load("glWindowPos3iMESA"); + glad_glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)load("glWindowPos3ivMESA"); + glad_glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)load("glWindowPos3sMESA"); + glad_glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)load("glWindowPos3svMESA"); + glad_glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)load("glWindowPos4dMESA"); + glad_glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)load("glWindowPos4dvMESA"); + glad_glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)load("glWindowPos4fMESA"); + glad_glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)load("glWindowPos4fvMESA"); + glad_glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)load("glWindowPos4iMESA"); + glad_glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)load("glWindowPos4ivMESA"); + glad_glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)load("glWindowPos4sMESA"); + glad_glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)load("glWindowPos4svMESA"); +} +static void load_GL_ARB_copy_buffer(GLADloadproc load) { + if(!GLAD_GL_ARB_copy_buffer) return; + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); +} +static void load_GL_APPLE_object_purgeable(GLADloadproc load) { + if(!GLAD_GL_APPLE_object_purgeable) return; + glad_glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)load("glObjectPurgeableAPPLE"); + glad_glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)load("glObjectUnpurgeableAPPLE"); + glad_glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)load("glGetObjectParameterivAPPLE"); +} +static void load_GL_ARB_occlusion_query(GLADloadproc load) { + if(!GLAD_GL_ARB_occlusion_query) return; + glad_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)load("glGenQueriesARB"); + glad_glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)load("glDeleteQueriesARB"); + glad_glIsQueryARB = (PFNGLISQUERYARBPROC)load("glIsQueryARB"); + glad_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)load("glBeginQueryARB"); + glad_glEndQueryARB = (PFNGLENDQUERYARBPROC)load("glEndQueryARB"); + glad_glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)load("glGetQueryivARB"); + glad_glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)load("glGetQueryObjectivARB"); + glad_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)load("glGetQueryObjectuivARB"); +} +static void load_GL_SGI_color_table(GLADloadproc load) { + if(!GLAD_GL_SGI_color_table) return; + glad_glColorTableSGI = (PFNGLCOLORTABLESGIPROC)load("glColorTableSGI"); + glad_glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)load("glColorTableParameterfvSGI"); + glad_glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)load("glColorTableParameterivSGI"); + glad_glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)load("glCopyColorTableSGI"); + glad_glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)load("glGetColorTableSGI"); + glad_glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)load("glGetColorTableParameterfvSGI"); + glad_glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)load("glGetColorTableParameterivSGI"); +} +static void load_GL_EXT_gpu_shader4(GLADloadproc load) { + if(!GLAD_GL_EXT_gpu_shader4) return; + glad_glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)load("glGetUniformuivEXT"); + glad_glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)load("glBindFragDataLocationEXT"); + glad_glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)load("glGetFragDataLocationEXT"); + glad_glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)load("glUniform1uiEXT"); + glad_glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)load("glUniform2uiEXT"); + glad_glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)load("glUniform3uiEXT"); + glad_glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)load("glUniform4uiEXT"); + glad_glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)load("glUniform1uivEXT"); + glad_glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)load("glUniform2uivEXT"); + glad_glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)load("glUniform3uivEXT"); + glad_glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)load("glUniform4uivEXT"); +} +static void load_GL_NV_geometry_program4(GLADloadproc load) { + if(!GLAD_GL_NV_geometry_program4) return; + glad_glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)load("glProgramVertexLimitNV"); + glad_glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)load("glFramebufferTextureEXT"); + glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); + glad_glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)load("glFramebufferTextureFaceEXT"); +} +static void load_GL_AMD_debug_output(GLADloadproc load) { + if(!GLAD_GL_AMD_debug_output) return; + glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); + glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); + glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); + glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); +} +static void load_GL_ARB_multitexture(GLADloadproc load) { + if(!GLAD_GL_ARB_multitexture) return; + glad_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)load("glActiveTextureARB"); + glad_glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)load("glClientActiveTextureARB"); + glad_glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)load("glMultiTexCoord1dARB"); + glad_glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)load("glMultiTexCoord1dvARB"); + glad_glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)load("glMultiTexCoord1fARB"); + glad_glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)load("glMultiTexCoord1fvARB"); + glad_glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)load("glMultiTexCoord1iARB"); + glad_glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)load("glMultiTexCoord1ivARB"); + glad_glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)load("glMultiTexCoord1sARB"); + glad_glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)load("glMultiTexCoord1svARB"); + glad_glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)load("glMultiTexCoord2dARB"); + glad_glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)load("glMultiTexCoord2dvARB"); + glad_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)load("glMultiTexCoord2fARB"); + glad_glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)load("glMultiTexCoord2fvARB"); + glad_glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)load("glMultiTexCoord2iARB"); + glad_glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)load("glMultiTexCoord2ivARB"); + glad_glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)load("glMultiTexCoord2sARB"); + glad_glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)load("glMultiTexCoord2svARB"); + glad_glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)load("glMultiTexCoord3dARB"); + glad_glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)load("glMultiTexCoord3dvARB"); + glad_glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)load("glMultiTexCoord3fARB"); + glad_glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)load("glMultiTexCoord3fvARB"); + glad_glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)load("glMultiTexCoord3iARB"); + glad_glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)load("glMultiTexCoord3ivARB"); + glad_glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)load("glMultiTexCoord3sARB"); + glad_glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)load("glMultiTexCoord3svARB"); + glad_glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)load("glMultiTexCoord4dARB"); + glad_glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)load("glMultiTexCoord4dvARB"); + glad_glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)load("glMultiTexCoord4fARB"); + glad_glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)load("glMultiTexCoord4fvARB"); + glad_glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)load("glMultiTexCoord4iARB"); + glad_glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)load("glMultiTexCoord4ivARB"); + glad_glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)load("glMultiTexCoord4sARB"); + glad_glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)load("glMultiTexCoord4svARB"); +} +static void load_GL_SGIX_polynomial_ffd(GLADloadproc load) { + if(!GLAD_GL_SGIX_polynomial_ffd) return; + glad_glDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC)load("glDeformationMap3dSGIX"); + glad_glDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC)load("glDeformationMap3fSGIX"); + glad_glDeformSGIX = (PFNGLDEFORMSGIXPROC)load("glDeformSGIX"); + glad_glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)load("glLoadIdentityDeformationMapSGIX"); +} +static void load_GL_EXT_provoking_vertex(GLADloadproc load) { + if(!GLAD_GL_EXT_provoking_vertex) return; + glad_glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)load("glProvokingVertexEXT"); +} +static void load_GL_ARB_point_parameters(GLADloadproc load) { + if(!GLAD_GL_ARB_point_parameters) return; + glad_glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)load("glPointParameterfARB"); + glad_glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)load("glPointParameterfvARB"); +} +static void load_GL_ARB_shader_image_load_store(GLADloadproc load) { + if(!GLAD_GL_ARB_shader_image_load_store) return; + glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); + glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); +} +static void load_GL_ARB_texture_barrier(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_barrier) return; + glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); +} +static void load_GL_NV_bindless_multi_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_NV_bindless_multi_draw_indirect) return; + glad_glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)load("glMultiDrawArraysIndirectBindlessNV"); + glad_glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)load("glMultiDrawElementsIndirectBindlessNV"); +} +static void load_GL_EXT_transform_feedback(GLADloadproc load) { + if(!GLAD_GL_EXT_transform_feedback) return; + glad_glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)load("glBeginTransformFeedbackEXT"); + glad_glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)load("glEndTransformFeedbackEXT"); + glad_glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)load("glBindBufferRangeEXT"); + glad_glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)load("glBindBufferOffsetEXT"); + glad_glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)load("glBindBufferBaseEXT"); + glad_glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)load("glTransformFeedbackVaryingsEXT"); + glad_glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)load("glGetTransformFeedbackVaryingEXT"); +} +static void load_GL_NV_gpu_program4(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_program4) return; + glad_glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)load("glProgramLocalParameterI4iNV"); + glad_glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)load("glProgramLocalParameterI4ivNV"); + glad_glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)load("glProgramLocalParametersI4ivNV"); + glad_glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)load("glProgramLocalParameterI4uiNV"); + glad_glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)load("glProgramLocalParameterI4uivNV"); + glad_glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)load("glProgramLocalParametersI4uivNV"); + glad_glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)load("glProgramEnvParameterI4iNV"); + glad_glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)load("glProgramEnvParameterI4ivNV"); + glad_glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)load("glProgramEnvParametersI4ivNV"); + glad_glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)load("glProgramEnvParameterI4uiNV"); + glad_glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)load("glProgramEnvParameterI4uivNV"); + glad_glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)load("glProgramEnvParametersI4uivNV"); + glad_glGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)load("glGetProgramLocalParameterIivNV"); + glad_glGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)load("glGetProgramLocalParameterIuivNV"); + glad_glGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)load("glGetProgramEnvParameterIivNV"); + glad_glGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)load("glGetProgramEnvParameterIuivNV"); +} +static void load_GL_NV_gpu_program5(GLADloadproc load) { + if(!GLAD_GL_NV_gpu_program5) return; + glad_glProgramSubroutineParametersuivNV = (PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)load("glProgramSubroutineParametersuivNV"); + glad_glGetProgramSubroutineParameteruivNV = (PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)load("glGetProgramSubroutineParameteruivNV"); +} +static void load_GL_ARB_geometry_shader4(GLADloadproc load) { + if(!GLAD_GL_ARB_geometry_shader4) return; + glad_glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)load("glProgramParameteriARB"); + glad_glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)load("glFramebufferTextureARB"); + glad_glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)load("glFramebufferTextureLayerARB"); + glad_glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)load("glFramebufferTextureFaceARB"); +} +static void load_GL_NV_conservative_raster(GLADloadproc load) { + if(!GLAD_GL_NV_conservative_raster) return; + glad_glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)load("glSubpixelPrecisionBiasNV"); +} +static void load_GL_SGIX_sprite(GLADloadproc load) { + if(!GLAD_GL_SGIX_sprite) return; + glad_glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)load("glSpriteParameterfSGIX"); + glad_glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)load("glSpriteParameterfvSGIX"); + glad_glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)load("glSpriteParameteriSGIX"); + glad_glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)load("glSpriteParameterivSGIX"); +} +static void load_GL_ARB_get_program_binary(GLADloadproc load) { + if(!GLAD_GL_ARB_get_program_binary) return; + glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); + glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); + glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); +} +static void load_GL_AMD_occlusion_query_event(GLADloadproc load) { + if(!GLAD_GL_AMD_occlusion_query_event) return; + glad_glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)load("glQueryObjectParameteruiAMD"); +} +static void load_GL_SGIS_multisample(GLADloadproc load) { + if(!GLAD_GL_SGIS_multisample) return; + glad_glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)load("glSampleMaskSGIS"); + glad_glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)load("glSamplePatternSGIS"); +} +static void load_GL_EXT_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_object) return; + glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); + glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); + glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); + glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); + glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); + glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); + glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); + glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); + glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); + glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); + glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); + glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); + glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); + glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); + glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); + glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); + glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); +} +static void load_GL_APPLE_vertex_array_range(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_array_range) return; + glad_glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)load("glVertexArrayRangeAPPLE"); + glad_glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)load("glFlushVertexArrayRangeAPPLE"); + glad_glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)load("glVertexArrayParameteriAPPLE"); +} +static void load_GL_NV_register_combiners(GLADloadproc load) { + if(!GLAD_GL_NV_register_combiners) return; + glad_glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)load("glCombinerParameterfvNV"); + glad_glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)load("glCombinerParameterfNV"); + glad_glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)load("glCombinerParameterivNV"); + glad_glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)load("glCombinerParameteriNV"); + glad_glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)load("glCombinerInputNV"); + glad_glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)load("glCombinerOutputNV"); + glad_glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)load("glFinalCombinerInputNV"); + glad_glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)load("glGetCombinerInputParameterfvNV"); + glad_glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)load("glGetCombinerInputParameterivNV"); + glad_glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)load("glGetCombinerOutputParameterfvNV"); + glad_glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)load("glGetCombinerOutputParameterivNV"); + glad_glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)load("glGetFinalCombinerInputParameterfvNV"); + glad_glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)load("glGetFinalCombinerInputParameterivNV"); +} +static void load_GL_ARB_draw_buffers(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers) return; + glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); +} +static void load_GL_ARB_clear_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_clear_texture) return; + glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); + glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); +} +static void load_GL_ARB_debug_output(GLADloadproc load) { + if(!GLAD_GL_ARB_debug_output) return; + glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); + glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); + glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); + glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); +} +static void load_GL_EXT_cull_vertex(GLADloadproc load) { + if(!GLAD_GL_EXT_cull_vertex) return; + glad_glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)load("glCullParameterdvEXT"); + glad_glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)load("glCullParameterfvEXT"); +} +static void load_GL_IBM_multimode_draw_arrays(GLADloadproc load) { + if(!GLAD_GL_IBM_multimode_draw_arrays) return; + glad_glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)load("glMultiModeDrawArraysIBM"); + glad_glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)load("glMultiModeDrawElementsIBM"); +} +static void load_GL_APPLE_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_APPLE_vertex_array_object) return; + glad_glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)load("glBindVertexArrayAPPLE"); + glad_glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)load("glDeleteVertexArraysAPPLE"); + glad_glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)load("glGenVertexArraysAPPLE"); + glad_glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)load("glIsVertexArrayAPPLE"); +} +static void load_GL_SGIS_detail_texture(GLADloadproc load) { + if(!GLAD_GL_SGIS_detail_texture) return; + glad_glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)load("glDetailTexFuncSGIS"); + glad_glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)load("glGetDetailTexFuncSGIS"); +} +static void load_GL_ARB_draw_instanced(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_instanced) return; + glad_glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)load("glDrawArraysInstancedARB"); + glad_glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)load("glDrawElementsInstancedARB"); +} +static void load_GL_ARB_shading_language_include(GLADloadproc load) { + if(!GLAD_GL_ARB_shading_language_include) return; + glad_glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)load("glNamedStringARB"); + glad_glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)load("glDeleteNamedStringARB"); + glad_glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)load("glCompileShaderIncludeARB"); + glad_glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)load("glIsNamedStringARB"); + glad_glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)load("glGetNamedStringARB"); + glad_glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)load("glGetNamedStringivARB"); +} +static void load_GL_INGR_blend_func_separate(GLADloadproc load) { + if(!GLAD_GL_INGR_blend_func_separate) return; + glad_glBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC)load("glBlendFuncSeparateINGR"); +} +static void load_GL_NV_path_rendering(GLADloadproc load) { + if(!GLAD_GL_NV_path_rendering) return; + glad_glGenPathsNV = (PFNGLGENPATHSNVPROC)load("glGenPathsNV"); + glad_glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)load("glDeletePathsNV"); + glad_glIsPathNV = (PFNGLISPATHNVPROC)load("glIsPathNV"); + glad_glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)load("glPathCommandsNV"); + glad_glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)load("glPathCoordsNV"); + glad_glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)load("glPathSubCommandsNV"); + glad_glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)load("glPathSubCoordsNV"); + glad_glPathStringNV = (PFNGLPATHSTRINGNVPROC)load("glPathStringNV"); + glad_glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)load("glPathGlyphsNV"); + glad_glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)load("glPathGlyphRangeNV"); + glad_glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)load("glWeightPathsNV"); + glad_glCopyPathNV = (PFNGLCOPYPATHNVPROC)load("glCopyPathNV"); + glad_glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)load("glInterpolatePathsNV"); + glad_glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)load("glTransformPathNV"); + glad_glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)load("glPathParameterivNV"); + glad_glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)load("glPathParameteriNV"); + glad_glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)load("glPathParameterfvNV"); + glad_glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)load("glPathParameterfNV"); + glad_glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)load("glPathDashArrayNV"); + glad_glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)load("glPathStencilFuncNV"); + glad_glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)load("glPathStencilDepthOffsetNV"); + glad_glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)load("glStencilFillPathNV"); + glad_glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)load("glStencilStrokePathNV"); + glad_glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)load("glStencilFillPathInstancedNV"); + glad_glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)load("glStencilStrokePathInstancedNV"); + glad_glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)load("glPathCoverDepthFuncNV"); + glad_glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)load("glCoverFillPathNV"); + glad_glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)load("glCoverStrokePathNV"); + glad_glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)load("glCoverFillPathInstancedNV"); + glad_glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)load("glCoverStrokePathInstancedNV"); + glad_glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)load("glGetPathParameterivNV"); + glad_glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)load("glGetPathParameterfvNV"); + glad_glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)load("glGetPathCommandsNV"); + glad_glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)load("glGetPathCoordsNV"); + glad_glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)load("glGetPathDashArrayNV"); + glad_glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)load("glGetPathMetricsNV"); + glad_glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)load("glGetPathMetricRangeNV"); + glad_glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)load("glGetPathSpacingNV"); + glad_glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)load("glIsPointInFillPathNV"); + glad_glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)load("glIsPointInStrokePathNV"); + glad_glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)load("glGetPathLengthNV"); + glad_glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)load("glPointAlongPathNV"); + glad_glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)load("glMatrixLoad3x2fNV"); + glad_glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)load("glMatrixLoad3x3fNV"); + glad_glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)load("glMatrixLoadTranspose3x3fNV"); + glad_glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)load("glMatrixMult3x2fNV"); + glad_glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)load("glMatrixMult3x3fNV"); + glad_glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)load("glMatrixMultTranspose3x3fNV"); + glad_glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)load("glStencilThenCoverFillPathNV"); + glad_glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)load("glStencilThenCoverStrokePathNV"); + glad_glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)load("glStencilThenCoverFillPathInstancedNV"); + glad_glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)load("glStencilThenCoverStrokePathInstancedNV"); + glad_glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)load("glPathGlyphIndexRangeNV"); + glad_glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)load("glPathGlyphIndexArrayNV"); + glad_glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)load("glPathMemoryGlyphIndexArrayNV"); + glad_glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)load("glProgramPathFragmentInputGenNV"); + glad_glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)load("glGetProgramResourcefvNV"); + glad_glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)load("glPathColorGenNV"); + glad_glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)load("glPathTexGenNV"); + glad_glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)load("glPathFogGenNV"); + glad_glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)load("glGetPathColorGenivNV"); + glad_glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)load("glGetPathColorGenfvNV"); + glad_glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)load("glGetPathTexGenivNV"); + glad_glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)load("glGetPathTexGenfvNV"); +} +static void load_GL_NV_conservative_raster_dilate(GLADloadproc load) { + if(!GLAD_GL_NV_conservative_raster_dilate) return; + glad_glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)load("glConservativeRasterParameterfNV"); +} +static void load_GL_ATI_vertex_streams(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_streams) return; + glad_glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)load("glVertexStream1sATI"); + glad_glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)load("glVertexStream1svATI"); + glad_glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)load("glVertexStream1iATI"); + glad_glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)load("glVertexStream1ivATI"); + glad_glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)load("glVertexStream1fATI"); + glad_glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)load("glVertexStream1fvATI"); + glad_glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)load("glVertexStream1dATI"); + glad_glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)load("glVertexStream1dvATI"); + glad_glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)load("glVertexStream2sATI"); + glad_glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)load("glVertexStream2svATI"); + glad_glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)load("glVertexStream2iATI"); + glad_glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)load("glVertexStream2ivATI"); + glad_glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)load("glVertexStream2fATI"); + glad_glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)load("glVertexStream2fvATI"); + glad_glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)load("glVertexStream2dATI"); + glad_glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)load("glVertexStream2dvATI"); + glad_glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)load("glVertexStream3sATI"); + glad_glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)load("glVertexStream3svATI"); + glad_glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)load("glVertexStream3iATI"); + glad_glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)load("glVertexStream3ivATI"); + glad_glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)load("glVertexStream3fATI"); + glad_glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)load("glVertexStream3fvATI"); + glad_glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)load("glVertexStream3dATI"); + glad_glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)load("glVertexStream3dvATI"); + glad_glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)load("glVertexStream4sATI"); + glad_glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)load("glVertexStream4svATI"); + glad_glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)load("glVertexStream4iATI"); + glad_glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)load("glVertexStream4ivATI"); + glad_glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)load("glVertexStream4fATI"); + glad_glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)load("glVertexStream4fvATI"); + glad_glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)load("glVertexStream4dATI"); + glad_glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)load("glVertexStream4dvATI"); + glad_glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)load("glNormalStream3bATI"); + glad_glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)load("glNormalStream3bvATI"); + glad_glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)load("glNormalStream3sATI"); + glad_glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)load("glNormalStream3svATI"); + glad_glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)load("glNormalStream3iATI"); + glad_glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)load("glNormalStream3ivATI"); + glad_glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)load("glNormalStream3fATI"); + glad_glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)load("glNormalStream3fvATI"); + glad_glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)load("glNormalStream3dATI"); + glad_glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)load("glNormalStream3dvATI"); + glad_glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)load("glClientActiveVertexStreamATI"); + glad_glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)load("glVertexBlendEnviATI"); + glad_glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)load("glVertexBlendEnvfATI"); +} +static void load_GL_ARB_gpu_shader_int64(GLADloadproc load) { + if(!GLAD_GL_ARB_gpu_shader_int64) return; + glad_glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)load("glUniform1i64ARB"); + glad_glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)load("glUniform2i64ARB"); + glad_glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)load("glUniform3i64ARB"); + glad_glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)load("glUniform4i64ARB"); + glad_glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)load("glUniform1i64vARB"); + glad_glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)load("glUniform2i64vARB"); + glad_glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)load("glUniform3i64vARB"); + glad_glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)load("glUniform4i64vARB"); + glad_glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)load("glUniform1ui64ARB"); + glad_glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)load("glUniform2ui64ARB"); + glad_glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)load("glUniform3ui64ARB"); + glad_glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)load("glUniform4ui64ARB"); + glad_glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)load("glUniform1ui64vARB"); + glad_glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)load("glUniform2ui64vARB"); + glad_glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)load("glUniform3ui64vARB"); + glad_glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)load("glUniform4ui64vARB"); + glad_glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)load("glGetUniformi64vARB"); + glad_glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)load("glGetUniformui64vARB"); + glad_glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)load("glGetnUniformi64vARB"); + glad_glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)load("glGetnUniformui64vARB"); + glad_glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)load("glProgramUniform1i64ARB"); + glad_glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)load("glProgramUniform2i64ARB"); + glad_glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)load("glProgramUniform3i64ARB"); + glad_glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)load("glProgramUniform4i64ARB"); + glad_glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)load("glProgramUniform1i64vARB"); + glad_glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)load("glProgramUniform2i64vARB"); + glad_glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)load("glProgramUniform3i64vARB"); + glad_glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)load("glProgramUniform4i64vARB"); + glad_glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)load("glProgramUniform1ui64ARB"); + glad_glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)load("glProgramUniform2ui64ARB"); + glad_glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)load("glProgramUniform3ui64ARB"); + glad_glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)load("glProgramUniform4ui64ARB"); + glad_glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)load("glProgramUniform1ui64vARB"); + glad_glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)load("glProgramUniform2ui64vARB"); + glad_glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)load("glProgramUniform3ui64vARB"); + glad_glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)load("glProgramUniform4ui64vARB"); +} +static void load_GL_NV_vdpau_interop(GLADloadproc load) { + if(!GLAD_GL_NV_vdpau_interop) return; + glad_glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)load("glVDPAUInitNV"); + glad_glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)load("glVDPAUFiniNV"); + glad_glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)load("glVDPAURegisterVideoSurfaceNV"); + glad_glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)load("glVDPAURegisterOutputSurfaceNV"); + glad_glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)load("glVDPAUIsSurfaceNV"); + glad_glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)load("glVDPAUUnregisterSurfaceNV"); + glad_glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)load("glVDPAUGetSurfaceivNV"); + glad_glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)load("glVDPAUSurfaceAccessNV"); + glad_glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)load("glVDPAUMapSurfacesNV"); + glad_glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)load("glVDPAUUnmapSurfacesNV"); +} +static void load_GL_ARB_internalformat_query2(GLADloadproc load) { + if(!GLAD_GL_ARB_internalformat_query2) return; + glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); +} +static void load_GL_SUN_vertex(GLADloadproc load) { + if(!GLAD_GL_SUN_vertex) return; + glad_glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)load("glColor4ubVertex2fSUN"); + glad_glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)load("glColor4ubVertex2fvSUN"); + glad_glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)load("glColor4ubVertex3fSUN"); + glad_glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)load("glColor4ubVertex3fvSUN"); + glad_glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)load("glColor3fVertex3fSUN"); + glad_glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)load("glColor3fVertex3fvSUN"); + glad_glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)load("glNormal3fVertex3fSUN"); + glad_glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)load("glNormal3fVertex3fvSUN"); + glad_glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glColor4fNormal3fVertex3fSUN"); + glad_glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glColor4fNormal3fVertex3fvSUN"); + glad_glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)load("glTexCoord2fVertex3fSUN"); + glad_glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)load("glTexCoord2fVertex3fvSUN"); + glad_glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)load("glTexCoord4fVertex4fSUN"); + glad_glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)load("glTexCoord4fVertex4fvSUN"); + glad_glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)load("glTexCoord2fColor4ubVertex3fSUN"); + glad_glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)load("glTexCoord2fColor4ubVertex3fvSUN"); + glad_glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)load("glTexCoord2fColor3fVertex3fSUN"); + glad_glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)load("glTexCoord2fColor3fVertex3fvSUN"); + glad_glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fNormal3fVertex3fSUN"); + glad_glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fNormal3fVertex3fvSUN"); + glad_glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fSUN"); + glad_glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fvSUN"); + glad_glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fSUN"); + glad_glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fvSUN"); + glad_glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)load("glReplacementCodeuiVertex3fSUN"); + glad_glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)load("glReplacementCodeuiVertex3fvSUN"); + glad_glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)load("glReplacementCodeuiColor4ubVertex3fSUN"); + glad_glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4ubVertex3fvSUN"); + glad_glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor3fVertex3fSUN"); + glad_glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor3fVertex3fvSUN"); + glad_glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiNormal3fVertex3fSUN"); + glad_glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"); + glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"); + glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"); +} +static void load_GL_SGIX_igloo_interface(GLADloadproc load) { + if(!GLAD_GL_SGIX_igloo_interface) return; + glad_glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)load("glIglooInterfaceSGIX"); +} +static void load_GL_ARB_draw_indirect(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_indirect) return; + glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); + glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); +} +static void load_GL_NV_vertex_program4(GLADloadproc load) { + if(!GLAD_GL_NV_vertex_program4) return; + glad_glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)load("glVertexAttribI1iEXT"); + glad_glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)load("glVertexAttribI2iEXT"); + glad_glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)load("glVertexAttribI3iEXT"); + glad_glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)load("glVertexAttribI4iEXT"); + glad_glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)load("glVertexAttribI1uiEXT"); + glad_glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)load("glVertexAttribI2uiEXT"); + glad_glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)load("glVertexAttribI3uiEXT"); + glad_glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)load("glVertexAttribI4uiEXT"); + glad_glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)load("glVertexAttribI1ivEXT"); + glad_glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)load("glVertexAttribI2ivEXT"); + glad_glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)load("glVertexAttribI3ivEXT"); + glad_glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)load("glVertexAttribI4ivEXT"); + glad_glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)load("glVertexAttribI1uivEXT"); + glad_glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)load("glVertexAttribI2uivEXT"); + glad_glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)load("glVertexAttribI3uivEXT"); + glad_glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)load("glVertexAttribI4uivEXT"); + glad_glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)load("glVertexAttribI4bvEXT"); + glad_glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)load("glVertexAttribI4svEXT"); + glad_glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)load("glVertexAttribI4ubvEXT"); + glad_glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)load("glVertexAttribI4usvEXT"); + glad_glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)load("glVertexAttribIPointerEXT"); + glad_glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)load("glGetVertexAttribIivEXT"); + glad_glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)load("glGetVertexAttribIuivEXT"); +} +static void load_GL_SGIS_fog_function(GLADloadproc load) { + if(!GLAD_GL_SGIS_fog_function) return; + glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); + glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); +} +static void load_GL_EXT_x11_sync_object(GLADloadproc load) { + if(!GLAD_GL_EXT_x11_sync_object) return; + glad_glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)load("glImportSyncEXT"); +} +static void load_GL_ARB_sync(GLADloadproc load) { + if(!GLAD_GL_ARB_sync) return; + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); +} +static void load_GL_NV_sample_locations(GLADloadproc load) { + if(!GLAD_GL_NV_sample_locations) return; + glad_glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glFramebufferSampleLocationsfvNV"); + glad_glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glNamedFramebufferSampleLocationsfvNV"); + glad_glResolveDepthValuesNV = (PFNGLRESOLVEDEPTHVALUESNVPROC)load("glResolveDepthValuesNV"); +} +static void load_GL_ARB_compute_variable_group_size(GLADloadproc load) { + if(!GLAD_GL_ARB_compute_variable_group_size) return; + glad_glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)load("glDispatchComputeGroupSizeARB"); +} +static void load_GL_OES_fixed_point(GLADloadproc load) { + if(!GLAD_GL_OES_fixed_point) return; + glad_glAlphaFuncxOES = (PFNGLALPHAFUNCXOESPROC)load("glAlphaFuncxOES"); + glad_glClearColorxOES = (PFNGLCLEARCOLORXOESPROC)load("glClearColorxOES"); + glad_glClearDepthxOES = (PFNGLCLEARDEPTHXOESPROC)load("glClearDepthxOES"); + glad_glClipPlanexOES = (PFNGLCLIPPLANEXOESPROC)load("glClipPlanexOES"); + glad_glColor4xOES = (PFNGLCOLOR4XOESPROC)load("glColor4xOES"); + glad_glDepthRangexOES = (PFNGLDEPTHRANGEXOESPROC)load("glDepthRangexOES"); + glad_glFogxOES = (PFNGLFOGXOESPROC)load("glFogxOES"); + glad_glFogxvOES = (PFNGLFOGXVOESPROC)load("glFogxvOES"); + glad_glFrustumxOES = (PFNGLFRUSTUMXOESPROC)load("glFrustumxOES"); + glad_glGetClipPlanexOES = (PFNGLGETCLIPPLANEXOESPROC)load("glGetClipPlanexOES"); + glad_glGetFixedvOES = (PFNGLGETFIXEDVOESPROC)load("glGetFixedvOES"); + glad_glGetTexEnvxvOES = (PFNGLGETTEXENVXVOESPROC)load("glGetTexEnvxvOES"); + glad_glGetTexParameterxvOES = (PFNGLGETTEXPARAMETERXVOESPROC)load("glGetTexParameterxvOES"); + glad_glLightModelxOES = (PFNGLLIGHTMODELXOESPROC)load("glLightModelxOES"); + glad_glLightModelxvOES = (PFNGLLIGHTMODELXVOESPROC)load("glLightModelxvOES"); + glad_glLightxOES = (PFNGLLIGHTXOESPROC)load("glLightxOES"); + glad_glLightxvOES = (PFNGLLIGHTXVOESPROC)load("glLightxvOES"); + glad_glLineWidthxOES = (PFNGLLINEWIDTHXOESPROC)load("glLineWidthxOES"); + glad_glLoadMatrixxOES = (PFNGLLOADMATRIXXOESPROC)load("glLoadMatrixxOES"); + glad_glMaterialxOES = (PFNGLMATERIALXOESPROC)load("glMaterialxOES"); + glad_glMaterialxvOES = (PFNGLMATERIALXVOESPROC)load("glMaterialxvOES"); + glad_glMultMatrixxOES = (PFNGLMULTMATRIXXOESPROC)load("glMultMatrixxOES"); + glad_glMultiTexCoord4xOES = (PFNGLMULTITEXCOORD4XOESPROC)load("glMultiTexCoord4xOES"); + glad_glNormal3xOES = (PFNGLNORMAL3XOESPROC)load("glNormal3xOES"); + glad_glOrthoxOES = (PFNGLORTHOXOESPROC)load("glOrthoxOES"); + glad_glPointParameterxvOES = (PFNGLPOINTPARAMETERXVOESPROC)load("glPointParameterxvOES"); + glad_glPointSizexOES = (PFNGLPOINTSIZEXOESPROC)load("glPointSizexOES"); + glad_glPolygonOffsetxOES = (PFNGLPOLYGONOFFSETXOESPROC)load("glPolygonOffsetxOES"); + glad_glRotatexOES = (PFNGLROTATEXOESPROC)load("glRotatexOES"); + glad_glScalexOES = (PFNGLSCALEXOESPROC)load("glScalexOES"); + glad_glTexEnvxOES = (PFNGLTEXENVXOESPROC)load("glTexEnvxOES"); + glad_glTexEnvxvOES = (PFNGLTEXENVXVOESPROC)load("glTexEnvxvOES"); + glad_glTexParameterxOES = (PFNGLTEXPARAMETERXOESPROC)load("glTexParameterxOES"); + glad_glTexParameterxvOES = (PFNGLTEXPARAMETERXVOESPROC)load("glTexParameterxvOES"); + glad_glTranslatexOES = (PFNGLTRANSLATEXOESPROC)load("glTranslatexOES"); + glad_glGetLightxvOES = (PFNGLGETLIGHTXVOESPROC)load("glGetLightxvOES"); + glad_glGetMaterialxvOES = (PFNGLGETMATERIALXVOESPROC)load("glGetMaterialxvOES"); + glad_glPointParameterxOES = (PFNGLPOINTPARAMETERXOESPROC)load("glPointParameterxOES"); + glad_glSampleCoveragexOES = (PFNGLSAMPLECOVERAGEXOESPROC)load("glSampleCoveragexOES"); + glad_glAccumxOES = (PFNGLACCUMXOESPROC)load("glAccumxOES"); + glad_glBitmapxOES = (PFNGLBITMAPXOESPROC)load("glBitmapxOES"); + glad_glBlendColorxOES = (PFNGLBLENDCOLORXOESPROC)load("glBlendColorxOES"); + glad_glClearAccumxOES = (PFNGLCLEARACCUMXOESPROC)load("glClearAccumxOES"); + glad_glColor3xOES = (PFNGLCOLOR3XOESPROC)load("glColor3xOES"); + glad_glColor3xvOES = (PFNGLCOLOR3XVOESPROC)load("glColor3xvOES"); + glad_glColor4xvOES = (PFNGLCOLOR4XVOESPROC)load("glColor4xvOES"); + glad_glConvolutionParameterxOES = (PFNGLCONVOLUTIONPARAMETERXOESPROC)load("glConvolutionParameterxOES"); + glad_glConvolutionParameterxvOES = (PFNGLCONVOLUTIONPARAMETERXVOESPROC)load("glConvolutionParameterxvOES"); + glad_glEvalCoord1xOES = (PFNGLEVALCOORD1XOESPROC)load("glEvalCoord1xOES"); + glad_glEvalCoord1xvOES = (PFNGLEVALCOORD1XVOESPROC)load("glEvalCoord1xvOES"); + glad_glEvalCoord2xOES = (PFNGLEVALCOORD2XOESPROC)load("glEvalCoord2xOES"); + glad_glEvalCoord2xvOES = (PFNGLEVALCOORD2XVOESPROC)load("glEvalCoord2xvOES"); + glad_glFeedbackBufferxOES = (PFNGLFEEDBACKBUFFERXOESPROC)load("glFeedbackBufferxOES"); + glad_glGetConvolutionParameterxvOES = (PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)load("glGetConvolutionParameterxvOES"); + glad_glGetHistogramParameterxvOES = (PFNGLGETHISTOGRAMPARAMETERXVOESPROC)load("glGetHistogramParameterxvOES"); + glad_glGetLightxOES = (PFNGLGETLIGHTXOESPROC)load("glGetLightxOES"); + glad_glGetMapxvOES = (PFNGLGETMAPXVOESPROC)load("glGetMapxvOES"); + glad_glGetMaterialxOES = (PFNGLGETMATERIALXOESPROC)load("glGetMaterialxOES"); + glad_glGetPixelMapxv = (PFNGLGETPIXELMAPXVPROC)load("glGetPixelMapxv"); + glad_glGetTexGenxvOES = (PFNGLGETTEXGENXVOESPROC)load("glGetTexGenxvOES"); + glad_glGetTexLevelParameterxvOES = (PFNGLGETTEXLEVELPARAMETERXVOESPROC)load("glGetTexLevelParameterxvOES"); + glad_glIndexxOES = (PFNGLINDEXXOESPROC)load("glIndexxOES"); + glad_glIndexxvOES = (PFNGLINDEXXVOESPROC)load("glIndexxvOES"); + glad_glLoadTransposeMatrixxOES = (PFNGLLOADTRANSPOSEMATRIXXOESPROC)load("glLoadTransposeMatrixxOES"); + glad_glMap1xOES = (PFNGLMAP1XOESPROC)load("glMap1xOES"); + glad_glMap2xOES = (PFNGLMAP2XOESPROC)load("glMap2xOES"); + glad_glMapGrid1xOES = (PFNGLMAPGRID1XOESPROC)load("glMapGrid1xOES"); + glad_glMapGrid2xOES = (PFNGLMAPGRID2XOESPROC)load("glMapGrid2xOES"); + glad_glMultTransposeMatrixxOES = (PFNGLMULTTRANSPOSEMATRIXXOESPROC)load("glMultTransposeMatrixxOES"); + glad_glMultiTexCoord1xOES = (PFNGLMULTITEXCOORD1XOESPROC)load("glMultiTexCoord1xOES"); + glad_glMultiTexCoord1xvOES = (PFNGLMULTITEXCOORD1XVOESPROC)load("glMultiTexCoord1xvOES"); + glad_glMultiTexCoord2xOES = (PFNGLMULTITEXCOORD2XOESPROC)load("glMultiTexCoord2xOES"); + glad_glMultiTexCoord2xvOES = (PFNGLMULTITEXCOORD2XVOESPROC)load("glMultiTexCoord2xvOES"); + glad_glMultiTexCoord3xOES = (PFNGLMULTITEXCOORD3XOESPROC)load("glMultiTexCoord3xOES"); + glad_glMultiTexCoord3xvOES = (PFNGLMULTITEXCOORD3XVOESPROC)load("glMultiTexCoord3xvOES"); + glad_glMultiTexCoord4xvOES = (PFNGLMULTITEXCOORD4XVOESPROC)load("glMultiTexCoord4xvOES"); + glad_glNormal3xvOES = (PFNGLNORMAL3XVOESPROC)load("glNormal3xvOES"); + glad_glPassThroughxOES = (PFNGLPASSTHROUGHXOESPROC)load("glPassThroughxOES"); + glad_glPixelMapx = (PFNGLPIXELMAPXPROC)load("glPixelMapx"); + glad_glPixelStorex = (PFNGLPIXELSTOREXPROC)load("glPixelStorex"); + glad_glPixelTransferxOES = (PFNGLPIXELTRANSFERXOESPROC)load("glPixelTransferxOES"); + glad_glPixelZoomxOES = (PFNGLPIXELZOOMXOESPROC)load("glPixelZoomxOES"); + glad_glPrioritizeTexturesxOES = (PFNGLPRIORITIZETEXTURESXOESPROC)load("glPrioritizeTexturesxOES"); + glad_glRasterPos2xOES = (PFNGLRASTERPOS2XOESPROC)load("glRasterPos2xOES"); + glad_glRasterPos2xvOES = (PFNGLRASTERPOS2XVOESPROC)load("glRasterPos2xvOES"); + glad_glRasterPos3xOES = (PFNGLRASTERPOS3XOESPROC)load("glRasterPos3xOES"); + glad_glRasterPos3xvOES = (PFNGLRASTERPOS3XVOESPROC)load("glRasterPos3xvOES"); + glad_glRasterPos4xOES = (PFNGLRASTERPOS4XOESPROC)load("glRasterPos4xOES"); + glad_glRasterPos4xvOES = (PFNGLRASTERPOS4XVOESPROC)load("glRasterPos4xvOES"); + glad_glRectxOES = (PFNGLRECTXOESPROC)load("glRectxOES"); + glad_glRectxvOES = (PFNGLRECTXVOESPROC)load("glRectxvOES"); + glad_glTexCoord1xOES = (PFNGLTEXCOORD1XOESPROC)load("glTexCoord1xOES"); + glad_glTexCoord1xvOES = (PFNGLTEXCOORD1XVOESPROC)load("glTexCoord1xvOES"); + glad_glTexCoord2xOES = (PFNGLTEXCOORD2XOESPROC)load("glTexCoord2xOES"); + glad_glTexCoord2xvOES = (PFNGLTEXCOORD2XVOESPROC)load("glTexCoord2xvOES"); + glad_glTexCoord3xOES = (PFNGLTEXCOORD3XOESPROC)load("glTexCoord3xOES"); + glad_glTexCoord3xvOES = (PFNGLTEXCOORD3XVOESPROC)load("glTexCoord3xvOES"); + glad_glTexCoord4xOES = (PFNGLTEXCOORD4XOESPROC)load("glTexCoord4xOES"); + glad_glTexCoord4xvOES = (PFNGLTEXCOORD4XVOESPROC)load("glTexCoord4xvOES"); + glad_glTexGenxOES = (PFNGLTEXGENXOESPROC)load("glTexGenxOES"); + glad_glTexGenxvOES = (PFNGLTEXGENXVOESPROC)load("glTexGenxvOES"); + glad_glVertex2xOES = (PFNGLVERTEX2XOESPROC)load("glVertex2xOES"); + glad_glVertex2xvOES = (PFNGLVERTEX2XVOESPROC)load("glVertex2xvOES"); + glad_glVertex3xOES = (PFNGLVERTEX3XOESPROC)load("glVertex3xOES"); + glad_glVertex3xvOES = (PFNGLVERTEX3XVOESPROC)load("glVertex3xvOES"); + glad_glVertex4xOES = (PFNGLVERTEX4XOESPROC)load("glVertex4xOES"); + glad_glVertex4xvOES = (PFNGLVERTEX4XVOESPROC)load("glVertex4xvOES"); +} +static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_multisample) return; + glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); +} +static void load_GL_SGIS_texture4D(GLADloadproc load) { + if(!GLAD_GL_SGIS_texture4D) return; + glad_glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)load("glTexImage4DSGIS"); + glad_glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)load("glTexSubImage4DSGIS"); +} +static void load_GL_EXT_texture3D(GLADloadproc load) { + if(!GLAD_GL_EXT_texture3D) return; + glad_glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)load("glTexImage3DEXT"); + glad_glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)load("glTexSubImage3DEXT"); +} +static void load_GL_EXT_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_multisample) return; + glad_glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)load("glSampleMaskEXT"); + glad_glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)load("glSamplePatternEXT"); +} +static void load_GL_EXT_secondary_color(GLADloadproc load) { + if(!GLAD_GL_EXT_secondary_color) return; + glad_glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)load("glSecondaryColor3bEXT"); + glad_glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)load("glSecondaryColor3bvEXT"); + glad_glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)load("glSecondaryColor3dEXT"); + glad_glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)load("glSecondaryColor3dvEXT"); + glad_glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)load("glSecondaryColor3fEXT"); + glad_glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)load("glSecondaryColor3fvEXT"); + glad_glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)load("glSecondaryColor3iEXT"); + glad_glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)load("glSecondaryColor3ivEXT"); + glad_glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)load("glSecondaryColor3sEXT"); + glad_glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)load("glSecondaryColor3svEXT"); + glad_glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)load("glSecondaryColor3ubEXT"); + glad_glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)load("glSecondaryColor3ubvEXT"); + glad_glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)load("glSecondaryColor3uiEXT"); + glad_glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)load("glSecondaryColor3uivEXT"); + glad_glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)load("glSecondaryColor3usEXT"); + glad_glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)load("glSecondaryColor3usvEXT"); + glad_glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)load("glSecondaryColorPointerEXT"); +} +static void load_GL_ATI_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_ATI_vertex_array_object) return; + glad_glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)load("glNewObjectBufferATI"); + glad_glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)load("glIsObjectBufferATI"); + glad_glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)load("glUpdateObjectBufferATI"); + glad_glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)load("glGetObjectBufferfvATI"); + glad_glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)load("glGetObjectBufferivATI"); + glad_glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)load("glFreeObjectBufferATI"); + glad_glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)load("glArrayObjectATI"); + glad_glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)load("glGetArrayObjectfvATI"); + glad_glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)load("glGetArrayObjectivATI"); + glad_glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)load("glVariantArrayObjectATI"); + glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); + glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); +} +static void load_GL_ARB_parallel_shader_compile(GLADloadproc load) { + if(!GLAD_GL_ARB_parallel_shader_compile) return; + glad_glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)load("glMaxShaderCompilerThreadsARB"); +} +static void load_GL_ARB_sparse_texture(GLADloadproc load) { + if(!GLAD_GL_ARB_sparse_texture) return; + glad_glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)load("glTexPageCommitmentARB"); +} +static void load_GL_ARB_sample_locations(GLADloadproc load) { + if(!GLAD_GL_ARB_sample_locations) return; + glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); + glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); + glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); +} +static void load_GL_ARB_sparse_buffer(GLADloadproc load) { + if(!GLAD_GL_ARB_sparse_buffer) return; + glad_glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)load("glBufferPageCommitmentARB"); + glad_glNamedBufferPageCommitmentEXT = (PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)load("glNamedBufferPageCommitmentEXT"); + glad_glNamedBufferPageCommitmentARB = (PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)load("glNamedBufferPageCommitmentARB"); +} +static void load_GL_EXT_draw_range_elements(GLADloadproc load) { + if(!GLAD_GL_EXT_draw_range_elements) return; + glad_glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)load("glDrawRangeElementsEXT"); +} +static int find_extensionsGL(void) { + if (!get_exts()) return 0; + GLAD_GL_SGIX_pixel_tiles = has_ext("GL_SGIX_pixel_tiles"); + GLAD_GL_EXT_post_depth_coverage = has_ext("GL_EXT_post_depth_coverage"); + GLAD_GL_APPLE_element_array = has_ext("GL_APPLE_element_array"); + GLAD_GL_AMD_multi_draw_indirect = has_ext("GL_AMD_multi_draw_indirect"); + GLAD_GL_EXT_blend_subtract = has_ext("GL_EXT_blend_subtract"); + GLAD_GL_SGIX_tag_sample_buffer = has_ext("GL_SGIX_tag_sample_buffer"); + GLAD_GL_NV_point_sprite = has_ext("GL_NV_point_sprite"); + GLAD_GL_IBM_texture_mirrored_repeat = has_ext("GL_IBM_texture_mirrored_repeat"); + GLAD_GL_APPLE_transform_hint = has_ext("GL_APPLE_transform_hint"); + GLAD_GL_ATI_separate_stencil = has_ext("GL_ATI_separate_stencil"); + GLAD_GL_NV_shader_atomic_int64 = has_ext("GL_NV_shader_atomic_int64"); + GLAD_GL_NV_vertex_program2_option = has_ext("GL_NV_vertex_program2_option"); + GLAD_GL_EXT_texture_buffer_object = has_ext("GL_EXT_texture_buffer_object"); + GLAD_GL_ARB_vertex_blend = has_ext("GL_ARB_vertex_blend"); + GLAD_GL_OVR_multiview = has_ext("GL_OVR_multiview"); + GLAD_GL_NV_vertex_program2 = has_ext("GL_NV_vertex_program2"); + GLAD_GL_ARB_program_interface_query = has_ext("GL_ARB_program_interface_query"); + GLAD_GL_EXT_misc_attribute = has_ext("GL_EXT_misc_attribute"); + GLAD_GL_NV_multisample_coverage = has_ext("GL_NV_multisample_coverage"); + GLAD_GL_ARB_shading_language_packing = has_ext("GL_ARB_shading_language_packing"); + GLAD_GL_EXT_texture_cube_map = has_ext("GL_EXT_texture_cube_map"); + GLAD_GL_NV_viewport_array2 = has_ext("GL_NV_viewport_array2"); + GLAD_GL_ARB_texture_stencil8 = has_ext("GL_ARB_texture_stencil8"); + GLAD_GL_EXT_index_func = has_ext("GL_EXT_index_func"); + GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); + GLAD_GL_NV_depth_clamp = has_ext("GL_NV_depth_clamp"); + GLAD_GL_NV_shader_buffer_load = has_ext("GL_NV_shader_buffer_load"); + GLAD_GL_EXT_color_subtable = has_ext("GL_EXT_color_subtable"); + GLAD_GL_SUNX_constant_data = has_ext("GL_SUNX_constant_data"); + GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); + GLAD_GL_EXT_multi_draw_arrays = has_ext("GL_EXT_multi_draw_arrays"); + GLAD_GL_ARB_shader_atomic_counters = has_ext("GL_ARB_shader_atomic_counters"); + GLAD_GL_ARB_arrays_of_arrays = has_ext("GL_ARB_arrays_of_arrays"); + GLAD_GL_NV_conditional_render = has_ext("GL_NV_conditional_render"); + GLAD_GL_EXT_texture_env_combine = has_ext("GL_EXT_texture_env_combine"); + GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); + GLAD_GL_SGIX_async_histogram = has_ext("GL_SGIX_async_histogram"); + GLAD_GL_MESA_resize_buffers = has_ext("GL_MESA_resize_buffers"); + GLAD_GL_NV_light_max_exponent = has_ext("GL_NV_light_max_exponent"); + GLAD_GL_NV_texture_env_combine4 = has_ext("GL_NV_texture_env_combine4"); + GLAD_GL_ARB_texture_view = has_ext("GL_ARB_texture_view"); + GLAD_GL_ARB_texture_env_combine = has_ext("GL_ARB_texture_env_combine"); + GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); + GLAD_GL_EXT_convolution = has_ext("GL_EXT_convolution"); + GLAD_GL_NV_compute_program5 = has_ext("GL_NV_compute_program5"); + GLAD_GL_NV_vertex_attrib_integer_64bit = has_ext("GL_NV_vertex_attrib_integer_64bit"); + GLAD_GL_EXT_paletted_texture = has_ext("GL_EXT_paletted_texture"); + GLAD_GL_ARB_texture_buffer_object = has_ext("GL_ARB_texture_buffer_object"); + GLAD_GL_ATI_pn_triangles = has_ext("GL_ATI_pn_triangles"); + GLAD_GL_SGIX_resample = has_ext("GL_SGIX_resample"); + GLAD_GL_SGIX_flush_raster = has_ext("GL_SGIX_flush_raster"); + GLAD_GL_EXT_light_texture = has_ext("GL_EXT_light_texture"); + GLAD_GL_ARB_point_sprite = has_ext("GL_ARB_point_sprite"); + GLAD_GL_SUN_convolution_border_modes = has_ext("GL_SUN_convolution_border_modes"); + GLAD_GL_NV_parameter_buffer_object2 = has_ext("GL_NV_parameter_buffer_object2"); + GLAD_GL_ARB_half_float_pixel = has_ext("GL_ARB_half_float_pixel"); + GLAD_GL_NV_tessellation_program5 = has_ext("GL_NV_tessellation_program5"); + GLAD_GL_REND_screen_coordinates = has_ext("GL_REND_screen_coordinates"); + GLAD_GL_HP_image_transform = has_ext("GL_HP_image_transform"); + GLAD_GL_EXT_packed_float = has_ext("GL_EXT_packed_float"); + GLAD_GL_OML_subsample = has_ext("GL_OML_subsample"); + GLAD_GL_SGIX_vertex_preclip = has_ext("GL_SGIX_vertex_preclip"); + GLAD_GL_SGIX_texture_scale_bias = has_ext("GL_SGIX_texture_scale_bias"); + GLAD_GL_AMD_draw_buffers_blend = has_ext("GL_AMD_draw_buffers_blend"); + GLAD_GL_APPLE_texture_range = has_ext("GL_APPLE_texture_range"); + GLAD_GL_EXT_texture_array = has_ext("GL_EXT_texture_array"); + GLAD_GL_NV_texture_barrier = has_ext("GL_NV_texture_barrier"); + GLAD_GL_ARB_texture_query_levels = has_ext("GL_ARB_texture_query_levels"); + GLAD_GL_NV_texgen_emboss = has_ext("GL_NV_texgen_emboss"); + GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); + GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); + GLAD_GL_ARB_vertex_type_2_10_10_10_rev = has_ext("GL_ARB_vertex_type_2_10_10_10_rev"); + GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); + GLAD_GL_3DFX_tbuffer = has_ext("GL_3DFX_tbuffer"); + GLAD_GL_GREMEDY_frame_terminator = has_ext("GL_GREMEDY_frame_terminator"); + GLAD_GL_ARB_blend_func_extended = has_ext("GL_ARB_blend_func_extended"); + GLAD_GL_EXT_separate_shader_objects = has_ext("GL_EXT_separate_shader_objects"); + GLAD_GL_NV_texture_multisample = has_ext("GL_NV_texture_multisample"); + GLAD_GL_ARB_shader_objects = has_ext("GL_ARB_shader_objects"); + GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); + GLAD_GL_ATI_envmap_bumpmap = has_ext("GL_ATI_envmap_bumpmap"); + GLAD_GL_ARB_robust_buffer_access_behavior = has_ext("GL_ARB_robust_buffer_access_behavior"); + GLAD_GL_ARB_shader_stencil_export = has_ext("GL_ARB_shader_stencil_export"); + GLAD_GL_NV_texture_rectangle = has_ext("GL_NV_texture_rectangle"); + GLAD_GL_ARB_enhanced_layouts = has_ext("GL_ARB_enhanced_layouts"); + GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); + GLAD_GL_SGI_texture_color_table = has_ext("GL_SGI_texture_color_table"); + GLAD_GL_ATI_map_object_buffer = has_ext("GL_ATI_map_object_buffer"); + GLAD_GL_ARB_robustness = has_ext("GL_ARB_robustness"); + GLAD_GL_NV_pixel_data_range = has_ext("GL_NV_pixel_data_range"); + GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); + GLAD_GL_ARB_gpu_shader_fp64 = has_ext("GL_ARB_gpu_shader_fp64"); + GLAD_GL_NV_command_list = has_ext("GL_NV_command_list"); + GLAD_GL_SGIX_depth_texture = has_ext("GL_SGIX_depth_texture"); + GLAD_GL_EXT_vertex_weighting = has_ext("GL_EXT_vertex_weighting"); + GLAD_GL_GREMEDY_string_marker = has_ext("GL_GREMEDY_string_marker"); + GLAD_GL_ARB_texture_compression_bptc = has_ext("GL_ARB_texture_compression_bptc"); + GLAD_GL_EXT_subtexture = has_ext("GL_EXT_subtexture"); + GLAD_GL_EXT_pixel_transform_color_table = has_ext("GL_EXT_pixel_transform_color_table"); + GLAD_GL_EXT_texture_compression_rgtc = has_ext("GL_EXT_texture_compression_rgtc"); + GLAD_GL_ARB_shader_atomic_counter_ops = has_ext("GL_ARB_shader_atomic_counter_ops"); + GLAD_GL_SGIX_depth_pass_instrument = has_ext("GL_SGIX_depth_pass_instrument"); + GLAD_GL_EXT_gpu_program_parameters = has_ext("GL_EXT_gpu_program_parameters"); + GLAD_GL_NV_evaluators = has_ext("GL_NV_evaluators"); + GLAD_GL_SGIS_texture_filter4 = has_ext("GL_SGIS_texture_filter4"); + GLAD_GL_AMD_performance_monitor = has_ext("GL_AMD_performance_monitor"); + GLAD_GL_NV_geometry_shader4 = has_ext("GL_NV_geometry_shader4"); + GLAD_GL_EXT_stencil_clear_tag = has_ext("GL_EXT_stencil_clear_tag"); + GLAD_GL_NV_vertex_program1_1 = has_ext("GL_NV_vertex_program1_1"); + GLAD_GL_NV_present_video = has_ext("GL_NV_present_video"); + GLAD_GL_ARB_texture_compression_rgtc = has_ext("GL_ARB_texture_compression_rgtc"); + GLAD_GL_HP_convolution_border_modes = has_ext("GL_HP_convolution_border_modes"); + GLAD_GL_EXT_shader_integer_mix = has_ext("GL_EXT_shader_integer_mix"); + GLAD_GL_SGIX_framezoom = has_ext("GL_SGIX_framezoom"); + GLAD_GL_ARB_stencil_texturing = has_ext("GL_ARB_stencil_texturing"); + GLAD_GL_ARB_shader_clock = has_ext("GL_ARB_shader_clock"); + GLAD_GL_NV_shader_atomic_fp16_vector = has_ext("GL_NV_shader_atomic_fp16_vector"); + GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); + GLAD_GL_ARB_draw_elements_base_vertex = has_ext("GL_ARB_draw_elements_base_vertex"); + GLAD_GL_INGR_interlace_read = has_ext("GL_INGR_interlace_read"); + GLAD_GL_NV_transform_feedback = has_ext("GL_NV_transform_feedback"); + GLAD_GL_NV_fragment_program = has_ext("GL_NV_fragment_program"); + GLAD_GL_AMD_stencil_operation_extended = has_ext("GL_AMD_stencil_operation_extended"); + GLAD_GL_ARB_seamless_cubemap_per_texture = has_ext("GL_ARB_seamless_cubemap_per_texture"); + GLAD_GL_ARB_instanced_arrays = has_ext("GL_ARB_instanced_arrays"); + GLAD_GL_EXT_polygon_offset = has_ext("GL_EXT_polygon_offset"); + GLAD_GL_NV_vertex_array_range2 = has_ext("GL_NV_vertex_array_range2"); + GLAD_GL_KHR_robustness = has_ext("GL_KHR_robustness"); + GLAD_GL_AMD_sparse_texture = has_ext("GL_AMD_sparse_texture"); + GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control"); + GLAD_GL_NV_fragment_coverage_to_color = has_ext("GL_NV_fragment_coverage_to_color"); + GLAD_GL_NV_fence = has_ext("GL_NV_fence"); + GLAD_GL_ARB_texture_buffer_range = has_ext("GL_ARB_texture_buffer_range"); + GLAD_GL_SUN_mesh_array = has_ext("GL_SUN_mesh_array"); + GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); + GLAD_GL_ARB_framebuffer_no_attachments = has_ext("GL_ARB_framebuffer_no_attachments"); + GLAD_GL_ARB_cl_event = has_ext("GL_ARB_cl_event"); + GLAD_GL_ARB_derivative_control = has_ext("GL_ARB_derivative_control"); + GLAD_GL_NV_packed_depth_stencil = has_ext("GL_NV_packed_depth_stencil"); + GLAD_GL_OES_single_precision = has_ext("GL_OES_single_precision"); + GLAD_GL_NV_primitive_restart = has_ext("GL_NV_primitive_restart"); + GLAD_GL_SUN_global_alpha = has_ext("GL_SUN_global_alpha"); + GLAD_GL_ARB_fragment_shader_interlock = has_ext("GL_ARB_fragment_shader_interlock"); + GLAD_GL_EXT_texture_object = has_ext("GL_EXT_texture_object"); + GLAD_GL_AMD_name_gen_delete = has_ext("GL_AMD_name_gen_delete"); + GLAD_GL_NV_texture_compression_vtc = has_ext("GL_NV_texture_compression_vtc"); + GLAD_GL_NV_sample_mask_override_coverage = has_ext("GL_NV_sample_mask_override_coverage"); + GLAD_GL_NV_texture_shader3 = has_ext("GL_NV_texture_shader3"); + GLAD_GL_NV_texture_shader2 = has_ext("GL_NV_texture_shader2"); + GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); + GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); + GLAD_GL_AMD_shader_atomic_counter_ops = has_ext("GL_AMD_shader_atomic_counter_ops"); + GLAD_GL_APPLE_vertex_program_evaluators = has_ext("GL_APPLE_vertex_program_evaluators"); + GLAD_GL_ARB_multi_bind = has_ext("GL_ARB_multi_bind"); + GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); + GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); + GLAD_GL_NV_path_rendering_shared_edge = has_ext("GL_NV_path_rendering_shared_edge"); + GLAD_GL_SGIX_shadow_ambient = has_ext("GL_SGIX_shadow_ambient"); + GLAD_GL_ARB_texture_cube_map = has_ext("GL_ARB_texture_cube_map"); + GLAD_GL_AMD_vertex_shader_viewport_index = has_ext("GL_AMD_vertex_shader_viewport_index"); + GLAD_GL_SGIX_list_priority = has_ext("GL_SGIX_list_priority"); + GLAD_GL_NV_vertex_buffer_unified_memory = has_ext("GL_NV_vertex_buffer_unified_memory"); + GLAD_GL_NV_uniform_buffer_unified_memory = has_ext("GL_NV_uniform_buffer_unified_memory"); + GLAD_GL_EXT_texture_env_dot3 = has_ext("GL_EXT_texture_env_dot3"); + GLAD_GL_ATI_texture_env_combine3 = has_ext("GL_ATI_texture_env_combine3"); + GLAD_GL_ARB_map_buffer_alignment = has_ext("GL_ARB_map_buffer_alignment"); + GLAD_GL_NV_blend_equation_advanced = has_ext("GL_NV_blend_equation_advanced"); + GLAD_GL_SGIS_sharpen_texture = has_ext("GL_SGIS_sharpen_texture"); + GLAD_GL_KHR_robust_buffer_access_behavior = has_ext("GL_KHR_robust_buffer_access_behavior"); + GLAD_GL_ARB_pipeline_statistics_query = has_ext("GL_ARB_pipeline_statistics_query"); + GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); + GLAD_GL_ARB_texture_rgb10_a2ui = has_ext("GL_ARB_texture_rgb10_a2ui"); + GLAD_GL_OML_interlace = has_ext("GL_OML_interlace"); + GLAD_GL_ATI_pixel_format_float = has_ext("GL_ATI_pixel_format_float"); + GLAD_GL_NV_geometry_shader_passthrough = has_ext("GL_NV_geometry_shader_passthrough"); + GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); + GLAD_GL_EXT_shadow_funcs = has_ext("GL_EXT_shadow_funcs"); + GLAD_GL_ATI_text_fragment_shader = has_ext("GL_ATI_text_fragment_shader"); + GLAD_GL_NV_vertex_array_range = has_ext("GL_NV_vertex_array_range"); + GLAD_GL_SGIX_fragment_lighting = has_ext("GL_SGIX_fragment_lighting"); + GLAD_GL_NV_texture_expand_normal = has_ext("GL_NV_texture_expand_normal"); + GLAD_GL_NV_framebuffer_multisample_coverage = has_ext("GL_NV_framebuffer_multisample_coverage"); + GLAD_GL_EXT_timer_query = has_ext("GL_EXT_timer_query"); + GLAD_GL_EXT_vertex_array_bgra = has_ext("GL_EXT_vertex_array_bgra"); + GLAD_GL_NV_bindless_texture = has_ext("GL_NV_bindless_texture"); + GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); + GLAD_GL_SGIS_texture_border_clamp = has_ext("GL_SGIS_texture_border_clamp"); + GLAD_GL_ATI_vertex_attrib_array_object = has_ext("GL_ATI_vertex_attrib_array_object"); + GLAD_GL_SGIX_clipmap = has_ext("GL_SGIX_clipmap"); + GLAD_GL_EXT_geometry_shader4 = has_ext("GL_EXT_geometry_shader4"); + GLAD_GL_ARB_shader_texture_image_samples = has_ext("GL_ARB_shader_texture_image_samples"); + GLAD_GL_MESA_ycbcr_texture = has_ext("GL_MESA_ycbcr_texture"); + GLAD_GL_MESAX_texture_stack = has_ext("GL_MESAX_texture_stack"); + GLAD_GL_AMD_seamless_cubemap_per_texture = has_ext("GL_AMD_seamless_cubemap_per_texture"); + GLAD_GL_EXT_bindable_uniform = has_ext("GL_EXT_bindable_uniform"); + GLAD_GL_KHR_texture_compression_astc_hdr = has_ext("GL_KHR_texture_compression_astc_hdr"); + GLAD_GL_ARB_shader_ballot = has_ext("GL_ARB_shader_ballot"); + GLAD_GL_KHR_blend_equation_advanced = has_ext("GL_KHR_blend_equation_advanced"); + GLAD_GL_ARB_fragment_program_shadow = has_ext("GL_ARB_fragment_program_shadow"); + GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); + GLAD_GL_AMD_texture_texture4 = has_ext("GL_AMD_texture_texture4"); + GLAD_GL_SGIX_reference_plane = has_ext("GL_SGIX_reference_plane"); + GLAD_GL_EXT_stencil_two_side = has_ext("GL_EXT_stencil_two_side"); + GLAD_GL_ARB_transform_feedback_overflow_query = has_ext("GL_ARB_transform_feedback_overflow_query"); + GLAD_GL_SGIX_texture_lod_bias = has_ext("GL_SGIX_texture_lod_bias"); + GLAD_GL_KHR_no_error = has_ext("GL_KHR_no_error"); + GLAD_GL_NV_explicit_multisample = has_ext("GL_NV_explicit_multisample"); + GLAD_GL_IBM_static_data = has_ext("GL_IBM_static_data"); + GLAD_GL_EXT_clip_volume_hint = has_ext("GL_EXT_clip_volume_hint"); + GLAD_GL_EXT_texture_perturb_normal = has_ext("GL_EXT_texture_perturb_normal"); + GLAD_GL_NV_fragment_program2 = has_ext("GL_NV_fragment_program2"); + GLAD_GL_NV_fragment_program4 = has_ext("GL_NV_fragment_program4"); + GLAD_GL_EXT_point_parameters = has_ext("GL_EXT_point_parameters"); + GLAD_GL_PGI_misc_hints = has_ext("GL_PGI_misc_hints"); + GLAD_GL_SGIX_subsample = has_ext("GL_SGIX_subsample"); + GLAD_GL_AMD_shader_stencil_export = has_ext("GL_AMD_shader_stencil_export"); + GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod"); + GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); + GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); + GLAD_GL_SGIS_texture_select = has_ext("GL_SGIS_texture_select"); + GLAD_GL_NV_texture_shader = has_ext("GL_NV_texture_shader"); + GLAD_GL_ARB_tessellation_shader = has_ext("GL_ARB_tessellation_shader"); + GLAD_GL_EXT_draw_buffers2 = has_ext("GL_EXT_draw_buffers2"); + GLAD_GL_ARB_vertex_attrib_64bit = has_ext("GL_ARB_vertex_attrib_64bit"); + GLAD_GL_EXT_texture_filter_minmax = has_ext("GL_EXT_texture_filter_minmax"); + GLAD_GL_WIN_specular_fog = has_ext("GL_WIN_specular_fog"); + GLAD_GL_AMD_interleaved_elements = has_ext("GL_AMD_interleaved_elements"); + GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); + GLAD_GL_OML_resample = has_ext("GL_OML_resample"); + GLAD_GL_APPLE_ycbcr_422 = has_ext("GL_APPLE_ycbcr_422"); + GLAD_GL_SGIX_texture_add_env = has_ext("GL_SGIX_texture_add_env"); + GLAD_GL_ARB_shadow_ambient = has_ext("GL_ARB_shadow_ambient"); + GLAD_GL_ARB_texture_storage = has_ext("GL_ARB_texture_storage"); + GLAD_GL_EXT_pixel_buffer_object = has_ext("GL_EXT_pixel_buffer_object"); + GLAD_GL_ARB_copy_image = has_ext("GL_ARB_copy_image"); + GLAD_GL_SGIS_pixel_texture = has_ext("GL_SGIS_pixel_texture"); + GLAD_GL_SGIS_generate_mipmap = has_ext("GL_SGIS_generate_mipmap"); + GLAD_GL_SGIX_instruments = has_ext("GL_SGIX_instruments"); + GLAD_GL_HP_texture_lighting = has_ext("GL_HP_texture_lighting"); + GLAD_GL_ARB_shader_storage_buffer_object = has_ext("GL_ARB_shader_storage_buffer_object"); + GLAD_GL_EXT_sparse_texture2 = has_ext("GL_EXT_sparse_texture2"); + GLAD_GL_EXT_blend_minmax = has_ext("GL_EXT_blend_minmax"); + GLAD_GL_MESA_pack_invert = has_ext("GL_MESA_pack_invert"); + GLAD_GL_ARB_base_instance = has_ext("GL_ARB_base_instance"); + GLAD_GL_SGIX_convolution_accuracy = has_ext("GL_SGIX_convolution_accuracy"); + GLAD_GL_PGI_vertex_hints = has_ext("GL_PGI_vertex_hints"); + GLAD_GL_AMD_transform_feedback4 = has_ext("GL_AMD_transform_feedback4"); + GLAD_GL_ARB_ES3_1_compatibility = has_ext("GL_ARB_ES3_1_compatibility"); + GLAD_GL_EXT_texture_integer = has_ext("GL_EXT_texture_integer"); + GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); + GLAD_GL_AMD_gpu_shader_int64 = has_ext("GL_AMD_gpu_shader_int64"); + GLAD_GL_S3_s3tc = has_ext("GL_S3_s3tc"); + GLAD_GL_ARB_query_buffer_object = has_ext("GL_ARB_query_buffer_object"); + GLAD_GL_AMD_vertex_shader_tessellator = has_ext("GL_AMD_vertex_shader_tessellator"); + GLAD_GL_ARB_invalidate_subdata = has_ext("GL_ARB_invalidate_subdata"); + GLAD_GL_EXT_index_material = has_ext("GL_EXT_index_material"); + GLAD_GL_NV_blend_equation_advanced_coherent = has_ext("GL_NV_blend_equation_advanced_coherent"); + GLAD_GL_KHR_texture_compression_astc_sliced_3d = has_ext("GL_KHR_texture_compression_astc_sliced_3d"); + GLAD_GL_INTEL_parallel_arrays = has_ext("GL_INTEL_parallel_arrays"); + GLAD_GL_ATI_draw_buffers = has_ext("GL_ATI_draw_buffers"); + GLAD_GL_EXT_cmyka = has_ext("GL_EXT_cmyka"); + GLAD_GL_SGIX_pixel_texture = has_ext("GL_SGIX_pixel_texture"); + GLAD_GL_APPLE_specular_vector = has_ext("GL_APPLE_specular_vector"); + GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); + GLAD_GL_ARB_timer_query = has_ext("GL_ARB_timer_query"); + GLAD_GL_SGIX_interlace = has_ext("GL_SGIX_interlace"); + GLAD_GL_NV_parameter_buffer_object = has_ext("GL_NV_parameter_buffer_object"); + GLAD_GL_AMD_shader_trinary_minmax = has_ext("GL_AMD_shader_trinary_minmax"); + GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access"); + GLAD_GL_EXT_rescale_normal = has_ext("GL_EXT_rescale_normal"); + GLAD_GL_ARB_pixel_buffer_object = has_ext("GL_ARB_pixel_buffer_object"); + GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); + GLAD_GL_ARB_vertex_type_10f_11f_11f_rev = has_ext("GL_ARB_vertex_type_10f_11f_11f_rev"); + GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); + GLAD_GL_NV_transform_feedback2 = has_ext("GL_NV_transform_feedback2"); + GLAD_GL_SGIX_async_pixel = has_ext("GL_SGIX_async_pixel"); + GLAD_GL_NV_fragment_program_option = has_ext("GL_NV_fragment_program_option"); + GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); + GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); + GLAD_GL_NV_shader_thread_group = has_ext("GL_NV_shader_thread_group"); + GLAD_GL_EXT_stencil_wrap = has_ext("GL_EXT_stencil_wrap"); + GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); + GLAD_GL_OVR_multiview2 = has_ext("GL_OVR_multiview2"); + GLAD_GL_EXT_histogram = has_ext("GL_EXT_histogram"); + GLAD_GL_ARB_get_texture_sub_image = has_ext("GL_ARB_get_texture_sub_image"); + GLAD_GL_SGIS_point_parameters = has_ext("GL_SGIS_point_parameters"); + GLAD_GL_SGIX_ycrcb = has_ext("GL_SGIX_ycrcb"); + GLAD_GL_EXT_direct_state_access = has_ext("GL_EXT_direct_state_access"); + GLAD_GL_ARB_cull_distance = has_ext("GL_ARB_cull_distance"); + GLAD_GL_AMD_sample_positions = has_ext("GL_AMD_sample_positions"); + GLAD_GL_NV_vertex_program = has_ext("GL_NV_vertex_program"); + GLAD_GL_NV_shader_thread_shuffle = has_ext("GL_NV_shader_thread_shuffle"); + GLAD_GL_ARB_shader_precision = has_ext("GL_ARB_shader_precision"); + GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); + GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); + GLAD_GL_APPLE_fence = has_ext("GL_APPLE_fence"); + GLAD_GL_OES_byte_coordinates = has_ext("GL_OES_byte_coordinates"); + GLAD_GL_ARB_transpose_matrix = has_ext("GL_ARB_transpose_matrix"); + GLAD_GL_ARB_provoking_vertex = has_ext("GL_ARB_provoking_vertex"); + GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); + GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); + GLAD_GL_ARB_half_float_vertex = has_ext("GL_ARB_half_float_vertex"); + GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); + GLAD_GL_NV_framebuffer_mixed_samples = has_ext("GL_NV_framebuffer_mixed_samples"); + GLAD_GL_NVX_conditional_render = has_ext("GL_NVX_conditional_render"); + GLAD_GL_ARB_multi_draw_indirect = has_ext("GL_ARB_multi_draw_indirect"); + GLAD_GL_EXT_raster_multisample = has_ext("GL_EXT_raster_multisample"); + GLAD_GL_NV_copy_image = has_ext("GL_NV_copy_image"); + GLAD_GL_ARB_fragment_layer_viewport = has_ext("GL_ARB_fragment_layer_viewport"); + GLAD_GL_INTEL_framebuffer_CMAA = has_ext("GL_INTEL_framebuffer_CMAA"); + GLAD_GL_ARB_transform_feedback2 = has_ext("GL_ARB_transform_feedback2"); + GLAD_GL_ARB_transform_feedback3 = has_ext("GL_ARB_transform_feedback3"); + GLAD_GL_SGIX_ycrcba = has_ext("GL_SGIX_ycrcba"); + GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); + GLAD_GL_EXT_bgra = has_ext("GL_EXT_bgra"); + GLAD_GL_ARB_sparse_texture_clamp = has_ext("GL_ARB_sparse_texture_clamp"); + GLAD_GL_EXT_pixel_transform = has_ext("GL_EXT_pixel_transform"); + GLAD_GL_ARB_conservative_depth = has_ext("GL_ARB_conservative_depth"); + GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); + GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); + GLAD_GL_SUN_triangle_list = has_ext("GL_SUN_triangle_list"); + GLAD_GL_EXT_texture_env_add = has_ext("GL_EXT_texture_env_add"); + GLAD_GL_EXT_packed_depth_stencil = has_ext("GL_EXT_packed_depth_stencil"); + GLAD_GL_EXT_texture_mirror_clamp = has_ext("GL_EXT_texture_mirror_clamp"); + GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); + GLAD_GL_APPLE_float_pixels = has_ext("GL_APPLE_float_pixels"); + GLAD_GL_ARB_transform_feedback_instanced = has_ext("GL_ARB_transform_feedback_instanced"); + GLAD_GL_SGIX_async = has_ext("GL_SGIX_async"); + GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); + GLAD_GL_NV_shader_atomic_float = has_ext("GL_NV_shader_atomic_float"); + GLAD_GL_ARB_shading_language_100 = has_ext("GL_ARB_shading_language_100"); + GLAD_GL_INTEL_performance_query = has_ext("GL_INTEL_performance_query"); + GLAD_GL_ARB_texture_mirror_clamp_to_edge = has_ext("GL_ARB_texture_mirror_clamp_to_edge"); + GLAD_GL_NV_gpu_shader5 = has_ext("GL_NV_gpu_shader5"); + GLAD_GL_NV_bindless_multi_draw_indirect_count = has_ext("GL_NV_bindless_multi_draw_indirect_count"); + GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); + GLAD_GL_ARB_indirect_parameters = has_ext("GL_ARB_indirect_parameters"); + GLAD_GL_NV_half_float = has_ext("GL_NV_half_float"); + GLAD_GL_ARB_ES3_2_compatibility = has_ext("GL_ARB_ES3_2_compatibility"); + GLAD_GL_ATI_texture_mirror_once = has_ext("GL_ATI_texture_mirror_once"); + GLAD_GL_IBM_rasterpos_clip = has_ext("GL_IBM_rasterpos_clip"); + GLAD_GL_SGIX_shadow = has_ext("GL_SGIX_shadow"); + GLAD_GL_EXT_polygon_offset_clamp = has_ext("GL_EXT_polygon_offset_clamp"); + GLAD_GL_NV_deep_texture3D = has_ext("GL_NV_deep_texture3D"); + GLAD_GL_ARB_shader_draw_parameters = has_ext("GL_ARB_shader_draw_parameters"); + GLAD_GL_SGIX_calligraphic_fragment = has_ext("GL_SGIX_calligraphic_fragment"); + GLAD_GL_ARB_shader_bit_encoding = has_ext("GL_ARB_shader_bit_encoding"); + GLAD_GL_EXT_compiled_vertex_array = has_ext("GL_EXT_compiled_vertex_array"); + GLAD_GL_NV_depth_buffer_float = has_ext("GL_NV_depth_buffer_float"); + GLAD_GL_NV_occlusion_query = has_ext("GL_NV_occlusion_query"); + GLAD_GL_APPLE_flush_buffer_range = has_ext("GL_APPLE_flush_buffer_range"); + GLAD_GL_ARB_imaging = has_ext("GL_ARB_imaging"); + GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); + GLAD_GL_AMD_gcn_shader = has_ext("GL_AMD_gcn_shader"); + GLAD_GL_AMD_blend_minmax_factor = has_ext("GL_AMD_blend_minmax_factor"); + GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); + GLAD_GL_ARB_shading_language_420pack = has_ext("GL_ARB_shading_language_420pack"); + GLAD_GL_ARB_shader_viewport_layer_array = has_ext("GL_ARB_shader_viewport_layer_array"); + GLAD_GL_ATI_meminfo = has_ext("GL_ATI_meminfo"); + GLAD_GL_EXT_abgr = has_ext("GL_EXT_abgr"); + GLAD_GL_AMD_pinned_memory = has_ext("GL_AMD_pinned_memory"); + GLAD_GL_EXT_texture_snorm = has_ext("GL_EXT_texture_snorm"); + GLAD_GL_SGIX_texture_coordinate_clamp = has_ext("GL_SGIX_texture_coordinate_clamp"); + GLAD_GL_ARB_clear_buffer_object = has_ext("GL_ARB_clear_buffer_object"); + GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); + GLAD_GL_EXT_debug_label = has_ext("GL_EXT_debug_label"); + GLAD_GL_ARB_sample_shading = has_ext("GL_ARB_sample_shading"); + GLAD_GL_NV_internalformat_sample_query = has_ext("GL_NV_internalformat_sample_query"); + GLAD_GL_INTEL_map_texture = has_ext("GL_INTEL_map_texture"); + GLAD_GL_ARB_texture_env_crossbar = has_ext("GL_ARB_texture_env_crossbar"); + GLAD_GL_EXT_422_pixels = has_ext("GL_EXT_422_pixels"); + GLAD_GL_ARB_compute_shader = has_ext("GL_ARB_compute_shader"); + GLAD_GL_EXT_blend_logic_op = has_ext("GL_EXT_blend_logic_op"); + GLAD_GL_IBM_cull_vertex = has_ext("GL_IBM_cull_vertex"); + GLAD_GL_IBM_vertex_array_lists = has_ext("GL_IBM_vertex_array_lists"); + GLAD_GL_ARB_color_buffer_float = has_ext("GL_ARB_color_buffer_float"); + GLAD_GL_ARB_bindless_texture = has_ext("GL_ARB_bindless_texture"); + GLAD_GL_ARB_window_pos = has_ext("GL_ARB_window_pos"); + GLAD_GL_ARB_internalformat_query = has_ext("GL_ARB_internalformat_query"); + GLAD_GL_ARB_shadow = has_ext("GL_ARB_shadow"); + GLAD_GL_ARB_texture_mirrored_repeat = has_ext("GL_ARB_texture_mirrored_repeat"); + GLAD_GL_EXT_shader_image_load_store = has_ext("GL_EXT_shader_image_load_store"); + GLAD_GL_EXT_copy_texture = has_ext("GL_EXT_copy_texture"); + GLAD_GL_NV_register_combiners2 = has_ext("GL_NV_register_combiners2"); + GLAD_GL_SGIX_ycrcb_subsample = has_ext("GL_SGIX_ycrcb_subsample"); + GLAD_GL_SGIX_ir_instrument1 = has_ext("GL_SGIX_ir_instrument1"); + GLAD_GL_NV_draw_texture = has_ext("GL_NV_draw_texture"); + GLAD_GL_EXT_texture_shared_exponent = has_ext("GL_EXT_texture_shared_exponent"); + GLAD_GL_EXT_draw_instanced = has_ext("GL_EXT_draw_instanced"); + GLAD_GL_NV_copy_depth_to_color = has_ext("GL_NV_copy_depth_to_color"); + GLAD_GL_ARB_viewport_array = has_ext("GL_ARB_viewport_array"); + GLAD_GL_ARB_separate_shader_objects = has_ext("GL_ARB_separate_shader_objects"); + GLAD_GL_EXT_depth_bounds_test = has_ext("GL_EXT_depth_bounds_test"); + GLAD_GL_EXT_shared_texture_palette = has_ext("GL_EXT_shared_texture_palette"); + GLAD_GL_ARB_texture_env_add = has_ext("GL_ARB_texture_env_add"); + GLAD_GL_NV_video_capture = has_ext("GL_NV_video_capture"); + GLAD_GL_ARB_sampler_objects = has_ext("GL_ARB_sampler_objects"); + GLAD_GL_ARB_matrix_palette = has_ext("GL_ARB_matrix_palette"); + GLAD_GL_SGIS_texture_color_mask = has_ext("GL_SGIS_texture_color_mask"); + GLAD_GL_EXT_packed_pixels = has_ext("GL_EXT_packed_pixels"); + GLAD_GL_EXT_coordinate_frame = has_ext("GL_EXT_coordinate_frame"); + GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); + GLAD_GL_APPLE_aux_depth_stencil = has_ext("GL_APPLE_aux_depth_stencil"); + GLAD_GL_ARB_shader_subroutine = has_ext("GL_ARB_shader_subroutine"); + GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); + GLAD_GL_ARB_texture_storage_multisample = has_ext("GL_ARB_texture_storage_multisample"); + GLAD_GL_KHR_blend_equation_advanced_coherent = has_ext("GL_KHR_blend_equation_advanced_coherent"); + GLAD_GL_EXT_vertex_attrib_64bit = has_ext("GL_EXT_vertex_attrib_64bit"); + GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); + GLAD_GL_NV_shader_buffer_store = has_ext("GL_NV_shader_buffer_store"); + GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); + GLAD_GL_MESA_window_pos = has_ext("GL_MESA_window_pos"); + GLAD_GL_NV_fill_rectangle = has_ext("GL_NV_fill_rectangle"); + GLAD_GL_NV_shader_storage_buffer_object = has_ext("GL_NV_shader_storage_buffer_object"); + GLAD_GL_ARB_texture_query_lod = has_ext("GL_ARB_texture_query_lod"); + GLAD_GL_ARB_copy_buffer = has_ext("GL_ARB_copy_buffer"); + GLAD_GL_ARB_shader_image_size = has_ext("GL_ARB_shader_image_size"); + GLAD_GL_NV_shader_atomic_counters = has_ext("GL_NV_shader_atomic_counters"); + GLAD_GL_APPLE_object_purgeable = has_ext("GL_APPLE_object_purgeable"); + GLAD_GL_ARB_occlusion_query = has_ext("GL_ARB_occlusion_query"); + GLAD_GL_INGR_color_clamp = has_ext("GL_INGR_color_clamp"); + GLAD_GL_SGI_color_table = has_ext("GL_SGI_color_table"); + GLAD_GL_NV_gpu_program5_mem_extended = has_ext("GL_NV_gpu_program5_mem_extended"); + GLAD_GL_ARB_texture_cube_map_array = has_ext("GL_ARB_texture_cube_map_array"); + GLAD_GL_SGIX_scalebias_hint = has_ext("GL_SGIX_scalebias_hint"); + GLAD_GL_EXT_gpu_shader4 = has_ext("GL_EXT_gpu_shader4"); + GLAD_GL_NV_geometry_program4 = has_ext("GL_NV_geometry_program4"); + GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); + GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); + GLAD_GL_ARB_texture_border_clamp = has_ext("GL_ARB_texture_border_clamp"); + GLAD_GL_ARB_fragment_coord_conventions = has_ext("GL_ARB_fragment_coord_conventions"); + GLAD_GL_ARB_multitexture = has_ext("GL_ARB_multitexture"); + GLAD_GL_SGIX_polynomial_ffd = has_ext("GL_SGIX_polynomial_ffd"); + GLAD_GL_EXT_provoking_vertex = has_ext("GL_EXT_provoking_vertex"); + GLAD_GL_ARB_point_parameters = has_ext("GL_ARB_point_parameters"); + GLAD_GL_ARB_shader_image_load_store = has_ext("GL_ARB_shader_image_load_store"); + GLAD_GL_ARB_conditional_render_inverted = has_ext("GL_ARB_conditional_render_inverted"); + GLAD_GL_HP_occlusion_test = has_ext("GL_HP_occlusion_test"); + GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); + GLAD_GL_ARB_texture_barrier = has_ext("GL_ARB_texture_barrier"); + GLAD_GL_ARB_texture_buffer_object_rgb32 = has_ext("GL_ARB_texture_buffer_object_rgb32"); + GLAD_GL_NV_bindless_multi_draw_indirect = has_ext("GL_NV_bindless_multi_draw_indirect"); + GLAD_GL_SGIX_texture_multi_buffer = has_ext("GL_SGIX_texture_multi_buffer"); + GLAD_GL_EXT_transform_feedback = has_ext("GL_EXT_transform_feedback"); + GLAD_GL_KHR_texture_compression_astc_ldr = has_ext("GL_KHR_texture_compression_astc_ldr"); + GLAD_GL_3DFX_multisample = has_ext("GL_3DFX_multisample"); + GLAD_GL_INTEL_fragment_shader_ordering = has_ext("GL_INTEL_fragment_shader_ordering"); + GLAD_GL_ARB_texture_env_dot3 = has_ext("GL_ARB_texture_env_dot3"); + GLAD_GL_NV_gpu_program4 = has_ext("GL_NV_gpu_program4"); + GLAD_GL_NV_gpu_program5 = has_ext("GL_NV_gpu_program5"); + GLAD_GL_NV_float_buffer = has_ext("GL_NV_float_buffer"); + GLAD_GL_SGIS_texture_edge_clamp = has_ext("GL_SGIS_texture_edge_clamp"); + GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); + GLAD_GL_SUN_slice_accum = has_ext("GL_SUN_slice_accum"); + GLAD_GL_EXT_index_texture = has_ext("GL_EXT_index_texture"); + GLAD_GL_EXT_shader_image_load_formatted = has_ext("GL_EXT_shader_image_load_formatted"); + GLAD_GL_ARB_geometry_shader4 = has_ext("GL_ARB_geometry_shader4"); + GLAD_GL_EXT_separate_specular_color = has_ext("GL_EXT_separate_specular_color"); + GLAD_GL_AMD_depth_clamp_separate = has_ext("GL_AMD_depth_clamp_separate"); + GLAD_GL_NV_conservative_raster = has_ext("GL_NV_conservative_raster"); + GLAD_GL_ARB_sparse_texture2 = has_ext("GL_ARB_sparse_texture2"); + GLAD_GL_SGIX_sprite = has_ext("GL_SGIX_sprite"); + GLAD_GL_ARB_get_program_binary = has_ext("GL_ARB_get_program_binary"); + GLAD_GL_AMD_occlusion_query_event = has_ext("GL_AMD_occlusion_query_event"); + GLAD_GL_SGIS_multisample = has_ext("GL_SGIS_multisample"); + GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); + GLAD_GL_ARB_robustness_isolation = has_ext("GL_ARB_robustness_isolation"); + GLAD_GL_ARB_vertex_array_bgra = has_ext("GL_ARB_vertex_array_bgra"); + GLAD_GL_APPLE_vertex_array_range = has_ext("GL_APPLE_vertex_array_range"); + GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); + GLAD_GL_NV_register_combiners = has_ext("GL_NV_register_combiners"); + GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); + GLAD_GL_ARB_clear_texture = has_ext("GL_ARB_clear_texture"); + GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); + GLAD_GL_SGI_color_matrix = has_ext("GL_SGI_color_matrix"); + GLAD_GL_EXT_cull_vertex = has_ext("GL_EXT_cull_vertex"); + GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); + GLAD_GL_APPLE_row_bytes = has_ext("GL_APPLE_row_bytes"); + GLAD_GL_NV_texgen_reflection = has_ext("GL_NV_texgen_reflection"); + GLAD_GL_IBM_multimode_draw_arrays = has_ext("GL_IBM_multimode_draw_arrays"); + GLAD_GL_APPLE_vertex_array_object = has_ext("GL_APPLE_vertex_array_object"); + GLAD_GL_3DFX_texture_compression_FXT1 = has_ext("GL_3DFX_texture_compression_FXT1"); + GLAD_GL_NV_fragment_shader_interlock = has_ext("GL_NV_fragment_shader_interlock"); + GLAD_GL_AMD_conservative_depth = has_ext("GL_AMD_conservative_depth"); + GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); + GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); + GLAD_GL_SGIS_detail_texture = has_ext("GL_SGIS_detail_texture"); + GLAD_GL_ARB_draw_instanced = has_ext("GL_ARB_draw_instanced"); + GLAD_GL_OES_read_format = has_ext("GL_OES_read_format"); + GLAD_GL_ATI_texture_float = has_ext("GL_ATI_texture_float"); + GLAD_GL_ARB_texture_gather = has_ext("GL_ARB_texture_gather"); + GLAD_GL_AMD_vertex_shader_layer = has_ext("GL_AMD_vertex_shader_layer"); + GLAD_GL_ARB_shading_language_include = has_ext("GL_ARB_shading_language_include"); + GLAD_GL_APPLE_client_storage = has_ext("GL_APPLE_client_storage"); + GLAD_GL_WIN_phong_shading = has_ext("GL_WIN_phong_shading"); + GLAD_GL_INGR_blend_func_separate = has_ext("GL_INGR_blend_func_separate"); + GLAD_GL_NV_path_rendering = has_ext("GL_NV_path_rendering"); + GLAD_GL_NV_conservative_raster_dilate = has_ext("GL_NV_conservative_raster_dilate"); + GLAD_GL_ATI_vertex_streams = has_ext("GL_ATI_vertex_streams"); + GLAD_GL_ARB_post_depth_coverage = has_ext("GL_ARB_post_depth_coverage"); + GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); + GLAD_GL_APPLE_rgb_422 = has_ext("GL_APPLE_rgb_422"); + GLAD_GL_EXT_texture_lod_bias = has_ext("GL_EXT_texture_lod_bias"); + GLAD_GL_ARB_gpu_shader_int64 = has_ext("GL_ARB_gpu_shader_int64"); + GLAD_GL_ARB_seamless_cube_map = has_ext("GL_ARB_seamless_cube_map"); + GLAD_GL_ARB_shader_group_vote = has_ext("GL_ARB_shader_group_vote"); + GLAD_GL_NV_vdpau_interop = has_ext("GL_NV_vdpau_interop"); + GLAD_GL_ARB_occlusion_query2 = has_ext("GL_ARB_occlusion_query2"); + GLAD_GL_ARB_internalformat_query2 = has_ext("GL_ARB_internalformat_query2"); + GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); + GLAD_GL_SUN_vertex = has_ext("GL_SUN_vertex"); + GLAD_GL_SGIX_igloo_interface = has_ext("GL_SGIX_igloo_interface"); + GLAD_GL_SGIS_texture_lod = has_ext("GL_SGIS_texture_lod"); + GLAD_GL_NV_vertex_program3 = has_ext("GL_NV_vertex_program3"); + GLAD_GL_ARB_draw_indirect = has_ext("GL_ARB_draw_indirect"); + GLAD_GL_NV_vertex_program4 = has_ext("GL_NV_vertex_program4"); + GLAD_GL_AMD_transform_feedback3_lines_triangles = has_ext("GL_AMD_transform_feedback3_lines_triangles"); + GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); + GLAD_GL_EXT_x11_sync_object = has_ext("GL_EXT_x11_sync_object"); + GLAD_GL_ARB_sync = has_ext("GL_ARB_sync"); + GLAD_GL_NV_sample_locations = has_ext("GL_NV_sample_locations"); + GLAD_GL_ARB_compute_variable_group_size = has_ext("GL_ARB_compute_variable_group_size"); + GLAD_GL_OES_fixed_point = has_ext("GL_OES_fixed_point"); + GLAD_GL_NV_blend_square = has_ext("GL_NV_blend_square"); + GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); + GLAD_GL_ARB_gpu_shader5 = has_ext("GL_ARB_gpu_shader5"); + GLAD_GL_SGIS_texture4D = has_ext("GL_SGIS_texture4D"); + GLAD_GL_EXT_texture3D = has_ext("GL_EXT_texture3D"); + GLAD_GL_EXT_multisample = has_ext("GL_EXT_multisample"); + GLAD_GL_EXT_secondary_color = has_ext("GL_EXT_secondary_color"); + GLAD_GL_ARB_texture_filter_minmax = has_ext("GL_ARB_texture_filter_minmax"); + GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); + GLAD_GL_ARB_parallel_shader_compile = has_ext("GL_ARB_parallel_shader_compile"); + GLAD_GL_NVX_gpu_memory_info = has_ext("GL_NVX_gpu_memory_info"); + GLAD_GL_ARB_sparse_texture = has_ext("GL_ARB_sparse_texture"); + GLAD_GL_SGIS_point_line_texgen = has_ext("GL_SGIS_point_line_texgen"); + GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); + GLAD_GL_ARB_sparse_buffer = has_ext("GL_ARB_sparse_buffer"); + GLAD_GL_EXT_draw_range_elements = has_ext("GL_EXT_draw_range_elements"); + GLAD_GL_SGIX_blend_alpha_minmax = has_ext("GL_SGIX_blend_alpha_minmax"); + GLAD_GL_KHR_context_flush_control = has_ext("GL_KHR_context_flush_control"); + free_exts(); + return 1; +} + +static void find_coreGL(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; + GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; + GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; + GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; + GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; + GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; + GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; + GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; + GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; + GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; + if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { + max_loaded_major = 3; + max_loaded_minor = 3; + } +} + +int gladLoadGLLoader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGL(); + load_GL_VERSION_1_0(load); + load_GL_VERSION_1_1(load); + load_GL_VERSION_1_2(load); + load_GL_VERSION_1_3(load); + load_GL_VERSION_1_4(load); + load_GL_VERSION_1_5(load); + load_GL_VERSION_2_0(load); + load_GL_VERSION_2_1(load); + load_GL_VERSION_3_0(load); + load_GL_VERSION_3_1(load); + load_GL_VERSION_3_2(load); + load_GL_VERSION_3_3(load); + + if (!find_extensionsGL()) return 0; + load_GL_APPLE_element_array(load); + load_GL_AMD_multi_draw_indirect(load); + load_GL_SGIX_tag_sample_buffer(load); + load_GL_NV_point_sprite(load); + load_GL_ATI_separate_stencil(load); + load_GL_EXT_texture_buffer_object(load); + load_GL_ARB_vertex_blend(load); + load_GL_OVR_multiview(load); + load_GL_ARB_program_interface_query(load); + load_GL_EXT_index_func(load); + load_GL_NV_shader_buffer_load(load); + load_GL_EXT_color_subtable(load); + load_GL_SUNX_constant_data(load); + load_GL_EXT_multi_draw_arrays(load); + load_GL_ARB_shader_atomic_counters(load); + load_GL_NV_conditional_render(load); + load_GL_MESA_resize_buffers(load); + load_GL_ARB_texture_view(load); + load_GL_ARB_map_buffer_range(load); + load_GL_EXT_convolution(load); + load_GL_NV_vertex_attrib_integer_64bit(load); + load_GL_EXT_paletted_texture(load); + load_GL_ARB_texture_buffer_object(load); + load_GL_ATI_pn_triangles(load); + load_GL_SGIX_flush_raster(load); + load_GL_EXT_light_texture(load); + load_GL_HP_image_transform(load); + load_GL_AMD_draw_buffers_blend(load); + load_GL_APPLE_texture_range(load); + load_GL_EXT_texture_array(load); + load_GL_NV_texture_barrier(load); + load_GL_ARB_vertex_type_2_10_10_10_rev(load); + load_GL_3DFX_tbuffer(load); + load_GL_GREMEDY_frame_terminator(load); + load_GL_ARB_blend_func_extended(load); + load_GL_EXT_separate_shader_objects(load); + load_GL_NV_texture_multisample(load); + load_GL_ARB_shader_objects(load); + load_GL_ARB_framebuffer_object(load); + load_GL_ATI_envmap_bumpmap(load); + load_GL_ATI_map_object_buffer(load); + load_GL_ARB_robustness(load); + load_GL_NV_pixel_data_range(load); + load_GL_EXT_framebuffer_blit(load); + load_GL_ARB_gpu_shader_fp64(load); + load_GL_NV_command_list(load); + load_GL_EXT_vertex_weighting(load); + load_GL_GREMEDY_string_marker(load); + load_GL_EXT_subtexture(load); + load_GL_EXT_gpu_program_parameters(load); + load_GL_NV_evaluators(load); + load_GL_SGIS_texture_filter4(load); + load_GL_AMD_performance_monitor(load); + load_GL_EXT_stencil_clear_tag(load); + load_GL_NV_present_video(load); + load_GL_SGIX_framezoom(load); + load_GL_ARB_draw_elements_base_vertex(load); + load_GL_NV_transform_feedback(load); + load_GL_NV_fragment_program(load); + load_GL_AMD_stencil_operation_extended(load); + load_GL_ARB_instanced_arrays(load); + load_GL_EXT_polygon_offset(load); + load_GL_KHR_robustness(load); + load_GL_AMD_sparse_texture(load); + load_GL_ARB_clip_control(load); + load_GL_NV_fragment_coverage_to_color(load); + load_GL_NV_fence(load); + load_GL_ARB_texture_buffer_range(load); + load_GL_SUN_mesh_array(load); + load_GL_ARB_vertex_attrib_binding(load); + load_GL_ARB_framebuffer_no_attachments(load); + load_GL_ARB_cl_event(load); + load_GL_OES_single_precision(load); + load_GL_NV_primitive_restart(load); + load_GL_SUN_global_alpha(load); + load_GL_EXT_texture_object(load); + load_GL_AMD_name_gen_delete(load); + load_GL_ARB_buffer_storage(load); + load_GL_APPLE_vertex_program_evaluators(load); + load_GL_ARB_multi_bind(load); + load_GL_SGIX_list_priority(load); + load_GL_NV_vertex_buffer_unified_memory(load); + load_GL_NV_blend_equation_advanced(load); + load_GL_SGIS_sharpen_texture(load); + load_GL_ARB_vertex_program(load); + load_GL_ARB_vertex_buffer_object(load); + load_GL_NV_vertex_array_range(load); + load_GL_SGIX_fragment_lighting(load); + load_GL_NV_framebuffer_multisample_coverage(load); + load_GL_EXT_timer_query(load); + load_GL_NV_bindless_texture(load); + load_GL_KHR_debug(load); + load_GL_ATI_vertex_attrib_array_object(load); + load_GL_EXT_geometry_shader4(load); + load_GL_EXT_bindable_uniform(load); + load_GL_KHR_blend_equation_advanced(load); + load_GL_ATI_element_array(load); + load_GL_SGIX_reference_plane(load); + load_GL_EXT_stencil_two_side(load); + load_GL_NV_explicit_multisample(load); + load_GL_IBM_static_data(load); + load_GL_EXT_texture_perturb_normal(load); + load_GL_EXT_point_parameters(load); + load_GL_PGI_misc_hints(load); + load_GL_ARB_vertex_shader(load); + load_GL_ARB_tessellation_shader(load); + load_GL_EXT_draw_buffers2(load); + load_GL_ARB_vertex_attrib_64bit(load); + load_GL_EXT_texture_filter_minmax(load); + load_GL_AMD_interleaved_elements(load); + load_GL_ARB_fragment_program(load); + load_GL_ARB_texture_storage(load); + load_GL_ARB_copy_image(load); + load_GL_SGIS_pixel_texture(load); + load_GL_SGIX_instruments(load); + load_GL_ARB_shader_storage_buffer_object(load); + load_GL_EXT_blend_minmax(load); + load_GL_ARB_base_instance(load); + load_GL_ARB_ES3_1_compatibility(load); + load_GL_EXT_texture_integer(load); + load_GL_ARB_texture_multisample(load); + load_GL_AMD_gpu_shader_int64(load); + load_GL_AMD_vertex_shader_tessellator(load); + load_GL_ARB_invalidate_subdata(load); + load_GL_EXT_index_material(load); + load_GL_INTEL_parallel_arrays(load); + load_GL_ATI_draw_buffers(load); + load_GL_SGIX_pixel_texture(load); + load_GL_ARB_timer_query(load); + load_GL_NV_parameter_buffer_object(load); + load_GL_ARB_direct_state_access(load); + load_GL_ARB_uniform_buffer_object(load); + load_GL_NV_transform_feedback2(load); + load_GL_EXT_blend_color(load); + load_GL_EXT_histogram(load); + load_GL_ARB_get_texture_sub_image(load); + load_GL_SGIS_point_parameters(load); + load_GL_EXT_direct_state_access(load); + load_GL_AMD_sample_positions(load); + load_GL_NV_vertex_program(load); + load_GL_EXT_vertex_shader(load); + load_GL_EXT_blend_func_separate(load); + load_GL_APPLE_fence(load); + load_GL_OES_byte_coordinates(load); + load_GL_ARB_transpose_matrix(load); + load_GL_ARB_provoking_vertex(load); + load_GL_EXT_fog_coord(load); + load_GL_EXT_vertex_array(load); + load_GL_EXT_blend_equation_separate(load); + load_GL_NV_framebuffer_mixed_samples(load); + load_GL_NVX_conditional_render(load); + load_GL_ARB_multi_draw_indirect(load); + load_GL_EXT_raster_multisample(load); + load_GL_NV_copy_image(load); + load_GL_INTEL_framebuffer_CMAA(load); + load_GL_ARB_transform_feedback2(load); + load_GL_ARB_transform_feedback3(load); + load_GL_EXT_debug_marker(load); + load_GL_EXT_pixel_transform(load); + load_GL_ATI_fragment_shader(load); + load_GL_ARB_vertex_array_object(load); + load_GL_SUN_triangle_list(load); + load_GL_ARB_transform_feedback_instanced(load); + load_GL_SGIX_async(load); + load_GL_INTEL_performance_query(load); + load_GL_NV_gpu_shader5(load); + load_GL_NV_bindless_multi_draw_indirect_count(load); + load_GL_ARB_ES2_compatibility(load); + load_GL_ARB_indirect_parameters(load); + load_GL_NV_half_float(load); + load_GL_ARB_ES3_2_compatibility(load); + load_GL_EXT_polygon_offset_clamp(load); + load_GL_EXT_compiled_vertex_array(load); + load_GL_NV_depth_buffer_float(load); + load_GL_NV_occlusion_query(load); + load_GL_APPLE_flush_buffer_range(load); + load_GL_ARB_imaging(load); + load_GL_ARB_draw_buffers_blend(load); + load_GL_ARB_clear_buffer_object(load); + load_GL_ARB_multisample(load); + load_GL_EXT_debug_label(load); + load_GL_ARB_sample_shading(load); + load_GL_NV_internalformat_sample_query(load); + load_GL_INTEL_map_texture(load); + load_GL_ARB_compute_shader(load); + load_GL_IBM_vertex_array_lists(load); + load_GL_ARB_color_buffer_float(load); + load_GL_ARB_bindless_texture(load); + load_GL_ARB_window_pos(load); + load_GL_ARB_internalformat_query(load); + load_GL_EXT_shader_image_load_store(load); + load_GL_EXT_copy_texture(load); + load_GL_NV_register_combiners2(load); + load_GL_NV_draw_texture(load); + load_GL_EXT_draw_instanced(load); + load_GL_ARB_viewport_array(load); + load_GL_ARB_separate_shader_objects(load); + load_GL_EXT_depth_bounds_test(load); + load_GL_NV_video_capture(load); + load_GL_ARB_sampler_objects(load); + load_GL_ARB_matrix_palette(load); + load_GL_SGIS_texture_color_mask(load); + load_GL_EXT_coordinate_frame(load); + load_GL_ARB_texture_compression(load); + load_GL_ARB_shader_subroutine(load); + load_GL_ARB_texture_storage_multisample(load); + load_GL_EXT_vertex_attrib_64bit(load); + load_GL_OES_query_matrix(load); + load_GL_MESA_window_pos(load); + load_GL_ARB_copy_buffer(load); + load_GL_APPLE_object_purgeable(load); + load_GL_ARB_occlusion_query(load); + load_GL_SGI_color_table(load); + load_GL_EXT_gpu_shader4(load); + load_GL_NV_geometry_program4(load); + load_GL_AMD_debug_output(load); + load_GL_ARB_multitexture(load); + load_GL_SGIX_polynomial_ffd(load); + load_GL_EXT_provoking_vertex(load); + load_GL_ARB_point_parameters(load); + load_GL_ARB_shader_image_load_store(load); + load_GL_ARB_texture_barrier(load); + load_GL_NV_bindless_multi_draw_indirect(load); + load_GL_EXT_transform_feedback(load); + load_GL_NV_gpu_program4(load); + load_GL_NV_gpu_program5(load); + load_GL_ARB_geometry_shader4(load); + load_GL_NV_conservative_raster(load); + load_GL_SGIX_sprite(load); + load_GL_ARB_get_program_binary(load); + load_GL_AMD_occlusion_query_event(load); + load_GL_SGIS_multisample(load); + load_GL_EXT_framebuffer_object(load); + load_GL_APPLE_vertex_array_range(load); + load_GL_NV_register_combiners(load); + load_GL_ARB_draw_buffers(load); + load_GL_ARB_clear_texture(load); + load_GL_ARB_debug_output(load); + load_GL_EXT_cull_vertex(load); + load_GL_IBM_multimode_draw_arrays(load); + load_GL_APPLE_vertex_array_object(load); + load_GL_SGIS_detail_texture(load); + load_GL_ARB_draw_instanced(load); + load_GL_ARB_shading_language_include(load); + load_GL_INGR_blend_func_separate(load); + load_GL_NV_path_rendering(load); + load_GL_NV_conservative_raster_dilate(load); + load_GL_ATI_vertex_streams(load); + load_GL_ARB_gpu_shader_int64(load); + load_GL_NV_vdpau_interop(load); + load_GL_ARB_internalformat_query2(load); + load_GL_SUN_vertex(load); + load_GL_SGIX_igloo_interface(load); + load_GL_ARB_draw_indirect(load); + load_GL_NV_vertex_program4(load); + load_GL_SGIS_fog_function(load); + load_GL_EXT_x11_sync_object(load); + load_GL_ARB_sync(load); + load_GL_NV_sample_locations(load); + load_GL_ARB_compute_variable_group_size(load); + load_GL_OES_fixed_point(load); + load_GL_EXT_framebuffer_multisample(load); + load_GL_SGIS_texture4D(load); + load_GL_EXT_texture3D(load); + load_GL_EXT_multisample(load); + load_GL_EXT_secondary_color(load); + load_GL_ATI_vertex_array_object(load); + load_GL_ARB_parallel_shader_compile(load); + load_GL_ARB_sparse_texture(load); + load_GL_ARB_sample_locations(load); + load_GL_ARB_sparse_buffer(load); + load_GL_EXT_draw_range_elements(load); + return GLVersion.major != 0 || GLVersion.minor != 0; +} + +#endif // GLAD_IMPLEMENTATION diff --git a/src/rlgl.c b/src/rlgl.c index 3dda77b1..6b99bf19 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -48,7 +48,8 @@ #ifdef __APPLE__ #include // OpenGL 3 library for OSX #else - #include "external/glad.h" // GLAD library, includes OpenGL headers + #define GLAD_IMPLEMENTATION + #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers #endif #endif -- cgit v1.2.3 From ca13c2ed0c113a504bc9756ef38484af35af270d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 7 Jun 2016 20:33:49 +0200 Subject: Converted raygui module to header only --- src/raygui.c | 1138 ------------------------------------------------------ src/raygui.h | 1222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 1200 insertions(+), 1160 deletions(-) delete mode 100644 src/raygui.c (limited to 'src') diff --git a/src/raygui.c b/src/raygui.c deleted file mode 100644 index 5064f123..00000000 --- a/src/raygui.c +++ /dev/null @@ -1,1138 +0,0 @@ -/********************************************************************************************** -* -* raygui - raylib IMGUI system (Immedite Mode GUI) -* -* Initial design by Kevin Gato and Daniel Nicolás -* Reviewed by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -//#define RAYGUI_STANDALONE // To use the raygui module as standalone lib, just uncomment this line - // NOTE: Some external funtions are required for drawing and input management - -#if !defined(RAYGUI_STANDALONE) - #include "raylib.h" -#endif - -#include "raygui.h" - -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() - // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() - -#include // Required for: malloc(), free() -#include // Required for: strcmp() -#include // Required for: va_list, va_start(), vfprintf(), va_end() - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) - #define KEY_LEFT 263 - #define KEY_RIGHT 262 - #define MOUSE_LEFT_BUTTON 0 -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- - -// GUI elements states -typedef enum { BUTTON_DEFAULT, BUTTON_HOVER, BUTTON_PRESSED, BUTTON_CLICKED } ButtonState; -typedef enum { TOGGLE_UNACTIVE, TOGGLE_HOVER, TOGGLE_PRESSED, TOGGLE_ACTIVE } ToggleState; -typedef enum { COMBOBOX_UNACTIVE, COMBOBOX_HOVER, COMBOBOX_PRESSED, COMBOBOX_ACTIVE } ComboBoxState; -typedef enum { SPINNER_DEFAULT, SPINNER_HOVER, SPINNER_PRESSED } SpinnerState; -typedef enum { CHECKBOX_STATUS, CHECKBOX_HOVER, CHECKBOX_PRESSED } CheckBoxState; -typedef enum { SLIDER_DEFAULT, SLIDER_HOVER, SLIDER_ACTIVE } SliderState; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- - -// Current GUI style (default light) -static int style[NUM_PROPERTIES] = { - 0xf5f5f5ff, // GLOBAL_BASE_COLOR, - 0xf5f5f5ff, // GLOBAL_BORDER_COLOR, - 0xf5f5f5ff, // GLOBAL_TEXT_COLOR, - 10, // GLOBAL_TEXT_FONTSIZE - 1, // GLOBAL_BORDER_WIDTH - 0xf5f5f5ff, // BACKGROUND_COLOR - 1, // LABEL_BORDER_WIDTH - 0x4d4d4dff, // LABEL_TEXT_COLOR - 20, // LABEL_TEXT_PADDING - 2, // BUTTON_BORDER_WIDTH - 20, // BUTTON_TEXT_PADDING - 0x828282ff, // BUTTON_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // BUTTON_DEFAULT_INSIDE_COLOR - 0x4d4d4dff, // BUTTON_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // BUTTON_HOVER_BORDER_COLOR - 0xffffffff, // BUTTON_HOVER_INSIDE_COLOR - 0x353535ff, // BUTTON_HOVER_TEXT_COLOR - 0x7bb0d6ff, // BUTTON_PRESSED_BORDER_COLOR - 0xbcecffff, // BUTTON_PRESSED_INSIDE_COLOR - 0x5f9aa7ff, // BUTTON_PRESSED_TEXT_COLOR - 20, // TOGGLE_TEXT_PADDING - 1, // TOGGLE_BORDER_WIDTH - 0x828282ff, // TOGGLE_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // TOGGLE_DEFAULT_INSIDE_COLOR - 0x828282ff, // TOGGLE_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // TOGGLE_HOVER_BORDER_COLOR - 0xffffffff, // TOGGLE_HOVER_INSIDE_COLOR - 0x828282ff, // TOGGLE_HOVER_TEXT_COLOR - 0xbdd7eaff, // TOGGLE_PRESSED_BORDER_COLOR - 0xddf5ffff, // TOGGLE_PRESSED_INSIDE_COLOR - 0xafccd3ff, // TOGGLE_PRESSED_TEXT_COLOR - 0x7bb0d6ff, // TOGGLE_ACTIVE_BORDER_COLOR - 0xbcecffff, // TOGGLE_ACTIVE_INSIDE_COLOR - 0x5f9aa7ff, // TOGGLE_ACTIVE_TEXT_COLOR - 3, // TOGGLEGROUP_PADDING - 1, // SLIDER_BORDER_WIDTH - 1, // SLIDER_BUTTON_BORDER_WIDTH - 0x828282ff, // SLIDER_BORDER_COLOR - 0xc8c8c8ff, // SLIDER_INSIDE_COLOR - 0xbcecffff, // SLIDER_DEFAULT_COLOR - 0xffffffff, // SLIDER_HOVER_COLOR - 0xddf5ffff, // SLIDER_ACTIVE_COLOR - 0x828282ff, // SLIDERBAR_BORDER_COLOR - 0xc8c8c8ff, // SLIDERBAR_INSIDE_COLOR - 0xbcecffff, // SLIDERBAR_DEFAULT_COLOR - 0xffffffff, // SLIDERBAR_HOVER_COLOR - 0xddf5ffff, // SLIDERBAR_ACTIVE_COLOR - 0x828282ff, // SLIDERBAR_ZERO_LINE_COLOR - 0x828282ff, // PROGRESSBAR_BORDER_COLOR - 0xc8c8c8ff, // PROGRESSBAR_INSIDE_COLOR - 0xbcecffff, // PROGRESSBAR_PROGRESS_COLOR - 2, // PROGRESSBAR_BORDER_WIDTH - 0x828282ff, // SPINNER_LABEL_BORDER_COLOR - 0xc8c8c8ff, // SPINNER_LABEL_INSIDE_COLOR - 0x828282ff, // SPINNER_DEFAULT_BUTTON_BORDER_COLOR - 0xc8c8c8ff, // SPINNER_DEFAULT_BUTTON_INSIDE_COLOR - 0x000000ff, // SPINNER_DEFAULT_SYMBOL_COLOR - 0x000000ff, // SPINNER_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // SPINNER_HOVER_BUTTON_BORDER_COLOR - 0xffffffff, // SPINNER_HOVER_BUTTON_INSIDE_COLOR - 0x000000ff, // SPINNER_HOVER_SYMBOL_COLOR - 0x000000ff, // SPINNER_HOVER_TEXT_COLOR - 0x7bb0d6ff, // SPINNER_PRESSED_BUTTON_BORDER_COLOR - 0xbcecffff, // SPINNER_PRESSED_BUTTON_INSIDE_COLOR - 0x5f9aa7ff, // SPINNER_PRESSED_SYMBOL_COLOR - 0x000000ff, // SPINNER_PRESSED_TEXT_COLOR - 1, // COMBOBOX_PADDING - 30, // COMBOBOX_BUTTON_WIDTH - 20, // COMBOBOX_BUTTON_HEIGHT - 1, // COMBOBOX_BORDER_WIDTH - 0x828282ff, // COMBOBOX_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // COMBOBOX_DEFAULT_INSIDE_COLOR - 0x828282ff, // COMBOBOX_DEFAULT_TEXT_COLOR - 0x828282ff, // COMBOBOX_DEFAULT_LIST_TEXT_COLOR - 0xc8c8c8ff, // COMBOBOX_HOVER_BORDER_COLOR - 0xffffffff, // COMBOBOX_HOVER_INSIDE_COLOR - 0x828282ff, // COMBOBOX_HOVER_TEXT_COLOR - 0x828282ff, // COMBOBOX_HOVER_LIST_TEXT_COLOR - 0x7bb0d6ff, // COMBOBOX_PRESSED_BORDER_COLOR - 0xbcecffff, // COMBOBOX_PRESSED_INSIDE_COLOR - 0x5f9aa7ff, // COMBOBOX_PRESSED_TEXT_COLOR - 0x0078acff, // COMBOBOX_PRESSED_LIST_BORDER_COLOR - 0x66e7ffff, // COMBOBOX_PRESSED_LIST_INSIDE_COLOR - 0x0078acff, // COMBOBOX_PRESSED_LIST_TEXT_COLOR - 0x828282ff, // CHECKBOX_DEFAULT_BORDER_COLOR - 0xffffffff, // CHECKBOX_DEFAULT_INSIDE_COLOR - 0xc8c8c8ff, // CHECKBOX_HOVER_BORDER_COLOR - 0xffffffff, // CHECKBOX_HOVER_INSIDE_COLOR - 0x66e7ffff, // CHECKBOX_CLICK_BORDER_COLOR - 0xddf5ffff, // CHECKBOX_CLICK_INSIDE_COLOR - 0x7bb0d6ff, // CHECKBOX_STATUS_ACTIVE_COLOR - 4, // CHECKBOX_INSIDE_WIDTH - 1, // TEXTBOX_BORDER_WIDTH - 0x828282ff, // TEXTBOX_BORDER_COLOR - 0xf5f5f5ff, // TEXTBOX_INSIDE_COLOR - 0x000000ff, // TEXTBOX_TEXT_COLOR - 0x000000ff, // TEXTBOX_LINE_COLOR - 10 // TEXTBOX_TEXT_FONTSIZE -}; - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static Color ColorMultiply(Color baseColor, float value); - -#if defined RAYGUI_STANDALONE -static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -static int GetHexValue(Color color); // Returns hexadecimal value for a Color -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' - -// NOTE: raygui depend on some raylib input and drawing functions -// TODO: Replace by your own functions -static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } -static int IsMouseButtonDown(int button) { return 0; } -static int IsMouseButtonPressed(int button) { return 0; } -static int IsMouseButtonReleased(int button) { return 0; } -static int IsMouseButtonUp(int button) { return 0; } - -static int GetKeyPressed(void) { return 0; } // NOTE: Only used by GuiTextBox() -static int IsKeyDown(int key) { return 0; } // NOTE: Only used by GuiSpinner() - -static int MeasureText(const char *text, int fontSize) { return 0; } -static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } -static void DrawRectangleRec(Rectangle rec, Color color) { } -static void DrawRectangle(int posX, int posY, int width, int height, Color color) { DrawRectangleRec((Rectangle){ posX, posY, width, height }, color); } -#endif - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- - -// Label element, show text -void GuiLabel(Rectangle bounds, const char *text) -{ - #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) - - GuiLabelEx(bounds, text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); -} - -// Label element extended, configurable colors -void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner) -{ - // Update control - //-------------------------------------------------------------------- - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - if (bounds.width < textWidth) bounds.width = textWidth + style[LABEL_TEXT_PADDING]; - if (bounds.height < textHeight) bounds.height = textHeight + style[LABEL_TEXT_PADDING]/2; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, border); - DrawRectangle(bounds.x + style[LABEL_BORDER_WIDTH], bounds.y + style[LABEL_BORDER_WIDTH], bounds.width - (2 * style[LABEL_BORDER_WIDTH]), bounds.height - (2 * style[LABEL_BORDER_WIDTH]), inner); - DrawText(text, bounds.x + ((bounds.width/2) - (textWidth/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], textColor); - //-------------------------------------------------------------------- -} - -// Button element, returns true when clicked -bool GuiButton(Rectangle bounds, const char *text) -{ - ButtonState buttonState = BUTTON_DEFAULT; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - // Update control - //-------------------------------------------------------------------- - if (bounds.width < textWidth) bounds.width = textWidth + style[BUTTON_TEXT_PADDING]; - if (bounds.height < textHeight) bounds.height = textHeight + style[BUTTON_TEXT_PADDING]/2; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_CLICKED; - else buttonState = BUTTON_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (buttonState) - { - case BUTTON_DEFAULT: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_DEFAULT_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_DEFAULT_TEXT_COLOR])); - } break; - case BUTTON_HOVER: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_HOVER_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_HOVER_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_HOVER_TEXT_COLOR])); - } break; - case BUTTON_PRESSED: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_PRESSED_TEXT_COLOR])); - } break; - case BUTTON_CLICKED: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); - } break; - default: break; - } - //------------------------------------------------------------------ - - if (buttonState == BUTTON_CLICKED) return true; - else return false; -} - -// Toggle Button element, returns true when active -bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle) -{ - ToggleState toggleState = TOGGLE_UNACTIVE; - Rectangle toggleButton = bounds; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - // Update control - //-------------------------------------------------------------------- - if (toggleButton.width < textWidth) toggleButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - if (toggleButton.height < textHeight) toggleButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - if (toggle) toggleState = TOGGLE_ACTIVE; - else toggleState = TOGGLE_UNACTIVE; - - if (CheckCollisionPointRec(mousePoint, toggleButton)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) toggleState = TOGGLE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - if (toggle) - { - toggle = false; - toggleState = TOGGLE_UNACTIVE; - } - else - { - toggle = true; - toggleState = TOGGLE_ACTIVE; - } - } - else toggleState = TOGGLE_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (toggleState) - { - case TOGGLE_UNACTIVE: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_DEFAULT_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_DEFAULT_TEXT_COLOR])); - } break; - case TOGGLE_HOVER: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_HOVER_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_HOVER_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_HOVER_TEXT_COLOR])); - } break; - case TOGGLE_PRESSED: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_PRESSED_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_PRESSED_TEXT_COLOR])); - } break; - case TOGGLE_ACTIVE: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_ACTIVE_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_ACTIVE_TEXT_COLOR])); - } break; - default: break; - } - //-------------------------------------------------------------------- - - return toggle; -} - -// Toggle Group element, returns toggled button index -int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive) -{ - for (int i = 0; i < toggleNum; i++) - { - if (i == toggleActive) GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], true); - else if (GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], false) == true) toggleActive = i; - } - - return toggleActive; -} - -// Combo Box element, returns selected item index -int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive) -{ - ComboBoxState comboBoxState = COMBOBOX_UNACTIVE; - Rectangle comboBoxButton = bounds; - Rectangle click = { bounds.x + bounds.width + style[COMBOBOX_PADDING], bounds.y, style[COMBOBOX_BUTTON_WIDTH], style[COMBOBOX_BUTTON_HEIGHT] }; - Vector2 mousePoint = GetMousePosition(); - - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - for (int i = 0; i < comboNum; i++) - { - if (i == comboActive) - { - // Update control - //-------------------------------------------------------------------- - int textWidth = MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE]); - - if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - if (CheckCollisionPointRec(mousePoint, comboBoxButton) || CheckCollisionPointRec(mousePoint, click)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_ACTIVE; - else comboBoxState = COMBOBOX_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (comboBoxState) - { - case COMBOBOX_UNACTIVE: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_TEXT_COLOR])); - } break; - case COMBOBOX_HOVER: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_TEXT_COLOR])); - } break; - case COMBOBOX_PRESSED: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); - } break; - case COMBOBOX_ACTIVE: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); - } break; - default: break; - } - - //DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[]globalTextFontSize)/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[]globalTextFontSize/2)), style[]globalTextFontSize, COMBOBOX_PRESSED_TEXT_COLOR); - //-------------------------------------------------------------------- - } - } - - if (CheckCollisionPointRec(GetMousePosition(), bounds) || CheckCollisionPointRec(GetMousePosition(), click)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - comboActive += 1; - if(comboActive >= comboNum) comboActive = 0; - } - } - - return comboActive; -} - -// Check Box element, returns true when active -bool GuiCheckBox(Rectangle checkBoxBounds, const char *text, bool checked) -{ - CheckBoxState checkBoxState = CHECKBOX_STATUS; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, checkBoxBounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) checkBoxState = CHECKBOX_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - checkBoxState = CHECKBOX_STATUS; - checked = !checked; - } - else checkBoxState = CHECKBOX_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (checkBoxState) - { - case CHECKBOX_HOVER: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_HOVER_INSIDE_COLOR])); - } break; - case CHECKBOX_STATUS: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_DEFAULT_INSIDE_COLOR])); - } break; - case CHECKBOX_PRESSED: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_CLICK_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_CLICK_INSIDE_COLOR])); - } break; - default: break; - } - - if (text != NULL) DrawText(text, checkBoxBounds.x + checkBoxBounds.width + 2, checkBoxBounds.y + ((checkBoxBounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2) + 1), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[LABEL_TEXT_COLOR])); - - if (checked) - { - DrawRectangle((int)(checkBoxBounds.x + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.y + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.width - (2*style[CHECKBOX_INSIDE_WIDTH])), (int)(checkBoxBounds.height - (2*style[CHECKBOX_INSIDE_WIDTH])), GetColor(style[CHECKBOX_STATUS_ACTIVE_COLOR])); - } - //-------------------------------------------------------------------- - - return checked; -} - -// Slider element, returns selected value -float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue) -{ - SliderState sliderState = SLIDER_DEFAULT; - float buttonTravelDistance = 0; - float sliderPos = 0; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - if (value < minValue) value = minValue; - else if (value >= maxValue) value = maxValue; - - sliderPos = (value - minValue)/(maxValue - minValue); - - Rectangle sliderButton; - sliderButton.width = ((int)(bounds.width - (2 * style[SLIDER_BUTTON_BORDER_WIDTH]))/10 - 8); - sliderButton.height =((int)(bounds.height - ( 2 * style[SLIDER_BORDER_WIDTH] + 2 * style[SLIDER_BUTTON_BORDER_WIDTH]))); - - float sliderButtonMinPos = bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]; - float sliderButtonMaxPos = bounds.x + bounds.width - (style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH] + sliderButton.width); - - buttonTravelDistance = sliderButtonMaxPos - sliderButtonMinPos; - - sliderButton.x = ((int)(bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]) + (sliderPos * buttonTravelDistance)); - sliderButton.y = ((int)(bounds.y + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH])); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - sliderState = SLIDER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) sliderState = SLIDER_ACTIVE; - - if ((sliderState == SLIDER_ACTIVE) && (IsMouseButtonDown(MOUSE_LEFT_BUTTON))) - { - sliderButton.x = mousePoint.x - sliderButton.width / 2; - - if (sliderButton.x <= sliderButtonMinPos) sliderButton.x = sliderButtonMinPos; - else if (sliderButton.x >= sliderButtonMaxPos) sliderButton.x = sliderButtonMaxPos; - - sliderPos = (sliderButton.x - sliderButtonMinPos) / buttonTravelDistance; - } - } - else sliderState = SLIDER_DEFAULT; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[SLIDER_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]), (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDER_INSIDE_COLOR])); - - switch (sliderState) - { - case SLIDER_DEFAULT: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_DEFAULT_COLOR])); break; - case SLIDER_HOVER: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_HOVER_COLOR])); break; - case SLIDER_ACTIVE: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_ACTIVE_COLOR])); break; - default: break; - } - //-------------------------------------------------------------------- - - return minValue + (maxValue - minValue)*sliderPos; -} - -// Slider Bar element, returns selected value -float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue) -{ - SliderState sliderState = SLIDER_DEFAULT; - Vector2 mousePoint = GetMousePosition(); - float fixedValue; - float fixedMinValue; - - fixedValue = value - minValue; - maxValue = maxValue - minValue; - fixedMinValue = 0; - - // Update control - //-------------------------------------------------------------------- - if (fixedValue <= fixedMinValue) fixedValue = fixedMinValue; - else if (fixedValue >= maxValue) fixedValue = maxValue; - - Rectangle sliderBar; - - sliderBar.x = bounds.x + style[SLIDER_BORDER_WIDTH]; - sliderBar.y = bounds.y + style[SLIDER_BORDER_WIDTH]; - sliderBar.width = ((fixedValue*((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]))/(maxValue - fixedMinValue)); - sliderBar.height = bounds.height - 2*style[SLIDER_BORDER_WIDTH]; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - sliderState = SLIDER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - sliderState = SLIDER_ACTIVE; - - sliderBar.width = (mousePoint.x - bounds.x - style[SLIDER_BORDER_WIDTH]); - - if (mousePoint.x <= (bounds.x + style[SLIDER_BORDER_WIDTH])) sliderBar.width = 0; - else if (mousePoint.x >= (bounds.x + bounds.width - style[SLIDER_BORDER_WIDTH])) sliderBar.width = bounds.width - 2*style[SLIDER_BORDER_WIDTH]; - } - } - else sliderState = SLIDER_DEFAULT; - - fixedValue = ((float)sliderBar.width*(maxValue - fixedMinValue))/((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]); - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[SLIDERBAR_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]) , (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDERBAR_INSIDE_COLOR])); - - switch (sliderState) - { - case SLIDER_DEFAULT: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_DEFAULT_COLOR])); break; - case SLIDER_HOVER: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_HOVER_COLOR])); break; - case SLIDER_ACTIVE: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_ACTIVE_COLOR])); break; - default: break; - } - - if (minValue < 0 && maxValue > 0) DrawRectangle((bounds.x + style[SLIDER_BORDER_WIDTH]) - (minValue * ((bounds.width - (style[SLIDER_BORDER_WIDTH]*2))/maxValue)), sliderBar.y, 1, sliderBar.height, GetColor(style[SLIDERBAR_ZERO_LINE_COLOR])); - //-------------------------------------------------------------------- - - return fixedValue + minValue; -} - -// Progress Bar element, shows current progress value -void GuiProgressBar(Rectangle bounds, float value) -{ - if (value > 1.0f) value = 1.0f; - else if (value < 0.0f) value = 0.0f; - - Rectangle progressBar = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; - Rectangle progressValue = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], value * (bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2)), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[PROGRESSBAR_BORDER_COLOR])); - DrawRectangleRec(progressBar, GetColor(style[PROGRESSBAR_INSIDE_COLOR])); - DrawRectangleRec(progressValue, GetColor(style[PROGRESSBAR_PROGRESS_COLOR])); - //-------------------------------------------------------------------- -} - -// Spinner element, returns selected value -// NOTE: Requires static variables: framesCounter, valueSpeed - ERROR! -int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) -{ - SpinnerState spinnerState = SPINNER_DEFAULT; - Rectangle labelBoxBound = { bounds.x + bounds.width/4 + 1, bounds.y, bounds.width/2, bounds.height }; - Rectangle leftButtonBound = { bounds.x, bounds.y, bounds.width/4, bounds.height }; - Rectangle rightButtonBound = { bounds.x + bounds.width - bounds.width/4 + 1, bounds.y, bounds.width/4, bounds.height }; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(FormatText("%i", value), style[GLOBAL_TEXT_FONTSIZE]); - //int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Unused variable - - int buttonSide = 0; - - static int framesCounter = 0; - static bool valueSpeed = false;; - - //if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - //if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - // Update control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, leftButtonBound) || CheckCollisionPointRec(mousePoint, rightButtonBound) || CheckCollisionPointRec(mousePoint, labelBoxBound)) - { - if (IsKeyDown(KEY_LEFT)) - { - spinnerState = SPINNER_PRESSED; - buttonSide = 1; - - if (value > minValue) value -= 1; - } - else if (IsKeyDown(KEY_RIGHT)) - { - spinnerState = SPINNER_PRESSED; - buttonSide = 2; - - if (value < maxValue) value += 1; - } - } - - if (CheckCollisionPointRec(mousePoint, leftButtonBound)) - { - buttonSide = 1; - spinnerState = SPINNER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!valueSpeed) - { - if (value > minValue) value--; - valueSpeed = true; - } - else framesCounter++; - - spinnerState = SPINNER_PRESSED; - - if (value > minValue) - { - if (framesCounter >= 30) value -= 1; - } - } - } - else if (CheckCollisionPointRec(mousePoint, rightButtonBound)) - { - buttonSide = 2; - spinnerState = SPINNER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!valueSpeed) - { - if (value < maxValue) value++; - valueSpeed = true; - } - else framesCounter++; - - spinnerState = SPINNER_PRESSED; - - if (value < maxValue) - { - if (framesCounter >= 30) value += 1; - } - } - } - else if (!CheckCollisionPointRec(mousePoint, labelBoxBound)) buttonSide = 0; - - if (IsMouseButtonUp(MOUSE_LEFT_BUTTON)) - { - valueSpeed = false; - framesCounter = 0; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (spinnerState) - { - case SPINNER_DEFAULT: - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_TEXT_COLOR])); - } break; - case SPINNER_HOVER: - { - if (buttonSide == 1) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - } - else if (buttonSide == 2) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); - } - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_TEXT_COLOR])); - } break; - case SPINNER_PRESSED: - { - if (buttonSide == 1) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - } - else if (buttonSide == 2) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); - } - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_TEXT_COLOR])); - } break; - default: break; - } - - return value; -} - -// Text Box element, returns input text -// NOTE: Requires static variables: framesCounter - ERROR! -char *GuiTextBox(Rectangle bounds, char *text) -{ - #define MAX_CHARS_LENGTH 20 - #define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256 - - int initPos = bounds.x + 4; - int letter = -1; - static int framesCounter = 0; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - framesCounter++; - - letter = GetKeyPressed(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (letter != -1) - { - if (letter == KEY_BACKSPACE_TEXT) - { - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if ((text[i] == '\0') && (i > 0)) - { - text[i - 1] = '\0'; - break; - } - } - - text[MAX_CHARS_LENGTH - 1] = '\0'; - } - else - { - if ((letter >= 32) && (letter < 127)) - { - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if (text[i] == '\0') - { - text[i] = (char)letter; - break; - } - } - } - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, bounds)) DrawRectangleRec(bounds, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); - else DrawRectangleRec(bounds, GetColor(style[TEXTBOX_BORDER_COLOR])); - - DrawRectangle(bounds.x + style[TEXTBOX_BORDER_WIDTH], bounds.y + style[TEXTBOX_BORDER_WIDTH], bounds.width - (style[TEXTBOX_BORDER_WIDTH] * 2), bounds.height - (style[TEXTBOX_BORDER_WIDTH] * 2), GetColor(style[TEXTBOX_INSIDE_COLOR])); - - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if (text[i] == '\0') break; - - DrawText(FormatText("%c", text[i]), initPos, bounds.y + style[TEXTBOX_TEXT_FONTSIZE], style[TEXTBOX_TEXT_FONTSIZE], GetColor(style[TEXTBOX_TEXT_COLOR])); - - initPos += (MeasureText(FormatText("%c", text[i]), style[GLOBAL_TEXT_FONTSIZE]) + 2); - //initPos += ((GetDefaultFont().charRecs[(int)text[i] - 32].width + 2)); - } - - if ((framesCounter/20)%2 && CheckCollisionPointRec(mousePoint, bounds)) DrawRectangle(initPos + 2, bounds.y + 5, 1, 20, GetColor(style[TEXTBOX_LINE_COLOR])); - //-------------------------------------------------------------------- - - return text; -} - -// Save current GUI style into a text file -void SaveGuiStyle(const char *fileName) -{ - FILE *styleFile = fopen(fileName, "wt"); - - for (int i = 0; i < NUM_PROPERTIES; i++) fprintf(styleFile, "%-40s0x%x\n", guiPropertyName[i], GetStyleProperty(i)); - - fclose(styleFile); -} - -// Load GUI style from a text file -void LoadGuiStyle(const char *fileName) -{ - #define MAX_STYLE_PROPERTIES 128 - - typedef struct { - char id[64]; - int value; - } StyleProperty; - - StyleProperty *styleProp = (StyleProperty *)malloc(MAX_STYLE_PROPERTIES*sizeof(StyleProperty));; - int counter = 0; - - FILE *styleFile = fopen(fileName, "rt"); - - while (!feof(styleFile)) - { - fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value); - counter++; - } - - fclose(styleFile); - - for (int i = 0; i < counter; i++) - { - for (int j = 0; j < NUM_PROPERTIES; j++) - { - if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0) - { - // Assign correct property to style - style[j] = styleProp[i].value; - } - } - } - - free(styleProp); -} - -// Set one style property value -void SetStyleProperty(int guiProperty, int value) -{ - #define NUM_COLOR_SAMPLES 10 - - if (guiProperty == GLOBAL_BASE_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_BASE_COLOR] = value; - style[BACKGROUND_COLOR] = GetHexValue(fadeColor[3]); - style[BUTTON_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[BUTTON_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[BUTTON_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[TOGGLE_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[TOGGLE_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_ACTIVE_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[SLIDER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SLIDER_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); - style[SLIDER_HOVER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDER_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDERBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SLIDERBAR_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); - style[SLIDERBAR_HOVER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDERBAR_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDERBAR_ZERO_LINE_COLOR] = GetHexValue(fadeColor[8]); - style[PROGRESSBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[PROGRESSBAR_PROGRESS_COLOR] = GetHexValue(fadeColor[6]); - style[SPINNER_LABEL_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_HOVER_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[COMBOBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[CHECKBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[CHECKBOX_CLICK_INSIDE_COLOR] = GetHexValue(fadeColor[6]); - style[CHECKBOX_STATUS_ACTIVE_COLOR] = GetHexValue(fadeColor[8]); - style[TEXTBOX_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - } - else if (guiProperty == GLOBAL_BORDER_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_BORDER_COLOR] = value; - style[BUTTON_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[BUTTON_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[BUTTON_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[TOGGLE_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[TOGGLE_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_ACTIVE_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDER_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDERBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[PROGRESSBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_LABEL_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_HOVER_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_PRESSED_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[COMBOBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_PRESSED_LIST_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[CHECKBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[CHECKBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[CHECKBOX_CLICK_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TEXTBOX_BORDER_COLOR] = GetHexValue(fadeColor[7]); - } - else if (guiProperty == GLOBAL_TEXT_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_TEXT_COLOR] = value; - style[LABEL_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[BUTTON_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[BUTTON_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[BUTTON_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[TOGGLE_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_ACTIVE_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[SPINNER_DEFAULT_SYMBOL_COLOR] = GetHexValue(fadeColor[9]); - style[SPINNER_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[SPINNER_HOVER_SYMBOL_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_PRESSED_SYMBOL_COLOR] = GetHexValue(fadeColor[5]); - style[SPINNER_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[COMBOBOX_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_HOVER_LIST_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_PRESSED_LIST_TEXT_COLOR] = GetHexValue(fadeColor[4]); - style[TEXTBOX_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[TEXTBOX_LINE_COLOR] = GetHexValue(fadeColor[6]); - } - else style[guiProperty] = value; - -} - -// Get one style property value -int GetStyleProperty(int guiProperty) { return style[guiProperty]; } - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -static Color ColorMultiply(Color baseColor, float value) -{ - Color multColor = baseColor; - - if (value > 1.0f) value = 1.0f; - else if (value < 0.0f) value = 0.0f; - - multColor.r += (255 - multColor.r)*value; - multColor.g += (255 - multColor.g)*value; - multColor.b += (255 - multColor.b)*value; - - return multColor; -} - -#if defined (RAYGUI_STANDALONE) -// Returns a Color struct from hexadecimal value -static Color GetColor(int hexValue) -{ - Color color; - - color.r = (unsigned char)(hexValue >> 24) & 0xFF; - color.g = (unsigned char)(hexValue >> 16) & 0xFF; - color.b = (unsigned char)(hexValue >> 8) & 0xFF; - color.a = (unsigned char)hexValue & 0xFF; - - return color; -} - -// Returns hexadecimal value for a Color -static int GetHexValue(Color color) -{ - return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); -} - -// Check if point is inside rectangle -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) -{ - bool collision = false; - - if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; - - return collision; -} - -// Formatting of text with variables to 'embed' -static const char *FormatText(const char *text, ...) -{ - #define MAX_FORMATTEXT_LENGTH 64 - - static char buffer[MAX_FORMATTEXT_LENGTH]; - - va_list args; - va_start(args, text); - vsprintf(buffer, text, args); - va_end(args); - - return buffer; -} -#endif \ No newline at end of file diff --git a/src/raygui.h b/src/raygui.h index 61741254..32ad8e9b 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1,8 +1,45 @@ /******************************************************************************************* * -* raygui - raylib IMGUI system (Immedite Mode GUI) +* raygui v1.2 - IMGUI (Immedite Mode GUI) library for raylib (https://github.com/raysan5/raylib) * -* Copyright (c) 2015 Kevin Gato, Daniel Nicolás, Sergio Martinez and Ramon Santamaria +* raygui is a library for creating simple IMGUI interfaces. It provides a set of basic components: +* +* - Label +* - Button +* - ToggleButton +* - ToggleGroup +* - ComboBox +* - CheckBox +* - Slider +* - SliderBar +* - ProgressBar +* - Spinner +* - TextBox +* +* It also provides a set of functions for styling the components based on a set of properties. +* +* USAGE: +* +* Include this file in any C/C++ file that requires it; in ONLY one of them, write: +* #define RAYGUI_IMPLEMENTATION +* before the #include of this file. This expands out the actual implementation into that file. +* +* CONFIGURATION: +* +* You can #define RAYGUI_STANDALONE to avoid raylib.h inclusion (not dependant on raylib functions and types). +* NOTE: Some external funtions are required for drawing and input management, check implementation code. +* +* You can #define RAY_MALLOC() to replace malloc() and free() function by your own. +* +* You can #define RAYGUI_STATIC to make the implementation private to the file that generates the implementation, +* +* VERSIONS AND CREDITS: +* +* 1.2 (07-Jun-2016) Converted to header-only by Ramon Santamaria +* 1.1 (07-Mar-2016) Reviewed and expanded by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. +* 1.0 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. +* +* LICENSE: zlib/libpng * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -20,10 +57,24 @@ * 3. This notice may not be removed or altered from any source distribution. * **********************************************************************************************/ + #ifndef RAYGUI_H #define RAYGUI_H -//#include "raylib.h" +#if !defined(RAYGUI_STANDALONE) + #include "raylib.h" +#endif + +#define RAYGUI_STATIC +#ifdef RAYGUI_STATIC + #define RAYGUIDEF static // Functions just visible to module including this file +#else + #ifdef __cplusplus + #define RAYGUIDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) + #else + #define RAYGUIDEF extern // Functions visible from other files + #endif +#endif //---------------------------------------------------------------------------------- // Defines and Macros @@ -168,7 +219,7 @@ typedef enum GuiProperty { } GuiProperty; #ifdef __cplusplus -extern "C" { // Prevents name mangling of functions +extern "C" { #endif //---------------------------------------------------------------------------------- @@ -278,27 +329,1154 @@ static const char *guiPropertyName[] = { //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -void GuiLabel(Rectangle bounds, const char *text); // Label element, show text -void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner); // Label element extended, configurable colors -bool GuiButton(Rectangle bounds, const char *text); // Button element, returns true when clicked -bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle); // Toggle Button element, returns true when active -int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive); // Toggle Group element, returns toggled button index -int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive); // Combo Box element, returns selected item index -bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box element, returns true when active -float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue); // Slider element, returns selected value -float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue); // Slider Bar element, returns selected value -void GuiProgressBar(Rectangle bounds, float value); // Progress Bar element, shows current progress value -int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue); // Spinner element, returns selected value -char *GuiTextBox(Rectangle bounds, char *text); // Text Box element, returns input text - -void SaveGuiStyle(const char *fileName); // Save GUI style file -void LoadGuiStyle(const char *fileName); // Load GUI style file - -void SetStyleProperty(int guiProperty, int value); // Set one style property -int GetStyleProperty(int guiProperty); // Get one style property +RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text); // Label element, show text +RAYGUIDEF void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner); // Label element extended, configurable colors +RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text); // Button element, returns true when clicked +RAYGUIDEF bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle); // Toggle Button element, returns true when active +RAYGUIDEF int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive); // Toggle Group element, returns toggled button index +RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive); // Combo Box element, returns selected item index +RAYGUIDEF bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box element, returns true when active +RAYGUIDEF float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue); // Slider element, returns selected value +RAYGUIDEF float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue); // Slider Bar element, returns selected value +RAYGUIDEF void GuiProgressBar(Rectangle bounds, float value); // Progress Bar element, shows current progress value +RAYGUIDEF int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue); // Spinner element, returns selected value +RAYGUIDEF char *GuiTextBox(Rectangle bounds, char *text); // Text Box element, returns input text + +RAYGUIDEF void SaveGuiStyle(const char *fileName); // Save GUI style file +RAYGUIDEF void LoadGuiStyle(const char *fileName); // Load GUI style file + +RAYGUIDEF void SetStyleProperty(int guiProperty, int value); // Set one style property +RAYGUIDEF int GetStyleProperty(int guiProperty); // Get one style property #ifdef __cplusplus } #endif #endif // RAYGUI_H + + +/********************************************************************************************************* +* +* RAYGUI IMPLEMENTATION +* +**********************************************************************************************************/ + +#if defined(RAYGUI_IMPLEMENTATION) + +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() + // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() + +#include // Required for: malloc(), free() [Used only on LoadGuiStyle()] +#include // Required for: strcmp() [Used only on LoadGuiStyle()] +#include // Required for: va_list, va_start(), vfprintf(), va_end() + +/* +// NOTE: Example on how to define custom functions +#if !defined(RAY_MALLOC) + #include + #define RAY_MALLOC(size,c) malloc(size) + #define RAY_FREE(ptr,c) free(ptr) +#endif +*/ + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +#if defined(RAYGUI_STANDALONE) + #define KEY_LEFT 263 + #define KEY_RIGHT 262 + #define MOUSE_LEFT_BUTTON 0 +#endif + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- + +// GUI elements states +typedef enum { BUTTON_DEFAULT, BUTTON_HOVER, BUTTON_PRESSED, BUTTON_CLICKED } ButtonState; +typedef enum { TOGGLE_UNACTIVE, TOGGLE_HOVER, TOGGLE_PRESSED, TOGGLE_ACTIVE } ToggleState; +typedef enum { COMBOBOX_UNACTIVE, COMBOBOX_HOVER, COMBOBOX_PRESSED, COMBOBOX_ACTIVE } ComboBoxState; +typedef enum { SPINNER_DEFAULT, SPINNER_HOVER, SPINNER_PRESSED } SpinnerState; +typedef enum { CHECKBOX_STATUS, CHECKBOX_HOVER, CHECKBOX_PRESSED } CheckBoxState; +typedef enum { SLIDER_DEFAULT, SLIDER_HOVER, SLIDER_ACTIVE } SliderState; + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- + +// Current GUI style (default light) +static int style[NUM_PROPERTIES] = { + 0xf5f5f5ff, // GLOBAL_BASE_COLOR, + 0xf5f5f5ff, // GLOBAL_BORDER_COLOR, + 0xf5f5f5ff, // GLOBAL_TEXT_COLOR, + 10, // GLOBAL_TEXT_FONTSIZE + 1, // GLOBAL_BORDER_WIDTH + 0xf5f5f5ff, // BACKGROUND_COLOR + 1, // LABEL_BORDER_WIDTH + 0x4d4d4dff, // LABEL_TEXT_COLOR + 20, // LABEL_TEXT_PADDING + 2, // BUTTON_BORDER_WIDTH + 20, // BUTTON_TEXT_PADDING + 0x828282ff, // BUTTON_DEFAULT_BORDER_COLOR + 0xc8c8c8ff, // BUTTON_DEFAULT_INSIDE_COLOR + 0x4d4d4dff, // BUTTON_DEFAULT_TEXT_COLOR + 0xc8c8c8ff, // BUTTON_HOVER_BORDER_COLOR + 0xffffffff, // BUTTON_HOVER_INSIDE_COLOR + 0x353535ff, // BUTTON_HOVER_TEXT_COLOR + 0x7bb0d6ff, // BUTTON_PRESSED_BORDER_COLOR + 0xbcecffff, // BUTTON_PRESSED_INSIDE_COLOR + 0x5f9aa7ff, // BUTTON_PRESSED_TEXT_COLOR + 20, // TOGGLE_TEXT_PADDING + 1, // TOGGLE_BORDER_WIDTH + 0x828282ff, // TOGGLE_DEFAULT_BORDER_COLOR + 0xc8c8c8ff, // TOGGLE_DEFAULT_INSIDE_COLOR + 0x828282ff, // TOGGLE_DEFAULT_TEXT_COLOR + 0xc8c8c8ff, // TOGGLE_HOVER_BORDER_COLOR + 0xffffffff, // TOGGLE_HOVER_INSIDE_COLOR + 0x828282ff, // TOGGLE_HOVER_TEXT_COLOR + 0xbdd7eaff, // TOGGLE_PRESSED_BORDER_COLOR + 0xddf5ffff, // TOGGLE_PRESSED_INSIDE_COLOR + 0xafccd3ff, // TOGGLE_PRESSED_TEXT_COLOR + 0x7bb0d6ff, // TOGGLE_ACTIVE_BORDER_COLOR + 0xbcecffff, // TOGGLE_ACTIVE_INSIDE_COLOR + 0x5f9aa7ff, // TOGGLE_ACTIVE_TEXT_COLOR + 3, // TOGGLEGROUP_PADDING + 1, // SLIDER_BORDER_WIDTH + 1, // SLIDER_BUTTON_BORDER_WIDTH + 0x828282ff, // SLIDER_BORDER_COLOR + 0xc8c8c8ff, // SLIDER_INSIDE_COLOR + 0xbcecffff, // SLIDER_DEFAULT_COLOR + 0xffffffff, // SLIDER_HOVER_COLOR + 0xddf5ffff, // SLIDER_ACTIVE_COLOR + 0x828282ff, // SLIDERBAR_BORDER_COLOR + 0xc8c8c8ff, // SLIDERBAR_INSIDE_COLOR + 0xbcecffff, // SLIDERBAR_DEFAULT_COLOR + 0xffffffff, // SLIDERBAR_HOVER_COLOR + 0xddf5ffff, // SLIDERBAR_ACTIVE_COLOR + 0x828282ff, // SLIDERBAR_ZERO_LINE_COLOR + 0x828282ff, // PROGRESSBAR_BORDER_COLOR + 0xc8c8c8ff, // PROGRESSBAR_INSIDE_COLOR + 0xbcecffff, // PROGRESSBAR_PROGRESS_COLOR + 2, // PROGRESSBAR_BORDER_WIDTH + 0x828282ff, // SPINNER_LABEL_BORDER_COLOR + 0xc8c8c8ff, // SPINNER_LABEL_INSIDE_COLOR + 0x828282ff, // SPINNER_DEFAULT_BUTTON_BORDER_COLOR + 0xc8c8c8ff, // SPINNER_DEFAULT_BUTTON_INSIDE_COLOR + 0x000000ff, // SPINNER_DEFAULT_SYMBOL_COLOR + 0x000000ff, // SPINNER_DEFAULT_TEXT_COLOR + 0xc8c8c8ff, // SPINNER_HOVER_BUTTON_BORDER_COLOR + 0xffffffff, // SPINNER_HOVER_BUTTON_INSIDE_COLOR + 0x000000ff, // SPINNER_HOVER_SYMBOL_COLOR + 0x000000ff, // SPINNER_HOVER_TEXT_COLOR + 0x7bb0d6ff, // SPINNER_PRESSED_BUTTON_BORDER_COLOR + 0xbcecffff, // SPINNER_PRESSED_BUTTON_INSIDE_COLOR + 0x5f9aa7ff, // SPINNER_PRESSED_SYMBOL_COLOR + 0x000000ff, // SPINNER_PRESSED_TEXT_COLOR + 1, // COMBOBOX_PADDING + 30, // COMBOBOX_BUTTON_WIDTH + 20, // COMBOBOX_BUTTON_HEIGHT + 1, // COMBOBOX_BORDER_WIDTH + 0x828282ff, // COMBOBOX_DEFAULT_BORDER_COLOR + 0xc8c8c8ff, // COMBOBOX_DEFAULT_INSIDE_COLOR + 0x828282ff, // COMBOBOX_DEFAULT_TEXT_COLOR + 0x828282ff, // COMBOBOX_DEFAULT_LIST_TEXT_COLOR + 0xc8c8c8ff, // COMBOBOX_HOVER_BORDER_COLOR + 0xffffffff, // COMBOBOX_HOVER_INSIDE_COLOR + 0x828282ff, // COMBOBOX_HOVER_TEXT_COLOR + 0x828282ff, // COMBOBOX_HOVER_LIST_TEXT_COLOR + 0x7bb0d6ff, // COMBOBOX_PRESSED_BORDER_COLOR + 0xbcecffff, // COMBOBOX_PRESSED_INSIDE_COLOR + 0x5f9aa7ff, // COMBOBOX_PRESSED_TEXT_COLOR + 0x0078acff, // COMBOBOX_PRESSED_LIST_BORDER_COLOR + 0x66e7ffff, // COMBOBOX_PRESSED_LIST_INSIDE_COLOR + 0x0078acff, // COMBOBOX_PRESSED_LIST_TEXT_COLOR + 0x828282ff, // CHECKBOX_DEFAULT_BORDER_COLOR + 0xffffffff, // CHECKBOX_DEFAULT_INSIDE_COLOR + 0xc8c8c8ff, // CHECKBOX_HOVER_BORDER_COLOR + 0xffffffff, // CHECKBOX_HOVER_INSIDE_COLOR + 0x66e7ffff, // CHECKBOX_CLICK_BORDER_COLOR + 0xddf5ffff, // CHECKBOX_CLICK_INSIDE_COLOR + 0x7bb0d6ff, // CHECKBOX_STATUS_ACTIVE_COLOR + 4, // CHECKBOX_INSIDE_WIDTH + 1, // TEXTBOX_BORDER_WIDTH + 0x828282ff, // TEXTBOX_BORDER_COLOR + 0xf5f5f5ff, // TEXTBOX_INSIDE_COLOR + 0x000000ff, // TEXTBOX_TEXT_COLOR + 0x000000ff, // TEXTBOX_LINE_COLOR + 10 // TEXTBOX_TEXT_FONTSIZE +}; + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static Color ColorMultiply(Color baseColor, float value); + +#if defined RAYGUI_STANDALONE +static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value +static int GetHexValue(Color color); // Returns hexadecimal value for a Color +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' + +// NOTE: raygui depend on some raylib input and drawing functions +// TODO: Replace by your own functions +static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } +static int IsMouseButtonDown(int button) { return 0; } +static int IsMouseButtonPressed(int button) { return 0; } +static int IsMouseButtonReleased(int button) { return 0; } +static int IsMouseButtonUp(int button) { return 0; } + +static int GetKeyPressed(void) { return 0; } // NOTE: Only used by GuiTextBox() +static int IsKeyDown(int key) { return 0; } // NOTE: Only used by GuiSpinner() + +static int MeasureText(const char *text, int fontSize) { return 0; } +static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } +static void DrawRectangleRec(Rectangle rec, Color color) { } +static void DrawRectangle(int posX, int posY, int width, int height, Color color) { DrawRectangleRec((Rectangle){ posX, posY, width, height }, color); } +#endif + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Label element, show text +RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text) +{ + #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) + + GuiLabelEx(bounds, text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); +} + +// Label element extended, configurable colors +RAYGUIDEF void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner) +{ + // Update control + //-------------------------------------------------------------------- + int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; + + if (bounds.width < textWidth) bounds.width = textWidth + style[LABEL_TEXT_PADDING]; + if (bounds.height < textHeight) bounds.height = textHeight + style[LABEL_TEXT_PADDING]/2; + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + DrawRectangleRec(bounds, border); + DrawRectangle(bounds.x + style[LABEL_BORDER_WIDTH], bounds.y + style[LABEL_BORDER_WIDTH], bounds.width - (2 * style[LABEL_BORDER_WIDTH]), bounds.height - (2 * style[LABEL_BORDER_WIDTH]), inner); + DrawText(text, bounds.x + ((bounds.width/2) - (textWidth/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], textColor); + //-------------------------------------------------------------------- +} + +// Button element, returns true when clicked +RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text) +{ + ButtonState buttonState = BUTTON_DEFAULT; + Vector2 mousePoint = GetMousePosition(); + + int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; + + // Update control + //-------------------------------------------------------------------- + if (bounds.width < textWidth) bounds.width = textWidth + style[BUTTON_TEXT_PADDING]; + if (bounds.height < textHeight) bounds.height = textHeight + style[BUTTON_TEXT_PADDING]/2; + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_PRESSED; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_CLICKED; + else buttonState = BUTTON_HOVER; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (buttonState) + { + case BUTTON_DEFAULT: + { + DrawRectangleRec(bounds, GetColor(style[BUTTON_DEFAULT_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_DEFAULT_INSIDE_COLOR])); + DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_DEFAULT_TEXT_COLOR])); + } break; + case BUTTON_HOVER: + { + DrawRectangleRec(bounds, GetColor(style[BUTTON_HOVER_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_HOVER_INSIDE_COLOR])); + DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_HOVER_TEXT_COLOR])); + } break; + case BUTTON_PRESSED: + { + DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); + DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_PRESSED_TEXT_COLOR])); + } break; + case BUTTON_CLICKED: + { + DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); + } break; + default: break; + } + //------------------------------------------------------------------ + + if (buttonState == BUTTON_CLICKED) return true; + else return false; +} + +// Toggle Button element, returns true when active +RAYGUIDEF bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle) +{ + ToggleState toggleState = TOGGLE_UNACTIVE; + Rectangle toggleButton = bounds; + Vector2 mousePoint = GetMousePosition(); + + int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; + + // Update control + //-------------------------------------------------------------------- + if (toggleButton.width < textWidth) toggleButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; + if (toggleButton.height < textHeight) toggleButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; + + if (toggle) toggleState = TOGGLE_ACTIVE; + else toggleState = TOGGLE_UNACTIVE; + + if (CheckCollisionPointRec(mousePoint, toggleButton)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) toggleState = TOGGLE_PRESSED; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + { + if (toggle) + { + toggle = false; + toggleState = TOGGLE_UNACTIVE; + } + else + { + toggle = true; + toggleState = TOGGLE_ACTIVE; + } + } + else toggleState = TOGGLE_HOVER; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (toggleState) + { + case TOGGLE_UNACTIVE: + { + DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_DEFAULT_BORDER_COLOR])); + DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_DEFAULT_INSIDE_COLOR])); + DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_DEFAULT_TEXT_COLOR])); + } break; + case TOGGLE_HOVER: + { + DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_HOVER_BORDER_COLOR])); + DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_HOVER_INSIDE_COLOR])); + DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_HOVER_TEXT_COLOR])); + } break; + case TOGGLE_PRESSED: + { + DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_PRESSED_BORDER_COLOR])); + DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_PRESSED_INSIDE_COLOR])); + DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_PRESSED_TEXT_COLOR])); + } break; + case TOGGLE_ACTIVE: + { + DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); + DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_ACTIVE_INSIDE_COLOR])); + DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_ACTIVE_TEXT_COLOR])); + } break; + default: break; + } + //-------------------------------------------------------------------- + + return toggle; +} + +// Toggle Group element, returns toggled button index +RAYGUIDEF int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive) +{ + for (int i = 0; i < toggleNum; i++) + { + if (i == toggleActive) GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], true); + else if (GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], false) == true) toggleActive = i; + } + + return toggleActive; +} + +// Combo Box element, returns selected item index +RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive) +{ + ComboBoxState comboBoxState = COMBOBOX_UNACTIVE; + Rectangle comboBoxButton = bounds; + Rectangle click = { bounds.x + bounds.width + style[COMBOBOX_PADDING], bounds.y, style[COMBOBOX_BUTTON_WIDTH], style[COMBOBOX_BUTTON_HEIGHT] }; + Vector2 mousePoint = GetMousePosition(); + + int textHeight = style[GLOBAL_TEXT_FONTSIZE]; + + for (int i = 0; i < comboNum; i++) + { + if (i == comboActive) + { + // Update control + //-------------------------------------------------------------------- + int textWidth = MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE]); + + if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; + if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; + + if (CheckCollisionPointRec(mousePoint, comboBoxButton) || CheckCollisionPointRec(mousePoint, click)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_PRESSED; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_ACTIVE; + else comboBoxState = COMBOBOX_HOVER; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (comboBoxState) + { + case COMBOBOX_UNACTIVE: + { + DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); + DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); + + DrawRectangleRec(click, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); + DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); + DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR])); + DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_TEXT_COLOR])); + } break; + case COMBOBOX_HOVER: + { + DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); + DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); + + DrawRectangleRec(click, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); + DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); + DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_LIST_TEXT_COLOR])); + DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_TEXT_COLOR])); + } break; + case COMBOBOX_PRESSED: + { + DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); + DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); + + DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); + DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); + DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); + DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); + } break; + case COMBOBOX_ACTIVE: + { + DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); + DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); + + DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); + DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); + DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); + DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); + } break; + default: break; + } + + //DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[]globalTextFontSize)/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[]globalTextFontSize/2)), style[]globalTextFontSize, COMBOBOX_PRESSED_TEXT_COLOR); + //-------------------------------------------------------------------- + } + } + + if (CheckCollisionPointRec(GetMousePosition(), bounds) || CheckCollisionPointRec(GetMousePosition(), click)) + { + if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) + { + comboActive += 1; + if(comboActive >= comboNum) comboActive = 0; + } + } + + return comboActive; +} + +// Check Box element, returns true when active +RAYGUIDEF bool GuiCheckBox(Rectangle checkBoxBounds, const char *text, bool checked) +{ + CheckBoxState checkBoxState = CHECKBOX_STATUS; + Vector2 mousePoint = GetMousePosition(); + + // Update control + //-------------------------------------------------------------------- + if (CheckCollisionPointRec(mousePoint, checkBoxBounds)) + { + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) checkBoxState = CHECKBOX_PRESSED; + else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) + { + checkBoxState = CHECKBOX_STATUS; + checked = !checked; + } + else checkBoxState = CHECKBOX_HOVER; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (checkBoxState) + { + case CHECKBOX_HOVER: + { + DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_HOVER_BORDER_COLOR])); + DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_HOVER_INSIDE_COLOR])); + } break; + case CHECKBOX_STATUS: + { + DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_DEFAULT_BORDER_COLOR])); + DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_DEFAULT_INSIDE_COLOR])); + } break; + case CHECKBOX_PRESSED: + { + DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_CLICK_BORDER_COLOR])); + DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_CLICK_INSIDE_COLOR])); + } break; + default: break; + } + + if (text != NULL) DrawText(text, checkBoxBounds.x + checkBoxBounds.width + 2, checkBoxBounds.y + ((checkBoxBounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2) + 1), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[LABEL_TEXT_COLOR])); + + if (checked) + { + DrawRectangle((int)(checkBoxBounds.x + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.y + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.width - (2*style[CHECKBOX_INSIDE_WIDTH])), (int)(checkBoxBounds.height - (2*style[CHECKBOX_INSIDE_WIDTH])), GetColor(style[CHECKBOX_STATUS_ACTIVE_COLOR])); + } + //-------------------------------------------------------------------- + + return checked; +} + +// Slider element, returns selected value +RAYGUIDEF float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue) +{ + SliderState sliderState = SLIDER_DEFAULT; + float buttonTravelDistance = 0; + float sliderPos = 0; + Vector2 mousePoint = GetMousePosition(); + + // Update control + //-------------------------------------------------------------------- + if (value < minValue) value = minValue; + else if (value >= maxValue) value = maxValue; + + sliderPos = (value - minValue)/(maxValue - minValue); + + Rectangle sliderButton; + sliderButton.width = ((int)(bounds.width - (2 * style[SLIDER_BUTTON_BORDER_WIDTH]))/10 - 8); + sliderButton.height =((int)(bounds.height - ( 2 * style[SLIDER_BORDER_WIDTH] + 2 * style[SLIDER_BUTTON_BORDER_WIDTH]))); + + float sliderButtonMinPos = bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]; + float sliderButtonMaxPos = bounds.x + bounds.width - (style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH] + sliderButton.width); + + buttonTravelDistance = sliderButtonMaxPos - sliderButtonMinPos; + + sliderButton.x = ((int)(bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]) + (sliderPos * buttonTravelDistance)); + sliderButton.y = ((int)(bounds.y + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH])); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + sliderState = SLIDER_HOVER; + + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) sliderState = SLIDER_ACTIVE; + + if ((sliderState == SLIDER_ACTIVE) && (IsMouseButtonDown(MOUSE_LEFT_BUTTON))) + { + sliderButton.x = mousePoint.x - sliderButton.width / 2; + + if (sliderButton.x <= sliderButtonMinPos) sliderButton.x = sliderButtonMinPos; + else if (sliderButton.x >= sliderButtonMaxPos) sliderButton.x = sliderButtonMaxPos; + + sliderPos = (sliderButton.x - sliderButtonMinPos) / buttonTravelDistance; + } + } + else sliderState = SLIDER_DEFAULT; + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + DrawRectangleRec(bounds, GetColor(style[SLIDER_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]), (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDER_INSIDE_COLOR])); + + switch (sliderState) + { + case SLIDER_DEFAULT: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_DEFAULT_COLOR])); break; + case SLIDER_HOVER: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_HOVER_COLOR])); break; + case SLIDER_ACTIVE: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_ACTIVE_COLOR])); break; + default: break; + } + //-------------------------------------------------------------------- + + return minValue + (maxValue - minValue)*sliderPos; +} + +// Slider Bar element, returns selected value +RAYGUIDEF float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue) +{ + SliderState sliderState = SLIDER_DEFAULT; + Vector2 mousePoint = GetMousePosition(); + float fixedValue; + float fixedMinValue; + + fixedValue = value - minValue; + maxValue = maxValue - minValue; + fixedMinValue = 0; + + // Update control + //-------------------------------------------------------------------- + if (fixedValue <= fixedMinValue) fixedValue = fixedMinValue; + else if (fixedValue >= maxValue) fixedValue = maxValue; + + Rectangle sliderBar; + + sliderBar.x = bounds.x + style[SLIDER_BORDER_WIDTH]; + sliderBar.y = bounds.y + style[SLIDER_BORDER_WIDTH]; + sliderBar.width = ((fixedValue*((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]))/(maxValue - fixedMinValue)); + sliderBar.height = bounds.height - 2*style[SLIDER_BORDER_WIDTH]; + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + sliderState = SLIDER_HOVER; + + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + sliderState = SLIDER_ACTIVE; + + sliderBar.width = (mousePoint.x - bounds.x - style[SLIDER_BORDER_WIDTH]); + + if (mousePoint.x <= (bounds.x + style[SLIDER_BORDER_WIDTH])) sliderBar.width = 0; + else if (mousePoint.x >= (bounds.x + bounds.width - style[SLIDER_BORDER_WIDTH])) sliderBar.width = bounds.width - 2*style[SLIDER_BORDER_WIDTH]; + } + } + else sliderState = SLIDER_DEFAULT; + + fixedValue = ((float)sliderBar.width*(maxValue - fixedMinValue))/((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]); + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + DrawRectangleRec(bounds, GetColor(style[SLIDERBAR_BORDER_COLOR])); + DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]) , (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDERBAR_INSIDE_COLOR])); + + switch (sliderState) + { + case SLIDER_DEFAULT: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_DEFAULT_COLOR])); break; + case SLIDER_HOVER: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_HOVER_COLOR])); break; + case SLIDER_ACTIVE: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_ACTIVE_COLOR])); break; + default: break; + } + + if (minValue < 0 && maxValue > 0) DrawRectangle((bounds.x + style[SLIDER_BORDER_WIDTH]) - (minValue * ((bounds.width - (style[SLIDER_BORDER_WIDTH]*2))/maxValue)), sliderBar.y, 1, sliderBar.height, GetColor(style[SLIDERBAR_ZERO_LINE_COLOR])); + //-------------------------------------------------------------------- + + return fixedValue + minValue; +} + +// Progress Bar element, shows current progress value +RAYGUIDEF void GuiProgressBar(Rectangle bounds, float value) +{ + if (value > 1.0f) value = 1.0f; + else if (value < 0.0f) value = 0.0f; + + Rectangle progressBar = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; + Rectangle progressValue = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], value * (bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2)), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; + + // Draw control + //-------------------------------------------------------------------- + DrawRectangleRec(bounds, GetColor(style[PROGRESSBAR_BORDER_COLOR])); + DrawRectangleRec(progressBar, GetColor(style[PROGRESSBAR_INSIDE_COLOR])); + DrawRectangleRec(progressValue, GetColor(style[PROGRESSBAR_PROGRESS_COLOR])); + //-------------------------------------------------------------------- +} + +// Spinner element, returns selected value +// NOTE: Requires static variables: framesCounter, valueSpeed - ERROR! +RAYGUIDEF int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) +{ + SpinnerState spinnerState = SPINNER_DEFAULT; + Rectangle labelBoxBound = { bounds.x + bounds.width/4 + 1, bounds.y, bounds.width/2, bounds.height }; + Rectangle leftButtonBound = { bounds.x, bounds.y, bounds.width/4, bounds.height }; + Rectangle rightButtonBound = { bounds.x + bounds.width - bounds.width/4 + 1, bounds.y, bounds.width/4, bounds.height }; + Vector2 mousePoint = GetMousePosition(); + + int textWidth = MeasureText(FormatText("%i", value), style[GLOBAL_TEXT_FONTSIZE]); + //int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Unused variable + + int buttonSide = 0; + + static int framesCounter = 0; + static bool valueSpeed = false;; + + //if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; + //if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; + + // Update control + //-------------------------------------------------------------------- + if (CheckCollisionPointRec(mousePoint, leftButtonBound) || CheckCollisionPointRec(mousePoint, rightButtonBound) || CheckCollisionPointRec(mousePoint, labelBoxBound)) + { + if (IsKeyDown(KEY_LEFT)) + { + spinnerState = SPINNER_PRESSED; + buttonSide = 1; + + if (value > minValue) value -= 1; + } + else if (IsKeyDown(KEY_RIGHT)) + { + spinnerState = SPINNER_PRESSED; + buttonSide = 2; + + if (value < maxValue) value += 1; + } + } + + if (CheckCollisionPointRec(mousePoint, leftButtonBound)) + { + buttonSide = 1; + spinnerState = SPINNER_HOVER; + + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + if (!valueSpeed) + { + if (value > minValue) value--; + valueSpeed = true; + } + else framesCounter++; + + spinnerState = SPINNER_PRESSED; + + if (value > minValue) + { + if (framesCounter >= 30) value -= 1; + } + } + } + else if (CheckCollisionPointRec(mousePoint, rightButtonBound)) + { + buttonSide = 2; + spinnerState = SPINNER_HOVER; + + if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) + { + if (!valueSpeed) + { + if (value < maxValue) value++; + valueSpeed = true; + } + else framesCounter++; + + spinnerState = SPINNER_PRESSED; + + if (value < maxValue) + { + if (framesCounter >= 30) value += 1; + } + } + } + else if (!CheckCollisionPointRec(mousePoint, labelBoxBound)) buttonSide = 0; + + if (IsMouseButtonUp(MOUSE_LEFT_BUTTON)) + { + valueSpeed = false; + framesCounter = 0; + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + switch (spinnerState) + { + case SPINNER_DEFAULT: + { + DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + + DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); + DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); + + DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_TEXT_COLOR])); + } break; + case SPINNER_HOVER: + { + if (buttonSide == 1) + { + DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); + DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); + + DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); + DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + } + else if (buttonSide == 2) + { + DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); + DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); + + DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); + } + + DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); + DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); + + DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_TEXT_COLOR])); + } break; + case SPINNER_PRESSED: + { + if (buttonSide == 1) + { + DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); + DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); + + DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); + DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + } + else if (buttonSide == 2) + { + DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); + DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); + + DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); + DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); + + DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); + DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); + } + + DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); + DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); + + DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_TEXT_COLOR])); + } break; + default: break; + } + + return value; +} + +// Text Box element, returns input text +// NOTE: Requires static variables: framesCounter - ERROR! +RAYGUIDEF char *GuiTextBox(Rectangle bounds, char *text) +{ + #define MAX_CHARS_LENGTH 20 + #define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256 + + int initPos = bounds.x + 4; + int letter = -1; + static int framesCounter = 0; + Vector2 mousePoint = GetMousePosition(); + + // Update control + //-------------------------------------------------------------------- + framesCounter++; + + letter = GetKeyPressed(); + + if (CheckCollisionPointRec(mousePoint, bounds)) + { + if (letter != -1) + { + if (letter == KEY_BACKSPACE_TEXT) + { + for (int i = 0; i < MAX_CHARS_LENGTH; i++) + { + if ((text[i] == '\0') && (i > 0)) + { + text[i - 1] = '\0'; + break; + } + } + + text[MAX_CHARS_LENGTH - 1] = '\0'; + } + else + { + if ((letter >= 32) && (letter < 127)) + { + for (int i = 0; i < MAX_CHARS_LENGTH; i++) + { + if (text[i] == '\0') + { + text[i] = (char)letter; + break; + } + } + } + } + } + } + //-------------------------------------------------------------------- + + // Draw control + //-------------------------------------------------------------------- + if (CheckCollisionPointRec(mousePoint, bounds)) DrawRectangleRec(bounds, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); + else DrawRectangleRec(bounds, GetColor(style[TEXTBOX_BORDER_COLOR])); + + DrawRectangle(bounds.x + style[TEXTBOX_BORDER_WIDTH], bounds.y + style[TEXTBOX_BORDER_WIDTH], bounds.width - (style[TEXTBOX_BORDER_WIDTH] * 2), bounds.height - (style[TEXTBOX_BORDER_WIDTH] * 2), GetColor(style[TEXTBOX_INSIDE_COLOR])); + + for (int i = 0; i < MAX_CHARS_LENGTH; i++) + { + if (text[i] == '\0') break; + + DrawText(FormatText("%c", text[i]), initPos, bounds.y + style[TEXTBOX_TEXT_FONTSIZE], style[TEXTBOX_TEXT_FONTSIZE], GetColor(style[TEXTBOX_TEXT_COLOR])); + + initPos += (MeasureText(FormatText("%c", text[i]), style[GLOBAL_TEXT_FONTSIZE]) + 2); + //initPos += ((GetDefaultFont().charRecs[(int)text[i] - 32].width + 2)); + } + + if ((framesCounter/20)%2 && CheckCollisionPointRec(mousePoint, bounds)) DrawRectangle(initPos + 2, bounds.y + 5, 1, 20, GetColor(style[TEXTBOX_LINE_COLOR])); + //-------------------------------------------------------------------- + + return text; +} + +// Save current GUI style into a text file +RAYGUIDEF void SaveGuiStyle(const char *fileName) +{ + FILE *styleFile = fopen(fileName, "wt"); + + for (int i = 0; i < NUM_PROPERTIES; i++) fprintf(styleFile, "%-40s0x%x\n", guiPropertyName[i], GetStyleProperty(i)); + + fclose(styleFile); +} + +// Load GUI style from a text file +RAYGUIDEF void LoadGuiStyle(const char *fileName) +{ + #define MAX_STYLE_PROPERTIES 128 + + typedef struct { + char id[64]; + int value; + } StyleProperty; + + StyleProperty *styleProp = (StyleProperty *)malloc(MAX_STYLE_PROPERTIES*sizeof(StyleProperty));; + int counter = 0; + + FILE *styleFile = fopen(fileName, "rt"); + + while (!feof(styleFile)) + { + fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value); + counter++; + } + + fclose(styleFile); + + for (int i = 0; i < counter; i++) + { + for (int j = 0; j < NUM_PROPERTIES; j++) + { + if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0) + { + // Assign correct property to style + style[j] = styleProp[i].value; + } + } + } + + free(styleProp); +} + +// Set one style property value +RAYGUIDEF void SetStyleProperty(int guiProperty, int value) +{ + #define NUM_COLOR_SAMPLES 10 + + if (guiProperty == GLOBAL_BASE_COLOR) + { + Color baseColor = GetColor(value); + Color fadeColor[NUM_COLOR_SAMPLES]; + + for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); + + style[GLOBAL_BASE_COLOR] = value; + style[BACKGROUND_COLOR] = GetHexValue(fadeColor[3]); + style[BUTTON_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[BUTTON_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[BUTTON_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); + style[TOGGLE_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[TOGGLE_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[TOGGLE_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); + style[TOGGLE_ACTIVE_INSIDE_COLOR] = GetHexValue(fadeColor[8]); + style[SLIDER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[SLIDER_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); + style[SLIDER_HOVER_COLOR] = GetHexValue(fadeColor[7]); + style[SLIDER_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); + style[SLIDERBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[SLIDERBAR_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); + style[SLIDERBAR_HOVER_COLOR] = GetHexValue(fadeColor[7]); + style[SLIDERBAR_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); + style[SLIDERBAR_ZERO_LINE_COLOR] = GetHexValue(fadeColor[8]); + style[PROGRESSBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[PROGRESSBAR_PROGRESS_COLOR] = GetHexValue(fadeColor[6]); + style[SPINNER_LABEL_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[SPINNER_HOVER_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[5]); + style[COMBOBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[COMBOBOX_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[COMBOBOX_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[8]); + style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR] = GetHexValue(fadeColor[8]); + style[CHECKBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + style[CHECKBOX_CLICK_INSIDE_COLOR] = GetHexValue(fadeColor[6]); + style[CHECKBOX_STATUS_ACTIVE_COLOR] = GetHexValue(fadeColor[8]); + style[TEXTBOX_INSIDE_COLOR] = GetHexValue(fadeColor[4]); + } + else if (guiProperty == GLOBAL_BORDER_COLOR) + { + Color baseColor = GetColor(value); + Color fadeColor[NUM_COLOR_SAMPLES]; + + for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); + + style[GLOBAL_BORDER_COLOR] = value; + style[BUTTON_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[BUTTON_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); + style[BUTTON_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[TOGGLE_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[TOGGLE_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); + style[TOGGLE_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[TOGGLE_ACTIVE_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[SLIDER_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[SLIDERBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[PROGRESSBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[SPINNER_LABEL_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[SPINNER_HOVER_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[8]); + style[SPINNER_PRESSED_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[COMBOBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[COMBOBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); + style[COMBOBOX_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[COMBOBOX_PRESSED_LIST_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[CHECKBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); + style[CHECKBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); + style[CHECKBOX_CLICK_BORDER_COLOR] = GetHexValue(fadeColor[9]); + style[TEXTBOX_BORDER_COLOR] = GetHexValue(fadeColor[7]); + } + else if (guiProperty == GLOBAL_TEXT_COLOR) + { + Color baseColor = GetColor(value); + Color fadeColor[NUM_COLOR_SAMPLES]; + + for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); + + style[GLOBAL_TEXT_COLOR] = value; + style[LABEL_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[BUTTON_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[BUTTON_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); + style[BUTTON_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); + style[TOGGLE_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[TOGGLE_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); + style[TOGGLE_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); + style[TOGGLE_ACTIVE_TEXT_COLOR] = GetHexValue(fadeColor[5]); + style[SPINNER_DEFAULT_SYMBOL_COLOR] = GetHexValue(fadeColor[9]); + style[SPINNER_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[SPINNER_HOVER_SYMBOL_COLOR] = GetHexValue(fadeColor[8]); + style[SPINNER_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); + style[SPINNER_PRESSED_SYMBOL_COLOR] = GetHexValue(fadeColor[5]); + style[SPINNER_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); + style[COMBOBOX_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[COMBOBOX_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); + style[COMBOBOX_HOVER_LIST_TEXT_COLOR] = GetHexValue(fadeColor[8]); + style[COMBOBOX_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[4]); + style[COMBOBOX_PRESSED_LIST_TEXT_COLOR] = GetHexValue(fadeColor[4]); + style[TEXTBOX_TEXT_COLOR] = GetHexValue(fadeColor[9]); + style[TEXTBOX_LINE_COLOR] = GetHexValue(fadeColor[6]); + } + else style[guiProperty] = value; + +} + +// Get one style property value +RAYGUIDEF int GetStyleProperty(int guiProperty) { return style[guiProperty]; } + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +static Color ColorMultiply(Color baseColor, float value) +{ + Color multColor = baseColor; + + if (value > 1.0f) value = 1.0f; + else if (value < 0.0f) value = 0.0f; + + multColor.r += (255 - multColor.r)*value; + multColor.g += (255 - multColor.g)*value; + multColor.b += (255 - multColor.b)*value; + + return multColor; +} + +#if defined (RAYGUI_STANDALONE) +// Returns a Color struct from hexadecimal value +static Color GetColor(int hexValue) +{ + Color color; + + color.r = (unsigned char)(hexValue >> 24) & 0xFF; + color.g = (unsigned char)(hexValue >> 16) & 0xFF; + color.b = (unsigned char)(hexValue >> 8) & 0xFF; + color.a = (unsigned char)hexValue & 0xFF; + + return color; +} + +// Returns hexadecimal value for a Color +static int GetHexValue(Color color) +{ + return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); +} + +// Check if point is inside rectangle +static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) +{ + bool collision = false; + + if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; + + return collision; +} + +// Formatting of text with variables to 'embed' +static const char *FormatText(const char *text, ...) +{ + #define MAX_FORMATTEXT_LENGTH 64 + + static char buffer[MAX_FORMATTEXT_LENGTH]; + + va_list args; + va_start(args, text); + vsprintf(buffer, text, args); + va_end(args); + + return buffer; +} +#endif + +#endif // RAYGUI_IMPLEMENTATION + -- cgit v1.2.3 From ee795150fa21f239533d4c9ffadf56366c89a8ca Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Jun 2016 23:44:53 +0200 Subject: Updated some code --- src/rlgl.c | 16 ++++++++-------- src/rlgl.h | 5 +++++ 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 6b99bf19..72225634 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -48,8 +48,13 @@ #ifdef __APPLE__ #include // OpenGL 3 library for OSX #else - #define GLAD_IMPLEMENTATION - #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers + #define GLAD_IMPLEMENTATION +#if defined(RLGL_STANDALONE) + #include "glad.h" // GLAD extensions loading library, includes OpenGL headers +#else + #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers +#endif + #endif #endif @@ -159,10 +164,6 @@ typedef struct { // TODO: Store draw state -> blending mode, shader } DrawCall; -#if defined(RLGL_STANDALONE) -typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; -#endif - //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -259,7 +260,6 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); #endif #if defined(RLGL_STANDALONE) -static void TraceLog(int msgType, const char *text, ...); float *MatrixToFloat(Matrix mat); // Converts Matrix to float array #endif @@ -3344,7 +3344,7 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) #if defined(RLGL_STANDALONE) // Output a trace log message // NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning -static void TraceLog(int msgType, const char *text, ...) +void TraceLog(int msgType, const char *text, ...) { va_list args; va_start(args, text); diff --git a/src/rlgl.h b/src/rlgl.h index 2a578a1f..9c25f710 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -230,6 +230,9 @@ typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; + + // TraceLog message types + typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif #ifdef __cplusplus @@ -339,6 +342,8 @@ void EndBlendMode(void); // End blend Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool void DestroyLight(Light light); // Destroy a light and take it out of the list + +void TraceLog(int msgType, const char *text, ...); #endif #ifdef __cplusplus -- cgit v1.2.3 From 09fa002818f0e25d1741299b0cf49054dda5c50a Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 8 Jun 2016 00:04:56 +0200 Subject: Corrected issue --- src/android/jni/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk index a9178dac..66851d08 100644 --- a/src/android/jni/Android.mk +++ b/src/android/jni/Android.mk @@ -46,7 +46,7 @@ LOCAL_SRC_FILES :=\ ../../models.c \ ../../utils.c \ ../../audio.c \ - ../../stb_vorbis.c \ + ../../external/stb_vorbis.c \ # Required includes paths (.h) LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/../.. -- cgit v1.2.3 From f0d8c009ae9bd1d8e7f17f76fe0658b257cf16de Mon Sep 17 00:00:00 2001 From: Joshua Reisenauer Date: Tue, 7 Jun 2016 16:03:21 -0700 Subject: cleaned things up --- src/audio.c | 29 +++++++++++++++-------------- src/external/jar_mod.h | 42 +++++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index ad1d7eba..958b9838 100644 --- a/src/audio.c +++ b/src/audio.c @@ -107,6 +107,7 @@ typedef struct Music { float totalLengthSeconds; bool loop; bool chipTune; // chiptune is loaded? + bool enabled; } Music; // Audio errors registered @@ -831,7 +832,7 @@ int PlayMusicStream(int index, char *fileName) TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); musicChannels_g[index].loop = true; // We loop by default - musicEnabled_g = true; + musicChannels_g[index].enabled = true; musicChannels_g[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * info.channels; @@ -861,7 +862,7 @@ int PlayMusicStream(int index, char *fileName) jar_xm_set_max_loop_count(musicChannels_g[index].xmctx, 0); // infinite number of loops musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicChannels_g[index].xmctx); musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; - musicEnabled_g = true; + musicChannels_g[index].enabled = true; TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); @@ -888,7 +889,7 @@ int PlayMusicStream(int index, char *fileName) musicChannels_g[index].loop = true; musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicChannels_g[index].modctx); musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; - musicEnabled_g = true; + musicChannels_g[index].enabled = true; TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); @@ -921,15 +922,14 @@ void StopMusicStream(int index) { CloseMixChannel(musicChannels_g[index].mixc); - if (musicChannels_g[index].chipTune && musicChannels_g[index].xmctx) - { + if (musicChannels_g[index].xmctx) jar_xm_free_context(musicChannels_g[index].xmctx); - musicChannels_g[index].xmctx = 0; - } - else if (musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) jar_mod_unload(&musicChannels_g[index].modctx); - else stb_vorbis_close(musicChannels_g[index].stream); + else if (musicChannels_g[index].modctx.mod_loaded) + jar_mod_unload(&musicChannels_g[index].modctx); + else + stb_vorbis_close(musicChannels_g[index].stream); - if (!GetMusicStreamCount()) musicEnabled_g = false; + musicChannels_g[index].enabled = false; if (musicChannels_g[index].stream || musicChannels_g[index].xmctx) { @@ -957,7 +957,7 @@ int GetMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc && musicEnabled_g) + if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc && musicChannels_g[index].enabled) { TraceLog(INFO, "Pausing music stream"); alSourcePause(musicChannels_g[index].mixc->alSource); @@ -1154,7 +1154,7 @@ void UpdateMusicStream(int index) bool active = true; int numBuffers = IsMusicStreamReadyForBuffering(index); - if (musicChannels_g[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicEnabled_g && musicChannels_g[index].mixc && numBuffers) + if (musicChannels_g[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicChannels_g[index].enabled && musicChannels_g[index].mixc && numBuffers) { active = BufferMusicStream(index, numBuffers); @@ -1163,7 +1163,8 @@ void UpdateMusicStream(int index) if (musicChannels_g[index].chipTune) { if(musicChannels_g[index].modctx.mod_loaded) jar_mod_seek_start(&musicChannels_g[index].modctx); - musicChannels_g[index].totalSamplesLeft = musicChannels_g[index].totalLengthSeconds * 48000; + + musicChannels_g[index].totalSamplesLeft = musicChannels_g[index].totalLengthSeconds * 48000.f; } else { @@ -1171,7 +1172,7 @@ void UpdateMusicStream(int index) musicChannels_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; } - active = true; + active = BufferMusicStream(index, IsMusicStreamReadyForBuffering(index)); } if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h index 2ddc61d1..e0169d5e 100644 --- a/src/external/jar_mod.h +++ b/src/external/jar_mod.h @@ -1063,7 +1063,6 @@ bool jar_mod_init(jar_mod_context_t * modctx) modctx->stereo_separation = 1; modctx->bits = 16; modctx->filter = 1; - modctx->loopcount = 0; for(i=0; i < PERIOD_TABLE_LENGTH - 1; i++) { @@ -1472,7 +1471,7 @@ void jar_mod_fillbuffer( jar_mod_context_t * modctx, short * outbuffer, unsigned } //resets internals for mod context -static void jar_mod_reset( jar_mod_context_t * modctx) +static bool jar_mod_reset( jar_mod_context_t * modctx) { if(modctx) { @@ -1488,7 +1487,6 @@ static void jar_mod_reset( jar_mod_context_t * modctx) modctx->patterntickse = 0; modctx->patternticksaim = 0; modctx->sampleticksconst = 0; - modctx->loopcount = 0; modctx->samplenb = 0; memclear(modctx->channels, 0, sizeof(modctx->channels)); modctx->number_of_channels = 0; @@ -1496,8 +1494,9 @@ static void jar_mod_reset( jar_mod_context_t * modctx) modctx->last_r_sample = 0; modctx->last_l_sample = 0; - jar_mod_init(modctx); + return jar_mod_init(modctx); } + return 0; } void jar_mod_unload( jar_mod_context_t * modctx) @@ -1508,6 +1507,8 @@ void jar_mod_unload( jar_mod_context_t * modctx) { free(modctx->modfile); modctx->modfile = 0; + modctx->modfilesize = 0; + modctx->loopcount = 0; } jar_mod_reset(modctx); } @@ -1556,27 +1557,34 @@ mulong jar_mod_current_samples(jar_mod_context_t * modctx) // Works, however it is very slow, this data should be cached to ensure it is run only once per file mulong jar_mod_max_samples(jar_mod_context_t * ctx) { - jar_mod_context_t tmpctx; - jar_mod_init(&tmpctx); - if(!jar_mod_load(&tmpctx, (void*)ctx->modfile, ctx->modfilesize)) return 0; - muint buff[2]; - mulong lastcount = tmpctx.loopcount; + mulong len; + mulong lastcount = ctx->loopcount; - while(1){ - jar_mod_fillbuffer( &tmpctx, buff, 1, 0 ); - if(tmpctx.loopcount > lastcount) break; - } - return tmpctx.samplenb; + while(ctx->loopcount <= lastcount) + jar_mod_fillbuffer(ctx, buff, 1, 0); + + len = ctx->samplenb; + jar_mod_seek_start(ctx); + + return len; } // move seek_val to sample index, 0 -> jar_mod_max_samples is the range void jar_mod_seek_start(jar_mod_context_t * ctx) { - if(ctx) + if(ctx && ctx->modfile) { - jar_mod_reset(ctx); - jar_mod_load(ctx, ctx->modfile, ctx->modfilesize); + muchar* ftmp = ctx->modfile; + mulong stmp = ctx->modfilesize; + muint lcnt = ctx->loopcount; + + if(jar_mod_reset(ctx)){ + jar_mod_load(ctx, ftmp, stmp); + ctx->modfile = ftmp; + ctx->modfilesize = stmp; + ctx->loopcount = lcnt; + } } } -- cgit v1.2.3 From 70a96fff80d0fb42722788df268b0c8e77e97120 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 8 Jun 2016 13:16:01 +0200 Subject: Simplified Oculus integration --- src/core.c | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4ba7505b..4223afd9 100644 --- a/src/core.c +++ b/src/core.c @@ -513,11 +513,6 @@ void CloseWindow(void) } #endif -#if defined(PLATFORM_OCULUS) - ovr_Destroy(session); // Must be called after glfwTerminate() - ovr_Shutdown(); -#endif - TraceLog(INFO, "Window closed successfully"); } @@ -526,6 +521,7 @@ void CloseWindow(void) // NOTE: Device initialization should be done before window creation? void InitOculusDevice(void) { + // Initialize Oculus device ovrResult result = ovr_Initialize(NULL); if (OVR_FAILURE(result)) TraceLog(ERROR, "OVR: Could not initialize Oculus device"); @@ -545,13 +541,13 @@ void InitOculusDevice(void) TraceLog(INFO, "OVR: Serian Number: %s", hmdDesc.SerialNumber); TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - screenWidth = hmdDesc.Resolution.w/2; - screenHeight = hmdDesc.Resolution.h/2; + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... + // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) // Initialize Oculus Buffers layer = InitOculusLayer(session); buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); + mirror = LoadOculusMirror(session, screenWidth, screenHeight); layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); } @@ -561,8 +557,8 @@ void CloseOculusDevice(void) UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers - ovr_Destroy(session); // Must be called after glfwTerminate() --> REALLY??? - ovr_Shutdown(); + ovr_Destroy(session); // Free Oculus session data + ovr_Shutdown(); // Close Oculus device connection } // Update Oculus Rift tracking (position and orientation) @@ -1625,31 +1621,7 @@ static void InitDisplay(int width, int height) // Downscale matrix is required in case desired screen area is bigger than display area downscaleView = MatrixIdentity(); - -#if defined(PLATFORM_OCULUS) - ovrResult result = ovr_Initialize(NULL); - if (OVR_FAILURE(result)) TraceLog(ERROR, "OVR: Could not initialize Oculus device"); - - result = ovr_Create(&session, &luid); - if (OVR_FAILURE(result)) - { - TraceLog(WARNING, "OVR: Could not create Oculus session"); - ovr_Shutdown(); - } - hmdDesc = ovr_GetHmdDesc(session); - - TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); - TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); - TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); - TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - TraceLog(INFO, "OVR: Serian Number: %s", hmdDesc.SerialNumber); - TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - - screenWidth = hmdDesc.Resolution.w/2; - screenHeight = hmdDesc.Resolution.h/2; -#endif - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) glfwSetErrorCallback(ErrorCallback); @@ -1964,14 +1936,6 @@ static void InitGraphics(void) rlglInit(); // Init rlgl rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) -#if defined(PLATFORM_OCULUS) - // Initialize Oculus Buffers - layer = InitOculusLayer(session); - buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); - layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); -#endif - ClearBackground(RAYWHITE); // Default background color for raylib games :P #if defined(PLATFORM_ANDROID) -- cgit v1.2.3 From 8323f81ab598d9a9e6720e55eb7269e410f10d2e Mon Sep 17 00:00:00 2001 From: victorfisac Date: Wed, 8 Jun 2016 17:27:55 +0200 Subject: Add physac module to android compile instructions... ... and switch from debug build to release --- src/android/jni/Android.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk index 66851d08..819ca79d 100644 --- a/src/android/jni/Android.mk +++ b/src/android/jni/Android.mk @@ -47,6 +47,7 @@ LOCAL_SRC_FILES :=\ ../../utils.c \ ../../audio.c \ ../../external/stb_vorbis.c \ + ../../physac.c \ # Required includes paths (.h) LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/../.. -- cgit v1.2.3 From 99ee26b001c75e506f5f4e697b3e44c72899d699 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 8 Jun 2016 22:52:54 +0200 Subject: Review const char * --- src/rlgl.c | 4 ++-- src/standard_shader.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 72225634..c9944806 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -236,7 +236,7 @@ unsigned int whiteTexture; //---------------------------------------------------------------------------------- #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) static void LoadCompressedTexture(unsigned char *data, int width, int height, int mipmapCount, int compressedFormat); -static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr); // Load custom shader strings and return program id +static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShaderStr); // Load custom shader strings and return program id static Shader LoadDefaultShader(void); // Load default shader (just vertex positioning and texture coloring) static Shader LoadStandardShader(void); // Load standard shader (support materials and lighting) @@ -2403,7 +2403,7 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in } // Load custom shader strings and return program id -static unsigned int LoadShaderProgram(char *vShaderStr, char *fShaderStr) +static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShaderStr) { unsigned int program = 0; diff --git a/src/standard_shader.h b/src/standard_shader.h index 956b5c32..b2b8980c 100644 --- a/src/standard_shader.h +++ b/src/standard_shader.h @@ -1,6 +1,6 @@ // Vertex shader definition to embed, no external file required -const static unsigned char vStandardShaderStr[] = +static const char vStandardShaderStr[] = #if defined(GRAPHICS_API_OPENGL_21) "#version 120 \n" #elif defined(GRAPHICS_API_OPENGL_ES2) @@ -37,7 +37,7 @@ const static unsigned char vStandardShaderStr[] = "} \n"; // Fragment shader definition to embed, no external file required -const static unsigned char fStandardShaderStr[] = +static const char fStandardShaderStr[] = #if defined(GRAPHICS_API_OPENGL_21) "#version 120 \n" #elif defined(GRAPHICS_API_OPENGL_ES2) @@ -163,4 +163,4 @@ const static unsigned char fStandardShaderStr[] = #elif defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) " gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" #endif -"} \n"; \ No newline at end of file +"}\n"; -- cgit v1.2.3 From dcbfb83031fb4158699efa8127930fb6de967d11 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 9 Jun 2016 20:01:39 +0200 Subject: Updated comments... --- src/raygui.h | 91 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/raygui.h b/src/raygui.h index 32ad8e9b..f13b68cd 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1,8 +1,9 @@ /******************************************************************************************* * -* raygui v1.2 - IMGUI (Immedite Mode GUI) library for raylib (https://github.com/raysan5/raylib) +* raygui 1.0 - IMGUI (Immedite Mode GUI) library for raylib (https://github.com/raysan5/raylib) * -* raygui is a library for creating simple IMGUI interfaces. It provides a set of basic components: +* raygui is a library for creating simple IMGUI interfaces using raylib. +* It provides a set of basic components: * * - Label * - Button @@ -16,31 +17,51 @@ * - Spinner * - TextBox * -* It also provides a set of functions for styling the components based on a set of properties. -* -* USAGE: -* -* Include this file in any C/C++ file that requires it; in ONLY one of them, write: -* #define RAYGUI_IMPLEMENTATION -* before the #include of this file. This expands out the actual implementation into that file. -* +* It also provides a set of functions for styling the components based on its properties (size, color). +* * CONFIGURATION: * -* You can #define RAYGUI_STANDALONE to avoid raylib.h inclusion (not dependant on raylib functions and types). -* NOTE: Some external funtions are required for drawing and input management, check implementation code. +* #define RAYGUI_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. +* +* #define RAYGUI_STATIC (defined by default) +* The generated implementation will stay private inside implementation file and all +* internal symbols and functions will only be visible inside that file. +* +* #define RAYGUI_STANDALONE +* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined +* internally in the library and input management and drawing functions must be provided by +* the user (check library implementation for further details). * -* You can #define RAY_MALLOC() to replace malloc() and free() function by your own. +* #define RAYGUI_MALLOC() +* #define RAYGUI_FREE() +* You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions. +* Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. +* +* LIMITATIONS: * -* You can #define RAYGUI_STATIC to make the implementation private to the file that generates the implementation, +* // TODO. * -* VERSIONS AND CREDITS: +* VERSIONS: * -* 1.2 (07-Jun-2016) Converted to header-only by Ramon Santamaria -* 1.1 (07-Mar-2016) Reviewed and expanded by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. -* 1.0 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. +* 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. +* 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. +* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. +* +* CONTRIBUTORS: +* Ramon Santamaria: Functions design and naming conventions. +* Kevin Gato: Initial implementation of basic components. +* Daniel Nicolas: Initial implementation of basic components. +* Albert Martos: Review and testing of library. +* Ian Eito: Review and testing of the library. +* Sergio Martinez: Review and testing of the library. * * LICENSE: zlib/libpng * +* Copyright (c) 2015-2016 emegeme (@emegemegames) +* * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. * @@ -355,29 +376,27 @@ RAYGUIDEF int GetStyleProperty(int guiProperty); // Get #endif // RAYGUI_H -/********************************************************************************************************* +/*********************************************************************************** * -* RAYGUI IMPLEMENTATION +* RAYGUI IMPLEMENTATION * -**********************************************************************************************************/ +************************************************************************************/ #if defined(RAYGUI_IMPLEMENTATION) -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() - // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() +#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() + // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() -#include // Required for: malloc(), free() [Used only on LoadGuiStyle()] -#include // Required for: strcmp() [Used only on LoadGuiStyle()] -#include // Required for: va_list, va_start(), vfprintf(), va_end() - -/* -// NOTE: Example on how to define custom functions -#if !defined(RAY_MALLOC) - #include - #define RAY_MALLOC(size,c) malloc(size) - #define RAY_FREE(ptr,c) free(ptr) +// Check if custom malloc/free functions defined, if not, using standard ones +#if !defined(RAYGUI_MALLOC) + #include // Required for: malloc(), free() [Used only on LoadGuiStyle()] + + #define RAYGUI_MALLOC(size) malloc(size) + #define RAYGUI_FREE(ptr) free(ptr) #endif -*/ + +#include // Required for: strcmp() [Used only on LoadGuiStyle()] +#include // Required for: va_list, va_start(), vfprintf(), va_end() //---------------------------------------------------------------------------------- // Defines and Macros @@ -1272,7 +1291,7 @@ RAYGUIDEF void LoadGuiStyle(const char *fileName) int value; } StyleProperty; - StyleProperty *styleProp = (StyleProperty *)malloc(MAX_STYLE_PROPERTIES*sizeof(StyleProperty));; + StyleProperty *styleProp = (StyleProperty *)RAYGUI_MALLOC(MAX_STYLE_PROPERTIES*sizeof(StyleProperty));; int counter = 0; FILE *styleFile = fopen(fileName, "rt"); @@ -1297,7 +1316,7 @@ RAYGUIDEF void LoadGuiStyle(const char *fileName) } } - free(styleProp); + RAYGUI_FREE(styleProp); } // Set one style property value -- cgit v1.2.3 From 558ec3891bc620d1481557ae291a9524e588b31e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 9 Jun 2016 20:01:59 +0200 Subject: Converted physac module to header only --- src/physac.c | 594 --------------------------------------------------- src/physac.h | 684 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 667 insertions(+), 611 deletions(-) delete mode 100644 src/physac.c (limited to 'src') diff --git a/src/physac.c b/src/physac.c deleted file mode 100644 index 1d577d3d..00000000 --- a/src/physac.c +++ /dev/null @@ -1,594 +0,0 @@ -/********************************************************************************************** -* -* [physac] raylib physics module - Basic functions to apply physics to 2D objects -* -* Copyright (c) 2016 Victor Fisac and Ramon Santamaria -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -//#define PHYSAC_STANDALONE // NOTE: To use the physics module as standalone lib, just uncomment this line - -#if defined(PHYSAC_STANDALONE) - #include "physac.h" -#else - #include "raylib.h" -#endif - -#include // Required for: malloc(), free() -#include // Required for: cos(), sin(), abs(), fminf() - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define MAX_PHYSIC_OBJECTS 256 // Maximum available physic object slots in objects pool -#define PHYSICS_STEPS 450 // Physics update steps number (divided calculations in steps per frame) to get more accurately collisions detections -#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) -#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -// NOTE: Below types are required for PHYSAC_STANDALONE usage -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -static PhysicObject physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool -static int physicObjectsCount; // Counts current enabled physic objects -static Vector2 gravityForce; // Gravity force - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 -static float Vector2Length(Vector2 v); // Returns the length of a Vector2 - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- - -// Initializes pointers array (just pointers, fixed size) -void InitPhysics(Vector2 gravity) -{ - // Initialize physics variables - physicObjectsCount = 0; - gravityForce = gravity; -} - -// Update physic objects, calculating physic behaviours and collisions detection -void UpdatePhysics() -{ - // Reset all physic objects is grounded state - for (int i = 0; i < physicObjectsCount; i++) physicObjects[i]->rigidbody.isGrounded = false; - - for (int steps = 0; steps < PHYSICS_STEPS; steps++) - { - for (int i = 0; i < physicObjectsCount; i++) - { - if (physicObjects[i]->enabled) - { - // Update physic behaviour - if (physicObjects[i]->rigidbody.enabled) - { - // Apply friction to acceleration in X axis - if (physicObjects[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicObjects[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else physicObjects[i]->rigidbody.acceleration.x = 0.0f; - - // Apply friction to acceleration in Y axis - if (physicObjects[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.y -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicObjects[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.acceleration.y += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else physicObjects[i]->rigidbody.acceleration.y = 0.0f; - - // Apply friction to velocity in X axis - if (physicObjects[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicObjects[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else physicObjects[i]->rigidbody.velocity.x = 0.0f; - - // Apply friction to velocity in Y axis - if (physicObjects[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.y -= physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicObjects[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicObjects[i]->rigidbody.velocity.y += physicObjects[i]->rigidbody.friction/PHYSICS_STEPS; - else physicObjects[i]->rigidbody.velocity.y = 0.0f; - - // Apply gravity to velocity - if (physicObjects[i]->rigidbody.applyGravity) - { - physicObjects[i]->rigidbody.velocity.x += gravityForce.x/PHYSICS_STEPS; - physicObjects[i]->rigidbody.velocity.y += gravityForce.y/PHYSICS_STEPS; - } - - // Apply acceleration to velocity - physicObjects[i]->rigidbody.velocity.x += physicObjects[i]->rigidbody.acceleration.x/PHYSICS_STEPS; - physicObjects[i]->rigidbody.velocity.y += physicObjects[i]->rigidbody.acceleration.y/PHYSICS_STEPS; - - // Apply velocity to position - physicObjects[i]->transform.position.x += physicObjects[i]->rigidbody.velocity.x/PHYSICS_STEPS; - physicObjects[i]->transform.position.y -= physicObjects[i]->rigidbody.velocity.y/PHYSICS_STEPS; - } - - // Update collision detection - if (physicObjects[i]->collider.enabled) - { - // Update collider bounds - physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); - - // Check collision with other colliders - for (int k = 0; k < physicObjectsCount; k++) - { - if (physicObjects[k]->collider.enabled && i != k) - { - // Resolve physic collision - // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) - // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) - - // 1. Calculate collision normal - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Define collision contact normal, direction and penetration depth - Vector2 contactNormal = { 0.0f, 0.0f }; - Vector2 direction = { 0.0f, 0.0f }; - float penetrationDepth = 0.0f; - - switch (physicObjects[i]->collider.type) - { - case COLLIDER_RECTANGLE: - { - switch (physicObjects[k]->collider.type) - { - case COLLIDER_RECTANGLE: - { - // Check if colliders are overlapped - if (CheckCollisionRecs(physicObjects[i]->collider.bounds, physicObjects[k]->collider.bounds)) - { - // Calculate direction vector from i to k - direction.x = (physicObjects[k]->transform.position.x + physicObjects[k]->transform.scale.x/2) - (physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2); - direction.y = (physicObjects[k]->transform.position.y + physicObjects[k]->transform.scale.y/2) - (physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2); - - // Define overlapping and penetration attributes - Vector2 overlap; - - // Calculate overlap on X axis - overlap.x = (physicObjects[i]->transform.scale.x + physicObjects[k]->transform.scale.x)/2 - abs(direction.x); - - // SAT test on X axis - if (overlap.x > 0.0f) - { - // Calculate overlap on Y axis - overlap.y = (physicObjects[i]->transform.scale.y + physicObjects[k]->transform.scale.y)/2 - abs(direction.y); - - // SAT test on Y axis - if (overlap.y > 0.0f) - { - // Find out which axis is axis of least penetration - if (overlap.y > overlap.x) - { - // Point towards k knowing that direction points from i to k - if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; - else contactNormal = (Vector2){ 1.0f, 0.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.x; - } - else - { - // Point towards k knowing that direction points from i to k - if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; - else contactNormal = (Vector2){ 0.0f, -1.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.y; - } - } - } - } - } break; - case COLLIDER_CIRCLE: - { - if (CheckCollisionCircleRec(physicObjects[k]->transform.position, physicObjects[k]->collider.radius, physicObjects[i]->collider.bounds)) - { - // Calculate direction vector between circles - direction.x = physicObjects[k]->transform.position.x - physicObjects[i]->transform.position.x + physicObjects[i]->transform.scale.x/2; - direction.y = physicObjects[k]->transform.position.y - physicObjects[i]->transform.position.y + physicObjects[i]->transform.scale.y/2; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicObjects[i]->collider.bounds.x + physicObjects[i]->collider.bounds.width; - else closestPoint.x = physicObjects[i]->collider.bounds.x; - - if (direction.y > 0.0f) closestPoint.y = physicObjects[i]->collider.bounds.y + physicObjects[i]->collider.bounds.height; - else closestPoint.y = physicObjects[i]->collider.bounds.y; - - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicObjects[k]->transform.position, physicObjects[k]->collider.radius)) - { - // Recalculate direction based on closest point position - direction.x = physicObjects[k]->transform.position.x - closestPoint.x; - direction.y = physicObjects[k]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicObjects[k]->collider.radius - distance; - } - else - { - if (abs(direction.y) < abs(direction.x)) - { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicObjects[i]->collider.bounds.y - physicObjects[k]->transform.position.y - physicObjects[k]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicObjects[i]->collider.bounds.y - physicObjects[k]->transform.position.y + physicObjects[k]->collider.radius); - } - } - else - { - // Calculate final contact normal - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicObjects[k]->transform.position.x + physicObjects[k]->collider.radius - physicObjects[i]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicObjects[i]->collider.bounds.x + physicObjects[i]->collider.bounds.width - physicObjects[k]->transform.position.x - physicObjects[k]->collider.radius); - } - } - } - } - } break; - } - } break; - case COLLIDER_CIRCLE: - { - switch (physicObjects[k]->collider.type) - { - case COLLIDER_RECTANGLE: - { - if (CheckCollisionCircleRec(physicObjects[i]->transform.position, physicObjects[i]->collider.radius, physicObjects[k]->collider.bounds)) - { - // Calculate direction vector between circles - direction.x = physicObjects[k]->transform.position.x + physicObjects[i]->transform.scale.x/2 - physicObjects[i]->transform.position.x; - direction.y = physicObjects[k]->transform.position.y + physicObjects[i]->transform.scale.y/2 - physicObjects[i]->transform.position.y; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicObjects[k]->collider.bounds.x + physicObjects[k]->collider.bounds.width; - else closestPoint.x = physicObjects[k]->collider.bounds.x; - - if (direction.y > 0.0f) closestPoint.y = physicObjects[k]->collider.bounds.y + physicObjects[k]->collider.bounds.height; - else closestPoint.y = physicObjects[k]->collider.bounds.y; - - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicObjects[i]->transform.position, physicObjects[i]->collider.radius)) - { - // Recalculate direction based on closest point position - direction.x = physicObjects[i]->transform.position.x - closestPoint.x; - direction.y = physicObjects[i]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicObjects[k]->collider.radius - distance; - } - else - { - if (abs(direction.y) < abs(direction.x)) - { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicObjects[k]->collider.bounds.y - physicObjects[i]->transform.position.y - physicObjects[i]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicObjects[k]->collider.bounds.y - physicObjects[i]->transform.position.y + physicObjects[i]->collider.radius); - } - } - else - { - // Calculate final contact normal and penetration depth - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicObjects[i]->transform.position.x + physicObjects[i]->collider.radius - physicObjects[k]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicObjects[k]->collider.bounds.x + physicObjects[k]->collider.bounds.width - physicObjects[i]->transform.position.x - physicObjects[i]->collider.radius); - } - } - } - } - } break; - case COLLIDER_CIRCLE: - { - // Check if colliders are overlapped - if (CheckCollisionCircles(physicObjects[i]->transform.position, physicObjects[i]->collider.radius, physicObjects[k]->transform.position, physicObjects[k]->collider.radius)) - { - // Calculate direction vector between circles - direction.x = physicObjects[k]->transform.position.x - physicObjects[i]->transform.position.x; - direction.y = physicObjects[k]->transform.position.y - physicObjects[i]->transform.position.y; - - // Calculate distance between circles - float distance = Vector2Length(direction); - - // Check if circles are not completely overlapped - if (distance != 0.0f) - { - // Calculate contact normal direction (Y axis needs to be flipped) - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - } - else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values - } - } break; - default: break; - } - } break; - default: break; - } - - // Update rigidbody grounded state - if (physicObjects[i]->rigidbody.enabled) - { - if (contactNormal.y < 0.0f) physicObjects[i]->rigidbody.isGrounded = true; - } - - // 2. Calculate collision impulse - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Calculate relative velocity - Vector2 relVelocity = { 0.0f, 0.0f }; - relVelocity.x = physicObjects[k]->rigidbody.velocity.x - physicObjects[i]->rigidbody.velocity.x; - relVelocity.y = physicObjects[k]->rigidbody.velocity.y - physicObjects[i]->rigidbody.velocity.y; - - // Calculate relative velocity in terms of the normal direction - float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); - - // Dot not resolve if velocities are separating - if (velAlongNormal <= 0.0f) - { - // Calculate minimum bounciness value from both objects - float e = fminf(physicObjects[i]->rigidbody.bounciness, physicObjects[k]->rigidbody.bounciness); - - // Calculate impulse scalar value - float j = -(1.0f + e)*velAlongNormal; - j /= 1.0f/physicObjects[i]->rigidbody.mass + 1.0f/physicObjects[k]->rigidbody.mass; - - // Calculate final impulse vector - Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; - - // Calculate collision mass ration - float massSum = physicObjects[i]->rigidbody.mass + physicObjects[k]->rigidbody.mass; - float ratio = 0.0f; - - // Apply impulse to current rigidbodies velocities if they are enabled - if (physicObjects[i]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicObjects[i]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicObjects[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); - physicObjects[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); - } - - if (physicObjects[k]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicObjects[k]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicObjects[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); - physicObjects[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicObjects[i]->rigidbody.bounciness); - } - - // 3. Correct colliders overlaping (transform position) - // --------------------------------------------------------------------------------------------------------------------------------- - - // Calculate transform position penetration correction - Vector2 posCorrection; - posCorrection.x = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; - posCorrection.y = penetrationDepth/((1.0f/physicObjects[i]->rigidbody.mass) + (1.0f/physicObjects[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; - - // Fix transform positions - if (physicObjects[i]->rigidbody.enabled) - { - // Fix physic objects transform position - physicObjects[i]->transform.position.x -= 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.x; - physicObjects[i]->transform.position.y += 1.0f/physicObjects[i]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicObjects[i]->collider.bounds = TransformToRectangle(physicObjects[i]->transform); - - if (physicObjects[k]->rigidbody.enabled) - { - // Fix physic objects transform position - physicObjects[k]->transform.position.x += 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.x; - physicObjects[k]->transform.position.y -= 1.0f/physicObjects[k]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicObjects[k]->collider.bounds = TransformToRectangle(physicObjects[k]->transform); - } - } - } - } - } - } - } - } - } -} - -// Unitialize all physic objects and empty the objects pool -void ClosePhysics() -{ - // Free all dynamic memory allocations - for (int i = 0; i < physicObjectsCount; i++) free(physicObjects[i]); - - // Reset enabled physic objects count - physicObjectsCount = 0; -} - -// Create a new physic object dinamically, initialize it and add to pool -PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale) -{ - // Allocate dynamic memory - PhysicObject obj = (PhysicObject)malloc(sizeof(PhysicObjectData)); - - // Initialize physic object values with generic values - obj->id = physicObjectsCount; - obj->enabled = true; - - obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; - - obj->rigidbody.enabled = false; - obj->rigidbody.mass = 1.0f; - obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.applyGravity = false; - obj->rigidbody.isGrounded = false; - obj->rigidbody.friction = 0.0f; - obj->rigidbody.bounciness = 0.0f; - - obj->collider.enabled = true; - obj->collider.type = COLLIDER_RECTANGLE; - obj->collider.bounds = TransformToRectangle(obj->transform); - obj->collider.radius = 0.0f; - - // Add new physic object to the pointers array - physicObjects[physicObjectsCount] = obj; - - // Increase enabled physic objects count - physicObjectsCount++; - - return obj; -} - -// Destroy a specific physic object and take it out of the list -void DestroyPhysicObject(PhysicObject pObj) -{ - // Free dynamic memory allocation - free(physicObjects[pObj->id]); - - // Remove *obj from the pointers array - for (int i = pObj->id; i < physicObjectsCount; i++) - { - // Resort all the following pointers of the array - if ((i + 1) < physicObjectsCount) - { - physicObjects[i] = physicObjects[i + 1]; - physicObjects[i]->id = physicObjects[i + 1]->id; - } - else free(physicObjects[i]); - } - - // Decrease enabled physic objects count - physicObjectsCount--; -} - -// Apply directional force to a physic object -void ApplyForce(PhysicObject pObj, Vector2 force) -{ - if (pObj->rigidbody.enabled) - { - pObj->rigidbody.velocity.x += force.x/pObj->rigidbody.mass; - pObj->rigidbody.velocity.y += force.y/pObj->rigidbody.mass; - } -} - -// Apply radial force to all physic objects in range -void ApplyForceAtPosition(Vector2 position, float force, float radius) -{ - for (int i = 0; i < physicObjectsCount; i++) - { - if (physicObjects[i]->rigidbody.enabled) - { - // Calculate direction and distance between force and physic object pposition - Vector2 distance = (Vector2){ physicObjects[i]->transform.position.x - position.x, physicObjects[i]->transform.position.y - position.y }; - - if (physicObjects[i]->collider.type == COLLIDER_RECTANGLE) - { - distance.x += physicObjects[i]->transform.scale.x/2; - distance.y += physicObjects[i]->transform.scale.y/2; - } - - float distanceLength = Vector2Length(distance); - - // Check if physic object is in force range - if (distanceLength <= radius) - { - // Normalize force direction - distance.x /= distanceLength; - distance.y /= -distanceLength; - - // Calculate final force - Vector2 finalForce = { distance.x*force, distance.y*force }; - - // Apply force to the physic object - ApplyForce(physicObjects[i], finalForce); - } - } - } -} - -// Convert Transform data type to Rectangle (position and scale) -Rectangle TransformToRectangle(Transform transform) -{ - return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -// Returns the dot product of two Vector2 -static float Vector2DotProduct(Vector2 v1, Vector2 v2) -{ - float result; - - result = v1.x*v2.x + v1.y*v2.y; - - return result; -} - -static float Vector2Length(Vector2 v) -{ - float result; - - result = sqrt(v.x*v.x + v.y*v.y); - - return result; -} diff --git a/src/physac.h b/src/physac.h index b2ae2766..c8466a12 100644 --- a/src/physac.h +++ b/src/physac.h @@ -1,8 +1,45 @@ /********************************************************************************************** * -* [physac] raylib physics module - Basic functions to apply physics to 2D objects +* physac 1.0 - 2D Physics library for raylib (https://github.com/raysan5/raylib) * -* Copyright (c) 2016 Victor Fisac and Ramon Santamaria +* // TODO: Description... +* +* CONFIGURATION: +* +* #define PHYSAC_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. +* +* #define PHYSAC_STATIC (defined by default) +* The generated implementation will stay private inside implementation file and all +* internal symbols and functions will only be visible inside that file. +* +* #define PHYSAC_STANDALONE +* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined +* internally in the library and input management and drawing functions must be provided by +* the user (check library implementation for further details). +* +* #define PHYSAC_MALLOC() +* #define PHYSAC_FREE() +* You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions. +* Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. +* +* LIMITATIONS: +* +* // TODO. +* +* VERSIONS: +* +* 1.0 (09-Jun-2016) Module names review and converted to header-only. +* 0.9 (23-Mar-2016) Complete module redesign, steps-based for better physics resolution. +* 0.3 (13-Feb-2016) Reviewed to add PhysicObjects pool. +* 0.2 (03-Jan-2016) Improved physics calculations. +* 0.1 (30-Dec-2015) Initial release. +* +* LICENSE: zlib/libpng +* +* Copyright (c) 2016 Victor Fisac (main developer) and Ramon Santamaria * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -24,6 +61,21 @@ #ifndef PHYSAC_H #define PHYSAC_H +#if !defined(RAYGUI_STANDALONE) + #include "raylib.h" +#endif + +#define PHYSAC_STATIC +#ifdef PHYSAC_STATIC + #define PHYSACDEF static // Functions just visible to module including this file +#else + #ifdef __cplusplus + #define PHYSACDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) + #else + #define PHYSACDEF extern // Functions visible from other files + #endif +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -33,12 +85,28 @@ // Types and Structures Definition // NOTE: Below types are required for PHYSAC_STANDALONE usage //---------------------------------------------------------------------------------- +#if defined(PHYSAC_STANDALONE) + #ifndef __cplusplus + // Boolean type + #ifndef true + typedef enum { false, true } bool; + #endif + #endif -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; + // Vector2 type + typedef struct Vector2 { + float x; + float y; + } Vector2; + + // Rectangle type + typedef struct Rectangle { + int x; + int y; + int width; + int height; + } Rectangle; +#endif typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; @@ -66,13 +134,13 @@ typedef struct Collider { int radius; // Used for COLLIDER_CIRCLE } Collider; -typedef struct PhysicObjectData { +typedef struct PhysicBodyData { unsigned int id; Transform transform; Rigidbody rigidbody; Collider collider; bool enabled; -} PhysicObjectData, *PhysicObject; +} PhysicBodyData, *PhysicBody; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -81,20 +149,602 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) -void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection -void ClosePhysics(); // Unitialize all physic objects and empty the objects pool +PHYSACDEF void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) +PHYSACDEF void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection +PHYSACDEF void ClosePhysics(); // Unitialize all physic objects and empty the objects pool -PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool -void DestroyPhysicObject(PhysicObject pObj); // Destroy a specific physic object and take it out of the list +PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale); // Create a new physic body dinamically, initialize it and add to pool +PHYSACDEF void DestroyPhysicBody(PhysicBody pbody); // Destroy a specific physic body and take it out of the list -void ApplyForce(PhysicObject pObj, Vector2 force); // Apply directional force to a physic object -void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range +PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force); // Apply directional force to a physic body +PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range -Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) +PHYSACDEF Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) #ifdef __cplusplus } #endif #endif // PHYSAC_H + + +/*********************************************************************************** +* +* PHYSAC IMPLEMENTATION +* +************************************************************************************/ + +#if defined(PHYSAC_IMPLEMENTATION) + +// Check if custom malloc/free functions defined, if not, using standard ones +#if !defined(PHYSAC_MALLOC) + #include // Required for: malloc(), free() + + #define PHYSAC_MALLOC(size) malloc(size) + #define PHYSAC_FREE(ptr) free(ptr) +#endif + +#include // Required for: cos(), sin(), abs(), fminf() + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +#define MAX_PHYSIC_BODIES 256 // Maximum available physic bodies slots in bodies pool +#define PHYSICS_STEPS 450 // Physics update steps number (divided calculations in steps per frame) to get more accurately collisions detections +#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) +#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +// NOTE: Below types are required for PHYSAC_STANDALONE usage +//---------------------------------------------------------------------------------- +// ... + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +static PhysicBody physicBodies[MAX_PHYSIC_BODIES]; // Physic bodies pool +static int physicBodiesCount; // Counts current enabled physic bodies +static Vector2 gravityForce; // Gravity force + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 +static float Vector2Length(Vector2 v); // Returns the length of a Vector2 + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Initializes pointers array (just pointers, fixed size) +PHYSACDEF void InitPhysics(Vector2 gravity) +{ + // Initialize physics variables + physicBodiesCount = 0; + gravityForce = gravity; +} + +// Update physic objects, calculating physic behaviours and collisions detection +PHYSACDEF void UpdatePhysics() +{ + // Reset all physic objects is grounded state + for (int i = 0; i < physicBodiesCount; i++) physicBodies[i]->rigidbody.isGrounded = false; + + for (int steps = 0; steps < PHYSICS_STEPS; steps++) + { + for (int i = 0; i < physicBodiesCount; i++) + { + if (physicBodies[i]->enabled) + { + // Update physic behaviour + if (physicBodies[i]->rigidbody.enabled) + { + // Apply friction to acceleration in X axis + if (physicBodies[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicBodies[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else physicBodies[i]->rigidbody.acceleration.x = 0.0f; + + // Apply friction to acceleration in Y axis + if (physicBodies[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicBodies[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else physicBodies[i]->rigidbody.acceleration.y = 0.0f; + + // Apply friction to velocity in X axis + if (physicBodies[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicBodies[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else physicBodies[i]->rigidbody.velocity.x = 0.0f; + + // Apply friction to velocity in Y axis + if (physicBodies[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else if (physicBodies[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; + else physicBodies[i]->rigidbody.velocity.y = 0.0f; + + // Apply gravity to velocity + if (physicBodies[i]->rigidbody.applyGravity) + { + physicBodies[i]->rigidbody.velocity.x += gravityForce.x/PHYSICS_STEPS; + physicBodies[i]->rigidbody.velocity.y += gravityForce.y/PHYSICS_STEPS; + } + + // Apply acceleration to velocity + physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.acceleration.x/PHYSICS_STEPS; + physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.acceleration.y/PHYSICS_STEPS; + + // Apply velocity to position + physicBodies[i]->transform.position.x += physicBodies[i]->rigidbody.velocity.x/PHYSICS_STEPS; + physicBodies[i]->transform.position.y -= physicBodies[i]->rigidbody.velocity.y/PHYSICS_STEPS; + } + + // Update collision detection + if (physicBodies[i]->collider.enabled) + { + // Update collider bounds + physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); + + // Check collision with other colliders + for (int k = 0; k < physicBodiesCount; k++) + { + if (physicBodies[k]->collider.enabled && i != k) + { + // Resolve physic collision + // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) + // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) + + // 1. Calculate collision normal + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Define collision contact normal, direction and penetration depth + Vector2 contactNormal = { 0.0f, 0.0f }; + Vector2 direction = { 0.0f, 0.0f }; + float penetrationDepth = 0.0f; + + switch (physicBodies[i]->collider.type) + { + case COLLIDER_RECTANGLE: + { + switch (physicBodies[k]->collider.type) + { + case COLLIDER_RECTANGLE: + { + // Check if colliders are overlapped + if (CheckCollisionRecs(physicBodies[i]->collider.bounds, physicBodies[k]->collider.bounds)) + { + // Calculate direction vector from i to k + direction.x = (physicBodies[k]->transform.position.x + physicBodies[k]->transform.scale.x/2) - (physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2); + direction.y = (physicBodies[k]->transform.position.y + physicBodies[k]->transform.scale.y/2) - (physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2); + + // Define overlapping and penetration attributes + Vector2 overlap; + + // Calculate overlap on X axis + overlap.x = (physicBodies[i]->transform.scale.x + physicBodies[k]->transform.scale.x)/2 - abs(direction.x); + + // SAT test on X axis + if (overlap.x > 0.0f) + { + // Calculate overlap on Y axis + overlap.y = (physicBodies[i]->transform.scale.y + physicBodies[k]->transform.scale.y)/2 - abs(direction.y); + + // SAT test on Y axis + if (overlap.y > 0.0f) + { + // Find out which axis is axis of least penetration + if (overlap.y > overlap.x) + { + // Point towards k knowing that direction points from i to k + if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; + else contactNormal = (Vector2){ 1.0f, 0.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.x; + } + else + { + // Point towards k knowing that direction points from i to k + if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; + else contactNormal = (Vector2){ 0.0f, -1.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.y; + } + } + } + } + } break; + case COLLIDER_CIRCLE: + { + if (CheckCollisionCircleRec(physicBodies[k]->transform.position, physicBodies[k]->collider.radius, physicBodies[i]->collider.bounds)) + { + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2; + direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width; + else closestPoint.x = physicBodies[i]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicBodies[i]->collider.bounds.y + physicBodies[i]->collider.bounds.height; + else closestPoint.y = physicBodies[i]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) + { + // Recalculate direction based on closest point position + direction.x = physicBodies[k]->transform.position.x - closestPoint.x; + direction.y = physicBodies[k]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); + + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + + // Calculate penetration depth + penetrationDepth = physicBodies[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) + { + // Calculate final contact normal + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y - physicBodies[k]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y + physicBodies[k]->collider.radius); + } + } + else + { + // Calculate final contact normal + if (direction.x > 0.0f) + { + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[k]->transform.position.x + physicBodies[k]->collider.radius - physicBodies[i]->collider.bounds.x); + } + else + { + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width - physicBodies[k]->transform.position.x - physicBodies[k]->collider.radius); + } + } + } + } + } break; + } + } break; + case COLLIDER_CIRCLE: + { + switch (physicBodies[k]->collider.type) + { + case COLLIDER_RECTANGLE: + { + if (CheckCollisionCircleRec(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->collider.bounds)) + { + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x + physicBodies[i]->transform.scale.x/2 - physicBodies[i]->transform.position.x; + direction.y = physicBodies[k]->transform.position.y + physicBodies[i]->transform.scale.y/2 - physicBodies[i]->transform.position.y; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width; + else closestPoint.x = physicBodies[k]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicBodies[k]->collider.bounds.y + physicBodies[k]->collider.bounds.height; + else closestPoint.y = physicBodies[k]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicBodies[i]->transform.position, physicBodies[i]->collider.radius)) + { + // Recalculate direction based on closest point position + direction.x = physicBodies[i]->transform.position.x - closestPoint.x; + direction.y = physicBodies[i]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); + + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + + // Calculate penetration depth + penetrationDepth = physicBodies[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) + { + // Calculate final contact normal + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y - physicBodies[i]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y + physicBodies[i]->collider.radius); + } + } + else + { + // Calculate final contact normal and penetration depth + if (direction.x > 0.0f) + { + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[i]->transform.position.x + physicBodies[i]->collider.radius - physicBodies[k]->collider.bounds.x); + } + else + { + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width - physicBodies[i]->transform.position.x - physicBodies[i]->collider.radius); + } + } + } + } + } break; + case COLLIDER_CIRCLE: + { + // Check if colliders are overlapped + if (CheckCollisionCircles(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) + { + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x; + direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y; + + // Calculate distance between circles + float distance = Vector2Length(direction); + + // Check if circles are not completely overlapped + if (distance != 0.0f) + { + // Calculate contact normal direction (Y axis needs to be flipped) + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; + } + else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values + } + } break; + default: break; + } + } break; + default: break; + } + + // Update rigidbody grounded state + if (physicBodies[i]->rigidbody.enabled) + { + if (contactNormal.y < 0.0f) physicBodies[i]->rigidbody.isGrounded = true; + } + + // 2. Calculate collision impulse + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Calculate relative velocity + Vector2 relVelocity = { 0.0f, 0.0f }; + relVelocity.x = physicBodies[k]->rigidbody.velocity.x - physicBodies[i]->rigidbody.velocity.x; + relVelocity.y = physicBodies[k]->rigidbody.velocity.y - physicBodies[i]->rigidbody.velocity.y; + + // Calculate relative velocity in terms of the normal direction + float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); + + // Dot not resolve if velocities are separating + if (velAlongNormal <= 0.0f) + { + // Calculate minimum bounciness value from both objects + float e = fminf(physicBodies[i]->rigidbody.bounciness, physicBodies[k]->rigidbody.bounciness); + + // Calculate impulse scalar value + float j = -(1.0f + e)*velAlongNormal; + j /= 1.0f/physicBodies[i]->rigidbody.mass + 1.0f/physicBodies[k]->rigidbody.mass; + + // Calculate final impulse vector + Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; + + // Calculate collision mass ration + float massSum = physicBodies[i]->rigidbody.mass + physicBodies[k]->rigidbody.mass; + float ratio = 0.0f; + + // Apply impulse to current rigidbodies velocities if they are enabled + if (physicBodies[i]->rigidbody.enabled) + { + // Calculate inverted mass ration + ratio = physicBodies[i]->rigidbody.mass/massSum; + + // Apply impulse direction to velocity + physicBodies[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + physicBodies[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + } + + if (physicBodies[k]->rigidbody.enabled) + { + // Calculate inverted mass ration + ratio = physicBodies[k]->rigidbody.mass/massSum; + + // Apply impulse direction to velocity + physicBodies[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + physicBodies[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + } + + // 3. Correct colliders overlaping (transform position) + // --------------------------------------------------------------------------------------------------------------------------------- + + // Calculate transform position penetration correction + Vector2 posCorrection; + posCorrection.x = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; + posCorrection.y = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; + + // Fix transform positions + if (physicBodies[i]->rigidbody.enabled) + { + // Fix physic objects transform position + physicBodies[i]->transform.position.x -= 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.x; + physicBodies[i]->transform.position.y += 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.y; + + // Update collider bounds + physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); + + if (physicBodies[k]->rigidbody.enabled) + { + // Fix physic objects transform position + physicBodies[k]->transform.position.x += 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.x; + physicBodies[k]->transform.position.y -= 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.y; + + // Update collider bounds + physicBodies[k]->collider.bounds = TransformToRectangle(physicBodies[k]->transform); + } + } + } + } + } + } + } + } + } +} + +// Unitialize all physic objects and empty the objects pool +PHYSACDEF void ClosePhysics() +{ + // Free all dynamic memory allocations + for (int i = 0; i < physicBodiesCount; i++) PHYSAC_FREE(physicBodies[i]); + + // Reset enabled physic objects count + physicBodiesCount = 0; +} + +// Create a new physic body dinamically, initialize it and add to pool +PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale) +{ + // Allocate dynamic memory + PhysicBody obj = (PhysicBody)PHYSAC_MALLOC(sizeof(PhysicBodyData)); + + // Initialize physic body values with generic values + obj->id = physicBodiesCount; + obj->enabled = true; + + obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; + + obj->rigidbody.enabled = false; + obj->rigidbody.mass = 1.0f; + obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.applyGravity = false; + obj->rigidbody.isGrounded = false; + obj->rigidbody.friction = 0.0f; + obj->rigidbody.bounciness = 0.0f; + + obj->collider.enabled = true; + obj->collider.type = COLLIDER_RECTANGLE; + obj->collider.bounds = TransformToRectangle(obj->transform); + obj->collider.radius = 0.0f; + + // Add new physic body to the pointers array + physicBodies[physicBodiesCount] = obj; + + // Increase enabled physic bodies count + physicBodiesCount++; + + return obj; +} + +// Destroy a specific physic body and take it out of the list +PHYSACDEF void DestroyPhysicBody(PhysicBody pbody) +{ + // Free dynamic memory allocation + PHYSAC_FREE(physicBodies[pbody->id]); + + // Remove *obj from the pointers array + for (int i = pbody->id; i < physicBodiesCount; i++) + { + // Resort all the following pointers of the array + if ((i + 1) < physicBodiesCount) + { + physicBodies[i] = physicBodies[i + 1]; + physicBodies[i]->id = physicBodies[i + 1]->id; + } + else PHYSAC_FREE(physicBodies[i]); + } + + // Decrease enabled physic bodies count + physicBodiesCount--; +} + +// Apply directional force to a physic body +PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force) +{ + if (pbody->rigidbody.enabled) + { + pbody->rigidbody.velocity.x += force.x/pbody->rigidbody.mass; + pbody->rigidbody.velocity.y += force.y/pbody->rigidbody.mass; + } +} + +// Apply radial force to all physic objects in range +PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius) +{ + for (int i = 0; i < physicBodiesCount; i++) + { + if (physicBodies[i]->rigidbody.enabled) + { + // Calculate direction and distance between force and physic body position + Vector2 distance = (Vector2){ physicBodies[i]->transform.position.x - position.x, physicBodies[i]->transform.position.y - position.y }; + + if (physicBodies[i]->collider.type == COLLIDER_RECTANGLE) + { + distance.x += physicBodies[i]->transform.scale.x/2; + distance.y += physicBodies[i]->transform.scale.y/2; + } + + float distanceLength = Vector2Length(distance); + + // Check if physic body is in force range + if (distanceLength <= radius) + { + // Normalize force direction + distance.x /= distanceLength; + distance.y /= -distanceLength; + + // Calculate final force + Vector2 finalForce = { distance.x*force, distance.y*force }; + + // Apply force to the physic body + ApplyForce(physicBodies[i], finalForce); + } + } + } +} + +// Convert Transform data type to Rectangle (position and scale) +PHYSACDEF Rectangle TransformToRectangle(Transform transform) +{ + return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Returns the dot product of two Vector2 +static float Vector2DotProduct(Vector2 v1, Vector2 v2) +{ + float result; + + result = v1.x*v2.x + v1.y*v2.y; + + return result; +} + +static float Vector2Length(Vector2 v) +{ + float result; + + result = sqrt(v.x*v.x + v.y*v.y); + + return result; +} + +#endif // PHYSAC_IMPLEMENTATION \ No newline at end of file -- cgit v1.2.3 From 5f4449f0a199ae2f1750eb60f2fcc4dd8c41ab79 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 9 Jun 2016 20:02:15 +0200 Subject: Removed physac functions from raylib header --- src/raylib.h | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 706c4f4a..bfcb9bf5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -527,40 +527,6 @@ typedef struct GestureEvent { // Camera system modes typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; -typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; - -typedef struct Transform { - Vector2 position; - float rotation; // Radians (not used) - Vector2 scale; // Just for rectangle physic objects, for circle physic objects use collider radius and keep scale as { 0, 0 } -} Transform; - -typedef struct Rigidbody { - bool enabled; // Acts as kinematic state (collisions are calculated anyway) - float mass; - Vector2 acceleration; - Vector2 velocity; - bool applyGravity; - bool isGrounded; - float friction; // Normalized value - float bounciness; -} Rigidbody; - -typedef struct Collider { - bool enabled; - ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE - int radius; // Used for COLLIDER_CIRCLE -} Collider; - -typedef struct PhysicObjectData { - unsigned int id; - Transform transform; - Rigidbody rigidbody; - Collider collider; - bool enabled; -} PhysicObjectData, *PhysicObject; - #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -886,21 +852,6 @@ void EndBlendMode(void); // End blend Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool void DestroyLight(Light light); // Destroy a light and take it out of the list -//---------------------------------------------------------------------------------- -// Physics System Functions (Module: physac) -//---------------------------------------------------------------------------------- -void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) -void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection -void ClosePhysics(); // Unitialize all physic objects and empty the objects pool - -PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale); // Create a new physic object dinamically, initialize it and add to pool -void DestroyPhysicObject(PhysicObject pObj); // Destroy a specific physic object and take it out of the list - -void ApplyForce(PhysicObject pObj, Vector2 force); // Apply directional force to a physic object -void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range - -Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) - //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ -- cgit v1.2.3 From e2cfc6b838c3e8579f406b6ef18978fc9d958b1c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 9 Jun 2016 21:00:21 +0200 Subject: Reduced physic steps resolution --- src/physac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index c8466a12..f576ad8a 100644 --- a/src/physac.h +++ b/src/physac.h @@ -190,7 +190,7 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); // Defines and Macros //---------------------------------------------------------------------------------- #define MAX_PHYSIC_BODIES 256 // Maximum available physic bodies slots in bodies pool -#define PHYSICS_STEPS 450 // Physics update steps number (divided calculations in steps per frame) to get more accurately collisions detections +#define PHYSICS_STEPS 64 // Physics update steps per frame for improved collision-detection #define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) #define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix -- cgit v1.2.3 From cbda329bfde0cadc5a1608f8c30c6b7778dec2df Mon Sep 17 00:00:00 2001 From: victorfisac Date: Thu, 9 Jun 2016 22:12:46 +0200 Subject: Removed physac old module from Android MK file --- src/android/jni/Android.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk index 819ca79d..66851d08 100644 --- a/src/android/jni/Android.mk +++ b/src/android/jni/Android.mk @@ -47,7 +47,6 @@ LOCAL_SRC_FILES :=\ ../../utils.c \ ../../audio.c \ ../../external/stb_vorbis.c \ - ../../physac.c \ # Required includes paths (.h) LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include $(LOCAL_PATH)/../.. -- cgit v1.2.3 From 7b07b68bfdf03f13ed705188394cb7d26f4c2594 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Fri, 10 Jun 2016 00:49:51 +0200 Subject: Adapt standard shader to GL ES 2.0 Some shader calculations are now pre-calculated because some math functions doesn't exist in glsl 110. --- src/rlgl.c | 7 ++++++- src/standard_shader.h | 40 ++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index c9944806..9a88a818 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1795,8 +1795,13 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // NOTE: standard shader specific locations are got at render time to keep Shader struct as simple as possible (with just default shader locations) if (material.shader.id == standardShader.id) { + // Transpose and inverse model transformations matrix for fragment normal calculations + Matrix transInvTransform = transform; + MatrixTranspose(&transInvTransform); + MatrixInvert(&transInvTransform); + // Send model transformations matrix to shader - glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transform)); + glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transInvTransform)); // Send view transformation matrix to shader. View matrix 8, 9 and 10 are view direction vector axis values (target - position) glUniform3f(glGetUniformLocation(material.shader.id, "viewDir"), matView.m8, matView.m9, matView.m10); diff --git a/src/standard_shader.h b/src/standard_shader.h index b2b8980c..a4bc9694 100644 --- a/src/standard_shader.h +++ b/src/standard_shader.h @@ -85,13 +85,13 @@ static const char fStandardShaderStr[] = "{\n" " vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" " vec3 surfaceToLight = l.position - surfacePos;\n" -" float brightness = clamp(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n)), 0, 1);\n" +" float brightness = clamp(float(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n))), 0.0, 1.0);\n" " float diff = 1.0/dot(surfaceToLight/l.radius, surfaceToLight/l.radius)*brightness*l.intensity;\n" " float spec = 0.0;\n" " if (diff > 0.0)\n" " {\n" " vec3 h = normalize(-l.direction + v);\n" -" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" " }\n" " return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" "}\n" @@ -99,23 +99,23 @@ static const char fStandardShaderStr[] = "vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)\n" "{\n" " vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(dot(n, lightDir), 0.0, 1.0)*l.intensity;\n" +" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" " float spec = 0.0;\n" " if (diff > 0.0)\n" " {\n" " vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" " }\n" " return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" "}\n" "\n" "vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)\n" "{\n" -" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" +" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1.0));\n" " vec3 lightToSurface = normalize(surfacePos - l.position);\n" " vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(dot(n, lightDir), 0.0, 1.0)*l.intensity;\n" -" float attenuation = clamp(dot(n, lightToSurface), 0.0, 1.0);\n" +" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" +" float attenuation = clamp(float(dot(n, lightToSurface)), 0.0, 1.0);\n" " attenuation = dot(lightToSurface, -lightDir);\n" " float lightToSurfaceAngle = degrees(acos(attenuation));\n" " if (lightToSurfaceAngle > l.coneAngle) attenuation = 0.0;\n" @@ -125,37 +125,45 @@ static const char fStandardShaderStr[] = " if (diffAttenuation > 0.0)\n" " {\n" " vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3 + glossiness)*s;\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" " }\n" " return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" "}\n" "\n" "void main()\n" "{\n" -" mat3 normalMatrix = transpose(inverse(mat3(modelMatrix)));\n" +" mat3 normalMatrix = mat3(modelMatrix);\n" " vec3 normal = normalize(normalMatrix*fragNormal);\n" " vec3 n = normalize(normal);\n" " vec3 v = normalize(viewDir);\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" vec4 texelColor = texture2D(texture0, fragTexCoord);\n" +#elif defined(GRAPHICS_API_OPENGL_33) " vec4 texelColor = texture(texture0, fragTexCoord);\n" +#endif " vec3 lighting = colAmbient.rgb;\n" " if (useNormal == 1)\n" " {\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" n *= texture2D(texture1, fragTexCoord).rgb;\n" +#elif defined(GRAPHICS_API_OPENGL_33) " n *= texture(texture1, fragTexCoord).rgb;\n" +#endif " n = normalize(n);\n" " }\n" " float spec = 1.0;\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" if (useSpecular == 1) spec *= normalize(texture2D(texture2, fragTexCoord).r);\n" +#elif defined(GRAPHICS_API_OPENGL_33) " if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" +#endif " for (int i = 0; i < lightsCount; i++)\n" " {\n" " if (lights[i].enabled == 1)\n" " {\n" -" switch (lights[i].type)\n" -" {\n" -" case 0: lighting += CalcPointLight(lights[i], n, v, spec); break;\n" -" case 1: lighting += CalcDirectionalLight(lights[i], n, v, spec); break;\n" -" case 2: lighting += CalcSpotLight(lights[i], n, v, spec); break;\n" -" default: break;\n" -" }\n" +" if(lights[i].type == 0) lighting += CalcPointLight(lights[i], n, v, spec);\n" +" else if(lights[i].type == 1) lighting += CalcDirectionalLight(lights[i], n, v, spec);\n" +" else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);\n" " }\n" " }\n" #if defined(GRAPHICS_API_OPENGL_33) -- cgit v1.2.3 From 3e8427799c27b1e0bca22759ae434e23b06547ae Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 10:56:20 +0200 Subject: Corrected bug on cubemap generation --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 15565c98..8d9219e3 100644 --- a/src/models.c +++ b/src/models.c @@ -739,7 +739,7 @@ Model LoadCubicmap(Image cubicmap) { Model model = { 0 }; - model.mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0, 1.0, 1.5f }); + model.mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0f, 1.5f, 1.0f }); rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) -- cgit v1.2.3 From 52b88e0991e4b82ed4e97a5a2e8ef939a37de661 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 10:58:17 +0200 Subject: Reduce extensions dependencies Only using raylib required extensions... it could be further reduced! --- src/external/glad.h | 22344 +++++++------------------------------------------- 1 file changed, 2933 insertions(+), 19411 deletions(-) (limited to 'src') diff --git a/src/external/glad.h b/src/external/glad.h index db1516f8..ab5947e6 100644 --- a/src/external/glad.h +++ b/src/external/glad.h @@ -1,25 +1,21 @@ /* - OpenGL loader generated by glad 0.1.9a3 on 01/22/16 00:32:54. + OpenGL loader generated by glad 0.1.10a0 on Fri Jun 10 12:54:12 2016. Language/Generator: C/C++ Specification: gl APIs: gl=3.3 Profile: core Extensions: - GL_SGIX_pixel_tiles, GL_EXT_post_depth_coverage, GL_APPLE_element_array, GL_AMD_multi_draw_indirect, GL_EXT_blend_subtract, GL_SGIX_tag_sample_buffer, GL_NV_point_sprite, GL_IBM_texture_mirrored_repeat, GL_APPLE_transform_hint, GL_ATI_separate_stencil, GL_NV_shader_atomic_int64, GL_NV_vertex_program2_option, GL_EXT_texture_buffer_object, GL_ARB_vertex_blend, GL_OVR_multiview, GL_NV_vertex_program2, GL_ARB_program_interface_query, GL_EXT_misc_attribute, GL_NV_multisample_coverage, GL_ARB_shading_language_packing, GL_EXT_texture_cube_map, GL_NV_viewport_array2, GL_ARB_texture_stencil8, GL_EXT_index_func, GL_OES_compressed_paletted_texture, GL_NV_depth_clamp, GL_NV_shader_buffer_load, GL_EXT_color_subtable, GL_SUNX_constant_data, GL_EXT_texture_compression_s3tc, GL_EXT_multi_draw_arrays, GL_ARB_shader_atomic_counters, GL_ARB_arrays_of_arrays, GL_NV_conditional_render, GL_EXT_texture_env_combine, GL_NV_fog_distance, GL_SGIX_async_histogram, GL_MESA_resize_buffers, GL_NV_light_max_exponent, GL_NV_texture_env_combine4, GL_ARB_texture_view, GL_ARB_texture_env_combine, GL_ARB_map_buffer_range, GL_EXT_convolution, GL_NV_compute_program5, GL_NV_vertex_attrib_integer_64bit, GL_EXT_paletted_texture, GL_ARB_texture_buffer_object, GL_ATI_pn_triangles, GL_SGIX_resample, GL_SGIX_flush_raster, GL_EXT_light_texture, GL_ARB_point_sprite, GL_SUN_convolution_border_modes, GL_NV_parameter_buffer_object2, GL_ARB_half_float_pixel, GL_NV_tessellation_program5, GL_REND_screen_coordinates, GL_HP_image_transform, GL_EXT_packed_float, GL_OML_subsample, GL_SGIX_vertex_preclip, GL_SGIX_texture_scale_bias, GL_AMD_draw_buffers_blend, GL_APPLE_texture_range, GL_EXT_texture_array, GL_NV_texture_barrier, GL_ARB_texture_query_levels, GL_NV_texgen_emboss, GL_EXT_texture_swizzle, GL_ARB_texture_rg, GL_ARB_vertex_type_2_10_10_10_rev, GL_ARB_fragment_shader, GL_3DFX_tbuffer, GL_GREMEDY_frame_terminator, GL_ARB_blend_func_extended, GL_EXT_separate_shader_objects, GL_NV_texture_multisample, GL_ARB_shader_objects, GL_ARB_framebuffer_object, GL_ATI_envmap_bumpmap, GL_ARB_robust_buffer_access_behavior, GL_ARB_shader_stencil_export, GL_NV_texture_rectangle, GL_ARB_enhanced_layouts, GL_ARB_texture_rectangle, GL_SGI_texture_color_table, GL_ATI_map_object_buffer, GL_ARB_robustness, GL_NV_pixel_data_range, GL_EXT_framebuffer_blit, GL_ARB_gpu_shader_fp64, GL_NV_command_list, GL_SGIX_depth_texture, GL_EXT_vertex_weighting, GL_GREMEDY_string_marker, GL_ARB_texture_compression_bptc, GL_EXT_subtexture, GL_EXT_pixel_transform_color_table, GL_EXT_texture_compression_rgtc, GL_ARB_shader_atomic_counter_ops, GL_SGIX_depth_pass_instrument, GL_EXT_gpu_program_parameters, GL_NV_evaluators, GL_SGIS_texture_filter4, GL_AMD_performance_monitor, GL_NV_geometry_shader4, GL_EXT_stencil_clear_tag, GL_NV_vertex_program1_1, GL_NV_present_video, GL_ARB_texture_compression_rgtc, GL_HP_convolution_border_modes, GL_EXT_shader_integer_mix, GL_SGIX_framezoom, GL_ARB_stencil_texturing, GL_ARB_shader_clock, GL_NV_shader_atomic_fp16_vector, GL_SGIX_fog_offset, GL_ARB_draw_elements_base_vertex, GL_INGR_interlace_read, GL_NV_transform_feedback, GL_NV_fragment_program, GL_AMD_stencil_operation_extended, GL_ARB_seamless_cubemap_per_texture, GL_ARB_instanced_arrays, GL_EXT_polygon_offset, GL_NV_vertex_array_range2, GL_KHR_robustness, GL_AMD_sparse_texture, GL_ARB_clip_control, GL_NV_fragment_coverage_to_color, GL_NV_fence, GL_ARB_texture_buffer_range, GL_SUN_mesh_array, GL_ARB_vertex_attrib_binding, GL_ARB_framebuffer_no_attachments, GL_ARB_cl_event, GL_ARB_derivative_control, GL_NV_packed_depth_stencil, GL_OES_single_precision, GL_NV_primitive_restart, GL_SUN_global_alpha, GL_ARB_fragment_shader_interlock, GL_EXT_texture_object, GL_AMD_name_gen_delete, GL_NV_texture_compression_vtc, GL_NV_sample_mask_override_coverage, GL_NV_texture_shader3, GL_NV_texture_shader2, GL_EXT_texture, GL_ARB_buffer_storage, GL_AMD_shader_atomic_counter_ops, GL_APPLE_vertex_program_evaluators, GL_ARB_multi_bind, GL_ARB_explicit_uniform_location, GL_ARB_depth_buffer_float, GL_NV_path_rendering_shared_edge, GL_SGIX_shadow_ambient, GL_ARB_texture_cube_map, GL_AMD_vertex_shader_viewport_index, GL_SGIX_list_priority, GL_NV_vertex_buffer_unified_memory, GL_NV_uniform_buffer_unified_memory, GL_EXT_texture_env_dot3, GL_ATI_texture_env_combine3, GL_ARB_map_buffer_alignment, GL_NV_blend_equation_advanced, GL_SGIS_sharpen_texture, GL_KHR_robust_buffer_access_behavior, GL_ARB_pipeline_statistics_query, GL_ARB_vertex_program, GL_ARB_texture_rgb10_a2ui, GL_OML_interlace, GL_ATI_pixel_format_float, GL_NV_geometry_shader_passthrough, GL_ARB_vertex_buffer_object, GL_EXT_shadow_funcs, GL_ATI_text_fragment_shader, GL_NV_vertex_array_range, GL_SGIX_fragment_lighting, GL_NV_texture_expand_normal, GL_NV_framebuffer_multisample_coverage, GL_EXT_timer_query, GL_EXT_vertex_array_bgra, GL_NV_bindless_texture, GL_KHR_debug, GL_SGIS_texture_border_clamp, GL_ATI_vertex_attrib_array_object, GL_SGIX_clipmap, GL_EXT_geometry_shader4, GL_ARB_shader_texture_image_samples, GL_MESA_ycbcr_texture, GL_MESAX_texture_stack, GL_AMD_seamless_cubemap_per_texture, GL_EXT_bindable_uniform, GL_KHR_texture_compression_astc_hdr, GL_ARB_shader_ballot, GL_KHR_blend_equation_advanced, GL_ARB_fragment_program_shadow, GL_ATI_element_array, GL_AMD_texture_texture4, GL_SGIX_reference_plane, GL_EXT_stencil_two_side, GL_ARB_transform_feedback_overflow_query, GL_SGIX_texture_lod_bias, GL_KHR_no_error, GL_NV_explicit_multisample, GL_IBM_static_data, GL_EXT_clip_volume_hint, GL_EXT_texture_perturb_normal, GL_NV_fragment_program2, GL_NV_fragment_program4, GL_EXT_point_parameters, GL_PGI_misc_hints, GL_SGIX_subsample, GL_AMD_shader_stencil_export, GL_ARB_shader_texture_lod, GL_ARB_vertex_shader, GL_ARB_depth_clamp, GL_SGIS_texture_select, GL_NV_texture_shader, GL_ARB_tessellation_shader, GL_EXT_draw_buffers2, GL_ARB_vertex_attrib_64bit, GL_EXT_texture_filter_minmax, GL_WIN_specular_fog, GL_AMD_interleaved_elements, GL_ARB_fragment_program, GL_OML_resample, GL_APPLE_ycbcr_422, GL_SGIX_texture_add_env, GL_ARB_shadow_ambient, GL_ARB_texture_storage, GL_EXT_pixel_buffer_object, GL_ARB_copy_image, GL_SGIS_pixel_texture, GL_SGIS_generate_mipmap, GL_SGIX_instruments, GL_HP_texture_lighting, GL_ARB_shader_storage_buffer_object, GL_EXT_sparse_texture2, GL_EXT_blend_minmax, GL_MESA_pack_invert, GL_ARB_base_instance, GL_SGIX_convolution_accuracy, GL_PGI_vertex_hints, GL_AMD_transform_feedback4, GL_ARB_ES3_1_compatibility, GL_EXT_texture_integer, GL_ARB_texture_multisample, GL_AMD_gpu_shader_int64, GL_S3_s3tc, GL_ARB_query_buffer_object, GL_AMD_vertex_shader_tessellator, GL_ARB_invalidate_subdata, GL_EXT_index_material, GL_NV_blend_equation_advanced_coherent, GL_KHR_texture_compression_astc_sliced_3d, GL_INTEL_parallel_arrays, GL_ATI_draw_buffers, GL_EXT_cmyka, GL_SGIX_pixel_texture, GL_APPLE_specular_vector, GL_ARB_compatibility, GL_ARB_timer_query, GL_SGIX_interlace, GL_NV_parameter_buffer_object, GL_AMD_shader_trinary_minmax, GL_ARB_direct_state_access, GL_EXT_rescale_normal, GL_ARB_pixel_buffer_object, GL_ARB_uniform_buffer_object, GL_ARB_vertex_type_10f_11f_11f_rev, GL_ARB_texture_swizzle, GL_NV_transform_feedback2, GL_SGIX_async_pixel, GL_NV_fragment_program_option, GL_ARB_explicit_attrib_location, GL_EXT_blend_color, GL_NV_shader_thread_group, GL_EXT_stencil_wrap, GL_EXT_index_array_formats, GL_OVR_multiview2, GL_EXT_histogram, GL_ARB_get_texture_sub_image, GL_SGIS_point_parameters, GL_SGIX_ycrcb, GL_EXT_direct_state_access, GL_ARB_cull_distance, GL_AMD_sample_positions, GL_NV_vertex_program, GL_NV_shader_thread_shuffle, GL_ARB_shader_precision, GL_EXT_vertex_shader, GL_EXT_blend_func_separate, GL_APPLE_fence, GL_OES_byte_coordinates, GL_ARB_transpose_matrix, GL_ARB_provoking_vertex, GL_EXT_fog_coord, GL_EXT_vertex_array, GL_ARB_half_float_vertex, GL_EXT_blend_equation_separate, GL_NV_framebuffer_mixed_samples, GL_NVX_conditional_render, GL_ARB_multi_draw_indirect, GL_EXT_raster_multisample, GL_NV_copy_image, GL_ARB_fragment_layer_viewport, GL_INTEL_framebuffer_CMAA, GL_ARB_transform_feedback2, GL_ARB_transform_feedback3, GL_SGIX_ycrcba, GL_EXT_debug_marker, GL_EXT_bgra, GL_ARB_sparse_texture_clamp, GL_EXT_pixel_transform, GL_ARB_conservative_depth, GL_ATI_fragment_shader, GL_ARB_vertex_array_object, GL_SUN_triangle_list, GL_EXT_texture_env_add, GL_EXT_packed_depth_stencil, GL_EXT_texture_mirror_clamp, GL_NV_multisample_filter_hint, GL_APPLE_float_pixels, GL_ARB_transform_feedback_instanced, GL_SGIX_async, GL_EXT_texture_compression_latc, GL_NV_shader_atomic_float, GL_ARB_shading_language_100, GL_INTEL_performance_query, GL_ARB_texture_mirror_clamp_to_edge, GL_NV_gpu_shader5, GL_NV_bindless_multi_draw_indirect_count, GL_ARB_ES2_compatibility, GL_ARB_indirect_parameters, GL_NV_half_float, GL_ARB_ES3_2_compatibility, GL_ATI_texture_mirror_once, GL_IBM_rasterpos_clip, GL_SGIX_shadow, GL_EXT_polygon_offset_clamp, GL_NV_deep_texture3D, GL_ARB_shader_draw_parameters, GL_SGIX_calligraphic_fragment, GL_ARB_shader_bit_encoding, GL_EXT_compiled_vertex_array, GL_NV_depth_buffer_float, GL_NV_occlusion_query, GL_APPLE_flush_buffer_range, GL_ARB_imaging, GL_ARB_draw_buffers_blend, GL_AMD_gcn_shader, GL_AMD_blend_minmax_factor, GL_EXT_texture_sRGB_decode, GL_ARB_shading_language_420pack, GL_ARB_shader_viewport_layer_array, GL_ATI_meminfo, GL_EXT_abgr, GL_AMD_pinned_memory, GL_EXT_texture_snorm, GL_SGIX_texture_coordinate_clamp, GL_ARB_clear_buffer_object, GL_ARB_multisample, GL_EXT_debug_label, GL_ARB_sample_shading, GL_NV_internalformat_sample_query, GL_INTEL_map_texture, GL_ARB_texture_env_crossbar, GL_EXT_422_pixels, GL_ARB_compute_shader, GL_EXT_blend_logic_op, GL_IBM_cull_vertex, GL_IBM_vertex_array_lists, GL_ARB_color_buffer_float, GL_ARB_bindless_texture, GL_ARB_window_pos, GL_ARB_internalformat_query, GL_ARB_shadow, GL_ARB_texture_mirrored_repeat, GL_EXT_shader_image_load_store, GL_EXT_copy_texture, GL_NV_register_combiners2, GL_SGIX_ycrcb_subsample, GL_SGIX_ir_instrument1, GL_NV_draw_texture, GL_EXT_texture_shared_exponent, GL_EXT_draw_instanced, GL_NV_copy_depth_to_color, GL_ARB_viewport_array, GL_ARB_separate_shader_objects, GL_EXT_depth_bounds_test, GL_EXT_shared_texture_palette, GL_ARB_texture_env_add, GL_NV_video_capture, GL_ARB_sampler_objects, GL_ARB_matrix_palette, GL_SGIS_texture_color_mask, GL_EXT_packed_pixels, GL_EXT_coordinate_frame, GL_ARB_texture_compression, GL_APPLE_aux_depth_stencil, GL_ARB_shader_subroutine, GL_EXT_framebuffer_sRGB, GL_ARB_texture_storage_multisample, GL_KHR_blend_equation_advanced_coherent, GL_EXT_vertex_attrib_64bit, GL_ARB_depth_texture, GL_NV_shader_buffer_store, GL_OES_query_matrix, GL_MESA_window_pos, GL_NV_fill_rectangle, GL_NV_shader_storage_buffer_object, GL_ARB_texture_query_lod, GL_ARB_copy_buffer, GL_ARB_shader_image_size, GL_NV_shader_atomic_counters, GL_APPLE_object_purgeable, GL_ARB_occlusion_query, GL_INGR_color_clamp, GL_SGI_color_table, GL_NV_gpu_program5_mem_extended, GL_ARB_texture_cube_map_array, GL_SGIX_scalebias_hint, GL_EXT_gpu_shader4, GL_NV_geometry_program4, GL_EXT_framebuffer_multisample_blit_scaled, GL_AMD_debug_output, GL_ARB_texture_border_clamp, GL_ARB_fragment_coord_conventions, GL_ARB_multitexture, GL_SGIX_polynomial_ffd, GL_EXT_provoking_vertex, GL_ARB_point_parameters, GL_ARB_shader_image_load_store, GL_ARB_conditional_render_inverted, GL_HP_occlusion_test, GL_ARB_ES3_compatibility, GL_ARB_texture_barrier, GL_ARB_texture_buffer_object_rgb32, GL_NV_bindless_multi_draw_indirect, GL_SGIX_texture_multi_buffer, GL_EXT_transform_feedback, GL_KHR_texture_compression_astc_ldr, GL_3DFX_multisample, GL_INTEL_fragment_shader_ordering, GL_ARB_texture_env_dot3, GL_NV_gpu_program4, GL_NV_gpu_program5, GL_NV_float_buffer, GL_SGIS_texture_edge_clamp, GL_ARB_framebuffer_sRGB, GL_SUN_slice_accum, GL_EXT_index_texture, GL_EXT_shader_image_load_formatted, GL_ARB_geometry_shader4, GL_EXT_separate_specular_color, GL_AMD_depth_clamp_separate, GL_NV_conservative_raster, GL_ARB_sparse_texture2, GL_SGIX_sprite, GL_ARB_get_program_binary, GL_AMD_occlusion_query_event, GL_SGIS_multisample, GL_EXT_framebuffer_object, GL_ARB_robustness_isolation, GL_ARB_vertex_array_bgra, GL_APPLE_vertex_array_range, GL_AMD_query_buffer_object, GL_NV_register_combiners, GL_ARB_draw_buffers, GL_ARB_clear_texture, GL_ARB_debug_output, GL_SGI_color_matrix, GL_EXT_cull_vertex, GL_EXT_texture_sRGB, GL_APPLE_row_bytes, GL_NV_texgen_reflection, GL_IBM_multimode_draw_arrays, GL_APPLE_vertex_array_object, GL_3DFX_texture_compression_FXT1, GL_NV_fragment_shader_interlock, GL_AMD_conservative_depth, GL_ARB_texture_float, GL_ARB_compressed_texture_pixel_storage, GL_SGIS_detail_texture, GL_ARB_draw_instanced, GL_OES_read_format, GL_ATI_texture_float, GL_ARB_texture_gather, GL_AMD_vertex_shader_layer, GL_ARB_shading_language_include, GL_APPLE_client_storage, GL_WIN_phong_shading, GL_INGR_blend_func_separate, GL_NV_path_rendering, GL_NV_conservative_raster_dilate, GL_ATI_vertex_streams, GL_ARB_post_depth_coverage, GL_ARB_texture_non_power_of_two, GL_APPLE_rgb_422, GL_EXT_texture_lod_bias, GL_ARB_gpu_shader_int64, GL_ARB_seamless_cube_map, GL_ARB_shader_group_vote, GL_NV_vdpau_interop, GL_ARB_occlusion_query2, GL_ARB_internalformat_query2, GL_EXT_texture_filter_anisotropic, GL_SUN_vertex, GL_SGIX_igloo_interface, GL_SGIS_texture_lod, GL_NV_vertex_program3, GL_ARB_draw_indirect, GL_NV_vertex_program4, GL_AMD_transform_feedback3_lines_triangles, GL_SGIS_fog_function, GL_EXT_x11_sync_object, GL_ARB_sync, GL_NV_sample_locations, GL_ARB_compute_variable_group_size, GL_OES_fixed_point, GL_NV_blend_square, GL_EXT_framebuffer_multisample, GL_ARB_gpu_shader5, GL_SGIS_texture4D, GL_EXT_texture3D, GL_EXT_multisample, GL_EXT_secondary_color, GL_ARB_texture_filter_minmax, GL_ATI_vertex_array_object, GL_ARB_parallel_shader_compile, GL_NVX_gpu_memory_info, GL_ARB_sparse_texture, GL_SGIS_point_line_texgen, GL_ARB_sample_locations, GL_ARB_sparse_buffer, GL_EXT_draw_range_elements, GL_SGIX_blend_alpha_minmax, GL_KHR_context_flush_control + GL_AMD_debug_output, GL_AMD_query_buffer_object, GL_ARB_ES2_compatibility, GL_ARB_ES3_compatibility, GL_ARB_buffer_storage, GL_ARB_compatibility, GL_ARB_compressed_texture_pixel_storage, GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, GL_ARB_multisample, GL_ARB_sample_locations, GL_ARB_texture_compression, GL_ARB_texture_float, GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two, GL_ARB_texture_rg, GL_ARB_texture_swizzle, GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_object, GL_ARB_vertex_attrib_binding, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_element_array, GL_ATI_fragment_shader, GL_ATI_vertex_array_object, GL_EXT_blend_color, GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_index_array_formats, GL_EXT_texture, GL_EXT_texture_compression_s3tc, GL_EXT_texture_sRGB, GL_EXT_texture_swizzle, GL_EXT_vertex_array, GL_EXT_vertex_shader Loader: No Commandline: - --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_SGIX_pixel_tiles,GL_EXT_post_depth_coverage,GL_APPLE_element_array,GL_AMD_multi_draw_indirect,GL_EXT_blend_subtract,GL_SGIX_tag_sample_buffer,GL_NV_point_sprite,GL_IBM_texture_mirrored_repeat,GL_APPLE_transform_hint,GL_ATI_separate_stencil,GL_NV_shader_atomic_int64,GL_NV_vertex_program2_option,GL_EXT_texture_buffer_object,GL_ARB_vertex_blend,GL_OVR_multiview,GL_NV_vertex_program2,GL_ARB_program_interface_query,GL_EXT_misc_attribute,GL_NV_multisample_coverage,GL_ARB_shading_language_packing,GL_EXT_texture_cube_map,GL_NV_viewport_array2,GL_ARB_texture_stencil8,GL_EXT_index_func,GL_OES_compressed_paletted_texture,GL_NV_depth_clamp,GL_NV_shader_buffer_load,GL_EXT_color_subtable,GL_SUNX_constant_data,GL_EXT_texture_compression_s3tc,GL_EXT_multi_draw_arrays,GL_ARB_shader_atomic_counters,GL_ARB_arrays_of_arrays,GL_NV_conditional_render,GL_EXT_texture_env_combine,GL_NV_fog_distance,GL_SGIX_async_histogram,GL_MESA_resize_buffers,GL_NV_light_max_exponent,GL_NV_texture_env_combine4,GL_ARB_texture_view,GL_ARB_texture_env_combine,GL_ARB_map_buffer_range,GL_EXT_convolution,GL_NV_compute_program5,GL_NV_vertex_attrib_integer_64bit,GL_EXT_paletted_texture,GL_ARB_texture_buffer_object,GL_ATI_pn_triangles,GL_SGIX_resample,GL_SGIX_flush_raster,GL_EXT_light_texture,GL_ARB_point_sprite,GL_SUN_convolution_border_modes,GL_NV_parameter_buffer_object2,GL_ARB_half_float_pixel,GL_NV_tessellation_program5,GL_REND_screen_coordinates,GL_HP_image_transform,GL_EXT_packed_float,GL_OML_subsample,GL_SGIX_vertex_preclip,GL_SGIX_texture_scale_bias,GL_AMD_draw_buffers_blend,GL_APPLE_texture_range,GL_EXT_texture_array,GL_NV_texture_barrier,GL_ARB_texture_query_levels,GL_NV_texgen_emboss,GL_EXT_texture_swizzle,GL_ARB_texture_rg,GL_ARB_vertex_type_2_10_10_10_rev,GL_ARB_fragment_shader,GL_3DFX_tbuffer,GL_GREMEDY_frame_terminator,GL_ARB_blend_func_extended,GL_EXT_separate_shader_objects,GL_NV_texture_multisample,GL_ARB_shader_objects,GL_ARB_framebuffer_object,GL_ATI_envmap_bumpmap,GL_ARB_robust_buffer_access_behavior,GL_ARB_shader_stencil_export,GL_NV_texture_rectangle,GL_ARB_enhanced_layouts,GL_ARB_texture_rectangle,GL_SGI_texture_color_table,GL_ATI_map_object_buffer,GL_ARB_robustness,GL_NV_pixel_data_range,GL_EXT_framebuffer_blit,GL_ARB_gpu_shader_fp64,GL_NV_command_list,GL_SGIX_depth_texture,GL_EXT_vertex_weighting,GL_GREMEDY_string_marker,GL_ARB_texture_compression_bptc,GL_EXT_subtexture,GL_EXT_pixel_transform_color_table,GL_EXT_texture_compression_rgtc,GL_ARB_shader_atomic_counter_ops,GL_SGIX_depth_pass_instrument,GL_EXT_gpu_program_parameters,GL_NV_evaluators,GL_SGIS_texture_filter4,GL_AMD_performance_monitor,GL_NV_geometry_shader4,GL_EXT_stencil_clear_tag,GL_NV_vertex_program1_1,GL_NV_present_video,GL_ARB_texture_compression_rgtc,GL_HP_convolution_border_modes,GL_EXT_shader_integer_mix,GL_SGIX_framezoom,GL_ARB_stencil_texturing,GL_ARB_shader_clock,GL_NV_shader_atomic_fp16_vector,GL_SGIX_fog_offset,GL_ARB_draw_elements_base_vertex,GL_INGR_interlace_read,GL_NV_transform_feedback,GL_NV_fragment_program,GL_AMD_stencil_operation_extended,GL_ARB_seamless_cubemap_per_texture,GL_ARB_instanced_arrays,GL_EXT_polygon_offset,GL_NV_vertex_array_range2,GL_KHR_robustness,GL_AMD_sparse_texture,GL_ARB_clip_control,GL_NV_fragment_coverage_to_color,GL_NV_fence,GL_ARB_texture_buffer_range,GL_SUN_mesh_array,GL_ARB_vertex_attrib_binding,GL_ARB_framebuffer_no_attachments,GL_ARB_cl_event,GL_ARB_derivative_control,GL_NV_packed_depth_stencil,GL_OES_single_precision,GL_NV_primitive_restart,GL_SUN_global_alpha,GL_ARB_fragment_shader_interlock,GL_EXT_texture_object,GL_AMD_name_gen_delete,GL_NV_texture_compression_vtc,GL_NV_sample_mask_override_coverage,GL_NV_texture_shader3,GL_NV_texture_shader2,GL_EXT_texture,GL_ARB_buffer_storage,GL_AMD_shader_atomic_counter_ops,GL_APPLE_vertex_program_evaluators,GL_ARB_multi_bind,GL_ARB_explicit_uniform_location,GL_ARB_depth_buffer_float,GL_NV_path_rendering_shared_edge,GL_SGIX_shadow_ambient,GL_ARB_texture_cube_map,GL_AMD_vertex_shader_viewport_index,GL_SGIX_list_priority,GL_NV_vertex_buffer_unified_memory,GL_NV_uniform_buffer_unified_memory,GL_EXT_texture_env_dot3,GL_ATI_texture_env_combine3,GL_ARB_map_buffer_alignment,GL_NV_blend_equation_advanced,GL_SGIS_sharpen_texture,GL_KHR_robust_buffer_access_behavior,GL_ARB_pipeline_statistics_query,GL_ARB_vertex_program,GL_ARB_texture_rgb10_a2ui,GL_OML_interlace,GL_ATI_pixel_format_float,GL_NV_geometry_shader_passthrough,GL_ARB_vertex_buffer_object,GL_EXT_shadow_funcs,GL_ATI_text_fragment_shader,GL_NV_vertex_array_range,GL_SGIX_fragment_lighting,GL_NV_texture_expand_normal,GL_NV_framebuffer_multisample_coverage,GL_EXT_timer_query,GL_EXT_vertex_array_bgra,GL_NV_bindless_texture,GL_KHR_debug,GL_SGIS_texture_border_clamp,GL_ATI_vertex_attrib_array_object,GL_SGIX_clipmap,GL_EXT_geometry_shader4,GL_ARB_shader_texture_image_samples,GL_MESA_ycbcr_texture,GL_MESAX_texture_stack,GL_AMD_seamless_cubemap_per_texture,GL_EXT_bindable_uniform,GL_KHR_texture_compression_astc_hdr,GL_ARB_shader_ballot,GL_KHR_blend_equation_advanced,GL_ARB_fragment_program_shadow,GL_ATI_element_array,GL_AMD_texture_texture4,GL_SGIX_reference_plane,GL_EXT_stencil_two_side,GL_ARB_transform_feedback_overflow_query,GL_SGIX_texture_lod_bias,GL_KHR_no_error,GL_NV_explicit_multisample,GL_IBM_static_data,GL_EXT_clip_volume_hint,GL_EXT_texture_perturb_normal,GL_NV_fragment_program2,GL_NV_fragment_program4,GL_EXT_point_parameters,GL_PGI_misc_hints,GL_SGIX_subsample,GL_AMD_shader_stencil_export,GL_ARB_shader_texture_lod,GL_ARB_vertex_shader,GL_ARB_depth_clamp,GL_SGIS_texture_select,GL_NV_texture_shader,GL_ARB_tessellation_shader,GL_EXT_draw_buffers2,GL_ARB_vertex_attrib_64bit,GL_EXT_texture_filter_minmax,GL_WIN_specular_fog,GL_AMD_interleaved_elements,GL_ARB_fragment_program,GL_OML_resample,GL_APPLE_ycbcr_422,GL_SGIX_texture_add_env,GL_ARB_shadow_ambient,GL_ARB_texture_storage,GL_EXT_pixel_buffer_object,GL_ARB_copy_image,GL_SGIS_pixel_texture,GL_SGIS_generate_mipmap,GL_SGIX_instruments,GL_HP_texture_lighting,GL_ARB_shader_storage_buffer_object,GL_EXT_sparse_texture2,GL_EXT_blend_minmax,GL_MESA_pack_invert,GL_ARB_base_instance,GL_SGIX_convolution_accuracy,GL_PGI_vertex_hints,GL_AMD_transform_feedback4,GL_ARB_ES3_1_compatibility,GL_EXT_texture_integer,GL_ARB_texture_multisample,GL_AMD_gpu_shader_int64,GL_S3_s3tc,GL_ARB_query_buffer_object,GL_AMD_vertex_shader_tessellator,GL_ARB_invalidate_subdata,GL_EXT_index_material,GL_NV_blend_equation_advanced_coherent,GL_KHR_texture_compression_astc_sliced_3d,GL_INTEL_parallel_arrays,GL_ATI_draw_buffers,GL_EXT_cmyka,GL_SGIX_pixel_texture,GL_APPLE_specular_vector,GL_ARB_compatibility,GL_ARB_timer_query,GL_SGIX_interlace,GL_NV_parameter_buffer_object,GL_AMD_shader_trinary_minmax,GL_ARB_direct_state_access,GL_EXT_rescale_normal,GL_ARB_pixel_buffer_object,GL_ARB_uniform_buffer_object,GL_ARB_vertex_type_10f_11f_11f_rev,GL_ARB_texture_swizzle,GL_NV_transform_feedback2,GL_SGIX_async_pixel,GL_NV_fragment_program_option,GL_ARB_explicit_attrib_location,GL_EXT_blend_color,GL_NV_shader_thread_group,GL_EXT_stencil_wrap,GL_EXT_index_array_formats,GL_OVR_multiview2,GL_EXT_histogram,GL_ARB_get_texture_sub_image,GL_SGIS_point_parameters,GL_SGIX_ycrcb,GL_EXT_direct_state_access,GL_ARB_cull_distance,GL_AMD_sample_positions,GL_NV_vertex_program,GL_NV_shader_thread_shuffle,GL_ARB_shader_precision,GL_EXT_vertex_shader,GL_EXT_blend_func_separate,GL_APPLE_fence,GL_OES_byte_coordinates,GL_ARB_transpose_matrix,GL_ARB_provoking_vertex,GL_EXT_fog_coord,GL_EXT_vertex_array,GL_ARB_half_float_vertex,GL_EXT_blend_equation_separate,GL_NV_framebuffer_mixed_samples,GL_NVX_conditional_render,GL_ARB_multi_draw_indirect,GL_EXT_raster_multisample,GL_NV_copy_image,GL_ARB_fragment_layer_viewport,GL_INTEL_framebuffer_CMAA,GL_ARB_transform_feedback2,GL_ARB_transform_feedback3,GL_SGIX_ycrcba,GL_EXT_debug_marker,GL_EXT_bgra,GL_ARB_sparse_texture_clamp,GL_EXT_pixel_transform,GL_ARB_conservative_depth,GL_ATI_fragment_shader,GL_ARB_vertex_array_object,GL_SUN_triangle_list,GL_EXT_texture_env_add,GL_EXT_packed_depth_stencil,GL_EXT_texture_mirror_clamp,GL_NV_multisample_filter_hint,GL_APPLE_float_pixels,GL_ARB_transform_feedback_instanced,GL_SGIX_async,GL_EXT_texture_compression_latc,GL_NV_shader_atomic_float,GL_ARB_shading_language_100,GL_INTEL_performance_query,GL_ARB_texture_mirror_clamp_to_edge,GL_NV_gpu_shader5,GL_NV_bindless_multi_draw_indirect_count,GL_ARB_ES2_compatibility,GL_ARB_indirect_parameters,GL_NV_half_float,GL_ARB_ES3_2_compatibility,GL_ATI_texture_mirror_once,GL_IBM_rasterpos_clip,GL_SGIX_shadow,GL_EXT_polygon_offset_clamp,GL_NV_deep_texture3D,GL_ARB_shader_draw_parameters,GL_SGIX_calligraphic_fragment,GL_ARB_shader_bit_encoding,GL_EXT_compiled_vertex_array,GL_NV_depth_buffer_float,GL_NV_occlusion_query,GL_APPLE_flush_buffer_range,GL_ARB_imaging,GL_ARB_draw_buffers_blend,GL_AMD_gcn_shader,GL_AMD_blend_minmax_factor,GL_EXT_texture_sRGB_decode,GL_ARB_shading_language_420pack,GL_ARB_shader_viewport_layer_array,GL_ATI_meminfo,GL_EXT_abgr,GL_AMD_pinned_memory,GL_EXT_texture_snorm,GL_SGIX_texture_coordinate_clamp,GL_ARB_clear_buffer_object,GL_ARB_multisample,GL_EXT_debug_label,GL_ARB_sample_shading,GL_NV_internalformat_sample_query,GL_INTEL_map_texture,GL_ARB_texture_env_crossbar,GL_EXT_422_pixels,GL_ARB_compute_shader,GL_EXT_blend_logic_op,GL_IBM_cull_vertex,GL_IBM_vertex_array_lists,GL_ARB_color_buffer_float,GL_ARB_bindless_texture,GL_ARB_window_pos,GL_ARB_internalformat_query,GL_ARB_shadow,GL_ARB_texture_mirrored_repeat,GL_EXT_shader_image_load_store,GL_EXT_copy_texture,GL_NV_register_combiners2,GL_SGIX_ycrcb_subsample,GL_SGIX_ir_instrument1,GL_NV_draw_texture,GL_EXT_texture_shared_exponent,GL_EXT_draw_instanced,GL_NV_copy_depth_to_color,GL_ARB_viewport_array,GL_ARB_separate_shader_objects,GL_EXT_depth_bounds_test,GL_EXT_shared_texture_palette,GL_ARB_texture_env_add,GL_NV_video_capture,GL_ARB_sampler_objects,GL_ARB_matrix_palette,GL_SGIS_texture_color_mask,GL_EXT_packed_pixels,GL_EXT_coordinate_frame,GL_ARB_texture_compression,GL_APPLE_aux_depth_stencil,GL_ARB_shader_subroutine,GL_EXT_framebuffer_sRGB,GL_ARB_texture_storage_multisample,GL_KHR_blend_equation_advanced_coherent,GL_EXT_vertex_attrib_64bit,GL_ARB_depth_texture,GL_NV_shader_buffer_store,GL_OES_query_matrix,GL_MESA_window_pos,GL_NV_fill_rectangle,GL_NV_shader_storage_buffer_object,GL_ARB_texture_query_lod,GL_ARB_copy_buffer,GL_ARB_shader_image_size,GL_NV_shader_atomic_counters,GL_APPLE_object_purgeable,GL_ARB_occlusion_query,GL_INGR_color_clamp,GL_SGI_color_table,GL_NV_gpu_program5_mem_extended,GL_ARB_texture_cube_map_array,GL_SGIX_scalebias_hint,GL_EXT_gpu_shader4,GL_NV_geometry_program4,GL_EXT_framebuffer_multisample_blit_scaled,GL_AMD_debug_output,GL_ARB_texture_border_clamp,GL_ARB_fragment_coord_conventions,GL_ARB_multitexture,GL_SGIX_polynomial_ffd,GL_EXT_provoking_vertex,GL_ARB_point_parameters,GL_ARB_shader_image_load_store,GL_ARB_conditional_render_inverted,GL_HP_occlusion_test,GL_ARB_ES3_compatibility,GL_ARB_texture_barrier,GL_ARB_texture_buffer_object_rgb32,GL_NV_bindless_multi_draw_indirect,GL_SGIX_texture_multi_buffer,GL_EXT_transform_feedback,GL_KHR_texture_compression_astc_ldr,GL_3DFX_multisample,GL_INTEL_fragment_shader_ordering,GL_ARB_texture_env_dot3,GL_NV_gpu_program4,GL_NV_gpu_program5,GL_NV_float_buffer,GL_SGIS_texture_edge_clamp,GL_ARB_framebuffer_sRGB,GL_SUN_slice_accum,GL_EXT_index_texture,GL_EXT_shader_image_load_formatted,GL_ARB_geometry_shader4,GL_EXT_separate_specular_color,GL_AMD_depth_clamp_separate,GL_NV_conservative_raster,GL_ARB_sparse_texture2,GL_SGIX_sprite,GL_ARB_get_program_binary,GL_AMD_occlusion_query_event,GL_SGIS_multisample,GL_EXT_framebuffer_object,GL_ARB_robustness_isolation,GL_ARB_vertex_array_bgra,GL_APPLE_vertex_array_range,GL_AMD_query_buffer_object,GL_NV_register_combiners,GL_ARB_draw_buffers,GL_ARB_clear_texture,GL_ARB_debug_output,GL_SGI_color_matrix,GL_EXT_cull_vertex,GL_EXT_texture_sRGB,GL_APPLE_row_bytes,GL_NV_texgen_reflection,GL_IBM_multimode_draw_arrays,GL_APPLE_vertex_array_object,GL_3DFX_texture_compression_FXT1,GL_NV_fragment_shader_interlock,GL_AMD_conservative_depth,GL_ARB_texture_float,GL_ARB_compressed_texture_pixel_storage,GL_SGIS_detail_texture,GL_ARB_draw_instanced,GL_OES_read_format,GL_ATI_texture_float,GL_ARB_texture_gather,GL_AMD_vertex_shader_layer,GL_ARB_shading_language_include,GL_APPLE_client_storage,GL_WIN_phong_shading,GL_INGR_blend_func_separate,GL_NV_path_rendering,GL_NV_conservative_raster_dilate,GL_ATI_vertex_streams,GL_ARB_post_depth_coverage,GL_ARB_texture_non_power_of_two,GL_APPLE_rgb_422,GL_EXT_texture_lod_bias,GL_ARB_gpu_shader_int64,GL_ARB_seamless_cube_map,GL_ARB_shader_group_vote,GL_NV_vdpau_interop,GL_ARB_occlusion_query2,GL_ARB_internalformat_query2,GL_EXT_texture_filter_anisotropic,GL_SUN_vertex,GL_SGIX_igloo_interface,GL_SGIS_texture_lod,GL_NV_vertex_program3,GL_ARB_draw_indirect,GL_NV_vertex_program4,GL_AMD_transform_feedback3_lines_triangles,GL_SGIS_fog_function,GL_EXT_x11_sync_object,GL_ARB_sync,GL_NV_sample_locations,GL_ARB_compute_variable_group_size,GL_OES_fixed_point,GL_NV_blend_square,GL_EXT_framebuffer_multisample,GL_ARB_gpu_shader5,GL_SGIS_texture4D,GL_EXT_texture3D,GL_EXT_multisample,GL_EXT_secondary_color,GL_ARB_texture_filter_minmax,GL_ATI_vertex_array_object,GL_ARB_parallel_shader_compile,GL_NVX_gpu_memory_info,GL_ARB_sparse_texture,GL_SGIS_point_line_texgen,GL_ARB_sample_locations,GL_ARB_sparse_buffer,GL_EXT_draw_range_elements,GL_SGIX_blend_alpha_minmax,GL_KHR_context_flush_control" + --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --no-loader --extensions="GL_AMD_debug_output,GL_AMD_query_buffer_object,GL_ARB_ES2_compatibility,GL_ARB_ES3_compatibility,GL_ARB_buffer_storage,GL_ARB_compatibility,GL_ARB_compressed_texture_pixel_storage,GL_ARB_debug_output,GL_ARB_depth_buffer_float,GL_ARB_depth_clamp,GL_ARB_depth_texture,GL_ARB_draw_buffers,GL_ARB_draw_buffers_blend,GL_ARB_explicit_attrib_location,GL_ARB_explicit_uniform_location,GL_ARB_fragment_program,GL_ARB_fragment_shader,GL_ARB_framebuffer_object,GL_ARB_framebuffer_sRGB,GL_ARB_multisample,GL_ARB_sample_locations,GL_ARB_texture_compression,GL_ARB_texture_float,GL_ARB_texture_multisample,GL_ARB_texture_non_power_of_two,GL_ARB_texture_rg,GL_ARB_texture_swizzle,GL_ARB_uniform_buffer_object,GL_ARB_vertex_array_object,GL_ARB_vertex_attrib_binding,GL_ARB_vertex_buffer_object,GL_ARB_vertex_program,GL_ARB_vertex_shader,GL_ATI_element_array,GL_ATI_fragment_shader,GL_ATI_vertex_array_object,GL_EXT_blend_color,GL_EXT_blend_equation_separate,GL_EXT_blend_func_separate,GL_EXT_framebuffer_blit,GL_EXT_framebuffer_multisample,GL_EXT_framebuffer_multisample_blit_scaled,GL_EXT_framebuffer_object,GL_EXT_framebuffer_sRGB,GL_EXT_index_array_formats,GL_EXT_texture,GL_EXT_texture_compression_s3tc,GL_EXT_texture_sRGB,GL_EXT_texture_swizzle,GL_EXT_vertex_array,GL_EXT_vertex_shader" Online: - Too many extensions + http://glad.dav1d.de/#profile=core&language=c&specification=gl&api=gl%3D3.3&extensions=GL_AMD_debug_output&extensions=GL_AMD_query_buffer_object&extensions=GL_ARB_ES2_compatibility&extensions=GL_ARB_ES3_compatibility&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_compatibility&extensions=GL_ARB_compressed_texture_pixel_storage&extensions=GL_ARB_debug_output&extensions=GL_ARB_depth_buffer_float&extensions=GL_ARB_depth_clamp&extensions=GL_ARB_depth_texture&extensions=GL_ARB_draw_buffers&extensions=GL_ARB_draw_buffers_blend&extensions=GL_ARB_explicit_attrib_location&extensions=GL_ARB_explicit_uniform_location&extensions=GL_ARB_fragment_program&extensions=GL_ARB_fragment_shader&extensions=GL_ARB_framebuffer_object&extensions=GL_ARB_framebuffer_sRGB&extensions=GL_ARB_multisample&extensions=GL_ARB_sample_locations&extensions=GL_ARB_texture_compression&extensions=GL_ARB_texture_float&extensions=GL_ARB_texture_multisample&extensions=GL_ARB_texture_non_power_of_two&extensions=GL_ARB_texture_rg&extensions=GL_ARB_texture_swizzle&extensions=GL_ARB_uniform_buffer_object&extensions=GL_ARB_vertex_array_object&extensions=GL_ARB_vertex_attrib_binding&extensions=GL_ARB_vertex_buffer_object&extensions=GL_ARB_vertex_program&extensions=GL_ARB_vertex_shader&extensions=GL_ATI_element_array&extensions=GL_ATI_fragment_shader&extensions=GL_ATI_vertex_array_object&extensions=GL_EXT_blend_color&extensions=GL_EXT_blend_equation_separate&extensions=GL_EXT_blend_func_separate&extensions=GL_EXT_framebuffer_blit&extensions=GL_EXT_framebuffer_multisample&extensions=GL_EXT_framebuffer_multisample_blit_scaled&extensions=GL_EXT_framebuffer_object&extensions=GL_EXT_framebuffer_sRGB&extensions=GL_EXT_index_array_formats&extensions=GL_EXT_texture&extensions=GL_EXT_texture_compression_s3tc&extensions=GL_EXT_texture_sRGB&extensions=GL_EXT_texture_swizzle&extensions=GL_EXT_vertex_array&extensions=GL_EXT_vertex_shader */ -////////////////////////////////////////////////////////////////////////////// -// -// INCLUDE SECTION -// #ifndef __glad_h_ #define __glad_h_ @@ -2154,750 +2150,52 @@ typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint* GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv #endif -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F -#define GL_IS_PER_PATCH 0x92E7 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B -#define GL_SAMPLES_ARB 0x80A9 -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 -#define GL_DEPTH_CLAMP_NV 0x864F -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -#define GL_EYE_PLANE 0x2502 -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#define GL_WRAP_BORDER_SUN 0x81D4 -#define GL_HALF_FLOAT_ARB 0x140B -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D -#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 -#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE_EXT 0x8258 -#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 -#define GL_NOP_COMMAND_NV 0x0001 -#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 -#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 -#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 -#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 -#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 -#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 -#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 -#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 -#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A -#define GL_BLEND_COLOR_COMMAND_NV 0x000B -#define GL_STENCIL_REF_COMMAND_NV 0x000C -#define GL_LINE_WIDTH_COMMAND_NV 0x000D -#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E -#define GL_ALPHA_REF_COMMAND_NV 0x000F -#define GL_VIEWPORT_COMMAND_NV 0x0010 -#define GL_SCISSOR_COMMAND_NV 0x0011 -#define GL_FRONT_FACE_COMMAND_NV 0x0012 -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#define GL_INTERLACE_READ_INGR 0x8568 -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F -#define GL_LAYER_NV 0x8DAA -#define GL_NEXT_BUFFER_NV -2 -#define GL_SKIP_COMPONENTS4_NV -3 -#define GL_SKIP_COMPONENTS3_NV -4 -#define GL_SKIP_COMPONENTS2_NV -5 -#define GL_SKIP_COMPONENTS1_NV -6 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET 0x8252 -#define GL_GUILTY_CONTEXT_RESET 0x8253 -#define GL_INNOCENT_CONTEXT_RESET 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 -#define GL_NO_RESET_NOTIFICATION 0x8261 -#define GL_CONTEXT_LOST 0x0507 -#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 -#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 -#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 -#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 -#define GL_CONTEXT_LOST_KHR 0x0507 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -#define GL_NEGATIVE_ONE_TO_ONE 0x935E -#define GL_ZERO_TO_ONE 0x935F -#define GL_CLIP_ORIGIN 0x935C -#define GL_CLIP_DEPTH_MODE 0x935D -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_RGB565 0x8D62 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B #define GL_MAP_PERSISTENT_BIT 0x0040 #define GL_MAP_COHERENT_BIT 0x0080 #define GL_DYNAMIC_STORAGE_BIT 0x0100 @@ -2905,153 +2203,64 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 #define GL_BUFFER_IMMUTABLE_STORAGE 0x821F #define GL_BUFFER_STORAGE_FLAGS 0x8220 -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 #define GL_MAX_UNIFORM_LOCATIONS 0x826E -#define GL_SHARED_EDGE_NV 0xC0 -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#define GL_LIST_PRIORITY_SGIX 0x8182 -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 -#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E -#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F -#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 -#define GL_COLORBURN_NV 0x929A -#define GL_COLORDODGE_NV 0x9299 -#define GL_CONJOINT_NV 0x9284 -#define GL_CONTRAST_NV 0x92A1 -#define GL_DARKEN_NV 0x9297 -#define GL_DIFFERENCE_NV 0x929E -#define GL_DISJOINT_NV 0x9283 -#define GL_DST_ATOP_NV 0x928F -#define GL_DST_IN_NV 0x928B -#define GL_DST_NV 0x9287 -#define GL_DST_OUT_NV 0x928D -#define GL_DST_OVER_NV 0x9289 -#define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 -#define GL_HARDLIGHT_NV 0x929B -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_INVERT_OVG_NV 0x92B4 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LIGHTEN_NV 0x9298 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_MINUS_NV 0x929F -#define GL_MULTIPLY_NV 0x9294 -#define GL_OVERLAY_NV 0x9296 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 -#define GL_SCREEN_NV 0x9295 -#define GL_SOFTLIGHT_NV 0x929C -#define GL_SRC_ATOP_NV 0x928E -#define GL_SRC_IN_NV 0x928A -#define GL_SRC_NV 0x9286 -#define GL_SRC_OUT_NV 0x928C -#define GL_SRC_OVER_NV 0x9288 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#define GL_VERTICES_SUBMITTED_ARB 0x82EE -#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_LENGTH_ARB 0x8627 #define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 #define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 #define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 #define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 @@ -3068,14 +2277,31 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD #define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE #define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 #define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 #define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 #define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 #define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 #define GL_MATRIX0_ARB 0x88C0 #define GL_MATRIX1_ARB 0x88C1 #define GL_MATRIX2_ARB 0x88C2 @@ -3108,304 +2334,111 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define GL_MATRIX29_ARB 0x88DD #define GL_MATRIX30_ARB 0x88DE #define GL_MATRIX31_ARB 0x88DF -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 -#define GL_TIME_ELAPSED_EXT 0x88BF -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 -#define GL_DEBUG_SOURCE_API_KHR 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A -#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B -#define GL_DEBUG_TYPE_ERROR_KHR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 -#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 -#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D -#define GL_BUFFER_KHR 0x82E0 -#define GL_SHADER_KHR 0x82E1 -#define GL_PROGRAM_KHR 0x82E2 -#define GL_VERTEX_ARRAY_KHR 0x8074 -#define GL_QUERY_KHR 0x82E3 -#define GL_PROGRAM_PIPELINE_KHR 0x82E4 -#define GL_SAMPLER_KHR 0x82E6 -#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 -#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 -#define GL_DEBUG_OUTPUT_KHR 0x92E0 -#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 -#define GL_STACK_OVERFLOW_KHR 0x0503 -#define GL_STACK_UNDERFLOW_KHR 0x0504 -#define GL_DISPLAY_LIST 0x82E7 -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 -#define GL_LINES_ADJACENCY_EXT 0x000A -#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B -#define GL_TRIANGLES_ADJACENCY_EXT 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 #define GL_VERTEX_SHADER_ARB 0x8B31 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A #define GL_MAX_VARYING_FLOATS_ARB 0x8B4B @@ -3413,511 +2446,314 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#define GL_PATCHES 0x000E -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_QUADS 0x0007 -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF -#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_BLEND_EQUATION_EXT 0x8009 -#define GL_PACK_INVERT_MESA 0x8758 -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#define GL_INTERLACE_SGIX 0x8094 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 -#define GL_TEXTURE_TARGET 0x1006 -#define GL_QUERY_TARGET 0x82EA -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_RESCALE_NORMAL_EXT 0x803A -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 #define GL_CONSTANT_COLOR_EXT 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 #define GL_CONSTANT_ALPHA_EXT 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 #define GL_BLEND_COLOR_EXT 0x8005 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F -#define GL_MAX_CULL_DISTANCES 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 #define GL_OP_MUL_EXT 0x8786 #define GL_OP_ADD_EXT 0x8787 #define GL_OP_MADD_EXT 0x8788 @@ -4022,16121 +2858,1965 @@ GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; #define GL_INVARIANT_DATATYPE_EXT 0x87EB #define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC #define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -#define GL_MAX_VERTEX_STREAMS 0x8E71 -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F -#define GL_ASYNC_MARKER_SGIX 0x8329 -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_RGB565 0x8D62 -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF -#define GL_HALF_FLOAT_NV 0x140B -#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE -#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 -#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_EQUATION 0x8009 -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD -#define GL_ABGR_EXT 0x8000 -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#define GL_CULL_VERTEX_IBM 103050 -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#define GL_UNSIGNED_INT64_ARB 0x140F -#define GL_NUM_SAMPLE_COUNTS 0x9380 -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_ALL_SHADER_BITS 0xFFFFFFFF -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 -#define GL_FILL_RECTANGLE_NV 0x933C -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 -#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_QUERY_WAIT_INVERTED 0x8E17 -#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 -#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 -#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F -#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 -#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#define GL_SLICE_ACCUM_SUN 0x85CC -#define GL_LINES_ADJACENCY_ARB 0x000A -#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B -#define GL_TRIANGLES_ADJACENCY_ARB 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -#define GL_FOG 0x0B60 -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#define GL_CLEAR_TEXTURE 0x9365 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_CLOSE_PATH_NV 0x00 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_BOLD_BIT_NV 0x01 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_2_BYTES_NV 0x1407 -#define GL_3_BYTES_NV 0x1408 -#define GL_4_BYTES_NV 0x1409 -#define GL_EYE_LINEAR_NV 0x2400 -#define GL_OBJECT_LINEAR_NV 0x2401 -#define GL_CONSTANT_NV 0x8576 -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D -#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 -#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A -#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#define GL_RGB_422_APPLE 0x8A1F -#define GL_RGB_RAW_422_APPLE 0x8A51 -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#define GL_INT64_ARB 0x140E -#define GL_INT64_VEC2_ARB 0x8FE9 -#define GL_INT64_VEC3_ARB 0x8FEA -#define GL_INT64_VEC4_ARB 0x8FEB -#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_SRGB_DECODE_ARB 0x8299 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#define GL_SYNC_X11_FENCE_EXT 0x90E1 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -#define GL_FIXED_OES 0x140C -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 -#define GL_WEIGHTED_AVERAGE_ARB 0x9367 -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 -#define GL_COMPLETION_STATUS_ARB 0x91B1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 -#define GL_SAMPLE_LOCATION_ARB 0x8E50 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 -#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 -#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -GLAPI int GLAD_GL_SGIX_pixel_tiles; -#endif -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 -GLAPI int GLAD_GL_EXT_post_depth_coverage; -#endif -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -GLAPI int GLAD_GL_APPLE_element_array; -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC)(GLenum type, const void* pointer); -GLAPI PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; -#define glElementPointerAPPLE glad_glElementPointerAPPLE -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; -#define glDrawElementArrayAPPLE glad_glDrawElementArrayAPPLE -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -GLAPI PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; -#define glDrawRangeElementArrayAPPLE glad_glDrawRangeElementArrayAPPLE -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; -#define glMultiDrawElementArrayAPPLE glad_glMultiDrawElementArrayAPPLE -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)(GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; -#define glMultiDrawRangeElementArrayAPPLE glad_glMultiDrawRangeElementArrayAPPLE -#endif -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 -GLAPI int GLAD_GL_AMD_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)(GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; -#define glMultiDrawArraysIndirectAMD glad_glMultiDrawArraysIndirectAMD -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; -#define glMultiDrawElementsIndirectAMD glad_glMultiDrawElementsIndirectAMD -#endif -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -GLAPI int GLAD_GL_EXT_blend_subtract; -#endif -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -GLAPI int GLAD_GL_SGIX_tag_sample_buffer; -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC)(); -GLAPI PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; -#define glTagSampleBufferSGIX glad_glTagSampleBufferSGIX -#endif -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -GLAPI int GLAD_GL_NV_point_sprite; -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC)(GLenum pname, GLint param); -GLAPI PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; -#define glPointParameteriNV glad_glPointParameteriNV -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; -#define glPointParameterivNV glad_glPointParameterivNV -#endif -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 -GLAPI int GLAD_GL_IBM_texture_mirrored_repeat; -#endif -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -GLAPI int GLAD_GL_APPLE_transform_hint; -#endif -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -GLAPI int GLAD_GL_ATI_separate_stencil; -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GLAPI PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; -#define glStencilOpSeparateATI glad_glStencilOpSeparateATI -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -GLAPI PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; -#define glStencilFuncSeparateATI glad_glStencilFuncSeparateATI -#endif -#ifndef GL_NV_shader_atomic_int64 -#define GL_NV_shader_atomic_int64 1 -GLAPI int GLAD_GL_NV_shader_atomic_int64; -#endif -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -GLAPI int GLAD_GL_NV_vertex_program2_option; -#endif -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 -GLAPI int GLAD_GL_EXT_texture_buffer_object; -typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; -#define glTexBufferEXT glad_glTexBufferEXT -#endif -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -GLAPI int GLAD_GL_ARB_vertex_blend; -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC)(GLint size, const GLbyte* weights); -GLAPI PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; -#define glWeightbvARB glad_glWeightbvARB -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC)(GLint size, const GLshort* weights); -GLAPI PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; -#define glWeightsvARB glad_glWeightsvARB -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC)(GLint size, const GLint* weights); -GLAPI PFNGLWEIGHTIVARBPROC glad_glWeightivARB; -#define glWeightivARB glad_glWeightivARB -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC)(GLint size, const GLfloat* weights); -GLAPI PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; -#define glWeightfvARB glad_glWeightfvARB -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC)(GLint size, const GLdouble* weights); -GLAPI PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; -#define glWeightdvARB glad_glWeightdvARB -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC)(GLint size, const GLubyte* weights); -GLAPI PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; -#define glWeightubvARB glad_glWeightubvARB -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC)(GLint size, const GLushort* weights); -GLAPI PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; -#define glWeightusvARB glad_glWeightusvARB -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC)(GLint size, const GLuint* weights); -GLAPI PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; -#define glWeightuivARB glad_glWeightuivARB -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; -#define glWeightPointerARB glad_glWeightPointerARB -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC)(GLint count); -GLAPI PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; -#define glVertexBlendARB glad_glVertexBlendARB -#endif -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 -GLAPI int GLAD_GL_OVR_multiview; -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -GLAPI PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; -#define glFramebufferTextureMultiviewOVR glad_glFramebufferTextureMultiviewOVR -#endif -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -GLAPI int GLAD_GL_NV_vertex_program2; -#endif -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 -GLAPI int GLAD_GL_ARB_program_interface_query; -typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC)(GLuint program, GLenum programInterface, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; -#define glGetProgramInterfaceiv glad_glGetProgramInterfaceiv -typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; -#define glGetProgramResourceIndex glad_glGetProgramResourceIndex -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; -#define glGetProgramResourceName glad_glGetProgramResourceName -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params); -GLAPI PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; -#define glGetProgramResourceiv glad_glGetProgramResourceiv -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; -#define glGetProgramResourceLocation glad_glGetProgramResourceLocation -typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)(GLuint program, GLenum programInterface, const GLchar* name); -GLAPI PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; -#define glGetProgramResourceLocationIndex glad_glGetProgramResourceLocationIndex -#endif -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -GLAPI int GLAD_GL_EXT_misc_attribute; -#endif -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 -GLAPI int GLAD_GL_NV_multisample_coverage; -#endif -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 -GLAPI int GLAD_GL_ARB_shading_language_packing; -#endif -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 -GLAPI int GLAD_GL_EXT_texture_cube_map; -#endif -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 -GLAPI int GLAD_GL_NV_viewport_array2; -#endif -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 -GLAPI int GLAD_GL_ARB_texture_stencil8; -#endif -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -GLAPI int GLAD_GL_EXT_index_func; -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC)(GLenum func, GLclampf ref); -GLAPI PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; -#define glIndexFuncEXT glad_glIndexFuncEXT -#endif -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 -GLAPI int GLAD_GL_OES_compressed_paletted_texture; -#endif -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -GLAPI int GLAD_GL_NV_depth_clamp; -#endif -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 -GLAPI int GLAD_GL_NV_shader_buffer_load; -typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; -#define glMakeBufferResidentNV glad_glMakeBufferResidentNV -typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC)(GLenum target); -GLAPI PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; -#define glMakeBufferNonResidentNV glad_glMakeBufferNonResidentNV -typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC)(GLenum target); -GLAPI PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; -#define glIsBufferResidentNV glad_glIsBufferResidentNV -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; -#define glMakeNamedBufferResidentNV glad_glMakeNamedBufferResidentNV -typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)(GLuint buffer); -GLAPI PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; -#define glMakeNamedBufferNonResidentNV glad_glMakeNamedBufferNonResidentNV -typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC)(GLuint buffer); -GLAPI PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; -#define glIsNamedBufferResidentNV glad_glIsNamedBufferResidentNV -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC)(GLenum target, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; -#define glGetBufferParameterui64vNV glad_glGetBufferParameterui64vNV -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)(GLuint buffer, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; -#define glGetNamedBufferParameterui64vNV glad_glGetNamedBufferParameterui64vNV -typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC)(GLenum value, GLuint64EXT* result); -GLAPI PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; -#define glGetIntegerui64vNV glad_glGetIntegerui64vNV -typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC)(GLint location, GLuint64EXT value); -GLAPI PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; -#define glUniformui64NV glad_glUniformui64NV -typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; -#define glUniformui64vNV glad_glUniformui64vNV -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLuint64EXT* params); -GLAPI PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; -#define glGetUniformui64vNV glad_glGetUniformui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC)(GLuint program, GLint location, GLuint64EXT value); -GLAPI PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; -#define glProgramUniformui64NV glad_glProgramUniformui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; -#define glProgramUniformui64vNV glad_glProgramUniformui64vNV -#endif -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -GLAPI int GLAD_GL_EXT_color_subtable; -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; -#define glColorSubTableEXT glad_glColorSubTableEXT -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; -#define glCopyColorSubTableEXT glad_glCopyColorSubTableEXT -#endif -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -GLAPI int GLAD_GL_SUNX_constant_data; -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC)(); -GLAPI PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; -#define glFinishTextureSUNX glad_glFinishTextureSUNX -#endif -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 -GLAPI int GLAD_GL_EXT_texture_compression_s3tc; -#endif -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -GLAPI int GLAD_GL_EXT_multi_draw_arrays; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); -GLAPI PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; -#define glMultiDrawArraysEXT glad_glMultiDrawArraysEXT -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC)(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount); -GLAPI PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; -#define glMultiDrawElementsEXT glad_glMultiDrawElementsEXT -#endif -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 -GLAPI int GLAD_GL_ARB_shader_atomic_counters; -typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)(GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); -GLAPI PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; -#define glGetActiveAtomicCounterBufferiv glad_glGetActiveAtomicCounterBufferiv -#endif -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 -GLAPI int GLAD_GL_ARB_arrays_of_arrays; -#endif -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 -GLAPI int GLAD_GL_NV_conditional_render; -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC)(GLuint id, GLenum mode); -GLAPI PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; -#define glBeginConditionalRenderNV glad_glBeginConditionalRenderNV -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; -#define glEndConditionalRenderNV glad_glEndConditionalRenderNV -#endif -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -GLAPI int GLAD_GL_EXT_texture_env_combine; -#endif -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -GLAPI int GLAD_GL_NV_fog_distance; -#endif -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -GLAPI int GLAD_GL_SGIX_async_histogram; -#endif -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -GLAPI int GLAD_GL_MESA_resize_buffers; -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC)(); -GLAPI PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; -#define glResizeBuffersMESA glad_glResizeBuffersMESA -#endif -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -GLAPI int GLAD_GL_NV_light_max_exponent; -#endif -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -GLAPI int GLAD_GL_NV_texture_env_combine4; -#endif -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 -GLAPI int GLAD_GL_ARB_texture_view; -typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC)(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); -GLAPI PFNGLTEXTUREVIEWPROC glad_glTextureView; -#define glTextureView glad_glTextureView -#endif -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -GLAPI int GLAD_GL_ARB_texture_env_combine; -#endif -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 -GLAPI int GLAD_GL_ARB_map_buffer_range; -#endif -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -GLAPI int GLAD_GL_EXT_convolution; -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; -#define glConvolutionFilter1DEXT glad_glConvolutionFilter1DEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; -#define glConvolutionFilter2DEXT glad_glConvolutionFilter2DEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat params); -GLAPI PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; -#define glConvolutionParameterfEXT glad_glConvolutionParameterfEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; -#define glConvolutionParameterfvEXT glad_glConvolutionParameterfvEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint params); -GLAPI PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; -#define glConvolutionParameteriEXT glad_glConvolutionParameteriEXT -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; -#define glConvolutionParameterivEXT glad_glConvolutionParameterivEXT -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; -#define glCopyConvolutionFilter1DEXT glad_glCopyConvolutionFilter1DEXT -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; -#define glCopyConvolutionFilter2DEXT glad_glCopyConvolutionFilter2DEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* image); -GLAPI PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; -#define glGetConvolutionFilterEXT glad_glGetConvolutionFilterEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; -#define glGetConvolutionParameterfvEXT glad_glGetConvolutionParameterfvEXT -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; -#define glGetConvolutionParameterivEXT glad_glGetConvolutionParameterivEXT -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -GLAPI PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; -#define glGetSeparableFilterEXT glad_glGetSeparableFilterEXT -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); -GLAPI PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; -#define glSeparableFilter2DEXT glad_glSeparableFilter2DEXT -#endif -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 -GLAPI int GLAD_GL_NV_compute_program5; -#endif -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 -GLAPI int GLAD_GL_NV_vertex_attrib_integer_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC)(GLuint index, GLint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; -#define glVertexAttribL1i64NV glad_glVertexAttribL1i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; -#define glVertexAttribL2i64NV glad_glVertexAttribL2i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; -#define glVertexAttribL3i64NV glad_glVertexAttribL3i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC)(GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; -#define glVertexAttribL4i64NV glad_glVertexAttribL4i64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; -#define glVertexAttribL1i64vNV glad_glVertexAttribL1i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; -#define glVertexAttribL2i64vNV glad_glVertexAttribL2i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; -#define glVertexAttribL3i64vNV glad_glVertexAttribL3i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC)(GLuint index, const GLint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; -#define glVertexAttribL4i64vNV glad_glVertexAttribL4i64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC)(GLuint index, GLuint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; -#define glVertexAttribL1ui64NV glad_glVertexAttribL1ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; -#define glVertexAttribL2ui64NV glad_glVertexAttribL2ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; -#define glVertexAttribL3ui64NV glad_glVertexAttribL3ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC)(GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; -#define glVertexAttribL4ui64NV glad_glVertexAttribL4ui64NV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; -#define glVertexAttribL1ui64vNV glad_glVertexAttribL1ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; -#define glVertexAttribL2ui64vNV glad_glVertexAttribL2ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; -#define glVertexAttribL3ui64vNV glad_glVertexAttribL3ui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; -#define glVertexAttribL4ui64vNV glad_glVertexAttribL4ui64vNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC)(GLuint index, GLenum pname, GLint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; -#define glGetVertexAttribLi64vNV glad_glGetVertexAttribLi64vNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC)(GLuint index, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; -#define glGetVertexAttribLui64vNV glad_glGetVertexAttribLui64vNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; -#define glVertexAttribLFormatNV glad_glVertexAttribLFormatNV -#endif -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -GLAPI int GLAD_GL_EXT_paletted_texture; -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; -#define glColorTableEXT glad_glColorTableEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC)(GLenum target, GLenum format, GLenum type, void* data); -GLAPI PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; -#define glGetColorTableEXT glad_glGetColorTableEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; -#define glGetColorTableParameterivEXT glad_glGetColorTableParameterivEXT -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; -#define glGetColorTableParameterfvEXT glad_glGetColorTableParameterfvEXT -#endif -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 -GLAPI int GLAD_GL_ARB_texture_buffer_object; -typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC)(GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; -#define glTexBufferARB glad_glTexBufferARB -#endif -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -GLAPI int GLAD_GL_ATI_pn_triangles; -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC)(GLenum pname, GLint param); -GLAPI PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; -#define glPNTrianglesiATI glad_glPNTrianglesiATI -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; -#define glPNTrianglesfATI glad_glPNTrianglesfATI -#endif -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -GLAPI int GLAD_GL_SGIX_resample; -#endif -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -GLAPI int GLAD_GL_SGIX_flush_raster; -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC)(); -GLAPI PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; -#define glFlushRasterSGIX glad_glFlushRasterSGIX -#endif -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -GLAPI int GLAD_GL_EXT_light_texture; -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC)(GLenum mode); -GLAPI PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; -#define glApplyTextureEXT glad_glApplyTextureEXT -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC)(GLenum pname); -GLAPI PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; -#define glTextureLightEXT glad_glTextureLightEXT -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC)(GLenum face, GLenum mode); -GLAPI PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; -#define glTextureMaterialEXT glad_glTextureMaterialEXT -#endif -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -GLAPI int GLAD_GL_ARB_point_sprite; -#endif -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -GLAPI int GLAD_GL_SUN_convolution_border_modes; -#endif -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 -GLAPI int GLAD_GL_NV_parameter_buffer_object2; -#endif -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -GLAPI int GLAD_GL_ARB_half_float_pixel; -#endif -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 -GLAPI int GLAD_GL_NV_tessellation_program5; -#endif -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -GLAPI int GLAD_GL_REND_screen_coordinates; -#endif -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -GLAPI int GLAD_GL_HP_image_transform; -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; -#define glImageTransformParameteriHP glad_glImageTransformParameteriHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; -#define glImageTransformParameterfHP glad_glImageTransformParameterfHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; -#define glImageTransformParameterivHP glad_glImageTransformParameterivHP -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; -#define glImageTransformParameterfvHP glad_glImageTransformParameterfvHP -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; -#define glGetImageTransformParameterivHP glad_glGetImageTransformParameterivHP -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; -#define glGetImageTransformParameterfvHP glad_glGetImageTransformParameterfvHP -#endif -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 -GLAPI int GLAD_GL_EXT_packed_float; -#endif -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -GLAPI int GLAD_GL_OML_subsample; -#endif -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -GLAPI int GLAD_GL_SGIX_vertex_preclip; -#endif -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -GLAPI int GLAD_GL_SGIX_texture_scale_bias; -#endif -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 -GLAPI int GLAD_GL_AMD_draw_buffers_blend; -typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC)(GLuint buf, GLenum src, GLenum dst); -GLAPI PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; -#define glBlendFuncIndexedAMD glad_glBlendFuncIndexedAMD -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; -#define glBlendFuncSeparateIndexedAMD glad_glBlendFuncSeparateIndexedAMD -typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC)(GLuint buf, GLenum mode); -GLAPI PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; -#define glBlendEquationIndexedAMD glad_glBlendEquationIndexedAMD -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; -#define glBlendEquationSeparateIndexedAMD glad_glBlendEquationSeparateIndexedAMD -#endif -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 -GLAPI int GLAD_GL_APPLE_texture_range; -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC)(GLenum target, GLsizei length, const void* pointer); -GLAPI PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; -#define glTextureRangeAPPLE glad_glTextureRangeAPPLE -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; -#define glGetTexParameterPointervAPPLE glad_glGetTexParameterPointervAPPLE -#endif -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 -GLAPI int GLAD_GL_EXT_texture_array; -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; -#define glFramebufferTextureLayerEXT glad_glFramebufferTextureLayerEXT -#endif -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 -GLAPI int GLAD_GL_NV_texture_barrier; -typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC)(); -GLAPI PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; -#define glTextureBarrierNV glad_glTextureBarrierNV -#endif -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 -GLAPI int GLAD_GL_ARB_texture_query_levels; -#endif -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -GLAPI int GLAD_GL_NV_texgen_emboss; -#endif -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 -GLAPI int GLAD_GL_EXT_texture_swizzle; -#endif -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 -GLAPI int GLAD_GL_ARB_texture_rg; -#endif -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 -GLAPI int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; -#endif -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -GLAPI int GLAD_GL_ARB_fragment_shader; -#endif -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -GLAPI int GLAD_GL_3DFX_tbuffer; -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC)(GLuint mask); -GLAPI PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; -#define glTbufferMask3DFX glad_glTbufferMask3DFX -#endif -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 -GLAPI int GLAD_GL_GREMEDY_frame_terminator; -typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC)(); -GLAPI PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; -#define glFrameTerminatorGREMEDY glad_glFrameTerminatorGREMEDY -#endif -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 -GLAPI int GLAD_GL_ARB_blend_func_extended; -#endif -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 -GLAPI int GLAD_GL_EXT_separate_shader_objects; -typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC)(GLenum type, GLuint program); -GLAPI PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; -#define glUseShaderProgramEXT glad_glUseShaderProgramEXT -typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC)(GLuint program); -GLAPI PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; -#define glActiveProgramEXT glad_glActiveProgramEXT -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC)(GLenum type, const GLchar* string); -GLAPI PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; -#define glCreateShaderProgramEXT glad_glCreateShaderProgramEXT -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC)(GLuint pipeline, GLuint program); -GLAPI PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; -#define glActiveShaderProgramEXT glad_glActiveShaderProgramEXT -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; -#define glBindProgramPipelineEXT glad_glBindProgramPipelineEXT -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC)(GLenum type, GLsizei count, const GLchar** strings); -GLAPI PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; -#define glCreateShaderProgramvEXT glad_glCreateShaderProgramvEXT -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC)(GLsizei n, const GLuint* pipelines); -GLAPI PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; -#define glDeleteProgramPipelinesEXT glad_glDeleteProgramPipelinesEXT -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; -#define glGenProgramPipelinesEXT glad_glGenProgramPipelinesEXT -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; -#define glGetProgramPipelineInfoLogEXT glad_glGetProgramPipelineInfoLogEXT -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC)(GLuint pipeline, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; -#define glGetProgramPipelineivEXT glad_glGetProgramPipelineivEXT -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; -#define glIsProgramPipelineEXT glad_glIsProgramPipelineEXT -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; -#define glProgramParameteriEXT glad_glProgramParameteriEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC)(GLuint program, GLint location, GLfloat v0); -GLAPI PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; -#define glProgramUniform1fEXT glad_glProgramUniform1fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; -#define glProgramUniform1fvEXT glad_glProgramUniform1fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC)(GLuint program, GLint location, GLint v0); -GLAPI PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; -#define glProgramUniform1iEXT glad_glProgramUniform1iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; -#define glProgramUniform1ivEXT glad_glProgramUniform1ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; -#define glProgramUniform2fEXT glad_glProgramUniform2fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; -#define glProgramUniform2fvEXT glad_glProgramUniform2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1); -GLAPI PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; -#define glProgramUniform2iEXT glad_glProgramUniform2iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; -#define glProgramUniform2ivEXT glad_glProgramUniform2ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; -#define glProgramUniform3fEXT glad_glProgramUniform3fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; -#define glProgramUniform3fvEXT glad_glProgramUniform3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; -#define glProgramUniform3iEXT glad_glProgramUniform3iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; -#define glProgramUniform3ivEXT glad_glProgramUniform3ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; -#define glProgramUniform4fEXT glad_glProgramUniform4fEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; -#define glProgramUniform4fvEXT glad_glProgramUniform4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; -#define glProgramUniform4iEXT glad_glProgramUniform4iEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; -#define glProgramUniform4ivEXT glad_glProgramUniform4ivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; -#define glProgramUniformMatrix2fvEXT glad_glProgramUniformMatrix2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; -#define glProgramUniformMatrix3fvEXT glad_glProgramUniformMatrix3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; -#define glProgramUniformMatrix4fvEXT glad_glProgramUniformMatrix4fvEXT -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC)(GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; -#define glUseProgramStagesEXT glad_glUseProgramStagesEXT -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)(GLuint pipeline); -GLAPI PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; -#define glValidateProgramPipelineEXT glad_glValidateProgramPipelineEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC)(GLuint program, GLint location, GLuint v0); -GLAPI PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; -#define glProgramUniform1uiEXT glad_glProgramUniform1uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; -#define glProgramUniform2uiEXT glad_glProgramUniform2uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; -#define glProgramUniform3uiEXT glad_glProgramUniform3uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; -#define glProgramUniform4uiEXT glad_glProgramUniform4uiEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; -#define glProgramUniform1uivEXT glad_glProgramUniform1uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; -#define glProgramUniform2uivEXT glad_glProgramUniform2uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; -#define glProgramUniform3uivEXT glad_glProgramUniform3uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; -#define glProgramUniform4uivEXT glad_glProgramUniform4uivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; -#define glProgramUniformMatrix2x3fvEXT glad_glProgramUniformMatrix2x3fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; -#define glProgramUniformMatrix3x2fvEXT glad_glProgramUniformMatrix3x2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; -#define glProgramUniformMatrix2x4fvEXT glad_glProgramUniformMatrix2x4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; -#define glProgramUniformMatrix4x2fvEXT glad_glProgramUniformMatrix4x2fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; -#define glProgramUniformMatrix3x4fvEXT glad_glProgramUniformMatrix3x4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; -#define glProgramUniformMatrix4x3fvEXT glad_glProgramUniformMatrix4x3fvEXT -#endif -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 -GLAPI int GLAD_GL_NV_texture_multisample; -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; -#define glTexImage2DMultisampleCoverageNV glad_glTexImage2DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; -#define glTexImage3DMultisampleCoverageNV glad_glTexImage3DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; -#define glTextureImage2DMultisampleNV glad_glTextureImage2DMultisampleNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; -#define glTextureImage3DMultisampleNV glad_glTextureImage3DMultisampleNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; -#define glTextureImage2DMultisampleCoverageNV glad_glTextureImage2DMultisampleCoverageNV -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -GLAPI PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; -#define glTextureImage3DMultisampleCoverageNV glad_glTextureImage3DMultisampleCoverageNV -#endif -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -GLAPI int GLAD_GL_ARB_shader_objects; -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC)(GLhandleARB obj); -GLAPI PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; -#define glDeleteObjectARB glad_glDeleteObjectARB -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC)(GLenum pname); -GLAPI PFNGLGETHANDLEARBPROC glad_glGetHandleARB; -#define glGetHandleARB glad_glGetHandleARB -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB attachedObj); -GLAPI PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; -#define glDetachObjectARB glad_glDetachObjectARB -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC)(GLenum shaderType); -GLAPI PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; -#define glCreateShaderObjectARB glad_glCreateShaderObjectARB -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC)(GLhandleARB shaderObj, GLsizei count, const GLcharARB** string, const GLint* length); -GLAPI PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; -#define glShaderSourceARB glad_glShaderSourceARB -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC)(GLhandleARB shaderObj); -GLAPI PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; -#define glCompileShaderARB glad_glCompileShaderARB -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC)(); -GLAPI PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; -#define glCreateProgramObjectARB glad_glCreateProgramObjectARB -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC)(GLhandleARB containerObj, GLhandleARB obj); -GLAPI PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; -#define glAttachObjectARB glad_glAttachObjectARB -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC)(GLhandleARB programObj); -GLAPI PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; -#define glLinkProgramARB glad_glLinkProgramARB -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC)(GLhandleARB programObj); -GLAPI PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; -#define glUseProgramObjectARB glad_glUseProgramObjectARB -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC)(GLhandleARB programObj); -GLAPI PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; -#define glValidateProgramARB glad_glValidateProgramARB -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC)(GLint location, GLfloat v0); -GLAPI PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; -#define glUniform1fARB glad_glUniform1fARB -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC)(GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; -#define glUniform2fARB glad_glUniform2fARB -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; -#define glUniform3fARB glad_glUniform3fARB -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; -#define glUniform4fARB glad_glUniform4fARB -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC)(GLint location, GLint v0); -GLAPI PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; -#define glUniform1iARB glad_glUniform1iARB -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC)(GLint location, GLint v0, GLint v1); -GLAPI PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; -#define glUniform2iARB glad_glUniform2iARB -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; -#define glUniform3iARB glad_glUniform3iARB -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; -#define glUniform4iARB glad_glUniform4iARB -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; -#define glUniform1fvARB glad_glUniform1fvARB -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; -#define glUniform2fvARB glad_glUniform2fvARB -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; -#define glUniform3fvARB glad_glUniform3fvARB -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC)(GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; -#define glUniform4fvARB glad_glUniform4fvARB -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; -#define glUniform1ivARB glad_glUniform1ivARB -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; -#define glUniform2ivARB glad_glUniform2ivARB -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; -#define glUniform3ivARB glad_glUniform3ivARB -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC)(GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; -#define glUniform4ivARB glad_glUniform4ivARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; -#define glUniformMatrix2fvARB glad_glUniformMatrix2fvARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; -#define glUniformMatrix3fvARB glad_glUniformMatrix3fvARB -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; -#define glUniformMatrix4fvARB glad_glUniformMatrix4fvARB -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC)(GLhandleARB obj, GLenum pname, GLfloat* params); -GLAPI PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; -#define glGetObjectParameterfvARB glad_glGetObjectParameterfvARB -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC)(GLhandleARB obj, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; -#define glGetObjectParameterivARB glad_glGetObjectParameterivARB -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* infoLog); -GLAPI PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; -#define glGetInfoLogARB glad_glGetInfoLogARB -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC)(GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB* obj); -GLAPI PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; -#define glGetAttachedObjectsARB glad_glGetAttachedObjectsARB -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); -GLAPI PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; -#define glGetUniformLocationARB glad_glGetUniformLocationARB -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); -GLAPI PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; -#define glGetActiveUniformARB glad_glGetActiveUniformARB -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC)(GLhandleARB programObj, GLint location, GLfloat* params); -GLAPI PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; -#define glGetUniformfvARB glad_glGetUniformfvARB -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC)(GLhandleARB programObj, GLint location, GLint* params); -GLAPI PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; -#define glGetUniformivARB glad_glGetUniformivARB -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC)(GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB* source); -GLAPI PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; -#define glGetShaderSourceARB glad_glGetShaderSourceARB -#endif -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 -GLAPI int GLAD_GL_ARB_framebuffer_object; -#endif -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -GLAPI int GLAD_GL_ATI_envmap_bumpmap; -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC)(GLenum pname, const GLint* param); -GLAPI PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; -#define glTexBumpParameterivATI glad_glTexBumpParameterivATI -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC)(GLenum pname, const GLfloat* param); -GLAPI PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; -#define glTexBumpParameterfvATI glad_glTexBumpParameterfvATI -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC)(GLenum pname, GLint* param); -GLAPI PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; -#define glGetTexBumpParameterivATI glad_glGetTexBumpParameterivATI -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC)(GLenum pname, GLfloat* param); -GLAPI PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; -#define glGetTexBumpParameterfvATI glad_glGetTexBumpParameterfvATI -#endif -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 -GLAPI int GLAD_GL_ARB_robust_buffer_access_behavior; -#endif -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 -GLAPI int GLAD_GL_ARB_shader_stencil_export; -#endif -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -GLAPI int GLAD_GL_NV_texture_rectangle; -#endif -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 -GLAPI int GLAD_GL_ARB_enhanced_layouts; -#endif -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -GLAPI int GLAD_GL_ARB_texture_rectangle; -#endif -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -GLAPI int GLAD_GL_SGI_texture_color_table; -#endif -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -GLAPI int GLAD_GL_ATI_map_object_buffer; -typedef void* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; -#define glMapObjectBufferATI glad_glMapObjectBufferATI -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; -#define glUnmapObjectBufferATI glad_glUnmapObjectBufferATI -#endif -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -GLAPI int GLAD_GL_ARB_robustness; -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -#define glGetGraphicsResetStatusARB glad_glGetGraphicsResetStatusARB -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); -GLAPI PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -#define glGetnTexImageARB glad_glGetnTexImageARB -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -#define glReadnPixelsARB glad_glReadnPixelsARB -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint lod, GLsizei bufSize, void* img); -GLAPI PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -#define glGetnCompressedTexImageARB glad_glGetnCompressedTexImageARB -typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -#define glGetnUniformfvARB glad_glGetnUniformfvARB -typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -#define glGetnUniformivARB glad_glGetnUniformivARB -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -#define glGetnUniformuivARB glad_glGetnUniformuivARB -typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLdouble* params); -GLAPI PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -#define glGetnUniformdvARB glad_glGetnUniformdvARB -typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); -GLAPI PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -#define glGetnMapdvARB glad_glGetnMapdvARB -typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); -GLAPI PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -#define glGetnMapfvARB glad_glGetnMapfvARB -typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLint* v); -GLAPI PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -#define glGetnMapivARB glad_glGetnMapivARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC)(GLenum map, GLsizei bufSize, GLfloat* values); -GLAPI PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -#define glGetnPixelMapfvARB glad_glGetnPixelMapfvARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC)(GLenum map, GLsizei bufSize, GLuint* values); -GLAPI PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -#define glGetnPixelMapuivARB glad_glGetnPixelMapuivARB -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC)(GLenum map, GLsizei bufSize, GLushort* values); -GLAPI PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -#define glGetnPixelMapusvARB glad_glGetnPixelMapusvARB -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC)(GLsizei bufSize, GLubyte* pattern); -GLAPI PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -#define glGetnPolygonStippleARB glad_glGetnPolygonStippleARB -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); -GLAPI PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -#define glGetnColorTableARB glad_glGetnColorTableARB -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); -GLAPI PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -#define glGetnConvolutionFilterARB glad_glGetnConvolutionFilterARB -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void* column, void* span); -GLAPI PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -#define glGetnSeparableFilterARB glad_glGetnSeparableFilterARB -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -GLAPI PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -#define glGetnHistogramARB glad_glGetnHistogramARB -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -GLAPI PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -#define glGetnMinmaxARB glad_glGetnMinmaxARB -#endif -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -GLAPI int GLAD_GL_NV_pixel_data_range; -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC)(GLenum target, GLsizei length, const void* pointer); -GLAPI PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; -#define glPixelDataRangeNV glad_glPixelDataRangeNV -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC)(GLenum target); -GLAPI PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; -#define glFlushPixelDataRangeNV glad_glFlushPixelDataRangeNV -#endif -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -GLAPI int GLAD_GL_EXT_framebuffer_blit; -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -#define glBlitFramebufferEXT glad_glBlitFramebufferEXT -#endif -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 -GLAPI int GLAD_GL_ARB_gpu_shader_fp64; -typedef void (APIENTRYP PFNGLUNIFORM1DPROC)(GLint location, GLdouble x); -GLAPI PFNGLUNIFORM1DPROC glad_glUniform1d; -#define glUniform1d glad_glUniform1d -typedef void (APIENTRYP PFNGLUNIFORM2DPROC)(GLint location, GLdouble x, GLdouble y); -GLAPI PFNGLUNIFORM2DPROC glad_glUniform2d; -#define glUniform2d glad_glUniform2d -typedef void (APIENTRYP PFNGLUNIFORM3DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLUNIFORM3DPROC glad_glUniform3d; -#define glUniform3d glad_glUniform3d -typedef void (APIENTRYP PFNGLUNIFORM4DPROC)(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLUNIFORM4DPROC glad_glUniform4d; -#define glUniform4d glad_glUniform4d -typedef void (APIENTRYP PFNGLUNIFORM1DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM1DVPROC glad_glUniform1dv; -#define glUniform1dv glad_glUniform1dv -typedef void (APIENTRYP PFNGLUNIFORM2DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM2DVPROC glad_glUniform2dv; -#define glUniform2dv glad_glUniform2dv -typedef void (APIENTRYP PFNGLUNIFORM3DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM3DVPROC glad_glUniform3dv; -#define glUniform3dv glad_glUniform3dv -typedef void (APIENTRYP PFNGLUNIFORM4DVPROC)(GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLUNIFORM4DVPROC glad_glUniform4dv; -#define glUniform4dv glad_glUniform4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; -#define glUniformMatrix2dv glad_glUniformMatrix2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; -#define glUniformMatrix3dv glad_glUniformMatrix3dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; -#define glUniformMatrix4dv glad_glUniformMatrix4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; -#define glUniformMatrix2x3dv glad_glUniformMatrix2x3dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; -#define glUniformMatrix2x4dv glad_glUniformMatrix2x4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; -#define glUniformMatrix3x2dv glad_glUniformMatrix3x2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; -#define glUniformMatrix3x4dv glad_glUniformMatrix3x4dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; -#define glUniformMatrix4x2dv glad_glUniformMatrix4x2dv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; -#define glUniformMatrix4x3dv glad_glUniformMatrix4x3dv -typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC)(GLuint program, GLint location, GLdouble* params); -GLAPI PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; -#define glGetUniformdv glad_glGetUniformdv -#endif -#ifndef GL_NV_command_list -#define GL_NV_command_list 1 -GLAPI int GLAD_GL_NV_command_list; -typedef void (APIENTRYP PFNGLCREATESTATESNVPROC)(GLsizei n, GLuint* states); -GLAPI PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; -#define glCreateStatesNV glad_glCreateStatesNV -typedef void (APIENTRYP PFNGLDELETESTATESNVPROC)(GLsizei n, const GLuint* states); -GLAPI PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; -#define glDeleteStatesNV glad_glDeleteStatesNV -typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC)(GLuint state); -GLAPI PFNGLISSTATENVPROC glad_glIsStateNV; -#define glIsStateNV glad_glIsStateNV -typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC)(GLuint state, GLenum mode); -GLAPI PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; -#define glStateCaptureNV glad_glStateCaptureNV -typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC)(GLenum tokenID, GLuint size); -GLAPI PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; -#define glGetCommandHeaderNV glad_glGetCommandHeaderNV -typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC)(GLenum shadertype); -GLAPI PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; -#define glGetStageIndexNV glad_glGetStageIndexNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC)(GLenum primitiveMode, GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, GLuint count); -GLAPI PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; -#define glDrawCommandsNV glad_glDrawCommandsNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC)(GLenum primitiveMode, const GLuint64* indirects, const GLsizei* sizes, GLuint count); -GLAPI PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; -#define glDrawCommandsAddressNV glad_glDrawCommandsAddressNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC)(GLuint buffer, const GLintptr* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; -#define glDrawCommandsStatesNV glad_glDrawCommandsStatesNV -typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)(const GLuint64* indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; -#define glDrawCommandsStatesAddressNV glad_glDrawCommandsStatesAddressNV -typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC)(GLsizei n, GLuint* lists); -GLAPI PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; -#define glCreateCommandListsNV glad_glCreateCommandListsNV -typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC)(GLsizei n, const GLuint* lists); -GLAPI PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; -#define glDeleteCommandListsNV glad_glDeleteCommandListsNV -typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; -#define glIsCommandListNV glad_glIsCommandListNV -typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)(GLuint list, GLuint segment, const void** indirects, const GLsizei* sizes, const GLuint* states, const GLuint* fbos, GLuint count); -GLAPI PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; -#define glListDrawCommandsStatesClientNV glad_glListDrawCommandsStatesClientNV -typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC)(GLuint list, GLuint segments); -GLAPI PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; -#define glCommandListSegmentsNV glad_glCommandListSegmentsNV -typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; -#define glCompileCommandListNV glad_glCompileCommandListNV -typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC)(GLuint list); -GLAPI PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; -#define glCallCommandListNV glad_glCallCommandListNV -#endif -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -GLAPI int GLAD_GL_SGIX_depth_texture; -#endif -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -GLAPI int GLAD_GL_EXT_vertex_weighting; -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC)(GLfloat weight); -GLAPI PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; -#define glVertexWeightfEXT glad_glVertexWeightfEXT -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC)(const GLfloat* weight); -GLAPI PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; -#define glVertexWeightfvEXT glad_glVertexWeightfvEXT -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; -#define glVertexWeightPointerEXT glad_glVertexWeightPointerEXT -#endif -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -GLAPI int GLAD_GL_GREMEDY_string_marker; -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC)(GLsizei len, const void* string); -GLAPI PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; -#define glStringMarkerGREMEDY glad_glStringMarkerGREMEDY -#endif -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 -GLAPI int GLAD_GL_ARB_texture_compression_bptc; -#endif -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -GLAPI int GLAD_GL_EXT_subtexture; -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; -#define glTexSubImage1DEXT glad_glTexSubImage1DEXT -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; -#define glTexSubImage2DEXT glad_glTexSubImage2DEXT -#endif -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -GLAPI int GLAD_GL_EXT_pixel_transform_color_table; -#endif -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 -GLAPI int GLAD_GL_EXT_texture_compression_rgtc; -#endif -#ifndef GL_ARB_shader_atomic_counter_ops -#define GL_ARB_shader_atomic_counter_ops 1 -GLAPI int GLAD_GL_ARB_shader_atomic_counter_ops; -#endif -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -GLAPI int GLAD_GL_SGIX_depth_pass_instrument; -#endif -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 -GLAPI int GLAD_GL_EXT_gpu_program_parameters; -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; -#define glProgramEnvParameters4fvEXT glad_glProgramEnvParameters4fvEXT -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; -#define glProgramLocalParameters4fvEXT glad_glProgramLocalParameters4fvEXT -#endif -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -GLAPI int GLAD_GL_NV_evaluators; -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); -GLAPI PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; -#define glMapControlPointsNV glad_glMapControlPointsNV -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; -#define glMapParameterivNV glad_glMapParameterivNV -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; -#define glMapParameterfvNV glad_glMapParameterfvNV -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC)(GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); -GLAPI PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; -#define glGetMapControlPointsNV glad_glGetMapControlPointsNV -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; -#define glGetMapParameterivNV glad_glGetMapParameterivNV -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; -#define glGetMapParameterfvNV glad_glGetMapParameterfvNV -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; -#define glGetMapAttribParameterivNV glad_glGetMapAttribParameterivNV -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; -#define glGetMapAttribParameterfvNV glad_glGetMapAttribParameterfvNV -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC)(GLenum target, GLenum mode); -GLAPI PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; -#define glEvalMapsNV glad_glEvalMapsNV -#endif -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -GLAPI int GLAD_GL_SGIS_texture_filter4; -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLfloat* weights); -GLAPI PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; -#define glGetTexFilterFuncSGIS glad_glGetTexFilterFuncSGIS -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC)(GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); -GLAPI PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; -#define glTexFilterFuncSGIS glad_glTexFilterFuncSGIS -#endif -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 -GLAPI int GLAD_GL_AMD_performance_monitor; -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC)(GLint* numGroups, GLsizei groupsSize, GLuint* groups); -GLAPI PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; -#define glGetPerfMonitorGroupsAMD glad_glGetPerfMonitorGroupsAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC)(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters); -GLAPI PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; -#define glGetPerfMonitorCountersAMD glad_glGetPerfMonitorCountersAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString); -GLAPI PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; -#define glGetPerfMonitorGroupStringAMD glad_glGetPerfMonitorGroupStringAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString); -GLAPI PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; -#define glGetPerfMonitorCounterStringAMD glad_glGetPerfMonitorCounterStringAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)(GLuint group, GLuint counter, GLenum pname, void* data); -GLAPI PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; -#define glGetPerfMonitorCounterInfoAMD glad_glGetPerfMonitorCounterInfoAMD -typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); -GLAPI PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; -#define glGenPerfMonitorsAMD glad_glGenPerfMonitorsAMD -typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC)(GLsizei n, GLuint* monitors); -GLAPI PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; -#define glDeletePerfMonitorsAMD glad_glDeletePerfMonitorsAMD -typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); -GLAPI PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; -#define glSelectPerfMonitorCountersAMD glad_glSelectPerfMonitorCountersAMD -typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC)(GLuint monitor); -GLAPI PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; -#define glBeginPerfMonitorAMD glad_glBeginPerfMonitorAMD -typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC)(GLuint monitor); -GLAPI PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; -#define glEndPerfMonitorAMD glad_glEndPerfMonitorAMD -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten); -GLAPI PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; -#define glGetPerfMonitorCounterDataAMD glad_glGetPerfMonitorCounterDataAMD -#endif -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 -GLAPI int GLAD_GL_NV_geometry_shader4; -#endif -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 -GLAPI int GLAD_GL_EXT_stencil_clear_tag; -typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC)(GLsizei stencilTagBits, GLuint stencilClearTag); -GLAPI PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; -#define glStencilClearTagEXT glad_glStencilClearTagEXT -#endif -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -GLAPI int GLAD_GL_NV_vertex_program1_1; -#endif -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 -GLAPI int GLAD_GL_NV_present_video; -typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); -GLAPI PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; -#define glPresentFrameKeyedNV glad_glPresentFrameKeyedNV -typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC)(GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -GLAPI PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; -#define glPresentFrameDualFillNV glad_glPresentFrameDualFillNV -typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC)(GLuint video_slot, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; -#define glGetVideoivNV glad_glGetVideoivNV -typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC)(GLuint video_slot, GLenum pname, GLuint* params); -GLAPI PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; -#define glGetVideouivNV glad_glGetVideouivNV -typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC)(GLuint video_slot, GLenum pname, GLint64EXT* params); -GLAPI PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; -#define glGetVideoi64vNV glad_glGetVideoi64vNV -typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC)(GLuint video_slot, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; -#define glGetVideoui64vNV glad_glGetVideoui64vNV -#endif -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 -GLAPI int GLAD_GL_ARB_texture_compression_rgtc; -#endif -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -GLAPI int GLAD_GL_HP_convolution_border_modes; -#endif -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -GLAPI int GLAD_GL_EXT_shader_integer_mix; -#endif -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -GLAPI int GLAD_GL_SGIX_framezoom; -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC)(GLint factor); -GLAPI PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; -#define glFrameZoomSGIX glad_glFrameZoomSGIX -#endif -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 -GLAPI int GLAD_GL_ARB_stencil_texturing; -#endif -#ifndef GL_ARB_shader_clock -#define GL_ARB_shader_clock 1 -GLAPI int GLAD_GL_ARB_shader_clock; -#endif -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 -GLAPI int GLAD_GL_NV_shader_atomic_fp16_vector; -#endif -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -GLAPI int GLAD_GL_SGIX_fog_offset; -#endif -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 -GLAPI int GLAD_GL_ARB_draw_elements_base_vertex; -#endif -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -GLAPI int GLAD_GL_INGR_interlace_read; -#endif -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 -GLAPI int GLAD_GL_NV_transform_feedback; -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; -#define glBeginTransformFeedbackNV glad_glBeginTransformFeedbackNV -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; -#define glEndTransformFeedbackNV glad_glEndTransformFeedbackNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; -#define glTransformFeedbackAttribsNV glad_glTransformFeedbackAttribsNV -typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; -#define glBindBufferRangeNV glad_glBindBufferRangeNV -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; -#define glBindBufferOffsetNV glad_glBindBufferOffsetNV -typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; -#define glBindBufferBaseNV glad_glBindBufferBaseNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)(GLuint program, GLsizei count, const GLint* locations, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; -#define glTransformFeedbackVaryingsNV glad_glTransformFeedbackVaryingsNV -typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; -#define glActiveVaryingNV glad_glActiveVaryingNV -typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; -#define glGetVaryingLocationNV glad_glGetVaryingLocationNV -typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; -#define glGetActiveVaryingNV glad_glGetActiveVaryingNV -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)(GLuint program, GLuint index, GLint* location); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; -#define glGetTransformFeedbackVaryingNV glad_glGetTransformFeedbackVaryingNV -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)(GLsizei count, const GLint* attribs, GLsizei nbuffers, const GLint* bufstreams, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; -#define glTransformFeedbackStreamAttribsNV glad_glTransformFeedbackStreamAttribsNV -#endif -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -GLAPI int GLAD_GL_NV_fragment_program; -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; -#define glProgramNamedParameter4fNV glad_glProgramNamedParameter4fNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLfloat* v); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; -#define glProgramNamedParameter4fvNV glad_glProgramNamedParameter4fvNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; -#define glProgramNamedParameter4dNV glad_glProgramNamedParameter4dNV -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLdouble* v); -GLAPI PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; -#define glProgramNamedParameter4dvNV glad_glProgramNamedParameter4dvNV -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat* params); -GLAPI PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; -#define glGetProgramNamedParameterfvNV glad_glGetProgramNamedParameterfvNV -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble* params); -GLAPI PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; -#define glGetProgramNamedParameterdvNV glad_glGetProgramNamedParameterdvNV -#endif -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 -GLAPI int GLAD_GL_AMD_stencil_operation_extended; -typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC)(GLenum face, GLuint value); -GLAPI PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; -#define glStencilOpValueAMD glad_glStencilOpValueAMD -#endif -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 -GLAPI int GLAD_GL_ARB_seamless_cubemap_per_texture; -#endif -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 -GLAPI int GLAD_GL_ARB_instanced_arrays; -typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC)(GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; -#define glVertexAttribDivisorARB glad_glVertexAttribDivisorARB -#endif -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -GLAPI int GLAD_GL_EXT_polygon_offset; -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC)(GLfloat factor, GLfloat bias); -GLAPI PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; -#define glPolygonOffsetEXT glad_glPolygonOffsetEXT -#endif -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -GLAPI int GLAD_GL_NV_vertex_array_range2; -#endif -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -GLAPI int GLAD_GL_KHR_robustness; -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; -#define glGetGraphicsResetStatus glad_glGetGraphicsResetStatus -typedef void (APIENTRYP PFNGLREADNPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSPROC glad_glReadnPixels; -#define glReadnPixels glad_glReadnPixels -typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; -#define glGetnUniformfv glad_glGetnUniformfv -typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; -#define glGetnUniformiv glad_glGetnUniformiv -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; -#define glGetnUniformuiv glad_glGetnUniformuiv -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(); -GLAPI PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; -#define glGetGraphicsResetStatusKHR glad_glGetGraphicsResetStatusKHR -typedef void (APIENTRYP PFNGLREADNPIXELSKHRPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); -GLAPI PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; -#define glReadnPixelsKHR glad_glReadnPixelsKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMFVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -GLAPI PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; -#define glGetnUniformfvKHR glad_glGetnUniformfvKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; -#define glGetnUniformivKHR glad_glGetnUniformivKHR -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint* params); -GLAPI PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; -#define glGetnUniformuivKHR glad_glGetnUniformuivKHR -#endif -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 -GLAPI int GLAD_GL_AMD_sparse_texture; -typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; -#define glTexStorageSparseAMD glad_glTexStorageSparseAMD -typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC)(GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -GLAPI PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; -#define glTextureStorageSparseAMD glad_glTextureStorageSparseAMD -#endif -#ifndef GL_ARB_clip_control -#define GL_ARB_clip_control 1 -GLAPI int GLAD_GL_ARB_clip_control; -typedef void (APIENTRYP PFNGLCLIPCONTROLPROC)(GLenum origin, GLenum depth); -GLAPI PFNGLCLIPCONTROLPROC glad_glClipControl; -#define glClipControl glad_glClipControl -#endif -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 -GLAPI int GLAD_GL_NV_fragment_coverage_to_color; -typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC)(GLuint color); -GLAPI PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; -#define glFragmentCoverageColorNV glad_glFragmentCoverageColorNV -#endif -#ifndef GL_NV_fence -#define GL_NV_fence 1 -GLAPI int GLAD_GL_NV_fence; -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC)(GLsizei n, const GLuint* fences); -GLAPI PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; -#define glDeleteFencesNV glad_glDeleteFencesNV -typedef void (APIENTRYP PFNGLGENFENCESNVPROC)(GLsizei n, GLuint* fences); -GLAPI PFNGLGENFENCESNVPROC glad_glGenFencesNV; -#define glGenFencesNV glad_glGenFencesNV -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC)(GLuint fence); -GLAPI PFNGLISFENCENVPROC glad_glIsFenceNV; -#define glIsFenceNV glad_glIsFenceNV -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC)(GLuint fence); -GLAPI PFNGLTESTFENCENVPROC glad_glTestFenceNV; -#define glTestFenceNV glad_glTestFenceNV -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC)(GLuint fence, GLenum pname, GLint* params); -GLAPI PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; -#define glGetFenceivNV glad_glGetFenceivNV -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC)(GLuint fence); -GLAPI PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; -#define glFinishFenceNV glad_glFinishFenceNV -typedef void (APIENTRYP PFNGLSETFENCENVPROC)(GLuint fence, GLenum condition); -GLAPI PFNGLSETFENCENVPROC glad_glSetFenceNV; -#define glSetFenceNV glad_glSetFenceNV -#endif -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 -GLAPI int GLAD_GL_ARB_texture_buffer_range; -typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC)(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; -#define glTexBufferRange glad_glTexBufferRange -#endif -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -GLAPI int GLAD_GL_SUN_mesh_array; -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC)(GLenum mode, GLint first, GLsizei count, GLsizei width); -GLAPI PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; -#define glDrawMeshArraysSUN glad_glDrawMeshArraysSUN -#endif -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 -GLAPI int GLAD_GL_ARB_vertex_attrib_binding; -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -#define glBindVertexBuffer glad_glBindVertexBuffer -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -#define glVertexAttribFormat glad_glVertexAttribFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -#define glVertexAttribIFormat glad_glVertexAttribIFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -#define glVertexAttribLFormat glad_glVertexAttribLFormat -typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC)(GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -#define glVertexAttribBinding glad_glVertexAttribBinding -typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC)(GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -#define glVertexBindingDivisor glad_glVertexBindingDivisor -#endif -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 -GLAPI int GLAD_GL_ARB_framebuffer_no_attachments; -typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; -#define glFramebufferParameteri glad_glFramebufferParameteri -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; -#define glGetFramebufferParameteriv glad_glGetFramebufferParameteriv -#endif -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 -GLAPI int GLAD_GL_ARB_cl_event; -typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC)(struct _cl_context* context, struct _cl_event* event, GLbitfield flags); -GLAPI PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; -#define glCreateSyncFromCLeventARB glad_glCreateSyncFromCLeventARB -#endif -#ifndef GL_ARB_derivative_control -#define GL_ARB_derivative_control 1 -GLAPI int GLAD_GL_ARB_derivative_control; -#endif -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -GLAPI int GLAD_GL_NV_packed_depth_stencil; -#endif -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 -GLAPI int GLAD_GL_OES_single_precision; -typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC)(GLclampf depth); -GLAPI PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; -#define glClearDepthfOES glad_glClearDepthfOES -typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC)(GLenum plane, const GLfloat* equation); -GLAPI PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; -#define glClipPlanefOES glad_glClipPlanefOES -typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC)(GLclampf n, GLclampf f); -GLAPI PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; -#define glDepthRangefOES glad_glDepthRangefOES -typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; -#define glFrustumfOES glad_glFrustumfOES -typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC)(GLenum plane, GLfloat* equation); -GLAPI PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; -#define glGetClipPlanefOES glad_glGetClipPlanefOES -typedef void (APIENTRYP PFNGLORTHOFOESPROC)(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GLAPI PFNGLORTHOFOESPROC glad_glOrthofOES; -#define glOrthofOES glad_glOrthofOES -#endif -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -GLAPI int GLAD_GL_NV_primitive_restart; -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC)(); -GLAPI PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; -#define glPrimitiveRestartNV glad_glPrimitiveRestartNV -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC)(GLuint index); -GLAPI PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; -#define glPrimitiveRestartIndexNV glad_glPrimitiveRestartIndexNV -#endif -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -GLAPI int GLAD_GL_SUN_global_alpha; -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC)(GLbyte factor); -GLAPI PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; -#define glGlobalAlphaFactorbSUN glad_glGlobalAlphaFactorbSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC)(GLshort factor); -GLAPI PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; -#define glGlobalAlphaFactorsSUN glad_glGlobalAlphaFactorsSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC)(GLint factor); -GLAPI PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; -#define glGlobalAlphaFactoriSUN glad_glGlobalAlphaFactoriSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC)(GLfloat factor); -GLAPI PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; -#define glGlobalAlphaFactorfSUN glad_glGlobalAlphaFactorfSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC)(GLdouble factor); -GLAPI PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; -#define glGlobalAlphaFactordSUN glad_glGlobalAlphaFactordSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC)(GLubyte factor); -GLAPI PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; -#define glGlobalAlphaFactorubSUN glad_glGlobalAlphaFactorubSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC)(GLushort factor); -GLAPI PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; -#define glGlobalAlphaFactorusSUN glad_glGlobalAlphaFactorusSUN -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC)(GLuint factor); -GLAPI PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; -#define glGlobalAlphaFactoruiSUN glad_glGlobalAlphaFactoruiSUN -#endif -#ifndef GL_ARB_fragment_shader_interlock -#define GL_ARB_fragment_shader_interlock 1 -GLAPI int GLAD_GL_ARB_fragment_shader_interlock; -#endif -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -GLAPI int GLAD_GL_EXT_texture_object; -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC)(GLsizei n, const GLuint* textures, GLboolean* residences); -GLAPI PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; -#define glAreTexturesResidentEXT glad_glAreTexturesResidentEXT -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC)(GLenum target, GLuint texture); -GLAPI PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; -#define glBindTextureEXT glad_glBindTextureEXT -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC)(GLsizei n, const GLuint* textures); -GLAPI PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; -#define glDeleteTexturesEXT glad_glDeleteTexturesEXT -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC)(GLsizei n, GLuint* textures); -GLAPI PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; -#define glGenTexturesEXT glad_glGenTexturesEXT -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC)(GLuint texture); -GLAPI PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; -#define glIsTextureEXT glad_glIsTextureEXT -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC)(GLsizei n, const GLuint* textures, const GLclampf* priorities); -GLAPI PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; -#define glPrioritizeTexturesEXT glad_glPrioritizeTexturesEXT -#endif -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 -GLAPI int GLAD_GL_AMD_name_gen_delete; -typedef void (APIENTRYP PFNGLGENNAMESAMDPROC)(GLenum identifier, GLuint num, GLuint* names); -GLAPI PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; -#define glGenNamesAMD glad_glGenNamesAMD -typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC)(GLenum identifier, GLuint num, const GLuint* names); -GLAPI PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; -#define glDeleteNamesAMD glad_glDeleteNamesAMD -typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC)(GLenum identifier, GLuint name); -GLAPI PFNGLISNAMEAMDPROC glad_glIsNameAMD; -#define glIsNameAMD glad_glIsNameAMD -#endif -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -GLAPI int GLAD_GL_NV_texture_compression_vtc; -#endif -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 -GLAPI int GLAD_GL_NV_sample_mask_override_coverage; -#endif -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -GLAPI int GLAD_GL_NV_texture_shader3; -#endif -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -GLAPI int GLAD_GL_NV_texture_shader2; -#endif -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -GLAPI int GLAD_GL_EXT_texture; -#endif -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 -GLAPI int GLAD_GL_ARB_buffer_storage; -typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -#define glBufferStorage glad_glBufferStorage -#endif -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -GLAPI int GLAD_GL_AMD_shader_atomic_counter_ops; -#endif -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 -GLAPI int GLAD_GL_APPLE_vertex_program_evaluators; -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; -#define glEnableVertexAttribAPPLE glad_glEnableVertexAttribAPPLE -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; -#define glDisableVertexAttribAPPLE glad_glDisableVertexAttribAPPLE -typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)(GLuint index, GLenum pname); -GLAPI PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; -#define glIsVertexAttribEnabledAPPLE glad_glIsVertexAttribEnabledAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); -GLAPI PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; -#define glMapVertexAttrib1dAPPLE glad_glMapVertexAttrib1dAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); -GLAPI PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; -#define glMapVertexAttrib1fAPPLE glad_glMapVertexAttrib1fAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC)(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); -GLAPI PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; -#define glMapVertexAttrib2dAPPLE glad_glMapVertexAttrib2dAPPLE -typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC)(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); -GLAPI PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; -#define glMapVertexAttrib2fAPPLE glad_glMapVertexAttrib2fAPPLE -#endif -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 -GLAPI int GLAD_GL_ARB_multi_bind; -typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers); -GLAPI PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; -#define glBindBuffersBase glad_glBindBuffersBase -typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC)(GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizeiptr* sizes); -GLAPI PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; -#define glBindBuffersRange glad_glBindBuffersRange -typedef void (APIENTRYP PFNGLBINDTEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); -GLAPI PFNGLBINDTEXTURESPROC glad_glBindTextures; -#define glBindTextures glad_glBindTextures -typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC)(GLuint first, GLsizei count, const GLuint* samplers); -GLAPI PFNGLBINDSAMPLERSPROC glad_glBindSamplers; -#define glBindSamplers glad_glBindSamplers -typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC)(GLuint first, GLsizei count, const GLuint* textures); -GLAPI PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; -#define glBindImageTextures glad_glBindImageTextures -typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC)(GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); -GLAPI PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; -#define glBindVertexBuffers glad_glBindVertexBuffers -#endif -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 -GLAPI int GLAD_GL_ARB_explicit_uniform_location; -#endif -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 -GLAPI int GLAD_GL_ARB_depth_buffer_float; -#endif -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 -GLAPI int GLAD_GL_NV_path_rendering_shared_edge; -#endif -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -GLAPI int GLAD_GL_SGIX_shadow_ambient; -#endif -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -GLAPI int GLAD_GL_ARB_texture_cube_map; -#endif -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 -GLAPI int GLAD_GL_AMD_vertex_shader_viewport_index; -#endif -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -GLAPI int GLAD_GL_SGIX_list_priority; -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, GLfloat* params); -GLAPI PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; -#define glGetListParameterfvSGIX glad_glGetListParameterfvSGIX -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, GLint* params); -GLAPI PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; -#define glGetListParameterivSGIX glad_glGetListParameterivSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC)(GLuint list, GLenum pname, GLfloat param); -GLAPI PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; -#define glListParameterfSGIX glad_glListParameterfSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC)(GLuint list, GLenum pname, const GLfloat* params); -GLAPI PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; -#define glListParameterfvSGIX glad_glListParameterfvSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC)(GLuint list, GLenum pname, GLint param); -GLAPI PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; -#define glListParameteriSGIX glad_glListParameteriSGIX -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC)(GLuint list, GLenum pname, const GLint* params); -GLAPI PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; -#define glListParameterivSGIX glad_glListParameterivSGIX -#endif -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 -GLAPI int GLAD_GL_NV_vertex_buffer_unified_memory; -typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC)(GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -GLAPI PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; -#define glBufferAddressRangeNV glad_glBufferAddressRangeNV -typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; -#define glVertexFormatNV glad_glVertexFormatNV -typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; -#define glNormalFormatNV glad_glNormalFormatNV -typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; -#define glColorFormatNV glad_glColorFormatNV -typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; -#define glIndexFormatNV glad_glIndexFormatNV -typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; -#define glTexCoordFormatNV glad_glTexCoordFormatNV -typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC)(GLsizei stride); -GLAPI PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; -#define glEdgeFlagFormatNV glad_glEdgeFlagFormatNV -typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC)(GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; -#define glSecondaryColorFormatNV glad_glSecondaryColorFormatNV -typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC)(GLenum type, GLsizei stride); -GLAPI PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; -#define glFogCoordFormatNV glad_glFogCoordFormatNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; -#define glVertexAttribFormatNV glad_glVertexAttribFormatNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC)(GLuint index, GLint size, GLenum type, GLsizei stride); -GLAPI PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; -#define glVertexAttribIFormatNV glad_glVertexAttribIFormatNV -typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC)(GLenum value, GLuint index, GLuint64EXT* result); -GLAPI PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; -#define glGetIntegerui64i_vNV glad_glGetIntegerui64i_vNV -#endif -#ifndef GL_NV_uniform_buffer_unified_memory -#define GL_NV_uniform_buffer_unified_memory 1 -GLAPI int GLAD_GL_NV_uniform_buffer_unified_memory; -#endif -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -GLAPI int GLAD_GL_EXT_texture_env_dot3; -#endif -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -GLAPI int GLAD_GL_ATI_texture_env_combine3; -#endif -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 -GLAPI int GLAD_GL_ARB_map_buffer_alignment; -#endif -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 -GLAPI int GLAD_GL_NV_blend_equation_advanced; -typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC)(GLenum pname, GLint value); -GLAPI PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; -#define glBlendParameteriNV glad_glBlendParameteriNV -typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC)(); -GLAPI PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; -#define glBlendBarrierNV glad_glBlendBarrierNV -#endif -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -GLAPI int GLAD_GL_SGIS_sharpen_texture; -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); -GLAPI PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; -#define glSharpenTexFuncSGIS glad_glSharpenTexFuncSGIS -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC)(GLenum target, GLfloat* points); -GLAPI PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; -#define glGetSharpenTexFuncSGIS glad_glGetSharpenTexFuncSGIS -#endif -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -GLAPI int GLAD_GL_KHR_robust_buffer_access_behavior; -#endif -#ifndef GL_ARB_pipeline_statistics_query -#define GL_ARB_pipeline_statistics_query 1 -GLAPI int GLAD_GL_ARB_pipeline_statistics_query; -#endif -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -GLAPI int GLAD_GL_ARB_vertex_program; -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -#define glVertexAttrib1dARB glad_glVertexAttrib1dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -#define glVertexAttrib1dvARB glad_glVertexAttrib1dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -#define glVertexAttrib1fARB glad_glVertexAttrib1fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -#define glVertexAttrib1fvARB glad_glVertexAttrib1fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -#define glVertexAttrib1sARB glad_glVertexAttrib1sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -#define glVertexAttrib1svARB glad_glVertexAttrib1svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -#define glVertexAttrib2dARB glad_glVertexAttrib2dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -#define glVertexAttrib2dvARB glad_glVertexAttrib2dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -#define glVertexAttrib2fARB glad_glVertexAttrib2fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -#define glVertexAttrib2fvARB glad_glVertexAttrib2fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -#define glVertexAttrib2sARB glad_glVertexAttrib2sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -#define glVertexAttrib2svARB glad_glVertexAttrib2svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -#define glVertexAttrib3dARB glad_glVertexAttrib3dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -#define glVertexAttrib3dvARB glad_glVertexAttrib3dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -#define glVertexAttrib3fARB glad_glVertexAttrib3fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -#define glVertexAttrib3fvARB glad_glVertexAttrib3fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -#define glVertexAttrib3sARB glad_glVertexAttrib3sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -#define glVertexAttrib3svARB glad_glVertexAttrib3svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -#define glVertexAttrib4NbvARB glad_glVertexAttrib4NbvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -#define glVertexAttrib4NivARB glad_glVertexAttrib4NivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -#define glVertexAttrib4NsvARB glad_glVertexAttrib4NsvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -#define glVertexAttrib4NubARB glad_glVertexAttrib4NubARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -#define glVertexAttrib4NubvARB glad_glVertexAttrib4NubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -#define glVertexAttrib4NuivARB glad_glVertexAttrib4NuivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -#define glVertexAttrib4NusvARB glad_glVertexAttrib4NusvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -#define glVertexAttrib4bvARB glad_glVertexAttrib4bvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -#define glVertexAttrib4dARB glad_glVertexAttrib4dARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -#define glVertexAttrib4dvARB glad_glVertexAttrib4dvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -#define glVertexAttrib4fARB glad_glVertexAttrib4fARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -#define glVertexAttrib4fvARB glad_glVertexAttrib4fvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -#define glVertexAttrib4ivARB glad_glVertexAttrib4ivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -#define glVertexAttrib4sARB glad_glVertexAttrib4sARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -#define glVertexAttrib4svARB glad_glVertexAttrib4svARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -#define glVertexAttrib4ubvARB glad_glVertexAttrib4ubvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -#define glVertexAttrib4uivARB glad_glVertexAttrib4uivARB -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -#define glVertexAttrib4usvARB glad_glVertexAttrib4usvARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -#define glVertexAttribPointerARB glad_glVertexAttribPointerARB -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -#define glEnableVertexAttribArrayARB glad_glEnableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -#define glDisableVertexAttribArrayARB glad_glDisableVertexAttribArrayARB -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); -GLAPI PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -#define glProgramStringARB glad_glProgramStringARB -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); -GLAPI PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -#define glBindProgramARB glad_glBindProgramARB -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -#define glDeleteProgramsARB glad_glDeleteProgramsARB -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); -GLAPI PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -#define glGenProgramsARB glad_glGenProgramsARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -#define glProgramEnvParameter4dARB glad_glProgramEnvParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -#define glProgramEnvParameter4dvARB glad_glProgramEnvParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -#define glProgramEnvParameter4fARB glad_glProgramEnvParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -#define glProgramEnvParameter4fvARB glad_glProgramEnvParameter4fvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -#define glProgramLocalParameter4dARB glad_glProgramLocalParameter4dARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -#define glProgramLocalParameter4dvARB glad_glProgramLocalParameter4dvARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -#define glProgramLocalParameter4fARB glad_glProgramLocalParameter4fARB -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -#define glProgramLocalParameter4fvARB glad_glProgramLocalParameter4fvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -#define glGetProgramEnvParameterdvARB glad_glGetProgramEnvParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -#define glGetProgramEnvParameterfvARB glad_glGetProgramEnvParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -#define glGetProgramLocalParameterdvARB glad_glGetProgramLocalParameterdvARB -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -#define glGetProgramLocalParameterfvARB glad_glGetProgramLocalParameterfvARB -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -#define glGetProgramivARB glad_glGetProgramivARB -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); -GLAPI PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -#define glGetProgramStringARB glad_glGetProgramStringARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -#define glGetVertexAttribdvARB glad_glGetVertexAttribdvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -#define glGetVertexAttribfvARB glad_glGetVertexAttribfvARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -#define glGetVertexAttribivARB glad_glGetVertexAttribivARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -#define glGetVertexAttribPointervARB glad_glGetVertexAttribPointervARB -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC)(GLuint program); -GLAPI PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -#define glIsProgramARB glad_glIsProgramARB -#endif -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 -GLAPI int GLAD_GL_ARB_texture_rgb10_a2ui; -#endif -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -GLAPI int GLAD_GL_OML_interlace; -#endif -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -GLAPI int GLAD_GL_ATI_pixel_format_float; -#endif -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 -GLAPI int GLAD_GL_NV_geometry_shader_passthrough; -#endif -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -GLAPI int GLAD_GL_ARB_vertex_buffer_object; -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); -GLAPI PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -#define glBindBufferARB glad_glBindBufferARB -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); -GLAPI PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -#define glDeleteBuffersARB glad_glDeleteBuffersARB -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -#define glGenBuffersARB glad_glGenBuffersARB -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC)(GLuint buffer); -GLAPI PFNGLISBUFFERARBPROC glad_glIsBufferARB; -#define glIsBufferARB glad_glIsBufferARB -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const void* data, GLenum usage); -GLAPI PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -#define glBufferDataARB glad_glBufferDataARB -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void* data); -GLAPI PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -#define glBufferSubDataARB glad_glBufferSubDataARB -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void* data); -GLAPI PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -#define glGetBufferSubDataARB glad_glGetBufferSubDataARB -typedef void* (APIENTRYP PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); -GLAPI PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -#define glMapBufferARB glad_glMapBufferARB -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC)(GLenum target); -GLAPI PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -#define glUnmapBufferARB glad_glUnmapBufferARB -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -#define glGetBufferParameterivARB glad_glGetBufferParameterivARB -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, void** params); -GLAPI PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -#define glGetBufferPointervARB glad_glGetBufferPointervARB -#endif -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -GLAPI int GLAD_GL_EXT_shadow_funcs; -#endif -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -GLAPI int GLAD_GL_ATI_text_fragment_shader; -#endif -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -GLAPI int GLAD_GL_NV_vertex_array_range; -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC)(); -GLAPI PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; -#define glFlushVertexArrayRangeNV glad_glFlushVertexArrayRangeNV -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC)(GLsizei length, const void* pointer); -GLAPI PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; -#define glVertexArrayRangeNV glad_glVertexArrayRangeNV -#endif -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -GLAPI int GLAD_GL_SGIX_fragment_lighting; -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC)(GLenum face, GLenum mode); -GLAPI PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; -#define glFragmentColorMaterialSGIX glad_glFragmentColorMaterialSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC)(GLenum light, GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; -#define glFragmentLightfSGIX glad_glFragmentLightfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; -#define glFragmentLightfvSGIX glad_glFragmentLightfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC)(GLenum light, GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; -#define glFragmentLightiSGIX glad_glFragmentLightiSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; -#define glFragmentLightivSGIX glad_glFragmentLightivSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; -#define glFragmentLightModelfSGIX glad_glFragmentLightModelfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; -#define glFragmentLightModelfvSGIX glad_glFragmentLightModelfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; -#define glFragmentLightModeliSGIX glad_glFragmentLightModeliSGIX -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; -#define glFragmentLightModelivSGIX glad_glFragmentLightModelivSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC)(GLenum face, GLenum pname, GLfloat param); -GLAPI PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; -#define glFragmentMaterialfSGIX glad_glFragmentMaterialfSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, const GLfloat* params); -GLAPI PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; -#define glFragmentMaterialfvSGIX glad_glFragmentMaterialfvSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC)(GLenum face, GLenum pname, GLint param); -GLAPI PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; -#define glFragmentMaterialiSGIX glad_glFragmentMaterialiSGIX -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, const GLint* params); -GLAPI PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; -#define glFragmentMaterialivSGIX glad_glFragmentMaterialivSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC)(GLenum light, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; -#define glGetFragmentLightfvSGIX glad_glGetFragmentLightfvSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC)(GLenum light, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; -#define glGetFragmentLightivSGIX glad_glGetFragmentLightivSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum face, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; -#define glGetFragmentMaterialfvSGIX glad_glGetFragmentMaterialfvSGIX -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC)(GLenum face, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; -#define glGetFragmentMaterialivSGIX glad_glGetFragmentMaterialivSGIX -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; -#define glLightEnviSGIX glad_glLightEnviSGIX -#endif -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -GLAPI int GLAD_GL_NV_texture_expand_normal; -#endif -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 -GLAPI int GLAD_GL_NV_framebuffer_multisample_coverage; -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; -#define glRenderbufferStorageMultisampleCoverageNV glad_glRenderbufferStorageMultisampleCoverageNV -#endif -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 -GLAPI int GLAD_GL_EXT_timer_query; -typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC)(GLuint id, GLenum pname, GLint64* params); -GLAPI PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; -#define glGetQueryObjecti64vEXT glad_glGetQueryObjecti64vEXT -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC)(GLuint id, GLenum pname, GLuint64* params); -GLAPI PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; -#define glGetQueryObjectui64vEXT glad_glGetQueryObjectui64vEXT -#endif -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 -GLAPI int GLAD_GL_EXT_vertex_array_bgra; -#endif -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 -GLAPI int GLAD_GL_NV_bindless_texture; -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC)(GLuint texture); -GLAPI PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; -#define glGetTextureHandleNV glad_glGetTextureHandleNV -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC)(GLuint texture, GLuint sampler); -GLAPI PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; -#define glGetTextureSamplerHandleNV glad_glGetTextureSamplerHandleNV -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; -#define glMakeTextureHandleResidentNV glad_glMakeTextureHandleResidentNV -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; -#define glMakeTextureHandleNonResidentNV glad_glMakeTextureHandleNonResidentNV -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; -#define glGetImageHandleNV glad_glGetImageHandleNV -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle, GLenum access); -GLAPI PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; -#define glMakeImageHandleResidentNV glad_glMakeImageHandleResidentNV -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; -#define glMakeImageHandleNonResidentNV glad_glMakeImageHandleNonResidentNV -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC)(GLint location, GLuint64 value); -GLAPI PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; -#define glUniformHandleui64NV glad_glUniformHandleui64NV -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; -#define glUniformHandleui64vNV glad_glUniformHandleui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)(GLuint program, GLint location, GLuint64 value); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; -#define glProgramUniformHandleui64NV glad_glProgramUniformHandleui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; -#define glProgramUniformHandleui64vNV glad_glProgramUniformHandleui64vNV -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; -#define glIsTextureHandleResidentNV glad_glIsTextureHandleResidentNV -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC)(GLuint64 handle); -GLAPI PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; -#define glIsImageHandleResidentNV glad_glIsImageHandleResidentNV -#endif -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 -GLAPI int GLAD_GL_KHR_debug; -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -#define glDebugMessageControl glad_glDebugMessageControl -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -#define glDebugMessageInsert glad_glDebugMessageInsert -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -#define glDebugMessageCallback glad_glDebugMessageCallback -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -#define glGetDebugMessageLog glad_glGetDebugMessageLog -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); -GLAPI PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -#define glPushDebugGroup glad_glPushDebugGroup -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC)(); -GLAPI PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -#define glPopDebugGroup glad_glPopDebugGroup -typedef void (APIENTRYP PFNGLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTLABELPROC glad_glObjectLabel; -#define glObjectLabel glad_glObjectLabel -typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -#define glGetObjectLabel glad_glGetObjectLabel -typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC)(const void* ptr, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -#define glObjectPtrLabel glad_glObjectPtrLabel -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -#define glGetObjectPtrLabel glad_glGetObjectPtrLabel -typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; -#define glGetPointerv glad_glGetPointerv -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; -#define glDebugMessageControlKHR glad_glDebugMessageControlKHR -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; -#define glDebugMessageInsertKHR glad_glDebugMessageInsertKHR -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC)(GLDEBUGPROCKHR callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; -#define glDebugMessageCallbackKHR glad_glDebugMessageCallbackKHR -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; -#define glGetDebugMessageLogKHR glad_glGetDebugMessageLogKHR -typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC)(GLenum source, GLuint id, GLsizei length, const GLchar* message); -GLAPI PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; -#define glPushDebugGroupKHR glad_glPushDebugGroupKHR -typedef void (APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC)(); -GLAPI PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; -#define glPopDebugGroupKHR glad_glPopDebugGroupKHR -typedef void (APIENTRYP PFNGLOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; -#define glObjectLabelKHR glad_glObjectLabelKHR -typedef void (APIENTRYP PFNGLGETOBJECTLABELKHRPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; -#define glGetObjectLabelKHR glad_glGetObjectLabelKHR -typedef void (APIENTRYP PFNGLOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei length, const GLchar* label); -GLAPI PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; -#define glObjectPtrLabelKHR glad_glObjectPtrLabelKHR -typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC)(const void* ptr, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; -#define glGetObjectPtrLabelKHR glad_glGetObjectPtrLabelKHR -typedef void (APIENTRYP PFNGLGETPOINTERVKHRPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; -#define glGetPointervKHR glad_glGetPointervKHR -#endif -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -GLAPI int GLAD_GL_SGIS_texture_border_clamp; -#endif -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -GLAPI int GLAD_GL_ATI_vertex_attrib_array_object; -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; -#define glVertexAttribArrayObjectATI glad_glVertexAttribArrayObjectATI -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; -#define glGetVertexAttribArrayObjectfvATI glad_glGetVertexAttribArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; -#define glGetVertexAttribArrayObjectivATI glad_glGetVertexAttribArrayObjectivATI -#endif -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -GLAPI int GLAD_GL_SGIX_clipmap; -#endif -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 -GLAPI int GLAD_GL_EXT_geometry_shader4; -#endif -#ifndef GL_ARB_shader_texture_image_samples -#define GL_ARB_shader_texture_image_samples 1 -GLAPI int GLAD_GL_ARB_shader_texture_image_samples; -#endif -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -GLAPI int GLAD_GL_MESA_ycbcr_texture; -#endif -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 -GLAPI int GLAD_GL_MESAX_texture_stack; -#endif -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 -GLAPI int GLAD_GL_AMD_seamless_cubemap_per_texture; -#endif -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 -GLAPI int GLAD_GL_EXT_bindable_uniform; -typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC)(GLuint program, GLint location, GLuint buffer); -GLAPI PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; -#define glUniformBufferEXT glad_glUniformBufferEXT -typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC)(GLuint program, GLint location); -GLAPI PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; -#define glGetUniformBufferSizeEXT glad_glGetUniformBufferSizeEXT -typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC)(GLuint program, GLint location); -GLAPI PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; -#define glGetUniformOffsetEXT glad_glGetUniformOffsetEXT -#endif -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_hdr; -#endif -#ifndef GL_ARB_shader_ballot -#define GL_ARB_shader_ballot 1 -GLAPI int GLAD_GL_ARB_shader_ballot; -#endif -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -GLAPI int GLAD_GL_KHR_blend_equation_advanced; -typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC)(); -GLAPI PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; -#define glBlendBarrierKHR glad_glBlendBarrierKHR -#endif -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -GLAPI int GLAD_GL_ARB_fragment_program_shadow; -#endif -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -GLAPI int GLAD_GL_ATI_element_array; -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC)(GLenum type, const void* pointer); -GLAPI PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -#define glElementPointerATI glad_glElementPointerATI -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC)(GLenum mode, GLsizei count); -GLAPI PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -#define glDrawElementArrayATI glad_glDrawElementArrayATI -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count); -GLAPI PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -#define glDrawRangeElementArrayATI glad_glDrawRangeElementArrayATI -#endif -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 -GLAPI int GLAD_GL_AMD_texture_texture4; -#endif -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -GLAPI int GLAD_GL_SGIX_reference_plane; -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC)(const GLdouble* equation); -GLAPI PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; -#define glReferencePlaneSGIX glad_glReferencePlaneSGIX -#endif -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -GLAPI int GLAD_GL_EXT_stencil_two_side; -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC)(GLenum face); -GLAPI PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; -#define glActiveStencilFaceEXT glad_glActiveStencilFaceEXT -#endif -#ifndef GL_ARB_transform_feedback_overflow_query -#define GL_ARB_transform_feedback_overflow_query 1 -GLAPI int GLAD_GL_ARB_transform_feedback_overflow_query; -#endif -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -GLAPI int GLAD_GL_SGIX_texture_lod_bias; -#endif -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 -GLAPI int GLAD_GL_KHR_no_error; -#endif -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 -GLAPI int GLAD_GL_NV_explicit_multisample; -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC)(GLenum pname, GLuint index, GLfloat* val); -GLAPI PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; -#define glGetMultisamplefvNV glad_glGetMultisamplefvNV -typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC)(GLuint index, GLbitfield mask); -GLAPI PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; -#define glSampleMaskIndexedNV glad_glSampleMaskIndexedNV -typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; -#define glTexRenderbufferNV glad_glTexRenderbufferNV -#endif -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 -GLAPI int GLAD_GL_IBM_static_data; -typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC)(GLenum target); -GLAPI PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; -#define glFlushStaticDataIBM glad_glFlushStaticDataIBM -#endif -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -GLAPI int GLAD_GL_EXT_clip_volume_hint; -#endif -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -GLAPI int GLAD_GL_EXT_texture_perturb_normal; -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC)(GLenum mode); -GLAPI PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; -#define glTextureNormalEXT glad_glTextureNormalEXT -#endif -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -GLAPI int GLAD_GL_NV_fragment_program2; -#endif -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 -GLAPI int GLAD_GL_NV_fragment_program4; -#endif -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -GLAPI int GLAD_GL_EXT_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; -#define glPointParameterfEXT glad_glPointParameterfEXT -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; -#define glPointParameterfvEXT glad_glPointParameterfvEXT -#endif -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -GLAPI int GLAD_GL_PGI_misc_hints; -typedef void (APIENTRYP PFNGLHINTPGIPROC)(GLenum target, GLint mode); -GLAPI PFNGLHINTPGIPROC glad_glHintPGI; -#define glHintPGI glad_glHintPGI -#endif -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -GLAPI int GLAD_GL_SGIX_subsample; -#endif -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 -GLAPI int GLAD_GL_AMD_shader_stencil_export; -#endif -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 -GLAPI int GLAD_GL_ARB_shader_texture_lod; -#endif -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -GLAPI int GLAD_GL_ARB_vertex_shader; -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC)(GLhandleARB programObj, GLuint index, const GLcharARB* name); -GLAPI PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -#define glBindAttribLocationARB glad_glBindAttribLocationARB -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); -GLAPI PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -#define glGetActiveAttribARB glad_glGetActiveAttribARB -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); -GLAPI PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -#define glGetAttribLocationARB glad_glGetAttribLocationARB -#endif -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 -GLAPI int GLAD_GL_ARB_depth_clamp; -#endif -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 -GLAPI int GLAD_GL_SGIS_texture_select; -#endif -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -GLAPI int GLAD_GL_NV_texture_shader; -#endif -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 -GLAPI int GLAD_GL_ARB_tessellation_shader; -typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC)(GLenum pname, GLint value); -GLAPI PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; -#define glPatchParameteri glad_glPatchParameteri -typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC)(GLenum pname, const GLfloat* values); -GLAPI PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; -#define glPatchParameterfv glad_glPatchParameterfv -#endif -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 -GLAPI int GLAD_GL_EXT_draw_buffers2; -typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GLAPI PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; -#define glColorMaskIndexedEXT glad_glColorMaskIndexedEXT -typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC)(GLenum target, GLuint index, GLboolean* data); -GLAPI PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; -#define glGetBooleanIndexedvEXT glad_glGetBooleanIndexedvEXT -typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC)(GLenum target, GLuint index, GLint* data); -GLAPI PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; -#define glGetIntegerIndexedvEXT glad_glGetIntegerIndexedvEXT -typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; -#define glEnableIndexedEXT glad_glEnableIndexedEXT -typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; -#define glDisableIndexedEXT glad_glDisableIndexedEXT -typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC)(GLenum target, GLuint index); -GLAPI PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; -#define glIsEnabledIndexedEXT glad_glIsEnabledIndexedEXT -#endif -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 -GLAPI int GLAD_GL_ARB_vertex_attrib_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; -#define glVertexAttribL1d glad_glVertexAttribL1d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; -#define glVertexAttribL2d glad_glVertexAttribL2d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; -#define glVertexAttribL3d glad_glVertexAttribL3d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; -#define glVertexAttribL4d glad_glVertexAttribL4d -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; -#define glVertexAttribL1dv glad_glVertexAttribL1dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; -#define glVertexAttribL2dv glad_glVertexAttribL2dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; -#define glVertexAttribL3dv glad_glVertexAttribL3dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; -#define glVertexAttribL4dv glad_glVertexAttribL4dv -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; -#define glVertexAttribLPointer glad_glVertexAttribLPointer -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; -#define glGetVertexAttribLdv glad_glGetVertexAttribLdv -#endif -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 -GLAPI int GLAD_GL_EXT_texture_filter_minmax; -typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC)(GLuint samples, GLboolean fixedsamplelocations); -GLAPI PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; -#define glRasterSamplesEXT glad_glRasterSamplesEXT -#endif -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -GLAPI int GLAD_GL_WIN_specular_fog; -#endif -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 -GLAPI int GLAD_GL_AMD_interleaved_elements; -typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC)(GLuint index, GLenum pname, GLint param); -GLAPI PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; -#define glVertexAttribParameteriAMD glad_glVertexAttribParameteriAMD -#endif -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -GLAPI int GLAD_GL_ARB_fragment_program; -#endif -#ifndef GL_OML_resample -#define GL_OML_resample 1 -GLAPI int GLAD_GL_OML_resample; -#endif -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -GLAPI int GLAD_GL_APPLE_ycbcr_422; -#endif -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -GLAPI int GLAD_GL_SGIX_texture_add_env; -#endif -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -GLAPI int GLAD_GL_ARB_shadow_ambient; -#endif -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 -GLAPI int GLAD_GL_ARB_texture_storage; -typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; -#define glTexStorage1D glad_glTexStorage1D -typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; -#define glTexStorage2D glad_glTexStorage2D -typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; -#define glTexStorage3D glad_glTexStorage3D -#endif -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -GLAPI int GLAD_GL_EXT_pixel_buffer_object; -#endif -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 -GLAPI int GLAD_GL_ARB_copy_image; -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GLAPI PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; -#define glCopyImageSubData glad_glCopyImageSubData -#endif -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -GLAPI int GLAD_GL_SGIS_pixel_texture; -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC)(GLenum pname, GLint param); -GLAPI PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; -#define glPixelTexGenParameteriSGIS glad_glPixelTexGenParameteriSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; -#define glPixelTexGenParameterivSGIS glad_glPixelTexGenParameterivSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; -#define glPixelTexGenParameterfSGIS glad_glPixelTexGenParameterfSGIS -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; -#define glPixelTexGenParameterfvSGIS glad_glPixelTexGenParameterfvSGIS -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)(GLenum pname, GLint* params); -GLAPI PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; -#define glGetPixelTexGenParameterivSGIS glad_glGetPixelTexGenParameterivSGIS -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)(GLenum pname, GLfloat* params); -GLAPI PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; -#define glGetPixelTexGenParameterfvSGIS glad_glGetPixelTexGenParameterfvSGIS -#endif -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -GLAPI int GLAD_GL_SGIS_generate_mipmap; -#endif -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -GLAPI int GLAD_GL_SGIX_instruments; -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC)(); -GLAPI PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; -#define glGetInstrumentsSGIX glad_glGetInstrumentsSGIX -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC)(GLsizei size, GLint* buffer); -GLAPI PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; -#define glInstrumentsBufferSGIX glad_glInstrumentsBufferSGIX -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC)(GLint* marker_p); -GLAPI PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; -#define glPollInstrumentsSGIX glad_glPollInstrumentsSGIX -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC)(GLint marker); -GLAPI PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; -#define glReadInstrumentsSGIX glad_glReadInstrumentsSGIX -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC)(); -GLAPI PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; -#define glStartInstrumentsSGIX glad_glStartInstrumentsSGIX -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC)(GLint marker); -GLAPI PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; -#define glStopInstrumentsSGIX glad_glStopInstrumentsSGIX -#endif -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -GLAPI int GLAD_GL_HP_texture_lighting; -#endif -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 -GLAPI int GLAD_GL_ARB_shader_storage_buffer_object; -typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC)(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); -GLAPI PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; -#define glShaderStorageBlockBinding glad_glShaderStorageBlockBinding -#endif -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 -GLAPI int GLAD_GL_EXT_sparse_texture2; -#endif -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -GLAPI int GLAD_GL_EXT_blend_minmax; -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC)(GLenum mode); -GLAPI PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; -#define glBlendEquationEXT glad_glBlendEquationEXT -#endif -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -GLAPI int GLAD_GL_MESA_pack_invert; -#endif -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 -GLAPI int GLAD_GL_ARB_base_instance; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); -GLAPI PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; -#define glDrawArraysInstancedBaseInstance glad_glDrawArraysInstancedBaseInstance -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLuint baseinstance); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; -#define glDrawElementsInstancedBaseInstance glad_glDrawElementsInstancedBaseInstance -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; -#define glDrawElementsInstancedBaseVertexBaseInstance glad_glDrawElementsInstancedBaseVertexBaseInstance -#endif -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -GLAPI int GLAD_GL_SGIX_convolution_accuracy; -#endif -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -GLAPI int GLAD_GL_PGI_vertex_hints; -#endif -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -GLAPI int GLAD_GL_AMD_transform_feedback4; -#endif -#ifndef GL_ARB_ES3_1_compatibility -#define GL_ARB_ES3_1_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_1_compatibility; -typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; -#define glMemoryBarrierByRegion glad_glMemoryBarrierByRegion -#endif -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 -GLAPI int GLAD_GL_EXT_texture_integer; -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; -#define glTexParameterIivEXT glad_glTexParameterIivEXT -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; -#define glTexParameterIuivEXT glad_glTexParameterIuivEXT -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; -#define glGetTexParameterIivEXT glad_glGetTexParameterIivEXT -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC)(GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; -#define glGetTexParameterIuivEXT glad_glGetTexParameterIuivEXT -typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC)(GLint red, GLint green, GLint blue, GLint alpha); -GLAPI PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; -#define glClearColorIiEXT glad_glClearColorIiEXT -typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLAPI PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; -#define glClearColorIuiEXT glad_glClearColorIuiEXT -#endif -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 -GLAPI int GLAD_GL_ARB_texture_multisample; -#endif -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -GLAPI int GLAD_GL_AMD_gpu_shader_int64; -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC)(GLint location, GLint64EXT x); -GLAPI PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; -#define glUniform1i64NV glad_glUniform1i64NV -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; -#define glUniform2i64NV glad_glUniform2i64NV -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; -#define glUniform3i64NV glad_glUniform3i64NV -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC)(GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; -#define glUniform4i64NV glad_glUniform4i64NV -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; -#define glUniform1i64vNV glad_glUniform1i64vNV -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; -#define glUniform2i64vNV glad_glUniform2i64vNV -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; -#define glUniform3i64vNV glad_glUniform3i64vNV -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC)(GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; -#define glUniform4i64vNV glad_glUniform4i64vNV -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC)(GLint location, GLuint64EXT x); -GLAPI PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; -#define glUniform1ui64NV glad_glUniform1ui64NV -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; -#define glUniform2ui64NV glad_glUniform2ui64NV -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; -#define glUniform3ui64NV glad_glUniform3ui64NV -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC)(GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; -#define glUniform4ui64NV glad_glUniform4ui64NV -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; -#define glUniform1ui64vNV glad_glUniform1ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; -#define glUniform2ui64vNV glad_glUniform2ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; -#define glUniform3ui64vNV glad_glUniform3ui64vNV -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC)(GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; -#define glUniform4ui64vNV glad_glUniform4ui64vNV -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC)(GLuint program, GLint location, GLint64EXT* params); -GLAPI PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; -#define glGetUniformi64vNV glad_glGetUniformi64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC)(GLuint program, GLint location, GLint64EXT x); -GLAPI PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; -#define glProgramUniform1i64NV glad_glProgramUniform1i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; -#define glProgramUniform2i64NV glad_glProgramUniform2i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; -#define glProgramUniform3i64NV glad_glProgramUniform3i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC)(GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; -#define glProgramUniform4i64NV glad_glProgramUniform4i64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; -#define glProgramUniform1i64vNV glad_glProgramUniform1i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; -#define glProgramUniform2i64vNV glad_glProgramUniform2i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; -#define glProgramUniform3i64vNV glad_glProgramUniform3i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; -#define glProgramUniform4i64vNV glad_glProgramUniform4i64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x); -GLAPI PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; -#define glProgramUniform1ui64NV glad_glProgramUniform1ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; -#define glProgramUniform2ui64NV glad_glProgramUniform2ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; -#define glProgramUniform3ui64NV glad_glProgramUniform3ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC)(GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; -#define glProgramUniform4ui64NV glad_glProgramUniform4ui64NV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; -#define glProgramUniform1ui64vNV glad_glProgramUniform1ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; -#define glProgramUniform2ui64vNV glad_glProgramUniform2ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; -#define glProgramUniform3ui64vNV glad_glProgramUniform3ui64vNV -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC)(GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -GLAPI PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; -#define glProgramUniform4ui64vNV glad_glProgramUniform4ui64vNV -#endif -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -GLAPI int GLAD_GL_S3_s3tc; -#endif -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 -GLAPI int GLAD_GL_ARB_query_buffer_object; -#endif -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 -GLAPI int GLAD_GL_AMD_vertex_shader_tessellator; -typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC)(GLfloat factor); -GLAPI PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; -#define glTessellationFactorAMD glad_glTessellationFactorAMD -typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC)(GLenum mode); -GLAPI PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; -#define glTessellationModeAMD glad_glTessellationModeAMD -#endif -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 -GLAPI int GLAD_GL_ARB_invalidate_subdata; -typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; -#define glInvalidateTexSubImage glad_glInvalidateTexSubImage -typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC)(GLuint texture, GLint level); -GLAPI PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; -#define glInvalidateTexImage glad_glInvalidateTexImage -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; -#define glInvalidateBufferSubData glad_glInvalidateBufferSubData -typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer); -GLAPI PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; -#define glInvalidateBufferData glad_glInvalidateBufferData -typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments); -GLAPI PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; -#define glInvalidateFramebuffer glad_glInvalidateFramebuffer -typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; -#define glInvalidateSubFramebuffer glad_glInvalidateSubFramebuffer -#endif -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -GLAPI int GLAD_GL_EXT_index_material; -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC)(GLenum face, GLenum mode); -GLAPI PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; -#define glIndexMaterialEXT glad_glIndexMaterialEXT -#endif -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 -GLAPI int GLAD_GL_NV_blend_equation_advanced_coherent; -#endif -#ifndef GL_KHR_texture_compression_astc_sliced_3d -#define GL_KHR_texture_compression_astc_sliced_3d 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_sliced_3d; -#endif -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -GLAPI int GLAD_GL_INTEL_parallel_arrays; -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; -#define glVertexPointervINTEL glad_glVertexPointervINTEL -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC)(GLenum type, const void** pointer); -GLAPI PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; -#define glNormalPointervINTEL glad_glNormalPointervINTEL -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; -#define glColorPointervINTEL glad_glColorPointervINTEL -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC)(GLint size, GLenum type, const void** pointer); -GLAPI PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; -#define glTexCoordPointervINTEL glad_glTexCoordPointervINTEL -#endif -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -GLAPI int GLAD_GL_ATI_draw_buffers; -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; -#define glDrawBuffersATI glad_glDrawBuffersATI -#endif -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -GLAPI int GLAD_GL_EXT_cmyka; -#endif -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -GLAPI int GLAD_GL_SGIX_pixel_texture; -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC)(GLenum mode); -GLAPI PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; -#define glPixelTexGenSGIX glad_glPixelTexGenSGIX -#endif -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -GLAPI int GLAD_GL_APPLE_specular_vector; -#endif -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 -GLAPI int GLAD_GL_ARB_compatibility; -#endif -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 -GLAPI int GLAD_GL_ARB_timer_query; -#endif -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -GLAPI int GLAD_GL_SGIX_interlace; -#endif -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 -GLAPI int GLAD_GL_NV_parameter_buffer_object; -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; -#define glProgramBufferParametersfvNV glad_glProgramBufferParametersfvNV -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; -#define glProgramBufferParametersIivNV glad_glProgramBufferParametersIivNV -typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)(GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; -#define glProgramBufferParametersIuivNV glad_glProgramBufferParametersIuivNV -#endif -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 -GLAPI int GLAD_GL_AMD_shader_trinary_minmax; -#endif -#ifndef GL_ARB_direct_state_access -#define GL_ARB_direct_state_access 1 -GLAPI int GLAD_GL_ARB_direct_state_access; -typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; -#define glCreateTransformFeedbacks glad_glCreateTransformFeedbacks -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)(GLuint xfb, GLuint index, GLuint buffer); -GLAPI PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; -#define glTransformFeedbackBufferBase glad_glTransformFeedbackBufferBase -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; -#define glTransformFeedbackBufferRange glad_glTransformFeedbackBufferRange -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC)(GLuint xfb, GLenum pname, GLint* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; -#define glGetTransformFeedbackiv glad_glGetTransformFeedbackiv -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; -#define glGetTransformFeedbacki_v glad_glGetTransformFeedbacki_v -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC)(GLuint xfb, GLenum pname, GLuint index, GLint64* param); -GLAPI PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; -#define glGetTransformFeedbacki64_v glad_glGetTransformFeedbacki64_v -typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC)(GLsizei n, GLuint* buffers); -GLAPI PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; -#define glCreateBuffers glad_glCreateBuffers -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; -#define glNamedBufferStorage glad_glNamedBufferStorage -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; -#define glNamedBufferData glad_glNamedBufferData -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; -#define glNamedBufferSubData glad_glNamedBufferSubData -typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; -#define glCopyNamedBufferSubData glad_glCopyNamedBufferSubData -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; -#define glClearNamedBufferData glad_glClearNamedBufferData -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; -#define glClearNamedBufferSubData glad_glClearNamedBufferSubData -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; -#define glMapNamedBuffer glad_glMapNamedBuffer -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; -#define glMapNamedBufferRange glad_glMapNamedBufferRange -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC)(GLuint buffer); -GLAPI PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; -#define glUnmapNamedBuffer glad_glUnmapNamedBuffer -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; -#define glFlushMappedNamedBufferRange glad_glFlushMappedNamedBufferRange -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; -#define glGetNamedBufferParameteriv glad_glGetNamedBufferParameteriv -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)(GLuint buffer, GLenum pname, GLint64* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; -#define glGetNamedBufferParameteri64v glad_glGetNamedBufferParameteri64v -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC)(GLuint buffer, GLenum pname, void** params); -GLAPI PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; -#define glGetNamedBufferPointerv glad_glGetNamedBufferPointerv -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; -#define glGetNamedBufferSubData glad_glGetNamedBufferSubData -typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; -#define glCreateFramebuffers glad_glCreateFramebuffers -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; -#define glNamedFramebufferRenderbuffer glad_glNamedFramebufferRenderbuffer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)(GLuint framebuffer, GLenum pname, GLint param); -GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; -#define glNamedFramebufferParameteri glad_glNamedFramebufferParameteri -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; -#define glNamedFramebufferTexture glad_glNamedFramebufferTexture -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; -#define glNamedFramebufferTextureLayer glad_glNamedFramebufferTextureLayer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)(GLuint framebuffer, GLenum buf); -GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; -#define glNamedFramebufferDrawBuffer glad_glNamedFramebufferDrawBuffer -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); -GLAPI PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; -#define glNamedFramebufferDrawBuffers glad_glNamedFramebufferDrawBuffers -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)(GLuint framebuffer, GLenum src); -GLAPI PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; -#define glNamedFramebufferReadBuffer glad_glNamedFramebufferReadBuffer -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); -GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; -#define glInvalidateNamedFramebufferData glad_glInvalidateNamedFramebufferData -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)(GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; -#define glInvalidateNamedFramebufferSubData glad_glInvalidateNamedFramebufferSubData -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; -#define glClearNamedFramebufferiv glad_glClearNamedFramebufferiv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; -#define glClearNamedFramebufferuiv glad_glClearNamedFramebufferuiv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; -#define glClearNamedFramebufferfv glad_glClearNamedFramebufferfv -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GLAPI PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; -#define glClearNamedFramebufferfi glad_glClearNamedFramebufferfi -typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC)(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; -#define glBlitNamedFramebuffer glad_glBlitNamedFramebuffer -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)(GLuint framebuffer, GLenum target); -GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; -#define glCheckNamedFramebufferStatus glad_glCheckNamedFramebufferStatus -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)(GLuint framebuffer, GLenum pname, GLint* param); -GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; -#define glGetNamedFramebufferParameteriv glad_glGetNamedFramebufferParameteriv -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; -#define glGetNamedFramebufferAttachmentParameteriv glad_glGetNamedFramebufferAttachmentParameteriv -typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; -#define glCreateRenderbuffers glad_glCreateRenderbuffers -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; -#define glNamedRenderbufferStorage glad_glNamedRenderbufferStorage -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; -#define glNamedRenderbufferStorageMultisample glad_glNamedRenderbufferStorageMultisample -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)(GLuint renderbuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; -#define glGetNamedRenderbufferParameteriv glad_glGetNamedRenderbufferParameteriv -typedef void (APIENTRYP PFNGLCREATETEXTURESPROC)(GLenum target, GLsizei n, GLuint* textures); -GLAPI PFNGLCREATETEXTURESPROC glad_glCreateTextures; -#define glCreateTextures glad_glCreateTextures -typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC)(GLuint texture, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; -#define glTextureBuffer glad_glTextureBuffer -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC)(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; -#define glTextureBufferRange glad_glTextureBufferRange -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; -#define glTextureStorage1D glad_glTextureStorage1D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; -#define glTextureStorage2D glad_glTextureStorage2D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC)(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; -#define glTextureStorage3D glad_glTextureStorage3D -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; -#define glTextureStorage2DMultisample glad_glTextureStorage2DMultisample -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; -#define glTextureStorage3DMultisample glad_glTextureStorage3DMultisample -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; -#define glTextureSubImage1D glad_glTextureSubImage1D -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; -#define glTextureSubImage2D glad_glTextureSubImage2D -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; -#define glTextureSubImage3D glad_glTextureSubImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; -#define glCompressedTextureSubImage1D glad_glCompressedTextureSubImage1D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; -#define glCompressedTextureSubImage2D glad_glCompressedTextureSubImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; -#define glCompressedTextureSubImage3D glad_glCompressedTextureSubImage3D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC)(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; -#define glCopyTextureSubImage1D glad_glCopyTextureSubImage1D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; -#define glCopyTextureSubImage2D glad_glCopyTextureSubImage2D -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; -#define glCopyTextureSubImage3D glad_glCopyTextureSubImage3D -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC)(GLuint texture, GLenum pname, GLfloat param); -GLAPI PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; -#define glTextureParameterf glad_glTextureParameterf -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, const GLfloat* param); -GLAPI PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; -#define glTextureParameterfv glad_glTextureParameterfv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC)(GLuint texture, GLenum pname, GLint param); -GLAPI PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; -#define glTextureParameteri glad_glTextureParameteri -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; -#define glTextureParameterIiv glad_glTextureParameterIiv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; -#define glTextureParameterIuiv glad_glTextureParameterIuiv -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, const GLint* param); -GLAPI PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; -#define glTextureParameteriv glad_glTextureParameteriv -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC)(GLuint texture); -GLAPI PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; -#define glGenerateTextureMipmap glad_glGenerateTextureMipmap -typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC)(GLuint unit, GLuint texture); -GLAPI PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; -#define glBindTextureUnit glad_glBindTextureUnit -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; -#define glGetTextureImage glad_glGetTextureImage -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)(GLuint texture, GLint level, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; -#define glGetCompressedTextureImage glad_glGetCompressedTextureImage -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC)(GLuint texture, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; -#define glGetTextureLevelParameterfv glad_glGetTextureLevelParameterfv -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC)(GLuint texture, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; -#define glGetTextureLevelParameteriv glad_glGetTextureLevelParameteriv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC)(GLuint texture, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; -#define glGetTextureParameterfv glad_glGetTextureParameterfv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC)(GLuint texture, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; -#define glGetTextureParameterIiv glad_glGetTextureParameterIiv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC)(GLuint texture, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; -#define glGetTextureParameterIuiv glad_glGetTextureParameterIuiv -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC)(GLuint texture, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; -#define glGetTextureParameteriv glad_glGetTextureParameteriv -typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; -#define glCreateVertexArrays glad_glCreateVertexArrays -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; -#define glDisableVertexArrayAttrib glad_glDisableVertexArrayAttrib -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; -#define glEnableVertexArrayAttrib glad_glEnableVertexArrayAttrib -typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC)(GLuint vaobj, GLuint buffer); -GLAPI PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; -#define glVertexArrayElementBuffer glad_glVertexArrayElementBuffer -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; -#define glVertexArrayVertexBuffer glad_glVertexArrayVertexBuffer -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC)(GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr* offsets, const GLsizei* strides); -GLAPI PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; -#define glVertexArrayVertexBuffers glad_glVertexArrayVertexBuffers -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; -#define glVertexArrayAttribBinding glad_glVertexArrayAttribBinding -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; -#define glVertexArrayAttribFormat glad_glVertexArrayAttribFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; -#define glVertexArrayAttribIFormat glad_glVertexArrayAttribIFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; -#define glVertexArrayAttribLFormat glad_glVertexArrayAttribLFormat -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; -#define glVertexArrayBindingDivisor glad_glVertexArrayBindingDivisor -typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC)(GLuint vaobj, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; -#define glGetVertexArrayiv glad_glGetVertexArrayiv -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; -#define glGetVertexArrayIndexediv glad_glGetVertexArrayIndexediv -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint64* param); -GLAPI PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; -#define glGetVertexArrayIndexed64iv glad_glGetVertexArrayIndexed64iv -typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC)(GLsizei n, GLuint* samplers); -GLAPI PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; -#define glCreateSamplers glad_glCreateSamplers -typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; -#define glCreateProgramPipelines glad_glCreateProgramPipelines -typedef void (APIENTRYP PFNGLCREATEQUERIESPROC)(GLenum target, GLsizei n, GLuint* ids); -GLAPI PFNGLCREATEQUERIESPROC glad_glCreateQueries; -#define glCreateQueries glad_glCreateQueries -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; -#define glGetQueryBufferObjecti64v glad_glGetQueryBufferObjecti64v -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; -#define glGetQueryBufferObjectiv glad_glGetQueryBufferObjectiv -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; -#define glGetQueryBufferObjectui64v glad_glGetQueryBufferObjectui64v -typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC)(GLuint id, GLuint buffer, GLenum pname, GLintptr offset); -GLAPI PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; -#define glGetQueryBufferObjectuiv glad_glGetQueryBufferObjectuiv -#endif -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -GLAPI int GLAD_GL_EXT_rescale_normal; -#endif -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -GLAPI int GLAD_GL_ARB_pixel_buffer_object; -#endif -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 -GLAPI int GLAD_GL_ARB_uniform_buffer_object; -#endif -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 -GLAPI int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; -#endif -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 -GLAPI int GLAD_GL_ARB_texture_swizzle; -#endif -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 -GLAPI int GLAD_GL_NV_transform_feedback2; -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; -#define glBindTransformFeedbackNV glad_glBindTransformFeedbackNV -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; -#define glDeleteTransformFeedbacksNV glad_glDeleteTransformFeedbacksNV -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; -#define glGenTransformFeedbacksNV glad_glGenTransformFeedbacksNV -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC)(GLuint id); -GLAPI PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; -#define glIsTransformFeedbackNV glad_glIsTransformFeedbackNV -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; -#define glPauseTransformFeedbackNV glad_glPauseTransformFeedbackNV -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC)(); -GLAPI PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; -#define glResumeTransformFeedbackNV glad_glResumeTransformFeedbackNV -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC)(GLenum mode, GLuint id); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; -#define glDrawTransformFeedbackNV glad_glDrawTransformFeedbackNV -#endif -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -GLAPI int GLAD_GL_SGIX_async_pixel; -#endif -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -GLAPI int GLAD_GL_NV_fragment_program_option; -#endif -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 -GLAPI int GLAD_GL_ARB_explicit_attrib_location; -#endif -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -GLAPI int GLAD_GL_EXT_blend_color; -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -#define glBlendColorEXT glad_glBlendColorEXT -#endif -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -GLAPI int GLAD_GL_NV_shader_thread_group; -#endif -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -GLAPI int GLAD_GL_EXT_stencil_wrap; -#endif -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -GLAPI int GLAD_GL_EXT_index_array_formats; -#endif -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 -GLAPI int GLAD_GL_OVR_multiview2; -#endif -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -GLAPI int GLAD_GL_EXT_histogram; -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; -#define glGetHistogramEXT glad_glGetHistogramEXT -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; -#define glGetHistogramParameterfvEXT glad_glGetHistogramParameterfvEXT -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; -#define glGetHistogramParameterivEXT glad_glGetHistogramParameterivEXT -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; -#define glGetMinmaxEXT glad_glGetMinmaxEXT -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; -#define glGetMinmaxParameterfvEXT glad_glGetMinmaxParameterfvEXT -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; -#define glGetMinmaxParameterivEXT glad_glGetMinmaxParameterivEXT -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; -#define glHistogramEXT glad_glHistogramEXT -typedef void (APIENTRYP PFNGLMINMAXEXTPROC)(GLenum target, GLenum internalformat, GLboolean sink); -GLAPI PFNGLMINMAXEXTPROC glad_glMinmaxEXT; -#define glMinmaxEXT glad_glMinmaxEXT -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC)(GLenum target); -GLAPI PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; -#define glResetHistogramEXT glad_glResetHistogramEXT -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC)(GLenum target); -GLAPI PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; -#define glResetMinmaxEXT glad_glResetMinmaxEXT -#endif -#ifndef GL_ARB_get_texture_sub_image -#define GL_ARB_get_texture_sub_image 1 -GLAPI int GLAD_GL_ARB_get_texture_sub_image; -typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; -#define glGetTextureSubImage glad_glGetTextureSubImage -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void* pixels); -GLAPI PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; -#define glGetCompressedTextureSubImage glad_glGetCompressedTextureSubImage -#endif -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -GLAPI int GLAD_GL_SGIS_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; -#define glPointParameterfSGIS glad_glPointParameterfSGIS -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; -#define glPointParameterfvSGIS glad_glPointParameterfvSGIS -#endif -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -GLAPI int GLAD_GL_SGIX_ycrcb; -#endif -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 -GLAPI int GLAD_GL_EXT_direct_state_access; -typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; -#define glMatrixLoadfEXT glad_glMatrixLoadfEXT -typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; -#define glMatrixLoaddEXT glad_glMatrixLoaddEXT -typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; -#define glMatrixMultfEXT glad_glMatrixMultfEXT -typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; -#define glMatrixMultdEXT glad_glMatrixMultdEXT -typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; -#define glMatrixLoadIdentityEXT glad_glMatrixLoadIdentityEXT -typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC)(GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; -#define glMatrixRotatefEXT glad_glMatrixRotatefEXT -typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC)(GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; -#define glMatrixRotatedEXT glad_glMatrixRotatedEXT -typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; -#define glMatrixScalefEXT glad_glMatrixScalefEXT -typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; -#define glMatrixScaledEXT glad_glMatrixScaledEXT -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC)(GLenum mode, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; -#define glMatrixTranslatefEXT glad_glMatrixTranslatefEXT -typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC)(GLenum mode, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; -#define glMatrixTranslatedEXT glad_glMatrixTranslatedEXT -typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; -#define glMatrixFrustumEXT glad_glMatrixFrustumEXT -typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC)(GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; -#define glMatrixOrthoEXT glad_glMatrixOrthoEXT -typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; -#define glMatrixPopEXT glad_glMatrixPopEXT -typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC)(GLenum mode); -GLAPI PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; -#define glMatrixPushEXT glad_glMatrixPushEXT -typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); -GLAPI PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; -#define glClientAttribDefaultEXT glad_glClientAttribDefaultEXT -typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)(GLbitfield mask); -GLAPI PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; -#define glPushClientAttribDefaultEXT glad_glPushClientAttribDefaultEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; -#define glTextureParameterfEXT glad_glTextureParameterfEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; -#define glTextureParameterfvEXT glad_glTextureParameterfvEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; -#define glTextureParameteriEXT glad_glTextureParameteriEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; -#define glTextureParameterivEXT glad_glTextureParameterivEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; -#define glTextureImage1DEXT glad_glTextureImage1DEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; -#define glTextureImage2DEXT glad_glTextureImage2DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; -#define glTextureSubImage1DEXT glad_glTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; -#define glTextureSubImage2DEXT glad_glTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; -#define glCopyTextureImage1DEXT glad_glCopyTextureImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; -#define glCopyTextureImage2DEXT glad_glCopyTextureImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; -#define glCopyTextureSubImage1DEXT glad_glCopyTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; -#define glCopyTextureSubImage2DEXT glad_glCopyTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; -#define glGetTextureImageEXT glad_glGetTextureImageEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; -#define glGetTextureParameterfvEXT glad_glGetTextureParameterfvEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; -#define glGetTextureParameterivEXT glad_glGetTextureParameterivEXT -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; -#define glGetTextureLevelParameterfvEXT glad_glGetTextureLevelParameterfvEXT -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; -#define glGetTextureLevelParameterivEXT glad_glGetTextureLevelParameterivEXT -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; -#define glTextureImage3DEXT glad_glTextureImage3DEXT -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; -#define glTextureSubImage3DEXT glad_glTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; -#define glCopyTextureSubImage3DEXT glad_glCopyTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC)(GLenum texunit, GLenum target, GLuint texture); -GLAPI PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; -#define glBindMultiTextureEXT glad_glBindMultiTextureEXT -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC)(GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; -#define glMultiTexCoordPointerEXT glad_glMultiTexCoordPointerEXT -typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; -#define glMultiTexEnvfEXT glad_glMultiTexEnvfEXT -typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; -#define glMultiTexEnvfvEXT glad_glMultiTexEnvfvEXT -typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; -#define glMultiTexEnviEXT glad_glMultiTexEnviEXT -typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; -#define glMultiTexEnvivEXT glad_glMultiTexEnvivEXT -typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -GLAPI PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; -#define glMultiTexGendEXT glad_glMultiTexGendEXT -typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); -GLAPI PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; -#define glMultiTexGendvEXT glad_glMultiTexGendvEXT -typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; -#define glMultiTexGenfEXT glad_glMultiTexGenfEXT -typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; -#define glMultiTexGenfvEXT glad_glMultiTexGenfvEXT -typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; -#define glMultiTexGeniEXT glad_glMultiTexGeniEXT -typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; -#define glMultiTexGenivEXT glad_glMultiTexGenivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; -#define glGetMultiTexEnvfvEXT glad_glGetMultiTexEnvfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; -#define glGetMultiTexEnvivEXT glad_glGetMultiTexEnvivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); -GLAPI PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; -#define glGetMultiTexGendvEXT glad_glGetMultiTexGendvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; -#define glGetMultiTexGenfvEXT glad_glGetMultiTexGenfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC)(GLenum texunit, GLenum coord, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; -#define glGetMultiTexGenivEXT glad_glGetMultiTexGenivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint param); -GLAPI PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; -#define glMultiTexParameteriEXT glad_glMultiTexParameteriEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; -#define glMultiTexParameterivEXT glad_glMultiTexParameterivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; -#define glMultiTexParameterfEXT glad_glMultiTexParameterfEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; -#define glMultiTexParameterfvEXT glad_glMultiTexParameterfvEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; -#define glMultiTexImage1DEXT glad_glMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; -#define glMultiTexImage2DEXT glad_glMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; -#define glMultiTexSubImage1DEXT glad_glMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; -#define glMultiTexSubImage2DEXT glad_glMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; -#define glCopyMultiTexImage1DEXT glad_glCopyMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; -#define glCopyMultiTexImage2DEXT glad_glCopyMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; -#define glCopyMultiTexSubImage1DEXT glad_glCopyMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; -#define glCopyMultiTexSubImage2DEXT glad_glCopyMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); -GLAPI PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; -#define glGetMultiTexImageEXT glad_glGetMultiTexImageEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; -#define glGetMultiTexParameterfvEXT glad_glGetMultiTexParameterfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; -#define glGetMultiTexParameterivEXT glad_glGetMultiTexParameterivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; -#define glGetMultiTexLevelParameterfvEXT glad_glGetMultiTexLevelParameterfvEXT -typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; -#define glGetMultiTexLevelParameterivEXT glad_glGetMultiTexLevelParameterivEXT -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; -#define glMultiTexImage3DEXT glad_glMultiTexImage3DEXT -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; -#define glMultiTexSubImage3DEXT glad_glMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; -#define glCopyMultiTexSubImage3DEXT glad_glCopyMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; -#define glEnableClientStateIndexedEXT glad_glEnableClientStateIndexedEXT -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; -#define glDisableClientStateIndexedEXT glad_glDisableClientStateIndexedEXT -typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC)(GLenum target, GLuint index, GLfloat* data); -GLAPI PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; -#define glGetFloatIndexedvEXT glad_glGetFloatIndexedvEXT -typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC)(GLenum target, GLuint index, GLdouble* data); -GLAPI PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; -#define glGetDoubleIndexedvEXT glad_glGetDoubleIndexedvEXT -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC)(GLenum target, GLuint index, void** data); -GLAPI PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; -#define glGetPointerIndexedvEXT glad_glGetPointerIndexedvEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; -#define glCompressedTextureImage3DEXT glad_glCompressedTextureImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; -#define glCompressedTextureImage2DEXT glad_glCompressedTextureImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; -#define glCompressedTextureImage1DEXT glad_glCompressedTextureImage1DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; -#define glCompressedTextureSubImage3DEXT glad_glCompressedTextureSubImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; -#define glCompressedTextureSubImage2DEXT glad_glCompressedTextureSubImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; -#define glCompressedTextureSubImage1DEXT glad_glCompressedTextureSubImage1DEXT -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)(GLuint texture, GLenum target, GLint lod, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; -#define glGetCompressedTextureImageEXT glad_glGetCompressedTextureImageEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; -#define glCompressedMultiTexImage3DEXT glad_glCompressedMultiTexImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; -#define glCompressedMultiTexImage2DEXT glad_glCompressedMultiTexImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; -#define glCompressedMultiTexImage1DEXT glad_glCompressedMultiTexImage1DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; -#define glCompressedMultiTexSubImage3DEXT glad_glCompressedMultiTexSubImage3DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; -#define glCompressedMultiTexSubImage2DEXT glad_glCompressedMultiTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* bits); -GLAPI PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; -#define glCompressedMultiTexSubImage1DEXT glad_glCompressedMultiTexSubImage1DEXT -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)(GLenum texunit, GLenum target, GLint lod, void* img); -GLAPI PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; -#define glGetCompressedMultiTexImageEXT glad_glGetCompressedMultiTexImageEXT -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; -#define glMatrixLoadTransposefEXT glad_glMatrixLoadTransposefEXT -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; -#define glMatrixLoadTransposedEXT glad_glMatrixLoadTransposedEXT -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC)(GLenum mode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; -#define glMatrixMultTransposefEXT glad_glMatrixMultTransposefEXT -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC)(GLenum mode, const GLdouble* m); -GLAPI PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; -#define glMatrixMultTransposedEXT glad_glMatrixMultTransposedEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); -GLAPI PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; -#define glNamedBufferDataEXT glad_glNamedBufferDataEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); -GLAPI PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; -#define glNamedBufferSubDataEXT glad_glNamedBufferSubDataEXT -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC)(GLuint buffer, GLenum access); -GLAPI PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; -#define glMapNamedBufferEXT glad_glMapNamedBufferEXT -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC)(GLuint buffer); -GLAPI PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; -#define glUnmapNamedBufferEXT glad_glUnmapNamedBufferEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; -#define glGetNamedBufferParameterivEXT glad_glGetNamedBufferParameterivEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)(GLuint buffer, GLenum pname, void** params); -GLAPI PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; -#define glGetNamedBufferPointervEXT glad_glGetNamedBufferPointervEXT -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); -GLAPI PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; -#define glGetNamedBufferSubDataEXT glad_glGetNamedBufferSubDataEXT -typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; -#define glTextureBufferEXT glad_glTextureBufferEXT -typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC)(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -GLAPI PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; -#define glMultiTexBufferEXT glad_glMultiTexBufferEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; -#define glTextureParameterIivEXT glad_glTextureParameterIivEXT -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; -#define glTextureParameterIuivEXT glad_glTextureParameterIuivEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; -#define glGetTextureParameterIivEXT glad_glGetTextureParameterIivEXT -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)(GLuint texture, GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; -#define glGetTextureParameterIuivEXT glad_glGetTextureParameterIuivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; -#define glMultiTexParameterIivEXT glad_glMultiTexParameterIivEXT -typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, const GLuint* params); -GLAPI PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; -#define glMultiTexParameterIuivEXT glad_glMultiTexParameterIuivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; -#define glGetMultiTexParameterIivEXT glad_glGetMultiTexParameterIivEXT -typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)(GLenum texunit, GLenum target, GLenum pname, GLuint* params); -GLAPI PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; -#define glGetMultiTexParameterIuivEXT glad_glGetMultiTexParameterIuivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; -#define glNamedProgramLocalParameters4fvEXT glad_glNamedProgramLocalParameters4fvEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)(GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; -#define glNamedProgramLocalParameterI4iEXT glad_glNamedProgramLocalParameterI4iEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; -#define glNamedProgramLocalParameterI4ivEXT glad_glNamedProgramLocalParameterI4ivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; -#define glNamedProgramLocalParametersI4ivEXT glad_glNamedProgramLocalParametersI4ivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; -#define glNamedProgramLocalParameterI4uiEXT glad_glNamedProgramLocalParameterI4uiEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; -#define glNamedProgramLocalParameterI4uivEXT glad_glNamedProgramLocalParameterI4uivEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; -#define glNamedProgramLocalParametersI4uivEXT glad_glNamedProgramLocalParametersI4uivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; -#define glGetNamedProgramLocalParameterIivEXT glad_glGetNamedProgramLocalParameterIivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)(GLuint program, GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; -#define glGetNamedProgramLocalParameterIuivEXT glad_glGetNamedProgramLocalParameterIuivEXT -typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; -#define glEnableClientStateiEXT glad_glEnableClientStateiEXT -typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC)(GLenum array, GLuint index); -GLAPI PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; -#define glDisableClientStateiEXT glad_glDisableClientStateiEXT -typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC)(GLenum pname, GLuint index, GLfloat* params); -GLAPI PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; -#define glGetFloati_vEXT glad_glGetFloati_vEXT -typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC)(GLenum pname, GLuint index, GLdouble* params); -GLAPI PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; -#define glGetDoublei_vEXT glad_glGetDoublei_vEXT -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC)(GLenum pname, GLuint index, void** params); -GLAPI PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; -#define glGetPointeri_vEXT glad_glGetPointeri_vEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); -GLAPI PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; -#define glNamedProgramStringEXT glad_glNamedProgramStringEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; -#define glNamedProgramLocalParameter4dEXT glad_glNamedProgramLocalParameter4dEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLdouble* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; -#define glNamedProgramLocalParameter4dvEXT glad_glNamedProgramLocalParameter4dvEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; -#define glNamedProgramLocalParameter4fEXT glad_glNamedProgramLocalParameter4fEXT -typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)(GLuint program, GLenum target, GLuint index, const GLfloat* params); -GLAPI PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; -#define glNamedProgramLocalParameter4fvEXT glad_glNamedProgramLocalParameter4fvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)(GLuint program, GLenum target, GLuint index, GLdouble* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; -#define glGetNamedProgramLocalParameterdvEXT glad_glGetNamedProgramLocalParameterdvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)(GLuint program, GLenum target, GLuint index, GLfloat* params); -GLAPI PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; -#define glGetNamedProgramLocalParameterfvEXT glad_glGetNamedProgramLocalParameterfvEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC)(GLuint program, GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; -#define glGetNamedProgramivEXT glad_glGetNamedProgramivEXT -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)(GLuint program, GLenum target, GLenum pname, void* string); -GLAPI PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; -#define glGetNamedProgramStringEXT glad_glGetNamedProgramStringEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; -#define glNamedRenderbufferStorageEXT glad_glNamedRenderbufferStorageEXT -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)(GLuint renderbuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; -#define glGetNamedRenderbufferParameterivEXT glad_glGetNamedRenderbufferParameterivEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; -#define glNamedRenderbufferStorageMultisampleEXT glad_glNamedRenderbufferStorageMultisampleEXT -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)(GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; -#define glNamedRenderbufferStorageMultisampleCoverageEXT glad_glNamedRenderbufferStorageMultisampleCoverageEXT -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)(GLuint framebuffer, GLenum target); -GLAPI PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; -#define glCheckNamedFramebufferStatusEXT glad_glCheckNamedFramebufferStatusEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; -#define glNamedFramebufferTexture1DEXT glad_glNamedFramebufferTexture1DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; -#define glNamedFramebufferTexture2DEXT glad_glNamedFramebufferTexture2DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; -#define glNamedFramebufferTexture3DEXT glad_glNamedFramebufferTexture3DEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; -#define glNamedFramebufferRenderbufferEXT glad_glNamedFramebufferRenderbufferEXT -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; -#define glGetNamedFramebufferAttachmentParameterivEXT glad_glGetNamedFramebufferAttachmentParameterivEXT -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC)(GLuint texture, GLenum target); -GLAPI PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; -#define glGenerateTextureMipmapEXT glad_glGenerateTextureMipmapEXT -typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC)(GLenum texunit, GLenum target); -GLAPI PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; -#define glGenerateMultiTexMipmapEXT glad_glGenerateMultiTexMipmapEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); -GLAPI PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; -#define glFramebufferDrawBufferEXT glad_glFramebufferDrawBufferEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)(GLuint framebuffer, GLsizei n, const GLenum* bufs); -GLAPI PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; -#define glFramebufferDrawBuffersEXT glad_glFramebufferDrawBuffersEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC)(GLuint framebuffer, GLenum mode); -GLAPI PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; -#define glFramebufferReadBufferEXT glad_glFramebufferReadBufferEXT -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; -#define glGetFramebufferParameterivEXT glad_glGetFramebufferParameterivEXT -typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GLAPI PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; -#define glNamedCopyBufferSubDataEXT glad_glNamedCopyBufferSubDataEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; -#define glNamedFramebufferTextureEXT glad_glNamedFramebufferTextureEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; -#define glNamedFramebufferTextureLayerEXT glad_glNamedFramebufferTextureLayerEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; -#define glNamedFramebufferTextureFaceEXT glad_glNamedFramebufferTextureFaceEXT -typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC)(GLuint texture, GLenum target, GLuint renderbuffer); -GLAPI PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; -#define glTextureRenderbufferEXT glad_glTextureRenderbufferEXT -typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC)(GLenum texunit, GLenum target, GLuint renderbuffer); -GLAPI PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; -#define glMultiTexRenderbufferEXT glad_glMultiTexRenderbufferEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; -#define glVertexArrayVertexOffsetEXT glad_glVertexArrayVertexOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; -#define glVertexArrayColorOffsetEXT glad_glVertexArrayColorOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; -#define glVertexArrayEdgeFlagOffsetEXT glad_glVertexArrayEdgeFlagOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; -#define glVertexArrayIndexOffsetEXT glad_glVertexArrayIndexOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; -#define glVertexArrayNormalOffsetEXT glad_glVertexArrayNormalOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; -#define glVertexArrayTexCoordOffsetEXT glad_glVertexArrayTexCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; -#define glVertexArrayMultiTexCoordOffsetEXT glad_glVertexArrayMultiTexCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; -#define glVertexArrayFogCoordOffsetEXT glad_glVertexArrayFogCoordOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; -#define glVertexArraySecondaryColorOffsetEXT glad_glVertexArraySecondaryColorOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; -#define glVertexArrayVertexAttribOffsetEXT glad_glVertexArrayVertexAttribOffsetEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; -#define glVertexArrayVertexAttribIOffsetEXT glad_glVertexArrayVertexAttribIOffsetEXT -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); -GLAPI PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; -#define glEnableVertexArrayEXT glad_glEnableVertexArrayEXT -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC)(GLuint vaobj, GLenum array); -GLAPI PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; -#define glDisableVertexArrayEXT glad_glDisableVertexArrayEXT -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; -#define glEnableVertexArrayAttribEXT glad_glEnableVertexArrayAttribEXT -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)(GLuint vaobj, GLuint index); -GLAPI PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; -#define glDisableVertexArrayAttribEXT glad_glDisableVertexArrayAttribEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC)(GLuint vaobj, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; -#define glGetVertexArrayIntegervEXT glad_glGetVertexArrayIntegervEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC)(GLuint vaobj, GLenum pname, void** param); -GLAPI PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; -#define glGetVertexArrayPointervEXT glad_glGetVertexArrayPointervEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, GLint* param); -GLAPI PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; -#define glGetVertexArrayIntegeri_vEXT glad_glGetVertexArrayIntegeri_vEXT -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)(GLuint vaobj, GLuint index, GLenum pname, void** param); -GLAPI PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; -#define glGetVertexArrayPointeri_vEXT glad_glGetVertexArrayPointeri_vEXT -typedef void* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -GLAPI PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; -#define glMapNamedBufferRangeEXT glad_glMapNamedBufferRangeEXT -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; -#define glFlushMappedNamedBufferRangeEXT glad_glFlushMappedNamedBufferRangeEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC)(GLuint buffer, GLsizeiptr size, const void* data, GLbitfield flags); -GLAPI PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; -#define glNamedBufferStorageEXT glad_glNamedBufferStorageEXT -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; -#define glClearNamedBufferDataEXT glad_glClearNamedBufferDataEXT -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; -#define glClearNamedBufferSubDataEXT glad_glClearNamedBufferSubDataEXT -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)(GLuint framebuffer, GLenum pname, GLint param); -GLAPI PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; -#define glNamedFramebufferParameteriEXT glad_glNamedFramebufferParameteriEXT -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)(GLuint framebuffer, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; -#define glGetNamedFramebufferParameterivEXT glad_glGetNamedFramebufferParameterivEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC)(GLuint program, GLint location, GLdouble x); -GLAPI PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; -#define glProgramUniform1dEXT glad_glProgramUniform1dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y); -GLAPI PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; -#define glProgramUniform2dEXT glad_glProgramUniform2dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; -#define glProgramUniform3dEXT glad_glProgramUniform3dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC)(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; -#define glProgramUniform4dEXT glad_glProgramUniform4dEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; -#define glProgramUniform1dvEXT glad_glProgramUniform1dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; -#define glProgramUniform2dvEXT glad_glProgramUniform2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; -#define glProgramUniform3dvEXT glad_glProgramUniform3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; -#define glProgramUniform4dvEXT glad_glProgramUniform4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; -#define glProgramUniformMatrix2dvEXT glad_glProgramUniformMatrix2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; -#define glProgramUniformMatrix3dvEXT glad_glProgramUniformMatrix3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; -#define glProgramUniformMatrix4dvEXT glad_glProgramUniformMatrix4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; -#define glProgramUniformMatrix2x3dvEXT glad_glProgramUniformMatrix2x3dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; -#define glProgramUniformMatrix2x4dvEXT glad_glProgramUniformMatrix2x4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; -#define glProgramUniformMatrix3x2dvEXT glad_glProgramUniformMatrix3x2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; -#define glProgramUniformMatrix3x4dvEXT glad_glProgramUniformMatrix3x4dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; -#define glProgramUniformMatrix4x2dvEXT glad_glProgramUniformMatrix4x2dvEXT -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; -#define glProgramUniformMatrix4x3dvEXT glad_glProgramUniformMatrix4x3dvEXT -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC)(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; -#define glTextureBufferRangeEXT glad_glTextureBufferRangeEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; -#define glTextureStorage1DEXT glad_glTextureStorage1DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; -#define glTextureStorage2DEXT glad_glTextureStorage2DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; -#define glTextureStorage3DEXT glad_glTextureStorage3DEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; -#define glTextureStorage2DMultisampleEXT glad_glTextureStorage2DMultisampleEXT -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; -#define glTextureStorage3DMultisampleEXT glad_glTextureStorage3DMultisampleEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; -#define glVertexArrayBindVertexBufferEXT glad_glVertexArrayBindVertexBufferEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; -#define glVertexArrayVertexAttribFormatEXT glad_glVertexArrayVertexAttribFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; -#define glVertexArrayVertexAttribIFormatEXT glad_glVertexArrayVertexAttribIFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; -#define glVertexArrayVertexAttribLFormatEXT glad_glVertexArrayVertexAttribLFormatEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)(GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; -#define glVertexArrayVertexAttribBindingEXT glad_glVertexArrayVertexAttribBindingEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)(GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; -#define glVertexArrayVertexBindingDivisorEXT glad_glVertexArrayVertexBindingDivisorEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; -#define glVertexArrayVertexAttribLOffsetEXT glad_glVertexArrayVertexAttribLOffsetEXT -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -GLAPI PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; -#define glTexturePageCommitmentEXT glad_glTexturePageCommitmentEXT -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)(GLuint vaobj, GLuint index, GLuint divisor); -GLAPI PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; -#define glVertexArrayVertexAttribDivisorEXT glad_glVertexArrayVertexAttribDivisorEXT -#endif -#ifndef GL_ARB_cull_distance -#define GL_ARB_cull_distance 1 -GLAPI int GLAD_GL_ARB_cull_distance; -#endif -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 -GLAPI int GLAD_GL_AMD_sample_positions; -typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC)(GLenum pname, GLuint index, const GLfloat* val); -GLAPI PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; -#define glSetMultisamplefvAMD glad_glSetMultisamplefvAMD -#endif -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -GLAPI int GLAD_GL_NV_vertex_program; -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC)(GLsizei n, const GLuint* programs, GLboolean* residences); -GLAPI PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; -#define glAreProgramsResidentNV glad_glAreProgramsResidentNV -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; -#define glBindProgramNV glad_glBindProgramNV -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; -#define glDeleteProgramsNV glad_glDeleteProgramsNV -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC)(GLenum target, GLuint id, const GLfloat* params); -GLAPI PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; -#define glExecuteProgramNV glad_glExecuteProgramNV -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC)(GLsizei n, GLuint* programs); -GLAPI PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; -#define glGenProgramsNV glad_glGenProgramsNV -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC)(GLenum target, GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; -#define glGetProgramParameterdvNV glad_glGetProgramParameterdvNV -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; -#define glGetProgramParameterfvNV glad_glGetProgramParameterfvNV -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; -#define glGetProgramivNV glad_glGetProgramivNV -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC)(GLuint id, GLenum pname, GLubyte* program); -GLAPI PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; -#define glGetProgramStringNV glad_glGetProgramStringNV -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC)(GLenum target, GLuint address, GLenum pname, GLint* params); -GLAPI PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; -#define glGetTrackMatrixivNV glad_glGetTrackMatrixivNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; -#define glGetVertexAttribdvNV glad_glGetVertexAttribdvNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC)(GLuint index, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; -#define glGetVertexAttribfvNV glad_glGetVertexAttribfvNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; -#define glGetVertexAttribivNV glad_glGetVertexAttribivNV -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC)(GLuint index, GLenum pname, void** pointer); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; -#define glGetVertexAttribPointervNV glad_glGetVertexAttribPointervNV -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC)(GLuint id); -GLAPI PFNGLISPROGRAMNVPROC glad_glIsProgramNV; -#define glIsProgramNV glad_glIsProgramNV -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC)(GLenum target, GLuint id, GLsizei len, const GLubyte* program); -GLAPI PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; -#define glLoadProgramNV glad_glLoadProgramNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; -#define glProgramParameter4dNV glad_glProgramParameter4dNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC)(GLenum target, GLuint index, const GLdouble* v); -GLAPI PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; -#define glProgramParameter4dvNV glad_glProgramParameter4dvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; -#define glProgramParameter4fNV glad_glProgramParameter4fNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC)(GLenum target, GLuint index, const GLfloat* v); -GLAPI PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; -#define glProgramParameter4fvNV glad_glProgramParameter4fvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; -#define glProgramParameters4dvNV glad_glProgramParameters4dvNV -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; -#define glProgramParameters4fvNV glad_glProgramParameters4fvNV -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); -GLAPI PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; -#define glRequestResidentProgramsNV glad_glRequestResidentProgramsNV -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC)(GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; -#define glTrackMatrixNV glad_glTrackMatrixNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC)(GLuint index, GLint fsize, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; -#define glVertexAttribPointerNV glad_glVertexAttribPointerNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; -#define glVertexAttrib1dNV glad_glVertexAttrib1dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; -#define glVertexAttrib1dvNV glad_glVertexAttrib1dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC)(GLuint index, GLfloat x); -GLAPI PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; -#define glVertexAttrib1fNV glad_glVertexAttrib1fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; -#define glVertexAttrib1fvNV glad_glVertexAttrib1fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC)(GLuint index, GLshort x); -GLAPI PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; -#define glVertexAttrib1sNV glad_glVertexAttrib1sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; -#define glVertexAttrib1svNV glad_glVertexAttrib1svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; -#define glVertexAttrib2dNV glad_glVertexAttrib2dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; -#define glVertexAttrib2dvNV glad_glVertexAttrib2dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC)(GLuint index, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; -#define glVertexAttrib2fNV glad_glVertexAttrib2fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; -#define glVertexAttrib2fvNV glad_glVertexAttrib2fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC)(GLuint index, GLshort x, GLshort y); -GLAPI PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; -#define glVertexAttrib2sNV glad_glVertexAttrib2sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; -#define glVertexAttrib2svNV glad_glVertexAttrib2svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; -#define glVertexAttrib3dNV glad_glVertexAttrib3dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; -#define glVertexAttrib3dvNV glad_glVertexAttrib3dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; -#define glVertexAttrib3fNV glad_glVertexAttrib3fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; -#define glVertexAttrib3fvNV glad_glVertexAttrib3fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; -#define glVertexAttrib3sNV glad_glVertexAttrib3sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; -#define glVertexAttrib3svNV glad_glVertexAttrib3svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; -#define glVertexAttrib4dNV glad_glVertexAttrib4dNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; -#define glVertexAttrib4dvNV glad_glVertexAttrib4dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; -#define glVertexAttrib4fNV glad_glVertexAttrib4fNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; -#define glVertexAttrib4fvNV glad_glVertexAttrib4fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; -#define glVertexAttrib4sNV glad_glVertexAttrib4sNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; -#define glVertexAttrib4svNV glad_glVertexAttrib4svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -GLAPI PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; -#define glVertexAttrib4ubNV glad_glVertexAttrib4ubNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; -#define glVertexAttrib4ubvNV glad_glVertexAttrib4ubvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; -#define glVertexAttribs1dvNV glad_glVertexAttribs1dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; -#define glVertexAttribs1fvNV glad_glVertexAttribs1fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; -#define glVertexAttribs1svNV glad_glVertexAttribs1svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; -#define glVertexAttribs2dvNV glad_glVertexAttribs2dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; -#define glVertexAttribs2fvNV glad_glVertexAttribs2fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; -#define glVertexAttribs2svNV glad_glVertexAttribs2svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; -#define glVertexAttribs3dvNV glad_glVertexAttribs3dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; -#define glVertexAttribs3fvNV glad_glVertexAttribs3fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; -#define glVertexAttribs3svNV glad_glVertexAttribs3svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; -#define glVertexAttribs4dvNV glad_glVertexAttribs4dvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); -GLAPI PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; -#define glVertexAttribs4fvNV glad_glVertexAttribs4fvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; -#define glVertexAttribs4svNV glad_glVertexAttribs4svNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC)(GLuint index, GLsizei count, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; -#define glVertexAttribs4ubvNV glad_glVertexAttribs4ubvNV -#endif -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -GLAPI int GLAD_GL_NV_shader_thread_shuffle; -#endif -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 -GLAPI int GLAD_GL_ARB_shader_precision; -#endif -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -GLAPI int GLAD_GL_EXT_vertex_shader; -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC)(); -GLAPI PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -#define glBeginVertexShaderEXT glad_glBeginVertexShaderEXT -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC)(); -GLAPI PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -#define glEndVertexShaderEXT glad_glEndVertexShaderEXT -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -#define glBindVertexShaderEXT glad_glBindVertexShaderEXT -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC)(GLuint range); -GLAPI PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -#define glGenVertexShadersEXT glad_glGenVertexShadersEXT -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC)(GLuint id); -GLAPI PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -#define glDeleteVertexShaderEXT glad_glDeleteVertexShaderEXT -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC)(GLenum op, GLuint res, GLuint arg1); -GLAPI PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -#define glShaderOp1EXT glad_glShaderOp1EXT -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2); -GLAPI PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -#define glShaderOp2EXT glad_glShaderOp2EXT -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -GLAPI PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -#define glShaderOp3EXT glad_glShaderOp3EXT -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -#define glSwizzleEXT glad_glSwizzleEXT -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -GLAPI PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -#define glWriteMaskEXT glad_glWriteMaskEXT -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -#define glInsertComponentEXT glad_glInsertComponentEXT -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); -GLAPI PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -#define glExtractComponentEXT glad_glExtractComponentEXT -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC)(GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -#define glGenSymbolsEXT glad_glGenSymbolsEXT -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -#define glSetInvariantEXT glad_glSetInvariantEXT -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC)(GLuint id, GLenum type, const void* addr); -GLAPI PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -#define glSetLocalConstantEXT glad_glSetLocalConstantEXT -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC)(GLuint id, const GLbyte* addr); -GLAPI PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -#define glVariantbvEXT glad_glVariantbvEXT -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC)(GLuint id, const GLshort* addr); -GLAPI PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -#define glVariantsvEXT glad_glVariantsvEXT -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC)(GLuint id, const GLint* addr); -GLAPI PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -#define glVariantivEXT glad_glVariantivEXT -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC)(GLuint id, const GLfloat* addr); -GLAPI PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -#define glVariantfvEXT glad_glVariantfvEXT -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC)(GLuint id, const GLdouble* addr); -GLAPI PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -#define glVariantdvEXT glad_glVariantdvEXT -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC)(GLuint id, const GLubyte* addr); -GLAPI PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -#define glVariantubvEXT glad_glVariantubvEXT -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC)(GLuint id, const GLushort* addr); -GLAPI PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -#define glVariantusvEXT glad_glVariantusvEXT -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC)(GLuint id, const GLuint* addr); -GLAPI PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -#define glVariantuivEXT glad_glVariantuivEXT -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC)(GLuint id, GLenum type, GLuint stride, const void* addr); -GLAPI PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -#define glVariantPointerEXT glad_glVariantPointerEXT -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -#define glEnableVariantClientStateEXT glad_glEnableVariantClientStateEXT -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); -GLAPI PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -#define glDisableVariantClientStateEXT glad_glDisableVariantClientStateEXT -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC)(GLenum light, GLenum value); -GLAPI PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -#define glBindLightParameterEXT glad_glBindLightParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC)(GLenum face, GLenum value); -GLAPI PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -#define glBindMaterialParameterEXT glad_glBindMaterialParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC)(GLenum unit, GLenum coord, GLenum value); -GLAPI PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -#define glBindTexGenParameterEXT glad_glBindTexGenParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)(GLenum unit, GLenum value); -GLAPI PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -#define glBindTextureUnitParameterEXT glad_glBindTextureUnitParameterEXT -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC)(GLenum value); -GLAPI PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -#define glBindParameterEXT glad_glBindParameterEXT -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC)(GLuint id, GLenum cap); -GLAPI PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -#define glIsVariantEnabledEXT glad_glIsVariantEnabledEXT -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -#define glGetVariantBooleanvEXT glad_glGetVariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -#define glGetVariantIntegervEXT glad_glGetVariantIntegervEXT -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -#define glGetVariantFloatvEXT glad_glGetVariantFloatvEXT -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC)(GLuint id, GLenum value, void** data); -GLAPI PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -#define glGetVariantPointervEXT glad_glGetVariantPointervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -#define glGetInvariantBooleanvEXT glad_glGetInvariantBooleanvEXT -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -#define glGetInvariantIntegervEXT glad_glGetInvariantIntegervEXT -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -#define glGetInvariantFloatvEXT glad_glGetInvariantFloatvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); -GLAPI PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -#define glGetLocalConstantBooleanvEXT glad_glGetLocalConstantBooleanvEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); -GLAPI PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -#define glGetLocalConstantIntegervEXT glad_glGetLocalConstantIntegervEXT -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); -GLAPI PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -#define glGetLocalConstantFloatvEXT glad_glGetLocalConstantFloatvEXT -#endif -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -GLAPI int GLAD_GL_EXT_blend_func_separate; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -#define glBlendFuncSeparateEXT glad_glBlendFuncSeparateEXT -#endif -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -GLAPI int GLAD_GL_APPLE_fence; -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC)(GLsizei n, GLuint* fences); -GLAPI PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; -#define glGenFencesAPPLE glad_glGenFencesAPPLE -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC)(GLsizei n, const GLuint* fences); -GLAPI PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; -#define glDeleteFencesAPPLE glad_glDeleteFencesAPPLE -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; -#define glSetFenceAPPLE glad_glSetFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; -#define glIsFenceAPPLE glad_glIsFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; -#define glTestFenceAPPLE glad_glTestFenceAPPLE -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC)(GLuint fence); -GLAPI PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; -#define glFinishFenceAPPLE glad_glFinishFenceAPPLE -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC)(GLenum object, GLuint name); -GLAPI PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; -#define glTestObjectAPPLE glad_glTestObjectAPPLE -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC)(GLenum object, GLint name); -GLAPI PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; -#define glFinishObjectAPPLE glad_glFinishObjectAPPLE -#endif -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 -GLAPI int GLAD_GL_OES_byte_coordinates; -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC)(GLenum texture, GLbyte s); -GLAPI PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; -#define glMultiTexCoord1bOES glad_glMultiTexCoord1bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; -#define glMultiTexCoord1bvOES glad_glMultiTexCoord1bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC)(GLenum texture, GLbyte s, GLbyte t); -GLAPI PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; -#define glMultiTexCoord2bOES glad_glMultiTexCoord2bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; -#define glMultiTexCoord2bvOES glad_glMultiTexCoord2bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r); -GLAPI PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; -#define glMultiTexCoord3bOES glad_glMultiTexCoord3bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; -#define glMultiTexCoord3bvOES glad_glMultiTexCoord3bvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC)(GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; -#define glMultiTexCoord4bOES glad_glMultiTexCoord4bOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC)(GLenum texture, const GLbyte* coords); -GLAPI PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; -#define glMultiTexCoord4bvOES glad_glMultiTexCoord4bvOES -typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC)(GLbyte s); -GLAPI PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; -#define glTexCoord1bOES glad_glTexCoord1bOES -typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; -#define glTexCoord1bvOES glad_glTexCoord1bvOES -typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC)(GLbyte s, GLbyte t); -GLAPI PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; -#define glTexCoord2bOES glad_glTexCoord2bOES -typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; -#define glTexCoord2bvOES glad_glTexCoord2bvOES -typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC)(GLbyte s, GLbyte t, GLbyte r); -GLAPI PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; -#define glTexCoord3bOES glad_glTexCoord3bOES -typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; -#define glTexCoord3bvOES glad_glTexCoord3bvOES -typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC)(GLbyte s, GLbyte t, GLbyte r, GLbyte q); -GLAPI PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; -#define glTexCoord4bOES glad_glTexCoord4bOES -typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; -#define glTexCoord4bvOES glad_glTexCoord4bvOES -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC)(GLbyte x, GLbyte y); -GLAPI PFNGLVERTEX2BOESPROC glad_glVertex2bOES; -#define glVertex2bOES glad_glVertex2bOES -typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; -#define glVertex2bvOES glad_glVertex2bvOES -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC)(GLbyte x, GLbyte y, GLbyte z); -GLAPI PFNGLVERTEX3BOESPROC glad_glVertex3bOES; -#define glVertex3bOES glad_glVertex3bOES -typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; -#define glVertex3bvOES glad_glVertex3bvOES -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC)(GLbyte x, GLbyte y, GLbyte z, GLbyte w); -GLAPI PFNGLVERTEX4BOESPROC glad_glVertex4bOES; -#define glVertex4bOES glad_glVertex4bOES -typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC)(const GLbyte* coords); -GLAPI PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; -#define glVertex4bvOES glad_glVertex4bvOES -#endif -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -GLAPI int GLAD_GL_ARB_transpose_matrix; -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; -#define glLoadTransposeMatrixfARB glad_glLoadTransposeMatrixfARB -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; -#define glLoadTransposeMatrixdARB glad_glLoadTransposeMatrixdARB -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; -#define glMultTransposeMatrixfARB glad_glMultTransposeMatrixfARB -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; -#define glMultTransposeMatrixdARB glad_glMultTransposeMatrixdARB -#endif -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 -GLAPI int GLAD_GL_ARB_provoking_vertex; -#endif -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -GLAPI int GLAD_GL_EXT_fog_coord; -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC)(GLfloat coord); -GLAPI PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; -#define glFogCoordfEXT glad_glFogCoordfEXT -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC)(const GLfloat* coord); -GLAPI PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; -#define glFogCoordfvEXT glad_glFogCoordfvEXT -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC)(GLdouble coord); -GLAPI PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; -#define glFogCoorddEXT glad_glFogCoorddEXT -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC)(const GLdouble* coord); -GLAPI PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; -#define glFogCoorddvEXT glad_glFogCoorddvEXT -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; -#define glFogCoordPointerEXT glad_glFogCoordPointerEXT -#endif -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -GLAPI int GLAD_GL_EXT_vertex_array; -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC)(GLint i); -GLAPI PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -#define glArrayElementEXT glad_glArrayElementEXT -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -#define glColorPointerEXT glad_glColorPointerEXT -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); -GLAPI PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -#define glDrawArraysEXT glad_glDrawArraysEXT -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); -GLAPI PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -#define glEdgeFlagPointerEXT glad_glEdgeFlagPointerEXT -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC)(GLenum pname, void** params); -GLAPI PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -#define glGetPointervEXT glad_glGetPointervEXT -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -#define glIndexPointerEXT glad_glIndexPointerEXT -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -#define glNormalPointerEXT glad_glNormalPointerEXT -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -#define glTexCoordPointerEXT glad_glTexCoordPointerEXT -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); -GLAPI PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -#define glVertexPointerEXT glad_glVertexPointerEXT -#endif -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 -GLAPI int GLAD_GL_ARB_half_float_vertex; -#endif -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -GLAPI int GLAD_GL_EXT_blend_equation_separate; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC)(GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -#define glBlendEquationSeparateEXT glad_glBlendEquationSeparateEXT -#endif -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 -GLAPI int GLAD_GL_NV_framebuffer_mixed_samples; -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC)(GLsizei n, const GLfloat* v); -GLAPI PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; -#define glCoverageModulationTableNV glad_glCoverageModulationTableNV -typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC)(GLsizei bufsize, GLfloat* v); -GLAPI PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; -#define glGetCoverageModulationTableNV glad_glGetCoverageModulationTableNV -typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC)(GLenum components); -GLAPI PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; -#define glCoverageModulationNV glad_glCoverageModulationNV -#endif -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 -GLAPI int GLAD_GL_NVX_conditional_render; -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC)(GLuint id); -GLAPI PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; -#define glBeginConditionalRenderNVX glad_glBeginConditionalRenderNVX -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; -#define glEndConditionalRenderNVX glad_glEndConditionalRenderNVX -#endif -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 -GLAPI int GLAD_GL_ARB_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect, GLsizei drawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; -#define glMultiDrawArraysIndirect glad_glMultiDrawArraysIndirect -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; -#define glMultiDrawElementsIndirect glad_glMultiDrawElementsIndirect -#endif -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 -GLAPI int GLAD_GL_EXT_raster_multisample; -#endif -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 -GLAPI int GLAD_GL_NV_copy_image; -typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); -GLAPI PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; -#define glCopyImageSubDataNV glad_glCopyImageSubDataNV -#endif -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 -GLAPI int GLAD_GL_ARB_fragment_layer_viewport; -#endif -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 -GLAPI int GLAD_GL_INTEL_framebuffer_CMAA; -typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)(); -GLAPI PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; -#define glApplyFramebufferAttachmentCMAAINTEL glad_glApplyFramebufferAttachmentCMAAINTEL -#endif -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 -GLAPI int GLAD_GL_ARB_transform_feedback2; -typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC)(GLenum target, GLuint id); -GLAPI PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; -#define glBindTransformFeedback glad_glBindTransformFeedback -typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; -#define glDeleteTransformFeedbacks glad_glDeleteTransformFeedbacks -typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; -#define glGenTransformFeedbacks glad_glGenTransformFeedbacks -typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC)(GLuint id); -GLAPI PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; -#define glIsTransformFeedback glad_glIsTransformFeedback -typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; -#define glPauseTransformFeedback glad_glPauseTransformFeedback -typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; -#define glResumeTransformFeedback glad_glResumeTransformFeedback -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC)(GLenum mode, GLuint id); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; -#define glDrawTransformFeedback glad_glDrawTransformFeedback -#endif -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 -GLAPI int GLAD_GL_ARB_transform_feedback3; -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)(GLenum mode, GLuint id, GLuint stream); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; -#define glDrawTransformFeedbackStream glad_glDrawTransformFeedbackStream -typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC)(GLenum target, GLuint index, GLuint id); -GLAPI PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; -#define glBeginQueryIndexed glad_glBeginQueryIndexed -typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC)(GLenum target, GLuint index); -GLAPI PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; -#define glEndQueryIndexed glad_glEndQueryIndexed -typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC)(GLenum target, GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; -#define glGetQueryIndexediv glad_glGetQueryIndexediv -#endif -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -GLAPI int GLAD_GL_SGIX_ycrcba; -#endif -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -GLAPI int GLAD_GL_EXT_debug_marker; -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC)(GLsizei length, const GLchar* marker); -GLAPI PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -#define glInsertEventMarkerEXT glad_glInsertEventMarkerEXT -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC)(GLsizei length, const GLchar* marker); -GLAPI PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -#define glPushGroupMarkerEXT glad_glPushGroupMarkerEXT -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC)(); -GLAPI PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -#define glPopGroupMarkerEXT glad_glPopGroupMarkerEXT -#endif -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -GLAPI int GLAD_GL_EXT_bgra; -#endif -#ifndef GL_ARB_sparse_texture_clamp -#define GL_ARB_sparse_texture_clamp 1 -GLAPI int GLAD_GL_ARB_sparse_texture_clamp; -#endif -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -GLAPI int GLAD_GL_EXT_pixel_transform; -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; -#define glPixelTransformParameteriEXT glad_glPixelTransformParameteriEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)(GLenum target, GLenum pname, GLfloat param); -GLAPI PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; -#define glPixelTransformParameterfEXT glad_glPixelTransformParameterfEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; -#define glPixelTransformParameterivEXT glad_glPixelTransformParameterivEXT -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; -#define glPixelTransformParameterfvEXT glad_glPixelTransformParameterfvEXT -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; -#define glGetPixelTransformParameterivEXT glad_glGetPixelTransformParameterivEXT -typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; -#define glGetPixelTransformParameterfvEXT glad_glGetPixelTransformParameterfvEXT -#endif -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 -GLAPI int GLAD_GL_ARB_conservative_depth; -#endif -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -GLAPI int GLAD_GL_ATI_fragment_shader; -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); -GLAPI PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -#define glGenFragmentShadersATI glad_glGenFragmentShadersATI -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -#define glBindFragmentShaderATI glad_glBindFragmentShaderATI -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); -GLAPI PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -#define glDeleteFragmentShaderATI glad_glDeleteFragmentShaderATI -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -#define glBeginFragmentShaderATI glad_glBeginFragmentShaderATI -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC)(); -GLAPI PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -#define glEndFragmentShaderATI glad_glEndFragmentShaderATI -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); -GLAPI PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -#define glPassTexCoordATI glad_glPassTexCoordATI -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); -GLAPI PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -#define glSampleMapATI glad_glSampleMapATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -#define glColorFragmentOp1ATI glad_glColorFragmentOp1ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -#define glColorFragmentOp2ATI glad_glColorFragmentOp2ATI -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -#define glColorFragmentOp3ATI glad_glColorFragmentOp3ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -GLAPI PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -#define glAlphaFragmentOp1ATI glad_glAlphaFragmentOp1ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -GLAPI PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -#define glAlphaFragmentOp2ATI glad_glAlphaFragmentOp2ATI -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -GLAPI PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -#define glAlphaFragmentOp3ATI glad_glAlphaFragmentOp3ATI -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat* value); -GLAPI PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -#define glSetFragmentShaderConstantATI glad_glSetFragmentShaderConstantATI -#endif -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 -GLAPI int GLAD_GL_ARB_vertex_array_object; -#endif -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -GLAPI int GLAD_GL_SUN_triangle_list; -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC)(GLuint code); -GLAPI PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; -#define glReplacementCodeuiSUN glad_glReplacementCodeuiSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC)(GLushort code); -GLAPI PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; -#define glReplacementCodeusSUN glad_glReplacementCodeusSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC)(GLubyte code); -GLAPI PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; -#define glReplacementCodeubSUN glad_glReplacementCodeubSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC)(const GLuint* code); -GLAPI PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; -#define glReplacementCodeuivSUN glad_glReplacementCodeuivSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC)(const GLushort* code); -GLAPI PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; -#define glReplacementCodeusvSUN glad_glReplacementCodeusvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC)(const GLubyte* code); -GLAPI PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; -#define glReplacementCodeubvSUN glad_glReplacementCodeubvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC)(GLenum type, GLsizei stride, const void** pointer); -GLAPI PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; -#define glReplacementCodePointerSUN glad_glReplacementCodePointerSUN -#endif -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -GLAPI int GLAD_GL_EXT_texture_env_add; -#endif -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 -GLAPI int GLAD_GL_EXT_packed_depth_stencil; -#endif -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -GLAPI int GLAD_GL_EXT_texture_mirror_clamp; -#endif -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -GLAPI int GLAD_GL_NV_multisample_filter_hint; -#endif -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 -GLAPI int GLAD_GL_APPLE_float_pixels; -#endif -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 -GLAPI int GLAD_GL_ARB_transform_feedback_instanced; -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)(GLenum mode, GLuint id, GLsizei instancecount); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; -#define glDrawTransformFeedbackInstanced glad_glDrawTransformFeedbackInstanced -typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); -GLAPI PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; -#define glDrawTransformFeedbackStreamInstanced glad_glDrawTransformFeedbackStreamInstanced -#endif -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -GLAPI int GLAD_GL_SGIX_async; -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC)(GLuint marker); -GLAPI PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; -#define glAsyncMarkerSGIX glad_glAsyncMarkerSGIX -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC)(GLuint* markerp); -GLAPI PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; -#define glFinishAsyncSGIX glad_glFinishAsyncSGIX -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC)(GLuint* markerp); -GLAPI PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; -#define glPollAsyncSGIX glad_glPollAsyncSGIX -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC)(GLsizei range); -GLAPI PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; -#define glGenAsyncMarkersSGIX glad_glGenAsyncMarkersSGIX -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC)(GLuint marker, GLsizei range); -GLAPI PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; -#define glDeleteAsyncMarkersSGIX glad_glDeleteAsyncMarkersSGIX -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC)(GLuint marker); -GLAPI PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; -#define glIsAsyncMarkerSGIX glad_glIsAsyncMarkerSGIX -#endif -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 -GLAPI int GLAD_GL_EXT_texture_compression_latc; -#endif -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 -GLAPI int GLAD_GL_NV_shader_atomic_float; -#endif -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -GLAPI int GLAD_GL_ARB_shading_language_100; -#endif -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -GLAPI int GLAD_GL_INTEL_performance_query; -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; -#define glBeginPerfQueryINTEL glad_glBeginPerfQueryINTEL -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC)(GLuint queryId, GLuint* queryHandle); -GLAPI PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; -#define glCreatePerfQueryINTEL glad_glCreatePerfQueryINTEL -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; -#define glDeletePerfQueryINTEL glad_glDeletePerfQueryINTEL -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC)(GLuint queryHandle); -GLAPI PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; -#define glEndPerfQueryINTEL glad_glEndPerfQueryINTEL -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC)(GLuint* queryId); -GLAPI PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; -#define glGetFirstPerfQueryIdINTEL glad_glGetFirstPerfQueryIdINTEL -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC)(GLuint queryId, GLuint* nextQueryId); -GLAPI PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; -#define glGetNextPerfQueryIdINTEL glad_glGetNextPerfQueryIdINTEL -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC)(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar* counterDesc, GLuint* counterOffset, GLuint* counterDataSize, GLuint* counterTypeEnum, GLuint* counterDataTypeEnum, GLuint64* rawCounterMaxValue); -GLAPI PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; -#define glGetPerfCounterInfoINTEL glad_glGetPerfCounterInfoINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC)(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid* data, GLuint* bytesWritten); -GLAPI PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; -#define glGetPerfQueryDataINTEL glad_glGetPerfQueryDataINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC)(GLchar* queryName, GLuint* queryId); -GLAPI PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; -#define glGetPerfQueryIdByNameINTEL glad_glGetPerfQueryIdByNameINTEL -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC)(GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint* dataSize, GLuint* noCounters, GLuint* noInstances, GLuint* capsMask); -GLAPI PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; -#define glGetPerfQueryInfoINTEL glad_glGetPerfQueryInfoINTEL -#endif -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 -GLAPI int GLAD_GL_ARB_texture_mirror_clamp_to_edge; -#endif -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 -GLAPI int GLAD_GL_NV_gpu_shader5; -#endif -#ifndef GL_NV_bindless_multi_draw_indirect_count -#define GL_NV_bindless_multi_draw_indirect_count 1 -GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect_count; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; -#define glMultiDrawArraysIndirectBindlessCountNV glad_glMultiDrawArraysIndirectBindlessCountNV -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; -#define glMultiDrawElementsIndirectBindlessCountNV glad_glMultiDrawElementsIndirectBindlessCountNV -#endif -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 -GLAPI int GLAD_GL_ARB_ES2_compatibility; -typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(); -GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -#define glReleaseShaderCompiler glad_glReleaseShaderCompiler -typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); -GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; -#define glShaderBinary glad_glShaderBinary -typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat -typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); -GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -#define glDepthRangef glad_glDepthRangef -typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); -GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -#define glClearDepthf glad_glClearDepthf -#endif -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 -GLAPI int GLAD_GL_ARB_indirect_parameters; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; -#define glMultiDrawArraysIndirectCountARB glad_glMultiDrawArraysIndirectCountARB -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; -#define glMultiDrawElementsIndirectCountARB glad_glMultiDrawElementsIndirectCountARB -#endif -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -GLAPI int GLAD_GL_NV_half_float; -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC)(GLhalfNV x, GLhalfNV y); -GLAPI PFNGLVERTEX2HNVPROC glad_glVertex2hNV; -#define glVertex2hNV glad_glVertex2hNV -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; -#define glVertex2hvNV glad_glVertex2hvNV -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI PFNGLVERTEX3HNVPROC glad_glVertex3hNV; -#define glVertex3hNV glad_glVertex3hNV -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; -#define glVertex3hvNV glad_glVertex3hvNV -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI PFNGLVERTEX4HNVPROC glad_glVertex4hNV; -#define glVertex4hNV glad_glVertex4hNV -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; -#define glVertex4hvNV glad_glVertex4hvNV -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC)(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -GLAPI PFNGLNORMAL3HNVPROC glad_glNormal3hNV; -#define glNormal3hNV glad_glNormal3hNV -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; -#define glNormal3hvNV glad_glNormal3hvNV -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI PFNGLCOLOR3HNVPROC glad_glColor3hNV; -#define glColor3hNV glad_glColor3hNV -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; -#define glColor3hvNV glad_glColor3hvNV -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -GLAPI PFNGLCOLOR4HNVPROC glad_glColor4hNV; -#define glColor4hNV glad_glColor4hNV -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; -#define glColor4hvNV glad_glColor4hvNV -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC)(GLhalfNV s); -GLAPI PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; -#define glTexCoord1hNV glad_glTexCoord1hNV -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; -#define glTexCoord1hvNV glad_glTexCoord1hvNV -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC)(GLhalfNV s, GLhalfNV t); -GLAPI PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; -#define glTexCoord2hNV glad_glTexCoord2hNV -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; -#define glTexCoord2hvNV glad_glTexCoord2hvNV -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; -#define glTexCoord3hNV glad_glTexCoord3hNV -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; -#define glTexCoord3hvNV glad_glTexCoord3hvNV -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC)(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; -#define glTexCoord4hNV glad_glTexCoord4hNV -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; -#define glTexCoord4hvNV glad_glTexCoord4hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC)(GLenum target, GLhalfNV s); -GLAPI PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; -#define glMultiTexCoord1hNV glad_glMultiTexCoord1hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; -#define glMultiTexCoord1hvNV glad_glMultiTexCoord1hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t); -GLAPI PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; -#define glMultiTexCoord2hNV glad_glMultiTexCoord2hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; -#define glMultiTexCoord2hvNV glad_glMultiTexCoord2hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -GLAPI PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; -#define glMultiTexCoord3hNV glad_glMultiTexCoord3hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; -#define glMultiTexCoord3hvNV glad_glMultiTexCoord3hvNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC)(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -GLAPI PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; -#define glMultiTexCoord4hNV glad_glMultiTexCoord4hNV -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC)(GLenum target, const GLhalfNV* v); -GLAPI PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; -#define glMultiTexCoord4hvNV glad_glMultiTexCoord4hvNV -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC)(GLhalfNV fog); -GLAPI PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; -#define glFogCoordhNV glad_glFogCoordhNV -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC)(const GLhalfNV* fog); -GLAPI PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; -#define glFogCoordhvNV glad_glFogCoordhvNV -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC)(GLhalfNV red, GLhalfNV green, GLhalfNV blue); -GLAPI PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; -#define glSecondaryColor3hNV glad_glSecondaryColor3hNV -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC)(const GLhalfNV* v); -GLAPI PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; -#define glSecondaryColor3hvNV glad_glSecondaryColor3hvNV -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC)(GLhalfNV weight); -GLAPI PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; -#define glVertexWeighthNV glad_glVertexWeighthNV -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC)(const GLhalfNV* weight); -GLAPI PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; -#define glVertexWeighthvNV glad_glVertexWeighthvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC)(GLuint index, GLhalfNV x); -GLAPI PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; -#define glVertexAttrib1hNV glad_glVertexAttrib1hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; -#define glVertexAttrib1hvNV glad_glVertexAttrib1hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y); -GLAPI PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; -#define glVertexAttrib2hNV glad_glVertexAttrib2hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; -#define glVertexAttrib2hvNV glad_glVertexAttrib2hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -GLAPI PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; -#define glVertexAttrib3hNV glad_glVertexAttrib3hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; -#define glVertexAttrib3hvNV glad_glVertexAttrib3hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -GLAPI PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; -#define glVertexAttrib4hNV glad_glVertexAttrib4hNV -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC)(GLuint index, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; -#define glVertexAttrib4hvNV glad_glVertexAttrib4hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; -#define glVertexAttribs1hvNV glad_glVertexAttribs1hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; -#define glVertexAttribs2hvNV glad_glVertexAttribs2hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; -#define glVertexAttribs3hvNV glad_glVertexAttribs3hvNV -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC)(GLuint index, GLsizei n, const GLhalfNV* v); -GLAPI PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; -#define glVertexAttribs4hvNV glad_glVertexAttribs4hvNV -#endif -#ifndef GL_ARB_ES3_2_compatibility -#define GL_ARB_ES3_2_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_2_compatibility; -typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC)(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -GLAPI PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; -#define glPrimitiveBoundingBoxARB glad_glPrimitiveBoundingBoxARB -#endif -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -GLAPI int GLAD_GL_ATI_texture_mirror_once; -#endif -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -GLAPI int GLAD_GL_IBM_rasterpos_clip; -#endif -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -GLAPI int GLAD_GL_SGIX_shadow; -#endif -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 -GLAPI int GLAD_GL_EXT_polygon_offset_clamp; -typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC)(GLfloat factor, GLfloat units, GLfloat clamp); -GLAPI PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; -#define glPolygonOffsetClampEXT glad_glPolygonOffsetClampEXT -#endif -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 -GLAPI int GLAD_GL_NV_deep_texture3D; -#endif -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 -GLAPI int GLAD_GL_ARB_shader_draw_parameters; -#endif -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -GLAPI int GLAD_GL_SGIX_calligraphic_fragment; -#endif -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 -GLAPI int GLAD_GL_ARB_shader_bit_encoding; -#endif -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -GLAPI int GLAD_GL_EXT_compiled_vertex_array; -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC)(GLint first, GLsizei count); -GLAPI PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; -#define glLockArraysEXT glad_glLockArraysEXT -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC)(); -GLAPI PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; -#define glUnlockArraysEXT glad_glUnlockArraysEXT -#endif -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 -GLAPI int GLAD_GL_NV_depth_buffer_float; -typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC)(GLdouble zNear, GLdouble zFar); -GLAPI PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; -#define glDepthRangedNV glad_glDepthRangedNV -typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC)(GLdouble depth); -GLAPI PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; -#define glClearDepthdNV glad_glClearDepthdNV -typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC)(GLdouble zmin, GLdouble zmax); -GLAPI PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; -#define glDepthBoundsdNV glad_glDepthBoundsdNV -#endif -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -GLAPI int GLAD_GL_NV_occlusion_query; -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; -#define glGenOcclusionQueriesNV glad_glGenOcclusionQueriesNV -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; -#define glDeleteOcclusionQueriesNV glad_glDeleteOcclusionQueriesNV -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC)(GLuint id); -GLAPI PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; -#define glIsOcclusionQueryNV glad_glIsOcclusionQueryNV -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC)(GLuint id); -GLAPI PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; -#define glBeginOcclusionQueryNV glad_glBeginOcclusionQueryNV -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC)(); -GLAPI PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; -#define glEndOcclusionQueryNV glad_glEndOcclusionQueryNV -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; -#define glGetOcclusionQueryivNV glad_glGetOcclusionQueryivNV -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; -#define glGetOcclusionQueryuivNV glad_glGetOcclusionQueryuivNV -#endif -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 -GLAPI int GLAD_GL_APPLE_flush_buffer_range; -typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC)(GLenum target, GLenum pname, GLint param); -GLAPI PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; -#define glBufferParameteriAPPLE glad_glBufferParameteriAPPLE -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)(GLenum target, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; -#define glFlushMappedBufferRangeAPPLE glad_glFlushMappedBufferRangeAPPLE -#endif -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -GLAPI int GLAD_GL_ARB_imaging; -typedef void (APIENTRYP PFNGLCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLEPROC glad_glColorTable; -#define glColorTable glad_glColorTable -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; -#define glColorTableParameterfv glad_glColorTableParameterfv -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; -#define glColorTableParameteriv glad_glColorTableParameteriv -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; -#define glCopyColorTable glad_glCopyColorTable -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC)(GLenum target, GLenum format, GLenum type, void* table); -GLAPI PFNGLGETCOLORTABLEPROC glad_glGetColorTable; -#define glGetColorTable glad_glGetColorTable -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; -#define glGetColorTableParameterfv glad_glGetColorTableParameterfv -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; -#define glGetColorTableParameteriv glad_glGetColorTableParameteriv -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; -#define glColorSubTable glad_glColorSubTable -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; -#define glCopyColorSubTable glad_glCopyColorSubTable -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; -#define glConvolutionFilter1D glad_glConvolutionFilter1D -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); -GLAPI PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; -#define glConvolutionFilter2D glad_glConvolutionFilter2D -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat params); -GLAPI PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; -#define glConvolutionParameterf glad_glConvolutionParameterf -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; -#define glConvolutionParameterfv glad_glConvolutionParameterfv -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC)(GLenum target, GLenum pname, GLint params); -GLAPI PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; -#define glConvolutionParameteri glad_glConvolutionParameteri -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; -#define glConvolutionParameteriv glad_glConvolutionParameteriv -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; -#define glCopyConvolutionFilter1D glad_glCopyConvolutionFilter1D -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; -#define glCopyConvolutionFilter2D glad_glCopyConvolutionFilter2D -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC)(GLenum target, GLenum format, GLenum type, void* image); -GLAPI PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; -#define glGetConvolutionFilter glad_glGetConvolutionFilter -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; -#define glGetConvolutionParameterfv glad_glGetConvolutionParameterfv -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; -#define glGetConvolutionParameteriv glad_glGetConvolutionParameteriv -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC)(GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); -GLAPI PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; -#define glGetSeparableFilter glad_glGetSeparableFilter -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); -GLAPI PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; -#define glSeparableFilter2D glad_glSeparableFilter2D -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETHISTOGRAMPROC glad_glGetHistogram; -#define glGetHistogram glad_glGetHistogram -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; -#define glGetHistogramParameterfv glad_glGetHistogramParameterfv -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; -#define glGetHistogramParameteriv glad_glGetHistogramParameteriv -typedef void (APIENTRYP PFNGLGETMINMAXPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); -GLAPI PFNGLGETMINMAXPROC glad_glGetMinmax; -#define glGetMinmax glad_glGetMinmax -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; -#define glGetMinmaxParameterfv glad_glGetMinmaxParameterfv -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; -#define glGetMinmaxParameteriv glad_glGetMinmaxParameteriv -typedef void (APIENTRYP PFNGLHISTOGRAMPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI PFNGLHISTOGRAMPROC glad_glHistogram; -#define glHistogram glad_glHistogram -typedef void (APIENTRYP PFNGLMINMAXPROC)(GLenum target, GLenum internalformat, GLboolean sink); -GLAPI PFNGLMINMAXPROC glad_glMinmax; -#define glMinmax glad_glMinmax -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC)(GLenum target); -GLAPI PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; -#define glResetHistogram glad_glResetHistogram -typedef void (APIENTRYP PFNGLRESETMINMAXPROC)(GLenum target); -GLAPI PFNGLRESETMINMAXPROC glad_glResetMinmax; -#define glResetMinmax glad_glResetMinmax -#endif -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 -GLAPI int GLAD_GL_ARB_draw_buffers_blend; -typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC)(GLuint buf, GLenum mode); -GLAPI PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -#define glBlendEquationiARB glad_glBlendEquationiARB -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GLAPI PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -#define glBlendEquationSeparateiARB glad_glBlendEquationSeparateiARB -typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC)(GLuint buf, GLenum src, GLenum dst); -GLAPI PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -#define glBlendFunciARB glad_glBlendFunciARB -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -#define glBlendFuncSeparateiARB glad_glBlendFuncSeparateiARB -#endif -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -GLAPI int GLAD_GL_AMD_gcn_shader; -#endif -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 -GLAPI int GLAD_GL_AMD_blend_minmax_factor; -#endif -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 -GLAPI int GLAD_GL_EXT_texture_sRGB_decode; -#endif -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 -GLAPI int GLAD_GL_ARB_shading_language_420pack; -#endif -#ifndef GL_ARB_shader_viewport_layer_array -#define GL_ARB_shader_viewport_layer_array 1 -GLAPI int GLAD_GL_ARB_shader_viewport_layer_array; -#endif -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 -GLAPI int GLAD_GL_ATI_meminfo; -#endif -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -GLAPI int GLAD_GL_EXT_abgr; -#endif -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 -GLAPI int GLAD_GL_AMD_pinned_memory; -#endif -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 -GLAPI int GLAD_GL_EXT_texture_snorm; -#endif -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -GLAPI int GLAD_GL_SGIX_texture_coordinate_clamp; -#endif -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 -GLAPI int GLAD_GL_ARB_clear_buffer_object; -typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC)(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; -#define glClearBufferData glad_glClearBufferData -typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC)(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; -#define glClearBufferSubData glad_glClearBufferSubData -#endif -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -GLAPI int GLAD_GL_ARB_multisample; -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -#define glSampleCoverageARB glad_glSampleCoverageARB -#endif -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -GLAPI int GLAD_GL_EXT_debug_label; -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC)(GLenum type, GLuint object, GLsizei length, const GLchar* label); -GLAPI PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; -#define glLabelObjectEXT glad_glLabelObjectEXT -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC)(GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar* label); -GLAPI PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; -#define glGetObjectLabelEXT glad_glGetObjectLabelEXT -#endif -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 -GLAPI int GLAD_GL_ARB_sample_shading; -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC)(GLfloat value); -GLAPI PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; -#define glMinSampleShadingARB glad_glMinSampleShadingARB -#endif -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 -GLAPI int GLAD_GL_NV_internalformat_sample_query; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)(GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; -#define glGetInternalformatSampleivNV glad_glGetInternalformatSampleivNV -#endif -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 -GLAPI int GLAD_GL_INTEL_map_texture; -typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC)(GLuint texture); -GLAPI PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; -#define glSyncTextureINTEL glad_glSyncTextureINTEL -typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level); -GLAPI PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; -#define glUnmapTexture2DINTEL glad_glUnmapTexture2DINTEL -typedef void* (APIENTRYP PFNGLMAPTEXTURE2DINTELPROC)(GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum* layout); -GLAPI PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; -#define glMapTexture2DINTEL glad_glMapTexture2DINTEL -#endif -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -GLAPI int GLAD_GL_ARB_texture_env_crossbar; -#endif -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -GLAPI int GLAD_GL_EXT_422_pixels; -#endif -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 -GLAPI int GLAD_GL_ARB_compute_shader; -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GLAPI PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; -#define glDispatchCompute glad_glDispatchCompute -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC)(GLintptr indirect); -GLAPI PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; -#define glDispatchComputeIndirect glad_glDispatchComputeIndirect -#endif -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -GLAPI int GLAD_GL_EXT_blend_logic_op; -#endif -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -GLAPI int GLAD_GL_IBM_cull_vertex; -#endif -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -GLAPI int GLAD_GL_IBM_vertex_array_lists; -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; -#define glColorPointerListIBM glad_glColorPointerListIBM -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; -#define glSecondaryColorPointerListIBM glad_glSecondaryColorPointerListIBM -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC)(GLint stride, const GLboolean** pointer, GLint ptrstride); -GLAPI PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; -#define glEdgeFlagPointerListIBM glad_glEdgeFlagPointerListIBM -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; -#define glFogCoordPointerListIBM glad_glFogCoordPointerListIBM -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; -#define glIndexPointerListIBM glad_glIndexPointerListIBM -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC)(GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; -#define glNormalPointerListIBM glad_glNormalPointerListIBM -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; -#define glTexCoordPointerListIBM glad_glTexCoordPointerListIBM -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC)(GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -GLAPI PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; -#define glVertexPointerListIBM glad_glVertexPointerListIBM -#endif -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -GLAPI int GLAD_GL_ARB_color_buffer_float; -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC)(GLenum target, GLenum clamp); -GLAPI PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; -#define glClampColorARB glad_glClampColorARB -#endif -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 -GLAPI int GLAD_GL_ARB_bindless_texture; -typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC)(GLuint texture); -GLAPI PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; -#define glGetTextureHandleARB glad_glGetTextureHandleARB -typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC)(GLuint texture, GLuint sampler); -GLAPI PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; -#define glGetTextureSamplerHandleARB glad_glGetTextureSamplerHandleARB -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; -#define glMakeTextureHandleResidentARB glad_glMakeTextureHandleResidentARB -typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; -#define glMakeTextureHandleNonResidentARB glad_glMakeTextureHandleNonResidentARB -typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC)(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -GLAPI PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; -#define glGetImageHandleARB glad_glGetImageHandleARB -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle, GLenum access); -GLAPI PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; -#define glMakeImageHandleResidentARB glad_glMakeImageHandleResidentARB -typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; -#define glMakeImageHandleNonResidentARB glad_glMakeImageHandleNonResidentARB -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC)(GLint location, GLuint64 value); -GLAPI PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; -#define glUniformHandleui64ARB glad_glUniformHandleui64ARB -typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; -#define glUniformHandleui64vARB glad_glUniformHandleui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)(GLuint program, GLint location, GLuint64 value); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; -#define glProgramUniformHandleui64ARB glad_glProgramUniformHandleui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* values); -GLAPI PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; -#define glProgramUniformHandleui64vARB glad_glProgramUniformHandleui64vARB -typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; -#define glIsTextureHandleResidentARB glad_glIsTextureHandleResidentARB -typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC)(GLuint64 handle); -GLAPI PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; -#define glIsImageHandleResidentARB glad_glIsImageHandleResidentARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC)(GLuint index, GLuint64EXT x); -GLAPI PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; -#define glVertexAttribL1ui64ARB glad_glVertexAttribL1ui64ARB -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC)(GLuint index, const GLuint64EXT* v); -GLAPI PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; -#define glVertexAttribL1ui64vARB glad_glVertexAttribL1ui64vARB -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC)(GLuint index, GLenum pname, GLuint64EXT* params); -GLAPI PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; -#define glGetVertexAttribLui64vARB glad_glGetVertexAttribLui64vARB -#endif -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -GLAPI int GLAD_GL_ARB_window_pos; -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC)(GLdouble x, GLdouble y); -GLAPI PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; -#define glWindowPos2dARB glad_glWindowPos2dARB -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; -#define glWindowPos2dvARB glad_glWindowPos2dvARB -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC)(GLfloat x, GLfloat y); -GLAPI PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; -#define glWindowPos2fARB glad_glWindowPos2fARB -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; -#define glWindowPos2fvARB glad_glWindowPos2fvARB -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC)(GLint x, GLint y); -GLAPI PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; -#define glWindowPos2iARB glad_glWindowPos2iARB -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; -#define glWindowPos2ivARB glad_glWindowPos2ivARB -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC)(GLshort x, GLshort y); -GLAPI PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; -#define glWindowPos2sARB glad_glWindowPos2sARB -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; -#define glWindowPos2svARB glad_glWindowPos2svARB -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC)(GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; -#define glWindowPos3dARB glad_glWindowPos3dARB -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; -#define glWindowPos3dvARB glad_glWindowPos3dvARB -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC)(GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; -#define glWindowPos3fARB glad_glWindowPos3fARB -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; -#define glWindowPos3fvARB glad_glWindowPos3fvARB -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC)(GLint x, GLint y, GLint z); -GLAPI PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; -#define glWindowPos3iARB glad_glWindowPos3iARB -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; -#define glWindowPos3ivARB glad_glWindowPos3ivARB -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC)(GLshort x, GLshort y, GLshort z); -GLAPI PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; -#define glWindowPos3sARB glad_glWindowPos3sARB -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; -#define glWindowPos3svARB glad_glWindowPos3svARB -#endif -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 -GLAPI int GLAD_GL_ARB_internalformat_query; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); -GLAPI PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; -#define glGetInternalformativ glad_glGetInternalformativ -#endif -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -GLAPI int GLAD_GL_ARB_shadow; -#endif -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -GLAPI int GLAD_GL_ARB_texture_mirrored_repeat; -#endif -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 -GLAPI int GLAD_GL_EXT_shader_image_load_store; -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC)(GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -GLAPI PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; -#define glBindImageTextureEXT glad_glBindImageTextureEXT -typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; -#define glMemoryBarrierEXT glad_glMemoryBarrierEXT -#endif -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -GLAPI int GLAD_GL_EXT_copy_texture; -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; -#define glCopyTexImage1DEXT glad_glCopyTexImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; -#define glCopyTexImage2DEXT glad_glCopyTexImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; -#define glCopyTexSubImage1DEXT glad_glCopyTexSubImage1DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; -#define glCopyTexSubImage2DEXT glad_glCopyTexSubImage2DEXT -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; -#define glCopyTexSubImage3DEXT glad_glCopyTexSubImage3DEXT -#endif -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -GLAPI int GLAD_GL_NV_register_combiners2; -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; -#define glCombinerStageParameterfvNV glad_glCombinerStageParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; -#define glGetCombinerStageParameterfvNV glad_glGetCombinerStageParameterfvNV -#endif -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -GLAPI int GLAD_GL_SGIX_ycrcb_subsample; -#endif -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -GLAPI int GLAD_GL_SGIX_ir_instrument1; -#endif -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 -GLAPI int GLAD_GL_NV_draw_texture; -typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC)(GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); -GLAPI PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; -#define glDrawTextureNV glad_glDrawTextureNV -#endif -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 -GLAPI int GLAD_GL_EXT_texture_shared_exponent; -#endif -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 -GLAPI int GLAD_GL_EXT_draw_instanced; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC)(GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; -#define glDrawArraysInstancedEXT glad_glDrawArraysInstancedEXT -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; -#define glDrawElementsInstancedEXT glad_glDrawElementsInstancedEXT -#endif -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -GLAPI int GLAD_GL_NV_copy_depth_to_color; -#endif -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 -GLAPI int GLAD_GL_ARB_viewport_array; -typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC)(GLuint first, GLsizei count, const GLfloat* v); -GLAPI PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; -#define glViewportArrayv glad_glViewportArrayv -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -GLAPI PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; -#define glViewportIndexedf glad_glViewportIndexedf -typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC)(GLuint index, const GLfloat* v); -GLAPI PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; -#define glViewportIndexedfv glad_glViewportIndexedfv -typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC)(GLuint first, GLsizei count, const GLint* v); -GLAPI PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; -#define glScissorArrayv glad_glScissorArrayv -typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC)(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -GLAPI PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; -#define glScissorIndexed glad_glScissorIndexed -typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC)(GLuint index, const GLint* v); -GLAPI PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; -#define glScissorIndexedv glad_glScissorIndexedv -typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC)(GLuint first, GLsizei count, const GLdouble* v); -GLAPI PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; -#define glDepthRangeArrayv glad_glDepthRangeArrayv -typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f); -GLAPI PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; -#define glDepthRangeIndexed glad_glDepthRangeIndexed -typedef void (APIENTRYP PFNGLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat* data); -GLAPI PFNGLGETFLOATI_VPROC glad_glGetFloati_v; -#define glGetFloati_v glad_glGetFloati_v -typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC)(GLenum target, GLuint index, GLdouble* data); -GLAPI PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; -#define glGetDoublei_v glad_glGetDoublei_v -#endif -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 -GLAPI int GLAD_GL_ARB_separate_shader_objects; -typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC)(GLuint pipeline, GLbitfield stages, GLuint program); -GLAPI PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; -#define glUseProgramStages glad_glUseProgramStages -typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC)(GLuint pipeline, GLuint program); -GLAPI PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; -#define glActiveShaderProgram glad_glActiveShaderProgram -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC)(GLenum type, GLsizei count, const GLchar** strings); -GLAPI PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; -#define glCreateShaderProgramv glad_glCreateShaderProgramv -typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; -#define glBindProgramPipeline glad_glBindProgramPipeline -typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC)(GLsizei n, const GLuint* pipelines); -GLAPI PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; -#define glDeleteProgramPipelines glad_glDeleteProgramPipelines -typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC)(GLsizei n, GLuint* pipelines); -GLAPI PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; -#define glGenProgramPipelines glad_glGenProgramPipelines -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; -#define glIsProgramPipeline glad_glIsProgramPipeline -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC)(GLuint pipeline, GLenum pname, GLint* params); -GLAPI PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; -#define glGetProgramPipelineiv glad_glGetProgramPipelineiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC)(GLuint program, GLint location, GLint v0); -GLAPI PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; -#define glProgramUniform1i glad_glProgramUniform1i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; -#define glProgramUniform1iv glad_glProgramUniform1iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC)(GLuint program, GLint location, GLfloat v0); -GLAPI PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; -#define glProgramUniform1f glad_glProgramUniform1f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; -#define glProgramUniform1fv glad_glProgramUniform1fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC)(GLuint program, GLint location, GLdouble v0); -GLAPI PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; -#define glProgramUniform1d glad_glProgramUniform1d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; -#define glProgramUniform1dv glad_glProgramUniform1dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC)(GLuint program, GLint location, GLuint v0); -GLAPI PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; -#define glProgramUniform1ui glad_glProgramUniform1ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; -#define glProgramUniform1uiv glad_glProgramUniform1uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC)(GLuint program, GLint location, GLint v0, GLint v1); -GLAPI PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; -#define glProgramUniform2i glad_glProgramUniform2i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; -#define glProgramUniform2iv glad_glProgramUniform2iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1); -GLAPI PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; -#define glProgramUniform2f glad_glProgramUniform2f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; -#define glProgramUniform2fv glad_glProgramUniform2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1); -GLAPI PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; -#define glProgramUniform2d glad_glProgramUniform2d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; -#define glProgramUniform2dv glad_glProgramUniform2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; -#define glProgramUniform2ui glad_glProgramUniform2ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; -#define glProgramUniform2uiv glad_glProgramUniform2uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GLAPI PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; -#define glProgramUniform3i glad_glProgramUniform3i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; -#define glProgramUniform3iv glad_glProgramUniform3iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GLAPI PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; -#define glProgramUniform3f glad_glProgramUniform3f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; -#define glProgramUniform3fv glad_glProgramUniform3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); -GLAPI PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; -#define glProgramUniform3d glad_glProgramUniform3d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; -#define glProgramUniform3dv glad_glProgramUniform3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; -#define glProgramUniform3ui glad_glProgramUniform3ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; -#define glProgramUniform3uiv glad_glProgramUniform3uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC)(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GLAPI PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; -#define glProgramUniform4i glad_glProgramUniform4i -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC)(GLuint program, GLint location, GLsizei count, const GLint* value); -GLAPI PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; -#define glProgramUniform4iv glad_glProgramUniform4iv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC)(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GLAPI PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; -#define glProgramUniform4f glad_glProgramUniform4f -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC)(GLuint program, GLint location, GLsizei count, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; -#define glProgramUniform4fv glad_glProgramUniform4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC)(GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); -GLAPI PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; -#define glProgramUniform4d glad_glProgramUniform4d -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC)(GLuint program, GLint location, GLsizei count, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; -#define glProgramUniform4dv glad_glProgramUniform4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC)(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; -#define glProgramUniform4ui glad_glProgramUniform4ui -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC)(GLuint program, GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; -#define glProgramUniform4uiv glad_glProgramUniform4uiv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; -#define glProgramUniformMatrix2fv glad_glProgramUniformMatrix2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; -#define glProgramUniformMatrix3fv glad_glProgramUniformMatrix3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; -#define glProgramUniformMatrix4fv glad_glProgramUniformMatrix4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; -#define glProgramUniformMatrix2dv glad_glProgramUniformMatrix2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; -#define glProgramUniformMatrix3dv glad_glProgramUniformMatrix3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; -#define glProgramUniformMatrix4dv glad_glProgramUniformMatrix4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; -#define glProgramUniformMatrix2x3fv glad_glProgramUniformMatrix2x3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; -#define glProgramUniformMatrix3x2fv glad_glProgramUniformMatrix3x2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; -#define glProgramUniformMatrix2x4fv glad_glProgramUniformMatrix2x4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; -#define glProgramUniformMatrix4x2fv glad_glProgramUniformMatrix4x2fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; -#define glProgramUniformMatrix3x4fv glad_glProgramUniformMatrix3x4fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; -#define glProgramUniformMatrix4x3fv glad_glProgramUniformMatrix4x3fv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; -#define glProgramUniformMatrix2x3dv glad_glProgramUniformMatrix2x3dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; -#define glProgramUniformMatrix3x2dv glad_glProgramUniformMatrix3x2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; -#define glProgramUniformMatrix2x4dv glad_glProgramUniformMatrix2x4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; -#define glProgramUniformMatrix4x2dv glad_glProgramUniformMatrix4x2dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; -#define glProgramUniformMatrix3x4dv glad_glProgramUniformMatrix3x4dv -typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -GLAPI PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; -#define glProgramUniformMatrix4x3dv glad_glProgramUniformMatrix4x3dv -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC)(GLuint pipeline); -GLAPI PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; -#define glValidateProgramPipeline glad_glValidateProgramPipeline -typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC)(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -GLAPI PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; -#define glGetProgramPipelineInfoLog glad_glGetProgramPipelineInfoLog -#endif -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -GLAPI int GLAD_GL_EXT_depth_bounds_test; -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); -GLAPI PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; -#define glDepthBoundsEXT glad_glDepthBoundsEXT -#endif -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -GLAPI int GLAD_GL_EXT_shared_texture_palette; -#endif -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -GLAPI int GLAD_GL_ARB_texture_env_add; -#endif -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 -GLAPI int GLAD_GL_NV_video_capture; -typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC)(GLuint video_capture_slot); -GLAPI PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; -#define glBeginVideoCaptureNV glad_glBeginVideoCaptureNV -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -GLAPI PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; -#define glBindVideoCaptureStreamBufferNV glad_glBindVideoCaptureStreamBufferNV -typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)(GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -GLAPI PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; -#define glBindVideoCaptureStreamTextureNV glad_glBindVideoCaptureStreamTextureNV -typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC)(GLuint video_capture_slot); -GLAPI PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; -#define glEndVideoCaptureNV glad_glEndVideoCaptureNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC)(GLuint video_capture_slot, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; -#define glGetVideoCaptureivNV glad_glGetVideoCaptureivNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; -#define glGetVideoCaptureStreamivNV glad_glGetVideoCaptureStreamivNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; -#define glGetVideoCaptureStreamfvNV glad_glGetVideoCaptureStreamfvNV -typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; -#define glGetVideoCaptureStreamdvNV glad_glGetVideoCaptureStreamdvNV -typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC)(GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT* capture_time); -GLAPI PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; -#define glVideoCaptureNV glad_glVideoCaptureNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; -#define glVideoCaptureStreamParameterivNV glad_glVideoCaptureStreamParameterivNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; -#define glVideoCaptureStreamParameterfvNV glad_glVideoCaptureStreamParameterfvNV -typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); -GLAPI PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; -#define glVideoCaptureStreamParameterdvNV glad_glVideoCaptureStreamParameterdvNV -#endif -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 -GLAPI int GLAD_GL_ARB_sampler_objects; -#endif -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -GLAPI int GLAD_GL_ARB_matrix_palette; -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC)(GLint index); -GLAPI PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; -#define glCurrentPaletteMatrixARB glad_glCurrentPaletteMatrixARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC)(GLint size, const GLubyte* indices); -GLAPI PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; -#define glMatrixIndexubvARB glad_glMatrixIndexubvARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC)(GLint size, const GLushort* indices); -GLAPI PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; -#define glMatrixIndexusvARB glad_glMatrixIndexusvARB -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC)(GLint size, const GLuint* indices); -GLAPI PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; -#define glMatrixIndexuivARB glad_glMatrixIndexuivARB -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; -#define glMatrixIndexPointerARB glad_glMatrixIndexPointerARB -#endif -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -GLAPI int GLAD_GL_SGIS_texture_color_mask; -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; -#define glTextureColorMaskSGIS glad_glTextureColorMaskSGIS -#endif -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -GLAPI int GLAD_GL_EXT_packed_pixels; -#endif -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -GLAPI int GLAD_GL_EXT_coordinate_frame; -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC)(GLbyte tx, GLbyte ty, GLbyte tz); -GLAPI PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; -#define glTangent3bEXT glad_glTangent3bEXT -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; -#define glTangent3bvEXT glad_glTangent3bvEXT -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC)(GLdouble tx, GLdouble ty, GLdouble tz); -GLAPI PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; -#define glTangent3dEXT glad_glTangent3dEXT -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; -#define glTangent3dvEXT glad_glTangent3dvEXT -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC)(GLfloat tx, GLfloat ty, GLfloat tz); -GLAPI PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; -#define glTangent3fEXT glad_glTangent3fEXT -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; -#define glTangent3fvEXT glad_glTangent3fvEXT -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC)(GLint tx, GLint ty, GLint tz); -GLAPI PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; -#define glTangent3iEXT glad_glTangent3iEXT -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC)(const GLint* v); -GLAPI PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; -#define glTangent3ivEXT glad_glTangent3ivEXT -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC)(GLshort tx, GLshort ty, GLshort tz); -GLAPI PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; -#define glTangent3sEXT glad_glTangent3sEXT -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; -#define glTangent3svEXT glad_glTangent3svEXT -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC)(GLbyte bx, GLbyte by, GLbyte bz); -GLAPI PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; -#define glBinormal3bEXT glad_glBinormal3bEXT -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; -#define glBinormal3bvEXT glad_glBinormal3bvEXT -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC)(GLdouble bx, GLdouble by, GLdouble bz); -GLAPI PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; -#define glBinormal3dEXT glad_glBinormal3dEXT -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; -#define glBinormal3dvEXT glad_glBinormal3dvEXT -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC)(GLfloat bx, GLfloat by, GLfloat bz); -GLAPI PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; -#define glBinormal3fEXT glad_glBinormal3fEXT -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; -#define glBinormal3fvEXT glad_glBinormal3fvEXT -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC)(GLint bx, GLint by, GLint bz); -GLAPI PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; -#define glBinormal3iEXT glad_glBinormal3iEXT -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC)(const GLint* v); -GLAPI PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; -#define glBinormal3ivEXT glad_glBinormal3ivEXT -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC)(GLshort bx, GLshort by, GLshort bz); -GLAPI PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; -#define glBinormal3sEXT glad_glBinormal3sEXT -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; -#define glBinormal3svEXT glad_glBinormal3svEXT -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; -#define glTangentPointerEXT glad_glTangentPointerEXT -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; -#define glBinormalPointerEXT glad_glBinormalPointerEXT -#endif -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -GLAPI int GLAD_GL_ARB_texture_compression; -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -#define glCompressedTexImage3DARB glad_glCompressedTexImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -#define glCompressedTexImage2DARB glad_glCompressedTexImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -#define glCompressedTexImage1DARB glad_glCompressedTexImage1DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -#define glCompressedTexSubImage3DARB glad_glCompressedTexSubImage3DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -#define glCompressedTexSubImage2DARB glad_glCompressedTexSubImage2DARB -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -#define glCompressedTexSubImage1DARB glad_glCompressedTexSubImage1DARB -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -#define glGetCompressedTexImageARB glad_glGetCompressedTexImageARB -#endif -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 -GLAPI int GLAD_GL_APPLE_aux_depth_stencil; -#endif -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 -GLAPI int GLAD_GL_ARB_shader_subroutine; -typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)(GLuint program, GLenum shadertype, const GLchar* name); -GLAPI PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; -#define glGetSubroutineUniformLocation glad_glGetSubroutineUniformLocation -typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC)(GLuint program, GLenum shadertype, const GLchar* name); -GLAPI PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; -#define glGetSubroutineIndex glad_glGetSubroutineIndex -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); -GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; -#define glGetActiveSubroutineUniformiv glad_glGetActiveSubroutineUniformiv -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; -#define glGetActiveSubroutineUniformName glad_glGetActiveSubroutineUniformName -typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC)(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar* name); -GLAPI PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; -#define glGetActiveSubroutineName glad_glGetActiveSubroutineName -typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC)(GLenum shadertype, GLsizei count, const GLuint* indices); -GLAPI PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; -#define glUniformSubroutinesuiv glad_glUniformSubroutinesuiv -typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC)(GLenum shadertype, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; -#define glGetUniformSubroutineuiv glad_glGetUniformSubroutineuiv -typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC)(GLuint program, GLenum shadertype, GLenum pname, GLint* values); -GLAPI PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; -#define glGetProgramStageiv glad_glGetProgramStageiv -#endif -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 -GLAPI int GLAD_GL_EXT_framebuffer_sRGB; -#endif -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 -GLAPI int GLAD_GL_ARB_texture_storage_multisample; -typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; -#define glTexStorage2DMultisample glad_glTexStorage2DMultisample -typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; -#define glTexStorage3DMultisample glad_glTexStorage3DMultisample -#endif -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -GLAPI int GLAD_GL_KHR_blend_equation_advanced_coherent; -#endif -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 -GLAPI int GLAD_GL_EXT_vertex_attrib_64bit; -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC)(GLuint index, GLdouble x); -GLAPI PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; -#define glVertexAttribL1dEXT glad_glVertexAttribL1dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC)(GLuint index, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; -#define glVertexAttribL2dEXT glad_glVertexAttribL2dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; -#define glVertexAttribL3dEXT glad_glVertexAttribL3dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; -#define glVertexAttribL4dEXT glad_glVertexAttribL4dEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; -#define glVertexAttribL1dvEXT glad_glVertexAttribL1dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; -#define glVertexAttribL2dvEXT glad_glVertexAttribL2dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; -#define glVertexAttribL3dvEXT glad_glVertexAttribL3dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC)(GLuint index, const GLdouble* v); -GLAPI PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; -#define glVertexAttribL4dvEXT glad_glVertexAttribL4dvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; -#define glVertexAttribLPointerEXT glad_glVertexAttribLPointerEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC)(GLuint index, GLenum pname, GLdouble* params); -GLAPI PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; -#define glGetVertexAttribLdvEXT glad_glGetVertexAttribLdvEXT -#endif -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -GLAPI int GLAD_GL_ARB_depth_texture; -#endif -#ifndef GL_NV_shader_buffer_store -#define GL_NV_shader_buffer_store 1 -GLAPI int GLAD_GL_NV_shader_buffer_store; -#endif -#ifndef GL_OES_query_matrix -#define GL_OES_query_matrix 1 -GLAPI int GLAD_GL_OES_query_matrix; -typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC)(GLfixed* mantissa, GLint* exponent); -GLAPI PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; -#define glQueryMatrixxOES glad_glQueryMatrixxOES -#endif -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -GLAPI int GLAD_GL_MESA_window_pos; -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC)(GLdouble x, GLdouble y); -GLAPI PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; -#define glWindowPos2dMESA glad_glWindowPos2dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; -#define glWindowPos2dvMESA glad_glWindowPos2dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC)(GLfloat x, GLfloat y); -GLAPI PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; -#define glWindowPos2fMESA glad_glWindowPos2fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; -#define glWindowPos2fvMESA glad_glWindowPos2fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC)(GLint x, GLint y); -GLAPI PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; -#define glWindowPos2iMESA glad_glWindowPos2iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; -#define glWindowPos2ivMESA glad_glWindowPos2ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC)(GLshort x, GLshort y); -GLAPI PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; -#define glWindowPos2sMESA glad_glWindowPos2sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; -#define glWindowPos2svMESA glad_glWindowPos2svMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC)(GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; -#define glWindowPos3dMESA glad_glWindowPos3dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; -#define glWindowPos3dvMESA glad_glWindowPos3dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC)(GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; -#define glWindowPos3fMESA glad_glWindowPos3fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; -#define glWindowPos3fvMESA glad_glWindowPos3fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC)(GLint x, GLint y, GLint z); -GLAPI PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; -#define glWindowPos3iMESA glad_glWindowPos3iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; -#define glWindowPos3ivMESA glad_glWindowPos3ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC)(GLshort x, GLshort y, GLshort z); -GLAPI PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; -#define glWindowPos3sMESA glad_glWindowPos3sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; -#define glWindowPos3svMESA glad_glWindowPos3svMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; -#define glWindowPos4dMESA glad_glWindowPos4dMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC)(const GLdouble* v); -GLAPI PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; -#define glWindowPos4dvMESA glad_glWindowPos4dvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; -#define glWindowPos4fMESA glad_glWindowPos4fMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC)(const GLfloat* v); -GLAPI PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; -#define glWindowPos4fvMESA glad_glWindowPos4fvMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC)(GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; -#define glWindowPos4iMESA glad_glWindowPos4iMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC)(const GLint* v); -GLAPI PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; -#define glWindowPos4ivMESA glad_glWindowPos4ivMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC)(GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; -#define glWindowPos4sMESA glad_glWindowPos4sMESA -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC)(const GLshort* v); -GLAPI PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; -#define glWindowPos4svMESA glad_glWindowPos4svMESA -#endif -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 -GLAPI int GLAD_GL_NV_fill_rectangle; -#endif -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 -GLAPI int GLAD_GL_NV_shader_storage_buffer_object; -#endif -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 -GLAPI int GLAD_GL_ARB_texture_query_lod; -#endif -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 -GLAPI int GLAD_GL_ARB_copy_buffer; -#endif -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 -GLAPI int GLAD_GL_ARB_shader_image_size; -#endif -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 -GLAPI int GLAD_GL_NV_shader_atomic_counters; -#endif -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 -GLAPI int GLAD_GL_APPLE_object_purgeable; -typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); -GLAPI PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; -#define glObjectPurgeableAPPLE glad_glObjectPurgeableAPPLE -typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC)(GLenum objectType, GLuint name, GLenum option); -GLAPI PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; -#define glObjectUnpurgeableAPPLE glad_glObjectUnpurgeableAPPLE -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC)(GLenum objectType, GLuint name, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; -#define glGetObjectParameterivAPPLE glad_glGetObjectParameterivAPPLE -#endif -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -GLAPI int GLAD_GL_ARB_occlusion_query; -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint* ids); -GLAPI PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; -#define glGenQueriesARB glad_glGenQueriesARB -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint* ids); -GLAPI PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; -#define glDeleteQueriesARB glad_glDeleteQueriesARB -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC)(GLuint id); -GLAPI PFNGLISQUERYARBPROC glad_glIsQueryARB; -#define glIsQueryARB glad_glIsQueryARB -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); -GLAPI PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; -#define glBeginQueryARB glad_glBeginQueryARB -typedef void (APIENTRYP PFNGLENDQUERYARBPROC)(GLenum target); -GLAPI PFNGLENDQUERYARBPROC glad_glEndQueryARB; -#define glEndQueryARB glad_glEndQueryARB -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; -#define glGetQueryivARB glad_glGetQueryivARB -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; -#define glGetQueryObjectivARB glad_glGetQueryObjectivARB -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint* params); -GLAPI PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; -#define glGetQueryObjectuivARB glad_glGetQueryObjectuivARB -#endif -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -GLAPI int GLAD_GL_INGR_color_clamp; -#endif -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -GLAPI int GLAD_GL_SGI_color_table; -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); -GLAPI PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; -#define glColorTableSGI glad_glColorTableSGI -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, const GLfloat* params); -GLAPI PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; -#define glColorTableParameterfvSGI glad_glColorTableParameterfvSGI -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, const GLint* params); -GLAPI PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; -#define glColorTableParameterivSGI glad_glColorTableParameterivSGI -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; -#define glCopyColorTableSGI glad_glCopyColorTableSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC)(GLenum target, GLenum format, GLenum type, void* table); -GLAPI PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; -#define glGetColorTableSGI glad_glGetColorTableSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)(GLenum target, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; -#define glGetColorTableParameterfvSGI glad_glGetColorTableParameterfvSGI -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; -#define glGetColorTableParameterivSGI glad_glGetColorTableParameterivSGI -#endif -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 -GLAPI int GLAD_GL_NV_gpu_program5_mem_extended; -#endif -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 -GLAPI int GLAD_GL_ARB_texture_cube_map_array; -#endif -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -GLAPI int GLAD_GL_SGIX_scalebias_hint; -#endif -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 -GLAPI int GLAD_GL_EXT_gpu_shader4; -typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC)(GLuint program, GLint location, GLuint* params); -GLAPI PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; -#define glGetUniformuivEXT glad_glGetUniformuivEXT -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC)(GLuint program, GLuint color, const GLchar* name); -GLAPI PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; -#define glBindFragDataLocationEXT glad_glBindFragDataLocationEXT -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC)(GLuint program, const GLchar* name); -GLAPI PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; -#define glGetFragDataLocationEXT glad_glGetFragDataLocationEXT -typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC)(GLint location, GLuint v0); -GLAPI PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; -#define glUniform1uiEXT glad_glUniform1uiEXT -typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC)(GLint location, GLuint v0, GLuint v1); -GLAPI PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; -#define glUniform2uiEXT glad_glUniform2uiEXT -typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); -GLAPI PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; -#define glUniform3uiEXT glad_glUniform3uiEXT -typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GLAPI PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; -#define glUniform4uiEXT glad_glUniform4uiEXT -typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; -#define glUniform1uivEXT glad_glUniform1uivEXT -typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; -#define glUniform2uivEXT glad_glUniform2uivEXT -typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; -#define glUniform3uivEXT glad_glUniform3uivEXT -typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC)(GLint location, GLsizei count, const GLuint* value); -GLAPI PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; -#define glUniform4uivEXT glad_glUniform4uivEXT -#endif -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 -GLAPI int GLAD_GL_NV_geometry_program4; -typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC)(GLenum target, GLint limit); -GLAPI PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; -#define glProgramVertexLimitNV glad_glProgramVertexLimitNV -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; -#define glFramebufferTextureEXT glad_glFramebufferTextureEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; -#define glFramebufferTextureFaceEXT glad_glFramebufferTextureFaceEXT -#endif -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -#endif -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 -GLAPI int GLAD_GL_AMD_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC)(GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -#define glDebugMessageEnableAMD glad_glDebugMessageEnableAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC)(GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -#define glDebugMessageInsertAMD glad_glDebugMessageInsertAMD -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC)(GLDEBUGPROCAMD callback, void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -#define glDebugMessageCallbackAMD glad_glDebugMessageCallbackAMD -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC)(GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); -GLAPI PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -#define glGetDebugMessageLogAMD glad_glGetDebugMessageLogAMD -#endif -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -GLAPI int GLAD_GL_ARB_texture_border_clamp; -#endif -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 -GLAPI int GLAD_GL_ARB_fragment_coord_conventions; -#endif -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -GLAPI int GLAD_GL_ARB_multitexture; -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC)(GLenum texture); -GLAPI PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; -#define glActiveTextureARB glad_glActiveTextureARB -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC)(GLenum texture); -GLAPI PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; -#define glClientActiveTextureARB glad_glClientActiveTextureARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC)(GLenum target, GLdouble s); -GLAPI PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; -#define glMultiTexCoord1dARB glad_glMultiTexCoord1dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; -#define glMultiTexCoord1dvARB glad_glMultiTexCoord1dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC)(GLenum target, GLfloat s); -GLAPI PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; -#define glMultiTexCoord1fARB glad_glMultiTexCoord1fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; -#define glMultiTexCoord1fvARB glad_glMultiTexCoord1fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC)(GLenum target, GLint s); -GLAPI PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; -#define glMultiTexCoord1iARB glad_glMultiTexCoord1iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; -#define glMultiTexCoord1ivARB glad_glMultiTexCoord1ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC)(GLenum target, GLshort s); -GLAPI PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; -#define glMultiTexCoord1sARB glad_glMultiTexCoord1sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; -#define glMultiTexCoord1svARB glad_glMultiTexCoord1svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC)(GLenum target, GLdouble s, GLdouble t); -GLAPI PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; -#define glMultiTexCoord2dARB glad_glMultiTexCoord2dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; -#define glMultiTexCoord2dvARB glad_glMultiTexCoord2dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC)(GLenum target, GLfloat s, GLfloat t); -GLAPI PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; -#define glMultiTexCoord2fARB glad_glMultiTexCoord2fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; -#define glMultiTexCoord2fvARB glad_glMultiTexCoord2fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC)(GLenum target, GLint s, GLint t); -GLAPI PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; -#define glMultiTexCoord2iARB glad_glMultiTexCoord2iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; -#define glMultiTexCoord2ivARB glad_glMultiTexCoord2ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC)(GLenum target, GLshort s, GLshort t); -GLAPI PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; -#define glMultiTexCoord2sARB glad_glMultiTexCoord2sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; -#define glMultiTexCoord2svARB glad_glMultiTexCoord2svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; -#define glMultiTexCoord3dARB glad_glMultiTexCoord3dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; -#define glMultiTexCoord3dvARB glad_glMultiTexCoord3dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; -#define glMultiTexCoord3fARB glad_glMultiTexCoord3fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; -#define glMultiTexCoord3fvARB glad_glMultiTexCoord3fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC)(GLenum target, GLint s, GLint t, GLint r); -GLAPI PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; -#define glMultiTexCoord3iARB glad_glMultiTexCoord3iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; -#define glMultiTexCoord3ivARB glad_glMultiTexCoord3ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; -#define glMultiTexCoord3sARB glad_glMultiTexCoord3sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; -#define glMultiTexCoord3svARB glad_glMultiTexCoord3svARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; -#define glMultiTexCoord4dARB glad_glMultiTexCoord4dARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC)(GLenum target, const GLdouble* v); -GLAPI PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; -#define glMultiTexCoord4dvARB glad_glMultiTexCoord4dvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; -#define glMultiTexCoord4fARB glad_glMultiTexCoord4fARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC)(GLenum target, const GLfloat* v); -GLAPI PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; -#define glMultiTexCoord4fvARB glad_glMultiTexCoord4fvARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; -#define glMultiTexCoord4iARB glad_glMultiTexCoord4iARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC)(GLenum target, const GLint* v); -GLAPI PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; -#define glMultiTexCoord4ivARB glad_glMultiTexCoord4ivARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; -#define glMultiTexCoord4sARB glad_glMultiTexCoord4sARB -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC)(GLenum target, const GLshort* v); -GLAPI PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; -#define glMultiTexCoord4svARB glad_glMultiTexCoord4svARB -#endif -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -GLAPI int GLAD_GL_SGIX_polynomial_ffd; -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble* points); -GLAPI PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; -#define glDeformationMap3dSGIX glad_glDeformationMap3dSGIX -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat* points); -GLAPI PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; -#define glDeformationMap3fSGIX glad_glDeformationMap3fSGIX -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC)(GLbitfield mask); -GLAPI PFNGLDEFORMSGIXPROC glad_glDeformSGIX; -#define glDeformSGIX glad_glDeformSGIX -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)(GLbitfield mask); -GLAPI PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; -#define glLoadIdentityDeformationMapSGIX glad_glLoadIdentityDeformationMapSGIX -#endif -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 -GLAPI int GLAD_GL_EXT_provoking_vertex; -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC)(GLenum mode); -GLAPI PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; -#define glProvokingVertexEXT glad_glProvokingVertexEXT -#endif -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -GLAPI int GLAD_GL_ARB_point_parameters; -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; -#define glPointParameterfARB glad_glPointParameterfARB -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; -#define glPointParameterfvARB glad_glPointParameterfvARB -#endif -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 -GLAPI int GLAD_GL_ARB_shader_image_load_store; -typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC)(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GLAPI PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; -#define glBindImageTexture glad_glBindImageTexture -typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC)(GLbitfield barriers); -GLAPI PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; -#define glMemoryBarrier glad_glMemoryBarrier -#endif -#ifndef GL_ARB_conditional_render_inverted -#define GL_ARB_conditional_render_inverted 1 -GLAPI int GLAD_GL_ARB_conditional_render_inverted; -#endif -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -GLAPI int GLAD_GL_HP_occlusion_test; -#endif -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 -GLAPI int GLAD_GL_ARB_ES3_compatibility; -#endif -#ifndef GL_ARB_texture_barrier -#define GL_ARB_texture_barrier 1 -GLAPI int GLAD_GL_ARB_texture_barrier; -typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC)(); -GLAPI PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; -#define glTextureBarrier glad_glTextureBarrier -#endif -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 -GLAPI int GLAD_GL_ARB_texture_buffer_object_rgb32; -#endif -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 -GLAPI int GLAD_GL_NV_bindless_multi_draw_indirect; -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)(GLenum mode, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; -#define glMultiDrawArraysIndirectBindlessNV glad_glMultiDrawArraysIndirectBindlessNV -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)(GLenum mode, GLenum type, const void* indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; -#define glMultiDrawElementsIndirectBindlessNV glad_glMultiDrawElementsIndirectBindlessNV -#endif -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -GLAPI int GLAD_GL_SGIX_texture_multi_buffer; -#endif -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 -GLAPI int GLAD_GL_EXT_transform_feedback; -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)(GLenum primitiveMode); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; -#define glBeginTransformFeedbackEXT glad_glBeginTransformFeedbackEXT -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; -#define glEndTransformFeedbackEXT glad_glEndTransformFeedbackEXT -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GLAPI PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; -#define glBindBufferRangeEXT glad_glBindBufferRangeEXT -typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset); -GLAPI PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; -#define glBindBufferOffsetEXT glad_glBindBufferOffsetEXT -typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC)(GLenum target, GLuint index, GLuint buffer); -GLAPI PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; -#define glBindBufferBaseEXT glad_glBindBufferBaseEXT -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)(GLuint program, GLsizei count, const GLchar** varyings, GLenum bufferMode); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; -#define glTransformFeedbackVaryingsEXT glad_glTransformFeedbackVaryingsEXT -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; -#define glGetTransformFeedbackVaryingEXT glad_glGetTransformFeedbackVaryingEXT -#endif -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 -GLAPI int GLAD_GL_KHR_texture_compression_astc_ldr; -#endif -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -GLAPI int GLAD_GL_3DFX_multisample; -#endif -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -GLAPI int GLAD_GL_INTEL_fragment_shader_ordering; -#endif -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -GLAPI int GLAD_GL_ARB_texture_env_dot3; -#endif -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 -GLAPI int GLAD_GL_NV_gpu_program4; -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; -#define glProgramLocalParameterI4iNV glad_glProgramLocalParameterI4iNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; -#define glProgramLocalParameterI4ivNV glad_glProgramLocalParameterI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; -#define glProgramLocalParametersI4ivNV glad_glProgramLocalParametersI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; -#define glProgramLocalParameterI4uiNV glad_glProgramLocalParameterI4uiNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; -#define glProgramLocalParameterI4uivNV glad_glProgramLocalParameterI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; -#define glProgramLocalParametersI4uivNV glad_glProgramLocalParametersI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC)(GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; -#define glProgramEnvParameterI4iNV glad_glProgramEnvParameterI4iNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC)(GLenum target, GLuint index, const GLint* params); -GLAPI PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; -#define glProgramEnvParameterI4ivNV glad_glProgramEnvParameterI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLint* params); -GLAPI PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; -#define glProgramEnvParametersI4ivNV glad_glProgramEnvParametersI4ivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC)(GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; -#define glProgramEnvParameterI4uiNV glad_glProgramEnvParameterI4uiNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)(GLenum target, GLuint index, const GLuint* params); -GLAPI PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; -#define glProgramEnvParameterI4uivNV glad_glProgramEnvParameterI4uivNV -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; -#define glProgramEnvParametersI4uivNV glad_glProgramEnvParametersI4uivNV -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; -#define glGetProgramLocalParameterIivNV glad_glGetProgramLocalParameterIivNV -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; -#define glGetProgramLocalParameterIuivNV glad_glGetProgramLocalParameterIuivNV -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)(GLenum target, GLuint index, GLint* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; -#define glGetProgramEnvParameterIivNV glad_glGetProgramEnvParameterIivNV -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)(GLenum target, GLuint index, GLuint* params); -GLAPI PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; -#define glGetProgramEnvParameterIuivNV glad_glGetProgramEnvParameterIuivNV -#endif -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 -GLAPI int GLAD_GL_NV_gpu_program5; -typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)(GLenum target, GLsizei count, const GLuint* params); -GLAPI PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; -#define glProgramSubroutineParametersuivNV glad_glProgramSubroutineParametersuivNV -typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)(GLenum target, GLuint index, GLuint* param); -GLAPI PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; -#define glGetProgramSubroutineParameteruivNV glad_glGetProgramSubroutineParameteruivNV -#endif -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -GLAPI int GLAD_GL_NV_float_buffer; -#endif -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -GLAPI int GLAD_GL_SGIS_texture_edge_clamp; -#endif -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 -GLAPI int GLAD_GL_ARB_framebuffer_sRGB; -#endif -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -GLAPI int GLAD_GL_SUN_slice_accum; -#endif -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -GLAPI int GLAD_GL_EXT_index_texture; -#endif -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -GLAPI int GLAD_GL_EXT_shader_image_load_formatted; -#endif -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 -GLAPI int GLAD_GL_ARB_geometry_shader4; -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; -#define glProgramParameteriARB glad_glProgramParameteriARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; -#define glFramebufferTextureARB glad_glFramebufferTextureARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; -#define glFramebufferTextureLayerARB glad_glFramebufferTextureLayerARB -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -GLAPI PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; -#define glFramebufferTextureFaceARB glad_glFramebufferTextureFaceARB -#endif -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -GLAPI int GLAD_GL_EXT_separate_specular_color; -#endif -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 -GLAPI int GLAD_GL_AMD_depth_clamp_separate; -#endif -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 -GLAPI int GLAD_GL_NV_conservative_raster; -typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC)(GLuint xbits, GLuint ybits); -GLAPI PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; -#define glSubpixelPrecisionBiasNV glad_glSubpixelPrecisionBiasNV -#endif -#ifndef GL_ARB_sparse_texture2 -#define GL_ARB_sparse_texture2 1 -GLAPI int GLAD_GL_ARB_sparse_texture2; -#endif -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -GLAPI int GLAD_GL_SGIX_sprite; -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; -#define glSpriteParameterfSGIX glad_glSpriteParameterfSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; -#define glSpriteParameterfvSGIX glad_glSpriteParameterfvSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC)(GLenum pname, GLint param); -GLAPI PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; -#define glSpriteParameteriSGIX glad_glSpriteParameteriSGIX -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; -#define glSpriteParameterivSGIX glad_glSpriteParameterivSGIX -#endif -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 -GLAPI int GLAD_GL_ARB_get_program_binary; -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary); -GLAPI PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; -#define glGetProgramBinary glad_glGetProgramBinary -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); -GLAPI PFNGLPROGRAMBINARYPROC glad_glProgramBinary; -#define glProgramBinary glad_glProgramBinary -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value); -GLAPI PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; -#define glProgramParameteri glad_glProgramParameteri -#endif -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -GLAPI int GLAD_GL_AMD_occlusion_query_event; -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC)(GLenum target, GLuint id, GLenum pname, GLuint param); -GLAPI PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; -#define glQueryObjectParameteruiAMD glad_glQueryObjectParameteruiAMD -#endif -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -GLAPI int GLAD_GL_SGIS_multisample; -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC)(GLclampf value, GLboolean invert); -GLAPI PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; -#define glSampleMaskSGIS glad_glSampleMaskSGIS -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC)(GLenum pattern); -GLAPI PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; -#define glSamplePatternSGIS glad_glSamplePatternSGIS -#endif -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -GLAPI int GLAD_GL_EXT_framebuffer_object; -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); -GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -#define glIsRenderbufferEXT glad_glIsRenderbufferEXT -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); -GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -#define glBindRenderbufferEXT glad_glBindRenderbufferEXT -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint* renderbuffers); -GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint* renderbuffers); -GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); -GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -#define glIsFramebufferEXT glad_glIsFramebufferEXT -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); -GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -#define glBindFramebufferEXT glad_glBindFramebufferEXT -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint* framebuffers); -GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint* framebuffers); -GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -#define glGenFramebuffersEXT glad_glGenFramebuffersEXT -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); -GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -#define glGenerateMipmapEXT glad_glGenerateMipmapEXT -#endif -#ifndef GL_ARB_robustness_isolation -#define GL_ARB_robustness_isolation 1 -GLAPI int GLAD_GL_ARB_robustness_isolation; -#endif -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 -GLAPI int GLAD_GL_ARB_vertex_array_bgra; -#endif -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -GLAPI int GLAD_GL_APPLE_vertex_array_range; -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); -GLAPI PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; -#define glVertexArrayRangeAPPLE glad_glVertexArrayRangeAPPLE -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)(GLsizei length, void* pointer); -GLAPI PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; -#define glFlushVertexArrayRangeAPPLE glad_glFlushVertexArrayRangeAPPLE -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)(GLenum pname, GLint param); -GLAPI PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; -#define glVertexArrayParameteriAPPLE glad_glVertexArrayParameteriAPPLE -#endif -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 -GLAPI int GLAD_GL_AMD_query_buffer_object; -#endif -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -GLAPI int GLAD_GL_NV_register_combiners; -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC)(GLenum pname, const GLfloat* params); -GLAPI PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; -#define glCombinerParameterfvNV glad_glCombinerParameterfvNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; -#define glCombinerParameterfNV glad_glCombinerParameterfNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC)(GLenum pname, const GLint* params); -GLAPI PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; -#define glCombinerParameterivNV glad_glCombinerParameterivNV -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC)(GLenum pname, GLint param); -GLAPI PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; -#define glCombinerParameteriNV glad_glCombinerParameteriNV -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; -#define glCombinerInputNV glad_glCombinerInputNV -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; -#define glCombinerOutputNV glad_glCombinerOutputNV -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; -#define glFinalCombinerInputNV glad_glFinalCombinerInputNV -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; -#define glGetCombinerInputParameterfvNV glad_glGetCombinerInputParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); -GLAPI PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; -#define glGetCombinerInputParameterivNV glad_glGetCombinerInputParameterivNV -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLfloat* params); -GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; -#define glGetCombinerOutputParameterfvNV glad_glGetCombinerOutputParameterfvNV -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLint* params); -GLAPI PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; -#define glGetCombinerOutputParameterivNV glad_glGetCombinerOutputParameterivNV -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)(GLenum variable, GLenum pname, GLfloat* params); -GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; -#define glGetFinalCombinerInputParameterfvNV glad_glGetFinalCombinerInputParameterfvNV -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)(GLenum variable, GLenum pname, GLint* params); -GLAPI PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; -#define glGetFinalCombinerInputParameterivNV glad_glGetFinalCombinerInputParameterivNV -#endif -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -GLAPI int GLAD_GL_ARB_draw_buffers; -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs); -GLAPI PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -#define glDrawBuffersARB glad_glDrawBuffersARB -#endif -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 -GLAPI int GLAD_GL_ARB_clear_texture; -typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC)(GLuint texture, GLint level, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; -#define glClearTexImage glad_glClearTexImage -typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC)(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* data); -GLAPI PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; -#define glClearTexSubImage glad_glClearTexSubImage -#endif -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 -GLAPI int GLAD_GL_ARB_debug_output; -typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -#define glDebugMessageControlARB glad_glDebugMessageControlARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -#define glDebugMessageInsertARB glad_glDebugMessageInsertARB -typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void* userParam); -GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB -#endif -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 -GLAPI int GLAD_GL_SGI_color_matrix; -#endif -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -GLAPI int GLAD_GL_EXT_cull_vertex; -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC)(GLenum pname, GLdouble* params); -GLAPI PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; -#define glCullParameterdvEXT glad_glCullParameterdvEXT -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC)(GLenum pname, GLfloat* params); -GLAPI PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; -#define glCullParameterfvEXT glad_glCullParameterfvEXT -#endif -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 -GLAPI int GLAD_GL_EXT_texture_sRGB; -#endif -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 -GLAPI int GLAD_GL_APPLE_row_bytes; -#endif -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -GLAPI int GLAD_GL_NV_texgen_reflection; -#endif -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -GLAPI int GLAD_GL_IBM_multimode_draw_arrays; -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC)(const GLenum* mode, const GLint* first, const GLsizei* count, GLsizei primcount, GLint modestride); -GLAPI PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; -#define glMultiModeDrawArraysIBM glad_glMultiModeDrawArraysIBM -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC)(const GLenum* mode, const GLsizei* count, GLenum type, const void** indices, GLsizei primcount, GLint modestride); -GLAPI PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; -#define glMultiModeDrawElementsIBM glad_glMultiModeDrawElementsIBM -#endif -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -GLAPI int GLAD_GL_APPLE_vertex_array_object; -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC)(GLuint array); -GLAPI PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; -#define glBindVertexArrayAPPLE glad_glBindVertexArrayAPPLE -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC)(GLsizei n, const GLuint* arrays); -GLAPI PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; -#define glDeleteVertexArraysAPPLE glad_glDeleteVertexArraysAPPLE -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC)(GLsizei n, GLuint* arrays); -GLAPI PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; -#define glGenVertexArraysAPPLE glad_glGenVertexArraysAPPLE -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC)(GLuint array); -GLAPI PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; -#define glIsVertexArrayAPPLE glad_glIsVertexArrayAPPLE -#endif -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -GLAPI int GLAD_GL_3DFX_texture_compression_FXT1; -#endif -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 -GLAPI int GLAD_GL_NV_fragment_shader_interlock; -#endif -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 -GLAPI int GLAD_GL_AMD_conservative_depth; -#endif -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -GLAPI int GLAD_GL_ARB_texture_float; -#endif -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 -GLAPI int GLAD_GL_ARB_compressed_texture_pixel_storage; -#endif -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -GLAPI int GLAD_GL_SGIS_detail_texture; -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC)(GLenum target, GLsizei n, const GLfloat* points); -GLAPI PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; -#define glDetailTexFuncSGIS glad_glDetailTexFuncSGIS -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC)(GLenum target, GLfloat* points); -GLAPI PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; -#define glGetDetailTexFuncSGIS glad_glGetDetailTexFuncSGIS -#endif -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 -GLAPI int GLAD_GL_ARB_draw_instanced; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; -#define glDrawArraysInstancedARB glad_glDrawArraysInstancedARB -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC)(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -GLAPI PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; -#define glDrawElementsInstancedARB glad_glDrawElementsInstancedARB -#endif -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -GLAPI int GLAD_GL_OES_read_format; -#endif -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -GLAPI int GLAD_GL_ATI_texture_float; -#endif -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 -GLAPI int GLAD_GL_ARB_texture_gather; -#endif -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 -GLAPI int GLAD_GL_AMD_vertex_shader_layer; -#endif -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 -GLAPI int GLAD_GL_ARB_shading_language_include; -typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC)(GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar* string); -GLAPI PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; -#define glNamedStringARB glad_glNamedStringARB -typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); -GLAPI PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; -#define glDeleteNamedStringARB glad_glDeleteNamedStringARB -typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC)(GLuint shader, GLsizei count, const GLchar** path, const GLint* length); -GLAPI PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; -#define glCompileShaderIncludeARB glad_glCompileShaderIncludeARB -typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name); -GLAPI PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; -#define glIsNamedStringARB glad_glIsNamedStringARB -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC)(GLint namelen, const GLchar* name, GLsizei bufSize, GLint* stringlen, GLchar* string); -GLAPI PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; -#define glGetNamedStringARB glad_glGetNamedStringARB -typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC)(GLint namelen, const GLchar* name, GLenum pname, GLint* params); -GLAPI PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; -#define glGetNamedStringivARB glad_glGetNamedStringivARB -#endif -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -GLAPI int GLAD_GL_APPLE_client_storage; -#endif -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -GLAPI int GLAD_GL_WIN_phong_shading; -#endif -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -GLAPI int GLAD_GL_INGR_blend_func_separate; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GLAPI PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; -#define glBlendFuncSeparateINGR glad_glBlendFuncSeparateINGR -#endif -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 -GLAPI int GLAD_GL_NV_path_rendering; -typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC)(GLsizei range); -GLAPI PFNGLGENPATHSNVPROC glad_glGenPathsNV; -#define glGenPathsNV glad_glGenPathsNV -typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC)(GLuint path, GLsizei range); -GLAPI PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; -#define glDeletePathsNV glad_glDeletePathsNV -typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC)(GLuint path); -GLAPI PFNGLISPATHNVPROC glad_glIsPathNV; -#define glIsPathNV glad_glIsPathNV -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC)(GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; -#define glPathCommandsNV glad_glPathCommandsNV -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC)(GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; -#define glPathCoordsNV glad_glPathCoordsNV -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC)(GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; -#define glPathSubCommandsNV glad_glPathSubCommandsNV -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC)(GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); -GLAPI PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; -#define glPathSubCoordsNV glad_glPathSubCoordsNV -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC)(GLuint path, GLenum format, GLsizei length, const void* pathString); -GLAPI PFNGLPATHSTRINGNVPROC glad_glPathStringNV; -#define glPathStringNV glad_glPathStringNV -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void* charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; -#define glPathGlyphsNV glad_glPathGlyphsNV -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; -#define glPathGlyphRangeNV glad_glPathGlyphRangeNV -typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC)(GLuint resultPath, GLsizei numPaths, const GLuint* paths, const GLfloat* weights); -GLAPI PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; -#define glWeightPathsNV glad_glWeightPathsNV -typedef void (APIENTRYP PFNGLCOPYPATHNVPROC)(GLuint resultPath, GLuint srcPath); -GLAPI PFNGLCOPYPATHNVPROC glad_glCopyPathNV; -#define glCopyPathNV glad_glCopyPathNV -typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC)(GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -GLAPI PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; -#define glInterpolatePathsNV glad_glInterpolatePathsNV -typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC)(GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; -#define glTransformPathNV glad_glTransformPathNV -typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, const GLint* value); -GLAPI PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; -#define glPathParameterivNV glad_glPathParameterivNV -typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC)(GLuint path, GLenum pname, GLint value); -GLAPI PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; -#define glPathParameteriNV glad_glPathParameteriNV -typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, const GLfloat* value); -GLAPI PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; -#define glPathParameterfvNV glad_glPathParameterfvNV -typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC)(GLuint path, GLenum pname, GLfloat value); -GLAPI PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; -#define glPathParameterfNV glad_glPathParameterfNV -typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC)(GLuint path, GLsizei dashCount, const GLfloat* dashArray); -GLAPI PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; -#define glPathDashArrayNV glad_glPathDashArrayNV -typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC)(GLenum func, GLint ref, GLuint mask); -GLAPI PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; -#define glPathStencilFuncNV glad_glPathStencilFuncNV -typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC)(GLfloat factor, GLfloat units); -GLAPI PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; -#define glPathStencilDepthOffsetNV glad_glPathStencilDepthOffsetNV -typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask); -GLAPI PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; -#define glStencilFillPathNV glad_glStencilFillPathNV -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask); -GLAPI PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; -#define glStencilStrokePathNV glad_glStencilStrokePathNV -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; -#define glStencilFillPathInstancedNV glad_glStencilFillPathInstancedNV -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; -#define glStencilStrokePathInstancedNV glad_glStencilStrokePathInstancedNV -typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC)(GLenum func); -GLAPI PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; -#define glPathCoverDepthFuncNV glad_glPathCoverDepthFuncNV -typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC)(GLuint path, GLenum coverMode); -GLAPI PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; -#define glCoverFillPathNV glad_glCoverFillPathNV -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC)(GLuint path, GLenum coverMode); -GLAPI PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; -#define glCoverStrokePathNV glad_glCoverStrokePathNV -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; -#define glCoverFillPathInstancedNV glad_glCoverFillPathInstancedNV -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; -#define glCoverStrokePathInstancedNV glad_glCoverStrokePathInstancedNV -typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC)(GLuint path, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; -#define glGetPathParameterivNV glad_glGetPathParameterivNV -typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC)(GLuint path, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; -#define glGetPathParameterfvNV glad_glGetPathParameterfvNV -typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC)(GLuint path, GLubyte* commands); -GLAPI PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; -#define glGetPathCommandsNV glad_glGetPathCommandsNV -typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC)(GLuint path, GLfloat* coords); -GLAPI PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; -#define glGetPathCoordsNV glad_glGetPathCoordsNV -typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC)(GLuint path, GLfloat* dashArray); -GLAPI PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; -#define glGetPathDashArrayNV glad_glGetPathDashArrayNV -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC)(GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat* metrics); -GLAPI PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; -#define glGetPathMetricsNV glad_glGetPathMetricsNV -typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC)(GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); -GLAPI PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; -#define glGetPathMetricRangeNV glad_glGetPathMetricRangeNV -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC)(GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat* returnedSpacing); -GLAPI PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; -#define glGetPathSpacingNV glad_glGetPathSpacingNV -typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC)(GLuint path, GLuint mask, GLfloat x, GLfloat y); -GLAPI PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; -#define glIsPointInFillPathNV glad_glIsPointInFillPathNV -typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC)(GLuint path, GLfloat x, GLfloat y); -GLAPI PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; -#define glIsPointInStrokePathNV glad_glIsPointInStrokePathNV -typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments); -GLAPI PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; -#define glGetPathLengthNV glad_glGetPathLengthNV -typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC)(GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat* y, GLfloat* tangentX, GLfloat* tangentY); -GLAPI PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; -#define glPointAlongPathNV glad_glPointAlongPathNV -typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; -#define glMatrixLoad3x2fNV glad_glMatrixLoad3x2fNV -typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; -#define glMatrixLoad3x3fNV glad_glMatrixLoad3x3fNV -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; -#define glMatrixLoadTranspose3x3fNV glad_glMatrixLoadTranspose3x3fNV -typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; -#define glMatrixMult3x2fNV glad_glMatrixMult3x2fNV -typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; -#define glMatrixMult3x3fNV glad_glMatrixMult3x3fNV -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)(GLenum matrixMode, const GLfloat* m); -GLAPI PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; -#define glMatrixMultTranspose3x3fNV glad_glMatrixMultTranspose3x3fNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC)(GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GLAPI PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; -#define glStencilThenCoverFillPathNV glad_glStencilThenCoverFillPathNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)(GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; -#define glStencilThenCoverStrokePathNV glad_glStencilThenCoverStrokePathNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; -#define glStencilThenCoverFillPathInstancedNV glad_glStencilThenCoverFillPathInstancedNV -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)(GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat* transformValues); -GLAPI PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; -#define glStencilThenCoverStrokePathInstancedNV glad_glStencilThenCoverStrokePathInstancedNV -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC)(GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint* baseAndCount); -GLAPI PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; -#define glPathGlyphIndexRangeNV glad_glPathGlyphIndexRangeNV -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; -#define glPathGlyphIndexArrayNV glad_glPathGlyphIndexArrayNV -typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)(GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void* fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; -#define glPathMemoryGlyphIndexArrayNV glad_glPathMemoryGlyphIndexArrayNV -typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)(GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); -GLAPI PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; -#define glProgramPathFragmentInputGenNV glad_glProgramPathFragmentInputGenNV -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC)(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLfloat* params); -GLAPI PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; -#define glGetProgramResourcefvNV glad_glGetProgramResourcefvNV -typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC)(GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); -GLAPI PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; -#define glPathColorGenNV glad_glPathColorGenNV -typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC)(GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); -GLAPI PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; -#define glPathTexGenNV glad_glPathTexGenNV -typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC)(GLenum genMode); -GLAPI PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; -#define glPathFogGenNV glad_glPathFogGenNV -typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC)(GLenum color, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; -#define glGetPathColorGenivNV glad_glGetPathColorGenivNV -typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC)(GLenum color, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; -#define glGetPathColorGenfvNV glad_glGetPathColorGenfvNV -typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC)(GLenum texCoordSet, GLenum pname, GLint* value); -GLAPI PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; -#define glGetPathTexGenivNV glad_glGetPathTexGenivNV -typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC)(GLenum texCoordSet, GLenum pname, GLfloat* value); -GLAPI PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; -#define glGetPathTexGenfvNV glad_glGetPathTexGenfvNV -#endif -#ifndef GL_NV_conservative_raster_dilate -#define GL_NV_conservative_raster_dilate 1 -GLAPI int GLAD_GL_NV_conservative_raster_dilate; -typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)(GLenum pname, GLfloat value); -GLAPI PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; -#define glConservativeRasterParameterfNV glad_glConservativeRasterParameterfNV -#endif -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -GLAPI int GLAD_GL_ATI_vertex_streams; -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC)(GLenum stream, GLshort x); -GLAPI PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; -#define glVertexStream1sATI glad_glVertexStream1sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; -#define glVertexStream1svATI glad_glVertexStream1svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC)(GLenum stream, GLint x); -GLAPI PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; -#define glVertexStream1iATI glad_glVertexStream1iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; -#define glVertexStream1ivATI glad_glVertexStream1ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC)(GLenum stream, GLfloat x); -GLAPI PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; -#define glVertexStream1fATI glad_glVertexStream1fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; -#define glVertexStream1fvATI glad_glVertexStream1fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC)(GLenum stream, GLdouble x); -GLAPI PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; -#define glVertexStream1dATI glad_glVertexStream1dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; -#define glVertexStream1dvATI glad_glVertexStream1dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC)(GLenum stream, GLshort x, GLshort y); -GLAPI PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; -#define glVertexStream2sATI glad_glVertexStream2sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; -#define glVertexStream2svATI glad_glVertexStream2svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC)(GLenum stream, GLint x, GLint y); -GLAPI PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; -#define glVertexStream2iATI glad_glVertexStream2iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; -#define glVertexStream2ivATI glad_glVertexStream2ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC)(GLenum stream, GLfloat x, GLfloat y); -GLAPI PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; -#define glVertexStream2fATI glad_glVertexStream2fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; -#define glVertexStream2fvATI glad_glVertexStream2fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC)(GLenum stream, GLdouble x, GLdouble y); -GLAPI PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; -#define glVertexStream2dATI glad_glVertexStream2dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; -#define glVertexStream2dvATI glad_glVertexStream2dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z); -GLAPI PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; -#define glVertexStream3sATI glad_glVertexStream3sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; -#define glVertexStream3svATI glad_glVertexStream3svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC)(GLenum stream, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; -#define glVertexStream3iATI glad_glVertexStream3iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; -#define glVertexStream3ivATI glad_glVertexStream3ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; -#define glVertexStream3fATI glad_glVertexStream3fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; -#define glVertexStream3fvATI glad_glVertexStream3fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z); -GLAPI PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; -#define glVertexStream3dATI glad_glVertexStream3dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; -#define glVertexStream3dvATI glad_glVertexStream3dvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC)(GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; -#define glVertexStream4sATI glad_glVertexStream4sATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; -#define glVertexStream4svATI glad_glVertexStream4svATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC)(GLenum stream, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; -#define glVertexStream4iATI glad_glVertexStream4iATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; -#define glVertexStream4ivATI glad_glVertexStream4ivATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC)(GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; -#define glVertexStream4fATI glad_glVertexStream4fATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; -#define glVertexStream4fvATI glad_glVertexStream4fvATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC)(GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; -#define glVertexStream4dATI glad_glVertexStream4dATI -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; -#define glVertexStream4dvATI glad_glVertexStream4dvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC)(GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; -#define glNormalStream3bATI glad_glNormalStream3bATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC)(GLenum stream, const GLbyte* coords); -GLAPI PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; -#define glNormalStream3bvATI glad_glNormalStream3bvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC)(GLenum stream, GLshort nx, GLshort ny, GLshort nz); -GLAPI PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; -#define glNormalStream3sATI glad_glNormalStream3sATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC)(GLenum stream, const GLshort* coords); -GLAPI PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; -#define glNormalStream3svATI glad_glNormalStream3svATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC)(GLenum stream, GLint nx, GLint ny, GLint nz); -GLAPI PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; -#define glNormalStream3iATI glad_glNormalStream3iATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC)(GLenum stream, const GLint* coords); -GLAPI PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; -#define glNormalStream3ivATI glad_glNormalStream3ivATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC)(GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; -#define glNormalStream3fATI glad_glNormalStream3fATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC)(GLenum stream, const GLfloat* coords); -GLAPI PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; -#define glNormalStream3fvATI glad_glNormalStream3fvATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC)(GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; -#define glNormalStream3dATI glad_glNormalStream3dATI -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC)(GLenum stream, const GLdouble* coords); -GLAPI PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; -#define glNormalStream3dvATI glad_glNormalStream3dvATI -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)(GLenum stream); -GLAPI PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; -#define glClientActiveVertexStreamATI glad_glClientActiveVertexStreamATI -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC)(GLenum pname, GLint param); -GLAPI PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; -#define glVertexBlendEnviATI glad_glVertexBlendEnviATI -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC)(GLenum pname, GLfloat param); -GLAPI PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; -#define glVertexBlendEnvfATI glad_glVertexBlendEnvfATI -#endif -#ifndef GL_ARB_post_depth_coverage -#define GL_ARB_post_depth_coverage 1 -GLAPI int GLAD_GL_ARB_post_depth_coverage; -#endif -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -GLAPI int GLAD_GL_ARB_texture_non_power_of_two; -#endif -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 -GLAPI int GLAD_GL_APPLE_rgb_422; -#endif -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -GLAPI int GLAD_GL_EXT_texture_lod_bias; -#endif -#ifndef GL_ARB_gpu_shader_int64 -#define GL_ARB_gpu_shader_int64 1 -GLAPI int GLAD_GL_ARB_gpu_shader_int64; -typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC)(GLint location, GLint64 x); -GLAPI PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; -#define glUniform1i64ARB glad_glUniform1i64ARB -typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC)(GLint location, GLint64 x, GLint64 y); -GLAPI PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; -#define glUniform2i64ARB glad_glUniform2i64ARB -typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; -#define glUniform3i64ARB glad_glUniform3i64ARB -typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC)(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; -#define glUniform4i64ARB glad_glUniform4i64ARB -typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; -#define glUniform1i64vARB glad_glUniform1i64vARB -typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; -#define glUniform2i64vARB glad_glUniform2i64vARB -typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; -#define glUniform3i64vARB glad_glUniform3i64vARB -typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC)(GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; -#define glUniform4i64vARB glad_glUniform4i64vARB -typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC)(GLint location, GLuint64 x); -GLAPI PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; -#define glUniform1ui64ARB glad_glUniform1ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y); -GLAPI PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; -#define glUniform2ui64ARB glad_glUniform2ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; -#define glUniform3ui64ARB glad_glUniform3ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC)(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; -#define glUniform4ui64ARB glad_glUniform4ui64ARB -typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; -#define glUniform1ui64vARB glad_glUniform1ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; -#define glUniform2ui64vARB glad_glUniform2ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; -#define glUniform3ui64vARB glad_glUniform3ui64vARB -typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC)(GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; -#define glUniform4ui64vARB glad_glUniform4ui64vARB -typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC)(GLuint program, GLint location, GLint64* params); -GLAPI PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; -#define glGetUniformi64vARB glad_glGetUniformi64vARB -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLuint64* params); -GLAPI PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; -#define glGetUniformui64vARB glad_glGetUniformui64vARB -typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint64* params); -GLAPI PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; -#define glGetnUniformi64vARB glad_glGetnUniformi64vARB -typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint64* params); -GLAPI PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; -#define glGetnUniformui64vARB glad_glGetnUniformui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC)(GLuint program, GLint location, GLint64 x); -GLAPI PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; -#define glProgramUniform1i64ARB glad_glProgramUniform1i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y); -GLAPI PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; -#define glProgramUniform2i64ARB glad_glProgramUniform2i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); -GLAPI PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; -#define glProgramUniform3i64ARB glad_glProgramUniform3i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC)(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -GLAPI PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; -#define glProgramUniform4i64ARB glad_glProgramUniform4i64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; -#define glProgramUniform1i64vARB glad_glProgramUniform1i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; -#define glProgramUniform2i64vARB glad_glProgramUniform2i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; -#define glProgramUniform3i64vARB glad_glProgramUniform3i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLint64* value); -GLAPI PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; -#define glProgramUniform4i64vARB glad_glProgramUniform4i64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC)(GLuint program, GLint location, GLuint64 x); -GLAPI PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; -#define glProgramUniform1ui64ARB glad_glProgramUniform1ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y); -GLAPI PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; -#define glProgramUniform2ui64ARB glad_glProgramUniform2ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -GLAPI PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; -#define glProgramUniform3ui64ARB glad_glProgramUniform3ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC)(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -GLAPI PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; -#define glProgramUniform4ui64ARB glad_glProgramUniform4ui64ARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; -#define glProgramUniform1ui64vARB glad_glProgramUniform1ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; -#define glProgramUniform2ui64vARB glad_glProgramUniform2ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; -#define glProgramUniform3ui64vARB glad_glProgramUniform3ui64vARB -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC)(GLuint program, GLint location, GLsizei count, const GLuint64* value); -GLAPI PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; -#define glProgramUniform4ui64vARB glad_glProgramUniform4ui64vARB -#endif -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 -GLAPI int GLAD_GL_ARB_seamless_cube_map; -#endif -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 -GLAPI int GLAD_GL_ARB_shader_group_vote; -#endif -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 -GLAPI int GLAD_GL_NV_vdpau_interop; -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC)(const void* vdpDevice, const void* getProcAddress); -GLAPI PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; -#define glVDPAUInitNV glad_glVDPAUInitNV -typedef void (APIENTRYP PFNGLVDPAUFININVPROC)(); -GLAPI PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; -#define glVDPAUFiniNV glad_glVDPAUFiniNV -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); -GLAPI PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; -#define glVDPAURegisterVideoSurfaceNV glad_glVDPAURegisterVideoSurfaceNV -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)(const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint* textureNames); -GLAPI PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; -#define glVDPAURegisterOutputSurfaceNV glad_glVDPAURegisterOutputSurfaceNV -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC)(GLvdpauSurfaceNV surface); -GLAPI PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; -#define glVDPAUIsSurfaceNV glad_glVDPAUIsSurfaceNV -typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC)(GLvdpauSurfaceNV surface); -GLAPI PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; -#define glVDPAUUnregisterSurfaceNV glad_glVDPAUUnregisterSurfaceNV -typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC)(GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); -GLAPI PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; -#define glVDPAUGetSurfaceivNV glad_glVDPAUGetSurfaceivNV -typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC)(GLvdpauSurfaceNV surface, GLenum access); -GLAPI PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; -#define glVDPAUSurfaceAccessNV glad_glVDPAUSurfaceAccessNV -typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC)(GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); -GLAPI PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; -#define glVDPAUMapSurfacesNV glad_glVDPAUMapSurfacesNV -typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC)(GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); -GLAPI PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; -#define glVDPAUUnmapSurfacesNV glad_glVDPAUUnmapSurfacesNV -#endif -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 -GLAPI int GLAD_GL_ARB_occlusion_query2; -#endif -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 -GLAPI int GLAD_GL_ARB_internalformat_query2; -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); -GLAPI PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; -#define glGetInternalformati64v glad_glGetInternalformati64v -#endif -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -GLAPI int GLAD_GL_EXT_texture_filter_anisotropic; -#endif -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -GLAPI int GLAD_GL_SUN_vertex; -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; -#define glColor4ubVertex2fSUN glad_glColor4ubVertex2fSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC)(const GLubyte* c, const GLfloat* v); -GLAPI PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; -#define glColor4ubVertex2fvSUN glad_glColor4ubVertex2fvSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC)(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; -#define glColor4ubVertex3fSUN glad_glColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC)(const GLubyte* c, const GLfloat* v); -GLAPI PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; -#define glColor4ubVertex3fvSUN glad_glColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; -#define glColor3fVertex3fSUN glad_glColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* v); -GLAPI PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; -#define glColor3fVertex3fvSUN glad_glColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC)(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; -#define glNormal3fVertex3fSUN glad_glNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* n, const GLfloat* v); -GLAPI PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; -#define glNormal3fVertex3fvSUN glad_glNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; -#define glColor4fNormal3fVertex3fSUN glad_glColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; -#define glColor4fNormal3fVertex3fvSUN glad_glColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; -#define glTexCoord2fVertex3fSUN glad_glTexCoord2fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; -#define glTexCoord2fVertex3fvSUN glad_glTexCoord2fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; -#define glTexCoord4fVertex4fSUN glad_glTexCoord4fVertex4fSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; -#define glTexCoord4fVertex4fvSUN glad_glTexCoord4fVertex4fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; -#define glTexCoord2fColor4ubVertex3fSUN glad_glTexCoord2fColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)(const GLfloat* tc, const GLubyte* c, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; -#define glTexCoord2fColor4ubVertex3fvSUN glad_glTexCoord2fColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; -#define glTexCoord2fColor3fVertex3fSUN glad_glTexCoord2fColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; -#define glTexCoord2fColor3fVertex3fvSUN glad_glTexCoord2fColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; -#define glTexCoord2fNormal3fVertex3fSUN glad_glTexCoord2fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; -#define glTexCoord2fNormal3fVertex3fvSUN glad_glTexCoord2fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; -#define glTexCoord2fColor4fNormal3fVertex3fSUN glad_glTexCoord2fColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; -#define glTexCoord2fColor4fNormal3fVertex3fvSUN glad_glTexCoord2fColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; -#define glTexCoord4fColor4fNormal3fVertex4fSUN glad_glTexCoord4fColor4fNormal3fVertex4fSUN -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)(const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; -#define glTexCoord4fColor4fNormal3fVertex4fvSUN glad_glTexCoord4fColor4fNormal3fVertex4fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)(GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; -#define glReplacementCodeuiVertex3fSUN glad_glReplacementCodeuiVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; -#define glReplacementCodeuiVertex3fvSUN glad_glReplacementCodeuiVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; -#define glReplacementCodeuiColor4ubVertex3fSUN glad_glReplacementCodeuiColor4ubVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)(const GLuint* rc, const GLubyte* c, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; -#define glReplacementCodeuiColor4ubVertex3fvSUN glad_glReplacementCodeuiColor4ubVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; -#define glReplacementCodeuiColor3fVertex3fSUN glad_glReplacementCodeuiColor3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; -#define glReplacementCodeuiColor3fVertex3fvSUN glad_glReplacementCodeuiColor3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; -#define glReplacementCodeuiNormal3fVertex3fSUN glad_glReplacementCodeuiNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; -#define glReplacementCodeuiNormal3fVertex3fvSUN glad_glReplacementCodeuiNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -#define glReplacementCodeuiColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fVertex3fSUN glad_glReplacementCodeuiTexCoord2fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)(const GLuint* rc, const GLfloat* tc, const GLfloat* c, const GLfloat* n, const GLfloat* v); -GLAPI PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN -#endif -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -GLAPI int GLAD_GL_SGIX_igloo_interface; -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC)(GLenum pname, const void* params); -GLAPI PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; -#define glIglooInterfaceSGIX glad_glIglooInterfaceSGIX -#endif -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -GLAPI int GLAD_GL_SGIS_texture_lod; -#endif -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -GLAPI int GLAD_GL_NV_vertex_program3; -#endif -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 -GLAPI int GLAD_GL_ARB_draw_indirect; -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC)(GLenum mode, const void* indirect); -GLAPI PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; -#define glDrawArraysIndirect glad_glDrawArraysIndirect -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC)(GLenum mode, GLenum type, const void* indirect); -GLAPI PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; -#define glDrawElementsIndirect glad_glDrawElementsIndirect -#endif -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 -GLAPI int GLAD_GL_NV_vertex_program4; -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC)(GLuint index, GLint x); -GLAPI PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; -#define glVertexAttribI1iEXT glad_glVertexAttribI1iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC)(GLuint index, GLint x, GLint y); -GLAPI PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; -#define glVertexAttribI2iEXT glad_glVertexAttribI2iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC)(GLuint index, GLint x, GLint y, GLint z); -GLAPI PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; -#define glVertexAttribI3iEXT glad_glVertexAttribI3iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); -GLAPI PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; -#define glVertexAttribI4iEXT glad_glVertexAttribI4iEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC)(GLuint index, GLuint x); -GLAPI PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; -#define glVertexAttribI1uiEXT glad_glVertexAttribI1uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC)(GLuint index, GLuint x, GLuint y); -GLAPI PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; -#define glVertexAttribI2uiEXT glad_glVertexAttribI2uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z); -GLAPI PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; -#define glVertexAttribI3uiEXT glad_glVertexAttribI3uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GLAPI PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; -#define glVertexAttribI4uiEXT glad_glVertexAttribI4uiEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; -#define glVertexAttribI1ivEXT glad_glVertexAttribI1ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; -#define glVertexAttribI2ivEXT glad_glVertexAttribI2ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; -#define glVertexAttribI3ivEXT glad_glVertexAttribI3ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC)(GLuint index, const GLint* v); -GLAPI PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; -#define glVertexAttribI4ivEXT glad_glVertexAttribI4ivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; -#define glVertexAttribI1uivEXT glad_glVertexAttribI1uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; -#define glVertexAttribI2uivEXT glad_glVertexAttribI2uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; -#define glVertexAttribI3uivEXT glad_glVertexAttribI3uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC)(GLuint index, const GLuint* v); -GLAPI PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; -#define glVertexAttribI4uivEXT glad_glVertexAttribI4uivEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC)(GLuint index, const GLbyte* v); -GLAPI PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; -#define glVertexAttribI4bvEXT glad_glVertexAttribI4bvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC)(GLuint index, const GLshort* v); -GLAPI PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; -#define glVertexAttribI4svEXT glad_glVertexAttribI4svEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC)(GLuint index, const GLubyte* v); -GLAPI PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; -#define glVertexAttribI4ubvEXT glad_glVertexAttribI4ubvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC)(GLuint index, const GLushort* v); -GLAPI PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; -#define glVertexAttribI4usvEXT glad_glVertexAttribI4usvEXT -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; -#define glVertexAttribIPointerEXT glad_glVertexAttribIPointerEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC)(GLuint index, GLenum pname, GLint* params); -GLAPI PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; -#define glGetVertexAttribIivEXT glad_glGetVertexAttribIivEXT -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC)(GLuint index, GLenum pname, GLuint* params); -GLAPI PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; -#define glGetVertexAttribIuivEXT glad_glGetVertexAttribIuivEXT -#endif -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 -GLAPI int GLAD_GL_AMD_transform_feedback3_lines_triangles; -#endif -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -GLAPI int GLAD_GL_SGIS_fog_function; -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC)(GLsizei n, const GLfloat* points); -GLAPI PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; -#define glFogFuncSGIS glad_glFogFuncSGIS -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC)(GLfloat* points); -GLAPI PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; -#define glGetFogFuncSGIS glad_glGetFogFuncSGIS -#endif -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 -GLAPI int GLAD_GL_EXT_x11_sync_object; -typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC)(GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); -GLAPI PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; -#define glImportSyncEXT glad_glImportSyncEXT -#endif -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 -GLAPI int GLAD_GL_ARB_sync; -#endif -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 -GLAPI int GLAD_GL_NV_sample_locations; -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; -#define glFramebufferSampleLocationsfvNV glad_glFramebufferSampleLocationsfvNV -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; -#define glNamedFramebufferSampleLocationsfvNV glad_glNamedFramebufferSampleLocationsfvNV -typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC)(); -GLAPI PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; -#define glResolveDepthValuesNV glad_glResolveDepthValuesNV -#endif -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 -GLAPI int GLAD_GL_ARB_compute_variable_group_size; -typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); -GLAPI PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; -#define glDispatchComputeGroupSizeARB glad_glDispatchComputeGroupSizeARB -#endif -#ifndef GL_OES_fixed_point -#define GL_OES_fixed_point 1 -GLAPI int GLAD_GL_OES_fixed_point; -typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC)(GLenum func, GLfixed ref); -GLAPI PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; -#define glAlphaFuncxOES glad_glAlphaFuncxOES -typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; -#define glClearColorxOES glad_glClearColorxOES -typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC)(GLfixed depth); -GLAPI PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; -#define glClearDepthxOES glad_glClearDepthxOES -typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC)(GLenum plane, const GLfixed* equation); -GLAPI PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; -#define glClipPlanexOES glad_glClipPlanexOES -typedef void (APIENTRYP PFNGLCOLOR4XOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCOLOR4XOESPROC glad_glColor4xOES; -#define glColor4xOES glad_glColor4xOES -typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC)(GLfixed n, GLfixed f); -GLAPI PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; -#define glDepthRangexOES glad_glDepthRangexOES -typedef void (APIENTRYP PFNGLFOGXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLFOGXOESPROC glad_glFogxOES; -#define glFogxOES glad_glFogxOES -typedef void (APIENTRYP PFNGLFOGXVOESPROC)(GLenum pname, const GLfixed* param); -GLAPI PFNGLFOGXVOESPROC glad_glFogxvOES; -#define glFogxvOES glad_glFogxvOES -typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; -#define glFrustumxOES glad_glFrustumxOES -typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC)(GLenum plane, GLfixed* equation); -GLAPI PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; -#define glGetClipPlanexOES glad_glGetClipPlanexOES -typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC)(GLenum pname, GLfixed* params); -GLAPI PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; -#define glGetFixedvOES glad_glGetFixedvOES -typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; -#define glGetTexEnvxvOES glad_glGetTexEnvxvOES -typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; -#define glGetTexParameterxvOES glad_glGetTexParameterxvOES -typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; -#define glLightModelxOES glad_glLightModelxOES -typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC)(GLenum pname, const GLfixed* param); -GLAPI PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; -#define glLightModelxvOES glad_glLightModelxvOES -typedef void (APIENTRYP PFNGLLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed param); -GLAPI PFNGLLIGHTXOESPROC glad_glLightxOES; -#define glLightxOES glad_glLightxOES -typedef void (APIENTRYP PFNGLLIGHTXVOESPROC)(GLenum light, GLenum pname, const GLfixed* params); -GLAPI PFNGLLIGHTXVOESPROC glad_glLightxvOES; -#define glLightxvOES glad_glLightxvOES -typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC)(GLfixed width); -GLAPI PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; -#define glLineWidthxOES glad_glLineWidthxOES -typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; -#define glLoadMatrixxOES glad_glLoadMatrixxOES -typedef void (APIENTRYP PFNGLMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); -GLAPI PFNGLMATERIALXOESPROC glad_glMaterialxOES; -#define glMaterialxOES glad_glMaterialxOES -typedef void (APIENTRYP PFNGLMATERIALXVOESPROC)(GLenum face, GLenum pname, const GLfixed* param); -GLAPI PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; -#define glMaterialxvOES glad_glMaterialxvOES -typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; -#define glMultMatrixxOES glad_glMultMatrixxOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; -#define glMultiTexCoord4xOES glad_glMultiTexCoord4xOES -typedef void (APIENTRYP PFNGLNORMAL3XOESPROC)(GLfixed nx, GLfixed ny, GLfixed nz); -GLAPI PFNGLNORMAL3XOESPROC glad_glNormal3xOES; -#define glNormal3xOES glad_glNormal3xOES -typedef void (APIENTRYP PFNGLORTHOXOESPROC)(GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GLAPI PFNGLORTHOXOESPROC glad_glOrthoxOES; -#define glOrthoxOES glad_glOrthoxOES -typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC)(GLenum pname, const GLfixed* params); -GLAPI PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; -#define glPointParameterxvOES glad_glPointParameterxvOES -typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC)(GLfixed size); -GLAPI PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; -#define glPointSizexOES glad_glPointSizexOES -typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC)(GLfixed factor, GLfixed units); -GLAPI PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; -#define glPolygonOffsetxOES glad_glPolygonOffsetxOES -typedef void (APIENTRYP PFNGLROTATEXOESPROC)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLROTATEXOESPROC glad_glRotatexOES; -#define glRotatexOES glad_glRotatexOES -typedef void (APIENTRYP PFNGLSCALEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLSCALEXOESPROC glad_glScalexOES; -#define glScalexOES glad_glScalexOES -typedef void (APIENTRYP PFNGLTEXENVXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLTEXENVXOESPROC glad_glTexEnvxOES; -#define glTexEnvxOES glad_glTexEnvxOES -typedef void (APIENTRYP PFNGLTEXENVXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; -#define glTexEnvxvOES glad_glTexEnvxvOES -typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; -#define glTexParameterxOES glad_glTexParameterxOES -typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; -#define glTexParameterxvOES glad_glTexParameterxvOES -typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; -#define glTranslatexOES glad_glTranslatexOES -typedef void (APIENTRYP PFNGLGETLIGHTXVOESPROC)(GLenum light, GLenum pname, GLfixed* params); -GLAPI PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; -#define glGetLightxvOES glad_glGetLightxvOES -typedef void (APIENTRYP PFNGLGETMATERIALXVOESPROC)(GLenum face, GLenum pname, GLfixed* params); -GLAPI PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; -#define glGetMaterialxvOES glad_glGetMaterialxvOES -typedef void (APIENTRYP PFNGLPOINTPARAMETERXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; -#define glPointParameterxOES glad_glPointParameterxOES -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC)(GLclampx value, GLboolean invert); -GLAPI PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; -#define glSampleCoveragexOES glad_glSampleCoveragexOES -typedef void (APIENTRYP PFNGLACCUMXOESPROC)(GLenum op, GLfixed value); -GLAPI PFNGLACCUMXOESPROC glad_glAccumxOES; -#define glAccumxOES glad_glAccumxOES -typedef void (APIENTRYP PFNGLBITMAPXOESPROC)(GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte* bitmap); -GLAPI PFNGLBITMAPXOESPROC glad_glBitmapxOES; -#define glBitmapxOES glad_glBitmapxOES -typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; -#define glBlendColorxOES glad_glBlendColorxOES -typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GLAPI PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; -#define glClearAccumxOES glad_glClearAccumxOES -typedef void (APIENTRYP PFNGLCOLOR3XOESPROC)(GLfixed red, GLfixed green, GLfixed blue); -GLAPI PFNGLCOLOR3XOESPROC glad_glColor3xOES; -#define glColor3xOES glad_glColor3xOES -typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC)(const GLfixed* components); -GLAPI PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; -#define glColor3xvOES glad_glColor3xvOES -typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC)(const GLfixed* components); -GLAPI PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; -#define glColor4xvOES glad_glColor4xvOES -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC)(GLenum target, GLenum pname, GLfixed param); -GLAPI PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; -#define glConvolutionParameterxOES glad_glConvolutionParameterxOES -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, const GLfixed* params); -GLAPI PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; -#define glConvolutionParameterxvOES glad_glConvolutionParameterxvOES -typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC)(GLfixed u); -GLAPI PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; -#define glEvalCoord1xOES glad_glEvalCoord1xOES -typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; -#define glEvalCoord1xvOES glad_glEvalCoord1xvOES -typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC)(GLfixed u, GLfixed v); -GLAPI PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; -#define glEvalCoord2xOES glad_glEvalCoord2xOES -typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; -#define glEvalCoord2xvOES glad_glEvalCoord2xvOES -typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC)(GLsizei n, GLenum type, const GLfixed* buffer); -GLAPI PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; -#define glFeedbackBufferxOES glad_glFeedbackBufferxOES -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; -#define glGetConvolutionParameterxvOES glad_glGetConvolutionParameterxvOES -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC)(GLenum target, GLenum pname, GLfixed* params); -GLAPI PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; -#define glGetHistogramParameterxvOES glad_glGetHistogramParameterxvOES -typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC)(GLenum light, GLenum pname, GLfixed* params); -GLAPI PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; -#define glGetLightxOES glad_glGetLightxOES -typedef void (APIENTRYP PFNGLGETMAPXVOESPROC)(GLenum target, GLenum query, GLfixed* v); -GLAPI PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; -#define glGetMapxvOES glad_glGetMapxvOES -typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC)(GLenum face, GLenum pname, GLfixed param); -GLAPI PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; -#define glGetMaterialxOES glad_glGetMaterialxOES -typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC)(GLenum map, GLint size, GLfixed* values); -GLAPI PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; -#define glGetPixelMapxv glad_glGetPixelMapxv -typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC)(GLenum coord, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; -#define glGetTexGenxvOES glad_glGetTexGenxvOES -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC)(GLenum target, GLint level, GLenum pname, GLfixed* params); -GLAPI PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; -#define glGetTexLevelParameterxvOES glad_glGetTexLevelParameterxvOES -typedef void (APIENTRYP PFNGLINDEXXOESPROC)(GLfixed component); -GLAPI PFNGLINDEXXOESPROC glad_glIndexxOES; -#define glIndexxOES glad_glIndexxOES -typedef void (APIENTRYP PFNGLINDEXXVOESPROC)(const GLfixed* component); -GLAPI PFNGLINDEXXVOESPROC glad_glIndexxvOES; -#define glIndexxvOES glad_glIndexxvOES -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; -#define glLoadTransposeMatrixxOES glad_glLoadTransposeMatrixxOES -typedef void (APIENTRYP PFNGLMAP1XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); -GLAPI PFNGLMAP1XOESPROC glad_glMap1xOES; -#define glMap1xOES glad_glMap1xOES -typedef void (APIENTRYP PFNGLMAP2XOESPROC)(GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); -GLAPI PFNGLMAP2XOESPROC glad_glMap2xOES; -#define glMap2xOES glad_glMap2xOES -typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC)(GLint n, GLfixed u1, GLfixed u2); -GLAPI PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; -#define glMapGrid1xOES glad_glMapGrid1xOES -typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC)(GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); -GLAPI PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; -#define glMapGrid2xOES glad_glMapGrid2xOES -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC)(const GLfixed* m); -GLAPI PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; -#define glMultTransposeMatrixxOES glad_glMultTransposeMatrixxOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC)(GLenum texture, GLfixed s); -GLAPI PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; -#define glMultiTexCoord1xOES glad_glMultiTexCoord1xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; -#define glMultiTexCoord1xvOES glad_glMultiTexCoord1xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC)(GLenum texture, GLfixed s, GLfixed t); -GLAPI PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; -#define glMultiTexCoord2xOES glad_glMultiTexCoord2xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; -#define glMultiTexCoord2xvOES glad_glMultiTexCoord2xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC)(GLenum texture, GLfixed s, GLfixed t, GLfixed r); -GLAPI PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; -#define glMultiTexCoord3xOES glad_glMultiTexCoord3xOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; -#define glMultiTexCoord3xvOES glad_glMultiTexCoord3xvOES -typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC)(GLenum texture, const GLfixed* coords); -GLAPI PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; -#define glMultiTexCoord4xvOES glad_glMultiTexCoord4xvOES -typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; -#define glNormal3xvOES glad_glNormal3xvOES -typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC)(GLfixed token); -GLAPI PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; -#define glPassThroughxOES glad_glPassThroughxOES -typedef void (APIENTRYP PFNGLPIXELMAPXPROC)(GLenum map, GLint size, const GLfixed* values); -GLAPI PFNGLPIXELMAPXPROC glad_glPixelMapx; -#define glPixelMapx glad_glPixelMapx -typedef void (APIENTRYP PFNGLPIXELSTOREXPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPIXELSTOREXPROC glad_glPixelStorex; -#define glPixelStorex glad_glPixelStorex -typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC)(GLenum pname, GLfixed param); -GLAPI PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; -#define glPixelTransferxOES glad_glPixelTransferxOES -typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC)(GLfixed xfactor, GLfixed yfactor); -GLAPI PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; -#define glPixelZoomxOES glad_glPixelZoomxOES -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC)(GLsizei n, const GLuint* textures, const GLfixed* priorities); -GLAPI PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; -#define glPrioritizeTexturesxOES glad_glPrioritizeTexturesxOES -typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC)(GLfixed x, GLfixed y); -GLAPI PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; -#define glRasterPos2xOES glad_glRasterPos2xOES -typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; -#define glRasterPos2xvOES glad_glRasterPos2xvOES -typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; -#define glRasterPos3xOES glad_glRasterPos3xOES -typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; -#define glRasterPos3xvOES glad_glRasterPos3xvOES -typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC)(GLfixed x, GLfixed y, GLfixed z, GLfixed w); -GLAPI PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; -#define glRasterPos4xOES glad_glRasterPos4xOES -typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; -#define glRasterPos4xvOES glad_glRasterPos4xvOES -typedef void (APIENTRYP PFNGLRECTXOESPROC)(GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); -GLAPI PFNGLRECTXOESPROC glad_glRectxOES; -#define glRectxOES glad_glRectxOES -typedef void (APIENTRYP PFNGLRECTXVOESPROC)(const GLfixed* v1, const GLfixed* v2); -GLAPI PFNGLRECTXVOESPROC glad_glRectxvOES; -#define glRectxvOES glad_glRectxvOES -typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC)(GLfixed s); -GLAPI PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; -#define glTexCoord1xOES glad_glTexCoord1xOES -typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; -#define glTexCoord1xvOES glad_glTexCoord1xvOES -typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC)(GLfixed s, GLfixed t); -GLAPI PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; -#define glTexCoord2xOES glad_glTexCoord2xOES -typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; -#define glTexCoord2xvOES glad_glTexCoord2xvOES -typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC)(GLfixed s, GLfixed t, GLfixed r); -GLAPI PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; -#define glTexCoord3xOES glad_glTexCoord3xOES -typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; -#define glTexCoord3xvOES glad_glTexCoord3xvOES -typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC)(GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GLAPI PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; -#define glTexCoord4xOES glad_glTexCoord4xOES -typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; -#define glTexCoord4xvOES glad_glTexCoord4xvOES -typedef void (APIENTRYP PFNGLTEXGENXOESPROC)(GLenum coord, GLenum pname, GLfixed param); -GLAPI PFNGLTEXGENXOESPROC glad_glTexGenxOES; -#define glTexGenxOES glad_glTexGenxOES -typedef void (APIENTRYP PFNGLTEXGENXVOESPROC)(GLenum coord, GLenum pname, const GLfixed* params); -GLAPI PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; -#define glTexGenxvOES glad_glTexGenxvOES -typedef void (APIENTRYP PFNGLVERTEX2XOESPROC)(GLfixed x); -GLAPI PFNGLVERTEX2XOESPROC glad_glVertex2xOES; -#define glVertex2xOES glad_glVertex2xOES -typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; -#define glVertex2xvOES glad_glVertex2xvOES -typedef void (APIENTRYP PFNGLVERTEX3XOESPROC)(GLfixed x, GLfixed y); -GLAPI PFNGLVERTEX3XOESPROC glad_glVertex3xOES; -#define glVertex3xOES glad_glVertex3xOES -typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; -#define glVertex3xvOES glad_glVertex3xvOES -typedef void (APIENTRYP PFNGLVERTEX4XOESPROC)(GLfixed x, GLfixed y, GLfixed z); -GLAPI PFNGLVERTEX4XOESPROC glad_glVertex4xOES; -#define glVertex4xOES glad_glVertex4xOES -typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC)(const GLfixed* coords); -GLAPI PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; -#define glVertex4xvOES glad_glVertex4xvOES -#endif -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -GLAPI int GLAD_GL_NV_blend_square; -#endif -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 -GLAPI int GLAD_GL_EXT_framebuffer_multisample; -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT -#endif -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 -GLAPI int GLAD_GL_ARB_gpu_shader5; -#endif -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -GLAPI int GLAD_GL_SGIS_texture4D; -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; -#define glTexImage4DSGIS glad_glTexImage4DSGIS -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; -#define glTexSubImage4DSGIS glad_glTexSubImage4DSGIS -#endif -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -GLAPI int GLAD_GL_EXT_texture3D; -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; -#define glTexImage3DEXT glad_glTexImage3DEXT -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); -GLAPI PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; -#define glTexSubImage3DEXT glad_glTexSubImage3DEXT -#endif -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -GLAPI int GLAD_GL_EXT_multisample; -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC)(GLclampf value, GLboolean invert); -GLAPI PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; -#define glSampleMaskEXT glad_glSampleMaskEXT -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC)(GLenum pattern); -GLAPI PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; -#define glSamplePatternEXT glad_glSamplePatternEXT -#endif -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -GLAPI int GLAD_GL_EXT_secondary_color; -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC)(GLbyte red, GLbyte green, GLbyte blue); -GLAPI PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; -#define glSecondaryColor3bEXT glad_glSecondaryColor3bEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC)(const GLbyte* v); -GLAPI PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; -#define glSecondaryColor3bvEXT glad_glSecondaryColor3bvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC)(GLdouble red, GLdouble green, GLdouble blue); -GLAPI PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; -#define glSecondaryColor3dEXT glad_glSecondaryColor3dEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC)(const GLdouble* v); -GLAPI PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; -#define glSecondaryColor3dvEXT glad_glSecondaryColor3dvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC)(GLfloat red, GLfloat green, GLfloat blue); -GLAPI PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; -#define glSecondaryColor3fEXT glad_glSecondaryColor3fEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC)(const GLfloat* v); -GLAPI PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; -#define glSecondaryColor3fvEXT glad_glSecondaryColor3fvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC)(GLint red, GLint green, GLint blue); -GLAPI PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; -#define glSecondaryColor3iEXT glad_glSecondaryColor3iEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC)(const GLint* v); -GLAPI PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; -#define glSecondaryColor3ivEXT glad_glSecondaryColor3ivEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC)(GLshort red, GLshort green, GLshort blue); -GLAPI PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; -#define glSecondaryColor3sEXT glad_glSecondaryColor3sEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC)(const GLshort* v); -GLAPI PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; -#define glSecondaryColor3svEXT glad_glSecondaryColor3svEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC)(GLubyte red, GLubyte green, GLubyte blue); -GLAPI PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; -#define glSecondaryColor3ubEXT glad_glSecondaryColor3ubEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC)(const GLubyte* v); -GLAPI PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; -#define glSecondaryColor3ubvEXT glad_glSecondaryColor3ubvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC)(GLuint red, GLuint green, GLuint blue); -GLAPI PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; -#define glSecondaryColor3uiEXT glad_glSecondaryColor3uiEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC)(const GLuint* v); -GLAPI PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; -#define glSecondaryColor3uivEXT glad_glSecondaryColor3uivEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC)(GLushort red, GLushort green, GLushort blue); -GLAPI PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; -#define glSecondaryColor3usEXT glad_glSecondaryColor3usEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC)(const GLushort* v); -GLAPI PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; -#define glSecondaryColor3usvEXT glad_glSecondaryColor3usvEXT -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, const void* pointer); -GLAPI PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; -#define glSecondaryColorPointerEXT glad_glSecondaryColorPointerEXT -#endif -#ifndef GL_ARB_texture_filter_minmax -#define GL_ARB_texture_filter_minmax 1 -GLAPI int GLAD_GL_ARB_texture_filter_minmax; -#endif -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -GLAPI int GLAD_GL_ATI_vertex_array_object; -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC)(GLsizei size, const void* pointer, GLenum usage); -GLAPI PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -#define glNewObjectBufferATI glad_glNewObjectBufferATI -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -#define glIsObjectBufferATI glad_glIsObjectBufferATI -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC)(GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); -GLAPI PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -#define glUpdateObjectBufferATI glad_glUpdateObjectBufferATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC)(GLuint buffer, GLenum pname, GLfloat* params); -GLAPI PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -#define glGetObjectBufferfvATI glad_glGetObjectBufferfvATI -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC)(GLuint buffer, GLenum pname, GLint* params); -GLAPI PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -#define glGetObjectBufferivATI glad_glGetObjectBufferivATI -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC)(GLuint buffer); -GLAPI PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -#define glFreeObjectBufferATI glad_glFreeObjectBufferATI -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC)(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -#define glArrayObjectATI glad_glArrayObjectATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC)(GLenum array, GLenum pname, GLfloat* params); -GLAPI PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -#define glGetArrayObjectfvATI glad_glGetArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC)(GLenum array, GLenum pname, GLint* params); -GLAPI PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -#define glGetArrayObjectivATI glad_glGetArrayObjectivATI -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC)(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -GLAPI PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -#define glVariantArrayObjectATI glad_glVariantArrayObjectATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC)(GLuint id, GLenum pname, GLfloat* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -#define glGetVariantArrayObjectfvATI glad_glGetVariantArrayObjectfvATI -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC)(GLuint id, GLenum pname, GLint* params); -GLAPI PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -#define glGetVariantArrayObjectivATI glad_glGetVariantArrayObjectivATI -#endif -#ifndef GL_ARB_parallel_shader_compile -#define GL_ARB_parallel_shader_compile 1 -GLAPI int GLAD_GL_ARB_parallel_shader_compile; -typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC)(GLuint count); -GLAPI PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; -#define glMaxShaderCompilerThreadsARB glad_glMaxShaderCompilerThreadsARB -#endif -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -GLAPI int GLAD_GL_NVX_gpu_memory_info; -#endif -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 -GLAPI int GLAD_GL_ARB_sparse_texture; -typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -GLAPI PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; -#define glTexPageCommitmentARB glad_glTexPageCommitmentARB -#endif -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -GLAPI int GLAD_GL_SGIS_point_line_texgen; -#endif -#ifndef GL_ARB_sample_locations -#define GL_ARB_sample_locations 1 -GLAPI int GLAD_GL_ARB_sample_locations; -typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -#define glFramebufferSampleLocationsfvARB glad_glFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); -GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -#define glNamedFramebufferSampleLocationsfvARB glad_glNamedFramebufferSampleLocationsfvARB -typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC)(); -GLAPI PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -#define glEvaluateDepthValuesARB glad_glEvaluateDepthValuesARB -#endif -#ifndef GL_ARB_sparse_buffer -#define GL_ARB_sparse_buffer 1 -GLAPI int GLAD_GL_ARB_sparse_buffer; -typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC)(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; -#define glBufferPageCommitmentARB glad_glBufferPageCommitmentARB -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; -#define glNamedBufferPageCommitmentEXT glad_glNamedBufferPageCommitmentEXT -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); -GLAPI PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; -#define glNamedBufferPageCommitmentARB glad_glNamedBufferPageCommitmentARB -#endif -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -GLAPI int GLAD_GL_EXT_draw_range_elements; -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void* indices); -GLAPI PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; -#define glDrawRangeElementsEXT glad_glDrawRangeElementsEXT -#endif -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -GLAPI int GLAD_GL_SGIX_blend_alpha_minmax; -#endif -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -GLAPI int GLAD_GL_KHR_context_flush_control; -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// IMPLEMENTATION SECTION -// - -#ifdef GLAD_IMPLEMENTATION - -#include -#include -#include - -struct gladGLversionStruct GLVersion; - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define _GLAD_IS_SOME_NEW_VERSION 1 -#endif - -static int max_loaded_major; -static int max_loaded_minor; - -static const char *exts = NULL; -static int num_exts_i = 0; -static const char **exts_i = NULL; - -static int get_exts(void) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - exts = (const char *)glGetString(GL_EXTENSIONS); -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - num_exts_i = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); - if (num_exts_i > 0) { - exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); - } - - if (exts_i == NULL) { - return 0; - } - - for(index = 0; index < num_exts_i; index++) { - exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); - } - } -#endif - return 1; -} - -static void free_exts(void) { - if (exts_i != NULL) { - free(exts_i); - exts_i = NULL; - } -} - -static int has_ext(const char *ext) { -#ifdef _GLAD_IS_SOME_NEW_VERSION - if(max_loaded_major < 3) { -#endif - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } -#ifdef _GLAD_IS_SOME_NEW_VERSION - } else { - int index; - - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - - if(strcmp(e, ext) == 0) { - return 1; - } - } - } -#endif - - return 0; -} -int GLAD_GL_VERSION_1_0; -int GLAD_GL_VERSION_1_1; -int GLAD_GL_VERSION_1_2; -int GLAD_GL_VERSION_1_3; -int GLAD_GL_VERSION_1_4; -int GLAD_GL_VERSION_1_5; -int GLAD_GL_VERSION_2_0; -int GLAD_GL_VERSION_2_1; -int GLAD_GL_VERSION_3_0; -int GLAD_GL_VERSION_3_1; -int GLAD_GL_VERSION_3_2; -int GLAD_GL_VERSION_3_3; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -PFNGLBINDSAMPLERPROC glad_glBindSampler; -PFNGLLINEWIDTHPROC glad_glLineWidth; -PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -PFNGLCOMPILESHADERPROC glad_glCompileShader; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -PFNGLENABLEIPROC glad_glEnablei; -PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -PFNGLCREATESHADERPROC glad_glCreateShader; -PFNGLISBUFFERPROC glad_glIsBuffer; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -PFNGLHINTPROC glad_glHint; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -PFNGLPOINTSIZEPROC glad_glPointSize; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -PFNGLWAITSYNCPROC glad_glWaitSync; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -PFNGLUNIFORM3IPROC glad_glUniform3i; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -PFNGLUNIFORM3FPROC glad_glUniform3f; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -PFNGLCOLORMASKIPROC glad_glColorMaski; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -PFNGLDRAWARRAYSPROC glad_glDrawArrays; -PFNGLUNIFORM1UIPROC glad_glUniform1ui; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -PFNGLCLEARPROC glad_glClear; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -PFNGLISENABLEDPROC glad_glIsEnabled; -PFNGLSTENCILOPPROC glad_glStencilOp; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -PFNGLGETQUERYIVPROC glad_glGetQueryiv; -PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -PFNGLISSHADERPROC glad_glIsShader; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -PFNGLENABLEPROC glad_glEnable; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -PFNGLFLUSHPROC glad_glFlush; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -PFNGLFENCESYNCPROC glad_glFenceSync; -PFNGLCOLORP3UIPROC glad_glColorP3ui; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -PFNGLGENSAMPLERSPROC glad_glGenSamplers; -PFNGLCLAMPCOLORPROC glad_glClampColor; -PFNGLUNIFORM4IVPROC glad_glUniform4iv; -PFNGLCLEARSTENCILPROC glad_glClearStencil; -PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -PFNGLGENTEXTURESPROC glad_glGenTextures; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -PFNGLISSYNCPROC glad_glIsSync; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -PFNGLUNIFORM2IPROC glad_glUniform2i; -PFNGLUNIFORM2FPROC glad_glUniform2f; -PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -PFNGLGENQUERIESPROC glad_glGenQueries; -PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -PFNGLISENABLEDIPROC glad_glIsEnabledi; -PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -PFNGLUNIFORM2IVPROC glad_glUniform2iv; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -PFNGLGETSHADERIVPROC glad_glGetShaderiv; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -PFNGLGETDOUBLEVPROC glad_glGetDoublev; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -PFNGLUNIFORM3FVPROC glad_glUniform3fv; -PFNGLDEPTHRANGEPROC glad_glDepthRange; -PFNGLMAPBUFFERPROC glad_glMapBuffer; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -PFNGLDELETESYNCPROC glad_glDeleteSync; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -PFNGLUNIFORM3IVPROC glad_glUniform3iv; -PFNGLPOLYGONMODEPROC glad_glPolygonMode; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -PFNGLUSEPROGRAMPROC glad_glUseProgram; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -PFNGLFINISHPROC glad_glFinish; -PFNGLDELETESHADERPROC glad_glDeleteShader; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -PFNGLVIEWPORTPROC glad_glViewport; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -PFNGLUNIFORM2UIPROC glad_glUniform2ui; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -PFNGLCLEARDEPTHPROC glad_glClearDepth; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -PFNGLTEXBUFFERPROC glad_glTexBuffer; -PFNGLPIXELSTOREIPROC glad_glPixelStorei; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -PFNGLPIXELSTOREFPROC glad_glPixelStoref; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -PFNGLLINKPROGRAMPROC glad_glLinkProgram; -PFNGLBINDTEXTUREPROC glad_glBindTexture; -PFNGLGETSTRINGPROC glad_glGetString; -PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -PFNGLDETACHSHADERPROC glad_glDetachShader; -PFNGLENDQUERYPROC glad_glEndQuery; -PFNGLNORMALP3UIPROC glad_glNormalP3ui; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -PFNGLUNIFORM1FPROC glad_glUniform1f; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -PFNGLUNIFORM1IPROC glad_glUniform1i; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -PFNGLDISABLEPROC glad_glDisable; -PFNGLLOGICOPPROC glad_glLogicOp; -PFNGLUNIFORM4UIPROC glad_glUniform4ui; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -PFNGLCULLFACEPROC glad_glCullFace; -PFNGLGETSTRINGIPROC glad_glGetStringi; -PFNGLATTACHSHADERPROC glad_glAttachShader; -PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -PFNGLDRAWELEMENTSPROC glad_glDrawElements; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -PFNGLUNIFORM1IVPROC glad_glUniform1iv; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -PFNGLREADBUFFERPROC glad_glReadBuffer; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -PFNGLBLENDCOLORPROC glad_glBlendColor; -PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -PFNGLISPROGRAMPROC glad_glIsProgram; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -PFNGLUNIFORM4IPROC glad_glUniform4i; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -PFNGLREADPIXELSPROC glad_glReadPixels; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -PFNGLUNIFORM4FPROC glad_glUniform4f; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -PFNGLSTENCILFUNCPROC glad_glStencilFunc; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -PFNGLCOLORP4UIPROC glad_glColorP4ui; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -PFNGLGENBUFFERSPROC glad_glGenBuffers; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -PFNGLBLENDFUNCPROC glad_glBlendFunc; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -PFNGLSCISSORPROC glad_glScissor; -PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -PFNGLCLEARCOLORPROC glad_glClearColor; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -PFNGLUNIFORM3UIPROC glad_glUniform3ui; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -PFNGLUNIFORM2FVPROC glad_glUniform2fv; -PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -PFNGLDEPTHFUNCPROC glad_glDepthFunc; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -PFNGLCOLORMASKPROC glad_glColorMask; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -PFNGLUNIFORM4FVPROC glad_glUniform4fv; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -PFNGLISSAMPLERPROC glad_glIsSampler; -PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -PFNGLDISABLEIPROC glad_glDisablei; -PFNGLSHADERSOURCEPROC glad_glShaderSource; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -PFNGLGETSYNCIVPROC glad_glGetSynciv; -PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -PFNGLBEGINQUERYPROC glad_glBeginQuery; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -PFNGLBINDBUFFERPROC glad_glBindBuffer; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -PFNGLBUFFERDATAPROC glad_glBufferData; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -PFNGLGETERRORPROC glad_glGetError; -PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -PFNGLGETFLOATVPROC glad_glGetFloatv; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -PFNGLGETINTEGERVPROC glad_glGetIntegerv; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -PFNGLISQUERYPROC glad_glIsQuery; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -PFNGLSTENCILMASKPROC glad_glStencilMask; -PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -PFNGLISTEXTUREPROC glad_glIsTexture; -PFNGLUNIFORM1FVPROC glad_glUniform1fv; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -PFNGLDEPTHMASKPROC glad_glDepthMask; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -PFNGLFRONTFACEPROC glad_glFrontFace; -int GLAD_GL_SGIX_pixel_tiles; -int GLAD_GL_NV_point_sprite; -int GLAD_GL_APPLE_element_array; -int GLAD_GL_AMD_multi_draw_indirect; -int GLAD_GL_EXT_blend_subtract; -int GLAD_GL_SGIX_tag_sample_buffer; -int GLAD_GL_IBM_texture_mirrored_repeat; -int GLAD_GL_APPLE_transform_hint; -int GLAD_GL_ATI_separate_stencil; -int GLAD_GL_NV_shader_atomic_int64; -int GLAD_GL_NV_vertex_program2_option; -int GLAD_GL_EXT_texture_buffer_object; -int GLAD_GL_ARB_vertex_blend; -int GLAD_GL_OVR_multiview; -int GLAD_GL_ARB_program_interface_query; -int GLAD_GL_EXT_misc_attribute; -int GLAD_GL_NV_multisample_coverage; -int GLAD_GL_ARB_shading_language_packing; -int GLAD_GL_EXT_texture_cube_map; -int GLAD_GL_NV_viewport_array2; -int GLAD_GL_KHR_robustness; -int GLAD_GL_EXT_index_func; -int GLAD_GL_OES_compressed_paletted_texture; -int GLAD_GL_NV_depth_clamp; -int GLAD_GL_NV_shader_buffer_load; -int GLAD_GL_EXT_color_subtable; -int GLAD_GL_SUNX_constant_data; -int GLAD_GL_EXT_multi_draw_arrays; -int GLAD_GL_ARB_shader_atomic_counters; -int GLAD_GL_ARB_arrays_of_arrays; -int GLAD_GL_NV_conditional_render; -int GLAD_GL_EXT_texture_env_combine; -int GLAD_GL_AMD_depth_clamp_separate; -int GLAD_GL_SGIX_async_histogram; -int GLAD_GL_MESA_resize_buffers; -int GLAD_GL_ARB_sample_shading; -int GLAD_GL_NV_texture_env_combine4; -int GLAD_GL_ARB_texture_view; -int GLAD_GL_ARB_texture_env_combine; -int GLAD_GL_ARB_map_buffer_range; -int GLAD_GL_EXT_convolution; -int GLAD_GL_NV_compute_program5; -int GLAD_GL_EXT_paletted_texture; -int GLAD_GL_ARB_texture_buffer_object; -int GLAD_GL_SUN_triangle_list; -int GLAD_GL_SGIX_resample; -int GLAD_GL_SGIX_flush_raster; -int GLAD_GL_EXT_light_texture; -int GLAD_GL_ARB_point_sprite; -int GLAD_GL_ARB_sparse_texture2; -int GLAD_GL_ARB_half_float_pixel; -int GLAD_GL_NV_tessellation_program5; -int GLAD_GL_REND_screen_coordinates; -int GLAD_GL_HP_image_transform; -int GLAD_GL_EXT_packed_float; -int GLAD_GL_ATI_vertex_attrib_array_object; -int GLAD_GL_SGIX_vertex_preclip; -int GLAD_GL_SGIX_texture_scale_bias; -int GLAD_GL_AMD_draw_buffers_blend; -int GLAD_GL_APPLE_texture_range; -int GLAD_GL_SGIX_framezoom; -int GLAD_GL_NV_texture_barrier; -int GLAD_GL_ARB_texture_query_levels; -int GLAD_GL_EXT_blend_logic_op; -int GLAD_GL_EXT_texture_swizzle; -int GLAD_GL_ARB_texture_rg; -int GLAD_GL_ARB_vertex_type_2_10_10_10_rev; -int GLAD_GL_ARB_fragment_shader; -int GLAD_GL_3DFX_tbuffer; -int GLAD_GL_SGIX_ycrcb; -int GLAD_GL_IBM_cull_vertex; -int GLAD_GL_EXT_separate_shader_objects; -int GLAD_GL_NV_texture_multisample; -int GLAD_GL_ARB_shader_objects; -int GLAD_GL_ARB_framebuffer_object; -int GLAD_GL_ATI_envmap_bumpmap; -int GLAD_GL_ARB_robust_buffer_access_behavior; -int GLAD_GL_ARB_shader_stencil_export; -int GLAD_GL_AMD_sample_positions; -int GLAD_GL_ARB_enhanced_layouts; -int GLAD_GL_ARB_texture_rectangle; -int GLAD_GL_SGI_texture_color_table; -int GLAD_GL_ATI_map_object_buffer; -int GLAD_GL_ARB_robustness; -int GLAD_GL_NV_pixel_data_range; -int GLAD_GL_EXT_framebuffer_blit; -int GLAD_GL_ARB_gpu_shader_fp64; -int GLAD_GL_NV_command_list; -int GLAD_GL_ARB_window_pos; -int GLAD_GL_ARB_robustness_isolation; -int GLAD_GL_GREMEDY_string_marker; -int GLAD_GL_ARB_texture_compression_bptc; -int GLAD_GL_EXT_subtexture; -int GLAD_GL_EXT_pixel_transform_color_table; -int GLAD_GL_EXT_texture_compression_rgtc; -int GLAD_GL_ARB_shadow; -int GLAD_GL_SGIX_depth_pass_instrument; -int GLAD_GL_NVX_conditional_render; -int GLAD_GL_NV_evaluators; -int GLAD_GL_SGIS_texture_filter4; -int GLAD_GL_AMD_performance_monitor; -int GLAD_GL_NV_geometry_shader4; -int GLAD_GL_EXT_stencil_clear_tag; -int GLAD_GL_NV_vertex_program1_1; -int GLAD_GL_NV_present_video; -int GLAD_GL_ARB_texture_compression_rgtc; -int GLAD_GL_ARB_texture_filter_minmax; -int GLAD_GL_HP_convolution_border_modes; -int GLAD_GL_EXT_gpu_program_parameters; -int GLAD_GL_SGIX_list_priority; -int GLAD_GL_ARB_stencil_texturing; -int GLAD_GL_ARB_shader_clock; -int GLAD_GL_NV_shader_atomic_fp16_vector; -int GLAD_GL_SGIX_fog_offset; -int GLAD_GL_ARB_draw_elements_base_vertex; -int GLAD_GL_INGR_interlace_read; -int GLAD_GL_NV_transform_feedback; -int GLAD_GL_EXT_post_depth_coverage; -int GLAD_GL_ARB_debug_output; -int GLAD_GL_AMD_stencil_operation_extended; -int GLAD_GL_ARB_compatibility; -int GLAD_GL_ARB_instanced_arrays; -int GLAD_GL_ARB_get_texture_sub_image; -int GLAD_GL_NV_vertex_array_range2; -int GLAD_GL_ARB_texture_stencil8; -int GLAD_GL_AMD_sparse_texture; -int GLAD_GL_ARB_clip_control; -int GLAD_GL_NV_fragment_coverage_to_color; -int GLAD_GL_NV_fence; -int GLAD_GL_ARB_texture_buffer_range; -int GLAD_GL_SUN_mesh_array; -int GLAD_GL_ARB_vertex_attrib_binding; -int GLAD_GL_EXT_texture_compression_s3tc; -int GLAD_GL_ARB_cl_event; -int GLAD_GL_ARB_derivative_control; -int GLAD_GL_NV_packed_depth_stencil; -int GLAD_GL_OES_single_precision; -int GLAD_GL_NV_primitive_restart; -int GLAD_GL_ARB_fragment_shader_interlock; -int GLAD_GL_EXT_texture_object; -int GLAD_GL_AMD_name_gen_delete; -int GLAD_GL_NV_texture_compression_vtc; -int GLAD_GL_NV_sample_mask_override_coverage; -int GLAD_GL_NV_texture_shader3; -int GLAD_GL_NV_texture_shader2; -int GLAD_GL_EXT_texture; -int GLAD_GL_ARB_buffer_storage; -int GLAD_GL_AMD_shader_atomic_counter_ops; -int GLAD_GL_APPLE_vertex_program_evaluators; -int GLAD_GL_ARB_multi_bind; -int GLAD_GL_ARB_explicit_uniform_location; -int GLAD_GL_ARB_depth_buffer_float; -int GLAD_GL_NV_path_rendering_shared_edge; -int GLAD_GL_SGIX_shadow_ambient; -int GLAD_GL_ARB_texture_cube_map; -int GLAD_GL_AMD_vertex_shader_viewport_index; -int GLAD_GL_EXT_shader_integer_mix; -int GLAD_GL_NV_vertex_buffer_unified_memory; -int GLAD_GL_EXT_fog_coord; -int GLAD_GL_EXT_texture_env_dot3; -int GLAD_GL_ATI_texture_env_combine3; -int GLAD_GL_ARB_map_buffer_alignment; -int GLAD_GL_NV_blend_equation_advanced; -int GLAD_GL_SGIS_sharpen_texture; -int GLAD_GL_KHR_robust_buffer_access_behavior; -int GLAD_GL_ARB_pipeline_statistics_query; -int GLAD_GL_ARB_vertex_program; -int GLAD_GL_ARB_texture_rgb10_a2ui; -int GLAD_GL_OML_interlace; -int GLAD_GL_ATI_pixel_format_float; -int GLAD_GL_ARB_vertex_buffer_object; -int GLAD_GL_EXT_shadow_funcs; -int GLAD_GL_ATI_text_fragment_shader; -int GLAD_GL_NV_vertex_array_range; -int GLAD_GL_SGIX_fragment_lighting; -int GLAD_GL_NV_texture_expand_normal; -int GLAD_GL_NV_framebuffer_multisample_coverage; -int GLAD_GL_ARB_framebuffer_no_attachments; -int GLAD_GL_EXT_timer_query; -int GLAD_GL_EXT_vertex_array_bgra; -int GLAD_GL_NV_bindless_texture; -int GLAD_GL_KHR_debug; -int GLAD_GL_SGIS_texture_border_clamp; -int GLAD_GL_OML_subsample; -int GLAD_GL_SGIX_clipmap; -int GLAD_GL_EXT_geometry_shader4; -int GLAD_GL_ARB_shader_texture_image_samples; -int GLAD_GL_MESA_ycbcr_texture; -int GLAD_GL_MESAX_texture_stack; -int GLAD_GL_AMD_seamless_cubemap_per_texture; -int GLAD_GL_EXT_bindable_uniform; -int GLAD_GL_KHR_texture_compression_astc_hdr; -int GLAD_GL_ARB_shader_ballot; -int GLAD_GL_KHR_blend_equation_advanced; -int GLAD_GL_ARB_fragment_program_shadow; -int GLAD_GL_ATI_element_array; -int GLAD_GL_ARB_sparse_texture_clamp; -int GLAD_GL_AMD_texture_texture4; -int GLAD_GL_SGIX_reference_plane; -int GLAD_GL_EXT_stencil_two_side; -int GLAD_GL_ARB_transform_feedback_overflow_query; -int GLAD_GL_SGIX_texture_lod_bias; -int GLAD_GL_KHR_no_error; -int GLAD_GL_NV_explicit_multisample; -int GLAD_GL_IBM_static_data; -int GLAD_GL_EXT_clip_volume_hint; -int GLAD_GL_EXT_texture_perturb_normal; -int GLAD_GL_NV_fragment_program2; -int GLAD_GL_NV_fragment_program4; -int GLAD_GL_EXT_point_parameters; -int GLAD_GL_PGI_misc_hints; -int GLAD_GL_SGIX_subsample; -int GLAD_GL_AMD_shader_stencil_export; -int GLAD_GL_ARB_shader_texture_lod; -int GLAD_GL_ARB_vertex_shader; -int GLAD_GL_ARB_depth_clamp; -int GLAD_GL_SGIS_texture_select; -int GLAD_GL_NV_texture_shader; -int GLAD_GL_ARB_tessellation_shader; -int GLAD_GL_EXT_draw_buffers2; -int GLAD_GL_ARB_vertex_attrib_64bit; -int GLAD_GL_EXT_texture_filter_minmax; -int GLAD_GL_ARB_texture_gather; -int GLAD_GL_AMD_interleaved_elements; -int GLAD_GL_ARB_fragment_program; -int GLAD_GL_OML_resample; -int GLAD_GL_APPLE_ycbcr_422; -int GLAD_GL_SGIX_texture_add_env; -int GLAD_GL_ARB_shadow_ambient; -int GLAD_GL_ARB_texture_storage; -int GLAD_GL_EXT_pixel_buffer_object; -int GLAD_GL_NV_vertex_program; -int GLAD_GL_SGIS_pixel_texture; -int GLAD_GL_SGIS_generate_mipmap; -int GLAD_GL_SGIX_instruments; -int GLAD_GL_ARB_fragment_layer_viewport; -int GLAD_GL_ARB_shader_storage_buffer_object; -int GLAD_GL_EXT_sparse_texture2; -int GLAD_GL_EXT_blend_minmax; -int GLAD_GL_MESA_pack_invert; -int GLAD_GL_ARB_base_instance; -int GLAD_GL_SUN_global_alpha; -int GLAD_GL_PGI_vertex_hints; -int GLAD_GL_AMD_transform_feedback4; -int GLAD_GL_ARB_ES3_1_compatibility; -int GLAD_GL_EXT_texture_integer; -int GLAD_GL_ARB_texture_multisample; -int GLAD_GL_AMD_gpu_shader_int64; -int GLAD_GL_S3_s3tc; -int GLAD_GL_ARB_query_buffer_object; -int GLAD_GL_AMD_vertex_shader_tessellator; -int GLAD_GL_ARB_invalidate_subdata; -int GLAD_GL_ARB_draw_indirect; -int GLAD_GL_ARB_transform_feedback2; -int GLAD_GL_EXT_index_material; -int GLAD_GL_NV_blend_equation_advanced_coherent; -int GLAD_GL_ARB_texture_non_power_of_two; -int GLAD_GL_KHR_texture_compression_astc_sliced_3d; -int GLAD_GL_ATI_draw_buffers; -int GLAD_GL_EXT_cmyka; -int GLAD_GL_SGIX_pixel_texture; -int GLAD_GL_APPLE_specular_vector; -int GLAD_GL_ARB_seamless_cubemap_per_texture; -int GLAD_GL_ARB_conservative_depth; -int GLAD_GL_SGIX_interlace; -int GLAD_GL_NV_parameter_buffer_object; -int GLAD_GL_AMD_shader_trinary_minmax; -int GLAD_GL_EXT_texture_lod_bias; -int GLAD_GL_EXT_rescale_normal; -int GLAD_GL_ARB_pixel_buffer_object; -int GLAD_GL_ARB_uniform_buffer_object; -int GLAD_GL_ARB_vertex_type_10f_11f_11f_rev; -int GLAD_GL_ARB_texture_swizzle; -int GLAD_GL_ARB_texture_compression; -int GLAD_GL_SGIX_async_pixel; -int GLAD_GL_NV_fragment_program_option; -int GLAD_GL_ARB_explicit_attrib_location; -int GLAD_GL_EXT_blend_color; -int GLAD_GL_NV_shader_thread_group; -int GLAD_GL_EXT_stencil_wrap; -int GLAD_GL_EXT_index_array_formats; -int GLAD_GL_OVR_multiview2; -int GLAD_GL_EXT_histogram; -int GLAD_GL_EXT_polygon_offset; -int GLAD_GL_SGIS_point_parameters; -int GLAD_GL_EXT_direct_state_access; -int GLAD_GL_ARB_shader_group_vote; -int GLAD_GL_NV_texture_rectangle; -int GLAD_GL_ARB_copy_image; -int GLAD_GL_NV_shader_thread_shuffle; -int GLAD_GL_ARB_shader_precision; -int GLAD_GL_EXT_vertex_shader; -int GLAD_GL_EXT_blend_func_separate; -int GLAD_GL_APPLE_fence; -int GLAD_GL_OES_byte_coordinates; -int GLAD_GL_ARB_transpose_matrix; -int GLAD_GL_ARB_provoking_vertex; -int GLAD_GL_NV_uniform_buffer_unified_memory; -int GLAD_GL_NV_fragment_shader_interlock; -int GLAD_GL_EXT_vertex_array; -int GLAD_GL_ARB_half_float_vertex; -int GLAD_GL_EXT_blend_equation_separate; -int GLAD_GL_NV_framebuffer_mixed_samples; -int GLAD_GL_ARB_multi_draw_indirect; -int GLAD_GL_EXT_raster_multisample; -int GLAD_GL_NV_copy_image; -int GLAD_GL_NV_geometry_shader_passthrough; -int GLAD_GL_INTEL_framebuffer_CMAA; -int GLAD_GL_SGIX_convolution_accuracy; -int GLAD_GL_ARB_transform_feedback3; -int GLAD_GL_SGIX_ycrcba; -int GLAD_GL_EXT_debug_marker; -int GLAD_GL_EXT_bgra; -int GLAD_GL_INTEL_parallel_arrays; -int GLAD_GL_EXT_pixel_transform; -int GLAD_GL_NV_vertex_attrib_integer_64bit; -int GLAD_GL_ATI_fragment_shader; -int GLAD_GL_ARB_vertex_array_object; -int GLAD_GL_ATI_pn_triangles; -int GLAD_GL_EXT_texture_env_add; -int GLAD_GL_EXT_packed_depth_stencil; -int GLAD_GL_EXT_texture_mirror_clamp; -int GLAD_GL_NV_multisample_filter_hint; -int GLAD_GL_INTEL_performance_query; -int GLAD_GL_ARB_transform_feedback_instanced; -int GLAD_GL_SGIX_async; -int GLAD_GL_EXT_texture_compression_latc; -int GLAD_GL_NV_shader_atomic_float; -int GLAD_GL_ARB_shading_language_100; -int GLAD_GL_APPLE_float_pixels; -int GLAD_GL_ARB_texture_mirror_clamp_to_edge; -int GLAD_GL_NV_vertex_program2; -int GLAD_GL_NV_bindless_multi_draw_indirect_count; -int GLAD_GL_ARB_depth_texture; -int GLAD_GL_ARB_ES2_compatibility; -int GLAD_GL_ARB_indirect_parameters; -int GLAD_GL_NV_half_float; -int GLAD_GL_ARB_ES3_2_compatibility; -int GLAD_GL_ATI_texture_mirror_once; -int GLAD_GL_IBM_rasterpos_clip; -int GLAD_GL_SGIX_shadow; -int GLAD_GL_EXT_polygon_offset_clamp; -int GLAD_GL_NV_deep_texture3D; -int GLAD_GL_ARB_shader_draw_parameters; -int GLAD_GL_SGIX_calligraphic_fragment; -int GLAD_GL_ARB_shader_bit_encoding; -int GLAD_GL_EXT_compiled_vertex_array; -int GLAD_GL_NV_depth_buffer_float; -int GLAD_GL_APPLE_flush_buffer_range; -int GLAD_GL_ARB_imaging; -int GLAD_GL_ARB_draw_buffers_blend; -int GLAD_GL_AMD_gcn_shader; -int GLAD_GL_AMD_blend_minmax_factor; -int GLAD_GL_EXT_texture_sRGB_decode; -int GLAD_GL_ARB_shading_language_420pack; -int GLAD_GL_ARB_shader_viewport_layer_array; -int GLAD_GL_ATI_meminfo; -int GLAD_GL_EXT_abgr; -int GLAD_GL_AMD_pinned_memory; -int GLAD_GL_EXT_texture_snorm; -int GLAD_GL_SGIX_texture_coordinate_clamp; -int GLAD_GL_ARB_clear_buffer_object; -int GLAD_GL_ARB_multisample; -int GLAD_GL_EXT_debug_label; -int GLAD_GL_NV_light_max_exponent; -int GLAD_GL_NV_internalformat_sample_query; -int GLAD_GL_INTEL_map_texture; -int GLAD_GL_ARB_texture_env_crossbar; -int GLAD_GL_EXT_422_pixels; -int GLAD_GL_ARB_compute_shader; -int GLAD_GL_NV_texgen_emboss; -int GLAD_GL_ARB_blend_func_extended; -int GLAD_GL_IBM_vertex_array_lists; -int GLAD_GL_ARB_color_buffer_float; -int GLAD_GL_ARB_bindless_texture; -int GLAD_GL_SGIX_depth_texture; -int GLAD_GL_ARB_internalformat_query; -int GLAD_GL_ARB_shader_atomic_counter_ops; -int GLAD_GL_ARB_texture_mirrored_repeat; -int GLAD_GL_EXT_shader_image_load_store; -int GLAD_GL_EXT_copy_texture; -int GLAD_GL_NV_register_combiners2; -int GLAD_GL_SGIX_ycrcb_subsample; -int GLAD_GL_ARB_copy_buffer; -int GLAD_GL_NV_draw_texture; -int GLAD_GL_EXT_texture_shared_exponent; -int GLAD_GL_EXT_draw_instanced; -int GLAD_GL_NV_copy_depth_to_color; -int GLAD_GL_ARB_viewport_array; -int GLAD_GL_ARB_separate_shader_objects; -int GLAD_GL_EXT_multisample; -int GLAD_GL_EXT_depth_bounds_test; -int GLAD_GL_EXT_shared_texture_palette; -int GLAD_GL_ARB_texture_env_add; -int GLAD_GL_NV_video_capture; -int GLAD_GL_ARB_sampler_objects; -int GLAD_GL_ARB_matrix_palette; -int GLAD_GL_SGIS_texture_color_mask; -int GLAD_GL_EXT_packed_pixels; -int GLAD_GL_EXT_coordinate_frame; -int GLAD_GL_NV_transform_feedback2; -int GLAD_GL_APPLE_aux_depth_stencil; -int GLAD_GL_ARB_shader_subroutine; -int GLAD_GL_EXT_framebuffer_sRGB; -int GLAD_GL_ARB_texture_storage_multisample; -int GLAD_GL_KHR_blend_equation_advanced_coherent; -int GLAD_GL_EXT_vertex_attrib_64bit; -int GLAD_GL_HP_texture_lighting; -int GLAD_GL_NV_shader_buffer_store; -int GLAD_GL_OES_query_matrix; -int GLAD_GL_MESA_window_pos; -int GLAD_GL_NV_fill_rectangle; -int GLAD_GL_NV_shader_storage_buffer_object; -int GLAD_GL_ARB_texture_query_lod; -int GLAD_GL_SGIX_ir_instrument1; -int GLAD_GL_ARB_shader_image_size; -int GLAD_GL_NV_shader_atomic_counters; -int GLAD_GL_APPLE_object_purgeable; -int GLAD_GL_ARB_occlusion_query; -int GLAD_GL_INGR_color_clamp; -int GLAD_GL_SGI_color_table; -int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; -int GLAD_GL_ARB_texture_cube_map_array; -int GLAD_GL_AMD_debug_output; -int GLAD_GL_EXT_gpu_shader4; -int GLAD_GL_NV_geometry_program4; -int GLAD_GL_NV_gpu_program5_mem_extended; -int GLAD_GL_SGIX_scalebias_hint; -int GLAD_GL_ARB_texture_border_clamp; -int GLAD_GL_ARB_fragment_coord_conventions; -int GLAD_GL_SGIX_polynomial_ffd; -int GLAD_GL_EXT_provoking_vertex; -int GLAD_GL_ARB_point_parameters; -int GLAD_GL_ARB_shader_image_load_store; -int GLAD_GL_ARB_conditional_render_inverted; -int GLAD_GL_HP_occlusion_test; -int GLAD_GL_ARB_ES3_compatibility; -int GLAD_GL_EXT_texture_array; -int GLAD_GL_ARB_texture_buffer_object_rgb32; -int GLAD_GL_NV_bindless_multi_draw_indirect; -int GLAD_GL_SGIX_texture_multi_buffer; -int GLAD_GL_EXT_transform_feedback; -int GLAD_GL_KHR_texture_compression_astc_ldr; -int GLAD_GL_3DFX_multisample; -int GLAD_GL_INTEL_fragment_shader_ordering; -int GLAD_GL_ARB_texture_env_dot3; -int GLAD_GL_NV_gpu_program4; -int GLAD_GL_NV_gpu_program5; -int GLAD_GL_NV_float_buffer; -int GLAD_GL_SGIS_texture_edge_clamp; -int GLAD_GL_ARB_framebuffer_sRGB; -int GLAD_GL_SUN_slice_accum; -int GLAD_GL_EXT_index_texture; -int GLAD_GL_EXT_shader_image_load_formatted; -int GLAD_GL_ARB_geometry_shader4; -int GLAD_GL_EXT_separate_specular_color; -int GLAD_GL_NV_fog_distance; -int GLAD_GL_NV_conservative_raster; -int GLAD_GL_SUN_convolution_border_modes; -int GLAD_GL_SGIX_sprite; -int GLAD_GL_ARB_get_program_binary; -int GLAD_GL_ARB_timer_query; -int GLAD_GL_AMD_occlusion_query_event; -int GLAD_GL_SGIS_multisample; -int GLAD_GL_EXT_framebuffer_object; -int GLAD_GL_EXT_vertex_weighting; -int GLAD_GL_ARB_vertex_array_bgra; -int GLAD_GL_APPLE_vertex_array_range; -int GLAD_GL_AMD_query_buffer_object; -int GLAD_GL_NV_register_combiners; -int GLAD_GL_ARB_draw_buffers; -int GLAD_GL_ARB_clear_texture; -int GLAD_GL_NV_fragment_program; -int GLAD_GL_SGI_color_matrix; -int GLAD_GL_EXT_cull_vertex; -int GLAD_GL_EXT_texture_sRGB; -int GLAD_GL_APPLE_row_bytes; -int GLAD_GL_NV_texgen_reflection; -int GLAD_GL_IBM_multimode_draw_arrays; -int GLAD_GL_APPLE_vertex_array_object; -int GLAD_GL_3DFX_texture_compression_FXT1; -int GLAD_GL_GREMEDY_frame_terminator; -int GLAD_GL_AMD_conservative_depth; -int GLAD_GL_ARB_texture_float; -int GLAD_GL_ARB_compressed_texture_pixel_storage; -int GLAD_GL_SGIS_detail_texture; -int GLAD_GL_ARB_draw_instanced; -int GLAD_GL_OES_read_format; -int GLAD_GL_ATI_texture_float; -int GLAD_GL_WIN_specular_fog; -int GLAD_GL_AMD_vertex_shader_layer; -int GLAD_GL_ARB_shading_language_include; -int GLAD_GL_APPLE_client_storage; -int GLAD_GL_WIN_phong_shading; -int GLAD_GL_INGR_blend_func_separate; -int GLAD_GL_NV_path_rendering; -int GLAD_GL_NV_conservative_raster_dilate; -int GLAD_GL_ARB_texture_barrier; -int GLAD_GL_ATI_vertex_streams; -int GLAD_GL_ARB_post_depth_coverage; -int GLAD_GL_NV_occlusion_query; -int GLAD_GL_APPLE_rgb_422; -int GLAD_GL_ARB_direct_state_access; -int GLAD_GL_ARB_gpu_shader_int64; -int GLAD_GL_ARB_seamless_cube_map; -int GLAD_GL_ARB_cull_distance; -int GLAD_GL_NV_vdpau_interop; -int GLAD_GL_ARB_occlusion_query2; -int GLAD_GL_ARB_internalformat_query2; -int GLAD_GL_EXT_texture_filter_anisotropic; -int GLAD_GL_SUN_vertex; -int GLAD_GL_ARB_sparse_texture; -int GLAD_GL_SGIS_texture_lod; -int GLAD_GL_NV_vertex_program3; -int GLAD_GL_NV_gpu_shader5; -int GLAD_GL_NV_vertex_program4; -int GLAD_GL_AMD_transform_feedback3_lines_triangles; -int GLAD_GL_SGIS_fog_function; -int GLAD_GL_EXT_x11_sync_object; -int GLAD_GL_ARB_sync; -int GLAD_GL_NV_sample_locations; -int GLAD_GL_ARB_compute_variable_group_size; -int GLAD_GL_OES_fixed_point; -int GLAD_GL_NV_blend_square; -int GLAD_GL_EXT_framebuffer_multisample; -int GLAD_GL_ARB_gpu_shader5; -int GLAD_GL_SGIS_texture4D; -int GLAD_GL_EXT_texture3D; -int GLAD_GL_ARB_multitexture; -int GLAD_GL_EXT_secondary_color; -int GLAD_GL_NV_parameter_buffer_object2; -int GLAD_GL_ATI_vertex_array_object; -int GLAD_GL_ARB_parallel_shader_compile; -int GLAD_GL_NVX_gpu_memory_info; -int GLAD_GL_SGIX_igloo_interface; -int GLAD_GL_SGIS_point_line_texgen; -int GLAD_GL_ARB_sample_locations; -int GLAD_GL_ARB_sparse_buffer; -int GLAD_GL_EXT_draw_range_elements; -int GLAD_GL_SGIX_blend_alpha_minmax; -int GLAD_GL_KHR_context_flush_control; -PFNGLELEMENTPOINTERAPPLEPROC glad_glElementPointerAPPLE; -PFNGLDRAWELEMENTARRAYAPPLEPROC glad_glDrawElementArrayAPPLE; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC glad_glDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC glad_glMultiDrawElementArrayAPPLE; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC glad_glMultiDrawRangeElementArrayAPPLE; -PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC glad_glMultiDrawArraysIndirectAMD; -PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC glad_glMultiDrawElementsIndirectAMD; -PFNGLTAGSAMPLEBUFFERSGIXPROC glad_glTagSampleBufferSGIX; -PFNGLPOINTPARAMETERINVPROC glad_glPointParameteriNV; -PFNGLPOINTPARAMETERIVNVPROC glad_glPointParameterivNV; -PFNGLSTENCILOPSEPARATEATIPROC glad_glStencilOpSeparateATI; -PFNGLSTENCILFUNCSEPARATEATIPROC glad_glStencilFuncSeparateATI; -PFNGLTEXBUFFEREXTPROC glad_glTexBufferEXT; -PFNGLWEIGHTBVARBPROC glad_glWeightbvARB; -PFNGLWEIGHTSVARBPROC glad_glWeightsvARB; -PFNGLWEIGHTIVARBPROC glad_glWeightivARB; -PFNGLWEIGHTFVARBPROC glad_glWeightfvARB; -PFNGLWEIGHTDVARBPROC glad_glWeightdvARB; -PFNGLWEIGHTUBVARBPROC glad_glWeightubvARB; -PFNGLWEIGHTUSVARBPROC glad_glWeightusvARB; -PFNGLWEIGHTUIVARBPROC glad_glWeightuivARB; -PFNGLWEIGHTPOINTERARBPROC glad_glWeightPointerARB; -PFNGLVERTEXBLENDARBPROC glad_glVertexBlendARB; -PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC glad_glFramebufferTextureMultiviewOVR; -PFNGLGETPROGRAMINTERFACEIVPROC glad_glGetProgramInterfaceiv; -PFNGLGETPROGRAMRESOURCEINDEXPROC glad_glGetProgramResourceIndex; -PFNGLGETPROGRAMRESOURCENAMEPROC glad_glGetProgramResourceName; -PFNGLGETPROGRAMRESOURCEIVPROC glad_glGetProgramResourceiv; -PFNGLGETPROGRAMRESOURCELOCATIONPROC glad_glGetProgramResourceLocation; -PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC glad_glGetProgramResourceLocationIndex; -PFNGLINDEXFUNCEXTPROC glad_glIndexFuncEXT; -PFNGLMAKEBUFFERRESIDENTNVPROC glad_glMakeBufferResidentNV; -PFNGLMAKEBUFFERNONRESIDENTNVPROC glad_glMakeBufferNonResidentNV; -PFNGLISBUFFERRESIDENTNVPROC glad_glIsBufferResidentNV; -PFNGLMAKENAMEDBUFFERRESIDENTNVPROC glad_glMakeNamedBufferResidentNV; -PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC glad_glMakeNamedBufferNonResidentNV; -PFNGLISNAMEDBUFFERRESIDENTNVPROC glad_glIsNamedBufferResidentNV; -PFNGLGETBUFFERPARAMETERUI64VNVPROC glad_glGetBufferParameterui64vNV; -PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC glad_glGetNamedBufferParameterui64vNV; -PFNGLGETINTEGERUI64VNVPROC glad_glGetIntegerui64vNV; -PFNGLUNIFORMUI64NVPROC glad_glUniformui64NV; -PFNGLUNIFORMUI64VNVPROC glad_glUniformui64vNV; -PFNGLGETUNIFORMUI64VNVPROC glad_glGetUniformui64vNV; -PFNGLPROGRAMUNIFORMUI64NVPROC glad_glProgramUniformui64NV; -PFNGLPROGRAMUNIFORMUI64VNVPROC glad_glProgramUniformui64vNV; -PFNGLCOLORSUBTABLEEXTPROC glad_glColorSubTableEXT; -PFNGLCOPYCOLORSUBTABLEEXTPROC glad_glCopyColorSubTableEXT; -PFNGLFINISHTEXTURESUNXPROC glad_glFinishTextureSUNX; -PFNGLMULTIDRAWARRAYSEXTPROC glad_glMultiDrawArraysEXT; -PFNGLMULTIDRAWELEMENTSEXTPROC glad_glMultiDrawElementsEXT; -PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC glad_glGetActiveAtomicCounterBufferiv; -PFNGLBEGINCONDITIONALRENDERNVPROC glad_glBeginConditionalRenderNV; -PFNGLENDCONDITIONALRENDERNVPROC glad_glEndConditionalRenderNV; -PFNGLRESIZEBUFFERSMESAPROC glad_glResizeBuffersMESA; -PFNGLTEXTUREVIEWPROC glad_glTextureView; -PFNGLCONVOLUTIONFILTER1DEXTPROC glad_glConvolutionFilter1DEXT; -PFNGLCONVOLUTIONFILTER2DEXTPROC glad_glConvolutionFilter2DEXT; -PFNGLCONVOLUTIONPARAMETERFEXTPROC glad_glConvolutionParameterfEXT; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC glad_glConvolutionParameterfvEXT; -PFNGLCONVOLUTIONPARAMETERIEXTPROC glad_glConvolutionParameteriEXT; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC glad_glConvolutionParameterivEXT; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC glad_glCopyConvolutionFilter1DEXT; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC glad_glCopyConvolutionFilter2DEXT; -PFNGLGETCONVOLUTIONFILTEREXTPROC glad_glGetConvolutionFilterEXT; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC glad_glGetConvolutionParameterfvEXT; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC glad_glGetConvolutionParameterivEXT; -PFNGLGETSEPARABLEFILTEREXTPROC glad_glGetSeparableFilterEXT; -PFNGLSEPARABLEFILTER2DEXTPROC glad_glSeparableFilter2DEXT; -PFNGLVERTEXATTRIBL1I64NVPROC glad_glVertexAttribL1i64NV; -PFNGLVERTEXATTRIBL2I64NVPROC glad_glVertexAttribL2i64NV; -PFNGLVERTEXATTRIBL3I64NVPROC glad_glVertexAttribL3i64NV; -PFNGLVERTEXATTRIBL4I64NVPROC glad_glVertexAttribL4i64NV; -PFNGLVERTEXATTRIBL1I64VNVPROC glad_glVertexAttribL1i64vNV; -PFNGLVERTEXATTRIBL2I64VNVPROC glad_glVertexAttribL2i64vNV; -PFNGLVERTEXATTRIBL3I64VNVPROC glad_glVertexAttribL3i64vNV; -PFNGLVERTEXATTRIBL4I64VNVPROC glad_glVertexAttribL4i64vNV; -PFNGLVERTEXATTRIBL1UI64NVPROC glad_glVertexAttribL1ui64NV; -PFNGLVERTEXATTRIBL2UI64NVPROC glad_glVertexAttribL2ui64NV; -PFNGLVERTEXATTRIBL3UI64NVPROC glad_glVertexAttribL3ui64NV; -PFNGLVERTEXATTRIBL4UI64NVPROC glad_glVertexAttribL4ui64NV; -PFNGLVERTEXATTRIBL1UI64VNVPROC glad_glVertexAttribL1ui64vNV; -PFNGLVERTEXATTRIBL2UI64VNVPROC glad_glVertexAttribL2ui64vNV; -PFNGLVERTEXATTRIBL3UI64VNVPROC glad_glVertexAttribL3ui64vNV; -PFNGLVERTEXATTRIBL4UI64VNVPROC glad_glVertexAttribL4ui64vNV; -PFNGLGETVERTEXATTRIBLI64VNVPROC glad_glGetVertexAttribLi64vNV; -PFNGLGETVERTEXATTRIBLUI64VNVPROC glad_glGetVertexAttribLui64vNV; -PFNGLVERTEXATTRIBLFORMATNVPROC glad_glVertexAttribLFormatNV; -PFNGLCOLORTABLEEXTPROC glad_glColorTableEXT; -PFNGLGETCOLORTABLEEXTPROC glad_glGetColorTableEXT; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC glad_glGetColorTableParameterivEXT; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC glad_glGetColorTableParameterfvEXT; -PFNGLTEXBUFFERARBPROC glad_glTexBufferARB; -PFNGLPNTRIANGLESIATIPROC glad_glPNTrianglesiATI; -PFNGLPNTRIANGLESFATIPROC glad_glPNTrianglesfATI; -PFNGLFLUSHRASTERSGIXPROC glad_glFlushRasterSGIX; -PFNGLAPPLYTEXTUREEXTPROC glad_glApplyTextureEXT; -PFNGLTEXTURELIGHTEXTPROC glad_glTextureLightEXT; -PFNGLTEXTUREMATERIALEXTPROC glad_glTextureMaterialEXT; -PFNGLIMAGETRANSFORMPARAMETERIHPPROC glad_glImageTransformParameteriHP; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC glad_glImageTransformParameterfHP; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC glad_glImageTransformParameterivHP; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC glad_glImageTransformParameterfvHP; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC glad_glGetImageTransformParameterivHP; -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC glad_glGetImageTransformParameterfvHP; -PFNGLBLENDFUNCINDEXEDAMDPROC glad_glBlendFuncIndexedAMD; -PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC glad_glBlendFuncSeparateIndexedAMD; -PFNGLBLENDEQUATIONINDEXEDAMDPROC glad_glBlendEquationIndexedAMD; -PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC glad_glBlendEquationSeparateIndexedAMD; -PFNGLTEXTURERANGEAPPLEPROC glad_glTextureRangeAPPLE; -PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC glad_glGetTexParameterPointervAPPLE; -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glad_glFramebufferTextureLayerEXT; -PFNGLTEXTUREBARRIERNVPROC glad_glTextureBarrierNV; -PFNGLTBUFFERMASK3DFXPROC glad_glTbufferMask3DFX; -PFNGLFRAMETERMINATORGREMEDYPROC glad_glFrameTerminatorGREMEDY; -PFNGLUSESHADERPROGRAMEXTPROC glad_glUseShaderProgramEXT; -PFNGLACTIVEPROGRAMEXTPROC glad_glActiveProgramEXT; -PFNGLCREATESHADERPROGRAMEXTPROC glad_glCreateShaderProgramEXT; -PFNGLACTIVESHADERPROGRAMEXTPROC glad_glActiveShaderProgramEXT; -PFNGLBINDPROGRAMPIPELINEEXTPROC glad_glBindProgramPipelineEXT; -PFNGLCREATESHADERPROGRAMVEXTPROC glad_glCreateShaderProgramvEXT; -PFNGLDELETEPROGRAMPIPELINESEXTPROC glad_glDeleteProgramPipelinesEXT; -PFNGLGENPROGRAMPIPELINESEXTPROC glad_glGenProgramPipelinesEXT; -PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC glad_glGetProgramPipelineInfoLogEXT; -PFNGLGETPROGRAMPIPELINEIVEXTPROC glad_glGetProgramPipelineivEXT; -PFNGLISPROGRAMPIPELINEEXTPROC glad_glIsProgramPipelineEXT; -PFNGLPROGRAMPARAMETERIEXTPROC glad_glProgramParameteriEXT; -PFNGLPROGRAMUNIFORM1FEXTPROC glad_glProgramUniform1fEXT; -PFNGLPROGRAMUNIFORM1FVEXTPROC glad_glProgramUniform1fvEXT; -PFNGLPROGRAMUNIFORM1IEXTPROC glad_glProgramUniform1iEXT; -PFNGLPROGRAMUNIFORM1IVEXTPROC glad_glProgramUniform1ivEXT; -PFNGLPROGRAMUNIFORM2FEXTPROC glad_glProgramUniform2fEXT; -PFNGLPROGRAMUNIFORM2FVEXTPROC glad_glProgramUniform2fvEXT; -PFNGLPROGRAMUNIFORM2IEXTPROC glad_glProgramUniform2iEXT; -PFNGLPROGRAMUNIFORM2IVEXTPROC glad_glProgramUniform2ivEXT; -PFNGLPROGRAMUNIFORM3FEXTPROC glad_glProgramUniform3fEXT; -PFNGLPROGRAMUNIFORM3FVEXTPROC glad_glProgramUniform3fvEXT; -PFNGLPROGRAMUNIFORM3IEXTPROC glad_glProgramUniform3iEXT; -PFNGLPROGRAMUNIFORM3IVEXTPROC glad_glProgramUniform3ivEXT; -PFNGLPROGRAMUNIFORM4FEXTPROC glad_glProgramUniform4fEXT; -PFNGLPROGRAMUNIFORM4FVEXTPROC glad_glProgramUniform4fvEXT; -PFNGLPROGRAMUNIFORM4IEXTPROC glad_glProgramUniform4iEXT; -PFNGLPROGRAMUNIFORM4IVEXTPROC glad_glProgramUniform4ivEXT; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC glad_glProgramUniformMatrix2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC glad_glProgramUniformMatrix3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC glad_glProgramUniformMatrix4fvEXT; -PFNGLUSEPROGRAMSTAGESEXTPROC glad_glUseProgramStagesEXT; -PFNGLVALIDATEPROGRAMPIPELINEEXTPROC glad_glValidateProgramPipelineEXT; -PFNGLPROGRAMUNIFORM1UIEXTPROC glad_glProgramUniform1uiEXT; -PFNGLPROGRAMUNIFORM2UIEXTPROC glad_glProgramUniform2uiEXT; -PFNGLPROGRAMUNIFORM3UIEXTPROC glad_glProgramUniform3uiEXT; -PFNGLPROGRAMUNIFORM4UIEXTPROC glad_glProgramUniform4uiEXT; -PFNGLPROGRAMUNIFORM1UIVEXTPROC glad_glProgramUniform1uivEXT; -PFNGLPROGRAMUNIFORM2UIVEXTPROC glad_glProgramUniform2uivEXT; -PFNGLPROGRAMUNIFORM3UIVEXTPROC glad_glProgramUniform3uivEXT; -PFNGLPROGRAMUNIFORM4UIVEXTPROC glad_glProgramUniform4uivEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC glad_glProgramUniformMatrix2x3fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC glad_glProgramUniformMatrix3x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC glad_glProgramUniformMatrix2x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC glad_glProgramUniformMatrix4x2fvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC glad_glProgramUniformMatrix3x4fvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC glad_glProgramUniformMatrix4x3fvEXT; -PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTexImage2DMultisampleCoverageNV; -PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTexImage3DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC glad_glTextureImage2DMultisampleNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC glad_glTextureImage3DMultisampleNV; -PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC glad_glTextureImage2DMultisampleCoverageNV; -PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC glad_glTextureImage3DMultisampleCoverageNV; -PFNGLDELETEOBJECTARBPROC glad_glDeleteObjectARB; -PFNGLGETHANDLEARBPROC glad_glGetHandleARB; -PFNGLDETACHOBJECTARBPROC glad_glDetachObjectARB; -PFNGLCREATESHADEROBJECTARBPROC glad_glCreateShaderObjectARB; -PFNGLSHADERSOURCEARBPROC glad_glShaderSourceARB; -PFNGLCOMPILESHADERARBPROC glad_glCompileShaderARB; -PFNGLCREATEPROGRAMOBJECTARBPROC glad_glCreateProgramObjectARB; -PFNGLATTACHOBJECTARBPROC glad_glAttachObjectARB; -PFNGLLINKPROGRAMARBPROC glad_glLinkProgramARB; -PFNGLUSEPROGRAMOBJECTARBPROC glad_glUseProgramObjectARB; -PFNGLVALIDATEPROGRAMARBPROC glad_glValidateProgramARB; -PFNGLUNIFORM1FARBPROC glad_glUniform1fARB; -PFNGLUNIFORM2FARBPROC glad_glUniform2fARB; -PFNGLUNIFORM3FARBPROC glad_glUniform3fARB; -PFNGLUNIFORM4FARBPROC glad_glUniform4fARB; -PFNGLUNIFORM1IARBPROC glad_glUniform1iARB; -PFNGLUNIFORM2IARBPROC glad_glUniform2iARB; -PFNGLUNIFORM3IARBPROC glad_glUniform3iARB; -PFNGLUNIFORM4IARBPROC glad_glUniform4iARB; -PFNGLUNIFORM1FVARBPROC glad_glUniform1fvARB; -PFNGLUNIFORM2FVARBPROC glad_glUniform2fvARB; -PFNGLUNIFORM3FVARBPROC glad_glUniform3fvARB; -PFNGLUNIFORM4FVARBPROC glad_glUniform4fvARB; -PFNGLUNIFORM1IVARBPROC glad_glUniform1ivARB; -PFNGLUNIFORM2IVARBPROC glad_glUniform2ivARB; -PFNGLUNIFORM3IVARBPROC glad_glUniform3ivARB; -PFNGLUNIFORM4IVARBPROC glad_glUniform4ivARB; -PFNGLUNIFORMMATRIX2FVARBPROC glad_glUniformMatrix2fvARB; -PFNGLUNIFORMMATRIX3FVARBPROC glad_glUniformMatrix3fvARB; -PFNGLUNIFORMMATRIX4FVARBPROC glad_glUniformMatrix4fvARB; -PFNGLGETOBJECTPARAMETERFVARBPROC glad_glGetObjectParameterfvARB; -PFNGLGETOBJECTPARAMETERIVARBPROC glad_glGetObjectParameterivARB; -PFNGLGETINFOLOGARBPROC glad_glGetInfoLogARB; -PFNGLGETATTACHEDOBJECTSARBPROC glad_glGetAttachedObjectsARB; -PFNGLGETUNIFORMLOCATIONARBPROC glad_glGetUniformLocationARB; -PFNGLGETACTIVEUNIFORMARBPROC glad_glGetActiveUniformARB; -PFNGLGETUNIFORMFVARBPROC glad_glGetUniformfvARB; -PFNGLGETUNIFORMIVARBPROC glad_glGetUniformivARB; -PFNGLGETSHADERSOURCEARBPROC glad_glGetShaderSourceARB; -PFNGLTEXBUMPPARAMETERIVATIPROC glad_glTexBumpParameterivATI; -PFNGLTEXBUMPPARAMETERFVATIPROC glad_glTexBumpParameterfvATI; -PFNGLGETTEXBUMPPARAMETERIVATIPROC glad_glGetTexBumpParameterivATI; -PFNGLGETTEXBUMPPARAMETERFVATIPROC glad_glGetTexBumpParameterfvATI; -PFNGLMAPOBJECTBUFFERATIPROC glad_glMapObjectBufferATI; -PFNGLUNMAPOBJECTBUFFERATIPROC glad_glUnmapObjectBufferATI; -PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -PFNGLPIXELDATARANGENVPROC glad_glPixelDataRangeNV; -PFNGLFLUSHPIXELDATARANGENVPROC glad_glFlushPixelDataRangeNV; -PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; -PFNGLUNIFORM1DPROC glad_glUniform1d; -PFNGLUNIFORM2DPROC glad_glUniform2d; -PFNGLUNIFORM3DPROC glad_glUniform3d; -PFNGLUNIFORM4DPROC glad_glUniform4d; -PFNGLUNIFORM1DVPROC glad_glUniform1dv; -PFNGLUNIFORM2DVPROC glad_glUniform2dv; -PFNGLUNIFORM3DVPROC glad_glUniform3dv; -PFNGLUNIFORM4DVPROC glad_glUniform4dv; -PFNGLUNIFORMMATRIX2DVPROC glad_glUniformMatrix2dv; -PFNGLUNIFORMMATRIX3DVPROC glad_glUniformMatrix3dv; -PFNGLUNIFORMMATRIX4DVPROC glad_glUniformMatrix4dv; -PFNGLUNIFORMMATRIX2X3DVPROC glad_glUniformMatrix2x3dv; -PFNGLUNIFORMMATRIX2X4DVPROC glad_glUniformMatrix2x4dv; -PFNGLUNIFORMMATRIX3X2DVPROC glad_glUniformMatrix3x2dv; -PFNGLUNIFORMMATRIX3X4DVPROC glad_glUniformMatrix3x4dv; -PFNGLUNIFORMMATRIX4X2DVPROC glad_glUniformMatrix4x2dv; -PFNGLUNIFORMMATRIX4X3DVPROC glad_glUniformMatrix4x3dv; -PFNGLGETUNIFORMDVPROC glad_glGetUniformdv; -PFNGLCREATESTATESNVPROC glad_glCreateStatesNV; -PFNGLDELETESTATESNVPROC glad_glDeleteStatesNV; -PFNGLISSTATENVPROC glad_glIsStateNV; -PFNGLSTATECAPTURENVPROC glad_glStateCaptureNV; -PFNGLGETCOMMANDHEADERNVPROC glad_glGetCommandHeaderNV; -PFNGLGETSTAGEINDEXNVPROC glad_glGetStageIndexNV; -PFNGLDRAWCOMMANDSNVPROC glad_glDrawCommandsNV; -PFNGLDRAWCOMMANDSADDRESSNVPROC glad_glDrawCommandsAddressNV; -PFNGLDRAWCOMMANDSSTATESNVPROC glad_glDrawCommandsStatesNV; -PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC glad_glDrawCommandsStatesAddressNV; -PFNGLCREATECOMMANDLISTSNVPROC glad_glCreateCommandListsNV; -PFNGLDELETECOMMANDLISTSNVPROC glad_glDeleteCommandListsNV; -PFNGLISCOMMANDLISTNVPROC glad_glIsCommandListNV; -PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC glad_glListDrawCommandsStatesClientNV; -PFNGLCOMMANDLISTSEGMENTSNVPROC glad_glCommandListSegmentsNV; -PFNGLCOMPILECOMMANDLISTNVPROC glad_glCompileCommandListNV; -PFNGLCALLCOMMANDLISTNVPROC glad_glCallCommandListNV; -PFNGLVERTEXWEIGHTFEXTPROC glad_glVertexWeightfEXT; -PFNGLVERTEXWEIGHTFVEXTPROC glad_glVertexWeightfvEXT; -PFNGLVERTEXWEIGHTPOINTEREXTPROC glad_glVertexWeightPointerEXT; -PFNGLSTRINGMARKERGREMEDYPROC glad_glStringMarkerGREMEDY; -PFNGLTEXSUBIMAGE1DEXTPROC glad_glTexSubImage1DEXT; -PFNGLTEXSUBIMAGE2DEXTPROC glad_glTexSubImage2DEXT; -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC glad_glProgramEnvParameters4fvEXT; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glProgramLocalParameters4fvEXT; -PFNGLMAPCONTROLPOINTSNVPROC glad_glMapControlPointsNV; -PFNGLMAPPARAMETERIVNVPROC glad_glMapParameterivNV; -PFNGLMAPPARAMETERFVNVPROC glad_glMapParameterfvNV; -PFNGLGETMAPCONTROLPOINTSNVPROC glad_glGetMapControlPointsNV; -PFNGLGETMAPPARAMETERIVNVPROC glad_glGetMapParameterivNV; -PFNGLGETMAPPARAMETERFVNVPROC glad_glGetMapParameterfvNV; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC glad_glGetMapAttribParameterivNV; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC glad_glGetMapAttribParameterfvNV; -PFNGLEVALMAPSNVPROC glad_glEvalMapsNV; -PFNGLGETTEXFILTERFUNCSGISPROC glad_glGetTexFilterFuncSGIS; -PFNGLTEXFILTERFUNCSGISPROC glad_glTexFilterFuncSGIS; -PFNGLGETPERFMONITORGROUPSAMDPROC glad_glGetPerfMonitorGroupsAMD; -PFNGLGETPERFMONITORCOUNTERSAMDPROC glad_glGetPerfMonitorCountersAMD; -PFNGLGETPERFMONITORGROUPSTRINGAMDPROC glad_glGetPerfMonitorGroupStringAMD; -PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC glad_glGetPerfMonitorCounterStringAMD; -PFNGLGETPERFMONITORCOUNTERINFOAMDPROC glad_glGetPerfMonitorCounterInfoAMD; -PFNGLGENPERFMONITORSAMDPROC glad_glGenPerfMonitorsAMD; -PFNGLDELETEPERFMONITORSAMDPROC glad_glDeletePerfMonitorsAMD; -PFNGLSELECTPERFMONITORCOUNTERSAMDPROC glad_glSelectPerfMonitorCountersAMD; -PFNGLBEGINPERFMONITORAMDPROC glad_glBeginPerfMonitorAMD; -PFNGLENDPERFMONITORAMDPROC glad_glEndPerfMonitorAMD; -PFNGLGETPERFMONITORCOUNTERDATAAMDPROC glad_glGetPerfMonitorCounterDataAMD; -PFNGLSTENCILCLEARTAGEXTPROC glad_glStencilClearTagEXT; -PFNGLPRESENTFRAMEKEYEDNVPROC glad_glPresentFrameKeyedNV; -PFNGLPRESENTFRAMEDUALFILLNVPROC glad_glPresentFrameDualFillNV; -PFNGLGETVIDEOIVNVPROC glad_glGetVideoivNV; -PFNGLGETVIDEOUIVNVPROC glad_glGetVideouivNV; -PFNGLGETVIDEOI64VNVPROC glad_glGetVideoi64vNV; -PFNGLGETVIDEOUI64VNVPROC glad_glGetVideoui64vNV; -PFNGLFRAMEZOOMSGIXPROC glad_glFrameZoomSGIX; -PFNGLBEGINTRANSFORMFEEDBACKNVPROC glad_glBeginTransformFeedbackNV; -PFNGLENDTRANSFORMFEEDBACKNVPROC glad_glEndTransformFeedbackNV; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC glad_glTransformFeedbackAttribsNV; -PFNGLBINDBUFFERRANGENVPROC glad_glBindBufferRangeNV; -PFNGLBINDBUFFEROFFSETNVPROC glad_glBindBufferOffsetNV; -PFNGLBINDBUFFERBASENVPROC glad_glBindBufferBaseNV; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC glad_glTransformFeedbackVaryingsNV; -PFNGLACTIVEVARYINGNVPROC glad_glActiveVaryingNV; -PFNGLGETVARYINGLOCATIONNVPROC glad_glGetVaryingLocationNV; -PFNGLGETACTIVEVARYINGNVPROC glad_glGetActiveVaryingNV; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC glad_glGetTransformFeedbackVaryingNV; -PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC glad_glTransformFeedbackStreamAttribsNV; -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC glad_glProgramNamedParameter4fNV; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC glad_glProgramNamedParameter4fvNV; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC glad_glProgramNamedParameter4dNV; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC glad_glProgramNamedParameter4dvNV; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC glad_glGetProgramNamedParameterfvNV; -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC glad_glGetProgramNamedParameterdvNV; -PFNGLSTENCILOPVALUEAMDPROC glad_glStencilOpValueAMD; -PFNGLVERTEXATTRIBDIVISORARBPROC glad_glVertexAttribDivisorARB; -PFNGLPOLYGONOFFSETEXTPROC glad_glPolygonOffsetEXT; -PFNGLGETGRAPHICSRESETSTATUSPROC glad_glGetGraphicsResetStatus; -PFNGLREADNPIXELSPROC glad_glReadnPixels; -PFNGLGETNUNIFORMFVPROC glad_glGetnUniformfv; -PFNGLGETNUNIFORMIVPROC glad_glGetnUniformiv; -PFNGLGETNUNIFORMUIVPROC glad_glGetnUniformuiv; -PFNGLGETGRAPHICSRESETSTATUSKHRPROC glad_glGetGraphicsResetStatusKHR; -PFNGLREADNPIXELSKHRPROC glad_glReadnPixelsKHR; -PFNGLGETNUNIFORMFVKHRPROC glad_glGetnUniformfvKHR; -PFNGLGETNUNIFORMIVKHRPROC glad_glGetnUniformivKHR; -PFNGLGETNUNIFORMUIVKHRPROC glad_glGetnUniformuivKHR; -PFNGLTEXSTORAGESPARSEAMDPROC glad_glTexStorageSparseAMD; -PFNGLTEXTURESTORAGESPARSEAMDPROC glad_glTextureStorageSparseAMD; -PFNGLCLIPCONTROLPROC glad_glClipControl; -PFNGLFRAGMENTCOVERAGECOLORNVPROC glad_glFragmentCoverageColorNV; -PFNGLDELETEFENCESNVPROC glad_glDeleteFencesNV; -PFNGLGENFENCESNVPROC glad_glGenFencesNV; -PFNGLISFENCENVPROC glad_glIsFenceNV; -PFNGLTESTFENCENVPROC glad_glTestFenceNV; -PFNGLGETFENCEIVNVPROC glad_glGetFenceivNV; -PFNGLFINISHFENCENVPROC glad_glFinishFenceNV; -PFNGLSETFENCENVPROC glad_glSetFenceNV; -PFNGLTEXBUFFERRANGEPROC glad_glTexBufferRange; -PFNGLDRAWMESHARRAYSSUNPROC glad_glDrawMeshArraysSUN; -PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; -PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; -PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; -PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; -PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; -PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; -PFNGLFRAMEBUFFERPARAMETERIPROC glad_glFramebufferParameteri; -PFNGLGETFRAMEBUFFERPARAMETERIVPROC glad_glGetFramebufferParameteriv; -PFNGLCREATESYNCFROMCLEVENTARBPROC glad_glCreateSyncFromCLeventARB; -PFNGLCLEARDEPTHFOESPROC glad_glClearDepthfOES; -PFNGLCLIPPLANEFOESPROC glad_glClipPlanefOES; -PFNGLDEPTHRANGEFOESPROC glad_glDepthRangefOES; -PFNGLFRUSTUMFOESPROC glad_glFrustumfOES; -PFNGLGETCLIPPLANEFOESPROC glad_glGetClipPlanefOES; -PFNGLORTHOFOESPROC glad_glOrthofOES; -PFNGLPRIMITIVERESTARTNVPROC glad_glPrimitiveRestartNV; -PFNGLPRIMITIVERESTARTINDEXNVPROC glad_glPrimitiveRestartIndexNV; -PFNGLGLOBALALPHAFACTORBSUNPROC glad_glGlobalAlphaFactorbSUN; -PFNGLGLOBALALPHAFACTORSSUNPROC glad_glGlobalAlphaFactorsSUN; -PFNGLGLOBALALPHAFACTORISUNPROC glad_glGlobalAlphaFactoriSUN; -PFNGLGLOBALALPHAFACTORFSUNPROC glad_glGlobalAlphaFactorfSUN; -PFNGLGLOBALALPHAFACTORDSUNPROC glad_glGlobalAlphaFactordSUN; -PFNGLGLOBALALPHAFACTORUBSUNPROC glad_glGlobalAlphaFactorubSUN; -PFNGLGLOBALALPHAFACTORUSSUNPROC glad_glGlobalAlphaFactorusSUN; -PFNGLGLOBALALPHAFACTORUISUNPROC glad_glGlobalAlphaFactoruiSUN; -PFNGLARETEXTURESRESIDENTEXTPROC glad_glAreTexturesResidentEXT; -PFNGLBINDTEXTUREEXTPROC glad_glBindTextureEXT; -PFNGLDELETETEXTURESEXTPROC glad_glDeleteTexturesEXT; -PFNGLGENTEXTURESEXTPROC glad_glGenTexturesEXT; -PFNGLISTEXTUREEXTPROC glad_glIsTextureEXT; -PFNGLPRIORITIZETEXTURESEXTPROC glad_glPrioritizeTexturesEXT; -PFNGLGENNAMESAMDPROC glad_glGenNamesAMD; -PFNGLDELETENAMESAMDPROC glad_glDeleteNamesAMD; -PFNGLISNAMEAMDPROC glad_glIsNameAMD; -PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; -PFNGLENABLEVERTEXATTRIBAPPLEPROC glad_glEnableVertexAttribAPPLE; -PFNGLDISABLEVERTEXATTRIBAPPLEPROC glad_glDisableVertexAttribAPPLE; -PFNGLISVERTEXATTRIBENABLEDAPPLEPROC glad_glIsVertexAttribEnabledAPPLE; -PFNGLMAPVERTEXATTRIB1DAPPLEPROC glad_glMapVertexAttrib1dAPPLE; -PFNGLMAPVERTEXATTRIB1FAPPLEPROC glad_glMapVertexAttrib1fAPPLE; -PFNGLMAPVERTEXATTRIB2DAPPLEPROC glad_glMapVertexAttrib2dAPPLE; -PFNGLMAPVERTEXATTRIB2FAPPLEPROC glad_glMapVertexAttrib2fAPPLE; -PFNGLBINDBUFFERSBASEPROC glad_glBindBuffersBase; -PFNGLBINDBUFFERSRANGEPROC glad_glBindBuffersRange; -PFNGLBINDTEXTURESPROC glad_glBindTextures; -PFNGLBINDSAMPLERSPROC glad_glBindSamplers; -PFNGLBINDIMAGETEXTURESPROC glad_glBindImageTextures; -PFNGLBINDVERTEXBUFFERSPROC glad_glBindVertexBuffers; -PFNGLGETLISTPARAMETERFVSGIXPROC glad_glGetListParameterfvSGIX; -PFNGLGETLISTPARAMETERIVSGIXPROC glad_glGetListParameterivSGIX; -PFNGLLISTPARAMETERFSGIXPROC glad_glListParameterfSGIX; -PFNGLLISTPARAMETERFVSGIXPROC glad_glListParameterfvSGIX; -PFNGLLISTPARAMETERISGIXPROC glad_glListParameteriSGIX; -PFNGLLISTPARAMETERIVSGIXPROC glad_glListParameterivSGIX; -PFNGLBUFFERADDRESSRANGENVPROC glad_glBufferAddressRangeNV; -PFNGLVERTEXFORMATNVPROC glad_glVertexFormatNV; -PFNGLNORMALFORMATNVPROC glad_glNormalFormatNV; -PFNGLCOLORFORMATNVPROC glad_glColorFormatNV; -PFNGLINDEXFORMATNVPROC glad_glIndexFormatNV; -PFNGLTEXCOORDFORMATNVPROC glad_glTexCoordFormatNV; -PFNGLEDGEFLAGFORMATNVPROC glad_glEdgeFlagFormatNV; -PFNGLSECONDARYCOLORFORMATNVPROC glad_glSecondaryColorFormatNV; -PFNGLFOGCOORDFORMATNVPROC glad_glFogCoordFormatNV; -PFNGLVERTEXATTRIBFORMATNVPROC glad_glVertexAttribFormatNV; -PFNGLVERTEXATTRIBIFORMATNVPROC glad_glVertexAttribIFormatNV; -PFNGLGETINTEGERUI64I_VNVPROC glad_glGetIntegerui64i_vNV; -PFNGLBLENDPARAMETERINVPROC glad_glBlendParameteriNV; -PFNGLBLENDBARRIERNVPROC glad_glBlendBarrierNV; -PFNGLSHARPENTEXFUNCSGISPROC glad_glSharpenTexFuncSGIS; -PFNGLGETSHARPENTEXFUNCSGISPROC glad_glGetSharpenTexFuncSGIS; -PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; -PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; -PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; -PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; -PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; -PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; -PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; -PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; -PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; -PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; -PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; -PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; -PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; -PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; -PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; -PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; -PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; -PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; -PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; -PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; -PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; -PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; -PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; -PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; -PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; -PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; -PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; -PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; -PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; -PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; -PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; -PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; -PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; -PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; -PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; -PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; -PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; -PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; -PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; -PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; -PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; -PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; -PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; -PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; -PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; -PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; -PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; -PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; -PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; -PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; -PFNGLISPROGRAMARBPROC glad_glIsProgramARB; -PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; -PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; -PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; -PFNGLISBUFFERARBPROC glad_glIsBufferARB; -PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; -PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; -PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; -PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; -PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; -PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; -PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; -PFNGLFLUSHVERTEXARRAYRANGENVPROC glad_glFlushVertexArrayRangeNV; -PFNGLVERTEXARRAYRANGENVPROC glad_glVertexArrayRangeNV; -PFNGLFRAGMENTCOLORMATERIALSGIXPROC glad_glFragmentColorMaterialSGIX; -PFNGLFRAGMENTLIGHTFSGIXPROC glad_glFragmentLightfSGIX; -PFNGLFRAGMENTLIGHTFVSGIXPROC glad_glFragmentLightfvSGIX; -PFNGLFRAGMENTLIGHTISGIXPROC glad_glFragmentLightiSGIX; -PFNGLFRAGMENTLIGHTIVSGIXPROC glad_glFragmentLightivSGIX; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC glad_glFragmentLightModelfSGIX; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC glad_glFragmentLightModelfvSGIX; -PFNGLFRAGMENTLIGHTMODELISGIXPROC glad_glFragmentLightModeliSGIX; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC glad_glFragmentLightModelivSGIX; -PFNGLFRAGMENTMATERIALFSGIXPROC glad_glFragmentMaterialfSGIX; -PFNGLFRAGMENTMATERIALFVSGIXPROC glad_glFragmentMaterialfvSGIX; -PFNGLFRAGMENTMATERIALISGIXPROC glad_glFragmentMaterialiSGIX; -PFNGLFRAGMENTMATERIALIVSGIXPROC glad_glFragmentMaterialivSGIX; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC glad_glGetFragmentLightfvSGIX; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC glad_glGetFragmentLightivSGIX; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC glad_glGetFragmentMaterialfvSGIX; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC glad_glGetFragmentMaterialivSGIX; -PFNGLLIGHTENVISGIXPROC glad_glLightEnviSGIX; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC glad_glRenderbufferStorageMultisampleCoverageNV; -PFNGLGETQUERYOBJECTI64VEXTPROC glad_glGetQueryObjecti64vEXT; -PFNGLGETQUERYOBJECTUI64VEXTPROC glad_glGetQueryObjectui64vEXT; -PFNGLGETTEXTUREHANDLENVPROC glad_glGetTextureHandleNV; -PFNGLGETTEXTURESAMPLERHANDLENVPROC glad_glGetTextureSamplerHandleNV; -PFNGLMAKETEXTUREHANDLERESIDENTNVPROC glad_glMakeTextureHandleResidentNV; -PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC glad_glMakeTextureHandleNonResidentNV; -PFNGLGETIMAGEHANDLENVPROC glad_glGetImageHandleNV; -PFNGLMAKEIMAGEHANDLERESIDENTNVPROC glad_glMakeImageHandleResidentNV; -PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC glad_glMakeImageHandleNonResidentNV; -PFNGLUNIFORMHANDLEUI64NVPROC glad_glUniformHandleui64NV; -PFNGLUNIFORMHANDLEUI64VNVPROC glad_glUniformHandleui64vNV; -PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC glad_glProgramUniformHandleui64NV; -PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC glad_glProgramUniformHandleui64vNV; -PFNGLISTEXTUREHANDLERESIDENTNVPROC glad_glIsTextureHandleResidentNV; -PFNGLISIMAGEHANDLERESIDENTNVPROC glad_glIsImageHandleResidentNV; -PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -PFNGLOBJECTLABELPROC glad_glObjectLabel; -PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -PFNGLGETPOINTERVPROC glad_glGetPointerv; -PFNGLDEBUGMESSAGECONTROLKHRPROC glad_glDebugMessageControlKHR; -PFNGLDEBUGMESSAGEINSERTKHRPROC glad_glDebugMessageInsertKHR; -PFNGLDEBUGMESSAGECALLBACKKHRPROC glad_glDebugMessageCallbackKHR; -PFNGLGETDEBUGMESSAGELOGKHRPROC glad_glGetDebugMessageLogKHR; -PFNGLPUSHDEBUGGROUPKHRPROC glad_glPushDebugGroupKHR; -PFNGLPOPDEBUGGROUPKHRPROC glad_glPopDebugGroupKHR; -PFNGLOBJECTLABELKHRPROC glad_glObjectLabelKHR; -PFNGLGETOBJECTLABELKHRPROC glad_glGetObjectLabelKHR; -PFNGLOBJECTPTRLABELKHRPROC glad_glObjectPtrLabelKHR; -PFNGLGETOBJECTPTRLABELKHRPROC glad_glGetObjectPtrLabelKHR; -PFNGLGETPOINTERVKHRPROC glad_glGetPointervKHR; -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC glad_glVertexAttribArrayObjectATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC glad_glGetVertexAttribArrayObjectfvATI; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC glad_glGetVertexAttribArrayObjectivATI; -PFNGLUNIFORMBUFFEREXTPROC glad_glUniformBufferEXT; -PFNGLGETUNIFORMBUFFERSIZEEXTPROC glad_glGetUniformBufferSizeEXT; -PFNGLGETUNIFORMOFFSETEXTPROC glad_glGetUniformOffsetEXT; -PFNGLBLENDBARRIERKHRPROC glad_glBlendBarrierKHR; -PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; -PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; -PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; -PFNGLREFERENCEPLANESGIXPROC glad_glReferencePlaneSGIX; -PFNGLACTIVESTENCILFACEEXTPROC glad_glActiveStencilFaceEXT; -PFNGLGETMULTISAMPLEFVNVPROC glad_glGetMultisamplefvNV; -PFNGLSAMPLEMASKINDEXEDNVPROC glad_glSampleMaskIndexedNV; -PFNGLTEXRENDERBUFFERNVPROC glad_glTexRenderbufferNV; -PFNGLFLUSHSTATICDATAIBMPROC glad_glFlushStaticDataIBM; -PFNGLTEXTURENORMALEXTPROC glad_glTextureNormalEXT; -PFNGLPOINTPARAMETERFEXTPROC glad_glPointParameterfEXT; -PFNGLPOINTPARAMETERFVEXTPROC glad_glPointParameterfvEXT; -PFNGLHINTPGIPROC glad_glHintPGI; -PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; -PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; -PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; -PFNGLPATCHPARAMETERIPROC glad_glPatchParameteri; -PFNGLPATCHPARAMETERFVPROC glad_glPatchParameterfv; -PFNGLCOLORMASKINDEXEDEXTPROC glad_glColorMaskIndexedEXT; -PFNGLGETBOOLEANINDEXEDVEXTPROC glad_glGetBooleanIndexedvEXT; -PFNGLGETINTEGERINDEXEDVEXTPROC glad_glGetIntegerIndexedvEXT; -PFNGLENABLEINDEXEDEXTPROC glad_glEnableIndexedEXT; -PFNGLDISABLEINDEXEDEXTPROC glad_glDisableIndexedEXT; -PFNGLISENABLEDINDEXEDEXTPROC glad_glIsEnabledIndexedEXT; -PFNGLVERTEXATTRIBL1DPROC glad_glVertexAttribL1d; -PFNGLVERTEXATTRIBL2DPROC glad_glVertexAttribL2d; -PFNGLVERTEXATTRIBL3DPROC glad_glVertexAttribL3d; -PFNGLVERTEXATTRIBL4DPROC glad_glVertexAttribL4d; -PFNGLVERTEXATTRIBL1DVPROC glad_glVertexAttribL1dv; -PFNGLVERTEXATTRIBL2DVPROC glad_glVertexAttribL2dv; -PFNGLVERTEXATTRIBL3DVPROC glad_glVertexAttribL3dv; -PFNGLVERTEXATTRIBL4DVPROC glad_glVertexAttribL4dv; -PFNGLVERTEXATTRIBLPOINTERPROC glad_glVertexAttribLPointer; -PFNGLGETVERTEXATTRIBLDVPROC glad_glGetVertexAttribLdv; -PFNGLRASTERSAMPLESEXTPROC glad_glRasterSamplesEXT; -PFNGLVERTEXATTRIBPARAMETERIAMDPROC glad_glVertexAttribParameteriAMD; -PFNGLTEXSTORAGE1DPROC glad_glTexStorage1D; -PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D; -PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D; -PFNGLCOPYIMAGESUBDATAPROC glad_glCopyImageSubData; -PFNGLPIXELTEXGENPARAMETERISGISPROC glad_glPixelTexGenParameteriSGIS; -PFNGLPIXELTEXGENPARAMETERIVSGISPROC glad_glPixelTexGenParameterivSGIS; -PFNGLPIXELTEXGENPARAMETERFSGISPROC glad_glPixelTexGenParameterfSGIS; -PFNGLPIXELTEXGENPARAMETERFVSGISPROC glad_glPixelTexGenParameterfvSGIS; -PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC glad_glGetPixelTexGenParameterivSGIS; -PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC glad_glGetPixelTexGenParameterfvSGIS; -PFNGLGETINSTRUMENTSSGIXPROC glad_glGetInstrumentsSGIX; -PFNGLINSTRUMENTSBUFFERSGIXPROC glad_glInstrumentsBufferSGIX; -PFNGLPOLLINSTRUMENTSSGIXPROC glad_glPollInstrumentsSGIX; -PFNGLREADINSTRUMENTSSGIXPROC glad_glReadInstrumentsSGIX; -PFNGLSTARTINSTRUMENTSSGIXPROC glad_glStartInstrumentsSGIX; -PFNGLSTOPINSTRUMENTSSGIXPROC glad_glStopInstrumentsSGIX; -PFNGLSHADERSTORAGEBLOCKBINDINGPROC glad_glShaderStorageBlockBinding; -PFNGLBLENDEQUATIONEXTPROC glad_glBlendEquationEXT; -PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC glad_glDrawArraysInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC glad_glDrawElementsInstancedBaseInstance; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC glad_glDrawElementsInstancedBaseVertexBaseInstance; -PFNGLMEMORYBARRIERBYREGIONPROC glad_glMemoryBarrierByRegion; -PFNGLTEXPARAMETERIIVEXTPROC glad_glTexParameterIivEXT; -PFNGLTEXPARAMETERIUIVEXTPROC glad_glTexParameterIuivEXT; -PFNGLGETTEXPARAMETERIIVEXTPROC glad_glGetTexParameterIivEXT; -PFNGLGETTEXPARAMETERIUIVEXTPROC glad_glGetTexParameterIuivEXT; -PFNGLCLEARCOLORIIEXTPROC glad_glClearColorIiEXT; -PFNGLCLEARCOLORIUIEXTPROC glad_glClearColorIuiEXT; -PFNGLUNIFORM1I64NVPROC glad_glUniform1i64NV; -PFNGLUNIFORM2I64NVPROC glad_glUniform2i64NV; -PFNGLUNIFORM3I64NVPROC glad_glUniform3i64NV; -PFNGLUNIFORM4I64NVPROC glad_glUniform4i64NV; -PFNGLUNIFORM1I64VNVPROC glad_glUniform1i64vNV; -PFNGLUNIFORM2I64VNVPROC glad_glUniform2i64vNV; -PFNGLUNIFORM3I64VNVPROC glad_glUniform3i64vNV; -PFNGLUNIFORM4I64VNVPROC glad_glUniform4i64vNV; -PFNGLUNIFORM1UI64NVPROC glad_glUniform1ui64NV; -PFNGLUNIFORM2UI64NVPROC glad_glUniform2ui64NV; -PFNGLUNIFORM3UI64NVPROC glad_glUniform3ui64NV; -PFNGLUNIFORM4UI64NVPROC glad_glUniform4ui64NV; -PFNGLUNIFORM1UI64VNVPROC glad_glUniform1ui64vNV; -PFNGLUNIFORM2UI64VNVPROC glad_glUniform2ui64vNV; -PFNGLUNIFORM3UI64VNVPROC glad_glUniform3ui64vNV; -PFNGLUNIFORM4UI64VNVPROC glad_glUniform4ui64vNV; -PFNGLGETUNIFORMI64VNVPROC glad_glGetUniformi64vNV; -PFNGLPROGRAMUNIFORM1I64NVPROC glad_glProgramUniform1i64NV; -PFNGLPROGRAMUNIFORM2I64NVPROC glad_glProgramUniform2i64NV; -PFNGLPROGRAMUNIFORM3I64NVPROC glad_glProgramUniform3i64NV; -PFNGLPROGRAMUNIFORM4I64NVPROC glad_glProgramUniform4i64NV; -PFNGLPROGRAMUNIFORM1I64VNVPROC glad_glProgramUniform1i64vNV; -PFNGLPROGRAMUNIFORM2I64VNVPROC glad_glProgramUniform2i64vNV; -PFNGLPROGRAMUNIFORM3I64VNVPROC glad_glProgramUniform3i64vNV; -PFNGLPROGRAMUNIFORM4I64VNVPROC glad_glProgramUniform4i64vNV; -PFNGLPROGRAMUNIFORM1UI64NVPROC glad_glProgramUniform1ui64NV; -PFNGLPROGRAMUNIFORM2UI64NVPROC glad_glProgramUniform2ui64NV; -PFNGLPROGRAMUNIFORM3UI64NVPROC glad_glProgramUniform3ui64NV; -PFNGLPROGRAMUNIFORM4UI64NVPROC glad_glProgramUniform4ui64NV; -PFNGLPROGRAMUNIFORM1UI64VNVPROC glad_glProgramUniform1ui64vNV; -PFNGLPROGRAMUNIFORM2UI64VNVPROC glad_glProgramUniform2ui64vNV; -PFNGLPROGRAMUNIFORM3UI64VNVPROC glad_glProgramUniform3ui64vNV; -PFNGLPROGRAMUNIFORM4UI64VNVPROC glad_glProgramUniform4ui64vNV; -PFNGLTESSELLATIONFACTORAMDPROC glad_glTessellationFactorAMD; -PFNGLTESSELLATIONMODEAMDPROC glad_glTessellationModeAMD; -PFNGLINVALIDATETEXSUBIMAGEPROC glad_glInvalidateTexSubImage; -PFNGLINVALIDATETEXIMAGEPROC glad_glInvalidateTexImage; -PFNGLINVALIDATEBUFFERSUBDATAPROC glad_glInvalidateBufferSubData; -PFNGLINVALIDATEBUFFERDATAPROC glad_glInvalidateBufferData; -PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer; -PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer; -PFNGLINDEXMATERIALEXTPROC glad_glIndexMaterialEXT; -PFNGLVERTEXPOINTERVINTELPROC glad_glVertexPointervINTEL; -PFNGLNORMALPOINTERVINTELPROC glad_glNormalPointervINTEL; -PFNGLCOLORPOINTERVINTELPROC glad_glColorPointervINTEL; -PFNGLTEXCOORDPOINTERVINTELPROC glad_glTexCoordPointervINTEL; -PFNGLDRAWBUFFERSATIPROC glad_glDrawBuffersATI; -PFNGLPIXELTEXGENSGIXPROC glad_glPixelTexGenSGIX; -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC glad_glProgramBufferParametersfvNV; -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC glad_glProgramBufferParametersIivNV; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC glad_glProgramBufferParametersIuivNV; -PFNGLCREATETRANSFORMFEEDBACKSPROC glad_glCreateTransformFeedbacks; -PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC glad_glTransformFeedbackBufferBase; -PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC glad_glTransformFeedbackBufferRange; -PFNGLGETTRANSFORMFEEDBACKIVPROC glad_glGetTransformFeedbackiv; -PFNGLGETTRANSFORMFEEDBACKI_VPROC glad_glGetTransformFeedbacki_v; -PFNGLGETTRANSFORMFEEDBACKI64_VPROC glad_glGetTransformFeedbacki64_v; -PFNGLCREATEBUFFERSPROC glad_glCreateBuffers; -PFNGLNAMEDBUFFERSTORAGEPROC glad_glNamedBufferStorage; -PFNGLNAMEDBUFFERDATAPROC glad_glNamedBufferData; -PFNGLNAMEDBUFFERSUBDATAPROC glad_glNamedBufferSubData; -PFNGLCOPYNAMEDBUFFERSUBDATAPROC glad_glCopyNamedBufferSubData; -PFNGLCLEARNAMEDBUFFERDATAPROC glad_glClearNamedBufferData; -PFNGLCLEARNAMEDBUFFERSUBDATAPROC glad_glClearNamedBufferSubData; -PFNGLMAPNAMEDBUFFERPROC glad_glMapNamedBuffer; -PFNGLMAPNAMEDBUFFERRANGEPROC glad_glMapNamedBufferRange; -PFNGLUNMAPNAMEDBUFFERPROC glad_glUnmapNamedBuffer; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glad_glFlushMappedNamedBufferRange; -PFNGLGETNAMEDBUFFERPARAMETERIVPROC glad_glGetNamedBufferParameteriv; -PFNGLGETNAMEDBUFFERPARAMETERI64VPROC glad_glGetNamedBufferParameteri64v; -PFNGLGETNAMEDBUFFERPOINTERVPROC glad_glGetNamedBufferPointerv; -PFNGLGETNAMEDBUFFERSUBDATAPROC glad_glGetNamedBufferSubData; -PFNGLCREATEFRAMEBUFFERSPROC glad_glCreateFramebuffers; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC glad_glNamedFramebufferRenderbuffer; -PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC glad_glNamedFramebufferParameteri; -PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glad_glNamedFramebufferTexture; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC glad_glNamedFramebufferTextureLayer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC glad_glNamedFramebufferDrawBuffer; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glad_glNamedFramebufferDrawBuffers; -PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glad_glNamedFramebufferReadBuffer; -PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC glad_glInvalidateNamedFramebufferData; -PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC glad_glInvalidateNamedFramebufferSubData; -PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glad_glClearNamedFramebufferiv; -PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glad_glClearNamedFramebufferuiv; -PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glad_glClearNamedFramebufferfv; -PFNGLCLEARNAMEDFRAMEBUFFERFIPROC glad_glClearNamedFramebufferfi; -PFNGLBLITNAMEDFRAMEBUFFERPROC glad_glBlitNamedFramebuffer; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glad_glCheckNamedFramebufferStatus; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC glad_glGetNamedFramebufferParameteriv; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetNamedFramebufferAttachmentParameteriv; -PFNGLCREATERENDERBUFFERSPROC glad_glCreateRenderbuffers; -PFNGLNAMEDRENDERBUFFERSTORAGEPROC glad_glNamedRenderbufferStorage; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glNamedRenderbufferStorageMultisample; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC glad_glGetNamedRenderbufferParameteriv; -PFNGLCREATETEXTURESPROC glad_glCreateTextures; -PFNGLTEXTUREBUFFERPROC glad_glTextureBuffer; -PFNGLTEXTUREBUFFERRANGEPROC glad_glTextureBufferRange; -PFNGLTEXTURESTORAGE1DPROC glad_glTextureStorage1D; -PFNGLTEXTURESTORAGE2DPROC glad_glTextureStorage2D; -PFNGLTEXTURESTORAGE3DPROC glad_glTextureStorage3D; -PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC glad_glTextureStorage2DMultisample; -PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC glad_glTextureStorage3DMultisample; -PFNGLTEXTURESUBIMAGE1DPROC glad_glTextureSubImage1D; -PFNGLTEXTURESUBIMAGE2DPROC glad_glTextureSubImage2D; -PFNGLTEXTURESUBIMAGE3DPROC glad_glTextureSubImage3D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC glad_glCompressedTextureSubImage1D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC glad_glCompressedTextureSubImage2D; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC glad_glCompressedTextureSubImage3D; -PFNGLCOPYTEXTURESUBIMAGE1DPROC glad_glCopyTextureSubImage1D; -PFNGLCOPYTEXTURESUBIMAGE2DPROC glad_glCopyTextureSubImage2D; -PFNGLCOPYTEXTURESUBIMAGE3DPROC glad_glCopyTextureSubImage3D; -PFNGLTEXTUREPARAMETERFPROC glad_glTextureParameterf; -PFNGLTEXTUREPARAMETERFVPROC glad_glTextureParameterfv; -PFNGLTEXTUREPARAMETERIPROC glad_glTextureParameteri; -PFNGLTEXTUREPARAMETERIIVPROC glad_glTextureParameterIiv; -PFNGLTEXTUREPARAMETERIUIVPROC glad_glTextureParameterIuiv; -PFNGLTEXTUREPARAMETERIVPROC glad_glTextureParameteriv; -PFNGLGENERATETEXTUREMIPMAPPROC glad_glGenerateTextureMipmap; -PFNGLBINDTEXTUREUNITPROC glad_glBindTextureUnit; -PFNGLGETTEXTUREIMAGEPROC glad_glGetTextureImage; -PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC glad_glGetCompressedTextureImage; -PFNGLGETTEXTURELEVELPARAMETERFVPROC glad_glGetTextureLevelParameterfv; -PFNGLGETTEXTURELEVELPARAMETERIVPROC glad_glGetTextureLevelParameteriv; -PFNGLGETTEXTUREPARAMETERFVPROC glad_glGetTextureParameterfv; -PFNGLGETTEXTUREPARAMETERIIVPROC glad_glGetTextureParameterIiv; -PFNGLGETTEXTUREPARAMETERIUIVPROC glad_glGetTextureParameterIuiv; -PFNGLGETTEXTUREPARAMETERIVPROC glad_glGetTextureParameteriv; -PFNGLCREATEVERTEXARRAYSPROC glad_glCreateVertexArrays; -PFNGLDISABLEVERTEXARRAYATTRIBPROC glad_glDisableVertexArrayAttrib; -PFNGLENABLEVERTEXARRAYATTRIBPROC glad_glEnableVertexArrayAttrib; -PFNGLVERTEXARRAYELEMENTBUFFERPROC glad_glVertexArrayElementBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERPROC glad_glVertexArrayVertexBuffer; -PFNGLVERTEXARRAYVERTEXBUFFERSPROC glad_glVertexArrayVertexBuffers; -PFNGLVERTEXARRAYATTRIBBINDINGPROC glad_glVertexArrayAttribBinding; -PFNGLVERTEXARRAYATTRIBFORMATPROC glad_glVertexArrayAttribFormat; -PFNGLVERTEXARRAYATTRIBIFORMATPROC glad_glVertexArrayAttribIFormat; -PFNGLVERTEXARRAYATTRIBLFORMATPROC glad_glVertexArrayAttribLFormat; -PFNGLVERTEXARRAYBINDINGDIVISORPROC glad_glVertexArrayBindingDivisor; -PFNGLGETVERTEXARRAYIVPROC glad_glGetVertexArrayiv; -PFNGLGETVERTEXARRAYINDEXEDIVPROC glad_glGetVertexArrayIndexediv; -PFNGLGETVERTEXARRAYINDEXED64IVPROC glad_glGetVertexArrayIndexed64iv; -PFNGLCREATESAMPLERSPROC glad_glCreateSamplers; -PFNGLCREATEPROGRAMPIPELINESPROC glad_glCreateProgramPipelines; -PFNGLCREATEQUERIESPROC glad_glCreateQueries; -PFNGLGETQUERYBUFFEROBJECTI64VPROC glad_glGetQueryBufferObjecti64v; -PFNGLGETQUERYBUFFEROBJECTIVPROC glad_glGetQueryBufferObjectiv; -PFNGLGETQUERYBUFFEROBJECTUI64VPROC glad_glGetQueryBufferObjectui64v; -PFNGLGETQUERYBUFFEROBJECTUIVPROC glad_glGetQueryBufferObjectuiv; -PFNGLBINDTRANSFORMFEEDBACKNVPROC glad_glBindTransformFeedbackNV; -PFNGLDELETETRANSFORMFEEDBACKSNVPROC glad_glDeleteTransformFeedbacksNV; -PFNGLGENTRANSFORMFEEDBACKSNVPROC glad_glGenTransformFeedbacksNV; -PFNGLISTRANSFORMFEEDBACKNVPROC glad_glIsTransformFeedbackNV; -PFNGLPAUSETRANSFORMFEEDBACKNVPROC glad_glPauseTransformFeedbackNV; -PFNGLRESUMETRANSFORMFEEDBACKNVPROC glad_glResumeTransformFeedbackNV; -PFNGLDRAWTRANSFORMFEEDBACKNVPROC glad_glDrawTransformFeedbackNV; -PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; -PFNGLGETHISTOGRAMEXTPROC glad_glGetHistogramEXT; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC glad_glGetHistogramParameterfvEXT; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC glad_glGetHistogramParameterivEXT; -PFNGLGETMINMAXEXTPROC glad_glGetMinmaxEXT; -PFNGLGETMINMAXPARAMETERFVEXTPROC glad_glGetMinmaxParameterfvEXT; -PFNGLGETMINMAXPARAMETERIVEXTPROC glad_glGetMinmaxParameterivEXT; -PFNGLHISTOGRAMEXTPROC glad_glHistogramEXT; -PFNGLMINMAXEXTPROC glad_glMinmaxEXT; -PFNGLRESETHISTOGRAMEXTPROC glad_glResetHistogramEXT; -PFNGLRESETMINMAXEXTPROC glad_glResetMinmaxEXT; -PFNGLGETTEXTURESUBIMAGEPROC glad_glGetTextureSubImage; -PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC glad_glGetCompressedTextureSubImage; -PFNGLPOINTPARAMETERFSGISPROC glad_glPointParameterfSGIS; -PFNGLPOINTPARAMETERFVSGISPROC glad_glPointParameterfvSGIS; -PFNGLMATRIXLOADFEXTPROC glad_glMatrixLoadfEXT; -PFNGLMATRIXLOADDEXTPROC glad_glMatrixLoaddEXT; -PFNGLMATRIXMULTFEXTPROC glad_glMatrixMultfEXT; -PFNGLMATRIXMULTDEXTPROC glad_glMatrixMultdEXT; -PFNGLMATRIXLOADIDENTITYEXTPROC glad_glMatrixLoadIdentityEXT; -PFNGLMATRIXROTATEFEXTPROC glad_glMatrixRotatefEXT; -PFNGLMATRIXROTATEDEXTPROC glad_glMatrixRotatedEXT; -PFNGLMATRIXSCALEFEXTPROC glad_glMatrixScalefEXT; -PFNGLMATRIXSCALEDEXTPROC glad_glMatrixScaledEXT; -PFNGLMATRIXTRANSLATEFEXTPROC glad_glMatrixTranslatefEXT; -PFNGLMATRIXTRANSLATEDEXTPROC glad_glMatrixTranslatedEXT; -PFNGLMATRIXFRUSTUMEXTPROC glad_glMatrixFrustumEXT; -PFNGLMATRIXORTHOEXTPROC glad_glMatrixOrthoEXT; -PFNGLMATRIXPOPEXTPROC glad_glMatrixPopEXT; -PFNGLMATRIXPUSHEXTPROC glad_glMatrixPushEXT; -PFNGLCLIENTATTRIBDEFAULTEXTPROC glad_glClientAttribDefaultEXT; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC glad_glPushClientAttribDefaultEXT; -PFNGLTEXTUREPARAMETERFEXTPROC glad_glTextureParameterfEXT; -PFNGLTEXTUREPARAMETERFVEXTPROC glad_glTextureParameterfvEXT; -PFNGLTEXTUREPARAMETERIEXTPROC glad_glTextureParameteriEXT; -PFNGLTEXTUREPARAMETERIVEXTPROC glad_glTextureParameterivEXT; -PFNGLTEXTUREIMAGE1DEXTPROC glad_glTextureImage1DEXT; -PFNGLTEXTUREIMAGE2DEXTPROC glad_glTextureImage2DEXT; -PFNGLTEXTURESUBIMAGE1DEXTPROC glad_glTextureSubImage1DEXT; -PFNGLTEXTURESUBIMAGE2DEXTPROC glad_glTextureSubImage2DEXT; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC glad_glCopyTextureImage1DEXT; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC glad_glCopyTextureImage2DEXT; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC glad_glCopyTextureSubImage1DEXT; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC glad_glCopyTextureSubImage2DEXT; -PFNGLGETTEXTUREIMAGEEXTPROC glad_glGetTextureImageEXT; -PFNGLGETTEXTUREPARAMETERFVEXTPROC glad_glGetTextureParameterfvEXT; -PFNGLGETTEXTUREPARAMETERIVEXTPROC glad_glGetTextureParameterivEXT; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC glad_glGetTextureLevelParameterfvEXT; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC glad_glGetTextureLevelParameterivEXT; -PFNGLTEXTUREIMAGE3DEXTPROC glad_glTextureImage3DEXT; -PFNGLTEXTURESUBIMAGE3DEXTPROC glad_glTextureSubImage3DEXT; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC glad_glCopyTextureSubImage3DEXT; -PFNGLBINDMULTITEXTUREEXTPROC glad_glBindMultiTextureEXT; -PFNGLMULTITEXCOORDPOINTEREXTPROC glad_glMultiTexCoordPointerEXT; -PFNGLMULTITEXENVFEXTPROC glad_glMultiTexEnvfEXT; -PFNGLMULTITEXENVFVEXTPROC glad_glMultiTexEnvfvEXT; -PFNGLMULTITEXENVIEXTPROC glad_glMultiTexEnviEXT; -PFNGLMULTITEXENVIVEXTPROC glad_glMultiTexEnvivEXT; -PFNGLMULTITEXGENDEXTPROC glad_glMultiTexGendEXT; -PFNGLMULTITEXGENDVEXTPROC glad_glMultiTexGendvEXT; -PFNGLMULTITEXGENFEXTPROC glad_glMultiTexGenfEXT; -PFNGLMULTITEXGENFVEXTPROC glad_glMultiTexGenfvEXT; -PFNGLMULTITEXGENIEXTPROC glad_glMultiTexGeniEXT; -PFNGLMULTITEXGENIVEXTPROC glad_glMultiTexGenivEXT; -PFNGLGETMULTITEXENVFVEXTPROC glad_glGetMultiTexEnvfvEXT; -PFNGLGETMULTITEXENVIVEXTPROC glad_glGetMultiTexEnvivEXT; -PFNGLGETMULTITEXGENDVEXTPROC glad_glGetMultiTexGendvEXT; -PFNGLGETMULTITEXGENFVEXTPROC glad_glGetMultiTexGenfvEXT; -PFNGLGETMULTITEXGENIVEXTPROC glad_glGetMultiTexGenivEXT; -PFNGLMULTITEXPARAMETERIEXTPROC glad_glMultiTexParameteriEXT; -PFNGLMULTITEXPARAMETERIVEXTPROC glad_glMultiTexParameterivEXT; -PFNGLMULTITEXPARAMETERFEXTPROC glad_glMultiTexParameterfEXT; -PFNGLMULTITEXPARAMETERFVEXTPROC glad_glMultiTexParameterfvEXT; -PFNGLMULTITEXIMAGE1DEXTPROC glad_glMultiTexImage1DEXT; -PFNGLMULTITEXIMAGE2DEXTPROC glad_glMultiTexImage2DEXT; -PFNGLMULTITEXSUBIMAGE1DEXTPROC glad_glMultiTexSubImage1DEXT; -PFNGLMULTITEXSUBIMAGE2DEXTPROC glad_glMultiTexSubImage2DEXT; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC glad_glCopyMultiTexImage1DEXT; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC glad_glCopyMultiTexImage2DEXT; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC glad_glCopyMultiTexSubImage1DEXT; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC glad_glCopyMultiTexSubImage2DEXT; -PFNGLGETMULTITEXIMAGEEXTPROC glad_glGetMultiTexImageEXT; -PFNGLGETMULTITEXPARAMETERFVEXTPROC glad_glGetMultiTexParameterfvEXT; -PFNGLGETMULTITEXPARAMETERIVEXTPROC glad_glGetMultiTexParameterivEXT; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC glad_glGetMultiTexLevelParameterfvEXT; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC glad_glGetMultiTexLevelParameterivEXT; -PFNGLMULTITEXIMAGE3DEXTPROC glad_glMultiTexImage3DEXT; -PFNGLMULTITEXSUBIMAGE3DEXTPROC glad_glMultiTexSubImage3DEXT; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC glad_glCopyMultiTexSubImage3DEXT; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC glad_glEnableClientStateIndexedEXT; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC glad_glDisableClientStateIndexedEXT; -PFNGLGETFLOATINDEXEDVEXTPROC glad_glGetFloatIndexedvEXT; -PFNGLGETDOUBLEINDEXEDVEXTPROC glad_glGetDoubleIndexedvEXT; -PFNGLGETPOINTERINDEXEDVEXTPROC glad_glGetPointerIndexedvEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC glad_glCompressedTextureImage3DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC glad_glCompressedTextureImage2DEXT; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC glad_glCompressedTextureImage1DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC glad_glCompressedTextureSubImage3DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC glad_glCompressedTextureSubImage2DEXT; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC glad_glCompressedTextureSubImage1DEXT; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC glad_glGetCompressedTextureImageEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC glad_glCompressedMultiTexImage3DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC glad_glCompressedMultiTexImage2DEXT; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC glad_glCompressedMultiTexImage1DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC glad_glCompressedMultiTexSubImage3DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC glad_glCompressedMultiTexSubImage2DEXT; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC glad_glCompressedMultiTexSubImage1DEXT; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC glad_glGetCompressedMultiTexImageEXT; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC glad_glMatrixLoadTransposefEXT; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC glad_glMatrixLoadTransposedEXT; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC glad_glMatrixMultTransposefEXT; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC glad_glMatrixMultTransposedEXT; -PFNGLNAMEDBUFFERDATAEXTPROC glad_glNamedBufferDataEXT; -PFNGLNAMEDBUFFERSUBDATAEXTPROC glad_glNamedBufferSubDataEXT; -PFNGLMAPNAMEDBUFFEREXTPROC glad_glMapNamedBufferEXT; -PFNGLUNMAPNAMEDBUFFEREXTPROC glad_glUnmapNamedBufferEXT; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC glad_glGetNamedBufferParameterivEXT; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC glad_glGetNamedBufferPointervEXT; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC glad_glGetNamedBufferSubDataEXT; -PFNGLTEXTUREBUFFEREXTPROC glad_glTextureBufferEXT; -PFNGLMULTITEXBUFFEREXTPROC glad_glMultiTexBufferEXT; -PFNGLTEXTUREPARAMETERIIVEXTPROC glad_glTextureParameterIivEXT; -PFNGLTEXTUREPARAMETERIUIVEXTPROC glad_glTextureParameterIuivEXT; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC glad_glGetTextureParameterIivEXT; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC glad_glGetTextureParameterIuivEXT; -PFNGLMULTITEXPARAMETERIIVEXTPROC glad_glMultiTexParameterIivEXT; -PFNGLMULTITEXPARAMETERIUIVEXTPROC glad_glMultiTexParameterIuivEXT; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC glad_glGetMultiTexParameterIivEXT; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC glad_glGetMultiTexParameterIuivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC glad_glNamedProgramLocalParameters4fvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC glad_glNamedProgramLocalParameterI4iEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC glad_glNamedProgramLocalParameterI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC glad_glNamedProgramLocalParametersI4ivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC glad_glNamedProgramLocalParameterI4uiEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC glad_glNamedProgramLocalParameterI4uivEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC glad_glNamedProgramLocalParametersI4uivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC glad_glGetNamedProgramLocalParameterIivEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC glad_glGetNamedProgramLocalParameterIuivEXT; -PFNGLENABLECLIENTSTATEIEXTPROC glad_glEnableClientStateiEXT; -PFNGLDISABLECLIENTSTATEIEXTPROC glad_glDisableClientStateiEXT; -PFNGLGETFLOATI_VEXTPROC glad_glGetFloati_vEXT; -PFNGLGETDOUBLEI_VEXTPROC glad_glGetDoublei_vEXT; -PFNGLGETPOINTERI_VEXTPROC glad_glGetPointeri_vEXT; -PFNGLNAMEDPROGRAMSTRINGEXTPROC glad_glNamedProgramStringEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC glad_glNamedProgramLocalParameter4dEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC glad_glNamedProgramLocalParameter4dvEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC glad_glNamedProgramLocalParameter4fEXT; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC glad_glNamedProgramLocalParameter4fvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC glad_glGetNamedProgramLocalParameterdvEXT; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC glad_glGetNamedProgramLocalParameterfvEXT; -PFNGLGETNAMEDPROGRAMIVEXTPROC glad_glGetNamedProgramivEXT; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC glad_glGetNamedProgramStringEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC glad_glNamedRenderbufferStorageEXT; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC glad_glGetNamedRenderbufferParameterivEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glNamedRenderbufferStorageMultisampleEXT; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC glad_glNamedRenderbufferStorageMultisampleCoverageEXT; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC glad_glCheckNamedFramebufferStatusEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC glad_glNamedFramebufferTexture1DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC glad_glNamedFramebufferTexture2DEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC glad_glNamedFramebufferTexture3DEXT; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC glad_glNamedFramebufferRenderbufferEXT; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetNamedFramebufferAttachmentParameterivEXT; -PFNGLGENERATETEXTUREMIPMAPEXTPROC glad_glGenerateTextureMipmapEXT; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC glad_glGenerateMultiTexMipmapEXT; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC glad_glFramebufferDrawBufferEXT; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC glad_glFramebufferDrawBuffersEXT; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC glad_glFramebufferReadBufferEXT; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetFramebufferParameterivEXT; -PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC glad_glNamedCopyBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC glad_glNamedFramebufferTextureEXT; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC glad_glNamedFramebufferTextureLayerEXT; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC glad_glNamedFramebufferTextureFaceEXT; -PFNGLTEXTURERENDERBUFFEREXTPROC glad_glTextureRenderbufferEXT; -PFNGLMULTITEXRENDERBUFFEREXTPROC glad_glMultiTexRenderbufferEXT; -PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC glad_glVertexArrayVertexOffsetEXT; -PFNGLVERTEXARRAYCOLOROFFSETEXTPROC glad_glVertexArrayColorOffsetEXT; -PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC glad_glVertexArrayEdgeFlagOffsetEXT; -PFNGLVERTEXARRAYINDEXOFFSETEXTPROC glad_glVertexArrayIndexOffsetEXT; -PFNGLVERTEXARRAYNORMALOFFSETEXTPROC glad_glVertexArrayNormalOffsetEXT; -PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC glad_glVertexArrayTexCoordOffsetEXT; -PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC glad_glVertexArrayMultiTexCoordOffsetEXT; -PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC glad_glVertexArrayFogCoordOffsetEXT; -PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC glad_glVertexArraySecondaryColorOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC glad_glVertexArrayVertexAttribOffsetEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC glad_glVertexArrayVertexAttribIOffsetEXT; -PFNGLENABLEVERTEXARRAYEXTPROC glad_glEnableVertexArrayEXT; -PFNGLDISABLEVERTEXARRAYEXTPROC glad_glDisableVertexArrayEXT; -PFNGLENABLEVERTEXARRAYATTRIBEXTPROC glad_glEnableVertexArrayAttribEXT; -PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC glad_glDisableVertexArrayAttribEXT; -PFNGLGETVERTEXARRAYINTEGERVEXTPROC glad_glGetVertexArrayIntegervEXT; -PFNGLGETVERTEXARRAYPOINTERVEXTPROC glad_glGetVertexArrayPointervEXT; -PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC glad_glGetVertexArrayIntegeri_vEXT; -PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC glad_glGetVertexArrayPointeri_vEXT; -PFNGLMAPNAMEDBUFFERRANGEEXTPROC glad_glMapNamedBufferRangeEXT; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC glad_glFlushMappedNamedBufferRangeEXT; -PFNGLNAMEDBUFFERSTORAGEEXTPROC glad_glNamedBufferStorageEXT; -PFNGLCLEARNAMEDBUFFERDATAEXTPROC glad_glClearNamedBufferDataEXT; -PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC glad_glClearNamedBufferSubDataEXT; -PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC glad_glNamedFramebufferParameteriEXT; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC glad_glGetNamedFramebufferParameterivEXT; -PFNGLPROGRAMUNIFORM1DEXTPROC glad_glProgramUniform1dEXT; -PFNGLPROGRAMUNIFORM2DEXTPROC glad_glProgramUniform2dEXT; -PFNGLPROGRAMUNIFORM3DEXTPROC glad_glProgramUniform3dEXT; -PFNGLPROGRAMUNIFORM4DEXTPROC glad_glProgramUniform4dEXT; -PFNGLPROGRAMUNIFORM1DVEXTPROC glad_glProgramUniform1dvEXT; -PFNGLPROGRAMUNIFORM2DVEXTPROC glad_glProgramUniform2dvEXT; -PFNGLPROGRAMUNIFORM3DVEXTPROC glad_glProgramUniform3dvEXT; -PFNGLPROGRAMUNIFORM4DVEXTPROC glad_glProgramUniform4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC glad_glProgramUniformMatrix2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC glad_glProgramUniformMatrix3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC glad_glProgramUniformMatrix4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC glad_glProgramUniformMatrix2x3dvEXT; -PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC glad_glProgramUniformMatrix2x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC glad_glProgramUniformMatrix3x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC glad_glProgramUniformMatrix3x4dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC glad_glProgramUniformMatrix4x2dvEXT; -PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC glad_glProgramUniformMatrix4x3dvEXT; -PFNGLTEXTUREBUFFERRANGEEXTPROC glad_glTextureBufferRangeEXT; -PFNGLTEXTURESTORAGE1DEXTPROC glad_glTextureStorage1DEXT; -PFNGLTEXTURESTORAGE2DEXTPROC glad_glTextureStorage2DEXT; -PFNGLTEXTURESTORAGE3DEXTPROC glad_glTextureStorage3DEXT; -PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC glad_glTextureStorage2DMultisampleEXT; -PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC glad_glTextureStorage3DMultisampleEXT; -PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC glad_glVertexArrayBindVertexBufferEXT; -PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC glad_glVertexArrayVertexAttribFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC glad_glVertexArrayVertexAttribIFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC glad_glVertexArrayVertexAttribLFormatEXT; -PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC glad_glVertexArrayVertexAttribBindingEXT; -PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC glad_glVertexArrayVertexBindingDivisorEXT; -PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC glad_glVertexArrayVertexAttribLOffsetEXT; -PFNGLTEXTUREPAGECOMMITMENTEXTPROC glad_glTexturePageCommitmentEXT; -PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC glad_glVertexArrayVertexAttribDivisorEXT; -PFNGLSETMULTISAMPLEFVAMDPROC glad_glSetMultisamplefvAMD; -PFNGLAREPROGRAMSRESIDENTNVPROC glad_glAreProgramsResidentNV; -PFNGLBINDPROGRAMNVPROC glad_glBindProgramNV; -PFNGLDELETEPROGRAMSNVPROC glad_glDeleteProgramsNV; -PFNGLEXECUTEPROGRAMNVPROC glad_glExecuteProgramNV; -PFNGLGENPROGRAMSNVPROC glad_glGenProgramsNV; -PFNGLGETPROGRAMPARAMETERDVNVPROC glad_glGetProgramParameterdvNV; -PFNGLGETPROGRAMPARAMETERFVNVPROC glad_glGetProgramParameterfvNV; -PFNGLGETPROGRAMIVNVPROC glad_glGetProgramivNV; -PFNGLGETPROGRAMSTRINGNVPROC glad_glGetProgramStringNV; -PFNGLGETTRACKMATRIXIVNVPROC glad_glGetTrackMatrixivNV; -PFNGLGETVERTEXATTRIBDVNVPROC glad_glGetVertexAttribdvNV; -PFNGLGETVERTEXATTRIBFVNVPROC glad_glGetVertexAttribfvNV; -PFNGLGETVERTEXATTRIBIVNVPROC glad_glGetVertexAttribivNV; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC glad_glGetVertexAttribPointervNV; -PFNGLISPROGRAMNVPROC glad_glIsProgramNV; -PFNGLLOADPROGRAMNVPROC glad_glLoadProgramNV; -PFNGLPROGRAMPARAMETER4DNVPROC glad_glProgramParameter4dNV; -PFNGLPROGRAMPARAMETER4DVNVPROC glad_glProgramParameter4dvNV; -PFNGLPROGRAMPARAMETER4FNVPROC glad_glProgramParameter4fNV; -PFNGLPROGRAMPARAMETER4FVNVPROC glad_glProgramParameter4fvNV; -PFNGLPROGRAMPARAMETERS4DVNVPROC glad_glProgramParameters4dvNV; -PFNGLPROGRAMPARAMETERS4FVNVPROC glad_glProgramParameters4fvNV; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC glad_glRequestResidentProgramsNV; -PFNGLTRACKMATRIXNVPROC glad_glTrackMatrixNV; -PFNGLVERTEXATTRIBPOINTERNVPROC glad_glVertexAttribPointerNV; -PFNGLVERTEXATTRIB1DNVPROC glad_glVertexAttrib1dNV; -PFNGLVERTEXATTRIB1DVNVPROC glad_glVertexAttrib1dvNV; -PFNGLVERTEXATTRIB1FNVPROC glad_glVertexAttrib1fNV; -PFNGLVERTEXATTRIB1FVNVPROC glad_glVertexAttrib1fvNV; -PFNGLVERTEXATTRIB1SNVPROC glad_glVertexAttrib1sNV; -PFNGLVERTEXATTRIB1SVNVPROC glad_glVertexAttrib1svNV; -PFNGLVERTEXATTRIB2DNVPROC glad_glVertexAttrib2dNV; -PFNGLVERTEXATTRIB2DVNVPROC glad_glVertexAttrib2dvNV; -PFNGLVERTEXATTRIB2FNVPROC glad_glVertexAttrib2fNV; -PFNGLVERTEXATTRIB2FVNVPROC glad_glVertexAttrib2fvNV; -PFNGLVERTEXATTRIB2SNVPROC glad_glVertexAttrib2sNV; -PFNGLVERTEXATTRIB2SVNVPROC glad_glVertexAttrib2svNV; -PFNGLVERTEXATTRIB3DNVPROC glad_glVertexAttrib3dNV; -PFNGLVERTEXATTRIB3DVNVPROC glad_glVertexAttrib3dvNV; -PFNGLVERTEXATTRIB3FNVPROC glad_glVertexAttrib3fNV; -PFNGLVERTEXATTRIB3FVNVPROC glad_glVertexAttrib3fvNV; -PFNGLVERTEXATTRIB3SNVPROC glad_glVertexAttrib3sNV; -PFNGLVERTEXATTRIB3SVNVPROC glad_glVertexAttrib3svNV; -PFNGLVERTEXATTRIB4DNVPROC glad_glVertexAttrib4dNV; -PFNGLVERTEXATTRIB4DVNVPROC glad_glVertexAttrib4dvNV; -PFNGLVERTEXATTRIB4FNVPROC glad_glVertexAttrib4fNV; -PFNGLVERTEXATTRIB4FVNVPROC glad_glVertexAttrib4fvNV; -PFNGLVERTEXATTRIB4SNVPROC glad_glVertexAttrib4sNV; -PFNGLVERTEXATTRIB4SVNVPROC glad_glVertexAttrib4svNV; -PFNGLVERTEXATTRIB4UBNVPROC glad_glVertexAttrib4ubNV; -PFNGLVERTEXATTRIB4UBVNVPROC glad_glVertexAttrib4ubvNV; -PFNGLVERTEXATTRIBS1DVNVPROC glad_glVertexAttribs1dvNV; -PFNGLVERTEXATTRIBS1FVNVPROC glad_glVertexAttribs1fvNV; -PFNGLVERTEXATTRIBS1SVNVPROC glad_glVertexAttribs1svNV; -PFNGLVERTEXATTRIBS2DVNVPROC glad_glVertexAttribs2dvNV; -PFNGLVERTEXATTRIBS2FVNVPROC glad_glVertexAttribs2fvNV; -PFNGLVERTEXATTRIBS2SVNVPROC glad_glVertexAttribs2svNV; -PFNGLVERTEXATTRIBS3DVNVPROC glad_glVertexAttribs3dvNV; -PFNGLVERTEXATTRIBS3FVNVPROC glad_glVertexAttribs3fvNV; -PFNGLVERTEXATTRIBS3SVNVPROC glad_glVertexAttribs3svNV; -PFNGLVERTEXATTRIBS4DVNVPROC glad_glVertexAttribs4dvNV; -PFNGLVERTEXATTRIBS4FVNVPROC glad_glVertexAttribs4fvNV; -PFNGLVERTEXATTRIBS4SVNVPROC glad_glVertexAttribs4svNV; -PFNGLVERTEXATTRIBS4UBVNVPROC glad_glVertexAttribs4ubvNV; -PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; -PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; -PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; -PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; -PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; -PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; -PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; -PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; -PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; -PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; -PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; -PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; -PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; -PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; -PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; -PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; -PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; -PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; -PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; -PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; -PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; -PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; -PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; -PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; -PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; -PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; -PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; -PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; -PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; -PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; -PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; -PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; -PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; -PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; -PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; -PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; -PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; -PFNGLGENFENCESAPPLEPROC glad_glGenFencesAPPLE; -PFNGLDELETEFENCESAPPLEPROC glad_glDeleteFencesAPPLE; -PFNGLSETFENCEAPPLEPROC glad_glSetFenceAPPLE; -PFNGLISFENCEAPPLEPROC glad_glIsFenceAPPLE; -PFNGLTESTFENCEAPPLEPROC glad_glTestFenceAPPLE; -PFNGLFINISHFENCEAPPLEPROC glad_glFinishFenceAPPLE; -PFNGLTESTOBJECTAPPLEPROC glad_glTestObjectAPPLE; -PFNGLFINISHOBJECTAPPLEPROC glad_glFinishObjectAPPLE; -PFNGLMULTITEXCOORD1BOESPROC glad_glMultiTexCoord1bOES; -PFNGLMULTITEXCOORD1BVOESPROC glad_glMultiTexCoord1bvOES; -PFNGLMULTITEXCOORD2BOESPROC glad_glMultiTexCoord2bOES; -PFNGLMULTITEXCOORD2BVOESPROC glad_glMultiTexCoord2bvOES; -PFNGLMULTITEXCOORD3BOESPROC glad_glMultiTexCoord3bOES; -PFNGLMULTITEXCOORD3BVOESPROC glad_glMultiTexCoord3bvOES; -PFNGLMULTITEXCOORD4BOESPROC glad_glMultiTexCoord4bOES; -PFNGLMULTITEXCOORD4BVOESPROC glad_glMultiTexCoord4bvOES; -PFNGLTEXCOORD1BOESPROC glad_glTexCoord1bOES; -PFNGLTEXCOORD1BVOESPROC glad_glTexCoord1bvOES; -PFNGLTEXCOORD2BOESPROC glad_glTexCoord2bOES; -PFNGLTEXCOORD2BVOESPROC glad_glTexCoord2bvOES; -PFNGLTEXCOORD3BOESPROC glad_glTexCoord3bOES; -PFNGLTEXCOORD3BVOESPROC glad_glTexCoord3bvOES; -PFNGLTEXCOORD4BOESPROC glad_glTexCoord4bOES; -PFNGLTEXCOORD4BVOESPROC glad_glTexCoord4bvOES; -PFNGLVERTEX2BOESPROC glad_glVertex2bOES; -PFNGLVERTEX2BVOESPROC glad_glVertex2bvOES; -PFNGLVERTEX3BOESPROC glad_glVertex3bOES; -PFNGLVERTEX3BVOESPROC glad_glVertex3bvOES; -PFNGLVERTEX4BOESPROC glad_glVertex4bOES; -PFNGLVERTEX4BVOESPROC glad_glVertex4bvOES; -PFNGLLOADTRANSPOSEMATRIXFARBPROC glad_glLoadTransposeMatrixfARB; -PFNGLLOADTRANSPOSEMATRIXDARBPROC glad_glLoadTransposeMatrixdARB; -PFNGLMULTTRANSPOSEMATRIXFARBPROC glad_glMultTransposeMatrixfARB; -PFNGLMULTTRANSPOSEMATRIXDARBPROC glad_glMultTransposeMatrixdARB; -PFNGLFOGCOORDFEXTPROC glad_glFogCoordfEXT; -PFNGLFOGCOORDFVEXTPROC glad_glFogCoordfvEXT; -PFNGLFOGCOORDDEXTPROC glad_glFogCoorddEXT; -PFNGLFOGCOORDDVEXTPROC glad_glFogCoorddvEXT; -PFNGLFOGCOORDPOINTEREXTPROC glad_glFogCoordPointerEXT; -PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; -PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; -PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; -PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; -PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; -PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; -PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; -PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; -PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; -PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; -PFNGLCOVERAGEMODULATIONTABLENVPROC glad_glCoverageModulationTableNV; -PFNGLGETCOVERAGEMODULATIONTABLENVPROC glad_glGetCoverageModulationTableNV; -PFNGLCOVERAGEMODULATIONNVPROC glad_glCoverageModulationNV; -PFNGLBEGINCONDITIONALRENDERNVXPROC glad_glBeginConditionalRenderNVX; -PFNGLENDCONDITIONALRENDERNVXPROC glad_glEndConditionalRenderNVX; -PFNGLMULTIDRAWARRAYSINDIRECTPROC glad_glMultiDrawArraysIndirect; -PFNGLMULTIDRAWELEMENTSINDIRECTPROC glad_glMultiDrawElementsIndirect; -PFNGLCOPYIMAGESUBDATANVPROC glad_glCopyImageSubDataNV; -PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC glad_glApplyFramebufferAttachmentCMAAINTEL; -PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback; -PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks; -PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks; -PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback; -PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback; -PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKPROC glad_glDrawTransformFeedback; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC glad_glDrawTransformFeedbackStream; -PFNGLBEGINQUERYINDEXEDPROC glad_glBeginQueryIndexed; -PFNGLENDQUERYINDEXEDPROC glad_glEndQueryIndexed; -PFNGLGETQUERYINDEXEDIVPROC glad_glGetQueryIndexediv; -PFNGLINSERTEVENTMARKEREXTPROC glad_glInsertEventMarkerEXT; -PFNGLPUSHGROUPMARKEREXTPROC glad_glPushGroupMarkerEXT; -PFNGLPOPGROUPMARKEREXTPROC glad_glPopGroupMarkerEXT; -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC glad_glPixelTransformParameteriEXT; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC glad_glPixelTransformParameterfEXT; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC glad_glPixelTransformParameterivEXT; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC glad_glPixelTransformParameterfvEXT; -PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC glad_glGetPixelTransformParameterivEXT; -PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC glad_glGetPixelTransformParameterfvEXT; -PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; -PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; -PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; -PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; -PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; -PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; -PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; -PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; -PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; -PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; -PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; -PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; -PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; -PFNGLREPLACEMENTCODEUISUNPROC glad_glReplacementCodeuiSUN; -PFNGLREPLACEMENTCODEUSSUNPROC glad_glReplacementCodeusSUN; -PFNGLREPLACEMENTCODEUBSUNPROC glad_glReplacementCodeubSUN; -PFNGLREPLACEMENTCODEUIVSUNPROC glad_glReplacementCodeuivSUN; -PFNGLREPLACEMENTCODEUSVSUNPROC glad_glReplacementCodeusvSUN; -PFNGLREPLACEMENTCODEUBVSUNPROC glad_glReplacementCodeubvSUN; -PFNGLREPLACEMENTCODEPOINTERSUNPROC glad_glReplacementCodePointerSUN; -PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC glad_glDrawTransformFeedbackInstanced; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC glad_glDrawTransformFeedbackStreamInstanced; -PFNGLASYNCMARKERSGIXPROC glad_glAsyncMarkerSGIX; -PFNGLFINISHASYNCSGIXPROC glad_glFinishAsyncSGIX; -PFNGLPOLLASYNCSGIXPROC glad_glPollAsyncSGIX; -PFNGLGENASYNCMARKERSSGIXPROC glad_glGenAsyncMarkersSGIX; -PFNGLDELETEASYNCMARKERSSGIXPROC glad_glDeleteAsyncMarkersSGIX; -PFNGLISASYNCMARKERSGIXPROC glad_glIsAsyncMarkerSGIX; -PFNGLBEGINPERFQUERYINTELPROC glad_glBeginPerfQueryINTEL; -PFNGLCREATEPERFQUERYINTELPROC glad_glCreatePerfQueryINTEL; -PFNGLDELETEPERFQUERYINTELPROC glad_glDeletePerfQueryINTEL; -PFNGLENDPERFQUERYINTELPROC glad_glEndPerfQueryINTEL; -PFNGLGETFIRSTPERFQUERYIDINTELPROC glad_glGetFirstPerfQueryIdINTEL; -PFNGLGETNEXTPERFQUERYIDINTELPROC glad_glGetNextPerfQueryIdINTEL; -PFNGLGETPERFCOUNTERINFOINTELPROC glad_glGetPerfCounterInfoINTEL; -PFNGLGETPERFQUERYDATAINTELPROC glad_glGetPerfQueryDataINTEL; -PFNGLGETPERFQUERYIDBYNAMEINTELPROC glad_glGetPerfQueryIdByNameINTEL; -PFNGLGETPERFQUERYINFOINTELPROC glad_glGetPerfQueryInfoINTEL; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawArraysIndirectBindlessCountNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC glad_glMultiDrawElementsIndirectBindlessCountNV; -PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -PFNGLSHADERBINARYPROC glad_glShaderBinary; -PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC glad_glMultiDrawArraysIndirectCountARB; -PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC glad_glMultiDrawElementsIndirectCountARB; -PFNGLVERTEX2HNVPROC glad_glVertex2hNV; -PFNGLVERTEX2HVNVPROC glad_glVertex2hvNV; -PFNGLVERTEX3HNVPROC glad_glVertex3hNV; -PFNGLVERTEX3HVNVPROC glad_glVertex3hvNV; -PFNGLVERTEX4HNVPROC glad_glVertex4hNV; -PFNGLVERTEX4HVNVPROC glad_glVertex4hvNV; -PFNGLNORMAL3HNVPROC glad_glNormal3hNV; -PFNGLNORMAL3HVNVPROC glad_glNormal3hvNV; -PFNGLCOLOR3HNVPROC glad_glColor3hNV; -PFNGLCOLOR3HVNVPROC glad_glColor3hvNV; -PFNGLCOLOR4HNVPROC glad_glColor4hNV; -PFNGLCOLOR4HVNVPROC glad_glColor4hvNV; -PFNGLTEXCOORD1HNVPROC glad_glTexCoord1hNV; -PFNGLTEXCOORD1HVNVPROC glad_glTexCoord1hvNV; -PFNGLTEXCOORD2HNVPROC glad_glTexCoord2hNV; -PFNGLTEXCOORD2HVNVPROC glad_glTexCoord2hvNV; -PFNGLTEXCOORD3HNVPROC glad_glTexCoord3hNV; -PFNGLTEXCOORD3HVNVPROC glad_glTexCoord3hvNV; -PFNGLTEXCOORD4HNVPROC glad_glTexCoord4hNV; -PFNGLTEXCOORD4HVNVPROC glad_glTexCoord4hvNV; -PFNGLMULTITEXCOORD1HNVPROC glad_glMultiTexCoord1hNV; -PFNGLMULTITEXCOORD1HVNVPROC glad_glMultiTexCoord1hvNV; -PFNGLMULTITEXCOORD2HNVPROC glad_glMultiTexCoord2hNV; -PFNGLMULTITEXCOORD2HVNVPROC glad_glMultiTexCoord2hvNV; -PFNGLMULTITEXCOORD3HNVPROC glad_glMultiTexCoord3hNV; -PFNGLMULTITEXCOORD3HVNVPROC glad_glMultiTexCoord3hvNV; -PFNGLMULTITEXCOORD4HNVPROC glad_glMultiTexCoord4hNV; -PFNGLMULTITEXCOORD4HVNVPROC glad_glMultiTexCoord4hvNV; -PFNGLFOGCOORDHNVPROC glad_glFogCoordhNV; -PFNGLFOGCOORDHVNVPROC glad_glFogCoordhvNV; -PFNGLSECONDARYCOLOR3HNVPROC glad_glSecondaryColor3hNV; -PFNGLSECONDARYCOLOR3HVNVPROC glad_glSecondaryColor3hvNV; -PFNGLVERTEXWEIGHTHNVPROC glad_glVertexWeighthNV; -PFNGLVERTEXWEIGHTHVNVPROC glad_glVertexWeighthvNV; -PFNGLVERTEXATTRIB1HNVPROC glad_glVertexAttrib1hNV; -PFNGLVERTEXATTRIB1HVNVPROC glad_glVertexAttrib1hvNV; -PFNGLVERTEXATTRIB2HNVPROC glad_glVertexAttrib2hNV; -PFNGLVERTEXATTRIB2HVNVPROC glad_glVertexAttrib2hvNV; -PFNGLVERTEXATTRIB3HNVPROC glad_glVertexAttrib3hNV; -PFNGLVERTEXATTRIB3HVNVPROC glad_glVertexAttrib3hvNV; -PFNGLVERTEXATTRIB4HNVPROC glad_glVertexAttrib4hNV; -PFNGLVERTEXATTRIB4HVNVPROC glad_glVertexAttrib4hvNV; -PFNGLVERTEXATTRIBS1HVNVPROC glad_glVertexAttribs1hvNV; -PFNGLVERTEXATTRIBS2HVNVPROC glad_glVertexAttribs2hvNV; -PFNGLVERTEXATTRIBS3HVNVPROC glad_glVertexAttribs3hvNV; -PFNGLVERTEXATTRIBS4HVNVPROC glad_glVertexAttribs4hvNV; -PFNGLPRIMITIVEBOUNDINGBOXARBPROC glad_glPrimitiveBoundingBoxARB; -PFNGLPOLYGONOFFSETCLAMPEXTPROC glad_glPolygonOffsetClampEXT; -PFNGLLOCKARRAYSEXTPROC glad_glLockArraysEXT; -PFNGLUNLOCKARRAYSEXTPROC glad_glUnlockArraysEXT; -PFNGLDEPTHRANGEDNVPROC glad_glDepthRangedNV; -PFNGLCLEARDEPTHDNVPROC glad_glClearDepthdNV; -PFNGLDEPTHBOUNDSDNVPROC glad_glDepthBoundsdNV; -PFNGLGENOCCLUSIONQUERIESNVPROC glad_glGenOcclusionQueriesNV; -PFNGLDELETEOCCLUSIONQUERIESNVPROC glad_glDeleteOcclusionQueriesNV; -PFNGLISOCCLUSIONQUERYNVPROC glad_glIsOcclusionQueryNV; -PFNGLBEGINOCCLUSIONQUERYNVPROC glad_glBeginOcclusionQueryNV; -PFNGLENDOCCLUSIONQUERYNVPROC glad_glEndOcclusionQueryNV; -PFNGLGETOCCLUSIONQUERYIVNVPROC glad_glGetOcclusionQueryivNV; -PFNGLGETOCCLUSIONQUERYUIVNVPROC glad_glGetOcclusionQueryuivNV; -PFNGLBUFFERPARAMETERIAPPLEPROC glad_glBufferParameteriAPPLE; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glad_glFlushMappedBufferRangeAPPLE; -PFNGLCOLORTABLEPROC glad_glColorTable; -PFNGLCOLORTABLEPARAMETERFVPROC glad_glColorTableParameterfv; -PFNGLCOLORTABLEPARAMETERIVPROC glad_glColorTableParameteriv; -PFNGLCOPYCOLORTABLEPROC glad_glCopyColorTable; -PFNGLGETCOLORTABLEPROC glad_glGetColorTable; -PFNGLGETCOLORTABLEPARAMETERFVPROC glad_glGetColorTableParameterfv; -PFNGLGETCOLORTABLEPARAMETERIVPROC glad_glGetColorTableParameteriv; -PFNGLCOLORSUBTABLEPROC glad_glColorSubTable; -PFNGLCOPYCOLORSUBTABLEPROC glad_glCopyColorSubTable; -PFNGLCONVOLUTIONFILTER1DPROC glad_glConvolutionFilter1D; -PFNGLCONVOLUTIONFILTER2DPROC glad_glConvolutionFilter2D; -PFNGLCONVOLUTIONPARAMETERFPROC glad_glConvolutionParameterf; -PFNGLCONVOLUTIONPARAMETERFVPROC glad_glConvolutionParameterfv; -PFNGLCONVOLUTIONPARAMETERIPROC glad_glConvolutionParameteri; -PFNGLCONVOLUTIONPARAMETERIVPROC glad_glConvolutionParameteriv; -PFNGLCOPYCONVOLUTIONFILTER1DPROC glad_glCopyConvolutionFilter1D; -PFNGLCOPYCONVOLUTIONFILTER2DPROC glad_glCopyConvolutionFilter2D; -PFNGLGETCONVOLUTIONFILTERPROC glad_glGetConvolutionFilter; -PFNGLGETCONVOLUTIONPARAMETERFVPROC glad_glGetConvolutionParameterfv; -PFNGLGETCONVOLUTIONPARAMETERIVPROC glad_glGetConvolutionParameteriv; -PFNGLGETSEPARABLEFILTERPROC glad_glGetSeparableFilter; -PFNGLSEPARABLEFILTER2DPROC glad_glSeparableFilter2D; -PFNGLGETHISTOGRAMPROC glad_glGetHistogram; -PFNGLGETHISTOGRAMPARAMETERFVPROC glad_glGetHistogramParameterfv; -PFNGLGETHISTOGRAMPARAMETERIVPROC glad_glGetHistogramParameteriv; -PFNGLGETMINMAXPROC glad_glGetMinmax; -PFNGLGETMINMAXPARAMETERFVPROC glad_glGetMinmaxParameterfv; -PFNGLGETMINMAXPARAMETERIVPROC glad_glGetMinmaxParameteriv; -PFNGLHISTOGRAMPROC glad_glHistogram; -PFNGLMINMAXPROC glad_glMinmax; -PFNGLRESETHISTOGRAMPROC glad_glResetHistogram; -PFNGLRESETMINMAXPROC glad_glResetMinmax; -PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; -PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; -PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; -PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; -PFNGLCLEARBUFFERDATAPROC glad_glClearBufferData; -PFNGLCLEARBUFFERSUBDATAPROC glad_glClearBufferSubData; -PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -PFNGLLABELOBJECTEXTPROC glad_glLabelObjectEXT; -PFNGLGETOBJECTLABELEXTPROC glad_glGetObjectLabelEXT; -PFNGLMINSAMPLESHADINGARBPROC glad_glMinSampleShadingARB; -PFNGLGETINTERNALFORMATSAMPLEIVNVPROC glad_glGetInternalformatSampleivNV; -PFNGLSYNCTEXTUREINTELPROC glad_glSyncTextureINTEL; -PFNGLUNMAPTEXTURE2DINTELPROC glad_glUnmapTexture2DINTEL; -PFNGLMAPTEXTURE2DINTELPROC glad_glMapTexture2DINTEL; -PFNGLDISPATCHCOMPUTEPROC glad_glDispatchCompute; -PFNGLDISPATCHCOMPUTEINDIRECTPROC glad_glDispatchComputeIndirect; -PFNGLCOLORPOINTERLISTIBMPROC glad_glColorPointerListIBM; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC glad_glSecondaryColorPointerListIBM; -PFNGLEDGEFLAGPOINTERLISTIBMPROC glad_glEdgeFlagPointerListIBM; -PFNGLFOGCOORDPOINTERLISTIBMPROC glad_glFogCoordPointerListIBM; -PFNGLINDEXPOINTERLISTIBMPROC glad_glIndexPointerListIBM; -PFNGLNORMALPOINTERLISTIBMPROC glad_glNormalPointerListIBM; -PFNGLTEXCOORDPOINTERLISTIBMPROC glad_glTexCoordPointerListIBM; -PFNGLVERTEXPOINTERLISTIBMPROC glad_glVertexPointerListIBM; -PFNGLCLAMPCOLORARBPROC glad_glClampColorARB; -PFNGLGETTEXTUREHANDLEARBPROC glad_glGetTextureHandleARB; -PFNGLGETTEXTURESAMPLERHANDLEARBPROC glad_glGetTextureSamplerHandleARB; -PFNGLMAKETEXTUREHANDLERESIDENTARBPROC glad_glMakeTextureHandleResidentARB; -PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC glad_glMakeTextureHandleNonResidentARB; -PFNGLGETIMAGEHANDLEARBPROC glad_glGetImageHandleARB; -PFNGLMAKEIMAGEHANDLERESIDENTARBPROC glad_glMakeImageHandleResidentARB; -PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC glad_glMakeImageHandleNonResidentARB; -PFNGLUNIFORMHANDLEUI64ARBPROC glad_glUniformHandleui64ARB; -PFNGLUNIFORMHANDLEUI64VARBPROC glad_glUniformHandleui64vARB; -PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC glad_glProgramUniformHandleui64ARB; -PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC glad_glProgramUniformHandleui64vARB; -PFNGLISTEXTUREHANDLERESIDENTARBPROC glad_glIsTextureHandleResidentARB; -PFNGLISIMAGEHANDLERESIDENTARBPROC glad_glIsImageHandleResidentARB; -PFNGLVERTEXATTRIBL1UI64ARBPROC glad_glVertexAttribL1ui64ARB; -PFNGLVERTEXATTRIBL1UI64VARBPROC glad_glVertexAttribL1ui64vARB; -PFNGLGETVERTEXATTRIBLUI64VARBPROC glad_glGetVertexAttribLui64vARB; -PFNGLWINDOWPOS2DARBPROC glad_glWindowPos2dARB; -PFNGLWINDOWPOS2DVARBPROC glad_glWindowPos2dvARB; -PFNGLWINDOWPOS2FARBPROC glad_glWindowPos2fARB; -PFNGLWINDOWPOS2FVARBPROC glad_glWindowPos2fvARB; -PFNGLWINDOWPOS2IARBPROC glad_glWindowPos2iARB; -PFNGLWINDOWPOS2IVARBPROC glad_glWindowPos2ivARB; -PFNGLWINDOWPOS2SARBPROC glad_glWindowPos2sARB; -PFNGLWINDOWPOS2SVARBPROC glad_glWindowPos2svARB; -PFNGLWINDOWPOS3DARBPROC glad_glWindowPos3dARB; -PFNGLWINDOWPOS3DVARBPROC glad_glWindowPos3dvARB; -PFNGLWINDOWPOS3FARBPROC glad_glWindowPos3fARB; -PFNGLWINDOWPOS3FVARBPROC glad_glWindowPos3fvARB; -PFNGLWINDOWPOS3IARBPROC glad_glWindowPos3iARB; -PFNGLWINDOWPOS3IVARBPROC glad_glWindowPos3ivARB; -PFNGLWINDOWPOS3SARBPROC glad_glWindowPos3sARB; -PFNGLWINDOWPOS3SVARBPROC glad_glWindowPos3svARB; -PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ; -PFNGLBINDIMAGETEXTUREEXTPROC glad_glBindImageTextureEXT; -PFNGLMEMORYBARRIEREXTPROC glad_glMemoryBarrierEXT; -PFNGLCOPYTEXIMAGE1DEXTPROC glad_glCopyTexImage1DEXT; -PFNGLCOPYTEXIMAGE2DEXTPROC glad_glCopyTexImage2DEXT; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC glad_glCopyTexSubImage1DEXT; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC glad_glCopyTexSubImage2DEXT; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC glad_glCopyTexSubImage3DEXT; -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC glad_glCombinerStageParameterfvNV; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC glad_glGetCombinerStageParameterfvNV; -PFNGLDRAWTEXTURENVPROC glad_glDrawTextureNV; -PFNGLDRAWARRAYSINSTANCEDEXTPROC glad_glDrawArraysInstancedEXT; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC glad_glDrawElementsInstancedEXT; -PFNGLVIEWPORTARRAYVPROC glad_glViewportArrayv; -PFNGLVIEWPORTINDEXEDFPROC glad_glViewportIndexedf; -PFNGLVIEWPORTINDEXEDFVPROC glad_glViewportIndexedfv; -PFNGLSCISSORARRAYVPROC glad_glScissorArrayv; -PFNGLSCISSORINDEXEDPROC glad_glScissorIndexed; -PFNGLSCISSORINDEXEDVPROC glad_glScissorIndexedv; -PFNGLDEPTHRANGEARRAYVPROC glad_glDepthRangeArrayv; -PFNGLDEPTHRANGEINDEXEDPROC glad_glDepthRangeIndexed; -PFNGLGETFLOATI_VPROC glad_glGetFloati_v; -PFNGLGETDOUBLEI_VPROC glad_glGetDoublei_v; -PFNGLUSEPROGRAMSTAGESPROC glad_glUseProgramStages; -PFNGLACTIVESHADERPROGRAMPROC glad_glActiveShaderProgram; -PFNGLCREATESHADERPROGRAMVPROC glad_glCreateShaderProgramv; -PFNGLBINDPROGRAMPIPELINEPROC glad_glBindProgramPipeline; -PFNGLDELETEPROGRAMPIPELINESPROC glad_glDeleteProgramPipelines; -PFNGLGENPROGRAMPIPELINESPROC glad_glGenProgramPipelines; -PFNGLISPROGRAMPIPELINEPROC glad_glIsProgramPipeline; -PFNGLGETPROGRAMPIPELINEIVPROC glad_glGetProgramPipelineiv; -PFNGLPROGRAMUNIFORM1IPROC glad_glProgramUniform1i; -PFNGLPROGRAMUNIFORM1IVPROC glad_glProgramUniform1iv; -PFNGLPROGRAMUNIFORM1FPROC glad_glProgramUniform1f; -PFNGLPROGRAMUNIFORM1FVPROC glad_glProgramUniform1fv; -PFNGLPROGRAMUNIFORM1DPROC glad_glProgramUniform1d; -PFNGLPROGRAMUNIFORM1DVPROC glad_glProgramUniform1dv; -PFNGLPROGRAMUNIFORM1UIPROC glad_glProgramUniform1ui; -PFNGLPROGRAMUNIFORM1UIVPROC glad_glProgramUniform1uiv; -PFNGLPROGRAMUNIFORM2IPROC glad_glProgramUniform2i; -PFNGLPROGRAMUNIFORM2IVPROC glad_glProgramUniform2iv; -PFNGLPROGRAMUNIFORM2FPROC glad_glProgramUniform2f; -PFNGLPROGRAMUNIFORM2FVPROC glad_glProgramUniform2fv; -PFNGLPROGRAMUNIFORM2DPROC glad_glProgramUniform2d; -PFNGLPROGRAMUNIFORM2DVPROC glad_glProgramUniform2dv; -PFNGLPROGRAMUNIFORM2UIPROC glad_glProgramUniform2ui; -PFNGLPROGRAMUNIFORM2UIVPROC glad_glProgramUniform2uiv; -PFNGLPROGRAMUNIFORM3IPROC glad_glProgramUniform3i; -PFNGLPROGRAMUNIFORM3IVPROC glad_glProgramUniform3iv; -PFNGLPROGRAMUNIFORM3FPROC glad_glProgramUniform3f; -PFNGLPROGRAMUNIFORM3FVPROC glad_glProgramUniform3fv; -PFNGLPROGRAMUNIFORM3DPROC glad_glProgramUniform3d; -PFNGLPROGRAMUNIFORM3DVPROC glad_glProgramUniform3dv; -PFNGLPROGRAMUNIFORM3UIPROC glad_glProgramUniform3ui; -PFNGLPROGRAMUNIFORM3UIVPROC glad_glProgramUniform3uiv; -PFNGLPROGRAMUNIFORM4IPROC glad_glProgramUniform4i; -PFNGLPROGRAMUNIFORM4IVPROC glad_glProgramUniform4iv; -PFNGLPROGRAMUNIFORM4FPROC glad_glProgramUniform4f; -PFNGLPROGRAMUNIFORM4FVPROC glad_glProgramUniform4fv; -PFNGLPROGRAMUNIFORM4DPROC glad_glProgramUniform4d; -PFNGLPROGRAMUNIFORM4DVPROC glad_glProgramUniform4dv; -PFNGLPROGRAMUNIFORM4UIPROC glad_glProgramUniform4ui; -PFNGLPROGRAMUNIFORM4UIVPROC glad_glProgramUniform4uiv; -PFNGLPROGRAMUNIFORMMATRIX2FVPROC glad_glProgramUniformMatrix2fv; -PFNGLPROGRAMUNIFORMMATRIX3FVPROC glad_glProgramUniformMatrix3fv; -PFNGLPROGRAMUNIFORMMATRIX4FVPROC glad_glProgramUniformMatrix4fv; -PFNGLPROGRAMUNIFORMMATRIX2DVPROC glad_glProgramUniformMatrix2dv; -PFNGLPROGRAMUNIFORMMATRIX3DVPROC glad_glProgramUniformMatrix3dv; -PFNGLPROGRAMUNIFORMMATRIX4DVPROC glad_glProgramUniformMatrix4dv; -PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glad_glProgramUniformMatrix2x3fv; -PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glad_glProgramUniformMatrix3x2fv; -PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glad_glProgramUniformMatrix2x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glad_glProgramUniformMatrix4x2fv; -PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glad_glProgramUniformMatrix3x4fv; -PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glad_glProgramUniformMatrix4x3fv; -PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC glad_glProgramUniformMatrix2x3dv; -PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC glad_glProgramUniformMatrix3x2dv; -PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC glad_glProgramUniformMatrix2x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC glad_glProgramUniformMatrix4x2dv; -PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC glad_glProgramUniformMatrix3x4dv; -PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC glad_glProgramUniformMatrix4x3dv; -PFNGLVALIDATEPROGRAMPIPELINEPROC glad_glValidateProgramPipeline; -PFNGLGETPROGRAMPIPELINEINFOLOGPROC glad_glGetProgramPipelineInfoLog; -PFNGLDEPTHBOUNDSEXTPROC glad_glDepthBoundsEXT; -PFNGLBEGINVIDEOCAPTURENVPROC glad_glBeginVideoCaptureNV; -PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glad_glBindVideoCaptureStreamBufferNV; -PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glad_glBindVideoCaptureStreamTextureNV; -PFNGLENDVIDEOCAPTURENVPROC glad_glEndVideoCaptureNV; -PFNGLGETVIDEOCAPTUREIVNVPROC glad_glGetVideoCaptureivNV; -PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glad_glGetVideoCaptureStreamivNV; -PFNGLGETVIDEOCAPTURESTREAMFVNVPROC glad_glGetVideoCaptureStreamfvNV; -PFNGLGETVIDEOCAPTURESTREAMDVNVPROC glad_glGetVideoCaptureStreamdvNV; -PFNGLVIDEOCAPTURENVPROC glad_glVideoCaptureNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glad_glVideoCaptureStreamParameterivNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glad_glVideoCaptureStreamParameterfvNV; -PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC glad_glVideoCaptureStreamParameterdvNV; -PFNGLCURRENTPALETTEMATRIXARBPROC glad_glCurrentPaletteMatrixARB; -PFNGLMATRIXINDEXUBVARBPROC glad_glMatrixIndexubvARB; -PFNGLMATRIXINDEXUSVARBPROC glad_glMatrixIndexusvARB; -PFNGLMATRIXINDEXUIVARBPROC glad_glMatrixIndexuivARB; -PFNGLMATRIXINDEXPOINTERARBPROC glad_glMatrixIndexPointerARB; -PFNGLTEXTURECOLORMASKSGISPROC glad_glTextureColorMaskSGIS; -PFNGLTANGENT3BEXTPROC glad_glTangent3bEXT; -PFNGLTANGENT3BVEXTPROC glad_glTangent3bvEXT; -PFNGLTANGENT3DEXTPROC glad_glTangent3dEXT; -PFNGLTANGENT3DVEXTPROC glad_glTangent3dvEXT; -PFNGLTANGENT3FEXTPROC glad_glTangent3fEXT; -PFNGLTANGENT3FVEXTPROC glad_glTangent3fvEXT; -PFNGLTANGENT3IEXTPROC glad_glTangent3iEXT; -PFNGLTANGENT3IVEXTPROC glad_glTangent3ivEXT; -PFNGLTANGENT3SEXTPROC glad_glTangent3sEXT; -PFNGLTANGENT3SVEXTPROC glad_glTangent3svEXT; -PFNGLBINORMAL3BEXTPROC glad_glBinormal3bEXT; -PFNGLBINORMAL3BVEXTPROC glad_glBinormal3bvEXT; -PFNGLBINORMAL3DEXTPROC glad_glBinormal3dEXT; -PFNGLBINORMAL3DVEXTPROC glad_glBinormal3dvEXT; -PFNGLBINORMAL3FEXTPROC glad_glBinormal3fEXT; -PFNGLBINORMAL3FVEXTPROC glad_glBinormal3fvEXT; -PFNGLBINORMAL3IEXTPROC glad_glBinormal3iEXT; -PFNGLBINORMAL3IVEXTPROC glad_glBinormal3ivEXT; -PFNGLBINORMAL3SEXTPROC glad_glBinormal3sEXT; -PFNGLBINORMAL3SVEXTPROC glad_glBinormal3svEXT; -PFNGLTANGENTPOINTEREXTPROC glad_glTangentPointerEXT; -PFNGLBINORMALPOINTEREXTPROC glad_glBinormalPointerEXT; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; -PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC glad_glGetSubroutineUniformLocation; -PFNGLGETSUBROUTINEINDEXPROC glad_glGetSubroutineIndex; -PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC glad_glGetActiveSubroutineUniformiv; -PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC glad_glGetActiveSubroutineUniformName; -PFNGLGETACTIVESUBROUTINENAMEPROC glad_glGetActiveSubroutineName; -PFNGLUNIFORMSUBROUTINESUIVPROC glad_glUniformSubroutinesuiv; -PFNGLGETUNIFORMSUBROUTINEUIVPROC glad_glGetUniformSubroutineuiv; -PFNGLGETPROGRAMSTAGEIVPROC glad_glGetProgramStageiv; -PFNGLTEXSTORAGE2DMULTISAMPLEPROC glad_glTexStorage2DMultisample; -PFNGLTEXSTORAGE3DMULTISAMPLEPROC glad_glTexStorage3DMultisample; -PFNGLVERTEXATTRIBL1DEXTPROC glad_glVertexAttribL1dEXT; -PFNGLVERTEXATTRIBL2DEXTPROC glad_glVertexAttribL2dEXT; -PFNGLVERTEXATTRIBL3DEXTPROC glad_glVertexAttribL3dEXT; -PFNGLVERTEXATTRIBL4DEXTPROC glad_glVertexAttribL4dEXT; -PFNGLVERTEXATTRIBL1DVEXTPROC glad_glVertexAttribL1dvEXT; -PFNGLVERTEXATTRIBL2DVEXTPROC glad_glVertexAttribL2dvEXT; -PFNGLVERTEXATTRIBL3DVEXTPROC glad_glVertexAttribL3dvEXT; -PFNGLVERTEXATTRIBL4DVEXTPROC glad_glVertexAttribL4dvEXT; -PFNGLVERTEXATTRIBLPOINTEREXTPROC glad_glVertexAttribLPointerEXT; -PFNGLGETVERTEXATTRIBLDVEXTPROC glad_glGetVertexAttribLdvEXT; -PFNGLQUERYMATRIXXOESPROC glad_glQueryMatrixxOES; -PFNGLWINDOWPOS2DMESAPROC glad_glWindowPos2dMESA; -PFNGLWINDOWPOS2DVMESAPROC glad_glWindowPos2dvMESA; -PFNGLWINDOWPOS2FMESAPROC glad_glWindowPos2fMESA; -PFNGLWINDOWPOS2FVMESAPROC glad_glWindowPos2fvMESA; -PFNGLWINDOWPOS2IMESAPROC glad_glWindowPos2iMESA; -PFNGLWINDOWPOS2IVMESAPROC glad_glWindowPos2ivMESA; -PFNGLWINDOWPOS2SMESAPROC glad_glWindowPos2sMESA; -PFNGLWINDOWPOS2SVMESAPROC glad_glWindowPos2svMESA; -PFNGLWINDOWPOS3DMESAPROC glad_glWindowPos3dMESA; -PFNGLWINDOWPOS3DVMESAPROC glad_glWindowPos3dvMESA; -PFNGLWINDOWPOS3FMESAPROC glad_glWindowPos3fMESA; -PFNGLWINDOWPOS3FVMESAPROC glad_glWindowPos3fvMESA; -PFNGLWINDOWPOS3IMESAPROC glad_glWindowPos3iMESA; -PFNGLWINDOWPOS3IVMESAPROC glad_glWindowPos3ivMESA; -PFNGLWINDOWPOS3SMESAPROC glad_glWindowPos3sMESA; -PFNGLWINDOWPOS3SVMESAPROC glad_glWindowPos3svMESA; -PFNGLWINDOWPOS4DMESAPROC glad_glWindowPos4dMESA; -PFNGLWINDOWPOS4DVMESAPROC glad_glWindowPos4dvMESA; -PFNGLWINDOWPOS4FMESAPROC glad_glWindowPos4fMESA; -PFNGLWINDOWPOS4FVMESAPROC glad_glWindowPos4fvMESA; -PFNGLWINDOWPOS4IMESAPROC glad_glWindowPos4iMESA; -PFNGLWINDOWPOS4IVMESAPROC glad_glWindowPos4ivMESA; -PFNGLWINDOWPOS4SMESAPROC glad_glWindowPos4sMESA; -PFNGLWINDOWPOS4SVMESAPROC glad_glWindowPos4svMESA; -PFNGLOBJECTPURGEABLEAPPLEPROC glad_glObjectPurgeableAPPLE; -PFNGLOBJECTUNPURGEABLEAPPLEPROC glad_glObjectUnpurgeableAPPLE; -PFNGLGETOBJECTPARAMETERIVAPPLEPROC glad_glGetObjectParameterivAPPLE; -PFNGLGENQUERIESARBPROC glad_glGenQueriesARB; -PFNGLDELETEQUERIESARBPROC glad_glDeleteQueriesARB; -PFNGLISQUERYARBPROC glad_glIsQueryARB; -PFNGLBEGINQUERYARBPROC glad_glBeginQueryARB; -PFNGLENDQUERYARBPROC glad_glEndQueryARB; -PFNGLGETQUERYIVARBPROC glad_glGetQueryivARB; -PFNGLGETQUERYOBJECTIVARBPROC glad_glGetQueryObjectivARB; -PFNGLGETQUERYOBJECTUIVARBPROC glad_glGetQueryObjectuivARB; -PFNGLCOLORTABLESGIPROC glad_glColorTableSGI; -PFNGLCOLORTABLEPARAMETERFVSGIPROC glad_glColorTableParameterfvSGI; -PFNGLCOLORTABLEPARAMETERIVSGIPROC glad_glColorTableParameterivSGI; -PFNGLCOPYCOLORTABLESGIPROC glad_glCopyColorTableSGI; -PFNGLGETCOLORTABLESGIPROC glad_glGetColorTableSGI; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC glad_glGetColorTableParameterfvSGI; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC glad_glGetColorTableParameterivSGI; -PFNGLGETUNIFORMUIVEXTPROC glad_glGetUniformuivEXT; -PFNGLBINDFRAGDATALOCATIONEXTPROC glad_glBindFragDataLocationEXT; -PFNGLGETFRAGDATALOCATIONEXTPROC glad_glGetFragDataLocationEXT; -PFNGLUNIFORM1UIEXTPROC glad_glUniform1uiEXT; -PFNGLUNIFORM2UIEXTPROC glad_glUniform2uiEXT; -PFNGLUNIFORM3UIEXTPROC glad_glUniform3uiEXT; -PFNGLUNIFORM4UIEXTPROC glad_glUniform4uiEXT; -PFNGLUNIFORM1UIVEXTPROC glad_glUniform1uivEXT; -PFNGLUNIFORM2UIVEXTPROC glad_glUniform2uivEXT; -PFNGLUNIFORM3UIVEXTPROC glad_glUniform3uivEXT; -PFNGLUNIFORM4UIVEXTPROC glad_glUniform4uivEXT; -PFNGLPROGRAMVERTEXLIMITNVPROC glad_glProgramVertexLimitNV; -PFNGLFRAMEBUFFERTEXTUREEXTPROC glad_glFramebufferTextureEXT; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC glad_glFramebufferTextureFaceEXT; -PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; -PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; -PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; -PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; -PFNGLACTIVETEXTUREARBPROC glad_glActiveTextureARB; -PFNGLCLIENTACTIVETEXTUREARBPROC glad_glClientActiveTextureARB; -PFNGLMULTITEXCOORD1DARBPROC glad_glMultiTexCoord1dARB; -PFNGLMULTITEXCOORD1DVARBPROC glad_glMultiTexCoord1dvARB; -PFNGLMULTITEXCOORD1FARBPROC glad_glMultiTexCoord1fARB; -PFNGLMULTITEXCOORD1FVARBPROC glad_glMultiTexCoord1fvARB; -PFNGLMULTITEXCOORD1IARBPROC glad_glMultiTexCoord1iARB; -PFNGLMULTITEXCOORD1IVARBPROC glad_glMultiTexCoord1ivARB; -PFNGLMULTITEXCOORD1SARBPROC glad_glMultiTexCoord1sARB; -PFNGLMULTITEXCOORD1SVARBPROC glad_glMultiTexCoord1svARB; -PFNGLMULTITEXCOORD2DARBPROC glad_glMultiTexCoord2dARB; -PFNGLMULTITEXCOORD2DVARBPROC glad_glMultiTexCoord2dvARB; -PFNGLMULTITEXCOORD2FARBPROC glad_glMultiTexCoord2fARB; -PFNGLMULTITEXCOORD2FVARBPROC glad_glMultiTexCoord2fvARB; -PFNGLMULTITEXCOORD2IARBPROC glad_glMultiTexCoord2iARB; -PFNGLMULTITEXCOORD2IVARBPROC glad_glMultiTexCoord2ivARB; -PFNGLMULTITEXCOORD2SARBPROC glad_glMultiTexCoord2sARB; -PFNGLMULTITEXCOORD2SVARBPROC glad_glMultiTexCoord2svARB; -PFNGLMULTITEXCOORD3DARBPROC glad_glMultiTexCoord3dARB; -PFNGLMULTITEXCOORD3DVARBPROC glad_glMultiTexCoord3dvARB; -PFNGLMULTITEXCOORD3FARBPROC glad_glMultiTexCoord3fARB; -PFNGLMULTITEXCOORD3FVARBPROC glad_glMultiTexCoord3fvARB; -PFNGLMULTITEXCOORD3IARBPROC glad_glMultiTexCoord3iARB; -PFNGLMULTITEXCOORD3IVARBPROC glad_glMultiTexCoord3ivARB; -PFNGLMULTITEXCOORD3SARBPROC glad_glMultiTexCoord3sARB; -PFNGLMULTITEXCOORD3SVARBPROC glad_glMultiTexCoord3svARB; -PFNGLMULTITEXCOORD4DARBPROC glad_glMultiTexCoord4dARB; -PFNGLMULTITEXCOORD4DVARBPROC glad_glMultiTexCoord4dvARB; -PFNGLMULTITEXCOORD4FARBPROC glad_glMultiTexCoord4fARB; -PFNGLMULTITEXCOORD4FVARBPROC glad_glMultiTexCoord4fvARB; -PFNGLMULTITEXCOORD4IARBPROC glad_glMultiTexCoord4iARB; -PFNGLMULTITEXCOORD4IVARBPROC glad_glMultiTexCoord4ivARB; -PFNGLMULTITEXCOORD4SARBPROC glad_glMultiTexCoord4sARB; -PFNGLMULTITEXCOORD4SVARBPROC glad_glMultiTexCoord4svARB; -PFNGLDEFORMATIONMAP3DSGIXPROC glad_glDeformationMap3dSGIX; -PFNGLDEFORMATIONMAP3FSGIXPROC glad_glDeformationMap3fSGIX; -PFNGLDEFORMSGIXPROC glad_glDeformSGIX; -PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC glad_glLoadIdentityDeformationMapSGIX; -PFNGLPROVOKINGVERTEXEXTPROC glad_glProvokingVertexEXT; -PFNGLPOINTPARAMETERFARBPROC glad_glPointParameterfARB; -PFNGLPOINTPARAMETERFVARBPROC glad_glPointParameterfvARB; -PFNGLBINDIMAGETEXTUREPROC glad_glBindImageTexture; -PFNGLMEMORYBARRIERPROC glad_glMemoryBarrier; -PFNGLTEXTUREBARRIERPROC glad_glTextureBarrier; -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC glad_glMultiDrawArraysIndirectBindlessNV; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC glad_glMultiDrawElementsIndirectBindlessNV; -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC glad_glBeginTransformFeedbackEXT; -PFNGLENDTRANSFORMFEEDBACKEXTPROC glad_glEndTransformFeedbackEXT; -PFNGLBINDBUFFERRANGEEXTPROC glad_glBindBufferRangeEXT; -PFNGLBINDBUFFEROFFSETEXTPROC glad_glBindBufferOffsetEXT; -PFNGLBINDBUFFERBASEEXTPROC glad_glBindBufferBaseEXT; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC glad_glTransformFeedbackVaryingsEXT; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC glad_glGetTransformFeedbackVaryingEXT; -PFNGLPROGRAMLOCALPARAMETERI4INVPROC glad_glProgramLocalParameterI4iNV; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC glad_glProgramLocalParameterI4ivNV; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC glad_glProgramLocalParametersI4ivNV; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC glad_glProgramLocalParameterI4uiNV; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC glad_glProgramLocalParameterI4uivNV; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC glad_glProgramLocalParametersI4uivNV; -PFNGLPROGRAMENVPARAMETERI4INVPROC glad_glProgramEnvParameterI4iNV; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC glad_glProgramEnvParameterI4ivNV; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC glad_glProgramEnvParametersI4ivNV; -PFNGLPROGRAMENVPARAMETERI4UINVPROC glad_glProgramEnvParameterI4uiNV; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC glad_glProgramEnvParameterI4uivNV; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC glad_glProgramEnvParametersI4uivNV; -PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC glad_glGetProgramLocalParameterIivNV; -PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC glad_glGetProgramLocalParameterIuivNV; -PFNGLGETPROGRAMENVPARAMETERIIVNVPROC glad_glGetProgramEnvParameterIivNV; -PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC glad_glGetProgramEnvParameterIuivNV; -PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC glad_glProgramSubroutineParametersuivNV; -PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC glad_glGetProgramSubroutineParameteruivNV; -PFNGLPROGRAMPARAMETERIARBPROC glad_glProgramParameteriARB; -PFNGLFRAMEBUFFERTEXTUREARBPROC glad_glFramebufferTextureARB; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC glad_glFramebufferTextureLayerARB; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC glad_glFramebufferTextureFaceARB; -PFNGLSUBPIXELPRECISIONBIASNVPROC glad_glSubpixelPrecisionBiasNV; -PFNGLSPRITEPARAMETERFSGIXPROC glad_glSpriteParameterfSGIX; -PFNGLSPRITEPARAMETERFVSGIXPROC glad_glSpriteParameterfvSGIX; -PFNGLSPRITEPARAMETERISGIXPROC glad_glSpriteParameteriSGIX; -PFNGLSPRITEPARAMETERIVSGIXPROC glad_glSpriteParameterivSGIX; -PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary; -PFNGLPROGRAMBINARYPROC glad_glProgramBinary; -PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri; -PFNGLQUERYOBJECTPARAMETERUIAMDPROC glad_glQueryObjectParameteruiAMD; -PFNGLSAMPLEMASKSGISPROC glad_glSampleMaskSGIS; -PFNGLSAMPLEPATTERNSGISPROC glad_glSamplePatternSGIS; -PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; -PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; -PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; -PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; -PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; -PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; -PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; -PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; -PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; -PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; -PFNGLVERTEXARRAYRANGEAPPLEPROC glad_glVertexArrayRangeAPPLE; -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC glad_glFlushVertexArrayRangeAPPLE; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC glad_glVertexArrayParameteriAPPLE; -PFNGLCOMBINERPARAMETERFVNVPROC glad_glCombinerParameterfvNV; -PFNGLCOMBINERPARAMETERFNVPROC glad_glCombinerParameterfNV; -PFNGLCOMBINERPARAMETERIVNVPROC glad_glCombinerParameterivNV; -PFNGLCOMBINERPARAMETERINVPROC glad_glCombinerParameteriNV; -PFNGLCOMBINERINPUTNVPROC glad_glCombinerInputNV; -PFNGLCOMBINEROUTPUTNVPROC glad_glCombinerOutputNV; -PFNGLFINALCOMBINERINPUTNVPROC glad_glFinalCombinerInputNV; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC glad_glGetCombinerInputParameterfvNV; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC glad_glGetCombinerInputParameterivNV; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC glad_glGetCombinerOutputParameterfvNV; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC glad_glGetCombinerOutputParameterivNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC glad_glGetFinalCombinerInputParameterfvNV; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC glad_glGetFinalCombinerInputParameterivNV; -PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; -PFNGLCLEARTEXIMAGEPROC glad_glClearTexImage; -PFNGLCLEARTEXSUBIMAGEPROC glad_glClearTexSubImage; -PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; -PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; -PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; -PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; -PFNGLCULLPARAMETERDVEXTPROC glad_glCullParameterdvEXT; -PFNGLCULLPARAMETERFVEXTPROC glad_glCullParameterfvEXT; -PFNGLMULTIMODEDRAWARRAYSIBMPROC glad_glMultiModeDrawArraysIBM; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC glad_glMultiModeDrawElementsIBM; -PFNGLBINDVERTEXARRAYAPPLEPROC glad_glBindVertexArrayAPPLE; -PFNGLDELETEVERTEXARRAYSAPPLEPROC glad_glDeleteVertexArraysAPPLE; -PFNGLGENVERTEXARRAYSAPPLEPROC glad_glGenVertexArraysAPPLE; -PFNGLISVERTEXARRAYAPPLEPROC glad_glIsVertexArrayAPPLE; -PFNGLDETAILTEXFUNCSGISPROC glad_glDetailTexFuncSGIS; -PFNGLGETDETAILTEXFUNCSGISPROC glad_glGetDetailTexFuncSGIS; -PFNGLDRAWARRAYSINSTANCEDARBPROC glad_glDrawArraysInstancedARB; -PFNGLDRAWELEMENTSINSTANCEDARBPROC glad_glDrawElementsInstancedARB; -PFNGLNAMEDSTRINGARBPROC glad_glNamedStringARB; -PFNGLDELETENAMEDSTRINGARBPROC glad_glDeleteNamedStringARB; -PFNGLCOMPILESHADERINCLUDEARBPROC glad_glCompileShaderIncludeARB; -PFNGLISNAMEDSTRINGARBPROC glad_glIsNamedStringARB; -PFNGLGETNAMEDSTRINGARBPROC glad_glGetNamedStringARB; -PFNGLGETNAMEDSTRINGIVARBPROC glad_glGetNamedStringivARB; -PFNGLBLENDFUNCSEPARATEINGRPROC glad_glBlendFuncSeparateINGR; -PFNGLGENPATHSNVPROC glad_glGenPathsNV; -PFNGLDELETEPATHSNVPROC glad_glDeletePathsNV; -PFNGLISPATHNVPROC glad_glIsPathNV; -PFNGLPATHCOMMANDSNVPROC glad_glPathCommandsNV; -PFNGLPATHCOORDSNVPROC glad_glPathCoordsNV; -PFNGLPATHSUBCOMMANDSNVPROC glad_glPathSubCommandsNV; -PFNGLPATHSUBCOORDSNVPROC glad_glPathSubCoordsNV; -PFNGLPATHSTRINGNVPROC glad_glPathStringNV; -PFNGLPATHGLYPHSNVPROC glad_glPathGlyphsNV; -PFNGLPATHGLYPHRANGENVPROC glad_glPathGlyphRangeNV; -PFNGLWEIGHTPATHSNVPROC glad_glWeightPathsNV; -PFNGLCOPYPATHNVPROC glad_glCopyPathNV; -PFNGLINTERPOLATEPATHSNVPROC glad_glInterpolatePathsNV; -PFNGLTRANSFORMPATHNVPROC glad_glTransformPathNV; -PFNGLPATHPARAMETERIVNVPROC glad_glPathParameterivNV; -PFNGLPATHPARAMETERINVPROC glad_glPathParameteriNV; -PFNGLPATHPARAMETERFVNVPROC glad_glPathParameterfvNV; -PFNGLPATHPARAMETERFNVPROC glad_glPathParameterfNV; -PFNGLPATHDASHARRAYNVPROC glad_glPathDashArrayNV; -PFNGLPATHSTENCILFUNCNVPROC glad_glPathStencilFuncNV; -PFNGLPATHSTENCILDEPTHOFFSETNVPROC glad_glPathStencilDepthOffsetNV; -PFNGLSTENCILFILLPATHNVPROC glad_glStencilFillPathNV; -PFNGLSTENCILSTROKEPATHNVPROC glad_glStencilStrokePathNV; -PFNGLSTENCILFILLPATHINSTANCEDNVPROC glad_glStencilFillPathInstancedNV; -PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC glad_glStencilStrokePathInstancedNV; -PFNGLPATHCOVERDEPTHFUNCNVPROC glad_glPathCoverDepthFuncNV; -PFNGLCOVERFILLPATHNVPROC glad_glCoverFillPathNV; -PFNGLCOVERSTROKEPATHNVPROC glad_glCoverStrokePathNV; -PFNGLCOVERFILLPATHINSTANCEDNVPROC glad_glCoverFillPathInstancedNV; -PFNGLCOVERSTROKEPATHINSTANCEDNVPROC glad_glCoverStrokePathInstancedNV; -PFNGLGETPATHPARAMETERIVNVPROC glad_glGetPathParameterivNV; -PFNGLGETPATHPARAMETERFVNVPROC glad_glGetPathParameterfvNV; -PFNGLGETPATHCOMMANDSNVPROC glad_glGetPathCommandsNV; -PFNGLGETPATHCOORDSNVPROC glad_glGetPathCoordsNV; -PFNGLGETPATHDASHARRAYNVPROC glad_glGetPathDashArrayNV; -PFNGLGETPATHMETRICSNVPROC glad_glGetPathMetricsNV; -PFNGLGETPATHMETRICRANGENVPROC glad_glGetPathMetricRangeNV; -PFNGLGETPATHSPACINGNVPROC glad_glGetPathSpacingNV; -PFNGLISPOINTINFILLPATHNVPROC glad_glIsPointInFillPathNV; -PFNGLISPOINTINSTROKEPATHNVPROC glad_glIsPointInStrokePathNV; -PFNGLGETPATHLENGTHNVPROC glad_glGetPathLengthNV; -PFNGLPOINTALONGPATHNVPROC glad_glPointAlongPathNV; -PFNGLMATRIXLOAD3X2FNVPROC glad_glMatrixLoad3x2fNV; -PFNGLMATRIXLOAD3X3FNVPROC glad_glMatrixLoad3x3fNV; -PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC glad_glMatrixLoadTranspose3x3fNV; -PFNGLMATRIXMULT3X2FNVPROC glad_glMatrixMult3x2fNV; -PFNGLMATRIXMULT3X3FNVPROC glad_glMatrixMult3x3fNV; -PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC glad_glMatrixMultTranspose3x3fNV; -PFNGLSTENCILTHENCOVERFILLPATHNVPROC glad_glStencilThenCoverFillPathNV; -PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC glad_glStencilThenCoverStrokePathNV; -PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC glad_glStencilThenCoverFillPathInstancedNV; -PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC glad_glStencilThenCoverStrokePathInstancedNV; -PFNGLPATHGLYPHINDEXRANGENVPROC glad_glPathGlyphIndexRangeNV; -PFNGLPATHGLYPHINDEXARRAYNVPROC glad_glPathGlyphIndexArrayNV; -PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC glad_glPathMemoryGlyphIndexArrayNV; -PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC glad_glProgramPathFragmentInputGenNV; -PFNGLGETPROGRAMRESOURCEFVNVPROC glad_glGetProgramResourcefvNV; -PFNGLPATHCOLORGENNVPROC glad_glPathColorGenNV; -PFNGLPATHTEXGENNVPROC glad_glPathTexGenNV; -PFNGLPATHFOGGENNVPROC glad_glPathFogGenNV; -PFNGLGETPATHCOLORGENIVNVPROC glad_glGetPathColorGenivNV; -PFNGLGETPATHCOLORGENFVNVPROC glad_glGetPathColorGenfvNV; -PFNGLGETPATHTEXGENIVNVPROC glad_glGetPathTexGenivNV; -PFNGLGETPATHTEXGENFVNVPROC glad_glGetPathTexGenfvNV; -PFNGLCONSERVATIVERASTERPARAMETERFNVPROC glad_glConservativeRasterParameterfNV; -PFNGLVERTEXSTREAM1SATIPROC glad_glVertexStream1sATI; -PFNGLVERTEXSTREAM1SVATIPROC glad_glVertexStream1svATI; -PFNGLVERTEXSTREAM1IATIPROC glad_glVertexStream1iATI; -PFNGLVERTEXSTREAM1IVATIPROC glad_glVertexStream1ivATI; -PFNGLVERTEXSTREAM1FATIPROC glad_glVertexStream1fATI; -PFNGLVERTEXSTREAM1FVATIPROC glad_glVertexStream1fvATI; -PFNGLVERTEXSTREAM1DATIPROC glad_glVertexStream1dATI; -PFNGLVERTEXSTREAM1DVATIPROC glad_glVertexStream1dvATI; -PFNGLVERTEXSTREAM2SATIPROC glad_glVertexStream2sATI; -PFNGLVERTEXSTREAM2SVATIPROC glad_glVertexStream2svATI; -PFNGLVERTEXSTREAM2IATIPROC glad_glVertexStream2iATI; -PFNGLVERTEXSTREAM2IVATIPROC glad_glVertexStream2ivATI; -PFNGLVERTEXSTREAM2FATIPROC glad_glVertexStream2fATI; -PFNGLVERTEXSTREAM2FVATIPROC glad_glVertexStream2fvATI; -PFNGLVERTEXSTREAM2DATIPROC glad_glVertexStream2dATI; -PFNGLVERTEXSTREAM2DVATIPROC glad_glVertexStream2dvATI; -PFNGLVERTEXSTREAM3SATIPROC glad_glVertexStream3sATI; -PFNGLVERTEXSTREAM3SVATIPROC glad_glVertexStream3svATI; -PFNGLVERTEXSTREAM3IATIPROC glad_glVertexStream3iATI; -PFNGLVERTEXSTREAM3IVATIPROC glad_glVertexStream3ivATI; -PFNGLVERTEXSTREAM3FATIPROC glad_glVertexStream3fATI; -PFNGLVERTEXSTREAM3FVATIPROC glad_glVertexStream3fvATI; -PFNGLVERTEXSTREAM3DATIPROC glad_glVertexStream3dATI; -PFNGLVERTEXSTREAM3DVATIPROC glad_glVertexStream3dvATI; -PFNGLVERTEXSTREAM4SATIPROC glad_glVertexStream4sATI; -PFNGLVERTEXSTREAM4SVATIPROC glad_glVertexStream4svATI; -PFNGLVERTEXSTREAM4IATIPROC glad_glVertexStream4iATI; -PFNGLVERTEXSTREAM4IVATIPROC glad_glVertexStream4ivATI; -PFNGLVERTEXSTREAM4FATIPROC glad_glVertexStream4fATI; -PFNGLVERTEXSTREAM4FVATIPROC glad_glVertexStream4fvATI; -PFNGLVERTEXSTREAM4DATIPROC glad_glVertexStream4dATI; -PFNGLVERTEXSTREAM4DVATIPROC glad_glVertexStream4dvATI; -PFNGLNORMALSTREAM3BATIPROC glad_glNormalStream3bATI; -PFNGLNORMALSTREAM3BVATIPROC glad_glNormalStream3bvATI; -PFNGLNORMALSTREAM3SATIPROC glad_glNormalStream3sATI; -PFNGLNORMALSTREAM3SVATIPROC glad_glNormalStream3svATI; -PFNGLNORMALSTREAM3IATIPROC glad_glNormalStream3iATI; -PFNGLNORMALSTREAM3IVATIPROC glad_glNormalStream3ivATI; -PFNGLNORMALSTREAM3FATIPROC glad_glNormalStream3fATI; -PFNGLNORMALSTREAM3FVATIPROC glad_glNormalStream3fvATI; -PFNGLNORMALSTREAM3DATIPROC glad_glNormalStream3dATI; -PFNGLNORMALSTREAM3DVATIPROC glad_glNormalStream3dvATI; -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC glad_glClientActiveVertexStreamATI; -PFNGLVERTEXBLENDENVIATIPROC glad_glVertexBlendEnviATI; -PFNGLVERTEXBLENDENVFATIPROC glad_glVertexBlendEnvfATI; -PFNGLUNIFORM1I64ARBPROC glad_glUniform1i64ARB; -PFNGLUNIFORM2I64ARBPROC glad_glUniform2i64ARB; -PFNGLUNIFORM3I64ARBPROC glad_glUniform3i64ARB; -PFNGLUNIFORM4I64ARBPROC glad_glUniform4i64ARB; -PFNGLUNIFORM1I64VARBPROC glad_glUniform1i64vARB; -PFNGLUNIFORM2I64VARBPROC glad_glUniform2i64vARB; -PFNGLUNIFORM3I64VARBPROC glad_glUniform3i64vARB; -PFNGLUNIFORM4I64VARBPROC glad_glUniform4i64vARB; -PFNGLUNIFORM1UI64ARBPROC glad_glUniform1ui64ARB; -PFNGLUNIFORM2UI64ARBPROC glad_glUniform2ui64ARB; -PFNGLUNIFORM3UI64ARBPROC glad_glUniform3ui64ARB; -PFNGLUNIFORM4UI64ARBPROC glad_glUniform4ui64ARB; -PFNGLUNIFORM1UI64VARBPROC glad_glUniform1ui64vARB; -PFNGLUNIFORM2UI64VARBPROC glad_glUniform2ui64vARB; -PFNGLUNIFORM3UI64VARBPROC glad_glUniform3ui64vARB; -PFNGLUNIFORM4UI64VARBPROC glad_glUniform4ui64vARB; -PFNGLGETUNIFORMI64VARBPROC glad_glGetUniformi64vARB; -PFNGLGETUNIFORMUI64VARBPROC glad_glGetUniformui64vARB; -PFNGLGETNUNIFORMI64VARBPROC glad_glGetnUniformi64vARB; -PFNGLGETNUNIFORMUI64VARBPROC glad_glGetnUniformui64vARB; -PFNGLPROGRAMUNIFORM1I64ARBPROC glad_glProgramUniform1i64ARB; -PFNGLPROGRAMUNIFORM2I64ARBPROC glad_glProgramUniform2i64ARB; -PFNGLPROGRAMUNIFORM3I64ARBPROC glad_glProgramUniform3i64ARB; -PFNGLPROGRAMUNIFORM4I64ARBPROC glad_glProgramUniform4i64ARB; -PFNGLPROGRAMUNIFORM1I64VARBPROC glad_glProgramUniform1i64vARB; -PFNGLPROGRAMUNIFORM2I64VARBPROC glad_glProgramUniform2i64vARB; -PFNGLPROGRAMUNIFORM3I64VARBPROC glad_glProgramUniform3i64vARB; -PFNGLPROGRAMUNIFORM4I64VARBPROC glad_glProgramUniform4i64vARB; -PFNGLPROGRAMUNIFORM1UI64ARBPROC glad_glProgramUniform1ui64ARB; -PFNGLPROGRAMUNIFORM2UI64ARBPROC glad_glProgramUniform2ui64ARB; -PFNGLPROGRAMUNIFORM3UI64ARBPROC glad_glProgramUniform3ui64ARB; -PFNGLPROGRAMUNIFORM4UI64ARBPROC glad_glProgramUniform4ui64ARB; -PFNGLPROGRAMUNIFORM1UI64VARBPROC glad_glProgramUniform1ui64vARB; -PFNGLPROGRAMUNIFORM2UI64VARBPROC glad_glProgramUniform2ui64vARB; -PFNGLPROGRAMUNIFORM3UI64VARBPROC glad_glProgramUniform3ui64vARB; -PFNGLPROGRAMUNIFORM4UI64VARBPROC glad_glProgramUniform4ui64vARB; -PFNGLVDPAUINITNVPROC glad_glVDPAUInitNV; -PFNGLVDPAUFININVPROC glad_glVDPAUFiniNV; -PFNGLVDPAUREGISTERVIDEOSURFACENVPROC glad_glVDPAURegisterVideoSurfaceNV; -PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC glad_glVDPAURegisterOutputSurfaceNV; -PFNGLVDPAUISSURFACENVPROC glad_glVDPAUIsSurfaceNV; -PFNGLVDPAUUNREGISTERSURFACENVPROC glad_glVDPAUUnregisterSurfaceNV; -PFNGLVDPAUGETSURFACEIVNVPROC glad_glVDPAUGetSurfaceivNV; -PFNGLVDPAUSURFACEACCESSNVPROC glad_glVDPAUSurfaceAccessNV; -PFNGLVDPAUMAPSURFACESNVPROC glad_glVDPAUMapSurfacesNV; -PFNGLVDPAUUNMAPSURFACESNVPROC glad_glVDPAUUnmapSurfacesNV; -PFNGLGETINTERNALFORMATI64VPROC glad_glGetInternalformati64v; -PFNGLCOLOR4UBVERTEX2FSUNPROC glad_glColor4ubVertex2fSUN; -PFNGLCOLOR4UBVERTEX2FVSUNPROC glad_glColor4ubVertex2fvSUN; -PFNGLCOLOR4UBVERTEX3FSUNPROC glad_glColor4ubVertex3fSUN; -PFNGLCOLOR4UBVERTEX3FVSUNPROC glad_glColor4ubVertex3fvSUN; -PFNGLCOLOR3FVERTEX3FSUNPROC glad_glColor3fVertex3fSUN; -PFNGLCOLOR3FVERTEX3FVSUNPROC glad_glColor3fVertex3fvSUN; -PFNGLNORMAL3FVERTEX3FSUNPROC glad_glNormal3fVertex3fSUN; -PFNGLNORMAL3FVERTEX3FVSUNPROC glad_glNormal3fVertex3fvSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glColor4fNormal3fVertex3fSUN; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FVERTEX3FSUNPROC glad_glTexCoord2fVertex3fSUN; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC glad_glTexCoord2fVertex3fvSUN; -PFNGLTEXCOORD4FVERTEX4FSUNPROC glad_glTexCoord4fVertex4fSUN; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC glad_glTexCoord4fVertex4fvSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC glad_glTexCoord2fColor4ubVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC glad_glTexCoord2fColor4ubVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC glad_glTexCoord2fColor3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC glad_glTexCoord2fColor3fVertex3fvSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fNormal3fVertex3fvSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fSUN; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC glad_glTexCoord4fColor4fNormal3fVertex4fvSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC glad_glReplacementCodeuiVertex3fSUN; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC glad_glReplacementCodeuiVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC glad_glReplacementCodeuiColor4ubVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4ubVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -PFNGLIGLOOINTERFACESGIXPROC glad_glIglooInterfaceSGIX; -PFNGLDRAWARRAYSINDIRECTPROC glad_glDrawArraysIndirect; -PFNGLDRAWELEMENTSINDIRECTPROC glad_glDrawElementsIndirect; -PFNGLVERTEXATTRIBI1IEXTPROC glad_glVertexAttribI1iEXT; -PFNGLVERTEXATTRIBI2IEXTPROC glad_glVertexAttribI2iEXT; -PFNGLVERTEXATTRIBI3IEXTPROC glad_glVertexAttribI3iEXT; -PFNGLVERTEXATTRIBI4IEXTPROC glad_glVertexAttribI4iEXT; -PFNGLVERTEXATTRIBI1UIEXTPROC glad_glVertexAttribI1uiEXT; -PFNGLVERTEXATTRIBI2UIEXTPROC glad_glVertexAttribI2uiEXT; -PFNGLVERTEXATTRIBI3UIEXTPROC glad_glVertexAttribI3uiEXT; -PFNGLVERTEXATTRIBI4UIEXTPROC glad_glVertexAttribI4uiEXT; -PFNGLVERTEXATTRIBI1IVEXTPROC glad_glVertexAttribI1ivEXT; -PFNGLVERTEXATTRIBI2IVEXTPROC glad_glVertexAttribI2ivEXT; -PFNGLVERTEXATTRIBI3IVEXTPROC glad_glVertexAttribI3ivEXT; -PFNGLVERTEXATTRIBI4IVEXTPROC glad_glVertexAttribI4ivEXT; -PFNGLVERTEXATTRIBI1UIVEXTPROC glad_glVertexAttribI1uivEXT; -PFNGLVERTEXATTRIBI2UIVEXTPROC glad_glVertexAttribI2uivEXT; -PFNGLVERTEXATTRIBI3UIVEXTPROC glad_glVertexAttribI3uivEXT; -PFNGLVERTEXATTRIBI4UIVEXTPROC glad_glVertexAttribI4uivEXT; -PFNGLVERTEXATTRIBI4BVEXTPROC glad_glVertexAttribI4bvEXT; -PFNGLVERTEXATTRIBI4SVEXTPROC glad_glVertexAttribI4svEXT; -PFNGLVERTEXATTRIBI4UBVEXTPROC glad_glVertexAttribI4ubvEXT; -PFNGLVERTEXATTRIBI4USVEXTPROC glad_glVertexAttribI4usvEXT; -PFNGLVERTEXATTRIBIPOINTEREXTPROC glad_glVertexAttribIPointerEXT; -PFNGLGETVERTEXATTRIBIIVEXTPROC glad_glGetVertexAttribIivEXT; -PFNGLGETVERTEXATTRIBIUIVEXTPROC glad_glGetVertexAttribIuivEXT; -PFNGLFOGFUNCSGISPROC glad_glFogFuncSGIS; -PFNGLGETFOGFUNCSGISPROC glad_glGetFogFuncSGIS; -PFNGLIMPORTSYNCEXTPROC glad_glImportSyncEXT; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glFramebufferSampleLocationsfvNV; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC glad_glNamedFramebufferSampleLocationsfvNV; -PFNGLRESOLVEDEPTHVALUESNVPROC glad_glResolveDepthValuesNV; -PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC glad_glDispatchComputeGroupSizeARB; -PFNGLALPHAFUNCXOESPROC glad_glAlphaFuncxOES; -PFNGLCLEARCOLORXOESPROC glad_glClearColorxOES; -PFNGLCLEARDEPTHXOESPROC glad_glClearDepthxOES; -PFNGLCLIPPLANEXOESPROC glad_glClipPlanexOES; -PFNGLCOLOR4XOESPROC glad_glColor4xOES; -PFNGLDEPTHRANGEXOESPROC glad_glDepthRangexOES; -PFNGLFOGXOESPROC glad_glFogxOES; -PFNGLFOGXVOESPROC glad_glFogxvOES; -PFNGLFRUSTUMXOESPROC glad_glFrustumxOES; -PFNGLGETCLIPPLANEXOESPROC glad_glGetClipPlanexOES; -PFNGLGETFIXEDVOESPROC glad_glGetFixedvOES; -PFNGLGETTEXENVXVOESPROC glad_glGetTexEnvxvOES; -PFNGLGETTEXPARAMETERXVOESPROC glad_glGetTexParameterxvOES; -PFNGLLIGHTMODELXOESPROC glad_glLightModelxOES; -PFNGLLIGHTMODELXVOESPROC glad_glLightModelxvOES; -PFNGLLIGHTXOESPROC glad_glLightxOES; -PFNGLLIGHTXVOESPROC glad_glLightxvOES; -PFNGLLINEWIDTHXOESPROC glad_glLineWidthxOES; -PFNGLLOADMATRIXXOESPROC glad_glLoadMatrixxOES; -PFNGLMATERIALXOESPROC glad_glMaterialxOES; -PFNGLMATERIALXVOESPROC glad_glMaterialxvOES; -PFNGLMULTMATRIXXOESPROC glad_glMultMatrixxOES; -PFNGLMULTITEXCOORD4XOESPROC glad_glMultiTexCoord4xOES; -PFNGLNORMAL3XOESPROC glad_glNormal3xOES; -PFNGLORTHOXOESPROC glad_glOrthoxOES; -PFNGLPOINTPARAMETERXVOESPROC glad_glPointParameterxvOES; -PFNGLPOINTSIZEXOESPROC glad_glPointSizexOES; -PFNGLPOLYGONOFFSETXOESPROC glad_glPolygonOffsetxOES; -PFNGLROTATEXOESPROC glad_glRotatexOES; -PFNGLSCALEXOESPROC glad_glScalexOES; -PFNGLTEXENVXOESPROC glad_glTexEnvxOES; -PFNGLTEXENVXVOESPROC glad_glTexEnvxvOES; -PFNGLTEXPARAMETERXOESPROC glad_glTexParameterxOES; -PFNGLTEXPARAMETERXVOESPROC glad_glTexParameterxvOES; -PFNGLTRANSLATEXOESPROC glad_glTranslatexOES; -PFNGLGETLIGHTXVOESPROC glad_glGetLightxvOES; -PFNGLGETMATERIALXVOESPROC glad_glGetMaterialxvOES; -PFNGLPOINTPARAMETERXOESPROC glad_glPointParameterxOES; -PFNGLSAMPLECOVERAGEXOESPROC glad_glSampleCoveragexOES; -PFNGLACCUMXOESPROC glad_glAccumxOES; -PFNGLBITMAPXOESPROC glad_glBitmapxOES; -PFNGLBLENDCOLORXOESPROC glad_glBlendColorxOES; -PFNGLCLEARACCUMXOESPROC glad_glClearAccumxOES; -PFNGLCOLOR3XOESPROC glad_glColor3xOES; -PFNGLCOLOR3XVOESPROC glad_glColor3xvOES; -PFNGLCOLOR4XVOESPROC glad_glColor4xvOES; -PFNGLCONVOLUTIONPARAMETERXOESPROC glad_glConvolutionParameterxOES; -PFNGLCONVOLUTIONPARAMETERXVOESPROC glad_glConvolutionParameterxvOES; -PFNGLEVALCOORD1XOESPROC glad_glEvalCoord1xOES; -PFNGLEVALCOORD1XVOESPROC glad_glEvalCoord1xvOES; -PFNGLEVALCOORD2XOESPROC glad_glEvalCoord2xOES; -PFNGLEVALCOORD2XVOESPROC glad_glEvalCoord2xvOES; -PFNGLFEEDBACKBUFFERXOESPROC glad_glFeedbackBufferxOES; -PFNGLGETCONVOLUTIONPARAMETERXVOESPROC glad_glGetConvolutionParameterxvOES; -PFNGLGETHISTOGRAMPARAMETERXVOESPROC glad_glGetHistogramParameterxvOES; -PFNGLGETLIGHTXOESPROC glad_glGetLightxOES; -PFNGLGETMAPXVOESPROC glad_glGetMapxvOES; -PFNGLGETMATERIALXOESPROC glad_glGetMaterialxOES; -PFNGLGETPIXELMAPXVPROC glad_glGetPixelMapxv; -PFNGLGETTEXGENXVOESPROC glad_glGetTexGenxvOES; -PFNGLGETTEXLEVELPARAMETERXVOESPROC glad_glGetTexLevelParameterxvOES; -PFNGLINDEXXOESPROC glad_glIndexxOES; -PFNGLINDEXXVOESPROC glad_glIndexxvOES; -PFNGLLOADTRANSPOSEMATRIXXOESPROC glad_glLoadTransposeMatrixxOES; -PFNGLMAP1XOESPROC glad_glMap1xOES; -PFNGLMAP2XOESPROC glad_glMap2xOES; -PFNGLMAPGRID1XOESPROC glad_glMapGrid1xOES; -PFNGLMAPGRID2XOESPROC glad_glMapGrid2xOES; -PFNGLMULTTRANSPOSEMATRIXXOESPROC glad_glMultTransposeMatrixxOES; -PFNGLMULTITEXCOORD1XOESPROC glad_glMultiTexCoord1xOES; -PFNGLMULTITEXCOORD1XVOESPROC glad_glMultiTexCoord1xvOES; -PFNGLMULTITEXCOORD2XOESPROC glad_glMultiTexCoord2xOES; -PFNGLMULTITEXCOORD2XVOESPROC glad_glMultiTexCoord2xvOES; -PFNGLMULTITEXCOORD3XOESPROC glad_glMultiTexCoord3xOES; -PFNGLMULTITEXCOORD3XVOESPROC glad_glMultiTexCoord3xvOES; -PFNGLMULTITEXCOORD4XVOESPROC glad_glMultiTexCoord4xvOES; -PFNGLNORMAL3XVOESPROC glad_glNormal3xvOES; -PFNGLPASSTHROUGHXOESPROC glad_glPassThroughxOES; -PFNGLPIXELMAPXPROC glad_glPixelMapx; -PFNGLPIXELSTOREXPROC glad_glPixelStorex; -PFNGLPIXELTRANSFERXOESPROC glad_glPixelTransferxOES; -PFNGLPIXELZOOMXOESPROC glad_glPixelZoomxOES; -PFNGLPRIORITIZETEXTURESXOESPROC glad_glPrioritizeTexturesxOES; -PFNGLRASTERPOS2XOESPROC glad_glRasterPos2xOES; -PFNGLRASTERPOS2XVOESPROC glad_glRasterPos2xvOES; -PFNGLRASTERPOS3XOESPROC glad_glRasterPos3xOES; -PFNGLRASTERPOS3XVOESPROC glad_glRasterPos3xvOES; -PFNGLRASTERPOS4XOESPROC glad_glRasterPos4xOES; -PFNGLRASTERPOS4XVOESPROC glad_glRasterPos4xvOES; -PFNGLRECTXOESPROC glad_glRectxOES; -PFNGLRECTXVOESPROC glad_glRectxvOES; -PFNGLTEXCOORD1XOESPROC glad_glTexCoord1xOES; -PFNGLTEXCOORD1XVOESPROC glad_glTexCoord1xvOES; -PFNGLTEXCOORD2XOESPROC glad_glTexCoord2xOES; -PFNGLTEXCOORD2XVOESPROC glad_glTexCoord2xvOES; -PFNGLTEXCOORD3XOESPROC glad_glTexCoord3xOES; -PFNGLTEXCOORD3XVOESPROC glad_glTexCoord3xvOES; -PFNGLTEXCOORD4XOESPROC glad_glTexCoord4xOES; -PFNGLTEXCOORD4XVOESPROC glad_glTexCoord4xvOES; -PFNGLTEXGENXOESPROC glad_glTexGenxOES; -PFNGLTEXGENXVOESPROC glad_glTexGenxvOES; -PFNGLVERTEX2XOESPROC glad_glVertex2xOES; -PFNGLVERTEX2XVOESPROC glad_glVertex2xvOES; -PFNGLVERTEX3XOESPROC glad_glVertex3xOES; -PFNGLVERTEX3XVOESPROC glad_glVertex3xvOES; -PFNGLVERTEX4XOESPROC glad_glVertex4xOES; -PFNGLVERTEX4XVOESPROC glad_glVertex4xvOES; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; -PFNGLTEXIMAGE4DSGISPROC glad_glTexImage4DSGIS; -PFNGLTEXSUBIMAGE4DSGISPROC glad_glTexSubImage4DSGIS; -PFNGLTEXIMAGE3DEXTPROC glad_glTexImage3DEXT; -PFNGLTEXSUBIMAGE3DEXTPROC glad_glTexSubImage3DEXT; -PFNGLSAMPLEMASKEXTPROC glad_glSampleMaskEXT; -PFNGLSAMPLEPATTERNEXTPROC glad_glSamplePatternEXT; -PFNGLSECONDARYCOLOR3BEXTPROC glad_glSecondaryColor3bEXT; -PFNGLSECONDARYCOLOR3BVEXTPROC glad_glSecondaryColor3bvEXT; -PFNGLSECONDARYCOLOR3DEXTPROC glad_glSecondaryColor3dEXT; -PFNGLSECONDARYCOLOR3DVEXTPROC glad_glSecondaryColor3dvEXT; -PFNGLSECONDARYCOLOR3FEXTPROC glad_glSecondaryColor3fEXT; -PFNGLSECONDARYCOLOR3FVEXTPROC glad_glSecondaryColor3fvEXT; -PFNGLSECONDARYCOLOR3IEXTPROC glad_glSecondaryColor3iEXT; -PFNGLSECONDARYCOLOR3IVEXTPROC glad_glSecondaryColor3ivEXT; -PFNGLSECONDARYCOLOR3SEXTPROC glad_glSecondaryColor3sEXT; -PFNGLSECONDARYCOLOR3SVEXTPROC glad_glSecondaryColor3svEXT; -PFNGLSECONDARYCOLOR3UBEXTPROC glad_glSecondaryColor3ubEXT; -PFNGLSECONDARYCOLOR3UBVEXTPROC glad_glSecondaryColor3ubvEXT; -PFNGLSECONDARYCOLOR3UIEXTPROC glad_glSecondaryColor3uiEXT; -PFNGLSECONDARYCOLOR3UIVEXTPROC glad_glSecondaryColor3uivEXT; -PFNGLSECONDARYCOLOR3USEXTPROC glad_glSecondaryColor3usEXT; -PFNGLSECONDARYCOLOR3USVEXTPROC glad_glSecondaryColor3usvEXT; -PFNGLSECONDARYCOLORPOINTEREXTPROC glad_glSecondaryColorPointerEXT; -PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; -PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; -PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; -PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; -PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; -PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; -PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; -PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; -PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; -PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; -PFNGLMAXSHADERCOMPILERTHREADSARBPROC glad_glMaxShaderCompilerThreadsARB; -PFNGLTEXPAGECOMMITMENTARBPROC glad_glTexPageCommitmentARB; -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; -PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; -PFNGLBUFFERPAGECOMMITMENTARBPROC glad_glBufferPageCommitmentARB; -PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC glad_glNamedBufferPageCommitmentEXT; -PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC glad_glNamedBufferPageCommitmentARB; -PFNGLDRAWRANGEELEMENTSEXTPROC glad_glDrawRangeElementsEXT; -static void load_GL_VERSION_1_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); - glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); - glad_glHint = (PFNGLHINTPROC)load("glHint"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); - glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); - glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); - glad_glClear = (PFNGLCLEARPROC)load("glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); - glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); - glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); - glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); - glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); - glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); - glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); - glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); - glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); - glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); - glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); -} -static void load_GL_VERSION_1_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); - glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); -} -static void load_GL_VERSION_1_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); -} -static void load_GL_VERSION_1_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); -} -static void load_GL_VERSION_1_4(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); -} -static void load_GL_VERSION_1_5(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); - glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); - glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); - glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); - glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); -} -static void load_GL_VERSION_2_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); -} -static void load_GL_VERSION_2_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); -} -static void load_GL_VERSION_3_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); - glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); - glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_VERSION_3_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_VERSION_3_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_VERSION_3_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_3) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); - glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); - glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_APPLE_element_array(GLADloadproc load) { - if(!GLAD_GL_APPLE_element_array) return; - glad_glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)load("glElementPointerAPPLE"); - glad_glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)load("glDrawElementArrayAPPLE"); - glad_glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)load("glDrawRangeElementArrayAPPLE"); - glad_glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)load("glMultiDrawElementArrayAPPLE"); - glad_glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)load("glMultiDrawRangeElementArrayAPPLE"); -} -static void load_GL_AMD_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_AMD_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)load("glMultiDrawArraysIndirectAMD"); - glad_glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)load("glMultiDrawElementsIndirectAMD"); -} -static void load_GL_SGIX_tag_sample_buffer(GLADloadproc load) { - if(!GLAD_GL_SGIX_tag_sample_buffer) return; - glad_glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)load("glTagSampleBufferSGIX"); -} -static void load_GL_NV_point_sprite(GLADloadproc load) { - if(!GLAD_GL_NV_point_sprite) return; - glad_glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)load("glPointParameteriNV"); - glad_glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)load("glPointParameterivNV"); -} -static void load_GL_ATI_separate_stencil(GLADloadproc load) { - if(!GLAD_GL_ATI_separate_stencil) return; - glad_glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)load("glStencilOpSeparateATI"); - glad_glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)load("glStencilFuncSeparateATI"); -} -static void load_GL_EXT_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_buffer_object) return; - glad_glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)load("glTexBufferEXT"); -} -static void load_GL_ARB_vertex_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_blend) return; - glad_glWeightbvARB = (PFNGLWEIGHTBVARBPROC)load("glWeightbvARB"); - glad_glWeightsvARB = (PFNGLWEIGHTSVARBPROC)load("glWeightsvARB"); - glad_glWeightivARB = (PFNGLWEIGHTIVARBPROC)load("glWeightivARB"); - glad_glWeightfvARB = (PFNGLWEIGHTFVARBPROC)load("glWeightfvARB"); - glad_glWeightdvARB = (PFNGLWEIGHTDVARBPROC)load("glWeightdvARB"); - glad_glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)load("glWeightubvARB"); - glad_glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)load("glWeightusvARB"); - glad_glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)load("glWeightuivARB"); - glad_glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)load("glWeightPointerARB"); - glad_glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)load("glVertexBlendARB"); -} -static void load_GL_OVR_multiview(GLADloadproc load) { - if(!GLAD_GL_OVR_multiview) return; - glad_glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)load("glFramebufferTextureMultiviewOVR"); -} -static void load_GL_ARB_program_interface_query(GLADloadproc load) { - if(!GLAD_GL_ARB_program_interface_query) return; - glad_glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)load("glGetProgramInterfaceiv"); - glad_glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)load("glGetProgramResourceIndex"); - glad_glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)load("glGetProgramResourceName"); - glad_glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)load("glGetProgramResourceiv"); - glad_glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)load("glGetProgramResourceLocation"); - glad_glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)load("glGetProgramResourceLocationIndex"); -} -static void load_GL_EXT_index_func(GLADloadproc load) { - if(!GLAD_GL_EXT_index_func) return; - glad_glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)load("glIndexFuncEXT"); -} -static void load_GL_NV_shader_buffer_load(GLADloadproc load) { - if(!GLAD_GL_NV_shader_buffer_load) return; - glad_glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)load("glMakeBufferResidentNV"); - glad_glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)load("glMakeBufferNonResidentNV"); - glad_glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)load("glIsBufferResidentNV"); - glad_glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)load("glMakeNamedBufferResidentNV"); - glad_glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)load("glMakeNamedBufferNonResidentNV"); - glad_glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)load("glIsNamedBufferResidentNV"); - glad_glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)load("glGetBufferParameterui64vNV"); - glad_glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)load("glGetNamedBufferParameterui64vNV"); - glad_glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)load("glGetIntegerui64vNV"); - glad_glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)load("glUniformui64NV"); - glad_glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)load("glUniformui64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)load("glProgramUniformui64NV"); - glad_glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)load("glProgramUniformui64vNV"); -} -static void load_GL_EXT_color_subtable(GLADloadproc load) { - if(!GLAD_GL_EXT_color_subtable) return; - glad_glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)load("glColorSubTableEXT"); - glad_glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)load("glCopyColorSubTableEXT"); -} -static void load_GL_SUNX_constant_data(GLADloadproc load) { - if(!GLAD_GL_SUNX_constant_data) return; - glad_glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)load("glFinishTextureSUNX"); -} -static void load_GL_EXT_multi_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_EXT_multi_draw_arrays) return; - glad_glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)load("glMultiDrawArraysEXT"); - glad_glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)load("glMultiDrawElementsEXT"); -} -static void load_GL_ARB_shader_atomic_counters(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_atomic_counters) return; - glad_glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)load("glGetActiveAtomicCounterBufferiv"); -} -static void load_GL_NV_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NV_conditional_render) return; - glad_glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)load("glBeginConditionalRenderNV"); - glad_glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)load("glEndConditionalRenderNV"); -} -static void load_GL_MESA_resize_buffers(GLADloadproc load) { - if(!GLAD_GL_MESA_resize_buffers) return; - glad_glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)load("glResizeBuffersMESA"); -} -static void load_GL_ARB_texture_view(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_view) return; - glad_glTextureView = (PFNGLTEXTUREVIEWPROC)load("glTextureView"); -} -static void load_GL_ARB_map_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_map_buffer_range) return; - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); -} -static void load_GL_EXT_convolution(GLADloadproc load) { - if(!GLAD_GL_EXT_convolution) return; - glad_glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)load("glConvolutionFilter1DEXT"); - glad_glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)load("glConvolutionFilter2DEXT"); - glad_glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)load("glConvolutionParameterfEXT"); - glad_glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)load("glConvolutionParameterfvEXT"); - glad_glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)load("glConvolutionParameteriEXT"); - glad_glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)load("glConvolutionParameterivEXT"); - glad_glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)load("glCopyConvolutionFilter1DEXT"); - glad_glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)load("glCopyConvolutionFilter2DEXT"); - glad_glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)load("glGetConvolutionFilterEXT"); - glad_glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)load("glGetConvolutionParameterfvEXT"); - glad_glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)load("glGetConvolutionParameterivEXT"); - glad_glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)load("glGetSeparableFilterEXT"); - glad_glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)load("glSeparableFilter2DEXT"); -} -static void load_GL_NV_vertex_attrib_integer_64bit(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_attrib_integer_64bit) return; - glad_glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)load("glVertexAttribL1i64NV"); - glad_glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)load("glVertexAttribL2i64NV"); - glad_glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)load("glVertexAttribL3i64NV"); - glad_glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)load("glVertexAttribL4i64NV"); - glad_glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)load("glVertexAttribL1i64vNV"); - glad_glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)load("glVertexAttribL2i64vNV"); - glad_glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)load("glVertexAttribL3i64vNV"); - glad_glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)load("glVertexAttribL4i64vNV"); - glad_glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)load("glVertexAttribL1ui64NV"); - glad_glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)load("glVertexAttribL2ui64NV"); - glad_glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)load("glVertexAttribL3ui64NV"); - glad_glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)load("glVertexAttribL4ui64NV"); - glad_glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)load("glVertexAttribL1ui64vNV"); - glad_glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)load("glVertexAttribL2ui64vNV"); - glad_glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)load("glVertexAttribL3ui64vNV"); - glad_glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)load("glVertexAttribL4ui64vNV"); - glad_glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)load("glGetVertexAttribLi64vNV"); - glad_glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)load("glGetVertexAttribLui64vNV"); - glad_glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)load("glVertexAttribLFormatNV"); -} -static void load_GL_EXT_paletted_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_paletted_texture) return; - glad_glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)load("glColorTableEXT"); - glad_glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)load("glGetColorTableEXT"); - glad_glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)load("glGetColorTableParameterivEXT"); - glad_glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)load("glGetColorTableParameterfvEXT"); -} -static void load_GL_ARB_texture_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_object) return; - glad_glTexBufferARB = (PFNGLTEXBUFFERARBPROC)load("glTexBufferARB"); -} -static void load_GL_ATI_pn_triangles(GLADloadproc load) { - if(!GLAD_GL_ATI_pn_triangles) return; - glad_glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)load("glPNTrianglesiATI"); - glad_glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)load("glPNTrianglesfATI"); -} -static void load_GL_SGIX_flush_raster(GLADloadproc load) { - if(!GLAD_GL_SGIX_flush_raster) return; - glad_glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)load("glFlushRasterSGIX"); -} -static void load_GL_EXT_light_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_light_texture) return; - glad_glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)load("glApplyTextureEXT"); - glad_glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)load("glTextureLightEXT"); - glad_glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)load("glTextureMaterialEXT"); -} -static void load_GL_HP_image_transform(GLADloadproc load) { - if(!GLAD_GL_HP_image_transform) return; - glad_glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)load("glImageTransformParameteriHP"); - glad_glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)load("glImageTransformParameterfHP"); - glad_glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)load("glImageTransformParameterivHP"); - glad_glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)load("glImageTransformParameterfvHP"); - glad_glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)load("glGetImageTransformParameterivHP"); - glad_glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)load("glGetImageTransformParameterfvHP"); -} -static void load_GL_AMD_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_AMD_draw_buffers_blend) return; - glad_glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)load("glBlendFuncIndexedAMD"); - glad_glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)load("glBlendFuncSeparateIndexedAMD"); - glad_glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)load("glBlendEquationIndexedAMD"); - glad_glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)load("glBlendEquationSeparateIndexedAMD"); -} -static void load_GL_APPLE_texture_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_texture_range) return; - glad_glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)load("glTextureRangeAPPLE"); - glad_glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)load("glGetTexParameterPointervAPPLE"); -} -static void load_GL_EXT_texture_array(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_array) return; - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); -} -static void load_GL_NV_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_NV_texture_barrier) return; - glad_glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)load("glTextureBarrierNV"); -} -static void load_GL_ARB_vertex_type_2_10_10_10_rev(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_type_2_10_10_10_rev) return; - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); -} -static void load_GL_3DFX_tbuffer(GLADloadproc load) { - if(!GLAD_GL_3DFX_tbuffer) return; - glad_glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)load("glTbufferMask3DFX"); -} -static void load_GL_GREMEDY_frame_terminator(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_frame_terminator) return; - glad_glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)load("glFrameTerminatorGREMEDY"); -} -static void load_GL_ARB_blend_func_extended(GLADloadproc load) { - if(!GLAD_GL_ARB_blend_func_extended) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); -} -static void load_GL_EXT_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_EXT_separate_shader_objects) return; - glad_glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)load("glUseShaderProgramEXT"); - glad_glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)load("glActiveProgramEXT"); - glad_glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)load("glCreateShaderProgramEXT"); - glad_glActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC)load("glActiveShaderProgramEXT"); - glad_glBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC)load("glBindProgramPipelineEXT"); - glad_glCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC)load("glCreateShaderProgramvEXT"); - glad_glDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC)load("glDeleteProgramPipelinesEXT"); - glad_glGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC)load("glGenProgramPipelinesEXT"); - glad_glGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC)load("glGetProgramPipelineInfoLogEXT"); - glad_glGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC)load("glGetProgramPipelineivEXT"); - glad_glIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC)load("glIsProgramPipelineEXT"); - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC)load("glUseProgramStagesEXT"); - glad_glValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC)load("glValidateProgramPipelineEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); -} -static void load_GL_NV_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_texture_multisample) return; - glad_glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTexImage2DMultisampleCoverageNV"); - glad_glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTexImage3DMultisampleCoverageNV"); - glad_glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)load("glTextureImage2DMultisampleNV"); - glad_glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)load("glTextureImage3DMultisampleNV"); - glad_glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)load("glTextureImage2DMultisampleCoverageNV"); - glad_glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)load("glTextureImage3DMultisampleCoverageNV"); -} -static void load_GL_ARB_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_objects) return; - glad_glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)load("glDeleteObjectARB"); - glad_glGetHandleARB = (PFNGLGETHANDLEARBPROC)load("glGetHandleARB"); - glad_glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)load("glDetachObjectARB"); - glad_glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)load("glCreateShaderObjectARB"); - glad_glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)load("glShaderSourceARB"); - glad_glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)load("glCompileShaderARB"); - glad_glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)load("glCreateProgramObjectARB"); - glad_glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)load("glAttachObjectARB"); - glad_glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)load("glLinkProgramARB"); - glad_glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)load("glUseProgramObjectARB"); - glad_glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)load("glValidateProgramARB"); - glad_glUniform1fARB = (PFNGLUNIFORM1FARBPROC)load("glUniform1fARB"); - glad_glUniform2fARB = (PFNGLUNIFORM2FARBPROC)load("glUniform2fARB"); - glad_glUniform3fARB = (PFNGLUNIFORM3FARBPROC)load("glUniform3fARB"); - glad_glUniform4fARB = (PFNGLUNIFORM4FARBPROC)load("glUniform4fARB"); - glad_glUniform1iARB = (PFNGLUNIFORM1IARBPROC)load("glUniform1iARB"); - glad_glUniform2iARB = (PFNGLUNIFORM2IARBPROC)load("glUniform2iARB"); - glad_glUniform3iARB = (PFNGLUNIFORM3IARBPROC)load("glUniform3iARB"); - glad_glUniform4iARB = (PFNGLUNIFORM4IARBPROC)load("glUniform4iARB"); - glad_glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)load("glUniform1fvARB"); - glad_glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)load("glUniform2fvARB"); - glad_glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)load("glUniform3fvARB"); - glad_glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)load("glUniform4fvARB"); - glad_glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)load("glUniform1ivARB"); - glad_glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)load("glUniform2ivARB"); - glad_glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)load("glUniform3ivARB"); - glad_glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)load("glUniform4ivARB"); - glad_glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)load("glUniformMatrix2fvARB"); - glad_glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)load("glUniformMatrix3fvARB"); - glad_glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)load("glUniformMatrix4fvARB"); - glad_glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)load("glGetObjectParameterfvARB"); - glad_glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)load("glGetObjectParameterivARB"); - glad_glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)load("glGetInfoLogARB"); - glad_glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)load("glGetAttachedObjectsARB"); - glad_glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)load("glGetUniformLocationARB"); - glad_glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)load("glGetActiveUniformARB"); - glad_glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)load("glGetUniformfvARB"); - glad_glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)load("glGetUniformivARB"); - glad_glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)load("glGetShaderSourceARB"); -} -static void load_GL_ARB_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_object) return; - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); -} -static void load_GL_ATI_envmap_bumpmap(GLADloadproc load) { - if(!GLAD_GL_ATI_envmap_bumpmap) return; - glad_glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)load("glTexBumpParameterivATI"); - glad_glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)load("glTexBumpParameterfvATI"); - glad_glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)load("glGetTexBumpParameterivATI"); - glad_glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)load("glGetTexBumpParameterfvATI"); -} -static void load_GL_ATI_map_object_buffer(GLADloadproc load) { - if(!GLAD_GL_ATI_map_object_buffer) return; - glad_glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)load("glMapObjectBufferATI"); - glad_glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)load("glUnmapObjectBufferATI"); -} -static void load_GL_ARB_robustness(GLADloadproc load) { - if(!GLAD_GL_ARB_robustness) return; - glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)load("glGetGraphicsResetStatusARB"); - glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)load("glGetnTexImageARB"); - glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)load("glReadnPixelsARB"); - glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)load("glGetnCompressedTexImageARB"); - glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)load("glGetnUniformfvARB"); - glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)load("glGetnUniformivARB"); - glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)load("glGetnUniformuivARB"); - glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)load("glGetnUniformdvARB"); - glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)load("glGetnMapdvARB"); - glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)load("glGetnMapfvARB"); - glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)load("glGetnMapivARB"); - glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)load("glGetnPixelMapfvARB"); - glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)load("glGetnPixelMapuivARB"); - glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)load("glGetnPixelMapusvARB"); - glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)load("glGetnPolygonStippleARB"); - glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)load("glGetnColorTableARB"); - glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)load("glGetnConvolutionFilterARB"); - glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)load("glGetnSeparableFilterARB"); - glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)load("glGetnHistogramARB"); - glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)load("glGetnMinmaxARB"); -} -static void load_GL_NV_pixel_data_range(GLADloadproc load) { - if(!GLAD_GL_NV_pixel_data_range) return; - glad_glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)load("glPixelDataRangeNV"); - glad_glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)load("glFlushPixelDataRangeNV"); -} -static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_blit) return; - glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); -} -static void load_GL_ARB_gpu_shader_fp64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_fp64) return; - glad_glUniform1d = (PFNGLUNIFORM1DPROC)load("glUniform1d"); - glad_glUniform2d = (PFNGLUNIFORM2DPROC)load("glUniform2d"); - glad_glUniform3d = (PFNGLUNIFORM3DPROC)load("glUniform3d"); - glad_glUniform4d = (PFNGLUNIFORM4DPROC)load("glUniform4d"); - glad_glUniform1dv = (PFNGLUNIFORM1DVPROC)load("glUniform1dv"); - glad_glUniform2dv = (PFNGLUNIFORM2DVPROC)load("glUniform2dv"); - glad_glUniform3dv = (PFNGLUNIFORM3DVPROC)load("glUniform3dv"); - glad_glUniform4dv = (PFNGLUNIFORM4DVPROC)load("glUniform4dv"); - glad_glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)load("glUniformMatrix2dv"); - glad_glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)load("glUniformMatrix3dv"); - glad_glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)load("glUniformMatrix4dv"); - glad_glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)load("glUniformMatrix2x3dv"); - glad_glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)load("glUniformMatrix2x4dv"); - glad_glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)load("glUniformMatrix3x2dv"); - glad_glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)load("glUniformMatrix3x4dv"); - glad_glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)load("glUniformMatrix4x2dv"); - glad_glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)load("glUniformMatrix4x3dv"); - glad_glGetUniformdv = (PFNGLGETUNIFORMDVPROC)load("glGetUniformdv"); -} -static void load_GL_NV_command_list(GLADloadproc load) { - if(!GLAD_GL_NV_command_list) return; - glad_glCreateStatesNV = (PFNGLCREATESTATESNVPROC)load("glCreateStatesNV"); - glad_glDeleteStatesNV = (PFNGLDELETESTATESNVPROC)load("glDeleteStatesNV"); - glad_glIsStateNV = (PFNGLISSTATENVPROC)load("glIsStateNV"); - glad_glStateCaptureNV = (PFNGLSTATECAPTURENVPROC)load("glStateCaptureNV"); - glad_glGetCommandHeaderNV = (PFNGLGETCOMMANDHEADERNVPROC)load("glGetCommandHeaderNV"); - glad_glGetStageIndexNV = (PFNGLGETSTAGEINDEXNVPROC)load("glGetStageIndexNV"); - glad_glDrawCommandsNV = (PFNGLDRAWCOMMANDSNVPROC)load("glDrawCommandsNV"); - glad_glDrawCommandsAddressNV = (PFNGLDRAWCOMMANDSADDRESSNVPROC)load("glDrawCommandsAddressNV"); - glad_glDrawCommandsStatesNV = (PFNGLDRAWCOMMANDSSTATESNVPROC)load("glDrawCommandsStatesNV"); - glad_glDrawCommandsStatesAddressNV = (PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC)load("glDrawCommandsStatesAddressNV"); - glad_glCreateCommandListsNV = (PFNGLCREATECOMMANDLISTSNVPROC)load("glCreateCommandListsNV"); - glad_glDeleteCommandListsNV = (PFNGLDELETECOMMANDLISTSNVPROC)load("glDeleteCommandListsNV"); - glad_glIsCommandListNV = (PFNGLISCOMMANDLISTNVPROC)load("glIsCommandListNV"); - glad_glListDrawCommandsStatesClientNV = (PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC)load("glListDrawCommandsStatesClientNV"); - glad_glCommandListSegmentsNV = (PFNGLCOMMANDLISTSEGMENTSNVPROC)load("glCommandListSegmentsNV"); - glad_glCompileCommandListNV = (PFNGLCOMPILECOMMANDLISTNVPROC)load("glCompileCommandListNV"); - glad_glCallCommandListNV = (PFNGLCALLCOMMANDLISTNVPROC)load("glCallCommandListNV"); -} -static void load_GL_EXT_vertex_weighting(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_weighting) return; - glad_glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)load("glVertexWeightfEXT"); - glad_glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)load("glVertexWeightfvEXT"); - glad_glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)load("glVertexWeightPointerEXT"); -} -static void load_GL_GREMEDY_string_marker(GLADloadproc load) { - if(!GLAD_GL_GREMEDY_string_marker) return; - glad_glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)load("glStringMarkerGREMEDY"); -} -static void load_GL_EXT_subtexture(GLADloadproc load) { - if(!GLAD_GL_EXT_subtexture) return; - glad_glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)load("glTexSubImage1DEXT"); - glad_glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)load("glTexSubImage2DEXT"); -} -static void load_GL_EXT_gpu_program_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_program_parameters) return; - glad_glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)load("glProgramEnvParameters4fvEXT"); - glad_glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glProgramLocalParameters4fvEXT"); -} -static void load_GL_NV_evaluators(GLADloadproc load) { - if(!GLAD_GL_NV_evaluators) return; - glad_glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)load("glMapControlPointsNV"); - glad_glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)load("glMapParameterivNV"); - glad_glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)load("glMapParameterfvNV"); - glad_glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)load("glGetMapControlPointsNV"); - glad_glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)load("glGetMapParameterivNV"); - glad_glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)load("glGetMapParameterfvNV"); - glad_glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)load("glGetMapAttribParameterivNV"); - glad_glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)load("glGetMapAttribParameterfvNV"); - glad_glEvalMapsNV = (PFNGLEVALMAPSNVPROC)load("glEvalMapsNV"); -} -static void load_GL_SGIS_texture_filter4(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_filter4) return; - glad_glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)load("glGetTexFilterFuncSGIS"); - glad_glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)load("glTexFilterFuncSGIS"); -} -static void load_GL_AMD_performance_monitor(GLADloadproc load) { - if(!GLAD_GL_AMD_performance_monitor) return; - glad_glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)load("glGetPerfMonitorGroupsAMD"); - glad_glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)load("glGetPerfMonitorCountersAMD"); - glad_glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)load("glGetPerfMonitorGroupStringAMD"); - glad_glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)load("glGetPerfMonitorCounterStringAMD"); - glad_glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)load("glGetPerfMonitorCounterInfoAMD"); - glad_glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)load("glGenPerfMonitorsAMD"); - glad_glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)load("glDeletePerfMonitorsAMD"); - glad_glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)load("glSelectPerfMonitorCountersAMD"); - glad_glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)load("glBeginPerfMonitorAMD"); - glad_glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)load("glEndPerfMonitorAMD"); - glad_glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)load("glGetPerfMonitorCounterDataAMD"); -} -static void load_GL_EXT_stencil_clear_tag(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_clear_tag) return; - glad_glStencilClearTagEXT = (PFNGLSTENCILCLEARTAGEXTPROC)load("glStencilClearTagEXT"); -} -static void load_GL_NV_present_video(GLADloadproc load) { - if(!GLAD_GL_NV_present_video) return; - glad_glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)load("glPresentFrameKeyedNV"); - glad_glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)load("glPresentFrameDualFillNV"); - glad_glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)load("glGetVideoivNV"); - glad_glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)load("glGetVideouivNV"); - glad_glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)load("glGetVideoi64vNV"); - glad_glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)load("glGetVideoui64vNV"); -} -static void load_GL_SGIX_framezoom(GLADloadproc load) { - if(!GLAD_GL_SGIX_framezoom) return; - glad_glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)load("glFrameZoomSGIX"); -} -static void load_GL_ARB_draw_elements_base_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_elements_base_vertex) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); -} -static void load_GL_NV_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback) return; - glad_glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)load("glBeginTransformFeedbackNV"); - glad_glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)load("glEndTransformFeedbackNV"); - glad_glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)load("glTransformFeedbackAttribsNV"); - glad_glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)load("glBindBufferRangeNV"); - glad_glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)load("glBindBufferOffsetNV"); - glad_glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)load("glBindBufferBaseNV"); - glad_glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)load("glTransformFeedbackVaryingsNV"); - glad_glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)load("glActiveVaryingNV"); - glad_glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)load("glGetVaryingLocationNV"); - glad_glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)load("glGetActiveVaryingNV"); - glad_glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)load("glGetTransformFeedbackVaryingNV"); - glad_glTransformFeedbackStreamAttribsNV = (PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC)load("glTransformFeedbackStreamAttribsNV"); -} -static void load_GL_NV_fragment_program(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_program) return; - glad_glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)load("glProgramNamedParameter4fNV"); - glad_glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)load("glProgramNamedParameter4fvNV"); - glad_glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)load("glProgramNamedParameter4dNV"); - glad_glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)load("glProgramNamedParameter4dvNV"); - glad_glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)load("glGetProgramNamedParameterfvNV"); - glad_glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)load("glGetProgramNamedParameterdvNV"); -} -static void load_GL_AMD_stencil_operation_extended(GLADloadproc load) { - if(!GLAD_GL_AMD_stencil_operation_extended) return; - glad_glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)load("glStencilOpValueAMD"); -} -static void load_GL_ARB_instanced_arrays(GLADloadproc load) { - if(!GLAD_GL_ARB_instanced_arrays) return; - glad_glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)load("glVertexAttribDivisorARB"); -} -static void load_GL_EXT_polygon_offset(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset) return; - glad_glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)load("glPolygonOffsetEXT"); -} -static void load_GL_KHR_robustness(GLADloadproc load) { - if(!GLAD_GL_KHR_robustness) return; - glad_glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)load("glGetGraphicsResetStatus"); - glad_glReadnPixels = (PFNGLREADNPIXELSPROC)load("glReadnPixels"); - glad_glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)load("glGetnUniformfv"); - glad_glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)load("glGetnUniformiv"); - glad_glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)load("glGetnUniformuiv"); - glad_glGetGraphicsResetStatusKHR = (PFNGLGETGRAPHICSRESETSTATUSKHRPROC)load("glGetGraphicsResetStatusKHR"); - glad_glReadnPixelsKHR = (PFNGLREADNPIXELSKHRPROC)load("glReadnPixelsKHR"); - glad_glGetnUniformfvKHR = (PFNGLGETNUNIFORMFVKHRPROC)load("glGetnUniformfvKHR"); - glad_glGetnUniformivKHR = (PFNGLGETNUNIFORMIVKHRPROC)load("glGetnUniformivKHR"); - glad_glGetnUniformuivKHR = (PFNGLGETNUNIFORMUIVKHRPROC)load("glGetnUniformuivKHR"); -} -static void load_GL_AMD_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_AMD_sparse_texture) return; - glad_glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)load("glTexStorageSparseAMD"); - glad_glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)load("glTextureStorageSparseAMD"); -} -static void load_GL_ARB_clip_control(GLADloadproc load) { - if(!GLAD_GL_ARB_clip_control) return; - glad_glClipControl = (PFNGLCLIPCONTROLPROC)load("glClipControl"); -} -static void load_GL_NV_fragment_coverage_to_color(GLADloadproc load) { - if(!GLAD_GL_NV_fragment_coverage_to_color) return; - glad_glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)load("glFragmentCoverageColorNV"); -} -static void load_GL_NV_fence(GLADloadproc load) { - if(!GLAD_GL_NV_fence) return; - glad_glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)load("glDeleteFencesNV"); - glad_glGenFencesNV = (PFNGLGENFENCESNVPROC)load("glGenFencesNV"); - glad_glIsFenceNV = (PFNGLISFENCENVPROC)load("glIsFenceNV"); - glad_glTestFenceNV = (PFNGLTESTFENCENVPROC)load("glTestFenceNV"); - glad_glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)load("glGetFenceivNV"); - glad_glFinishFenceNV = (PFNGLFINISHFENCENVPROC)load("glFinishFenceNV"); - glad_glSetFenceNV = (PFNGLSETFENCENVPROC)load("glSetFenceNV"); -} -static void load_GL_ARB_texture_buffer_range(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_buffer_range) return; - glad_glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)load("glTexBufferRange"); -} -static void load_GL_SUN_mesh_array(GLADloadproc load) { - if(!GLAD_GL_SUN_mesh_array) return; - glad_glDrawMeshArraysSUN = (PFNGLDRAWMESHARRAYSSUNPROC)load("glDrawMeshArraysSUN"); -} -static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_binding) return; - glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); - glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); - glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); - glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); - glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); - glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); -} -static void load_GL_ARB_framebuffer_no_attachments(GLADloadproc load) { - if(!GLAD_GL_ARB_framebuffer_no_attachments) return; - glad_glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)load("glFramebufferParameteri"); - glad_glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)load("glGetFramebufferParameteriv"); -} -static void load_GL_ARB_cl_event(GLADloadproc load) { - if(!GLAD_GL_ARB_cl_event) return; - glad_glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)load("glCreateSyncFromCLeventARB"); -} -static void load_GL_OES_single_precision(GLADloadproc load) { - if(!GLAD_GL_OES_single_precision) return; - glad_glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)load("glClearDepthfOES"); - glad_glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)load("glClipPlanefOES"); - glad_glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)load("glDepthRangefOES"); - glad_glFrustumfOES = (PFNGLFRUSTUMFOESPROC)load("glFrustumfOES"); - glad_glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)load("glGetClipPlanefOES"); - glad_glOrthofOES = (PFNGLORTHOFOESPROC)load("glOrthofOES"); -} -static void load_GL_NV_primitive_restart(GLADloadproc load) { - if(!GLAD_GL_NV_primitive_restart) return; - glad_glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)load("glPrimitiveRestartNV"); - glad_glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)load("glPrimitiveRestartIndexNV"); -} -static void load_GL_SUN_global_alpha(GLADloadproc load) { - if(!GLAD_GL_SUN_global_alpha) return; - glad_glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)load("glGlobalAlphaFactorbSUN"); - glad_glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)load("glGlobalAlphaFactorsSUN"); - glad_glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)load("glGlobalAlphaFactoriSUN"); - glad_glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)load("glGlobalAlphaFactorfSUN"); - glad_glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)load("glGlobalAlphaFactordSUN"); - glad_glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)load("glGlobalAlphaFactorubSUN"); - glad_glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)load("glGlobalAlphaFactorusSUN"); - glad_glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)load("glGlobalAlphaFactoruiSUN"); -} -static void load_GL_EXT_texture_object(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_object) return; - glad_glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)load("glAreTexturesResidentEXT"); - glad_glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)load("glBindTextureEXT"); - glad_glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)load("glDeleteTexturesEXT"); - glad_glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)load("glGenTexturesEXT"); - glad_glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)load("glIsTextureEXT"); - glad_glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)load("glPrioritizeTexturesEXT"); -} -static void load_GL_AMD_name_gen_delete(GLADloadproc load) { - if(!GLAD_GL_AMD_name_gen_delete) return; - glad_glGenNamesAMD = (PFNGLGENNAMESAMDPROC)load("glGenNamesAMD"); - glad_glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)load("glDeleteNamesAMD"); - glad_glIsNameAMD = (PFNGLISNAMEAMDPROC)load("glIsNameAMD"); -} -static void load_GL_ARB_buffer_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_buffer_storage) return; - glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); -} -static void load_GL_APPLE_vertex_program_evaluators(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_program_evaluators) return; - glad_glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)load("glEnableVertexAttribAPPLE"); - glad_glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)load("glDisableVertexAttribAPPLE"); - glad_glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)load("glIsVertexAttribEnabledAPPLE"); - glad_glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)load("glMapVertexAttrib1dAPPLE"); - glad_glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)load("glMapVertexAttrib1fAPPLE"); - glad_glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)load("glMapVertexAttrib2dAPPLE"); - glad_glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)load("glMapVertexAttrib2fAPPLE"); -} -static void load_GL_ARB_multi_bind(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_bind) return; - glad_glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)load("glBindBuffersBase"); - glad_glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)load("glBindBuffersRange"); - glad_glBindTextures = (PFNGLBINDTEXTURESPROC)load("glBindTextures"); - glad_glBindSamplers = (PFNGLBINDSAMPLERSPROC)load("glBindSamplers"); - glad_glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)load("glBindImageTextures"); - glad_glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)load("glBindVertexBuffers"); -} -static void load_GL_SGIX_list_priority(GLADloadproc load) { - if(!GLAD_GL_SGIX_list_priority) return; - glad_glGetListParameterfvSGIX = (PFNGLGETLISTPARAMETERFVSGIXPROC)load("glGetListParameterfvSGIX"); - glad_glGetListParameterivSGIX = (PFNGLGETLISTPARAMETERIVSGIXPROC)load("glGetListParameterivSGIX"); - glad_glListParameterfSGIX = (PFNGLLISTPARAMETERFSGIXPROC)load("glListParameterfSGIX"); - glad_glListParameterfvSGIX = (PFNGLLISTPARAMETERFVSGIXPROC)load("glListParameterfvSGIX"); - glad_glListParameteriSGIX = (PFNGLLISTPARAMETERISGIXPROC)load("glListParameteriSGIX"); - glad_glListParameterivSGIX = (PFNGLLISTPARAMETERIVSGIXPROC)load("glListParameterivSGIX"); -} -static void load_GL_NV_vertex_buffer_unified_memory(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_buffer_unified_memory) return; - glad_glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)load("glBufferAddressRangeNV"); - glad_glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)load("glVertexFormatNV"); - glad_glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)load("glNormalFormatNV"); - glad_glColorFormatNV = (PFNGLCOLORFORMATNVPROC)load("glColorFormatNV"); - glad_glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)load("glIndexFormatNV"); - glad_glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)load("glTexCoordFormatNV"); - glad_glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)load("glEdgeFlagFormatNV"); - glad_glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)load("glSecondaryColorFormatNV"); - glad_glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)load("glFogCoordFormatNV"); - glad_glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)load("glVertexAttribFormatNV"); - glad_glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)load("glVertexAttribIFormatNV"); - glad_glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)load("glGetIntegerui64i_vNV"); -} -static void load_GL_NV_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_NV_blend_equation_advanced) return; - glad_glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)load("glBlendParameteriNV"); - glad_glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)load("glBlendBarrierNV"); -} -static void load_GL_SGIS_sharpen_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_sharpen_texture) return; - glad_glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)load("glSharpenTexFuncSGIS"); - glad_glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)load("glGetSharpenTexFuncSGIS"); -} -static void load_GL_ARB_vertex_program(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_program) return; - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_buffer_object) return; - glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); - glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); - glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); - glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); - glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); - glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); - glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); - glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); - glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); - glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); - glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); -} -static void load_GL_NV_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_array_range) return; - glad_glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)load("glFlushVertexArrayRangeNV"); - glad_glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)load("glVertexArrayRangeNV"); -} -static void load_GL_SGIX_fragment_lighting(GLADloadproc load) { - if(!GLAD_GL_SGIX_fragment_lighting) return; - glad_glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)load("glFragmentColorMaterialSGIX"); - glad_glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)load("glFragmentLightfSGIX"); - glad_glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)load("glFragmentLightfvSGIX"); - glad_glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)load("glFragmentLightiSGIX"); - glad_glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)load("glFragmentLightivSGIX"); - glad_glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)load("glFragmentLightModelfSGIX"); - glad_glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)load("glFragmentLightModelfvSGIX"); - glad_glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)load("glFragmentLightModeliSGIX"); - glad_glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)load("glFragmentLightModelivSGIX"); - glad_glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)load("glFragmentMaterialfSGIX"); - glad_glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)load("glFragmentMaterialfvSGIX"); - glad_glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)load("glFragmentMaterialiSGIX"); - glad_glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)load("glFragmentMaterialivSGIX"); - glad_glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)load("glGetFragmentLightfvSGIX"); - glad_glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)load("glGetFragmentLightivSGIX"); - glad_glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)load("glGetFragmentMaterialfvSGIX"); - glad_glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)load("glGetFragmentMaterialivSGIX"); - glad_glLightEnviSGIX = (PFNGLLIGHTENVISGIXPROC)load("glLightEnviSGIX"); -} -static void load_GL_NV_framebuffer_multisample_coverage(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_multisample_coverage) return; - glad_glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)load("glRenderbufferStorageMultisampleCoverageNV"); -} -static void load_GL_EXT_timer_query(GLADloadproc load) { - if(!GLAD_GL_EXT_timer_query) return; - glad_glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)load("glGetQueryObjecti64vEXT"); - glad_glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)load("glGetQueryObjectui64vEXT"); -} -static void load_GL_NV_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_texture) return; - glad_glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)load("glGetTextureHandleNV"); - glad_glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)load("glGetTextureSamplerHandleNV"); - glad_glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)load("glMakeTextureHandleResidentNV"); - glad_glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)load("glMakeTextureHandleNonResidentNV"); - glad_glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)load("glGetImageHandleNV"); - glad_glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)load("glMakeImageHandleResidentNV"); - glad_glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)load("glMakeImageHandleNonResidentNV"); - glad_glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)load("glUniformHandleui64NV"); - glad_glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)load("glUniformHandleui64vNV"); - glad_glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)load("glProgramUniformHandleui64NV"); - glad_glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)load("glProgramUniformHandleui64vNV"); - glad_glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)load("glIsTextureHandleResidentNV"); - glad_glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)load("glIsImageHandleResidentNV"); -} -static void load_GL_KHR_debug(GLADloadproc load) { - if(!GLAD_GL_KHR_debug) return; - glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)load("glDebugMessageControl"); - glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)load("glDebugMessageInsert"); - glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)load("glDebugMessageCallback"); - glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)load("glGetDebugMessageLog"); - glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)load("glPushDebugGroup"); - glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)load("glPopDebugGroup"); - glad_glObjectLabel = (PFNGLOBJECTLABELPROC)load("glObjectLabel"); - glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)load("glGetObjectLabel"); - glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)load("glObjectPtrLabel"); - glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)load("glGetObjectPtrLabel"); - glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); - glad_glDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)load("glDebugMessageControlKHR"); - glad_glDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC)load("glDebugMessageInsertKHR"); - glad_glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)load("glDebugMessageCallbackKHR"); - glad_glGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC)load("glGetDebugMessageLogKHR"); - glad_glPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC)load("glPushDebugGroupKHR"); - glad_glPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC)load("glPopDebugGroupKHR"); - glad_glObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC)load("glObjectLabelKHR"); - glad_glGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC)load("glGetObjectLabelKHR"); - glad_glObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC)load("glObjectPtrLabelKHR"); - glad_glGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC)load("glGetObjectPtrLabelKHR"); - glad_glGetPointervKHR = (PFNGLGETPOINTERVKHRPROC)load("glGetPointervKHR"); -} -static void load_GL_ATI_vertex_attrib_array_object(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_attrib_array_object) return; - glad_glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)load("glVertexAttribArrayObjectATI"); - glad_glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)load("glGetVertexAttribArrayObjectfvATI"); - glad_glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)load("glGetVertexAttribArrayObjectivATI"); -} -static void load_GL_EXT_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_geometry_shader4) return; - glad_glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)load("glProgramParameteriEXT"); -} -static void load_GL_EXT_bindable_uniform(GLADloadproc load) { - if(!GLAD_GL_EXT_bindable_uniform) return; - glad_glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)load("glUniformBufferEXT"); - glad_glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)load("glGetUniformBufferSizeEXT"); - glad_glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)load("glGetUniformOffsetEXT"); -} -static void load_GL_KHR_blend_equation_advanced(GLADloadproc load) { - if(!GLAD_GL_KHR_blend_equation_advanced) return; - glad_glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)load("glBlendBarrierKHR"); -} -static void load_GL_ATI_element_array(GLADloadproc load) { - if(!GLAD_GL_ATI_element_array) return; - glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); - glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); - glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); -} -static void load_GL_SGIX_reference_plane(GLADloadproc load) { - if(!GLAD_GL_SGIX_reference_plane) return; - glad_glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)load("glReferencePlaneSGIX"); -} -static void load_GL_EXT_stencil_two_side(GLADloadproc load) { - if(!GLAD_GL_EXT_stencil_two_side) return; - glad_glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)load("glActiveStencilFaceEXT"); -} -static void load_GL_NV_explicit_multisample(GLADloadproc load) { - if(!GLAD_GL_NV_explicit_multisample) return; - glad_glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)load("glGetMultisamplefvNV"); - glad_glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)load("glSampleMaskIndexedNV"); - glad_glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)load("glTexRenderbufferNV"); -} -static void load_GL_IBM_static_data(GLADloadproc load) { - if(!GLAD_GL_IBM_static_data) return; - glad_glFlushStaticDataIBM = (PFNGLFLUSHSTATICDATAIBMPROC)load("glFlushStaticDataIBM"); -} -static void load_GL_EXT_texture_perturb_normal(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_perturb_normal) return; - glad_glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)load("glTextureNormalEXT"); -} -static void load_GL_EXT_point_parameters(GLADloadproc load) { - if(!GLAD_GL_EXT_point_parameters) return; - glad_glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)load("glPointParameterfEXT"); - glad_glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)load("glPointParameterfvEXT"); -} -static void load_GL_PGI_misc_hints(GLADloadproc load) { - if(!GLAD_GL_PGI_misc_hints) return; - glad_glHintPGI = (PFNGLHINTPGIPROC)load("glHintPGI"); -} -static void load_GL_ARB_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_shader) return; - glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); - glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); - glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); - glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); - glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); - glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); - glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); - glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); - glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); - glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); - glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); - glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); - glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); - glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); - glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); - glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); - glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); - glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); - glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); - glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); - glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); - glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); - glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); - glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); - glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); - glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); - glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); - glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); - glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); - glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); - glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); - glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); - glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); - glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); - glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); - glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); - glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); - glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); - glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); - glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); - glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); - glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); - glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); - glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); - glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); - glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); -} -static void load_GL_ARB_tessellation_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_tessellation_shader) return; - glad_glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)load("glPatchParameteri"); - glad_glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)load("glPatchParameterfv"); -} -static void load_GL_EXT_draw_buffers2(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_buffers2) return; - glad_glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)load("glColorMaskIndexedEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); -} -static void load_GL_ARB_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_attrib_64bit) return; - glad_glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)load("glVertexAttribL1d"); - glad_glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)load("glVertexAttribL2d"); - glad_glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)load("glVertexAttribL3d"); - glad_glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)load("glVertexAttribL4d"); - glad_glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)load("glVertexAttribL1dv"); - glad_glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)load("glVertexAttribL2dv"); - glad_glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)load("glVertexAttribL3dv"); - glad_glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)load("glVertexAttribL4dv"); - glad_glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)load("glVertexAttribLPointer"); - glad_glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)load("glGetVertexAttribLdv"); -} -static void load_GL_EXT_texture_filter_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_filter_minmax) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); -} -static void load_GL_AMD_interleaved_elements(GLADloadproc load) { - if(!GLAD_GL_AMD_interleaved_elements) return; - glad_glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)load("glVertexAttribParameteriAMD"); -} -static void load_GL_ARB_fragment_program(GLADloadproc load) { - if(!GLAD_GL_ARB_fragment_program) return; - glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); - glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); - glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); - glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); - glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); - glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); - glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); - glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); - glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); - glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); - glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); - glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); - glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); - glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); - glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); - glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); - glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); - glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); - glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); -} -static void load_GL_ARB_texture_storage(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage) return; - glad_glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)load("glTexStorage1D"); - glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)load("glTexStorage2D"); - glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)load("glTexStorage3D"); -} -static void load_GL_ARB_copy_image(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_image) return; - glad_glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)load("glCopyImageSubData"); -} -static void load_GL_SGIS_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_pixel_texture) return; - glad_glPixelTexGenParameteriSGIS = (PFNGLPIXELTEXGENPARAMETERISGISPROC)load("glPixelTexGenParameteriSGIS"); - glad_glPixelTexGenParameterivSGIS = (PFNGLPIXELTEXGENPARAMETERIVSGISPROC)load("glPixelTexGenParameterivSGIS"); - glad_glPixelTexGenParameterfSGIS = (PFNGLPIXELTEXGENPARAMETERFSGISPROC)load("glPixelTexGenParameterfSGIS"); - glad_glPixelTexGenParameterfvSGIS = (PFNGLPIXELTEXGENPARAMETERFVSGISPROC)load("glPixelTexGenParameterfvSGIS"); - glad_glGetPixelTexGenParameterivSGIS = (PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC)load("glGetPixelTexGenParameterivSGIS"); - glad_glGetPixelTexGenParameterfvSGIS = (PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC)load("glGetPixelTexGenParameterfvSGIS"); -} -static void load_GL_SGIX_instruments(GLADloadproc load) { - if(!GLAD_GL_SGIX_instruments) return; - glad_glGetInstrumentsSGIX = (PFNGLGETINSTRUMENTSSGIXPROC)load("glGetInstrumentsSGIX"); - glad_glInstrumentsBufferSGIX = (PFNGLINSTRUMENTSBUFFERSGIXPROC)load("glInstrumentsBufferSGIX"); - glad_glPollInstrumentsSGIX = (PFNGLPOLLINSTRUMENTSSGIXPROC)load("glPollInstrumentsSGIX"); - glad_glReadInstrumentsSGIX = (PFNGLREADINSTRUMENTSSGIXPROC)load("glReadInstrumentsSGIX"); - glad_glStartInstrumentsSGIX = (PFNGLSTARTINSTRUMENTSSGIXPROC)load("glStartInstrumentsSGIX"); - glad_glStopInstrumentsSGIX = (PFNGLSTOPINSTRUMENTSSGIXPROC)load("glStopInstrumentsSGIX"); -} -static void load_GL_ARB_shader_storage_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_storage_buffer_object) return; - glad_glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)load("glShaderStorageBlockBinding"); -} -static void load_GL_EXT_blend_minmax(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_minmax) return; - glad_glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)load("glBlendEquationEXT"); -} -static void load_GL_ARB_base_instance(GLADloadproc load) { - if(!GLAD_GL_ARB_base_instance) return; - glad_glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)load("glDrawArraysInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)load("glDrawElementsInstancedBaseInstance"); - glad_glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)load("glDrawElementsInstancedBaseVertexBaseInstance"); -} -static void load_GL_ARB_ES3_1_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_1_compatibility) return; - glad_glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)load("glMemoryBarrierByRegion"); -} -static void load_GL_EXT_texture_integer(GLADloadproc load) { - if(!GLAD_GL_EXT_texture_integer) return; - glad_glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)load("glTexParameterIivEXT"); - glad_glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)load("glTexParameterIuivEXT"); - glad_glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)load("glGetTexParameterIivEXT"); - glad_glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)load("glGetTexParameterIuivEXT"); - glad_glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)load("glClearColorIiEXT"); - glad_glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)load("glClearColorIuiEXT"); -} -static void load_GL_ARB_texture_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_multisample) return; - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void load_GL_AMD_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_AMD_gpu_shader_int64) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)load("glGetUniformui64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_AMD_vertex_shader_tessellator(GLADloadproc load) { - if(!GLAD_GL_AMD_vertex_shader_tessellator) return; - glad_glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)load("glTessellationFactorAMD"); - glad_glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)load("glTessellationModeAMD"); -} -static void load_GL_ARB_invalidate_subdata(GLADloadproc load) { - if(!GLAD_GL_ARB_invalidate_subdata) return; - glad_glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)load("glInvalidateTexSubImage"); - glad_glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)load("glInvalidateTexImage"); - glad_glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)load("glInvalidateBufferSubData"); - glad_glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)load("glInvalidateBufferData"); - glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)load("glInvalidateFramebuffer"); - glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)load("glInvalidateSubFramebuffer"); -} -static void load_GL_EXT_index_material(GLADloadproc load) { - if(!GLAD_GL_EXT_index_material) return; - glad_glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)load("glIndexMaterialEXT"); -} -static void load_GL_INTEL_parallel_arrays(GLADloadproc load) { - if(!GLAD_GL_INTEL_parallel_arrays) return; - glad_glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)load("glVertexPointervINTEL"); - glad_glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)load("glNormalPointervINTEL"); - glad_glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)load("glColorPointervINTEL"); - glad_glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)load("glTexCoordPointervINTEL"); -} -static void load_GL_ATI_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ATI_draw_buffers) return; - glad_glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)load("glDrawBuffersATI"); -} -static void load_GL_SGIX_pixel_texture(GLADloadproc load) { - if(!GLAD_GL_SGIX_pixel_texture) return; - glad_glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)load("glPixelTexGenSGIX"); -} -static void load_GL_ARB_timer_query(GLADloadproc load) { - if(!GLAD_GL_ARB_timer_query) return; - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); -} -static void load_GL_NV_parameter_buffer_object(GLADloadproc load) { - if(!GLAD_GL_NV_parameter_buffer_object) return; - glad_glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)load("glProgramBufferParametersfvNV"); - glad_glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)load("glProgramBufferParametersIivNV"); - glad_glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)load("glProgramBufferParametersIuivNV"); -} -static void load_GL_ARB_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_ARB_direct_state_access) return; - glad_glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)load("glCreateTransformFeedbacks"); - glad_glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)load("glTransformFeedbackBufferBase"); - glad_glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)load("glTransformFeedbackBufferRange"); - glad_glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)load("glGetTransformFeedbackiv"); - glad_glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)load("glGetTransformFeedbacki_v"); - glad_glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)load("glGetTransformFeedbacki64_v"); - glad_glCreateBuffers = (PFNGLCREATEBUFFERSPROC)load("glCreateBuffers"); - glad_glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)load("glNamedBufferStorage"); - glad_glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)load("glNamedBufferData"); - glad_glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)load("glNamedBufferSubData"); - glad_glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)load("glCopyNamedBufferSubData"); - glad_glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)load("glClearNamedBufferData"); - glad_glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)load("glClearNamedBufferSubData"); - glad_glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)load("glMapNamedBuffer"); - glad_glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)load("glMapNamedBufferRange"); - glad_glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)load("glUnmapNamedBuffer"); - glad_glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)load("glFlushMappedNamedBufferRange"); - glad_glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)load("glGetNamedBufferParameteriv"); - glad_glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)load("glGetNamedBufferParameteri64v"); - glad_glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)load("glGetNamedBufferPointerv"); - glad_glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)load("glGetNamedBufferSubData"); - glad_glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)load("glCreateFramebuffers"); - glad_glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)load("glNamedFramebufferRenderbuffer"); - glad_glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)load("glNamedFramebufferParameteri"); - glad_glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)load("glNamedFramebufferTexture"); - glad_glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)load("glNamedFramebufferTextureLayer"); - glad_glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)load("glNamedFramebufferDrawBuffer"); - glad_glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)load("glNamedFramebufferDrawBuffers"); - glad_glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)load("glNamedFramebufferReadBuffer"); - glad_glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)load("glInvalidateNamedFramebufferData"); - glad_glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)load("glInvalidateNamedFramebufferSubData"); - glad_glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)load("glClearNamedFramebufferiv"); - glad_glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)load("glClearNamedFramebufferuiv"); - glad_glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)load("glClearNamedFramebufferfv"); - glad_glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)load("glClearNamedFramebufferfi"); - glad_glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)load("glBlitNamedFramebuffer"); - glad_glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)load("glCheckNamedFramebufferStatus"); - glad_glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)load("glGetNamedFramebufferParameteriv"); - glad_glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetNamedFramebufferAttachmentParameteriv"); - glad_glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)load("glCreateRenderbuffers"); - glad_glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)load("glNamedRenderbufferStorage"); - glad_glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glNamedRenderbufferStorageMultisample"); - glad_glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)load("glGetNamedRenderbufferParameteriv"); - glad_glCreateTextures = (PFNGLCREATETEXTURESPROC)load("glCreateTextures"); - glad_glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)load("glTextureBuffer"); - glad_glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)load("glTextureBufferRange"); - glad_glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)load("glTextureStorage1D"); - glad_glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)load("glTextureStorage2D"); - glad_glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)load("glTextureStorage3D"); - glad_glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)load("glTextureStorage2DMultisample"); - glad_glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)load("glTextureStorage3DMultisample"); - glad_glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)load("glTextureSubImage1D"); - glad_glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)load("glTextureSubImage2D"); - glad_glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)load("glTextureSubImage3D"); - glad_glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)load("glCompressedTextureSubImage1D"); - glad_glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)load("glCompressedTextureSubImage2D"); - glad_glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)load("glCompressedTextureSubImage3D"); - glad_glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)load("glCopyTextureSubImage1D"); - glad_glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)load("glCopyTextureSubImage2D"); - glad_glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)load("glCopyTextureSubImage3D"); - glad_glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)load("glTextureParameterf"); - glad_glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)load("glTextureParameterfv"); - glad_glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)load("glTextureParameteri"); - glad_glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)load("glTextureParameterIiv"); - glad_glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)load("glTextureParameterIuiv"); - glad_glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)load("glTextureParameteriv"); - glad_glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)load("glGenerateTextureMipmap"); - glad_glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)load("glBindTextureUnit"); - glad_glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)load("glGetTextureImage"); - glad_glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)load("glGetCompressedTextureImage"); - glad_glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)load("glGetTextureLevelParameterfv"); - glad_glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)load("glGetTextureLevelParameteriv"); - glad_glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)load("glGetTextureParameterfv"); - glad_glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)load("glGetTextureParameterIiv"); - glad_glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)load("glGetTextureParameterIuiv"); - glad_glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)load("glGetTextureParameteriv"); - glad_glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)load("glCreateVertexArrays"); - glad_glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)load("glDisableVertexArrayAttrib"); - glad_glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)load("glEnableVertexArrayAttrib"); - glad_glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)load("glVertexArrayElementBuffer"); - glad_glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)load("glVertexArrayVertexBuffer"); - glad_glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)load("glVertexArrayVertexBuffers"); - glad_glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)load("glVertexArrayAttribBinding"); - glad_glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)load("glVertexArrayAttribFormat"); - glad_glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)load("glVertexArrayAttribIFormat"); - glad_glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)load("glVertexArrayAttribLFormat"); - glad_glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)load("glVertexArrayBindingDivisor"); - glad_glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)load("glGetVertexArrayiv"); - glad_glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)load("glGetVertexArrayIndexediv"); - glad_glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)load("glGetVertexArrayIndexed64iv"); - glad_glCreateSamplers = (PFNGLCREATESAMPLERSPROC)load("glCreateSamplers"); - glad_glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)load("glCreateProgramPipelines"); - glad_glCreateQueries = (PFNGLCREATEQUERIESPROC)load("glCreateQueries"); - glad_glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)load("glGetQueryBufferObjecti64v"); - glad_glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)load("glGetQueryBufferObjectiv"); - glad_glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)load("glGetQueryBufferObjectui64v"); - glad_glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)load("glGetQueryBufferObjectuiv"); -} -static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_uniform_buffer_object) return; - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); -} -static void load_GL_NV_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_NV_transform_feedback2) return; - glad_glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)load("glBindTransformFeedbackNV"); - glad_glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)load("glDeleteTransformFeedbacksNV"); - glad_glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)load("glGenTransformFeedbacksNV"); - glad_glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)load("glIsTransformFeedbackNV"); - glad_glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)load("glPauseTransformFeedbackNV"); - glad_glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)load("glResumeTransformFeedbackNV"); - glad_glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)load("glDrawTransformFeedbackNV"); -} -static void load_GL_EXT_blend_color(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_color) return; - glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); -} -static void load_GL_EXT_histogram(GLADloadproc load) { - if(!GLAD_GL_EXT_histogram) return; - glad_glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)load("glGetHistogramEXT"); - glad_glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)load("glGetHistogramParameterfvEXT"); - glad_glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)load("glGetHistogramParameterivEXT"); - glad_glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)load("glGetMinmaxEXT"); - glad_glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)load("glGetMinmaxParameterfvEXT"); - glad_glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)load("glGetMinmaxParameterivEXT"); - glad_glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)load("glHistogramEXT"); - glad_glMinmaxEXT = (PFNGLMINMAXEXTPROC)load("glMinmaxEXT"); - glad_glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)load("glResetHistogramEXT"); - glad_glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)load("glResetMinmaxEXT"); -} -static void load_GL_ARB_get_texture_sub_image(GLADloadproc load) { - if(!GLAD_GL_ARB_get_texture_sub_image) return; - glad_glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)load("glGetTextureSubImage"); - glad_glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)load("glGetCompressedTextureSubImage"); -} -static void load_GL_SGIS_point_parameters(GLADloadproc load) { - if(!GLAD_GL_SGIS_point_parameters) return; - glad_glPointParameterfSGIS = (PFNGLPOINTPARAMETERFSGISPROC)load("glPointParameterfSGIS"); - glad_glPointParameterfvSGIS = (PFNGLPOINTPARAMETERFVSGISPROC)load("glPointParameterfvSGIS"); -} -static void load_GL_EXT_direct_state_access(GLADloadproc load) { - if(!GLAD_GL_EXT_direct_state_access) return; - glad_glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)load("glMatrixLoadfEXT"); - glad_glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)load("glMatrixLoaddEXT"); - glad_glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)load("glMatrixMultfEXT"); - glad_glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)load("glMatrixMultdEXT"); - glad_glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)load("glMatrixLoadIdentityEXT"); - glad_glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)load("glMatrixRotatefEXT"); - glad_glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)load("glMatrixRotatedEXT"); - glad_glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)load("glMatrixScalefEXT"); - glad_glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)load("glMatrixScaledEXT"); - glad_glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)load("glMatrixTranslatefEXT"); - glad_glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)load("glMatrixTranslatedEXT"); - glad_glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)load("glMatrixFrustumEXT"); - glad_glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)load("glMatrixOrthoEXT"); - glad_glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)load("glMatrixPopEXT"); - glad_glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)load("glMatrixPushEXT"); - glad_glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)load("glClientAttribDefaultEXT"); - glad_glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)load("glPushClientAttribDefaultEXT"); - glad_glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)load("glTextureParameterfEXT"); - glad_glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)load("glTextureParameterfvEXT"); - glad_glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)load("glTextureParameteriEXT"); - glad_glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)load("glTextureParameterivEXT"); - glad_glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)load("glTextureImage1DEXT"); - glad_glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)load("glTextureImage2DEXT"); - glad_glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)load("glTextureSubImage1DEXT"); - glad_glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)load("glTextureSubImage2DEXT"); - glad_glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)load("glCopyTextureImage1DEXT"); - glad_glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)load("glCopyTextureImage2DEXT"); - glad_glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)load("glCopyTextureSubImage1DEXT"); - glad_glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)load("glCopyTextureSubImage2DEXT"); - glad_glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)load("glGetTextureImageEXT"); - glad_glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)load("glGetTextureParameterfvEXT"); - glad_glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)load("glGetTextureParameterivEXT"); - glad_glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)load("glGetTextureLevelParameterfvEXT"); - glad_glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)load("glGetTextureLevelParameterivEXT"); - glad_glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)load("glTextureImage3DEXT"); - glad_glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)load("glTextureSubImage3DEXT"); - glad_glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)load("glCopyTextureSubImage3DEXT"); - glad_glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)load("glBindMultiTextureEXT"); - glad_glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)load("glMultiTexCoordPointerEXT"); - glad_glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)load("glMultiTexEnvfEXT"); - glad_glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)load("glMultiTexEnvfvEXT"); - glad_glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)load("glMultiTexEnviEXT"); - glad_glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)load("glMultiTexEnvivEXT"); - glad_glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)load("glMultiTexGendEXT"); - glad_glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)load("glMultiTexGendvEXT"); - glad_glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)load("glMultiTexGenfEXT"); - glad_glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)load("glMultiTexGenfvEXT"); - glad_glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)load("glMultiTexGeniEXT"); - glad_glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)load("glMultiTexGenivEXT"); - glad_glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)load("glGetMultiTexEnvfvEXT"); - glad_glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)load("glGetMultiTexEnvivEXT"); - glad_glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)load("glGetMultiTexGendvEXT"); - glad_glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)load("glGetMultiTexGenfvEXT"); - glad_glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)load("glGetMultiTexGenivEXT"); - glad_glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)load("glMultiTexParameteriEXT"); - glad_glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)load("glMultiTexParameterivEXT"); - glad_glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)load("glMultiTexParameterfEXT"); - glad_glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)load("glMultiTexParameterfvEXT"); - glad_glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)load("glMultiTexImage1DEXT"); - glad_glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)load("glMultiTexImage2DEXT"); - glad_glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)load("glMultiTexSubImage1DEXT"); - glad_glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)load("glMultiTexSubImage2DEXT"); - glad_glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)load("glCopyMultiTexImage1DEXT"); - glad_glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)load("glCopyMultiTexImage2DEXT"); - glad_glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)load("glCopyMultiTexSubImage1DEXT"); - glad_glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)load("glCopyMultiTexSubImage2DEXT"); - glad_glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)load("glGetMultiTexImageEXT"); - glad_glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)load("glGetMultiTexParameterfvEXT"); - glad_glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)load("glGetMultiTexParameterivEXT"); - glad_glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)load("glGetMultiTexLevelParameterfvEXT"); - glad_glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)load("glGetMultiTexLevelParameterivEXT"); - glad_glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)load("glMultiTexImage3DEXT"); - glad_glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)load("glMultiTexSubImage3DEXT"); - glad_glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)load("glCopyMultiTexSubImage3DEXT"); - glad_glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)load("glEnableClientStateIndexedEXT"); - glad_glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)load("glDisableClientStateIndexedEXT"); - glad_glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)load("glGetFloatIndexedvEXT"); - glad_glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)load("glGetDoubleIndexedvEXT"); - glad_glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)load("glGetPointerIndexedvEXT"); - glad_glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)load("glEnableIndexedEXT"); - glad_glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)load("glDisableIndexedEXT"); - glad_glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)load("glIsEnabledIndexedEXT"); - glad_glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)load("glGetIntegerIndexedvEXT"); - glad_glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)load("glGetBooleanIndexedvEXT"); - glad_glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)load("glCompressedTextureImage3DEXT"); - glad_glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)load("glCompressedTextureImage2DEXT"); - glad_glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)load("glCompressedTextureImage1DEXT"); - glad_glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)load("glCompressedTextureSubImage3DEXT"); - glad_glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)load("glCompressedTextureSubImage2DEXT"); - glad_glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)load("glCompressedTextureSubImage1DEXT"); - glad_glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)load("glGetCompressedTextureImageEXT"); - glad_glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)load("glCompressedMultiTexImage3DEXT"); - glad_glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)load("glCompressedMultiTexImage2DEXT"); - glad_glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)load("glCompressedMultiTexImage1DEXT"); - glad_glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)load("glCompressedMultiTexSubImage3DEXT"); - glad_glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)load("glCompressedMultiTexSubImage2DEXT"); - glad_glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)load("glCompressedMultiTexSubImage1DEXT"); - glad_glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)load("glGetCompressedMultiTexImageEXT"); - glad_glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)load("glMatrixLoadTransposefEXT"); - glad_glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)load("glMatrixLoadTransposedEXT"); - glad_glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)load("glMatrixMultTransposefEXT"); - glad_glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)load("glMatrixMultTransposedEXT"); - glad_glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)load("glNamedBufferDataEXT"); - glad_glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)load("glNamedBufferSubDataEXT"); - glad_glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)load("glMapNamedBufferEXT"); - glad_glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)load("glUnmapNamedBufferEXT"); - glad_glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)load("glGetNamedBufferParameterivEXT"); - glad_glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)load("glGetNamedBufferPointervEXT"); - glad_glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)load("glGetNamedBufferSubDataEXT"); - glad_glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)load("glProgramUniform1fEXT"); - glad_glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)load("glProgramUniform2fEXT"); - glad_glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)load("glProgramUniform3fEXT"); - glad_glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)load("glProgramUniform4fEXT"); - glad_glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)load("glProgramUniform1iEXT"); - glad_glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)load("glProgramUniform2iEXT"); - glad_glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)load("glProgramUniform3iEXT"); - glad_glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)load("glProgramUniform4iEXT"); - glad_glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)load("glProgramUniform1fvEXT"); - glad_glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)load("glProgramUniform2fvEXT"); - glad_glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)load("glProgramUniform3fvEXT"); - glad_glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)load("glProgramUniform4fvEXT"); - glad_glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)load("glProgramUniform1ivEXT"); - glad_glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)load("glProgramUniform2ivEXT"); - glad_glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)load("glProgramUniform3ivEXT"); - glad_glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)load("glProgramUniform4ivEXT"); - glad_glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)load("glProgramUniformMatrix2fvEXT"); - glad_glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)load("glProgramUniformMatrix3fvEXT"); - glad_glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)load("glProgramUniformMatrix4fvEXT"); - glad_glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)load("glProgramUniformMatrix2x3fvEXT"); - glad_glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)load("glProgramUniformMatrix3x2fvEXT"); - glad_glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)load("glProgramUniformMatrix2x4fvEXT"); - glad_glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)load("glProgramUniformMatrix4x2fvEXT"); - glad_glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)load("glProgramUniformMatrix3x4fvEXT"); - glad_glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)load("glProgramUniformMatrix4x3fvEXT"); - glad_glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)load("glTextureBufferEXT"); - glad_glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)load("glMultiTexBufferEXT"); - glad_glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)load("glTextureParameterIivEXT"); - glad_glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)load("glTextureParameterIuivEXT"); - glad_glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)load("glGetTextureParameterIivEXT"); - glad_glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)load("glGetTextureParameterIuivEXT"); - glad_glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)load("glMultiTexParameterIivEXT"); - glad_glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)load("glMultiTexParameterIuivEXT"); - glad_glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)load("glGetMultiTexParameterIivEXT"); - glad_glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)load("glGetMultiTexParameterIuivEXT"); - glad_glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)load("glProgramUniform1uiEXT"); - glad_glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)load("glProgramUniform2uiEXT"); - glad_glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)load("glProgramUniform3uiEXT"); - glad_glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)load("glProgramUniform4uiEXT"); - glad_glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)load("glProgramUniform1uivEXT"); - glad_glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)load("glProgramUniform2uivEXT"); - glad_glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)load("glProgramUniform3uivEXT"); - glad_glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)load("glProgramUniform4uivEXT"); - glad_glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)load("glNamedProgramLocalParameters4fvEXT"); - glad_glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)load("glNamedProgramLocalParameterI4iEXT"); - glad_glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)load("glNamedProgramLocalParameterI4ivEXT"); - glad_glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)load("glNamedProgramLocalParametersI4ivEXT"); - glad_glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)load("glNamedProgramLocalParameterI4uiEXT"); - glad_glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)load("glNamedProgramLocalParameterI4uivEXT"); - glad_glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)load("glNamedProgramLocalParametersI4uivEXT"); - glad_glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)load("glGetNamedProgramLocalParameterIivEXT"); - glad_glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)load("glGetNamedProgramLocalParameterIuivEXT"); - glad_glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)load("glEnableClientStateiEXT"); - glad_glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)load("glDisableClientStateiEXT"); - glad_glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)load("glGetFloati_vEXT"); - glad_glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)load("glGetDoublei_vEXT"); - glad_glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)load("glGetPointeri_vEXT"); - glad_glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)load("glNamedProgramStringEXT"); - glad_glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)load("glNamedProgramLocalParameter4dEXT"); - glad_glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)load("glNamedProgramLocalParameter4dvEXT"); - glad_glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)load("glNamedProgramLocalParameter4fEXT"); - glad_glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)load("glNamedProgramLocalParameter4fvEXT"); - glad_glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)load("glGetNamedProgramLocalParameterdvEXT"); - glad_glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)load("glGetNamedProgramLocalParameterfvEXT"); - glad_glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)load("glGetNamedProgramivEXT"); - glad_glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)load("glGetNamedProgramStringEXT"); - glad_glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)load("glNamedRenderbufferStorageEXT"); - glad_glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)load("glGetNamedRenderbufferParameterivEXT"); - glad_glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glNamedRenderbufferStorageMultisampleEXT"); - glad_glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)load("glNamedRenderbufferStorageMultisampleCoverageEXT"); - glad_glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)load("glCheckNamedFramebufferStatusEXT"); - glad_glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)load("glNamedFramebufferTexture1DEXT"); - glad_glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)load("glNamedFramebufferTexture2DEXT"); - glad_glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)load("glNamedFramebufferTexture3DEXT"); - glad_glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)load("glNamedFramebufferRenderbufferEXT"); - glad_glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetNamedFramebufferAttachmentParameterivEXT"); - glad_glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)load("glGenerateTextureMipmapEXT"); - glad_glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)load("glGenerateMultiTexMipmapEXT"); - glad_glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)load("glFramebufferDrawBufferEXT"); - glad_glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)load("glFramebufferDrawBuffersEXT"); - glad_glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)load("glFramebufferReadBufferEXT"); - glad_glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetFramebufferParameterivEXT"); - glad_glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)load("glNamedCopyBufferSubDataEXT"); - glad_glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)load("glNamedFramebufferTextureEXT"); - glad_glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)load("glNamedFramebufferTextureLayerEXT"); - glad_glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)load("glNamedFramebufferTextureFaceEXT"); - glad_glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)load("glTextureRenderbufferEXT"); - glad_glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)load("glMultiTexRenderbufferEXT"); - glad_glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)load("glVertexArrayVertexOffsetEXT"); - glad_glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)load("glVertexArrayColorOffsetEXT"); - glad_glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)load("glVertexArrayEdgeFlagOffsetEXT"); - glad_glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)load("glVertexArrayIndexOffsetEXT"); - glad_glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)load("glVertexArrayNormalOffsetEXT"); - glad_glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)load("glVertexArrayTexCoordOffsetEXT"); - glad_glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)load("glVertexArrayMultiTexCoordOffsetEXT"); - glad_glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)load("glVertexArrayFogCoordOffsetEXT"); - glad_glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)load("glVertexArraySecondaryColorOffsetEXT"); - glad_glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)load("glVertexArrayVertexAttribOffsetEXT"); - glad_glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)load("glVertexArrayVertexAttribIOffsetEXT"); - glad_glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)load("glEnableVertexArrayEXT"); - glad_glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)load("glDisableVertexArrayEXT"); - glad_glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)load("glEnableVertexArrayAttribEXT"); - glad_glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)load("glDisableVertexArrayAttribEXT"); - glad_glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)load("glGetVertexArrayIntegervEXT"); - glad_glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)load("glGetVertexArrayPointervEXT"); - glad_glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)load("glGetVertexArrayIntegeri_vEXT"); - glad_glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)load("glGetVertexArrayPointeri_vEXT"); - glad_glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)load("glMapNamedBufferRangeEXT"); - glad_glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)load("glFlushMappedNamedBufferRangeEXT"); - glad_glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)load("glNamedBufferStorageEXT"); - glad_glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)load("glClearNamedBufferDataEXT"); - glad_glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)load("glClearNamedBufferSubDataEXT"); - glad_glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)load("glNamedFramebufferParameteriEXT"); - glad_glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)load("glGetNamedFramebufferParameterivEXT"); - glad_glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)load("glProgramUniform1dEXT"); - glad_glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)load("glProgramUniform2dEXT"); - glad_glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)load("glProgramUniform3dEXT"); - glad_glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)load("glProgramUniform4dEXT"); - glad_glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)load("glProgramUniform1dvEXT"); - glad_glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)load("glProgramUniform2dvEXT"); - glad_glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)load("glProgramUniform3dvEXT"); - glad_glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)load("glProgramUniform4dvEXT"); - glad_glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)load("glProgramUniformMatrix2dvEXT"); - glad_glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)load("glProgramUniformMatrix3dvEXT"); - glad_glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)load("glProgramUniformMatrix4dvEXT"); - glad_glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)load("glProgramUniformMatrix2x3dvEXT"); - glad_glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)load("glProgramUniformMatrix2x4dvEXT"); - glad_glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)load("glProgramUniformMatrix3x2dvEXT"); - glad_glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)load("glProgramUniformMatrix3x4dvEXT"); - glad_glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)load("glProgramUniformMatrix4x2dvEXT"); - glad_glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)load("glProgramUniformMatrix4x3dvEXT"); - glad_glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)load("glTextureBufferRangeEXT"); - glad_glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)load("glTextureStorage1DEXT"); - glad_glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)load("glTextureStorage2DEXT"); - glad_glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)load("glTextureStorage3DEXT"); - glad_glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)load("glTextureStorage2DMultisampleEXT"); - glad_glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)load("glTextureStorage3DMultisampleEXT"); - glad_glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)load("glVertexArrayBindVertexBufferEXT"); - glad_glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)load("glVertexArrayVertexAttribFormatEXT"); - glad_glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)load("glVertexArrayVertexAttribIFormatEXT"); - glad_glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)load("glVertexArrayVertexAttribLFormatEXT"); - glad_glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)load("glVertexArrayVertexAttribBindingEXT"); - glad_glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)load("glVertexArrayVertexBindingDivisorEXT"); - glad_glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)load("glVertexArrayVertexAttribLOffsetEXT"); - glad_glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)load("glTexturePageCommitmentEXT"); - glad_glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)load("glVertexArrayVertexAttribDivisorEXT"); -} -static void load_GL_AMD_sample_positions(GLADloadproc load) { - if(!GLAD_GL_AMD_sample_positions) return; - glad_glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)load("glSetMultisamplefvAMD"); -} -static void load_GL_NV_vertex_program(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program) return; - glad_glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)load("glAreProgramsResidentNV"); - glad_glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)load("glBindProgramNV"); - glad_glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)load("glDeleteProgramsNV"); - glad_glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)load("glExecuteProgramNV"); - glad_glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)load("glGenProgramsNV"); - glad_glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)load("glGetProgramParameterdvNV"); - glad_glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)load("glGetProgramParameterfvNV"); - glad_glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)load("glGetProgramivNV"); - glad_glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)load("glGetProgramStringNV"); - glad_glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)load("glGetTrackMatrixivNV"); - glad_glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)load("glGetVertexAttribdvNV"); - glad_glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)load("glGetVertexAttribfvNV"); - glad_glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)load("glGetVertexAttribivNV"); - glad_glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)load("glGetVertexAttribPointervNV"); - glad_glIsProgramNV = (PFNGLISPROGRAMNVPROC)load("glIsProgramNV"); - glad_glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)load("glLoadProgramNV"); - glad_glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)load("glProgramParameter4dNV"); - glad_glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)load("glProgramParameter4dvNV"); - glad_glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)load("glProgramParameter4fNV"); - glad_glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)load("glProgramParameter4fvNV"); - glad_glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)load("glProgramParameters4dvNV"); - glad_glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)load("glProgramParameters4fvNV"); - glad_glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)load("glRequestResidentProgramsNV"); - glad_glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)load("glTrackMatrixNV"); - glad_glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)load("glVertexAttribPointerNV"); - glad_glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)load("glVertexAttrib1dNV"); - glad_glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)load("glVertexAttrib1dvNV"); - glad_glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)load("glVertexAttrib1fNV"); - glad_glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)load("glVertexAttrib1fvNV"); - glad_glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)load("glVertexAttrib1sNV"); - glad_glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)load("glVertexAttrib1svNV"); - glad_glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)load("glVertexAttrib2dNV"); - glad_glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)load("glVertexAttrib2dvNV"); - glad_glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)load("glVertexAttrib2fNV"); - glad_glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)load("glVertexAttrib2fvNV"); - glad_glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)load("glVertexAttrib2sNV"); - glad_glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)load("glVertexAttrib2svNV"); - glad_glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)load("glVertexAttrib3dNV"); - glad_glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)load("glVertexAttrib3dvNV"); - glad_glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)load("glVertexAttrib3fNV"); - glad_glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)load("glVertexAttrib3fvNV"); - glad_glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)load("glVertexAttrib3sNV"); - glad_glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)load("glVertexAttrib3svNV"); - glad_glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)load("glVertexAttrib4dNV"); - glad_glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)load("glVertexAttrib4dvNV"); - glad_glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)load("glVertexAttrib4fNV"); - glad_glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)load("glVertexAttrib4fvNV"); - glad_glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)load("glVertexAttrib4sNV"); - glad_glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)load("glVertexAttrib4svNV"); - glad_glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)load("glVertexAttrib4ubNV"); - glad_glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)load("glVertexAttrib4ubvNV"); - glad_glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)load("glVertexAttribs1dvNV"); - glad_glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)load("glVertexAttribs1fvNV"); - glad_glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)load("glVertexAttribs1svNV"); - glad_glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)load("glVertexAttribs2dvNV"); - glad_glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)load("glVertexAttribs2fvNV"); - glad_glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)load("glVertexAttribs2svNV"); - glad_glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)load("glVertexAttribs3dvNV"); - glad_glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)load("glVertexAttribs3fvNV"); - glad_glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)load("glVertexAttribs3svNV"); - glad_glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)load("glVertexAttribs4dvNV"); - glad_glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)load("glVertexAttribs4fvNV"); - glad_glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)load("glVertexAttribs4svNV"); - glad_glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)load("glVertexAttribs4ubvNV"); -} -static void load_GL_EXT_vertex_shader(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_shader) return; - glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); - glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); - glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); - glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); - glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); - glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); - glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); - glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); - glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); - glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); - glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); - glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); - glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); - glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); - glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); - glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); - glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); - glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); - glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); - glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); - glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); - glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); - glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); - glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); - glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); - glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); - glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); - glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); - glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); - glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); - glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); - glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); - glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); - glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); - glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); - glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); - glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); - glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); - glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); - glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); - glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); - glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); -} -static void load_GL_EXT_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_func_separate) return; - glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); -} -static void load_GL_APPLE_fence(GLADloadproc load) { - if(!GLAD_GL_APPLE_fence) return; - glad_glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)load("glGenFencesAPPLE"); - glad_glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)load("glDeleteFencesAPPLE"); - glad_glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)load("glSetFenceAPPLE"); - glad_glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)load("glIsFenceAPPLE"); - glad_glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)load("glTestFenceAPPLE"); - glad_glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)load("glFinishFenceAPPLE"); - glad_glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)load("glTestObjectAPPLE"); - glad_glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)load("glFinishObjectAPPLE"); -} -static void load_GL_OES_byte_coordinates(GLADloadproc load) { - if(!GLAD_GL_OES_byte_coordinates) return; - glad_glMultiTexCoord1bOES = (PFNGLMULTITEXCOORD1BOESPROC)load("glMultiTexCoord1bOES"); - glad_glMultiTexCoord1bvOES = (PFNGLMULTITEXCOORD1BVOESPROC)load("glMultiTexCoord1bvOES"); - glad_glMultiTexCoord2bOES = (PFNGLMULTITEXCOORD2BOESPROC)load("glMultiTexCoord2bOES"); - glad_glMultiTexCoord2bvOES = (PFNGLMULTITEXCOORD2BVOESPROC)load("glMultiTexCoord2bvOES"); - glad_glMultiTexCoord3bOES = (PFNGLMULTITEXCOORD3BOESPROC)load("glMultiTexCoord3bOES"); - glad_glMultiTexCoord3bvOES = (PFNGLMULTITEXCOORD3BVOESPROC)load("glMultiTexCoord3bvOES"); - glad_glMultiTexCoord4bOES = (PFNGLMULTITEXCOORD4BOESPROC)load("glMultiTexCoord4bOES"); - glad_glMultiTexCoord4bvOES = (PFNGLMULTITEXCOORD4BVOESPROC)load("glMultiTexCoord4bvOES"); - glad_glTexCoord1bOES = (PFNGLTEXCOORD1BOESPROC)load("glTexCoord1bOES"); - glad_glTexCoord1bvOES = (PFNGLTEXCOORD1BVOESPROC)load("glTexCoord1bvOES"); - glad_glTexCoord2bOES = (PFNGLTEXCOORD2BOESPROC)load("glTexCoord2bOES"); - glad_glTexCoord2bvOES = (PFNGLTEXCOORD2BVOESPROC)load("glTexCoord2bvOES"); - glad_glTexCoord3bOES = (PFNGLTEXCOORD3BOESPROC)load("glTexCoord3bOES"); - glad_glTexCoord3bvOES = (PFNGLTEXCOORD3BVOESPROC)load("glTexCoord3bvOES"); - glad_glTexCoord4bOES = (PFNGLTEXCOORD4BOESPROC)load("glTexCoord4bOES"); - glad_glTexCoord4bvOES = (PFNGLTEXCOORD4BVOESPROC)load("glTexCoord4bvOES"); - glad_glVertex2bOES = (PFNGLVERTEX2BOESPROC)load("glVertex2bOES"); - glad_glVertex2bvOES = (PFNGLVERTEX2BVOESPROC)load("glVertex2bvOES"); - glad_glVertex3bOES = (PFNGLVERTEX3BOESPROC)load("glVertex3bOES"); - glad_glVertex3bvOES = (PFNGLVERTEX3BVOESPROC)load("glVertex3bvOES"); - glad_glVertex4bOES = (PFNGLVERTEX4BOESPROC)load("glVertex4bOES"); - glad_glVertex4bvOES = (PFNGLVERTEX4BVOESPROC)load("glVertex4bvOES"); -} -static void load_GL_ARB_transpose_matrix(GLADloadproc load) { - if(!GLAD_GL_ARB_transpose_matrix) return; - glad_glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)load("glLoadTransposeMatrixfARB"); - glad_glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)load("glLoadTransposeMatrixdARB"); - glad_glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)load("glMultTransposeMatrixfARB"); - glad_glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)load("glMultTransposeMatrixdARB"); -} -static void load_GL_ARB_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_ARB_provoking_vertex) return; - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); -} -static void load_GL_EXT_fog_coord(GLADloadproc load) { - if(!GLAD_GL_EXT_fog_coord) return; - glad_glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)load("glFogCoordfEXT"); - glad_glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)load("glFogCoordfvEXT"); - glad_glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)load("glFogCoorddEXT"); - glad_glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)load("glFogCoorddvEXT"); - glad_glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)load("glFogCoordPointerEXT"); -} -static void load_GL_EXT_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_array) return; - glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); - glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); - glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); - glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); - glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); - glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); - glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); - glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); - glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); -} -static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { - if(!GLAD_GL_EXT_blend_equation_separate) return; - glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +GLAPI int GLAD_GL_AMD_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC)(GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; +#define glDebugMessageEnableAMD glad_glDebugMessageEnableAMD +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC)(GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; +#define glDebugMessageInsertAMD glad_glDebugMessageInsertAMD +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC)(GLDEBUGPROCAMD callback, void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; +#define glDebugMessageCallbackAMD glad_glDebugMessageCallbackAMD +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC)(GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); +GLAPI PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; +#define glGetDebugMessageLogAMD glad_glGetDebugMessageLogAMD +#endif +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +GLAPI int GLAD_GL_AMD_query_buffer_object; +#endif +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +GLAPI int GLAD_GL_ARB_ES2_compatibility; +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC)(); +GLAPI PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +#define glReleaseShaderCompiler glad_glReleaseShaderCompiler +typedef void (APIENTRYP PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); +GLAPI PFNGLSHADERBINARYPROC glad_glShaderBinary; +#define glShaderBinary glad_glShaderBinary +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +GLAPI PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); +GLAPI PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +#define glDepthRangef glad_glDepthRangef +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC)(GLfloat d); +GLAPI PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +#define glClearDepthf glad_glClearDepthf +#endif +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +GLAPI int GLAD_GL_ARB_ES3_compatibility; +#endif +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +GLAPI int GLAD_GL_ARB_buffer_storage; +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags); +GLAPI PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +#define glBufferStorage glad_glBufferStorage +#endif +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +GLAPI int GLAD_GL_ARB_compatibility; +#endif +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +GLAPI int GLAD_GL_ARB_compressed_texture_pixel_storage; +#endif +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +GLAPI int GLAD_GL_ARB_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +#define glDebugMessageControlARB glad_glDebugMessageControlARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +#define glDebugMessageInsertARB glad_glDebugMessageInsertARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void* userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB +#endif +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +GLAPI int GLAD_GL_ARB_depth_buffer_float; +#endif +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +GLAPI int GLAD_GL_ARB_depth_clamp; +#endif +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +GLAPI int GLAD_GL_ARB_depth_texture; +#endif +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +GLAPI int GLAD_GL_ARB_draw_buffers; +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC)(GLsizei n, const GLenum* bufs); +GLAPI PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; +#define glDrawBuffersARB glad_glDrawBuffersARB +#endif +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +GLAPI int GLAD_GL_ARB_draw_buffers_blend; +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC)(GLuint buf, GLenum mode); +GLAPI PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; +#define glBlendEquationiARB glad_glBlendEquationiARB +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC)(GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; +#define glBlendEquationSeparateiARB glad_glBlendEquationSeparateiARB +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC)(GLuint buf, GLenum src, GLenum dst); +GLAPI PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; +#define glBlendFunciARB glad_glBlendFunciARB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC)(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; +#define glBlendFuncSeparateiARB glad_glBlendFuncSeparateiARB +#endif +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +GLAPI int GLAD_GL_ARB_explicit_attrib_location; +#endif +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +GLAPI int GLAD_GL_ARB_explicit_uniform_location; +#endif +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +GLAPI int GLAD_GL_ARB_fragment_program; +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); +GLAPI PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; +#define glProgramStringARB glad_glProgramStringARB +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); +GLAPI PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; +#define glBindProgramARB glad_glBindProgramARB +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); +GLAPI PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; +#define glDeleteProgramsARB glad_glDeleteProgramsARB +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); +GLAPI PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; +#define glGenProgramsARB glad_glGenProgramsARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; +#define glProgramEnvParameter4dARB glad_glProgramEnvParameter4dARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); +GLAPI PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; +#define glProgramEnvParameter4dvARB glad_glProgramEnvParameter4dvARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; +#define glProgramEnvParameter4fARB glad_glProgramEnvParameter4fARB +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); +GLAPI PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; +#define glProgramEnvParameter4fvARB glad_glProgramEnvParameter4fvARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; +#define glProgramLocalParameter4dARB glad_glProgramLocalParameter4dARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); +GLAPI PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; +#define glProgramLocalParameter4dvARB glad_glProgramLocalParameter4dvARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; +#define glProgramLocalParameter4fARB glad_glProgramLocalParameter4fARB +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); +GLAPI PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; +#define glProgramLocalParameter4fvARB glad_glProgramLocalParameter4fvARB +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; +#define glGetProgramEnvParameterdvARB glad_glGetProgramEnvParameterdvARB +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); +GLAPI PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; +#define glGetProgramEnvParameterfvARB glad_glGetProgramEnvParameterfvARB +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; +#define glGetProgramLocalParameterdvARB glad_glGetProgramLocalParameterdvARB +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); +GLAPI PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; +#define glGetProgramLocalParameterfvARB glad_glGetProgramLocalParameterfvARB +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; +#define glGetProgramivARB glad_glGetProgramivARB +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); +GLAPI PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; +#define glGetProgramStringARB glad_glGetProgramStringARB +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC)(GLuint program); +GLAPI PFNGLISPROGRAMARBPROC glad_glIsProgramARB; +#define glIsProgramARB glad_glIsProgramARB +#endif +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +GLAPI int GLAD_GL_ARB_fragment_shader; +#endif +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +GLAPI int GLAD_GL_ARB_framebuffer_object; +#endif +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +GLAPI int GLAD_GL_ARB_framebuffer_sRGB; +#endif +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +GLAPI int GLAD_GL_ARB_multisample; +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; +#define glSampleCoverageARB glad_glSampleCoverageARB +#endif +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 +GLAPI int GLAD_GL_ARB_sample_locations; +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLenum target, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; +#define glFramebufferSampleLocationsfvARB glad_glFramebufferSampleLocationsfvARB +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); +GLAPI PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; +#define glNamedFramebufferSampleLocationsfvARB glad_glNamedFramebufferSampleLocationsfvARB +typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC)(); +GLAPI PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; +#define glEvaluateDepthValuesARB glad_glEvaluateDepthValuesARB +#endif +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +GLAPI int GLAD_GL_ARB_texture_compression; +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; +#define glCompressedTexImage3DARB glad_glCompressedTexImage3DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; +#define glCompressedTexImage2DARB glad_glCompressedTexImage2DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; +#define glCompressedTexImage1DARB glad_glCompressedTexImage1DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; +#define glCompressedTexSubImage3DARB glad_glCompressedTexSubImage3DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; +#define glCompressedTexSubImage2DARB glad_glCompressedTexSubImage2DARB +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; +#define glCompressedTexSubImage1DARB glad_glCompressedTexSubImage1DARB +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; +#define glGetCompressedTexImageARB glad_glGetCompressedTexImageARB +#endif +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +GLAPI int GLAD_GL_ARB_texture_float; +#endif +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +GLAPI int GLAD_GL_ARB_texture_multisample; +#endif +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +GLAPI int GLAD_GL_ARB_texture_non_power_of_two; +#endif +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +GLAPI int GLAD_GL_ARB_texture_rg; +#endif +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +GLAPI int GLAD_GL_ARB_texture_swizzle; +#endif +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +GLAPI int GLAD_GL_ARB_uniform_buffer_object; +#endif +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +GLAPI int GLAD_GL_ARB_vertex_array_object; +#endif +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +GLAPI int GLAD_GL_ARB_vertex_attrib_binding; +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC)(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; +#define glBindVertexBuffer glad_glBindVertexBuffer +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; +#define glVertexAttribFormat glad_glVertexAttribFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; +#define glVertexAttribIFormat glad_glVertexAttribIFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC)(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; +#define glVertexAttribLFormat glad_glVertexAttribLFormat +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC)(GLuint attribindex, GLuint bindingindex); +GLAPI PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; +#define glVertexAttribBinding glad_glVertexAttribBinding +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC)(GLuint bindingindex, GLuint divisor); +GLAPI PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; +#define glVertexBindingDivisor glad_glVertexBindingDivisor +#endif +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +GLAPI int GLAD_GL_ARB_vertex_buffer_object; +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; +#define glBindBufferARB glad_glBindBufferARB +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); +GLAPI PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; +#define glDeleteBuffersARB glad_glDeleteBuffersARB +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); +GLAPI PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; +#define glGenBuffersARB glad_glGenBuffersARB +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERARBPROC glad_glIsBufferARB; +#define glIsBufferARB glad_glIsBufferARB +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const void* data, GLenum usage); +GLAPI PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; +#define glBufferDataARB glad_glBufferDataARB +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void* data); +GLAPI PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; +#define glBufferSubDataARB glad_glBufferSubDataARB +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void* data); +GLAPI PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; +#define glGetBufferSubDataARB glad_glGetBufferSubDataARB +typedef void* (APIENTRYP PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; +#define glMapBufferARB glad_glMapBufferARB +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; +#define glUnmapBufferARB glad_glUnmapBufferARB +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; +#define glGetBufferParameterivARB glad_glGetBufferParameterivARB +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, void** params); +GLAPI PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; +#define glGetBufferPointervARB glad_glGetBufferPointervARB +#endif +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +GLAPI int GLAD_GL_ARB_vertex_program; +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; +#define glVertexAttrib1dARB glad_glVertexAttrib1dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; +#define glVertexAttrib1dvARB glad_glVertexAttrib1dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; +#define glVertexAttrib1fARB glad_glVertexAttrib1fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; +#define glVertexAttrib1fvARB glad_glVertexAttrib1fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; +#define glVertexAttrib1sARB glad_glVertexAttrib1sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; +#define glVertexAttrib1svARB glad_glVertexAttrib1svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; +#define glVertexAttrib2dARB glad_glVertexAttrib2dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; +#define glVertexAttrib2dvARB glad_glVertexAttrib2dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; +#define glVertexAttrib2fARB glad_glVertexAttrib2fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; +#define glVertexAttrib2fvARB glad_glVertexAttrib2fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; +#define glVertexAttrib2sARB glad_glVertexAttrib2sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; +#define glVertexAttrib2svARB glad_glVertexAttrib2svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; +#define glVertexAttrib3dARB glad_glVertexAttrib3dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; +#define glVertexAttrib3dvARB glad_glVertexAttrib3dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; +#define glVertexAttrib3fARB glad_glVertexAttrib3fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; +#define glVertexAttrib3fvARB glad_glVertexAttrib3fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; +#define glVertexAttrib3sARB glad_glVertexAttrib3sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; +#define glVertexAttrib3svARB glad_glVertexAttrib3svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; +#define glVertexAttrib4NbvARB glad_glVertexAttrib4NbvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; +#define glVertexAttrib4NivARB glad_glVertexAttrib4NivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; +#define glVertexAttrib4NsvARB glad_glVertexAttrib4NsvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; +#define glVertexAttrib4NubARB glad_glVertexAttrib4NubARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; +#define glVertexAttrib4NubvARB glad_glVertexAttrib4NubvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; +#define glVertexAttrib4NuivARB glad_glVertexAttrib4NuivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; +#define glVertexAttrib4NusvARB glad_glVertexAttrib4NusvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); +GLAPI PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; +#define glVertexAttrib4bvARB glad_glVertexAttrib4bvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; +#define glVertexAttrib4dARB glad_glVertexAttrib4dARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); +GLAPI PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; +#define glVertexAttrib4dvARB glad_glVertexAttrib4dvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; +#define glVertexAttrib4fARB glad_glVertexAttrib4fARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); +GLAPI PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; +#define glVertexAttrib4fvARB glad_glVertexAttrib4fvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); +GLAPI PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; +#define glVertexAttrib4ivARB glad_glVertexAttrib4ivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; +#define glVertexAttrib4sARB glad_glVertexAttrib4sARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); +GLAPI PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; +#define glVertexAttrib4svARB glad_glVertexAttrib4svARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); +GLAPI PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; +#define glVertexAttrib4ubvARB glad_glVertexAttrib4ubvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); +GLAPI PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; +#define glVertexAttrib4uivARB glad_glVertexAttrib4uivARB +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); +GLAPI PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; +#define glVertexAttrib4usvARB glad_glVertexAttrib4usvARB +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; +#define glVertexAttribPointerARB glad_glVertexAttribPointerARB +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; +#define glEnableVertexAttribArrayARB glad_glEnableVertexAttribArrayARB +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; +#define glDisableVertexAttribArrayARB glad_glDisableVertexAttribArrayARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); +GLAPI PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; +#define glGetVertexAttribdvARB glad_glGetVertexAttribdvARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; +#define glGetVertexAttribfvARB glad_glGetVertexAttribfvARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); +GLAPI PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; +#define glGetVertexAttribivARB glad_glGetVertexAttribivARB +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; +#define glGetVertexAttribPointervARB glad_glGetVertexAttribPointervARB +#endif +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +GLAPI int GLAD_GL_ARB_vertex_shader; +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC)(GLhandleARB programObj, GLuint index, const GLcharARB* name); +GLAPI PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; +#define glBindAttribLocationARB glad_glBindAttribLocationARB +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLcharARB* name); +GLAPI PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; +#define glGetActiveAttribARB glad_glGetActiveAttribARB +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC)(GLhandleARB programObj, const GLcharARB* name); +GLAPI PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; +#define glGetAttribLocationARB glad_glGetAttribLocationARB +#endif +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +GLAPI int GLAD_GL_ATI_element_array; +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC)(GLenum type, const void* pointer); +GLAPI PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; +#define glElementPointerATI glad_glElementPointerATI +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC)(GLenum mode, GLsizei count); +GLAPI PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; +#define glDrawElementArrayATI glad_glDrawElementArrayATI +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count); +GLAPI PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; +#define glDrawRangeElementArrayATI glad_glDrawRangeElementArrayATI +#endif +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +GLAPI int GLAD_GL_ATI_fragment_shader; +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC)(GLuint range); +GLAPI PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; +#define glGenFragmentShadersATI glad_glGenFragmentShadersATI +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC)(GLuint id); +GLAPI PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; +#define glBindFragmentShaderATI glad_glBindFragmentShaderATI +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC)(GLuint id); +GLAPI PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; +#define glDeleteFragmentShaderATI glad_glDeleteFragmentShaderATI +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC)(); +GLAPI PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; +#define glBeginFragmentShaderATI glad_glBeginFragmentShaderATI +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC)(); +GLAPI PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; +#define glEndFragmentShaderATI glad_glEndFragmentShaderATI +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC)(GLuint dst, GLuint coord, GLenum swizzle); +GLAPI PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; +#define glPassTexCoordATI glad_glPassTexCoordATI +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC)(GLuint dst, GLuint interp, GLenum swizzle); +GLAPI PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; +#define glSampleMapATI glad_glSampleMapATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; +#define glColorFragmentOp1ATI glad_glColorFragmentOp1ATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; +#define glColorFragmentOp2ATI glad_glColorFragmentOp2ATI +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; +#define glColorFragmentOp3ATI glad_glColorFragmentOp3ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; +#define glAlphaFragmentOp1ATI glad_glAlphaFragmentOp1ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; +#define glAlphaFragmentOp2ATI glad_glAlphaFragmentOp2ATI +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; +#define glAlphaFragmentOp3ATI glad_glAlphaFragmentOp3ATI +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)(GLuint dst, const GLfloat* value); +GLAPI PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; +#define glSetFragmentShaderConstantATI glad_glSetFragmentShaderConstantATI +#endif +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +GLAPI int GLAD_GL_ATI_vertex_array_object; +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC)(GLsizei size, const void* pointer, GLenum usage); +GLAPI PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; +#define glNewObjectBufferATI glad_glNewObjectBufferATI +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; +#define glIsObjectBufferATI glad_glIsObjectBufferATI +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC)(GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +GLAPI PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; +#define glUpdateObjectBufferATI glad_glUpdateObjectBufferATI +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC)(GLuint buffer, GLenum pname, GLfloat* params); +GLAPI PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; +#define glGetObjectBufferfvATI glad_glGetObjectBufferfvATI +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC)(GLuint buffer, GLenum pname, GLint* params); +GLAPI PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; +#define glGetObjectBufferivATI glad_glGetObjectBufferivATI +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC)(GLuint buffer); +GLAPI PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; +#define glFreeObjectBufferATI glad_glFreeObjectBufferATI +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC)(GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; +#define glArrayObjectATI glad_glArrayObjectATI +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC)(GLenum array, GLenum pname, GLfloat* params); +GLAPI PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; +#define glGetArrayObjectfvATI glad_glGetArrayObjectfvATI +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC)(GLenum array, GLenum pname, GLint* params); +GLAPI PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; +#define glGetArrayObjectivATI glad_glGetArrayObjectivATI +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC)(GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; +#define glVariantArrayObjectATI glad_glVariantArrayObjectATI +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC)(GLuint id, GLenum pname, GLfloat* params); +GLAPI PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; +#define glGetVariantArrayObjectfvATI glad_glGetVariantArrayObjectfvATI +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC)(GLuint id, GLenum pname, GLint* params); +GLAPI PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; +#define glGetVariantArrayObjectivATI glad_glGetVariantArrayObjectivATI +#endif +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +GLAPI int GLAD_GL_EXT_blend_color; +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; +#define glBlendColorEXT glad_glBlendColorEXT +#endif +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +GLAPI int GLAD_GL_EXT_blend_equation_separate; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; +#define glBlendEquationSeparateEXT glad_glBlendEquationSeparateEXT +#endif +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +GLAPI int GLAD_GL_EXT_blend_func_separate; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; +#define glBlendFuncSeparateEXT glad_glBlendFuncSeparateEXT +#endif +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +GLAPI int GLAD_GL_EXT_framebuffer_blit; +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; +#define glBlitFramebufferEXT glad_glBlitFramebufferEXT +#endif +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +GLAPI int GLAD_GL_EXT_framebuffer_multisample; +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; +#define glRenderbufferStorageMultisampleEXT glad_glRenderbufferStorageMultisampleEXT +#endif +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +GLAPI int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; +#endif +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +GLAPI int GLAD_GL_EXT_framebuffer_object; +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +#define glIsRenderbufferEXT glad_glIsRenderbufferEXT +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +#define glBindRenderbufferEXT glad_glBindRenderbufferEXT +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint* renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +#define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint* renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +#define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +#define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +#define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +#define glIsFramebufferEXT glad_glIsFramebufferEXT +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +#define glBindFramebufferEXT glad_glBindFramebufferEXT +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint* framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +#define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint* framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +#define glGenFramebuffersEXT glad_glGenFramebuffersEXT +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +#define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +#define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +#define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +#define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +#define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint* params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +#define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +#define glGenerateMipmapEXT glad_glGenerateMipmapEXT +#endif +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +GLAPI int GLAD_GL_EXT_framebuffer_sRGB; +#endif +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +GLAPI int GLAD_GL_EXT_index_array_formats; +#endif +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +GLAPI int GLAD_GL_EXT_texture; +#endif +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +GLAPI int GLAD_GL_EXT_texture_compression_s3tc; +#endif +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +GLAPI int GLAD_GL_EXT_texture_sRGB; +#endif +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +GLAPI int GLAD_GL_EXT_texture_swizzle; +#endif +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +GLAPI int GLAD_GL_EXT_vertex_array; +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC)(GLint i); +GLAPI PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; +#define glArrayElementEXT glad_glArrayElementEXT +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; +#define glColorPointerEXT glad_glColorPointerEXT +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; +#define glDrawArraysEXT glad_glDrawArraysEXT +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); +GLAPI PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; +#define glEdgeFlagPointerEXT glad_glEdgeFlagPointerEXT +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC)(GLenum pname, void** params); +GLAPI PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; +#define glGetPointervEXT glad_glGetPointervEXT +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; +#define glIndexPointerEXT glad_glIndexPointerEXT +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; +#define glNormalPointerEXT glad_glNormalPointerEXT +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; +#define glTexCoordPointerEXT glad_glTexCoordPointerEXT +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +GLAPI PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; +#define glVertexPointerEXT glad_glVertexPointerEXT +#endif +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +GLAPI int GLAD_GL_EXT_vertex_shader; +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC)(); +GLAPI PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; +#define glBeginVertexShaderEXT glad_glBeginVertexShaderEXT +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC)(); +GLAPI PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; +#define glEndVertexShaderEXT glad_glEndVertexShaderEXT +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC)(GLuint id); +GLAPI PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; +#define glBindVertexShaderEXT glad_glBindVertexShaderEXT +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC)(GLuint range); +GLAPI PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; +#define glGenVertexShadersEXT glad_glGenVertexShadersEXT +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC)(GLuint id); +GLAPI PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; +#define glDeleteVertexShaderEXT glad_glDeleteVertexShaderEXT +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC)(GLenum op, GLuint res, GLuint arg1); +GLAPI PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; +#define glShaderOp1EXT glad_glShaderOp1EXT +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; +#define glShaderOp2EXT glad_glShaderOp2EXT +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC)(GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; +#define glShaderOp3EXT glad_glShaderOp3EXT +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; +#define glSwizzleEXT glad_glSwizzleEXT +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC)(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; +#define glWriteMaskEXT glad_glWriteMaskEXT +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); +GLAPI PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; +#define glInsertComponentEXT glad_glInsertComponentEXT +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC)(GLuint res, GLuint src, GLuint num); +GLAPI PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; +#define glExtractComponentEXT glad_glExtractComponentEXT +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC)(GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; +#define glGenSymbolsEXT glad_glGenSymbolsEXT +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC)(GLuint id, GLenum type, const void* addr); +GLAPI PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; +#define glSetInvariantEXT glad_glSetInvariantEXT +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC)(GLuint id, GLenum type, const void* addr); +GLAPI PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; +#define glSetLocalConstantEXT glad_glSetLocalConstantEXT +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC)(GLuint id, const GLbyte* addr); +GLAPI PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; +#define glVariantbvEXT glad_glVariantbvEXT +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC)(GLuint id, const GLshort* addr); +GLAPI PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; +#define glVariantsvEXT glad_glVariantsvEXT +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC)(GLuint id, const GLint* addr); +GLAPI PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; +#define glVariantivEXT glad_glVariantivEXT +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC)(GLuint id, const GLfloat* addr); +GLAPI PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; +#define glVariantfvEXT glad_glVariantfvEXT +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC)(GLuint id, const GLdouble* addr); +GLAPI PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; +#define glVariantdvEXT glad_glVariantdvEXT +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC)(GLuint id, const GLubyte* addr); +GLAPI PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; +#define glVariantubvEXT glad_glVariantubvEXT +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC)(GLuint id, const GLushort* addr); +GLAPI PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; +#define glVariantusvEXT glad_glVariantusvEXT +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC)(GLuint id, const GLuint* addr); +GLAPI PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; +#define glVariantuivEXT glad_glVariantuivEXT +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC)(GLuint id, GLenum type, GLuint stride, const void* addr); +GLAPI PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; +#define glVariantPointerEXT glad_glVariantPointerEXT +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); +GLAPI PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; +#define glEnableVariantClientStateEXT glad_glEnableVariantClientStateEXT +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)(GLuint id); +GLAPI PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; +#define glDisableVariantClientStateEXT glad_glDisableVariantClientStateEXT +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC)(GLenum light, GLenum value); +GLAPI PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; +#define glBindLightParameterEXT glad_glBindLightParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC)(GLenum face, GLenum value); +GLAPI PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; +#define glBindMaterialParameterEXT glad_glBindMaterialParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC)(GLenum unit, GLenum coord, GLenum value); +GLAPI PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; +#define glBindTexGenParameterEXT glad_glBindTexGenParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)(GLenum unit, GLenum value); +GLAPI PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; +#define glBindTextureUnitParameterEXT glad_glBindTextureUnitParameterEXT +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC)(GLenum value); +GLAPI PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; +#define glBindParameterEXT glad_glBindParameterEXT +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC)(GLuint id, GLenum cap); +GLAPI PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; +#define glIsVariantEnabledEXT glad_glIsVariantEnabledEXT +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; +#define glGetVariantBooleanvEXT glad_glGetVariantBooleanvEXT +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; +#define glGetVariantIntegervEXT glad_glGetVariantIntegervEXT +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; +#define glGetVariantFloatvEXT glad_glGetVariantFloatvEXT +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC)(GLuint id, GLenum value, void** data); +GLAPI PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; +#define glGetVariantPointervEXT glad_glGetVariantPointervEXT +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; +#define glGetInvariantBooleanvEXT glad_glGetInvariantBooleanvEXT +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; +#define glGetInvariantIntegervEXT glad_glGetInvariantIntegervEXT +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; +#define glGetInvariantFloatvEXT glad_glGetInvariantFloatvEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)(GLuint id, GLenum value, GLboolean* data); +GLAPI PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; +#define glGetLocalConstantBooleanvEXT glad_glGetLocalConstantBooleanvEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)(GLuint id, GLenum value, GLint* data); +GLAPI PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; +#define glGetLocalConstantIntegervEXT glad_glGetLocalConstantIntegervEXT +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC)(GLuint id, GLenum value, GLfloat* data); +GLAPI PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; +#define glGetLocalConstantFloatvEXT glad_glGetLocalConstantFloatvEXT +#endif + +#ifdef __cplusplus } -static void load_GL_NV_framebuffer_mixed_samples(GLADloadproc load) { - if(!GLAD_GL_NV_framebuffer_mixed_samples) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); - glad_glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)load("glCoverageModulationTableNV"); - glad_glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)load("glGetCoverageModulationTableNV"); - glad_glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)load("glCoverageModulationNV"); +#endif + +#endif + +////////////////////////////////////////////////////////////////////////////// +// +// IMPLEMENTATION SECTION +// + +#ifdef GLAD_IMPLEMENTATION + +#include +#include +#include + +struct gladGLversionStruct GLVersion; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static const char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < num_exts_i; index++) { + exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); + } + } +#endif + return 1; } -static void load_GL_NVX_conditional_render(GLADloadproc load) { - if(!GLAD_GL_NVX_conditional_render) return; - glad_glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)load("glBeginConditionalRenderNVX"); - glad_glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)load("glEndConditionalRenderNVX"); + +static void free_exts(void) { + if (exts_i != NULL) { + free((char **)exts_i); + exts_i = NULL; + } } -static void load_GL_ARB_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)load("glMultiDrawArraysIndirect"); - glad_glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)load("glMultiDrawElementsIndirect"); + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; } -static void load_GL_EXT_raster_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_raster_multisample) return; - glad_glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)load("glRasterSamplesEXT"); +int GLAD_GL_VERSION_1_0; +int GLAD_GL_VERSION_1_1; +int GLAD_GL_VERSION_1_2; +int GLAD_GL_VERSION_1_3; +int GLAD_GL_VERSION_1_4; +int GLAD_GL_VERSION_1_5; +int GLAD_GL_VERSION_2_0; +int GLAD_GL_VERSION_2_1; +int GLAD_GL_VERSION_3_0; +int GLAD_GL_VERSION_3_1; +int GLAD_GL_VERSION_3_2; +int GLAD_GL_VERSION_3_3; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +PFNGLBINDSAMPLERPROC glad_glBindSampler; +PFNGLLINEWIDTHPROC glad_glLineWidth; +PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +PFNGLCOMPILESHADERPROC glad_glCompileShader; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +PFNGLENABLEIPROC glad_glEnablei; +PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +PFNGLCREATESHADERPROC glad_glCreateShader; +PFNGLISBUFFERPROC glad_glIsBuffer; +PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +PFNGLHINTPROC glad_glHint; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +PFNGLPOINTSIZEPROC glad_glPointSize; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +PFNGLWAITSYNCPROC glad_glWaitSync; +PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +PFNGLUNIFORM3IPROC glad_glUniform3i; +PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +PFNGLUNIFORM3FPROC glad_glUniform3f; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +PFNGLCOLORMASKIPROC glad_glColorMaski; +PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +PFNGLDRAWARRAYSPROC glad_glDrawArrays; +PFNGLUNIFORM1UIPROC glad_glUniform1ui; +PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +PFNGLCLEARPROC glad_glClear; +PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +PFNGLISENABLEDPROC glad_glIsEnabled; +PFNGLSTENCILOPPROC glad_glStencilOp; +PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +PFNGLGETQUERYIVPROC glad_glGetQueryiv; +PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +PFNGLISSHADERPROC glad_glIsShader; +PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +PFNGLENABLEPROC glad_glEnable; +PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +PFNGLFLUSHPROC glad_glFlush; +PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +PFNGLFENCESYNCPROC glad_glFenceSync; +PFNGLCOLORP3UIPROC glad_glColorP3ui; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +PFNGLGENSAMPLERSPROC glad_glGenSamplers; +PFNGLCLAMPCOLORPROC glad_glClampColor; +PFNGLUNIFORM4IVPROC glad_glUniform4iv; +PFNGLCLEARSTENCILPROC glad_glClearStencil; +PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +PFNGLGENTEXTURESPROC glad_glGenTextures; +PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +PFNGLISSYNCPROC glad_glIsSync; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +PFNGLUNIFORM2IPROC glad_glUniform2i; +PFNGLUNIFORM2FPROC glad_glUniform2f; +PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +PFNGLGENQUERIESPROC glad_glGenQueries; +PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +PFNGLISENABLEDIPROC glad_glIsEnabledi; +PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +PFNGLUNIFORM2IVPROC glad_glUniform2iv; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +PFNGLGETSHADERIVPROC glad_glGetShaderiv; +PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +PFNGLGETDOUBLEVPROC glad_glGetDoublev; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +PFNGLUNIFORM3FVPROC glad_glUniform3fv; +PFNGLDEPTHRANGEPROC glad_glDepthRange; +PFNGLMAPBUFFERPROC glad_glMapBuffer; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +PFNGLDELETESYNCPROC glad_glDeleteSync; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +PFNGLUNIFORM3IVPROC glad_glUniform3iv; +PFNGLPOLYGONMODEPROC glad_glPolygonMode; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +PFNGLUSEPROGRAMPROC glad_glUseProgram; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +PFNGLFINISHPROC glad_glFinish; +PFNGLDELETESHADERPROC glad_glDeleteShader; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +PFNGLVIEWPORTPROC glad_glViewport; +PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +PFNGLUNIFORM2UIPROC glad_glUniform2ui; +PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +PFNGLCLEARDEPTHPROC glad_glClearDepth; +PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +PFNGLTEXBUFFERPROC glad_glTexBuffer; +PFNGLPIXELSTOREIPROC glad_glPixelStorei; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +PFNGLPIXELSTOREFPROC glad_glPixelStoref; +PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +PFNGLLINKPROGRAMPROC glad_glLinkProgram; +PFNGLBINDTEXTUREPROC glad_glBindTexture; +PFNGLGETSTRINGPROC glad_glGetString; +PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +PFNGLDETACHSHADERPROC glad_glDetachShader; +PFNGLENDQUERYPROC glad_glEndQuery; +PFNGLNORMALP3UIPROC glad_glNormalP3ui; +PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +PFNGLUNIFORM1FPROC glad_glUniform1f; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +PFNGLUNIFORM1IPROC glad_glUniform1i; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +PFNGLDISABLEPROC glad_glDisable; +PFNGLLOGICOPPROC glad_glLogicOp; +PFNGLUNIFORM4UIPROC glad_glUniform4ui; +PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +PFNGLCULLFACEPROC glad_glCullFace; +PFNGLGETSTRINGIPROC glad_glGetStringi; +PFNGLATTACHSHADERPROC glad_glAttachShader; +PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +PFNGLDRAWELEMENTSPROC glad_glDrawElements; +PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +PFNGLUNIFORM1IVPROC glad_glUniform1iv; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +PFNGLREADBUFFERPROC glad_glReadBuffer; +PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +PFNGLBLENDCOLORPROC glad_glBlendColor; +PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +PFNGLISPROGRAMPROC glad_glIsProgram; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +PFNGLUNIFORM4IPROC glad_glUniform4i; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +PFNGLREADPIXELSPROC glad_glReadPixels; +PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +PFNGLUNIFORM4FPROC glad_glUniform4f; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +PFNGLSTENCILFUNCPROC glad_glStencilFunc; +PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +PFNGLCOLORP4UIPROC glad_glColorP4ui; +PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +PFNGLGENBUFFERSPROC glad_glGenBuffers; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +PFNGLBLENDFUNCPROC glad_glBlendFunc; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +PFNGLSCISSORPROC glad_glScissor; +PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +PFNGLCLEARCOLORPROC glad_glClearColor; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +PFNGLUNIFORM3UIPROC glad_glUniform3ui; +PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +PFNGLUNIFORM2FVPROC glad_glUniform2fv; +PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +PFNGLDEPTHFUNCPROC glad_glDepthFunc; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +PFNGLCOLORMASKPROC glad_glColorMask; +PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +PFNGLUNIFORM4FVPROC glad_glUniform4fv; +PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +PFNGLISSAMPLERPROC glad_glIsSampler; +PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +PFNGLDISABLEIPROC glad_glDisablei; +PFNGLSHADERSOURCEPROC glad_glShaderSource; +PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +PFNGLGETSYNCIVPROC glad_glGetSynciv; +PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +PFNGLBEGINQUERYPROC glad_glBeginQuery; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +PFNGLBINDBUFFERPROC glad_glBindBuffer; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +PFNGLBUFFERDATAPROC glad_glBufferData; +PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +PFNGLGETERRORPROC glad_glGetError; +PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +PFNGLGETFLOATVPROC glad_glGetFloatv; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +PFNGLGETINTEGERVPROC glad_glGetIntegerv; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +PFNGLISQUERYPROC glad_glIsQuery; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +PFNGLSTENCILMASKPROC glad_glStencilMask; +PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +PFNGLISTEXTUREPROC glad_glIsTexture; +PFNGLUNIFORM1FVPROC glad_glUniform1fv; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +PFNGLDEPTHMASKPROC glad_glDepthMask; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +PFNGLFRONTFACEPROC glad_glFrontFace; +int GLAD_GL_ARB_texture_compression; +int GLAD_GL_ARB_texture_swizzle; +int GLAD_GL_ATI_fragment_shader; +int GLAD_GL_EXT_texture_sRGB; +int GLAD_GL_ARB_explicit_attrib_location; +int GLAD_GL_ARB_ES3_compatibility; +int GLAD_GL_EXT_blend_color; +int GLAD_GL_EXT_framebuffer_sRGB; +int GLAD_GL_EXT_index_array_formats; +int GLAD_GL_ARB_vertex_shader; +int GLAD_GL_ARB_vertex_attrib_binding; +int GLAD_GL_ARB_vertex_program; +int GLAD_GL_EXT_texture_compression_s3tc; +int GLAD_GL_EXT_texture_swizzle; +int GLAD_GL_ARB_texture_multisample; +int GLAD_GL_ARB_texture_rg; +int GLAD_GL_ARB_texture_float; +int GLAD_GL_ARB_compressed_texture_pixel_storage; +int GLAD_GL_ARB_framebuffer_sRGB; +int GLAD_GL_ARB_vertex_array_object; +int GLAD_GL_ARB_depth_clamp; +int GLAD_GL_ARB_fragment_shader; +int GLAD_GL_ATI_vertex_array_object; +int GLAD_GL_ARB_vertex_buffer_object; +int GLAD_GL_ARB_fragment_program; +int GLAD_GL_EXT_framebuffer_multisample; +int GLAD_GL_ARB_framebuffer_object; +int GLAD_GL_ARB_draw_buffers_blend; +int GLAD_GL_EXT_vertex_shader; +int GLAD_GL_EXT_blend_func_separate; +int GLAD_GL_ARB_texture_non_power_of_two; +int GLAD_GL_EXT_texture; +int GLAD_GL_ARB_buffer_storage; +int GLAD_GL_ARB_explicit_uniform_location; +int GLAD_GL_EXT_framebuffer_object; +int GLAD_GL_EXT_framebuffer_multisample_blit_scaled; +int GLAD_GL_AMD_debug_output; +int GLAD_GL_ARB_depth_buffer_float; +int GLAD_GL_ARB_multisample; +int GLAD_GL_ARB_compatibility; +int GLAD_GL_ARB_depth_texture; +int GLAD_GL_ARB_sample_locations; +int GLAD_GL_ARB_ES2_compatibility; +int GLAD_GL_AMD_query_buffer_object; +int GLAD_GL_EXT_framebuffer_blit; +int GLAD_GL_EXT_vertex_array; +int GLAD_GL_ARB_draw_buffers; +int GLAD_GL_EXT_blend_equation_separate; +int GLAD_GL_ATI_element_array; +int GLAD_GL_ARB_debug_output; +int GLAD_GL_ARB_uniform_buffer_object; +PFNGLDEBUGMESSAGEENABLEAMDPROC glad_glDebugMessageEnableAMD; +PFNGLDEBUGMESSAGEINSERTAMDPROC glad_glDebugMessageInsertAMD; +PFNGLDEBUGMESSAGECALLBACKAMDPROC glad_glDebugMessageCallbackAMD; +PFNGLGETDEBUGMESSAGELOGAMDPROC glad_glGetDebugMessageLogAMD; +PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; +PFNGLSHADERBINARYPROC glad_glShaderBinary; +PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; +PFNGLDEPTHRANGEFPROC glad_glDepthRangef; +PFNGLCLEARDEPTHFPROC glad_glClearDepthf; +PFNGLBUFFERSTORAGEPROC glad_glBufferStorage; +PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +PFNGLDRAWBUFFERSARBPROC glad_glDrawBuffersARB; +PFNGLBLENDEQUATIONIARBPROC glad_glBlendEquationiARB; +PFNGLBLENDEQUATIONSEPARATEIARBPROC glad_glBlendEquationSeparateiARB; +PFNGLBLENDFUNCIARBPROC glad_glBlendFunciARB; +PFNGLBLENDFUNCSEPARATEIARBPROC glad_glBlendFuncSeparateiARB; +PFNGLPROGRAMSTRINGARBPROC glad_glProgramStringARB; +PFNGLBINDPROGRAMARBPROC glad_glBindProgramARB; +PFNGLDELETEPROGRAMSARBPROC glad_glDeleteProgramsARB; +PFNGLGENPROGRAMSARBPROC glad_glGenProgramsARB; +PFNGLPROGRAMENVPARAMETER4DARBPROC glad_glProgramEnvParameter4dARB; +PFNGLPROGRAMENVPARAMETER4DVARBPROC glad_glProgramEnvParameter4dvARB; +PFNGLPROGRAMENVPARAMETER4FARBPROC glad_glProgramEnvParameter4fARB; +PFNGLPROGRAMENVPARAMETER4FVARBPROC glad_glProgramEnvParameter4fvARB; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC glad_glProgramLocalParameter4dARB; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC glad_glProgramLocalParameter4dvARB; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC glad_glProgramLocalParameter4fARB; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glad_glProgramLocalParameter4fvARB; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC glad_glGetProgramEnvParameterdvARB; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC glad_glGetProgramEnvParameterfvARB; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glad_glGetProgramLocalParameterdvARB; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC glad_glGetProgramLocalParameterfvARB; +PFNGLGETPROGRAMIVARBPROC glad_glGetProgramivARB; +PFNGLGETPROGRAMSTRINGARBPROC glad_glGetProgramStringARB; +PFNGLISPROGRAMARBPROC glad_glIsProgramARB; +PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; +PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glFramebufferSampleLocationsfvARB; +PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC glad_glNamedFramebufferSampleLocationsfvARB; +PFNGLEVALUATEDEPTHVALUESARBPROC glad_glEvaluateDepthValuesARB; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC glad_glCompressedTexImage3DARB; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glad_glCompressedTexImage2DARB; +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC glad_glCompressedTexImage1DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC glad_glCompressedTexSubImage3DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glad_glCompressedTexSubImage2DARB; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC glad_glCompressedTexSubImage1DARB; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC glad_glGetCompressedTexImageARB; +PFNGLBINDVERTEXBUFFERPROC glad_glBindVertexBuffer; +PFNGLVERTEXATTRIBFORMATPROC glad_glVertexAttribFormat; +PFNGLVERTEXATTRIBIFORMATPROC glad_glVertexAttribIFormat; +PFNGLVERTEXATTRIBLFORMATPROC glad_glVertexAttribLFormat; +PFNGLVERTEXATTRIBBINDINGPROC glad_glVertexAttribBinding; +PFNGLVERTEXBINDINGDIVISORPROC glad_glVertexBindingDivisor; +PFNGLBINDBUFFERARBPROC glad_glBindBufferARB; +PFNGLDELETEBUFFERSARBPROC glad_glDeleteBuffersARB; +PFNGLGENBUFFERSARBPROC glad_glGenBuffersARB; +PFNGLISBUFFERARBPROC glad_glIsBufferARB; +PFNGLBUFFERDATAARBPROC glad_glBufferDataARB; +PFNGLBUFFERSUBDATAARBPROC glad_glBufferSubDataARB; +PFNGLGETBUFFERSUBDATAARBPROC glad_glGetBufferSubDataARB; +PFNGLMAPBUFFERARBPROC glad_glMapBufferARB; +PFNGLUNMAPBUFFERARBPROC glad_glUnmapBufferARB; +PFNGLGETBUFFERPARAMETERIVARBPROC glad_glGetBufferParameterivARB; +PFNGLGETBUFFERPOINTERVARBPROC glad_glGetBufferPointervARB; +PFNGLVERTEXATTRIB1DARBPROC glad_glVertexAttrib1dARB; +PFNGLVERTEXATTRIB1DVARBPROC glad_glVertexAttrib1dvARB; +PFNGLVERTEXATTRIB1FARBPROC glad_glVertexAttrib1fARB; +PFNGLVERTEXATTRIB1FVARBPROC glad_glVertexAttrib1fvARB; +PFNGLVERTEXATTRIB1SARBPROC glad_glVertexAttrib1sARB; +PFNGLVERTEXATTRIB1SVARBPROC glad_glVertexAttrib1svARB; +PFNGLVERTEXATTRIB2DARBPROC glad_glVertexAttrib2dARB; +PFNGLVERTEXATTRIB2DVARBPROC glad_glVertexAttrib2dvARB; +PFNGLVERTEXATTRIB2FARBPROC glad_glVertexAttrib2fARB; +PFNGLVERTEXATTRIB2FVARBPROC glad_glVertexAttrib2fvARB; +PFNGLVERTEXATTRIB2SARBPROC glad_glVertexAttrib2sARB; +PFNGLVERTEXATTRIB2SVARBPROC glad_glVertexAttrib2svARB; +PFNGLVERTEXATTRIB3DARBPROC glad_glVertexAttrib3dARB; +PFNGLVERTEXATTRIB3DVARBPROC glad_glVertexAttrib3dvARB; +PFNGLVERTEXATTRIB3FARBPROC glad_glVertexAttrib3fARB; +PFNGLVERTEXATTRIB3FVARBPROC glad_glVertexAttrib3fvARB; +PFNGLVERTEXATTRIB3SARBPROC glad_glVertexAttrib3sARB; +PFNGLVERTEXATTRIB3SVARBPROC glad_glVertexAttrib3svARB; +PFNGLVERTEXATTRIB4NBVARBPROC glad_glVertexAttrib4NbvARB; +PFNGLVERTEXATTRIB4NIVARBPROC glad_glVertexAttrib4NivARB; +PFNGLVERTEXATTRIB4NSVARBPROC glad_glVertexAttrib4NsvARB; +PFNGLVERTEXATTRIB4NUBARBPROC glad_glVertexAttrib4NubARB; +PFNGLVERTEXATTRIB4NUBVARBPROC glad_glVertexAttrib4NubvARB; +PFNGLVERTEXATTRIB4NUIVARBPROC glad_glVertexAttrib4NuivARB; +PFNGLVERTEXATTRIB4NUSVARBPROC glad_glVertexAttrib4NusvARB; +PFNGLVERTEXATTRIB4BVARBPROC glad_glVertexAttrib4bvARB; +PFNGLVERTEXATTRIB4DARBPROC glad_glVertexAttrib4dARB; +PFNGLVERTEXATTRIB4DVARBPROC glad_glVertexAttrib4dvARB; +PFNGLVERTEXATTRIB4FARBPROC glad_glVertexAttrib4fARB; +PFNGLVERTEXATTRIB4FVARBPROC glad_glVertexAttrib4fvARB; +PFNGLVERTEXATTRIB4IVARBPROC glad_glVertexAttrib4ivARB; +PFNGLVERTEXATTRIB4SARBPROC glad_glVertexAttrib4sARB; +PFNGLVERTEXATTRIB4SVARBPROC glad_glVertexAttrib4svARB; +PFNGLVERTEXATTRIB4UBVARBPROC glad_glVertexAttrib4ubvARB; +PFNGLVERTEXATTRIB4UIVARBPROC glad_glVertexAttrib4uivARB; +PFNGLVERTEXATTRIB4USVARBPROC glad_glVertexAttrib4usvARB; +PFNGLVERTEXATTRIBPOINTERARBPROC glad_glVertexAttribPointerARB; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC glad_glEnableVertexAttribArrayARB; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glad_glDisableVertexAttribArrayARB; +PFNGLGETVERTEXATTRIBDVARBPROC glad_glGetVertexAttribdvARB; +PFNGLGETVERTEXATTRIBFVARBPROC glad_glGetVertexAttribfvARB; +PFNGLGETVERTEXATTRIBIVARBPROC glad_glGetVertexAttribivARB; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC glad_glGetVertexAttribPointervARB; +PFNGLBINDATTRIBLOCATIONARBPROC glad_glBindAttribLocationARB; +PFNGLGETACTIVEATTRIBARBPROC glad_glGetActiveAttribARB; +PFNGLGETATTRIBLOCATIONARBPROC glad_glGetAttribLocationARB; +PFNGLELEMENTPOINTERATIPROC glad_glElementPointerATI; +PFNGLDRAWELEMENTARRAYATIPROC glad_glDrawElementArrayATI; +PFNGLDRAWRANGEELEMENTARRAYATIPROC glad_glDrawRangeElementArrayATI; +PFNGLGENFRAGMENTSHADERSATIPROC glad_glGenFragmentShadersATI; +PFNGLBINDFRAGMENTSHADERATIPROC glad_glBindFragmentShaderATI; +PFNGLDELETEFRAGMENTSHADERATIPROC glad_glDeleteFragmentShaderATI; +PFNGLBEGINFRAGMENTSHADERATIPROC glad_glBeginFragmentShaderATI; +PFNGLENDFRAGMENTSHADERATIPROC glad_glEndFragmentShaderATI; +PFNGLPASSTEXCOORDATIPROC glad_glPassTexCoordATI; +PFNGLSAMPLEMAPATIPROC glad_glSampleMapATI; +PFNGLCOLORFRAGMENTOP1ATIPROC glad_glColorFragmentOp1ATI; +PFNGLCOLORFRAGMENTOP2ATIPROC glad_glColorFragmentOp2ATI; +PFNGLCOLORFRAGMENTOP3ATIPROC glad_glColorFragmentOp3ATI; +PFNGLALPHAFRAGMENTOP1ATIPROC glad_glAlphaFragmentOp1ATI; +PFNGLALPHAFRAGMENTOP2ATIPROC glad_glAlphaFragmentOp2ATI; +PFNGLALPHAFRAGMENTOP3ATIPROC glad_glAlphaFragmentOp3ATI; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glad_glSetFragmentShaderConstantATI; +PFNGLNEWOBJECTBUFFERATIPROC glad_glNewObjectBufferATI; +PFNGLISOBJECTBUFFERATIPROC glad_glIsObjectBufferATI; +PFNGLUPDATEOBJECTBUFFERATIPROC glad_glUpdateObjectBufferATI; +PFNGLGETOBJECTBUFFERFVATIPROC glad_glGetObjectBufferfvATI; +PFNGLGETOBJECTBUFFERIVATIPROC glad_glGetObjectBufferivATI; +PFNGLFREEOBJECTBUFFERATIPROC glad_glFreeObjectBufferATI; +PFNGLARRAYOBJECTATIPROC glad_glArrayObjectATI; +PFNGLGETARRAYOBJECTFVATIPROC glad_glGetArrayObjectfvATI; +PFNGLGETARRAYOBJECTIVATIPROC glad_glGetArrayObjectivATI; +PFNGLVARIANTARRAYOBJECTATIPROC glad_glVariantArrayObjectATI; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC glad_glGetVariantArrayObjectfvATI; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC glad_glGetVariantArrayObjectivATI; +PFNGLBLENDCOLOREXTPROC glad_glBlendColorEXT; +PFNGLBLENDEQUATIONSEPARATEEXTPROC glad_glBlendEquationSeparateEXT; +PFNGLBLENDFUNCSEPARATEEXTPROC glad_glBlendFuncSeparateEXT; +PFNGLBLITFRAMEBUFFEREXTPROC glad_glBlitFramebufferEXT; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glad_glRenderbufferStorageMultisampleEXT; +PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT; +PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT; +PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT; +PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT; +PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT; +PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT; +PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT; +PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT; +PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT; +PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT; +PFNGLARRAYELEMENTEXTPROC glad_glArrayElementEXT; +PFNGLCOLORPOINTEREXTPROC glad_glColorPointerEXT; +PFNGLDRAWARRAYSEXTPROC glad_glDrawArraysEXT; +PFNGLEDGEFLAGPOINTEREXTPROC glad_glEdgeFlagPointerEXT; +PFNGLGETPOINTERVEXTPROC glad_glGetPointervEXT; +PFNGLINDEXPOINTEREXTPROC glad_glIndexPointerEXT; +PFNGLNORMALPOINTEREXTPROC glad_glNormalPointerEXT; +PFNGLTEXCOORDPOINTEREXTPROC glad_glTexCoordPointerEXT; +PFNGLVERTEXPOINTEREXTPROC glad_glVertexPointerEXT; +PFNGLBEGINVERTEXSHADEREXTPROC glad_glBeginVertexShaderEXT; +PFNGLENDVERTEXSHADEREXTPROC glad_glEndVertexShaderEXT; +PFNGLBINDVERTEXSHADEREXTPROC glad_glBindVertexShaderEXT; +PFNGLGENVERTEXSHADERSEXTPROC glad_glGenVertexShadersEXT; +PFNGLDELETEVERTEXSHADEREXTPROC glad_glDeleteVertexShaderEXT; +PFNGLSHADEROP1EXTPROC glad_glShaderOp1EXT; +PFNGLSHADEROP2EXTPROC glad_glShaderOp2EXT; +PFNGLSHADEROP3EXTPROC glad_glShaderOp3EXT; +PFNGLSWIZZLEEXTPROC glad_glSwizzleEXT; +PFNGLWRITEMASKEXTPROC glad_glWriteMaskEXT; +PFNGLINSERTCOMPONENTEXTPROC glad_glInsertComponentEXT; +PFNGLEXTRACTCOMPONENTEXTPROC glad_glExtractComponentEXT; +PFNGLGENSYMBOLSEXTPROC glad_glGenSymbolsEXT; +PFNGLSETINVARIANTEXTPROC glad_glSetInvariantEXT; +PFNGLSETLOCALCONSTANTEXTPROC glad_glSetLocalConstantEXT; +PFNGLVARIANTBVEXTPROC glad_glVariantbvEXT; +PFNGLVARIANTSVEXTPROC glad_glVariantsvEXT; +PFNGLVARIANTIVEXTPROC glad_glVariantivEXT; +PFNGLVARIANTFVEXTPROC glad_glVariantfvEXT; +PFNGLVARIANTDVEXTPROC glad_glVariantdvEXT; +PFNGLVARIANTUBVEXTPROC glad_glVariantubvEXT; +PFNGLVARIANTUSVEXTPROC glad_glVariantusvEXT; +PFNGLVARIANTUIVEXTPROC glad_glVariantuivEXT; +PFNGLVARIANTPOINTEREXTPROC glad_glVariantPointerEXT; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC glad_glEnableVariantClientStateEXT; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC glad_glDisableVariantClientStateEXT; +PFNGLBINDLIGHTPARAMETEREXTPROC glad_glBindLightParameterEXT; +PFNGLBINDMATERIALPARAMETEREXTPROC glad_glBindMaterialParameterEXT; +PFNGLBINDTEXGENPARAMETEREXTPROC glad_glBindTexGenParameterEXT; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC glad_glBindTextureUnitParameterEXT; +PFNGLBINDPARAMETEREXTPROC glad_glBindParameterEXT; +PFNGLISVARIANTENABLEDEXTPROC glad_glIsVariantEnabledEXT; +PFNGLGETVARIANTBOOLEANVEXTPROC glad_glGetVariantBooleanvEXT; +PFNGLGETVARIANTINTEGERVEXTPROC glad_glGetVariantIntegervEXT; +PFNGLGETVARIANTFLOATVEXTPROC glad_glGetVariantFloatvEXT; +PFNGLGETVARIANTPOINTERVEXTPROC glad_glGetVariantPointervEXT; +PFNGLGETINVARIANTBOOLEANVEXTPROC glad_glGetInvariantBooleanvEXT; +PFNGLGETINVARIANTINTEGERVEXTPROC glad_glGetInvariantIntegervEXT; +PFNGLGETINVARIANTFLOATVEXTPROC glad_glGetInvariantFloatvEXT; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC glad_glGetLocalConstantBooleanvEXT; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC glad_glGetLocalConstantIntegervEXT; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC glad_glGetLocalConstantFloatvEXT; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); } -static void load_GL_NV_copy_image(GLADloadproc load) { - if(!GLAD_GL_NV_copy_image) return; - glad_glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)load("glCopyImageSubDataNV"); +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); } -static void load_GL_INTEL_framebuffer_CMAA(GLADloadproc load) { - if(!GLAD_GL_INTEL_framebuffer_CMAA) return; - glad_glApplyFramebufferAttachmentCMAAINTEL = (PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC)load("glApplyFramebufferAttachmentCMAAINTEL"); +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); } -static void load_GL_ARB_transform_feedback2(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback2) return; - glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)load("glBindTransformFeedback"); - glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)load("glDeleteTransformFeedbacks"); - glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)load("glGenTransformFeedbacks"); - glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)load("glIsTransformFeedback"); - glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)load("glPauseTransformFeedback"); - glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)load("glResumeTransformFeedback"); - glad_glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)load("glDrawTransformFeedback"); +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); } -static void load_GL_ARB_transform_feedback3(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback3) return; - glad_glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)load("glDrawTransformFeedbackStream"); - glad_glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)load("glBeginQueryIndexed"); - glad_glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)load("glEndQueryIndexed"); - glad_glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)load("glGetQueryIndexediv"); +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); } -static void load_GL_EXT_debug_marker(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_marker) return; - glad_glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)load("glInsertEventMarkerEXT"); - glad_glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)load("glPushGroupMarkerEXT"); - glad_glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)load("glPopGroupMarkerEXT"); +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); } -static void load_GL_EXT_pixel_transform(GLADloadproc load) { - if(!GLAD_GL_EXT_pixel_transform) return; - glad_glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)load("glPixelTransformParameteriEXT"); - glad_glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)load("glPixelTransformParameterfEXT"); - glad_glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)load("glPixelTransformParameterivEXT"); - glad_glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)load("glPixelTransformParameterfvEXT"); - glad_glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)load("glGetPixelTransformParameterivEXT"); - glad_glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)load("glGetPixelTransformParameterfvEXT"); +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); } -static void load_GL_ATI_fragment_shader(GLADloadproc load) { - if(!GLAD_GL_ATI_fragment_shader) return; - glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); - glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); - glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); - glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); - glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); - glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); - glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); - glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); - glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); - glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); - glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); - glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); - glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); - glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); +static void load_GL_VERSION_2_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_1) return; + glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); + glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); + glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); + glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); + glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); + glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); } -static void load_GL_ARB_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_ARB_vertex_array_object) return; +static void load_GL_VERSION_3_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_0) return; + glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); + glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); + glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); + glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); + glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); + glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); + glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); + glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); + glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); + glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); + glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); + glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); + glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); + glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); + glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); + glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); + glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); + glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); + glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); + glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); + glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); + glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); + glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); + glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); + glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); + glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); + glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); + glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); + glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); + glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); + glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); + glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); + glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); + glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); + glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); + glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); + glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); + glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); + glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); + glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); + glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); + glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); + glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); + glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); + glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); + glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); + glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); + glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); + glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); + glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); + glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); + glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); + glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); + glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); } -static void load_GL_SUN_triangle_list(GLADloadproc load) { - if(!GLAD_GL_SUN_triangle_list) return; - glad_glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)load("glReplacementCodeuiSUN"); - glad_glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)load("glReplacementCodeusSUN"); - glad_glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)load("glReplacementCodeubSUN"); - glad_glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)load("glReplacementCodeuivSUN"); - glad_glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)load("glReplacementCodeusvSUN"); - glad_glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)load("glReplacementCodeubvSUN"); - glad_glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)load("glReplacementCodePointerSUN"); -} -static void load_GL_ARB_transform_feedback_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_transform_feedback_instanced) return; - glad_glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)load("glDrawTransformFeedbackInstanced"); - glad_glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)load("glDrawTransformFeedbackStreamInstanced"); -} -static void load_GL_SGIX_async(GLADloadproc load) { - if(!GLAD_GL_SGIX_async) return; - glad_glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)load("glAsyncMarkerSGIX"); - glad_glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)load("glFinishAsyncSGIX"); - glad_glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)load("glPollAsyncSGIX"); - glad_glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)load("glGenAsyncMarkersSGIX"); - glad_glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)load("glDeleteAsyncMarkersSGIX"); - glad_glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)load("glIsAsyncMarkerSGIX"); -} -static void load_GL_INTEL_performance_query(GLADloadproc load) { - if(!GLAD_GL_INTEL_performance_query) return; - glad_glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)load("glBeginPerfQueryINTEL"); - glad_glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)load("glCreatePerfQueryINTEL"); - glad_glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)load("glDeletePerfQueryINTEL"); - glad_glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)load("glEndPerfQueryINTEL"); - glad_glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)load("glGetFirstPerfQueryIdINTEL"); - glad_glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)load("glGetNextPerfQueryIdINTEL"); - glad_glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)load("glGetPerfCounterInfoINTEL"); - glad_glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)load("glGetPerfQueryDataINTEL"); - glad_glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)load("glGetPerfQueryIdByNameINTEL"); - glad_glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)load("glGetPerfQueryInfoINTEL"); -} -static void load_GL_NV_gpu_shader5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_shader5) return; - glad_glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)load("glUniform1i64NV"); - glad_glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)load("glUniform2i64NV"); - glad_glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)load("glUniform3i64NV"); - glad_glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)load("glUniform4i64NV"); - glad_glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)load("glUniform1i64vNV"); - glad_glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)load("glUniform2i64vNV"); - glad_glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)load("glUniform3i64vNV"); - glad_glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)load("glUniform4i64vNV"); - glad_glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)load("glUniform1ui64NV"); - glad_glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)load("glUniform2ui64NV"); - glad_glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)load("glUniform3ui64NV"); - glad_glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)load("glUniform4ui64NV"); - glad_glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)load("glUniform1ui64vNV"); - glad_glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)load("glUniform2ui64vNV"); - glad_glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)load("glUniform3ui64vNV"); - glad_glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)load("glUniform4ui64vNV"); - glad_glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)load("glGetUniformi64vNV"); - glad_glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)load("glProgramUniform1i64NV"); - glad_glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)load("glProgramUniform2i64NV"); - glad_glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)load("glProgramUniform3i64NV"); - glad_glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)load("glProgramUniform4i64NV"); - glad_glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)load("glProgramUniform1i64vNV"); - glad_glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)load("glProgramUniform2i64vNV"); - glad_glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)load("glProgramUniform3i64vNV"); - glad_glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)load("glProgramUniform4i64vNV"); - glad_glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)load("glProgramUniform1ui64NV"); - glad_glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)load("glProgramUniform2ui64NV"); - glad_glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)load("glProgramUniform3ui64NV"); - glad_glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)load("glProgramUniform4ui64NV"); - glad_glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)load("glProgramUniform1ui64vNV"); - glad_glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)load("glProgramUniform2ui64vNV"); - glad_glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)load("glProgramUniform3ui64vNV"); - glad_glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)load("glProgramUniform4ui64vNV"); -} -static void load_GL_NV_bindless_multi_draw_indirect_count(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect_count) return; - glad_glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawArraysIndirectBindlessCountNV"); - glad_glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)load("glMultiDrawElementsIndirectBindlessCountNV"); -} -static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES2_compatibility) return; - glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); - glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); - glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); - glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); - glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); -} -static void load_GL_ARB_indirect_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_indirect_parameters) return; - glad_glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)load("glMultiDrawArraysIndirectCountARB"); - glad_glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)load("glMultiDrawElementsIndirectCountARB"); -} -static void load_GL_NV_half_float(GLADloadproc load) { - if(!GLAD_GL_NV_half_float) return; - glad_glVertex2hNV = (PFNGLVERTEX2HNVPROC)load("glVertex2hNV"); - glad_glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)load("glVertex2hvNV"); - glad_glVertex3hNV = (PFNGLVERTEX3HNVPROC)load("glVertex3hNV"); - glad_glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)load("glVertex3hvNV"); - glad_glVertex4hNV = (PFNGLVERTEX4HNVPROC)load("glVertex4hNV"); - glad_glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)load("glVertex4hvNV"); - glad_glNormal3hNV = (PFNGLNORMAL3HNVPROC)load("glNormal3hNV"); - glad_glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)load("glNormal3hvNV"); - glad_glColor3hNV = (PFNGLCOLOR3HNVPROC)load("glColor3hNV"); - glad_glColor3hvNV = (PFNGLCOLOR3HVNVPROC)load("glColor3hvNV"); - glad_glColor4hNV = (PFNGLCOLOR4HNVPROC)load("glColor4hNV"); - glad_glColor4hvNV = (PFNGLCOLOR4HVNVPROC)load("glColor4hvNV"); - glad_glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)load("glTexCoord1hNV"); - glad_glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)load("glTexCoord1hvNV"); - glad_glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)load("glTexCoord2hNV"); - glad_glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)load("glTexCoord2hvNV"); - glad_glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)load("glTexCoord3hNV"); - glad_glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)load("glTexCoord3hvNV"); - glad_glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)load("glTexCoord4hNV"); - glad_glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)load("glTexCoord4hvNV"); - glad_glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)load("glMultiTexCoord1hNV"); - glad_glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)load("glMultiTexCoord1hvNV"); - glad_glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)load("glMultiTexCoord2hNV"); - glad_glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)load("glMultiTexCoord2hvNV"); - glad_glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)load("glMultiTexCoord3hNV"); - glad_glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)load("glMultiTexCoord3hvNV"); - glad_glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)load("glMultiTexCoord4hNV"); - glad_glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)load("glMultiTexCoord4hvNV"); - glad_glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)load("glFogCoordhNV"); - glad_glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)load("glFogCoordhvNV"); - glad_glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)load("glSecondaryColor3hNV"); - glad_glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)load("glSecondaryColor3hvNV"); - glad_glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)load("glVertexWeighthNV"); - glad_glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)load("glVertexWeighthvNV"); - glad_glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)load("glVertexAttrib1hNV"); - glad_glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)load("glVertexAttrib1hvNV"); - glad_glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)load("glVertexAttrib2hNV"); - glad_glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)load("glVertexAttrib2hvNV"); - glad_glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)load("glVertexAttrib3hNV"); - glad_glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)load("glVertexAttrib3hvNV"); - glad_glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)load("glVertexAttrib4hNV"); - glad_glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)load("glVertexAttrib4hvNV"); - glad_glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)load("glVertexAttribs1hvNV"); - glad_glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)load("glVertexAttribs2hvNV"); - glad_glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)load("glVertexAttribs3hvNV"); - glad_glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)load("glVertexAttribs4hvNV"); -} -static void load_GL_ARB_ES3_2_compatibility(GLADloadproc load) { - if(!GLAD_GL_ARB_ES3_2_compatibility) return; - glad_glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)load("glPrimitiveBoundingBoxARB"); -} -static void load_GL_EXT_polygon_offset_clamp(GLADloadproc load) { - if(!GLAD_GL_EXT_polygon_offset_clamp) return; - glad_glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)load("glPolygonOffsetClampEXT"); -} -static void load_GL_EXT_compiled_vertex_array(GLADloadproc load) { - if(!GLAD_GL_EXT_compiled_vertex_array) return; - glad_glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)load("glLockArraysEXT"); - glad_glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)load("glUnlockArraysEXT"); -} -static void load_GL_NV_depth_buffer_float(GLADloadproc load) { - if(!GLAD_GL_NV_depth_buffer_float) return; - glad_glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)load("glDepthRangedNV"); - glad_glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)load("glClearDepthdNV"); - glad_glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)load("glDepthBoundsdNV"); -} -static void load_GL_NV_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_NV_occlusion_query) return; - glad_glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)load("glGenOcclusionQueriesNV"); - glad_glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)load("glDeleteOcclusionQueriesNV"); - glad_glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)load("glIsOcclusionQueryNV"); - glad_glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)load("glBeginOcclusionQueryNV"); - glad_glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)load("glEndOcclusionQueryNV"); - glad_glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)load("glGetOcclusionQueryivNV"); - glad_glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)load("glGetOcclusionQueryuivNV"); -} -static void load_GL_APPLE_flush_buffer_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_flush_buffer_range) return; - glad_glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)load("glBufferParameteriAPPLE"); - glad_glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)load("glFlushMappedBufferRangeAPPLE"); -} -static void load_GL_ARB_imaging(GLADloadproc load) { - if(!GLAD_GL_ARB_imaging) return; - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); - glad_glColorTable = (PFNGLCOLORTABLEPROC)load("glColorTable"); - glad_glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)load("glColorTableParameterfv"); - glad_glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)load("glColorTableParameteriv"); - glad_glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)load("glCopyColorTable"); - glad_glGetColorTable = (PFNGLGETCOLORTABLEPROC)load("glGetColorTable"); - glad_glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)load("glGetColorTableParameterfv"); - glad_glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)load("glGetColorTableParameteriv"); - glad_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)load("glColorSubTable"); - glad_glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)load("glCopyColorSubTable"); - glad_glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)load("glConvolutionFilter1D"); - glad_glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)load("glConvolutionFilter2D"); - glad_glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)load("glConvolutionParameterf"); - glad_glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)load("glConvolutionParameterfv"); - glad_glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)load("glConvolutionParameteri"); - glad_glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)load("glConvolutionParameteriv"); - glad_glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)load("glCopyConvolutionFilter1D"); - glad_glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)load("glCopyConvolutionFilter2D"); - glad_glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)load("glGetConvolutionFilter"); - glad_glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)load("glGetConvolutionParameterfv"); - glad_glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)load("glGetConvolutionParameteriv"); - glad_glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)load("glGetSeparableFilter"); - glad_glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)load("glSeparableFilter2D"); - glad_glGetHistogram = (PFNGLGETHISTOGRAMPROC)load("glGetHistogram"); - glad_glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)load("glGetHistogramParameterfv"); - glad_glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)load("glGetHistogramParameteriv"); - glad_glGetMinmax = (PFNGLGETMINMAXPROC)load("glGetMinmax"); - glad_glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)load("glGetMinmaxParameterfv"); - glad_glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)load("glGetMinmaxParameteriv"); - glad_glHistogram = (PFNGLHISTOGRAMPROC)load("glHistogram"); - glad_glMinmax = (PFNGLMINMAXPROC)load("glMinmax"); - glad_glResetHistogram = (PFNGLRESETHISTOGRAMPROC)load("glResetHistogram"); - glad_glResetMinmax = (PFNGLRESETMINMAXPROC)load("glResetMinmax"); -} -static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers_blend) return; - glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); - glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); - glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); - glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); -} -static void load_GL_ARB_clear_buffer_object(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_buffer_object) return; - glad_glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)load("glClearBufferData"); - glad_glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)load("glClearBufferSubData"); -} -static void load_GL_ARB_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_multisample) return; - glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); -} -static void load_GL_EXT_debug_label(GLADloadproc load) { - if(!GLAD_GL_EXT_debug_label) return; - glad_glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)load("glLabelObjectEXT"); - glad_glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)load("glGetObjectLabelEXT"); -} -static void load_GL_ARB_sample_shading(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_shading) return; - glad_glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)load("glMinSampleShadingARB"); -} -static void load_GL_NV_internalformat_sample_query(GLADloadproc load) { - if(!GLAD_GL_NV_internalformat_sample_query) return; - glad_glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)load("glGetInternalformatSampleivNV"); -} -static void load_GL_INTEL_map_texture(GLADloadproc load) { - if(!GLAD_GL_INTEL_map_texture) return; - glad_glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)load("glSyncTextureINTEL"); - glad_glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)load("glUnmapTexture2DINTEL"); - glad_glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)load("glMapTexture2DINTEL"); -} -static void load_GL_ARB_compute_shader(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_shader) return; - glad_glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)load("glDispatchCompute"); - glad_glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)load("glDispatchComputeIndirect"); -} -static void load_GL_IBM_vertex_array_lists(GLADloadproc load) { - if(!GLAD_GL_IBM_vertex_array_lists) return; - glad_glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)load("glColorPointerListIBM"); - glad_glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)load("glSecondaryColorPointerListIBM"); - glad_glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)load("glEdgeFlagPointerListIBM"); - glad_glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)load("glFogCoordPointerListIBM"); - glad_glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)load("glIndexPointerListIBM"); - glad_glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)load("glNormalPointerListIBM"); - glad_glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)load("glTexCoordPointerListIBM"); - glad_glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)load("glVertexPointerListIBM"); -} -static void load_GL_ARB_color_buffer_float(GLADloadproc load) { - if(!GLAD_GL_ARB_color_buffer_float) return; - glad_glClampColorARB = (PFNGLCLAMPCOLORARBPROC)load("glClampColorARB"); -} -static void load_GL_ARB_bindless_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_bindless_texture) return; - glad_glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)load("glGetTextureHandleARB"); - glad_glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)load("glGetTextureSamplerHandleARB"); - glad_glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)load("glMakeTextureHandleResidentARB"); - glad_glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)load("glMakeTextureHandleNonResidentARB"); - glad_glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)load("glGetImageHandleARB"); - glad_glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)load("glMakeImageHandleResidentARB"); - glad_glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)load("glMakeImageHandleNonResidentARB"); - glad_glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)load("glUniformHandleui64ARB"); - glad_glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)load("glUniformHandleui64vARB"); - glad_glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)load("glProgramUniformHandleui64ARB"); - glad_glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)load("glProgramUniformHandleui64vARB"); - glad_glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)load("glIsTextureHandleResidentARB"); - glad_glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)load("glIsImageHandleResidentARB"); - glad_glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)load("glVertexAttribL1ui64ARB"); - glad_glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)load("glVertexAttribL1ui64vARB"); - glad_glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)load("glGetVertexAttribLui64vARB"); -} -static void load_GL_ARB_window_pos(GLADloadproc load) { - if(!GLAD_GL_ARB_window_pos) return; - glad_glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)load("glWindowPos2dARB"); - glad_glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)load("glWindowPos2dvARB"); - glad_glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)load("glWindowPos2fARB"); - glad_glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)load("glWindowPos2fvARB"); - glad_glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)load("glWindowPos2iARB"); - glad_glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)load("glWindowPos2ivARB"); - glad_glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)load("glWindowPos2sARB"); - glad_glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)load("glWindowPos2svARB"); - glad_glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)load("glWindowPos3dARB"); - glad_glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)load("glWindowPos3dvARB"); - glad_glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)load("glWindowPos3fARB"); - glad_glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)load("glWindowPos3fvARB"); - glad_glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)load("glWindowPos3iARB"); - glad_glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)load("glWindowPos3ivARB"); - glad_glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)load("glWindowPos3sARB"); - glad_glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)load("glWindowPos3svARB"); -} -static void load_GL_ARB_internalformat_query(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query) return; - glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)load("glGetInternalformativ"); -} -static void load_GL_EXT_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_EXT_shader_image_load_store) return; - glad_glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)load("glBindImageTextureEXT"); - glad_glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)load("glMemoryBarrierEXT"); -} -static void load_GL_EXT_copy_texture(GLADloadproc load) { - if(!GLAD_GL_EXT_copy_texture) return; - glad_glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)load("glCopyTexImage1DEXT"); - glad_glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)load("glCopyTexImage2DEXT"); - glad_glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)load("glCopyTexSubImage1DEXT"); - glad_glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)load("glCopyTexSubImage2DEXT"); - glad_glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)load("glCopyTexSubImage3DEXT"); -} -static void load_GL_NV_register_combiners2(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners2) return; - glad_glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)load("glCombinerStageParameterfvNV"); - glad_glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)load("glGetCombinerStageParameterfvNV"); -} -static void load_GL_NV_draw_texture(GLADloadproc load) { - if(!GLAD_GL_NV_draw_texture) return; - glad_glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)load("glDrawTextureNV"); -} -static void load_GL_EXT_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_instanced) return; - glad_glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)load("glDrawArraysInstancedEXT"); - glad_glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)load("glDrawElementsInstancedEXT"); -} -static void load_GL_ARB_viewport_array(GLADloadproc load) { - if(!GLAD_GL_ARB_viewport_array) return; - glad_glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)load("glViewportArrayv"); - glad_glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)load("glViewportIndexedf"); - glad_glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)load("glViewportIndexedfv"); - glad_glScissorArrayv = (PFNGLSCISSORARRAYVPROC)load("glScissorArrayv"); - glad_glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)load("glScissorIndexed"); - glad_glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)load("glScissorIndexedv"); - glad_glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)load("glDepthRangeArrayv"); - glad_glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)load("glDepthRangeIndexed"); - glad_glGetFloati_v = (PFNGLGETFLOATI_VPROC)load("glGetFloati_v"); - glad_glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)load("glGetDoublei_v"); -} -static void load_GL_ARB_separate_shader_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_separate_shader_objects) return; - glad_glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)load("glUseProgramStages"); - glad_glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)load("glActiveShaderProgram"); - glad_glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)load("glCreateShaderProgramv"); - glad_glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)load("glBindProgramPipeline"); - glad_glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)load("glDeleteProgramPipelines"); - glad_glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)load("glGenProgramPipelines"); - glad_glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)load("glIsProgramPipeline"); - glad_glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)load("glGetProgramPipelineiv"); - glad_glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)load("glProgramUniform1i"); - glad_glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)load("glProgramUniform1iv"); - glad_glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)load("glProgramUniform1f"); - glad_glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)load("glProgramUniform1fv"); - glad_glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)load("glProgramUniform1d"); - glad_glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)load("glProgramUniform1dv"); - glad_glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)load("glProgramUniform1ui"); - glad_glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)load("glProgramUniform1uiv"); - glad_glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)load("glProgramUniform2i"); - glad_glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)load("glProgramUniform2iv"); - glad_glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)load("glProgramUniform2f"); - glad_glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)load("glProgramUniform2fv"); - glad_glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)load("glProgramUniform2d"); - glad_glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)load("glProgramUniform2dv"); - glad_glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)load("glProgramUniform2ui"); - glad_glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)load("glProgramUniform2uiv"); - glad_glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)load("glProgramUniform3i"); - glad_glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)load("glProgramUniform3iv"); - glad_glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)load("glProgramUniform3f"); - glad_glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)load("glProgramUniform3fv"); - glad_glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)load("glProgramUniform3d"); - glad_glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)load("glProgramUniform3dv"); - glad_glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)load("glProgramUniform3ui"); - glad_glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)load("glProgramUniform3uiv"); - glad_glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)load("glProgramUniform4i"); - glad_glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)load("glProgramUniform4iv"); - glad_glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)load("glProgramUniform4f"); - glad_glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)load("glProgramUniform4fv"); - glad_glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)load("glProgramUniform4d"); - glad_glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)load("glProgramUniform4dv"); - glad_glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)load("glProgramUniform4ui"); - glad_glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)load("glProgramUniform4uiv"); - glad_glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)load("glProgramUniformMatrix2fv"); - glad_glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)load("glProgramUniformMatrix3fv"); - glad_glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)load("glProgramUniformMatrix4fv"); - glad_glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)load("glProgramUniformMatrix2dv"); - glad_glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)load("glProgramUniformMatrix3dv"); - glad_glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)load("glProgramUniformMatrix4dv"); - glad_glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)load("glProgramUniformMatrix2x3fv"); - glad_glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)load("glProgramUniformMatrix3x2fv"); - glad_glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)load("glProgramUniformMatrix2x4fv"); - glad_glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)load("glProgramUniformMatrix4x2fv"); - glad_glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)load("glProgramUniformMatrix3x4fv"); - glad_glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)load("glProgramUniformMatrix4x3fv"); - glad_glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)load("glProgramUniformMatrix2x3dv"); - glad_glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)load("glProgramUniformMatrix3x2dv"); - glad_glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)load("glProgramUniformMatrix2x4dv"); - glad_glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)load("glProgramUniformMatrix4x2dv"); - glad_glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)load("glProgramUniformMatrix3x4dv"); - glad_glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)load("glProgramUniformMatrix4x3dv"); - glad_glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)load("glValidateProgramPipeline"); - glad_glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)load("glGetProgramPipelineInfoLog"); -} -static void load_GL_EXT_depth_bounds_test(GLADloadproc load) { - if(!GLAD_GL_EXT_depth_bounds_test) return; - glad_glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)load("glDepthBoundsEXT"); +static void load_GL_VERSION_3_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_1) return; + glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); + glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); + glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); + glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); } -static void load_GL_NV_video_capture(GLADloadproc load) { - if(!GLAD_GL_NV_video_capture) return; - glad_glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)load("glBeginVideoCaptureNV"); - glad_glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)load("glBindVideoCaptureStreamBufferNV"); - glad_glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)load("glBindVideoCaptureStreamTextureNV"); - glad_glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)load("glEndVideoCaptureNV"); - glad_glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)load("glGetVideoCaptureivNV"); - glad_glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)load("glGetVideoCaptureStreamivNV"); - glad_glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)load("glGetVideoCaptureStreamfvNV"); - glad_glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)load("glGetVideoCaptureStreamdvNV"); - glad_glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)load("glVideoCaptureNV"); - glad_glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)load("glVideoCaptureStreamParameterivNV"); - glad_glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)load("glVideoCaptureStreamParameterfvNV"); - glad_glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)load("glVideoCaptureStreamParameterdvNV"); +static void load_GL_VERSION_3_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_2) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); + glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); + glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); + glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); } -static void load_GL_ARB_sampler_objects(GLADloadproc load) { - if(!GLAD_GL_ARB_sampler_objects) return; +static void load_GL_VERSION_3_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_3) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); @@ -20151,357 +4831,67 @@ static void load_GL_ARB_sampler_objects(GLADloadproc load) { glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); + glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); } -static void load_GL_ARB_matrix_palette(GLADloadproc load) { - if(!GLAD_GL_ARB_matrix_palette) return; - glad_glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)load("glCurrentPaletteMatrixARB"); - glad_glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)load("glMatrixIndexubvARB"); - glad_glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)load("glMatrixIndexusvARB"); - glad_glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)load("glMatrixIndexuivARB"); - glad_glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)load("glMatrixIndexPointerARB"); -} -static void load_GL_SGIS_texture_color_mask(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture_color_mask) return; - glad_glTextureColorMaskSGIS = (PFNGLTEXTURECOLORMASKSGISPROC)load("glTextureColorMaskSGIS"); -} -static void load_GL_EXT_coordinate_frame(GLADloadproc load) { - if(!GLAD_GL_EXT_coordinate_frame) return; - glad_glTangent3bEXT = (PFNGLTANGENT3BEXTPROC)load("glTangent3bEXT"); - glad_glTangent3bvEXT = (PFNGLTANGENT3BVEXTPROC)load("glTangent3bvEXT"); - glad_glTangent3dEXT = (PFNGLTANGENT3DEXTPROC)load("glTangent3dEXT"); - glad_glTangent3dvEXT = (PFNGLTANGENT3DVEXTPROC)load("glTangent3dvEXT"); - glad_glTangent3fEXT = (PFNGLTANGENT3FEXTPROC)load("glTangent3fEXT"); - glad_glTangent3fvEXT = (PFNGLTANGENT3FVEXTPROC)load("glTangent3fvEXT"); - glad_glTangent3iEXT = (PFNGLTANGENT3IEXTPROC)load("glTangent3iEXT"); - glad_glTangent3ivEXT = (PFNGLTANGENT3IVEXTPROC)load("glTangent3ivEXT"); - glad_glTangent3sEXT = (PFNGLTANGENT3SEXTPROC)load("glTangent3sEXT"); - glad_glTangent3svEXT = (PFNGLTANGENT3SVEXTPROC)load("glTangent3svEXT"); - glad_glBinormal3bEXT = (PFNGLBINORMAL3BEXTPROC)load("glBinormal3bEXT"); - glad_glBinormal3bvEXT = (PFNGLBINORMAL3BVEXTPROC)load("glBinormal3bvEXT"); - glad_glBinormal3dEXT = (PFNGLBINORMAL3DEXTPROC)load("glBinormal3dEXT"); - glad_glBinormal3dvEXT = (PFNGLBINORMAL3DVEXTPROC)load("glBinormal3dvEXT"); - glad_glBinormal3fEXT = (PFNGLBINORMAL3FEXTPROC)load("glBinormal3fEXT"); - glad_glBinormal3fvEXT = (PFNGLBINORMAL3FVEXTPROC)load("glBinormal3fvEXT"); - glad_glBinormal3iEXT = (PFNGLBINORMAL3IEXTPROC)load("glBinormal3iEXT"); - glad_glBinormal3ivEXT = (PFNGLBINORMAL3IVEXTPROC)load("glBinormal3ivEXT"); - glad_glBinormal3sEXT = (PFNGLBINORMAL3SEXTPROC)load("glBinormal3sEXT"); - glad_glBinormal3svEXT = (PFNGLBINORMAL3SVEXTPROC)load("glBinormal3svEXT"); - glad_glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)load("glTangentPointerEXT"); - glad_glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)load("glBinormalPointerEXT"); -} -static void load_GL_ARB_texture_compression(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_compression) return; - glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); - glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); - glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); - glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); - glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); - glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); - glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); -} -static void load_GL_ARB_shader_subroutine(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_subroutine) return; - glad_glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)load("glGetSubroutineUniformLocation"); - glad_glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)load("glGetSubroutineIndex"); - glad_glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)load("glGetActiveSubroutineUniformiv"); - glad_glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)load("glGetActiveSubroutineUniformName"); - glad_glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)load("glGetActiveSubroutineName"); - glad_glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)load("glUniformSubroutinesuiv"); - glad_glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)load("glGetUniformSubroutineuiv"); - glad_glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)load("glGetProgramStageiv"); -} -static void load_GL_ARB_texture_storage_multisample(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_storage_multisample) return; - glad_glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)load("glTexStorage2DMultisample"); - glad_glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)load("glTexStorage3DMultisample"); -} -static void load_GL_EXT_vertex_attrib_64bit(GLADloadproc load) { - if(!GLAD_GL_EXT_vertex_attrib_64bit) return; - glad_glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)load("glVertexAttribL1dEXT"); - glad_glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)load("glVertexAttribL2dEXT"); - glad_glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)load("glVertexAttribL3dEXT"); - glad_glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)load("glVertexAttribL4dEXT"); - glad_glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)load("glVertexAttribL1dvEXT"); - glad_glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)load("glVertexAttribL2dvEXT"); - glad_glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)load("glVertexAttribL3dvEXT"); - glad_glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)load("glVertexAttribL4dvEXT"); - glad_glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)load("glVertexAttribLPointerEXT"); - glad_glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)load("glGetVertexAttribLdvEXT"); -} -static void load_GL_OES_query_matrix(GLADloadproc load) { - if(!GLAD_GL_OES_query_matrix) return; - glad_glQueryMatrixxOES = (PFNGLQUERYMATRIXXOESPROC)load("glQueryMatrixxOES"); -} -static void load_GL_MESA_window_pos(GLADloadproc load) { - if(!GLAD_GL_MESA_window_pos) return; - glad_glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)load("glWindowPos2dMESA"); - glad_glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)load("glWindowPos2dvMESA"); - glad_glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)load("glWindowPos2fMESA"); - glad_glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)load("glWindowPos2fvMESA"); - glad_glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)load("glWindowPos2iMESA"); - glad_glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)load("glWindowPos2ivMESA"); - glad_glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)load("glWindowPos2sMESA"); - glad_glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)load("glWindowPos2svMESA"); - glad_glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)load("glWindowPos3dMESA"); - glad_glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)load("glWindowPos3dvMESA"); - glad_glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)load("glWindowPos3fMESA"); - glad_glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)load("glWindowPos3fvMESA"); - glad_glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)load("glWindowPos3iMESA"); - glad_glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)load("glWindowPos3ivMESA"); - glad_glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)load("glWindowPos3sMESA"); - glad_glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)load("glWindowPos3svMESA"); - glad_glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)load("glWindowPos4dMESA"); - glad_glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)load("glWindowPos4dvMESA"); - glad_glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)load("glWindowPos4fMESA"); - glad_glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)load("glWindowPos4fvMESA"); - glad_glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)load("glWindowPos4iMESA"); - glad_glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)load("glWindowPos4ivMESA"); - glad_glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)load("glWindowPos4sMESA"); - glad_glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)load("glWindowPos4svMESA"); -} -static void load_GL_ARB_copy_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_copy_buffer) return; - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); -} -static void load_GL_APPLE_object_purgeable(GLADloadproc load) { - if(!GLAD_GL_APPLE_object_purgeable) return; - glad_glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)load("glObjectPurgeableAPPLE"); - glad_glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)load("glObjectUnpurgeableAPPLE"); - glad_glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)load("glGetObjectParameterivAPPLE"); -} -static void load_GL_ARB_occlusion_query(GLADloadproc load) { - if(!GLAD_GL_ARB_occlusion_query) return; - glad_glGenQueriesARB = (PFNGLGENQUERIESARBPROC)load("glGenQueriesARB"); - glad_glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)load("glDeleteQueriesARB"); - glad_glIsQueryARB = (PFNGLISQUERYARBPROC)load("glIsQueryARB"); - glad_glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)load("glBeginQueryARB"); - glad_glEndQueryARB = (PFNGLENDQUERYARBPROC)load("glEndQueryARB"); - glad_glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)load("glGetQueryivARB"); - glad_glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)load("glGetQueryObjectivARB"); - glad_glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)load("glGetQueryObjectuivARB"); -} -static void load_GL_SGI_color_table(GLADloadproc load) { - if(!GLAD_GL_SGI_color_table) return; - glad_glColorTableSGI = (PFNGLCOLORTABLESGIPROC)load("glColorTableSGI"); - glad_glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)load("glColorTableParameterfvSGI"); - glad_glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)load("glColorTableParameterivSGI"); - glad_glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)load("glCopyColorTableSGI"); - glad_glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)load("glGetColorTableSGI"); - glad_glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)load("glGetColorTableParameterfvSGI"); - glad_glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)load("glGetColorTableParameterivSGI"); -} -static void load_GL_EXT_gpu_shader4(GLADloadproc load) { - if(!GLAD_GL_EXT_gpu_shader4) return; - glad_glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)load("glGetUniformuivEXT"); - glad_glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)load("glBindFragDataLocationEXT"); - glad_glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)load("glGetFragDataLocationEXT"); - glad_glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)load("glUniform1uiEXT"); - glad_glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)load("glUniform2uiEXT"); - glad_glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)load("glUniform3uiEXT"); - glad_glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)load("glUniform4uiEXT"); - glad_glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)load("glUniform1uivEXT"); - glad_glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)load("glUniform2uivEXT"); - glad_glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)load("glUniform3uivEXT"); - glad_glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)load("glUniform4uivEXT"); -} -static void load_GL_NV_geometry_program4(GLADloadproc load) { - if(!GLAD_GL_NV_geometry_program4) return; - glad_glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)load("glProgramVertexLimitNV"); - glad_glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)load("glFramebufferTextureEXT"); - glad_glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)load("glFramebufferTextureLayerEXT"); - glad_glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)load("glFramebufferTextureFaceEXT"); -} -static void load_GL_AMD_debug_output(GLADloadproc load) { - if(!GLAD_GL_AMD_debug_output) return; - glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); - glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); - glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); - glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); -} -static void load_GL_ARB_multitexture(GLADloadproc load) { - if(!GLAD_GL_ARB_multitexture) return; - glad_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)load("glActiveTextureARB"); - glad_glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)load("glClientActiveTextureARB"); - glad_glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)load("glMultiTexCoord1dARB"); - glad_glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)load("glMultiTexCoord1dvARB"); - glad_glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)load("glMultiTexCoord1fARB"); - glad_glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)load("glMultiTexCoord1fvARB"); - glad_glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)load("glMultiTexCoord1iARB"); - glad_glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)load("glMultiTexCoord1ivARB"); - glad_glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)load("glMultiTexCoord1sARB"); - glad_glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)load("glMultiTexCoord1svARB"); - glad_glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)load("glMultiTexCoord2dARB"); - glad_glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)load("glMultiTexCoord2dvARB"); - glad_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)load("glMultiTexCoord2fARB"); - glad_glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)load("glMultiTexCoord2fvARB"); - glad_glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)load("glMultiTexCoord2iARB"); - glad_glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)load("glMultiTexCoord2ivARB"); - glad_glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)load("glMultiTexCoord2sARB"); - glad_glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)load("glMultiTexCoord2svARB"); - glad_glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)load("glMultiTexCoord3dARB"); - glad_glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)load("glMultiTexCoord3dvARB"); - glad_glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)load("glMultiTexCoord3fARB"); - glad_glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)load("glMultiTexCoord3fvARB"); - glad_glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)load("glMultiTexCoord3iARB"); - glad_glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)load("glMultiTexCoord3ivARB"); - glad_glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)load("glMultiTexCoord3sARB"); - glad_glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)load("glMultiTexCoord3svARB"); - glad_glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)load("glMultiTexCoord4dARB"); - glad_glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)load("glMultiTexCoord4dvARB"); - glad_glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)load("glMultiTexCoord4fARB"); - glad_glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)load("glMultiTexCoord4fvARB"); - glad_glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)load("glMultiTexCoord4iARB"); - glad_glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)load("glMultiTexCoord4ivARB"); - glad_glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)load("glMultiTexCoord4sARB"); - glad_glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)load("glMultiTexCoord4svARB"); -} -static void load_GL_SGIX_polynomial_ffd(GLADloadproc load) { - if(!GLAD_GL_SGIX_polynomial_ffd) return; - glad_glDeformationMap3dSGIX = (PFNGLDEFORMATIONMAP3DSGIXPROC)load("glDeformationMap3dSGIX"); - glad_glDeformationMap3fSGIX = (PFNGLDEFORMATIONMAP3FSGIXPROC)load("glDeformationMap3fSGIX"); - glad_glDeformSGIX = (PFNGLDEFORMSGIXPROC)load("glDeformSGIX"); - glad_glLoadIdentityDeformationMapSGIX = (PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC)load("glLoadIdentityDeformationMapSGIX"); -} -static void load_GL_EXT_provoking_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_provoking_vertex) return; - glad_glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)load("glProvokingVertexEXT"); -} -static void load_GL_ARB_point_parameters(GLADloadproc load) { - if(!GLAD_GL_ARB_point_parameters) return; - glad_glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)load("glPointParameterfARB"); - glad_glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)load("glPointParameterfvARB"); -} -static void load_GL_ARB_shader_image_load_store(GLADloadproc load) { - if(!GLAD_GL_ARB_shader_image_load_store) return; - glad_glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)load("glBindImageTexture"); - glad_glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)load("glMemoryBarrier"); -} -static void load_GL_ARB_texture_barrier(GLADloadproc load) { - if(!GLAD_GL_ARB_texture_barrier) return; - glad_glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)load("glTextureBarrier"); -} -static void load_GL_NV_bindless_multi_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_NV_bindless_multi_draw_indirect) return; - glad_glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)load("glMultiDrawArraysIndirectBindlessNV"); - glad_glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)load("glMultiDrawElementsIndirectBindlessNV"); -} -static void load_GL_EXT_transform_feedback(GLADloadproc load) { - if(!GLAD_GL_EXT_transform_feedback) return; - glad_glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)load("glBeginTransformFeedbackEXT"); - glad_glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)load("glEndTransformFeedbackEXT"); - glad_glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)load("glBindBufferRangeEXT"); - glad_glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)load("glBindBufferOffsetEXT"); - glad_glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)load("glBindBufferBaseEXT"); - glad_glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)load("glTransformFeedbackVaryingsEXT"); - glad_glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)load("glGetTransformFeedbackVaryingEXT"); -} -static void load_GL_NV_gpu_program4(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program4) return; - glad_glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)load("glProgramLocalParameterI4iNV"); - glad_glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)load("glProgramLocalParameterI4ivNV"); - glad_glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)load("glProgramLocalParametersI4ivNV"); - glad_glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)load("glProgramLocalParameterI4uiNV"); - glad_glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)load("glProgramLocalParameterI4uivNV"); - glad_glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)load("glProgramLocalParametersI4uivNV"); - glad_glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)load("glProgramEnvParameterI4iNV"); - glad_glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)load("glProgramEnvParameterI4ivNV"); - glad_glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)load("glProgramEnvParametersI4ivNV"); - glad_glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)load("glProgramEnvParameterI4uiNV"); - glad_glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)load("glProgramEnvParameterI4uivNV"); - glad_glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)load("glProgramEnvParametersI4uivNV"); - glad_glGetProgramLocalParameterIivNV = (PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC)load("glGetProgramLocalParameterIivNV"); - glad_glGetProgramLocalParameterIuivNV = (PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC)load("glGetProgramLocalParameterIuivNV"); - glad_glGetProgramEnvParameterIivNV = (PFNGLGETPROGRAMENVPARAMETERIIVNVPROC)load("glGetProgramEnvParameterIivNV"); - glad_glGetProgramEnvParameterIuivNV = (PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC)load("glGetProgramEnvParameterIuivNV"); -} -static void load_GL_NV_gpu_program5(GLADloadproc load) { - if(!GLAD_GL_NV_gpu_program5) return; - glad_glProgramSubroutineParametersuivNV = (PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC)load("glProgramSubroutineParametersuivNV"); - glad_glGetProgramSubroutineParameteruivNV = (PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC)load("glGetProgramSubroutineParameteruivNV"); -} -static void load_GL_ARB_geometry_shader4(GLADloadproc load) { - if(!GLAD_GL_ARB_geometry_shader4) return; - glad_glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)load("glProgramParameteriARB"); - glad_glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)load("glFramebufferTextureARB"); - glad_glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)load("glFramebufferTextureLayerARB"); - glad_glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)load("glFramebufferTextureFaceARB"); -} -static void load_GL_NV_conservative_raster(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster) return; - glad_glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)load("glSubpixelPrecisionBiasNV"); -} -static void load_GL_SGIX_sprite(GLADloadproc load) { - if(!GLAD_GL_SGIX_sprite) return; - glad_glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)load("glSpriteParameterfSGIX"); - glad_glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)load("glSpriteParameterfvSGIX"); - glad_glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)load("glSpriteParameteriSGIX"); - glad_glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)load("glSpriteParameterivSGIX"); -} -static void load_GL_ARB_get_program_binary(GLADloadproc load) { - if(!GLAD_GL_ARB_get_program_binary) return; - glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)load("glGetProgramBinary"); - glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC)load("glProgramBinary"); - glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)load("glProgramParameteri"); -} -static void load_GL_AMD_occlusion_query_event(GLADloadproc load) { - if(!GLAD_GL_AMD_occlusion_query_event) return; - glad_glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)load("glQueryObjectParameteruiAMD"); -} -static void load_GL_SGIS_multisample(GLADloadproc load) { - if(!GLAD_GL_SGIS_multisample) return; - glad_glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)load("glSampleMaskSGIS"); - glad_glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)load("glSamplePatternSGIS"); -} -static void load_GL_EXT_framebuffer_object(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_object) return; - glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); - glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); - glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); - glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); - glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); - glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); - glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); - glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); - glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); - glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); - glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); - glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); - glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); - glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); - glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); - glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); - glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); -} -static void load_GL_APPLE_vertex_array_range(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_range) return; - glad_glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)load("glVertexArrayRangeAPPLE"); - glad_glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)load("glFlushVertexArrayRangeAPPLE"); - glad_glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)load("glVertexArrayParameteriAPPLE"); -} -static void load_GL_NV_register_combiners(GLADloadproc load) { - if(!GLAD_GL_NV_register_combiners) return; - glad_glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)load("glCombinerParameterfvNV"); - glad_glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)load("glCombinerParameterfNV"); - glad_glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)load("glCombinerParameterivNV"); - glad_glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)load("glCombinerParameteriNV"); - glad_glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)load("glCombinerInputNV"); - glad_glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)load("glCombinerOutputNV"); - glad_glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)load("glFinalCombinerInputNV"); - glad_glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)load("glGetCombinerInputParameterfvNV"); - glad_glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)load("glGetCombinerInputParameterivNV"); - glad_glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)load("glGetCombinerOutputParameterfvNV"); - glad_glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)load("glGetCombinerOutputParameterivNV"); - glad_glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)load("glGetFinalCombinerInputParameterfvNV"); - glad_glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)load("glGetFinalCombinerInputParameterivNV"); +static void load_GL_AMD_debug_output(GLADloadproc load) { + if(!GLAD_GL_AMD_debug_output) return; + glad_glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)load("glDebugMessageEnableAMD"); + glad_glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)load("glDebugMessageInsertAMD"); + glad_glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)load("glDebugMessageCallbackAMD"); + glad_glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)load("glGetDebugMessageLogAMD"); } -static void load_GL_ARB_draw_buffers(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_buffers) return; - glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); +static void load_GL_ARB_ES2_compatibility(GLADloadproc load) { + if(!GLAD_GL_ARB_ES2_compatibility) return; + glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)load("glReleaseShaderCompiler"); + glad_glShaderBinary = (PFNGLSHADERBINARYPROC)load("glShaderBinary"); + glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)load("glGetShaderPrecisionFormat"); + glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC)load("glDepthRangef"); + glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC)load("glClearDepthf"); } -static void load_GL_ARB_clear_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_clear_texture) return; - glad_glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)load("glClearTexImage"); - glad_glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)load("glClearTexSubImage"); +static void load_GL_ARB_buffer_storage(GLADloadproc load) { + if(!GLAD_GL_ARB_buffer_storage) return; + glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage"); } static void load_GL_ARB_debug_output(GLADloadproc load) { if(!GLAD_GL_ARB_debug_output) return; @@ -20510,476 +4900,268 @@ static void load_GL_ARB_debug_output(GLADloadproc load) { glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); } -static void load_GL_EXT_cull_vertex(GLADloadproc load) { - if(!GLAD_GL_EXT_cull_vertex) return; - glad_glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)load("glCullParameterdvEXT"); - glad_glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)load("glCullParameterfvEXT"); -} -static void load_GL_IBM_multimode_draw_arrays(GLADloadproc load) { - if(!GLAD_GL_IBM_multimode_draw_arrays) return; - glad_glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)load("glMultiModeDrawArraysIBM"); - glad_glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)load("glMultiModeDrawElementsIBM"); -} -static void load_GL_APPLE_vertex_array_object(GLADloadproc load) { - if(!GLAD_GL_APPLE_vertex_array_object) return; - glad_glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)load("glBindVertexArrayAPPLE"); - glad_glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)load("glDeleteVertexArraysAPPLE"); - glad_glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)load("glGenVertexArraysAPPLE"); - glad_glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)load("glIsVertexArrayAPPLE"); -} -static void load_GL_SGIS_detail_texture(GLADloadproc load) { - if(!GLAD_GL_SGIS_detail_texture) return; - glad_glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)load("glDetailTexFuncSGIS"); - glad_glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)load("glGetDetailTexFuncSGIS"); -} -static void load_GL_ARB_draw_instanced(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_instanced) return; - glad_glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)load("glDrawArraysInstancedARB"); - glad_glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)load("glDrawElementsInstancedARB"); -} -static void load_GL_ARB_shading_language_include(GLADloadproc load) { - if(!GLAD_GL_ARB_shading_language_include) return; - glad_glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)load("glNamedStringARB"); - glad_glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)load("glDeleteNamedStringARB"); - glad_glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)load("glCompileShaderIncludeARB"); - glad_glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)load("glIsNamedStringARB"); - glad_glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)load("glGetNamedStringARB"); - glad_glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)load("glGetNamedStringivARB"); -} -static void load_GL_INGR_blend_func_separate(GLADloadproc load) { - if(!GLAD_GL_INGR_blend_func_separate) return; - glad_glBlendFuncSeparateINGR = (PFNGLBLENDFUNCSEPARATEINGRPROC)load("glBlendFuncSeparateINGR"); -} -static void load_GL_NV_path_rendering(GLADloadproc load) { - if(!GLAD_GL_NV_path_rendering) return; - glad_glGenPathsNV = (PFNGLGENPATHSNVPROC)load("glGenPathsNV"); - glad_glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)load("glDeletePathsNV"); - glad_glIsPathNV = (PFNGLISPATHNVPROC)load("glIsPathNV"); - glad_glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)load("glPathCommandsNV"); - glad_glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)load("glPathCoordsNV"); - glad_glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)load("glPathSubCommandsNV"); - glad_glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)load("glPathSubCoordsNV"); - glad_glPathStringNV = (PFNGLPATHSTRINGNVPROC)load("glPathStringNV"); - glad_glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)load("glPathGlyphsNV"); - glad_glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)load("glPathGlyphRangeNV"); - glad_glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)load("glWeightPathsNV"); - glad_glCopyPathNV = (PFNGLCOPYPATHNVPROC)load("glCopyPathNV"); - glad_glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)load("glInterpolatePathsNV"); - glad_glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)load("glTransformPathNV"); - glad_glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)load("glPathParameterivNV"); - glad_glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)load("glPathParameteriNV"); - glad_glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)load("glPathParameterfvNV"); - glad_glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)load("glPathParameterfNV"); - glad_glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)load("glPathDashArrayNV"); - glad_glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)load("glPathStencilFuncNV"); - glad_glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)load("glPathStencilDepthOffsetNV"); - glad_glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)load("glStencilFillPathNV"); - glad_glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)load("glStencilStrokePathNV"); - glad_glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)load("glStencilFillPathInstancedNV"); - glad_glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)load("glStencilStrokePathInstancedNV"); - glad_glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)load("glPathCoverDepthFuncNV"); - glad_glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)load("glCoverFillPathNV"); - glad_glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)load("glCoverStrokePathNV"); - glad_glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)load("glCoverFillPathInstancedNV"); - glad_glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)load("glCoverStrokePathInstancedNV"); - glad_glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)load("glGetPathParameterivNV"); - glad_glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)load("glGetPathParameterfvNV"); - glad_glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)load("glGetPathCommandsNV"); - glad_glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)load("glGetPathCoordsNV"); - glad_glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)load("glGetPathDashArrayNV"); - glad_glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)load("glGetPathMetricsNV"); - glad_glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)load("glGetPathMetricRangeNV"); - glad_glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)load("glGetPathSpacingNV"); - glad_glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)load("glIsPointInFillPathNV"); - glad_glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)load("glIsPointInStrokePathNV"); - glad_glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)load("glGetPathLengthNV"); - glad_glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)load("glPointAlongPathNV"); - glad_glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)load("glMatrixLoad3x2fNV"); - glad_glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)load("glMatrixLoad3x3fNV"); - glad_glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)load("glMatrixLoadTranspose3x3fNV"); - glad_glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)load("glMatrixMult3x2fNV"); - glad_glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)load("glMatrixMult3x3fNV"); - glad_glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)load("glMatrixMultTranspose3x3fNV"); - glad_glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)load("glStencilThenCoverFillPathNV"); - glad_glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)load("glStencilThenCoverStrokePathNV"); - glad_glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)load("glStencilThenCoverFillPathInstancedNV"); - glad_glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)load("glStencilThenCoverStrokePathInstancedNV"); - glad_glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)load("glPathGlyphIndexRangeNV"); - glad_glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)load("glPathGlyphIndexArrayNV"); - glad_glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)load("glPathMemoryGlyphIndexArrayNV"); - glad_glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)load("glProgramPathFragmentInputGenNV"); - glad_glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)load("glGetProgramResourcefvNV"); - glad_glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)load("glPathColorGenNV"); - glad_glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)load("glPathTexGenNV"); - glad_glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)load("glPathFogGenNV"); - glad_glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)load("glGetPathColorGenivNV"); - glad_glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)load("glGetPathColorGenfvNV"); - glad_glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)load("glGetPathTexGenivNV"); - glad_glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)load("glGetPathTexGenfvNV"); -} -static void load_GL_NV_conservative_raster_dilate(GLADloadproc load) { - if(!GLAD_GL_NV_conservative_raster_dilate) return; - glad_glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)load("glConservativeRasterParameterfNV"); -} -static void load_GL_ATI_vertex_streams(GLADloadproc load) { - if(!GLAD_GL_ATI_vertex_streams) return; - glad_glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)load("glVertexStream1sATI"); - glad_glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)load("glVertexStream1svATI"); - glad_glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)load("glVertexStream1iATI"); - glad_glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)load("glVertexStream1ivATI"); - glad_glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)load("glVertexStream1fATI"); - glad_glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)load("glVertexStream1fvATI"); - glad_glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)load("glVertexStream1dATI"); - glad_glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)load("glVertexStream1dvATI"); - glad_glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)load("glVertexStream2sATI"); - glad_glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)load("glVertexStream2svATI"); - glad_glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)load("glVertexStream2iATI"); - glad_glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)load("glVertexStream2ivATI"); - glad_glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)load("glVertexStream2fATI"); - glad_glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)load("glVertexStream2fvATI"); - glad_glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)load("glVertexStream2dATI"); - glad_glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)load("glVertexStream2dvATI"); - glad_glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)load("glVertexStream3sATI"); - glad_glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)load("glVertexStream3svATI"); - glad_glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)load("glVertexStream3iATI"); - glad_glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)load("glVertexStream3ivATI"); - glad_glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)load("glVertexStream3fATI"); - glad_glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)load("glVertexStream3fvATI"); - glad_glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)load("glVertexStream3dATI"); - glad_glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)load("glVertexStream3dvATI"); - glad_glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)load("glVertexStream4sATI"); - glad_glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)load("glVertexStream4svATI"); - glad_glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)load("glVertexStream4iATI"); - glad_glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)load("glVertexStream4ivATI"); - glad_glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)load("glVertexStream4fATI"); - glad_glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)load("glVertexStream4fvATI"); - glad_glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)load("glVertexStream4dATI"); - glad_glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)load("glVertexStream4dvATI"); - glad_glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)load("glNormalStream3bATI"); - glad_glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)load("glNormalStream3bvATI"); - glad_glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)load("glNormalStream3sATI"); - glad_glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)load("glNormalStream3svATI"); - glad_glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)load("glNormalStream3iATI"); - glad_glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)load("glNormalStream3ivATI"); - glad_glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)load("glNormalStream3fATI"); - glad_glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)load("glNormalStream3fvATI"); - glad_glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)load("glNormalStream3dATI"); - glad_glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)load("glNormalStream3dvATI"); - glad_glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)load("glClientActiveVertexStreamATI"); - glad_glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)load("glVertexBlendEnviATI"); - glad_glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)load("glVertexBlendEnvfATI"); -} -static void load_GL_ARB_gpu_shader_int64(GLADloadproc load) { - if(!GLAD_GL_ARB_gpu_shader_int64) return; - glad_glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)load("glUniform1i64ARB"); - glad_glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)load("glUniform2i64ARB"); - glad_glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)load("glUniform3i64ARB"); - glad_glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)load("glUniform4i64ARB"); - glad_glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)load("glUniform1i64vARB"); - glad_glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)load("glUniform2i64vARB"); - glad_glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)load("glUniform3i64vARB"); - glad_glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)load("glUniform4i64vARB"); - glad_glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)load("glUniform1ui64ARB"); - glad_glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)load("glUniform2ui64ARB"); - glad_glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)load("glUniform3ui64ARB"); - glad_glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)load("glUniform4ui64ARB"); - glad_glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)load("glUniform1ui64vARB"); - glad_glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)load("glUniform2ui64vARB"); - glad_glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)load("glUniform3ui64vARB"); - glad_glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)load("glUniform4ui64vARB"); - glad_glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)load("glGetUniformi64vARB"); - glad_glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)load("glGetUniformui64vARB"); - glad_glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)load("glGetnUniformi64vARB"); - glad_glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)load("glGetnUniformui64vARB"); - glad_glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)load("glProgramUniform1i64ARB"); - glad_glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)load("glProgramUniform2i64ARB"); - glad_glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)load("glProgramUniform3i64ARB"); - glad_glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)load("glProgramUniform4i64ARB"); - glad_glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)load("glProgramUniform1i64vARB"); - glad_glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)load("glProgramUniform2i64vARB"); - glad_glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)load("glProgramUniform3i64vARB"); - glad_glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)load("glProgramUniform4i64vARB"); - glad_glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)load("glProgramUniform1ui64ARB"); - glad_glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)load("glProgramUniform2ui64ARB"); - glad_glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)load("glProgramUniform3ui64ARB"); - glad_glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)load("glProgramUniform4ui64ARB"); - glad_glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)load("glProgramUniform1ui64vARB"); - glad_glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)load("glProgramUniform2ui64vARB"); - glad_glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)load("glProgramUniform3ui64vARB"); - glad_glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)load("glProgramUniform4ui64vARB"); -} -static void load_GL_NV_vdpau_interop(GLADloadproc load) { - if(!GLAD_GL_NV_vdpau_interop) return; - glad_glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)load("glVDPAUInitNV"); - glad_glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)load("glVDPAUFiniNV"); - glad_glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)load("glVDPAURegisterVideoSurfaceNV"); - glad_glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)load("glVDPAURegisterOutputSurfaceNV"); - glad_glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)load("glVDPAUIsSurfaceNV"); - glad_glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)load("glVDPAUUnregisterSurfaceNV"); - glad_glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)load("glVDPAUGetSurfaceivNV"); - glad_glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)load("glVDPAUSurfaceAccessNV"); - glad_glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)load("glVDPAUMapSurfacesNV"); - glad_glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)load("glVDPAUUnmapSurfacesNV"); -} -static void load_GL_ARB_internalformat_query2(GLADloadproc load) { - if(!GLAD_GL_ARB_internalformat_query2) return; - glad_glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)load("glGetInternalformati64v"); +static void load_GL_ARB_draw_buffers(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers) return; + glad_glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)load("glDrawBuffersARB"); } -static void load_GL_SUN_vertex(GLADloadproc load) { - if(!GLAD_GL_SUN_vertex) return; - glad_glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)load("glColor4ubVertex2fSUN"); - glad_glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)load("glColor4ubVertex2fvSUN"); - glad_glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)load("glColor4ubVertex3fSUN"); - glad_glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)load("glColor4ubVertex3fvSUN"); - glad_glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)load("glColor3fVertex3fSUN"); - glad_glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)load("glColor3fVertex3fvSUN"); - glad_glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)load("glNormal3fVertex3fSUN"); - glad_glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)load("glNormal3fVertex3fvSUN"); - glad_glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glColor4fNormal3fVertex3fSUN"); - glad_glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)load("glTexCoord2fVertex3fSUN"); - glad_glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)load("glTexCoord2fVertex3fvSUN"); - glad_glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)load("glTexCoord4fVertex4fSUN"); - glad_glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)load("glTexCoord4fVertex4fvSUN"); - glad_glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)load("glTexCoord2fColor4ubVertex3fSUN"); - glad_glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)load("glTexCoord2fColor4ubVertex3fvSUN"); - glad_glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)load("glTexCoord2fColor3fVertex3fSUN"); - glad_glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)load("glTexCoord2fColor3fVertex3fvSUN"); - glad_glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fNormal3fVertex3fSUN"); - glad_glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fNormal3fVertex3fvSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glTexCoord2fColor4fNormal3fVertex3fvSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fSUN"); - glad_glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)load("glTexCoord4fColor4fNormal3fVertex4fvSUN"); - glad_glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)load("glReplacementCodeuiVertex3fSUN"); - glad_glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)load("glReplacementCodeuiVertex3fvSUN"); - glad_glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)load("glReplacementCodeuiColor4ubVertex3fSUN"); - glad_glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4ubVertex3fvSUN"); - glad_glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor3fVertex3fSUN"); - glad_glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor3fVertex3fvSUN"); - glad_glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiNormal3fVertex3fSUN"); - glad_glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiColor4fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN"); - glad_glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)load("glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN"); +static void load_GL_ARB_draw_buffers_blend(GLADloadproc load) { + if(!GLAD_GL_ARB_draw_buffers_blend) return; + glad_glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)load("glBlendEquationiARB"); + glad_glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)load("glBlendEquationSeparateiARB"); + glad_glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)load("glBlendFunciARB"); + glad_glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)load("glBlendFuncSeparateiARB"); } -static void load_GL_SGIX_igloo_interface(GLADloadproc load) { - if(!GLAD_GL_SGIX_igloo_interface) return; - glad_glIglooInterfaceSGIX = (PFNGLIGLOOINTERFACESGIXPROC)load("glIglooInterfaceSGIX"); +static void load_GL_ARB_fragment_program(GLADloadproc load) { + if(!GLAD_GL_ARB_fragment_program) return; + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); } -static void load_GL_ARB_draw_indirect(GLADloadproc load) { - if(!GLAD_GL_ARB_draw_indirect) return; - glad_glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)load("glDrawArraysIndirect"); - glad_glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)load("glDrawElementsIndirect"); +static void load_GL_ARB_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_framebuffer_object) return; + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); } -static void load_GL_NV_vertex_program4(GLADloadproc load) { - if(!GLAD_GL_NV_vertex_program4) return; - glad_glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)load("glVertexAttribI1iEXT"); - glad_glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)load("glVertexAttribI2iEXT"); - glad_glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)load("glVertexAttribI3iEXT"); - glad_glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)load("glVertexAttribI4iEXT"); - glad_glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)load("glVertexAttribI1uiEXT"); - glad_glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)load("glVertexAttribI2uiEXT"); - glad_glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)load("glVertexAttribI3uiEXT"); - glad_glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)load("glVertexAttribI4uiEXT"); - glad_glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)load("glVertexAttribI1ivEXT"); - glad_glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)load("glVertexAttribI2ivEXT"); - glad_glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)load("glVertexAttribI3ivEXT"); - glad_glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)load("glVertexAttribI4ivEXT"); - glad_glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)load("glVertexAttribI1uivEXT"); - glad_glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)load("glVertexAttribI2uivEXT"); - glad_glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)load("glVertexAttribI3uivEXT"); - glad_glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)load("glVertexAttribI4uivEXT"); - glad_glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)load("glVertexAttribI4bvEXT"); - glad_glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)load("glVertexAttribI4svEXT"); - glad_glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)load("glVertexAttribI4ubvEXT"); - glad_glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)load("glVertexAttribI4usvEXT"); - glad_glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)load("glVertexAttribIPointerEXT"); - glad_glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)load("glGetVertexAttribIivEXT"); - glad_glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)load("glGetVertexAttribIuivEXT"); +static void load_GL_ARB_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_multisample) return; + glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)load("glSampleCoverageARB"); } -static void load_GL_SGIS_fog_function(GLADloadproc load) { - if(!GLAD_GL_SGIS_fog_function) return; - glad_glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)load("glFogFuncSGIS"); - glad_glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)load("glGetFogFuncSGIS"); +static void load_GL_ARB_sample_locations(GLADloadproc load) { + if(!GLAD_GL_ARB_sample_locations) return; + glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); + glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); + glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); } -static void load_GL_EXT_x11_sync_object(GLADloadproc load) { - if(!GLAD_GL_EXT_x11_sync_object) return; - glad_glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)load("glImportSyncEXT"); +static void load_GL_ARB_texture_compression(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_compression) return; + glad_glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)load("glCompressedTexImage3DARB"); + glad_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)load("glCompressedTexImage2DARB"); + glad_glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)load("glCompressedTexImage1DARB"); + glad_glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)load("glCompressedTexSubImage3DARB"); + glad_glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)load("glCompressedTexSubImage2DARB"); + glad_glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)load("glCompressedTexSubImage1DARB"); + glad_glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)load("glGetCompressedTexImageARB"); } -static void load_GL_ARB_sync(GLADloadproc load) { - if(!GLAD_GL_ARB_sync) return; - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); +static void load_GL_ARB_texture_multisample(GLADloadproc load) { + if(!GLAD_GL_ARB_texture_multisample) return; + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); } -static void load_GL_NV_sample_locations(GLADloadproc load) { - if(!GLAD_GL_NV_sample_locations) return; - glad_glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glFramebufferSampleLocationsfvNV"); - glad_glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)load("glNamedFramebufferSampleLocationsfvNV"); - glad_glResolveDepthValuesNV = (PFNGLRESOLVEDEPTHVALUESNVPROC)load("glResolveDepthValuesNV"); +static void load_GL_ARB_uniform_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_uniform_buffer_object) return; + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); } -static void load_GL_ARB_compute_variable_group_size(GLADloadproc load) { - if(!GLAD_GL_ARB_compute_variable_group_size) return; - glad_glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)load("glDispatchComputeGroupSizeARB"); +static void load_GL_ARB_vertex_array_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_array_object) return; + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); } -static void load_GL_OES_fixed_point(GLADloadproc load) { - if(!GLAD_GL_OES_fixed_point) return; - glad_glAlphaFuncxOES = (PFNGLALPHAFUNCXOESPROC)load("glAlphaFuncxOES"); - glad_glClearColorxOES = (PFNGLCLEARCOLORXOESPROC)load("glClearColorxOES"); - glad_glClearDepthxOES = (PFNGLCLEARDEPTHXOESPROC)load("glClearDepthxOES"); - glad_glClipPlanexOES = (PFNGLCLIPPLANEXOESPROC)load("glClipPlanexOES"); - glad_glColor4xOES = (PFNGLCOLOR4XOESPROC)load("glColor4xOES"); - glad_glDepthRangexOES = (PFNGLDEPTHRANGEXOESPROC)load("glDepthRangexOES"); - glad_glFogxOES = (PFNGLFOGXOESPROC)load("glFogxOES"); - glad_glFogxvOES = (PFNGLFOGXVOESPROC)load("glFogxvOES"); - glad_glFrustumxOES = (PFNGLFRUSTUMXOESPROC)load("glFrustumxOES"); - glad_glGetClipPlanexOES = (PFNGLGETCLIPPLANEXOESPROC)load("glGetClipPlanexOES"); - glad_glGetFixedvOES = (PFNGLGETFIXEDVOESPROC)load("glGetFixedvOES"); - glad_glGetTexEnvxvOES = (PFNGLGETTEXENVXVOESPROC)load("glGetTexEnvxvOES"); - glad_glGetTexParameterxvOES = (PFNGLGETTEXPARAMETERXVOESPROC)load("glGetTexParameterxvOES"); - glad_glLightModelxOES = (PFNGLLIGHTMODELXOESPROC)load("glLightModelxOES"); - glad_glLightModelxvOES = (PFNGLLIGHTMODELXVOESPROC)load("glLightModelxvOES"); - glad_glLightxOES = (PFNGLLIGHTXOESPROC)load("glLightxOES"); - glad_glLightxvOES = (PFNGLLIGHTXVOESPROC)load("glLightxvOES"); - glad_glLineWidthxOES = (PFNGLLINEWIDTHXOESPROC)load("glLineWidthxOES"); - glad_glLoadMatrixxOES = (PFNGLLOADMATRIXXOESPROC)load("glLoadMatrixxOES"); - glad_glMaterialxOES = (PFNGLMATERIALXOESPROC)load("glMaterialxOES"); - glad_glMaterialxvOES = (PFNGLMATERIALXVOESPROC)load("glMaterialxvOES"); - glad_glMultMatrixxOES = (PFNGLMULTMATRIXXOESPROC)load("glMultMatrixxOES"); - glad_glMultiTexCoord4xOES = (PFNGLMULTITEXCOORD4XOESPROC)load("glMultiTexCoord4xOES"); - glad_glNormal3xOES = (PFNGLNORMAL3XOESPROC)load("glNormal3xOES"); - glad_glOrthoxOES = (PFNGLORTHOXOESPROC)load("glOrthoxOES"); - glad_glPointParameterxvOES = (PFNGLPOINTPARAMETERXVOESPROC)load("glPointParameterxvOES"); - glad_glPointSizexOES = (PFNGLPOINTSIZEXOESPROC)load("glPointSizexOES"); - glad_glPolygonOffsetxOES = (PFNGLPOLYGONOFFSETXOESPROC)load("glPolygonOffsetxOES"); - glad_glRotatexOES = (PFNGLROTATEXOESPROC)load("glRotatexOES"); - glad_glScalexOES = (PFNGLSCALEXOESPROC)load("glScalexOES"); - glad_glTexEnvxOES = (PFNGLTEXENVXOESPROC)load("glTexEnvxOES"); - glad_glTexEnvxvOES = (PFNGLTEXENVXVOESPROC)load("glTexEnvxvOES"); - glad_glTexParameterxOES = (PFNGLTEXPARAMETERXOESPROC)load("glTexParameterxOES"); - glad_glTexParameterxvOES = (PFNGLTEXPARAMETERXVOESPROC)load("glTexParameterxvOES"); - glad_glTranslatexOES = (PFNGLTRANSLATEXOESPROC)load("glTranslatexOES"); - glad_glGetLightxvOES = (PFNGLGETLIGHTXVOESPROC)load("glGetLightxvOES"); - glad_glGetMaterialxvOES = (PFNGLGETMATERIALXVOESPROC)load("glGetMaterialxvOES"); - glad_glPointParameterxOES = (PFNGLPOINTPARAMETERXOESPROC)load("glPointParameterxOES"); - glad_glSampleCoveragexOES = (PFNGLSAMPLECOVERAGEXOESPROC)load("glSampleCoveragexOES"); - glad_glAccumxOES = (PFNGLACCUMXOESPROC)load("glAccumxOES"); - glad_glBitmapxOES = (PFNGLBITMAPXOESPROC)load("glBitmapxOES"); - glad_glBlendColorxOES = (PFNGLBLENDCOLORXOESPROC)load("glBlendColorxOES"); - glad_glClearAccumxOES = (PFNGLCLEARACCUMXOESPROC)load("glClearAccumxOES"); - glad_glColor3xOES = (PFNGLCOLOR3XOESPROC)load("glColor3xOES"); - glad_glColor3xvOES = (PFNGLCOLOR3XVOESPROC)load("glColor3xvOES"); - glad_glColor4xvOES = (PFNGLCOLOR4XVOESPROC)load("glColor4xvOES"); - glad_glConvolutionParameterxOES = (PFNGLCONVOLUTIONPARAMETERXOESPROC)load("glConvolutionParameterxOES"); - glad_glConvolutionParameterxvOES = (PFNGLCONVOLUTIONPARAMETERXVOESPROC)load("glConvolutionParameterxvOES"); - glad_glEvalCoord1xOES = (PFNGLEVALCOORD1XOESPROC)load("glEvalCoord1xOES"); - glad_glEvalCoord1xvOES = (PFNGLEVALCOORD1XVOESPROC)load("glEvalCoord1xvOES"); - glad_glEvalCoord2xOES = (PFNGLEVALCOORD2XOESPROC)load("glEvalCoord2xOES"); - glad_glEvalCoord2xvOES = (PFNGLEVALCOORD2XVOESPROC)load("glEvalCoord2xvOES"); - glad_glFeedbackBufferxOES = (PFNGLFEEDBACKBUFFERXOESPROC)load("glFeedbackBufferxOES"); - glad_glGetConvolutionParameterxvOES = (PFNGLGETCONVOLUTIONPARAMETERXVOESPROC)load("glGetConvolutionParameterxvOES"); - glad_glGetHistogramParameterxvOES = (PFNGLGETHISTOGRAMPARAMETERXVOESPROC)load("glGetHistogramParameterxvOES"); - glad_glGetLightxOES = (PFNGLGETLIGHTXOESPROC)load("glGetLightxOES"); - glad_glGetMapxvOES = (PFNGLGETMAPXVOESPROC)load("glGetMapxvOES"); - glad_glGetMaterialxOES = (PFNGLGETMATERIALXOESPROC)load("glGetMaterialxOES"); - glad_glGetPixelMapxv = (PFNGLGETPIXELMAPXVPROC)load("glGetPixelMapxv"); - glad_glGetTexGenxvOES = (PFNGLGETTEXGENXVOESPROC)load("glGetTexGenxvOES"); - glad_glGetTexLevelParameterxvOES = (PFNGLGETTEXLEVELPARAMETERXVOESPROC)load("glGetTexLevelParameterxvOES"); - glad_glIndexxOES = (PFNGLINDEXXOESPROC)load("glIndexxOES"); - glad_glIndexxvOES = (PFNGLINDEXXVOESPROC)load("glIndexxvOES"); - glad_glLoadTransposeMatrixxOES = (PFNGLLOADTRANSPOSEMATRIXXOESPROC)load("glLoadTransposeMatrixxOES"); - glad_glMap1xOES = (PFNGLMAP1XOESPROC)load("glMap1xOES"); - glad_glMap2xOES = (PFNGLMAP2XOESPROC)load("glMap2xOES"); - glad_glMapGrid1xOES = (PFNGLMAPGRID1XOESPROC)load("glMapGrid1xOES"); - glad_glMapGrid2xOES = (PFNGLMAPGRID2XOESPROC)load("glMapGrid2xOES"); - glad_glMultTransposeMatrixxOES = (PFNGLMULTTRANSPOSEMATRIXXOESPROC)load("glMultTransposeMatrixxOES"); - glad_glMultiTexCoord1xOES = (PFNGLMULTITEXCOORD1XOESPROC)load("glMultiTexCoord1xOES"); - glad_glMultiTexCoord1xvOES = (PFNGLMULTITEXCOORD1XVOESPROC)load("glMultiTexCoord1xvOES"); - glad_glMultiTexCoord2xOES = (PFNGLMULTITEXCOORD2XOESPROC)load("glMultiTexCoord2xOES"); - glad_glMultiTexCoord2xvOES = (PFNGLMULTITEXCOORD2XVOESPROC)load("glMultiTexCoord2xvOES"); - glad_glMultiTexCoord3xOES = (PFNGLMULTITEXCOORD3XOESPROC)load("glMultiTexCoord3xOES"); - glad_glMultiTexCoord3xvOES = (PFNGLMULTITEXCOORD3XVOESPROC)load("glMultiTexCoord3xvOES"); - glad_glMultiTexCoord4xvOES = (PFNGLMULTITEXCOORD4XVOESPROC)load("glMultiTexCoord4xvOES"); - glad_glNormal3xvOES = (PFNGLNORMAL3XVOESPROC)load("glNormal3xvOES"); - glad_glPassThroughxOES = (PFNGLPASSTHROUGHXOESPROC)load("glPassThroughxOES"); - glad_glPixelMapx = (PFNGLPIXELMAPXPROC)load("glPixelMapx"); - glad_glPixelStorex = (PFNGLPIXELSTOREXPROC)load("glPixelStorex"); - glad_glPixelTransferxOES = (PFNGLPIXELTRANSFERXOESPROC)load("glPixelTransferxOES"); - glad_glPixelZoomxOES = (PFNGLPIXELZOOMXOESPROC)load("glPixelZoomxOES"); - glad_glPrioritizeTexturesxOES = (PFNGLPRIORITIZETEXTURESXOESPROC)load("glPrioritizeTexturesxOES"); - glad_glRasterPos2xOES = (PFNGLRASTERPOS2XOESPROC)load("glRasterPos2xOES"); - glad_glRasterPos2xvOES = (PFNGLRASTERPOS2XVOESPROC)load("glRasterPos2xvOES"); - glad_glRasterPos3xOES = (PFNGLRASTERPOS3XOESPROC)load("glRasterPos3xOES"); - glad_glRasterPos3xvOES = (PFNGLRASTERPOS3XVOESPROC)load("glRasterPos3xvOES"); - glad_glRasterPos4xOES = (PFNGLRASTERPOS4XOESPROC)load("glRasterPos4xOES"); - glad_glRasterPos4xvOES = (PFNGLRASTERPOS4XVOESPROC)load("glRasterPos4xvOES"); - glad_glRectxOES = (PFNGLRECTXOESPROC)load("glRectxOES"); - glad_glRectxvOES = (PFNGLRECTXVOESPROC)load("glRectxvOES"); - glad_glTexCoord1xOES = (PFNGLTEXCOORD1XOESPROC)load("glTexCoord1xOES"); - glad_glTexCoord1xvOES = (PFNGLTEXCOORD1XVOESPROC)load("glTexCoord1xvOES"); - glad_glTexCoord2xOES = (PFNGLTEXCOORD2XOESPROC)load("glTexCoord2xOES"); - glad_glTexCoord2xvOES = (PFNGLTEXCOORD2XVOESPROC)load("glTexCoord2xvOES"); - glad_glTexCoord3xOES = (PFNGLTEXCOORD3XOESPROC)load("glTexCoord3xOES"); - glad_glTexCoord3xvOES = (PFNGLTEXCOORD3XVOESPROC)load("glTexCoord3xvOES"); - glad_glTexCoord4xOES = (PFNGLTEXCOORD4XOESPROC)load("glTexCoord4xOES"); - glad_glTexCoord4xvOES = (PFNGLTEXCOORD4XVOESPROC)load("glTexCoord4xvOES"); - glad_glTexGenxOES = (PFNGLTEXGENXOESPROC)load("glTexGenxOES"); - glad_glTexGenxvOES = (PFNGLTEXGENXVOESPROC)load("glTexGenxvOES"); - glad_glVertex2xOES = (PFNGLVERTEX2XOESPROC)load("glVertex2xOES"); - glad_glVertex2xvOES = (PFNGLVERTEX2XVOESPROC)load("glVertex2xvOES"); - glad_glVertex3xOES = (PFNGLVERTEX3XOESPROC)load("glVertex3xOES"); - glad_glVertex3xvOES = (PFNGLVERTEX3XVOESPROC)load("glVertex3xvOES"); - glad_glVertex4xOES = (PFNGLVERTEX4XOESPROC)load("glVertex4xOES"); - glad_glVertex4xvOES = (PFNGLVERTEX4XVOESPROC)load("glVertex4xvOES"); +static void load_GL_ARB_vertex_attrib_binding(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_attrib_binding) return; + glad_glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)load("glBindVertexBuffer"); + glad_glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)load("glVertexAttribFormat"); + glad_glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)load("glVertexAttribIFormat"); + glad_glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)load("glVertexAttribLFormat"); + glad_glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)load("glVertexAttribBinding"); + glad_glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)load("glVertexBindingDivisor"); } -static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_framebuffer_multisample) return; - glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); +static void load_GL_ARB_vertex_buffer_object(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_buffer_object) return; + glad_glBindBufferARB = (PFNGLBINDBUFFERARBPROC)load("glBindBufferARB"); + glad_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)load("glDeleteBuffersARB"); + glad_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)load("glGenBuffersARB"); + glad_glIsBufferARB = (PFNGLISBUFFERARBPROC)load("glIsBufferARB"); + glad_glBufferDataARB = (PFNGLBUFFERDATAARBPROC)load("glBufferDataARB"); + glad_glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)load("glBufferSubDataARB"); + glad_glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)load("glGetBufferSubDataARB"); + glad_glMapBufferARB = (PFNGLMAPBUFFERARBPROC)load("glMapBufferARB"); + glad_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)load("glUnmapBufferARB"); + glad_glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)load("glGetBufferParameterivARB"); + glad_glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)load("glGetBufferPointervARB"); } -static void load_GL_SGIS_texture4D(GLADloadproc load) { - if(!GLAD_GL_SGIS_texture4D) return; - glad_glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)load("glTexImage4DSGIS"); - glad_glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)load("glTexSubImage4DSGIS"); +static void load_GL_ARB_vertex_program(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_program) return; + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)load("glProgramStringARB"); + glad_glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)load("glBindProgramARB"); + glad_glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)load("glDeleteProgramsARB"); + glad_glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)load("glGenProgramsARB"); + glad_glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)load("glProgramEnvParameter4dARB"); + glad_glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)load("glProgramEnvParameter4dvARB"); + glad_glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)load("glProgramEnvParameter4fARB"); + glad_glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)load("glProgramEnvParameter4fvARB"); + glad_glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)load("glProgramLocalParameter4dARB"); + glad_glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)load("glProgramLocalParameter4dvARB"); + glad_glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)load("glProgramLocalParameter4fARB"); + glad_glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)load("glProgramLocalParameter4fvARB"); + glad_glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)load("glGetProgramEnvParameterdvARB"); + glad_glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)load("glGetProgramEnvParameterfvARB"); + glad_glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)load("glGetProgramLocalParameterdvARB"); + glad_glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)load("glGetProgramLocalParameterfvARB"); + glad_glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)load("glGetProgramivARB"); + glad_glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)load("glGetProgramStringARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); + glad_glIsProgramARB = (PFNGLISPROGRAMARBPROC)load("glIsProgramARB"); } -static void load_GL_EXT_texture3D(GLADloadproc load) { - if(!GLAD_GL_EXT_texture3D) return; - glad_glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)load("glTexImage3DEXT"); - glad_glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)load("glTexSubImage3DEXT"); +static void load_GL_ARB_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_ARB_vertex_shader) return; + glad_glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)load("glVertexAttrib1fARB"); + glad_glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)load("glVertexAttrib1sARB"); + glad_glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)load("glVertexAttrib1dARB"); + glad_glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)load("glVertexAttrib2fARB"); + glad_glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)load("glVertexAttrib2sARB"); + glad_glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)load("glVertexAttrib2dARB"); + glad_glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)load("glVertexAttrib3fARB"); + glad_glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)load("glVertexAttrib3sARB"); + glad_glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)load("glVertexAttrib3dARB"); + glad_glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)load("glVertexAttrib4fARB"); + glad_glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)load("glVertexAttrib4sARB"); + glad_glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)load("glVertexAttrib4dARB"); + glad_glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)load("glVertexAttrib4NubARB"); + glad_glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)load("glVertexAttrib1fvARB"); + glad_glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)load("glVertexAttrib1svARB"); + glad_glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)load("glVertexAttrib1dvARB"); + glad_glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)load("glVertexAttrib2fvARB"); + glad_glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)load("glVertexAttrib2svARB"); + glad_glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)load("glVertexAttrib2dvARB"); + glad_glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)load("glVertexAttrib3fvARB"); + glad_glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)load("glVertexAttrib3svARB"); + glad_glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)load("glVertexAttrib3dvARB"); + glad_glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)load("glVertexAttrib4fvARB"); + glad_glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)load("glVertexAttrib4svARB"); + glad_glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)load("glVertexAttrib4dvARB"); + glad_glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)load("glVertexAttrib4ivARB"); + glad_glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)load("glVertexAttrib4bvARB"); + glad_glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)load("glVertexAttrib4ubvARB"); + glad_glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)load("glVertexAttrib4usvARB"); + glad_glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)load("glVertexAttrib4uivARB"); + glad_glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)load("glVertexAttrib4NbvARB"); + glad_glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)load("glVertexAttrib4NsvARB"); + glad_glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)load("glVertexAttrib4NivARB"); + glad_glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)load("glVertexAttrib4NubvARB"); + glad_glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)load("glVertexAttrib4NusvARB"); + glad_glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)load("glVertexAttrib4NuivARB"); + glad_glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)load("glVertexAttribPointerARB"); + glad_glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)load("glEnableVertexAttribArrayARB"); + glad_glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)load("glDisableVertexAttribArrayARB"); + glad_glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)load("glBindAttribLocationARB"); + glad_glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)load("glGetActiveAttribARB"); + glad_glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)load("glGetAttribLocationARB"); + glad_glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)load("glGetVertexAttribdvARB"); + glad_glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)load("glGetVertexAttribfvARB"); + glad_glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)load("glGetVertexAttribivARB"); + glad_glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)load("glGetVertexAttribPointervARB"); } -static void load_GL_EXT_multisample(GLADloadproc load) { - if(!GLAD_GL_EXT_multisample) return; - glad_glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)load("glSampleMaskEXT"); - glad_glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)load("glSamplePatternEXT"); +static void load_GL_ATI_element_array(GLADloadproc load) { + if(!GLAD_GL_ATI_element_array) return; + glad_glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)load("glElementPointerATI"); + glad_glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)load("glDrawElementArrayATI"); + glad_glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)load("glDrawRangeElementArrayATI"); } -static void load_GL_EXT_secondary_color(GLADloadproc load) { - if(!GLAD_GL_EXT_secondary_color) return; - glad_glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)load("glSecondaryColor3bEXT"); - glad_glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)load("glSecondaryColor3bvEXT"); - glad_glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)load("glSecondaryColor3dEXT"); - glad_glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)load("glSecondaryColor3dvEXT"); - glad_glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)load("glSecondaryColor3fEXT"); - glad_glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)load("glSecondaryColor3fvEXT"); - glad_glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)load("glSecondaryColor3iEXT"); - glad_glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)load("glSecondaryColor3ivEXT"); - glad_glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)load("glSecondaryColor3sEXT"); - glad_glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)load("glSecondaryColor3svEXT"); - glad_glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)load("glSecondaryColor3ubEXT"); - glad_glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)load("glSecondaryColor3ubvEXT"); - glad_glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)load("glSecondaryColor3uiEXT"); - glad_glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)load("glSecondaryColor3uivEXT"); - glad_glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)load("glSecondaryColor3usEXT"); - glad_glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)load("glSecondaryColor3usvEXT"); - glad_glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)load("glSecondaryColorPointerEXT"); +static void load_GL_ATI_fragment_shader(GLADloadproc load) { + if(!GLAD_GL_ATI_fragment_shader) return; + glad_glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)load("glGenFragmentShadersATI"); + glad_glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)load("glBindFragmentShaderATI"); + glad_glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)load("glDeleteFragmentShaderATI"); + glad_glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)load("glBeginFragmentShaderATI"); + glad_glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)load("glEndFragmentShaderATI"); + glad_glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)load("glPassTexCoordATI"); + glad_glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)load("glSampleMapATI"); + glad_glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)load("glColorFragmentOp1ATI"); + glad_glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)load("glColorFragmentOp2ATI"); + glad_glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)load("glColorFragmentOp3ATI"); + glad_glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)load("glAlphaFragmentOp1ATI"); + glad_glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)load("glAlphaFragmentOp2ATI"); + glad_glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)load("glAlphaFragmentOp3ATI"); + glad_glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)load("glSetFragmentShaderConstantATI"); } static void load_GL_ATI_vertex_array_object(GLADloadproc load) { if(!GLAD_GL_ATI_vertex_array_object) return; @@ -20996,573 +5178,156 @@ static void load_GL_ATI_vertex_array_object(GLADloadproc load) { glad_glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)load("glGetVariantArrayObjectfvATI"); glad_glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)load("glGetVariantArrayObjectivATI"); } -static void load_GL_ARB_parallel_shader_compile(GLADloadproc load) { - if(!GLAD_GL_ARB_parallel_shader_compile) return; - glad_glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)load("glMaxShaderCompilerThreadsARB"); +static void load_GL_EXT_blend_color(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_color) return; + glad_glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)load("glBlendColorEXT"); } -static void load_GL_ARB_sparse_texture(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_texture) return; - glad_glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)load("glTexPageCommitmentARB"); +static void load_GL_EXT_blend_equation_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_equation_separate) return; + glad_glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)load("glBlendEquationSeparateEXT"); } -static void load_GL_ARB_sample_locations(GLADloadproc load) { - if(!GLAD_GL_ARB_sample_locations) return; - glad_glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glFramebufferSampleLocationsfvARB"); - glad_glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)load("glNamedFramebufferSampleLocationsfvARB"); - glad_glEvaluateDepthValuesARB = (PFNGLEVALUATEDEPTHVALUESARBPROC)load("glEvaluateDepthValuesARB"); +static void load_GL_EXT_blend_func_separate(GLADloadproc load) { + if(!GLAD_GL_EXT_blend_func_separate) return; + glad_glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)load("glBlendFuncSeparateEXT"); +} +static void load_GL_EXT_framebuffer_blit(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_blit) return; + glad_glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)load("glBlitFramebufferEXT"); +} +static void load_GL_EXT_framebuffer_multisample(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_multisample) return; + glad_glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)load("glRenderbufferStorageMultisampleEXT"); +} +static void load_GL_EXT_framebuffer_object(GLADloadproc load) { + if(!GLAD_GL_EXT_framebuffer_object) return; + glad_glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)load("glIsRenderbufferEXT"); + glad_glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)load("glBindRenderbufferEXT"); + glad_glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)load("glDeleteRenderbuffersEXT"); + glad_glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)load("glGenRenderbuffersEXT"); + glad_glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)load("glRenderbufferStorageEXT"); + glad_glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)load("glGetRenderbufferParameterivEXT"); + glad_glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)load("glIsFramebufferEXT"); + glad_glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)load("glBindFramebufferEXT"); + glad_glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)load("glDeleteFramebuffersEXT"); + glad_glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)load("glGenFramebuffersEXT"); + glad_glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)load("glCheckFramebufferStatusEXT"); + glad_glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)load("glFramebufferTexture1DEXT"); + glad_glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)load("glFramebufferTexture2DEXT"); + glad_glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)load("glFramebufferTexture3DEXT"); + glad_glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)load("glFramebufferRenderbufferEXT"); + glad_glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)load("glGetFramebufferAttachmentParameterivEXT"); + glad_glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)load("glGenerateMipmapEXT"); } -static void load_GL_ARB_sparse_buffer(GLADloadproc load) { - if(!GLAD_GL_ARB_sparse_buffer) return; - glad_glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)load("glBufferPageCommitmentARB"); - glad_glNamedBufferPageCommitmentEXT = (PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC)load("glNamedBufferPageCommitmentEXT"); - glad_glNamedBufferPageCommitmentARB = (PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC)load("glNamedBufferPageCommitmentARB"); +static void load_GL_EXT_vertex_array(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_array) return; + glad_glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)load("glArrayElementEXT"); + glad_glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)load("glColorPointerEXT"); + glad_glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)load("glDrawArraysEXT"); + glad_glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)load("glEdgeFlagPointerEXT"); + glad_glGetPointervEXT = (PFNGLGETPOINTERVEXTPROC)load("glGetPointervEXT"); + glad_glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)load("glIndexPointerEXT"); + glad_glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)load("glNormalPointerEXT"); + glad_glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)load("glTexCoordPointerEXT"); + glad_glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)load("glVertexPointerEXT"); } -static void load_GL_EXT_draw_range_elements(GLADloadproc load) { - if(!GLAD_GL_EXT_draw_range_elements) return; - glad_glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)load("glDrawRangeElementsEXT"); +static void load_GL_EXT_vertex_shader(GLADloadproc load) { + if(!GLAD_GL_EXT_vertex_shader) return; + glad_glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)load("glBeginVertexShaderEXT"); + glad_glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)load("glEndVertexShaderEXT"); + glad_glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)load("glBindVertexShaderEXT"); + glad_glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)load("glGenVertexShadersEXT"); + glad_glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)load("glDeleteVertexShaderEXT"); + glad_glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)load("glShaderOp1EXT"); + glad_glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)load("glShaderOp2EXT"); + glad_glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)load("glShaderOp3EXT"); + glad_glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)load("glSwizzleEXT"); + glad_glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)load("glWriteMaskEXT"); + glad_glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)load("glInsertComponentEXT"); + glad_glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)load("glExtractComponentEXT"); + glad_glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)load("glGenSymbolsEXT"); + glad_glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)load("glSetInvariantEXT"); + glad_glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)load("glSetLocalConstantEXT"); + glad_glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)load("glVariantbvEXT"); + glad_glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)load("glVariantsvEXT"); + glad_glVariantivEXT = (PFNGLVARIANTIVEXTPROC)load("glVariantivEXT"); + glad_glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)load("glVariantfvEXT"); + glad_glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)load("glVariantdvEXT"); + glad_glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)load("glVariantubvEXT"); + glad_glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)load("glVariantusvEXT"); + glad_glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)load("glVariantuivEXT"); + glad_glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)load("glVariantPointerEXT"); + glad_glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)load("glEnableVariantClientStateEXT"); + glad_glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)load("glDisableVariantClientStateEXT"); + glad_glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)load("glBindLightParameterEXT"); + glad_glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)load("glBindMaterialParameterEXT"); + glad_glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)load("glBindTexGenParameterEXT"); + glad_glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)load("glBindTextureUnitParameterEXT"); + glad_glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)load("glBindParameterEXT"); + glad_glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)load("glIsVariantEnabledEXT"); + glad_glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)load("glGetVariantBooleanvEXT"); + glad_glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)load("glGetVariantIntegervEXT"); + glad_glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)load("glGetVariantFloatvEXT"); + glad_glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)load("glGetVariantPointervEXT"); + glad_glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)load("glGetInvariantBooleanvEXT"); + glad_glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)load("glGetInvariantIntegervEXT"); + glad_glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)load("glGetInvariantFloatvEXT"); + glad_glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)load("glGetLocalConstantBooleanvEXT"); + glad_glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)load("glGetLocalConstantIntegervEXT"); + glad_glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)load("glGetLocalConstantFloatvEXT"); } static int find_extensionsGL(void) { if (!get_exts()) return 0; - GLAD_GL_SGIX_pixel_tiles = has_ext("GL_SGIX_pixel_tiles"); - GLAD_GL_EXT_post_depth_coverage = has_ext("GL_EXT_post_depth_coverage"); - GLAD_GL_APPLE_element_array = has_ext("GL_APPLE_element_array"); - GLAD_GL_AMD_multi_draw_indirect = has_ext("GL_AMD_multi_draw_indirect"); - GLAD_GL_EXT_blend_subtract = has_ext("GL_EXT_blend_subtract"); - GLAD_GL_SGIX_tag_sample_buffer = has_ext("GL_SGIX_tag_sample_buffer"); - GLAD_GL_NV_point_sprite = has_ext("GL_NV_point_sprite"); - GLAD_GL_IBM_texture_mirrored_repeat = has_ext("GL_IBM_texture_mirrored_repeat"); - GLAD_GL_APPLE_transform_hint = has_ext("GL_APPLE_transform_hint"); - GLAD_GL_ATI_separate_stencil = has_ext("GL_ATI_separate_stencil"); - GLAD_GL_NV_shader_atomic_int64 = has_ext("GL_NV_shader_atomic_int64"); - GLAD_GL_NV_vertex_program2_option = has_ext("GL_NV_vertex_program2_option"); - GLAD_GL_EXT_texture_buffer_object = has_ext("GL_EXT_texture_buffer_object"); - GLAD_GL_ARB_vertex_blend = has_ext("GL_ARB_vertex_blend"); - GLAD_GL_OVR_multiview = has_ext("GL_OVR_multiview"); - GLAD_GL_NV_vertex_program2 = has_ext("GL_NV_vertex_program2"); - GLAD_GL_ARB_program_interface_query = has_ext("GL_ARB_program_interface_query"); - GLAD_GL_EXT_misc_attribute = has_ext("GL_EXT_misc_attribute"); - GLAD_GL_NV_multisample_coverage = has_ext("GL_NV_multisample_coverage"); - GLAD_GL_ARB_shading_language_packing = has_ext("GL_ARB_shading_language_packing"); - GLAD_GL_EXT_texture_cube_map = has_ext("GL_EXT_texture_cube_map"); - GLAD_GL_NV_viewport_array2 = has_ext("GL_NV_viewport_array2"); - GLAD_GL_ARB_texture_stencil8 = has_ext("GL_ARB_texture_stencil8"); - GLAD_GL_EXT_index_func = has_ext("GL_EXT_index_func"); - GLAD_GL_OES_compressed_paletted_texture = has_ext("GL_OES_compressed_paletted_texture"); - GLAD_GL_NV_depth_clamp = has_ext("GL_NV_depth_clamp"); - GLAD_GL_NV_shader_buffer_load = has_ext("GL_NV_shader_buffer_load"); - GLAD_GL_EXT_color_subtable = has_ext("GL_EXT_color_subtable"); - GLAD_GL_SUNX_constant_data = has_ext("GL_SUNX_constant_data"); - GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); - GLAD_GL_EXT_multi_draw_arrays = has_ext("GL_EXT_multi_draw_arrays"); - GLAD_GL_ARB_shader_atomic_counters = has_ext("GL_ARB_shader_atomic_counters"); - GLAD_GL_ARB_arrays_of_arrays = has_ext("GL_ARB_arrays_of_arrays"); - GLAD_GL_NV_conditional_render = has_ext("GL_NV_conditional_render"); - GLAD_GL_EXT_texture_env_combine = has_ext("GL_EXT_texture_env_combine"); - GLAD_GL_NV_fog_distance = has_ext("GL_NV_fog_distance"); - GLAD_GL_SGIX_async_histogram = has_ext("GL_SGIX_async_histogram"); - GLAD_GL_MESA_resize_buffers = has_ext("GL_MESA_resize_buffers"); - GLAD_GL_NV_light_max_exponent = has_ext("GL_NV_light_max_exponent"); - GLAD_GL_NV_texture_env_combine4 = has_ext("GL_NV_texture_env_combine4"); - GLAD_GL_ARB_texture_view = has_ext("GL_ARB_texture_view"); - GLAD_GL_ARB_texture_env_combine = has_ext("GL_ARB_texture_env_combine"); - GLAD_GL_ARB_map_buffer_range = has_ext("GL_ARB_map_buffer_range"); - GLAD_GL_EXT_convolution = has_ext("GL_EXT_convolution"); - GLAD_GL_NV_compute_program5 = has_ext("GL_NV_compute_program5"); - GLAD_GL_NV_vertex_attrib_integer_64bit = has_ext("GL_NV_vertex_attrib_integer_64bit"); - GLAD_GL_EXT_paletted_texture = has_ext("GL_EXT_paletted_texture"); - GLAD_GL_ARB_texture_buffer_object = has_ext("GL_ARB_texture_buffer_object"); - GLAD_GL_ATI_pn_triangles = has_ext("GL_ATI_pn_triangles"); - GLAD_GL_SGIX_resample = has_ext("GL_SGIX_resample"); - GLAD_GL_SGIX_flush_raster = has_ext("GL_SGIX_flush_raster"); - GLAD_GL_EXT_light_texture = has_ext("GL_EXT_light_texture"); - GLAD_GL_ARB_point_sprite = has_ext("GL_ARB_point_sprite"); - GLAD_GL_SUN_convolution_border_modes = has_ext("GL_SUN_convolution_border_modes"); - GLAD_GL_NV_parameter_buffer_object2 = has_ext("GL_NV_parameter_buffer_object2"); - GLAD_GL_ARB_half_float_pixel = has_ext("GL_ARB_half_float_pixel"); - GLAD_GL_NV_tessellation_program5 = has_ext("GL_NV_tessellation_program5"); - GLAD_GL_REND_screen_coordinates = has_ext("GL_REND_screen_coordinates"); - GLAD_GL_HP_image_transform = has_ext("GL_HP_image_transform"); - GLAD_GL_EXT_packed_float = has_ext("GL_EXT_packed_float"); - GLAD_GL_OML_subsample = has_ext("GL_OML_subsample"); - GLAD_GL_SGIX_vertex_preclip = has_ext("GL_SGIX_vertex_preclip"); - GLAD_GL_SGIX_texture_scale_bias = has_ext("GL_SGIX_texture_scale_bias"); - GLAD_GL_AMD_draw_buffers_blend = has_ext("GL_AMD_draw_buffers_blend"); - GLAD_GL_APPLE_texture_range = has_ext("GL_APPLE_texture_range"); - GLAD_GL_EXT_texture_array = has_ext("GL_EXT_texture_array"); - GLAD_GL_NV_texture_barrier = has_ext("GL_NV_texture_barrier"); - GLAD_GL_ARB_texture_query_levels = has_ext("GL_ARB_texture_query_levels"); - GLAD_GL_NV_texgen_emboss = has_ext("GL_NV_texgen_emboss"); - GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); - GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); - GLAD_GL_ARB_vertex_type_2_10_10_10_rev = has_ext("GL_ARB_vertex_type_2_10_10_10_rev"); - GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); - GLAD_GL_3DFX_tbuffer = has_ext("GL_3DFX_tbuffer"); - GLAD_GL_GREMEDY_frame_terminator = has_ext("GL_GREMEDY_frame_terminator"); - GLAD_GL_ARB_blend_func_extended = has_ext("GL_ARB_blend_func_extended"); - GLAD_GL_EXT_separate_shader_objects = has_ext("GL_EXT_separate_shader_objects"); - GLAD_GL_NV_texture_multisample = has_ext("GL_NV_texture_multisample"); - GLAD_GL_ARB_shader_objects = has_ext("GL_ARB_shader_objects"); - GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); - GLAD_GL_ATI_envmap_bumpmap = has_ext("GL_ATI_envmap_bumpmap"); - GLAD_GL_ARB_robust_buffer_access_behavior = has_ext("GL_ARB_robust_buffer_access_behavior"); - GLAD_GL_ARB_shader_stencil_export = has_ext("GL_ARB_shader_stencil_export"); - GLAD_GL_NV_texture_rectangle = has_ext("GL_NV_texture_rectangle"); - GLAD_GL_ARB_enhanced_layouts = has_ext("GL_ARB_enhanced_layouts"); - GLAD_GL_ARB_texture_rectangle = has_ext("GL_ARB_texture_rectangle"); - GLAD_GL_SGI_texture_color_table = has_ext("GL_SGI_texture_color_table"); - GLAD_GL_ATI_map_object_buffer = has_ext("GL_ATI_map_object_buffer"); - GLAD_GL_ARB_robustness = has_ext("GL_ARB_robustness"); - GLAD_GL_NV_pixel_data_range = has_ext("GL_NV_pixel_data_range"); - GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); - GLAD_GL_ARB_gpu_shader_fp64 = has_ext("GL_ARB_gpu_shader_fp64"); - GLAD_GL_NV_command_list = has_ext("GL_NV_command_list"); - GLAD_GL_SGIX_depth_texture = has_ext("GL_SGIX_depth_texture"); - GLAD_GL_EXT_vertex_weighting = has_ext("GL_EXT_vertex_weighting"); - GLAD_GL_GREMEDY_string_marker = has_ext("GL_GREMEDY_string_marker"); - GLAD_GL_ARB_texture_compression_bptc = has_ext("GL_ARB_texture_compression_bptc"); - GLAD_GL_EXT_subtexture = has_ext("GL_EXT_subtexture"); - GLAD_GL_EXT_pixel_transform_color_table = has_ext("GL_EXT_pixel_transform_color_table"); - GLAD_GL_EXT_texture_compression_rgtc = has_ext("GL_EXT_texture_compression_rgtc"); - GLAD_GL_ARB_shader_atomic_counter_ops = has_ext("GL_ARB_shader_atomic_counter_ops"); - GLAD_GL_SGIX_depth_pass_instrument = has_ext("GL_SGIX_depth_pass_instrument"); - GLAD_GL_EXT_gpu_program_parameters = has_ext("GL_EXT_gpu_program_parameters"); - GLAD_GL_NV_evaluators = has_ext("GL_NV_evaluators"); - GLAD_GL_SGIS_texture_filter4 = has_ext("GL_SGIS_texture_filter4"); - GLAD_GL_AMD_performance_monitor = has_ext("GL_AMD_performance_monitor"); - GLAD_GL_NV_geometry_shader4 = has_ext("GL_NV_geometry_shader4"); - GLAD_GL_EXT_stencil_clear_tag = has_ext("GL_EXT_stencil_clear_tag"); - GLAD_GL_NV_vertex_program1_1 = has_ext("GL_NV_vertex_program1_1"); - GLAD_GL_NV_present_video = has_ext("GL_NV_present_video"); - GLAD_GL_ARB_texture_compression_rgtc = has_ext("GL_ARB_texture_compression_rgtc"); - GLAD_GL_HP_convolution_border_modes = has_ext("GL_HP_convolution_border_modes"); - GLAD_GL_EXT_shader_integer_mix = has_ext("GL_EXT_shader_integer_mix"); - GLAD_GL_SGIX_framezoom = has_ext("GL_SGIX_framezoom"); - GLAD_GL_ARB_stencil_texturing = has_ext("GL_ARB_stencil_texturing"); - GLAD_GL_ARB_shader_clock = has_ext("GL_ARB_shader_clock"); - GLAD_GL_NV_shader_atomic_fp16_vector = has_ext("GL_NV_shader_atomic_fp16_vector"); - GLAD_GL_SGIX_fog_offset = has_ext("GL_SGIX_fog_offset"); - GLAD_GL_ARB_draw_elements_base_vertex = has_ext("GL_ARB_draw_elements_base_vertex"); - GLAD_GL_INGR_interlace_read = has_ext("GL_INGR_interlace_read"); - GLAD_GL_NV_transform_feedback = has_ext("GL_NV_transform_feedback"); - GLAD_GL_NV_fragment_program = has_ext("GL_NV_fragment_program"); - GLAD_GL_AMD_stencil_operation_extended = has_ext("GL_AMD_stencil_operation_extended"); - GLAD_GL_ARB_seamless_cubemap_per_texture = has_ext("GL_ARB_seamless_cubemap_per_texture"); - GLAD_GL_ARB_instanced_arrays = has_ext("GL_ARB_instanced_arrays"); - GLAD_GL_EXT_polygon_offset = has_ext("GL_EXT_polygon_offset"); - GLAD_GL_NV_vertex_array_range2 = has_ext("GL_NV_vertex_array_range2"); - GLAD_GL_KHR_robustness = has_ext("GL_KHR_robustness"); - GLAD_GL_AMD_sparse_texture = has_ext("GL_AMD_sparse_texture"); - GLAD_GL_ARB_clip_control = has_ext("GL_ARB_clip_control"); - GLAD_GL_NV_fragment_coverage_to_color = has_ext("GL_NV_fragment_coverage_to_color"); - GLAD_GL_NV_fence = has_ext("GL_NV_fence"); - GLAD_GL_ARB_texture_buffer_range = has_ext("GL_ARB_texture_buffer_range"); - GLAD_GL_SUN_mesh_array = has_ext("GL_SUN_mesh_array"); - GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); - GLAD_GL_ARB_framebuffer_no_attachments = has_ext("GL_ARB_framebuffer_no_attachments"); - GLAD_GL_ARB_cl_event = has_ext("GL_ARB_cl_event"); - GLAD_GL_ARB_derivative_control = has_ext("GL_ARB_derivative_control"); - GLAD_GL_NV_packed_depth_stencil = has_ext("GL_NV_packed_depth_stencil"); - GLAD_GL_OES_single_precision = has_ext("GL_OES_single_precision"); - GLAD_GL_NV_primitive_restart = has_ext("GL_NV_primitive_restart"); - GLAD_GL_SUN_global_alpha = has_ext("GL_SUN_global_alpha"); - GLAD_GL_ARB_fragment_shader_interlock = has_ext("GL_ARB_fragment_shader_interlock"); - GLAD_GL_EXT_texture_object = has_ext("GL_EXT_texture_object"); - GLAD_GL_AMD_name_gen_delete = has_ext("GL_AMD_name_gen_delete"); - GLAD_GL_NV_texture_compression_vtc = has_ext("GL_NV_texture_compression_vtc"); - GLAD_GL_NV_sample_mask_override_coverage = has_ext("GL_NV_sample_mask_override_coverage"); - GLAD_GL_NV_texture_shader3 = has_ext("GL_NV_texture_shader3"); - GLAD_GL_NV_texture_shader2 = has_ext("GL_NV_texture_shader2"); - GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); + GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); + GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); + GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); + GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage"); - GLAD_GL_AMD_shader_atomic_counter_ops = has_ext("GL_AMD_shader_atomic_counter_ops"); - GLAD_GL_APPLE_vertex_program_evaluators = has_ext("GL_APPLE_vertex_program_evaluators"); - GLAD_GL_ARB_multi_bind = has_ext("GL_ARB_multi_bind"); - GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); + GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); + GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); + GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); GLAD_GL_ARB_depth_buffer_float = has_ext("GL_ARB_depth_buffer_float"); - GLAD_GL_NV_path_rendering_shared_edge = has_ext("GL_NV_path_rendering_shared_edge"); - GLAD_GL_SGIX_shadow_ambient = has_ext("GL_SGIX_shadow_ambient"); - GLAD_GL_ARB_texture_cube_map = has_ext("GL_ARB_texture_cube_map"); - GLAD_GL_AMD_vertex_shader_viewport_index = has_ext("GL_AMD_vertex_shader_viewport_index"); - GLAD_GL_SGIX_list_priority = has_ext("GL_SGIX_list_priority"); - GLAD_GL_NV_vertex_buffer_unified_memory = has_ext("GL_NV_vertex_buffer_unified_memory"); - GLAD_GL_NV_uniform_buffer_unified_memory = has_ext("GL_NV_uniform_buffer_unified_memory"); - GLAD_GL_EXT_texture_env_dot3 = has_ext("GL_EXT_texture_env_dot3"); - GLAD_GL_ATI_texture_env_combine3 = has_ext("GL_ATI_texture_env_combine3"); - GLAD_GL_ARB_map_buffer_alignment = has_ext("GL_ARB_map_buffer_alignment"); - GLAD_GL_NV_blend_equation_advanced = has_ext("GL_NV_blend_equation_advanced"); - GLAD_GL_SGIS_sharpen_texture = has_ext("GL_SGIS_sharpen_texture"); - GLAD_GL_KHR_robust_buffer_access_behavior = has_ext("GL_KHR_robust_buffer_access_behavior"); - GLAD_GL_ARB_pipeline_statistics_query = has_ext("GL_ARB_pipeline_statistics_query"); - GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); - GLAD_GL_ARB_texture_rgb10_a2ui = has_ext("GL_ARB_texture_rgb10_a2ui"); - GLAD_GL_OML_interlace = has_ext("GL_OML_interlace"); - GLAD_GL_ATI_pixel_format_float = has_ext("GL_ATI_pixel_format_float"); - GLAD_GL_NV_geometry_shader_passthrough = has_ext("GL_NV_geometry_shader_passthrough"); - GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); - GLAD_GL_EXT_shadow_funcs = has_ext("GL_EXT_shadow_funcs"); - GLAD_GL_ATI_text_fragment_shader = has_ext("GL_ATI_text_fragment_shader"); - GLAD_GL_NV_vertex_array_range = has_ext("GL_NV_vertex_array_range"); - GLAD_GL_SGIX_fragment_lighting = has_ext("GL_SGIX_fragment_lighting"); - GLAD_GL_NV_texture_expand_normal = has_ext("GL_NV_texture_expand_normal"); - GLAD_GL_NV_framebuffer_multisample_coverage = has_ext("GL_NV_framebuffer_multisample_coverage"); - GLAD_GL_EXT_timer_query = has_ext("GL_EXT_timer_query"); - GLAD_GL_EXT_vertex_array_bgra = has_ext("GL_EXT_vertex_array_bgra"); - GLAD_GL_NV_bindless_texture = has_ext("GL_NV_bindless_texture"); - GLAD_GL_KHR_debug = has_ext("GL_KHR_debug"); - GLAD_GL_SGIS_texture_border_clamp = has_ext("GL_SGIS_texture_border_clamp"); - GLAD_GL_ATI_vertex_attrib_array_object = has_ext("GL_ATI_vertex_attrib_array_object"); - GLAD_GL_SGIX_clipmap = has_ext("GL_SGIX_clipmap"); - GLAD_GL_EXT_geometry_shader4 = has_ext("GL_EXT_geometry_shader4"); - GLAD_GL_ARB_shader_texture_image_samples = has_ext("GL_ARB_shader_texture_image_samples"); - GLAD_GL_MESA_ycbcr_texture = has_ext("GL_MESA_ycbcr_texture"); - GLAD_GL_MESAX_texture_stack = has_ext("GL_MESAX_texture_stack"); - GLAD_GL_AMD_seamless_cubemap_per_texture = has_ext("GL_AMD_seamless_cubemap_per_texture"); - GLAD_GL_EXT_bindable_uniform = has_ext("GL_EXT_bindable_uniform"); - GLAD_GL_KHR_texture_compression_astc_hdr = has_ext("GL_KHR_texture_compression_astc_hdr"); - GLAD_GL_ARB_shader_ballot = has_ext("GL_ARB_shader_ballot"); - GLAD_GL_KHR_blend_equation_advanced = has_ext("GL_KHR_blend_equation_advanced"); - GLAD_GL_ARB_fragment_program_shadow = has_ext("GL_ARB_fragment_program_shadow"); - GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); - GLAD_GL_AMD_texture_texture4 = has_ext("GL_AMD_texture_texture4"); - GLAD_GL_SGIX_reference_plane = has_ext("GL_SGIX_reference_plane"); - GLAD_GL_EXT_stencil_two_side = has_ext("GL_EXT_stencil_two_side"); - GLAD_GL_ARB_transform_feedback_overflow_query = has_ext("GL_ARB_transform_feedback_overflow_query"); - GLAD_GL_SGIX_texture_lod_bias = has_ext("GL_SGIX_texture_lod_bias"); - GLAD_GL_KHR_no_error = has_ext("GL_KHR_no_error"); - GLAD_GL_NV_explicit_multisample = has_ext("GL_NV_explicit_multisample"); - GLAD_GL_IBM_static_data = has_ext("GL_IBM_static_data"); - GLAD_GL_EXT_clip_volume_hint = has_ext("GL_EXT_clip_volume_hint"); - GLAD_GL_EXT_texture_perturb_normal = has_ext("GL_EXT_texture_perturb_normal"); - GLAD_GL_NV_fragment_program2 = has_ext("GL_NV_fragment_program2"); - GLAD_GL_NV_fragment_program4 = has_ext("GL_NV_fragment_program4"); - GLAD_GL_EXT_point_parameters = has_ext("GL_EXT_point_parameters"); - GLAD_GL_PGI_misc_hints = has_ext("GL_PGI_misc_hints"); - GLAD_GL_SGIX_subsample = has_ext("GL_SGIX_subsample"); - GLAD_GL_AMD_shader_stencil_export = has_ext("GL_AMD_shader_stencil_export"); - GLAD_GL_ARB_shader_texture_lod = has_ext("GL_ARB_shader_texture_lod"); - GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp"); - GLAD_GL_SGIS_texture_select = has_ext("GL_SGIS_texture_select"); - GLAD_GL_NV_texture_shader = has_ext("GL_NV_texture_shader"); - GLAD_GL_ARB_tessellation_shader = has_ext("GL_ARB_tessellation_shader"); - GLAD_GL_EXT_draw_buffers2 = has_ext("GL_EXT_draw_buffers2"); - GLAD_GL_ARB_vertex_attrib_64bit = has_ext("GL_ARB_vertex_attrib_64bit"); - GLAD_GL_EXT_texture_filter_minmax = has_ext("GL_EXT_texture_filter_minmax"); - GLAD_GL_WIN_specular_fog = has_ext("GL_WIN_specular_fog"); - GLAD_GL_AMD_interleaved_elements = has_ext("GL_AMD_interleaved_elements"); + GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); + GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); + GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); + GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); + GLAD_GL_ARB_explicit_uniform_location = has_ext("GL_ARB_explicit_uniform_location"); GLAD_GL_ARB_fragment_program = has_ext("GL_ARB_fragment_program"); - GLAD_GL_OML_resample = has_ext("GL_OML_resample"); - GLAD_GL_APPLE_ycbcr_422 = has_ext("GL_APPLE_ycbcr_422"); - GLAD_GL_SGIX_texture_add_env = has_ext("GL_SGIX_texture_add_env"); - GLAD_GL_ARB_shadow_ambient = has_ext("GL_ARB_shadow_ambient"); - GLAD_GL_ARB_texture_storage = has_ext("GL_ARB_texture_storage"); - GLAD_GL_EXT_pixel_buffer_object = has_ext("GL_EXT_pixel_buffer_object"); - GLAD_GL_ARB_copy_image = has_ext("GL_ARB_copy_image"); - GLAD_GL_SGIS_pixel_texture = has_ext("GL_SGIS_pixel_texture"); - GLAD_GL_SGIS_generate_mipmap = has_ext("GL_SGIS_generate_mipmap"); - GLAD_GL_SGIX_instruments = has_ext("GL_SGIX_instruments"); - GLAD_GL_HP_texture_lighting = has_ext("GL_HP_texture_lighting"); - GLAD_GL_ARB_shader_storage_buffer_object = has_ext("GL_ARB_shader_storage_buffer_object"); - GLAD_GL_EXT_sparse_texture2 = has_ext("GL_EXT_sparse_texture2"); - GLAD_GL_EXT_blend_minmax = has_ext("GL_EXT_blend_minmax"); - GLAD_GL_MESA_pack_invert = has_ext("GL_MESA_pack_invert"); - GLAD_GL_ARB_base_instance = has_ext("GL_ARB_base_instance"); - GLAD_GL_SGIX_convolution_accuracy = has_ext("GL_SGIX_convolution_accuracy"); - GLAD_GL_PGI_vertex_hints = has_ext("GL_PGI_vertex_hints"); - GLAD_GL_AMD_transform_feedback4 = has_ext("GL_AMD_transform_feedback4"); - GLAD_GL_ARB_ES3_1_compatibility = has_ext("GL_ARB_ES3_1_compatibility"); - GLAD_GL_EXT_texture_integer = has_ext("GL_EXT_texture_integer"); + GLAD_GL_ARB_fragment_shader = has_ext("GL_ARB_fragment_shader"); + GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object"); + GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); + GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); + GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); + GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); + GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); GLAD_GL_ARB_texture_multisample = has_ext("GL_ARB_texture_multisample"); - GLAD_GL_AMD_gpu_shader_int64 = has_ext("GL_AMD_gpu_shader_int64"); - GLAD_GL_S3_s3tc = has_ext("GL_S3_s3tc"); - GLAD_GL_ARB_query_buffer_object = has_ext("GL_ARB_query_buffer_object"); - GLAD_GL_AMD_vertex_shader_tessellator = has_ext("GL_AMD_vertex_shader_tessellator"); - GLAD_GL_ARB_invalidate_subdata = has_ext("GL_ARB_invalidate_subdata"); - GLAD_GL_EXT_index_material = has_ext("GL_EXT_index_material"); - GLAD_GL_NV_blend_equation_advanced_coherent = has_ext("GL_NV_blend_equation_advanced_coherent"); - GLAD_GL_KHR_texture_compression_astc_sliced_3d = has_ext("GL_KHR_texture_compression_astc_sliced_3d"); - GLAD_GL_INTEL_parallel_arrays = has_ext("GL_INTEL_parallel_arrays"); - GLAD_GL_ATI_draw_buffers = has_ext("GL_ATI_draw_buffers"); - GLAD_GL_EXT_cmyka = has_ext("GL_EXT_cmyka"); - GLAD_GL_SGIX_pixel_texture = has_ext("GL_SGIX_pixel_texture"); - GLAD_GL_APPLE_specular_vector = has_ext("GL_APPLE_specular_vector"); - GLAD_GL_ARB_compatibility = has_ext("GL_ARB_compatibility"); - GLAD_GL_ARB_timer_query = has_ext("GL_ARB_timer_query"); - GLAD_GL_SGIX_interlace = has_ext("GL_SGIX_interlace"); - GLAD_GL_NV_parameter_buffer_object = has_ext("GL_NV_parameter_buffer_object"); - GLAD_GL_AMD_shader_trinary_minmax = has_ext("GL_AMD_shader_trinary_minmax"); - GLAD_GL_ARB_direct_state_access = has_ext("GL_ARB_direct_state_access"); - GLAD_GL_EXT_rescale_normal = has_ext("GL_EXT_rescale_normal"); - GLAD_GL_ARB_pixel_buffer_object = has_ext("GL_ARB_pixel_buffer_object"); - GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); - GLAD_GL_ARB_vertex_type_10f_11f_11f_rev = has_ext("GL_ARB_vertex_type_10f_11f_11f_rev"); + GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); + GLAD_GL_ARB_texture_rg = has_ext("GL_ARB_texture_rg"); GLAD_GL_ARB_texture_swizzle = has_ext("GL_ARB_texture_swizzle"); - GLAD_GL_NV_transform_feedback2 = has_ext("GL_NV_transform_feedback2"); - GLAD_GL_SGIX_async_pixel = has_ext("GL_SGIX_async_pixel"); - GLAD_GL_NV_fragment_program_option = has_ext("GL_NV_fragment_program_option"); - GLAD_GL_ARB_explicit_attrib_location = has_ext("GL_ARB_explicit_attrib_location"); + GLAD_GL_ARB_uniform_buffer_object = has_ext("GL_ARB_uniform_buffer_object"); + GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); + GLAD_GL_ARB_vertex_attrib_binding = has_ext("GL_ARB_vertex_attrib_binding"); + GLAD_GL_ARB_vertex_buffer_object = has_ext("GL_ARB_vertex_buffer_object"); + GLAD_GL_ARB_vertex_program = has_ext("GL_ARB_vertex_program"); + GLAD_GL_ARB_vertex_shader = has_ext("GL_ARB_vertex_shader"); + GLAD_GL_ATI_element_array = has_ext("GL_ATI_element_array"); + GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); + GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); GLAD_GL_EXT_blend_color = has_ext("GL_EXT_blend_color"); - GLAD_GL_NV_shader_thread_group = has_ext("GL_NV_shader_thread_group"); - GLAD_GL_EXT_stencil_wrap = has_ext("GL_EXT_stencil_wrap"); - GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); - GLAD_GL_OVR_multiview2 = has_ext("GL_OVR_multiview2"); - GLAD_GL_EXT_histogram = has_ext("GL_EXT_histogram"); - GLAD_GL_ARB_get_texture_sub_image = has_ext("GL_ARB_get_texture_sub_image"); - GLAD_GL_SGIS_point_parameters = has_ext("GL_SGIS_point_parameters"); - GLAD_GL_SGIX_ycrcb = has_ext("GL_SGIX_ycrcb"); - GLAD_GL_EXT_direct_state_access = has_ext("GL_EXT_direct_state_access"); - GLAD_GL_ARB_cull_distance = has_ext("GL_ARB_cull_distance"); - GLAD_GL_AMD_sample_positions = has_ext("GL_AMD_sample_positions"); - GLAD_GL_NV_vertex_program = has_ext("GL_NV_vertex_program"); - GLAD_GL_NV_shader_thread_shuffle = has_ext("GL_NV_shader_thread_shuffle"); - GLAD_GL_ARB_shader_precision = has_ext("GL_ARB_shader_precision"); - GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); - GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); - GLAD_GL_APPLE_fence = has_ext("GL_APPLE_fence"); - GLAD_GL_OES_byte_coordinates = has_ext("GL_OES_byte_coordinates"); - GLAD_GL_ARB_transpose_matrix = has_ext("GL_ARB_transpose_matrix"); - GLAD_GL_ARB_provoking_vertex = has_ext("GL_ARB_provoking_vertex"); - GLAD_GL_EXT_fog_coord = has_ext("GL_EXT_fog_coord"); - GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); - GLAD_GL_ARB_half_float_vertex = has_ext("GL_ARB_half_float_vertex"); GLAD_GL_EXT_blend_equation_separate = has_ext("GL_EXT_blend_equation_separate"); - GLAD_GL_NV_framebuffer_mixed_samples = has_ext("GL_NV_framebuffer_mixed_samples"); - GLAD_GL_NVX_conditional_render = has_ext("GL_NVX_conditional_render"); - GLAD_GL_ARB_multi_draw_indirect = has_ext("GL_ARB_multi_draw_indirect"); - GLAD_GL_EXT_raster_multisample = has_ext("GL_EXT_raster_multisample"); - GLAD_GL_NV_copy_image = has_ext("GL_NV_copy_image"); - GLAD_GL_ARB_fragment_layer_viewport = has_ext("GL_ARB_fragment_layer_viewport"); - GLAD_GL_INTEL_framebuffer_CMAA = has_ext("GL_INTEL_framebuffer_CMAA"); - GLAD_GL_ARB_transform_feedback2 = has_ext("GL_ARB_transform_feedback2"); - GLAD_GL_ARB_transform_feedback3 = has_ext("GL_ARB_transform_feedback3"); - GLAD_GL_SGIX_ycrcba = has_ext("GL_SGIX_ycrcba"); - GLAD_GL_EXT_debug_marker = has_ext("GL_EXT_debug_marker"); - GLAD_GL_EXT_bgra = has_ext("GL_EXT_bgra"); - GLAD_GL_ARB_sparse_texture_clamp = has_ext("GL_ARB_sparse_texture_clamp"); - GLAD_GL_EXT_pixel_transform = has_ext("GL_EXT_pixel_transform"); - GLAD_GL_ARB_conservative_depth = has_ext("GL_ARB_conservative_depth"); - GLAD_GL_ATI_fragment_shader = has_ext("GL_ATI_fragment_shader"); - GLAD_GL_ARB_vertex_array_object = has_ext("GL_ARB_vertex_array_object"); - GLAD_GL_SUN_triangle_list = has_ext("GL_SUN_triangle_list"); - GLAD_GL_EXT_texture_env_add = has_ext("GL_EXT_texture_env_add"); - GLAD_GL_EXT_packed_depth_stencil = has_ext("GL_EXT_packed_depth_stencil"); - GLAD_GL_EXT_texture_mirror_clamp = has_ext("GL_EXT_texture_mirror_clamp"); - GLAD_GL_NV_multisample_filter_hint = has_ext("GL_NV_multisample_filter_hint"); - GLAD_GL_APPLE_float_pixels = has_ext("GL_APPLE_float_pixels"); - GLAD_GL_ARB_transform_feedback_instanced = has_ext("GL_ARB_transform_feedback_instanced"); - GLAD_GL_SGIX_async = has_ext("GL_SGIX_async"); - GLAD_GL_EXT_texture_compression_latc = has_ext("GL_EXT_texture_compression_latc"); - GLAD_GL_NV_shader_atomic_float = has_ext("GL_NV_shader_atomic_float"); - GLAD_GL_ARB_shading_language_100 = has_ext("GL_ARB_shading_language_100"); - GLAD_GL_INTEL_performance_query = has_ext("GL_INTEL_performance_query"); - GLAD_GL_ARB_texture_mirror_clamp_to_edge = has_ext("GL_ARB_texture_mirror_clamp_to_edge"); - GLAD_GL_NV_gpu_shader5 = has_ext("GL_NV_gpu_shader5"); - GLAD_GL_NV_bindless_multi_draw_indirect_count = has_ext("GL_NV_bindless_multi_draw_indirect_count"); - GLAD_GL_ARB_ES2_compatibility = has_ext("GL_ARB_ES2_compatibility"); - GLAD_GL_ARB_indirect_parameters = has_ext("GL_ARB_indirect_parameters"); - GLAD_GL_NV_half_float = has_ext("GL_NV_half_float"); - GLAD_GL_ARB_ES3_2_compatibility = has_ext("GL_ARB_ES3_2_compatibility"); - GLAD_GL_ATI_texture_mirror_once = has_ext("GL_ATI_texture_mirror_once"); - GLAD_GL_IBM_rasterpos_clip = has_ext("GL_IBM_rasterpos_clip"); - GLAD_GL_SGIX_shadow = has_ext("GL_SGIX_shadow"); - GLAD_GL_EXT_polygon_offset_clamp = has_ext("GL_EXT_polygon_offset_clamp"); - GLAD_GL_NV_deep_texture3D = has_ext("GL_NV_deep_texture3D"); - GLAD_GL_ARB_shader_draw_parameters = has_ext("GL_ARB_shader_draw_parameters"); - GLAD_GL_SGIX_calligraphic_fragment = has_ext("GL_SGIX_calligraphic_fragment"); - GLAD_GL_ARB_shader_bit_encoding = has_ext("GL_ARB_shader_bit_encoding"); - GLAD_GL_EXT_compiled_vertex_array = has_ext("GL_EXT_compiled_vertex_array"); - GLAD_GL_NV_depth_buffer_float = has_ext("GL_NV_depth_buffer_float"); - GLAD_GL_NV_occlusion_query = has_ext("GL_NV_occlusion_query"); - GLAD_GL_APPLE_flush_buffer_range = has_ext("GL_APPLE_flush_buffer_range"); - GLAD_GL_ARB_imaging = has_ext("GL_ARB_imaging"); - GLAD_GL_ARB_draw_buffers_blend = has_ext("GL_ARB_draw_buffers_blend"); - GLAD_GL_AMD_gcn_shader = has_ext("GL_AMD_gcn_shader"); - GLAD_GL_AMD_blend_minmax_factor = has_ext("GL_AMD_blend_minmax_factor"); - GLAD_GL_EXT_texture_sRGB_decode = has_ext("GL_EXT_texture_sRGB_decode"); - GLAD_GL_ARB_shading_language_420pack = has_ext("GL_ARB_shading_language_420pack"); - GLAD_GL_ARB_shader_viewport_layer_array = has_ext("GL_ARB_shader_viewport_layer_array"); - GLAD_GL_ATI_meminfo = has_ext("GL_ATI_meminfo"); - GLAD_GL_EXT_abgr = has_ext("GL_EXT_abgr"); - GLAD_GL_AMD_pinned_memory = has_ext("GL_AMD_pinned_memory"); - GLAD_GL_EXT_texture_snorm = has_ext("GL_EXT_texture_snorm"); - GLAD_GL_SGIX_texture_coordinate_clamp = has_ext("GL_SGIX_texture_coordinate_clamp"); - GLAD_GL_ARB_clear_buffer_object = has_ext("GL_ARB_clear_buffer_object"); - GLAD_GL_ARB_multisample = has_ext("GL_ARB_multisample"); - GLAD_GL_EXT_debug_label = has_ext("GL_EXT_debug_label"); - GLAD_GL_ARB_sample_shading = has_ext("GL_ARB_sample_shading"); - GLAD_GL_NV_internalformat_sample_query = has_ext("GL_NV_internalformat_sample_query"); - GLAD_GL_INTEL_map_texture = has_ext("GL_INTEL_map_texture"); - GLAD_GL_ARB_texture_env_crossbar = has_ext("GL_ARB_texture_env_crossbar"); - GLAD_GL_EXT_422_pixels = has_ext("GL_EXT_422_pixels"); - GLAD_GL_ARB_compute_shader = has_ext("GL_ARB_compute_shader"); - GLAD_GL_EXT_blend_logic_op = has_ext("GL_EXT_blend_logic_op"); - GLAD_GL_IBM_cull_vertex = has_ext("GL_IBM_cull_vertex"); - GLAD_GL_IBM_vertex_array_lists = has_ext("GL_IBM_vertex_array_lists"); - GLAD_GL_ARB_color_buffer_float = has_ext("GL_ARB_color_buffer_float"); - GLAD_GL_ARB_bindless_texture = has_ext("GL_ARB_bindless_texture"); - GLAD_GL_ARB_window_pos = has_ext("GL_ARB_window_pos"); - GLAD_GL_ARB_internalformat_query = has_ext("GL_ARB_internalformat_query"); - GLAD_GL_ARB_shadow = has_ext("GL_ARB_shadow"); - GLAD_GL_ARB_texture_mirrored_repeat = has_ext("GL_ARB_texture_mirrored_repeat"); - GLAD_GL_EXT_shader_image_load_store = has_ext("GL_EXT_shader_image_load_store"); - GLAD_GL_EXT_copy_texture = has_ext("GL_EXT_copy_texture"); - GLAD_GL_NV_register_combiners2 = has_ext("GL_NV_register_combiners2"); - GLAD_GL_SGIX_ycrcb_subsample = has_ext("GL_SGIX_ycrcb_subsample"); - GLAD_GL_SGIX_ir_instrument1 = has_ext("GL_SGIX_ir_instrument1"); - GLAD_GL_NV_draw_texture = has_ext("GL_NV_draw_texture"); - GLAD_GL_EXT_texture_shared_exponent = has_ext("GL_EXT_texture_shared_exponent"); - GLAD_GL_EXT_draw_instanced = has_ext("GL_EXT_draw_instanced"); - GLAD_GL_NV_copy_depth_to_color = has_ext("GL_NV_copy_depth_to_color"); - GLAD_GL_ARB_viewport_array = has_ext("GL_ARB_viewport_array"); - GLAD_GL_ARB_separate_shader_objects = has_ext("GL_ARB_separate_shader_objects"); - GLAD_GL_EXT_depth_bounds_test = has_ext("GL_EXT_depth_bounds_test"); - GLAD_GL_EXT_shared_texture_palette = has_ext("GL_EXT_shared_texture_palette"); - GLAD_GL_ARB_texture_env_add = has_ext("GL_ARB_texture_env_add"); - GLAD_GL_NV_video_capture = has_ext("GL_NV_video_capture"); - GLAD_GL_ARB_sampler_objects = has_ext("GL_ARB_sampler_objects"); - GLAD_GL_ARB_matrix_palette = has_ext("GL_ARB_matrix_palette"); - GLAD_GL_SGIS_texture_color_mask = has_ext("GL_SGIS_texture_color_mask"); - GLAD_GL_EXT_packed_pixels = has_ext("GL_EXT_packed_pixels"); - GLAD_GL_EXT_coordinate_frame = has_ext("GL_EXT_coordinate_frame"); - GLAD_GL_ARB_texture_compression = has_ext("GL_ARB_texture_compression"); - GLAD_GL_APPLE_aux_depth_stencil = has_ext("GL_APPLE_aux_depth_stencil"); - GLAD_GL_ARB_shader_subroutine = has_ext("GL_ARB_shader_subroutine"); - GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); - GLAD_GL_ARB_texture_storage_multisample = has_ext("GL_ARB_texture_storage_multisample"); - GLAD_GL_KHR_blend_equation_advanced_coherent = has_ext("GL_KHR_blend_equation_advanced_coherent"); - GLAD_GL_EXT_vertex_attrib_64bit = has_ext("GL_EXT_vertex_attrib_64bit"); - GLAD_GL_ARB_depth_texture = has_ext("GL_ARB_depth_texture"); - GLAD_GL_NV_shader_buffer_store = has_ext("GL_NV_shader_buffer_store"); - GLAD_GL_OES_query_matrix = has_ext("GL_OES_query_matrix"); - GLAD_GL_MESA_window_pos = has_ext("GL_MESA_window_pos"); - GLAD_GL_NV_fill_rectangle = has_ext("GL_NV_fill_rectangle"); - GLAD_GL_NV_shader_storage_buffer_object = has_ext("GL_NV_shader_storage_buffer_object"); - GLAD_GL_ARB_texture_query_lod = has_ext("GL_ARB_texture_query_lod"); - GLAD_GL_ARB_copy_buffer = has_ext("GL_ARB_copy_buffer"); - GLAD_GL_ARB_shader_image_size = has_ext("GL_ARB_shader_image_size"); - GLAD_GL_NV_shader_atomic_counters = has_ext("GL_NV_shader_atomic_counters"); - GLAD_GL_APPLE_object_purgeable = has_ext("GL_APPLE_object_purgeable"); - GLAD_GL_ARB_occlusion_query = has_ext("GL_ARB_occlusion_query"); - GLAD_GL_INGR_color_clamp = has_ext("GL_INGR_color_clamp"); - GLAD_GL_SGI_color_table = has_ext("GL_SGI_color_table"); - GLAD_GL_NV_gpu_program5_mem_extended = has_ext("GL_NV_gpu_program5_mem_extended"); - GLAD_GL_ARB_texture_cube_map_array = has_ext("GL_ARB_texture_cube_map_array"); - GLAD_GL_SGIX_scalebias_hint = has_ext("GL_SGIX_scalebias_hint"); - GLAD_GL_EXT_gpu_shader4 = has_ext("GL_EXT_gpu_shader4"); - GLAD_GL_NV_geometry_program4 = has_ext("GL_NV_geometry_program4"); + GLAD_GL_EXT_blend_func_separate = has_ext("GL_EXT_blend_func_separate"); + GLAD_GL_EXT_framebuffer_blit = has_ext("GL_EXT_framebuffer_blit"); + GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); GLAD_GL_EXT_framebuffer_multisample_blit_scaled = has_ext("GL_EXT_framebuffer_multisample_blit_scaled"); - GLAD_GL_AMD_debug_output = has_ext("GL_AMD_debug_output"); - GLAD_GL_ARB_texture_border_clamp = has_ext("GL_ARB_texture_border_clamp"); - GLAD_GL_ARB_fragment_coord_conventions = has_ext("GL_ARB_fragment_coord_conventions"); - GLAD_GL_ARB_multitexture = has_ext("GL_ARB_multitexture"); - GLAD_GL_SGIX_polynomial_ffd = has_ext("GL_SGIX_polynomial_ffd"); - GLAD_GL_EXT_provoking_vertex = has_ext("GL_EXT_provoking_vertex"); - GLAD_GL_ARB_point_parameters = has_ext("GL_ARB_point_parameters"); - GLAD_GL_ARB_shader_image_load_store = has_ext("GL_ARB_shader_image_load_store"); - GLAD_GL_ARB_conditional_render_inverted = has_ext("GL_ARB_conditional_render_inverted"); - GLAD_GL_HP_occlusion_test = has_ext("GL_HP_occlusion_test"); - GLAD_GL_ARB_ES3_compatibility = has_ext("GL_ARB_ES3_compatibility"); - GLAD_GL_ARB_texture_barrier = has_ext("GL_ARB_texture_barrier"); - GLAD_GL_ARB_texture_buffer_object_rgb32 = has_ext("GL_ARB_texture_buffer_object_rgb32"); - GLAD_GL_NV_bindless_multi_draw_indirect = has_ext("GL_NV_bindless_multi_draw_indirect"); - GLAD_GL_SGIX_texture_multi_buffer = has_ext("GL_SGIX_texture_multi_buffer"); - GLAD_GL_EXT_transform_feedback = has_ext("GL_EXT_transform_feedback"); - GLAD_GL_KHR_texture_compression_astc_ldr = has_ext("GL_KHR_texture_compression_astc_ldr"); - GLAD_GL_3DFX_multisample = has_ext("GL_3DFX_multisample"); - GLAD_GL_INTEL_fragment_shader_ordering = has_ext("GL_INTEL_fragment_shader_ordering"); - GLAD_GL_ARB_texture_env_dot3 = has_ext("GL_ARB_texture_env_dot3"); - GLAD_GL_NV_gpu_program4 = has_ext("GL_NV_gpu_program4"); - GLAD_GL_NV_gpu_program5 = has_ext("GL_NV_gpu_program5"); - GLAD_GL_NV_float_buffer = has_ext("GL_NV_float_buffer"); - GLAD_GL_SGIS_texture_edge_clamp = has_ext("GL_SGIS_texture_edge_clamp"); - GLAD_GL_ARB_framebuffer_sRGB = has_ext("GL_ARB_framebuffer_sRGB"); - GLAD_GL_SUN_slice_accum = has_ext("GL_SUN_slice_accum"); - GLAD_GL_EXT_index_texture = has_ext("GL_EXT_index_texture"); - GLAD_GL_EXT_shader_image_load_formatted = has_ext("GL_EXT_shader_image_load_formatted"); - GLAD_GL_ARB_geometry_shader4 = has_ext("GL_ARB_geometry_shader4"); - GLAD_GL_EXT_separate_specular_color = has_ext("GL_EXT_separate_specular_color"); - GLAD_GL_AMD_depth_clamp_separate = has_ext("GL_AMD_depth_clamp_separate"); - GLAD_GL_NV_conservative_raster = has_ext("GL_NV_conservative_raster"); - GLAD_GL_ARB_sparse_texture2 = has_ext("GL_ARB_sparse_texture2"); - GLAD_GL_SGIX_sprite = has_ext("GL_SGIX_sprite"); - GLAD_GL_ARB_get_program_binary = has_ext("GL_ARB_get_program_binary"); - GLAD_GL_AMD_occlusion_query_event = has_ext("GL_AMD_occlusion_query_event"); - GLAD_GL_SGIS_multisample = has_ext("GL_SGIS_multisample"); GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object"); - GLAD_GL_ARB_robustness_isolation = has_ext("GL_ARB_robustness_isolation"); - GLAD_GL_ARB_vertex_array_bgra = has_ext("GL_ARB_vertex_array_bgra"); - GLAD_GL_APPLE_vertex_array_range = has_ext("GL_APPLE_vertex_array_range"); - GLAD_GL_AMD_query_buffer_object = has_ext("GL_AMD_query_buffer_object"); - GLAD_GL_NV_register_combiners = has_ext("GL_NV_register_combiners"); - GLAD_GL_ARB_draw_buffers = has_ext("GL_ARB_draw_buffers"); - GLAD_GL_ARB_clear_texture = has_ext("GL_ARB_clear_texture"); - GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); - GLAD_GL_SGI_color_matrix = has_ext("GL_SGI_color_matrix"); - GLAD_GL_EXT_cull_vertex = has_ext("GL_EXT_cull_vertex"); + GLAD_GL_EXT_framebuffer_sRGB = has_ext("GL_EXT_framebuffer_sRGB"); + GLAD_GL_EXT_index_array_formats = has_ext("GL_EXT_index_array_formats"); + GLAD_GL_EXT_texture = has_ext("GL_EXT_texture"); + GLAD_GL_EXT_texture_compression_s3tc = has_ext("GL_EXT_texture_compression_s3tc"); GLAD_GL_EXT_texture_sRGB = has_ext("GL_EXT_texture_sRGB"); - GLAD_GL_APPLE_row_bytes = has_ext("GL_APPLE_row_bytes"); - GLAD_GL_NV_texgen_reflection = has_ext("GL_NV_texgen_reflection"); - GLAD_GL_IBM_multimode_draw_arrays = has_ext("GL_IBM_multimode_draw_arrays"); - GLAD_GL_APPLE_vertex_array_object = has_ext("GL_APPLE_vertex_array_object"); - GLAD_GL_3DFX_texture_compression_FXT1 = has_ext("GL_3DFX_texture_compression_FXT1"); - GLAD_GL_NV_fragment_shader_interlock = has_ext("GL_NV_fragment_shader_interlock"); - GLAD_GL_AMD_conservative_depth = has_ext("GL_AMD_conservative_depth"); - GLAD_GL_ARB_texture_float = has_ext("GL_ARB_texture_float"); - GLAD_GL_ARB_compressed_texture_pixel_storage = has_ext("GL_ARB_compressed_texture_pixel_storage"); - GLAD_GL_SGIS_detail_texture = has_ext("GL_SGIS_detail_texture"); - GLAD_GL_ARB_draw_instanced = has_ext("GL_ARB_draw_instanced"); - GLAD_GL_OES_read_format = has_ext("GL_OES_read_format"); - GLAD_GL_ATI_texture_float = has_ext("GL_ATI_texture_float"); - GLAD_GL_ARB_texture_gather = has_ext("GL_ARB_texture_gather"); - GLAD_GL_AMD_vertex_shader_layer = has_ext("GL_AMD_vertex_shader_layer"); - GLAD_GL_ARB_shading_language_include = has_ext("GL_ARB_shading_language_include"); - GLAD_GL_APPLE_client_storage = has_ext("GL_APPLE_client_storage"); - GLAD_GL_WIN_phong_shading = has_ext("GL_WIN_phong_shading"); - GLAD_GL_INGR_blend_func_separate = has_ext("GL_INGR_blend_func_separate"); - GLAD_GL_NV_path_rendering = has_ext("GL_NV_path_rendering"); - GLAD_GL_NV_conservative_raster_dilate = has_ext("GL_NV_conservative_raster_dilate"); - GLAD_GL_ATI_vertex_streams = has_ext("GL_ATI_vertex_streams"); - GLAD_GL_ARB_post_depth_coverage = has_ext("GL_ARB_post_depth_coverage"); - GLAD_GL_ARB_texture_non_power_of_two = has_ext("GL_ARB_texture_non_power_of_two"); - GLAD_GL_APPLE_rgb_422 = has_ext("GL_APPLE_rgb_422"); - GLAD_GL_EXT_texture_lod_bias = has_ext("GL_EXT_texture_lod_bias"); - GLAD_GL_ARB_gpu_shader_int64 = has_ext("GL_ARB_gpu_shader_int64"); - GLAD_GL_ARB_seamless_cube_map = has_ext("GL_ARB_seamless_cube_map"); - GLAD_GL_ARB_shader_group_vote = has_ext("GL_ARB_shader_group_vote"); - GLAD_GL_NV_vdpau_interop = has_ext("GL_NV_vdpau_interop"); - GLAD_GL_ARB_occlusion_query2 = has_ext("GL_ARB_occlusion_query2"); - GLAD_GL_ARB_internalformat_query2 = has_ext("GL_ARB_internalformat_query2"); - GLAD_GL_EXT_texture_filter_anisotropic = has_ext("GL_EXT_texture_filter_anisotropic"); - GLAD_GL_SUN_vertex = has_ext("GL_SUN_vertex"); - GLAD_GL_SGIX_igloo_interface = has_ext("GL_SGIX_igloo_interface"); - GLAD_GL_SGIS_texture_lod = has_ext("GL_SGIS_texture_lod"); - GLAD_GL_NV_vertex_program3 = has_ext("GL_NV_vertex_program3"); - GLAD_GL_ARB_draw_indirect = has_ext("GL_ARB_draw_indirect"); - GLAD_GL_NV_vertex_program4 = has_ext("GL_NV_vertex_program4"); - GLAD_GL_AMD_transform_feedback3_lines_triangles = has_ext("GL_AMD_transform_feedback3_lines_triangles"); - GLAD_GL_SGIS_fog_function = has_ext("GL_SGIS_fog_function"); - GLAD_GL_EXT_x11_sync_object = has_ext("GL_EXT_x11_sync_object"); - GLAD_GL_ARB_sync = has_ext("GL_ARB_sync"); - GLAD_GL_NV_sample_locations = has_ext("GL_NV_sample_locations"); - GLAD_GL_ARB_compute_variable_group_size = has_ext("GL_ARB_compute_variable_group_size"); - GLAD_GL_OES_fixed_point = has_ext("GL_OES_fixed_point"); - GLAD_GL_NV_blend_square = has_ext("GL_NV_blend_square"); - GLAD_GL_EXT_framebuffer_multisample = has_ext("GL_EXT_framebuffer_multisample"); - GLAD_GL_ARB_gpu_shader5 = has_ext("GL_ARB_gpu_shader5"); - GLAD_GL_SGIS_texture4D = has_ext("GL_SGIS_texture4D"); - GLAD_GL_EXT_texture3D = has_ext("GL_EXT_texture3D"); - GLAD_GL_EXT_multisample = has_ext("GL_EXT_multisample"); - GLAD_GL_EXT_secondary_color = has_ext("GL_EXT_secondary_color"); - GLAD_GL_ARB_texture_filter_minmax = has_ext("GL_ARB_texture_filter_minmax"); - GLAD_GL_ATI_vertex_array_object = has_ext("GL_ATI_vertex_array_object"); - GLAD_GL_ARB_parallel_shader_compile = has_ext("GL_ARB_parallel_shader_compile"); - GLAD_GL_NVX_gpu_memory_info = has_ext("GL_NVX_gpu_memory_info"); - GLAD_GL_ARB_sparse_texture = has_ext("GL_ARB_sparse_texture"); - GLAD_GL_SGIS_point_line_texgen = has_ext("GL_SGIS_point_line_texgen"); - GLAD_GL_ARB_sample_locations = has_ext("GL_ARB_sample_locations"); - GLAD_GL_ARB_sparse_buffer = has_ext("GL_ARB_sparse_buffer"); - GLAD_GL_EXT_draw_range_elements = has_ext("GL_EXT_draw_range_elements"); - GLAD_GL_SGIX_blend_alpha_minmax = has_ext("GL_SGIX_blend_alpha_minmax"); - GLAD_GL_KHR_context_flush_control = has_ext("GL_KHR_context_flush_control"); + GLAD_GL_EXT_texture_swizzle = has_ext("GL_EXT_texture_swizzle"); + GLAD_GL_EXT_vertex_array = has_ext("GL_EXT_vertex_array"); + GLAD_GL_EXT_vertex_shader = has_ext("GL_EXT_vertex_shader"); free_exts(); return 1; } @@ -21641,278 +5406,35 @@ int gladLoadGLLoader(GLADloadproc load) { load_GL_VERSION_3_3(load); if (!find_extensionsGL()) return 0; - load_GL_APPLE_element_array(load); - load_GL_AMD_multi_draw_indirect(load); - load_GL_SGIX_tag_sample_buffer(load); - load_GL_NV_point_sprite(load); - load_GL_ATI_separate_stencil(load); - load_GL_EXT_texture_buffer_object(load); - load_GL_ARB_vertex_blend(load); - load_GL_OVR_multiview(load); - load_GL_ARB_program_interface_query(load); - load_GL_EXT_index_func(load); - load_GL_NV_shader_buffer_load(load); - load_GL_EXT_color_subtable(load); - load_GL_SUNX_constant_data(load); - load_GL_EXT_multi_draw_arrays(load); - load_GL_ARB_shader_atomic_counters(load); - load_GL_NV_conditional_render(load); - load_GL_MESA_resize_buffers(load); - load_GL_ARB_texture_view(load); - load_GL_ARB_map_buffer_range(load); - load_GL_EXT_convolution(load); - load_GL_NV_vertex_attrib_integer_64bit(load); - load_GL_EXT_paletted_texture(load); - load_GL_ARB_texture_buffer_object(load); - load_GL_ATI_pn_triangles(load); - load_GL_SGIX_flush_raster(load); - load_GL_EXT_light_texture(load); - load_GL_HP_image_transform(load); - load_GL_AMD_draw_buffers_blend(load); - load_GL_APPLE_texture_range(load); - load_GL_EXT_texture_array(load); - load_GL_NV_texture_barrier(load); - load_GL_ARB_vertex_type_2_10_10_10_rev(load); - load_GL_3DFX_tbuffer(load); - load_GL_GREMEDY_frame_terminator(load); - load_GL_ARB_blend_func_extended(load); - load_GL_EXT_separate_shader_objects(load); - load_GL_NV_texture_multisample(load); - load_GL_ARB_shader_objects(load); - load_GL_ARB_framebuffer_object(load); - load_GL_ATI_envmap_bumpmap(load); - load_GL_ATI_map_object_buffer(load); - load_GL_ARB_robustness(load); - load_GL_NV_pixel_data_range(load); - load_GL_EXT_framebuffer_blit(load); - load_GL_ARB_gpu_shader_fp64(load); - load_GL_NV_command_list(load); - load_GL_EXT_vertex_weighting(load); - load_GL_GREMEDY_string_marker(load); - load_GL_EXT_subtexture(load); - load_GL_EXT_gpu_program_parameters(load); - load_GL_NV_evaluators(load); - load_GL_SGIS_texture_filter4(load); - load_GL_AMD_performance_monitor(load); - load_GL_EXT_stencil_clear_tag(load); - load_GL_NV_present_video(load); - load_GL_SGIX_framezoom(load); - load_GL_ARB_draw_elements_base_vertex(load); - load_GL_NV_transform_feedback(load); - load_GL_NV_fragment_program(load); - load_GL_AMD_stencil_operation_extended(load); - load_GL_ARB_instanced_arrays(load); - load_GL_EXT_polygon_offset(load); - load_GL_KHR_robustness(load); - load_GL_AMD_sparse_texture(load); - load_GL_ARB_clip_control(load); - load_GL_NV_fragment_coverage_to_color(load); - load_GL_NV_fence(load); - load_GL_ARB_texture_buffer_range(load); - load_GL_SUN_mesh_array(load); - load_GL_ARB_vertex_attrib_binding(load); - load_GL_ARB_framebuffer_no_attachments(load); - load_GL_ARB_cl_event(load); - load_GL_OES_single_precision(load); - load_GL_NV_primitive_restart(load); - load_GL_SUN_global_alpha(load); - load_GL_EXT_texture_object(load); - load_GL_AMD_name_gen_delete(load); + load_GL_AMD_debug_output(load); + load_GL_ARB_ES2_compatibility(load); load_GL_ARB_buffer_storage(load); - load_GL_APPLE_vertex_program_evaluators(load); - load_GL_ARB_multi_bind(load); - load_GL_SGIX_list_priority(load); - load_GL_NV_vertex_buffer_unified_memory(load); - load_GL_NV_blend_equation_advanced(load); - load_GL_SGIS_sharpen_texture(load); - load_GL_ARB_vertex_program(load); - load_GL_ARB_vertex_buffer_object(load); - load_GL_NV_vertex_array_range(load); - load_GL_SGIX_fragment_lighting(load); - load_GL_NV_framebuffer_multisample_coverage(load); - load_GL_EXT_timer_query(load); - load_GL_NV_bindless_texture(load); - load_GL_KHR_debug(load); - load_GL_ATI_vertex_attrib_array_object(load); - load_GL_EXT_geometry_shader4(load); - load_GL_EXT_bindable_uniform(load); - load_GL_KHR_blend_equation_advanced(load); - load_GL_ATI_element_array(load); - load_GL_SGIX_reference_plane(load); - load_GL_EXT_stencil_two_side(load); - load_GL_NV_explicit_multisample(load); - load_GL_IBM_static_data(load); - load_GL_EXT_texture_perturb_normal(load); - load_GL_EXT_point_parameters(load); - load_GL_PGI_misc_hints(load); - load_GL_ARB_vertex_shader(load); - load_GL_ARB_tessellation_shader(load); - load_GL_EXT_draw_buffers2(load); - load_GL_ARB_vertex_attrib_64bit(load); - load_GL_EXT_texture_filter_minmax(load); - load_GL_AMD_interleaved_elements(load); + load_GL_ARB_debug_output(load); + load_GL_ARB_draw_buffers(load); + load_GL_ARB_draw_buffers_blend(load); load_GL_ARB_fragment_program(load); - load_GL_ARB_texture_storage(load); - load_GL_ARB_copy_image(load); - load_GL_SGIS_pixel_texture(load); - load_GL_SGIX_instruments(load); - load_GL_ARB_shader_storage_buffer_object(load); - load_GL_EXT_blend_minmax(load); - load_GL_ARB_base_instance(load); - load_GL_ARB_ES3_1_compatibility(load); - load_GL_EXT_texture_integer(load); + load_GL_ARB_framebuffer_object(load); + load_GL_ARB_multisample(load); + load_GL_ARB_sample_locations(load); + load_GL_ARB_texture_compression(load); load_GL_ARB_texture_multisample(load); - load_GL_AMD_gpu_shader_int64(load); - load_GL_AMD_vertex_shader_tessellator(load); - load_GL_ARB_invalidate_subdata(load); - load_GL_EXT_index_material(load); - load_GL_INTEL_parallel_arrays(load); - load_GL_ATI_draw_buffers(load); - load_GL_SGIX_pixel_texture(load); - load_GL_ARB_timer_query(load); - load_GL_NV_parameter_buffer_object(load); - load_GL_ARB_direct_state_access(load); load_GL_ARB_uniform_buffer_object(load); - load_GL_NV_transform_feedback2(load); + load_GL_ARB_vertex_array_object(load); + load_GL_ARB_vertex_attrib_binding(load); + load_GL_ARB_vertex_buffer_object(load); + load_GL_ARB_vertex_program(load); + load_GL_ARB_vertex_shader(load); + load_GL_ATI_element_array(load); + load_GL_ATI_fragment_shader(load); + load_GL_ATI_vertex_array_object(load); load_GL_EXT_blend_color(load); - load_GL_EXT_histogram(load); - load_GL_ARB_get_texture_sub_image(load); - load_GL_SGIS_point_parameters(load); - load_GL_EXT_direct_state_access(load); - load_GL_AMD_sample_positions(load); - load_GL_NV_vertex_program(load); - load_GL_EXT_vertex_shader(load); - load_GL_EXT_blend_func_separate(load); - load_GL_APPLE_fence(load); - load_GL_OES_byte_coordinates(load); - load_GL_ARB_transpose_matrix(load); - load_GL_ARB_provoking_vertex(load); - load_GL_EXT_fog_coord(load); - load_GL_EXT_vertex_array(load); load_GL_EXT_blend_equation_separate(load); - load_GL_NV_framebuffer_mixed_samples(load); - load_GL_NVX_conditional_render(load); - load_GL_ARB_multi_draw_indirect(load); - load_GL_EXT_raster_multisample(load); - load_GL_NV_copy_image(load); - load_GL_INTEL_framebuffer_CMAA(load); - load_GL_ARB_transform_feedback2(load); - load_GL_ARB_transform_feedback3(load); - load_GL_EXT_debug_marker(load); - load_GL_EXT_pixel_transform(load); - load_GL_ATI_fragment_shader(load); - load_GL_ARB_vertex_array_object(load); - load_GL_SUN_triangle_list(load); - load_GL_ARB_transform_feedback_instanced(load); - load_GL_SGIX_async(load); - load_GL_INTEL_performance_query(load); - load_GL_NV_gpu_shader5(load); - load_GL_NV_bindless_multi_draw_indirect_count(load); - load_GL_ARB_ES2_compatibility(load); - load_GL_ARB_indirect_parameters(load); - load_GL_NV_half_float(load); - load_GL_ARB_ES3_2_compatibility(load); - load_GL_EXT_polygon_offset_clamp(load); - load_GL_EXT_compiled_vertex_array(load); - load_GL_NV_depth_buffer_float(load); - load_GL_NV_occlusion_query(load); - load_GL_APPLE_flush_buffer_range(load); - load_GL_ARB_imaging(load); - load_GL_ARB_draw_buffers_blend(load); - load_GL_ARB_clear_buffer_object(load); - load_GL_ARB_multisample(load); - load_GL_EXT_debug_label(load); - load_GL_ARB_sample_shading(load); - load_GL_NV_internalformat_sample_query(load); - load_GL_INTEL_map_texture(load); - load_GL_ARB_compute_shader(load); - load_GL_IBM_vertex_array_lists(load); - load_GL_ARB_color_buffer_float(load); - load_GL_ARB_bindless_texture(load); - load_GL_ARB_window_pos(load); - load_GL_ARB_internalformat_query(load); - load_GL_EXT_shader_image_load_store(load); - load_GL_EXT_copy_texture(load); - load_GL_NV_register_combiners2(load); - load_GL_NV_draw_texture(load); - load_GL_EXT_draw_instanced(load); - load_GL_ARB_viewport_array(load); - load_GL_ARB_separate_shader_objects(load); - load_GL_EXT_depth_bounds_test(load); - load_GL_NV_video_capture(load); - load_GL_ARB_sampler_objects(load); - load_GL_ARB_matrix_palette(load); - load_GL_SGIS_texture_color_mask(load); - load_GL_EXT_coordinate_frame(load); - load_GL_ARB_texture_compression(load); - load_GL_ARB_shader_subroutine(load); - load_GL_ARB_texture_storage_multisample(load); - load_GL_EXT_vertex_attrib_64bit(load); - load_GL_OES_query_matrix(load); - load_GL_MESA_window_pos(load); - load_GL_ARB_copy_buffer(load); - load_GL_APPLE_object_purgeable(load); - load_GL_ARB_occlusion_query(load); - load_GL_SGI_color_table(load); - load_GL_EXT_gpu_shader4(load); - load_GL_NV_geometry_program4(load); - load_GL_AMD_debug_output(load); - load_GL_ARB_multitexture(load); - load_GL_SGIX_polynomial_ffd(load); - load_GL_EXT_provoking_vertex(load); - load_GL_ARB_point_parameters(load); - load_GL_ARB_shader_image_load_store(load); - load_GL_ARB_texture_barrier(load); - load_GL_NV_bindless_multi_draw_indirect(load); - load_GL_EXT_transform_feedback(load); - load_GL_NV_gpu_program4(load); - load_GL_NV_gpu_program5(load); - load_GL_ARB_geometry_shader4(load); - load_GL_NV_conservative_raster(load); - load_GL_SGIX_sprite(load); - load_GL_ARB_get_program_binary(load); - load_GL_AMD_occlusion_query_event(load); - load_GL_SGIS_multisample(load); - load_GL_EXT_framebuffer_object(load); - load_GL_APPLE_vertex_array_range(load); - load_GL_NV_register_combiners(load); - load_GL_ARB_draw_buffers(load); - load_GL_ARB_clear_texture(load); - load_GL_ARB_debug_output(load); - load_GL_EXT_cull_vertex(load); - load_GL_IBM_multimode_draw_arrays(load); - load_GL_APPLE_vertex_array_object(load); - load_GL_SGIS_detail_texture(load); - load_GL_ARB_draw_instanced(load); - load_GL_ARB_shading_language_include(load); - load_GL_INGR_blend_func_separate(load); - load_GL_NV_path_rendering(load); - load_GL_NV_conservative_raster_dilate(load); - load_GL_ATI_vertex_streams(load); - load_GL_ARB_gpu_shader_int64(load); - load_GL_NV_vdpau_interop(load); - load_GL_ARB_internalformat_query2(load); - load_GL_SUN_vertex(load); - load_GL_SGIX_igloo_interface(load); - load_GL_ARB_draw_indirect(load); - load_GL_NV_vertex_program4(load); - load_GL_SGIS_fog_function(load); - load_GL_EXT_x11_sync_object(load); - load_GL_ARB_sync(load); - load_GL_NV_sample_locations(load); - load_GL_ARB_compute_variable_group_size(load); - load_GL_OES_fixed_point(load); + load_GL_EXT_blend_func_separate(load); + load_GL_EXT_framebuffer_blit(load); load_GL_EXT_framebuffer_multisample(load); - load_GL_SGIS_texture4D(load); - load_GL_EXT_texture3D(load); - load_GL_EXT_multisample(load); - load_GL_EXT_secondary_color(load); - load_GL_ATI_vertex_array_object(load); - load_GL_ARB_parallel_shader_compile(load); - load_GL_ARB_sparse_texture(load); - load_GL_ARB_sample_locations(load); - load_GL_ARB_sparse_buffer(load); - load_GL_EXT_draw_range_elements(load); + load_GL_EXT_framebuffer_object(load); + load_GL_EXT_vertex_array(load); + load_GL_EXT_vertex_shader(load); return GLVersion.major != 0 || GLVersion.minor != 0; } -- cgit v1.2.3 From d63e32a377d00ff5defdcc15f0766456255b85fb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 11:21:24 +0200 Subject: Remove include, not supported on html5 AL/alext.h is not supported on html5 OpenAL implementation, just replaced by the defines used in audio module --- src/audio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 958b9838..e06994b8 100644 --- a/src/audio.c +++ b/src/audio.c @@ -37,12 +37,18 @@ #include "AL/al.h" // OpenAL basic header #include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) -#include "AL/alext.h" // OpenAL extensions for other format types #include // Required for: malloc(), free() #include // Required for: strcmp(), strncmp() #include // Required for: FILE, fopen(), fclose(), fread() +#ifndef AL_FORMAT_MONO_FLOAT32 + #define AL_FORMAT_MONO_FLOAT32 0x10010 +#endif +#ifndef AL_FORMAT_STEREO_FLOAT32 + #define AL_FORMAT_STEREO_FLOAT32 0x10011 +#endif + #if defined(AUDIO_STANDALONE) #include // Required for: va_list, va_start(), vfprintf(), va_end() #else -- cgit v1.2.3 From 8de1427803682f2ab0ca3ceda7834c72d4e9c030 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 11:48:42 +0200 Subject: Remove release files from src directory --- src/libraylib.bc | Bin 710808 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/libraylib.bc (limited to 'src') diff --git a/src/libraylib.bc b/src/libraylib.bc deleted file mode 100644 index 0b385eb8..00000000 Binary files a/src/libraylib.bc and /dev/null differ -- cgit v1.2.3 From 38847169480ea52e77a27949c139eca574ac2ba0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 12:01:39 +0200 Subject: Corrected a couple of warnings --- src/audio.c | 1 - src/external/jar_mod.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index e06994b8..a76a453f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -144,7 +144,6 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- static Music musicChannels_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time static MixChannel_t *mixChannels_g[MAX_MIX_CHANNELS]; // What mix channels are currently active -static bool musicEnabled_g = false; static int lastAudioError = 0; // Registers last audio error diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h index e0169d5e..c39db65a 100644 --- a/src/external/jar_mod.h +++ b/src/external/jar_mod.h @@ -64,7 +64,7 @@ // - "Load" a MOD from file, context must already be initialized. // Return size of file in bytes. // ------------------------------------------- -// void jar_mod_fillbuffer( jar_mod_context_t * modctx, unsigned short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) +// void jar_mod_fillbuffer( jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf ) // // - Generate and return the next samples chunk to outbuffer. // nbsample specify the number of stereo 16bits samples you want. @@ -1557,7 +1557,7 @@ mulong jar_mod_current_samples(jar_mod_context_t * modctx) // Works, however it is very slow, this data should be cached to ensure it is run only once per file mulong jar_mod_max_samples(jar_mod_context_t * ctx) { - muint buff[2]; + mint buff[2]; mulong len; mulong lastcount = ctx->loopcount; -- cgit v1.2.3 From c46c0fc6520914d6e9488282c02c96395d8bea9f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 12:18:08 +0200 Subject: Corrected keywords usage --- src/physac.h | 8 -------- src/raygui.h | 8 -------- src/raymath.h | 18 ++++++++---------- 3 files changed, 8 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index f576ad8a..6a90dc29 100644 --- a/src/physac.h +++ b/src/physac.h @@ -142,10 +142,6 @@ typedef struct PhysicBodyData { bool enabled; } PhysicBodyData, *PhysicBody; -#ifdef __cplusplus -extern "C" { // Prevents name mangling of functions -#endif - //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- @@ -161,10 +157,6 @@ PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius) PHYSACDEF Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) -#ifdef __cplusplus -} -#endif - #endif // PHYSAC_H diff --git a/src/raygui.h b/src/raygui.h index f13b68cd..74f131d5 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -239,10 +239,6 @@ typedef enum GuiProperty { TEXTBOX_TEXT_FONTSIZE } GuiProperty; -#ifdef __cplusplus -extern "C" { -#endif - //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -369,10 +365,6 @@ RAYGUIDEF void LoadGuiStyle(const char *fileName); // Loa RAYGUIDEF void SetStyleProperty(int guiProperty, int value); // Set one style property RAYGUIDEF int GetStyleProperty(int guiProperty); // Get one style property -#ifdef __cplusplus -} -#endif - #endif // RAYGUI_H diff --git a/src/raymath.h b/src/raymath.h index 4075a1a9..10eabb6b 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -47,10 +47,16 @@ #include "raylib.h" // Required for structs: Vector3, Matrix #endif +#ifdef __cplusplus + #define RMEXTERN extern "C" // Functions visible from other files (no name mangling of functions in C++) +#else + #define RMEXTERN extern // Functions visible from other files +#endif + #if defined(RAYMATH_EXTERN_INLINE) - #define RMDEF extern inline + #define RMDEF RMEXTERN inline // Functions are embeded inline (compiler generated code) #else - #define RMDEF extern + #define RMDEF RMEXTERN #endif //---------------------------------------------------------------------------------- @@ -105,10 +111,6 @@ typedef struct Quaternion { #ifndef RAYMATH_EXTERN_INLINE -#ifdef __cplusplus -extern "C" { -#endif - //------------------------------------------------------------------------------------ // Functions Declaration to work with Vector3 //------------------------------------------------------------------------------------ @@ -166,10 +168,6 @@ RMDEF Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle); // Returns RMDEF void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle); // Returns the rotation angle and axis for a given quaternion RMDEF void QuaternionTransform(Quaternion *q, Matrix mat); // Transform a quaternion given a transformation matrix -#ifdef __cplusplus -} -#endif - #endif // notdef RAYMATH_EXTERN_INLINE #endif // RAYMATH_H -- cgit v1.2.3 From 68a02e567d5fea42d1593e7932a0e052cf244d52 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 12:41:03 +0200 Subject: Avoid external variable whiteTexture To get it, use GetDefaultTexture() --- src/models.c | 4 ++-- src/rlgl.c | 3 +-- src/shapes.c | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 8d9219e3..8deabcb0 100644 --- a/src/models.c +++ b/src/models.c @@ -50,7 +50,7 @@ //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -extern unsigned int whiteTexture; +// ... //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -811,7 +811,7 @@ void UnloadMaterial(Material material) // Link a texture to a model void SetModelTexture(Model *model, Texture2D texture) { - if (texture.id <= 0) model->material.texDiffuse.id = whiteTexture; // Use default white texture + if (texture.id <= 0) model->material.texDiffuse = GetDefaultTexture(); // Use default white texture else model->material.texDiffuse = texture; } diff --git a/src/rlgl.c b/src/rlgl.c index 9a88a818..d4502595 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -228,8 +228,7 @@ static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; static int blendMode = 0; // White texture useful for plain color polys (required by shader) -// NOTE: It's required in shapes and models modules! -unsigned int whiteTexture; +static unsigned int whiteTexture; //---------------------------------------------------------------------------------- // Module specific Functions Declaration diff --git a/src/shapes.c b/src/shapes.c index 7129ac17..3ccfd660 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -44,7 +44,7 @@ //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -extern unsigned int whiteTexture; +// ... //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -137,7 +137,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) } else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { - rlEnableTexture(whiteTexture); // Default white texture + rlEnableTexture(GetDefaultTexture().id); // Default white texture rlBegin(RL_QUADS); for (int i = 0; i < 360; i += 20) @@ -220,7 +220,7 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color) } else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { - rlEnableTexture(whiteTexture); // Default white texture + rlEnableTexture(GetDefaultTexture().id); // Default white texture rlBegin(RL_QUADS); rlColor4ub(color.r, color.g, color.b, color.a); -- cgit v1.2.3 From 27ba7de1e4a9d262b2f3039433977d6cffa1da8d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Jun 2016 14:08:39 +0200 Subject: Added some comments --- src/core.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4223afd9..0c1e0454 100644 --- a/src/core.c +++ b/src/core.c @@ -209,23 +209,23 @@ float gamepadAxisValues[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis st #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) -static EGLDisplay display; // Native display device (physical screen connection) -static EGLSurface surface; // Surface to draw on, framebuffers (connected to context) -static EGLContext context; // Graphic context, mode in which drawing can be done -static EGLConfig config; // Graphic config -static uint64_t baseTime; // Base time measure for hi-res timer -static bool windowShouldClose = false; // Flag to set window for closing +static EGLDisplay display; // Native display device (physical screen connection) +static EGLSurface surface; // Surface to draw on, framebuffers (connected to context) +static EGLContext context; // Graphic context, mode in which drawing can be done +static EGLConfig config; // Graphic config +static uint64_t baseTime; // Base time measure for hi-res timer +static bool windowShouldClose = false; // Flag to set window for closing #endif #if defined(PLATFORM_OCULUS) // OVR device variables -static ovrSession session; -static ovrHmdDesc hmdDesc; -static ovrGraphicsLuid luid; -static OculusLayer layer; -static OculusBuffer buffer; -static OculusMirror mirror; -static unsigned int frameIndex = 0; +static ovrSession session; // Oculus session (pointer to ovrHmdStruct) +static ovrHmdDesc hmdDesc; // Oculus device descriptor parameters +static ovrGraphicsLuid luid; // Oculus locally unique identifier for the program (64 bit) +static OculusLayer layer; // Oculus drawing layer (similar to photoshop) +static OculusBuffer buffer; // Oculus internal buffers (texture chain and fbo) +static OculusMirror mirror; // Oculus mirror texture and fbo +static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif static unsigned int displayWidth, displayHeight; // Display width and height (monitor, device-screen, LCD, ...) @@ -280,8 +280,8 @@ static bool showLogo = false; // Track if showing logo at init is //---------------------------------------------------------------------------------- // Other Modules Functions Declaration (required by core) //---------------------------------------------------------------------------------- -extern void LoadDefaultFont(void); // [Module: text] Loads default font on InitWindow() -extern void UnloadDefaultFont(void); // [Module: text] Unloads default font from GPU memory +extern void LoadDefaultFont(void); // [Module: text] Loads default font on InitWindow() +extern void UnloadDefaultFont(void); // [Module: text] Unloads default font from GPU memory //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -523,7 +523,7 @@ void InitOculusDevice(void) { // Initialize Oculus device ovrResult result = ovr_Initialize(NULL); - if (OVR_FAILURE(result)) TraceLog(ERROR, "OVR: Could not initialize Oculus device"); + if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); result = ovr_Create(&session, &luid); if (OVR_FAILURE(result)) @@ -538,7 +538,7 @@ void InitOculusDevice(void) TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - TraceLog(INFO, "OVR: Serian Number: %s", hmdDesc.SerialNumber); + //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... -- cgit v1.2.3 From c10c49e44f31ddac4b544ddf8c973774afd288c6 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 11 Jun 2016 18:35:46 +0200 Subject: Convert physac module from static steps to fixed time steps Old physics update system used a static number of steps to calculate physics (450 for desktop and 64 for android). It was too much and it was limited by target frame time... Now physics update runs in a secondary thread using a fixed delta time value to update steps. Collisions are perfectly detected and resolved and performance has been improved so much. --- src/physac.h | 601 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 296 insertions(+), 305 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index 6a90dc29..dd2b1628 100644 --- a/src/physac.h +++ b/src/physac.h @@ -146,7 +146,7 @@ typedef struct PhysicBodyData { // Module Functions Declaration //---------------------------------------------------------------------------------- PHYSACDEF void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) -PHYSACDEF void UpdatePhysics(); // Update physic objects, calculating physic behaviours and collisions detection +PHYSACDEF void UpdatePhysics(double deltaTime); // Update physic objects, calculating physic behaviours and collisions detection PHYSACDEF void ClosePhysics(); // Unitialize all physic objects and empty the objects pool PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale); // Create a new physic body dinamically, initialize it and add to pool @@ -182,7 +182,7 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); // Defines and Macros //---------------------------------------------------------------------------------- #define MAX_PHYSIC_BODIES 256 // Maximum available physic bodies slots in bodies pool -#define PHYSICS_STEPS 64 // Physics update steps per frame for improved collision-detection +#define PHYSICS_TIMESTEP 0.016666 // Physics fixed time step (1/fps) #define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) #define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix @@ -218,376 +218,367 @@ PHYSACDEF void InitPhysics(Vector2 gravity) } // Update physic objects, calculating physic behaviours and collisions detection -PHYSACDEF void UpdatePhysics() +PHYSACDEF void UpdatePhysics(double deltaTime) { - // Reset all physic objects is grounded state - for (int i = 0; i < physicBodiesCount; i++) physicBodies[i]->rigidbody.isGrounded = false; - - for (int steps = 0; steps < PHYSICS_STEPS; steps++) + for (int i = 0; i < physicBodiesCount; i++) { - for (int i = 0; i < physicBodiesCount; i++) + if (physicBodies[i]->enabled) { - if (physicBodies[i]->enabled) + // Update physic behaviour + if (physicBodies[i]->rigidbody.enabled) { - // Update physic behaviour - if (physicBodies[i]->rigidbody.enabled) + // Apply friction to acceleration in X axis + if (physicBodies[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x -= physicBodies[i]->rigidbody.friction*deltaTime; + else if (physicBodies[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x += physicBodies[i]->rigidbody.friction*deltaTime; + else physicBodies[i]->rigidbody.acceleration.x = 0.0f; + + // Apply friction to acceleration in Y axis + if (physicBodies[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y -= physicBodies[i]->rigidbody.friction*deltaTime; + else if (physicBodies[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y += physicBodies[i]->rigidbody.friction*deltaTime; + else physicBodies[i]->rigidbody.acceleration.y = 0.0f; + + // Apply friction to velocity in X axis + if (physicBodies[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x -= physicBodies[i]->rigidbody.friction*deltaTime; + else if (physicBodies[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.friction*deltaTime; + else physicBodies[i]->rigidbody.velocity.x = 0.0f; + + // Apply friction to velocity in Y axis + if (physicBodies[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y -= physicBodies[i]->rigidbody.friction*deltaTime; + else if (physicBodies[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.friction*deltaTime; + else physicBodies[i]->rigidbody.velocity.y = 0.0f; + + // Apply gravity to velocity + if (physicBodies[i]->rigidbody.applyGravity) { - // Apply friction to acceleration in X axis - if (physicBodies[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicBodies[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else physicBodies[i]->rigidbody.acceleration.x = 0.0f; - - // Apply friction to acceleration in Y axis - if (physicBodies[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicBodies[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else physicBodies[i]->rigidbody.acceleration.y = 0.0f; - - // Apply friction to velocity in X axis - if (physicBodies[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicBodies[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else physicBodies[i]->rigidbody.velocity.x = 0.0f; - - // Apply friction to velocity in Y axis - if (physicBodies[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y -= physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else if (physicBodies[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.friction/PHYSICS_STEPS; - else physicBodies[i]->rigidbody.velocity.y = 0.0f; - - // Apply gravity to velocity - if (physicBodies[i]->rigidbody.applyGravity) - { - physicBodies[i]->rigidbody.velocity.x += gravityForce.x/PHYSICS_STEPS; - physicBodies[i]->rigidbody.velocity.y += gravityForce.y/PHYSICS_STEPS; - } - - // Apply acceleration to velocity - physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.acceleration.x/PHYSICS_STEPS; - physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.acceleration.y/PHYSICS_STEPS; - - // Apply velocity to position - physicBodies[i]->transform.position.x += physicBodies[i]->rigidbody.velocity.x/PHYSICS_STEPS; - physicBodies[i]->transform.position.y -= physicBodies[i]->rigidbody.velocity.y/PHYSICS_STEPS; + physicBodies[i]->rigidbody.velocity.x += gravityForce.x*deltaTime; + physicBodies[i]->rigidbody.velocity.y += gravityForce.y*deltaTime; } - // Update collision detection - if (physicBodies[i]->collider.enabled) + // Apply acceleration to velocity + physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.acceleration.x*deltaTime; + physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.acceleration.y*deltaTime; + + // Apply velocity to position + physicBodies[i]->transform.position.x += physicBodies[i]->rigidbody.velocity.x*deltaTime; + physicBodies[i]->transform.position.y -= physicBodies[i]->rigidbody.velocity.y*deltaTime; + } + + // Update collision detection + if (physicBodies[i]->collider.enabled) + { + // Update collider bounds + physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); + + // Check collision with other colliders + for (int k = 0; k < physicBodiesCount; k++) { - // Update collider bounds - physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); - - // Check collision with other colliders - for (int k = 0; k < physicBodiesCount; k++) + if (physicBodies[k]->collider.enabled && i != k) { - if (physicBodies[k]->collider.enabled && i != k) + // Resolve physic collision + // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) + // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) + + // 1. Calculate collision normal + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Define collision contact normal, direction and penetration depth + Vector2 contactNormal = { 0.0f, 0.0f }; + Vector2 direction = { 0.0f, 0.0f }; + float penetrationDepth = 0.0f; + + switch (physicBodies[i]->collider.type) { - // Resolve physic collision - // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) - // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) - - // 1. Calculate collision normal - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Define collision contact normal, direction and penetration depth - Vector2 contactNormal = { 0.0f, 0.0f }; - Vector2 direction = { 0.0f, 0.0f }; - float penetrationDepth = 0.0f; - - switch (physicBodies[i]->collider.type) + case COLLIDER_RECTANGLE: { - case COLLIDER_RECTANGLE: + switch (physicBodies[k]->collider.type) { - switch (physicBodies[k]->collider.type) + case COLLIDER_RECTANGLE: { - case COLLIDER_RECTANGLE: + // Check if colliders are overlapped + if (CheckCollisionRecs(physicBodies[i]->collider.bounds, physicBodies[k]->collider.bounds)) { - // Check if colliders are overlapped - if (CheckCollisionRecs(physicBodies[i]->collider.bounds, physicBodies[k]->collider.bounds)) + // Calculate direction vector from i to k + direction.x = (physicBodies[k]->transform.position.x + physicBodies[k]->transform.scale.x/2) - (physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2); + direction.y = (physicBodies[k]->transform.position.y + physicBodies[k]->transform.scale.y/2) - (physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2); + + // Define overlapping and penetration attributes + Vector2 overlap; + + // Calculate overlap on X axis + overlap.x = (physicBodies[i]->transform.scale.x + physicBodies[k]->transform.scale.x)/2 - abs(direction.x); + + // SAT test on X axis + if (overlap.x > 0.0f) { - // Calculate direction vector from i to k - direction.x = (physicBodies[k]->transform.position.x + physicBodies[k]->transform.scale.x/2) - (physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2); - direction.y = (physicBodies[k]->transform.position.y + physicBodies[k]->transform.scale.y/2) - (physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2); - - // Define overlapping and penetration attributes - Vector2 overlap; - - // Calculate overlap on X axis - overlap.x = (physicBodies[i]->transform.scale.x + physicBodies[k]->transform.scale.x)/2 - abs(direction.x); + // Calculate overlap on Y axis + overlap.y = (physicBodies[i]->transform.scale.y + physicBodies[k]->transform.scale.y)/2 - abs(direction.y); - // SAT test on X axis - if (overlap.x > 0.0f) + // SAT test on Y axis + if (overlap.y > 0.0f) { - // Calculate overlap on Y axis - overlap.y = (physicBodies[i]->transform.scale.y + physicBodies[k]->transform.scale.y)/2 - abs(direction.y); - - // SAT test on Y axis - if (overlap.y > 0.0f) + // Find out which axis is axis of least penetration + if (overlap.y > overlap.x) + { + // Point towards k knowing that direction points from i to k + if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; + else contactNormal = (Vector2){ 1.0f, 0.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.x; + } + else { - // Find out which axis is axis of least penetration - if (overlap.y > overlap.x) - { - // Point towards k knowing that direction points from i to k - if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; - else contactNormal = (Vector2){ 1.0f, 0.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.x; - } - else - { - // Point towards k knowing that direction points from i to k - if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; - else contactNormal = (Vector2){ 0.0f, -1.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.y; - } + // Point towards k knowing that direction points from i to k + if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; + else contactNormal = (Vector2){ 0.0f, -1.0f }; + + // Update penetration depth for position correction + penetrationDepth = overlap.y; } } } - } break; - case COLLIDER_CIRCLE: + } + } break; + case COLLIDER_CIRCLE: + { + if (CheckCollisionCircleRec(physicBodies[k]->transform.position, physicBodies[k]->collider.radius, physicBodies[i]->collider.bounds)) { - if (CheckCollisionCircleRec(physicBodies[k]->transform.position, physicBodies[k]->collider.radius, physicBodies[i]->collider.bounds)) + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2; + direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width; + else closestPoint.x = physicBodies[i]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicBodies[i]->collider.bounds.y + physicBodies[i]->collider.bounds.height; + else closestPoint.y = physicBodies[i]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2; - direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width; - else closestPoint.x = physicBodies[i]->collider.bounds.x; + // Recalculate direction based on closest point position + direction.x = physicBodies[k]->transform.position.x - closestPoint.x; + direction.y = physicBodies[k]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); - if (direction.y > 0.0f) closestPoint.y = physicBodies[i]->collider.bounds.y + physicBodies[i]->collider.bounds.height; - else closestPoint.y = physicBodies[i]->collider.bounds.y; + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) + // Calculate penetration depth + penetrationDepth = physicBodies[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) { - // Recalculate direction based on closest point position - direction.x = physicBodies[k]->transform.position.x - closestPoint.x; - direction.y = physicBodies[k]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicBodies[k]->collider.radius - distance; + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y - physicBodies[k]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y + physicBodies[k]->collider.radius); + } } else { - if (abs(direction.y) < abs(direction.x)) + // Calculate final contact normal + if (direction.x > 0.0f) { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y - physicBodies[k]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y + physicBodies[k]->collider.radius); - } + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[k]->transform.position.x + physicBodies[k]->collider.radius - physicBodies[i]->collider.bounds.x); } - else + else { - // Calculate final contact normal - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[k]->transform.position.x + physicBodies[k]->collider.radius - physicBodies[i]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width - physicBodies[k]->transform.position.x - physicBodies[k]->collider.radius); - } + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width - physicBodies[k]->transform.position.x - physicBodies[k]->collider.radius); } } } - } break; - } - } break; - case COLLIDER_CIRCLE: + } + } break; + } + } break; + case COLLIDER_CIRCLE: + { + switch (physicBodies[k]->collider.type) { - switch (physicBodies[k]->collider.type) + case COLLIDER_RECTANGLE: { - case COLLIDER_RECTANGLE: + if (CheckCollisionCircleRec(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->collider.bounds)) { - if (CheckCollisionCircleRec(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->collider.bounds)) + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x + physicBodies[i]->transform.scale.x/2 - physicBodies[i]->transform.position.x; + direction.y = physicBodies[k]->transform.position.y + physicBodies[i]->transform.scale.y/2 - physicBodies[i]->transform.position.y; + + // Calculate closest point on rectangle to circle + Vector2 closestPoint = { 0.0f, 0.0f }; + if (direction.x > 0.0f) closestPoint.x = physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width; + else closestPoint.x = physicBodies[k]->collider.bounds.x; + + if (direction.y > 0.0f) closestPoint.y = physicBodies[k]->collider.bounds.y + physicBodies[k]->collider.bounds.height; + else closestPoint.y = physicBodies[k]->collider.bounds.y; + + // Check if the closest point is inside the circle + if (CheckCollisionPointCircle(closestPoint, physicBodies[i]->transform.position, physicBodies[i]->collider.radius)) { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x + physicBodies[i]->transform.scale.x/2 - physicBodies[i]->transform.position.x; - direction.y = physicBodies[k]->transform.position.y + physicBodies[i]->transform.scale.y/2 - physicBodies[i]->transform.position.y; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width; - else closestPoint.x = physicBodies[k]->collider.bounds.x; + // Recalculate direction based on closest point position + direction.x = physicBodies[i]->transform.position.x - closestPoint.x; + direction.y = physicBodies[i]->transform.position.y - closestPoint.y; + float distance = Vector2Length(direction); - if (direction.y > 0.0f) closestPoint.y = physicBodies[k]->collider.bounds.y + physicBodies[k]->collider.bounds.height; - else closestPoint.y = physicBodies[k]->collider.bounds.y; + // Calculate final contact normal + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicBodies[i]->transform.position, physicBodies[i]->collider.radius)) + // Calculate penetration depth + penetrationDepth = physicBodies[k]->collider.radius - distance; + } + else + { + if (abs(direction.y) < abs(direction.x)) { - // Recalculate direction based on closest point position - direction.x = physicBodies[i]->transform.position.x - closestPoint.x; - direction.y = physicBodies[i]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicBodies[k]->collider.radius - distance; + if (direction.y > 0.0f) + { + contactNormal = (Vector2){ 0.0f, -1.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y - physicBodies[i]->collider.radius); + } + else + { + contactNormal = (Vector2){ 0.0f, 1.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y + physicBodies[i]->collider.radius); + } } else { - if (abs(direction.y) < abs(direction.x)) + // Calculate final contact normal and penetration depth + if (direction.x > 0.0f) { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y - physicBodies[i]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y + physicBodies[i]->collider.radius); - } + contactNormal = (Vector2){ 1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[i]->transform.position.x + physicBodies[i]->collider.radius - physicBodies[k]->collider.bounds.x); } - else + else { - // Calculate final contact normal and penetration depth - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[i]->transform.position.x + physicBodies[i]->collider.radius - physicBodies[k]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width - physicBodies[i]->transform.position.x - physicBodies[i]->collider.radius); - } + contactNormal = (Vector2){ -1.0f, 0.0f }; + penetrationDepth = fabs(physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width - physicBodies[i]->transform.position.x - physicBodies[i]->collider.radius); } } } - } break; - case COLLIDER_CIRCLE: + } + } break; + case COLLIDER_CIRCLE: + { + // Check if colliders are overlapped + if (CheckCollisionCircles(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) { - // Check if colliders are overlapped - if (CheckCollisionCircles(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) - { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x; - direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y; - - // Calculate distance between circles - float distance = Vector2Length(direction); - - // Check if circles are not completely overlapped - if (distance != 0.0f) - { - // Calculate contact normal direction (Y axis needs to be flipped) - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - } - else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values + // Calculate direction vector between circles + direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x; + direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y; + + // Calculate distance between circles + float distance = Vector2Length(direction); + + // Check if circles are not completely overlapped + if (distance != 0.0f) + { + // Calculate contact normal direction (Y axis needs to be flipped) + contactNormal.x = direction.x/distance; + contactNormal.y = -direction.y/distance; } - } break; - default: break; - } - } break; - default: break; - } + else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values + } + } break; + default: break; + } + } break; + default: break; + } + + // Update rigidbody grounded state + if (physicBodies[i]->rigidbody.enabled) physicBodies[i]->rigidbody.isGrounded = (contactNormal.y < 0.0f); + + // 2. Calculate collision impulse + // ------------------------------------------------------------------------------------------------------------------------------------- + + // Calculate relative velocity + Vector2 relVelocity = { 0.0f, 0.0f }; + relVelocity.x = physicBodies[k]->rigidbody.velocity.x - physicBodies[i]->rigidbody.velocity.x; + relVelocity.y = physicBodies[k]->rigidbody.velocity.y - physicBodies[i]->rigidbody.velocity.y; + + // Calculate relative velocity in terms of the normal direction + float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); + + // Dot not resolve if velocities are separating + if (velAlongNormal <= 0.0f) + { + // Calculate minimum bounciness value from both objects + float e = fminf(physicBodies[i]->rigidbody.bounciness, physicBodies[k]->rigidbody.bounciness); - // Update rigidbody grounded state - if (physicBodies[i]->rigidbody.enabled) - { - if (contactNormal.y < 0.0f) physicBodies[i]->rigidbody.isGrounded = true; - } + // Calculate impulse scalar value + float j = -(1.0f + e)*velAlongNormal; + j /= 1.0f/physicBodies[i]->rigidbody.mass + 1.0f/physicBodies[k]->rigidbody.mass; - // 2. Calculate collision impulse - // ------------------------------------------------------------------------------------------------------------------------------------- + // Calculate final impulse vector + Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; - // Calculate relative velocity - Vector2 relVelocity = { 0.0f, 0.0f }; - relVelocity.x = physicBodies[k]->rigidbody.velocity.x - physicBodies[i]->rigidbody.velocity.x; - relVelocity.y = physicBodies[k]->rigidbody.velocity.y - physicBodies[i]->rigidbody.velocity.y; - - // Calculate relative velocity in terms of the normal direction - float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); - - // Dot not resolve if velocities are separating - if (velAlongNormal <= 0.0f) + // Calculate collision mass ration + float massSum = physicBodies[i]->rigidbody.mass + physicBodies[k]->rigidbody.mass; + float ratio = 0.0f; + + // Apply impulse to current rigidbodies velocities if they are enabled + if (physicBodies[i]->rigidbody.enabled) { - // Calculate minimum bounciness value from both objects - float e = fminf(physicBodies[i]->rigidbody.bounciness, physicBodies[k]->rigidbody.bounciness); - - // Calculate impulse scalar value - float j = -(1.0f + e)*velAlongNormal; - j /= 1.0f/physicBodies[i]->rigidbody.mass + 1.0f/physicBodies[k]->rigidbody.mass; + // Calculate inverted mass ration + ratio = physicBodies[i]->rigidbody.mass/massSum; - // Calculate final impulse vector - Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; + // Apply impulse direction to velocity + physicBodies[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + physicBodies[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + } + + if (physicBodies[k]->rigidbody.enabled) + { + // Calculate inverted mass ration + ratio = physicBodies[k]->rigidbody.mass/massSum; - // Calculate collision mass ration - float massSum = physicBodies[i]->rigidbody.mass + physicBodies[k]->rigidbody.mass; - float ratio = 0.0f; + // Apply impulse direction to velocity + physicBodies[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + physicBodies[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); + } + + // 3. Correct colliders overlaping (transform position) + // --------------------------------------------------------------------------------------------------------------------------------- + + // Calculate transform position penetration correction + Vector2 posCorrection; + posCorrection.x = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; + posCorrection.y = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; + + // Fix transform positions + if (physicBodies[i]->rigidbody.enabled) + { + // Fix physic objects transform position + physicBodies[i]->transform.position.x -= 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.x; + physicBodies[i]->transform.position.y += 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.y; - // Apply impulse to current rigidbodies velocities if they are enabled - if (physicBodies[i]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicBodies[i]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicBodies[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - physicBodies[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - } + // Update collider bounds + physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); - if (physicBodies[k]->rigidbody.enabled) + if (physicBodies[k]->rigidbody.enabled) { - // Calculate inverted mass ration - ratio = physicBodies[k]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicBodies[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - physicBodies[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - } - - // 3. Correct colliders overlaping (transform position) - // --------------------------------------------------------------------------------------------------------------------------------- - - // Calculate transform position penetration correction - Vector2 posCorrection; - posCorrection.x = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; - posCorrection.y = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; - - // Fix transform positions - if (physicBodies[i]->rigidbody.enabled) - { // Fix physic objects transform position - physicBodies[i]->transform.position.x -= 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.x; - physicBodies[i]->transform.position.y += 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.y; + physicBodies[k]->transform.position.x += 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.x; + physicBodies[k]->transform.position.y -= 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.y; // Update collider bounds - physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); - - if (physicBodies[k]->rigidbody.enabled) - { - // Fix physic objects transform position - physicBodies[k]->transform.position.x += 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.x; - physicBodies[k]->transform.position.y -= 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicBodies[k]->collider.bounds = TransformToRectangle(physicBodies[k]->transform); - } + physicBodies[k]->collider.bounds = TransformToRectangle(physicBodies[k]->transform); } } } -- cgit v1.2.3 From 7999bbafa8c5333b69edb7881f64986f3e3e3d45 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sat, 11 Jun 2016 19:14:25 +0200 Subject: Make GetTime() public to be used externally --- src/core.c | 3 +-- src/raylib.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 0c1e0454..00b2e82f 100644 --- a/src/core.c +++ b/src/core.c @@ -290,7 +290,6 @@ static void InitDisplay(int width, int height); // Initialize display de static void InitGraphics(void); // Initialize OpenGL graphics static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer -static double GetTime(void); // Returns time since InitTimer() was run static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed static void PollInputEvents(void); // Register user events @@ -2039,7 +2038,7 @@ static void InitTimer(void) } // Get current time measure (in seconds) since InitTimer() -static double GetTime(void) +double GetTime(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetTime(); diff --git a/src/raylib.h b/src/raylib.h index bfcb9bf5..bfed533b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -582,6 +582,7 @@ Matrix GetCameraMatrix(Camera camera); // Returns camera tr void SetTargetFPS(int fps); // Set target FPS (maximum) float GetFPS(void); // Returns current FPS float GetFrameTime(void); // Returns time in seconds for one frame +double GetTime(void); // Returns time since InitTimer() was run internally Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value int GetHexValue(Color color); // Returns hexadecimal value for a Color -- cgit v1.2.3 From 66ec0b5d829de6db72d8a7508373ab52a8c3c1f2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 12 Jun 2016 10:47:50 +0200 Subject: Oculus tracking correction --- src/core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 0c1e0454..122453e3 100644 --- a/src/core.c +++ b/src/core.c @@ -565,7 +565,7 @@ void CloseOculusDevice(void) void UpdateOculusTracking(void) { frameIndex++; - + ovrPosef eyePoses[2]; ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); @@ -644,14 +644,6 @@ void BeginDrawing(void) previousTime = currentTime; #if defined(PLATFORM_OCULUS) - frameIndex++; - - ovrPosef eyePoses[2]; - ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - - layer.eyeLayer.RenderPose[0] = eyePoses[0]; - layer.eyeLayer.RenderPose[1] = eyePoses[1]; - SetOculusBuffer(session, buffer); #endif -- cgit v1.2.3 From 4dae3385c3871d4629a0e391165173ed86f87dcf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 12 Jun 2016 19:40:08 +0200 Subject: Record draw call for batch processing Just started working on this, not sure if it would be available for raylib 1.5 --- src/rlgl.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index d4502595..e69ff983 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -159,9 +159,17 @@ typedef struct { // Draw call type // NOTE: Used to track required draw-calls, organized by texture typedef struct { - GLuint textureId; int vertexCount; - // TODO: Store draw state -> blending mode, shader + GLuint vaoId; + GLuint textureId; + GLuint shaderId; + + Matrix projection; + Matrix modelview; + + // TODO: Store additional draw state data + //int blendMode; + //Guint fboId; } DrawCall; //---------------------------------------------------------------------------------- @@ -2099,6 +2107,24 @@ void *rlglReadTexturePixels(Texture2D texture) return pixels; } +/* +// TODO: Record draw calls to be processed in batch +// NOTE: Global state must be kept +void rlglRecordDraw(void) +{ + // TODO: Before adding a new draw, check if anything changed from last stored draw +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + draws[drawsCounter].vaoId = currentState.vaoId; // lines.id, trangles.id, quads.id? + draws[drawsCounter].textureId = currentState.textureId; // whiteTexture? + draws[drawsCounter].shaderId = currentState.shaderId; // defaultShader.id + draws[drawsCounter].projection = projection; + draws[drawsCounter].modelview = modelview; + draws[drawsCounter].vertexCount = currentState.vertexCount; + + drawsCounter++; +#endif +} +*/ //---------------------------------------------------------------------------------- // Module Functions Definition - Shaders Functions -- cgit v1.2.3 From 16609d6702f60ae714741888837a80756628400c Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sun, 12 Jun 2016 22:04:51 +0200 Subject: Revert "Make GetTime() public to be used externally" This reverts commit 7999bbafa8c5333b69edb7881f64986f3e3e3d45. --- src/core.c | 3 ++- src/raylib.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 899f0162..122453e3 100644 --- a/src/core.c +++ b/src/core.c @@ -290,6 +290,7 @@ static void InitDisplay(int width, int height); // Initialize display de static void InitGraphics(void); // Initialize OpenGL graphics static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer +static double GetTime(void); // Returns time since InitTimer() was run static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed static void PollInputEvents(void); // Register user events @@ -2030,7 +2031,7 @@ static void InitTimer(void) } // Get current time measure (in seconds) since InitTimer() -double GetTime(void) +static double GetTime(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetTime(); diff --git a/src/raylib.h b/src/raylib.h index bfed533b..bfcb9bf5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -582,7 +582,6 @@ Matrix GetCameraMatrix(Camera camera); // Returns camera tr void SetTargetFPS(int fps); // Set target FPS (maximum) float GetFPS(void); // Returns current FPS float GetFrameTime(void); // Returns time in seconds for one frame -double GetTime(void); // Returns time since InitTimer() was run internally Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value int GetHexValue(Color color); // Returns hexadecimal value for a Color -- cgit v1.2.3 From 5625c11e9982838498722c33d832289f3e79fa6e Mon Sep 17 00:00:00 2001 From: victorfisac Date: Sun, 12 Jun 2016 22:07:06 +0200 Subject: Added internal hi-resolution timer to physac... ... and now physac thread creation is done in InitPhysics() and it is destroyed in ClosePhysics(). User just need to call these functions to use physac module. --- src/physac.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index dd2b1628..ea8801c3 100644 --- a/src/physac.h +++ b/src/physac.h @@ -177,6 +177,18 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); #endif #include // Required for: cos(), sin(), abs(), fminf() +#include // Required for typedef unsigned long long int uint64_t, used by hi-res timer +#include // Required for: pthread_create() +#include "utils.h" // Required for: TraceLog() + +#if defined(PLATFORM_DESKTOP) + // Functions required to query time on Windows + int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); + int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); +#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + #include // Required for: timespec + #include // Required for: clock_gettime() +#endif //---------------------------------------------------------------------------------- // Defines and Macros @@ -195,6 +207,9 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- +static bool physicsThreadEnabled = false; // Physics calculations thread exit control +static uint64_t baseTime; // Base time measure for hi-res timer +static double currentTime, previousTime; // Used to track timmings static PhysicBody physicBodies[MAX_PHYSIC_BODIES]; // Physic bodies pool static int physicBodiesCount; // Counts current enabled physic bodies static Vector2 gravityForce; // Gravity force @@ -202,6 +217,9 @@ static Vector2 gravityForce; // Gravity f //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- +static void* PhysicsThread(void *arg); // Physics calculations thread function +static void InitTimer(void); // Initialize hi-resolution timer +static double GetCurrentTime(void); // Time measure returned are microseconds static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 static float Vector2Length(Vector2 v); // Returns the length of a Vector2 @@ -215,6 +233,10 @@ PHYSACDEF void InitPhysics(Vector2 gravity) // Initialize physics variables physicBodiesCount = 0; gravityForce = gravity; + + // Create physics thread + pthread_t tid; + pthread_create(&tid, NULL, &PhysicsThread, NULL); } // Update physic objects, calculating physic behaviours and collisions detection @@ -592,6 +614,9 @@ PHYSACDEF void UpdatePhysics(double deltaTime) // Unitialize all physic objects and empty the objects pool PHYSACDEF void ClosePhysics() { + // Exit physics thread loop + physicsThreadEnabled = false; + // Free all dynamic memory allocations for (int i = 0; i < physicBodiesCount; i++) PHYSAC_FREE(physicBodies[i]); @@ -710,6 +735,65 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform) //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- +// Physics calculations thread function +static void* PhysicsThread(void *arg) +{ + // Initialize thread loop state + physicsThreadEnabled = true; + + // Initialize hi-resolution timer + InitTimer(); + + // Physics update loop + while (physicsThreadEnabled) + { + currentTime = GetCurrentTime(); + double deltaTime = (double)(currentTime - previousTime); + previousTime = currentTime; + + // Delta time value needs to be inverse multiplied by physics time step value (1/target fps) + UpdatePhysics(deltaTime/PHYSICS_TIMESTEP); + } + + return NULL; +} + +// Initialize hi-resolution timer +static void InitTimer(void) +{ +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec now; + + if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success + { + baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + } + else TraceLog(WARNING, "No hi-resolution timer available"); +#endif + + previousTime = GetCurrentTime(); // Get time as double +} + +// Time measure returned are microseconds +static double GetCurrentTime(void) +{ +#if defined(PLATFORM_DESKTOP) + unsigned long long int clockFrequency, currentTime; + + QueryPerformanceFrequency(&clockFrequency); + QueryPerformanceCounter(¤tTime); + + return (double)(currentTime/clockFrequency); +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; + + return (double)(time - baseTime)*1e-9; +#endif +} // Returns the dot product of two Vector2 static float Vector2DotProduct(Vector2 v1, Vector2 v2) -- cgit v1.2.3 From 47afda2549cdab0429047fcc64540a4ed5d0ede7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 11:55:32 +0200 Subject: Removed useless function: GetGestureDetected() Use instead: IsGestureDetected() --- src/gestures.c | 7 ------- src/gestures.h | 7 +++---- src/raylib.h | 7 +++---- 3 files changed, 6 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gestures.c b/src/gestures.c index 90371620..8e6005b3 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -298,13 +298,6 @@ bool IsGestureDetected(int gesture) else return false; } -// Check gesture type -int GetGestureDetected(void) -{ - // Get current gesture only if enabled - return (enabledGestures & currentGesture); -} - // Get number of touch points int GetTouchPointsCount(void) { diff --git a/src/gestures.h b/src/gestures.h index f2bdaba4..ab5287cc 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -90,13 +90,12 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- +void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +bool IsGestureDetected(int gesture); // Check if a gesture have been detected void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures void UpdateGestures(void); // Update gestures detected (must be called every frame) -bool IsGestureDetected(int gesture); // Check if a gesture have been detected -int GetGestureDetected(void); // Get latest detected gesture -void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -int GetTouchPointsCount(void); // Get touch points count +int GetTouchPointsCount(void); // Get touch points count float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle diff --git a/src/raylib.h b/src/raylib.h index bfcb9bf5..343e86f1 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -644,13 +644,12 @@ bool IsButtonReleased(int button); // Detect if an android //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ +void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +bool IsGestureDetected(int gesture); // Check if a gesture have been detected void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents()) -bool IsGestureDetected(int gesture); // Check if a gesture have been detected -int GetGestureDetected(void); // Get latest detected gesture -void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -int GetTouchPointsCount(void); // Get touch points count +int GetTouchPointsCount(void); // Get touch points count float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle -- cgit v1.2.3 From 3d6be7fd8000bf7bd9da0b9ad8764021f86c0d01 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 12:01:57 +0200 Subject: Added GetGestureDetected() again... Required by gestures example.... --- src/gestures.c | 27 +++++++++++++++++---------- src/gestures.h | 1 + src/raylib.h | 1 + 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gestures.c b/src/gestures.c index 8e6005b3..57b96bd2 100644 --- a/src/gestures.c +++ b/src/gestures.c @@ -111,6 +111,19 @@ static double GetCurrentTime(void); // Module Functions Definition //---------------------------------------------------------------------------------- +// Enable only desired getures to be detected +void SetGesturesEnabled(unsigned int gestureFlags) +{ + enabledGestures = gestureFlags; +} + +// Check if a gesture have been detected +bool IsGestureDetected(int gesture) +{ + if ((enabledGestures & currentGesture) == gesture) return true; + else return false; +} + // Process gesture event and translate it into gestures void ProcessGestureEvent(GestureEvent event) { @@ -291,13 +304,6 @@ void UpdateGestures(void) } } -// Check if a gesture have been detected -bool IsGestureDetected(int gesture) -{ - if ((enabledGestures & currentGesture) == gesture) return true; - else return false; -} - // Get number of touch points int GetTouchPointsCount(void) { @@ -306,10 +312,11 @@ int GetTouchPointsCount(void) return pointCount; } -// Enable only desired getures to be detected -void SetGesturesEnabled(unsigned int gestureFlags) +// Get latest detected gesture +int GetGestureDetected(void) { - enabledGestures = gestureFlags; + // Get current gesture only if enabled + return (enabledGestures & currentGesture); } // Hold time measured in ms diff --git a/src/gestures.h b/src/gestures.h index ab5287cc..912d0b92 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -96,6 +96,7 @@ void ProcessGestureEvent(GestureEvent event); // Process gesture event void UpdateGestures(void); // Update gestures detected (must be called every frame) int GetTouchPointsCount(void); // Get touch points count +int GetGestureDetected(void); // Get latest detected gesture float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle diff --git a/src/raylib.h b/src/raylib.h index 343e86f1..9120ddc4 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -650,6 +650,7 @@ void ProcessGestureEvent(GestureEvent event); // Process gesture event void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents()) int GetTouchPointsCount(void); // Get touch points count +int GetGestureDetected(void); // Get latest detected gesture float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle -- cgit v1.2.3 From 3a5fc0c32042714efde93c72903d2cd89c4cff50 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 12:12:02 +0200 Subject: Move global data to implementation --- src/raygui.h | 208 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 107 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/raygui.h b/src/raygui.h index 74f131d5..42cf264b 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -242,106 +242,7 @@ typedef enum GuiProperty { //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static const char *guiPropertyName[] = { - "GLOBAL_BASE_COLOR", - "GLOBAL_BORDER_COLOR", - "GLOBAL_TEXT_COLOR", - "GLOBAL_TEXT_FONTSIZE", - "GLOBAL_BORDER_WIDTH", - "BACKGROUND_COLOR", - "LABEL_BORDER_WIDTH", - "LABEL_TEXT_COLOR", - "LABEL_TEXT_PADDING", - "BUTTON_BORDER_WIDTH", - "BUTTON_TEXT_PADDING", - "BUTTON_DEFAULT_BORDER_COLOR", - "BUTTON_DEFAULT_INSIDE_COLOR", - "BUTTON_DEFAULT_TEXT_COLOR", - "BUTTON_HOVER_BORDER_COLOR", - "BUTTON_HOVER_INSIDE_COLOR", - "BUTTON_HOVER_TEXT_COLOR", - "BUTTON_PRESSED_BORDER_COLOR", - "BUTTON_PRESSED_INSIDE_COLOR", - "BUTTON_PRESSED_TEXT_COLOR", - "TOGGLE_TEXT_PADDING", - "TOGGLE_BORDER_WIDTH", - "TOGGLE_DEFAULT_BORDER_COLOR", - "TOGGLE_DEFAULT_INSIDE_COLOR", - "TOGGLE_DEFAULT_TEXT_COLOR", - "TOGGLE_HOVER_BORDER_COLOR", - "TOGGLE_HOVER_INSIDE_COLOR", - "TOGGLE_HOVER_TEXT_COLOR", - "TOGGLE_PRESSED_BORDER_COLOR", - "TOGGLE_PRESSED_INSIDE_COLOR", - "TOGGLE_PRESSED_TEXT_COLOR", - "TOGGLE_ACTIVE_BORDER_COLOR", - "TOGGLE_ACTIVE_INSIDE_COLOR", - "TOGGLE_ACTIVE_TEXT_COLOR", - "TOGGLEGROUP_PADDING", - "SLIDER_BORDER_WIDTH", - "SLIDER_BUTTON_BORDER_WIDTH", - "SLIDER_BORDER_COLOR", - "SLIDER_INSIDE_COLOR", - "SLIDER_DEFAULT_COLOR", - "SLIDER_HOVER_COLOR", - "SLIDER_ACTIVE_COLOR", - "SLIDERBAR_BORDER_COLOR", - "SLIDERBAR_INSIDE_COLOR", - "SLIDERBAR_DEFAULT_COLOR", - "SLIDERBAR_HOVER_COLOR", - "SLIDERBAR_ACTIVE_COLOR", - "SLIDERBAR_ZERO_LINE_COLOR", - "PROGRESSBAR_BORDER_COLOR", - "PROGRESSBAR_INSIDE_COLOR", - "PROGRESSBAR_PROGRESS_COLOR", - "PROGRESSBAR_BORDER_WIDTH", - "SPINNER_LABEL_BORDER_COLOR", - "SPINNER_LABEL_INSIDE_COLOR", - "SPINNER_DEFAULT_BUTTON_BORDER_COLOR", - "SPINNER_DEFAULT_BUTTON_INSIDE_COLOR", - "SPINNER_DEFAULT_SYMBOL_COLOR", - "SPINNER_DEFAULT_TEXT_COLOR", - "SPINNER_HOVER_BUTTON_BORDER_COLOR", - "SPINNER_HOVER_BUTTON_INSIDE_COLOR", - "SPINNER_HOVER_SYMBOL_COLOR", - "SPINNER_HOVER_TEXT_COLOR", - "SPINNER_PRESSED_BUTTON_BORDER_COLOR", - "SPINNER_PRESSED_BUTTON_INSIDE_COLOR", - "SPINNER_PRESSED_SYMBOL_COLOR", - "SPINNER_PRESSED_TEXT_COLOR", - "COMBOBOX_PADDING", - "COMBOBOX_BUTTON_WIDTH", - "COMBOBOX_BUTTON_HEIGHT", - "COMBOBOX_BORDER_WIDTH", - "COMBOBOX_DEFAULT_BORDER_COLOR", - "COMBOBOX_DEFAULT_INSIDE_COLOR", - "COMBOBOX_DEFAULT_TEXT_COLOR", - "COMBOBOX_DEFAULT_LIST_TEXT_COLOR", - "COMBOBOX_HOVER_BORDER_COLOR", - "COMBOBOX_HOVER_INSIDE_COLOR", - "COMBOBOX_HOVER_TEXT_COLOR", - "COMBOBOX_HOVER_LIST_TEXT_COLOR", - "COMBOBOX_PRESSED_BORDER_COLOR", - "COMBOBOX_PRESSED_INSIDE_COLOR", - "COMBOBOX_PRESSED_TEXT_COLOR", - "COMBOBOX_PRESSED_LIST_BORDER_COLOR", - "COMBOBOX_PRESSED_LIST_INSIDE_COLOR", - "COMBOBOX_PRESSED_LIST_TEXT_COLOR", - "CHECKBOX_DEFAULT_BORDER_COLOR", - "CHECKBOX_DEFAULT_INSIDE_COLOR", - "CHECKBOX_HOVER_BORDER_COLOR", - "CHECKBOX_HOVER_INSIDE_COLOR", - "CHECKBOX_CLICK_BORDER_COLOR", - "CHECKBOX_CLICK_INSIDE_COLOR", - "CHECKBOX_STATUS_ACTIVE_COLOR", - "CHECKBOX_INSIDE_WIDTH", - "TEXTBOX_BORDER_WIDTH", - "TEXTBOX_BORDER_COLOR", - "TEXTBOX_INSIDE_COLOR", - "TEXTBOX_TEXT_COLOR", - "TEXTBOX_LINE_COLOR", - "TEXTBOX_TEXT_FONTSIZE" -}; +// ... //---------------------------------------------------------------------------------- // Module Functions Declaration @@ -517,6 +418,108 @@ static int style[NUM_PROPERTIES] = { 10 // TEXTBOX_TEXT_FONTSIZE }; +// GUI property names (to read/write style text files) +static const char *guiPropertyName[] = { + "GLOBAL_BASE_COLOR", + "GLOBAL_BORDER_COLOR", + "GLOBAL_TEXT_COLOR", + "GLOBAL_TEXT_FONTSIZE", + "GLOBAL_BORDER_WIDTH", + "BACKGROUND_COLOR", + "LABEL_BORDER_WIDTH", + "LABEL_TEXT_COLOR", + "LABEL_TEXT_PADDING", + "BUTTON_BORDER_WIDTH", + "BUTTON_TEXT_PADDING", + "BUTTON_DEFAULT_BORDER_COLOR", + "BUTTON_DEFAULT_INSIDE_COLOR", + "BUTTON_DEFAULT_TEXT_COLOR", + "BUTTON_HOVER_BORDER_COLOR", + "BUTTON_HOVER_INSIDE_COLOR", + "BUTTON_HOVER_TEXT_COLOR", + "BUTTON_PRESSED_BORDER_COLOR", + "BUTTON_PRESSED_INSIDE_COLOR", + "BUTTON_PRESSED_TEXT_COLOR", + "TOGGLE_TEXT_PADDING", + "TOGGLE_BORDER_WIDTH", + "TOGGLE_DEFAULT_BORDER_COLOR", + "TOGGLE_DEFAULT_INSIDE_COLOR", + "TOGGLE_DEFAULT_TEXT_COLOR", + "TOGGLE_HOVER_BORDER_COLOR", + "TOGGLE_HOVER_INSIDE_COLOR", + "TOGGLE_HOVER_TEXT_COLOR", + "TOGGLE_PRESSED_BORDER_COLOR", + "TOGGLE_PRESSED_INSIDE_COLOR", + "TOGGLE_PRESSED_TEXT_COLOR", + "TOGGLE_ACTIVE_BORDER_COLOR", + "TOGGLE_ACTIVE_INSIDE_COLOR", + "TOGGLE_ACTIVE_TEXT_COLOR", + "TOGGLEGROUP_PADDING", + "SLIDER_BORDER_WIDTH", + "SLIDER_BUTTON_BORDER_WIDTH", + "SLIDER_BORDER_COLOR", + "SLIDER_INSIDE_COLOR", + "SLIDER_DEFAULT_COLOR", + "SLIDER_HOVER_COLOR", + "SLIDER_ACTIVE_COLOR", + "SLIDERBAR_BORDER_COLOR", + "SLIDERBAR_INSIDE_COLOR", + "SLIDERBAR_DEFAULT_COLOR", + "SLIDERBAR_HOVER_COLOR", + "SLIDERBAR_ACTIVE_COLOR", + "SLIDERBAR_ZERO_LINE_COLOR", + "PROGRESSBAR_BORDER_COLOR", + "PROGRESSBAR_INSIDE_COLOR", + "PROGRESSBAR_PROGRESS_COLOR", + "PROGRESSBAR_BORDER_WIDTH", + "SPINNER_LABEL_BORDER_COLOR", + "SPINNER_LABEL_INSIDE_COLOR", + "SPINNER_DEFAULT_BUTTON_BORDER_COLOR", + "SPINNER_DEFAULT_BUTTON_INSIDE_COLOR", + "SPINNER_DEFAULT_SYMBOL_COLOR", + "SPINNER_DEFAULT_TEXT_COLOR", + "SPINNER_HOVER_BUTTON_BORDER_COLOR", + "SPINNER_HOVER_BUTTON_INSIDE_COLOR", + "SPINNER_HOVER_SYMBOL_COLOR", + "SPINNER_HOVER_TEXT_COLOR", + "SPINNER_PRESSED_BUTTON_BORDER_COLOR", + "SPINNER_PRESSED_BUTTON_INSIDE_COLOR", + "SPINNER_PRESSED_SYMBOL_COLOR", + "SPINNER_PRESSED_TEXT_COLOR", + "COMBOBOX_PADDING", + "COMBOBOX_BUTTON_WIDTH", + "COMBOBOX_BUTTON_HEIGHT", + "COMBOBOX_BORDER_WIDTH", + "COMBOBOX_DEFAULT_BORDER_COLOR", + "COMBOBOX_DEFAULT_INSIDE_COLOR", + "COMBOBOX_DEFAULT_TEXT_COLOR", + "COMBOBOX_DEFAULT_LIST_TEXT_COLOR", + "COMBOBOX_HOVER_BORDER_COLOR", + "COMBOBOX_HOVER_INSIDE_COLOR", + "COMBOBOX_HOVER_TEXT_COLOR", + "COMBOBOX_HOVER_LIST_TEXT_COLOR", + "COMBOBOX_PRESSED_BORDER_COLOR", + "COMBOBOX_PRESSED_INSIDE_COLOR", + "COMBOBOX_PRESSED_TEXT_COLOR", + "COMBOBOX_PRESSED_LIST_BORDER_COLOR", + "COMBOBOX_PRESSED_LIST_INSIDE_COLOR", + "COMBOBOX_PRESSED_LIST_TEXT_COLOR", + "CHECKBOX_DEFAULT_BORDER_COLOR", + "CHECKBOX_DEFAULT_INSIDE_COLOR", + "CHECKBOX_HOVER_BORDER_COLOR", + "CHECKBOX_HOVER_INSIDE_COLOR", + "CHECKBOX_CLICK_BORDER_COLOR", + "CHECKBOX_CLICK_INSIDE_COLOR", + "CHECKBOX_STATUS_ACTIVE_COLOR", + "CHECKBOX_INSIDE_WIDTH", + "TEXTBOX_BORDER_WIDTH", + "TEXTBOX_BORDER_COLOR", + "TEXTBOX_INSIDE_COLOR", + "TEXTBOX_TEXT_COLOR", + "TEXTBOX_LINE_COLOR", + "TEXTBOX_TEXT_FONTSIZE" +}; + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -529,7 +532,9 @@ static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if p static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' // NOTE: raygui depend on some raylib input and drawing functions -// TODO: Replace by your own functions +// TODO: To use raygui as standalone library, those functions must be overwrite by custom ones + +// Input management functions static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } static int IsMouseButtonDown(int button) { return 0; } static int IsMouseButtonPressed(int button) { return 0; } @@ -539,6 +544,7 @@ static int IsMouseButtonUp(int button) { return 0; } static int GetKeyPressed(void) { return 0; } // NOTE: Only used by GuiTextBox() static int IsKeyDown(int key) { return 0; } // NOTE: Only used by GuiSpinner() +// Drawing related functions static int MeasureText(const char *text, int fontSize) { return 0; } static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } static void DrawRectangleRec(Rectangle rec, Color color) { } -- cgit v1.2.3 From c25b4cdc69999c851594f7644ce89556be039c70 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 15:42:04 +0200 Subject: Move OpenGL extensions loading to rlgl --- src/core.c | 20 +++----------------- src/rlgl.c | 21 ++++++++++++++++++++- src/rlgl.h | 3 ++- 3 files changed, 25 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 122453e3..bd49b549 100644 --- a/src/core.c +++ b/src/core.c @@ -58,10 +58,6 @@ #define PLATFORM_DESKTOP // Enable PLATFORM_DESKTOP code-base #endif -#if defined(PLATFORM_DESKTOP) - #include "external/glad.h" // GLAD library: Manage OpenGL headers and extensions -#endif - #if defined(PLATFORM_OCULUS) #include "../examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL #endif @@ -1747,19 +1743,9 @@ static void InitDisplay(int width, int height) #endif #if defined(PLATFORM_DESKTOP) - // Load OpenGL 3.3 extensions using GLAD - if (rlGetVersion() == OPENGL_33) - { - // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions - if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); - else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); - - if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); - else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); - - // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans - //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object - } + // Load OpenGL 3.3 extensions + // NOTE: GLFW loader function is passed as parameter + rlglLoadExtensions(glfwGetProcAddress); #endif // Enables GPU v-sync, so frames are not limited to screen refresh rate (60Hz -> 60 FPS) diff --git a/src/rlgl.c b/src/rlgl.c index e69ff983..26961ca9 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -872,6 +872,23 @@ int rlGetVersion(void) #endif } +// Load OpenGL extensions +// NOTE: External loader function could be passed as a pointer +void rlglLoadExtensions(void *loader) +{ +#if defined(GRAPHICS_API_OPENGL_33) + // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions + if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); + else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); + + if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); + else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); + + // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans + //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object +#endif +} + //---------------------------------------------------------------------------------- // Module Functions Definition - rlgl Functions //---------------------------------------------------------------------------------- @@ -1184,11 +1201,13 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma GLuint id = 0; // Check texture format support by OpenGL 1.1 (compressed textures not supported) - if ((rlGetVersion() == OPENGL_11) && (textureFormat >= 8)) +#if defined(GRAPHICS_API_OPENGL_11) + if (textureFormat >= 8) { TraceLog(WARNING, "OpenGL 1.1 does not support GPU compressed texture formats"); return id; } +#endif if ((!texCompDXTSupported) && ((textureFormat == COMPRESSED_DXT1_RGB) || (textureFormat == COMPRESSED_DXT1_RGBA) || (textureFormat == COMPRESSED_DXT3_RGBA) || (textureFormat == COMPRESSED_DXT5_RGBA))) diff --git a/src/rlgl.h b/src/rlgl.h index 9c25f710..28c50b8f 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -48,7 +48,7 @@ // Choose opengl version here or just define it at compile time: -DGRAPHICS_API_OPENGL_33 //#define GRAPHICS_API_OPENGL_11 // Only available on PLATFORM_DESKTOP -//#define GRAPHICS_API_OPENGL_33 // Only available on PLATFORM_DESKTOP +//#define GRAPHICS_API_OPENGL_33 // Only available on PLATFORM_DESKTOP or PLATFORM_OCULUS //#define GRAPHICS_API_OPENGL_ES2 // Only available on PLATFORM_ANDROID or PLATFORM_RPI or PLATFORM_WEB // Security check in case no GRAPHICS_API_OPENGL_* defined @@ -296,6 +296,7 @@ void rlglInit(void); // Initialize rlgl (shaders, VAO void rlglClose(void); // De-init rlgl void rlglDraw(void); // Draw VAO/VBO void rlglInitGraphics(int offsetX, int offsetY, int width, int height); // Initialize Graphics (OpenGL stuff) +void rlglLoadExtensions(void *loader); // Load OpenGL extensions unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) -- cgit v1.2.3 From 0d0f306fc2f6bed7526df2044263698753811d0a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 17:15:00 +0200 Subject: Add Oculus SDK LibOVR library to external deps. --- .../LibOVR/Include/Extras/OVR_CAPI_Util.h | 196 + .../OculusSDK/LibOVR/Include/Extras/OVR_Math.h | 3785 ++++++++++++++++++++ .../LibOVR/Include/Extras/OVR_StereoProjection.h | 70 + src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h | 2116 +++++++++++ .../OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h | 76 + .../OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h | 155 + .../OculusSDK/LibOVR/Include/OVR_CAPI_GL.h | 99 + .../OculusSDK/LibOVR/Include/OVR_CAPI_Keys.h | 53 + .../OculusSDK/LibOVR/Include/OVR_ErrorCode.h | 209 ++ .../OculusSDK/LibOVR/Include/OVR_Version.h | 60 + 10 files changed, 6819 insertions(+) create mode 100644 src/external/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h create mode 100644 src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h create mode 100644 src/external/OculusSDK/LibOVR/Include/Extras/OVR_StereoProjection.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Keys.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h create mode 100644 src/external/OculusSDK/LibOVR/Include/OVR_Version.h (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h new file mode 100644 index 00000000..552f3b12 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_CAPI_Util.h @@ -0,0 +1,196 @@ +/********************************************************************************//** +\file OVR_CAPI_Util.h +\brief This header provides LibOVR utility function declarations +\copyright Copyright 2015-2016 Oculus VR, LLC All Rights reserved. +*************************************************************************************/ + +#ifndef OVR_CAPI_Util_h +#define OVR_CAPI_Util_h + + +#include "../OVR_CAPI.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/// Enumerates modifications to the projection matrix based on the application's needs. +/// +/// \see ovrMatrix4f_Projection +/// +typedef enum ovrProjectionModifier_ +{ + /// Use for generating a default projection matrix that is: + /// * Right-handed. + /// * Near depth values stored in the depth buffer are smaller than far depth values. + /// * Both near and far are explicitly defined. + /// * With a clipping range that is (0 to w). + ovrProjection_None = 0x00, + + /// Enable if using left-handed transformations in your application. + ovrProjection_LeftHanded = 0x01, + + /// After the projection transform is applied, far values stored in the depth buffer will be less than closer depth values. + /// NOTE: Enable only if the application is using a floating-point depth buffer for proper precision. + ovrProjection_FarLessThanNear = 0x02, + + /// When this flag is used, the zfar value pushed into ovrMatrix4f_Projection() will be ignored + /// NOTE: Enable only if ovrProjection_FarLessThanNear is also enabled where the far clipping plane will be pushed to infinity. + ovrProjection_FarClipAtInfinity = 0x04, + + /// Enable if the application is rendering with OpenGL and expects a projection matrix with a clipping range of (-w to w). + /// Ignore this flag if your application already handles the conversion from D3D range (0 to w) to OpenGL. + ovrProjection_ClipRangeOpenGL = 0x08, +} ovrProjectionModifier; + + +/// Return values for ovr_Detect. +/// +/// \see ovr_Detect +/// +typedef struct OVR_ALIGNAS(8) ovrDetectResult_ +{ + /// Is ovrFalse when the Oculus Service is not running. + /// This means that the Oculus Service is either uninstalled or stopped. + /// IsOculusHMDConnected will be ovrFalse in this case. + /// Is ovrTrue when the Oculus Service is running. + /// This means that the Oculus Service is installed and running. + /// IsOculusHMDConnected will reflect the state of the HMD. + ovrBool IsOculusServiceRunning; + + /// Is ovrFalse when an Oculus HMD is not detected. + /// If the Oculus Service is not running, this will be ovrFalse. + /// Is ovrTrue when an Oculus HMD is detected. + /// This implies that the Oculus Service is also installed and running. + ovrBool IsOculusHMDConnected; + + OVR_UNUSED_STRUCT_PAD(pad0, 6) ///< \internal struct padding + +} ovrDetectResult; + +OVR_STATIC_ASSERT(sizeof(ovrDetectResult) == 8, "ovrDetectResult size mismatch"); + + +/// Detects Oculus Runtime and Device Status +/// +/// Checks for Oculus Runtime and Oculus HMD device status without loading the LibOVRRT +/// shared library. This may be called before ovr_Initialize() to help decide whether or +/// not to initialize LibOVR. +/// +/// \param[in] timeoutMilliseconds Specifies a timeout to wait for HMD to be attached or 0 to poll. +/// +/// \return Returns an ovrDetectResult object indicating the result of detection. +/// +/// \see ovrDetectResult +/// +OVR_PUBLIC_FUNCTION(ovrDetectResult) ovr_Detect(int timeoutMilliseconds); + +// On the Windows platform, +#ifdef _WIN32 + /// This is the Windows Named Event name that is used to check for HMD connected state. + #define OVR_HMD_CONNECTED_EVENT_NAME L"OculusHMDConnected" +#endif // _WIN32 + + +/// Used to generate projection from ovrEyeDesc::Fov. +/// +/// \param[in] fov Specifies the ovrFovPort to use. +/// \param[in] znear Distance to near Z limit. +/// \param[in] zfar Distance to far Z limit. +/// \param[in] projectionModFlags A combination of the ovrProjectionModifier flags. +/// +/// \return Returns the calculated projection matrix. +/// +/// \see ovrProjectionModifier +/// +OVR_PUBLIC_FUNCTION(ovrMatrix4f) ovrMatrix4f_Projection(ovrFovPort fov, float znear, float zfar, unsigned int projectionModFlags); + + +/// Extracts the required data from the result of ovrMatrix4f_Projection. +/// +/// \param[in] projection Specifies the project matrix from which to extract ovrTimewarpProjectionDesc. +/// \param[in] projectionModFlags A combination of the ovrProjectionModifier flags. +/// \return Returns the extracted ovrTimewarpProjectionDesc. +/// \see ovrTimewarpProjectionDesc +/// +OVR_PUBLIC_FUNCTION(ovrTimewarpProjectionDesc) ovrTimewarpProjectionDesc_FromProjection(ovrMatrix4f projection, unsigned int projectionModFlags); + + +/// Generates an orthographic sub-projection. +/// +/// Used for 2D rendering, Y is down. +/// +/// \param[in] projection The perspective matrix that the orthographic matrix is derived from. +/// \param[in] orthoScale Equal to 1.0f / pixelsPerTanAngleAtCenter. +/// \param[in] orthoDistance Equal to the distance from the camera in meters, such as 0.8m. +/// \param[in] HmdToEyeOffsetX Specifies the offset of the eye from the center. +/// +/// \return Returns the calculated projection matrix. +/// +OVR_PUBLIC_FUNCTION(ovrMatrix4f) ovrMatrix4f_OrthoSubProjection(ovrMatrix4f projection, ovrVector2f orthoScale, + float orthoDistance, float HmdToEyeOffsetX); + + + +/// Computes offset eye poses based on headPose returned by ovrTrackingState. +/// +/// \param[in] headPose Indicates the HMD position and orientation to use for the calculation. +/// \param[in] hmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from +/// ovr_GetRenderDesc. For monoscopic rendering, use a vector that is the average +/// of the two vectors for both eyes. +/// \param[out] outEyePoses If outEyePoses are used for rendering, they should be passed to +/// ovr_SubmitFrame in ovrLayerEyeFov::RenderPose or ovrLayerEyeFovDepth::RenderPose. +/// +OVR_PUBLIC_FUNCTION(void) ovr_CalcEyePoses(ovrPosef headPose, + const ovrVector3f hmdToEyeOffset[2], + ovrPosef outEyePoses[2]); + + +/// Returns the predicted head pose in outHmdTrackingState and offset eye poses in outEyePoses. +/// +/// This is a thread-safe function where caller should increment frameIndex with every frame +/// and pass that index where applicable to functions called on the rendering thread. +/// Assuming outEyePoses are used for rendering, it should be passed as a part of ovrLayerEyeFov. +/// The caller does not need to worry about applying HmdToEyeOffset to the returned outEyePoses variables. +/// +/// \param[in] hmd Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] frameIndex Specifies the targeted frame index, or 0 to refer to one frame after +/// the last time ovr_SubmitFrame was called. +/// \param[in] latencyMarker Specifies that this call is the point in time where +/// the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer +/// provides "SensorSampleTimestamp", that will override the value stored here. +/// \param[in] hmdToEyeOffset Can be ovrEyeRenderDesc.HmdToEyeOffset returned from +/// ovr_GetRenderDesc. For monoscopic rendering, use a vector that is the average +/// of the two vectors for both eyes. +/// \param[out] outEyePoses The predicted eye poses. +/// \param[out] outSensorSampleTime The time when this function was called. May be NULL, in which case it is ignored. +/// +OVR_PUBLIC_FUNCTION(void) ovr_GetEyePoses(ovrSession session, long long frameIndex, ovrBool latencyMarker, + const ovrVector3f hmdToEyeOffset[2], + ovrPosef outEyePoses[2], + double* outSensorSampleTime); + + + +/// Tracking poses provided by the SDK come in a right-handed coordinate system. If an application +/// is passing in ovrProjection_LeftHanded into ovrMatrix4f_Projection, then it should also use +/// this function to flip the HMD tracking poses to be left-handed. +/// +/// While this utility function is intended to convert a left-handed ovrPosef into a right-handed +/// coordinate system, it will also work for converting right-handed to left-handed since the +/// flip operation is the same for both cases. +/// +/// \param[in] inPose that is right-handed +/// \param[out] outPose that is requested to be left-handed (can be the same pointer to inPose) +/// +OVR_PUBLIC_FUNCTION(void) ovrPosef_FlipHandedness(const ovrPosef* inPose, ovrPosef* outPose); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + + +#endif // Header include guard diff --git a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h new file mode 100644 index 00000000..c182ed5b --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h @@ -0,0 +1,3785 @@ +/********************************************************************************//** +\file OVR_Math.h +\brief Implementation of 3D primitives such as vectors, matrices. +\copyright Copyright 2014-2016 Oculus VR, LLC All Rights reserved. +*************************************************************************************/ + +#ifndef OVR_Math_h +#define OVR_Math_h + + +// This file is intended to be independent of the rest of LibOVR and LibOVRKernel and thus +// has no #include dependencies on either. + +#include +#include +#include +#include +#include +#include +#include "../OVR_CAPI.h" // Currently required due to a dependence on the ovrFovPort_ declaration. + +#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable: 4127) // conditional expression is constant +#endif + + +#if defined(_MSC_VER) + #define OVRMath_sprintf sprintf_s +#else + #define OVRMath_sprintf snprintf +#endif + + +//------------------------------------------------------------------------------------- +// ***** OVR_MATH_ASSERT +// +// Independent debug break implementation for OVR_Math.h. + +#if !defined(OVR_MATH_DEBUG_BREAK) + #if defined(_DEBUG) + #if defined(_MSC_VER) + #define OVR_MATH_DEBUG_BREAK __debugbreak() + #else + #define OVR_MATH_DEBUG_BREAK __builtin_trap() + #endif + #else + #define OVR_MATH_DEBUG_BREAK ((void)0) + #endif +#endif + + +//------------------------------------------------------------------------------------- +// ***** OVR_MATH_ASSERT +// +// Independent OVR_MATH_ASSERT implementation for OVR_Math.h. + +#if !defined(OVR_MATH_ASSERT) + #if defined(_DEBUG) + #define OVR_MATH_ASSERT(p) if (!(p)) { OVR_MATH_DEBUG_BREAK; } + #else + #define OVR_MATH_ASSERT(p) ((void)0) + #endif +#endif + + +//------------------------------------------------------------------------------------- +// ***** OVR_MATH_STATIC_ASSERT +// +// Independent OVR_MATH_ASSERT implementation for OVR_Math.h. + +#if !defined(OVR_MATH_STATIC_ASSERT) + #if defined(__cplusplus) && ((defined(_MSC_VER) && (defined(_MSC_VER) >= 1600)) || defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)) + #define OVR_MATH_STATIC_ASSERT static_assert + #else + #if !defined(OVR_SA_UNUSED) + #if defined(__GNUC__) || defined(__clang__) + #define OVR_SA_UNUSED __attribute__((unused)) + #else + #define OVR_SA_UNUSED + #endif + #define OVR_SA_PASTE(a,b) a##b + #define OVR_SA_HELP(a,b) OVR_SA_PASTE(a,b) + #endif + + #define OVR_MATH_STATIC_ASSERT(expression, msg) typedef char OVR_SA_HELP(compileTimeAssert, __LINE__) [((expression) != 0) ? 1 : -1] OVR_SA_UNUSED + #endif +#endif + + + +namespace OVR { + +template +const T OVRMath_Min(const T a, const T b) +{ return (a < b) ? a : b; } + +template +const T OVRMath_Max(const T a, const T b) +{ return (b < a) ? a : b; } + +template +void OVRMath_Swap(T& a, T& b) +{ T temp(a); a = b; b = temp; } + + +//------------------------------------------------------------------------------------- +// ***** Constants for 3D world/axis definitions. + +// Definitions of axes for coordinate and rotation conversions. +enum Axis +{ + Axis_X = 0, Axis_Y = 1, Axis_Z = 2 +}; + +// RotateDirection describes the rotation direction around an axis, interpreted as follows: +// CW - Clockwise while looking "down" from positive axis towards the origin. +// CCW - Counter-clockwise while looking from the positive axis towards the origin, +// which is in the negative axis direction. +// CCW is the default for the RHS coordinate system. Oculus standard RHS coordinate +// system defines Y up, X right, and Z back (pointing out from the screen). In this +// system Rotate_CCW around Z will specifies counter-clockwise rotation in XY plane. +enum RotateDirection +{ + Rotate_CCW = 1, + Rotate_CW = -1 +}; + +// Constants for right handed and left handed coordinate systems +enum HandedSystem +{ + Handed_R = 1, Handed_L = -1 +}; + +// AxisDirection describes which way the coordinate axis points. Used by WorldAxes. +enum AxisDirection +{ + Axis_Up = 2, + Axis_Down = -2, + Axis_Right = 1, + Axis_Left = -1, + Axis_In = 3, + Axis_Out = -3 +}; + +struct WorldAxes +{ + AxisDirection XAxis, YAxis, ZAxis; + + WorldAxes(AxisDirection x, AxisDirection y, AxisDirection z) + : XAxis(x), YAxis(y), ZAxis(z) + { OVR_MATH_ASSERT(abs(x) != abs(y) && abs(y) != abs(z) && abs(z) != abs(x));} +}; + +} // namespace OVR + + +//------------------------------------------------------------------------------------// +// ***** C Compatibility Types + +// These declarations are used to support conversion between C types used in +// LibOVR C interfaces and their C++ versions. As an example, they allow passing +// Vector3f into a function that expects ovrVector3f. + +typedef struct ovrQuatf_ ovrQuatf; +typedef struct ovrQuatd_ ovrQuatd; +typedef struct ovrSizei_ ovrSizei; +typedef struct ovrSizef_ ovrSizef; +typedef struct ovrSized_ ovrSized; +typedef struct ovrRecti_ ovrRecti; +typedef struct ovrVector2i_ ovrVector2i; +typedef struct ovrVector2f_ ovrVector2f; +typedef struct ovrVector2d_ ovrVector2d; +typedef struct ovrVector3f_ ovrVector3f; +typedef struct ovrVector3d_ ovrVector3d; +typedef struct ovrVector4f_ ovrVector4f; +typedef struct ovrVector4d_ ovrVector4d; +typedef struct ovrMatrix2f_ ovrMatrix2f; +typedef struct ovrMatrix2d_ ovrMatrix2d; +typedef struct ovrMatrix3f_ ovrMatrix3f; +typedef struct ovrMatrix3d_ ovrMatrix3d; +typedef struct ovrMatrix4f_ ovrMatrix4f; +typedef struct ovrMatrix4d_ ovrMatrix4d; +typedef struct ovrPosef_ ovrPosef; +typedef struct ovrPosed_ ovrPosed; +typedef struct ovrPoseStatef_ ovrPoseStatef; +typedef struct ovrPoseStated_ ovrPoseStated; + +namespace OVR { + +// Forward-declare our templates. +template class Quat; +template class Size; +template class Rect; +template class Vector2; +template class Vector3; +template class Vector4; +template class Matrix2; +template class Matrix3; +template class Matrix4; +template class Pose; +template class PoseState; + +// CompatibleTypes::Type is used to lookup a compatible C-version of a C++ class. +template +struct CompatibleTypes +{ + // Declaration here seems necessary for MSVC; specializations are + // used instead. + typedef struct {} Type; +}; + +// Specializations providing CompatibleTypes::Type value. +template<> struct CompatibleTypes > { typedef ovrQuatf Type; }; +template<> struct CompatibleTypes > { typedef ovrQuatd Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix2f Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix2d Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix3f Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix3d Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix4f Type; }; +template<> struct CompatibleTypes > { typedef ovrMatrix4d Type; }; +template<> struct CompatibleTypes > { typedef ovrSizei Type; }; +template<> struct CompatibleTypes > { typedef ovrSizef Type; }; +template<> struct CompatibleTypes > { typedef ovrSized Type; }; +template<> struct CompatibleTypes > { typedef ovrRecti Type; }; +template<> struct CompatibleTypes > { typedef ovrVector2i Type; }; +template<> struct CompatibleTypes > { typedef ovrVector2f Type; }; +template<> struct CompatibleTypes > { typedef ovrVector2d Type; }; +template<> struct CompatibleTypes > { typedef ovrVector3f Type; }; +template<> struct CompatibleTypes > { typedef ovrVector3d Type; }; +template<> struct CompatibleTypes > { typedef ovrVector4f Type; }; +template<> struct CompatibleTypes > { typedef ovrVector4d Type; }; +template<> struct CompatibleTypes > { typedef ovrPosef Type; }; +template<> struct CompatibleTypes > { typedef ovrPosed Type; }; + +//------------------------------------------------------------------------------------// +// ***** Math +// +// Math class contains constants and functions. This class is a template specialized +// per type, with Math and Math being distinct. +template +class Math +{ +public: + // By default, support explicit conversion to float. This allows Vector2 to + // compile, for example. + typedef float OtherFloatType; + + static int Tolerance() { return 0; } // Default value so integer types compile +}; + + +//------------------------------------------------------------------------------------// +// ***** double constants +#define MATH_DOUBLE_PI 3.14159265358979323846 +#define MATH_DOUBLE_TWOPI (2*MATH_DOUBLE_PI) +#define MATH_DOUBLE_PIOVER2 (0.5*MATH_DOUBLE_PI) +#define MATH_DOUBLE_PIOVER4 (0.25*MATH_DOUBLE_PI) +#define MATH_FLOAT_MAXVALUE (FLT_MAX) + +#define MATH_DOUBLE_RADTODEGREEFACTOR (360.0 / MATH_DOUBLE_TWOPI) +#define MATH_DOUBLE_DEGREETORADFACTOR (MATH_DOUBLE_TWOPI / 360.0) + +#define MATH_DOUBLE_E 2.71828182845904523536 +#define MATH_DOUBLE_LOG2E 1.44269504088896340736 +#define MATH_DOUBLE_LOG10E 0.434294481903251827651 +#define MATH_DOUBLE_LN2 0.693147180559945309417 +#define MATH_DOUBLE_LN10 2.30258509299404568402 + +#define MATH_DOUBLE_SQRT2 1.41421356237309504880 +#define MATH_DOUBLE_SQRT1_2 0.707106781186547524401 + +#define MATH_DOUBLE_TOLERANCE 1e-12 // a default number for value equality tolerance: about 4500*Epsilon; +#define MATH_DOUBLE_SINGULARITYRADIUS 1e-12 // about 1-cos(.0001 degree), for gimbal lock numerical problems + +//------------------------------------------------------------------------------------// +// ***** float constants +#define MATH_FLOAT_PI float(MATH_DOUBLE_PI) +#define MATH_FLOAT_TWOPI float(MATH_DOUBLE_TWOPI) +#define MATH_FLOAT_PIOVER2 float(MATH_DOUBLE_PIOVER2) +#define MATH_FLOAT_PIOVER4 float(MATH_DOUBLE_PIOVER4) + +#define MATH_FLOAT_RADTODEGREEFACTOR float(MATH_DOUBLE_RADTODEGREEFACTOR) +#define MATH_FLOAT_DEGREETORADFACTOR float(MATH_DOUBLE_DEGREETORADFACTOR) + +#define MATH_FLOAT_E float(MATH_DOUBLE_E) +#define MATH_FLOAT_LOG2E float(MATH_DOUBLE_LOG2E) +#define MATH_FLOAT_LOG10E float(MATH_DOUBLE_LOG10E) +#define MATH_FLOAT_LN2 float(MATH_DOUBLE_LN2) +#define MATH_FLOAT_LN10 float(MATH_DOUBLE_LN10) + +#define MATH_FLOAT_SQRT2 float(MATH_DOUBLE_SQRT2) +#define MATH_FLOAT_SQRT1_2 float(MATH_DOUBLE_SQRT1_2) + +#define MATH_FLOAT_TOLERANCE 1e-5f // a default number for value equality tolerance: 1e-5, about 84*EPSILON; +#define MATH_FLOAT_SINGULARITYRADIUS 1e-7f // about 1-cos(.025 degree), for gimbal lock numerical problems + + + +// Single-precision Math constants class. +template<> +class Math +{ +public: + typedef double OtherFloatType; + + static inline float Tolerance() { return MATH_FLOAT_TOLERANCE; }; // a default number for value equality tolerance + static inline float SingularityRadius() { return MATH_FLOAT_SINGULARITYRADIUS; }; // for gimbal lock numerical problems +}; + +// Double-precision Math constants class +template<> +class Math +{ +public: + typedef float OtherFloatType; + + static inline double Tolerance() { return MATH_DOUBLE_TOLERANCE; }; // a default number for value equality tolerance + static inline double SingularityRadius() { return MATH_DOUBLE_SINGULARITYRADIUS; }; // for gimbal lock numerical problems +}; + +typedef Math Mathf; +typedef Math Mathd; + +// Conversion functions between degrees and radians +// (non-templated to ensure passing int arguments causes warning) +inline float RadToDegree(float rad) { return rad * MATH_FLOAT_RADTODEGREEFACTOR; } +inline double RadToDegree(double rad) { return rad * MATH_DOUBLE_RADTODEGREEFACTOR; } + +inline float DegreeToRad(float deg) { return deg * MATH_FLOAT_DEGREETORADFACTOR; } +inline double DegreeToRad(double deg) { return deg * MATH_DOUBLE_DEGREETORADFACTOR; } + +// Square function +template +inline T Sqr(T x) { return x*x; } + +// Sign: returns 0 if x == 0, -1 if x < 0, and 1 if x > 0 +template +inline T Sign(T x) { return (x != T(0)) ? (x < T(0) ? T(-1) : T(1)) : T(0); } + +// Numerically stable acos function +inline float Acos(float x) { return (x > 1.0f) ? 0.0f : (x < -1.0f) ? MATH_FLOAT_PI : acosf(x); } +inline double Acos(double x) { return (x > 1.0) ? 0.0 : (x < -1.0) ? MATH_DOUBLE_PI : acos(x); } + +// Numerically stable asin function +inline float Asin(float x) { return (x > 1.0f) ? MATH_FLOAT_PIOVER2 : (x < -1.0f) ? -MATH_FLOAT_PIOVER2 : asinf(x); } +inline double Asin(double x) { return (x > 1.0) ? MATH_DOUBLE_PIOVER2 : (x < -1.0) ? -MATH_DOUBLE_PIOVER2 : asin(x); } + +#if defined(_MSC_VER) + inline int isnan(double x) { return ::_isnan(x); } +#elif !defined(isnan) // Some libraries #define isnan. + inline int isnan(double x) { return ::isnan(x); } +#endif + +template +class Quat; + + +//------------------------------------------------------------------------------------- +// ***** Vector2<> + +// Vector2f (Vector2d) represents a 2-dimensional vector or point in space, +// consisting of coordinates x and y + +template +class Vector2 +{ +public: + typedef T ElementType; + static const size_t ElementCount = 2; + + T x, y; + + Vector2() : x(0), y(0) { } + Vector2(T x_, T y_) : x(x_), y(y_) { } + explicit Vector2(T s) : x(s), y(s) { } + explicit Vector2(const Vector2::OtherFloatType> &src) + : x((T)src.x), y((T)src.y) { } + + static Vector2 Zero() { return Vector2(0, 0); } + + // C-interop support. + typedef typename CompatibleTypes >::Type CompatibleType; + + Vector2(const CompatibleType& s) : x(s.x), y(s.y) { } + + operator const CompatibleType& () const + { + OVR_MATH_STATIC_ASSERT(sizeof(Vector2) == sizeof(CompatibleType), "sizeof(Vector2) failure"); + return reinterpret_cast(*this); + } + + + bool operator== (const Vector2& b) const { return x == b.x && y == b.y; } + bool operator!= (const Vector2& b) const { return x != b.x || y != b.y; } + + Vector2 operator+ (const Vector2& b) const { return Vector2(x + b.x, y + b.y); } + Vector2& operator+= (const Vector2& b) { x += b.x; y += b.y; return *this; } + Vector2 operator- (const Vector2& b) const { return Vector2(x - b.x, y - b.y); } + Vector2& operator-= (const Vector2& b) { x -= b.x; y -= b.y; return *this; } + Vector2 operator- () const { return Vector2(-x, -y); } + + // Scalar multiplication/division scales vector. + Vector2 operator* (T s) const { return Vector2(x*s, y*s); } + Vector2& operator*= (T s) { x *= s; y *= s; return *this; } + + Vector2 operator/ (T s) const { T rcp = T(1)/s; + return Vector2(x*rcp, y*rcp); } + Vector2& operator/= (T s) { T rcp = T(1)/s; + x *= rcp; y *= rcp; + return *this; } + + static Vector2 Min(const Vector2& a, const Vector2& b) { return Vector2((a.x < b.x) ? a.x : b.x, + (a.y < b.y) ? a.y : b.y); } + static Vector2 Max(const Vector2& a, const Vector2& b) { return Vector2((a.x > b.x) ? a.x : b.x, + (a.y > b.y) ? a.y : b.y); } + + Vector2 Clamped(T maxMag) const + { + T magSquared = LengthSq(); + if (magSquared <= Sqr(maxMag)) + return *this; + else + return *this * (maxMag / sqrt(magSquared)); + } + + // Compare two vectors for equality with tolerance. Returns true if vectors match withing tolerance. + bool IsEqual(const Vector2& b, T tolerance =Math::Tolerance()) const + { + return (fabs(b.x-x) <= tolerance) && + (fabs(b.y-y) <= tolerance); + } + bool Compare(const Vector2& b, T tolerance = Math::Tolerance()) const + { + return IsEqual(b, tolerance); + } + + // Access element by index + T& operator[] (int idx) + { + OVR_MATH_ASSERT(0 <= idx && idx < 2); + return *(&x + idx); + } + const T& operator[] (int idx) const + { + OVR_MATH_ASSERT(0 <= idx && idx < 2); + return *(&x + idx); + } + + // Entry-wise product of two vectors + Vector2 EntrywiseMultiply(const Vector2& b) const { return Vector2(x * b.x, y * b.y);} + + + // Multiply and divide operators do entry-wise math. Used Dot() for dot product. + Vector2 operator* (const Vector2& b) const { return Vector2(x * b.x, y * b.y); } + Vector2 operator/ (const Vector2& b) const { return Vector2(x / b.x, y / b.y); } + + // Dot product + // Used to calculate angle q between two vectors among other things, + // as (A dot B) = |a||b|cos(q). + T Dot(const Vector2& b) const { return x*b.x + y*b.y; } + + // Returns the angle from this vector to b, in radians. + T Angle(const Vector2& b) const + { + T div = LengthSq()*b.LengthSq(); + OVR_MATH_ASSERT(div != T(0)); + T result = Acos((this->Dot(b))/sqrt(div)); + return result; + } + + // Return Length of the vector squared. + T LengthSq() const { return (x * x + y * y); } + + // Return vector length. + T Length() const { return sqrt(LengthSq()); } + + // Returns squared distance between two points represented by vectors. + T DistanceSq(const Vector2& b) const { return (*this - b).LengthSq(); } + + // Returns distance between two points represented by vectors. + T Distance(const Vector2& b) const { return (*this - b).Length(); } + + // Determine if this a unit vector. + bool IsNormalized() const { return fabs(LengthSq() - T(1)) < Math::Tolerance(); } + + // Normalize, convention vector length to 1. + void Normalize() + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + *this *= s; + } + + // Returns normalized (unit) version of the vector without modifying itself. + Vector2 Normalized() const + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + return *this * s; + } + + // Linearly interpolates from this vector to another. + // Factor should be between 0.0 and 1.0, with 0 giving full value to this. + Vector2 Lerp(const Vector2& b, T f) const { return *this*(T(1) - f) + b*f; } + + // Projects this vector onto the argument; in other words, + // A.Project(B) returns projection of vector A onto B. + Vector2 ProjectTo(const Vector2& b) const + { + T l2 = b.LengthSq(); + OVR_MATH_ASSERT(l2 != T(0)); + return b * ( Dot(b) / l2 ); + } + + // returns true if vector b is clockwise from this vector + bool IsClockwise(const Vector2& b) const + { + return (x * b.y - y * b.x) < 0; + } +}; + + +typedef Vector2 Vector2f; +typedef Vector2 Vector2d; +typedef Vector2 Vector2i; + +typedef Vector2 Point2f; +typedef Vector2 Point2d; +typedef Vector2 Point2i; + +//------------------------------------------------------------------------------------- +// ***** Vector3<> - 3D vector of {x, y, z} + +// +// Vector3f (Vector3d) represents a 3-dimensional vector or point in space, +// consisting of coordinates x, y and z. + +template +class Vector3 +{ +public: + typedef T ElementType; + static const size_t ElementCount = 3; + + T x, y, z; + + // FIXME: default initialization of a vector class can be very expensive in a full-blown + // application. A few hundred thousand vector constructions is not unlikely and can add + // up to milliseconds of time on processors like the PS3 PPU. + Vector3() : x(0), y(0), z(0) { } + Vector3(T x_, T y_, T z_ = 0) : x(x_), y(y_), z(z_) { } + explicit Vector3(T s) : x(s), y(s), z(s) { } + explicit Vector3(const Vector3::OtherFloatType> &src) + : x((T)src.x), y((T)src.y), z((T)src.z) { } + + static Vector3 Zero() { return Vector3(0, 0, 0); } + + // C-interop support. + typedef typename CompatibleTypes >::Type CompatibleType; + + Vector3(const CompatibleType& s) : x(s.x), y(s.y), z(s.z) { } + + operator const CompatibleType& () const + { + OVR_MATH_STATIC_ASSERT(sizeof(Vector3) == sizeof(CompatibleType), "sizeof(Vector3) failure"); + return reinterpret_cast(*this); + } + + bool operator== (const Vector3& b) const { return x == b.x && y == b.y && z == b.z; } + bool operator!= (const Vector3& b) const { return x != b.x || y != b.y || z != b.z; } + + Vector3 operator+ (const Vector3& b) const { return Vector3(x + b.x, y + b.y, z + b.z); } + Vector3& operator+= (const Vector3& b) { x += b.x; y += b.y; z += b.z; return *this; } + Vector3 operator- (const Vector3& b) const { return Vector3(x - b.x, y - b.y, z - b.z); } + Vector3& operator-= (const Vector3& b) { x -= b.x; y -= b.y; z -= b.z; return *this; } + Vector3 operator- () const { return Vector3(-x, -y, -z); } + + // Scalar multiplication/division scales vector. + Vector3 operator* (T s) const { return Vector3(x*s, y*s, z*s); } + Vector3& operator*= (T s) { x *= s; y *= s; z *= s; return *this; } + + Vector3 operator/ (T s) const { T rcp = T(1)/s; + return Vector3(x*rcp, y*rcp, z*rcp); } + Vector3& operator/= (T s) { T rcp = T(1)/s; + x *= rcp; y *= rcp; z *= rcp; + return *this; } + + static Vector3 Min(const Vector3& a, const Vector3& b) + { + return Vector3((a.x < b.x) ? a.x : b.x, + (a.y < b.y) ? a.y : b.y, + (a.z < b.z) ? a.z : b.z); + } + static Vector3 Max(const Vector3& a, const Vector3& b) + { + return Vector3((a.x > b.x) ? a.x : b.x, + (a.y > b.y) ? a.y : b.y, + (a.z > b.z) ? a.z : b.z); + } + + Vector3 Clamped(T maxMag) const + { + T magSquared = LengthSq(); + if (magSquared <= Sqr(maxMag)) + return *this; + else + return *this * (maxMag / sqrt(magSquared)); + } + + // Compare two vectors for equality with tolerance. Returns true if vectors match withing tolerance. + bool IsEqual(const Vector3& b, T tolerance = Math::Tolerance()) const + { + return (fabs(b.x-x) <= tolerance) && + (fabs(b.y-y) <= tolerance) && + (fabs(b.z-z) <= tolerance); + } + bool Compare(const Vector3& b, T tolerance = Math::Tolerance()) const + { + return IsEqual(b, tolerance); + } + + T& operator[] (int idx) + { + OVR_MATH_ASSERT(0 <= idx && idx < 3); + return *(&x + idx); + } + + const T& operator[] (int idx) const + { + OVR_MATH_ASSERT(0 <= idx && idx < 3); + return *(&x + idx); + } + + // Entrywise product of two vectors + Vector3 EntrywiseMultiply(const Vector3& b) const { return Vector3(x * b.x, + y * b.y, + z * b.z);} + + // Multiply and divide operators do entry-wise math + Vector3 operator* (const Vector3& b) const { return Vector3(x * b.x, + y * b.y, + z * b.z); } + + Vector3 operator/ (const Vector3& b) const { return Vector3(x / b.x, + y / b.y, + z / b.z); } + + + // Dot product + // Used to calculate angle q between two vectors among other things, + // as (A dot B) = |a||b|cos(q). + T Dot(const Vector3& b) const { return x*b.x + y*b.y + z*b.z; } + + // Compute cross product, which generates a normal vector. + // Direction vector can be determined by right-hand rule: Pointing index finder in + // direction a and middle finger in direction b, thumb will point in a.Cross(b). + Vector3 Cross(const Vector3& b) const { return Vector3(y*b.z - z*b.y, + z*b.x - x*b.z, + x*b.y - y*b.x); } + + // Returns the angle from this vector to b, in radians. + T Angle(const Vector3& b) const + { + T div = LengthSq()*b.LengthSq(); + OVR_MATH_ASSERT(div != T(0)); + T result = Acos((this->Dot(b))/sqrt(div)); + return result; + } + + // Return Length of the vector squared. + T LengthSq() const { return (x * x + y * y + z * z); } + + // Return vector length. + T Length() const { return (T)sqrt(LengthSq()); } + + // Returns squared distance between two points represented by vectors. + T DistanceSq(Vector3 const& b) const { return (*this - b).LengthSq(); } + + // Returns distance between two points represented by vectors. + T Distance(Vector3 const& b) const { return (*this - b).Length(); } + + bool IsNormalized() const { return fabs(LengthSq() - T(1)) < Math::Tolerance(); } + + // Normalize, convention vector length to 1. + void Normalize() + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + *this *= s; + } + + // Returns normalized (unit) version of the vector without modifying itself. + Vector3 Normalized() const + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + return *this * s; + } + + // Linearly interpolates from this vector to another. + // Factor should be between 0.0 and 1.0, with 0 giving full value to this. + Vector3 Lerp(const Vector3& b, T f) const { return *this*(T(1) - f) + b*f; } + + // Projects this vector onto the argument; in other words, + // A.Project(B) returns projection of vector A onto B. + Vector3 ProjectTo(const Vector3& b) const + { + T l2 = b.LengthSq(); + OVR_MATH_ASSERT(l2 != T(0)); + return b * ( Dot(b) / l2 ); + } + + // Projects this vector onto a plane defined by a normal vector + Vector3 ProjectToPlane(const Vector3& normal) const { return *this - this->ProjectTo(normal); } +}; + +typedef Vector3 Vector3f; +typedef Vector3 Vector3d; +typedef Vector3 Vector3i; + +OVR_MATH_STATIC_ASSERT((sizeof(Vector3f) == 3*sizeof(float)), "sizeof(Vector3f) failure"); +OVR_MATH_STATIC_ASSERT((sizeof(Vector3d) == 3*sizeof(double)), "sizeof(Vector3d) failure"); +OVR_MATH_STATIC_ASSERT((sizeof(Vector3i) == 3*sizeof(int32_t)), "sizeof(Vector3i) failure"); + +typedef Vector3 Point3f; +typedef Vector3 Point3d; +typedef Vector3 Point3i; + + +//------------------------------------------------------------------------------------- +// ***** Vector4<> - 4D vector of {x, y, z, w} + +// +// Vector4f (Vector4d) represents a 3-dimensional vector or point in space, +// consisting of coordinates x, y, z and w. + +template +class Vector4 +{ +public: + typedef T ElementType; + static const size_t ElementCount = 4; + + T x, y, z, w; + + // FIXME: default initialization of a vector class can be very expensive in a full-blown + // application. A few hundred thousand vector constructions is not unlikely and can add + // up to milliseconds of time on processors like the PS3 PPU. + Vector4() : x(0), y(0), z(0), w(0) { } + Vector4(T x_, T y_, T z_, T w_) : x(x_), y(y_), z(z_), w(w_) { } + explicit Vector4(T s) : x(s), y(s), z(s), w(s) { } + explicit Vector4(const Vector3& v, const T w_=T(1)) : x(v.x), y(v.y), z(v.z), w(w_) { } + explicit Vector4(const Vector4::OtherFloatType> &src) + : x((T)src.x), y((T)src.y), z((T)src.z), w((T)src.w) { } + + static Vector4 Zero() { return Vector4(0, 0, 0, 0); } + + // C-interop support. + typedef typename CompatibleTypes< Vector4 >::Type CompatibleType; + + Vector4(const CompatibleType& s) : x(s.x), y(s.y), z(s.z), w(s.w) { } + + operator const CompatibleType& () const + { + OVR_MATH_STATIC_ASSERT(sizeof(Vector4) == sizeof(CompatibleType), "sizeof(Vector4) failure"); + return reinterpret_cast(*this); + } + + Vector4& operator= (const Vector3& other) { x=other.x; y=other.y; z=other.z; w=1; return *this; } + bool operator== (const Vector4& b) const { return x == b.x && y == b.y && z == b.z && w == b.w; } + bool operator!= (const Vector4& b) const { return x != b.x || y != b.y || z != b.z || w != b.w; } + + Vector4 operator+ (const Vector4& b) const { return Vector4(x + b.x, y + b.y, z + b.z, w + b.w); } + Vector4& operator+= (const Vector4& b) { x += b.x; y += b.y; z += b.z; w += b.w; return *this; } + Vector4 operator- (const Vector4& b) const { return Vector4(x - b.x, y - b.y, z - b.z, w - b.w); } + Vector4& operator-= (const Vector4& b) { x -= b.x; y -= b.y; z -= b.z; w -= b.w; return *this; } + Vector4 operator- () const { return Vector4(-x, -y, -z, -w); } + + // Scalar multiplication/division scales vector. + Vector4 operator* (T s) const { return Vector4(x*s, y*s, z*s, w*s); } + Vector4& operator*= (T s) { x *= s; y *= s; z *= s; w *= s;return *this; } + + Vector4 operator/ (T s) const { T rcp = T(1)/s; + return Vector4(x*rcp, y*rcp, z*rcp, w*rcp); } + Vector4& operator/= (T s) { T rcp = T(1)/s; + x *= rcp; y *= rcp; z *= rcp; w *= rcp; + return *this; } + + static Vector4 Min(const Vector4& a, const Vector4& b) + { + return Vector4((a.x < b.x) ? a.x : b.x, + (a.y < b.y) ? a.y : b.y, + (a.z < b.z) ? a.z : b.z, + (a.w < b.w) ? a.w : b.w); + } + static Vector4 Max(const Vector4& a, const Vector4& b) + { + return Vector4((a.x > b.x) ? a.x : b.x, + (a.y > b.y) ? a.y : b.y, + (a.z > b.z) ? a.z : b.z, + (a.w > b.w) ? a.w : b.w); + } + + Vector4 Clamped(T maxMag) const + { + T magSquared = LengthSq(); + if (magSquared <= Sqr(maxMag)) + return *this; + else + return *this * (maxMag / sqrt(magSquared)); + } + + // Compare two vectors for equality with tolerance. Returns true if vectors match withing tolerance. + bool IsEqual(const Vector4& b, T tolerance = Math::Tolerance()) const + { + return (fabs(b.x-x) <= tolerance) && + (fabs(b.y-y) <= tolerance) && + (fabs(b.z-z) <= tolerance) && + (fabs(b.w-w) <= tolerance); + } + bool Compare(const Vector4& b, T tolerance = Math::Tolerance()) const + { + return IsEqual(b, tolerance); + } + + T& operator[] (int idx) + { + OVR_MATH_ASSERT(0 <= idx && idx < 4); + return *(&x + idx); + } + + const T& operator[] (int idx) const + { + OVR_MATH_ASSERT(0 <= idx && idx < 4); + return *(&x + idx); + } + + // Entry wise product of two vectors + Vector4 EntrywiseMultiply(const Vector4& b) const { return Vector4(x * b.x, + y * b.y, + z * b.z, + w * b.w);} + + // Multiply and divide operators do entry-wise math + Vector4 operator* (const Vector4& b) const { return Vector4(x * b.x, + y * b.y, + z * b.z, + w * b.w); } + + Vector4 operator/ (const Vector4& b) const { return Vector4(x / b.x, + y / b.y, + z / b.z, + w / b.w); } + + + // Dot product + T Dot(const Vector4& b) const { return x*b.x + y*b.y + z*b.z + w*b.w; } + + // Return Length of the vector squared. + T LengthSq() const { return (x * x + y * y + z * z + w * w); } + + // Return vector length. + T Length() const { return sqrt(LengthSq()); } + + bool IsNormalized() const { return fabs(LengthSq() - T(1)) < Math::Tolerance(); } + + // Normalize, convention vector length to 1. + void Normalize() + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + *this *= s; + } + + // Returns normalized (unit) version of the vector without modifying itself. + Vector4 Normalized() const + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + return *this * s; + } + + // Linearly interpolates from this vector to another. + // Factor should be between 0.0 and 1.0, with 0 giving full value to this. + Vector4 Lerp(const Vector4& b, T f) const { return *this*(T(1) - f) + b*f; } +}; + +typedef Vector4 Vector4f; +typedef Vector4 Vector4d; +typedef Vector4 Vector4i; + + +//------------------------------------------------------------------------------------- +// ***** Bounds3 + +// Bounds class used to describe a 3D axis aligned bounding box. + +template +class Bounds3 +{ +public: + Vector3 b[2]; + + Bounds3() + { + } + + Bounds3( const Vector3 & mins, const Vector3 & maxs ) +{ + b[0] = mins; + b[1] = maxs; + } + + void Clear() + { + b[0].x = b[0].y = b[0].z = Math::MaxValue; + b[1].x = b[1].y = b[1].z = -Math::MaxValue; + } + + void AddPoint( const Vector3 & v ) + { + b[0].x = (b[0].x < v.x ? b[0].x : v.x); + b[0].y = (b[0].y < v.y ? b[0].y : v.y); + b[0].z = (b[0].z < v.z ? b[0].z : v.z); + b[1].x = (v.x < b[1].x ? b[1].x : v.x); + b[1].y = (v.y < b[1].y ? b[1].y : v.y); + b[1].z = (v.z < b[1].z ? b[1].z : v.z); + } + + const Vector3 & GetMins() const { return b[0]; } + const Vector3 & GetMaxs() const { return b[1]; } + + Vector3 & GetMins() { return b[0]; } + Vector3 & GetMaxs() { return b[1]; } +}; + +typedef Bounds3 Bounds3f; +typedef Bounds3 Bounds3d; + + +//------------------------------------------------------------------------------------- +// ***** Size + +// Size class represents 2D size with Width, Height components. +// Used to describe distentions of render targets, etc. + +template +class Size +{ +public: + T w, h; + + Size() : w(0), h(0) { } + Size(T w_, T h_) : w(w_), h(h_) { } + explicit Size(T s) : w(s), h(s) { } + explicit Size(const Size::OtherFloatType> &src) + : w((T)src.w), h((T)src.h) { } + + // C-interop support. + typedef typename CompatibleTypes >::Type CompatibleType; + + Size(const CompatibleType& s) : w(s.w), h(s.h) { } + + operator const CompatibleType& () const + { + OVR_MATH_STATIC_ASSERT(sizeof(Size) == sizeof(CompatibleType), "sizeof(Size) failure"); + return reinterpret_cast(*this); + } + + bool operator== (const Size& b) const { return w == b.w && h == b.h; } + bool operator!= (const Size& b) const { return w != b.w || h != b.h; } + + Size operator+ (const Size& b) const { return Size(w + b.w, h + b.h); } + Size& operator+= (const Size& b) { w += b.w; h += b.h; return *this; } + Size operator- (const Size& b) const { return Size(w - b.w, h - b.h); } + Size& operator-= (const Size& b) { w -= b.w; h -= b.h; return *this; } + Size operator- () const { return Size(-w, -h); } + Size operator* (const Size& b) const { return Size(w * b.w, h * b.h); } + Size& operator*= (const Size& b) { w *= b.w; h *= b.h; return *this; } + Size operator/ (const Size& b) const { return Size(w / b.w, h / b.h); } + Size& operator/= (const Size& b) { w /= b.w; h /= b.h; return *this; } + + // Scalar multiplication/division scales both components. + Size operator* (T s) const { return Size(w*s, h*s); } + Size& operator*= (T s) { w *= s; h *= s; return *this; } + Size operator/ (T s) const { return Size(w/s, h/s); } + Size& operator/= (T s) { w /= s; h /= s; return *this; } + + static Size Min(const Size& a, const Size& b) { return Size((a.w < b.w) ? a.w : b.w, + (a.h < b.h) ? a.h : b.h); } + static Size Max(const Size& a, const Size& b) { return Size((a.w > b.w) ? a.w : b.w, + (a.h > b.h) ? a.h : b.h); } + + T Area() const { return w * h; } + + inline Vector2 ToVector() const { return Vector2(w, h); } +}; + + +typedef Size Sizei; +typedef Size Sizeu; +typedef Size Sizef; +typedef Size Sized; + + + +//----------------------------------------------------------------------------------- +// ***** Rect + +// Rect describes a rectangular area for rendering, that includes position and size. +template +class Rect +{ +public: + T x, y; + T w, h; + + Rect() { } + Rect(T x1, T y1, T w1, T h1) : x(x1), y(y1), w(w1), h(h1) { } + Rect(const Vector2& pos, const Size& sz) : x(pos.x), y(pos.y), w(sz.w), h(sz.h) { } + Rect(const Size& sz) : x(0), y(0), w(sz.w), h(sz.h) { } + + // C-interop support. + typedef typename CompatibleTypes >::Type CompatibleType; + + Rect(const CompatibleType& s) : x(s.Pos.x), y(s.Pos.y), w(s.Size.w), h(s.Size.h) { } + + operator const CompatibleType& () const + { + OVR_MATH_STATIC_ASSERT(sizeof(Rect) == sizeof(CompatibleType), "sizeof(Rect) failure"); + return reinterpret_cast(*this); + } + + Vector2 GetPos() const { return Vector2(x, y); } + Size GetSize() const { return Size(w, h); } + void SetPos(const Vector2& pos) { x = pos.x; y = pos.y; } + void SetSize(const Size& sz) { w = sz.w; h = sz.h; } + + bool operator == (const Rect& vp) const + { return (x == vp.x) && (y == vp.y) && (w == vp.w) && (h == vp.h); } + bool operator != (const Rect& vp) const + { return !operator == (vp); } +}; + +typedef Rect Recti; + + +//-------------------------------------------------------------------------------------// +// ***** Quat +// +// Quatf represents a quaternion class used for rotations. +// +// Quaternion multiplications are done in right-to-left order, to match the +// behavior of matrices. + + +template +class Quat +{ +public: + typedef T ElementType; + static const size_t ElementCount = 4; + + // x,y,z = axis*sin(angle), w = cos(angle) + T x, y, z, w; + + Quat() : x(0), y(0), z(0), w(1) { } + Quat(T x_, T y_, T z_, T w_) : x(x_), y(y_), z(z_), w(w_) { } + explicit Quat(const Quat::OtherFloatType> &src) + : x((T)src.x), y((T)src.y), z((T)src.z), w((T)src.w) + { + // NOTE: Converting a normalized Quat to Quat + // will generally result in an un-normalized quaternion. + // But we don't normalize here in case the quaternion + // being converted is not a normalized rotation quaternion. + } + + typedef typename CompatibleTypes >::Type CompatibleType; + + // C-interop support. + Quat(const CompatibleType& s) : x(s.x), y(s.y), z(s.z), w(s.w) { } + + operator CompatibleType () const + { + CompatibleType result; + result.x = x; + result.y = y; + result.z = z; + result.w = w; + return result; + } + + // Constructs quaternion for rotation around the axis by an angle. + Quat(const Vector3& axis, T angle) + { + // Make sure we don't divide by zero. + if (axis.LengthSq() == T(0)) + { + // Assert if the axis is zero, but the angle isn't + OVR_MATH_ASSERT(angle == T(0)); + x = y = z = T(0); w = T(1); + return; + } + + Vector3 unitAxis = axis.Normalized(); + T sinHalfAngle = sin(angle * T(0.5)); + + w = cos(angle * T(0.5)); + x = unitAxis.x * sinHalfAngle; + y = unitAxis.y * sinHalfAngle; + z = unitAxis.z * sinHalfAngle; + } + + // Constructs quaternion for rotation around one of the coordinate axis by an angle. + Quat(Axis A, T angle, RotateDirection d = Rotate_CCW, HandedSystem s = Handed_R) + { + T sinHalfAngle = s * d *sin(angle * T(0.5)); + T v[3]; + v[0] = v[1] = v[2] = T(0); + v[A] = sinHalfAngle; + + w = cos(angle * T(0.5)); + x = v[0]; + y = v[1]; + z = v[2]; + } + + Quat operator-() { return Quat(-x, -y, -z, -w); } // unary minus + + static Quat Identity() { return Quat(0, 0, 0, 1); } + + // Compute axis and angle from quaternion + void GetAxisAngle(Vector3* axis, T* angle) const + { + if ( x*x + y*y + z*z > Math::Tolerance() * Math::Tolerance() ) { + *axis = Vector3(x, y, z).Normalized(); + *angle = 2 * Acos(w); + if (*angle > ((T)MATH_DOUBLE_PI)) // Reduce the magnitude of the angle, if necessary + { + *angle = ((T)MATH_DOUBLE_TWOPI) - *angle; + *axis = *axis * (-1); + } + } + else + { + *axis = Vector3(1, 0, 0); + *angle= T(0); + } + } + + // Convert a quaternion to a rotation vector, also known as + // Rodrigues vector, AxisAngle vector, SORA vector, exponential map. + // A rotation vector describes a rotation about an axis: + // the axis of rotation is the vector normalized, + // the angle of rotation is the magnitude of the vector. + Vector3 ToRotationVector() const + { + OVR_MATH_ASSERT(IsNormalized() || LengthSq() == 0); + T s = T(0); + T sinHalfAngle = sqrt(x*x + y*y + z*z); + if (sinHalfAngle > T(0)) + { + T cosHalfAngle = w; + T halfAngle = atan2(sinHalfAngle, cosHalfAngle); + + // Ensure minimum rotation magnitude + if (cosHalfAngle < 0) + halfAngle -= T(MATH_DOUBLE_PI); + + s = T(2) * halfAngle / sinHalfAngle; + } + return Vector3(x*s, y*s, z*s); + } + + // Faster version of the above, optimized for use with small rotations, where rotation angle ~= sin(angle) + inline OVR::Vector3 FastToRotationVector() const + { + OVR_MATH_ASSERT(IsNormalized()); + T s; + T sinHalfSquared = x*x + y*y + z*z; + if (sinHalfSquared < T(.0037)) // =~ sin(7/2 degrees)^2 + { + // Max rotation magnitude error is about .062% at 7 degrees rotation, or about .0043 degrees + s = T(2) * Sign(w); + } + else + { + T sinHalfAngle = sqrt(sinHalfSquared); + T cosHalfAngle = w; + T halfAngle = atan2(sinHalfAngle, cosHalfAngle); + + // Ensure minimum rotation magnitude + if (cosHalfAngle < 0) + halfAngle -= T(MATH_DOUBLE_PI); + + s = T(2) * halfAngle / sinHalfAngle; + } + return Vector3(x*s, y*s, z*s); + } + + // Given a rotation vector of form unitRotationAxis * angle, + // returns the equivalent quaternion (unitRotationAxis * sin(angle), cos(Angle)). + static Quat FromRotationVector(const Vector3& v) + { + T angleSquared = v.LengthSq(); + T s = T(0); + T c = T(1); + if (angleSquared > T(0)) + { + T angle = sqrt(angleSquared); + s = sin(angle * T(0.5)) / angle; // normalize + c = cos(angle * T(0.5)); + } + return Quat(s*v.x, s*v.y, s*v.z, c); + } + + // Faster version of above, optimized for use with small rotation magnitudes, where rotation angle =~ sin(angle). + // If normalize is false, small-angle quaternions are returned un-normalized. + inline static Quat FastFromRotationVector(const OVR::Vector3& v, bool normalize = true) + { + T s, c; + T angleSquared = v.LengthSq(); + if (angleSquared < T(0.0076)) // =~ (5 degrees*pi/180)^2 + { + s = T(0.5); + c = T(1.0); + // Max rotation magnitude error (after normalization) is about .064% at 5 degrees rotation, or .0032 degrees + if (normalize && angleSquared > 0) + { + // sin(angle/2)^2 ~= (angle/2)^2 and cos(angle/2)^2 ~= 1 + T invLen = T(1) / sqrt(angleSquared * T(0.25) + T(1)); // normalize + s = s * invLen; + c = c * invLen; + } + } + else + { + T angle = sqrt(angleSquared); + s = sin(angle * T(0.5)) / angle; + c = cos(angle * T(0.5)); + } + return Quat(s*v.x, s*v.y, s*v.z, c); + } + + // Constructs the quaternion from a rotation matrix + explicit Quat(const Matrix4& m) + { + T trace = m.M[0][0] + m.M[1][1] + m.M[2][2]; + + // In almost all cases, the first part is executed. + // However, if the trace is not positive, the other + // cases arise. + if (trace > T(0)) + { + T s = sqrt(trace + T(1)) * T(2); // s=4*qw + w = T(0.25) * s; + x = (m.M[2][1] - m.M[1][2]) / s; + y = (m.M[0][2] - m.M[2][0]) / s; + z = (m.M[1][0] - m.M[0][1]) / s; + } + else if ((m.M[0][0] > m.M[1][1])&&(m.M[0][0] > m.M[2][2])) + { + T s = sqrt(T(1) + m.M[0][0] - m.M[1][1] - m.M[2][2]) * T(2); + w = (m.M[2][1] - m.M[1][2]) / s; + x = T(0.25) * s; + y = (m.M[0][1] + m.M[1][0]) / s; + z = (m.M[2][0] + m.M[0][2]) / s; + } + else if (m.M[1][1] > m.M[2][2]) + { + T s = sqrt(T(1) + m.M[1][1] - m.M[0][0] - m.M[2][2]) * T(2); // S=4*qy + w = (m.M[0][2] - m.M[2][0]) / s; + x = (m.M[0][1] + m.M[1][0]) / s; + y = T(0.25) * s; + z = (m.M[1][2] + m.M[2][1]) / s; + } + else + { + T s = sqrt(T(1) + m.M[2][2] - m.M[0][0] - m.M[1][1]) * T(2); // S=4*qz + w = (m.M[1][0] - m.M[0][1]) / s; + x = (m.M[0][2] + m.M[2][0]) / s; + y = (m.M[1][2] + m.M[2][1]) / s; + z = T(0.25) * s; + } + OVR_MATH_ASSERT(IsNormalized()); // Ensure input matrix is orthogonal + } + + // Constructs the quaternion from a rotation matrix + explicit Quat(const Matrix3& m) + { + T trace = m.M[0][0] + m.M[1][1] + m.M[2][2]; + + // In almost all cases, the first part is executed. + // However, if the trace is not positive, the other + // cases arise. + if (trace > T(0)) + { + T s = sqrt(trace + T(1)) * T(2); // s=4*qw + w = T(0.25) * s; + x = (m.M[2][1] - m.M[1][2]) / s; + y = (m.M[0][2] - m.M[2][0]) / s; + z = (m.M[1][0] - m.M[0][1]) / s; + } + else if ((m.M[0][0] > m.M[1][1])&&(m.M[0][0] > m.M[2][2])) + { + T s = sqrt(T(1) + m.M[0][0] - m.M[1][1] - m.M[2][2]) * T(2); + w = (m.M[2][1] - m.M[1][2]) / s; + x = T(0.25) * s; + y = (m.M[0][1] + m.M[1][0]) / s; + z = (m.M[2][0] + m.M[0][2]) / s; + } + else if (m.M[1][1] > m.M[2][2]) + { + T s = sqrt(T(1) + m.M[1][1] - m.M[0][0] - m.M[2][2]) * T(2); // S=4*qy + w = (m.M[0][2] - m.M[2][0]) / s; + x = (m.M[0][1] + m.M[1][0]) / s; + y = T(0.25) * s; + z = (m.M[1][2] + m.M[2][1]) / s; + } + else + { + T s = sqrt(T(1) + m.M[2][2] - m.M[0][0] - m.M[1][1]) * T(2); // S=4*qz + w = (m.M[1][0] - m.M[0][1]) / s; + x = (m.M[0][2] + m.M[2][0]) / s; + y = (m.M[1][2] + m.M[2][1]) / s; + z = T(0.25) * s; + } + OVR_MATH_ASSERT(IsNormalized()); // Ensure input matrix is orthogonal + } + + bool operator== (const Quat& b) const { return x == b.x && y == b.y && z == b.z && w == b.w; } + bool operator!= (const Quat& b) const { return x != b.x || y != b.y || z != b.z || w != b.w; } + + Quat operator+ (const Quat& b) const { return Quat(x + b.x, y + b.y, z + b.z, w + b.w); } + Quat& operator+= (const Quat& b) { w += b.w; x += b.x; y += b.y; z += b.z; return *this; } + Quat operator- (const Quat& b) const { return Quat(x - b.x, y - b.y, z - b.z, w - b.w); } + Quat& operator-= (const Quat& b) { w -= b.w; x -= b.x; y -= b.y; z -= b.z; return *this; } + + Quat operator* (T s) const { return Quat(x * s, y * s, z * s, w * s); } + Quat& operator*= (T s) { w *= s; x *= s; y *= s; z *= s; return *this; } + Quat operator/ (T s) const { T rcp = T(1)/s; return Quat(x * rcp, y * rcp, z * rcp, w *rcp); } + Quat& operator/= (T s) { T rcp = T(1)/s; w *= rcp; x *= rcp; y *= rcp; z *= rcp; return *this; } + + // Compare two quats for equality within tolerance. Returns true if quats match withing tolerance. + bool IsEqual(const Quat& b, T tolerance = Math::Tolerance()) const + { + return Abs(Dot(b)) >= T(1) - tolerance; + } + + static T Abs(const T v) { return (v >= 0) ? v : -v; } + + // Get Imaginary part vector + Vector3 Imag() const { return Vector3(x,y,z); } + + // Get quaternion length. + T Length() const { return sqrt(LengthSq()); } + + // Get quaternion length squared. + T LengthSq() const { return (x * x + y * y + z * z + w * w); } + + // Simple Euclidean distance in R^4 (not SLERP distance, but at least respects Haar measure) + T Distance(const Quat& q) const + { + T d1 = (*this - q).Length(); + T d2 = (*this + q).Length(); // Antipodal point check + return (d1 < d2) ? d1 : d2; + } + + T DistanceSq(const Quat& q) const + { + T d1 = (*this - q).LengthSq(); + T d2 = (*this + q).LengthSq(); // Antipodal point check + return (d1 < d2) ? d1 : d2; + } + + T Dot(const Quat& q) const + { + return x * q.x + y * q.y + z * q.z + w * q.w; + } + + // Angle between two quaternions in radians + T Angle(const Quat& q) const + { + return T(2) * Acos(Abs(Dot(q))); + } + + // Angle of quaternion + T Angle() const + { + return T(2) * Acos(Abs(w)); + } + + // Normalize + bool IsNormalized() const { return fabs(LengthSq() - T(1)) < Math::Tolerance(); } + + void Normalize() + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + *this *= s; + } + + Quat Normalized() const + { + T s = Length(); + if (s != T(0)) + s = T(1) / s; + return *this * s; + } + + inline void EnsureSameHemisphere(const Quat& o) + { + if (Dot(o) < T(0)) + { + x = -x; + y = -y; + z = -z; + w = -w; + } + } + + // Returns conjugate of the quaternion. Produces inverse rotation if quaternion is normalized. + Quat Conj() const { return Quat(-x, -y, -z, w); } + + // Quaternion multiplication. Combines quaternion rotations, performing the one on the + // right hand side first. + Quat operator* (const Quat& b) const { return Quat(w * b.x + x * b.w + y * b.z - z * b.y, + w * b.y - x * b.z + y * b.w + z * b.x, + w * b.z + x * b.y - y * b.x + z * b.w, + w * b.w - x * b.x - y * b.y - z * b.z); } + const Quat& operator*= (const Quat& b) { *this = *this * b; return *this; } + + // + // this^p normalized; same as rotating by this p times. + Quat PowNormalized(T p) const + { + Vector3 v; + T a; + GetAxisAngle(&v, &a); + return Quat(v, a * p); + } + + // Compute quaternion that rotates v into alignTo: alignTo = Quat::Align(alignTo, v).Rotate(v). + // NOTE: alignTo and v must be normalized. + static Quat Align(const Vector3& alignTo, const Vector3& v) + { + OVR_MATH_ASSERT(alignTo.IsNormalized() && v.IsNormalized()); + Vector3 bisector = (v + alignTo); + bisector.Normalize(); + T cosHalfAngle = v.Dot(bisector); // 0..1 + if (cosHalfAngle > T(0)) + { + Vector3 imag = v.Cross(bisector); + return Quat(imag.x, imag.y, imag.z, cosHalfAngle); + } + else + { + // cosHalfAngle == 0: a 180 degree rotation. + // sinHalfAngle == 1, rotation axis is any axis perpendicular + // to alignTo. Choose axis to include largest magnitude components + if (fabs(v.x) > fabs(v.y)) + { + // x or z is max magnitude component + // = Cross(v, (0,1,0)).Normalized(); + T invLen = sqrt(v.x*v.x + v.z*v.z); + if (invLen > T(0)) + invLen = T(1) / invLen; + return Quat(-v.z*invLen, 0, v.x*invLen, 0); + } + else + { + // y or z is max magnitude component + // = Cross(v, (1,0,0)).Normalized(); + T invLen = sqrt(v.y*v.y + v.z*v.z); + if (invLen > T(0)) + invLen = T(1) / invLen; + return Quat(0, v.z*invLen, -v.y*invLen, 0); + } + } + } + + // Normalized linear interpolation of quaternions + // NOTE: This function is a bad approximation of Slerp() + // when the angle between the *this and b is large. + // Use FastSlerp() or Slerp() instead. + Quat Lerp(const Quat& b, T s) const + { + return (*this * (T(1) - s) + b * (Dot(b) < 0 ? -s : s)).Normalized(); + } + + // Spherical linear interpolation between rotations + Quat Slerp(const Quat& b, T s) const + { + Vector3 delta = (b * this->Inverted()).ToRotationVector(); + return FromRotationVector(delta * s) * *this; + } + + // Spherical linear interpolation: much faster for small rotations, accurate for large rotations. See FastTo/FromRotationVector + Quat FastSlerp(const Quat& b, T s) const + { + Vector3 delta = (b * this->Inverted()).FastToRotationVector(); + return (FastFromRotationVector(delta * s, false) * *this).Normalized(); + } + + // Rotate transforms vector in a manner that matches Matrix rotations (counter-clockwise, + // assuming negative direction of the axis). Standard formula: q(t) * V * q(t)^-1. + Vector3 Rotate(const Vector3& v) const + { + OVR_MATH_ASSERT(isnan(w) || IsNormalized()); + + // rv = q * (v,0) * q' + // Same as rv = v + real * cross(imag,v)*2 + cross(imag, cross(imag,v)*2); + + // uv = 2 * Imag().Cross(v); + T uvx = T(2) * (y*v.z - z*v.y); + T uvy = T(2) * (z*v.x - x*v.z); + T uvz = T(2) * (x*v.y - y*v.x); + + // return v + Real()*uv + Imag().Cross(uv); + return Vector3(v.x + w*uvx + y*uvz - z*uvy, + v.y + w*uvy + z*uvx - x*uvz, + v.z + w*uvz + x*uvy - y*uvx); + } + + // Rotation by inverse of *this + Vector3 InverseRotate(const Vector3& v) const + { + OVR_MATH_ASSERT(IsNormalized()); + + // rv = q' * (v,0) * q + // Same as rv = v + real * cross(-imag,v)*2 + cross(-imag, cross(-imag,v)*2); + // or rv = v - real * cross(imag,v)*2 + cross(imag, cross(imag,v)*2); + + // uv = 2 * Imag().Cross(v); + T uvx = T(2) * (y*v.z - z*v.y); + T uvy = T(2) * (z*v.x - x*v.z); + T uvz = T(2) * (x*v.y - y*v.x); + + // return v - Real()*uv + Imag().Cross(uv); + return Vector3(v.x - w*uvx + y*uvz - z*uvy, + v.y - w*uvy + z*uvx - x*uvz, + v.z - w*uvz + x*uvy - y*uvx); + } + + // Inversed quaternion rotates in the opposite direction. + Quat Inverted() const + { + return Quat(-x, -y, -z, w); + } + + Quat Inverse() const + { + return Quat(-x, -y, -z, w); + } + + // Sets this quaternion to the one rotates in the opposite direction. + void Invert() + { + *this = Quat(-x, -y, -z, w); + } + + // Time integration of constant angular velocity over dt + Quat TimeIntegrate(Vector3 angularVelocity, T dt) const + { + // solution is: this * exp( omega*dt/2 ); FromRotationVector(v) gives exp(v*.5). + return (*this * FastFromRotationVector(angularVelocity * dt, false)).Normalized(); + } + + // Time integration of constant angular acceleration and velocity over dt + // These are the first two terms of the "Magnus expansion" of the solution + // + // o = o * exp( W=(W1 + W2 + W3+...) * 0.5 ); + // + // omega1 = (omega + omegaDot*dt) + // W1 = (omega + omega1)*dt/2 + // W2 = cross(omega, omega1)/12*dt^2 % (= -cross(omega_dot, omega)/12*dt^3) + // Terms 3 and beyond are vanishingly small: + // W3 = cross(omega_dot, cross(omega_dot, omega))/240*dt^5 + // + Quat TimeIntegrate(Vector3 angularVelocity, Vector3 angularAcceleration, T dt) const + { + const Vector3& omega = angularVelocity; + const Vector3& omegaDot = angularAcceleration; + + Vector3 omega1 = (omega + omegaDot * dt); + Vector3 W = ( (omega + omega1) + omega.Cross(omega1) * (dt/T(6)) ) * (dt/T(2)); + + // FromRotationVector(v) is exp(v*.5) + return (*this * FastFromRotationVector(W, false)).Normalized(); + } + + // Decompose rotation into three rotations: + // roll radians about Z axis, then pitch radians about X axis, then yaw radians about Y axis. + // Call with nullptr if a return value is not needed. + void GetYawPitchRoll(T* yaw, T* pitch, T* roll) const + { + return GetEulerAngles(yaw, pitch, roll); + } + + // GetEulerAngles extracts Euler angles from the quaternion, in the specified order of + // axis rotations and the specified coordinate system. Right-handed coordinate system + // is the default, with CCW rotations while looking in the negative axis direction. + // Here a,b,c, are the Yaw/Pitch/Roll angles to be returned. + // Rotation order is c, b, a: + // rotation c around axis A3 + // is followed by rotation b around axis A2 + // is followed by rotation a around axis A1 + // rotations are CCW or CW (D) in LH or RH coordinate system (S) + // + template + void GetEulerAngles(T *a, T *b, T *c) const + { + OVR_MATH_ASSERT(IsNormalized()); + OVR_MATH_STATIC_ASSERT((A1 != A2) && (A2 != A3) && (A1 != A3), "(A1 != A2) && (A2 != A3) && (A1 != A3)"); + + T Q[3] = { x, y, z }; //Quaternion components x,y,z + + T ww = w*w; + T Q11 = Q[A1]*Q[A1]; + T Q22 = Q[A2]*Q[A2]; + T Q33 = Q[A3]*Q[A3]; + + T psign = T(-1); + // Determine whether even permutation + if (((A1 + 1) % 3 == A2) && ((A2 + 1) % 3 == A3)) + psign = T(1); + + T s2 = psign * T(2) * (psign*w*Q[A2] + Q[A1]*Q[A3]); + + T singularityRadius = Math::SingularityRadius(); + if (s2 < T(-1) + singularityRadius) + { // South pole singularity + if (a) *a = T(0); + if (b) *b = -S*D*((T)MATH_DOUBLE_PIOVER2); + if (c) *c = S*D*atan2(T(2)*(psign*Q[A1] * Q[A2] + w*Q[A3]), ww + Q22 - Q11 - Q33 ); + } + else if (s2 > T(1) - singularityRadius) + { // North pole singularity + if (a) *a = T(0); + if (b) *b = S*D*((T)MATH_DOUBLE_PIOVER2); + if (c) *c = S*D*atan2(T(2)*(psign*Q[A1] * Q[A2] + w*Q[A3]), ww + Q22 - Q11 - Q33); + } + else + { + if (a) *a = -S*D*atan2(T(-2)*(w*Q[A1] - psign*Q[A2] * Q[A3]), ww + Q33 - Q11 - Q22); + if (b) *b = S*D*asin(s2); + if (c) *c = S*D*atan2(T(2)*(w*Q[A3] - psign*Q[A1] * Q[A2]), ww + Q11 - Q22 - Q33); + } + } + + template + void GetEulerAngles(T *a, T *b, T *c) const + { GetEulerAngles(a, b, c); } + + template + void GetEulerAngles(T *a, T *b, T *c) const + { GetEulerAngles(a, b, c); } + + // GetEulerAnglesABA extracts Euler angles from the quaternion, in the specified order of + // axis rotations and the specified coordinate system. Right-handed coordinate system + // is the default, with CCW rotations while looking in the negative axis direction. + // Here a,b,c, are the Yaw/Pitch/Roll angles to be returned. + // rotation a around axis A1 + // is followed by rotation b around axis A2 + // is followed by rotation c around axis A1 + // Rotations are CCW or CW (D) in LH or RH coordinate system (S) + template + void GetEulerAnglesABA(T *a, T *b, T *c) const + { + OVR_MATH_ASSERT(IsNormalized()); + OVR_MATH_STATIC_ASSERT(A1 != A2, "A1 != A2"); + + T Q[3] = {x, y, z}; // Quaternion components + + // Determine the missing axis that was not supplied + int m = 3 - A1 - A2; + + T ww = w*w; + T Q11 = Q[A1]*Q[A1]; + T Q22 = Q[A2]*Q[A2]; + T Qmm = Q[m]*Q[m]; + + T psign = T(-1); + if ((A1 + 1) % 3 == A2) // Determine whether even permutation + { + psign = T(1); + } + + T c2 = ww + Q11 - Q22 - Qmm; + T singularityRadius = Math::SingularityRadius(); + if (c2 < T(-1) + singularityRadius) + { // South pole singularity + if (a) *a = T(0); + if (b) *b = S*D*((T)MATH_DOUBLE_PI); + if (c) *c = S*D*atan2(T(2)*(w*Q[A1] - psign*Q[A2] * Q[m]), + ww + Q22 - Q11 - Qmm); + } + else if (c2 > T(1) - singularityRadius) + { // North pole singularity + if (a) *a = T(0); + if (b) *b = T(0); + if (c) *c = S*D*atan2(T(2)*(w*Q[A1] - psign*Q[A2] * Q[m]), + ww + Q22 - Q11 - Qmm); + } + else + { + if (a) *a = S*D*atan2(psign*w*Q[m] + Q[A1] * Q[A2], + w*Q[A2] -psign*Q[A1]*Q[m]); + if (b) *b = S*D*acos(c2); + if (c) *c = S*D*atan2(-psign*w*Q[m] + Q[A1] * Q[A2], + w*Q[A2] + psign*Q[A1]*Q[m]); + } + } +}; + +typedef Quat Quatf; +typedef Quat Quatd; + +OVR_MATH_STATIC_ASSERT((sizeof(Quatf) == 4*sizeof(float)), "sizeof(Quatf) failure"); +OVR_MATH_STATIC_ASSERT((sizeof(Quatd) == 4*sizeof(double)), "sizeof(Quatd) failure"); + +//------------------------------------------------------------------------------------- +// ***** Pose +// +// Position and orientation combined. +// +// This structure needs to be the same size and layout on 32-bit and 64-bit arch. +// Update OVR_PadCheck.cpp when updating this object. +template +class Pose +{ +public: + typedef typename CompatibleTypes >::Type CompatibleType; + + Pose() { } + Pose(const Quat& orientation, const Vector3& pos) + : Rotation(orientation), Translation(pos) { } + Pose(const Pose& s) + : Rotation(s.Rotation), Translation(s.Translation) { } + Pose(const Matrix3& R, const Vector3& t) + : Rotation((Quat)R), Translation(t) { } + Pose(const CompatibleType& s) + : Rotation(s.Orientation), Translation(s.Position) { } + + explicit Pose(const Pose::OtherFloatType> &s) + : Rotation(s.Rotation), Translation(s.Translation) + { + // Ensure normalized rotation if converting from float to double + if (sizeof(T) > sizeof(typename Math::OtherFloatType)) + Rotation.Normalize(); + } + + static Pose Identity() { return Pose(Quat(0, 0, 0, 1), Vector3(0, 0, 0)); } + + void SetIdentity() { Rotation = Quat(0, 0, 0, 1); Translation = Vector3(0, 0, 0); } + + // used to make things obviously broken if someone tries to use the value + void SetInvalid() { Rotation = Quat(NAN, NAN, NAN, NAN); Translation = Vector3(NAN, NAN, NAN); } + + bool IsEqual(const Pose&b, T tolerance = Math::Tolerance()) const + { + return Translation.IsEqual(b.Translation, tolerance) && Rotation.IsEqual(b.Rotation, tolerance); + } + + operator typename CompatibleTypes >::Type () const + { + typename CompatibleTypes >::Type result; + result.Orientation = Rotation; + result.Position = Translation; + return result; + } + + Quat Rotation; + Vector3 Translation; + + OVR_MATH_STATIC_ASSERT((sizeof(T) == sizeof(double) || sizeof(T) == sizeof(float)), "(sizeof(T) == sizeof(double) || sizeof(T) == sizeof(float))"); + + void ToArray(T* arr) const + { + T temp[7] = { Rotation.x, Rotation.y, Rotation.z, Rotation.w, Translation.x, Translation.y, Translation.z }; + for (int i = 0; i < 7; i++) arr[i] = temp[i]; + } + + static Pose FromArray(const T* v) + { + Quat rotation(v[0], v[1], v[2], v[3]); + Vector3 translation(v[4], v[5], v[6]); + // Ensure rotation is normalized, in case it was originally a float, stored in a .json file, etc. + return Pose(rotation.Normalized(), translation); + } + + Vector3 Rotate(const Vector3& v) const + { + return Rotation.Rotate(v); + } + + Vector3 InverseRotate(const Vector3& v) const + { + return Rotation.InverseRotate(v); + } + + Vector3 Translate(const Vector3& v) const + { + return v + Translation; + } + + Vector3 Transform(const Vector3& v) const + { + return Rotate(v) + Translation; + } + + Vector3 InverseTransform(const Vector3& v) const + { + return InverseRotate(v - Translation); + } + + + Vector3 Apply(const Vector3& v) const + { + return Transform(v); + } + + Pose operator*(const Pose& other) const + { + return Pose(Rotation * other.Rotation, Apply(other.Translation)); + } + + Pose Inverted() const + { + Quat inv = Rotation.Inverted(); + return Pose(inv, inv.Rotate(-Translation)); + } + + // Interpolation between two poses: translation is interpolated with Lerp(), + // and rotations are interpolated with Slerp(). + Pose Lerp(const Pose& b, T s) + { + return Pose(Rotation.Slerp(b.Rotation, s), Translation.Lerp(b.Translation, s)); + } + + // Similar to Lerp above, except faster in case of small rotation differences. See Quat::FastSlerp. + Pose FastLerp(const Pose& b, T s) + { + return Pose(Rotation.FastSlerp(b.Rotation, s), Translation.Lerp(b.Translation, s)); + } + + Pose TimeIntegrate(const Vector3& linearVelocity, const Vector3& angularVelocity, T dt) const + { + return Pose( + (Rotation * Quat::FastFromRotationVector(angularVelocity * dt, false)).Normalized(), + Translation + linearVelocity * dt); + } + + Pose TimeIntegrate(const Vector3& linearVelocity, const Vector3& linearAcceleration, + const Vector3& angularVelocity, const Vector3& angularAcceleration, + T dt) const + { + return Pose(Rotation.TimeIntegrate(angularVelocity, angularAcceleration, dt), + Translation + linearVelocity*dt + linearAcceleration*dt*dt * T(0.5)); + } +}; + +typedef Pose Posef; +typedef Pose Posed; + +OVR_MATH_STATIC_ASSERT((sizeof(Posed) == sizeof(Quatd) + sizeof(Vector3d)), "sizeof(Posed) failure"); +OVR_MATH_STATIC_ASSERT((sizeof(Posef) == sizeof(Quatf) + sizeof(Vector3f)), "sizeof(Posef) failure"); + + +//------------------------------------------------------------------------------------- +// ***** Matrix4 +// +// Matrix4 is a 4x4 matrix used for 3d transformations and projections. +// Translation stored in the last column. +// The matrix is stored in row-major order in memory, meaning that values +// of the first row are stored before the next one. +// +// The arrangement of the matrix is chosen to be in Right-Handed +// coordinate system and counterclockwise rotations when looking down +// the axis +// +// Transformation Order: +// - Transformations are applied from right to left, so the expression +// M1 * M2 * M3 * V means that the vector V is transformed by M3 first, +// followed by M2 and M1. +// +// Coordinate system: Right Handed +// +// Rotations: Counterclockwise when looking down the axis. All angles are in radians. +// +// | sx 01 02 tx | // First column (sx, 10, 20): Axis X basis vector. +// | 10 sy 12 ty | // Second column (01, sy, 21): Axis Y basis vector. +// | 20 21 sz tz | // Third columnt (02, 12, sz): Axis Z basis vector. +// | 30 31 32 33 | +// +// The basis vectors are first three columns. + +template +class Matrix4 +{ +public: + typedef T ElementType; + static const size_t Dimension = 4; + + T M[4][4]; + + enum NoInitType { NoInit }; + + // Construct with no memory initialization. + Matrix4(NoInitType) { } + + // By default, we construct identity matrix. + Matrix4() + { + M[0][0] = M[1][1] = M[2][2] = M[3][3] = T(1); + M[0][1] = M[1][0] = M[2][3] = M[3][1] = T(0); + M[0][2] = M[1][2] = M[2][0] = M[3][2] = T(0); + M[0][3] = M[1][3] = M[2][1] = M[3][0] = T(0); + } + + Matrix4(T m11, T m12, T m13, T m14, + T m21, T m22, T m23, T m24, + T m31, T m32, T m33, T m34, + T m41, T m42, T m43, T m44) + { + M[0][0] = m11; M[0][1] = m12; M[0][2] = m13; M[0][3] = m14; + M[1][0] = m21; M[1][1] = m22; M[1][2] = m23; M[1][3] = m24; + M[2][0] = m31; M[2][1] = m32; M[2][2] = m33; M[2][3] = m34; + M[3][0] = m41; M[3][1] = m42; M[3][2] = m43; M[3][3] = m44; + } + + Matrix4(T m11, T m12, T m13, + T m21, T m22, T m23, + T m31, T m32, T m33) + { + M[0][0] = m11; M[0][1] = m12; M[0][2] = m13; M[0][3] = T(0); + M[1][0] = m21; M[1][1] = m22; M[1][2] = m23; M[1][3] = T(0); + M[2][0] = m31; M[2][1] = m32; M[2][2] = m33; M[2][3] = T(0); + M[3][0] = T(0); M[3][1] = T(0); M[3][2] = T(0); M[3][3] = T(1); + } + + explicit Matrix4(const Matrix3& m) + { + M[0][0] = m.M[0][0]; M[0][1] = m.M[0][1]; M[0][2] = m.M[0][2]; M[0][3] = T(0); + M[1][0] = m.M[1][0]; M[1][1] = m.M[1][1]; M[1][2] = m.M[1][2]; M[1][3] = T(0); + M[2][0] = m.M[2][0]; M[2][1] = m.M[2][1]; M[2][2] = m.M[2][2]; M[2][3] = T(0); + M[3][0] = T(0); M[3][1] = T(0); M[3][2] = T(0); M[3][3] = T(1); + } + + explicit Matrix4(const Quat& q) + { + OVR_MATH_ASSERT(q.IsNormalized()); + T ww = q.w*q.w; + T xx = q.x*q.x; + T yy = q.y*q.y; + T zz = q.z*q.z; + + M[0][0] = ww + xx - yy - zz; M[0][1] = 2 * (q.x*q.y - q.w*q.z); M[0][2] = 2 * (q.x*q.z + q.w*q.y); M[0][3] = T(0); + M[1][0] = 2 * (q.x*q.y + q.w*q.z); M[1][1] = ww - xx + yy - zz; M[1][2] = 2 * (q.y*q.z - q.w*q.x); M[1][3] = T(0); + M[2][0] = 2 * (q.x*q.z - q.w*q.y); M[2][1] = 2 * (q.y*q.z + q.w*q.x); M[2][2] = ww - xx - yy + zz; M[2][3] = T(0); + M[3][0] = T(0); M[3][1] = T(0); M[3][2] = T(0); M[3][3] = T(1); + } + + explicit Matrix4(const Pose& p) + { + Matrix4 result(p.Rotation); + result.SetTranslation(p.Translation); + *this = result; + } + + + // C-interop support + explicit Matrix4(const Matrix4::OtherFloatType> &src) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + M[i][j] = (T)src.M[i][j]; + } + + // C-interop support. + Matrix4(const typename CompatibleTypes >::Type& s) + { + OVR_MATH_STATIC_ASSERT(sizeof(s) == sizeof(Matrix4), "sizeof(s) == sizeof(Matrix4)"); + memcpy(M, s.M, sizeof(M)); + } + + operator typename CompatibleTypes >::Type () const + { + typename CompatibleTypes >::Type result; + OVR_MATH_STATIC_ASSERT(sizeof(result) == sizeof(Matrix4), "sizeof(result) == sizeof(Matrix4)"); + memcpy(result.M, M, sizeof(M)); + return result; + } + + void ToString(char* dest, size_t destsize) const + { + size_t pos = 0; + for (int r=0; r<4; r++) + { + for (int c=0; c<4; c++) + { + pos += OVRMath_sprintf(dest+pos, destsize-pos, "%g ", M[r][c]); + } + } + } + + static Matrix4 FromString(const char* src) + { + Matrix4 result; + if (src) + { + for (int r = 0; r < 4; r++) + { + for (int c = 0; c < 4; c++) + { + result.M[r][c] = (T)atof(src); + while (*src && *src != ' ') + { + src++; + } + while (*src && *src == ' ') + { + src++; + } + } + } + } + return result; + } + + static Matrix4 Identity() { return Matrix4(); } + + void SetIdentity() + { + M[0][0] = M[1][1] = M[2][2] = M[3][3] = T(1); + M[0][1] = M[1][0] = M[2][3] = M[3][1] = T(0); + M[0][2] = M[1][2] = M[2][0] = M[3][2] = T(0); + M[0][3] = M[1][3] = M[2][1] = M[3][0] = T(0); + } + + void SetXBasis(const Vector3& v) + { + M[0][0] = v.x; + M[1][0] = v.y; + M[2][0] = v.z; + } + Vector3 GetXBasis() const + { + return Vector3(M[0][0], M[1][0], M[2][0]); + } + + void SetYBasis(const Vector3 & v) + { + M[0][1] = v.x; + M[1][1] = v.y; + M[2][1] = v.z; + } + Vector3 GetYBasis() const + { + return Vector3(M[0][1], M[1][1], M[2][1]); + } + + void SetZBasis(const Vector3 & v) + { + M[0][2] = v.x; + M[1][2] = v.y; + M[2][2] = v.z; + } + Vector3 GetZBasis() const + { + return Vector3(M[0][2], M[1][2], M[2][2]); + } + + bool operator== (const Matrix4& b) const + { + bool isEqual = true; + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + isEqual &= (M[i][j] == b.M[i][j]); + + return isEqual; + } + + Matrix4 operator+ (const Matrix4& b) const + { + Matrix4 result(*this); + result += b; + return result; + } + + Matrix4& operator+= (const Matrix4& b) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + M[i][j] += b.M[i][j]; + return *this; + } + + Matrix4 operator- (const Matrix4& b) const + { + Matrix4 result(*this); + result -= b; + return result; + } + + Matrix4& operator-= (const Matrix4& b) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + M[i][j] -= b.M[i][j]; + return *this; + } + + // Multiplies two matrices into destination with minimum copying. + static Matrix4& Multiply(Matrix4* d, const Matrix4& a, const Matrix4& b) + { + OVR_MATH_ASSERT((d != &a) && (d != &b)); + int i = 0; + do { + d->M[i][0] = a.M[i][0] * b.M[0][0] + a.M[i][1] * b.M[1][0] + a.M[i][2] * b.M[2][0] + a.M[i][3] * b.M[3][0]; + d->M[i][1] = a.M[i][0] * b.M[0][1] + a.M[i][1] * b.M[1][1] + a.M[i][2] * b.M[2][1] + a.M[i][3] * b.M[3][1]; + d->M[i][2] = a.M[i][0] * b.M[0][2] + a.M[i][1] * b.M[1][2] + a.M[i][2] * b.M[2][2] + a.M[i][3] * b.M[3][2]; + d->M[i][3] = a.M[i][0] * b.M[0][3] + a.M[i][1] * b.M[1][3] + a.M[i][2] * b.M[2][3] + a.M[i][3] * b.M[3][3]; + } while((++i) < 4); + + return *d; + } + + Matrix4 operator* (const Matrix4& b) const + { + Matrix4 result(Matrix4::NoInit); + Multiply(&result, *this, b); + return result; + } + + Matrix4& operator*= (const Matrix4& b) + { + return Multiply(this, Matrix4(*this), b); + } + + Matrix4 operator* (T s) const + { + Matrix4 result(*this); + result *= s; + return result; + } + + Matrix4& operator*= (T s) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + M[i][j] *= s; + return *this; + } + + + Matrix4 operator/ (T s) const + { + Matrix4 result(*this); + result /= s; + return result; + } + + Matrix4& operator/= (T s) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + M[i][j] /= s; + return *this; + } + + Vector3 Transform(const Vector3& v) const + { + const T rcpW = T(1) / (M[3][0] * v.x + M[3][1] * v.y + M[3][2] * v.z + M[3][3]); + return Vector3((M[0][0] * v.x + M[0][1] * v.y + M[0][2] * v.z + M[0][3]) * rcpW, + (M[1][0] * v.x + M[1][1] * v.y + M[1][2] * v.z + M[1][3]) * rcpW, + (M[2][0] * v.x + M[2][1] * v.y + M[2][2] * v.z + M[2][3]) * rcpW); + } + + Vector4 Transform(const Vector4& v) const + { + return Vector4(M[0][0] * v.x + M[0][1] * v.y + M[0][2] * v.z + M[0][3] * v.w, + M[1][0] * v.x + M[1][1] * v.y + M[1][2] * v.z + M[1][3] * v.w, + M[2][0] * v.x + M[2][1] * v.y + M[2][2] * v.z + M[2][3] * v.w, + M[3][0] * v.x + M[3][1] * v.y + M[3][2] * v.z + M[3][3] * v.w); + } + + Matrix4 Transposed() const + { + return Matrix4(M[0][0], M[1][0], M[2][0], M[3][0], + M[0][1], M[1][1], M[2][1], M[3][1], + M[0][2], M[1][2], M[2][2], M[3][2], + M[0][3], M[1][3], M[2][3], M[3][3]); + } + + void Transpose() + { + *this = Transposed(); + } + + + T SubDet (const size_t* rows, const size_t* cols) const + { + return M[rows[0]][cols[0]] * (M[rows[1]][cols[1]] * M[rows[2]][cols[2]] - M[rows[1]][cols[2]] * M[rows[2]][cols[1]]) + - M[rows[0]][cols[1]] * (M[rows[1]][cols[0]] * M[rows[2]][cols[2]] - M[rows[1]][cols[2]] * M[rows[2]][cols[0]]) + + M[rows[0]][cols[2]] * (M[rows[1]][cols[0]] * M[rows[2]][cols[1]] - M[rows[1]][cols[1]] * M[rows[2]][cols[0]]); + } + + T Cofactor(size_t I, size_t J) const + { + const size_t indices[4][3] = {{1,2,3},{0,2,3},{0,1,3},{0,1,2}}; + return ((I+J)&1) ? -SubDet(indices[I],indices[J]) : SubDet(indices[I],indices[J]); + } + + T Determinant() const + { + return M[0][0] * Cofactor(0,0) + M[0][1] * Cofactor(0,1) + M[0][2] * Cofactor(0,2) + M[0][3] * Cofactor(0,3); + } + + Matrix4 Adjugated() const + { + return Matrix4(Cofactor(0,0), Cofactor(1,0), Cofactor(2,0), Cofactor(3,0), + Cofactor(0,1), Cofactor(1,1), Cofactor(2,1), Cofactor(3,1), + Cofactor(0,2), Cofactor(1,2), Cofactor(2,2), Cofactor(3,2), + Cofactor(0,3), Cofactor(1,3), Cofactor(2,3), Cofactor(3,3)); + } + + Matrix4 Inverted() const + { + T det = Determinant(); + OVR_MATH_ASSERT(det != 0); + return Adjugated() * (T(1)/det); + } + + void Invert() + { + *this = Inverted(); + } + + // This is more efficient than general inverse, but ONLY works + // correctly if it is a homogeneous transform matrix (rot + trans) + Matrix4 InvertedHomogeneousTransform() const + { + // Make the inverse rotation matrix + Matrix4 rinv = this->Transposed(); + rinv.M[3][0] = rinv.M[3][1] = rinv.M[3][2] = T(0); + // Make the inverse translation matrix + Vector3 tvinv(-M[0][3],-M[1][3],-M[2][3]); + Matrix4 tinv = Matrix4::Translation(tvinv); + return rinv * tinv; // "untranslate", then "unrotate" + } + + // This is more efficient than general inverse, but ONLY works + // correctly if it is a homogeneous transform matrix (rot + trans) + void InvertHomogeneousTransform() + { + *this = InvertedHomogeneousTransform(); + } + + // Matrix to Euler Angles conversion + // a,b,c, are the YawPitchRoll angles to be returned + // rotation a around axis A1 + // is followed by rotation b around axis A2 + // is followed by rotation c around axis A3 + // rotations are CCW or CW (D) in LH or RH coordinate system (S) + template + void ToEulerAngles(T *a, T *b, T *c) const + { + OVR_MATH_STATIC_ASSERT((A1 != A2) && (A2 != A3) && (A1 != A3), "(A1 != A2) && (A2 != A3) && (A1 != A3)"); + + T psign = T(-1); + if (((A1 + 1) % 3 == A2) && ((A2 + 1) % 3 == A3)) // Determine whether even permutation + psign = T(1); + + T pm = psign*M[A1][A3]; + T singularityRadius = Math::SingularityRadius(); + if (pm < T(-1) + singularityRadius) + { // South pole singularity + *a = T(0); + *b = -S*D*((T)MATH_DOUBLE_PIOVER2); + *c = S*D*atan2( psign*M[A2][A1], M[A2][A2] ); + } + else if (pm > T(1) - singularityRadius) + { // North pole singularity + *a = T(0); + *b = S*D*((T)MATH_DOUBLE_PIOVER2); + *c = S*D*atan2( psign*M[A2][A1], M[A2][A2] ); + } + else + { // Normal case (nonsingular) + *a = S*D*atan2( -psign*M[A2][A3], M[A3][A3] ); + *b = S*D*asin(pm); + *c = S*D*atan2( -psign*M[A1][A2], M[A1][A1] ); + } + } + + // Matrix to Euler Angles conversion + // a,b,c, are the YawPitchRoll angles to be returned + // rotation a around axis A1 + // is followed by rotation b around axis A2 + // is followed by rotation c around axis A1 + // rotations are CCW or CW (D) in LH or RH coordinate system (S) + template + void ToEulerAnglesABA(T *a, T *b, T *c) const + { + OVR_MATH_STATIC_ASSERT(A1 != A2, "A1 != A2"); + + // Determine the axis that was not supplied + int m = 3 - A1 - A2; + + T psign = T(-1); + if ((A1 + 1) % 3 == A2) // Determine whether even permutation + psign = T(1); + + T c2 = M[A1][A1]; + T singularityRadius = Math::SingularityRadius(); + if (c2 < T(-1) + singularityRadius) + { // South pole singularity + *a = T(0); + *b = S*D*((T)MATH_DOUBLE_PI); + *c = S*D*atan2( -psign*M[A2][m],M[A2][A2]); + } + else if (c2 > T(1) - singularityRadius) + { // North pole singularity + *a = T(0); + *b = T(0); + *c = S*D*atan2( -psign*M[A2][m],M[A2][A2]); + } + else + { // Normal case (nonsingular) + *a = S*D*atan2( M[A2][A1],-psign*M[m][A1]); + *b = S*D*acos(c2); + *c = S*D*atan2( M[A1][A2],psign*M[A1][m]); + } + } + + // Creates a matrix that converts the vertices from one coordinate system + // to another. + static Matrix4 AxisConversion(const WorldAxes& to, const WorldAxes& from) + { + // Holds axis values from the 'to' structure + int toArray[3] = { to.XAxis, to.YAxis, to.ZAxis }; + + // The inverse of the toArray + int inv[4]; + inv[0] = inv[abs(to.XAxis)] = 0; + inv[abs(to.YAxis)] = 1; + inv[abs(to.ZAxis)] = 2; + + Matrix4 m(0, 0, 0, + 0, 0, 0, + 0, 0, 0); + + // Only three values in the matrix need to be changed to 1 or -1. + m.M[inv[abs(from.XAxis)]][0] = T(from.XAxis/toArray[inv[abs(from.XAxis)]]); + m.M[inv[abs(from.YAxis)]][1] = T(from.YAxis/toArray[inv[abs(from.YAxis)]]); + m.M[inv[abs(from.ZAxis)]][2] = T(from.ZAxis/toArray[inv[abs(from.ZAxis)]]); + return m; + } + + + // Creates a matrix for translation by vector + static Matrix4 Translation(const Vector3& v) + { + Matrix4 t; + t.M[0][3] = v.x; + t.M[1][3] = v.y; + t.M[2][3] = v.z; + return t; + } + + // Creates a matrix for translation by vector + static Matrix4 Translation(T x, T y, T z = T(0)) + { + Matrix4 t; + t.M[0][3] = x; + t.M[1][3] = y; + t.M[2][3] = z; + return t; + } + + // Sets the translation part + void SetTranslation(const Vector3& v) + { + M[0][3] = v.x; + M[1][3] = v.y; + M[2][3] = v.z; + } + + Vector3 GetTranslation() const + { + return Vector3( M[0][3], M[1][3], M[2][3] ); + } + + // Creates a matrix for scaling by vector + static Matrix4 Scaling(const Vector3& v) + { + Matrix4 t; + t.M[0][0] = v.x; + t.M[1][1] = v.y; + t.M[2][2] = v.z; + return t; + } + + // Creates a matrix for scaling by vector + static Matrix4 Scaling(T x, T y, T z) + { + Matrix4 t; + t.M[0][0] = x; + t.M[1][1] = y; + t.M[2][2] = z; + return t; + } + + // Creates a matrix for scaling by constant + static Matrix4 Scaling(T s) + { + Matrix4 t; + t.M[0][0] = s; + t.M[1][1] = s; + t.M[2][2] = s; + return t; + } + + // Simple L1 distance in R^12 + T Distance(const Matrix4& m2) const + { + T d = fabs(M[0][0] - m2.M[0][0]) + fabs(M[0][1] - m2.M[0][1]); + d += fabs(M[0][2] - m2.M[0][2]) + fabs(M[0][3] - m2.M[0][3]); + d += fabs(M[1][0] - m2.M[1][0]) + fabs(M[1][1] - m2.M[1][1]); + d += fabs(M[1][2] - m2.M[1][2]) + fabs(M[1][3] - m2.M[1][3]); + d += fabs(M[2][0] - m2.M[2][0]) + fabs(M[2][1] - m2.M[2][1]); + d += fabs(M[2][2] - m2.M[2][2]) + fabs(M[2][3] - m2.M[2][3]); + d += fabs(M[3][0] - m2.M[3][0]) + fabs(M[3][1] - m2.M[3][1]); + d += fabs(M[3][2] - m2.M[3][2]) + fabs(M[3][3] - m2.M[3][3]); + return d; + } + + // Creates a rotation matrix rotating around the X axis by 'angle' radians. + // Just for quick testing. Not for final API. Need to remove case. + static Matrix4 RotationAxis(Axis A, T angle, RotateDirection d, HandedSystem s) + { + T sina = s * d *sin(angle); + T cosa = cos(angle); + + switch(A) + { + case Axis_X: + return Matrix4(1, 0, 0, + 0, cosa, -sina, + 0, sina, cosa); + case Axis_Y: + return Matrix4(cosa, 0, sina, + 0, 1, 0, + -sina, 0, cosa); + case Axis_Z: + return Matrix4(cosa, -sina, 0, + sina, cosa, 0, + 0, 0, 1); + default: + return Matrix4(); + } + } + + + // Creates a rotation matrix rotating around the X axis by 'angle' radians. + // Rotation direction is depends on the coordinate system: + // RHS (Oculus default): Positive angle values rotate Counter-clockwise (CCW), + // while looking in the negative axis direction. This is the + // same as looking down from positive axis values towards origin. + // LHS: Positive angle values rotate clock-wise (CW), while looking in the + // negative axis direction. + static Matrix4 RotationX(T angle) + { + T sina = sin(angle); + T cosa = cos(angle); + return Matrix4(1, 0, 0, + 0, cosa, -sina, + 0, sina, cosa); + } + + // Creates a rotation matrix rotating around the Y axis by 'angle' radians. + // Rotation direction is depends on the coordinate system: + // RHS (Oculus default): Positive angle values rotate Counter-clockwise (CCW), + // while looking in the negative axis direction. This is the + // same as looking down from positive axis values towards origin. + // LHS: Positive angle values rotate clock-wise (CW), while looking in the + // negative axis direction. + static Matrix4 RotationY(T angle) + { + T sina = (T)sin(angle); + T cosa = (T)cos(angle); + return Matrix4(cosa, 0, sina, + 0, 1, 0, + -sina, 0, cosa); + } + + // Creates a rotation matrix rotating around the Z axis by 'angle' radians. + // Rotation direction is depends on the coordinate system: + // RHS (Oculus default): Positive angle values rotate Counter-clockwise (CCW), + // while looking in the negative axis direction. This is the + // same as looking down from positive axis values towards origin. + // LHS: Positive angle values rotate clock-wise (CW), while looking in the + // negative axis direction. + static Matrix4 RotationZ(T angle) + { + T sina = sin(angle); + T cosa = cos(angle); + return Matrix4(cosa, -sina, 0, + sina, cosa, 0, + 0, 0, 1); + } + + // LookAtRH creates a View transformation matrix for right-handed coordinate system. + // The resulting matrix points camera from 'eye' towards 'at' direction, with 'up' + // specifying the up vector. The resulting matrix should be used with PerspectiveRH + // projection. + static Matrix4 LookAtRH(const Vector3& eye, const Vector3& at, const Vector3& up) + { + Vector3 z = (eye - at).Normalized(); // Forward + Vector3 x = up.Cross(z).Normalized(); // Right + Vector3 y = z.Cross(x); + + Matrix4 m(x.x, x.y, x.z, -(x.Dot(eye)), + y.x, y.y, y.z, -(y.Dot(eye)), + z.x, z.y, z.z, -(z.Dot(eye)), + 0, 0, 0, 1 ); + return m; + } + + // LookAtLH creates a View transformation matrix for left-handed coordinate system. + // The resulting matrix points camera from 'eye' towards 'at' direction, with 'up' + // specifying the up vector. + static Matrix4 LookAtLH(const Vector3& eye, const Vector3& at, const Vector3& up) + { + Vector3 z = (at - eye).Normalized(); // Forward + Vector3 x = up.Cross(z).Normalized(); // Right + Vector3 y = z.Cross(x); + + Matrix4 m(x.x, x.y, x.z, -(x.Dot(eye)), + y.x, y.y, y.z, -(y.Dot(eye)), + z.x, z.y, z.z, -(z.Dot(eye)), + 0, 0, 0, 1 ); + return m; + } + + // PerspectiveRH creates a right-handed perspective projection matrix that can be + // used with the Oculus sample renderer. + // yfov - Specifies vertical field of view in radians. + // aspect - Screen aspect ration, which is usually width/height for square pixels. + // Note that xfov = yfov * aspect. + // znear - Absolute value of near Z clipping clipping range. + // zfar - Absolute value of far Z clipping clipping range (larger then near). + // Even though RHS usually looks in the direction of negative Z, positive values + // are expected for znear and zfar. + static Matrix4 PerspectiveRH(T yfov, T aspect, T znear, T zfar) + { + Matrix4 m; + T tanHalfFov = tan(yfov * T(0.5)); + + m.M[0][0] = T(1) / (aspect * tanHalfFov); + m.M[1][1] = T(1) / tanHalfFov; + m.M[2][2] = zfar / (znear - zfar); + m.M[3][2] = T(-1); + m.M[2][3] = (zfar * znear) / (znear - zfar); + m.M[3][3] = T(0); + + // Note: Post-projection matrix result assumes Left-Handed coordinate system, + // with Y up, X right and Z forward. This supports positive z-buffer values. + // This is the case even for RHS coordinate input. + return m; + } + + // PerspectiveLH creates a left-handed perspective projection matrix that can be + // used with the Oculus sample renderer. + // yfov - Specifies vertical field of view in radians. + // aspect - Screen aspect ration, which is usually width/height for square pixels. + // Note that xfov = yfov * aspect. + // znear - Absolute value of near Z clipping clipping range. + // zfar - Absolute value of far Z clipping clipping range (larger then near). + static Matrix4 PerspectiveLH(T yfov, T aspect, T znear, T zfar) + { + Matrix4 m; + T tanHalfFov = tan(yfov * T(0.5)); + + m.M[0][0] = T(1) / (aspect * tanHalfFov); + m.M[1][1] = T(1) / tanHalfFov; + //m.M[2][2] = zfar / (znear - zfar); + m.M[2][2] = zfar / (zfar - znear); + m.M[3][2] = T(-1); + m.M[2][3] = (zfar * znear) / (znear - zfar); + m.M[3][3] = T(0); + + // Note: Post-projection matrix result assumes Left-Handed coordinate system, + // with Y up, X right and Z forward. This supports positive z-buffer values. + // This is the case even for RHS coordinate input. + return m; + } + + static Matrix4 Ortho2D(T w, T h) + { + Matrix4 m; + m.M[0][0] = T(2.0)/w; + m.M[1][1] = T(-2.0)/h; + m.M[0][3] = T(-1.0); + m.M[1][3] = T(1.0); + m.M[2][2] = T(0); + return m; + } +}; + +typedef Matrix4 Matrix4f; +typedef Matrix4 Matrix4d; + +//------------------------------------------------------------------------------------- +// ***** Matrix3 +// +// Matrix3 is a 3x3 matrix used for representing a rotation matrix. +// The matrix is stored in row-major order in memory, meaning that values +// of the first row are stored before the next one. +// +// The arrangement of the matrix is chosen to be in Right-Handed +// coordinate system and counterclockwise rotations when looking down +// the axis +// +// Transformation Order: +// - Transformations are applied from right to left, so the expression +// M1 * M2 * M3 * V means that the vector V is transformed by M3 first, +// followed by M2 and M1. +// +// Coordinate system: Right Handed +// +// Rotations: Counterclockwise when looking down the axis. All angles are in radians. + +template +class Matrix3 +{ +public: + typedef T ElementType; + static const size_t Dimension = 3; + + T M[3][3]; + + enum NoInitType { NoInit }; + + // Construct with no memory initialization. + Matrix3(NoInitType) { } + + // By default, we construct identity matrix. + Matrix3() + { + M[0][0] = M[1][1] = M[2][2] = T(1); + M[0][1] = M[1][0] = M[2][0] = T(0); + M[0][2] = M[1][2] = M[2][1] = T(0); + } + + Matrix3(T m11, T m12, T m13, + T m21, T m22, T m23, + T m31, T m32, T m33) + { + M[0][0] = m11; M[0][1] = m12; M[0][2] = m13; + M[1][0] = m21; M[1][1] = m22; M[1][2] = m23; + M[2][0] = m31; M[2][1] = m32; M[2][2] = m33; + } + + // Construction from X, Y, Z basis vectors + Matrix3(const Vector3& xBasis, const Vector3& yBasis, const Vector3& zBasis) + { + M[0][0] = xBasis.x; M[0][1] = yBasis.x; M[0][2] = zBasis.x; + M[1][0] = xBasis.y; M[1][1] = yBasis.y; M[1][2] = zBasis.y; + M[2][0] = xBasis.z; M[2][1] = yBasis.z; M[2][2] = zBasis.z; + } + + explicit Matrix3(const Quat& q) + { + OVR_MATH_ASSERT(q.IsNormalized()); + const T tx = q.x+q.x, ty = q.y+q.y, tz = q.z+q.z; + const T twx = q.w*tx, twy = q.w*ty, twz = q.w*tz; + const T txx = q.x*tx, txy = q.x*ty, txz = q.x*tz; + const T tyy = q.y*ty, tyz = q.y*tz, tzz = q.z*tz; + M[0][0] = T(1) - (tyy + tzz); M[0][1] = txy - twz; M[0][2] = txz + twy; + M[1][0] = txy + twz; M[1][1] = T(1) - (txx + tzz); M[1][2] = tyz - twx; + M[2][0] = txz - twy; M[2][1] = tyz + twx; M[2][2] = T(1) - (txx + tyy); + } + + inline explicit Matrix3(T s) + { + M[0][0] = M[1][1] = M[2][2] = s; + M[0][1] = M[0][2] = M[1][0] = M[1][2] = M[2][0] = M[2][1] = T(0); + } + + Matrix3(T m11, T m22, T m33) + { + M[0][0] = m11; M[0][1] = T(0); M[0][2] = T(0); + M[1][0] = T(0); M[1][1] = m22; M[1][2] = T(0); + M[2][0] = T(0); M[2][1] = T(0); M[2][2] = m33; + } + + explicit Matrix3(const Matrix3::OtherFloatType> &src) + { + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + M[i][j] = (T)src.M[i][j]; + } + + // C-interop support. + Matrix3(const typename CompatibleTypes >::Type& s) + { + OVR_MATH_STATIC_ASSERT(sizeof(s) == sizeof(Matrix3), "sizeof(s) == sizeof(Matrix3)"); + memcpy(M, s.M, sizeof(M)); + } + + operator const typename CompatibleTypes >::Type () const + { + typename CompatibleTypes >::Type result; + OVR_MATH_STATIC_ASSERT(sizeof(result) == sizeof(Matrix3), "sizeof(result) == sizeof(Matrix3)"); + memcpy(result.M, M, sizeof(M)); + return result; + } + + T operator()(int i, int j) const { return M[i][j]; } + T& operator()(int i, int j) { return M[i][j]; } + + void ToString(char* dest, size_t destsize) const + { + size_t pos = 0; + for (int r=0; r<3; r++) + { + for (int c=0; c<3; c++) + pos += OVRMath_sprintf(dest+pos, destsize-pos, "%g ", M[r][c]); + } + } + + static Matrix3 FromString(const char* src) + { + Matrix3 result; + if (src) + { + for (int r=0; r<3; r++) + { + for (int c=0; c<3; c++) + { + result.M[r][c] = (T)atof(src); + while (*src && *src != ' ') + src++; + while (*src && *src == ' ') + src++; + } + } + } + return result; + } + + static Matrix3 Identity() { return Matrix3(); } + + void SetIdentity() + { + M[0][0] = M[1][1] = M[2][2] = T(1); + M[0][1] = M[1][0] = M[2][0] = T(0); + M[0][2] = M[1][2] = M[2][1] = T(0); + } + + static Matrix3 Diagonal(T m00, T m11, T m22) + { + return Matrix3(m00, 0, 0, + 0, m11, 0, + 0, 0, m22); + } + static Matrix3 Diagonal(const Vector3& v) { return Diagonal(v.x, v.y, v.z); } + + T Trace() const { return M[0][0] + M[1][1] + M[2][2]; } + + bool operator== (const Matrix3& b) const + { + bool isEqual = true; + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + isEqual &= (M[i][j] == b.M[i][j]); + } + + return isEqual; + } + + Matrix3 operator+ (const Matrix3& b) const + { + Matrix3 result(*this); + result += b; + return result; + } + + Matrix3& operator+= (const Matrix3& b) + { + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + M[i][j] += b.M[i][j]; + return *this; + } + + void operator= (const Matrix3& b) + { + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + M[i][j] = b.M[i][j]; + } + + Matrix3 operator- (const Matrix3& b) const + { + Matrix3 result(*this); + result -= b; + return result; + } + + Matrix3& operator-= (const Matrix3& b) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + M[i][j] -= b.M[i][j]; + } + + return *this; + } + + // Multiplies two matrices into destination with minimum copying. + static Matrix3& Multiply(Matrix3* d, const Matrix3& a, const Matrix3& b) + { + OVR_MATH_ASSERT((d != &a) && (d != &b)); + int i = 0; + do { + d->M[i][0] = a.M[i][0] * b.M[0][0] + a.M[i][1] * b.M[1][0] + a.M[i][2] * b.M[2][0]; + d->M[i][1] = a.M[i][0] * b.M[0][1] + a.M[i][1] * b.M[1][1] + a.M[i][2] * b.M[2][1]; + d->M[i][2] = a.M[i][0] * b.M[0][2] + a.M[i][1] * b.M[1][2] + a.M[i][2] * b.M[2][2]; + } while((++i) < 3); + + return *d; + } + + Matrix3 operator* (const Matrix3& b) const + { + Matrix3 result(Matrix3::NoInit); + Multiply(&result, *this, b); + return result; + } + + Matrix3& operator*= (const Matrix3& b) + { + return Multiply(this, Matrix3(*this), b); + } + + Matrix3 operator* (T s) const + { + Matrix3 result(*this); + result *= s; + return result; + } + + Matrix3& operator*= (T s) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + M[i][j] *= s; + } + + return *this; + } + + Vector3 operator* (const Vector3 &b) const + { + Vector3 result; + result.x = M[0][0]*b.x + M[0][1]*b.y + M[0][2]*b.z; + result.y = M[1][0]*b.x + M[1][1]*b.y + M[1][2]*b.z; + result.z = M[2][0]*b.x + M[2][1]*b.y + M[2][2]*b.z; + + return result; + } + + Matrix3 operator/ (T s) const + { + Matrix3 result(*this); + result /= s; + return result; + } + + Matrix3& operator/= (T s) + { + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + M[i][j] /= s; + } + + return *this; + } + + Vector2 Transform(const Vector2& v) const + { + const T rcpZ = T(1) / (M[2][0] * v.x + M[2][1] * v.y + M[2][2]); + return Vector2((M[0][0] * v.x + M[0][1] * v.y + M[0][2]) * rcpZ, + (M[1][0] * v.x + M[1][1] * v.y + M[1][2]) * rcpZ); + } + + Vector3 Transform(const Vector3& v) const + { + return Vector3(M[0][0] * v.x + M[0][1] * v.y + M[0][2] * v.z, + M[1][0] * v.x + M[1][1] * v.y + M[1][2] * v.z, + M[2][0] * v.x + M[2][1] * v.y + M[2][2] * v.z); + } + + Matrix3 Transposed() const + { + return Matrix3(M[0][0], M[1][0], M[2][0], + M[0][1], M[1][1], M[2][1], + M[0][2], M[1][2], M[2][2]); + } + + void Transpose() + { + *this = Transposed(); + } + + + T SubDet (const size_t* rows, const size_t* cols) const + { + return M[rows[0]][cols[0]] * (M[rows[1]][cols[1]] * M[rows[2]][cols[2]] - M[rows[1]][cols[2]] * M[rows[2]][cols[1]]) + - M[rows[0]][cols[1]] * (M[rows[1]][cols[0]] * M[rows[2]][cols[2]] - M[rows[1]][cols[2]] * M[rows[2]][cols[0]]) + + M[rows[0]][cols[2]] * (M[rows[1]][cols[0]] * M[rows[2]][cols[1]] - M[rows[1]][cols[1]] * M[rows[2]][cols[0]]); + } + + + // M += a*b.t() + inline void Rank1Add(const Vector3 &a, const Vector3 &b) + { + M[0][0] += a.x*b.x; M[0][1] += a.x*b.y; M[0][2] += a.x*b.z; + M[1][0] += a.y*b.x; M[1][1] += a.y*b.y; M[1][2] += a.y*b.z; + M[2][0] += a.z*b.x; M[2][1] += a.z*b.y; M[2][2] += a.z*b.z; + } + + // M -= a*b.t() + inline void Rank1Sub(const Vector3 &a, const Vector3 &b) + { + M[0][0] -= a.x*b.x; M[0][1] -= a.x*b.y; M[0][2] -= a.x*b.z; + M[1][0] -= a.y*b.x; M[1][1] -= a.y*b.y; M[1][2] -= a.y*b.z; + M[2][0] -= a.z*b.x; M[2][1] -= a.z*b.y; M[2][2] -= a.z*b.z; + } + + inline Vector3 Col(int c) const + { + return Vector3(M[0][c], M[1][c], M[2][c]); + } + + inline Vector3 Row(int r) const + { + return Vector3(M[r][0], M[r][1], M[r][2]); + } + + inline Vector3 GetColumn(int c) const + { + return Vector3(M[0][c], M[1][c], M[2][c]); + } + + inline Vector3 GetRow(int r) const + { + return Vector3(M[r][0], M[r][1], M[r][2]); + } + + inline void SetColumn(int c, const Vector3& v) + { + M[0][c] = v.x; + M[1][c] = v.y; + M[2][c] = v.z; + } + + inline void SetRow(int r, const Vector3& v) + { + M[r][0] = v.x; + M[r][1] = v.y; + M[r][2] = v.z; + } + + inline T Determinant() const + { + const Matrix3& m = *this; + T d; + + d = m.M[0][0] * (m.M[1][1]*m.M[2][2] - m.M[1][2] * m.M[2][1]); + d -= m.M[0][1] * (m.M[1][0]*m.M[2][2] - m.M[1][2] * m.M[2][0]); + d += m.M[0][2] * (m.M[1][0]*m.M[2][1] - m.M[1][1] * m.M[2][0]); + + return d; + } + + inline Matrix3 Inverse() const + { + Matrix3 a; + const Matrix3& m = *this; + T d = Determinant(); + + OVR_MATH_ASSERT(d != 0); + T s = T(1)/d; + + a.M[0][0] = s * (m.M[1][1] * m.M[2][2] - m.M[1][2] * m.M[2][1]); + a.M[1][0] = s * (m.M[1][2] * m.M[2][0] - m.M[1][0] * m.M[2][2]); + a.M[2][0] = s * (m.M[1][0] * m.M[2][1] - m.M[1][1] * m.M[2][0]); + + a.M[0][1] = s * (m.M[0][2] * m.M[2][1] - m.M[0][1] * m.M[2][2]); + a.M[1][1] = s * (m.M[0][0] * m.M[2][2] - m.M[0][2] * m.M[2][0]); + a.M[2][1] = s * (m.M[0][1] * m.M[2][0] - m.M[0][0] * m.M[2][1]); + + a.M[0][2] = s * (m.M[0][1] * m.M[1][2] - m.M[0][2] * m.M[1][1]); + a.M[1][2] = s * (m.M[0][2] * m.M[1][0] - m.M[0][0] * m.M[1][2]); + a.M[2][2] = s * (m.M[0][0] * m.M[1][1] - m.M[0][1] * m.M[1][0]); + + return a; + } + + // Outer Product of two column vectors: a * b.Transpose() + static Matrix3 OuterProduct(const Vector3& a, const Vector3& b) + { + return Matrix3(a.x*b.x, a.x*b.y, a.x*b.z, + a.y*b.x, a.y*b.y, a.y*b.z, + a.z*b.x, a.z*b.y, a.z*b.z); + } + + // Vector cross product as a premultiply matrix: + // L.Cross(R) = LeftCrossAsMatrix(L) * R + static Matrix3 LeftCrossAsMatrix(const Vector3& L) + { + return Matrix3( + T(0), -L.z, +L.y, + +L.z, T(0), -L.x, + -L.y, +L.x, T(0)); + } + + // Vector cross product as a premultiply matrix: + // L.Cross(R) = RightCrossAsMatrix(R) * L + static Matrix3 RightCrossAsMatrix(const Vector3& R) + { + return Matrix3( + T(0), +R.z, -R.y, + -R.z, T(0), +R.x, + +R.y, -R.x, T(0)); + } + + // Angle in radians of a rotation matrix + // Uses identity trace(a) = 2*cos(theta) + 1 + T Angle() const + { + return Acos((Trace() - T(1)) * T(0.5)); + } + + // Angle in radians between two rotation matrices + T Angle(const Matrix3& b) const + { + // Compute trace of (this->Transposed() * b) + // This works out to sum of products of elements. + T trace = T(0); + for (int i = 0; i < 3; i++) + { + for (int j = 0; j < 3; j++) + { + trace += M[i][j] * b.M[i][j]; + } + } + return Acos((trace - T(1)) * T(0.5)); + } +}; + +typedef Matrix3 Matrix3f; +typedef Matrix3 Matrix3d; + +//------------------------------------------------------------------------------------- +// ***** Matrix2 + +template +class Matrix2 +{ +public: + typedef T ElementType; + static const size_t Dimension = 2; + + T M[2][2]; + + enum NoInitType { NoInit }; + + // Construct with no memory initialization. + Matrix2(NoInitType) { } + + // By default, we construct identity matrix. + Matrix2() + { + M[0][0] = M[1][1] = T(1); + M[0][1] = M[1][0] = T(0); + } + + Matrix2(T m11, T m12, + T m21, T m22) + { + M[0][0] = m11; M[0][1] = m12; + M[1][0] = m21; M[1][1] = m22; + } + + // Construction from X, Y basis vectors + Matrix2(const Vector2& xBasis, const Vector2& yBasis) + { + M[0][0] = xBasis.x; M[0][1] = yBasis.x; + M[1][0] = xBasis.y; M[1][1] = yBasis.y; + } + + explicit Matrix2(T s) + { + M[0][0] = M[1][1] = s; + M[0][1] = M[1][0] = T(0); + } + + Matrix2(T m11, T m22) + { + M[0][0] = m11; M[0][1] = T(0); + M[1][0] = T(0); M[1][1] = m22; + } + + explicit Matrix2(const Matrix2::OtherFloatType> &src) + { + M[0][0] = T(src.M[0][0]); M[0][1] = T(src.M[0][1]); + M[1][0] = T(src.M[1][0]); M[1][1] = T(src.M[1][1]); + } + + // C-interop support + Matrix2(const typename CompatibleTypes >::Type& s) + { + OVR_MATH_STATIC_ASSERT(sizeof(s) == sizeof(Matrix2), "sizeof(s) == sizeof(Matrix2)"); + memcpy(M, s.M, sizeof(M)); + } + + operator const typename CompatibleTypes >::Type() const + { + typename CompatibleTypes >::Type result; + OVR_MATH_STATIC_ASSERT(sizeof(result) == sizeof(Matrix2), "sizeof(result) == sizeof(Matrix2)"); + memcpy(result.M, M, sizeof(M)); + return result; + } + + T operator()(int i, int j) const { return M[i][j]; } + T& operator()(int i, int j) { return M[i][j]; } + const T* operator[](int i) const { return M[i]; } + T* operator[](int i) { return M[i]; } + + static Matrix2 Identity() { return Matrix2(); } + + void SetIdentity() + { + M[0][0] = M[1][1] = T(1); + M[0][1] = M[1][0] = T(0); + } + + static Matrix2 Diagonal(T m00, T m11) + { + return Matrix2(m00, m11); + } + static Matrix2 Diagonal(const Vector2& v) { return Matrix2(v.x, v.y); } + + T Trace() const { return M[0][0] + M[1][1]; } + + bool operator== (const Matrix2& b) const + { + return M[0][0] == b.M[0][0] && M[0][1] == b.M[0][1] && + M[1][0] == b.M[1][0] && M[1][1] == b.M[1][1]; + } + + Matrix2 operator+ (const Matrix2& b) const + { + return Matrix2(M[0][0] + b.M[0][0], M[0][1] + b.M[0][1], + M[1][0] + b.M[1][0], M[1][1] + b.M[1][1]); + } + + Matrix2& operator+= (const Matrix2& b) + { + M[0][0] += b.M[0][0]; M[0][1] += b.M[0][1]; + M[1][0] += b.M[1][0]; M[1][1] += b.M[1][1]; + return *this; + } + + void operator= (const Matrix2& b) + { + M[0][0] = b.M[0][0]; M[0][1] = b.M[0][1]; + M[1][0] = b.M[1][0]; M[1][1] = b.M[1][1]; + } + + Matrix2 operator- (const Matrix2& b) const + { + return Matrix2(M[0][0] - b.M[0][0], M[0][1] - b.M[0][1], + M[1][0] - b.M[1][0], M[1][1] - b.M[1][1]); + } + + Matrix2& operator-= (const Matrix2& b) + { + M[0][0] -= b.M[0][0]; M[0][1] -= b.M[0][1]; + M[1][0] -= b.M[1][0]; M[1][1] -= b.M[1][1]; + return *this; + } + + Matrix2 operator* (const Matrix2& b) const + { + return Matrix2(M[0][0] * b.M[0][0] + M[0][1] * b.M[1][0], M[0][0] * b.M[0][1] + M[0][1] * b.M[1][1], + M[1][0] * b.M[0][0] + M[1][1] * b.M[1][0], M[1][0] * b.M[0][1] + M[1][1] * b.M[1][1]); + } + + Matrix2& operator*= (const Matrix2& b) + { + *this = *this * b; + return *this; + } + + Matrix2 operator* (T s) const + { + return Matrix2(M[0][0] * s, M[0][1] * s, + M[1][0] * s, M[1][1] * s); + } + + Matrix2& operator*= (T s) + { + M[0][0] *= s; M[0][1] *= s; + M[1][0] *= s; M[1][1] *= s; + return *this; + } + + Matrix2 operator/ (T s) const + { + return *this * (T(1) / s); + } + + Matrix2& operator/= (T s) + { + return *this *= (T(1) / s); + } + + Vector2 operator* (const Vector2 &b) const + { + return Vector2(M[0][0] * b.x + M[0][1] * b.y, + M[1][0] * b.x + M[1][1] * b.y); + } + + Vector2 Transform(const Vector2& v) const + { + return Vector2(M[0][0] * v.x + M[0][1] * v.y, + M[1][0] * v.x + M[1][1] * v.y); + } + + Matrix2 Transposed() const + { + return Matrix2(M[0][0], M[1][0], + M[0][1], M[1][1]); + } + + void Transpose() + { + OVRMath_Swap(M[1][0], M[0][1]); + } + + Vector2 GetColumn(int c) const + { + return Vector2(M[0][c], M[1][c]); + } + + Vector2 GetRow(int r) const + { + return Vector2(M[r][0], M[r][1]); + } + + void SetColumn(int c, const Vector2& v) + { + M[0][c] = v.x; + M[1][c] = v.y; + } + + void SetRow(int r, const Vector2& v) + { + M[r][0] = v.x; + M[r][1] = v.y; + } + + T Determinant() const + { + return M[0][0] * M[1][1] - M[0][1] * M[1][0]; + } + + Matrix2 Inverse() const + { + T rcpDet = T(1) / Determinant(); + return Matrix2( M[1][1] * rcpDet, -M[0][1] * rcpDet, + -M[1][0] * rcpDet, M[0][0] * rcpDet); + } + + // Outer Product of two column vectors: a * b.Transpose() + static Matrix2 OuterProduct(const Vector2& a, const Vector2& b) + { + return Matrix2(a.x*b.x, a.x*b.y, + a.y*b.x, a.y*b.y); + } + + // Angle in radians between two rotation matrices + T Angle(const Matrix2& b) const + { + const Matrix2& a = *this; + return Acos(a(0, 0)*b(0, 0) + a(1, 0)*b(1, 0)); + } +}; + +typedef Matrix2 Matrix2f; +typedef Matrix2 Matrix2d; + +//------------------------------------------------------------------------------------- + +template +class SymMat3 +{ +private: + typedef SymMat3 this_type; + +public: + typedef T Value_t; + // Upper symmetric + T v[6]; // _00 _01 _02 _11 _12 _22 + + inline SymMat3() {} + + inline explicit SymMat3(T s) + { + v[0] = v[3] = v[5] = s; + v[1] = v[2] = v[4] = T(0); + } + + inline explicit SymMat3(T a00, T a01, T a02, T a11, T a12, T a22) + { + v[0] = a00; v[1] = a01; v[2] = a02; + v[3] = a11; v[4] = a12; + v[5] = a22; + } + + // Cast to symmetric Matrix3 + operator Matrix3() const + { + return Matrix3(v[0], v[1], v[2], + v[1], v[3], v[4], + v[2], v[4], v[5]); + } + + static inline int Index(unsigned int i, unsigned int j) + { + return (i <= j) ? (3*i - i*(i+1)/2 + j) : (3*j - j*(j+1)/2 + i); + } + + inline T operator()(int i, int j) const { return v[Index(i,j)]; } + + inline T &operator()(int i, int j) { return v[Index(i,j)]; } + + inline this_type& operator+=(const this_type& b) + { + v[0]+=b.v[0]; + v[1]+=b.v[1]; + v[2]+=b.v[2]; + v[3]+=b.v[3]; + v[4]+=b.v[4]; + v[5]+=b.v[5]; + return *this; + } + + inline this_type& operator-=(const this_type& b) + { + v[0]-=b.v[0]; + v[1]-=b.v[1]; + v[2]-=b.v[2]; + v[3]-=b.v[3]; + v[4]-=b.v[4]; + v[5]-=b.v[5]; + + return *this; + } + + inline this_type& operator*=(T s) + { + v[0]*=s; + v[1]*=s; + v[2]*=s; + v[3]*=s; + v[4]*=s; + v[5]*=s; + + return *this; + } + + inline SymMat3 operator*(T s) const + { + SymMat3 d; + d.v[0] = v[0]*s; + d.v[1] = v[1]*s; + d.v[2] = v[2]*s; + d.v[3] = v[3]*s; + d.v[4] = v[4]*s; + d.v[5] = v[5]*s; + + return d; + } + + // Multiplies two matrices into destination with minimum copying. + static SymMat3& Multiply(SymMat3* d, const SymMat3& a, const SymMat3& b) + { + // _00 _01 _02 _11 _12 _22 + + d->v[0] = a.v[0] * b.v[0]; + d->v[1] = a.v[0] * b.v[1] + a.v[1] * b.v[3]; + d->v[2] = a.v[0] * b.v[2] + a.v[1] * b.v[4]; + + d->v[3] = a.v[3] * b.v[3]; + d->v[4] = a.v[3] * b.v[4] + a.v[4] * b.v[5]; + + d->v[5] = a.v[5] * b.v[5]; + + return *d; + } + + inline T Determinant() const + { + const this_type& m = *this; + T d; + + d = m(0,0) * (m(1,1)*m(2,2) - m(1,2) * m(2,1)); + d -= m(0,1) * (m(1,0)*m(2,2) - m(1,2) * m(2,0)); + d += m(0,2) * (m(1,0)*m(2,1) - m(1,1) * m(2,0)); + + return d; + } + + inline this_type Inverse() const + { + this_type a; + const this_type& m = *this; + T d = Determinant(); + + OVR_MATH_ASSERT(d != 0); + T s = T(1)/d; + + a(0,0) = s * (m(1,1) * m(2,2) - m(1,2) * m(2,1)); + + a(0,1) = s * (m(0,2) * m(2,1) - m(0,1) * m(2,2)); + a(1,1) = s * (m(0,0) * m(2,2) - m(0,2) * m(2,0)); + + a(0,2) = s * (m(0,1) * m(1,2) - m(0,2) * m(1,1)); + a(1,2) = s * (m(0,2) * m(1,0) - m(0,0) * m(1,2)); + a(2,2) = s * (m(0,0) * m(1,1) - m(0,1) * m(1,0)); + + return a; + } + + inline T Trace() const { return v[0] + v[3] + v[5]; } + + // M = a*a.t() + inline void Rank1(const Vector3 &a) + { + v[0] = a.x*a.x; v[1] = a.x*a.y; v[2] = a.x*a.z; + v[3] = a.y*a.y; v[4] = a.y*a.z; + v[5] = a.z*a.z; + } + + // M += a*a.t() + inline void Rank1Add(const Vector3 &a) + { + v[0] += a.x*a.x; v[1] += a.x*a.y; v[2] += a.x*a.z; + v[3] += a.y*a.y; v[4] += a.y*a.z; + v[5] += a.z*a.z; + } + + // M -= a*a.t() + inline void Rank1Sub(const Vector3 &a) + { + v[0] -= a.x*a.x; v[1] -= a.x*a.y; v[2] -= a.x*a.z; + v[3] -= a.y*a.y; v[4] -= a.y*a.z; + v[5] -= a.z*a.z; + } +}; + +typedef SymMat3 SymMat3f; +typedef SymMat3 SymMat3d; + +template +inline Matrix3 operator*(const SymMat3& a, const SymMat3& b) +{ + #define AJB_ARBC(r,c) (a(r,0)*b(0,c)+a(r,1)*b(1,c)+a(r,2)*b(2,c)) + return Matrix3( + AJB_ARBC(0,0), AJB_ARBC(0,1), AJB_ARBC(0,2), + AJB_ARBC(1,0), AJB_ARBC(1,1), AJB_ARBC(1,2), + AJB_ARBC(2,0), AJB_ARBC(2,1), AJB_ARBC(2,2)); + #undef AJB_ARBC +} + +template +inline Matrix3 operator*(const Matrix3& a, const SymMat3& b) +{ + #define AJB_ARBC(r,c) (a(r,0)*b(0,c)+a(r,1)*b(1,c)+a(r,2)*b(2,c)) + return Matrix3( + AJB_ARBC(0,0), AJB_ARBC(0,1), AJB_ARBC(0,2), + AJB_ARBC(1,0), AJB_ARBC(1,1), AJB_ARBC(1,2), + AJB_ARBC(2,0), AJB_ARBC(2,1), AJB_ARBC(2,2)); + #undef AJB_ARBC +} + +//------------------------------------------------------------------------------------- +// ***** Angle + +// Cleanly representing the algebra of 2D rotations. +// The operations maintain the angle between -Pi and Pi, the same range as atan2. + +template +class Angle +{ +public: + enum AngularUnits + { + Radians = 0, + Degrees = 1 + }; + + Angle() : a(0) {} + + // Fix the range to be between -Pi and Pi + Angle(T a_, AngularUnits u = Radians) : a((u == Radians) ? a_ : a_*((T)MATH_DOUBLE_DEGREETORADFACTOR)) { FixRange(); } + + T Get(AngularUnits u = Radians) const { return (u == Radians) ? a : a*((T)MATH_DOUBLE_RADTODEGREEFACTOR); } + void Set(const T& x, AngularUnits u = Radians) { a = (u == Radians) ? x : x*((T)MATH_DOUBLE_DEGREETORADFACTOR); FixRange(); } + int Sign() const { if (a == 0) return 0; else return (a > 0) ? 1 : -1; } + T Abs() const { return (a >= 0) ? a : -a; } + + bool operator== (const Angle& b) const { return a == b.a; } + bool operator!= (const Angle& b) const { return a != b.a; } +// bool operator< (const Angle& b) const { return a < a.b; } +// bool operator> (const Angle& b) const { return a > a.b; } +// bool operator<= (const Angle& b) const { return a <= a.b; } +// bool operator>= (const Angle& b) const { return a >= a.b; } +// bool operator= (const T& x) { a = x; FixRange(); } + + // These operations assume a is already between -Pi and Pi. + Angle& operator+= (const Angle& b) { a = a + b.a; FastFixRange(); return *this; } + Angle& operator+= (const T& x) { a = a + x; FixRange(); return *this; } + Angle operator+ (const Angle& b) const { Angle res = *this; res += b; return res; } + Angle operator+ (const T& x) const { Angle res = *this; res += x; return res; } + Angle& operator-= (const Angle& b) { a = a - b.a; FastFixRange(); return *this; } + Angle& operator-= (const T& x) { a = a - x; FixRange(); return *this; } + Angle operator- (const Angle& b) const { Angle res = *this; res -= b; return res; } + Angle operator- (const T& x) const { Angle res = *this; res -= x; return res; } + + T Distance(const Angle& b) { T c = fabs(a - b.a); return (c <= ((T)MATH_DOUBLE_PI)) ? c : ((T)MATH_DOUBLE_TWOPI) - c; } + +private: + + // The stored angle, which should be maintained between -Pi and Pi + T a; + + // Fixes the angle range to [-Pi,Pi], but assumes no more than 2Pi away on either side + inline void FastFixRange() + { + if (a < -((T)MATH_DOUBLE_PI)) + a += ((T)MATH_DOUBLE_TWOPI); + else if (a > ((T)MATH_DOUBLE_PI)) + a -= ((T)MATH_DOUBLE_TWOPI); + } + + // Fixes the angle range to [-Pi,Pi] for any given range, but slower then the fast method + inline void FixRange() + { + // do nothing if the value is already in the correct range, since fmod call is expensive + if (a >= -((T)MATH_DOUBLE_PI) && a <= ((T)MATH_DOUBLE_PI)) + return; + a = fmod(a,((T)MATH_DOUBLE_TWOPI)); + if (a < -((T)MATH_DOUBLE_PI)) + a += ((T)MATH_DOUBLE_TWOPI); + else if (a > ((T)MATH_DOUBLE_PI)) + a -= ((T)MATH_DOUBLE_TWOPI); + } +}; + + +typedef Angle Anglef; +typedef Angle Angled; + + +//------------------------------------------------------------------------------------- +// ***** Plane + +// Consists of a normal vector and distance from the origin where the plane is located. + +template +class Plane +{ +public: + Vector3 N; + T D; + + Plane() : D(0) {} + + // Normals must already be normalized + Plane(const Vector3& n, T d) : N(n), D(d) {} + Plane(T x, T y, T z, T d) : N(x,y,z), D(d) {} + + // construct from a point on the plane and the normal + Plane(const Vector3& p, const Vector3& n) : N(n), D(-(p * n)) {} + + // Find the point to plane distance. The sign indicates what side of the plane the point is on (0 = point on plane). + T TestSide(const Vector3& p) const + { + return (N.Dot(p)) + D; + } + + Plane Flipped() const + { + return Plane(-N, -D); + } + + void Flip() + { + N = -N; + D = -D; + } + + bool operator==(const Plane& rhs) const + { + return (this->D == rhs.D && this->N == rhs.N); + } +}; + +typedef Plane Planef; +typedef Plane Planed; + + + + +//----------------------------------------------------------------------------------- +// ***** ScaleAndOffset2D + +struct ScaleAndOffset2D +{ + Vector2f Scale; + Vector2f Offset; + + ScaleAndOffset2D(float sx = 0.0f, float sy = 0.0f, float ox = 0.0f, float oy = 0.0f) + : Scale(sx, sy), Offset(ox, oy) + { } +}; + + +//----------------------------------------------------------------------------------- +// ***** FovPort + +// FovPort describes Field Of View (FOV) of a viewport. +// This class has values for up, down, left and right, stored in +// tangent of the angle units to simplify calculations. +// +// As an example, for a standard 90 degree vertical FOV, we would +// have: { UpTan = tan(90 degrees / 2), DownTan = tan(90 degrees / 2) }. +// +// CreateFromRadians/Degrees helper functions can be used to +// access FOV in different units. + + +// ***** FovPort + +struct FovPort +{ + float UpTan; + float DownTan; + float LeftTan; + float RightTan; + + FovPort ( float sideTan = 0.0f ) : + UpTan(sideTan), DownTan(sideTan), LeftTan(sideTan), RightTan(sideTan) { } + FovPort ( float u, float d, float l, float r ) : + UpTan(u), DownTan(d), LeftTan(l), RightTan(r) { } + + // C-interop support: FovPort <-> ovrFovPort (implementation in OVR_CAPI.cpp). + FovPort(const ovrFovPort &src) + : UpTan(src.UpTan), DownTan(src.DownTan), LeftTan(src.LeftTan), RightTan(src.RightTan) + { } + + operator ovrFovPort () const + { + ovrFovPort result; + result.LeftTan = LeftTan; + result.RightTan = RightTan; + result.UpTan = UpTan; + result.DownTan = DownTan; + return result; + } + + static FovPort CreateFromRadians(float horizontalFov, float verticalFov) + { + FovPort result; + result.UpTan = tanf ( verticalFov * 0.5f ); + result.DownTan = tanf ( verticalFov * 0.5f ); + result.LeftTan = tanf ( horizontalFov * 0.5f ); + result.RightTan = tanf ( horizontalFov * 0.5f ); + return result; + } + + static FovPort CreateFromDegrees(float horizontalFovDegrees, + float verticalFovDegrees) + { + return CreateFromRadians(DegreeToRad(horizontalFovDegrees), + DegreeToRad(verticalFovDegrees)); + } + + // Get Horizontal/Vertical components of Fov in radians. + float GetVerticalFovRadians() const { return atanf(UpTan) + atanf(DownTan); } + float GetHorizontalFovRadians() const { return atanf(LeftTan) + atanf(RightTan); } + // Get Horizontal/Vertical components of Fov in degrees. + float GetVerticalFovDegrees() const { return RadToDegree(GetVerticalFovRadians()); } + float GetHorizontalFovDegrees() const { return RadToDegree(GetHorizontalFovRadians()); } + + // Compute maximum tangent value among all four sides. + float GetMaxSideTan() const + { + return OVRMath_Max(OVRMath_Max(UpTan, DownTan), OVRMath_Max(LeftTan, RightTan)); + } + + static ScaleAndOffset2D CreateNDCScaleAndOffsetFromFov ( FovPort tanHalfFov ) + { + float projXScale = 2.0f / ( tanHalfFov.LeftTan + tanHalfFov.RightTan ); + float projXOffset = ( tanHalfFov.LeftTan - tanHalfFov.RightTan ) * projXScale * 0.5f; + float projYScale = 2.0f / ( tanHalfFov.UpTan + tanHalfFov.DownTan ); + float projYOffset = ( tanHalfFov.UpTan - tanHalfFov.DownTan ) * projYScale * 0.5f; + + ScaleAndOffset2D result; + result.Scale = Vector2f(projXScale, projYScale); + result.Offset = Vector2f(projXOffset, projYOffset); + // Hey - why is that Y.Offset negated? + // It's because a projection matrix transforms from world coords with Y=up, + // whereas this is from NDC which is Y=down. + + return result; + } + + // Converts Fov Tan angle units to [-1,1] render target NDC space + Vector2f TanAngleToRendertargetNDC(Vector2f const &tanEyeAngle) + { + ScaleAndOffset2D eyeToSourceNDC = CreateNDCScaleAndOffsetFromFov(*this); + return tanEyeAngle * eyeToSourceNDC.Scale + eyeToSourceNDC.Offset; + } + + // Compute per-channel minimum and maximum of Fov. + static FovPort Min(const FovPort& a, const FovPort& b) + { + FovPort fov( OVRMath_Min( a.UpTan , b.UpTan ), + OVRMath_Min( a.DownTan , b.DownTan ), + OVRMath_Min( a.LeftTan , b.LeftTan ), + OVRMath_Min( a.RightTan, b.RightTan ) ); + return fov; + } + + static FovPort Max(const FovPort& a, const FovPort& b) + { + FovPort fov( OVRMath_Max( a.UpTan , b.UpTan ), + OVRMath_Max( a.DownTan , b.DownTan ), + OVRMath_Max( a.LeftTan , b.LeftTan ), + OVRMath_Max( a.RightTan, b.RightTan ) ); + return fov; + } +}; + + +} // Namespace OVR + + +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + + +#endif diff --git a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_StereoProjection.h b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_StereoProjection.h new file mode 100644 index 00000000..b4bc3bc7 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_StereoProjection.h @@ -0,0 +1,70 @@ +/************************************************************************************ + +Filename : OVR_StereoProjection.h +Content : Stereo projection functions +Created : November 30, 2013 +Authors : Tom Fosyth + +Copyright : Copyright 2014-2016 Oculus VR, LLC All Rights reserved. + +Licensed under the Oculus VR Rift SDK License Version 3.3 (the "License"); +you may not use the Oculus VR Rift SDK except in compliance with the License, +which is provided at the time of installation or download, or which +otherwise accompanies this software in either electronic or hard copy form. + +You may obtain a copy of the License at + +http://www.oculusvr.com/licenses/LICENSE-3.3 + +Unless required by applicable law or agreed to in writing, the Oculus VR SDK +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +*************************************************************************************/ + +#ifndef OVR_StereoProjection_h +#define OVR_StereoProjection_h + + +#include "Extras/OVR_Math.h" + + +namespace OVR { + + +//----------------------------------------------------------------------------------- +// ***** Stereo Enumerations + +// StereoEye specifies which eye we are rendering for; it is used to +// retrieve StereoEyeParams. +enum StereoEye +{ + StereoEye_Left, + StereoEye_Right, + StereoEye_Center +}; + + + +//----------------------------------------------------------------------------------- +// ***** Propjection functions + +Matrix4f CreateProjection ( bool rightHanded, bool isOpenGL, FovPort fov, StereoEye eye, + float zNear = 0.01f, float zFar = 10000.0f, + bool flipZ = false, bool farAtInfinity = false); + +Matrix4f CreateOrthoSubProjection ( bool rightHanded, StereoEye eyeType, + float tanHalfFovX, float tanHalfFovY, + float unitsX, float unitsY, float distanceFromCamera, + float interpupillaryDistance, Matrix4f const &projection, + float zNear = 0.0f, float zFar = 0.0f, + bool flipZ = false, bool farAtInfinity = false); + +ScaleAndOffset2D CreateNDCScaleAndOffsetFromFov ( FovPort fov ); + + +} //namespace OVR + +#endif // OVR_StereoProjection_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h new file mode 100644 index 00000000..b1ec3cc0 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h @@ -0,0 +1,2116 @@ +/********************************************************************************//** +\file OVR_CAPI.h +\brief C Interface to the Oculus PC SDK tracking and rendering library. +\copyright Copyright 2014 Oculus VR, LLC All Rights reserved. +************************************************************************************/ + +#ifndef OVR_CAPI_h // We don't use version numbers within this name, as all versioned variations of this file are currently mutually exclusive. +#define OVR_CAPI_h ///< Header include guard + + +#include "OVR_CAPI_Keys.h" +#include "OVR_Version.h" +#include "OVR_ErrorCode.h" + + +#include + +#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable: 4324) // structure was padded due to __declspec(align()) + #pragma warning(disable: 4359) // The alignment specified for a type is less than the alignment of the type of one of its data members +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_OS +// +#if !defined(OVR_OS_WIN32) && defined(_WIN32) + #define OVR_OS_WIN32 +#endif + +#if !defined(OVR_OS_MAC) && defined(__APPLE__) + #define OVR_OS_MAC +#endif + +#if !defined(OVR_OS_LINUX) && defined(__linux__) + #define OVR_OS_LINUX +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_CPP +// +#if !defined(OVR_CPP) + #if defined(__cplusplus) + #define OVR_CPP(x) x + #else + #define OVR_CPP(x) /* Not C++ */ + #endif +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_CDECL +// +/// LibOVR calling convention for 32-bit Windows builds. +// +#if !defined(OVR_CDECL) + #if defined(_WIN32) + #define OVR_CDECL __cdecl + #else + #define OVR_CDECL + #endif +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_EXTERN_C +// +/// Defined as extern "C" when built from C++ code. +// +#if !defined(OVR_EXTERN_C) + #ifdef __cplusplus + #define OVR_EXTERN_C extern "C" + #else + #define OVR_EXTERN_C + #endif +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_PUBLIC_FUNCTION / OVR_PRIVATE_FUNCTION +// +// OVR_PUBLIC_FUNCTION - Functions that externally visible from a shared library. Corresponds to Microsoft __dllexport. +// OVR_PUBLIC_CLASS - C++ structs and classes that are externally visible from a shared library. Corresponds to Microsoft __dllexport. +// OVR_PRIVATE_FUNCTION - Functions that are not visible outside of a shared library. They are private to the shared library. +// OVR_PRIVATE_CLASS - C++ structs and classes that are not visible outside of a shared library. They are private to the shared library. +// +// OVR_DLL_BUILD - Used to indicate that the current compilation unit is of a shared library. +// OVR_DLL_IMPORT - Used to indicate that the current compilation unit is a user of the corresponding shared library. +// OVR_STATIC_BUILD - used to indicate that the current compilation unit is not a shared library but rather statically linked code. +// +#if !defined(OVR_PUBLIC_FUNCTION) + #if defined(OVR_DLL_BUILD) + #if defined(_WIN32) + #define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllexport) rval OVR_CDECL + #define OVR_PUBLIC_CLASS __declspec(dllexport) + #define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL + #define OVR_PRIVATE_CLASS + #else + #define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __attribute__((visibility("default"))) rval OVR_CDECL /* Requires GCC 4.0+ */ + #define OVR_PUBLIC_CLASS __attribute__((visibility("default"))) /* Requires GCC 4.0+ */ + #define OVR_PRIVATE_FUNCTION(rval) __attribute__((visibility("hidden"))) rval OVR_CDECL + #define OVR_PRIVATE_CLASS __attribute__((visibility("hidden"))) + #endif + #elif defined(OVR_DLL_IMPORT) + #if defined(_WIN32) + #define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C __declspec(dllimport) rval OVR_CDECL + #define OVR_PUBLIC_CLASS __declspec(dllimport) + #else + #define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL + #define OVR_PUBLIC_CLASS + #endif + #define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL + #define OVR_PRIVATE_CLASS + #else // OVR_STATIC_BUILD + #define OVR_PUBLIC_FUNCTION(rval) OVR_EXTERN_C rval OVR_CDECL + #define OVR_PUBLIC_CLASS + #define OVR_PRIVATE_FUNCTION(rval) rval OVR_CDECL + #define OVR_PRIVATE_CLASS + #endif +#endif + + +//----------------------------------------------------------------------------------- +// ***** OVR_EXPORT +// +/// Provided for backward compatibility with older versions of this library. +// +#if !defined(OVR_EXPORT) + #ifdef OVR_OS_WIN32 + #define OVR_EXPORT __declspec(dllexport) + #else + #define OVR_EXPORT + #endif +#endif + + + +//----------------------------------------------------------------------------------- +// ***** OVR_ALIGNAS +// +#if !defined(OVR_ALIGNAS) + #if defined(__GNUC__) || defined(__clang__) + #define OVR_ALIGNAS(n) __attribute__((aligned(n))) + #elif defined(_MSC_VER) || defined(__INTEL_COMPILER) + #define OVR_ALIGNAS(n) __declspec(align(n)) + #elif defined(__CC_ARM) + #define OVR_ALIGNAS(n) __align(n) + #else + #error Need to define OVR_ALIGNAS + #endif +#endif + + +//----------------------------------------------------------------------------------- +// ***** OVR_CC_HAS_FEATURE +// +// This is a portable way to use compile-time feature identification available +// with some compilers in a clean way. Direct usage of __has_feature in preprocessing +// statements of non-supporting compilers results in a preprocessing error. +// +// Example usage: +// #if OVR_CC_HAS_FEATURE(is_pod) +// if(__is_pod(T)) // If the type is plain data then we can safely memcpy it. +// memcpy(&destObject, &srcObject, sizeof(object)); +// #endif +// +#if !defined(OVR_CC_HAS_FEATURE) + #if defined(__clang__) // http://clang.llvm.org/docs/LanguageExtensions.html#id2 + #define OVR_CC_HAS_FEATURE(x) __has_feature(x) + #else + #define OVR_CC_HAS_FEATURE(x) 0 + #endif +#endif + + +// ------------------------------------------------------------------------ +// ***** OVR_STATIC_ASSERT +// +// Portable support for C++11 static_assert(). +// Acts as if the following were declared: +// void OVR_STATIC_ASSERT(bool const_expression, const char* msg); +// +// Example usage: +// OVR_STATIC_ASSERT(sizeof(int32_t) == 4, "int32_t expected to be 4 bytes."); + +#if !defined(OVR_STATIC_ASSERT) + #if !(defined(__cplusplus) && (__cplusplus >= 201103L)) /* Other */ && \ + !(defined(__GXX_EXPERIMENTAL_CXX0X__)) /* GCC */ && \ + !(defined(__clang__) && defined(__cplusplus) && OVR_CC_HAS_FEATURE(cxx_static_assert)) /* clang */ && \ + !(defined(_MSC_VER) && (_MSC_VER >= 1600) && defined(__cplusplus)) /* VS2010+ */ + + #if !defined(OVR_SA_UNUSED) + #if defined(OVR_CC_GNU) || defined(OVR_CC_CLANG) + #define OVR_SA_UNUSED __attribute__((unused)) + #else + #define OVR_SA_UNUSED + #endif + #define OVR_SA_PASTE(a,b) a##b + #define OVR_SA_HELP(a,b) OVR_SA_PASTE(a,b) + #endif + + #if defined(__COUNTER__) + #define OVR_STATIC_ASSERT(expression, msg) typedef char OVR_SA_HELP(compileTimeAssert, __COUNTER__) [((expression) != 0) ? 1 : -1] OVR_SA_UNUSED + #else + #define OVR_STATIC_ASSERT(expression, msg) typedef char OVR_SA_HELP(compileTimeAssert, __LINE__) [((expression) != 0) ? 1 : -1] OVR_SA_UNUSED + #endif + + #else + #define OVR_STATIC_ASSERT(expression, msg) static_assert(expression, msg) + #endif +#endif + + +//----------------------------------------------------------------------------------- +// ***** Padding +// +/// Defines explicitly unused space for a struct. +/// When used correcly, usage of this macro should not change the size of the struct. +/// Compile-time and runtime behavior with and without this defined should be identical. +/// +#if !defined(OVR_UNUSED_STRUCT_PAD) + #define OVR_UNUSED_STRUCT_PAD(padName, size) char padName[size]; +#endif + + +//----------------------------------------------------------------------------------- +// ***** Word Size +// +/// Specifies the size of a pointer on the given platform. +/// +#if !defined(OVR_PTR_SIZE) + #if defined(__WORDSIZE) + #define OVR_PTR_SIZE ((__WORDSIZE) / 8) + #elif defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(_M_IA64) || defined(__ia64__) || defined(__arch64__) || defined(__64BIT__) || defined(__Ptr_Is_64) + #define OVR_PTR_SIZE 8 + #elif defined(__CC_ARM) && (__sizeof_ptr == 8) + #define OVR_PTR_SIZE 8 + #else + #define OVR_PTR_SIZE 4 + #endif +#endif + + +//----------------------------------------------------------------------------------- +// ***** OVR_ON32 / OVR_ON64 +// +#if OVR_PTR_SIZE == 8 + #define OVR_ON32(x) + #define OVR_ON64(x) x +#else + #define OVR_ON32(x) x + #define OVR_ON64(x) +#endif + + +//----------------------------------------------------------------------------------- +// ***** ovrBool + +typedef char ovrBool; ///< Boolean type +#define ovrFalse 0 ///< ovrBool value of false. +#define ovrTrue 1 ///< ovrBool value of true. + + +//----------------------------------------------------------------------------------- +// ***** Simple Math Structures + +/// A 2D vector with integer components. +typedef struct OVR_ALIGNAS(4) ovrVector2i_ +{ + int x, y; +} ovrVector2i; + +/// A 2D size with integer components. +typedef struct OVR_ALIGNAS(4) ovrSizei_ +{ + int w, h; +} ovrSizei; + +/// A 2D rectangle with a position and size. +/// All components are integers. +typedef struct OVR_ALIGNAS(4) ovrRecti_ +{ + ovrVector2i Pos; + ovrSizei Size; +} ovrRecti; + +/// A quaternion rotation. +typedef struct OVR_ALIGNAS(4) ovrQuatf_ +{ + float x, y, z, w; +} ovrQuatf; + +/// A 2D vector with float components. +typedef struct OVR_ALIGNAS(4) ovrVector2f_ +{ + float x, y; +} ovrVector2f; + +/// A 3D vector with float components. +typedef struct OVR_ALIGNAS(4) ovrVector3f_ +{ + float x, y, z; +} ovrVector3f; + +/// A 4x4 matrix with float elements. +typedef struct OVR_ALIGNAS(4) ovrMatrix4f_ +{ + float M[4][4]; +} ovrMatrix4f; + + +/// Position and orientation together. +typedef struct OVR_ALIGNAS(4) ovrPosef_ +{ + ovrQuatf Orientation; + ovrVector3f Position; +} ovrPosef; + +/// A full pose (rigid body) configuration with first and second derivatives. +/// +/// Body refers to any object for which ovrPoseStatef is providing data. +/// It can be the HMD, Touch controller, sensor or something else. The context +/// depends on the usage of the struct. +typedef struct OVR_ALIGNAS(8) ovrPoseStatef_ +{ + ovrPosef ThePose; ///< Position and orientation. + ovrVector3f AngularVelocity; ///< Angular velocity in radians per second. + ovrVector3f LinearVelocity; ///< Velocity in meters per second. + ovrVector3f AngularAcceleration; ///< Angular acceleration in radians per second per second. + ovrVector3f LinearAcceleration; ///< Acceleration in meters per second per second. + OVR_UNUSED_STRUCT_PAD(pad0, 4) ///< \internal struct pad. + double TimeInSeconds; ///< Absolute time that this pose refers to. \see ovr_GetTimeInSeconds +} ovrPoseStatef; + +/// Describes the up, down, left, and right angles of the field of view. +/// +/// Field Of View (FOV) tangent of the angle units. +/// \note For a standard 90 degree vertical FOV, we would +/// have: { UpTan = tan(90 degrees / 2), DownTan = tan(90 degrees / 2) }. +typedef struct OVR_ALIGNAS(4) ovrFovPort_ +{ + float UpTan; ///< The tangent of the angle between the viewing vector and the top edge of the field of view. + float DownTan; ///< The tangent of the angle between the viewing vector and the bottom edge of the field of view. + float LeftTan; ///< The tangent of the angle between the viewing vector and the left edge of the field of view. + float RightTan; ///< The tangent of the angle between the viewing vector and the right edge of the field of view. +} ovrFovPort; + + +//----------------------------------------------------------------------------------- +// ***** HMD Types + +/// Enumerates all HMD types that we support. +/// +/// The currently released developer kits are ovrHmd_DK1 and ovrHmd_DK2. The other enumerations are for internal use only. +typedef enum ovrHmdType_ +{ + ovrHmd_None = 0, + ovrHmd_DK1 = 3, + ovrHmd_DKHD = 4, + ovrHmd_DK2 = 6, + ovrHmd_CB = 8, + ovrHmd_Other = 9, + ovrHmd_E3_2015 = 10, + ovrHmd_ES06 = 11, + ovrHmd_ES09 = 12, + ovrHmd_ES11 = 13, + ovrHmd_CV1 = 14, + + ovrHmd_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrHmdType; + + +/// HMD capability bits reported by device. +/// +typedef enum ovrHmdCaps_ +{ + // Read-only flags + ovrHmdCap_DebugDevice = 0x0010, ///< (read only) Specifies that the HMD is a virtual debug device. + + + ovrHmdCap_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrHmdCaps; + + +/// Tracking capability bits reported by the device. +/// Used with ovr_GetTrackingCaps. +typedef enum ovrTrackingCaps_ +{ + ovrTrackingCap_Orientation = 0x0010, ///< Supports orientation tracking (IMU). + ovrTrackingCap_MagYawCorrection = 0x0020, ///< Supports yaw drift correction via a magnetometer or other means. + ovrTrackingCap_Position = 0x0040, ///< Supports positional tracking. + ovrTrackingCap_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTrackingCaps; + + +/// Specifies which eye is being used for rendering. +/// This type explicitly does not include a third "NoStereo" monoscopic option, as such is +/// not required for an HMD-centered API. +typedef enum ovrEyeType_ +{ + ovrEye_Left = 0, ///< The left eye, from the viewer's perspective. + ovrEye_Right = 1, ///< The right eye, from the viewer's perspective. + ovrEye_Count = 2, ///< \internal Count of enumerated elements. + ovrEye_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrEyeType; + +/// Specifies the coordinate system ovrTrackingState returns tracking poses in. +/// Used with ovr_SetTrackingOriginType() +typedef enum ovrTrackingOrigin_ +{ + /// \brief Tracking system origin reported at eye (HMD) height + /// \details Prefer using this origin when your application requires + /// matching user's current physical head pose to a virtual head pose + /// without any regards to a the height of the floor. Cockpit-based, + /// or 3rd-person experiences are ideal candidates. + /// When used, all poses in ovrTrackingState are reported as an offset + /// transform from the profile calibrated or recentered HMD pose. + /// It is recommended that apps using this origin type call ovr_RecenterTrackingOrigin + /// prior to starting the VR experience, but notify the user before doing so + /// to make sure the user is in a comfortable pose, facing a comfortable + /// direction. + ovrTrackingOrigin_EyeLevel = 0, + /// \brief Tracking system origin reported at floor height + /// \details Prefer using this origin when your application requires the + /// physical floor height to match the virtual floor height, such as + /// standing experiences. + /// When used, all poses in ovrTrackingState are reported as an offset + /// transform from the profile calibrated floor pose. Calling ovr_RecenterTrackingOrigin + /// will recenter the X & Z axes as well as yaw, but the Y-axis (i.e. height) will continue + /// to be reported using the floor height as the origin for all poses. + ovrTrackingOrigin_FloorLevel = 1, + ovrTrackingOrigin_Count = 2, ///< \internal Count of enumerated elements. + ovrTrackingOrigin_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTrackingOrigin; + +/// Identifies a graphics device in a platform-specific way. +/// For Windows this is a LUID type. +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrGraphicsLuid_ +{ + // Public definition reserves space for graphics API-specific implementation + char Reserved[8]; +} ovrGraphicsLuid; + + +/// This is a complete descriptor of the HMD. +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrHmdDesc_ +{ + ovrHmdType Type; ///< The type of HMD. + OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) ///< \internal struct paddding. + char ProductName[64]; ///< UTF8-encoded product identification string (e.g. "Oculus Rift DK1"). + char Manufacturer[64]; ///< UTF8-encoded HMD manufacturer identification string. + short VendorId; ///< HID (USB) vendor identifier of the device. + short ProductId; ///< HID (USB) product identifier of the device. + char SerialNumber[24]; ///< HMD serial number. + short FirmwareMajor; ///< HMD firmware major version. + short FirmwareMinor; ///< HMD firmware minor version. + unsigned int AvailableHmdCaps; ///< Capability bits described by ovrHmdCaps which the HMD currently supports. + unsigned int DefaultHmdCaps; ///< Capability bits described by ovrHmdCaps which are default for the current Hmd. + unsigned int AvailableTrackingCaps; ///< Capability bits described by ovrTrackingCaps which the system currently supports. + unsigned int DefaultTrackingCaps; ///< Capability bits described by ovrTrackingCaps which are default for the current system. + ovrFovPort DefaultEyeFov[ovrEye_Count]; ///< Defines the recommended FOVs for the HMD. + ovrFovPort MaxEyeFov[ovrEye_Count]; ///< Defines the maximum FOVs for the HMD. + ovrSizei Resolution; ///< Resolution of the full HMD screen (both eyes) in pixels. + float DisplayRefreshRate; ///< Nominal refresh rate of the display in cycles per second at the time of HMD creation. + OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad1, 4)) ///< \internal struct paddding. +} ovrHmdDesc; + + +/// Used as an opaque pointer to an OVR session. +typedef struct ovrHmdStruct* ovrSession; + + + +/// Bit flags describing the current status of sensor tracking. +/// The values must be the same as in enum StatusBits +/// +/// \see ovrTrackingState +/// +typedef enum ovrStatusBits_ +{ + ovrStatus_OrientationTracked = 0x0001, ///< Orientation is currently tracked (connected and in use). + ovrStatus_PositionTracked = 0x0002, ///< Position is currently tracked (false if out of range). + ovrStatus_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrStatusBits; + + +/// Specifies the description of a single sensor. +/// +/// \see ovrGetTrackerDesc +/// +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTrackerDesc_ +{ + float FrustumHFovInRadians; ///< Sensor frustum horizontal field-of-view (if present). + float FrustumVFovInRadians; ///< Sensor frustum vertical field-of-view (if present). + float FrustumNearZInMeters; ///< Sensor frustum near Z (if present). + float FrustumFarZInMeters; ///< Sensor frustum far Z (if present). +} ovrTrackerDesc; + + +/// Specifies sensor flags. +/// +/// /see ovrTrackerPose +/// +typedef enum ovrTrackerFlags_ +{ + ovrTracker_Connected = 0x0020, ///< The sensor is present, else the sensor is absent or offline. + ovrTracker_PoseTracked = 0x0004 ///< The sensor has a valid pose, else the pose is unavailable. This will only be set if ovrTracker_Connected is set. +} ovrTrackerFlags; + + +/// Specifies the pose for a single sensor. +/// +typedef struct OVR_ALIGNAS(8) _ovrTrackerPose +{ + unsigned int TrackerFlags; ///< ovrTrackerFlags. + ovrPosef Pose; ///< The sensor's pose. This pose includes sensor tilt (roll and pitch). For a leveled coordinate system use LeveledPose. + ovrPosef LeveledPose; ///< The sensor's leveled pose, aligned with gravity. This value includes position and yaw of the sensor, but not roll and pitch. It can be used as a reference point to render real-world objects in the correct location. + OVR_UNUSED_STRUCT_PAD(pad0, 4) ///< \internal struct pad. +} ovrTrackerPose; + + +/// Tracking state at a given absolute time (describes predicted HMD pose, etc.). +/// Returned by ovr_GetTrackingState. +/// +/// \see ovr_GetTrackingState +/// +typedef struct OVR_ALIGNAS(8) ovrTrackingState_ +{ + /// Predicted head pose (and derivatives) at the requested absolute time. + ovrPoseStatef HeadPose; + + /// HeadPose tracking status described by ovrStatusBits. + unsigned int StatusFlags; + + /// The most recent calculated pose for each hand when hand controller tracking is present. + /// HandPoses[ovrHand_Left] refers to the left hand and HandPoses[ovrHand_Right] to the right hand. + /// These values can be combined with ovrInputState for complete hand controller information. + ovrPoseStatef HandPoses[2]; + + /// HandPoses status flags described by ovrStatusBits. + /// Only ovrStatus_OrientationTracked and ovrStatus_PositionTracked are reported. + unsigned int HandStatusFlags[2]; + + /// The pose of the origin captured during calibration. + /// Like all other poses here, this is expressed in the space set by ovr_RecenterTrackingOrigin, + /// and so will change every time that is called. This pose can be used to calculate + /// where the calibrated origin lands in the new recentered space. + /// If an application never calls ovr_RecenterTrackingOrigin, expect this value to be the identity + /// pose and as such will point respective origin based on ovrTrackingOrigin requested when + /// calling ovr_GetTrackingState. + ovrPosef CalibratedOrigin; + +} ovrTrackingState; + + +/// Rendering information for each eye. Computed by ovr_GetRenderDesc() based on the +/// specified FOV. Note that the rendering viewport is not included +/// here as it can be specified separately and modified per frame by +/// passing different Viewport values in the layer structure. +/// +/// \see ovr_GetRenderDesc +/// +typedef struct OVR_ALIGNAS(4) ovrEyeRenderDesc_ +{ + ovrEyeType Eye; ///< The eye index to which this instance corresponds. + ovrFovPort Fov; ///< The field of view. + ovrRecti DistortedViewport; ///< Distortion viewport. + ovrVector2f PixelsPerTanAngleAtCenter; ///< How many display pixels will fit in tan(angle) = 1. + ovrVector3f HmdToEyeOffset; ///< Translation of each eye, in meters. +} ovrEyeRenderDesc; + + +/// Projection information for ovrLayerEyeFovDepth. +/// +/// Use the utility function ovrTimewarpProjectionDesc_FromProjection to +/// generate this structure from the application's projection matrix. +/// +/// \see ovrLayerEyeFovDepth, ovrTimewarpProjectionDesc_FromProjection +/// +typedef struct OVR_ALIGNAS(4) ovrTimewarpProjectionDesc_ +{ + float Projection22; ///< Projection matrix element [2][2]. + float Projection23; ///< Projection matrix element [2][3]. + float Projection32; ///< Projection matrix element [3][2]. +} ovrTimewarpProjectionDesc; + + +/// Contains the data necessary to properly calculate position info for various layer types. +/// - HmdToEyeOffset is the same value pair provided in ovrEyeRenderDesc. +/// - HmdSpaceToWorldScaleInMeters is used to scale player motion into in-application units. +/// In other words, it is how big an in-application unit is in the player's physical meters. +/// For example, if the application uses inches as its units then HmdSpaceToWorldScaleInMeters would be 0.0254. +/// Note that if you are scaling the player in size, this must also scale. So if your application +/// units are inches, but you're shrinking the player to half their normal size, then +/// HmdSpaceToWorldScaleInMeters would be 0.0254*2.0. +/// +/// \see ovrEyeRenderDesc, ovr_SubmitFrame +/// +typedef struct OVR_ALIGNAS(4) ovrViewScaleDesc_ +{ + ovrVector3f HmdToEyeOffset[ovrEye_Count]; ///< Translation of each eye. + float HmdSpaceToWorldScaleInMeters; ///< Ratio of viewer units to meter units. +} ovrViewScaleDesc; + + +//----------------------------------------------------------------------------------- +// ***** Platform-independent Rendering Configuration + +/// The type of texture resource. +/// +/// \see ovrTextureSwapChainDesc +/// +typedef enum ovrTextureType_ +{ + ovrTexture_2D, ///< 2D textures. + ovrTexture_2D_External, ///< External 2D texture. Not used on PC + ovrTexture_Cube, ///< Cube maps. Not currently supported on PC. + ovrTexture_Count, + ovrTexture_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTextureType; + +/// The bindings required for texture swap chain. +/// +/// All texture swap chains are automatically bindable as shader +/// input resources since the Oculus runtime needs this to read them. +/// +/// \see ovrTextureSwapChainDesc +/// +typedef enum ovrTextureBindFlags_ +{ + ovrTextureBind_None, + ovrTextureBind_DX_RenderTarget = 0x0001, ///< The application can write into the chain with pixel shader + ovrTextureBind_DX_UnorderedAccess = 0x0002, ///< The application can write to the chain with compute shader + ovrTextureBind_DX_DepthStencil = 0x0004, ///< The chain buffers can be bound as depth and/or stencil buffers + + ovrTextureBind_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTextureBindFlags; + +/// The format of a texture. +/// +/// \see ovrTextureSwapChainDesc +/// +typedef enum ovrTextureFormat_ +{ + OVR_FORMAT_UNKNOWN, + OVR_FORMAT_B5G6R5_UNORM, ///< Not currently supported on PC. Would require a DirectX 11.1 device. + OVR_FORMAT_B5G5R5A1_UNORM, ///< Not currently supported on PC. Would require a DirectX 11.1 device. + OVR_FORMAT_B4G4R4A4_UNORM, ///< Not currently supported on PC. Would require a DirectX 11.1 device. + OVR_FORMAT_R8G8B8A8_UNORM, + OVR_FORMAT_R8G8B8A8_UNORM_SRGB, + OVR_FORMAT_B8G8R8A8_UNORM, + OVR_FORMAT_B8G8R8A8_UNORM_SRGB, ///< Not supported for OpenGL applications + OVR_FORMAT_B8G8R8X8_UNORM, ///< Not supported for OpenGL applications + OVR_FORMAT_B8G8R8X8_UNORM_SRGB, ///< Not supported for OpenGL applications + OVR_FORMAT_R16G16B16A16_FLOAT, + OVR_FORMAT_D16_UNORM, + OVR_FORMAT_D24_UNORM_S8_UINT, + OVR_FORMAT_D32_FLOAT, + OVR_FORMAT_D32_FLOAT_S8X24_UINT, + + OVR_FORMAT_ENUMSIZE = 0x7fffffff ///< \internal Force type int32_t. +} ovrTextureFormat; + +/// Misc flags overriding particular +/// behaviors of a texture swap chain +/// +/// \see ovrTextureSwapChainDesc +/// +typedef enum ovrTextureMiscFlags_ +{ + ovrTextureMisc_None, + + /// DX only: The underlying texture is created with a TYPELESS equivalent of the + /// format specified in the texture desc. The SDK will still access the + /// texture using the format specified in the texture desc, but the app can + /// create views with different formats if this is specified. + ovrTextureMisc_DX_Typeless = 0x0001, + + /// DX only: Allow generation of the mip chain on the GPU via the GenerateMips + /// call. This flag requires that RenderTarget binding also be specified. + ovrTextureMisc_AllowGenerateMips = 0x0002, + + /// Texture swap chain contains protected content, and requires + /// HDCP connection in order to display to HMD. Also prevents + /// mirroring or other redirection of any frame containing this contents + ovrTextureMisc_ProtectedContent = 0x0004, + + ovrTextureMisc_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTextureFlags; + +/// Description used to create a texture swap chain. +/// +/// \see ovr_CreateTextureSwapChainDX +/// \see ovr_CreateTextureSwapChainGL +/// +typedef struct ovrTextureSwapChainDesc_ +{ + ovrTextureType Type; + ovrTextureFormat Format; + int ArraySize; ///< Only supported with ovrTexture_2D. Not supported on PC at this time. + int Width; + int Height; + int MipLevels; + int SampleCount; ///< Current only supported on depth textures + ovrBool StaticImage; ///< Not buffered in a chain. For images that don't change + unsigned int MiscFlags; ///< ovrTextureFlags + unsigned int BindFlags; ///< ovrTextureBindFlags. Not used for GL. +} ovrTextureSwapChainDesc; + +/// Description used to create a mirror texture. +/// +/// \see ovr_CreateMirrorTextureDX +/// \see ovr_CreateMirrorTextureGL +/// +typedef struct ovrMirrorTextureDesc_ +{ + ovrTextureFormat Format; + int Width; + int Height; + unsigned int MiscFlags; ///< ovrTextureFlags +} ovrMirrorTextureDesc; + +typedef struct ovrTextureSwapChainData* ovrTextureSwapChain; +typedef struct ovrMirrorTextureData* ovrMirrorTexture; + +//----------------------------------------------------------------------------------- + +/// Describes button input types. +/// Button inputs are combined; that is they will be reported as pressed if they are +/// pressed on either one of the two devices. +/// The ovrButton_Up/Down/Left/Right map to both XBox D-Pad and directional buttons. +/// The ovrButton_Enter and ovrButton_Return map to Start and Back controller buttons, respectively. +typedef enum ovrButton_ +{ + ovrButton_A = 0x00000001, + ovrButton_B = 0x00000002, + ovrButton_RThumb = 0x00000004, + ovrButton_RShoulder = 0x00000008, + + // Bit mask of all buttons on the right Touch controller + ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, + + ovrButton_X = 0x00000100, + ovrButton_Y = 0x00000200, + ovrButton_LThumb = 0x00000400, + ovrButton_LShoulder = 0x00000800, + + // Bit mask of all buttons on the left Touch controller + ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder, + + // Navigation through DPad. + ovrButton_Up = 0x00010000, + ovrButton_Down = 0x00020000, + ovrButton_Left = 0x00040000, + ovrButton_Right = 0x00080000, + ovrButton_Enter = 0x00100000, // Start on XBox controller. + ovrButton_Back = 0x00200000, // Back on Xbox controller. + ovrButton_VolUp = 0x00400000, // only supported by Remote. + ovrButton_VolDown = 0x00800000, // only supported by Remote. + ovrButton_Home = 0x01000000, + ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, + + + ovrButton_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrButton; + +/// Describes touch input types. +/// These values map to capacitive touch values reported ovrInputState::Touch. +/// Some of these values are mapped to button bits for consistency. +typedef enum ovrTouch_ +{ + ovrTouch_A = ovrButton_A, + ovrTouch_B = ovrButton_B, + ovrTouch_RThumb = ovrButton_RThumb, + ovrTouch_RIndexTrigger = 0x00000010, + + // Bit mask of all the button touches on the right controller + ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RIndexTrigger, + + ovrTouch_X = ovrButton_X, + ovrTouch_Y = ovrButton_Y, + ovrTouch_LThumb = ovrButton_LThumb, + ovrTouch_LIndexTrigger = 0x00001000, + + // Bit mask of all the button touches on the left controller + ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LIndexTrigger, + + // Finger pose state + // Derived internally based on distance, proximity to sensors and filtering. + ovrTouch_RIndexPointing = 0x00000020, + ovrTouch_RThumbUp = 0x00000040, + + // Bit mask of all right controller poses + ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp, + + ovrTouch_LIndexPointing = 0x00002000, + ovrTouch_LThumbUp = 0x00004000, + + // Bit mask of all left controller poses + ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp, + + ovrTouch_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrTouch; + +/// Specifies which controller is connected; multiple can be connected at once. +typedef enum ovrControllerType_ +{ + ovrControllerType_None = 0x00, + ovrControllerType_LTouch = 0x01, + ovrControllerType_RTouch = 0x02, + ovrControllerType_Touch = 0x03, + ovrControllerType_Remote = 0x04, + ovrControllerType_XBox = 0x10, + + ovrControllerType_Active = 0xff, ///< Operate on or query whichever controller is active. + + ovrControllerType_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrControllerType; + + +/// Provides names for the left and right hand array indexes. +/// +/// \see ovrInputState, ovrTrackingState +/// +typedef enum ovrHandType_ +{ + ovrHand_Left = 0, + ovrHand_Right = 1, + ovrHand_Count = 2, + ovrHand_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrHandType; + + + +/// ovrInputState describes the complete controller input state, including Oculus Touch, +/// and XBox gamepad. If multiple inputs are connected and used at the same time, +/// their inputs are combined. +typedef struct ovrInputState_ +{ + // System type when the controller state was last updated. + double TimeInSeconds; + + // Values for buttons described by ovrButton. + unsigned int Buttons; + + // Touch values for buttons and sensors as described by ovrTouch. + unsigned int Touches; + + // Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + float IndexTrigger[ovrHand_Count]; + + // Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + float HandTrigger[ovrHand_Count]; + + // Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range -1.0f to 1.0f. + ovrVector2f Thumbstick[ovrHand_Count]; + + // The type of the controller this state is for. + ovrControllerType ControllerType; + +} ovrInputState; + + + +//----------------------------------------------------------------------------------- +// ***** Initialize structures + +/// Initialization flags. +/// +/// \see ovrInitParams, ovr_Initialize +/// +typedef enum ovrInitFlags_ +{ + /// When a debug library is requested, a slower debugging version of the library will + /// run which can be used to help solve problems in the library and debug application code. + ovrInit_Debug = 0x00000001, + + /// When a version is requested, the LibOVR runtime respects the RequestedMinorVersion + /// field and verifies that the RequestedMinorVersion is supported. + ovrInit_RequestVersion = 0x00000004, + + // These bits are writable by user code. + ovrinit_WritableBits = 0x00ffffff, + + ovrInit_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrInitFlags; + + +/// Logging levels +/// +/// \see ovrInitParams, ovrLogCallback +/// +typedef enum ovrLogLevel_ +{ + ovrLogLevel_Debug = 0, ///< Debug-level log event. + ovrLogLevel_Info = 1, ///< Info-level log event. + ovrLogLevel_Error = 2, ///< Error-level log event. + + ovrLogLevel_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrLogLevel; + + +/// Signature of the logging callback function pointer type. +/// +/// \param[in] userData is an arbitrary value specified by the user of ovrInitParams. +/// \param[in] level is one of the ovrLogLevel constants. +/// \param[in] message is a UTF8-encoded null-terminated string. +/// \see ovrInitParams, ovrLogLevel, ovr_Initialize +/// +typedef void (OVR_CDECL* ovrLogCallback)(uintptr_t userData, int level, const char* message); + + +/// Parameters for ovr_Initialize. +/// +/// \see ovr_Initialize +/// +typedef struct OVR_ALIGNAS(8) ovrInitParams_ +{ + /// Flags from ovrInitFlags to override default behavior. + /// Use 0 for the defaults. + uint32_t Flags; + + /// Requests a specific minimum minor version of the LibOVR runtime. + /// Flags must include ovrInit_RequestVersion or this will be ignored + /// and OVR_MINOR_VERSION will be used. + uint32_t RequestedMinorVersion; + + /// User-supplied log callback function, which may be called at any time + /// asynchronously from multiple threads until ovr_Shutdown completes. + /// Use NULL to specify no log callback. + ovrLogCallback LogCallback; + + /// User-supplied data which is passed as-is to LogCallback. Typically this + /// is used to store an application-specific pointer which is read in the + /// callback function. + uintptr_t UserData; + + /// Relative number of milliseconds to wait for a connection to the server + /// before failing. Use 0 for the default timeout. + uint32_t ConnectionTimeoutMS; + + OVR_ON64(OVR_UNUSED_STRUCT_PAD(pad0, 4)) ///< \internal + +} ovrInitParams; + + +#ifdef __cplusplus +extern "C" { +#endif + + +// ----------------------------------------------------------------------------------- +// ***** API Interfaces + +// Overview of the API +// +// Setup: +// - ovr_Initialize(). +// - ovr_Create(&hmd, &graphicsId). +// - Use hmd members and ovr_GetFovTextureSize() to determine graphics configuration +// and ovr_GetRenderDesc() to get per-eye rendering parameters. +// - Allocate texture swap chains with ovr_CreateTextureSwapChainDX() or +// ovr_CreateTextureSwapChainGL(). Create any associated render target views or +// frame buffer objects. +// +// Application Loop: +// - Call ovr_GetPredictedDisplayTime() to get the current frame timing information. +// - Call ovr_GetTrackingState() and ovr_CalcEyePoses() to obtain the predicted +// rendering pose for each eye based on timing. +// - Render the scene content into the current buffer of the texture swapchains +// for each eye and layer you plan to update this frame. If you render into a +// texture swap chain, you must call ovr_CommitTextureSwapChain() on it to commit +// the changes before you reference the chain this frame (otherwise, your latest +// changes won't be picked up). +// - Call ovr_SubmitFrame() to render the distorted layers to and present them on the HMD. +// If ovr_SubmitFrame returns ovrSuccess_NotVisible, there is no need to render the scene +// for the next loop iteration. Instead, just call ovr_SubmitFrame again until it returns +// ovrSuccess. +// +// Shutdown: +// - ovr_Destroy(). +// - ovr_Shutdown(). + + +/// Initializes LibOVR +/// +/// Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT +/// shared library. No LibOVR API functions, other than ovr_GetLastErrorInfo and ovr_Detect, can +/// be called unless ovr_Initialize succeeds. A successful call to ovr_Initialize must be eventually +/// followed by a call to ovr_Shutdown. ovr_Initialize calls are idempotent. +/// Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown. +/// If already initialized, the return value is ovr_Success. +/// +/// LibOVRRT shared library search order: +/// -# Current working directory (often the same as the application directory). +/// -# Module directory (usually the same as the application directory, +/// but not if the module is a separate shared library). +/// -# Application directory +/// -# Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, +/// which is off by default). +/// -# Standard OS shared library search location(s) (OS-specific). +/// +/// \param params Specifies custom initialization options. May be NULL to indicate default options. +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. Example failed results include: +/// - ovrError_Initialize: Generic initialization error. +/// - ovrError_LibLoad: Couldn't load LibOVRRT. +/// - ovrError_LibVersion: LibOVRRT version incompatibility. +/// - ovrError_ServiceConnection: Couldn't connect to the OVR Service. +/// - ovrError_ServiceVersion: OVR Service version incompatibility. +/// - ovrError_IncompatibleOS: The operating system version is incompatible. +/// - ovrError_DisplayInit: Unable to initialize the HMD display. +/// - ovrError_ServerStart: Unable to start the server. Is it already running? +/// - ovrError_Reinitialization: Attempted to re-initialize with a different version. +/// +/// Example code +/// \code{.cpp} +/// ovrResult result = ovr_Initialize(NULL); +/// if(OVR_FAILURE(result)) { +/// ovrErrorInfo errorInfo; +/// ovr_GetLastErrorInfo(&errorInfo); +/// DebugLog("ovr_Initialize failed: %s", errorInfo.ErrorString); +/// return false; +/// } +/// [...] +/// \endcode +/// +/// \see ovr_Shutdown +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_Initialize(const ovrInitParams* params); + + +/// Shuts down LibOVR +/// +/// A successful call to ovr_Initialize must be eventually matched by a call to ovr_Shutdown. +/// After calling ovr_Shutdown, no LibOVR functions can be called except ovr_GetLastErrorInfo +/// or another ovr_Initialize. ovr_Shutdown invalidates all pointers, references, and created objects +/// previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded by +/// ovr_Shutdown. +/// +/// \see ovr_Initialize +/// +OVR_PUBLIC_FUNCTION(void) ovr_Shutdown(); + +/// Returns information about the most recent failed return value by the +/// current thread for this library. +/// +/// This function itself can never generate an error. +/// The last error is never cleared by LibOVR, but will be overwritten by new errors. +/// Do not use this call to determine if there was an error in the last API +/// call as successful API calls don't clear the last ovrErrorInfo. +/// To avoid any inconsistency, ovr_GetLastErrorInfo should be called immediately +/// after an API function that returned a failed ovrResult, with no other API +/// functions called in the interim. +/// +/// \param[out] errorInfo The last ovrErrorInfo for the current thread. +/// +/// \see ovrErrorInfo +/// +OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo); + + +/// Returns the version string representing the LibOVRRT version. +/// +/// The returned string pointer is valid until the next call to ovr_Shutdown. +/// +/// Note that the returned version string doesn't necessarily match the current +/// OVR_MAJOR_VERSION, etc., as the returned string refers to the LibOVRRT shared +/// library version and not the locally compiled interface version. +/// +/// The format of this string is subject to change in future versions and its contents +/// should not be interpreted. +/// +/// \return Returns a UTF8-encoded null-terminated version string. +/// +OVR_PUBLIC_FUNCTION(const char*) ovr_GetVersionString(); + + +/// Writes a message string to the LibOVR tracing mechanism (if enabled). +/// +/// This message will be passed back to the application via the ovrLogCallback if +/// it was registered. +/// +/// \param[in] level One of the ovrLogLevel constants. +/// \param[in] message A UTF8-encoded null-terminated string. +/// \return returns the strlen of the message or a negative value if the message is too large. +/// +/// \see ovrLogLevel, ovrLogCallback +/// +OVR_PUBLIC_FUNCTION(int) ovr_TraceMessage(int level, const char* message); + + +//------------------------------------------------------------------------------------- +/// @name HMD Management +/// +/// Handles the enumeration, creation, destruction, and properties of an HMD (head-mounted display). +///@{ + + +/// Returns information about the current HMD. +/// +/// ovr_Initialize must have first been called in order for this to succeed, otherwise ovrHmdDesc::Type +/// will be reported as ovrHmd_None. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create, else NULL in which +/// case this function detects whether an HMD is present and returns its info if so. +/// +/// \return Returns an ovrHmdDesc. If the hmd is NULL and ovrHmdDesc::Type is ovrHmd_None then +/// no HMD is present. +/// +OVR_PUBLIC_FUNCTION(ovrHmdDesc) ovr_GetHmdDesc(ovrSession session); + + +/// Returns the number of sensors. +/// +/// The number of sensors may change at any time, so this function should be called before use +/// as opposed to once on startup. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// +/// \return Returns unsigned int count. +/// +OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetTrackerCount(ovrSession session); + + +/// Returns a given sensor description. +/// +/// It's possible that sensor desc [0] may indicate a unconnnected or non-pose tracked sensor, but +/// sensor desc [1] may be connected. +/// +/// ovr_Initialize must have first been called in order for this to succeed, otherwise the returned +/// trackerDescArray will be zero-initialized. The data returned by this function can change at runtime. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// +/// \param[in] trackerDescIndex Specifies a sensor index. The valid indexes are in the range of 0 to +/// the sensor count returned by ovr_GetTrackerCount. +/// +/// \return Returns ovrTrackerDesc. An empty ovrTrackerDesc will be returned if trackerDescIndex is out of range. +/// +/// \see ovrTrackerDesc, ovr_GetTrackerCount +/// +OVR_PUBLIC_FUNCTION(ovrTrackerDesc) ovr_GetTrackerDesc(ovrSession session, unsigned int trackerDescIndex); + + +/// Creates a handle to a VR session. +/// +/// Upon success the returned ovrSession must be eventually freed with ovr_Destroy when it is no longer needed. +/// A second call to ovr_Create will result in an error return value if the previous Hmd has not been destroyed. +/// +/// \param[out] pSession Provides a pointer to an ovrSession which will be written to upon success. +/// \param[out] luid Provides a system specific graphics adapter identifier that locates which +/// graphics adapter has the HMD attached. This must match the adapter used by the application +/// or no rendering output will be possible. This is important for stability on multi-adapter systems. An +/// application that simply chooses the default adapter will not run reliably on multi-adapter systems. +/// \return Returns an ovrResult indicating success or failure. Upon failure +/// the returned pHmd will be NULL. +/// +/// Example code +/// \code{.cpp} +/// ovrSession session; +/// ovrGraphicsLuid luid; +/// ovrResult result = ovr_Create(&session, &luid); +/// if(OVR_FAILURE(result)) +/// ... +/// \endcode +/// +/// \see ovr_Destroy +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid); + + +/// Destroys the HMD. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \see ovr_Create +/// +OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session); + + +/// Specifies status information for the current session. +/// +/// \see ovr_GetSessionStatus +/// +typedef struct ovrSessionStatus_ +{ + ovrBool IsVisible; ///< True if the process has VR focus and thus is visible in the HMD. + ovrBool HmdPresent; ///< True if an HMD is present. + ovrBool HmdMounted; ///< True if the HMD is on the user's head. + ovrBool DisplayLost; ///< True if the session is in a display-lost state. See ovr_SubmitFrame. + ovrBool ShouldQuit; ///< True if the application should initiate shutdown. + ovrBool ShouldRecenter; ///< True if UX has requested re-centering. Must call ovr_ClearShouldRecenterFlag or ovr_RecenterTrackingOrigin. +}ovrSessionStatus; + + +/// Returns status information for the application. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[out] sessionStatus Provides an ovrSessionStatus that is filled in. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of +/// failure, use ovr_GetLastErrorInfo to get more information. +// Return values include but aren't limited to: +/// - ovrSuccess: Completed successfully. +/// - ovrError_ServiceConnection: The service connection was lost and the application +// must destroy the session. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus); + + +//@} + + + +//------------------------------------------------------------------------------------- +/// @name Tracking +/// +/// Tracking functions handle the position, orientation, and movement of the HMD in space. +/// +/// All tracking interface functions are thread-safe, allowing tracking state to be sampled +/// from different threads. +/// +///@{ + + + +/// Sets the tracking origin type +/// +/// When the tracking origin is changed, all of the calls that either provide +/// or accept ovrPosef will use the new tracking origin provided. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] origin Specifies an ovrTrackingOrigin to be used for all ovrPosef +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// \see ovrTrackingOrigin, ovr_GetTrackingOriginType +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetTrackingOriginType(ovrSession session, ovrTrackingOrigin origin); + + +/// Gets the tracking origin state +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// +/// \return Returns the ovrTrackingOrigin that was either set by default, or previous set by the application. +/// +/// \see ovrTrackingOrigin, ovr_SetTrackingOriginType +OVR_PUBLIC_FUNCTION(ovrTrackingOrigin) ovr_GetTrackingOriginType(ovrSession session); + + +/// Re-centers the sensor position and orientation. +/// +/// This resets the (x,y,z) positional components and the yaw orientation component. +/// The Roll and pitch orientation components are always determined by gravity and cannot +/// be redefined. All future tracking will report values relative to this new reference position. +/// If you are using ovrTrackerPoses then you will need to call ovr_GetTrackerPose after +/// this, because the sensor position(s) will change as a result of this. +/// +/// The headset cannot be facing vertically upward or downward but rather must be roughly +/// level otherwise this function will fail with ovrError_InvalidHeadsetOrientation. +/// +/// For more info, see the notes on each ovrTrackingOrigin enumeration to understand how +/// recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. Return values include but aren't limited to: +/// - ovrSuccess: Completed successfully. +/// - ovrError_InvalidHeadsetOrientation: The headset was facing an invalid direction when +/// attempting recentering, such as facing vertically. +/// +/// \see ovrTrackingOrigin, ovr_GetTrackerPose +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_RecenterTrackingOrigin(ovrSession session); + + +/// Clears the ShouldRecenter status bit in ovrSessionStatus. +/// +/// Clears the ShouldRecenter status bit in ovrSessionStatus, allowing further recenter +/// requests to be detected. Since this is automatically done by ovr_RecenterTrackingOrigin, +/// this is only needs to be called when application is doing its own re-centering. +OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session); + + +/// Returns tracking state reading based on the specified absolute system time. +/// +/// Pass an absTime value of 0.0 to request the most recent sensor reading. In this case +/// both PredictedPose and SamplePose will have the same value. +/// +/// This may also be used for more refined timing of front buffer rendering logic, and so on. +/// This may be called by multiple threads. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] absTime Specifies the absolute future time to predict the return +/// ovrTrackingState value. Use 0 to request the most recent tracking state. +/// \param[in] latencyMarker Specifies that this call is the point in time where +/// the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer +/// provides "SensorSampleTimestamp", that will override the value stored here. +/// \return Returns the ovrTrackingState that is predicted for the given absTime. +/// +/// \see ovrTrackingState, ovr_GetEyePoses, ovr_GetTimeInSeconds +/// +OVR_PUBLIC_FUNCTION(ovrTrackingState) ovr_GetTrackingState(ovrSession session, double absTime, ovrBool latencyMarker); + + + +/// Returns the ovrTrackerPose for the given sensor. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] trackerPoseIndex Index of the sensor being requested. +/// +/// \return Returns the requested ovrTrackerPose. An empty ovrTrackerPose will be returned if trackerPoseIndex is out of range. +/// +/// \see ovr_GetTrackerCount +/// +OVR_PUBLIC_FUNCTION(ovrTrackerPose) ovr_GetTrackerPose(ovrSession session, unsigned int trackerPoseIndex); + + + +/// Returns the most recent input state for controllers, without positional tracking info. +/// +/// \param[out] inputState Input state that will be filled in. +/// \param[in] ovrControllerType Specifies which controller the input will be returned for. +/// \return Returns ovrSuccess if the new state was successfully obtained. +/// +/// \see ovrControllerType +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetInputState(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState); + + +/// Returns controller types connected to the system OR'ed together. +/// +/// \return A bitmask of ovrControllerTypes connected to the system. +/// +/// \see ovrControllerType +/// +OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession session); + + +/// Turns on vibration of the given controller. +/// +/// To disable vibration, call ovr_SetControllerVibration with an amplitude of 0. +/// Vibration automatically stops after a nominal amount of time, so if you want vibration +/// to be continuous over multiple seconds then you need to call this function periodically. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] controllerType Specifies the controller to apply the vibration to. +/// \param[in] frequency Specifies a vibration frequency in the range of 0.0 to 1.0. +/// Currently the only valid values are 0.0, 0.5, and 1.0 and other values will +/// be clamped to one of these. +/// \param[in] amplitude Specifies a vibration amplitude in the range of 0.0 to 1.0. +/// +/// \return Returns ovrSuccess upon success. +/// +/// \see ovrControllerType +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, + float frequency, float amplitude); + +///@} + + +//------------------------------------------------------------------------------------- +// @name Layers +// +///@{ + + +/// Specifies the maximum number of layers supported by ovr_SubmitFrame. +/// +/// /see ovr_SubmitFrame +/// +enum { + ovrMaxLayerCount = 16 +}; + +/// Describes layer types that can be passed to ovr_SubmitFrame. +/// Each layer type has an associated struct, such as ovrLayerEyeFov. +/// +/// \see ovrLayerHeader +/// +typedef enum ovrLayerType_ +{ + ovrLayerType_Disabled = 0, ///< Layer is disabled. + ovrLayerType_EyeFov = 1, ///< Described by ovrLayerEyeFov. + ovrLayerType_Quad = 3, ///< Described by ovrLayerQuad. Previously called ovrLayerType_QuadInWorld. + /// enum 4 used to be ovrLayerType_QuadHeadLocked. Instead, use ovrLayerType_Quad with ovrLayerFlag_HeadLocked. + ovrLayerType_EyeMatrix = 5, ///< Described by ovrLayerEyeMatrix. + ovrLayerType_EnumSize = 0x7fffffff ///< Force type int32_t. +} ovrLayerType; + + +/// Identifies flags used by ovrLayerHeader and which are passed to ovr_SubmitFrame. +/// +/// \see ovrLayerHeader +/// +typedef enum ovrLayerFlags_ +{ + /// ovrLayerFlag_HighQuality enables 4x anisotropic sampling during the composition of the layer. + /// The benefits are mostly visible at the periphery for high-frequency & high-contrast visuals. + /// For best results consider combining this flag with an ovrTextureSwapChain that has mipmaps and + /// instead of using arbitrary sized textures, prefer texture sizes that are powers-of-two. + /// Actual rendered viewport and doesn't necessarily have to fill the whole texture. + ovrLayerFlag_HighQuality = 0x01, + + /// ovrLayerFlag_TextureOriginAtBottomLeft: the opposite is TopLeft. + /// Generally this is false for D3D, true for OpenGL. + ovrLayerFlag_TextureOriginAtBottomLeft = 0x02, + + /// Mark this surface as "headlocked", which means it is specified + /// relative to the HMD and moves with it, rather than being specified + /// relative to sensor/torso space and remaining still while the head moves. + /// What used to be ovrLayerType_QuadHeadLocked is now ovrLayerType_Quad plus this flag. + /// However the flag can be applied to any layer type to achieve a similar effect. + ovrLayerFlag_HeadLocked = 0x04 + +} ovrLayerFlags; + + +/// Defines properties shared by all ovrLayer structs, such as ovrLayerEyeFov. +/// +/// ovrLayerHeader is used as a base member in these larger structs. +/// This struct cannot be used by itself except for the case that Type is ovrLayerType_Disabled. +/// +/// \see ovrLayerType, ovrLayerFlags +/// +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerHeader_ +{ + ovrLayerType Type; ///< Described by ovrLayerType. + unsigned Flags; ///< Described by ovrLayerFlags. +} ovrLayerHeader; + + +/// Describes a layer that specifies a monoscopic or stereoscopic view. +/// This is the kind of layer that's typically used as layer 0 to ovr_SubmitFrame, +/// as it is the kind of layer used to render a 3D stereoscopic view. +/// +/// Three options exist with respect to mono/stereo texture usage: +/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings, respectively. +/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively. +/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL, +/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0]. +/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and +/// Viewport[1] both refer to that rendering. +/// +/// \see ovrTextureSwapChain, ovr_SubmitFrame +/// +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeFov_ +{ + /// Header.Type must be ovrLayerType_EyeFov. + ovrLayerHeader Header; + + /// ovrTextureSwapChains for the left and right eye respectively. + /// The second one of which can be NULL for cases described above. + ovrTextureSwapChain ColorTexture[ovrEye_Count]; + + /// Specifies the ColorTexture sub-rect UV coordinates. + /// Both Viewport[0] and Viewport[1] must be valid. + ovrRecti Viewport[ovrEye_Count]; + + /// The viewport field of view. + ovrFovPort Fov[ovrEye_Count]; + + /// Specifies the position and orientation of each eye view, with the position specified in meters. + /// RenderPose will typically be the value returned from ovr_CalcEyePoses, + /// but can be different in special cases if a different head pose is used for rendering. + ovrPosef RenderPose[ovrEye_Count]; + + /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose) + /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds + /// around the instant the application calls ovr_GetTrackingState + /// The main purpose for this is to accurately track app tracking latency. + double SensorSampleTime; + +} ovrLayerEyeFov; + + + + +/// Describes a layer that specifies a monoscopic or stereoscopic view. +/// This uses a direct 3x4 matrix to map from view space to the UV coordinates. +/// It is essentially the same thing as ovrLayerEyeFov but using a much +/// lower level. This is mainly to provide compatibility with specific apps. +/// Unless the application really requires this flexibility, it is usually better +/// to use ovrLayerEyeFov. +/// +/// Three options exist with respect to mono/stereo texture usage: +/// - ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings, respectively. +/// Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively. +/// - ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL, +/// and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0]. +/// - ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and +/// Viewport[1] both refer to that rendering. +/// +/// \see ovrTextureSwapChain, ovr_SubmitFrame +/// +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerEyeMatrix_ +{ + /// Header.Type must be ovrLayerType_EyeMatrix. + ovrLayerHeader Header; + + /// ovrTextureSwapChains for the left and right eye respectively. + /// The second one of which can be NULL for cases described above. + ovrTextureSwapChain ColorTexture[ovrEye_Count]; + + /// Specifies the ColorTexture sub-rect UV coordinates. + /// Both Viewport[0] and Viewport[1] must be valid. + ovrRecti Viewport[ovrEye_Count]; + + /// Specifies the position and orientation of each eye view, with the position specified in meters. + /// RenderPose will typically be the value returned from ovr_CalcEyePoses, + /// but can be different in special cases if a different head pose is used for rendering. + ovrPosef RenderPose[ovrEye_Count]; + + /// Specifies the mapping from a view-space vector + /// to a UV coordinate on the textures given above. + /// P = (x,y,z,1)*Matrix + /// TexU = P.x/P.z + /// TexV = P.y/P.z + ovrMatrix4f Matrix[ovrEye_Count]; + + /// Specifies the timestamp when the source ovrPosef (used in calculating RenderPose) + /// was sampled from the SDK. Typically retrieved by calling ovr_GetTimeInSeconds + /// around the instant the application calls ovr_GetTrackingState + /// The main purpose for this is to accurately track app tracking latency. + double SensorSampleTime; + +} ovrLayerEyeMatrix; + + + + + +/// Describes a layer of Quad type, which is a single quad in world or viewer space. +/// It is used for ovrLayerType_Quad. This type of layer represents a single +/// object placed in the world and not a stereo view of the world itself. +/// +/// A typical use of ovrLayerType_Quad is to draw a television screen in a room +/// that for some reason is more convenient to draw as a layer than as part of the main +/// view in layer 0. For example, it could implement a 3D popup GUI that is drawn at a +/// higher resolution than layer 0 to improve fidelity of the GUI. +/// +/// Quad layers are visible from both sides; they are not back-face culled. +/// +/// \see ovrTextureSwapChain, ovr_SubmitFrame +/// +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrLayerQuad_ +{ + /// Header.Type must be ovrLayerType_Quad. + ovrLayerHeader Header; + + /// Contains a single image, never with any stereo view. + ovrTextureSwapChain ColorTexture; + + /// Specifies the ColorTexture sub-rect UV coordinates. + ovrRecti Viewport; + + /// Specifies the orientation and position of the center point of a Quad layer type. + /// The supplied direction is the vector perpendicular to the quad. + /// The position is in real-world meters (not the application's virtual world, + /// the physical world the user is in) and is relative to the "zero" position + /// set by ovr_RecenterTrackingOrigin unless the ovrLayerFlag_HeadLocked flag is used. + ovrPosef QuadPoseCenter; + + /// Width and height (respectively) of the quad in meters. + ovrVector2f QuadSize; + +} ovrLayerQuad; + + + + +/// Union that combines ovrLayer types in a way that allows them +/// to be used in a polymorphic way. +typedef union ovrLayer_Union_ +{ + ovrLayerHeader Header; + ovrLayerEyeFov EyeFov; + ovrLayerQuad Quad; +} ovrLayer_Union; + + +//@} + + + +/// @name SDK Distortion Rendering +/// +/// All of rendering functions including the configure and frame functions +/// are not thread safe. It is OK to use ConfigureRendering on one thread and handle +/// frames on another thread, but explicit synchronization must be done since +/// functions that depend on configured state are not reentrant. +/// +/// These functions support rendering of distortion by the SDK. +/// +//@{ + +/// TextureSwapChain creation is rendering API-specific. +/// ovr_CreateTextureSwapChainDX and ovr_CreateTextureSwapChainGL can be found in the +/// rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h + +/// Gets the number of buffers in an ovrTextureSwapChain. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies the ovrTextureSwapChain for which the length should be retrieved. +/// \param[out] out_Length Returns the number of buffers in the specified chain. +/// +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// +/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainLength(ovrSession session, ovrTextureSwapChain chain, int* out_Length); + +/// Gets the current index in an ovrTextureSwapChain. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies the ovrTextureSwapChain for which the index should be retrieved. +/// \param[out] out_Index Returns the current (free) index in specified chain. +/// +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// +/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainCurrentIndex(ovrSession session, ovrTextureSwapChain chain, int* out_Index); + +/// Gets the description of the buffers in an ovrTextureSwapChain +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies the ovrTextureSwapChain for which the description should be retrieved. +/// \param[out] out_Desc Returns the description of the specified chain. +/// +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// +/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainDesc(ovrSession session, ovrTextureSwapChain chain, ovrTextureSwapChainDesc* out_Desc); + +/// Commits any pending changes to an ovrTextureSwapChain, and advances its current index +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies the ovrTextureSwapChain to commit. +/// +/// \note When Commit is called, the texture at the current index is considered ready for use by the +/// runtime, and further writes to it should be avoided. The swap chain's current index is advanced, +/// providing there's room in the chain. The next time the SDK dereferences this texture swap chain, +/// it will synchronize with the app's graphics context and pick up the submitted index, opening up +/// room in the swap chain for further commits. +/// +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// Failures include but aren't limited to: +/// - ovrError_TextureSwapChainFull: ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. +/// +/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_CommitTextureSwapChain(ovrSession session, ovrTextureSwapChain chain); + +/// Destroys an ovrTextureSwapChain and frees all the resources associated with it. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies the ovrTextureSwapChain to destroy. If it is NULL then this function has no effect. +/// +/// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL +/// +OVR_PUBLIC_FUNCTION(void) ovr_DestroyTextureSwapChain(ovrSession session, ovrTextureSwapChain chain); + + +/// MirrorTexture creation is rendering API-specific. +/// ovr_CreateMirrorTextureDX and ovr_CreateMirrorTextureGL can be found in the +/// rendering API-specific headers, such as OVR_CAPI_D3D.h and OVR_CAPI_GL.h + +/// Destroys a mirror texture previously created by one of the mirror texture creation functions. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] mirrorTexture Specifies the ovrTexture to destroy. If it is NULL then this function has no effect. +/// +/// \see ovr_CreateMirrorTextureDX, ovr_CreateMirrorTextureGL +/// +OVR_PUBLIC_FUNCTION(void) ovr_DestroyMirrorTexture(ovrSession session, ovrMirrorTexture mirrorTexture); + + +/// Calculates the recommended viewport size for rendering a given eye within the HMD +/// with a given FOV cone. +/// +/// Higher FOV will generally require larger textures to maintain quality. +/// Apps packing multiple eye views together on the same texture should ensure there are +/// at least 8 pixels of padding between them to prevent texture filtering and chromatic +/// aberration causing images to leak between the two eye views. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] eye Specifies which eye (left or right) to calculate for. +/// \param[in] fov Specifies the ovrFovPort to use. +/// \param[in] pixelsPerDisplayPixel Specifies the ratio of the number of render target pixels +/// to display pixels at the center of distortion. 1.0 is the default value. Lower +/// values can improve performance, higher values give improved quality. +/// +/// Example code +/// \code{.cpp} +/// ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session); +/// ovrSizei eyeSizeLeft = ovr_GetFovTextureSize(session, ovrEye_Left, hmdDesc.DefaultEyeFov[ovrEye_Left], 1.0f); +/// ovrSizei eyeSizeRight = ovr_GetFovTextureSize(session, ovrEye_Right, hmdDesc.DefaultEyeFov[ovrEye_Right], 1.0f); +/// \endcode +/// +/// \return Returns the texture width and height size. +/// +OVR_PUBLIC_FUNCTION(ovrSizei) ovr_GetFovTextureSize(ovrSession session, ovrEyeType eye, ovrFovPort fov, + float pixelsPerDisplayPixel); + +/// Computes the distortion viewport, view adjust, and other rendering parameters for +/// the specified eye. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] eyeType Specifies which eye (left or right) for which to perform calculations. +/// \param[in] fov Specifies the ovrFovPort to use. +/// +/// \return Returns the computed ovrEyeRenderDesc for the given eyeType and field of view. +/// +/// \see ovrEyeRenderDesc +/// +OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc) ovr_GetRenderDesc(ovrSession session, + ovrEyeType eyeType, ovrFovPort fov); + +/// Submits layers for distortion and display. +/// +/// ovr_SubmitFrame triggers distortion and processing which might happen asynchronously. +/// The function will return when there is room in the submission queue and surfaces +/// are available. Distortion might or might not have completed. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// +/// \param[in] frameIndex Specifies the targeted application frame index, or 0 to refer to one frame +/// after the last time ovr_SubmitFrame was called. +/// +/// \param[in] viewScaleDesc Provides additional information needed only if layerPtrList contains +/// an ovrLayerType_Quad. If NULL, a default version is used based on the current configuration and a 1.0 world scale. +/// +/// \param[in] layerPtrList Specifies a list of ovrLayer pointers, which can include NULL entries to +/// indicate that any previously shown layer at that index is to not be displayed. +/// Each layer header must be a part of a layer structure such as ovrLayerEyeFov or ovrLayerQuad, +/// with Header.Type identifying its type. A NULL layerPtrList entry in the array indicates the +// absence of the given layer. +/// +/// \param[in] layerCount Indicates the number of valid elements in layerPtrList. The maximum +/// supported layerCount is not currently specified, but may be specified in a future version. +/// +/// - Layers are drawn in the order they are specified in the array, regardless of the layer type. +/// +/// - Layers are not remembered between successive calls to ovr_SubmitFrame. A layer must be +/// specified in every call to ovr_SubmitFrame or it won't be displayed. +/// +/// - If a layerPtrList entry that was specified in a previous call to ovr_SubmitFrame is +/// passed as NULL or is of type ovrLayerType_Disabled, that layer is no longer displayed. +/// +/// - A layerPtrList entry can be of any layer type and multiple entries of the same layer type +/// are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier entry). +/// +/// Example code +/// \code{.cpp} +/// ovrLayerEyeFov layer0; +/// ovrLayerQuad layer1; +/// ... +/// ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header }; +/// ovrResult result = ovr_SubmitFrame(hmd, frameIndex, nullptr, layers, 2); +/// \endcode +/// +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true +/// upon success. Return values include but aren't limited to: +/// - ovrSuccess: rendering completed successfully. +/// - ovrSuccess_NotVisible: rendering completed successfully but was not displayed on the HMD, +/// usually because another application currently has ownership of the HMD. Applications receiving +/// this result should stop rendering new content, but continue to call ovr_SubmitFrame periodically +/// until it returns a value other than ovrSuccess_NotVisible. +/// - ovrError_DisplayLost: The session has become invalid (such as due to a device removal) +/// and the shared resources need to be released (ovr_DestroyTextureSwapChain), the session needs to +/// destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be created +/// (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not +/// need to be recreated unless the new ovr_Create call returns a different GraphicsLuid. +/// - ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. +/// Ensure ovr_CommitTextureSwapChain was called at least once first. +/// +/// \see ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitFrame(ovrSession session, long long frameIndex, + const ovrViewScaleDesc* viewScaleDesc, + ovrLayerHeader const * const * layerPtrList, unsigned int layerCount); +///@} + + + +//------------------------------------------------------------------------------------- +/// @name Frame Timing +/// +//@{ + + +/// Gets the time of the specified frame midpoint. +/// +/// Predicts the time at which the given frame will be displayed. The predicted time +/// is the middle of the time period during which the corresponding eye images will +/// be displayed. +/// +/// The application should increment frameIndex for each successively targeted frame, +/// and pass that index to any relevent OVR functions that need to apply to the frame +/// identified by that index. +/// +/// This function is thread-safe and allows for multiple application threads to target +/// their processing to the same displayed frame. +/// +/// In the even that prediction fails due to various reasons (e.g. the display being off +/// or app has yet to present any frames), the return value will be current CPU time. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] frameIndex Identifies the frame the caller wishes to target. +/// A value of zero returns the next frame index. +/// \return Returns the absolute frame midpoint time for the given frameIndex. +/// \see ovr_GetTimeInSeconds +/// +OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, long long frameIndex); + + +/// Returns global, absolute high-resolution time in seconds. +/// +/// The time frame of reference for this function is not specified and should not be +/// depended upon. +/// +/// \return Returns seconds as a floating point value. +/// \see ovrPoseStatef, ovrFrameTiming +/// +OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds(); + + +/// Performance HUD enables the HMD user to see information critical to +/// the real-time operation of the VR application such as latency timing, +/// and CPU & GPU performance metrics +/// +/// App can toggle performance HUD modes as such: +/// \code{.cpp} +/// ovrPerfHudMode PerfHudMode = ovrPerfHud_LatencyTiming; +/// ovr_SetInt(Hmd, OVR_PERF_HUD_MODE, (int)PerfHudMode); +/// \endcode +/// +typedef enum ovrPerfHudMode_ +{ + ovrPerfHud_Off = 0, ///< Turns off the performance HUD + ovrPerfHud_PerfSummary = 1, ///< Shows performance summary and headroom + ovrPerfHud_LatencyTiming = 2, ///< Shows latency related timing info + ovrPerfHud_AppRenderTiming = 3, ///< Shows render timing info for application + ovrPerfHud_CompRenderTiming = 4, ///< Shows render timing info for OVR compositor + ovrPerfHud_VersionInfo = 5, ///< Shows SDK & HMD version Info + ovrPerfHud_Count = 6, ///< \internal Count of enumerated elements. + ovrPerfHud_EnumSize = 0x7fffffff ///< \internal Force type int32_t. +} ovrPerfHudMode; + +/// Layer HUD enables the HMD user to see information about a layer +/// +/// App can toggle layer HUD modes as such: +/// \code{.cpp} +/// ovrLayerHudMode LayerHudMode = ovrLayerHud_Info; +/// ovr_SetInt(Hmd, OVR_LAYER_HUD_MODE, (int)LayerHudMode); +/// \endcode +/// +typedef enum ovrLayerHudMode_ +{ + ovrLayerHud_Off = 0, ///< Turns off the layer HUD + ovrLayerHud_Info = 1, ///< Shows info about a specific layer + ovrLayerHud_EnumSize = 0x7fffffff +} ovrLayerHudMode; + +///@} + +/// Debug HUD is provided to help developers gauge and debug the fidelity of their app's +/// stereo rendering characteristics. Using the provided quad and crosshair guides, +/// the developer can verify various aspects such as VR tracking units (e.g. meters), +/// stereo camera-parallax properties (e.g. making sure objects at infinity are rendered +/// with the proper separation), measuring VR geometry sizes and distances and more. +/// +/// App can toggle the debug HUD modes as such: +/// \code{.cpp} +/// ovrDebugHudStereoMode DebugHudMode = ovrDebugHudStereo_QuadWithCrosshair; +/// ovr_SetInt(Hmd, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode); +/// \endcode +/// +/// The app can modify the visual properties of the stereo guide (i.e. quad, crosshair) +/// using the ovr_SetFloatArray function. For a list of tweakable properties, +/// see the OVR_DEBUG_HUD_STEREO_GUIDE_* keys in the OVR_CAPI_Keys.h header file. +typedef enum ovrDebugHudStereoMode_ +{ + ovrDebugHudStereo_Off = 0, ///< Turns off the Stereo Debug HUD + ovrDebugHudStereo_Quad = 1, ///< Renders Quad in world for Stereo Debugging + ovrDebugHudStereo_QuadWithCrosshair = 2, ///< Renders Quad+crosshair in world for Stereo Debugging + ovrDebugHudStereo_CrosshairAtInfinity = 3, ///< Renders screen-space crosshair at infinity for Stereo Debugging + ovrDebugHudStereo_Count, ///< \internal Count of enumerated elements + + ovrDebugHudStereo_EnumSize = 0x7fffffff ///< \internal Force type int32_t +} ovrDebugHudStereoMode; + + + + +// ----------------------------------------------------------------------------------- +/// @name Property Access +/// +/// These functions read and write OVR properties. Supported properties +/// are defined in OVR_CAPI_Keys.h +/// +//@{ + +/// Reads a boolean property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid for only the call. +/// \param[in] defaultVal specifes the value to return if the property couldn't be read. +/// \return Returns the property interpreted as a boolean value. Returns defaultVal if +/// the property doesn't exist. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_GetBool(ovrSession session, const char* propertyName, ovrBool defaultVal); + +/// Writes or creates a boolean property. +/// If the property wasn't previously a boolean property, it is changed to a boolean property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] value The value to write. +/// \return Returns true if successful, otherwise false. A false result should only occur if the property +/// name is empty or if the property is read-only. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetBool(ovrSession session, const char* propertyName, ovrBool value); + + +/// Reads an integer property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] defaultVal Specifes the value to return if the property couldn't be read. +/// \return Returns the property interpreted as an integer value. Returns defaultVal if +/// the property doesn't exist. +OVR_PUBLIC_FUNCTION(int) ovr_GetInt(ovrSession session, const char* propertyName, int defaultVal); + +/// Writes or creates an integer property. +/// +/// If the property wasn't previously a boolean property, it is changed to an integer property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] value The value to write. +/// \return Returns true if successful, otherwise false. A false result should only occur if the property +/// name is empty or if the property is read-only. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetInt(ovrSession session, const char* propertyName, int value); + + +/// Reads a float property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] defaultVal specifes the value to return if the property couldn't be read. +/// \return Returns the property interpreted as an float value. Returns defaultVal if +/// the property doesn't exist. +OVR_PUBLIC_FUNCTION(float) ovr_GetFloat(ovrSession session, const char* propertyName, float defaultVal); + +/// Writes or creates a float property. +/// If the property wasn't previously a float property, it's changed to a float property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] value The value to write. +/// \return Returns true if successful, otherwise false. A false result should only occur if the property +/// name is empty or if the property is read-only. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloat(ovrSession session, const char* propertyName, float value); + + +/// Reads a float array property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] values An array of float to write to. +/// \param[in] valuesCapacity Specifies the maximum number of elements to write to the values array. +/// \return Returns the number of elements read, or 0 if property doesn't exist or is empty. +OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetFloatArray(ovrSession session, const char* propertyName, + float values[], unsigned int valuesCapacity); + +/// Writes or creates a float array property. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] values An array of float to write from. +/// \param[in] valuesSize Specifies the number of elements to write. +/// \return Returns true if successful, otherwise false. A false result should only occur if the property +/// name is empty or if the property is read-only. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloatArray(ovrSession session, const char* propertyName, + const float values[], unsigned int valuesSize); + + +/// Reads a string property. +/// Strings are UTF8-encoded and null-terminated. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] defaultVal Specifes the value to return if the property couldn't be read. +/// \return Returns the string property if it exists. Otherwise returns defaultVal, which can be specified as NULL. +/// The return memory is guaranteed to be valid until next call to ovr_GetString or +/// until the HMD is destroyed, whichever occurs first. +OVR_PUBLIC_FUNCTION(const char*) ovr_GetString(ovrSession session, const char* propertyName, + const char* defaultVal); + +/// Writes or creates a string property. +/// Strings are UTF8-encoded and null-terminated. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] propertyName The name of the property, which needs to be valid only for the call. +/// \param[in] value The string property, which only needs to be valid for the duration of the call. +/// \return Returns true if successful, otherwise false. A false result should only occur if the property +/// name is empty or if the property is read-only. +OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetString(ovrSession session, const char* propertyName, + const char* value); + +///@} + + + +#ifdef __cplusplus +} // extern "C" +#endif + + +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + +/// @cond DoxygenIgnore +//----------------------------------------------------------------------------- +// ***** Compiler packing validation +// +// These checks ensure that the compiler settings being used will be compatible +// with with pre-built dynamic library provided with the runtime. + +OVR_STATIC_ASSERT(sizeof(ovrBool) == 1, "ovrBool size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrVector2i) == 4 * 2, "ovrVector2i size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrSizei) == 4 * 2, "ovrSizei size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrRecti) == sizeof(ovrVector2i) + sizeof(ovrSizei), "ovrRecti size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrQuatf) == 4 * 4, "ovrQuatf size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrVector2f) == 4 * 2, "ovrVector2f size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrVector3f) == 4 * 3, "ovrVector3f size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrMatrix4f) == 4 * 16, "ovrMatrix4f size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrPosef) == (7 * 4), "ovrPosef size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrPoseStatef) == (22 * 4), "ovrPoseStatef size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrFovPort) == (4 * 4), "ovrFovPort size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrHmdCaps) == 4, "ovrHmdCaps size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrTrackingCaps) == 4, "ovrTrackingCaps size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrEyeType) == 4, "ovrEyeType size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrHmdType) == 4, "ovrHmdType size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrTrackerDesc) == 4 + 4 + 4 + 4, "ovrTrackerDesc size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrTrackerPose) == 4 + 4 + sizeof(ovrPosef) + sizeof(ovrPosef), "ovrTrackerPose size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrTrackingState) == sizeof(ovrPoseStatef) + 4 + 4 + (sizeof(ovrPoseStatef) * 2) + (sizeof(unsigned int) * 2) + sizeof(ovrPosef) + 4, "ovrTrackingState size mismatch"); + + +//OVR_STATIC_ASSERT(sizeof(ovrTextureHeader) == sizeof(ovrRenderAPIType) + sizeof(ovrSizei), +// "ovrTextureHeader size mismatch"); +//OVR_STATIC_ASSERT(sizeof(ovrTexture) == sizeof(ovrTextureHeader) OVR_ON64(+4) + sizeof(uintptr_t) * 8, +// "ovrTexture size mismatch"); +// +OVR_STATIC_ASSERT(sizeof(ovrStatusBits) == 4, "ovrStatusBits size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrSessionStatus) == 6, "ovrSessionStatus size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrEyeRenderDesc) == sizeof(ovrEyeType) + sizeof(ovrFovPort) + sizeof(ovrRecti) + + sizeof(ovrVector2f) + sizeof(ovrVector3f), + "ovrEyeRenderDesc size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrTimewarpProjectionDesc) == 4 * 3, "ovrTimewarpProjectionDesc size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrInitFlags) == 4, "ovrInitFlags size mismatch"); +OVR_STATIC_ASSERT(sizeof(ovrLogLevel) == 4, "ovrLogLevel size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrInitParams) == 4 + 4 + sizeof(ovrLogCallback) + sizeof(uintptr_t) + 4 + 4, + "ovrInitParams size mismatch"); + +OVR_STATIC_ASSERT(sizeof(ovrHmdDesc) == + + sizeof(ovrHmdType) // Type + OVR_ON64(+ 4) // pad0 + + 64 // ProductName + + 64 // Manufacturer + + 2 // VendorId + + 2 // ProductId + + 24 // SerialNumber + + 2 // FirmwareMajor + + 2 // FirmwareMinor + + 4 * 4 // AvailableHmdCaps - DefaultTrackingCaps + + sizeof(ovrFovPort) * 2 // DefaultEyeFov + + sizeof(ovrFovPort) * 2 // MaxEyeFov + + sizeof(ovrSizei) // Resolution + + 4 // DisplayRefreshRate + OVR_ON64(+ 4) // pad1 + , "ovrHmdDesc size mismatch"); + + +// ----------------------------------------------------------------------------------- +// ***** Backward compatibility #includes +// +// This is at the bottom of this file because the following is dependent on the +// declarations above. + +#if !defined(OVR_CAPI_NO_UTILS) + #include "Extras/OVR_CAPI_Util.h" +#endif + +/// @endcond + +#endif // OVR_CAPI_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h new file mode 100644 index 00000000..c5344813 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h @@ -0,0 +1,76 @@ +/********************************************************************************//** +\file OVR_CAPI_Audio.h +\brief CAPI audio functions. +\copyright Copyright 2015 Oculus VR, LLC. All Rights reserved. +************************************************************************************/ + + +#ifndef OVR_CAPI_Audio_h +#define OVR_CAPI_Audio_h + +#ifdef _WIN32 +#include +#include "OVR_CAPI.h" +#define OVR_AUDIO_MAX_DEVICE_STR_SIZE 128 + +/// Gets the ID of the preferred VR audio output device. +/// +/// \param[out] deviceOutId The ID of the user's preferred VR audio device to use, which will be valid upon a successful return value, else it will be WAVE_MAPPER. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceOutWaveId(UINT* deviceOutId); + +/// Gets the ID of the preferred VR audio input device. +/// +/// \param[out] deviceInId The ID of the user's preferred VR audio device to use, which will be valid upon a successful return value, else it will be WAVE_MAPPER. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceInWaveId(UINT* deviceInId); + + +/// Gets the GUID of the preferred VR audio device as a string. +/// +/// \param[out] deviceOutStrBuffer A buffer where the GUID string for the device will copied to. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceOutGuidStr(WCHAR deviceOutStrBuffer[OVR_AUDIO_MAX_DEVICE_STR_SIZE]); + + +/// Gets the GUID of the preferred VR audio device. +/// +/// \param[out] deviceOutGuid The GUID of the user's preferred VR audio device to use, which will be valid upon a successful return value, else it will be NULL. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceOutGuid(GUID* deviceOutGuid); + + +/// Gets the GUID of the preferred VR microphone device as a string. +/// +/// \param[out] deviceInStrBuffer A buffer where the GUID string for the device will copied to. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceInGuidStr(WCHAR deviceInStrBuffer[OVR_AUDIO_MAX_DEVICE_STR_SIZE]); + + +/// Gets the GUID of the preferred VR microphone device. +/// +/// \param[out] deviceInGuid The GUID of the user's preferred VR audio device to use, which will be valid upon a successful return value, else it will be NULL. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceInGuid(GUID* deviceInGuid); + +#endif //OVR_OS_MS + +#endif // OVR_CAPI_Audio_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h new file mode 100644 index 00000000..50806bca --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h @@ -0,0 +1,155 @@ +/********************************************************************************//** +\file OVR_CAPI_D3D.h +\brief D3D specific structures used by the CAPI interface. +\copyright Copyright 2014-2016 Oculus VR, LLC All Rights reserved. +************************************************************************************/ + +#ifndef OVR_CAPI_D3D_h +#define OVR_CAPI_D3D_h + +#include "OVR_CAPI.h" +#include "OVR_Version.h" + + +#if defined (_WIN32) +#include + +//----------------------------------------------------------------------------------- +// ***** Direct3D Specific + +/// Create Texture Swap Chain suitable for use with Direct3D 11 and 12. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] d3dPtr Specifies the application's D3D11Device to create resources with or the D3D12CommandQueue +/// which must be the same one the application renders to the eye textures with. +/// \param[in] desc Specifies requested texture properties. See notes for more info about texture format. +/// \param[in] bindFlags Specifies what ovrTextureBindFlags the application requires for this texture chain. +/// \param[out] out_TextureSwapChain Returns the created ovrTextureSwapChain, which will be valid upon a successful return value, else it will be NULL. +/// This texture chain must be eventually destroyed via ovr_DestroyTextureSwapChain before destroying the HMD with ovr_Destroy. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// \note The texture format provided in \a desc should be thought of as the format the distortion-compositor will use for the +/// ShaderResourceView when reading the contents of the texture. To that end, it is highly recommended that the application +/// requests texture swapchain formats that are in sRGB-space (e.g. OVR_FORMAT_R8G8B8A8_UNORM_SRGB) as the compositor +/// does sRGB-correct rendering. As such, the compositor relies on the GPU's hardware sampler to do the sRGB-to-linear +/// conversion. If the application still prefers to render to a linear format (e.g. OVR_FORMAT_R8G8B8A8_UNORM) while handling the +/// linear-to-gamma conversion via HLSL code, then the application must still request the corresponding sRGB format and also use +/// the \a ovrTextureMisc_DX_Typeless flag in the ovrTextureSwapChainDesc's Flag field. This will allow the application to create +/// a RenderTargetView that is the desired linear format while the compositor continues to treat it as sRGB. Failure to do so +/// will cause the compositor to apply unexpected gamma conversions leading to gamma-curve artifacts. The \a ovrTextureMisc_DX_Typeless +/// flag for depth buffer formats (e.g. OVR_FORMAT_D32_FLOAT) is ignored as they are always converted to be typeless. +/// +/// \see ovr_GetTextureSwapChainLength +/// \see ovr_GetTextureSwapChainCurrentIndex +/// \see ovr_GetTextureSwapChainDesc +/// \see ovr_GetTextureSwapChainBufferDX +/// \see ovr_DestroyTextureSwapChain +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateTextureSwapChainDX(ovrSession session, + IUnknown* d3dPtr, + const ovrTextureSwapChainDesc* desc, + ovrTextureSwapChain* out_TextureSwapChain); + + +/// Get a specific buffer within the chain as any compatible COM interface (similar to QueryInterface) +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies an ovrTextureSwapChain previously returned by ovr_CreateTextureSwapChainDX +/// \param[in] index Specifies the index within the chain to retrieve. Must be between 0 and length (see ovr_GetTextureSwapChainLength), +/// or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex) +/// \param[in] iid Specifies the interface ID of the interface pointer to query the buffer for. +/// \param[out] out_Buffer Returns the COM interface pointer retrieved. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// Example code +/// \code{.cpp} +/// ovr_GetTextureSwapChainBufferDX(session, chain, 0, IID_ID3D11Texture2D, &d3d11Texture); +/// ovr_GetTextureSwapChainBufferDX(session, chain, 1, IID_PPV_ARGS(&dxgiResource)); +/// \endcode +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferDX(ovrSession session, + ovrTextureSwapChain chain, + int index, + IID iid, + void** out_Buffer); + + +/// Create Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application. +/// +/// A second call to ovr_CreateMirrorTextureDX for a given ovrSession before destroying the first one +/// is not supported and will result in an error return. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] d3dPtr Specifies the application's D3D11Device to create resources with or the D3D12CommandQueue +/// which must be the same one the application renders to the textures with. +/// \param[in] desc Specifies requested texture properties. See notes for more info about texture format. +/// \param[out] out_MirrorTexture Returns the created ovrMirrorTexture, which will be valid upon a successful return value, else it will be NULL. +/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the HMD with ovr_Destroy. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// \note The texture format provided in \a desc should be thought of as the format the compositor will use for the RenderTargetView when +/// writing into mirror texture. To that end, it is highly recommended that the application requests a mirror texture format that is +/// in sRGB-space (e.g. OVR_FORMAT_R8G8B8A8_UNORM_SRGB) as the compositor does sRGB-correct rendering. If however the application wants +/// to still read the mirror texture as a linear format (e.g. OVR_FORMAT_R8G8B8A8_UNORM) and handle the sRGB-to-linear conversion in +/// HLSL code, then it is recommended the application still requests an sRGB format and also use the \a ovrTextureMisc_DX_Typeless flag in the +/// ovrMirrorTextureDesc's Flags field. This will allow the application to bind a ShaderResourceView that is a linear format while the +/// compositor continues to treat is as sRGB. Failure to do so will cause the compositor to apply unexpected gamma conversions leading to +/// gamma-curve artifacts. +/// +/// +/// Example code +/// \code{.cpp} +/// ovrMirrorTexture mirrorTexture = nullptr; +/// ovrMirrorTextureDesc mirrorDesc = {}; +/// mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; +/// mirrorDesc.Width = mirrorWindowWidth; +/// mirrorDesc.Height = mirrorWindowHeight; +/// ovrResult result = ovr_CreateMirrorTextureDX(session, d3d11Device, &mirrorDesc, &mirrorTexture); +/// [...] +/// // Destroy the texture when done with it. +/// ovr_DestroyMirrorTexture(session, mirrorTexture); +/// mirrorTexture = nullptr; +/// \endcode +/// +/// \see ovr_GetMirrorTextureBufferDX +/// \see ovr_DestroyMirrorTexture +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureDX(ovrSession session, + IUnknown* d3dPtr, + const ovrMirrorTextureDesc* desc, + ovrMirrorTexture* out_MirrorTexture); + +/// Get a the underlying buffer as any compatible COM interface (similar to QueryInterface) +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] mirrorTexture Specifies an ovrMirrorTexture previously returned by ovr_CreateMirrorTextureDX +/// \param[in] iid Specifies the interface ID of the interface pointer to query the buffer for. +/// \param[out] out_Buffer Returns the COM interface pointer retrieved. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// Example code +/// \code{.cpp} +/// ID3D11Texture2D* d3d11Texture = nullptr; +/// ovr_GetMirrorTextureBufferDX(session, mirrorTexture, IID_PPV_ARGS(&d3d11Texture)); +/// d3d11DeviceContext->CopyResource(d3d11TextureBackBuffer, d3d11Texture); +/// d3d11Texture->Release(); +/// dxgiSwapChain->Present(0, 0); +/// \endcode +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferDX(ovrSession session, + ovrMirrorTexture mirrorTexture, + IID iid, + void** out_Buffer); + + +#endif // _WIN32 + +#endif // OVR_CAPI_D3D_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h new file mode 100644 index 00000000..1658ca57 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h @@ -0,0 +1,99 @@ +/********************************************************************************//** +\file OVR_CAPI_GL.h +\brief OpenGL-specific structures used by the CAPI interface. +\copyright Copyright 2015 Oculus VR, LLC. All Rights reserved. +************************************************************************************/ + +#ifndef OVR_CAPI_GL_h +#define OVR_CAPI_GL_h + +#include "OVR_CAPI.h" + +/// Creates a TextureSwapChain suitable for use with OpenGL. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] desc Specifies the requested texture properties. See notes for more info about texture format. +/// \param[out] out_TextureSwapChain Returns the created ovrTextureSwapChain, which will be valid upon +/// a successful return value, else it will be NULL. This texture swap chain must be eventually +/// destroyed via ovr_DestroyTextureSwapChain before destroying the HMD with ovr_Destroy. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// \note The \a format provided should be thought of as the format the distortion compositor will use when reading +/// the contents of the texture. To that end, it is highly recommended that the application requests texture swap chain +/// formats that are in sRGB-space (e.g. OVR_FORMAT_R8G8B8A8_UNORM_SRGB) as the distortion compositor does sRGB-correct +/// rendering. Furthermore, the app should then make sure "glEnable(GL_FRAMEBUFFER_SRGB);" is called before rendering +/// into these textures. Even though it is not recommended, if the application would like to treat the texture as a linear +/// format and do linear-to-gamma conversion in GLSL, then the application can avoid calling "glEnable(GL_FRAMEBUFFER_SRGB);", +/// but should still pass in an sRGB variant for the \a format. Failure to do so will cause the distortion compositor +/// to apply incorrect gamma conversions leading to gamma-curve artifacts. +/// +/// \see ovr_GetTextureSwapChainLength +/// \see ovr_GetTextureSwapChainCurrentIndex +/// \see ovr_GetTextureSwapChainDesc +/// \see ovr_GetTextureSwapChainBufferGL +/// \see ovr_DestroyTextureSwapChain +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateTextureSwapChainGL(ovrSession session, + const ovrTextureSwapChainDesc* desc, + ovrTextureSwapChain* out_TextureSwapChain); + +/// Get a specific buffer within the chain as a GL texture name +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] chain Specifies an ovrTextureSwapChain previously returned by ovr_CreateTextureSwapChainGL +/// \param[in] index Specifies the index within the chain to retrieve. Must be between 0 and length (see ovr_GetTextureSwapChainLength) +/// or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex) +/// \param[out] out_TexId Returns the GL texture object name associated with the specific index requested +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferGL(ovrSession session, + ovrTextureSwapChain chain, + int index, + unsigned int* out_TexId); + + +/// Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application. +/// +/// A second call to ovr_CreateMirrorTextureGL for a given ovrSession before destroying the first one +/// is not supported and will result in an error return. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] desc Specifies the requested mirror texture description. +/// \param[out] out_MirrorTexture Specifies the created ovrMirrorTexture, which will be valid upon a successful return value, else it will be NULL. +/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the HMD with ovr_Destroy. +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +/// \note The \a format provided should be thought of as the format the distortion compositor will use when writing into the mirror +/// texture. It is highly recommended that mirror textures are requested as sRGB formats because the distortion compositor +/// does sRGB-correct rendering. If the application requests a non-sRGB format (e.g. R8G8B8A8_UNORM) as the mirror texture, +/// then the application might have to apply a manual linear-to-gamma conversion when reading from the mirror texture. +/// Failure to do so can result in incorrect gamma conversions leading to gamma-curve artifacts and color banding. +/// +/// \see ovr_GetMirrorTextureBufferGL +/// \see ovr_DestroyMirrorTexture +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_CreateMirrorTextureGL(ovrSession session, + const ovrMirrorTextureDesc* desc, + ovrMirrorTexture* out_MirrorTexture); + +/// Get a the underlying buffer as a GL texture name +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] mirrorTexture Specifies an ovrMirrorTexture previously returned by ovr_CreateMirrorTextureGL +/// \param[out] out_TexId Specifies the GL texture object name associated with the mirror texture +/// +/// \return Returns an ovrResult indicating success or failure. In the case of failure, use +/// ovr_GetLastErrorInfo to get more information. +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferGL(ovrSession session, + ovrMirrorTexture mirrorTexture, + unsigned int* out_TexId); + + +#endif // OVR_CAPI_GL_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Keys.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Keys.h new file mode 100644 index 00000000..e3e9d689 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Keys.h @@ -0,0 +1,53 @@ +/********************************************************************************//** +\file OVR_CAPI.h +\brief Keys for CAPI proprty function calls +\copyright Copyright 2015 Oculus VR, LLC All Rights reserved. +************************************************************************************/ + +#ifndef OVR_CAPI_Keys_h +#define OVR_CAPI_Keys_h + +#include "OVR_Version.h" + + + +#define OVR_KEY_USER "User" // string + +#define OVR_KEY_NAME "Name" // string + +#define OVR_KEY_GENDER "Gender" // string "Male", "Female", or "Unknown" +#define OVR_DEFAULT_GENDER "Unknown" + +#define OVR_KEY_PLAYER_HEIGHT "PlayerHeight" // float meters +#define OVR_DEFAULT_PLAYER_HEIGHT 1.778f + +#define OVR_KEY_EYE_HEIGHT "EyeHeight" // float meters +#define OVR_DEFAULT_EYE_HEIGHT 1.675f + +#define OVR_KEY_NECK_TO_EYE_DISTANCE "NeckEyeDistance" // float[2] meters +#define OVR_DEFAULT_NECK_TO_EYE_HORIZONTAL 0.0805f +#define OVR_DEFAULT_NECK_TO_EYE_VERTICAL 0.075f + + +#define OVR_KEY_EYE_TO_NOSE_DISTANCE "EyeToNoseDist" // float[2] meters + + + + + +#define OVR_PERF_HUD_MODE "PerfHudMode" // int, allowed values are defined in enum ovrPerfHudMode + +#define OVR_LAYER_HUD_MODE "LayerHudMode" // int, allowed values are defined in enum ovrLayerHudMode +#define OVR_LAYER_HUD_CURRENT_LAYER "LayerHudCurrentLayer" // int, The layer to show +#define OVR_LAYER_HUD_SHOW_ALL_LAYERS "LayerHudShowAll" // bool, Hide other layers when the hud is enabled + +#define OVR_DEBUG_HUD_STEREO_MODE "DebugHudStereoMode" // int, allowed values are defined in enum ovrDebugHudStereoMode +#define OVR_DEBUG_HUD_STEREO_GUIDE_INFO_ENABLE "DebugHudStereoGuideInfoEnable" // bool +#define OVR_DEBUG_HUD_STEREO_GUIDE_SIZE "DebugHudStereoGuideSize2f" // float[2] +#define OVR_DEBUG_HUD_STEREO_GUIDE_POSITION "DebugHudStereoGuidePosition3f" // float[3] +#define OVR_DEBUG_HUD_STEREO_GUIDE_YAWPITCHROLL "DebugHudStereoGuideYawPitchRoll3f" // float[3] +#define OVR_DEBUG_HUD_STEREO_GUIDE_COLOR "DebugHudStereoGuideColor4f" // float[4] + + + +#endif // OVR_CAPI_Keys_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h new file mode 100644 index 00000000..ed0be0e7 --- /dev/null +++ b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h @@ -0,0 +1,209 @@ +/********************************************************************************//** +\file OVR_ErrorCode.h +\brief This header provides LibOVR error code declarations. +\copyright Copyright 2015-2016 Oculus VR, LLC All Rights reserved. +*************************************************************************************/ + +#ifndef OVR_ErrorCode_h +#define OVR_ErrorCode_h + + +#include "OVR_Version.h" +#include + + + + + + + +#ifndef OVR_RESULT_DEFINED +#define OVR_RESULT_DEFINED ///< Allows ovrResult to be independently defined. +/// API call results are represented at the highest level by a single ovrResult. +typedef int32_t ovrResult; +#endif + + +/// \brief Indicates if an ovrResult indicates success. +/// +/// Some functions return additional successful values other than ovrSucces and +/// require usage of this macro to indicate successs. +/// +#if !defined(OVR_SUCCESS) + #define OVR_SUCCESS(result) (result >= 0) +#endif + + +/// \brief Indicates if an ovrResult indicates an unqualified success. +/// +/// This is useful for indicating that the code intentionally wants to +/// check for result == ovrSuccess as opposed to OVR_SUCCESS(), which +/// checks for result >= ovrSuccess. +/// +#if !defined(OVR_UNQUALIFIED_SUCCESS) + #define OVR_UNQUALIFIED_SUCCESS(result) (result == ovrSuccess) +#endif + + +/// \brief Indicates if an ovrResult indicates failure. +/// +#if !defined(OVR_FAILURE) + #define OVR_FAILURE(result) (!OVR_SUCCESS(result)) +#endif + + +// Success is a value greater or equal to 0, while all error types are negative values. +#ifndef OVR_SUCCESS_DEFINED +#define OVR_SUCCESS_DEFINED ///< Allows ovrResult to be independently defined. +typedef enum ovrSuccessType_ +{ + /// This is a general success result. Use OVR_SUCCESS to test for success. + ovrSuccess = 0, + + /// Returned from a call to SubmitFrame. The call succeeded, but what the app + /// rendered will not be visible on the HMD. Ideally the app should continue + /// calling SubmitFrame, but not do any rendering. When the result becomes + /// ovrSuccess, rendering should continue as usual. + ovrSuccess_NotVisible = 1000, + + ovrSuccess_HMDFirmwareMismatch = 4100, ///< The HMD Firmware is out of date but is acceptable. + ovrSuccess_TrackerFirmwareMismatch = 4101, ///< The Tracker Firmware is out of date but is acceptable. + ovrSuccess_ControllerFirmwareMismatch = 4104, ///< The controller firmware is out of date but is acceptable. + ovrSuccess_TrackerDriverNotFound = 4105, ///< The tracker driver interface was not found. Can be a temporary error + +} ovrSuccessType; +#endif + + +typedef enum ovrErrorType_ +{ + /* General errors */ + ovrError_MemoryAllocationFailure = -1000, ///< Failure to allocate memory. + ovrError_SocketCreationFailure = -1001, ///< Failure to create a socket. + ovrError_InvalidSession = -1002, ///< Invalid ovrSession parameter provided. + ovrError_Timeout = -1003, ///< The operation timed out. + ovrError_NotInitialized = -1004, ///< The system or component has not been initialized. + ovrError_InvalidParameter = -1005, ///< Invalid parameter provided. See error info or log for details. + ovrError_ServiceError = -1006, ///< Generic service error. See error info or log for details. + ovrError_NoHmd = -1007, ///< The given HMD doesn't exist. + ovrError_Unsupported = -1009, ///< Function call is not supported on this hardware/software + ovrError_DeviceUnavailable = -1010, ///< Specified device type isn't available. + ovrError_InvalidHeadsetOrientation = -1011, ///< The headset was in an invalid orientation for the requested operation (e.g. vertically oriented during ovr_RecenterPose). + ovrError_ClientSkippedDestroy = -1012, ///< The client failed to call ovr_Destroy on an active session before calling ovr_Shutdown. Or the client crashed. + ovrError_ClientSkippedShutdown = -1013, ///< The client failed to call ovr_Shutdown or the client crashed. + ovrError_ServiceDeadlockDetected = -1014, ///< The service watchdog discovered a deadlock. + + /* Audio error range, reserved for Audio errors. */ + ovrError_AudioReservedBegin = -2000, ///< First Audio error. + ovrError_AudioDeviceNotFound = -2001, ///< Failure to find the specified audio device. + ovrError_AudioComError = -2002, ///< Generic COM error. + ovrError_AudioReservedEnd = -2999, ///< Last Audio error. + + /* Initialization errors. */ + ovrError_Initialize = -3000, ///< Generic initialization error. + ovrError_LibLoad = -3001, ///< Couldn't load LibOVRRT. + ovrError_LibVersion = -3002, ///< LibOVRRT version incompatibility. + ovrError_ServiceConnection = -3003, ///< Couldn't connect to the OVR Service. + ovrError_ServiceVersion = -3004, ///< OVR Service version incompatibility. + ovrError_IncompatibleOS = -3005, ///< The operating system version is incompatible. + ovrError_DisplayInit = -3006, ///< Unable to initialize the HMD display. + ovrError_ServerStart = -3007, ///< Unable to start the server. Is it already running? + ovrError_Reinitialization = -3008, ///< Attempting to re-initialize with a different version. + ovrError_MismatchedAdapters = -3009, ///< Chosen rendering adapters between client and service do not match + ovrError_LeakingResources = -3010, ///< Calling application has leaked resources + ovrError_ClientVersion = -3011, ///< Client version too old to connect to service + ovrError_OutOfDateOS = -3012, ///< The operating system is out of date. + ovrError_OutOfDateGfxDriver = -3013, ///< The graphics driver is out of date. + ovrError_IncompatibleGPU = -3014, ///< The graphics hardware is not supported + ovrError_NoValidVRDisplaySystem = -3015, ///< No valid VR display system found. + ovrError_Obsolete = -3016, ///< Feature or API is obsolete and no longer supported. + ovrError_DisabledOrDefaultAdapter = -3017, ///< No supported VR display system found, but disabled or driverless adapter found. + ovrError_HybridGraphicsNotSupported = -3018, ///< The system is using hybrid graphics (Optimus, etc...), which is not support. + ovrError_DisplayManagerInit = -3019, ///< Initialization of the DisplayManager failed. + ovrError_TrackerDriverInit = -3020, ///< Failed to get the interface for an attached tracker + + /* Hardware errors */ + ovrError_InvalidBundleAdjustment = -4000, ///< Headset has no bundle adjustment data. + ovrError_USBBandwidth = -4001, ///< The USB hub cannot handle the camera frame bandwidth. + ovrError_USBEnumeratedSpeed = -4002, ///< The USB camera is not enumerating at the correct device speed. + ovrError_ImageSensorCommError = -4003, ///< Unable to communicate with the image sensor. + ovrError_GeneralTrackerFailure = -4004, ///< We use this to report various sensor issues that don't fit in an easily classifiable bucket. + ovrError_ExcessiveFrameTruncation = -4005, ///< A more than acceptable number of frames are coming back truncated. + ovrError_ExcessiveFrameSkipping = -4006, ///< A more than acceptable number of frames have been skipped. + ovrError_SyncDisconnected = -4007, ///< The sensor is not receiving the sync signal (cable disconnected?). + ovrError_TrackerMemoryReadFailure = -4008, ///< Failed to read memory from the sensor. + ovrError_TrackerMemoryWriteFailure = -4009, ///< Failed to write memory from the sensor. + ovrError_TrackerFrameTimeout = -4010, ///< Timed out waiting for a camera frame. + ovrError_TrackerTruncatedFrame = -4011, ///< Truncated frame returned from sensor. + ovrError_TrackerDriverFailure = -4012, ///< The sensor driver has encountered a problem. + ovrError_TrackerNRFFailure = -4013, ///< The sensor wireless subsystem has encountered a problem. + ovrError_HardwareGone = -4014, ///< The hardware has been unplugged + ovrError_NordicEnabledNoSync = -4015, ///< The nordic indicates that sync is enabled but it is not sending sync pulses + ovrError_NordicSyncNoFrames = -4016, ///< It looks like we're getting a sync signal, but no camera frames have been received + ovrError_CatastrophicFailure = -4017, ///< A catastrophic failure has occurred. We will attempt to recover by resetting the device + ovrError_CatastrophicTimeout = -4018, ///< The catastrophic recovery has timed out. + ovrError_RepeatCatastrophicFail = -4019, ///< Catastrophic failure has repeated too many times. + ovrError_USBOpenDeviceFailure = -4020, ///< Could not open handle for Rift device (likely already in use by another process). + ovrError_HMDGeneralFailure = -4021, ///< Unexpected HMD issues that don't fit a specific bucket. + + ovrError_HMDFirmwareMismatch = -4100, ///< The HMD Firmware is out of date and is unacceptable. + ovrError_TrackerFirmwareMismatch = -4101, ///< The sensor Firmware is out of date and is unacceptable. + ovrError_BootloaderDeviceDetected = -4102, ///< A bootloader HMD is detected by the service. + ovrError_TrackerCalibrationError = -4103, ///< The sensor calibration is missing or incorrect. + ovrError_ControllerFirmwareMismatch = -4104, ///< The controller firmware is out of date and is unacceptable. + ovrError_DevManDeviceDetected = -4105, ///< A DeviceManagement mode HMD is detected by the service. + ovrError_RebootedBootloaderDevice = -4106, ///< Had to reboot bootloader device, which succeeded. + ovrError_FailedRebootBootloaderDev = -4107, ///< Had to reboot bootloader device, which failed. Device is stuck in bootloader mode. + + ovrError_IMUTooManyLostSamples = -4200, ///< Too many lost IMU samples. + ovrError_IMURateError = -4201, ///< IMU rate is outside of the expected range. + ovrError_FeatureReportFailure = -4202, ///< A feature report has failed. + ovrError_HMDWirelessTimeout = -4203, ///< HMD wireless interface never returned from busy state. + + ovrError_BootloaderAssertLog = -4300, ///< HMD Bootloader Assert Log was not empty. + ovrError_AppAssertLog = -4301, ///< HMD App Assert Log was not empty. + + /* Synchronization errors */ + ovrError_Incomplete = -5000, ///< Requested async work not yet complete. + ovrError_Abandoned = -5001, ///< Requested async work was abandoned and result is incomplete. + + /* Rendering errors */ + ovrError_DisplayLost = -6000, ///< In the event of a system-wide graphics reset or cable unplug this is returned to the app. + ovrError_TextureSwapChainFull = -6001, ///< ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. + ovrError_TextureSwapChainInvalid = -6002, ///< The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure ovr_CommitTextureSwapChain was called at least once first. + ovrError_GraphicsDeviceReset = -6003, ///< Graphics device has been reset (TDR, etc...) + ovrError_DisplayRemoved = -6004, ///< HMD removed from the display adapter + ovrError_ContentProtectionNotAvailable = -6005,/// Date: Tue, 14 Jun 2016 17:16:20 +0200 Subject: Move Oculus Rift support to rlgl module --- src/core.c | 386 +--------------------------------------------------------- src/raylib.h | 19 +-- src/rlgl.c | 390 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/rlgl.h | 9 ++ 4 files changed, 399 insertions(+), 405 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index bd49b549..fb71af21 100644 --- a/src/core.c +++ b/src/core.c @@ -9,7 +9,7 @@ * PLATFORM_ANDROID - Only OpenGL ES 2.0 devices * PLATFORM_RPI - Rapsberry Pi (tested on Raspbian) * PLATFORM_WEB - Emscripten, HTML5 -* PLATFORM_OCULUS - Oculus Rift CV1 (with desktop mirror) +* Oculus Rift CV1 (with desktop mirror) - View [rlgl] module to enable it * * On PLATFORM_DESKTOP, the external lib GLFW3 (www.glfw.com) is used to manage graphic * device, OpenGL context and input on multiple operating systems (Windows, Linux, OSX). @@ -54,14 +54,6 @@ #include // String function definitions, memset() #include // Macros for reporting and retrieving error conditions through error codes -#if defined(PLATFORM_OCULUS) - #define PLATFORM_DESKTOP // Enable PLATFORM_DESKTOP code-base -#endif - -#if defined(PLATFORM_OCULUS) - #include "../examples/oculus_glfw_sample/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL -#endif - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 #include // GLFW3 library: Windows, OpenGL context and Input management @@ -134,31 +126,7 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- -#if defined(PLATFORM_OCULUS) -typedef struct OculusBuffer { - ovrTextureSwapChain textureChain; - GLuint depthId; - GLuint fboId; - int width; - int height; -} OculusBuffer; - -typedef struct OculusMirror { - ovrMirrorTexture texture; - GLuint fboId; - int width; - int height; -} OculusMirror; - -typedef struct OculusLayer { - ovrViewScaleDesc viewScaleDesc; - ovrLayerEyeFov eyeLayer; // layer 0 - //ovrLayerQuad quadLayer; // TODO: layer 1: '2D' quad for GUI - Matrix eyeProjections[2]; - int width; - int height; -} OculusLayer; -#endif +// ... //---------------------------------------------------------------------------------- // Global Variables Definition @@ -213,17 +181,6 @@ static uint64_t baseTime; // Base time measure for hi-res timer static bool windowShouldClose = false; // Flag to set window for closing #endif -#if defined(PLATFORM_OCULUS) -// OVR device variables -static ovrSession session; // Oculus session (pointer to ovrHmdStruct) -static ovrHmdDesc hmdDesc; // Oculus device descriptor parameters -static ovrGraphicsLuid luid; // Oculus locally unique identifier for the program (64 bit) -static OculusLayer layer; // Oculus drawing layer (similar to photoshop) -static OculusBuffer buffer; // Oculus internal buffers (texture chain and fbo) -static OculusMirror mirror; // Oculus mirror texture and fbo -static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain -#endif - static unsigned int displayWidth, displayHeight; // Display width and height (monitor, device-screen, LCD, ...) static int screenWidth, screenHeight; // Screen width and height (used render area) static int renderWidth, renderHeight; // Framebuffer width and height (render area) @@ -233,7 +190,6 @@ static int renderOffsetX = 0; // Offset X from render area (must b static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2) static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size) -static Matrix cameraView; // Store camera view matrix (required for Oculus Rift) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... @@ -332,19 +288,6 @@ static void InitGamepad(void); // Init raw gamepad inpu static void *GamepadThread(void *arg); // Mouse reading thread #endif -#if defined(PLATFORM_OCULUS) -// Oculus Rift functions -static Matrix FromOvrMatrix(ovrMatrix4f ovrM); -static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); -static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); -static void SetOculusBuffer(ovrSession session, OculusBuffer buffer); -static void UnsetOculusBuffer(OculusBuffer buffer); -static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers -static void UnloadOculusMirror(ovrSession session, OculusMirror mirror); // Unload Oculus mirror buffers -static void BlitOculusMirror(ovrSession session, OculusMirror mirror); -static OculusLayer InitOculusLayer(ovrSession session); -#endif - //---------------------------------------------------------------------------------- // Module Functions Definition - Window and OpenGL Context Functions //---------------------------------------------------------------------------------- @@ -393,11 +336,6 @@ void InitWindow(int width, int height, const char *title) //emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenInputCallback); #endif -#if defined(PLATFORM_OCULUS) - // Recenter OVR tracking origin - ovr_RecenterTrackingOrigin(session); -#endif - mousePosition.x = (float)screenWidth/2.0f; mousePosition.y = (float)screenHeight/2.0f; @@ -512,64 +450,6 @@ void CloseWindow(void) TraceLog(INFO, "Window closed successfully"); } -#if defined(PLATFORM_OCULUS) -// Init Oculus Rift device -// NOTE: Device initialization should be done before window creation? -void InitOculusDevice(void) -{ - // Initialize Oculus device - ovrResult result = ovr_Initialize(NULL); - if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - - result = ovr_Create(&session, &luid); - if (OVR_FAILURE(result)) - { - TraceLog(WARNING, "OVR: Could not create Oculus session"); - ovr_Shutdown(); - } - - hmdDesc = ovr_GetHmdDesc(session); - - TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); - TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); - TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); - TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); - TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - - // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... - // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) - - // Initialize Oculus Buffers - layer = InitOculusLayer(session); - buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, screenWidth, screenHeight); - layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); -} - -// Close Oculus Rift device -void CloseOculusDevice(void) -{ - UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer - UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers - - ovr_Destroy(session); // Free Oculus session data - ovr_Shutdown(); // Close Oculus device connection -} - -// Update Oculus Rift tracking (position and orientation) -void UpdateOculusTracking(void) -{ - frameIndex++; - - ovrPosef eyePoses[2]; - ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - - layer.eyeLayer.RenderPose[0] = eyePoses[0]; - layer.eyeLayer.RenderPose[1] = eyePoses[1]; -} -#endif - // Detect if KEY_ESCAPE pressed or Close icon pressed bool WindowShouldClose(void) { @@ -638,10 +518,6 @@ void BeginDrawing(void) currentTime = GetTime(); // Number of elapsed seconds since InitTimer() was called updateTime = currentTime - previousTime; previousTime = currentTime; - -#if defined(PLATFORM_OCULUS) - SetOculusBuffer(session, buffer); -#endif rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -654,49 +530,7 @@ void BeginDrawing(void) // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void) { -#if defined(PLATFORM_OCULUS) - for (int eye = 0; eye < 2; eye++) - { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - - Quaternion eyeRPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); - - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); - Matrix modelEyeView = MatrixMultiply(cameraView, eyeView); // Using internal camera modelview matrix - - SetMatrixModelview(modelEyeView); - SetMatrixProjection(layer.eyeProjections[eye]); -#endif - - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - -#if defined(PLATFORM_OCULUS) - } - - UnsetOculusBuffer(buffer); - - ovr_CommitTextureSwapChain(session, buffer.textureChain); - - ovrLayerHeader *layers = &layer.eyeLayer.Header; - ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); - - // Blit mirror texture to back buffer - BlitOculusMirror(session, mirror); - - // Get session status information - ovrSessionStatus sessionStatus; - ovr_GetSessionStatus(session, &sessionStatus); - if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); - if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); -#endif + rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -768,7 +602,7 @@ void Begin3dMode(Camera camera) rlLoadIdentity(); // Reset current matrix (MODELVIEW) // Setup Camera view - cameraView = MatrixLookAt(camera.position, camera.target, camera.up); + Matrix cameraView = MatrixLookAt(camera.position, camera.target, camera.up); rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D @@ -1738,9 +1572,7 @@ static void InitDisplay(int width, int height) #endif glfwMakeContextCurrent(window); -#if defined(PLATFORM_OCULUS) - glfwSwapInterval(0); -#endif + glfwSwapInterval(0); // Disable VSync by default #if defined(PLATFORM_DESKTOP) // Load OpenGL 3.3 extensions @@ -2940,214 +2772,6 @@ static void *GamepadThread(void *arg) } #endif - -#if defined(PLATFORM_OCULUS) -// Convert from Oculus ovrMatrix4f struct to raymath Matrix struct -static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) -{ - Matrix rmat; - - rmat.m0 = ovrmat.M[0][0]; - rmat.m1 = ovrmat.M[1][0]; - rmat.m2 = ovrmat.M[2][0]; - rmat.m3 = ovrmat.M[3][0]; - rmat.m4 = ovrmat.M[0][1]; - rmat.m5 = ovrmat.M[1][1]; - rmat.m6 = ovrmat.M[2][1]; - rmat.m7 = ovrmat.M[3][1]; - rmat.m8 = ovrmat.M[0][2]; - rmat.m9 = ovrmat.M[1][2]; - rmat.m10 = ovrmat.M[2][2]; - rmat.m11 = ovrmat.M[3][2]; - rmat.m12 = ovrmat.M[0][3]; - rmat.m13 = ovrmat.M[1][3]; - rmat.m14 = ovrmat.M[2][3]; - rmat.m15 = ovrmat.M[3][3]; - - MatrixTranspose(&rmat); - - return rmat; -} - -// Load Oculus required buffers: texture-swap-chain, fbo, texture-depth -static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) -{ - OculusBuffer buffer; - buffer.width = width; - buffer.height = height; - - // Create OVR texture chain - ovrTextureSwapChainDesc desc = {}; - desc.Type = ovrTexture_2D; - desc.ArraySize = 1; - desc.Width = width; - desc.Height = height; - desc.MipLevels = 1; - desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; // Requires glEnable(GL_FRAMEBUFFER_SRGB); - desc.SampleCount = 1; - desc.StaticImage = ovrFalse; - - ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); - - if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); - - int textureCount = 0; - ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); - - if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); - - for (int i = 0; i < textureCount; ++i) - { - GLuint chainTexId; - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, i, &chainTexId); - glBindTexture(GL_TEXTURE_2D, chainTexId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - - glBindTexture(GL_TEXTURE_2D, 0); - - /* - // Setup framebuffer object (using depth texture) - glGenFramebuffers(1, &buffer.fboId); - glGenTextures(1, &buffer.depthId); - glBindTexture(GL_TEXTURE_2D, buffer.depthId); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); - */ - - // Setup framebuffer object (using depth renderbuffer) - glGenFramebuffers(1, &buffer.fboId); - glGenRenderbuffers(1, &buffer.depthId); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glBindRenderbuffer(GL_RENDERBUFFER, buffer.depthId); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, buffer.width, buffer.height); - glBindRenderbuffer(GL_RENDERBUFFER, 0); - glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, buffer.depthId); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - return buffer; -} - -// Unload texture required buffers -static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer) -{ - if (buffer.textureChain) - { - ovr_DestroyTextureSwapChain(session, buffer.textureChain); - buffer.textureChain = NULL; - } - - if (buffer.depthId != 0) glDeleteTextures(1, &buffer.depthId); - if (buffer.fboId != 0) glDeleteFramebuffers(1, &buffer.fboId); -} - -// Set current Oculus buffer -static void SetOculusBuffer(ovrSession session, OculusBuffer buffer) -{ - GLuint currentTexId; - int currentIndex; - - ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); - //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded - - //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) - //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Required if OculusBuffer format is OVR_FORMAT_R8G8B8A8_UNORM_SRGB - glEnable(GL_FRAMEBUFFER_SRGB); -} - -// Unset Oculus buffer -static void UnsetOculusBuffer(OculusBuffer buffer) -{ - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); -} - -// Load Oculus mirror buffers -static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) -{ - OculusMirror mirror; - mirror.width = width; - mirror.height = height; - - ovrMirrorTextureDesc mirrorDesc; - memset(&mirrorDesc, 0, sizeof(mirrorDesc)); - mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; - mirrorDesc.Width = mirror.width; - mirrorDesc.Height = mirror.height; - - if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); - - glGenFramebuffers(1, &mirror.fboId); - - return mirror; -} - -// Unload Oculus mirror buffers -static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) -{ - if (mirror.fboId != 0) glDeleteFramebuffers(1, &mirror.fboId); - if (mirror.texture) ovr_DestroyMirrorTexture(session, mirror.texture); -} - -static void BlitOculusMirror(ovrSession session, OculusMirror mirror) -{ - GLuint mirrorTextureId; - - ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); - - glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); - glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); - glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); - glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); -} - -// Requires: session, hmdDesc -static OculusLayer InitOculusLayer(ovrSession session) -{ - OculusLayer layer = { 0 }; - - layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; - - memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); - layer.eyeLayer.Header.Type = ovrLayerType_EyeFov; - layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; - - ovrEyeRenderDesc eyeRenderDescs[2]; - - for (int eye = 0; eye < 2; eye++) - { - eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); - ovrMatrix4f ovrPerspectiveProjection = ovrMatrix4f_Projection(eyeRenderDescs[eye].Fov, 0.01f, 10000.0f, ovrProjection_None); //ovrProjection_ClipRangeOpenGL); - layer.eyeProjections[eye] = FromOvrMatrix(ovrPerspectiveProjection); // NOTE: struct ovrMatrix4f { float M[4][4] } --> struct Matrix - - layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; - layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; - - ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); - layer.eyeLayer.Viewport[eye].Size = eyeSize; - layer.eyeLayer.Viewport[eye].Pos.x = layer.width; - layer.eyeLayer.Viewport[eye].Pos.y = 0; - - layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); - layer.width += eyeSize.w; - } - - return layer; -} -#endif - // Plays raylib logo appearing animation static void LogoAnimation(void) { diff --git a/src/raylib.h b/src/raylib.h index 9120ddc4..0c9f0280 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -64,7 +64,7 @@ //#define PLATFORM_ANDROID // Android device //#define PLATFORM_RPI // Raspberry Pi //#define PLATFORM_WEB // HTML5 (emscripten, asm.js) -//#define PLATFORM_OCULUS // Oculus Rift CV1 +//#define RLGL_OCULUS_SUPPORT // Oculus Rift CV1 (complementary to PLATFORM_DESKTOP) // Security check in case no PLATFORM_* defined #if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB) @@ -545,12 +545,6 @@ void InitWindow(int width, int height, struct android_app *state); // Init Andr void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics #endif -#if defined(PLATFORM_OCULUS) -void InitOculusDevice(void); // Init Oculus Rift device -void CloseOculusDevice(void); // Close Oculus Rift device -void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -#endif - void CloseWindow(void); // Close Window and Terminate Context bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) @@ -852,6 +846,17 @@ void EndBlendMode(void); // End blend Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool void DestroyLight(Light light); // Destroy a light and take it out of the list +//------------------------------------------------------------------------------------ +// Oculus Rift CV1 Functions (Module: rlgl) +// NOTE: This functions are useless when using OpenGL 1.1 +//------------------------------------------------------------------------------------ +void InitOculusDevice(void); // Init Oculus Rift device +void CloseOculusDevice(void); // Close Oculus Rift device +void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) +void SetOculusMatrix(int eye); // Set internal projection and modelview matrix depending on eyes tracking data +void BeginOculusDrawing(void); // Begin Oculus drawing configuration +void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) + //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ diff --git a/src/rlgl.c b/src/rlgl.c index 26961ca9..1e392889 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -72,6 +72,10 @@ #include "standard_shader.h" // Standard shader to embed #endif +#if defined(RLGL_OCULUS_SUPPORT) + #include "external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -172,6 +176,32 @@ typedef struct { //Guint fboId; } DrawCall; +#if defined(RLGL_OCULUS_SUPPORT) +typedef struct OculusBuffer { + ovrTextureSwapChain textureChain; + GLuint depthId; + GLuint fboId; + int width; + int height; +} OculusBuffer; + +typedef struct OculusMirror { + ovrMirrorTexture texture; + GLuint fboId; + int width; + int height; +} OculusMirror; + +typedef struct OculusLayer { + ovrViewScaleDesc viewScaleDesc; + ovrLayerEyeFov eyeLayer; // layer 0 + //ovrLayerQuad quadLayer; // TODO: layer 1: '2D' quad for GUI + Matrix eyeProjections[2]; + int width; + int height; +} OculusLayer; +#endif + //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- @@ -221,6 +251,17 @@ static Light lights[MAX_LIGHTS]; // Lights pool static int lightsCount; // Counts current enabled physic objects #endif +#if defined(RLGL_OCULUS_SUPPORT) +// OVR device variables +static ovrSession session; // Oculus session (pointer to ovrHmdStruct) +static ovrHmdDesc hmdDesc; // Oculus device descriptor parameters +static ovrGraphicsLuid luid; // Oculus locally unique identifier for the program (64 bit) +static OculusLayer layer; // Oculus drawing layer (similar to photoshop) +static OculusBuffer buffer; // Oculus internal buffers (texture chain and fbo) +static OculusMirror mirror; // Oculus mirror texture and fbo +static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain +#endif + // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support static bool npotSupported = false; // NPOT textures full support @@ -261,6 +302,16 @@ static void SetShaderLights(Shader shader); // Sets shader uniform values for li static char *ReadTextFile(const char *fileName); #endif +#if defined(RLGL_OCULUS_SUPPORT) // Oculus Rift functions +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror); // Unload Oculus mirror buffers +static void BlitOculusMirror(ovrSession session, OculusMirror mirror); // Copy Oculus screen buffer to mirror texture +static OculusLayer InitOculusLayer(ovrSession session); // Init Oculus layer (similar to photoshop) +static Matrix FromOvrMatrix(ovrMatrix4f ovrM); // Convert from Oculus ovrMatrix4f struct to raymath Matrix struct +#endif + #if defined(GRAPHICS_API_OPENGL_11) static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight); static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); @@ -872,23 +923,6 @@ int rlGetVersion(void) #endif } -// Load OpenGL extensions -// NOTE: External loader function could be passed as a pointer -void rlglLoadExtensions(void *loader) -{ -#if defined(GRAPHICS_API_OPENGL_33) - // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions - if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); - else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); - - if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); - else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); - - // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans - //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object -#endif -} - //---------------------------------------------------------------------------------- // Module Functions Definition - rlgl Functions //---------------------------------------------------------------------------------- @@ -1170,6 +1204,23 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) TraceLog(INFO, "OpenGL graphic device initialized successfully"); } +// Load OpenGL extensions +// NOTE: External loader function could be passed as a pointer +void rlglLoadExtensions(void *loader) +{ +#if defined(GRAPHICS_API_OPENGL_33) + // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions + if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); + else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); + + if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); + else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); + + // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans + //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object +#endif +} + // Get world coordinates from screen coordinates Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view) { @@ -2410,6 +2461,130 @@ void DestroyLight(Light light) #endif } +#if defined(RLGL_OCULUS_SUPPORT) +// Init Oculus Rift device +// NOTE: Device initialization should be done before window creation? +void InitOculusDevice(void) +{ + // Initialize Oculus device + ovrResult result = ovr_Initialize(NULL); + if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); + + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + } + + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... + // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) + + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); + + // Recenter OVR tracking origin + ovr_RecenterTrackingOrigin(session); +} + +// Close Oculus Rift device +void CloseOculusDevice(void) +{ + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers + + ovr_Destroy(session); // Free Oculus session data + ovr_Shutdown(); // Close Oculus device connection +} + +// Update Oculus Rift tracking (position and orientation) +void UpdateOculusTracking(void) +{ + frameIndex++; + + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; +} + +void SetOculusMatrix(int eye) +{ + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + + Quaternion eyeRPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); + Matrix modelEyeView = MatrixMultiply(modelview, eyeView); // Using internal camera modelview matrix + + SetMatrixModelview(modelEyeView); + SetMatrixProjection(layer.eyeProjections[eye]); +} + +void BeginOculusDrawing(void) +{ + GLuint currentTexId; + int currentIndex; + + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); + + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); + //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded + + //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) + //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Same as rlClearScreenBuffers() + + // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) + // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: + // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB + // - Do NOT enable GL_FRAMEBUFFER_SRGB + //glEnable(GL_FRAMEBUFFER_SRGB); +} + +void EndOculusDrawing(void) +{ + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + ovr_CommitTextureSwapChain(session, buffer.textureChain); + + ovrLayerHeader *layers = &layer.eyeLayer.Header; + ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); + + // Blit mirror texture to back buffer + BlitOculusMirror(session, mirror); + + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); +} +#endif + //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- @@ -3390,6 +3565,187 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) } #endif +#if defined(RLGL_OCULUS_SUPPORT) +// Load Oculus required buffers: texture-swap-chain, fbo, texture-depth +static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) +{ + OculusBuffer buffer; + buffer.width = width; + buffer.height = height; + + // Create OVR texture chain + ovrTextureSwapChainDesc desc = {}; + desc.Type = ovrTexture_2D; + desc.ArraySize = 1; + desc.Width = width; + desc.Height = height; + desc.MipLevels = 1; + desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; // Requires glEnable(GL_FRAMEBUFFER_SRGB); + desc.SampleCount = 1; + desc.StaticImage = ovrFalse; + + ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); + + if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); + + int textureCount = 0; + ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); + + if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); + + for (int i = 0; i < textureCount; ++i) + { + GLuint chainTexId; + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, i, &chainTexId); + glBindTexture(GL_TEXTURE_2D, chainTexId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + + glBindTexture(GL_TEXTURE_2D, 0); + + /* + // Setup framebuffer object (using depth texture) + glGenFramebuffers(1, &buffer.fboId); + glGenTextures(1, &buffer.depthId); + glBindTexture(GL_TEXTURE_2D, buffer.depthId); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + */ + + // Setup framebuffer object (using depth renderbuffer) + glGenFramebuffers(1, &buffer.fboId); + glGenRenderbuffers(1, &buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glBindRenderbuffer(GL_RENDERBUFFER, buffer.depthId); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, buffer.width, buffer.height); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, buffer.depthId); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + return buffer; +} + +// Unload texture required buffers +static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer) +{ + if (buffer.textureChain) + { + ovr_DestroyTextureSwapChain(session, buffer.textureChain); + buffer.textureChain = NULL; + } + + if (buffer.depthId != 0) glDeleteTextures(1, &buffer.depthId); + if (buffer.fboId != 0) glDeleteFramebuffers(1, &buffer.fboId); +} + +// Load Oculus mirror buffers +static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) +{ + OculusMirror mirror; + mirror.width = width; + mirror.height = height; + + ovrMirrorTextureDesc mirrorDesc; + memset(&mirrorDesc, 0, sizeof(mirrorDesc)); + mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; + mirrorDesc.Width = mirror.width; + mirrorDesc.Height = mirror.height; + + if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); + + glGenFramebuffers(1, &mirror.fboId); + + return mirror; +} + +// Unload Oculus mirror buffers +static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) +{ + if (mirror.fboId != 0) glDeleteFramebuffers(1, &mirror.fboId); + if (mirror.texture) ovr_DestroyMirrorTexture(session, mirror.texture); +} + +// Copy Oculus screen buffer to mirror texture +static void BlitOculusMirror(ovrSession session, OculusMirror mirror) +{ + GLuint mirrorTextureId; + + ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); + glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); + glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); +} + +// Init Oculus layer (similar to photoshop) +static OculusLayer InitOculusLayer(ovrSession session) +{ + OculusLayer layer = { 0 }; + + layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; + + memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); + layer.eyeLayer.Header.Type = ovrLayerType_EyeFov; + layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; + + ovrEyeRenderDesc eyeRenderDescs[2]; + + for (int eye = 0; eye < 2; eye++) + { + eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); + ovrMatrix4f ovrPerspectiveProjection = ovrMatrix4f_Projection(eyeRenderDescs[eye].Fov, 0.01f, 10000.0f, ovrProjection_None); //ovrProjection_ClipRangeOpenGL); + layer.eyeProjections[eye] = FromOvrMatrix(ovrPerspectiveProjection); // NOTE: struct ovrMatrix4f { float M[4][4] } --> struct Matrix + + layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; + layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; + + ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); + layer.eyeLayer.Viewport[eye].Size = eyeSize; + layer.eyeLayer.Viewport[eye].Pos.x = layer.width; + layer.eyeLayer.Viewport[eye].Pos.y = 0; + + layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); + layer.width += eyeSize.w; + } + + return layer; +} + +// Convert from Oculus ovrMatrix4f struct to raymath Matrix struct +static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) +{ + Matrix rmat; + + rmat.m0 = ovrmat.M[0][0]; + rmat.m1 = ovrmat.M[1][0]; + rmat.m2 = ovrmat.M[2][0]; + rmat.m3 = ovrmat.M[3][0]; + rmat.m4 = ovrmat.M[0][1]; + rmat.m5 = ovrmat.M[1][1]; + rmat.m6 = ovrmat.M[2][1]; + rmat.m7 = ovrmat.M[3][1]; + rmat.m8 = ovrmat.M[0][2]; + rmat.m9 = ovrmat.M[1][2]; + rmat.m10 = ovrmat.M[2][2]; + rmat.m11 = ovrmat.M[3][2]; + rmat.m12 = ovrmat.M[0][3]; + rmat.m13 = ovrmat.M[1][3]; + rmat.m14 = ovrmat.M[2][3]; + rmat.m15 = ovrmat.M[3][3]; + + MatrixTranspose(&rmat); + + return rmat; +} +#endif + #if defined(RLGL_STANDALONE) // Output a trace log message // NOTE: Expected msgType: (0)Info, (1)Error, (2)Warning diff --git a/src/rlgl.h b/src/rlgl.h index 28c50b8f..1e77b771 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -347,6 +347,15 @@ void DestroyLight(Light light); // Destroy a void TraceLog(int msgType, const char *text, ...); #endif +#if defined(RLGL_OCULUS_SUPPORT) +void InitOculusDevice(void); // Init Oculus Rift device +void CloseOculusDevice(void); // Close Oculus Rift device +void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) +void SetOculusMatrix(int eye); // Set internal projection and modelview matrix depending on eyes tracking data +void BeginOculusDrawing(void); // Begin Oculus drawing configuration +void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.3 From d60dc7c2ebf151481e1148a9a6361b9687c48418 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 17:34:51 +0200 Subject: Added Oculus Rift library dll --- src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll | Bin 0 -> 964048 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll new file mode 100644 index 00000000..70f63f70 Binary files /dev/null and b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll differ -- cgit v1.2.3 From c91401060662e2e6f828fdbeb41838ad085b436c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 14 Jun 2016 18:37:28 +0200 Subject: Correct issue on Oculus drawing --- src/rlgl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 1e392889..5d6fd9d7 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2562,6 +2562,8 @@ void BeginOculusDrawing(void) // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB // - Do NOT enable GL_FRAMEBUFFER_SRGB //glEnable(GL_FRAMEBUFFER_SRGB); + + rlClearScreenBuffers(); // Clear current framebuffer(s) } void EndOculusDrawing(void) -- cgit v1.2.3 From 54537e8f0b57df2f3f15d8e46309672f46e4775a Mon Sep 17 00:00:00 2001 From: victorfisac Date: Tue, 14 Jun 2016 20:23:46 +0200 Subject: Fixed bug in delta time calculation... and added PHYSAC_NO_THREADS define. Improved physac example drawing frames per second in screen. --- src/physac.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index ea8801c3..5ce3970e 100644 --- a/src/physac.h +++ b/src/physac.h @@ -178,8 +178,10 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); #include // Required for: cos(), sin(), abs(), fminf() #include // Required for typedef unsigned long long int uint64_t, used by hi-res timer -#include // Required for: pthread_create() -#include "utils.h" // Required for: TraceLog() + +#ifndef PHYSAC_NO_THREADS + #include // Required for: pthread_create() +#endif #if defined(PLATFORM_DESKTOP) // Functions required to query time on Windows @@ -234,9 +236,11 @@ PHYSACDEF void InitPhysics(Vector2 gravity) physicBodiesCount = 0; gravityForce = gravity; - // Create physics thread - pthread_t tid; - pthread_create(&tid, NULL, &PhysicsThread, NULL); + #ifndef PHYSAC_NO_THREADS // NOTE: if defined, user will need to create a thread for PhysicsThread function manually + // Create physics thread + pthread_t tid; + pthread_create(&tid, NULL, &PhysicsThread, NULL); + #endif } // Update physic objects, calculating physic behaviours and collisions detection @@ -768,7 +772,6 @@ static void InitTimer(void) { baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; } - else TraceLog(WARNING, "No hi-resolution timer available"); #endif previousTime = GetCurrentTime(); // Get time as double @@ -777,22 +780,25 @@ static void InitTimer(void) // Time measure returned are microseconds static double GetCurrentTime(void) { + double time; + #if defined(PLATFORM_DESKTOP) unsigned long long int clockFrequency, currentTime; QueryPerformanceFrequency(&clockFrequency); QueryPerformanceCounter(¤tTime); - - return (double)(currentTime/clockFrequency); + #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - uint64_t time = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; + uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; - return (double)(time - baseTime)*1e-9; + time = (double)(temp - baseTime)*1e-9; #endif + + return time; } // Returns the dot product of two Vector2 -- cgit v1.2.3 From 5a1cbb2842f6801f7a86086e87f4821fd0b09229 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Tue, 14 Jun 2016 20:25:08 +0200 Subject: Fix current time value --- src/physac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index 5ce3970e..4f9b736f 100644 --- a/src/physac.h +++ b/src/physac.h @@ -788,6 +788,7 @@ static double GetCurrentTime(void) QueryPerformanceFrequency(&clockFrequency); QueryPerformanceCounter(¤tTime); + time = (double)((double)currentTime/(double)clockFrequency); #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) -- cgit v1.2.3 From 1a8fbe5cf0b982cf74434f1ba4654fced71a0450 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Tue, 14 Jun 2016 20:31:48 +0200 Subject: Add pthread external library to source... and add instructions in physac examples to run it successful. --- src/external/pthread/pthreadGC2.dll | Bin 0 -> 119888 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/external/pthread/pthreadGC2.dll (limited to 'src') diff --git a/src/external/pthread/pthreadGC2.dll b/src/external/pthread/pthreadGC2.dll new file mode 100644 index 00000000..67b9289d Binary files /dev/null and b/src/external/pthread/pthreadGC2.dll differ -- cgit v1.2.3 From 4e84ded7ef3b165081e08a83d95bf54387a413ca Mon Sep 17 00:00:00 2001 From: victorfisac Date: Tue, 14 Jun 2016 20:38:49 +0200 Subject: Fixed spacing and set UpdatePhysics() function as static... and remove static from PhysicsThread(). --- src/physac.h | 418 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 209 insertions(+), 209 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index 4f9b736f..b8cc8f15 100644 --- a/src/physac.h +++ b/src/physac.h @@ -146,7 +146,7 @@ typedef struct PhysicBodyData { // Module Functions Declaration //---------------------------------------------------------------------------------- PHYSACDEF void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) -PHYSACDEF void UpdatePhysics(double deltaTime); // Update physic objects, calculating physic behaviours and collisions detection +PHYSACDEF void* PhysicsThread(void *arg); // Physics calculations thread function PHYSACDEF void ClosePhysics(); // Unitialize all physic objects and empty the objects pool PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale); // Create a new physic body dinamically, initialize it and add to pool @@ -219,7 +219,7 @@ static Vector2 gravityForce; // Gravity f //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static void* PhysicsThread(void *arg); // Physics calculations thread function +static void UpdatePhysics(double deltaTime); // Update physic objects, calculating physic behaviours and collisions detection static void InitTimer(void); // Initialize hi-resolution timer static double GetCurrentTime(void); // Time measure returned are microseconds static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 @@ -243,8 +243,214 @@ PHYSACDEF void InitPhysics(Vector2 gravity) #endif } +// Unitialize all physic objects and empty the objects pool +PHYSACDEF void ClosePhysics() +{ + // Exit physics thread loop + physicsThreadEnabled = false; + + // Free all dynamic memory allocations + for (int i = 0; i < physicBodiesCount; i++) PHYSAC_FREE(physicBodies[i]); + + // Reset enabled physic objects count + physicBodiesCount = 0; +} + +// Create a new physic body dinamically, initialize it and add to pool +PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale) +{ + // Allocate dynamic memory + PhysicBody obj = (PhysicBody)PHYSAC_MALLOC(sizeof(PhysicBodyData)); + + // Initialize physic body values with generic values + obj->id = physicBodiesCount; + obj->enabled = true; + + obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; + + obj->rigidbody.enabled = false; + obj->rigidbody.mass = 1.0f; + obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; + obj->rigidbody.applyGravity = false; + obj->rigidbody.isGrounded = false; + obj->rigidbody.friction = 0.0f; + obj->rigidbody.bounciness = 0.0f; + + obj->collider.enabled = true; + obj->collider.type = COLLIDER_RECTANGLE; + obj->collider.bounds = TransformToRectangle(obj->transform); + obj->collider.radius = 0.0f; + + // Add new physic body to the pointers array + physicBodies[physicBodiesCount] = obj; + + // Increase enabled physic bodies count + physicBodiesCount++; + + return obj; +} + +// Destroy a specific physic body and take it out of the list +PHYSACDEF void DestroyPhysicBody(PhysicBody pbody) +{ + // Free dynamic memory allocation + PHYSAC_FREE(physicBodies[pbody->id]); + + // Remove *obj from the pointers array + for (int i = pbody->id; i < physicBodiesCount; i++) + { + // Resort all the following pointers of the array + if ((i + 1) < physicBodiesCount) + { + physicBodies[i] = physicBodies[i + 1]; + physicBodies[i]->id = physicBodies[i + 1]->id; + } + else PHYSAC_FREE(physicBodies[i]); + } + + // Decrease enabled physic bodies count + physicBodiesCount--; +} + +// Apply directional force to a physic body +PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force) +{ + if (pbody->rigidbody.enabled) + { + pbody->rigidbody.velocity.x += force.x/pbody->rigidbody.mass; + pbody->rigidbody.velocity.y += force.y/pbody->rigidbody.mass; + } +} + +// Apply radial force to all physic objects in range +PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius) +{ + for (int i = 0; i < physicBodiesCount; i++) + { + if (physicBodies[i]->rigidbody.enabled) + { + // Calculate direction and distance between force and physic body position + Vector2 distance = (Vector2){ physicBodies[i]->transform.position.x - position.x, physicBodies[i]->transform.position.y - position.y }; + + if (physicBodies[i]->collider.type == COLLIDER_RECTANGLE) + { + distance.x += physicBodies[i]->transform.scale.x/2; + distance.y += physicBodies[i]->transform.scale.y/2; + } + + float distanceLength = Vector2Length(distance); + + // Check if physic body is in force range + if (distanceLength <= radius) + { + // Normalize force direction + distance.x /= distanceLength; + distance.y /= -distanceLength; + + // Calculate final force + Vector2 finalForce = { distance.x*force, distance.y*force }; + + // Apply force to the physic body + ApplyForce(physicBodies[i], finalForce); + } + } + } +} + +// Convert Transform data type to Rectangle (position and scale) +PHYSACDEF Rectangle TransformToRectangle(Transform transform) +{ + return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; +} + +// Physics calculations thread function +PHYSACDEF void* PhysicsThread(void *arg) +{ + // Initialize thread loop state + physicsThreadEnabled = true; + + // Initialize hi-resolution timer + InitTimer(); + + // Physics update loop + while (physicsThreadEnabled) + { + currentTime = GetCurrentTime(); + double deltaTime = (double)(currentTime - previousTime); + previousTime = currentTime; + + // Delta time value needs to be inverse multiplied by physics time step value (1/target fps) + UpdatePhysics(deltaTime/PHYSICS_TIMESTEP); + } + + return NULL; +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- +// Initialize hi-resolution timer +static void InitTimer(void) +{ +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec now; + + if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success + { + baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + } +#endif + + previousTime = GetCurrentTime(); // Get time as double +} + +// Time measure returned are microseconds +static double GetCurrentTime(void) +{ + double time; + +#if defined(PLATFORM_DESKTOP) + unsigned long long int clockFrequency, currentTime; + + QueryPerformanceFrequency(&clockFrequency); + QueryPerformanceCounter(¤tTime); + + time = (double)((double)currentTime/(double)clockFrequency); +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; + + time = (double)(temp - baseTime)*1e-9; +#endif + + return time; +} + +// Returns the dot product of two Vector2 +static float Vector2DotProduct(Vector2 v1, Vector2 v2) +{ + float result; + + result = v1.x*v2.x + v1.y*v2.y; + + return result; +} + +static float Vector2Length(Vector2 v) +{ + float result; + + result = sqrt(v.x*v.x + v.y*v.y); + + return result; +} + // Update physic objects, calculating physic behaviours and collisions detection -PHYSACDEF void UpdatePhysics(double deltaTime) +static void UpdatePhysics(double deltaTime) { for (int i = 0; i < physicBodiesCount; i++) { @@ -615,210 +821,4 @@ PHYSACDEF void UpdatePhysics(double deltaTime) } } -// Unitialize all physic objects and empty the objects pool -PHYSACDEF void ClosePhysics() -{ - // Exit physics thread loop - physicsThreadEnabled = false; - - // Free all dynamic memory allocations - for (int i = 0; i < physicBodiesCount; i++) PHYSAC_FREE(physicBodies[i]); - - // Reset enabled physic objects count - physicBodiesCount = 0; -} - -// Create a new physic body dinamically, initialize it and add to pool -PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale) -{ - // Allocate dynamic memory - PhysicBody obj = (PhysicBody)PHYSAC_MALLOC(sizeof(PhysicBodyData)); - - // Initialize physic body values with generic values - obj->id = physicBodiesCount; - obj->enabled = true; - - obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; - - obj->rigidbody.enabled = false; - obj->rigidbody.mass = 1.0f; - obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.applyGravity = false; - obj->rigidbody.isGrounded = false; - obj->rigidbody.friction = 0.0f; - obj->rigidbody.bounciness = 0.0f; - - obj->collider.enabled = true; - obj->collider.type = COLLIDER_RECTANGLE; - obj->collider.bounds = TransformToRectangle(obj->transform); - obj->collider.radius = 0.0f; - - // Add new physic body to the pointers array - physicBodies[physicBodiesCount] = obj; - - // Increase enabled physic bodies count - physicBodiesCount++; - - return obj; -} - -// Destroy a specific physic body and take it out of the list -PHYSACDEF void DestroyPhysicBody(PhysicBody pbody) -{ - // Free dynamic memory allocation - PHYSAC_FREE(physicBodies[pbody->id]); - - // Remove *obj from the pointers array - for (int i = pbody->id; i < physicBodiesCount; i++) - { - // Resort all the following pointers of the array - if ((i + 1) < physicBodiesCount) - { - physicBodies[i] = physicBodies[i + 1]; - physicBodies[i]->id = physicBodies[i + 1]->id; - } - else PHYSAC_FREE(physicBodies[i]); - } - - // Decrease enabled physic bodies count - physicBodiesCount--; -} - -// Apply directional force to a physic body -PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force) -{ - if (pbody->rigidbody.enabled) - { - pbody->rigidbody.velocity.x += force.x/pbody->rigidbody.mass; - pbody->rigidbody.velocity.y += force.y/pbody->rigidbody.mass; - } -} - -// Apply radial force to all physic objects in range -PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius) -{ - for (int i = 0; i < physicBodiesCount; i++) - { - if (physicBodies[i]->rigidbody.enabled) - { - // Calculate direction and distance between force and physic body position - Vector2 distance = (Vector2){ physicBodies[i]->transform.position.x - position.x, physicBodies[i]->transform.position.y - position.y }; - - if (physicBodies[i]->collider.type == COLLIDER_RECTANGLE) - { - distance.x += physicBodies[i]->transform.scale.x/2; - distance.y += physicBodies[i]->transform.scale.y/2; - } - - float distanceLength = Vector2Length(distance); - - // Check if physic body is in force range - if (distanceLength <= radius) - { - // Normalize force direction - distance.x /= distanceLength; - distance.y /= -distanceLength; - - // Calculate final force - Vector2 finalForce = { distance.x*force, distance.y*force }; - - // Apply force to the physic body - ApplyForce(physicBodies[i], finalForce); - } - } - } -} - -// Convert Transform data type to Rectangle (position and scale) -PHYSACDEF Rectangle TransformToRectangle(Transform transform) -{ - return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- -// Physics calculations thread function -static void* PhysicsThread(void *arg) -{ - // Initialize thread loop state - physicsThreadEnabled = true; - - // Initialize hi-resolution timer - InitTimer(); - - // Physics update loop - while (physicsThreadEnabled) - { - currentTime = GetCurrentTime(); - double deltaTime = (double)(currentTime - previousTime); - previousTime = currentTime; - - // Delta time value needs to be inverse multiplied by physics time step value (1/target fps) - UpdatePhysics(deltaTime/PHYSICS_TIMESTEP); - } - - return NULL; -} - -// Initialize hi-resolution timer -static void InitTimer(void) -{ -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec now; - - if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success - { - baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; - } -#endif - - previousTime = GetCurrentTime(); // Get time as double -} - -// Time measure returned are microseconds -static double GetCurrentTime(void) -{ - double time; - -#if defined(PLATFORM_DESKTOP) - unsigned long long int clockFrequency, currentTime; - - QueryPerformanceFrequency(&clockFrequency); - QueryPerformanceCounter(¤tTime); - - time = (double)((double)currentTime/(double)clockFrequency); -#endif - -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; - - time = (double)(temp - baseTime)*1e-9; -#endif - - return time; -} - -// Returns the dot product of two Vector2 -static float Vector2DotProduct(Vector2 v1, Vector2 v2) -{ - float result; - - result = v1.x*v2.x + v1.y*v2.y; - - return result; -} - -static float Vector2Length(Vector2 v) -{ - float result; - - result = sqrt(v.x*v.x + v.y*v.y); - - return result; -} - #endif // PHYSAC_IMPLEMENTATION \ No newline at end of file -- cgit v1.2.3 From 1b0996fb0bcf68e2a14bc6260c6f2c5366ab033f Mon Sep 17 00:00:00 2001 From: victorfisac Date: Tue, 14 Jun 2016 20:54:20 +0200 Subject: Updated physac header documentation --- src/physac.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index b8cc8f15..dd4c4126 100644 --- a/src/physac.h +++ b/src/physac.h @@ -15,6 +15,10 @@ * The generated implementation will stay private inside implementation file and all * internal symbols and functions will only be visible inside that file. * +* #define PHYSAC_NO_THREADS +* The generated implementation won't include pthread library and user must create a secondary thread to call PhysicsThread(). +* It is so important that the thread where PhysicsThread() is called must not have v-sync or any other CPU limitation. +* * #define PHYSAC_STANDALONE * Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined * internally in the library and input management and drawing functions must be provided by @@ -27,12 +31,16 @@ * * LIMITATIONS: * -* // TODO. +* - There is a limit of 256 physic objects. +* - Physics behaviour can be unexpected using bounciness or friction values out of 0.0f - 1.0f range. +* - The module is limited to 2D axis oriented physics. +* - Physics colliders must be rectangle or circle shapes (there is not a custom polygon collider type). * * VERSIONS: * -* 1.0 (09-Jun-2016) Module names review and converted to header-only. -* 0.9 (23-Mar-2016) Complete module redesign, steps-based for better physics resolution. +* 1.0 (14-Jun-2016) New module defines and fixed some delta time calculation bugs. +* 0.9 (09-Jun-2016) Module names review and converted to header-only. +* 0.8 (23-Mar-2016) Complete module redesign, steps-based for better physics resolution. * 0.3 (13-Feb-2016) Reviewed to add PhysicObjects pool. * 0.2 (03-Jan-2016) Improved physics calculations. * 0.1 (30-Dec-2015) Initial release. -- cgit v1.2.3 From 3468af213f88cd367eac43826ad49f9e9fc730f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 15 Jun 2016 00:54:55 +0200 Subject: Reviewing Oculus rendering... --- src/rlgl.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 5d6fd9d7..fec03926 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2519,26 +2519,39 @@ void UpdateOculusTracking(void) layer.eyeLayer.RenderPose[0] = eyePoses[0]; layer.eyeLayer.RenderPose[1] = eyePoses[1]; + + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); + //if (sessionStatus.HmdPresent) // HMD is present. + //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. + //if (sessionStatus.HmdMounted) // HMD is on the user's head. + //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. } void SetOculusMatrix(int eye) { rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - Quaternion eyeRPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRPose); + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, -layer.eyeLayer.RenderPose[eye].Position.y, -layer.eyeLayer.RenderPose[eye].Position.z); - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); - Matrix modelEyeView = MatrixMultiply(modelview, eyeView); // Using internal camera modelview matrix + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + Matrix eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - SetMatrixModelview(modelEyeView); + // TODO: Find a better way to get camera view matrix (instead of using internal modelview) + + SetMatrixModelview(eyeModelView); SetMatrixProjection(layer.eyeProjections[eye]); } @@ -2554,20 +2567,19 @@ void BeginOculusDrawing(void) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded - //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) - //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Same as rlClearScreenBuffers() - // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB // - Do NOT enable GL_FRAMEBUFFER_SRGB //glEnable(GL_FRAMEBUFFER_SRGB); + //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) rlClearScreenBuffers(); // Clear current framebuffer(s) } void EndOculusDrawing(void) { + // Unbind current framebuffer (Oculus buffer) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); @@ -2578,12 +2590,6 @@ void EndOculusDrawing(void) // Blit mirror texture to back buffer BlitOculusMirror(session, mirror); - - // Get session status information - ovrSessionStatus sessionStatus; - ovr_GetSessionStatus(session, &sessionStatus); - if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); - if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); } #endif -- cgit v1.2.3 From 4df7a0f2f8cf5c4dde236bd99d05d83c7b472db5 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 16 Jun 2016 20:25:50 +0200 Subject: Added support for OpenGL 2.1 --- src/Makefile | 1 + src/core.c | 21 +++++++----- src/rlgl.c | 105 ++++++++++++++++++++++++++++++++++------------------------- src/rlgl.h | 12 +++++-- 4 files changed, 84 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index ce703c3a..33b666b4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -51,6 +51,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI) else # define raylib graphics api to use (OpenGL 1.1 by default) GRAPHICS ?= GRAPHICS_API_OPENGL_11 + #GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1 #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 endif ifeq ($(PLATFORM),PLATFORM_WEB) diff --git a/src/core.c b/src/core.c index fb71af21..7c2dbcb9 100644 --- a/src/core.c +++ b/src/core.c @@ -1480,16 +1480,21 @@ static void InitDisplay(int width, int height) // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // with forward compatibility to older OpenGL versions. // For example, if using OpenGL 1.1, driver can provide a 3.3 context fordward compatible. - - // Check selection OpenGL version (not initialized yet!) - if (rlGetVersion() == OPENGL_33) + + if (configFlags & FLAG_MSAA_4X_HINT) { - if (configFlags & FLAG_MSAA_4X_HINT) - { - glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 - TraceLog(INFO, "Trying to enable MSAA x4"); - } + glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 + TraceLog(INFO, "Trying to enable MSAA x4"); + } + // Check selection OpenGL version + if (rlGetVersion() == OPENGL_21) + { + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); // Choose OpenGL major version (just hint) + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); // Choose OpenGL minor version (just hint) + } + else if (rlGetVersion() == OPENGL_33) + { glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // Choose OpenGL major version (just hint) glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); // Choose OpenGL minor version (just hint) glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! diff --git a/src/rlgl.c b/src/rlgl.c index fec03926..99ef4a4f 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -44,6 +44,10 @@ #endif #endif +#if defined(GRAPHICS_API_OPENGL_21) + #define GRAPHICS_API_OPENGL_33 +#endif + #if defined(GRAPHICS_API_OPENGL_33) #ifdef __APPLE__ #include // OpenGL 3 library for OSX @@ -916,6 +920,8 @@ int rlGetVersion(void) { #if defined(GRAPHICS_API_OPENGL_11) return OPENGL_11; +#elif defined(GRAPHICS_API_OPENGL_21) + return OPENGL_21; #elif defined(GRAPHICS_API_OPENGL_33) return OPENGL_33; #elif defined(GRAPHICS_API_OPENGL_ES2) @@ -1213,7 +1219,8 @@ void rlglLoadExtensions(void *loader) if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); - if (GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); + if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); + else if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans @@ -2752,55 +2759,65 @@ static Shader LoadDefaultShader(void) Shader shader; // Vertex shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char vShaderStr[] = "#version 330 \n" - "in vec3 vertexPosition; \n" - "in vec2 vertexTexCoord; \n" - "in vec4 vertexColor; \n" - "out vec2 fragTexCoord; \n" - "out vec4 fragColor; \n" + char vDefaultShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) + "#version 120 \n" #elif defined(GRAPHICS_API_OPENGL_ES2) - char vShaderStr[] = "#version 100 \n" - "attribute vec3 vertexPosition; \n" - "attribute vec2 vertexTexCoord; \n" - "attribute vec4 vertexColor; \n" - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#endif - "uniform mat4 mvpMatrix; \n" - "void main() \n" - "{ \n" - " fragTexCoord = vertexTexCoord; \n" - " fragColor = vertexColor; \n" - " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" - "} \n"; + "#version 100 \n" +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) + "attribute vec3 vertexPosition; \n" + "attribute vec2 vertexTexCoord; \n" + "attribute vec4 vertexColor; \n" + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) + "#version 330 \n" + "in vec3 vertexPosition; \n" + "in vec2 vertexTexCoord; \n" + "in vec4 vertexColor; \n" + "out vec2 fragTexCoord; \n" + "out vec4 fragColor; \n" +#endif + "uniform mat4 mvpMatrix; \n" + "void main() \n" + "{ \n" + " fragTexCoord = vertexTexCoord; \n" + " fragColor = vertexColor; \n" + " gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" + "} \n"; // Fragment shader directly defined, no external file required -#if defined(GRAPHICS_API_OPENGL_33) - char fShaderStr[] = "#version 330 \n" - "in vec2 fragTexCoord; \n" - "in vec4 fragColor; \n" - "out vec4 finalColor; \n" + char fDefaultShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) + "#version 120 \n" #elif defined(GRAPHICS_API_OPENGL_ES2) - char fShaderStr[] = "#version 100 \n" - "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) - "varying vec2 fragTexCoord; \n" - "varying vec4 fragColor; \n" -#endif - "uniform sampler2D texture0; \n" - "uniform vec4 colDiffuse; \n" - "void main() \n" - "{ \n" -#if defined(GRAPHICS_API_OPENGL_33) - " vec4 texelColor = texture(texture0, fragTexCoord); \n" - " finalColor = texelColor*colDiffuse*fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) - " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 - " gl_FragColor = texelColor*colDiffuse*fragColor; \n" + "#version 100 \n" + "precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) + "varying vec2 fragTexCoord; \n" + "varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) + "#version 330 \n" + "in vec2 fragTexCoord; \n" + "in vec4 fragColor; \n" + "out vec4 finalColor; \n" +#endif + "uniform sampler2D texture0; \n" + "uniform vec4 colDiffuse; \n" + "void main() \n" + "{ \n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) + " vec4 texelColor = texture2D(texture0, fragTexCoord); \n" // NOTE: texture2D() is deprecated on OpenGL 3.3 and ES 3.0 + " gl_FragColor = texelColor*colDiffuse*fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) + " vec4 texelColor = texture(texture0, fragTexCoord); \n" + " finalColor = texelColor*colDiffuse*fragColor; \n" #endif - "} \n"; + "} \n"; - shader.id = LoadShaderProgram(vShaderStr, fShaderStr); + shader.id = LoadShaderProgram(vDefaultShaderStr, fDefaultShaderStr); if (shader.id != 0) TraceLog(INFO, "[SHDR ID %i] Default shader loaded successfully", shader.id); else TraceLog(WARNING, "[SHDR ID %i] Default shader could not be loaded", shader.id); diff --git a/src/rlgl.h b/src/rlgl.h index 1e77b771..3322d80c 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -52,21 +52,27 @@ //#define GRAPHICS_API_OPENGL_ES2 // Only available on PLATFORM_ANDROID or PLATFORM_RPI or PLATFORM_WEB // Security check in case no GRAPHICS_API_OPENGL_* defined -#if !defined(GRAPHICS_API_OPENGL_11) && !defined(GRAPHICS_API_OPENGL_33) && !defined(GRAPHICS_API_OPENGL_ES2) +#if !defined(GRAPHICS_API_OPENGL_11) && !defined(GRAPHICS_API_OPENGL_21) && !defined(GRAPHICS_API_OPENGL_33) && !defined(GRAPHICS_API_OPENGL_ES2) #define GRAPHICS_API_OPENGL_11 #endif // Security check in case multiple GRAPHICS_API_OPENGL_* defined #if defined(GRAPHICS_API_OPENGL_11) + #if defined(GRAPHICS_API_OPENGL_21) + #undef GRAPHICS_API_OPENGL_21 + #endif #if defined(GRAPHICS_API_OPENGL_33) #undef GRAPHICS_API_OPENGL_33 #endif - #if defined(GRAPHICS_API_OPENGL_ES2) #undef GRAPHICS_API_OPENGL_ES2 #endif #endif +#if defined(GRAPHICS_API_OPENGL_21) + #define GRAPHICS_API_OPENGL_33 +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -90,7 +96,7 @@ typedef enum { RL_PROJECTION, RL_MODELVIEW, RL_TEXTURE } MatrixMode; typedef enum { RL_LINES, RL_TRIANGLES, RL_QUADS } DrawMode; -typedef enum { OPENGL_11 = 1, OPENGL_33, OPENGL_ES_20 } GlVersion; +typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; #if defined(RLGL_STANDALONE) #ifndef __cplusplus -- cgit v1.2.3 From 9fdf4420d5354c32394246703015a686df8135ce Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 17 Jun 2016 00:29:46 +0200 Subject: Corrected bugs on OpenGL 2.1 --- src/rlgl.c | 13 +++++++++---- src/shapes.c | 6 +++--- src/standard_shader.h | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 99ef4a4f..6d003869 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1214,14 +1214,17 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) // NOTE: External loader function could be passed as a pointer void rlglLoadExtensions(void *loader) { -#if defined(GRAPHICS_API_OPENGL_33) - // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions +#if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33) + // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); - + +#if defined(GRAPHICS_API_OPENGL_21) if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); - else if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); +#elif defined(GRAPHICS_API_OPENGL_33) + if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); +#endif // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans //if (GLAD_GL_ARB_vertex_array_object) // Use GL_ARB_vertex_array_object @@ -2597,6 +2600,8 @@ void EndOculusDrawing(void) // Blit mirror texture to back buffer BlitOculusMirror(session, mirror); + + rlDisableDepthTest(); } #endif diff --git a/src/shapes.c b/src/shapes.c index 3ccfd660..2a4e19c2 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -135,7 +135,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) } rlEnd(); } - else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + else if ((rlGetVersion() == OPENGL_21) || (rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { rlEnableTexture(GetDefaultTexture().id); // Default white texture @@ -218,7 +218,7 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color) rlVertex2i(position.x + size.x, position.y); rlEnd(); } - else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + else if ((rlGetVersion() == OPENGL_21) || (rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { rlEnableTexture(GetDefaultTexture().id); // Default white texture @@ -264,7 +264,7 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) rlVertex2i(posX + 1, posY + 1); rlEnd(); } - else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + else if ((rlGetVersion() == OPENGL_21) || (rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) { DrawRectangle(posX, posY, width, 1, color); DrawRectangle(posX + width - 1, posY + 1, 1, height - 2, color); diff --git a/src/standard_shader.h b/src/standard_shader.h index a4bc9694..e1668ae7 100644 --- a/src/standard_shader.h +++ b/src/standard_shader.h @@ -166,9 +166,9 @@ static const char fStandardShaderStr[] = " else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);\n" " }\n" " }\n" -#if defined(GRAPHICS_API_OPENGL_33) -" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) " gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" +#elif defined(GRAPHICS_API_OPENGL_33) +" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" #endif "}\n"; -- cgit v1.2.3 From 24c9b1f717bd9a6510667907614928188a6b6a6f Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 17 Jun 2016 13:54:45 +0200 Subject: Improving Oculus Rift example... Under design... looking for the easiest and most comprehensive way for the user to use VR... --- src/core.c | 10 ++++++++++ src/raylib.h | 3 ++- src/rlgl.c | 10 +++++----- src/rlgl.h | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 7c2dbcb9..eef81bad 100644 --- a/src/core.c +++ b/src/core.c @@ -606,6 +606,8 @@ void Begin3dMode(Camera camera) rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D + + //if (vrEnabled) BeginVrMode(); } // Ends 3D mode and returns to default 2D orthographic mode @@ -1015,6 +1017,14 @@ Matrix GetCameraMatrix(Camera camera) return MatrixLookAt(camera.position, camera.target, camera.up); } +// Update and draw default buffers vertex data +// NOTE: This data has been stored dynamically during frame on each Draw*() call +void DrawDefaultBuffers(void) +{ + rlglUpdateDefaultBuffers(); // Upload frame vertex data to GPU + rlglDrawDefaultBuffers(); // Draw vertex data into framebuffer +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Input (Keyboard, Mouse, Gamepad) Functions //---------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index 0c9f0280..ed787892 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -572,6 +572,7 @@ void EndTextureMode(void); // Ends drawing to r Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) +void DrawDefaultBuffers(void); // Update and draw default buffers vertex data (stored dynamically in frame) void SetTargetFPS(int fps); // Set target FPS (maximum) float GetFPS(void); // Returns current FPS @@ -853,7 +854,7 @@ void DestroyLight(Light light); // Destroy a void InitOculusDevice(void); // Init Oculus Rift device void CloseOculusDevice(void); // Close Oculus Rift device void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void SetOculusMatrix(int eye); // Set internal projection and modelview matrix depending on eyes tracking data +void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) diff --git a/src/rlgl.c b/src/rlgl.c index 6d003869..d68b9109 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -297,8 +297,8 @@ static void UnloadDefaultShader(void); // Unload default shader static void UnloadStandardShader(void); // Unload standard shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) -static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data -static void DrawDefaultBuffers(void); // Draw default internal buffers vertex data +void rlglUpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data +void rlglDrawDefaultBuffers(void); // Draw default internal buffers vertex data static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array @@ -2542,7 +2542,7 @@ void UpdateOculusTracking(void) //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. } -void SetOculusMatrix(int eye) +void SetOculusView(int eye) { rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); @@ -3089,7 +3089,7 @@ static void LoadDefaultBuffers(void) // Update default internal buffers (VAOs/VBOs) with vertex array data // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) -static void UpdateDefaultBuffers(void) +void rlglUpdateDefaultBuffers(void) { // Update lines vertex buffers if (lines.vCounter > 0) @@ -3159,7 +3159,7 @@ static void UpdateDefaultBuffers(void) // Draw default internal buffers vertex data // NOTE: We draw in this order: lines, triangles, quads -static void DrawDefaultBuffers(void) +void rlglDrawDefaultBuffers(void) { // Set current shader and upload current MVP matrix if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) diff --git a/src/rlgl.h b/src/rlgl.h index 3322d80c..8904b9ac 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -357,7 +357,7 @@ void TraceLog(int msgType, const char *text, ...); void InitOculusDevice(void); // Init Oculus Rift device void CloseOculusDevice(void); // Close Oculus Rift device void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void SetOculusMatrix(int eye); // Set internal projection and modelview matrix depending on eyes tracking data +void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) #endif -- cgit v1.2.3 From b01f5ff6a7e0d7a91057da618a688000eec6365d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 19 Jun 2016 19:12:47 +0200 Subject: Starting work on VR simulator support If Oculus device is not available or not initialized correctly, simulated VR view is generated using stereo-rendering and distortion --- src/rlgl.c | 145 ++++++++++++++++++++++++++++++++++++++++++++++--------------- src/rlgl.h | 7 +-- 2 files changed, 113 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index d68b9109..2d4d951c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -76,6 +76,7 @@ #include "standard_shader.h" // Standard shader to embed #endif +#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code #if defined(RLGL_OCULUS_SUPPORT) #include "external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL #endif @@ -266,6 +267,8 @@ static OculusMirror mirror; // Oculus mirror texture and fbo static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif +static bool vrSimulator = false; // VR simulator (stereo rendering on window, without vr device) + // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support static bool npotSupported = false; // NPOT textures full support @@ -306,7 +309,7 @@ static void SetShaderLights(Shader shader); // Sets shader uniform values for li static char *ReadTextFile(const char *fileName); #endif -#if defined(RLGL_OCULUS_SUPPORT) // Oculus Rift functions +#if defined(RLGL_OCULUS_SUPPORT) static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers @@ -1158,8 +1161,8 @@ void rlglDraw(void) } */ // NOTE: Default buffers always drawn at the end - UpdateDefaultBuffers(); - DrawDefaultBuffers(); + rlglUpdateDefaultBuffers(); + rlglDrawDefaultBuffers(); #endif } @@ -2471,57 +2474,86 @@ void DestroyLight(Light light) #endif } -#if defined(RLGL_OCULUS_SUPPORT) -// Init Oculus Rift device -// NOTE: Device initialization should be done before window creation? +// Init Oculus Rift device (or Oculus device simulator) void InitOculusDevice(void) { +#if defined(RLGL_OCULUS_SUPPORT) // Initialize Oculus device ovrResult result = ovr_Initialize(NULL); - if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - - result = ovr_Create(&session, &luid); if (OVR_FAILURE(result)) { - TraceLog(WARNING, "OVR: Could not create Oculus session"); - ovr_Shutdown(); + TraceLog(WARNING, "OVR: Could not initialize Oculus device"); + TraceLog(INFO, "VR: Initializing Oculus simulator"); + vrSimulator = true; } + else + { + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + + TraceLog(INFO, "VR: Initializing Oculus simulator"); + vrSimulator = true; + } + else + { + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... + // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) + + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); + + // Recenter OVR tracking origin + ovr_RecenterTrackingOrigin(session); + } + } +#else + vrSimulator = true; +#endif - hmdDesc = ovr_GetHmdDesc(session); - - TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); - TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); - TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); - TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); - TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - - // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... - // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) - - // Initialize Oculus Buffers - layer = InitOculusLayer(session); - buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... - layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); - - // Recenter OVR tracking origin - ovr_RecenterTrackingOrigin(session); + if (vrSimulator) + { + // TODO: Initialize framebuffer and textures for stereo rendering + // TODO: Load oculus-distortion shader (oculus parameters setup internally) + } } -// Close Oculus Rift device +// Close Oculus Rift device (or Oculus device simulator) void CloseOculusDevice(void) { +#if defined(RLGL_OCULUS_SUPPORT) UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers ovr_Destroy(session); // Free Oculus session data ovr_Shutdown(); // Close Oculus device connection +#endif + + if (vrSimulator) + { + // TODO: Unload stereo framebuffer and texture + // TODO: Unload oculus-distortion shader + } } // Update Oculus Rift tracking (position and orientation) void UpdateOculusTracking(void) { +#if defined(RLGL_OCULUS_SUPPORT) frameIndex++; ovrPosef eyePoses[2]; @@ -2540,10 +2572,21 @@ void UpdateOculusTracking(void) //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. //if (sessionStatus.HmdMounted) // HMD is on the user's head. //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. +#endif + + if (vrSimulator) + { + // TODO: Use alternative inputs (mouse, keyboard) to simulate tracking data (eyes position/orientation) + } } +// Set internal projection and modelview matrix depending on eyes tracking data void SetOculusView(int eye) { + Matrix eyeProjection; + Matrix eyeModelView; + +#if defined(RLGL_OCULUS_SUPPORT) rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, @@ -2557,16 +2600,26 @@ void SetOculusView(int eye) -layer.eyeLayer.RenderPose[eye].Position.z); Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - Matrix eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement // TODO: Find a better way to get camera view matrix (instead of using internal modelview) + eyeProjection = layer.eyeProjections[eye]; +#endif + + if (vrSimulator) + { + // TODO: Setup viewport and projection/modelview matrices using tracking data + } + SetMatrixModelview(eyeModelView); - SetMatrixProjection(layer.eyeProjections[eye]); + SetMatrixProjection(eyeProjection); } +// Begin Oculus drawing configuration void BeginOculusDrawing(void) { +#if defined(RLGL_OCULUS_SUPPORT) GLuint currentTexId; int currentIndex; @@ -2576,6 +2629,13 @@ void BeginOculusDrawing(void) glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded +#endif + + if (vrSimulator) + { + // TODO: Setup framebuffer for stereo rendering + //rlEnableRenderTexture(buffer.fboId); + } // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: @@ -2587,8 +2647,10 @@ void BeginOculusDrawing(void) rlClearScreenBuffers(); // Clear current framebuffer(s) } +// End Oculus drawing process (and desktop mirror) void EndOculusDrawing(void) { +#if defined(RLGL_OCULUS_SUPPORT) // Unbind current framebuffer (Oculus buffer) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); @@ -2600,10 +2662,21 @@ void EndOculusDrawing(void) // Blit mirror texture to back buffer BlitOculusMirror(session, mirror); - +#endif + + if (vrSimulator) + { + // Unbind current framebuffer + //rlDisableRenderTexture(); + + // TODO: Draw RenderTexture (fbo) using distortion shader + //BeginShaderMode(distortion); + // TODO: DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); + //EndShaderMode(); + } + rlDisableDepthTest(); } -#endif //---------------------------------------------------------------------------------- // Module specific Functions Definition diff --git a/src/rlgl.h b/src/rlgl.h index 8904b9ac..e2e1dde6 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -48,7 +48,7 @@ // Choose opengl version here or just define it at compile time: -DGRAPHICS_API_OPENGL_33 //#define GRAPHICS_API_OPENGL_11 // Only available on PLATFORM_DESKTOP -//#define GRAPHICS_API_OPENGL_33 // Only available on PLATFORM_DESKTOP or PLATFORM_OCULUS +//#define GRAPHICS_API_OPENGL_33 // Only available on PLATFORM_DESKTOP and RLGL_OCULUS_SUPPORT //#define GRAPHICS_API_OPENGL_ES2 // Only available on PLATFORM_ANDROID or PLATFORM_RPI or PLATFORM_WEB // Security check in case no GRAPHICS_API_OPENGL_* defined @@ -304,6 +304,9 @@ void rlglDraw(void); // Draw VAO/VBO void rlglInitGraphics(int offsetX, int offsetY, int width, int height); // Initialize Graphics (OpenGL stuff) void rlglLoadExtensions(void *loader); // Load OpenGL extensions +void rlglUpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data +void rlglDrawDefaultBuffers(void); // Draw default internal buffers vertex data + unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data @@ -353,14 +356,12 @@ void DestroyLight(Light light); // Destroy a void TraceLog(int msgType, const char *text, ...); #endif -#if defined(RLGL_OCULUS_SUPPORT) void InitOculusDevice(void); // Init Oculus Rift device void CloseOculusDevice(void); // Close Oculus Rift device void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) -#endif #ifdef __cplusplus } -- cgit v1.2.3 From 6062201e8f543c227a0adbb77f3a0941772be889 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 Jun 2016 08:59:29 +0200 Subject: Simplify Oculus example... ...to align it with standard raylib code. Final goal would be having the same code work for every platform with no changes... --- src/core.c | 5 +++-- src/rlgl.c | 12 +++++++++++- src/rlgl.h | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index eef81bad..af82e092 100644 --- a/src/core.c +++ b/src/core.c @@ -607,13 +607,14 @@ void Begin3dMode(Camera camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D - //if (vrEnabled) BeginVrMode(); + if (VrEnabled()) BeginOculusDrawing(); } // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void) { - rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + if (VrEnabled()) EndOculusDrawing(); + else rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack diff --git a/src/rlgl.c b/src/rlgl.c index 2d4d951c..eee19ef4 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -76,7 +76,7 @@ #include "standard_shader.h" // Standard shader to embed #endif -#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code +//#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code #if defined(RLGL_OCULUS_SUPPORT) #include "external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL #endif @@ -268,6 +268,7 @@ static unsigned int frameIndex = 0; // Oculus frames counter, used to discar #endif static bool vrSimulator = false; // VR simulator (stereo rendering on window, without vr device) +static bool vrEnabled = false; // VR enabled flag (required by core module) // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support @@ -2523,6 +2524,7 @@ void InitOculusDevice(void) } #else vrSimulator = true; + vrEnabled = true; #endif if (vrSimulator) @@ -2548,6 +2550,14 @@ void CloseOculusDevice(void) // TODO: Unload stereo framebuffer and texture // TODO: Unload oculus-distortion shader } + + vrEnabled = false; +} + +// Track stereoscopic rendering +bool VrEnabled(void) +{ + return vrEnabled; } // Update Oculus Rift tracking (position and orientation) diff --git a/src/rlgl.h b/src/rlgl.h index e2e1dde6..c0e93a65 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -362,6 +362,7 @@ void UpdateOculusTracking(void); // Update Oculus Rift tracking (posi void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) +bool VrEnabled(void); // Track stereoscopic rendering #ifdef __cplusplus } -- cgit v1.2.3 From afe033412b4d8bffc9235a49dc8049eb74af59f3 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 21 Jun 2016 13:45:13 +0200 Subject: Code tweak --- src/textures.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 518348f4..f5523a3e 100644 --- a/src/textures.c +++ b/src/textures.c @@ -422,12 +422,7 @@ void UnloadTexture(Texture2D texture) // Unload render texture from GPU memory void UnloadRenderTexture(RenderTexture2D target) { - if (target.id != 0) - { - rlDeleteRenderTextures(target); - - TraceLog(INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); - } + if (target.id != 0) rlDeleteRenderTextures(target); } // Get pixel data from image in the form of Color struct array -- cgit v1.2.3 From 03d9583b945dcf17d6a93ed97deeb9f9721284b5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 21 Jun 2016 13:49:13 +0200 Subject: Add oculus simulator (in case device is not detected) --- src/core.c | 7 +- src/rlgl.c | 263 ++++++++++++++++++++++++++++++++++++++++--------------------- src/rlgl.h | 2 +- 3 files changed, 178 insertions(+), 94 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index af82e092..1073ae6a 100644 --- a/src/core.c +++ b/src/core.c @@ -607,14 +607,15 @@ void Begin3dMode(Camera camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D - if (VrEnabled()) BeginOculusDrawing(); + if (IsOculusReady()) BeginOculusDrawing(); } // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void) { - if (VrEnabled()) EndOculusDrawing(); - else rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + if (IsOculusReady()) EndOculusDrawing(); + + rlglDraw(); // Process internal buffers (update + draw) rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack diff --git a/src/rlgl.c b/src/rlgl.c index eee19ef4..f1d49df9 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -267,8 +267,11 @@ static OculusMirror mirror; // Oculus mirror texture and fbo static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif -static bool vrSimulator = false; // VR simulator (stereo rendering on window, without vr device) -static bool vrEnabled = false; // VR enabled flag (required by core module) +static bool oculusEnabled = false; // Oculus device enabled flag (required by core module) +static bool oculusSimulator = false; // Oculus device simulator + +static RenderTexture2D stereoFbo; +static Shader distortion; // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support @@ -865,6 +868,8 @@ void rlDeleteRenderTextures(RenderTexture2D target) if (target.id != 0) glDeleteFramebuffers(1, &target.id); if (target.texture.id != 0) glDeleteTextures(1, &target.texture.id); if (target.depth.id != 0) glDeleteTextures(1, &target.depth.id); + + TraceLog(INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); #endif } @@ -2484,8 +2489,7 @@ void InitOculusDevice(void) if (OVR_FAILURE(result)) { TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - TraceLog(INFO, "VR: Initializing Oculus simulator"); - vrSimulator = true; + oculusEnabled = false; } else { @@ -2494,9 +2498,7 @@ void InitOculusDevice(void) { TraceLog(WARNING, "OVR: Could not create Oculus session"); ovr_Shutdown(); - - TraceLog(INFO, "VR: Initializing Oculus simulator"); - vrSimulator = true; + oculusEnabled = false; } else { @@ -2520,17 +2522,29 @@ void InitOculusDevice(void) // Recenter OVR tracking origin ovr_RecenterTrackingOrigin(session); + + oculusEnabled = true; } } #else - vrSimulator = true; - vrEnabled = true; + oculusEnabled = false; #endif - if (vrSimulator) + if (!oculusEnabled) { - // TODO: Initialize framebuffer and textures for stereo rendering - // TODO: Load oculus-distortion shader (oculus parameters setup internally) + TraceLog(INFO, "VR: Initializing Oculus simulator"); + + int screenWidth = 1080; + int screenHeight = 600; + + // Initialize framebuffer and textures for stereo rendering + stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); + + // Load oculus-distortion shader (oculus parameters setup internally) + // TODO: Embed coulus distortion shader (in this function like default shader?) + distortion = LoadShader("resources/shaders/base.vs", "resources/shaders/distortion.fs"); + + oculusSimulator = true; } } @@ -2538,53 +2552,60 @@ void InitOculusDevice(void) void CloseOculusDevice(void) { #if defined(RLGL_OCULUS_SUPPORT) - UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer - UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers + if (oculusEnabled) + { + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers - ovr_Destroy(session); // Free Oculus session data - ovr_Shutdown(); // Close Oculus device connection + ovr_Destroy(session); // Free Oculus session data + ovr_Shutdown(); // Close Oculus device connection + } + else #endif - - if (vrSimulator) { - // TODO: Unload stereo framebuffer and texture - // TODO: Unload oculus-distortion shader + // Unload stereo framebuffer and texture + rlDeleteRenderTextures(stereoFbo); + + // Unload oculus-distortion shader + UnloadShader(distortion); } - vrEnabled = false; + oculusEnabled = false; } -// Track stereoscopic rendering -bool VrEnabled(void) +// Detect if oculus device is available +bool IsOculusReady(void) { - return vrEnabled; + return (oculusEnabled || oculusSimulator); } // Update Oculus Rift tracking (position and orientation) void UpdateOculusTracking(void) { #if defined(RLGL_OCULUS_SUPPORT) - frameIndex++; + if (oculusEnabled) + { + frameIndex++; - ovrPosef eyePoses[2]; - ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - - layer.eyeLayer.RenderPose[0] = eyePoses[0]; - layer.eyeLayer.RenderPose[1] = eyePoses[1]; - - // Get session status information - ovrSessionStatus sessionStatus; - ovr_GetSessionStatus(session, &sessionStatus); - - if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); - if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); - //if (sessionStatus.HmdPresent) // HMD is present. - //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. - //if (sessionStatus.HmdMounted) // HMD is on the user's head. - //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; + + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); + //if (sessionStatus.HmdPresent) // HMD is present. + //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. + //if (sessionStatus.HmdMounted) // HMD is on the user's head. + //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. + } + else #endif - - if (vrSimulator) { // TODO: Use alternative inputs (mouse, keyboard) to simulate tracking data (eyes position/orientation) } @@ -2597,29 +2618,44 @@ void SetOculusView(int eye) Matrix eyeModelView; #if defined(RLGL_OCULUS_SUPPORT) - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + if (oculusEnabled) + { + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRenderPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - // TODO: Find a better way to get camera view matrix (instead of using internal modelview) - - eyeProjection = layer.eyeProjections[eye]; + // TODO: Find a better way to get camera view matrix (instead of using internal modelview) + + eyeProjection = layer.eyeProjections[eye]; + } + else #endif - - if (vrSimulator) { - // TODO: Setup viewport and projection/modelview matrices using tracking data + int screenWidth = 1080; + int screenHeight = 600; + float fovy = 45.0f; + + // Setup viewport and projection/modelview matrices using tracking data + rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + + eyeProjection = MatrixPerspective(fovy, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); + MatrixTranspose(&eyeProjection); + + // TODO: Compute eyes IPD and apply to current modelview matrix (camera) + Matrix eyeView = MatrixIdentity(); + + eyeModelView = MatrixMultiply(modelview, eyeView); } SetMatrixModelview(eyeModelView); @@ -2630,21 +2666,23 @@ void SetOculusView(int eye) void BeginOculusDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - GLuint currentTexId; - int currentIndex; - - ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); + if (oculusEnabled) + { + GLuint currentTexId; + int currentIndex; + + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); - //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); + //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded + } + else #endif - - if (vrSimulator) { - // TODO: Setup framebuffer for stereo rendering - //rlEnableRenderTexture(buffer.fboId); + // Setup framebuffer for stereo rendering + rlEnableRenderTexture(stereoFbo.id); } // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) @@ -2661,28 +2699,73 @@ void BeginOculusDrawing(void) void EndOculusDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - // Unbind current framebuffer (Oculus buffer) - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - ovr_CommitTextureSwapChain(session, buffer.textureChain); - - ovrLayerHeader *layers = &layer.eyeLayer.Header; - ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); + if (oculusEnabled) + { + // Unbind current framebuffer (Oculus buffer) + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + ovr_CommitTextureSwapChain(session, buffer.textureChain); + + ovrLayerHeader *layers = &layer.eyeLayer.Header; + ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); - // Blit mirror texture to back buffer - BlitOculusMirror(session, mirror); + // Blit mirror texture to back buffer + BlitOculusMirror(session, mirror); + } + else #endif - - if (vrSimulator) { // Unbind current framebuffer - //rlDisableRenderTexture(); + rlDisableRenderTexture(); + + rlClearScreenBuffers(); // Clear current framebuffer - // TODO: Draw RenderTexture (fbo) using distortion shader - //BeginShaderMode(distortion); - // TODO: DrawTextureRec(target.texture, (Rectangle){ 0, 0, target.texture.width, -target.texture.height }, (Vector2){ 0, 0 }, WHITE); - //EndShaderMode(); + int screenWidth = 1080; + int screenHeight = 600; + + // Set viewport to default framebuffer size (screen size) + rlViewport(0, 0, screenWidth, screenHeight); + + // Let rlgl reconfigure internal matrices + rlMatrixMode(RL_PROJECTION); // Enable internal projection matrix + rlLoadIdentity(); // Reset internal projection matrix + rlOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0); // Recalculate internal projection matrix + rlMatrixMode(RL_MODELVIEW); // Enable internal modelview matrix + rlLoadIdentity(); // Reset internal modelview matrix + + // Draw RenderTexture (stereoFbo) using distortion shader + BeginShaderMode(distortion); + + rlEnableTexture(stereoFbo.texture.id); + + rlPushMatrix(); + rlBegin(RL_QUADS); + rlColor4ub(255, 255, 255, 255); + rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer + + // Bottom-left corner for texture and quad + rlTexCoord2f(0.0f, 1.0f); + rlVertex2f(0.0f, 0.0f); + + // Bottom-right corner for texture and quad + rlTexCoord2f(0.0f, 0.0f); + rlVertex2f(0.0f, stereoFbo.texture.height); + + // Top-right corner for texture and quad + rlTexCoord2f(1.0f, 0.0f); + rlVertex2f(stereoFbo.texture.width, stereoFbo.texture.height); + + // Top-left corner for texture and quad + rlTexCoord2f(1.0f, 1.0f); + rlVertex2f(stereoFbo.texture.width, 0.0f); + rlEnd(); + rlPopMatrix(); + + rlDisableTexture(); + + //rlglDraw(); + EndShaderMode(); } rlDisableDepthTest(); diff --git a/src/rlgl.h b/src/rlgl.h index c0e93a65..2bd7a6b4 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -362,7 +362,7 @@ void UpdateOculusTracking(void); // Update Oculus Rift tracking (posi void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) -bool VrEnabled(void); // Track stereoscopic rendering +bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready #ifdef __cplusplus } -- cgit v1.2.3 From a522b6e23b8ef5cb5ffc006320c300f7c7bf191c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 24 Jun 2016 19:34:47 +0200 Subject: Corrected issue with unclosed threads --- src/core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 1073ae6a..bc195219 100644 --- a/src/core.c +++ b/src/core.c @@ -444,7 +444,15 @@ void CloseWindow(void) eglTerminate(display); display = EGL_NO_DISPLAY; - } + } +#endif + +#if defined(PLATFORM_RPI) + // Wait for mouse and gamepad threads to finish before closing + // NOTE: Those threads should already have finished at this point + // because they are controlled by windowShouldClose variable + pthread_join(mouseThreadId, NULL); + pthread_join(gamepadThreadId, NULL); #endif TraceLog(INFO, "Window closed successfully"); @@ -1766,12 +1774,12 @@ static void InitGraphics(void) ClearBackground(RAYWHITE); // Default background color for raylib games :P #if defined(PLATFORM_ANDROID) - windowReady = true; // IMPORTANT! + windowReady = true; // IMPORTANT! #endif } // Compute framebuffer size relative to screen size and display size -// NOTE: Global variables renderWidth/renderHeight can be modified +// NOTE: Global variables renderWidth/renderHeight and renderOffsetX/renderOffsetY can be modified static void SetupFramebufferSize(int displayWidth, int displayHeight) { // TODO: SetupFramebufferSize() does not consider properly display video modes. @@ -2662,7 +2670,7 @@ static void *MouseThread(void *arg) int mouseRelX = 0; int mouseRelY = 0; - while(1) + while (1) { if (read(mouseStream, &mouse, sizeof(MouseEvent)) == (int)sizeof(MouseEvent)) { @@ -2752,7 +2760,7 @@ static void *GamepadThread(void *arg) // Read gamepad event struct js_event gamepadEvent; - while (1) + while (!windowShouldClose) { for (int i = 0; i < MAX_GAMEPADS; i++) { @@ -2787,7 +2795,7 @@ static void *GamepadThread(void *arg) return NULL; } -#endif +#endif // PLATFORM_RPI // Plays raylib logo appearing animation static void LogoAnimation(void) -- cgit v1.2.3 From b358402cb39d2b06a69be28e64b086a0f44b42f1 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 24 Jun 2016 19:37:52 +0200 Subject: Some code tweaks (view description) - Added support for RLGL_NO_STANDARD_SHADER - Store framebuffer width and height as globals - Reorganize rlglInit() function --- src/rlgl.c | 69 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index f1d49df9..6e8cccc3 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -72,7 +72,7 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() [Used only on TraceLog()] #endif -#if !defined(GRAPHICS_API_OPENGL_11) +#if !defined(GRAPHICS_API_OPENGL_11) && !defined(RLGL_NO_STANDARD_SHADER) #include "standard_shader.h" // Standard shader to embed #endif @@ -240,7 +240,7 @@ static bool useTempBuffer = false; static Shader defaultShader; static Shader standardShader; // Lazy initialization when GetStandardShader() static Shader currentShader; // By default, defaultShader -static bool standardShaderLoaded = false; +static bool standardShaderLoaded = false; // Flag to track if standard shader has been loaded // Flags for supported extensions static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) @@ -285,11 +285,16 @@ static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; //static PFNGLISVERTEXARRAYOESPROC glIsVertexArray; // NOTE: Fails in WebGL, omitted #endif -static int blendMode = 0; +static int blendMode = 0; // Track current blending mode // White texture useful for plain color polys (required by shader) static unsigned int whiteTexture; +// Default framebuffer size +// NOTE: Updated when calling rlglInitGraphics() +static int screenWidth; // Default framebuffer width +static int screenHeight; // Default framebuffer height + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -1089,18 +1094,7 @@ void rlglInit(void) // Initialize buffers, default shaders and default textures //---------------------------------------------------------- - // Set default draw mode - currentDrawMode = RL_TRIANGLES; - - // Reset projection and modelview matrices - projection = MatrixIdentity(); - modelview = MatrixIdentity(); - currentMatrix = &modelview; - - // Initialize matrix stack - for (int i = 0; i < MATRIX_STACK_SIZE; i++) stack[i] = MatrixIdentity(); - - // Create default white texture for plain colors (required by shader) + // Init default white texture unsigned char pixels[4] = { 255, 255, 255, 255 }; // 1 pixel RGBA (4 bytes) whiteTexture = rlglLoadTexture(pixels, 1, 1, UNCOMPRESSED_R8G8B8A8, 1); @@ -1112,7 +1106,8 @@ void rlglInit(void) defaultShader = LoadDefaultShader(); currentShader = defaultShader; - LoadDefaultBuffers(); // Initialize default vertex arrays buffers (lines, triangles, quads) + // Init default vertex arrays buffers (lines, triangles, quads) + LoadDefaultBuffers(); // Init temp vertex buffer, used when transformation required (translate, rotate, scale) tempBuffer = (Vector3 *)malloc(sizeof(Vector3)*TEMP_VERTEX_BUFFER_SIZE); @@ -1130,6 +1125,15 @@ void rlglInit(void) drawsCounter = 1; draws[drawsCounter - 1].textureId = whiteTexture; + currentDrawMode = RL_TRIANGLES; // Set default draw mode + + // Init internal matrix stack (emulating OpenGL 1.1) + for (int i = 0; i < MATRIX_STACK_SIZE; i++) stack[i] = MatrixIdentity(); + + // Init internal projection and modelview matrices + projection = MatrixIdentity(); + modelview = MatrixIdentity(); + currentMatrix = &modelview; #endif } @@ -1175,7 +1179,11 @@ void rlglDraw(void) // Initialize Graphics Device (OpenGL stuff) // NOTE: Stores global variables screenWidth and screenHeight void rlglInitGraphics(int offsetX, int offsetY, int width, int height) -{ +{ + // Store default framebuffer size + screenWidth = width; + screenHeight = height; + // NOTE: Required! viewport must be recalculated if screen resized! glViewport(offsetX/2, offsetY/2, width - offsetX, height - offsetY); // Set viewport width and height @@ -2312,7 +2320,7 @@ Shader GetDefaultShader(void) Shader GetStandardShader(void) { Shader shader = { 0 }; - + #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (standardShaderLoaded) shader = standardShader; else @@ -2333,7 +2341,7 @@ int GetShaderLocation(Shader shader, const char *uniformName) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) location = glGetUniformLocation(shader.id, uniformName); - if (location == -1) TraceLog(WARNING, "[SHDR ID %i] Shader location for %s could not be found", shader.id, uniformName); + if (location == -1) TraceLog(DEBUG, "[SHDR ID %i] Shader location for %s could not be found", shader.id, uniformName); #endif return location; } @@ -2532,10 +2540,7 @@ void InitOculusDevice(void) if (!oculusEnabled) { - TraceLog(INFO, "VR: Initializing Oculus simulator"); - - int screenWidth = 1080; - int screenHeight = 600; + TraceLog(WARNING, "VR: Initializing Oculus simulator"); // Initialize framebuffer and textures for stereo rendering stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); @@ -2642,14 +2647,11 @@ void SetOculusView(int eye) else #endif { - int screenWidth = 1080; - int screenHeight = 600; - float fovy = 45.0f; - // Setup viewport and projection/modelview matrices using tracking data rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - eyeProjection = MatrixPerspective(fovy, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); + // NOTE: fovy vaule hardcoded to 45.0 degrees + eyeProjection = MatrixPerspective(45.0, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); MatrixTranspose(&eyeProjection); // TODO: Compute eyes IPD and apply to current modelview matrix (camera) @@ -2721,9 +2723,6 @@ void EndOculusDrawing(void) rlClearScreenBuffers(); // Clear current framebuffer - int screenWidth = 1080; - int screenHeight = 600; - // Set viewport to default framebuffer size (screen size) rlViewport(0, 0, screenWidth, screenHeight); @@ -3007,6 +3006,7 @@ static Shader LoadStandardShader(void) { Shader shader; +#if !defined(RLGL_NO_STANDARD_SHADER) // Load standard shader (embeded in standard_shader.h) shader.id = LoadShaderProgram(vStandardShaderStr, fStandardShaderStr); @@ -3022,6 +3022,10 @@ static Shader LoadStandardShader(void) TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded, using default shader", shader.id); shader = GetDefaultShader(); } +#else + shader = defaultShader; + TraceLog(WARNING, "[SHDR ID %i] Standard shader not available, using default shader", shader.id); +#endif return shader; } @@ -3072,12 +3076,13 @@ static void UnloadDefaultShader(void) static void UnloadStandardShader(void) { glUseProgram(0); - +#if !defined(RLGL_NO_STANDARD_SHADER) //glDetachShader(defaultShader, vertexShader); //glDetachShader(defaultShader, fragmentShader); //glDeleteShader(vertexShader); // Already deleted on shader compilation //glDeleteShader(fragmentShader); // Already deleted on shader compilation glDeleteProgram(standardShader.id); +#endif } -- cgit v1.2.3 From 5f7ac64c44543383b10ec6a56e5ec1db5706276e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 24 Jun 2016 19:49:36 +0200 Subject: Removed function SetModelTexture() It's more educational to go through new material system, so, I decide to remove this function to avoid students confusion... --- src/models.c | 7 ------- src/raylib.h | 1 - 2 files changed, 8 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 8deabcb0..a4bcde8f 100644 --- a/src/models.c +++ b/src/models.c @@ -808,13 +808,6 @@ void UnloadMaterial(Material material) rlDeleteTextures(material.texSpecular.id); } -// Link a texture to a model -void SetModelTexture(Model *model, Texture2D texture) -{ - if (texture.id <= 0) model->material.texDiffuse = GetDefaultTexture(); // Use default white texture - else model->material.texDiffuse = texture; -} - // Generate a mesh from heightmap static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { diff --git a/src/raylib.h b/src/raylib.h index ed787892..641f4c09 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -795,7 +795,6 @@ Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d mod Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) void UnloadModel(Model model); // Unload 3d model from memory -void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) -- cgit v1.2.3 From 9ee96bea95e2b9b2180edee8ed01171fb64bfcd6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 25 Jun 2016 21:28:50 +0200 Subject: Unified functions: InitGraphicsDevice() Following XNA style, now we have InitGraphicsDevice(), replacing InitDisplay() + InitGraphics() --- src/core.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index bc195219..62b916fb 100644 --- a/src/core.c +++ b/src/core.c @@ -238,8 +238,7 @@ extern void UnloadDefaultFont(void); // [Module: text] Unloads default fo //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static void InitDisplay(int width, int height); // Initialize display device and framebuffer -static void InitGraphics(void); // Initialize OpenGL graphics +static void InitGraphicsDevice(int width, int height); // Initialize graphics device static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer static double GetTime(void); // Returns time since InitTimer() was run @@ -300,11 +299,8 @@ void InitWindow(int width, int height, const char *title) // Store window title (could be useful...) windowTitle = title; - // Init device display (monitor, LCD, ...) - InitDisplay(width, height); - - // Init OpenGL graphics - InitGraphics(); + // Init graphics device (display device and OpenGL context) + InitGraphicsDevice(width, height); // Load default font for convenience // NOTE: External function (defined in module: text) @@ -1453,7 +1449,7 @@ bool IsButtonReleased(int button) // Initialize display device and framebuffer // NOTE: width and height represent the screen (framebuffer) desired size, not actual display size // If width or height are 0, default display size will be used for framebuffer size -static void InitDisplay(int width, int height) +static void InitGraphicsDevice(int width, int height) { screenWidth = width; // User desired width screenHeight = height; // User desired height @@ -1763,11 +1759,8 @@ static void InitDisplay(int width, int height) TraceLog(INFO, "Viewport offsets: %i, %i", renderOffsetX, renderOffsetY); } #endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) -} -// Initialize OpenGL graphics -static void InitGraphics(void) -{ + // Initialize OpenGL context (states and resources) rlglInit(); // Init rlgl rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) @@ -2213,11 +2206,8 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) } else { - // Init device display (monitor, LCD, ...) - InitDisplay(screenWidth, screenHeight); - - // Init OpenGL graphics - InitGraphics(); + // Init graphics device (display device and OpenGL context) + InitGraphicsDevice(screenWidth, screenHeight); // Load default font for convenience // NOTE: External function (defined in module: text) -- cgit v1.2.3 From 369b8532c018e1b606c448be0e725054619ce303 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 25 Jun 2016 22:42:35 +0200 Subject: Review rlglInitGraphics() --- src/rlgl.c | 60 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 6e8cccc3..185ea4fc 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1176,7 +1176,7 @@ void rlglDraw(void) #endif } -// Initialize Graphics Device (OpenGL stuff) +// Initialize OpenGL states // NOTE: Stores global variables screenWidth and screenHeight void rlglInitGraphics(int offsetX, int offsetY, int width, int height) { @@ -1184,45 +1184,49 @@ void rlglInitGraphics(int offsetX, int offsetY, int width, int height) screenWidth = width; screenHeight = height; - // NOTE: Required! viewport must be recalculated if screen resized! + // Init state: Viewport + // NOTE: Viewport must be recalculated if screen is resized, don't confuse glViewport with the + // transformation matrix, glViewport just defines the area of the context that you will actually draw to. glViewport(offsetX/2, offsetY/2, width - offsetX, height - offsetY); // Set viewport width and height - // NOTE: Don't confuse glViewport with the transformation matrix - // NOTE: glViewport just defines the area of the context that you will actually draw to. - - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) - //glClearDepth(1.0f); // Clear depth buffer (default) - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear used buffers, depth buffer is used for 3D - - glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) + // Init state: Depth Test glDepthFunc(GL_LEQUAL); // Type of depth testing to apply + glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) - glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) + // Init state: Blending mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Color blending function (how colors are mixed) + glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) + + // Init state: Culling + // NOTE: All shapes/models triangles are drawn CCW + glCullFace(GL_BACK); // Cull the back face (default) + glFrontFace(GL_CCW); // Front face are defined counter clockwise (default) + glEnable(GL_CULL_FACE); // Enable backface culling #if defined(GRAPHICS_API_OPENGL_11) - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation (Deprecated in OGL 3.0) - // Other options: GL_FASTEST, GL_DONT_CARE (default) + // Init state: Color hints (deprecated in OpenGL 3.0+) + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation + glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) #endif + // Init state: Color/Depth buffers clear + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) + glClearDepth(1.0f); // Set clear depth value (default) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) + + // Init state: projection and modelview matrices + // NOTE: Setup global variables: projection and modelview rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix rlLoadIdentity(); // Reset current matrix (PROJECTION) - - rlOrtho(0, width - offsetX, height - offsetY, 0, 0.0f, 1.0f); // Config orthographic mode: top-left corner --> (0,0) - + rlOrtho(0, width - offsetX, height - offsetY, 0, 0.0f, 1.0f); // Orthographic projection mode with top-left corner at (0,0) rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) - - // NOTE: All shapes/models triangles are drawn CCW - - glEnable(GL_CULL_FACE); // Enable backface culling (Disabled by default) - //glCullFace(GL_BACK); // Cull the Back face (default) - //glFrontFace(GL_CCW); // Front face are defined counter clockwise (default) - -#if defined(GRAPHICS_API_OPENGL_11) - glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) (Deprecated on OpenGL 3.3+) - // Possible options: GL_SMOOTH (Color interpolation) or GL_FLAT (no interpolation) -#endif + + // NOTE: projection and modelview could be set alternatively using: + //Matrix matOrtho = MatrixOrtho(0, width - offsetX, height - offsetY, 0, 0.0f, 1.0f); + //MatrixTranspose(&matOrtho); + //projection = matOrtho; // Global variable + //modelview = MatrixIdentity(); // Global variable TraceLog(INFO, "OpenGL graphic device initialized successfully"); } @@ -2741,7 +2745,7 @@ void EndOculusDrawing(void) rlPushMatrix(); rlBegin(RL_QUADS); rlColor4ub(255, 255, 255, 255); - rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer + rlNormal3f(0.0f, 0.0f, 1.0f); // Bottom-left corner for texture and quad rlTexCoord2f(0.0f, 1.0f); -- cgit v1.2.3 From 71ab20229564a4c519ab46ee34ec785846bdbe83 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 25 Jun 2016 23:28:50 +0200 Subject: Removed rlglInitGraphics(), integrated into rlglInit() Redesigned rlgl usage: - rlViewport() must be called by user - Internal projection/modelview matrices must be setup by user --- src/core.c | 28 +++++++++++++----- src/rlgl.c | 97 ++++++++++++++++++++++++-------------------------------------- src/rlgl.h | 1 - 3 files changed, 59 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 62b916fb..de632c09 100644 --- a/src/core.c +++ b/src/core.c @@ -1761,8 +1761,19 @@ static void InitGraphicsDevice(int width, int height) #endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) // Initialize OpenGL context (states and resources) - rlglInit(); // Init rlgl - rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) + rlglInit(); + + // Initialize screen viewport (area of the screen that you will actually draw to) + // NOTE: Viewport must be recalculated if screen is resized + rlViewport(renderOffsetX/2, renderOffsetY/2, renderWidth - renderOffsetX, renderHeight - renderOffsetY); + + // Initialize internal projection and modelview matrices + // NOTE: Default to orthographic projection mode with top-left corner at (0,0) + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix + rlLoadIdentity(); // Reset current matrix (PROJECTION) + rlOrtho(0, renderWidth - renderOffsetX, renderHeight - renderOffsetY, 0, 0.0f, 1.0f); + rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix + rlLoadIdentity(); // Reset current matrix (MODELVIEW) ClearBackground(RAYWHITE); // Default background color for raylib games :P @@ -2127,8 +2138,14 @@ static void CursorEnterCallback(GLFWwindow *window, int enter) // NOTE: Window resizing not allowed by default static void WindowSizeCallback(GLFWwindow *window, int width, int height) { - // If window is resized, graphics device is re-initialized (but only ortho mode) - rlglInitGraphics(0, 0, width, height); + // If window is resized, viewport and projection matrix needs to be re-calculated + rlViewport(0, 0, width, height); // Set viewport width and height + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix + rlLoadIdentity(); // Reset current matrix (PROJECTION) + rlOrtho(0, width, height, 0, 0.0f, 1.0f); // Orthographic projection mode with top-left corner at (0,0) + rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix + rlLoadIdentity(); // Reset current matrix (MODELVIEW) + rlClearScreenBuffers(); // Clear screen buffers (color and depth) // Window size must be updated to be used on 3D mode to get new aspect ratio (Begin3dMode()) screenWidth = width; @@ -2137,9 +2154,6 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height) renderHeight = height; // NOTE: Postprocessing texture is not scaled to new size - - // Background must be also re-cleared - ClearBackground(RAYWHITE); } // GLFW3 WindowIconify Callback, runs when window is minimized/restored diff --git a/src/rlgl.c b/src/rlgl.c index 185ea4fc..99afd681 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -290,8 +290,7 @@ static int blendMode = 0; // Track current blending mode // White texture useful for plain color polys (required by shader) static unsigned int whiteTexture; -// Default framebuffer size -// NOTE: Updated when calling rlglInitGraphics() +// Default framebuffer size (required by Oculus device) static int screenWidth; // Default framebuffer width static int screenHeight; // Default framebuffer height @@ -481,10 +480,15 @@ void rlOrtho(double left, double right, double bottom, double top, double near, #endif -// Set the viewport area (trasnformation from normalized device coordinates to window coordinates) +// Set the viewport area (transformation from normalized device coordinates to window coordinates) +// NOTE: Updates global variables: screenWidth, screenHeight void rlViewport(int x, int y, int width, int height) { glViewport(x, y, width, height); + + // Store default framebuffer size + screenWidth = width; + screenHeight = height; } //---------------------------------------------------------------------------------- @@ -947,7 +951,7 @@ int rlGetVersion(void) // Module Functions Definition - rlgl Functions //---------------------------------------------------------------------------------- -// Init OpenGL 3.3+ required data +// Initialize rlgl: OpenGL extensions, default buffers/shaders/textures, OpenGL states void rlglInit(void) { // Check OpenGL information and capabilities @@ -1134,7 +1138,37 @@ void rlglInit(void) projection = MatrixIdentity(); modelview = MatrixIdentity(); currentMatrix = &modelview; +#endif // defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + + // Initialize OpenGL default states + //---------------------------------------------------------- + + // Init state: Depth test + glDepthFunc(GL_LEQUAL); // Type of depth testing to apply + glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) + + // Init state: Blending mode + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Color blending function (how colors are mixed) + glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) + + // Init state: Culling + // NOTE: All shapes/models triangles are drawn CCW + glCullFace(GL_BACK); // Cull the back face (default) + glFrontFace(GL_CCW); // Front face are defined counter clockwise (default) + glEnable(GL_CULL_FACE); // Enable backface culling + +#if defined(GRAPHICS_API_OPENGL_11) + // Init state: Color hints (deprecated in OpenGL 3.0+) + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation + glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) #endif + + // Init state: Color/Depth buffers clear + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) + glClearDepth(1.0f); // Set clear depth value (default) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) + + TraceLog(INFO, "OpenGL default states initialized successfully"); } // Vertex Buffer Object deinitialization (memory free) @@ -1176,61 +1210,6 @@ void rlglDraw(void) #endif } -// Initialize OpenGL states -// NOTE: Stores global variables screenWidth and screenHeight -void rlglInitGraphics(int offsetX, int offsetY, int width, int height) -{ - // Store default framebuffer size - screenWidth = width; - screenHeight = height; - - // Init state: Viewport - // NOTE: Viewport must be recalculated if screen is resized, don't confuse glViewport with the - // transformation matrix, glViewport just defines the area of the context that you will actually draw to. - glViewport(offsetX/2, offsetY/2, width - offsetX, height - offsetY); // Set viewport width and height - - // Init state: Depth Test - glDepthFunc(GL_LEQUAL); // Type of depth testing to apply - glDisable(GL_DEPTH_TEST); // Disable depth testing for 2D (only used for 3D) - - // Init state: Blending mode - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Color blending function (how colors are mixed) - glEnable(GL_BLEND); // Enable color blending (required to work with transparencies) - - // Init state: Culling - // NOTE: All shapes/models triangles are drawn CCW - glCullFace(GL_BACK); // Cull the back face (default) - glFrontFace(GL_CCW); // Front face are defined counter clockwise (default) - glEnable(GL_CULL_FACE); // Enable backface culling - -#if defined(GRAPHICS_API_OPENGL_11) - // Init state: Color hints (deprecated in OpenGL 3.0+) - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation - glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) -#endif - - // Init state: Color/Depth buffers clear - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) - glClearDepth(1.0f); // Set clear depth value (default) - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) - - // Init state: projection and modelview matrices - // NOTE: Setup global variables: projection and modelview - rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix - rlLoadIdentity(); // Reset current matrix (PROJECTION) - rlOrtho(0, width - offsetX, height - offsetY, 0, 0.0f, 1.0f); // Orthographic projection mode with top-left corner at (0,0) - rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix - rlLoadIdentity(); // Reset current matrix (MODELVIEW) - - // NOTE: projection and modelview could be set alternatively using: - //Matrix matOrtho = MatrixOrtho(0, width - offsetX, height - offsetY, 0, 0.0f, 1.0f); - //MatrixTranspose(&matOrtho); - //projection = matOrtho; // Global variable - //modelview = MatrixIdentity(); // Global variable - - TraceLog(INFO, "OpenGL graphic device initialized successfully"); -} - // Load OpenGL extensions // NOTE: External loader function could be passed as a pointer void rlglLoadExtensions(void *loader) diff --git a/src/rlgl.h b/src/rlgl.h index 2bd7a6b4..61d11d66 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -301,7 +301,6 @@ int rlGetVersion(void); // Returns current OpenGL versio void rlglInit(void); // Initialize rlgl (shaders, VAO, VBO...) void rlglClose(void); // De-init rlgl void rlglDraw(void); // Draw VAO/VBO -void rlglInitGraphics(int offsetX, int offsetY, int width, int height); // Initialize Graphics (OpenGL stuff) void rlglLoadExtensions(void *loader); // Load OpenGL extensions void rlglUpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data -- cgit v1.2.3 From 6981e2bffaf6626b4ffc3f667dd9cc1de2c196da Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 26 Jun 2016 01:36:06 +0200 Subject: Get supported videomodes for fullscreen --- src/core.c | 53 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index de632c09..f02178c5 100644 --- a/src/core.c +++ b/src/core.c @@ -480,16 +480,14 @@ bool IsWindowMinimized(void) } // Fullscreen toggle -// TODO: When destroying window context is lost and resources too, take care! void ToggleFullscreen(void) { #if defined(PLATFORM_DESKTOP) fullscreen = !fullscreen; // Toggle fullscreen flag - rlglClose(); // De-init rlgl - glfwDestroyWindow(window); // Destroy the current window (we will recreate it!) - - InitWindow(screenWidth, screenHeight, windowTitle); + // NOTE: glfwSetWindowMonitor() doesn't work properly (bugs) + if (fullscreen) glfwSetWindowMonitor(window, glfwGetPrimaryMonitor(), 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE); + else glfwSetWindowMonitor(window, NULL, 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE); #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1525,25 +1523,40 @@ static void InitGraphicsDevice(int width, int height) if (fullscreen) { - // At this point we need to manage render size vs screen size - // NOTE: This function uses and modifies global module variables: - // screenWidth/screenHeight - renderWidth/renderHeight - downscaleView - SetupFramebufferSize(displayWidth, displayHeight); - - // TODO: SetupFramebufferSize() does not consider properly display video modes. - // It setups a renderWidth/renderHeight with black bars that could not match a valid video mode, - // and so, framebuffer is not scaled properly to some monitors. - + // Obtain recommended displayWidth/displayHeight from a valid videomode for the monitor int count; const GLFWvidmode *modes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); + // Get closest videomode to desired screenWidth/screenHeight for (int i = 0; i < count; i++) { - // TODO: Check modes[i]->width; - // TODO: Check modes[i]->height; + if (modes[i].width >= screenWidth) + { + if (modes[i].height >= screenHeight) + { + displayWidth = modes[i].width; + displayHeight = modes[i].height; + break; + } + } } - window = glfwCreateWindow(screenWidth, screenHeight, windowTitle, glfwGetPrimaryMonitor(), NULL); + TraceLog(WARNING, "Closest fullscreen videomode: %i x %i", displayWidth, displayHeight); + + // NOTE: ISSUE: Closest videomode could not match monitor aspect-ratio, for example, + // for a desired screen size of 800x450 (16:9), closest supported videomode is 800x600 (4:3), + // framebuffer is rendered correctly but once displayed on a 16:9 monitor, it gets stretched + // by the sides to fit all monitor space... + + // At this point we need to manage render size vs screen size + // NOTE: This function uses and modifies global module variables: + // screenWidth/screenHeight - renderWidth/renderHeight - downscaleView + SetupFramebufferSize(displayWidth, displayHeight); + + window = glfwCreateWindow(displayWidth, displayHeight, windowTitle, glfwGetPrimaryMonitor(), NULL); + + // NOTE: Full-screen change, not working properly... + //glfwSetWindowMonitor(window, glfwGetPrimaryMonitor(), 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE); } else { @@ -1785,11 +1798,7 @@ static void InitGraphicsDevice(int width, int height) // Compute framebuffer size relative to screen size and display size // NOTE: Global variables renderWidth/renderHeight and renderOffsetX/renderOffsetY can be modified static void SetupFramebufferSize(int displayWidth, int displayHeight) -{ - // TODO: SetupFramebufferSize() does not consider properly display video modes. - // It setups a renderWidth/renderHeight with black bars that could not match a valid video mode, - // and so, framebuffer is not scaled properly to some monitors. - +{ // Calculate renderWidth and renderHeight, we have the display size (input params) and the desired screen size (global var) if ((screenWidth > displayWidth) || (screenHeight > displayHeight)) { -- cgit v1.2.3 From 8652e644dd9f013464ac1cf1bf9f643637209ff8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 26 Jun 2016 14:13:11 +0200 Subject: Corrected bug on stereo rendering --- src/core.c | 2 +- src/rlgl.c | 12 ++++++------ src/rlgl.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index f02178c5..47ce5cea 100644 --- a/src/core.c +++ b/src/core.c @@ -1774,7 +1774,7 @@ static void InitGraphicsDevice(int width, int height) #endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) // Initialize OpenGL context (states and resources) - rlglInit(); + rlglInit(screenWidth, screenHeight); // Initialize screen viewport (area of the screen that you will actually draw to) // NOTE: Viewport must be recalculated if screen is resized diff --git a/src/rlgl.c b/src/rlgl.c index 99afd681..ea65b6a4 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -485,10 +485,6 @@ void rlOrtho(double left, double right, double bottom, double top, double near, void rlViewport(int x, int y, int width, int height) { glViewport(x, y, width, height); - - // Store default framebuffer size - screenWidth = width; - screenHeight = height; } //---------------------------------------------------------------------------------- @@ -952,7 +948,7 @@ int rlGetVersion(void) //---------------------------------------------------------------------------------- // Initialize rlgl: OpenGL extensions, default buffers/shaders/textures, OpenGL states -void rlglInit(void) +void rlglInit(int width, int height) { // Check OpenGL information and capabilities //------------------------------------------------------------------------------ @@ -1167,6 +1163,10 @@ void rlglInit(void) glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) glClearDepth(1.0f); // Set clear depth value (default) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) + + // Store screen size into global variables + screenWidth = width; + screenHeight = height; TraceLog(INFO, "OpenGL default states initialized successfully"); } @@ -2524,7 +2524,7 @@ void InitOculusDevice(void) if (!oculusEnabled) { TraceLog(WARNING, "VR: Initializing Oculus simulator"); - + // Initialize framebuffer and textures for stereo rendering stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); diff --git a/src/rlgl.h b/src/rlgl.h index 61d11d66..0f9c7a80 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -298,7 +298,7 @@ int rlGetVersion(void); // Returns current OpenGL versio //------------------------------------------------------------------------------------ // Functions Declaration - rlgl functionality //------------------------------------------------------------------------------------ -void rlglInit(void); // Initialize rlgl (shaders, VAO, VBO...) +void rlglInit(int width, int height); // Initialize rlgl (buffers, shaders, textures, states) void rlglClose(void); // De-init rlgl void rlglDraw(void); // Draw VAO/VBO void rlglLoadExtensions(void *loader); // Load OpenGL extensions -- cgit v1.2.3 From 9127b5a57d317c3be76be48deb7395069ae6ab12 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 26 Jun 2016 15:36:12 +0200 Subject: Enable/Disable VR experience --- src/rlgl.c | 113 ++++++++++++++++++++++++++++++++++--------------------------- src/rlgl.h | 1 + 2 files changed, 64 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index ea65b6a4..d21d3e4c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -267,8 +267,9 @@ static OculusMirror mirror; // Oculus mirror texture and fbo static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif -static bool oculusEnabled = false; // Oculus device enabled flag (required by core module) +static bool oculusReady = false; // Oculus device ready flag static bool oculusSimulator = false; // Oculus device simulator +static bool vrEnabled = false; // VR experience enabled (Oculus device or simulator) static RenderTexture2D stereoFbo; static Shader distortion; @@ -2480,7 +2481,7 @@ void InitOculusDevice(void) if (OVR_FAILURE(result)) { TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - oculusEnabled = false; + oculusReady = false; } else { @@ -2489,7 +2490,7 @@ void InitOculusDevice(void) { TraceLog(WARNING, "OVR: Could not create Oculus session"); ovr_Shutdown(); - oculusEnabled = false; + oculusReady = false; } else { @@ -2514,14 +2515,15 @@ void InitOculusDevice(void) // Recenter OVR tracking origin ovr_RecenterTrackingOrigin(session); - oculusEnabled = true; + oculusReady = true; + vrEnabled = true; } } #else - oculusEnabled = false; + oculusReady = false; #endif - if (!oculusEnabled) + if (!oculusReady) { TraceLog(WARNING, "VR: Initializing Oculus simulator"); @@ -2533,6 +2535,7 @@ void InitOculusDevice(void) distortion = LoadShader("resources/shaders/base.vs", "resources/shaders/distortion.fs"); oculusSimulator = true; + vrEnabled = true; } } @@ -2540,7 +2543,7 @@ void InitOculusDevice(void) void CloseOculusDevice(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusEnabled) + if (oculusReady) { UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers @@ -2558,20 +2561,26 @@ void CloseOculusDevice(void) UnloadShader(distortion); } - oculusEnabled = false; + oculusReady = false; } // Detect if oculus device is available bool IsOculusReady(void) { - return (oculusEnabled || oculusSimulator); + return (oculusReady || oculusSimulator) && vrEnabled; +} + +// Enable/Disable VR experience (Oculus device or simulator) +void ToggleVR(void) +{ + vrEnabled = !vrEnabled; } // Update Oculus Rift tracking (position and orientation) void UpdateOculusTracking(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusEnabled) + if (oculusReady) { frameIndex++; @@ -2604,54 +2613,58 @@ void SetOculusView(int eye) { Matrix eyeProjection; Matrix eyeModelView; - -#if defined(RLGL_OCULUS_SUPPORT) - if (oculusEnabled) + + if (vrEnabled) { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRenderPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); - - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - - // TODO: Find a better way to get camera view matrix (instead of using internal modelview) - - eyeProjection = layer.eyeProjections[eye]; - } - else +#if defined(RLGL_OCULUS_SUPPORT) + if (oculusReady) + { + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, + layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + + // TODO: Find a better way to get camera view matrix (instead of using internal modelview) + + eyeProjection = layer.eyeProjections[eye]; + } + else #endif - { - // Setup viewport and projection/modelview matrices using tracking data - rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - - // NOTE: fovy vaule hardcoded to 45.0 degrees - eyeProjection = MatrixPerspective(45.0, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); - MatrixTranspose(&eyeProjection); - - // TODO: Compute eyes IPD and apply to current modelview matrix (camera) - Matrix eyeView = MatrixIdentity(); - - eyeModelView = MatrixMultiply(modelview, eyeView); - } + { + // Setup viewport and projection/modelview matrices using tracking data + rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + + // NOTE: fovy value hardcoded to 60 degrees (Oculus Rift CV1 vertical FOV is 100 degrees) + eyeProjection = MatrixPerspective(60.0, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); + MatrixTranspose(&eyeProjection); + + // TODO: Compute eyes IPD and apply to current modelview matrix (camera) + Matrix eyeView = MatrixIdentity(); + + eyeModelView = MatrixMultiply(modelview, eyeView); + } - SetMatrixModelview(eyeModelView); - SetMatrixProjection(eyeProjection); + SetMatrixModelview(eyeModelView); + SetMatrixProjection(eyeProjection); + } } // Begin Oculus drawing configuration void BeginOculusDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusEnabled) + if (oculusReady) { GLuint currentTexId; int currentIndex; @@ -2684,7 +2697,7 @@ void BeginOculusDrawing(void) void EndOculusDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusEnabled) + if (oculusReady) { // Unbind current framebuffer (Oculus buffer) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); diff --git a/src/rlgl.h b/src/rlgl.h index 0f9c7a80..675bb74f 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -362,6 +362,7 @@ void SetOculusView(int eye); // Set internal projection and model void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready +void ToggleVR(void); // Enable/Disable VR experience (Oculus device or simulator) #ifdef __cplusplus } -- cgit v1.2.3 From 4b444e7cc395378b1545ae0a240dd21135b5e434 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 26 Jun 2016 18:43:10 +0200 Subject: Comment glBlitFramebuffer() --- src/rlgl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index d21d3e4c..69c80faf 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -135,6 +135,12 @@ #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif +#if defined(GRAPHICS_API_OPENGL_ES2) + #define glClearDepth glClearDepthf + #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER + #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER +#endif + // Default vertex attribute names on shader to set location points #define DEFAULT_ATTRIB_POSITION_NAME "vertexPosition" // shader-location = 0 #define DEFAULT_ATTRIB_TEXCOORD_NAME "vertexTexCoord" // shader-location = 1 @@ -3877,7 +3883,10 @@ static void BlitOculusMirror(ovrSession session, OculusMirror mirror) glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); +#if defined(GRAPHICS_API_OPENGL_33) + // NOTE: glBlitFramebuffer() requires extension: GL_EXT_framebuffer_blit (not available in OpenGL ES 2.0) glBlitFramebuffer(0, 0, mirror.width, mirror.height, 0, mirror.height, mirror.width, 0, GL_COLOR_BUFFER_BIT, GL_NEAREST); +#endif glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); } -- cgit v1.2.3 From 572936ec65c127c7fecc69f025b819ffec20cdc0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 27 Jun 2016 18:30:58 +0200 Subject: Added Oculus functions to raylib header --- src/raylib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 641f4c09..6bacfc67 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -856,6 +856,8 @@ void UpdateOculusTracking(void); // Update Oculus Rift tracking (posi void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) +bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready +void ToggleVR(void); // Enable/Disable VR experience (Oculus device or simulator) //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) -- cgit v1.2.3 From c4922c9e8854f9c936b28c3f8b00162b407ae503 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 27 Jun 2016 18:32:56 +0200 Subject: Reorganize shaders to respective folders --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 69c80faf..fa57e9ac 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2538,7 +2538,7 @@ void InitOculusDevice(void) // Load oculus-distortion shader (oculus parameters setup internally) // TODO: Embed coulus distortion shader (in this function like default shader?) - distortion = LoadShader("resources/shaders/base.vs", "resources/shaders/distortion.fs"); + distortion = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/distortion.fs"); oculusSimulator = true; vrEnabled = true; -- cgit v1.2.3 From 308fcbb96cc6e8c40dc9402d61ca29025a515e8a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 27 Jun 2016 20:10:28 +0200 Subject: Added eyes projection/view matrices calculation Based on HMD parameters (IPD, ScreenSize, LesnsSeparation...) --- src/rlgl.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index fa57e9ac..d3ffdd8b 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2651,6 +2651,46 @@ void SetOculusView(int eye) // Setup viewport and projection/modelview matrices using tracking data rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + float hmdIPD = 0.064f; + float hmdHScreenSize = 0.14976f; + float hmdVScreenSize = 0.0936f; + //float hmdVScreenCenter = 0.04675f; + float hmdEyeToScreenDistance = 0.041f; + float hmdLensSeparationDistance = 0.064f; + + //NOTE: fovy value hardcoded to 60 degrees (Oculus Rift CV1 vertical FOV is 100 degrees) + //float halfScreenDistance = hmdVScreenSize/2.0f; + //float yfov = 2.0f*atan(halfScreenDistance/hmdEyeToScreenDistance); + + float viewCenter = (float)hmdHScreenSize*0.25f; + float eyeProjectionShift = viewCenter - hmdLensSeparationDistance*0.5f; + float projectionCenterOffset = 4.0f*eyeProjectionShift/(float)hmdHScreenSize; + + + // The matrixes for offsetting the projection and view for each eye, to achieve stereo effect + Vector3 projectionOffset = { -projectionCenterOffset, 0.0f, 0.0f }; + Vector3 viewOffset = { -hmdIPD/2.0f, 0.0f, 0.0f }; + + // Negate the left eye versions + if (eye == 1) + { + projectionOffset.x *= -1.0f; + viewOffset.x *= -1.0f; + } + + // Adjust the view and projection matrixes + // View matrix is translated based on the eye offset + Matrix projCenter = MatrixPerspective(60.0, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); + + Matrix projTranslation = MatrixTranslate(projectionOffset.x, projectionOffset.y, projectionOffset.z); + Matrix viewTranslation = MatrixTranslate(viewOffset.x, viewOffset.y, viewOffset.z); + + eyeProjection = MatrixMultiply(projCenter, projTranslation); // projection + eyeModelView = MatrixMultiply(modelview, viewTranslation); // modelview + + MatrixTranspose(&eyeProjection); + + /* // NOTE: fovy value hardcoded to 60 degrees (Oculus Rift CV1 vertical FOV is 100 degrees) eyeProjection = MatrixPerspective(60.0, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); MatrixTranspose(&eyeProjection); @@ -2659,6 +2699,7 @@ void SetOculusView(int eye) Matrix eyeView = MatrixIdentity(); eyeModelView = MatrixMultiply(modelview, eyeView); + */ } SetMatrixModelview(eyeModelView); -- cgit v1.2.3 From ee72654b557202a673f042484c83d3020ae618b8 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 4 Jul 2016 01:29:23 +0200 Subject: Redesigned stereo rendering mechanism Now it's easier for the user! Just init Oculus device and get stereo rendering! --- src/core.c | 18 +-- src/raylib.h | 2 - src/rlgl.c | 443 ++++++++++++++++++++++++++++++++--------------------------- src/rlgl.h | 4 - 4 files changed, 244 insertions(+), 223 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 47ce5cea..a8557831 100644 --- a/src/core.c +++ b/src/core.c @@ -520,6 +520,8 @@ void BeginDrawing(void) currentTime = GetTime(); // Number of elapsed seconds since InitTimer() was called updateTime = currentTime - previousTime; previousTime = currentTime; + + if (IsOculusReady()) BeginOculusDrawing(); rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -533,6 +535,8 @@ void BeginDrawing(void) void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + if (IsOculusReady()) EndOculusDrawing(); SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -608,15 +612,11 @@ void Begin3dMode(Camera camera) rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D - - if (IsOculusReady()) BeginOculusDrawing(); } // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void) -{ - if (IsOculusReady()) EndOculusDrawing(); - +{ rlglDraw(); // Process internal buffers (update + draw) rlMatrixMode(RL_PROJECTION); // Switch to projection matrix @@ -1021,14 +1021,6 @@ Matrix GetCameraMatrix(Camera camera) return MatrixLookAt(camera.position, camera.target, camera.up); } -// Update and draw default buffers vertex data -// NOTE: This data has been stored dynamically during frame on each Draw*() call -void DrawDefaultBuffers(void) -{ - rlglUpdateDefaultBuffers(); // Upload frame vertex data to GPU - rlglDrawDefaultBuffers(); // Draw vertex data into framebuffer -} - //---------------------------------------------------------------------------------- // Module Functions Definition - Input (Keyboard, Mouse, Gamepad) Functions //---------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index 6bacfc67..89fc457f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -572,7 +572,6 @@ void EndTextureMode(void); // Ends drawing to r Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) -void DrawDefaultBuffers(void); // Update and draw default buffers vertex data (stored dynamically in frame) void SetTargetFPS(int fps); // Set target FPS (maximum) float GetFPS(void); // Returns current FPS @@ -853,7 +852,6 @@ void DestroyLight(Light light); // Destroy a void InitOculusDevice(void); // Init Oculus Rift device void CloseOculusDevice(void); // Close Oculus Rift device void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready diff --git a/src/rlgl.c b/src/rlgl.c index d3ffdd8b..57e6b894 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -276,9 +276,10 @@ static unsigned int frameIndex = 0; // Oculus frames counter, used to discar static bool oculusReady = false; // Oculus device ready flag static bool oculusSimulator = false; // Oculus device simulator static bool vrEnabled = false; // VR experience enabled (Oculus device or simulator) +static bool vrControl = true; // VR controlled by user code, instead of internally static RenderTexture2D stereoFbo; -static Shader distortion; +static Shader distortionShader; // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support @@ -315,10 +316,13 @@ static void UnloadDefaultShader(void); // Unload default shader static void UnloadStandardShader(void); // Unload standard shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) -void rlglUpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data -void rlglDrawDefaultBuffers(void); // Draw default internal buffers vertex data +static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data +static void DrawDefaultBuffers(int eyesCount); // Draw default internal buffers vertex data static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU +// Set internal projection and modelview matrix depending on eyes tracking data +static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView); + static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array static char *ReadTextFile(const char *fileName); @@ -1205,15 +1209,14 @@ void rlglClose(void) void rlglDraw(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) -/* - for (int i = 0; i < modelsCount; i++) - { - rlglDrawMesh(models[i]->mesh, models[i]->material, models[i]->transform); - } -*/ - // NOTE: Default buffers always drawn at the end - rlglUpdateDefaultBuffers(); - rlglDrawDefaultBuffers(); + // NOTE: In a future version, models could be stored in a stack... + //for (int i = 0; i < modelsCount; i++) rlglDrawMesh(models[i]->mesh, models[i]->material, models[i]->transform); + + // NOTE: Default buffers upload and draw + UpdateDefaultBuffers(); + + if (vrEnabled && vrControl) DrawDefaultBuffers(2); + else DrawDefaultBuffers(1); #endif } @@ -1865,26 +1868,23 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + int eyesCount = 1; + if (vrEnabled) eyesCount = 2; + glUseProgram(material.shader.id); + // Upload to shader material.colDiffuse + float vColorDiffuse[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; + glUniform4fv(material.shader.tintColorLoc, 1, vColorDiffuse); + // At this point the modelview matrix just contains the view matrix (camera) // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() Matrix matView = modelview; // View matrix (camera) Matrix matProjection = projection; // Projection matrix (perspective) - + // Calculate model-view matrix combining matModel and matView Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates - // Calculate model-view-projection matrix (MVP) - Matrix matMVP = MatrixMultiply(matModelView, matProjection); // Transform to screen-space coordinates - - // Send combined model-view-projection matrix to shader - glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - - // Upload to shader material.colDiffuse - float vColorDiffuse[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; - glUniform4fv(material.shader.tintColorLoc, 1, vColorDiffuse); - // Check if using standard shader to get location points // NOTE: standard shader specific locations are got at render time to keep Shader struct as simple as possible (with just default shader locations) if (material.shader.id == standardShader.id) @@ -1989,9 +1989,20 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } - // Draw call! - if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw - else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + for (int eye = 0; eye < eyesCount; eye++) + { + if (eyesCount == 2) SetOculusView(eye, matProjection, matModelView); + + // Calculate model-view-projection matrix (MVP) + Matrix matMVP = MatrixMultiply(modelview, projection); // Transform to screen-space coordinates + + // Send combined model-view-projection matrix to shader + glUniformMatrix4fv(material.shader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + + // Draw call! + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw + else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); + } if (material.texNormal.id != 0) { @@ -2016,6 +2027,10 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) } glUseProgram(0); // Unbind shader program + + // Restore projection/modelview matrices + projection = matProjection; + modelview = matView; #endif } @@ -2538,7 +2553,7 @@ void InitOculusDevice(void) // Load oculus-distortion shader (oculus parameters setup internally) // TODO: Embed coulus distortion shader (in this function like default shader?) - distortion = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/distortion.fs"); + distortionShader = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/distortion.fs"); oculusSimulator = true; vrEnabled = true; @@ -2564,7 +2579,7 @@ void CloseOculusDevice(void) rlDeleteRenderTextures(stereoFbo); // Unload oculus-distortion shader - UnloadShader(distortion); + UnloadShader(distortionShader); } oculusReady = false; @@ -2615,13 +2630,13 @@ void UpdateOculusTracking(void) } // Set internal projection and modelview matrix depending on eyes tracking data -void SetOculusView(int eye) -{ - Matrix eyeProjection; - Matrix eyeModelView; - +static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView) +{ if (vrEnabled) { + Matrix eyeProjection = matProjection; + Matrix eyeModelView = matModelView; + #if defined(RLGL_OCULUS_SUPPORT) if (oculusReady) { @@ -2639,10 +2654,8 @@ void SetOculusView(int eye) -layer.eyeLayer.RenderPose[eye].Position.z); Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(modelview, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - // TODO: Find a better way to get camera view matrix (instead of using internal modelview) - eyeProjection = layer.eyeProjections[eye]; } else @@ -2651,28 +2664,43 @@ void SetOculusView(int eye) // Setup viewport and projection/modelview matrices using tracking data rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - float hmdIPD = 0.064f; - float hmdHScreenSize = 0.14976f; - float hmdVScreenSize = 0.0936f; - //float hmdVScreenCenter = 0.04675f; - float hmdEyeToScreenDistance = 0.041f; - float hmdLensSeparationDistance = 0.064f; + static float IPD = 0.064f; // InterpupillaryDistance + float HScreenSize = 0.14976f; + float VScreenSize = 0.0936f; // HScreenSize/(1280.0f/800.0f) + float VScreenCenter = 0.04675f; + float EyeToScreenDistance = 0.041f; + float LensSeparationDistance = 0.064f; //0.0635f (DK1) - //NOTE: fovy value hardcoded to 60 degrees (Oculus Rift CV1 vertical FOV is 100 degrees) - //float halfScreenDistance = hmdVScreenSize/2.0f; - //float yfov = 2.0f*atan(halfScreenDistance/hmdEyeToScreenDistance); - - float viewCenter = (float)hmdHScreenSize*0.25f; - float eyeProjectionShift = viewCenter - hmdLensSeparationDistance*0.5f; - float projectionCenterOffset = 4.0f*eyeProjectionShift/(float)hmdHScreenSize; - + // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) + float halfScreenDistance = VScreenSize/2.0f; + float fovy = 2.0f*atan(halfScreenDistance/EyeToScreenDistance)*RAD2DEG; + + float viewCenter = (float)HScreenSize*0.25f; + float eyeProjectionShift = viewCenter - LensSeparationDistance*0.5f; + float projectionCenterOffset = 4.0f*eyeProjectionShift/(float)HScreenSize; +/* + static float scale[2] = { 0.25, 0.45 }; + + if (IsKeyDown(KEY_RIGHT)) scale[0] += 0.01; + else if (IsKeyDown(KEY_LEFT)) scale[0] -= 0.01; + else if (IsKeyDown(KEY_UP)) scale[1] += 0.01; + else if (IsKeyDown(KEY_DOWN)) scale[1] -= 0.01; + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "Scale"), scale, 2); + + if (IsKeyDown(KEY_N)) IPD += 0.02; + else if (IsKeyDown(KEY_M)) IPD -= 0.02; +*/ // The matrixes for offsetting the projection and view for each eye, to achieve stereo effect Vector3 projectionOffset = { -projectionCenterOffset, 0.0f, 0.0f }; - Vector3 viewOffset = { -hmdIPD/2.0f, 0.0f, 0.0f }; + + // Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add + // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. + Vector3 viewOffset = { -IPD/2.0f, 0.075f, 0.045f }; // Negate the left eye versions - if (eye == 1) + if (eye == 0) { projectionOffset.x *= -1.0f; viewOffset.x *= -1.0f; @@ -2680,29 +2708,18 @@ void SetOculusView(int eye) // Adjust the view and projection matrixes // View matrix is translated based on the eye offset - Matrix projCenter = MatrixPerspective(60.0, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); + Matrix projCenter = MatrixPerspective(fovy, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); Matrix projTranslation = MatrixTranslate(projectionOffset.x, projectionOffset.y, projectionOffset.z); Matrix viewTranslation = MatrixTranslate(viewOffset.x, viewOffset.y, viewOffset.z); eyeProjection = MatrixMultiply(projCenter, projTranslation); // projection - eyeModelView = MatrixMultiply(modelview, viewTranslation); // modelview + eyeModelView = MatrixMultiply(matModelView, viewTranslation); // modelview MatrixTranspose(&eyeProjection); - - /* - // NOTE: fovy value hardcoded to 60 degrees (Oculus Rift CV1 vertical FOV is 100 degrees) - eyeProjection = MatrixPerspective(60.0, (double)(screenWidth/2)/(double)screenHeight, 0.01, 1000.0); - MatrixTranspose(&eyeProjection); - - // TODO: Compute eyes IPD and apply to current modelview matrix (camera) - Matrix eyeView = MatrixIdentity(); - - eyeModelView = MatrixMultiply(modelview, eyeView); - */ } - SetMatrixModelview(eyeModelView); + SetMatrixModelview(eyeModelView); // ERROR! We are modifying modelview for next eye!!! SetMatrixProjection(eyeProjection); } } @@ -2738,6 +2755,8 @@ void BeginOculusDrawing(void) //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) rlClearScreenBuffers(); // Clear current framebuffer(s) + + vrControl = true; } // End Oculus drawing process (and desktop mirror) @@ -2777,40 +2796,44 @@ void EndOculusDrawing(void) rlLoadIdentity(); // Reset internal modelview matrix // Draw RenderTexture (stereoFbo) using distortion shader - BeginShaderMode(distortion); + currentShader = distortionShader; - rlEnableTexture(stereoFbo.texture.id); + rlEnableTexture(stereoFbo.texture.id); - rlPushMatrix(); - rlBegin(RL_QUADS); - rlColor4ub(255, 255, 255, 255); - rlNormal3f(0.0f, 0.0f, 1.0f); + rlPushMatrix(); + rlBegin(RL_QUADS); + rlColor4ub(255, 255, 255, 255); + rlNormal3f(0.0f, 0.0f, 1.0f); - // Bottom-left corner for texture and quad - rlTexCoord2f(0.0f, 1.0f); - rlVertex2f(0.0f, 0.0f); + // Bottom-left corner for texture and quad + rlTexCoord2f(0.0f, 1.0f); + rlVertex2f(0.0f, 0.0f); - // Bottom-right corner for texture and quad - rlTexCoord2f(0.0f, 0.0f); - rlVertex2f(0.0f, stereoFbo.texture.height); + // Bottom-right corner for texture and quad + rlTexCoord2f(0.0f, 0.0f); + rlVertex2f(0.0f, stereoFbo.texture.height); - // Top-right corner for texture and quad - rlTexCoord2f(1.0f, 0.0f); - rlVertex2f(stereoFbo.texture.width, stereoFbo.texture.height); + // Top-right corner for texture and quad + rlTexCoord2f(1.0f, 0.0f); + rlVertex2f(stereoFbo.texture.width, stereoFbo.texture.height); - // Top-left corner for texture and quad - rlTexCoord2f(1.0f, 1.0f); - rlVertex2f(stereoFbo.texture.width, 0.0f); - rlEnd(); - rlPopMatrix(); + // Top-left corner for texture and quad + rlTexCoord2f(1.0f, 1.0f); + rlVertex2f(stereoFbo.texture.width, 0.0f); + rlEnd(); + rlPopMatrix(); - rlDisableTexture(); - - //rlglDraw(); - EndShaderMode(); + rlDisableTexture(); + + UpdateDefaultBuffers(); + DrawDefaultBuffers(1); + + currentShader = defaultShader; } rlDisableDepthTest(); + + vrControl = false; } //---------------------------------------------------------------------------------- @@ -3303,7 +3326,7 @@ static void LoadDefaultBuffers(void) // Update default internal buffers (VAOs/VBOs) with vertex array data // NOTE: If there is not vertex data, buffers doesn't need to be updated (vertexCount > 0) // TODO: If no data changed on the CPU arrays --> No need to re-update GPU arrays (change flag required) -void rlglUpdateDefaultBuffers(void) +static void UpdateDefaultBuffers(void) { // Update lines vertex buffers if (lines.vCounter > 0) @@ -3373,146 +3396,154 @@ void rlglUpdateDefaultBuffers(void) // Draw default internal buffers vertex data // NOTE: We draw in this order: lines, triangles, quads -void rlglDrawDefaultBuffers(void) +static void DrawDefaultBuffers(int eyesCount) { - // Set current shader and upload current MVP matrix - if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) - { - glUseProgram(currentShader.id); - - // Create modelview-projection matrix - Matrix matMVP = MatrixMultiply(modelview, projection); - - glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); - glUniform1i(currentShader.mapTexture0Loc, 0); - - // NOTE: Additional map textures not considered for default buffers drawing - } - - // Draw lines buffers - if (lines.vCounter > 0) + Matrix matProjection = projection; + Matrix matModelView = modelview; + + for (int eye = 0; eye < eyesCount; eye++) { - glBindTexture(GL_TEXTURE_2D, whiteTexture); + if (eyesCount == 2) SetOculusView(eye, matProjection, matModelView); - if (vaoSupported) + // Set current shader and upload current MVP matrix + if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) { - glBindVertexArray(lines.vaoId); + glUseProgram(currentShader.id); + + // Create modelview-projection matrix + Matrix matMVP = MatrixMultiply(modelview, projection); + + glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); + glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); + glUniform1i(currentShader.mapTexture0Loc, 0); + + // NOTE: Additional map textures not considered for default buffers drawing } - else + + // Draw lines buffers + if (lines.vCounter > 0) { - // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); - } + glBindTexture(GL_TEXTURE_2D, whiteTexture); - glDrawArrays(GL_LINES, 0, lines.vCounter); - - if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindTexture(GL_TEXTURE_2D, 0); - } + if (vaoSupported) + { + glBindVertexArray(lines.vaoId); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[1]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + } - // Draw triangles buffers - if (triangles.vCounter > 0) - { - glBindTexture(GL_TEXTURE_2D, whiteTexture); + glDrawArrays(GL_LINES, 0, lines.vCounter); - if (vaoSupported) - { - glBindVertexArray(triangles.vaoId); - } - else - { - // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); + if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindTexture(GL_TEXTURE_2D, 0); } - glDrawArrays(GL_TRIANGLES, 0, triangles.vCounter); + // Draw triangles buffers + if (triangles.vCounter > 0) + { + glBindTexture(GL_TEXTURE_2D, whiteTexture); - if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindTexture(GL_TEXTURE_2D, 0); - } + if (vaoSupported) + { + glBindVertexArray(triangles.vaoId); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[1]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + } - // Draw quads buffers - if (quads.vCounter > 0) - { - int quadsCount = 0; - int numIndicesToProcess = 0; - int indicesOffset = 0; + glDrawArrays(GL_TRIANGLES, 0, triangles.vCounter); - if (vaoSupported) - { - glBindVertexArray(quads.vaoId); + if (!vaoSupported) glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindTexture(GL_TEXTURE_2D, 0); } - else + + // Draw quads buffers + if (quads.vCounter > 0) { - // Bind vertex attrib: position (shader-location = 0) - glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); - glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.vertexLoc); - - // Bind vertex attrib: texcoord (shader-location = 1) - glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[1]); - glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); - glEnableVertexAttribArray(currentShader.texcoordLoc); - - // Bind vertex attrib: color (shader-location = 3) - glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); - glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(currentShader.colorLoc); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); - } + int quadsCount = 0; + int numIndicesToProcess = 0; + int indicesOffset = 0; - //TraceLog(DEBUG, "Draws required per frame: %i", drawsCounter); + if (vaoSupported) + { + glBindVertexArray(quads.vaoId); + } + else + { + // Bind vertex attrib: position (shader-location = 0) + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); + glVertexAttribPointer(currentShader.vertexLoc, 3, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.vertexLoc); + + // Bind vertex attrib: texcoord (shader-location = 1) + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[1]); + glVertexAttribPointer(currentShader.texcoordLoc, 2, GL_FLOAT, 0, 0, 0); + glEnableVertexAttribArray(currentShader.texcoordLoc); + + // Bind vertex attrib: color (shader-location = 3) + glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); + glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(currentShader.colorLoc); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); + } - for (int i = 0; i < drawsCounter; i++) - { - quadsCount = draws[i].vertexCount/4; - numIndicesToProcess = quadsCount*6; // Get number of Quads * 6 index by Quad + //TraceLog(DEBUG, "Draws required per frame: %i", drawsCounter); - //TraceLog(DEBUG, "Quads to render: %i - Vertex Count: %i", quadsCount, draws[i].vertexCount); + for (int i = 0; i < drawsCounter; i++) + { + quadsCount = draws[i].vertexCount/4; + numIndicesToProcess = quadsCount*6; // Get number of Quads * 6 index by Quad - glBindTexture(GL_TEXTURE_2D, draws[i].textureId); + //TraceLog(DEBUG, "Quads to render: %i - Vertex Count: %i", quadsCount, draws[i].vertexCount); - // NOTE: The final parameter tells the GPU the offset in bytes from the start of the index buffer to the location of the first index to process -#if defined(GRAPHICS_API_OPENGL_33) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid *)(sizeof(GLuint)*indicesOffset)); -#elif defined(GRAPHICS_API_OPENGL_ES2) - glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid *)(sizeof(GLushort)*indicesOffset)); -#endif - //GLenum err; - //if ((err = glGetError()) != GL_NO_ERROR) TraceLog(INFO, "OpenGL error: %i", (int)err); //GL_INVALID_ENUM! + glBindTexture(GL_TEXTURE_2D, draws[i].textureId); - indicesOffset += draws[i].vertexCount/4*6; - } + // NOTE: The final parameter tells the GPU the offset in bytes from the start of the index buffer to the location of the first index to process + #if defined(GRAPHICS_API_OPENGL_33) + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_INT, (GLvoid *)(sizeof(GLuint)*indicesOffset)); + #elif defined(GRAPHICS_API_OPENGL_ES2) + glDrawElements(GL_TRIANGLES, numIndicesToProcess, GL_UNSIGNED_SHORT, (GLvoid *)(sizeof(GLushort)*indicesOffset)); + #endif + //GLenum err; + //if ((err = glGetError()) != GL_NO_ERROR) TraceLog(INFO, "OpenGL error: %i", (int)err); //GL_INVALID_ENUM! - if (!vaoSupported) - { - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - } + indicesOffset += draws[i].vertexCount/4*6; + } - glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures - } + if (!vaoSupported) + { + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } - if (vaoSupported) glBindVertexArray(0); // Unbind VAO + glBindTexture(GL_TEXTURE_2D, 0); // Unbind textures + } - glUseProgram(0); // Unbind shader program + if (vaoSupported) glBindVertexArray(0); // Unbind VAO + glUseProgram(0); // Unbind shader program + } + // Reset draws counter drawsCounter = 1; draws[0].textureId = whiteTexture; @@ -3529,6 +3560,10 @@ void rlglDrawDefaultBuffers(void) // Reset depth for next draw currentDepth = -1.0f; + + // Restore projection/modelview matrices + projection = matProjection; + modelview = matModelView; } // Unload default internal buffers vertex data from CPU and GPU diff --git a/src/rlgl.h b/src/rlgl.h index 675bb74f..f52af6f9 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -303,9 +303,6 @@ void rlglClose(void); // De-init rlgl void rlglDraw(void); // Draw VAO/VBO void rlglLoadExtensions(void *loader); // Load OpenGL extensions -void rlglUpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data -void rlglDrawDefaultBuffers(void); // Draw default internal buffers vertex data - unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data @@ -358,7 +355,6 @@ void TraceLog(int msgType, const char *text, ...); void InitOculusDevice(void); // Init Oculus Rift device void CloseOculusDevice(void); // Close Oculus Rift device void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void SetOculusView(int eye); // Set internal projection and modelview matrix depending on eyes tracking data void BeginOculusDrawing(void); // Begin Oculus drawing configuration void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready -- cgit v1.2.3 From 2f9abe6e1388a84d662eb12e62bbcccc7eccd9d0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 4 Jul 2016 01:30:07 +0200 Subject: Review ResolveCollisionCubicmap() This function needs to be redesigned or removed... --- src/models.c | 71 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a4bcde8f..b194a0db 100644 --- a/src/models.c +++ b/src/models.c @@ -40,7 +40,7 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define CUBIC_MAP_HALF_BLOCK_SIZE 0.5 +// ... //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -1542,8 +1542,11 @@ BoundingBox CalculateBoundingBox(Mesh mesh) // Detect and resolve cubicmap collisions // NOTE: player position (or camera) is modified inside this function +// TODO: This functions needs to be completely reviewed! Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius) { + #define CUBIC_MAP_HALF_BLOCK_SIZE 0.5 + Color *cubicmapPixels = GetImageData(cubicmap); // Detect the cell where the player is located @@ -1555,15 +1558,15 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p locationCellX = floor(playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE); locationCellY = floor(playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE); - if (locationCellX >= 0 && locationCellY >= 0 && locationCellX < cubicmap.width && locationCellY < cubicmap.height) + if ((locationCellX >= 0) && (locationCellY >= 0) && (locationCellX < cubicmap.width) && (locationCellY < cubicmap.height)) { // Multiple Axis -------------------------------------------------------------------------------------------- // Axis x-, y- - if (locationCellX > 0 && locationCellY > 0) + if ((locationCellX > 0) && (locationCellY > 0)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX - 1)].r != 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) @@ -1576,10 +1579,10 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x-, y+ - if (locationCellX > 0 && locationCellY < cubicmap.height - 1) + if ((locationCellX > 0) && (locationCellY < cubicmap.height - 1)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX - 1)].r != 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) @@ -1592,10 +1595,10 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x+, y- - if (locationCellX < cubicmap.width - 1 && locationCellY > 0) + if ((locationCellX < cubicmap.width - 1) && (locationCellY > 0)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX + 1)].r != 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) @@ -1608,10 +1611,10 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x+, y+ - if (locationCellX < cubicmap.width - 1 && locationCellY < cubicmap.height - 1) + if ((locationCellX < cubicmap.width - 1) && (locationCellY < cubicmap.height - 1)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX + 1)].r != 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) @@ -1628,7 +1631,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // Axis x- if (locationCellX > 0) { - if (cubicmapPixels[locationCellY * cubicmap.width + (locationCellX - 1)].r != 0) + if (cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) { if ((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) { @@ -1640,7 +1643,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // Axis x+ if (locationCellX < cubicmap.width - 1) { - if (cubicmapPixels[locationCellY * cubicmap.width + (locationCellX + 1)].r != 0) + if (cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) { if ((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) { @@ -1652,7 +1655,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // Axis y- if (locationCellY > 0) { - if (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX)].r != 0) + if (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0) { if ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius) { @@ -1664,7 +1667,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // Axis y+ if (locationCellY < cubicmap.height - 1) { - if (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX)].r != 0) + if (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0) { if ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius) { @@ -1677,11 +1680,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p // Diagonals ------------------------------------------------------------------------------------------------------- // Axis x-, y- - if (locationCellX > 0 && locationCellY > 0) + if ((locationCellX > 0) && (locationCellY > 0)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX - 1)].r == 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX - 1)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r == 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r == 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX - 1)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) @@ -1700,11 +1703,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x-, y+ - if (locationCellX > 0 && locationCellY < cubicmap.height - 1) + if ((locationCellX > 0) && (locationCellY < cubicmap.height - 1)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX - 1)].r == 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX - 1)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r == 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r == 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX - 1)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) @@ -1723,11 +1726,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x+, y- - if (locationCellX < cubicmap.width - 1 && locationCellY > 0) + if ((locationCellX < cubicmap.width - 1) && (locationCellY > 0)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX + 1)].r == 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY - 1) * cubicmap.width + (locationCellX + 1)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r == 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r == 0) && + (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX + 1)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) @@ -1746,11 +1749,11 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p } // Axis x+, y+ - if (locationCellX < cubicmap.width - 1 && locationCellY < cubicmap.height - 1) + if ((locationCellX < cubicmap.width - 1) && (locationCellY < cubicmap.height - 1)) { - if ((cubicmapPixels[locationCellY * cubicmap.width + (locationCellX + 1)].r == 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY + 1) * cubicmap.width + (locationCellX + 1)].r != 0)) + if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r == 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r == 0) && + (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX + 1)].r != 0)) { if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) -- cgit v1.2.3 From 8bdd03eeac8cf91eb8eb9a5a0a1c434135a3c9a6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Jul 2016 18:34:02 +0200 Subject: Updated Oculus PC SDK to version 1.5 --- .../OculusSDK/LibOVR/Include/Extras/OVR_Math.h | 21 ++++- src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h | 102 ++++++++++++--------- .../OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h | 4 + .../OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h | 4 +- .../OculusSDK/LibOVR/Include/OVR_CAPI_GL.h | 4 +- .../OculusSDK/LibOVR/Include/OVR_ErrorCode.h | 80 ++-------------- .../OculusSDK/LibOVR/Include/OVR_Version.h | 2 +- src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll | Bin 964048 -> 1018320 bytes 8 files changed, 95 insertions(+), 122 deletions(-) (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h index c182ed5b..718c21cb 100644 --- a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h +++ b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h @@ -1487,6 +1487,25 @@ public: } } + // Decompose a quat into quat = swing * twist, where twist is a rotation about axis, + // and swing is a rotation perpendicular to axis. + Quat GetSwingTwist(const Vector3& axis, Quat* twist) const + { + OVR_MATH_ASSERT(twist); + OVR_MATH_ASSERT(axis.IsNormalized()); + + // Create a normalized quaternion from projection of (x,y,z) onto axis + T d = axis.Dot(Vector3(x, y, z)); + *twist = Quat(axis.x*d, axis.y*d, axis.z*d, w); + T len = twist->Length(); + if (len == 0) + twist->w = T(1); // identity + else + twist /= len; // normalize + + return *this * twist.Inverted(); + } + // Normalized linear interpolation of quaternions // NOTE: This function is a bad approximation of Slerp() // when the angle between the *this and b is large. @@ -1500,7 +1519,7 @@ public: Quat Slerp(const Quat& b, T s) const { Vector3 delta = (b * this->Inverted()).ToRotationVector(); - return FromRotationVector(delta * s) * *this; + return (FromRotationVector(delta * s) * *this).Normalized(); // normalize so errors don't accumulate } // Spherical linear interpolation: much faster for small rotations, accurate for large rotations. See FastTo/FromRotationVector diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h index b1ec3cc0..cf7aab62 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h @@ -493,7 +493,7 @@ typedef enum ovrStatusBits_ /// Specifies the description of a single sensor. /// -/// \see ovrGetTrackerDesc +/// \see ovr_GetTrackerDesc /// typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTrackerDesc_ { @@ -665,6 +665,18 @@ typedef enum ovrTextureFormat_ OVR_FORMAT_D32_FLOAT, OVR_FORMAT_D32_FLOAT_S8X24_UINT, + // Added in 1.5 compressed formats can be used for static layers + OVR_FORMAT_BC1_UNORM, + OVR_FORMAT_BC1_UNORM_SRGB, + OVR_FORMAT_BC2_UNORM, + OVR_FORMAT_BC2_UNORM_SRGB, + OVR_FORMAT_BC3_UNORM, + OVR_FORMAT_BC3_UNORM_SRGB, + OVR_FORMAT_BC6H_UF16, + OVR_FORMAT_BC6H_SF16, + OVR_FORMAT_BC7_UNORM, + OVR_FORMAT_BC7_UNORM_SRGB, + OVR_FORMAT_ENUMSIZE = 0x7fffffff ///< \internal Force type int32_t. } ovrTextureFormat; @@ -779,18 +791,20 @@ typedef enum ovrTouch_ ovrTouch_A = ovrButton_A, ovrTouch_B = ovrButton_B, ovrTouch_RThumb = ovrButton_RThumb, + ovrTouch_RThumbRest = 0x00000008, ovrTouch_RIndexTrigger = 0x00000010, // Bit mask of all the button touches on the right controller - ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RIndexTrigger, + ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger, ovrTouch_X = ovrButton_X, ovrTouch_Y = ovrButton_Y, ovrTouch_LThumb = ovrButton_LThumb, + ovrTouch_LThumbRest = 0x00000800, ovrTouch_LIndexTrigger = 0x00001000, // Bit mask of all the button touches on the left controller - ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LIndexTrigger, + ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger, // Finger pose state // Derived internally based on distance, proximity to sensors and filtering. @@ -959,36 +973,6 @@ extern "C" { // ----------------------------------------------------------------------------------- // ***** API Interfaces -// Overview of the API -// -// Setup: -// - ovr_Initialize(). -// - ovr_Create(&hmd, &graphicsId). -// - Use hmd members and ovr_GetFovTextureSize() to determine graphics configuration -// and ovr_GetRenderDesc() to get per-eye rendering parameters. -// - Allocate texture swap chains with ovr_CreateTextureSwapChainDX() or -// ovr_CreateTextureSwapChainGL(). Create any associated render target views or -// frame buffer objects. -// -// Application Loop: -// - Call ovr_GetPredictedDisplayTime() to get the current frame timing information. -// - Call ovr_GetTrackingState() and ovr_CalcEyePoses() to obtain the predicted -// rendering pose for each eye based on timing. -// - Render the scene content into the current buffer of the texture swapchains -// for each eye and layer you plan to update this frame. If you render into a -// texture swap chain, you must call ovr_CommitTextureSwapChain() on it to commit -// the changes before you reference the chain this frame (otherwise, your latest -// changes won't be picked up). -// - Call ovr_SubmitFrame() to render the distorted layers to and present them on the HMD. -// If ovr_SubmitFrame returns ovrSuccess_NotVisible, there is no need to render the scene -// for the next loop iteration. Instead, just call ovr_SubmitFrame again until it returns -// ovrSuccess. -// -// Shutdown: -// - ovr_Destroy(). -// - ovr_Shutdown(). - - /// Initializes LibOVR /// /// Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT @@ -1097,6 +1081,35 @@ OVR_PUBLIC_FUNCTION(const char*) ovr_GetVersionString(); OVR_PUBLIC_FUNCTION(int) ovr_TraceMessage(int level, const char* message); +/// Identify client application info. +/// +/// The string is one or more newline-delimited lines of optional info +/// indicating engine name, engine version, engine plugin name, engine plugin +/// version, engine editor. The order of the lines is not relevant. Individual +/// lines are optional. A newline is not necessary at the end of the last line. +/// Call after ovr_Initialize and before the first call to ovr_Create. +/// Each value is limited to 20 characters. Key names such as 'EngineName:' +/// 'EngineVersion:' do not count towards this limit. +/// +/// \param[in] identity Specifies one or more newline-delimited lines of optional info: +/// EngineName: %s\n +/// EngineVersion: %s\n +/// EnginePluginName: %s\n +/// EnginePluginVersion: %s\n +/// EngineEditor: ('true' or 'false')\n +/// +/// Example code +/// \code{.cpp} +/// ovr_IdentifyClient("EngineName: Unity\n" +/// "EngineVersion: 5.3.3\n" +/// "EnginePluginName: OVRPlugin\n" +/// "EnginePluginVersion: 1.2.0\n" +/// "EngineEditor: true"); +/// \endcode +/// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_IdentifyClient(const char* identity); + + //------------------------------------------------------------------------------------- /// @name HMD Management /// @@ -1153,7 +1166,7 @@ OVR_PUBLIC_FUNCTION(ovrTrackerDesc) ovr_GetTrackerDesc(ovrSession session, unsig /// Creates a handle to a VR session. /// /// Upon success the returned ovrSession must be eventually freed with ovr_Destroy when it is no longer needed. -/// A second call to ovr_Create will result in an error return value if the previous Hmd has not been destroyed. +/// A second call to ovr_Create will result in an error return value if the previous session has not been destroyed. /// /// \param[out] pSession Provides a pointer to an ovrSession which will be written to upon success. /// \param[out] luid Provides a system specific graphics adapter identifier that locates which @@ -1161,7 +1174,7 @@ OVR_PUBLIC_FUNCTION(ovrTrackerDesc) ovr_GetTrackerDesc(ovrSession session, unsig /// or no rendering output will be possible. This is important for stability on multi-adapter systems. An /// application that simply chooses the default adapter will not run reliably on multi-adapter systems. /// \return Returns an ovrResult indicating success or failure. Upon failure -/// the returned pHmd will be NULL. +/// the returned ovrSession will be NULL. /// /// Example code /// \code{.cpp} @@ -1177,7 +1190,7 @@ OVR_PUBLIC_FUNCTION(ovrTrackerDesc) ovr_GetTrackerDesc(ovrSession session, unsig OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* pLuid); -/// Destroys the HMD. +/// Destroys the session. /// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// \see ovr_Create @@ -1304,7 +1317,7 @@ OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session); /// ovrTrackingState value. Use 0 to request the most recent tracking state. /// \param[in] latencyMarker Specifies that this call is the point in time where /// the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer -/// provides "SensorSampleTimestamp", that will override the value stored here. +/// provides "SensorSampleTime", that will override the value stored here. /// \return Returns the ovrTrackingState that is predicted for the given absTime. /// /// \see ovrTrackingState, ovr_GetEyePoses, ovr_GetTimeInSeconds @@ -1363,11 +1376,10 @@ OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession ses /// /// \see ovrControllerType /// -OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, - float frequency, float amplitude); +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, float frequency, float amplitude); -///@} +///@} //------------------------------------------------------------------------------------- // @name Layers @@ -1768,7 +1780,7 @@ OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc) ovr_GetRenderDesc(ovrSession session, /// ovrLayerQuad layer1; /// ... /// ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header }; -/// ovrResult result = ovr_SubmitFrame(hmd, frameIndex, nullptr, layers, 2); +/// ovrResult result = ovr_SubmitFrame(session, frameIndex, nullptr, layers, 2); /// \endcode /// /// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true @@ -1844,7 +1856,7 @@ OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds(); /// App can toggle performance HUD modes as such: /// \code{.cpp} /// ovrPerfHudMode PerfHudMode = ovrPerfHud_LatencyTiming; -/// ovr_SetInt(Hmd, OVR_PERF_HUD_MODE, (int)PerfHudMode); +/// ovr_SetInt(session, OVR_PERF_HUD_MODE, (int)PerfHudMode); /// \endcode /// typedef enum ovrPerfHudMode_ @@ -1864,7 +1876,7 @@ typedef enum ovrPerfHudMode_ /// App can toggle layer HUD modes as such: /// \code{.cpp} /// ovrLayerHudMode LayerHudMode = ovrLayerHud_Info; -/// ovr_SetInt(Hmd, OVR_LAYER_HUD_MODE, (int)LayerHudMode); +/// ovr_SetInt(session, OVR_LAYER_HUD_MODE, (int)LayerHudMode); /// \endcode /// typedef enum ovrLayerHudMode_ @@ -1885,7 +1897,7 @@ typedef enum ovrLayerHudMode_ /// App can toggle the debug HUD modes as such: /// \code{.cpp} /// ovrDebugHudStereoMode DebugHudMode = ovrDebugHudStereo_QuadWithCrosshair; -/// ovr_SetInt(Hmd, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode); +/// ovr_SetInt(session, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode); /// \endcode /// /// The app can modify the visual properties of the stereo guide (i.e. quad, crosshair) @@ -2004,7 +2016,7 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetFloatArray(ovrSession session, const char* p /// \param[in] defaultVal Specifes the value to return if the property couldn't be read. /// \return Returns the string property if it exists. Otherwise returns defaultVal, which can be specified as NULL. /// The return memory is guaranteed to be valid until next call to ovr_GetString or -/// until the HMD is destroyed, whichever occurs first. +/// until the session is destroyed, whichever occurs first. OVR_PUBLIC_FUNCTION(const char*) ovr_GetString(ovrSession session, const char* propertyName, const char* defaultVal); diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h index c5344813..930dfcbe 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h @@ -9,6 +9,10 @@ #define OVR_CAPI_Audio_h #ifdef _WIN32 +// Prevents from defining min() and max() macro symbols. +#ifndef NOMINMAX +#define NOMINMAX +#endif #include #include "OVR_CAPI.h" #define OVR_AUDIO_MAX_DEVICE_STR_SIZE 128 diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h index 50806bca..982af8f0 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h @@ -25,7 +25,7 @@ /// \param[in] desc Specifies requested texture properties. See notes for more info about texture format. /// \param[in] bindFlags Specifies what ovrTextureBindFlags the application requires for this texture chain. /// \param[out] out_TextureSwapChain Returns the created ovrTextureSwapChain, which will be valid upon a successful return value, else it will be NULL. -/// This texture chain must be eventually destroyed via ovr_DestroyTextureSwapChain before destroying the HMD with ovr_Destroy. +/// This texture chain must be eventually destroyed via ovr_DestroyTextureSwapChain before destroying the session with ovr_Destroy. /// /// \return Returns an ovrResult indicating success or failure. In the case of failure, use /// ovr_GetLastErrorInfo to get more information. @@ -88,7 +88,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferDX(ovrSession sessio /// which must be the same one the application renders to the textures with. /// \param[in] desc Specifies requested texture properties. See notes for more info about texture format. /// \param[out] out_MirrorTexture Returns the created ovrMirrorTexture, which will be valid upon a successful return value, else it will be NULL. -/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the HMD with ovr_Destroy. +/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the session with ovr_Destroy. /// /// \return Returns an ovrResult indicating success or failure. In the case of failure, use /// ovr_GetLastErrorInfo to get more information. diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h index 1658ca57..81487947 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h @@ -15,7 +15,7 @@ /// \param[in] desc Specifies the requested texture properties. See notes for more info about texture format. /// \param[out] out_TextureSwapChain Returns the created ovrTextureSwapChain, which will be valid upon /// a successful return value, else it will be NULL. This texture swap chain must be eventually -/// destroyed via ovr_DestroyTextureSwapChain before destroying the HMD with ovr_Destroy. +/// destroyed via ovr_DestroyTextureSwapChain before destroying the session with ovr_Destroy. /// /// \return Returns an ovrResult indicating success or failure. In the case of failure, use /// ovr_GetLastErrorInfo to get more information. @@ -64,7 +64,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainBufferGL(ovrSession sessio /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// \param[in] desc Specifies the requested mirror texture description. /// \param[out] out_MirrorTexture Specifies the created ovrMirrorTexture, which will be valid upon a successful return value, else it will be NULL. -/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the HMD with ovr_Destroy. +/// This texture must be eventually destroyed via ovr_DestroyMirrorTexture before destroying the session with ovr_Destroy. /// /// \return Returns an ovrResult indicating success or failure. In the case of failure, use /// ovr_GetLastErrorInfo to get more information. diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h index ed0be0e7..9fc527c7 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h @@ -14,9 +14,6 @@ - - - #ifndef OVR_RESULT_DEFINED #define OVR_RESULT_DEFINED ///< Allows ovrResult to be independently defined. /// API call results are represented at the highest level by a single ovrResult. @@ -59,27 +56,26 @@ typedef enum ovrSuccessType_ { /// This is a general success result. Use OVR_SUCCESS to test for success. ovrSuccess = 0, +} ovrSuccessType; +#endif +// Public success types +// Success is a value greater or equal to 0, while all error types are negative values. +typedef enum ovrSuccessTypes_ +{ /// Returned from a call to SubmitFrame. The call succeeded, but what the app /// rendered will not be visible on the HMD. Ideally the app should continue /// calling SubmitFrame, but not do any rendering. When the result becomes /// ovrSuccess, rendering should continue as usual. ovrSuccess_NotVisible = 1000, - ovrSuccess_HMDFirmwareMismatch = 4100, ///< The HMD Firmware is out of date but is acceptable. - ovrSuccess_TrackerFirmwareMismatch = 4101, ///< The Tracker Firmware is out of date but is acceptable. - ovrSuccess_ControllerFirmwareMismatch = 4104, ///< The controller firmware is out of date but is acceptable. - ovrSuccess_TrackerDriverNotFound = 4105, ///< The tracker driver interface was not found. Can be a temporary error - -} ovrSuccessType; -#endif - +} ovrSuccessTypes; +// Public error types typedef enum ovrErrorType_ { /* General errors */ ovrError_MemoryAllocationFailure = -1000, ///< Failure to allocate memory. - ovrError_SocketCreationFailure = -1001, ///< Failure to create a socket. ovrError_InvalidSession = -1002, ///< Invalid ovrSession parameter provided. ovrError_Timeout = -1003, ///< The operation timed out. ovrError_NotInitialized = -1004, ///< The system or component has not been initialized. @@ -94,10 +90,8 @@ typedef enum ovrErrorType_ ovrError_ServiceDeadlockDetected = -1014, ///< The service watchdog discovered a deadlock. /* Audio error range, reserved for Audio errors. */ - ovrError_AudioReservedBegin = -2000, ///< First Audio error. ovrError_AudioDeviceNotFound = -2001, ///< Failure to find the specified audio device. ovrError_AudioComError = -2002, ///< Generic COM error. - ovrError_AudioReservedEnd = -2999, ///< Last Audio error. /* Initialization errors. */ ovrError_Initialize = -3000, ///< Generic initialization error. @@ -122,51 +116,6 @@ typedef enum ovrErrorType_ ovrError_DisplayManagerInit = -3019, ///< Initialization of the DisplayManager failed. ovrError_TrackerDriverInit = -3020, ///< Failed to get the interface for an attached tracker - /* Hardware errors */ - ovrError_InvalidBundleAdjustment = -4000, ///< Headset has no bundle adjustment data. - ovrError_USBBandwidth = -4001, ///< The USB hub cannot handle the camera frame bandwidth. - ovrError_USBEnumeratedSpeed = -4002, ///< The USB camera is not enumerating at the correct device speed. - ovrError_ImageSensorCommError = -4003, ///< Unable to communicate with the image sensor. - ovrError_GeneralTrackerFailure = -4004, ///< We use this to report various sensor issues that don't fit in an easily classifiable bucket. - ovrError_ExcessiveFrameTruncation = -4005, ///< A more than acceptable number of frames are coming back truncated. - ovrError_ExcessiveFrameSkipping = -4006, ///< A more than acceptable number of frames have been skipped. - ovrError_SyncDisconnected = -4007, ///< The sensor is not receiving the sync signal (cable disconnected?). - ovrError_TrackerMemoryReadFailure = -4008, ///< Failed to read memory from the sensor. - ovrError_TrackerMemoryWriteFailure = -4009, ///< Failed to write memory from the sensor. - ovrError_TrackerFrameTimeout = -4010, ///< Timed out waiting for a camera frame. - ovrError_TrackerTruncatedFrame = -4011, ///< Truncated frame returned from sensor. - ovrError_TrackerDriverFailure = -4012, ///< The sensor driver has encountered a problem. - ovrError_TrackerNRFFailure = -4013, ///< The sensor wireless subsystem has encountered a problem. - ovrError_HardwareGone = -4014, ///< The hardware has been unplugged - ovrError_NordicEnabledNoSync = -4015, ///< The nordic indicates that sync is enabled but it is not sending sync pulses - ovrError_NordicSyncNoFrames = -4016, ///< It looks like we're getting a sync signal, but no camera frames have been received - ovrError_CatastrophicFailure = -4017, ///< A catastrophic failure has occurred. We will attempt to recover by resetting the device - ovrError_CatastrophicTimeout = -4018, ///< The catastrophic recovery has timed out. - ovrError_RepeatCatastrophicFail = -4019, ///< Catastrophic failure has repeated too many times. - ovrError_USBOpenDeviceFailure = -4020, ///< Could not open handle for Rift device (likely already in use by another process). - ovrError_HMDGeneralFailure = -4021, ///< Unexpected HMD issues that don't fit a specific bucket. - - ovrError_HMDFirmwareMismatch = -4100, ///< The HMD Firmware is out of date and is unacceptable. - ovrError_TrackerFirmwareMismatch = -4101, ///< The sensor Firmware is out of date and is unacceptable. - ovrError_BootloaderDeviceDetected = -4102, ///< A bootloader HMD is detected by the service. - ovrError_TrackerCalibrationError = -4103, ///< The sensor calibration is missing or incorrect. - ovrError_ControllerFirmwareMismatch = -4104, ///< The controller firmware is out of date and is unacceptable. - ovrError_DevManDeviceDetected = -4105, ///< A DeviceManagement mode HMD is detected by the service. - ovrError_RebootedBootloaderDevice = -4106, ///< Had to reboot bootloader device, which succeeded. - ovrError_FailedRebootBootloaderDev = -4107, ///< Had to reboot bootloader device, which failed. Device is stuck in bootloader mode. - - ovrError_IMUTooManyLostSamples = -4200, ///< Too many lost IMU samples. - ovrError_IMURateError = -4201, ///< IMU rate is outside of the expected range. - ovrError_FeatureReportFailure = -4202, ///< A feature report has failed. - ovrError_HMDWirelessTimeout = -4203, ///< HMD wireless interface never returned from busy state. - - ovrError_BootloaderAssertLog = -4300, ///< HMD Bootloader Assert Log was not empty. - ovrError_AppAssertLog = -4301, ///< HMD App Assert Log was not empty. - - /* Synchronization errors */ - ovrError_Incomplete = -5000, ///< Requested async work not yet complete. - ovrError_Abandoned = -5001, ///< Requested async work was abandoned and result is incomplete. - /* Rendering errors */ ovrError_DisplayLost = -6000, ///< In the event of a system-wide graphics reset or cable unplug this is returned to the app. ovrError_TextureSwapChainFull = -6001, ///< ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. @@ -182,18 +131,6 @@ typedef enum ovrErrorType_ ovrError_RuntimeException = -7000, ///< A runtime exception occurred. The application is required to shutdown LibOVR and re-initialize it before this error state will be cleared. - ovrError_MetricsUnknownApp = -90000, - ovrError_MetricsDuplicateApp = -90001, - ovrError_MetricsNoEvents = -90002, - ovrError_MetricsRuntime = -90003, - ovrError_MetricsFile = -90004, - ovrError_MetricsNoClientInfo = -90005, - ovrError_MetricsNoAppMetaData = -90006, - ovrError_MetricsNoApp = -90007, - ovrError_MetricsOafFailure = -90008, - ovrError_MetricsSessionAlreadyActive = -90009, - ovrError_MetricsSessionNotActive = -90010, - } ovrErrorType; @@ -206,4 +143,5 @@ typedef struct ovrErrorInfo_ char ErrorString[512]; ///< A UTF8-encoded null-terminated English string describing the problem. The format of this string is subject to change in future versions. } ovrErrorInfo; + #endif /* OVR_ErrorCode_h */ diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h index dbfe4deb..376fa7d5 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h @@ -19,7 +19,7 @@ // Master version numbers #define OVR_PRODUCT_VERSION 1 // Product version doesn't participate in semantic versioning. #define OVR_MAJOR_VERSION 1 // If you change these values then you need to also make sure to change LibOVR/Projects/Windows/LibOVR.props in parallel. -#define OVR_MINOR_VERSION 4 // +#define OVR_MINOR_VERSION 5 // #define OVR_PATCH_VERSION 0 #define OVR_BUILD_NUMBER 0 diff --git a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll index 70f63f70..8553ce11 100644 Binary files a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll and b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll differ -- cgit v1.2.3 From 3fb1c446ea5cf7fe813b0809894e938232ab1738 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Jul 2016 18:34:28 +0200 Subject: Corrected issue on RPI on model drawing --- src/rlgl.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 57e6b894..af2d57cb 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -31,6 +31,7 @@ #include // Required for: fopen(), fclose(), fread()... [Used only on ReadTextFile()] #include // Required for: malloc(), free(), rand() #include // Required for: strcmp(), strlen(), strtok() +#include // Required for: atan() #ifndef RLGL_STANDALONE #include "raymath.h" // Required for Vector3 and Matrix functions @@ -1648,8 +1649,8 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) int drawHint = GL_STATIC_DRAW; if (dynamic) drawHint = GL_DYNAMIC_DRAW; - GLuint vaoId = 0; // Vertex Array Objects (VAO) - GLuint vboId[7]; // Vertex Buffer Objects (VBOs) + GLuint vaoId = 0; // Vertex Array Objects (VAO) + GLuint vboId[7] = { 0 }; // Vertex Buffer Objects (VBOs) if (vaoSupported) { @@ -1745,7 +1746,6 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short)*mesh->triangleCount*3, mesh->indices, GL_STATIC_DRAW); } - mesh->vboId[0] = vboId[0]; // Vertex position VBO mesh->vboId[1] = vboId[1]; // Texcoords VBO mesh->vboId[2] = vboId[2]; // Normals VBO @@ -1912,12 +1912,12 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Upload to shader glossiness glUniform1f(glGetUniformLocation(material.shader.id, "glossiness"), material.glossiness); } - + // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, material.texDiffuse.id); glUniform1i(material.shader.mapTexture0Loc, 0); // Diffuse texture fits in active texture unit 0 - + if ((material.texNormal.id != 0) && (material.shader.mapTexture1Loc != -1)) { // Upload to shader specular map flag @@ -1937,7 +1937,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); glUniform1i(material.shader.mapTexture2Loc, 2); // Specular texture fits in active texture unit 2 } - + if (vaoSupported) { glBindVertexArray(mesh.vaoId); @@ -1962,12 +1962,22 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glEnableVertexAttribArray(material.shader.normalLoc); } - // Bind mesh VBO data: vertex colors (shader-location = 3, if available) , tangents, texcoords2 (if available) + // Bind mesh VBO data: vertex colors (shader-location = 3, if available) if (material.shader.colorLoc != -1) { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); - glVertexAttribPointer(material.shader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); - glEnableVertexAttribArray(material.shader.colorLoc); + if (mesh.vboId[3] != 0) + { + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); + glVertexAttribPointer(material.shader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); + glEnableVertexAttribArray(material.shader.colorLoc); + } + else + { + // Set default value for unused attribute + // NOTE: Required when using default shader and no VAO support + glVertexAttrib4f(material.shader.colorLoc, 1.0f, 1.0f, 1.0f, 1.0f); + glDisableVertexAttribArray(material.shader.colorLoc); + } } // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) @@ -1992,6 +2002,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) for (int eye = 0; eye < eyesCount; eye++) { if (eyesCount == 2) SetOculusView(eye, matProjection, matModelView); + else modelview = matModelView; // Calculate model-view-projection matrix (MVP) Matrix matMVP = MatrixMultiply(modelview, projection); // Transform to screen-space coordinates @@ -2677,7 +2688,7 @@ static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView) float viewCenter = (float)HScreenSize*0.25f; float eyeProjectionShift = viewCenter - LensSeparationDistance*0.5f; - float projectionCenterOffset = 4.0f*eyeProjectionShift/(float)HScreenSize; + float projectionCenterOffset = eyeProjectionShift/(float)HScreenSize; //4.0f*eyeProjectionShift/(float)HScreenSize; /* static float scale[2] = { 0.25, 0.45 }; @@ -3274,7 +3285,7 @@ static void LoadDefaultBuffers(void) glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); if (vaoSupported) TraceLog(INFO, "[VAO ID %i] Default buffers VAO initialized successfully (triangles)", triangles.vaoId); - else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully(triangles)", triangles.vboId[0], triangles.vboId[1]); + else TraceLog(INFO, "[VBO ID %i][VBO ID %i] Default buffers VBOs initialized successfully (triangles)", triangles.vboId[0], triangles.vboId[1]); // Upload and link quads vertex buffers if (vaoSupported) -- cgit v1.2.3 From 2ff2096b36d80078cbda5e61ff77d7fedeeeaeb5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Jul 2016 18:35:50 +0200 Subject: Moved Oculus enable drawing to user side... Still thinking about the best way to manage this... --- src/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index a8557831..f8a83e25 100644 --- a/src/core.c +++ b/src/core.c @@ -521,7 +521,7 @@ void BeginDrawing(void) updateTime = currentTime - previousTime; previousTime = currentTime; - if (IsOculusReady()) BeginOculusDrawing(); + //if (IsOculusReady()) BeginOculusDrawing(); rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -536,7 +536,7 @@ void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - if (IsOculusReady()) EndOculusDrawing(); + //if (IsOculusReady()) EndOculusDrawing(); SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -2675,7 +2675,7 @@ static void *MouseThread(void *arg) int mouseRelX = 0; int mouseRelY = 0; - while (1) + while (!windowShouldClose) { if (read(mouseStream, &mouse, sizeof(MouseEvent)) == (int)sizeof(MouseEvent)) { -- cgit v1.2.3 From bc80174357392c0a16b74cd4a9e497a1de367760 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 6 Jul 2016 00:54:38 +0200 Subject: VR Functions renaming (for generic HMD device) Stereo rendering has been moved again to Begin3dMode() and End3dMode(), it has some limitations but makes more sense... --- src/core.c | 8 ++++---- src/raylib.h | 29 +++++++++++++++++++++-------- src/rlgl.c | 45 +++++++++++++++++++++++---------------------- src/rlgl.h | 16 ++++++++-------- 4 files changed, 56 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index f8a83e25..107fc0a0 100644 --- a/src/core.c +++ b/src/core.c @@ -521,8 +521,6 @@ void BeginDrawing(void) updateTime = currentTime - previousTime; previousTime = currentTime; - //if (IsOculusReady()) BeginOculusDrawing(); - rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) rlMultMatrixf(MatrixToFloat(downscaleView)); // If downscale required, apply it here @@ -535,8 +533,6 @@ void BeginDrawing(void) void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - - //if (IsOculusReady()) EndOculusDrawing(); SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -590,6 +586,8 @@ void End2dMode(void) void Begin3dMode(Camera camera) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + if (IsVrDeviceReady()) BeginVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix @@ -618,6 +616,8 @@ void Begin3dMode(Camera camera) void End3dMode(void) { rlglDraw(); // Process internal buffers (update + draw) + + if (IsVrDeviceReady()) EndVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack diff --git a/src/raylib.h b/src/raylib.h index 89fc457f..227f83f2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -527,6 +527,19 @@ typedef struct GestureEvent { // Camera system modes typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; +// Head Mounted Display devices +typedef enum { + HMD_DEFAULT_DEVICE = 0, + HMD_OCULUS_RIFT_DK2, + HMD_OCULUS_RIFT_CV1, + HMD_VALVE_HTC_VIVE, + HMD_SAMSUNG_GEAR_VR, + HMD_GOOGLE_CARDBOARD, + HMD_SONY_PLAYSTATION_VR, + HMD_RAZER_OSVR, + HMD_FOVE_VR, +} HmdDevice; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -846,16 +859,16 @@ Light CreateLight(int type, Vector3 position, Color diffuse); // Create a void DestroyLight(Light light); // Destroy a light and take it out of the list //------------------------------------------------------------------------------------ -// Oculus Rift CV1 Functions (Module: rlgl) +// VR experience Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -void InitOculusDevice(void); // Init Oculus Rift device -void CloseOculusDevice(void); // Close Oculus Rift device -void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void BeginOculusDrawing(void); // Begin Oculus drawing configuration -void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) -bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready -void ToggleVR(void); // Enable/Disable VR experience (Oculus device or simulator) +void InitVrDevice(int hmdDevice); // Init VR device +void CloseVrDevice(void); // Close VR device +void UpdateVrTracking(void); // Update VR tracking (position and orientation) +void BeginVrDrawing(void); // Begin VR drawing configuration +void EndVrDrawing(void); // End VR drawing process (and desktop mirror) +bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) diff --git a/src/rlgl.c b/src/rlgl.c index af2d57cb..a71142b0 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -322,7 +322,7 @@ static void DrawDefaultBuffers(int eyesCount); // Draw default internal buffers static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU // Set internal projection and modelview matrix depending on eyes tracking data -static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView); +static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array @@ -2001,7 +2001,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) for (int eye = 0; eye < eyesCount; eye++) { - if (eyesCount == 2) SetOculusView(eye, matProjection, matModelView); + if (eyesCount == 2) SetStereoView(eye, matProjection, matModelView); else modelview = matModelView; // Calculate model-view-projection matrix (MVP) @@ -2504,8 +2504,9 @@ void DestroyLight(Light light) #endif } -// Init Oculus Rift device (or Oculus device simulator) -void InitOculusDevice(void) +// Init VR device (or simulator) +// NOTE: If device is not available, it fallbacks to default device (simulator) +void InitVrDevice(int hmdDevice) { #if defined(RLGL_OCULUS_SUPPORT) // Initialize Oculus device @@ -2557,7 +2558,7 @@ void InitOculusDevice(void) if (!oculusReady) { - TraceLog(WARNING, "VR: Initializing Oculus simulator"); + TraceLog(WARNING, "HMD Device not found: Initializing VR simulator"); // Initialize framebuffer and textures for stereo rendering stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); @@ -2571,8 +2572,8 @@ void InitOculusDevice(void) } } -// Close Oculus Rift device (or Oculus device simulator) -void CloseOculusDevice(void) +// Close VR device (or simulator) +void CloseVrDevice(void) { #if defined(RLGL_OCULUS_SUPPORT) if (oculusReady) @@ -2596,20 +2597,20 @@ void CloseOculusDevice(void) oculusReady = false; } -// Detect if oculus device is available -bool IsOculusReady(void) +// Detect if VR device is available +bool IsVrDeviceReady(void) { return (oculusReady || oculusSimulator) && vrEnabled; } -// Enable/Disable VR experience (Oculus device or simulator) -void ToggleVR(void) +// Enable/Disable VR experience (device or simulator) +void ToggleVrMode(void) { vrEnabled = !vrEnabled; } -// Update Oculus Rift tracking (position and orientation) -void UpdateOculusTracking(void) +// Update VR tracking (position and orientation) +void UpdateVrTracking(void) { #if defined(RLGL_OCULUS_SUPPORT) if (oculusReady) @@ -2641,7 +2642,7 @@ void UpdateOculusTracking(void) } // Set internal projection and modelview matrix depending on eyes tracking data -static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView) +static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) { if (vrEnabled) { @@ -2675,12 +2676,12 @@ static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView) // Setup viewport and projection/modelview matrices using tracking data rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - static float IPD = 0.064f; // InterpupillaryDistance + static float IPD = 0.064f; // InterpupillaryDistance float HScreenSize = 0.14976f; - float VScreenSize = 0.0936f; // HScreenSize/(1280.0f/800.0f) - float VScreenCenter = 0.04675f; + float VScreenSize = 0.0936f; // HScreenSize/(1280.0f/800.0f) (DK2) + float VScreenCenter = 0.04675f; // VScreenSize/2 float EyeToScreenDistance = 0.041f; - float LensSeparationDistance = 0.064f; //0.0635f (DK1) + float LensSeparationDistance = 0.064f; //0.0635f (DK1) // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) float halfScreenDistance = VScreenSize/2.0f; @@ -2730,13 +2731,13 @@ static void SetOculusView(int eye, Matrix matProjection, Matrix matModelView) MatrixTranspose(&eyeProjection); } - SetMatrixModelview(eyeModelView); // ERROR! We are modifying modelview for next eye!!! + SetMatrixModelview(eyeModelView); SetMatrixProjection(eyeProjection); } } // Begin Oculus drawing configuration -void BeginOculusDrawing(void) +void BeginVrDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) if (oculusReady) @@ -2771,7 +2772,7 @@ void BeginOculusDrawing(void) } // End Oculus drawing process (and desktop mirror) -void EndOculusDrawing(void) +void EndVrDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) if (oculusReady) @@ -3414,7 +3415,7 @@ static void DrawDefaultBuffers(int eyesCount) for (int eye = 0; eye < eyesCount; eye++) { - if (eyesCount == 2) SetOculusView(eye, matProjection, matModelView); + if (eyesCount == 2) SetStereoView(eye, matProjection, matModelView); // Set current shader and upload current MVP matrix if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) diff --git a/src/rlgl.h b/src/rlgl.h index f52af6f9..f984c0c6 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -350,15 +350,15 @@ Light CreateLight(int type, Vector3 position, Color diffuse); // Create a void DestroyLight(Light light); // Destroy a light and take it out of the list void TraceLog(int msgType, const char *text, ...); -#endif -void InitOculusDevice(void); // Init Oculus Rift device -void CloseOculusDevice(void); // Close Oculus Rift device -void UpdateOculusTracking(void); // Update Oculus Rift tracking (position and orientation) -void BeginOculusDrawing(void); // Begin Oculus drawing configuration -void EndOculusDrawing(void); // End Oculus drawing process (and desktop mirror) -bool IsOculusReady(void); // Detect if oculus device (or simulator) is ready -void ToggleVR(void); // Enable/Disable VR experience (Oculus device or simulator) +void InitVrDevice(int hmdDevice); // Init VR device +void CloseVrDevice(void); // Close VR device +void UpdateVrTracking(void); // Update VR tracking (position and orientation) +void BeginVrDrawing(void); // Begin VR drawing configuration +void EndVrDrawing(void); // End VR drawing process (and desktop mirror) +bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) +#endif #ifdef __cplusplus } -- cgit v1.2.3 From 8fd450784799d553a649a69df92497d32415140b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 6 Jul 2016 20:02:15 +0200 Subject: Corrected bug on Raspberry Pi with strcat() --- src/text.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index b5f7ad0c..ec2480e3 100644 --- a/src/text.c +++ b/src/text.c @@ -782,12 +782,15 @@ static SpriteFont LoadBMFont(const char *fileName) char *texPath = NULL; char *lastSlash = NULL; - lastSlash = strrchr(fileName, '/'); // you need escape character - texPath = malloc(strlen(fileName) - strlen(lastSlash) + 1 + strlen(texFileName) + 1); - memcpy(texPath, fileName, strlen(fileName) - strlen(lastSlash)); - strcat(texPath, "/"); - strcat(texPath, texFileName); - strcat(texPath, "\0"); + lastSlash = strrchr(fileName, '/'); + + // NOTE: We need some extra space to avoid memory corruption on next allocations! + texPath = malloc(strlen(fileName) - strlen(lastSlash) + strlen(texFileName) + 4); + + // NOTE: strcat() and strncat() required a '\0' terminated string to work! + *texPath = '\0'; + strncat(texPath, fileName, strlen(fileName) - strlen(lastSlash) + 1); + strncat(texPath, texFileName, strlen(texFileName)); TraceLog(DEBUG, "[%s] Font texture loading path: %s", fileName, texPath); @@ -828,7 +831,7 @@ static SpriteFont LoadBMFont(const char *fileName) else if (unorderedChars) TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); // NOTE: Font data could be not ordered by charId: 32,33,34,35... raylib does not support unordered BMFonts - if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars)) + if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars) || (font.texture.id == 0)) { UnloadSpriteFont(font); font = GetDefaultFont(); -- cgit v1.2.3 From e2a3a52ad6acaacf8c839fcefd405ff3258dcad9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 6 Jul 2016 20:02:33 +0200 Subject: Edited comment --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index a71142b0..089e2809 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -260,7 +260,7 @@ static bool texCompASTCSupported = false; // ASTC texture compression support // Lighting data static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount; // Counts current enabled physic objects +static int lightsCount; // Enabled lights counter #endif #if defined(RLGL_OCULUS_SUPPORT) -- cgit v1.2.3 From 7cefbd8a947551f6c63dba88117099d6c0f4998b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 6 Jul 2016 20:33:46 +0200 Subject: Updated lighting system... ...to avoid dynamic conditions on for loop (lightsCount) on standard shader, it seems GLSL 100 doesn't support that feature... on some GPUs like RaspberryPi... --- src/raylib.h | 2 +- src/rlgl.c | 196 +++++++++++++++++++++++++++----------------------- src/rlgl.h | 4 +- src/standard_shader.h | 3 +- 4 files changed, 109 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 227f83f2..1d160492 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -431,8 +431,8 @@ typedef struct Model { // Light type typedef struct LightData { unsigned int id; // Light unique id - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT bool enabled; // Light enabled + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT Vector3 position; // Light position Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) diff --git a/src/rlgl.c b/src/rlgl.c index 089e2809..aa729824 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -260,7 +260,7 @@ static bool texCompASTCSupported = false; // ASTC texture compression support // Lighting data static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount; // Enabled lights counter +static int lightsCount = 0; // Enabled lights counter #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -2454,24 +2454,28 @@ Light CreateLight(int type, Vector3 position, Color diffuse) Light light = NULL; #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Allocate dynamic memory - light = (Light)malloc(sizeof(LightData)); - - // Initialize light values with generic values - light->id = lightsCount; - light->type = type; - light->enabled = true; - - light->position = position; - light->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - light->intensity = 1.0f; - light->diffuse = diffuse; - - // Add new light to the array - lights[lightsCount] = light; - - // Increase enabled lights count - lightsCount++; + if (lightsCount < MAX_LIGHTS) + { + // Allocate dynamic memory + light = (Light)malloc(sizeof(LightData)); + + // Initialize light values with generic values + light->id = lightsCount; + light->type = type; + light->enabled = true; + + light->position = position; + light->target = (Vector3){ 0.0f, 0.0f, 0.0f }; + light->intensity = 1.0f; + light->diffuse = diffuse; + + // Add new light to the array + lights[lightsCount] = light; + + // Increase enabled lights count + lightsCount++; + } + else TraceLog(WARNING, "Too many lights, only supported up to %i lights", MAX_LIGHTS); #else // TODO: Support OpenGL 1.1 lighting system TraceLog(WARNING, "Lighting currently not supported on OpenGL 1.1"); @@ -2484,23 +2488,26 @@ Light CreateLight(int type, Vector3 position, Color diffuse) void DestroyLight(Light light) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - // Free dynamic memory allocation - free(lights[light->id]); - - // Remove *obj from the pointers array - for (int i = light->id; i < lightsCount; i++) + if (light != NULL) { - // Resort all the following pointers of the array - if ((i + 1) < lightsCount) + // Free dynamic memory allocation + free(lights[light->id]); + + // Remove *obj from the pointers array + for (int i = light->id; i < lightsCount; i++) { - lights[i] = lights[i + 1]; - lights[i]->id = lights[i + 1]->id; + // Resort all the following pointers of the array + if ((i + 1) < lightsCount) + { + lights[i] = lights[i + 1]; + lights[i]->id = lights[i + 1]->id; + } + else free(lights[i]); } - else free(lights[i]); + + // Decrease enabled physic objects count + lightsCount--; } - - // Decrease enabled physic objects count - lightsCount--; #endif } @@ -3625,72 +3632,79 @@ static void UnloadDefaultBuffers(void) // NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0f static void SetShaderLights(Shader shader) { - int locPoint = glGetUniformLocation(shader.id, "lightsCount"); - glUniform1i(locPoint, lightsCount); - + int locPoint = -1; char locName[32] = "lights[x].position\0"; - for (int i = 0; i < lightsCount; i++) + for (int i = 0; i < MAX_LIGHTS; i++) { locName[7] = '0' + i; - - memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform1i(locPoint, lights[i]->enabled); - - memcpy(&locName[10], "type\0", strlen("type\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform1i(locPoint, lights[i]->type); - - memcpy(&locName[10], "diffuse\0", strlen("diffuse\0") + 2); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); - - memcpy(&locName[10], "intensity\0", strlen("intensity\0")); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform1f(locPoint, lights[i]->intensity); - - switch (lights[i]->type) + + if (lights[i] != NULL) // Only upload registered lights data { - case LIGHT_POINT: - { - memcpy(&locName[10], "position\0", strlen("position\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - - memcpy(&locName[10], "radius\0", strlen("radius\0") + 2); - locPoint = GetShaderLocation(shader, locName); - glUniform1f(locPoint, lights[i]->radius); - } break; - case LIGHT_DIRECTIONAL: - { - memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); - locPoint = GetShaderLocation(shader, locName); - Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; - VectorNormalize(&direction); - glUniform3f(locPoint, direction.x, direction.y, direction.z); - } break; - case LIGHT_SPOT: + memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform1i(locPoint, lights[i]->enabled); + + memcpy(&locName[10], "type\0", strlen("type\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform1i(locPoint, lights[i]->type); + + memcpy(&locName[10], "diffuse\0", strlen("diffuse\0") + 2); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); + + memcpy(&locName[10], "intensity\0", strlen("intensity\0")); + locPoint = glGetUniformLocation(shader.id, locName); + glUniform1f(locPoint, lights[i]->intensity); + + switch (lights[i]->type) { - memcpy(&locName[10], "position\0", strlen("position\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - - memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); - locPoint = GetShaderLocation(shader, locName); - - Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; - VectorNormalize(&direction); - glUniform3f(locPoint, direction.x, direction.y, direction.z); - - memcpy(&locName[10], "coneAngle\0", strlen("coneAngle\0")); - locPoint = GetShaderLocation(shader, locName); - glUniform1f(locPoint, lights[i]->coneAngle); - } break; - default: break; + case LIGHT_POINT: + { + memcpy(&locName[10], "position\0", strlen("position\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + + memcpy(&locName[10], "radius\0", strlen("radius\0") + 2); + locPoint = GetShaderLocation(shader, locName); + glUniform1f(locPoint, lights[i]->radius); + } break; + case LIGHT_DIRECTIONAL: + { + memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); + locPoint = GetShaderLocation(shader, locName); + Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + VectorNormalize(&direction); + glUniform3f(locPoint, direction.x, direction.y, direction.z); + } break; + case LIGHT_SPOT: + { + memcpy(&locName[10], "position\0", strlen("position\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + + memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); + locPoint = GetShaderLocation(shader, locName); + + Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + VectorNormalize(&direction); + glUniform3f(locPoint, direction.x, direction.y, direction.z); + + memcpy(&locName[10], "coneAngle\0", strlen("coneAngle\0")); + locPoint = GetShaderLocation(shader, locName); + glUniform1f(locPoint, lights[i]->coneAngle); + } break; + default: break; + } + + // TODO: Pass to the shader any other required data from LightData struct + } + else // Not enabled lights + { + memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); + locPoint = GetShaderLocation(shader, locName); + glUniform1i(locPoint, 0); } - - // TODO: Pass to the shader any other required data from LightData struct } } diff --git a/src/rlgl.h b/src/rlgl.h index f984c0c6..9afafc52 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -218,9 +218,9 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // Light type typedef struct LightData { unsigned int id; // Light unique id - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT bool enabled; // Light enabled - + int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT + Vector3 position; // Light position Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) float radius; // Light attenuation radius light intensity reduced with distance (world distance) diff --git a/src/standard_shader.h b/src/standard_shader.h index e1668ae7..deae7fe1 100644 --- a/src/standard_shader.h +++ b/src/standard_shader.h @@ -78,7 +78,6 @@ static const char fStandardShaderStr[] = " float radius; \n" " float coneAngle; }; \n" "const int maxLights = 8; \n" -"uniform int lightsCount; \n" "uniform Light lights[maxLights]; \n" "\n" "vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s) \n" @@ -157,7 +156,7 @@ static const char fStandardShaderStr[] = #elif defined(GRAPHICS_API_OPENGL_33) " if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" #endif -" for (int i = 0; i < lightsCount; i++)\n" +" for (int i = 0; i < maxLights; i++)\n" " {\n" " if (lights[i].enabled == 1)\n" " {\n" -- cgit v1.2.3 From 3922bc27cda94e4d174f079ea04f0eeca8b364ab Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 8 Jul 2016 00:57:27 +0200 Subject: Supporting multiple HMD configurations -IN PROGRESS- --- src/rlgl.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index aa729824..25a6745c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -188,6 +188,20 @@ typedef struct { //Guint fboId; } DrawCall; +// Head-Mounted-Display device parameters +typedef struct { + int hResolution; // HMD horizontal resolution in pixels + int vResolution; // HMD vertical resolution in pixels + float hScreenSize; // HMD horizontal size in meters + float vScreenSize; // HMD vertical size in meters + float vScreenCenter; // HMD screen center in meters + float eyeToScreenDistance; // HMD distance between eye and display in meters + float lensSeparationDistance; // HMD lens separation distance in meters + float interpupillaryDistance; // HMD IPD (distance between pupils) in meters + float distortionK[4]; // HMD lens distortion constant parameters + float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters +} VrDeviceInfo; + #if defined(RLGL_OCULUS_SUPPORT) typedef struct OculusBuffer { ovrTextureSwapChain textureChain; @@ -324,6 +338,9 @@ static void UnloadDefaultBuffers(void); // Unload default internal buffers v // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); +// Configure stereo rendering (including distortion shader) with HMD device parameters +static void SetupVrDevice(VrDeviceInfo hmd); + static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array static char *ReadTextFile(const char *fileName); @@ -2535,7 +2552,7 @@ void InitVrDevice(int hmdDevice) else { hmdDesc = ovr_GetHmdDesc(session); - + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); @@ -2685,10 +2702,10 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) static float IPD = 0.064f; // InterpupillaryDistance float HScreenSize = 0.14976f; - float VScreenSize = 0.0936f; // HScreenSize/(1280.0f/800.0f) (DK2) + float VScreenSize = 0.09356f; // HScreenSize/(1280.0f/800.0f) (DK2) float VScreenCenter = 0.04675f; // VScreenSize/2 float EyeToScreenDistance = 0.041f; - float LensSeparationDistance = 0.064f; //0.0635f (DK1) + float LensSeparationDistance = 0.0635f; //0.0635f (DK2) // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) float halfScreenDistance = VScreenSize/2.0f; @@ -3870,7 +3887,81 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) } #endif +// Configure stereo rendering (including distortion shader) with HMD device parameters +static void SetupVrDevice(VrDeviceInfo hmd) +{ + // Compute aspect ratio and FOV + float aspect = ((float)hmd.hResolution/2.0f)/(float)hmd.vResolution; + + // Fov-y is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG + // ...but with lens distortion it is increased (see Oculus SDK Documentation) + float radius = -1.0 - (4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize); + float distScale = (hmd.distortionK[0] + hmd.distortionK[1]*pow(radius, 2) + hmd.distortionK[2]*pow(radius, 4) + hmd.distortionK[3]*pow(radius, 6)); + float fovy = 2*atan2(hmd.vScreenSize*distScale, 2*hmd.eyeToScreenDistance)*RAD2DEG; + + // Compute camera projection matrices + Matrix proj = MatrixPerspective(fovy, aspect, 0.1, 10000); + float projOffset = 4*(hmd.hScreenSize/4 - hmd.interpupillaryDistance/2)/hmd.hScreenSize; + + //Matrix projLeft = MatrixMultiply(MatrixTranslation(projOffset, 0.0, 0.0), proj); + //matrix projRight = MatrixMultiply(MatrixTranslation(-projOffset, 0.0, 0.0)), proj); + + // Compute camera transformation matrices + //Matrix viewTransformLeft = MatrixTranslation(-hmd.interpupillaryDistance/2, 0.0, 0.0 ); + //Matrix viewTransformRight = MatrixTranslation(hmd.interpupillaryDistance/2, 0.0, 0.0 ); + + // Compute eyes Viewports + // Rectangle viewportLeft = { 0, 0, hmd.hResolution/2, hmd.vResolution }; + // Rectangle viewportRight = { hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; + + // Distortion shader parameters + float lensShift = 4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize; + float leftLensCenter[2] = { lensShift, 0.0f }; + float rightLensCenter[2] = { -lensShift, 0.0f }; + float leftScreenCenter[2] = { 0.25f, 0.5f }; + float rightScreenCenter[2] = { 0.75f, 0.5f }; + + float scaleIn[2] = { 1.0f, 1.0f/aspect }; + float scale[2] = { 1.0f/distScale, 1.0f*aspect/distScale }; + + // Distortion shader parameters update + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftLensCenter"), leftLensCenter, 2); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightLensCenter"), rightLensCenter, 2); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftScreenCenter"), leftScreenCenter, 2); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightScreenCenter"), rightScreenCenter, 2); + + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scale"), scale, 2); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scaleIn"), scaleIn, 2); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "hmdWarpParam"), hmd.distortionK, 4); + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); +} + #if defined(RLGL_OCULUS_SUPPORT) +static void InitOculusDevice(void) +{ + +} + +static void CloseOculusDevice(void) +{ + +} + +static void UpdateOculusTracking(void) +{ + +} + +static void BeginOculusDrawing(void) +{ + +} + +static void EndOculusDrawing(void) +{ + +} + // Load Oculus required buffers: texture-swap-chain, fbo, texture-depth static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) { -- cgit v1.2.3 From bcc2b17701f70015498ee2e51d7b35ffdd22f8d5 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 8 Jul 2016 17:22:37 +0200 Subject: Rename standard_shader.h to shader_standard.h --- src/shader_standard.h | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/standard_shader.h | 173 -------------------------------------------------- 2 files changed, 173 insertions(+), 173 deletions(-) create mode 100644 src/shader_standard.h delete mode 100644 src/standard_shader.h (limited to 'src') diff --git a/src/shader_standard.h b/src/shader_standard.h new file mode 100644 index 00000000..deae7fe1 --- /dev/null +++ b/src/shader_standard.h @@ -0,0 +1,173 @@ + +// Vertex shader definition to embed, no external file required +static const char vStandardShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"attribute vec3 vertexPosition; \n" +"attribute vec3 vertexNormal; \n" +"attribute vec2 vertexTexCoord; \n" +"attribute vec4 vertexColor; \n" +"varying vec3 fragPosition; \n" +"varying vec3 fragNormal; \n" +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec3 vertexPosition; \n" +"in vec3 vertexNormal; \n" +"in vec2 vertexTexCoord; \n" +"in vec4 vertexColor; \n" +"out vec3 fragPosition; \n" +"out vec3 fragNormal; \n" +"out vec2 fragTexCoord; \n" +"out vec4 fragColor; \n" +#endif +"uniform mat4 mvpMatrix; \n" +"void main() \n" +"{ \n" +" fragPosition = vertexPosition; \n" +" fragNormal = vertexNormal; \n" +" fragTexCoord = vertexTexCoord; \n" +" fragColor = vertexColor; \n" +" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" +"} \n"; + +// Fragment shader definition to embed, no external file required +static const char fStandardShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +"precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"varying vec3 fragPosition; \n" +"varying vec3 fragNormal; \n" +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec3 fragPosition; \n" +"in vec3 fragNormal; \n" +"in vec2 fragTexCoord; \n" +"in vec4 fragColor; \n" +"out vec4 finalColor; \n" +#endif +"uniform sampler2D texture0; \n" +"uniform sampler2D texture1; \n" +"uniform sampler2D texture2; \n" +"uniform vec4 colAmbient; \n" +"uniform vec4 colDiffuse; \n" +"uniform vec4 colSpecular; \n" +"uniform float glossiness; \n" +"uniform int useNormal; \n" +"uniform int useSpecular; \n" +"uniform mat4 modelMatrix; \n" +"uniform vec3 viewDir; \n" +"struct Light { \n" +" int enabled; \n" +" int type; \n" +" vec3 position; \n" +" vec3 direction; \n" +" vec4 diffuse; \n" +" float intensity; \n" +" float radius; \n" +" float coneAngle; }; \n" +"const int maxLights = 8; \n" +"uniform Light lights[maxLights]; \n" +"\n" +"vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s) \n" +"{\n" +" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" +" vec3 surfaceToLight = l.position - surfacePos;\n" +" float brightness = clamp(float(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n))), 0.0, 1.0);\n" +" float diff = 1.0/dot(surfaceToLight/l.radius, surfaceToLight/l.radius)*brightness*l.intensity;\n" +" float spec = 0.0;\n" +" if (diff > 0.0)\n" +" {\n" +" vec3 h = normalize(-l.direction + v);\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" }\n" +" return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" +"}\n" +"\n" +"vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)\n" +"{\n" +" vec3 lightDir = normalize(-l.direction);\n" +" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" +" float spec = 0.0;\n" +" if (diff > 0.0)\n" +" {\n" +" vec3 h = normalize(lightDir + v);\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" }\n" +" return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" +"}\n" +"\n" +"vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)\n" +"{\n" +" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1.0));\n" +" vec3 lightToSurface = normalize(surfacePos - l.position);\n" +" vec3 lightDir = normalize(-l.direction);\n" +" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" +" float attenuation = clamp(float(dot(n, lightToSurface)), 0.0, 1.0);\n" +" attenuation = dot(lightToSurface, -lightDir);\n" +" float lightToSurfaceAngle = degrees(acos(attenuation));\n" +" if (lightToSurfaceAngle > l.coneAngle) attenuation = 0.0;\n" +" float falloff = (l.coneAngle - lightToSurfaceAngle)/l.coneAngle;\n" +" float diffAttenuation = diff*attenuation;\n" +" float spec = 0.0;\n" +" if (diffAttenuation > 0.0)\n" +" {\n" +" vec3 h = normalize(lightDir + v);\n" +" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" }\n" +" return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" +"}\n" +"\n" +"void main()\n" +"{\n" +" mat3 normalMatrix = mat3(modelMatrix);\n" +" vec3 normal = normalize(normalMatrix*fragNormal);\n" +" vec3 n = normalize(normal);\n" +" vec3 v = normalize(viewDir);\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" vec4 texelColor = texture2D(texture0, fragTexCoord);\n" +#elif defined(GRAPHICS_API_OPENGL_33) +" vec4 texelColor = texture(texture0, fragTexCoord);\n" +#endif +" vec3 lighting = colAmbient.rgb;\n" +" if (useNormal == 1)\n" +" {\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" n *= texture2D(texture1, fragTexCoord).rgb;\n" +#elif defined(GRAPHICS_API_OPENGL_33) +" n *= texture(texture1, fragTexCoord).rgb;\n" +#endif +" n = normalize(n);\n" +" }\n" +" float spec = 1.0;\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" if (useSpecular == 1) spec *= normalize(texture2D(texture2, fragTexCoord).r);\n" +#elif defined(GRAPHICS_API_OPENGL_33) +" if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" +#endif +" for (int i = 0; i < maxLights; i++)\n" +" {\n" +" if (lights[i].enabled == 1)\n" +" {\n" +" if(lights[i].type == 0) lighting += CalcPointLight(lights[i], n, v, spec);\n" +" else if(lights[i].type == 1) lighting += CalcDirectionalLight(lights[i], n, v, spec);\n" +" else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);\n" +" }\n" +" }\n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" +#elif defined(GRAPHICS_API_OPENGL_33) +" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" +#endif +"}\n"; diff --git a/src/standard_shader.h b/src/standard_shader.h deleted file mode 100644 index deae7fe1..00000000 --- a/src/standard_shader.h +++ /dev/null @@ -1,173 +0,0 @@ - -// Vertex shader definition to embed, no external file required -static const char vStandardShaderStr[] = -#if defined(GRAPHICS_API_OPENGL_21) -"#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) -"#version 100 \n" -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -"attribute vec3 vertexPosition; \n" -"attribute vec3 vertexNormal; \n" -"attribute vec2 vertexTexCoord; \n" -"attribute vec4 vertexColor; \n" -"varying vec3 fragPosition; \n" -"varying vec3 fragNormal; \n" -"varying vec2 fragTexCoord; \n" -"varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) -"#version 330 \n" -"in vec3 vertexPosition; \n" -"in vec3 vertexNormal; \n" -"in vec2 vertexTexCoord; \n" -"in vec4 vertexColor; \n" -"out vec3 fragPosition; \n" -"out vec3 fragNormal; \n" -"out vec2 fragTexCoord; \n" -"out vec4 fragColor; \n" -#endif -"uniform mat4 mvpMatrix; \n" -"void main() \n" -"{ \n" -" fragPosition = vertexPosition; \n" -" fragNormal = vertexNormal; \n" -" fragTexCoord = vertexTexCoord; \n" -" fragColor = vertexColor; \n" -" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" -"} \n"; - -// Fragment shader definition to embed, no external file required -static const char fStandardShaderStr[] = -#if defined(GRAPHICS_API_OPENGL_21) -"#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) -"#version 100 \n" -"precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -"varying vec3 fragPosition; \n" -"varying vec3 fragNormal; \n" -"varying vec2 fragTexCoord; \n" -"varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) -"#version 330 \n" -"in vec3 fragPosition; \n" -"in vec3 fragNormal; \n" -"in vec2 fragTexCoord; \n" -"in vec4 fragColor; \n" -"out vec4 finalColor; \n" -#endif -"uniform sampler2D texture0; \n" -"uniform sampler2D texture1; \n" -"uniform sampler2D texture2; \n" -"uniform vec4 colAmbient; \n" -"uniform vec4 colDiffuse; \n" -"uniform vec4 colSpecular; \n" -"uniform float glossiness; \n" -"uniform int useNormal; \n" -"uniform int useSpecular; \n" -"uniform mat4 modelMatrix; \n" -"uniform vec3 viewDir; \n" -"struct Light { \n" -" int enabled; \n" -" int type; \n" -" vec3 position; \n" -" vec3 direction; \n" -" vec4 diffuse; \n" -" float intensity; \n" -" float radius; \n" -" float coneAngle; }; \n" -"const int maxLights = 8; \n" -"uniform Light lights[maxLights]; \n" -"\n" -"vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s) \n" -"{\n" -" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" -" vec3 surfaceToLight = l.position - surfacePos;\n" -" float brightness = clamp(float(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n))), 0.0, 1.0);\n" -" float diff = 1.0/dot(surfaceToLight/l.radius, surfaceToLight/l.radius)*brightness*l.intensity;\n" -" float spec = 0.0;\n" -" if (diff > 0.0)\n" -" {\n" -" vec3 h = normalize(-l.direction + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" -" }\n" -" return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" -"}\n" -"\n" -"vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)\n" -"{\n" -" vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" -" float spec = 0.0;\n" -" if (diff > 0.0)\n" -" {\n" -" vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" -" }\n" -" return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" -"}\n" -"\n" -"vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)\n" -"{\n" -" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1.0));\n" -" vec3 lightToSurface = normalize(surfacePos - l.position);\n" -" vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" -" float attenuation = clamp(float(dot(n, lightToSurface)), 0.0, 1.0);\n" -" attenuation = dot(lightToSurface, -lightDir);\n" -" float lightToSurfaceAngle = degrees(acos(attenuation));\n" -" if (lightToSurfaceAngle > l.coneAngle) attenuation = 0.0;\n" -" float falloff = (l.coneAngle - lightToSurfaceAngle)/l.coneAngle;\n" -" float diffAttenuation = diff*attenuation;\n" -" float spec = 0.0;\n" -" if (diffAttenuation > 0.0)\n" -" {\n" -" vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" -" }\n" -" return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" -"}\n" -"\n" -"void main()\n" -"{\n" -" mat3 normalMatrix = mat3(modelMatrix);\n" -" vec3 normal = normalize(normalMatrix*fragNormal);\n" -" vec3 n = normalize(normal);\n" -" vec3 v = normalize(viewDir);\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" vec4 texelColor = texture2D(texture0, fragTexCoord);\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" vec4 texelColor = texture(texture0, fragTexCoord);\n" -#endif -" vec3 lighting = colAmbient.rgb;\n" -" if (useNormal == 1)\n" -" {\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" n *= texture2D(texture1, fragTexCoord).rgb;\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" n *= texture(texture1, fragTexCoord).rgb;\n" -#endif -" n = normalize(n);\n" -" }\n" -" float spec = 1.0;\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" if (useSpecular == 1) spec *= normalize(texture2D(texture2, fragTexCoord).r);\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" -#endif -" for (int i = 0; i < maxLights; i++)\n" -" {\n" -" if (lights[i].enabled == 1)\n" -" {\n" -" if(lights[i].type == 0) lighting += CalcPointLight(lights[i], n, v, spec);\n" -" else if(lights[i].type == 1) lighting += CalcDirectionalLight(lights[i], n, v, spec);\n" -" else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);\n" -" }\n" -" }\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" -#elif defined(GRAPHICS_API_OPENGL_33) -" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" -#endif -"}\n"; -- cgit v1.2.3 From 884e13ac2faea7ea91af1fa5a4c1cfaf44dfb4af Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 8 Jul 2016 20:32:06 +0200 Subject: Updated VR support -IN PROGRESS- - Embedded VR distortion shader - Ready to support multiple VR devices - Fallback to VR Simulator if device not ready - Support mono rendering over stereo rendering --- src/rlgl.c | 505 ++++++++++++++++++++++++++---------------------- src/shader_distortion.h | 91 +++++++++ 2 files changed, 368 insertions(+), 228 deletions(-) create mode 100644 src/shader_distortion.h (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 25a6745c..7cb6a751 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -74,7 +74,11 @@ #endif #if !defined(GRAPHICS_API_OPENGL_11) && !defined(RLGL_NO_STANDARD_SHADER) - #include "standard_shader.h" // Standard shader to embed + #include "shader_standard.h" // Standard shader to be embedded +#endif + +#if !defined(GRAPHICS_API_OPENGL_11) && !defined(RLGL_NO_DISTORTION_SHADER) + #include "shader_distortion.h" // Distortion shader to be embedded #endif //#define RLGL_OCULUS_SUPPORT // Enable Oculus Rift code @@ -288,13 +292,14 @@ static OculusMirror mirror; // Oculus mirror texture and fbo static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif -static bool oculusReady = false; // Oculus device ready flag -static bool oculusSimulator = false; // Oculus device simulator -static bool vrEnabled = false; // VR experience enabled (Oculus device or simulator) -static bool vrControl = true; // VR controlled by user code, instead of internally +static bool vrDeviceReady = false; // VR device ready flag +static bool vrSimulator = false; // VR simulator enabled flag +static bool vrEnabled = false; // VR experience enabled (device or simulator) +static bool vrRendering = true; // VR stereo rendering enabled/disabled flag + // NOTE: This flag is useful to render data over stereo image (i.e. FPS) -static RenderTexture2D stereoFbo; -static Shader distortionShader; +static RenderTexture2D stereoFbo; // Stereo rendering framebuffer +static Shader distortionShader; // Stereo rendering distortion shader (simulator) // Compressed textures support flags static bool texCompDXTSupported = false; // DDS texture compression support @@ -335,12 +340,12 @@ static void UpdateDefaultBuffers(void); // Update default internal buffers ( static void DrawDefaultBuffers(int eyesCount); // Draw default internal buffers vertex data static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU +// Configure stereo rendering (including distortion shader) with HMD device parameters +static void SetupVrDevice(VrDeviceInfo info); + // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); -// Configure stereo rendering (including distortion shader) with HMD device parameters -static void SetupVrDevice(VrDeviceInfo hmd); - static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array static char *ReadTextFile(const char *fileName); @@ -1233,7 +1238,7 @@ void rlglDraw(void) // NOTE: Default buffers upload and draw UpdateDefaultBuffers(); - if (vrEnabled && vrControl) DrawDefaultBuffers(2); + if (vrEnabled && vrRendering) DrawDefaultBuffers(2); else DrawDefaultBuffers(1); #endif } @@ -2532,66 +2537,65 @@ void DestroyLight(Light light) // NOTE: If device is not available, it fallbacks to default device (simulator) void InitVrDevice(int hmdDevice) { -#if defined(RLGL_OCULUS_SUPPORT) - // Initialize Oculus device - ovrResult result = ovr_Initialize(NULL); - if (OVR_FAILURE(result)) + switch (hmdDevice) { - TraceLog(WARNING, "OVR: Could not initialize Oculus device"); - oculusReady = false; - } - else - { - result = ovr_Create(&session, &luid); - if (OVR_FAILURE(result)) + case HMD_DEFAULT_DEVICE: TraceLog(INFO, "Initializing default VR Device (Oculus Rift CV1)"); + case HMD_OCULUS_RIFT_DK2: + case HMD_OCULUS_RIFT_CV1: { - TraceLog(WARNING, "OVR: Could not create Oculus session"); - ovr_Shutdown(); - oculusReady = false; - } - else - { - hmdDesc = ovr_GetHmdDesc(session); - - TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); - TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); - TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); - TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); - //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); - TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - - // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... - // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) - - // Initialize Oculus Buffers - layer = InitOculusLayer(session); - buffer = LoadOculusBuffer(session, layer.width, layer.height); - mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... - layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); - - // Recenter OVR tracking origin - ovr_RecenterTrackingOrigin(session); - - oculusReady = true; - vrEnabled = true; - } - } +#if defined(RLGL_OCULUS_SUPPORT) + vrDeviceReady = InitOculusDevice(); #else - oculusReady = false; + TraceLog(WARNING, "Oculus Rift not supported by default, recompile raylib with Oculus support"); #endif + } break; + case HMD_VALVE_HTC_VIVE: + case HMD_SAMSUNG_GEAR_VR: + case HMD_GOOGLE_CARDBOARD: + case HMD_SONY_PLAYSTATION_VR: + case HMD_RAZER_OSVR: + case HMD_FOVE_VR: TraceLog(WARNING, "VR Device not supported"); + default: break; + } - if (!oculusReady) + if (!vrDeviceReady) { - TraceLog(WARNING, "HMD Device not found: Initializing VR simulator"); + TraceLog(WARNING, "VR Device not found: Initializing VR Simulator"); // Initialize framebuffer and textures for stereo rendering stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); - // Load oculus-distortion shader (oculus parameters setup internally) - // TODO: Embed coulus distortion shader (in this function like default shader?) - distortionShader = LoadShader("resources/shaders/glsl330/base.vs", "resources/shaders/glsl330/distortion.fs"); + // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) + distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); + if (distortionShader.id != 0) LoadDefaultShaderLocations(&distortionShader); + + VrDeviceInfo info = { 0 }; - oculusSimulator = true; + if ((hmdDevice == HMD_DEFAULT_DEVICE) || + (hmdDevice == HMD_OCULUS_RIFT_DK2) || + (hmdDevice == HMD_OCULUS_RIFT_CV1)) + { + info.hResolution = 1280; // HMD horizontal resolution in pixels + info.vResolution = 800; // HMD vertical resolution in pixels + info.hScreenSize = 0.14976f;; // HMD horizontal size in meters + info.vScreenSize = 0.09356f; // HMD vertical size in meters + info.vScreenCenter = 0.04675f; // HMD screen center in meters + info.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + info.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters + info.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters + info.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + info.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + info.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + info.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + info.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + info.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + info.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + info.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + } + + SetupVrDevice(info); + + vrSimulator = true; vrEnabled = true; } } @@ -2600,14 +2604,7 @@ void InitVrDevice(int hmdDevice) void CloseVrDevice(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusReady) - { - UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer - UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers - - ovr_Destroy(session); // Free Oculus session data - ovr_Shutdown(); // Close Oculus device connection - } + if (vrDeviceReady) CloseOculusDevice(); else #endif { @@ -2618,13 +2615,13 @@ void CloseVrDevice(void) UnloadShader(distortionShader); } - oculusReady = false; + vrDeviceReady = false; } // Detect if VR device is available bool IsVrDeviceReady(void) { - return (oculusReady || oculusSimulator) && vrEnabled; + return (vrDeviceReady || vrSimulator) && vrEnabled; } // Enable/Disable VR experience (device or simulator) @@ -2637,27 +2634,7 @@ void ToggleVrMode(void) void UpdateVrTracking(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusReady) - { - frameIndex++; - - ovrPosef eyePoses[2]; - ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - - layer.eyeLayer.RenderPose[0] = eyePoses[0]; - layer.eyeLayer.RenderPose[1] = eyePoses[1]; - - // Get session status information - ovrSessionStatus sessionStatus; - ovr_GetSessionStatus(session, &sessionStatus); - - if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); - if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); - //if (sessionStatus.HmdPresent) // HMD is present. - //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. - //if (sessionStatus.HmdMounted) // HMD is on the user's head. - //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. - } + if (vrDeviceReady) UpdateOculusTracking(); else #endif { @@ -2665,116 +2642,13 @@ void UpdateVrTracking(void) } } -// Set internal projection and modelview matrix depending on eyes tracking data -static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) -{ - if (vrEnabled) - { - Matrix eyeProjection = matProjection; - Matrix eyeModelView = matModelView; - -#if defined(RLGL_OCULUS_SUPPORT) - if (oculusReady) - { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, - layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRenderPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); - - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - - eyeProjection = layer.eyeProjections[eye]; - } - else -#endif - { - // Setup viewport and projection/modelview matrices using tracking data - rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - - static float IPD = 0.064f; // InterpupillaryDistance - float HScreenSize = 0.14976f; - float VScreenSize = 0.09356f; // HScreenSize/(1280.0f/800.0f) (DK2) - float VScreenCenter = 0.04675f; // VScreenSize/2 - float EyeToScreenDistance = 0.041f; - float LensSeparationDistance = 0.0635f; //0.0635f (DK2) - - // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) - float halfScreenDistance = VScreenSize/2.0f; - float fovy = 2.0f*atan(halfScreenDistance/EyeToScreenDistance)*RAD2DEG; - - float viewCenter = (float)HScreenSize*0.25f; - float eyeProjectionShift = viewCenter - LensSeparationDistance*0.5f; - float projectionCenterOffset = eyeProjectionShift/(float)HScreenSize; //4.0f*eyeProjectionShift/(float)HScreenSize; -/* - static float scale[2] = { 0.25, 0.45 }; - - if (IsKeyDown(KEY_RIGHT)) scale[0] += 0.01; - else if (IsKeyDown(KEY_LEFT)) scale[0] -= 0.01; - else if (IsKeyDown(KEY_UP)) scale[1] += 0.01; - else if (IsKeyDown(KEY_DOWN)) scale[1] -= 0.01; - - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "Scale"), scale, 2); - - if (IsKeyDown(KEY_N)) IPD += 0.02; - else if (IsKeyDown(KEY_M)) IPD -= 0.02; -*/ - // The matrixes for offsetting the projection and view for each eye, to achieve stereo effect - Vector3 projectionOffset = { -projectionCenterOffset, 0.0f, 0.0f }; - - // Camera movement might seem more natural if we model the head. - // Our axis of rotation is the base of our head, so we might want to add - // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. - Vector3 viewOffset = { -IPD/2.0f, 0.075f, 0.045f }; - - // Negate the left eye versions - if (eye == 0) - { - projectionOffset.x *= -1.0f; - viewOffset.x *= -1.0f; - } - - // Adjust the view and projection matrixes - // View matrix is translated based on the eye offset - Matrix projCenter = MatrixPerspective(fovy, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); - - Matrix projTranslation = MatrixTranslate(projectionOffset.x, projectionOffset.y, projectionOffset.z); - Matrix viewTranslation = MatrixTranslate(viewOffset.x, viewOffset.y, viewOffset.z); - - eyeProjection = MatrixMultiply(projCenter, projTranslation); // projection - eyeModelView = MatrixMultiply(matModelView, viewTranslation); // modelview - - MatrixTranspose(&eyeProjection); - } - - SetMatrixModelview(eyeModelView); - SetMatrixProjection(eyeProjection); - } -} - // Begin Oculus drawing configuration void BeginVrDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusReady) + if (vrDeviceReady) { - GLuint currentTexId; - int currentIndex; - - ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); - ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); - - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); - //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded + BeginOculusDrawing(); } else #endif @@ -2792,26 +2666,16 @@ void BeginVrDrawing(void) //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) rlClearScreenBuffers(); // Clear current framebuffer(s) - vrControl = true; + vrRendering = true; } // End Oculus drawing process (and desktop mirror) void EndVrDrawing(void) { #if defined(RLGL_OCULUS_SUPPORT) - if (oculusReady) + if (vrDeviceReady) { - // Unbind current framebuffer (Oculus buffer) - glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - - ovr_CommitTextureSwapChain(session, buffer.textureChain); - - ovrLayerHeader *layers = &layer.eyeLayer.Header; - ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); - - // Blit mirror texture to back buffer - BlitOculusMirror(session, mirror); + EndOculusDrawing(); } else #endif @@ -2869,7 +2733,7 @@ void EndVrDrawing(void) rlDisableDepthTest(); - vrControl = false; + vrRendering = false; } //---------------------------------------------------------------------------------- @@ -3890,25 +3754,34 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) // Configure stereo rendering (including distortion shader) with HMD device parameters static void SetupVrDevice(VrDeviceInfo hmd) { + // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) + //float fovy = 2.0f*atan((VScreenSize*0.5f)/EyeToScreenDistance)*RAD2DEG; + + //float eyeProjectionShift = ; + //float projectionOffset = (HScreenSize*0.25f - LensSeparationDistance*0.5f)/(float)HScreenSize; + // Compute aspect ratio and FOV - float aspect = ((float)hmd.hResolution/2.0f)/(float)hmd.vResolution; + //float aspect = ((float)hmd.hResolution/2.0f)/(float)hmd.vResolution; + float aspect = (float)screenWidth*0.5f/(float)screenHeight; // Fov-y is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG // ...but with lens distortion it is increased (see Oculus SDK Documentation) float radius = -1.0 - (4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize); float distScale = (hmd.distortionK[0] + hmd.distortionK[1]*pow(radius, 2) + hmd.distortionK[2]*pow(radius, 4) + hmd.distortionK[3]*pow(radius, 6)); - float fovy = 2*atan2(hmd.vScreenSize*distScale, 2*hmd.eyeToScreenDistance)*RAD2DEG; + //float fovy = 2.0f*atan2(hmd.vScreenSize*distScale, 2*hmd.eyeToScreenDistance)*RAD2DEG; + float fovy = 2.0f*atan((hmd.vScreenSize*0.5f)/hmd.eyeToScreenDistance)*RAD2DEG; // Compute camera projection matrices - Matrix proj = MatrixPerspective(fovy, aspect, 0.1, 10000); - float projOffset = 4*(hmd.hScreenSize/4 - hmd.interpupillaryDistance/2)/hmd.hScreenSize; + Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); + //float projOffset = 4.0f*(hmd.hScreenSize/4 - hmd.interpupillaryDistance/2)/hmd.hScreenSize; + float projOffset = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; - //Matrix projLeft = MatrixMultiply(MatrixTranslation(projOffset, 0.0, 0.0), proj); - //matrix projRight = MatrixMultiply(MatrixTranslation(-projOffset, 0.0, 0.0)), proj); + //Matrix projLeft = MatrixMultiply(MatrixTranslate(projOffset, 0.0, 0.0), proj); + //matrix projRight = MatrixMultiply(MatrixTranslate(-projOffset, 0.0, 0.0)), proj); // Compute camera transformation matrices - //Matrix viewTransformLeft = MatrixTranslation(-hmd.interpupillaryDistance/2, 0.0, 0.0 ); - //Matrix viewTransformRight = MatrixTranslation(hmd.interpupillaryDistance/2, 0.0, 0.0 ); + //Matrix viewTransformLeft = MatrixTranslate(-hmd.interpupillaryDistance/2, 0.0, 0.0 ); + //Matrix viewTransformRight = MatrixTranslate(hmd.interpupillaryDistance/2, 0.0, 0.0 ); // Compute eyes Viewports // Rectangle viewportLeft = { 0, 0, hmd.hResolution/2, hmd.vResolution }; @@ -3916,50 +3789,226 @@ static void SetupVrDevice(VrDeviceInfo hmd) // Distortion shader parameters float lensShift = 4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize; - float leftLensCenter[2] = { lensShift, 0.0f }; - float rightLensCenter[2] = { -lensShift, 0.0f }; + float leftLensCenter[2] = { lensShift, 0.0f }; // REVIEW!!! + float rightLensCenter[2] = { -lensShift, 0.0f }; // REVIEW!!! float leftScreenCenter[2] = { 0.25f, 0.5f }; float rightScreenCenter[2] = { 0.75f, 0.5f }; - float scaleIn[2] = { 1.0f, 1.0f/aspect }; - float scale[2] = { 1.0f/distScale, 1.0f*aspect/distScale }; + float scaleIn[2] = { 1.0f, 1.0f/aspect }; // REVIEW!!! + float scale[2] = { 1.0f/distScale, 1.0f*aspect/distScale }; // REVIEW!!! // Distortion shader parameters update - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftLensCenter"), leftLensCenter, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightLensCenter"), rightLensCenter, 2); + //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftLensCenter"), leftLensCenter, 2); + //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightLensCenter"), rightLensCenter, 2); SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftScreenCenter"), leftScreenCenter, 2); SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightScreenCenter"), rightScreenCenter, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scale"), scale, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scaleIn"), scaleIn, 2); + //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scale"), scale, 2); + //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scaleIn"), scaleIn, 2); SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "hmdWarpParam"), hmd.distortionK, 4); SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); } +// Set internal projection and modelview matrix depending on eyes tracking data +static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) +{ + if (vrEnabled) + { + Matrix eyeProjection = matProjection; + Matrix eyeModelView = matModelView; + #if defined(RLGL_OCULUS_SUPPORT) -static void InitOculusDevice(void) + if (vrDeviceReady) + { + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, + layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + + eyeProjection = layer.eyeProjections[eye]; + } + else +#endif + { + // Setup viewport and projection/modelview matrices using tracking data + rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + + float HScreenSize = 0.14976f; + float VScreenSize = 0.09356f; // HScreenSize/(1280.0f/800.0f) (DK2) + float VScreenCenter = 0.04675f; // VScreenSize/2 + float EyeToScreenDistance = 0.041f; + float LensSeparationDistance = 0.0635f; // DK2 + float InterpupillaryDistance = 0.064f; // IPD + + // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) + float halfScreenDistance = VScreenSize/2.0f; + float fovy = 2.0f*atan(halfScreenDistance/EyeToScreenDistance)*RAD2DEG; + + float viewCenter = (float)HScreenSize*0.25f; + float eyeProjectionShift = viewCenter - LensSeparationDistance*0.5f; + float projectionCenterOffset = eyeProjectionShift/(float)HScreenSize; //4.0f*eyeProjectionShift/(float)HScreenSize; +/* + static float scale[2] = { 0.25, 0.45 }; + + if (IsKeyDown(KEY_RIGHT)) scale[0] += 0.01; + else if (IsKeyDown(KEY_LEFT)) scale[0] -= 0.01; + else if (IsKeyDown(KEY_UP)) scale[1] += 0.01; + else if (IsKeyDown(KEY_DOWN)) scale[1] -= 0.01; + + SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "Scale"), scale, 2); + + if (IsKeyDown(KEY_N)) IPD += 0.02; + else if (IsKeyDown(KEY_M)) IPD -= 0.02; +*/ + // The matrixes for offsetting the projection and view for each eye, to achieve stereo effect + Vector3 projectionOffset = { -projectionCenterOffset, 0.0f, 0.0f }; + + // Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add + // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. + Vector3 viewOffset = { -InterpupillaryDistance/2.0f, 0.075f, 0.045f }; + + // Negate the left eye versions + if (eye == 0) + { + projectionOffset.x *= -1.0f; + viewOffset.x *= -1.0f; + } + + // Adjust the view and projection matrixes + // View matrix is translated based on the eye offset + Matrix projCenter = MatrixPerspective(fovy, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); + + Matrix projTranslation = MatrixTranslate(projectionOffset.x, projectionOffset.y, projectionOffset.z); + Matrix viewTranslation = MatrixTranslate(viewOffset.x, viewOffset.y, viewOffset.z); + + eyeProjection = MatrixMultiply(projCenter, projTranslation); // projection + eyeModelView = MatrixMultiply(matModelView, viewTranslation); // modelview + + MatrixTranspose(&eyeProjection); + } + + SetMatrixModelview(eyeModelView); + SetMatrixProjection(eyeProjection); + } +} + +#if defined(RLGL_OCULUS_SUPPORT) +// Initialize Oculus device +static bool InitOculusDevice(void) { + bool oculusReady = false; + + ovrResult result = ovr_Initialize(NULL); + + if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); + else + { + result = ovr_Create(&session, &luid); + if (OVR_FAILURE(result)) + { + TraceLog(WARNING, "OVR: Could not create Oculus session"); + ovr_Shutdown(); + } + else + { + hmdDesc = ovr_GetHmdDesc(session); + + TraceLog(INFO, "OVR: Product Name: %s", hmdDesc.ProductName); + TraceLog(INFO, "OVR: Manufacturer: %s", hmdDesc.Manufacturer); + TraceLog(INFO, "OVR: Product ID: %i", hmdDesc.ProductId); + TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); + //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); + TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); + + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... + // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) + + // Initialize Oculus Buffers + layer = InitOculusLayer(session); + buffer = LoadOculusBuffer(session, layer.width, layer.height); + mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... + layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); + + // Recenter OVR tracking origin + ovr_RecenterTrackingOrigin(session); + + oculusReady = true; + vrEnabled = true; + } + } + return oculusReady; } static void CloseOculusDevice(void) { - + UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer + UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers + + ovr_Destroy(session); // Free Oculus session data + ovr_Shutdown(); // Close Oculus device connection } static void UpdateOculusTracking(void) { + frameIndex++; + + ovrPosef eyePoses[2]; + ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); + + layer.eyeLayer.RenderPose[0] = eyePoses[0]; + layer.eyeLayer.RenderPose[1] = eyePoses[1]; + // Get session status information + ovrSessionStatus sessionStatus; + ovr_GetSessionStatus(session, &sessionStatus); + + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); + if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); + //if (sessionStatus.HmdPresent) // HMD is present. + //if (sessionStatus.DisplayLost) // HMD was unplugged or the display driver was manually disabled or encountered a TDR. + //if (sessionStatus.HmdMounted) // HMD is on the user's head. + //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. } static void BeginOculusDrawing(void) { + GLuint currentTexId; + int currentIndex; + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); + ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); + + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, buffer.fboId); + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, currentTexId, 0); + //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded } static void EndOculusDrawing(void) { + // Unbind current framebuffer (Oculus buffer) + glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + ovr_CommitTextureSwapChain(session, buffer.textureChain); + + ovrLayerHeader *layers = &layer.eyeLayer.Header; + ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); + + // Blit mirror texture to back buffer + BlitOculusMirror(session, mirror); } // Load Oculus required buffers: texture-swap-chain, fbo, texture-depth diff --git a/src/shader_distortion.h b/src/shader_distortion.h new file mode 100644 index 00000000..e4ce5d6c --- /dev/null +++ b/src/shader_distortion.h @@ -0,0 +1,91 @@ + +// Vertex shader definition to embed, no external file required +static const char vDistortionShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"attribute vec3 vertexPosition; \n" +"attribute vec2 vertexTexCoord; \n" +"attribute vec4 vertexColor; \n" +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec3 vertexPosition; \n" +"in vec2 vertexTexCoord; \n" +"in vec4 vertexColor; \n" +"out vec2 fragTexCoord; \n" +"out vec4 fragColor; \n" +#endif +"uniform mat4 mvpMatrix; \n" +"void main() \n" +"{ \n" +" fragTexCoord = vertexTexCoord; \n" +" fragColor = vertexColor; \n" +" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" +"} \n"; + +// Fragment shader definition to embed, no external file required +static const char fDistortionShaderStr[] = +#if defined(GRAPHICS_API_OPENGL_21) +"#version 120 \n" +#elif defined(GRAPHICS_API_OPENGL_ES2) +"#version 100 \n" +"precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) +#endif +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"varying vec2 fragTexCoord; \n" +"varying vec4 fragColor; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +"#version 330 \n" +"in vec2 fragTexCoord; \n" +"in vec4 fragColor; \n" +"out vec4 finalColor; \n" +#endif +"uniform sampler2D texture0; \n" +"uniform vec2 leftLensCenter = vec2(0.288, 0.5); \n" +"uniform vec2 rightLensCenter = vec2(0.712, 0.5); \n" +"uniform vec2 leftScreenCenter = vec2(0.25, 0.5); \n" +"uniform vec2 rightScreenCenter = vec2(0.75, 0.5); \n" +"uniform vec2 scale = vec2(0.25, 0.45); \n" +"uniform vec2 scaleIn = vec2(4, 2.2222); \n" +"uniform vec4 hmdWarpParam = vec4(1, 0.22, 0.24, 0); \n" +"uniform vec4 chromaAbParam = vec4(0.996, -0.004, 1.014, 0.0); \n" +"void main() \n" +"{ \n" +" vec2 lensCenter = fragTexCoord.x < 0.5 ? leftLensCenter : rightLensCenter; \n" +" vec2 screenCenter = fragTexCoord.x < 0.5 ? leftScreenCenter : rightScreenCenter; \n" +" vec2 theta = (fragTexCoord - lensCenter)*scaleIn; \n" +" float rSq = theta.x*theta.x + theta.y*theta.y; \n" +" vec2 theta1 = theta*(hmdWarpParam.x + hmdWarpParam.y*rSq + hmdWarpParam.z*rSq*rSq + hmdWarpParam.w*rSq*rSq*rSq); \n" +" vec2 thetaBlue = theta1*(chromaAbParam.z + chromaAbParam.w*rSq); \n" +" vec2 tcBlue = lensCenter + scale*thetaBlue; \n" +" if (any(bvec2(clamp(tcBlue, screenCenter - vec2(0.25, 0.5), screenCenter + vec2(0.25, 0.5)) - tcBlue))) \n" +" { \n" +" finalColor = vec4(0.0, 0.0, 0.0, 1.0); \n" +" } \n" +" else \n" +" { \n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" float blue = texture2D(texture0, tcBlue).b; \n" +" vec2 tcGreen = lensCenter + scale*theta1; \n" +" float green = texture2D(texture0, tcGreen).g; \n" +#elif defined(GRAPHICS_API_OPENGL_33) +" float blue = texture(texture0, tcBlue).b; \n" +" vec2 tcGreen = lensCenter + scale*theta1; \n" +" float green = texture(texture0, tcGreen).g; \n" +#endif +" vec2 thetaRed = theta1*(chromaAbParam.x + chromaAbParam.y*rSq); \n" +" vec2 tcRed = lensCenter + scale*thetaRed; \n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" float red = texture2D(texture0, tcRed).r; \n" +" gl_FragColor = vec4(red, green, blue, 1.0); \n" +#elif defined(GRAPHICS_API_OPENGL_33) +" float red = texture(texture0, tcRed).r; \n" +" finalColor = vec4(red, green, blue, 1.0); \n" +#endif +" } \n" +"} \n"; -- cgit v1.2.3 From 17331258738229ca087437c31bbfc3c9495fe42e Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 8 Jul 2016 23:17:18 +0200 Subject: Do not expose raw audio context to final user... ...at least, directly, available if using directly audio module... --- src/audio.h | 4 ++-- src/raylib.h | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/audio.h b/src/audio.h index fe72d866..3ffe575c 100644 --- a/src/audio.h +++ b/src/audio.h @@ -100,10 +100,10 @@ void PauseMusicStream(int index); // Pause music p void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(int index, float pitch); // Set pitch for a music (1.0 is base level) float GetMusicTimeLength(int index); // Get music time length (in seconds) float GetMusicTimePlayed(int index); // Get current music time played (in seconds) -int GetMusicStreamCount(void); -void SetMusicPitch(int index, float pitch); +int GetMusicStreamCount(void); // Get number of streams loaded // used to output raw audio streams, returns negative numbers on error // if floating point is false the data size is 16bit short, otherwise it is float 32bit diff --git a/src/raylib.h b/src/raylib.h index 1d160492..9225c5ee 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -895,17 +895,10 @@ void PauseMusicStream(int index); // Pause music p void ResumeMusicStream(int index); // Resume playing paused music bool IsMusicPlaying(int index); // Check if music is playing void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(int index, float pitch); // Set pitch for a music (1.0 is base level) float GetMusicTimeLength(int index); // Get current music time length (in seconds) float GetMusicTimePlayed(int index); // Get current music time played (in seconds) -int GetMusicStreamCount(void); -void SetMusicPitch(int index, float pitch); - -// used to output raw audio streams, returns negative numbers on error -// if floating point is false the data size is 16bit short, otherwise it is float 32bit -RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); - -void CloseRawAudioContext(RawAudioContext ctx); -int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements); // returns number of elements buffered +int GetMusicStreamCount(void); // Get number of streams loaded #ifdef __cplusplus } -- cgit v1.2.3 From 24c267d32499c35c5cd61e52e9e32f15cc79faad Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 10 Jul 2016 20:09:18 +0200 Subject: Compute stereo config from device parameters Simulator configuration is directly obtained from VR device parameters! --- src/rlgl.c | 249 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 108 insertions(+), 141 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 7cb6a751..65249f5e 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -31,7 +31,7 @@ #include // Required for: fopen(), fclose(), fread()... [Used only on ReadTextFile()] #include // Required for: malloc(), free(), rand() #include // Required for: strcmp(), strlen(), strtok() -#include // Required for: atan() +#include // Required for: atan2() #ifndef RLGL_STANDALONE #include "raymath.h" // Required for Vector3 and Matrix functions @@ -206,6 +206,15 @@ typedef struct { float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters } VrDeviceInfo; +// VR Stereo rendering configuration for simulator +typedef struct { + RenderTexture2D stereoFbo; // VR stereo rendering framebuffer + Shader distortionShader; // VR stereo rendering distortion shader + //Rectangle eyesViewport[2]; // VR stereo rendering eyes viewports + Matrix eyesProjection[2]; // VR stereo rendering eyes projection matrices + Matrix eyesViewOffset[2]; // VR stereo rendering eyes view offset matrices +} VrStereoConfig; + #if defined(RLGL_OCULUS_SUPPORT) typedef struct OculusBuffer { ovrTextureSwapChain textureChain; @@ -292,19 +301,15 @@ static OculusMirror mirror; // Oculus mirror texture and fbo static unsigned int frameIndex = 0; // Oculus frames counter, used to discard frames from chain #endif +// VR global variables +static VrDeviceInfo hmd; // Current VR device info +static VrStereoConfig vrConfig; // VR stereo configuration for simulator static bool vrDeviceReady = false; // VR device ready flag static bool vrSimulator = false; // VR simulator enabled flag static bool vrEnabled = false; // VR experience enabled (device or simulator) static bool vrRendering = true; // VR stereo rendering enabled/disabled flag // NOTE: This flag is useful to render data over stereo image (i.e. FPS) -static RenderTexture2D stereoFbo; // Stereo rendering framebuffer -static Shader distortionShader; // Stereo rendering distortion shader (simulator) - -// Compressed textures support flags -static bool texCompDXTSupported = false; // DDS texture compression support -static bool npotSupported = false; // NPOT textures full support - #if defined(GRAPHICS_API_OPENGL_ES2) // NOTE: VAO functionality is exposed through extensions (OES) static PFNGLGENVERTEXARRAYSOESPROC glGenVertexArrays; @@ -313,6 +318,10 @@ static PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArrays; //static PFNGLISVERTEXARRAYOESPROC glIsVertexArray; // NOTE: Fails in WebGL, omitted #endif +// Compressed textures support flags +static bool texCompDXTSupported = false; // DDS texture compression support +static bool npotSupported = false; // NPOT textures full support + static int blendMode = 0; // Track current blending mode // White texture useful for plain color polys (required by shader) @@ -341,7 +350,7 @@ static void DrawDefaultBuffers(int eyesCount); // Draw default internal buffers static void UnloadDefaultBuffers(void); // Unload default internal buffers vertex data from CPU and GPU // Configure stereo rendering (including distortion shader) with HMD device parameters -static void SetupVrDevice(VrDeviceInfo info); +static void SetStereoConfig(VrDeviceInfo info); // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); @@ -2535,6 +2544,7 @@ void DestroyLight(Light light) // Init VR device (or simulator) // NOTE: If device is not available, it fallbacks to default device (simulator) +// NOTE: It modifies the global variable: VrDeviceInfo hmd void InitVrDevice(int hmdDevice) { switch (hmdDevice) @@ -2560,40 +2570,39 @@ void InitVrDevice(int hmdDevice) if (!vrDeviceReady) { - TraceLog(WARNING, "VR Device not found: Initializing VR Simulator"); + TraceLog(WARNING, "VR Device not found: Initializing VR Simulator (Oculus Rift DK2)"); // Initialize framebuffer and textures for stereo rendering - stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); + vrConfig.stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) - distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); - if (distortionShader.id != 0) LoadDefaultShaderLocations(&distortionShader); - - VrDeviceInfo info = { 0 }; - + vrConfig.distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); + if (vrConfig.distortionShader.id != 0) LoadDefaultShaderLocations(&vrConfig.distortionShader); + if ((hmdDevice == HMD_DEFAULT_DEVICE) || (hmdDevice == HMD_OCULUS_RIFT_DK2) || (hmdDevice == HMD_OCULUS_RIFT_CV1)) { - info.hResolution = 1280; // HMD horizontal resolution in pixels - info.vResolution = 800; // HMD vertical resolution in pixels - info.hScreenSize = 0.14976f;; // HMD horizontal size in meters - info.vScreenSize = 0.09356f; // HMD vertical size in meters - info.vScreenCenter = 0.04675f; // HMD screen center in meters - info.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters - info.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters - info.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters - info.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 - info.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 - info.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 - info.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 - info.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 - info.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 - info.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 - info.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + // NOTE: Oculus Rift DK2 parameters + hmd.hResolution = 1280; // HMD horizontal resolution in pixels + hmd.vResolution = 800; // HMD vertical resolution in pixels + hmd.hScreenSize = 0.14976f;; // HMD horizontal size in meters + hmd.vScreenSize = 0.09356f; // HMD vertical size in meters + hmd.vScreenCenter = 0.04675f; // HMD screen center in meters + hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + hmd.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters + hmd.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters + hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 } - SetupVrDevice(info); + SetStereoConfig(hmd); vrSimulator = true; vrEnabled = true; @@ -2608,11 +2617,8 @@ void CloseVrDevice(void) else #endif { - // Unload stereo framebuffer and texture - rlDeleteRenderTextures(stereoFbo); - - // Unload oculus-distortion shader - UnloadShader(distortionShader); + rlDeleteRenderTextures(vrConfig.stereoFbo); // Unload stereo framebuffer and texture + UnloadShader(vrConfig.distortionShader); // Unload distortion shader } vrDeviceReady = false; @@ -2654,7 +2660,7 @@ void BeginVrDrawing(void) #endif { // Setup framebuffer for stereo rendering - rlEnableRenderTexture(stereoFbo.id); + rlEnableRenderTexture(vrConfig.stereoFbo.id); } // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) @@ -2696,9 +2702,9 @@ void EndVrDrawing(void) rlLoadIdentity(); // Reset internal modelview matrix // Draw RenderTexture (stereoFbo) using distortion shader - currentShader = distortionShader; + currentShader = vrConfig.distortionShader; - rlEnableTexture(stereoFbo.texture.id); + rlEnableTexture(vrConfig.stereoFbo.texture.id); rlPushMatrix(); rlBegin(RL_QUADS); @@ -2711,15 +2717,15 @@ void EndVrDrawing(void) // Bottom-right corner for texture and quad rlTexCoord2f(0.0f, 0.0f); - rlVertex2f(0.0f, stereoFbo.texture.height); + rlVertex2f(0.0f, vrConfig.stereoFbo.texture.height); // Top-right corner for texture and quad rlTexCoord2f(1.0f, 0.0f); - rlVertex2f(stereoFbo.texture.width, stereoFbo.texture.height); + rlVertex2f(vrConfig.stereoFbo.texture.width, vrConfig.stereoFbo.texture.height); // Top-left corner for texture and quad rlTexCoord2f(1.0f, 1.0f); - rlVertex2f(stereoFbo.texture.width, 0.0f); + rlVertex2f(vrConfig.stereoFbo.texture.width, 0.0f); rlEnd(); rlPopMatrix(); @@ -3752,61 +3758,71 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) #endif // Configure stereo rendering (including distortion shader) with HMD device parameters -static void SetupVrDevice(VrDeviceInfo hmd) +static void SetStereoConfig(VrDeviceInfo hmd) { - // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) - //float fovy = 2.0f*atan((VScreenSize*0.5f)/EyeToScreenDistance)*RAD2DEG; - - //float eyeProjectionShift = ; - //float projectionOffset = (HScreenSize*0.25f - LensSeparationDistance*0.5f)/(float)HScreenSize; - - // Compute aspect ratio and FOV - //float aspect = ((float)hmd.hResolution/2.0f)/(float)hmd.vResolution; + // Compute aspect ratio + //float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; float aspect = (float)screenWidth*0.5f/(float)screenHeight; - - // Fov-y is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG + + // Compute lens parameters + float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; + float leftLensCenter[2] = { 0.25 + lensShift, 0.5f }; + float rightLensCenter[2] = { 0.75 - lensShift, 0.5f }; + float leftScreenCenter[2] = { 0.25f, 0.5f }; + float rightScreenCenter[2] = { 0.75f, 0.5f }; + + // Compute distortion scale parameters + // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] + float lensRadius = fabsf(-1.0f - 4.0f*lensShift); + float lensRadiusSq = lensRadius*lensRadius; + float distortionScale = hmd.distortionK[0] + + hmd.distortionK[1]*lensRadiusSq + + hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + + hmd.distortionK[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; + + float normScreenWidth = 0.5f; + float normScreenHeight = 1.0f; + float scaleIn[2] = { 2/normScreenWidth, 2/normScreenHeight/aspect }; + float scale[2] = { normScreenWidth*0.5/distortionScale, normScreenHeight*0.5*aspect/distortionScale }; + + // Update distortion shader with lens and distortion-scale parameters + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftLensCenter"), leftLensCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightLensCenter"), rightLensCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftScreenCenter"), leftScreenCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightScreenCenter"), rightScreenCenter, 2); + + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scale"), scale, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scaleIn"), scaleIn, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "hmdWarpParam"), hmd.distortionK, 4); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); + + // Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG // ...but with lens distortion it is increased (see Oculus SDK Documentation) - float radius = -1.0 - (4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize); - float distScale = (hmd.distortionK[0] + hmd.distortionK[1]*pow(radius, 2) + hmd.distortionK[2]*pow(radius, 4) + hmd.distortionK[3]*pow(radius, 6)); - //float fovy = 2.0f*atan2(hmd.vScreenSize*distScale, 2*hmd.eyeToScreenDistance)*RAD2DEG; - float fovy = 2.0f*atan((hmd.vScreenSize*0.5f)/hmd.eyeToScreenDistance)*RAD2DEG; + float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? // Compute camera projection matrices + float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); - //float projOffset = 4.0f*(hmd.hScreenSize/4 - hmd.interpupillaryDistance/2)/hmd.hScreenSize; - float projOffset = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; + vrConfig.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); + vrConfig.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); + + // NOTE: Projection matrices must be transposed due to raymath convention + MatrixTranspose(&vrConfig.eyesProjection[0]); + MatrixTranspose(&vrConfig.eyesProjection[1]); - //Matrix projLeft = MatrixMultiply(MatrixTranslate(projOffset, 0.0, 0.0), proj); - //matrix projRight = MatrixMultiply(MatrixTranslate(-projOffset, 0.0, 0.0)), proj); - // Compute camera transformation matrices - //Matrix viewTransformLeft = MatrixTranslate(-hmd.interpupillaryDistance/2, 0.0, 0.0 ); - //Matrix viewTransformRight = MatrixTranslate(hmd.interpupillaryDistance/2, 0.0, 0.0 ); - - // Compute eyes Viewports - // Rectangle viewportLeft = { 0, 0, hmd.hResolution/2, hmd.vResolution }; - // Rectangle viewportRight = { hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; - - // Distortion shader parameters - float lensShift = 4*(hmd.hScreenSize/4 - hmd.lensSeparationDistance/2)/hmd.hScreenSize; - float leftLensCenter[2] = { lensShift, 0.0f }; // REVIEW!!! - float rightLensCenter[2] = { -lensShift, 0.0f }; // REVIEW!!! - float leftScreenCenter[2] = { 0.25f, 0.5f }; - float rightScreenCenter[2] = { 0.75f, 0.5f }; + // NOTE: Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add + // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. + vrConfig.eyesViewOffset[0] = MatrixTranslate(-hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); + vrConfig.eyesViewOffset[1] = MatrixTranslate(hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - float scaleIn[2] = { 1.0f, 1.0f/aspect }; // REVIEW!!! - float scale[2] = { 1.0f/distScale, 1.0f*aspect/distScale }; // REVIEW!!! - - // Distortion shader parameters update - //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftLensCenter"), leftLensCenter, 2); - //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightLensCenter"), rightLensCenter, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "leftScreenCenter"), leftScreenCenter, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "rightScreenCenter"), rightScreenCenter, 2); + // Compute eyes Viewports + //vrConfig.eyesViewport[0] = (Rectangle){ 0, 0, hmd.hResolution/2, hmd.vResolution }; + //vrConfig.eyesViewport[1] = (Rectangle){ hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; - //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scale"), scale, 2); - //SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "scaleIn"), scaleIn, 2); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "hmdWarpParam"), hmd.distortionK, 4); - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); + //https://forums.oculus.com/vip/discussion/3413/calculating-the-distortion-shader-parameters + //https://vrwiki.wikispaces.com/Theory+%26+practice } // Set internal projection and modelview matrix depending on eyes tracking data @@ -3844,59 +3860,10 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) // Setup viewport and projection/modelview matrices using tracking data rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - float HScreenSize = 0.14976f; - float VScreenSize = 0.09356f; // HScreenSize/(1280.0f/800.0f) (DK2) - float VScreenCenter = 0.04675f; // VScreenSize/2 - float EyeToScreenDistance = 0.041f; - float LensSeparationDistance = 0.0635f; // DK2 - float InterpupillaryDistance = 0.064f; // IPD - - // NOTE: fovy value obtained from device parameters (Oculus Rift CV1) - float halfScreenDistance = VScreenSize/2.0f; - float fovy = 2.0f*atan(halfScreenDistance/EyeToScreenDistance)*RAD2DEG; - - float viewCenter = (float)HScreenSize*0.25f; - float eyeProjectionShift = viewCenter - LensSeparationDistance*0.5f; - float projectionCenterOffset = eyeProjectionShift/(float)HScreenSize; //4.0f*eyeProjectionShift/(float)HScreenSize; -/* - static float scale[2] = { 0.25, 0.45 }; - - if (IsKeyDown(KEY_RIGHT)) scale[0] += 0.01; - else if (IsKeyDown(KEY_LEFT)) scale[0] -= 0.01; - else if (IsKeyDown(KEY_UP)) scale[1] += 0.01; - else if (IsKeyDown(KEY_DOWN)) scale[1] -= 0.01; - - SetShaderValue(distortionShader, GetShaderLocation(distortionShader, "Scale"), scale, 2); - - if (IsKeyDown(KEY_N)) IPD += 0.02; - else if (IsKeyDown(KEY_M)) IPD -= 0.02; -*/ - // The matrixes for offsetting the projection and view for each eye, to achieve stereo effect - Vector3 projectionOffset = { -projectionCenterOffset, 0.0f, 0.0f }; - - // Camera movement might seem more natural if we model the head. - // Our axis of rotation is the base of our head, so we might want to add - // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. - Vector3 viewOffset = { -InterpupillaryDistance/2.0f, 0.075f, 0.045f }; - - // Negate the left eye versions - if (eye == 0) - { - projectionOffset.x *= -1.0f; - viewOffset.x *= -1.0f; - } - - // Adjust the view and projection matrixes - // View matrix is translated based on the eye offset - Matrix projCenter = MatrixPerspective(fovy, (double)((float)screenWidth*0.5f)/(double)screenHeight, 0.01, 1000.0); - - Matrix projTranslation = MatrixTranslate(projectionOffset.x, projectionOffset.y, projectionOffset.z); - Matrix viewTranslation = MatrixTranslate(viewOffset.x, viewOffset.y, viewOffset.z); - - eyeProjection = MatrixMultiply(projCenter, projTranslation); // projection - eyeModelView = MatrixMultiply(matModelView, viewTranslation); // modelview + // Apply view offset to modelview matrix + eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); - MatrixTranspose(&eyeProjection); + eyeProjection = vrConfig.eyesProjection[eye]; } SetMatrixModelview(eyeModelView); -- cgit v1.2.3 From 84d1b19f61865d1bad32c9e159955a30efa57103 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 11 Jul 2016 14:43:58 +0200 Subject: Added custom Oculus CV1 parameters Matching the same stereo rendering result given by Oculus PC SDK for Oculus Rift CV1 is very difficult because hardware has changed a lot and DK2 distortion shader and parameters don't fit on CV1. Some custom parameters have been calculated to simulate kind of CV1 stereo rendering. Further work is required on this point. --- src/rlgl.c | 94 ++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 65249f5e..25005870 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2570,38 +2570,62 @@ void InitVrDevice(int hmdDevice) if (!vrDeviceReady) { - TraceLog(WARNING, "VR Device not found: Initializing VR Simulator (Oculus Rift DK2)"); + TraceLog(WARNING, "VR Device not found: Initializing VR Simulator (Oculus Rift CV1)"); + if (hmdDevice == HMD_OCULUS_RIFT_DK2) + { + // Oculus Rift DK2 parameters + hmd.hResolution = 1280; // HMD horizontal resolution in pixels + hmd.vResolution = 800; // HMD vertical resolution in pixels + hmd.hScreenSize = 0.14976f; // HMD horizontal size in meters + hmd.vScreenSize = 0.09356f; // HMD vertical size in meters + hmd.vScreenCenter = 0.04678f; // HMD screen center in meters + hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + hmd.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters + hmd.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters + hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + } + else if ((hmdDevice == HMD_DEFAULT_DEVICE) || (hmdDevice == HMD_OCULUS_RIFT_CV1)) + { + // Oculus Rift CV1 parameters + // NOTE: CV1 represents a complete HMD redesign compared to previous versions, + // new Fresnel-hybrid-asymmetric lenses have been added and, consequently, + // previous parameters (DK2) and distortion shader (DK2) doesn't work any more. + // I just defined a set of parameters for simulator that approximate to CV1 stereo rendering + // but result is not the same obtained with Oculus PC SDK. + hmd.hResolution = 2160; // HMD horizontal resolution in pixels + hmd.vResolution = 1200; // HMD vertical resolution in pixels + hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters + hmd.vScreenSize = 0.0669; // HMD vertical size in meters + hmd.vScreenCenter = 0.04678f; // HMD screen center in meters + hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters + hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters + hmd.interpupillaryDistance = 0.07f; // HMD IPD (distance between pupils) in meters + hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 + hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 + hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 + hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 + hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 + hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 + hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 + hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 + } + // Initialize framebuffer and textures for stereo rendering + // NOTE: screen size should match HMD aspect ratio vrConfig.stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) vrConfig.distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); if (vrConfig.distortionShader.id != 0) LoadDefaultShaderLocations(&vrConfig.distortionShader); - if ((hmdDevice == HMD_DEFAULT_DEVICE) || - (hmdDevice == HMD_OCULUS_RIFT_DK2) || - (hmdDevice == HMD_OCULUS_RIFT_CV1)) - { - // NOTE: Oculus Rift DK2 parameters - hmd.hResolution = 1280; // HMD horizontal resolution in pixels - hmd.vResolution = 800; // HMD vertical resolution in pixels - hmd.hScreenSize = 0.14976f;; // HMD horizontal size in meters - hmd.vScreenSize = 0.09356f; // HMD vertical size in meters - hmd.vScreenCenter = 0.04675f; // HMD screen center in meters - hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters - hmd.lensSeparationDistance = 0.0635f; // HMD lens separation distance in meters - hmd.interpupillaryDistance = 0.064f; // HMD IPD (distance between pupils) in meters - hmd.distortionK[0] = 1.0f; // HMD lens distortion constant parameter 0 - hmd.distortionK[1] = 0.22f; // HMD lens distortion constant parameter 1 - hmd.distortionK[2] = 0.24f; // HMD lens distortion constant parameter 2 - hmd.distortionK[3] = 0.0f; // HMD lens distortion constant parameter 3 - hmd.chromaAbCorrection[0] = 0.996f; // HMD chromatic aberration correction parameter 0 - hmd.chromaAbCorrection[1] = -0.004f; // HMD chromatic aberration correction parameter 1 - hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 - hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 - } - SetStereoConfig(hmd); vrSimulator = true; @@ -3761,9 +3785,8 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) static void SetStereoConfig(VrDeviceInfo hmd) { // Compute aspect ratio - //float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; - float aspect = (float)screenWidth*0.5f/(float)screenHeight; - + float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; + // Compute lens parameters float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; float leftLensCenter[2] = { 0.25 + lensShift, 0.5f }; @@ -3779,12 +3802,19 @@ static void SetStereoConfig(VrDeviceInfo hmd) hmd.distortionK[1]*lensRadiusSq + hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + hmd.distortionK[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; - + + TraceLog(DEBUG, "VR: Distortion Scale: %f", distortionScale); + float normScreenWidth = 0.5f; float normScreenHeight = 1.0f; float scaleIn[2] = { 2/normScreenWidth, 2/normScreenHeight/aspect }; float scale[2] = { normScreenWidth*0.5/distortionScale, normScreenHeight*0.5*aspect/distortionScale }; + TraceLog(DEBUG, "VR: Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); + TraceLog(DEBUG, "VR: Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); + TraceLog(DEBUG, "VR: Distortion Shader: Scale = { %f, %f }", scale[0], scale[1]); + TraceLog(DEBUG, "VR: Distortion Shader: ScaleIn = { %f, %f }", scaleIn[0], scaleIn[1]); + // Update distortion shader with lens and distortion-scale parameters SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftLensCenter"), leftLensCenter, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightLensCenter"), rightLensCenter, 2); @@ -3798,8 +3828,9 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG // ...but with lens distortion it is increased (see Oculus SDK Documentation) - float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? - + //float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? + float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; + // Compute camera projection matrices float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); @@ -3820,9 +3851,6 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Compute eyes Viewports //vrConfig.eyesViewport[0] = (Rectangle){ 0, 0, hmd.hResolution/2, hmd.vResolution }; //vrConfig.eyesViewport[1] = (Rectangle){ hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; - - //https://forums.oculus.com/vip/discussion/3413/calculating-the-distortion-shader-parameters - //https://vrwiki.wikispaces.com/Theory+%26+practice } // Set internal projection and modelview matrix depending on eyes tracking data -- cgit v1.2.3 From 56ec22f5c9291427efd59af37af4e78fbf80190c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 11 Jul 2016 17:34:12 +0200 Subject: Corrected some issues on OpenGL 1.1 Corrected lighting system crash and VR variables not found... --- src/rlgl.c | 270 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 141 insertions(+), 129 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 25005870..18c0b929 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -284,10 +284,6 @@ static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support - -// Lighting data -static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount = 0; // Enabled lights counter #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -331,6 +327,10 @@ static unsigned int whiteTexture; static int screenWidth; // Default framebuffer width static int screenHeight; // Default framebuffer height +// Lighting data +static Light lights[MAX_LIGHTS]; // Lights pool +static int lightsCount = 0; // Enabled lights counter + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -1880,6 +1880,8 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array + + // TODO: Support OpenGL 1.1 lighting system rlPushMatrix(); rlMultMatrixf(MatrixToFloat(transform)); @@ -2484,7 +2486,6 @@ Light CreateLight(int type, Vector3 position, Color diffuse) { Light light = NULL; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (lightsCount < MAX_LIGHTS) { // Allocate dynamic memory @@ -2506,9 +2507,15 @@ Light CreateLight(int type, Vector3 position, Color diffuse) // Increase enabled lights count lightsCount++; } - else TraceLog(WARNING, "Too many lights, only supported up to %i lights", MAX_LIGHTS); -#else - // TODO: Support OpenGL 1.1 lighting system + else + { + TraceLog(WARNING, "Too many lights, only supported up to %i lights", MAX_LIGHTS); + + // NOTE: Returning latest created light to avoid crashes + light = lights[lightsCount]; + } + +#if defined(GRAPHICS_API_OPENGL_11) TraceLog(WARNING, "Lighting currently not supported on OpenGL 1.1"); #endif @@ -2518,7 +2525,6 @@ Light CreateLight(int type, Vector3 position, Color diffuse) // Destroy a light and take it out of the list void DestroyLight(Light light) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (light != NULL) { // Free dynamic memory allocation @@ -2539,7 +2545,6 @@ void DestroyLight(Light light) // Decrease enabled physic objects count lightsCount--; } -#endif } // Init VR device (or simulator) @@ -2547,6 +2552,7 @@ void DestroyLight(Light light) // NOTE: It modifies the global variable: VrDeviceInfo hmd void InitVrDevice(int hmdDevice) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) switch (hmdDevice) { case HMD_DEFAULT_DEVICE: TraceLog(INFO, "Initializing default VR Device (Oculus Rift CV1)"); @@ -2631,11 +2637,13 @@ void InitVrDevice(int hmdDevice) vrSimulator = true; vrEnabled = true; } +#endif } // Close VR device (or simulator) void CloseVrDevice(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(RLGL_OCULUS_SUPPORT) if (vrDeviceReady) CloseOculusDevice(); else @@ -2644,7 +2652,7 @@ void CloseVrDevice(void) rlDeleteRenderTextures(vrConfig.stereoFbo); // Unload stereo framebuffer and texture UnloadShader(vrConfig.distortionShader); // Unload distortion shader } - +#endif vrDeviceReady = false; } @@ -2675,6 +2683,7 @@ void UpdateVrTracking(void) // Begin Oculus drawing configuration void BeginVrDrawing(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(RLGL_OCULUS_SUPPORT) if (vrDeviceReady) { @@ -2697,11 +2706,13 @@ void BeginVrDrawing(void) rlClearScreenBuffers(); // Clear current framebuffer(s) vrRendering = true; +#endif } // End Oculus drawing process (and desktop mirror) void EndVrDrawing(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(RLGL_OCULUS_SUPPORT) if (vrDeviceReady) { @@ -2764,6 +2775,7 @@ void EndVrDrawing(void) rlDisableDepthTest(); vrRendering = false; +#endif } //---------------------------------------------------------------------------------- @@ -3652,6 +3664,124 @@ static char *ReadTextFile(const char *fileName) return text; } + +// Configure stereo rendering (including distortion shader) with HMD device parameters +static void SetStereoConfig(VrDeviceInfo hmd) +{ + // Compute aspect ratio + float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; + + // Compute lens parameters + float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; + float leftLensCenter[2] = { 0.25 + lensShift, 0.5f }; + float rightLensCenter[2] = { 0.75 - lensShift, 0.5f }; + float leftScreenCenter[2] = { 0.25f, 0.5f }; + float rightScreenCenter[2] = { 0.75f, 0.5f }; + + // Compute distortion scale parameters + // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] + float lensRadius = fabsf(-1.0f - 4.0f*lensShift); + float lensRadiusSq = lensRadius*lensRadius; + float distortionScale = hmd.distortionK[0] + + hmd.distortionK[1]*lensRadiusSq + + hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + + hmd.distortionK[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; + + TraceLog(DEBUG, "VR: Distortion Scale: %f", distortionScale); + + float normScreenWidth = 0.5f; + float normScreenHeight = 1.0f; + float scaleIn[2] = { 2/normScreenWidth, 2/normScreenHeight/aspect }; + float scale[2] = { normScreenWidth*0.5/distortionScale, normScreenHeight*0.5*aspect/distortionScale }; + + TraceLog(DEBUG, "VR: Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); + TraceLog(DEBUG, "VR: Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); + TraceLog(DEBUG, "VR: Distortion Shader: Scale = { %f, %f }", scale[0], scale[1]); + TraceLog(DEBUG, "VR: Distortion Shader: ScaleIn = { %f, %f }", scaleIn[0], scaleIn[1]); + + // Update distortion shader with lens and distortion-scale parameters + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftLensCenter"), leftLensCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightLensCenter"), rightLensCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftScreenCenter"), leftScreenCenter, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightScreenCenter"), rightScreenCenter, 2); + + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scale"), scale, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scaleIn"), scaleIn, 2); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "hmdWarpParam"), hmd.distortionK, 4); + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); + + // Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG + // ...but with lens distortion it is increased (see Oculus SDK Documentation) + //float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? + float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; + + // Compute camera projection matrices + float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] + Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); + vrConfig.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); + vrConfig.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); + + // NOTE: Projection matrices must be transposed due to raymath convention + MatrixTranspose(&vrConfig.eyesProjection[0]); + MatrixTranspose(&vrConfig.eyesProjection[1]); + + // Compute camera transformation matrices + // NOTE: Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add + // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. + vrConfig.eyesViewOffset[0] = MatrixTranslate(-hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); + vrConfig.eyesViewOffset[1] = MatrixTranslate(hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); + + // Compute eyes Viewports + //vrConfig.eyesViewport[0] = (Rectangle){ 0, 0, hmd.hResolution/2, hmd.vResolution }; + //vrConfig.eyesViewport[1] = (Rectangle){ hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; +} + +// Set internal projection and modelview matrix depending on eyes tracking data +static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) +{ + if (vrEnabled) + { + Matrix eyeProjection = matProjection; + Matrix eyeModelView = matModelView; + +#if defined(RLGL_OCULUS_SUPPORT) + if (vrDeviceReady) + { + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, + layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); + + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, + layer.eyeLayer.RenderPose[eye].Orientation.w }; + QuaternionInvert(&eyeRenderPose); + Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, + -layer.eyeLayer.RenderPose[eye].Position.z); + + Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement + eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement + + eyeProjection = layer.eyeProjections[eye]; + } + else +#endif + { + // Setup viewport and projection/modelview matrices using tracking data + rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); + + // Apply view offset to modelview matrix + eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); + + eyeProjection = vrConfig.eyesProjection[eye]; + } + + SetMatrixModelview(eyeModelView); + SetMatrixProjection(eyeProjection); + } +} #endif //defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) #if defined(GRAPHICS_API_OPENGL_11) @@ -3781,124 +3911,6 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) } #endif -// Configure stereo rendering (including distortion shader) with HMD device parameters -static void SetStereoConfig(VrDeviceInfo hmd) -{ - // Compute aspect ratio - float aspect = ((float)hmd.hResolution*0.5f)/(float)hmd.vResolution; - - // Compute lens parameters - float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; - float leftLensCenter[2] = { 0.25 + lensShift, 0.5f }; - float rightLensCenter[2] = { 0.75 - lensShift, 0.5f }; - float leftScreenCenter[2] = { 0.25f, 0.5f }; - float rightScreenCenter[2] = { 0.75f, 0.5f }; - - // Compute distortion scale parameters - // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] - float lensRadius = fabsf(-1.0f - 4.0f*lensShift); - float lensRadiusSq = lensRadius*lensRadius; - float distortionScale = hmd.distortionK[0] + - hmd.distortionK[1]*lensRadiusSq + - hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + - hmd.distortionK[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; - - TraceLog(DEBUG, "VR: Distortion Scale: %f", distortionScale); - - float normScreenWidth = 0.5f; - float normScreenHeight = 1.0f; - float scaleIn[2] = { 2/normScreenWidth, 2/normScreenHeight/aspect }; - float scale[2] = { normScreenWidth*0.5/distortionScale, normScreenHeight*0.5*aspect/distortionScale }; - - TraceLog(DEBUG, "VR: Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); - TraceLog(DEBUG, "VR: Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); - TraceLog(DEBUG, "VR: Distortion Shader: Scale = { %f, %f }", scale[0], scale[1]); - TraceLog(DEBUG, "VR: Distortion Shader: ScaleIn = { %f, %f }", scaleIn[0], scaleIn[1]); - - // Update distortion shader with lens and distortion-scale parameters - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftLensCenter"), leftLensCenter, 2); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightLensCenter"), rightLensCenter, 2); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftScreenCenter"), leftScreenCenter, 2); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightScreenCenter"), rightScreenCenter, 2); - - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scale"), scale, 2); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scaleIn"), scaleIn, 2); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "hmdWarpParam"), hmd.distortionK, 4); - SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "chromaAbParam"), hmd.chromaAbCorrection, 4); - - // Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG - // ...but with lens distortion it is increased (see Oculus SDK Documentation) - //float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? - float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; - - // Compute camera projection matrices - float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] - Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); - vrConfig.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); - vrConfig.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); - - // NOTE: Projection matrices must be transposed due to raymath convention - MatrixTranspose(&vrConfig.eyesProjection[0]); - MatrixTranspose(&vrConfig.eyesProjection[1]); - - // Compute camera transformation matrices - // NOTE: Camera movement might seem more natural if we model the head. - // Our axis of rotation is the base of our head, so we might want to add - // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. - vrConfig.eyesViewOffset[0] = MatrixTranslate(-hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - vrConfig.eyesViewOffset[1] = MatrixTranslate(hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - - // Compute eyes Viewports - //vrConfig.eyesViewport[0] = (Rectangle){ 0, 0, hmd.hResolution/2, hmd.vResolution }; - //vrConfig.eyesViewport[1] = (Rectangle){ hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; -} - -// Set internal projection and modelview matrix depending on eyes tracking data -static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) -{ - if (vrEnabled) - { - Matrix eyeProjection = matProjection; - Matrix eyeModelView = matModelView; - -#if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) - { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, - layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, - layer.eyeLayer.RenderPose[eye].Orientation.w }; - QuaternionInvert(&eyeRenderPose); - Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, - -layer.eyeLayer.RenderPose[eye].Position.z); - - Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement - eyeModelView = MatrixMultiply(matModelView, eyeView); // Combine internal camera matrix (modelview) wih eye-head movement - - eyeProjection = layer.eyeProjections[eye]; - } - else -#endif - { - // Setup viewport and projection/modelview matrices using tracking data - rlViewport(eye*screenWidth/2, 0, screenWidth/2, screenHeight); - - // Apply view offset to modelview matrix - eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); - - eyeProjection = vrConfig.eyesProjection[eye]; - } - - SetMatrixModelview(eyeModelView); - SetMatrixProjection(eyeProjection); - } -} - #if defined(RLGL_OCULUS_SUPPORT) // Initialize Oculus device static bool InitOculusDevice(void) -- cgit v1.2.3 From 22672bc738ee0923fd43c431cb41d0bf4d8dd96c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 11 Jul 2016 19:01:13 +0200 Subject: Added Oculus functions declaration and comments --- src/rlgl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 18c0b929..b50e1a45 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -361,6 +361,12 @@ static char *ReadTextFile(const char *fileName); #endif #if defined(RLGL_OCULUS_SUPPORT) +static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) +static void CloseOculusDevice(void); // Close Oculus device +static void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking +static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing +static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror + static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers static OculusMirror LoadOculusMirror(ovrSession session, int width, int height); // Load Oculus mirror buffers @@ -3912,7 +3918,7 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) #endif #if defined(RLGL_OCULUS_SUPPORT) -// Initialize Oculus device +// Initialize Oculus device (returns true if success) static bool InitOculusDevice(void) { bool oculusReady = false; @@ -3959,6 +3965,7 @@ static bool InitOculusDevice(void) return oculusReady; } +// Close Oculus device (and unload buffers) static void CloseOculusDevice(void) { UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer @@ -3968,6 +3975,7 @@ static void CloseOculusDevice(void) ovr_Shutdown(); // Close Oculus device connection } +// Update Oculus head position-orientation tracking static void UpdateOculusTracking(void) { frameIndex++; @@ -3990,6 +3998,7 @@ static void UpdateOculusTracking(void) //if (sessionStatus.IsVisible) // the game or experience has VR focus and is visible in the HMD. } +// Setup Oculus buffers for drawing static void BeginOculusDrawing(void) { GLuint currentTexId; @@ -4003,6 +4012,7 @@ static void BeginOculusDrawing(void) //glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, buffer.depthId, 0); // Already binded } +// Finish Oculus drawing and blit framebuffer to mirror static void EndOculusDrawing(void) { // Unbind current framebuffer (Oculus buffer) -- cgit v1.2.3 From 31b64d46898e536a963b1c891cb7e0d9cd3881f7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 12 Jul 2016 17:10:31 +0200 Subject: Updated for GLSL 100 --- src/shader_distortion.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/shader_distortion.h b/src/shader_distortion.h index e4ce5d6c..75653e12 100644 --- a/src/shader_distortion.h +++ b/src/shader_distortion.h @@ -46,6 +46,16 @@ static const char fDistortionShaderStr[] = "out vec4 finalColor; \n" #endif "uniform sampler2D texture0; \n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +"uniform vec2 leftLensCenter; \n" +"uniform vec2 rightLensCenter; \n" +"uniform vec2 leftScreenCenter; \n" +"uniform vec2 rightScreenCenter; \n" +"uniform vec2 scale; \n" +"uniform vec2 scaleIn; \n" +"uniform vec4 hmdWarpParam; \n" +"uniform vec4 chromaAbParam; \n" +#elif defined(GRAPHICS_API_OPENGL_33) "uniform vec2 leftLensCenter = vec2(0.288, 0.5); \n" "uniform vec2 rightLensCenter = vec2(0.712, 0.5); \n" "uniform vec2 leftScreenCenter = vec2(0.25, 0.5); \n" @@ -54,6 +64,7 @@ static const char fDistortionShaderStr[] = "uniform vec2 scaleIn = vec2(4, 2.2222); \n" "uniform vec4 hmdWarpParam = vec4(1, 0.22, 0.24, 0); \n" "uniform vec4 chromaAbParam = vec4(0.996, -0.004, 1.014, 0.0); \n" +#endif "void main() \n" "{ \n" " vec2 lensCenter = fragTexCoord.x < 0.5 ? leftLensCenter : rightLensCenter; \n" @@ -65,7 +76,11 @@ static const char fDistortionShaderStr[] = " vec2 tcBlue = lensCenter + scale*thetaBlue; \n" " if (any(bvec2(clamp(tcBlue, screenCenter - vec2(0.25, 0.5), screenCenter + vec2(0.25, 0.5)) - tcBlue))) \n" " { \n" +#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) +" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); \n" +#elif defined(GRAPHICS_API_OPENGL_33) " finalColor = vec4(0.0, 0.0, 0.0, 1.0); \n" +#endif " } \n" " else \n" " { \n" -- cgit v1.2.3 From 9d6d68f00a154796682589458bce944f7b58dc14 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 12 Jul 2016 18:44:45 +0200 Subject: Support VR mode disable on Oculus device --- src/rlgl.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index b50e1a45..1d5d6157 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2671,7 +2671,17 @@ bool IsVrDeviceReady(void) // Enable/Disable VR experience (device or simulator) void ToggleVrMode(void) { - vrEnabled = !vrEnabled; + if (vrDeviceReady || vrSimulator) vrEnabled = !vrEnabled; + else vrEnabled = false; + + if (!vrEnabled) + { + // Reset viewport and default projection-modelview matrices + rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + projection = MatrixOrtho(0, GetScreenWidth(), GetScreenHeight(), 0, 0.0f, 1.0f); + MatrixTranspose(&projection); + modelview = MatrixIdentity(); + } } // Update VR tracking (position and orientation) @@ -3745,12 +3755,12 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) -{ +{ if (vrEnabled) { Matrix eyeProjection = matProjection; Matrix eyeModelView = matModelView; - + #if defined(RLGL_OCULUS_SUPPORT) if (vrDeviceReady) { -- cgit v1.2.3 From 11172118d10e193afade9816e145f0d57bcd4bb8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 13 Jul 2016 20:05:00 +0200 Subject: Review comments --- src/core.c | 11 +++++------ src/rlgl.c | 15 ++++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 107fc0a0..a3253d79 100644 --- a/src/core.c +++ b/src/core.c @@ -181,11 +181,10 @@ static uint64_t baseTime; // Base time measure for hi-res timer static bool windowShouldClose = false; // Flag to set window for closing #endif -static unsigned int displayWidth, displayHeight; // Display width and height (monitor, device-screen, LCD, ...) +// Display size-related data +static unsigned int displayWidth, displayHeight; // Display width and height (monitor, device-screen, LCD, ...) static int screenWidth, screenHeight; // Screen width and height (used render area) -static int renderWidth, renderHeight; // Framebuffer width and height (render area) - // NOTE: Framebuffer could include black bars - +static int renderWidth, renderHeight; // Framebuffer width and height (render area, including black bars if required) static int renderOffsetX = 0; // Offset X from render area (must be divided by 2) static int renderOffsetY = 0; // Offset Y from render area (must be divided by 2) static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP) @@ -214,7 +213,7 @@ static bool cursorHidden; // Track if cursor is hidden #endif static Vector2 mousePosition; // Mouse position on screen -static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen +static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen #if defined(PLATFORM_DESKTOP) static char **dropFilesPath; // Store dropped files paths as strings @@ -226,7 +225,7 @@ static double updateTime, drawTime; // Time measures for update and draw static double frameTime; // Time measure for one frame static double targetTime = 0.0; // Desired time for one frame, if 0 not applied -static char configFlags = 0; // Configuration flags (bit based) +static char configFlags = 0; // Configuration flags (bit based) static bool showLogo = false; // Track if showing logo at init is enabled //---------------------------------------------------------------------------------- diff --git a/src/rlgl.c b/src/rlgl.c index 1d5d6157..586c15e3 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -257,9 +257,9 @@ static DrawMode currentDrawMode; static float currentDepth = -1.0f; -static DynamicBuffer lines; -static DynamicBuffer triangles; -static DynamicBuffer quads; +static DynamicBuffer lines; // Default dynamic buffer for lines data +static DynamicBuffer triangles; // Default dynamic buffer for triangles data +static DynamicBuffer quads; // Default dynamic buffer for quads data (used to draw textures) // Default buffers draw calls static DrawCall *draws; @@ -271,9 +271,10 @@ static int tempBufferCount = 0; static bool useTempBuffer = false; // Shader Programs -static Shader defaultShader; -static Shader standardShader; // Lazy initialization when GetStandardShader() -static Shader currentShader; // By default, defaultShader +static Shader defaultShader; // Basic shader, support vertex color and diffuse texture +static Shader standardShader; // Shader with support for lighting and materials + // NOTE: Lazy initialization when GetStandardShader() +static Shader currentShader; // Shader to be used on rendering (by default, defaultShader) static bool standardShaderLoaded = false; // Flag to track if standard shader has been loaded // Flags for supported extensions @@ -357,7 +358,7 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array -static char *ReadTextFile(const char *fileName); +static char *ReadTextFile(const char *fileName); // Read chars array from text file #endif #if defined(RLGL_OCULUS_SUPPORT) -- cgit v1.2.3 From 338bb3fd9c0d26f181072f68552432702b8ce6dd Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 13 Jul 2016 20:05:53 +0200 Subject: Review variables to raylib naming conventions Some review work still required... --- src/audio.c | 302 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 151 insertions(+), 151 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index a76a453f..2941b9fb 100644 --- a/src/audio.c +++ b/src/audio.c @@ -69,7 +69,7 @@ // Defines and Macros //---------------------------------------------------------------------------------- #define MAX_STREAM_BUFFERS 2 // Number of buffers for each alSource -#define MAX_MIX_CHANNELS 4 // Number of open AL sources +#define MAX_MIX_CHANNELS 4 // Number of OpenAL sources #define MAX_MUSIC_STREAMS 2 // Number of simultanious music sources #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) @@ -86,10 +86,10 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -// Used to create custom audio streams that are not bound to a specific file. There can be -// no more than 4 concurrent mixchannels in use. This is due to each active mixc being tied to -// a dedicated mix channel. -typedef struct MixChannel_t { +// Used to create custom audio streams that are not bound to a specific file. +// There can be no more than 4 concurrent mixchannels in use. +// This is due to each active mixc being tied to a dedicated mix channel. +typedef struct MixChannel { unsigned short sampleRate; // default is 48000 unsigned char channels; // 1=mono,2=stereo unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream @@ -99,40 +99,40 @@ typedef struct MixChannel_t { ALenum alFormat; // OpenAL format specifier ALuint alSource; // OpenAL source ALuint alBuffer[MAX_STREAM_BUFFERS]; // OpenAL sample buffer -} MixChannel_t; +} MixChannel; // Music type (file streaming from memory) // NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... typedef struct Music { stb_vorbis *stream; - jar_xm_context_t *xmctx; // XM chiptune context - jar_mod_context_t modctx; // MOD chiptune context - MixChannel_t *mixc; // mix channel + jar_xm_context_t *xmctx; // XM chiptune context + jar_mod_context_t modctx; // MOD chiptune context + MixChannel *mixc; // Mix channel unsigned int totalSamplesLeft; float totalLengthSeconds; bool loop; - bool chipTune; // chiptune is loaded? + bool chipTune; // chiptune is loaded? bool enabled; } Music; // Audio errors registered typedef enum { - ERROR_RAW_CONTEXT_CREATION = 1, - ERROR_XM_CONTEXT_CREATION = 2, - ERROR_MOD_CONTEXT_CREATION = 4, - ERROR_MIX_CHANNEL_CREATION = 8, - ERROR_MUSIC_CHANNEL_CREATION = 16, - ERROR_LOADING_XM = 32, - ERROR_LOADING_MOD = 64, - ERROR_LOADING_WAV = 128, - ERROR_LOADING_OGG = 256, - ERROR_OUT_OF_MIX_CHANNELS = 512, - ERROR_EXTENSION_NOT_RECOGNIZED = 1024, - ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, - ERROR_INVALID_RRES_FILE = 4096, - ERROR_INVALID_RRES_RESOURCE = 8192, - ERROR_UNINITIALIZED_CHANNELS = 16384 + ERROR_RAW_CONTEXT_CREATION = 1, + ERROR_XM_CONTEXT_CREATION = 2, + ERROR_MOD_CONTEXT_CREATION = 4, + ERROR_MIX_CHANNEL_CREATION = 8, + ERROR_MUSIC_CHANNEL_CREATION = 16, + ERROR_LOADING_XM = 32, + ERROR_LOADING_MOD = 64, + ERROR_LOADING_WAV = 128, + ERROR_LOADING_OGG = 256, + ERROR_OUT_OF_MIX_CHANNELS = 512, + ERROR_EXTENSION_NOT_RECOGNIZED = 1024, + ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, + ERROR_INVALID_RRES_FILE = 4096, + ERROR_INVALID_RRES_RESOURCE = 8192, + ERROR_UNINITIALIZED_CHANNELS = 16384 } AudioError; #if defined(AUDIO_STANDALONE) @@ -142,10 +142,10 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Music musicChannels_g[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time -static MixChannel_t *mixChannels_g[MAX_MIX_CHANNELS]; // What mix channels are currently active +static Music musicStreams[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time +static MixChannel *mixChannels[MAX_MIX_CHANNELS]; // What mix channels are currently active -static int lastAudioError = 0; // Registers last audio error +static int lastAudioError = 0; // Registers last audio error //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -157,10 +157,10 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data static void EmptyMusicStream(int index); // Empty music buffers -static MixChannel_t *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. -static void CloseMixChannel(MixChannel_t *mixc); // Frees mix channel -static int BufferMixChannel(MixChannel_t *mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses -static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed +static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. +static void CloseMixChannel(MixChannel *mixc); // Frees mix channel +static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses +static int FillAlBufferWithSilence(MixChannel *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in static int IsMusicStreamReadyForBuffering(int index); // Checks if music buffer is ready to be refilled @@ -206,7 +206,7 @@ void CloseAudioDevice(void) { for (int index=0; index= MAX_MIX_CHANNELS) return NULL; if (!IsAudioDeviceReady()) InitAudioDevice(); - if (!mixChannels_g[mixChannel]) + if (!mixChannels[mixChannel]) { - MixChannel_t *mixc = (MixChannel_t *)malloc(sizeof(MixChannel_t)); + MixChannel *mixc = (MixChannel *)malloc(sizeof(MixChannel)); mixc->sampleRate = sampleRate; mixc->channels = channels; mixc->mixChannel = mixChannel; mixc->floatingPoint = floatingPoint; - mixChannels_g[mixChannel] = mixc; + mixChannels[mixChannel] = mixc; // Setup OpenAL format if (channels == 1) @@ -293,7 +293,7 @@ static MixChannel_t *InitMixChannel(unsigned short sampleRate, unsigned char mix } // Frees buffer in mix channel -static void CloseMixChannel(MixChannel_t *mixc) +static void CloseMixChannel(MixChannel *mixc) { if (mixc) { @@ -314,7 +314,7 @@ static void CloseMixChannel(MixChannel_t *mixc) // Delete source and buffers alDeleteSources(1, &mixc->alSource); alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - mixChannels_g[mixc->mixChannel] = NULL; + mixChannels[mixc->mixChannel] = NULL; free(mixc); mixc = NULL; } @@ -323,9 +323,9 @@ static void CloseMixChannel(MixChannel_t *mixc) // Pushes more audio data into mixc mix channel, only one buffer per call // Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. // @Returns number of samples that where processed. -static int BufferMixChannel(MixChannel_t *mixc, void *data, int numberElements) +static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) { - if (!mixc || (mixChannels_g[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples + if (!mixc || (mixChannels[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples if (!data || !numberElements) { @@ -369,7 +369,7 @@ static int BufferMixChannel(MixChannel_t *mixc, void *data, int numberElements) } // fill buffer with zeros, returns number processed -static int FillAlBufferWithSilence(MixChannel_t *mixc, ALuint buffer) +static int FillAlBufferWithSilence(MixChannel *mixc, ALuint buffer) { if (mixc->floatingPoint) { @@ -418,7 +418,7 @@ RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingP int mixIndex; for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { - if (mixChannels_g[mixIndex] == NULL) break; + if (mixChannels[mixIndex] == NULL) break; else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error } @@ -428,7 +428,7 @@ RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingP void CloseRawAudioContext(RawAudioContext ctx) { - if (mixChannels_g[ctx]) CloseMixChannel(mixChannels_g[ctx]); + if (mixChannels[ctx]) CloseMixChannel(mixChannels[ctx]); } // if 0 is returned, the buffers are still full and you need to keep trying with the same data until a + number is returned. @@ -440,7 +440,7 @@ int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short number if (ctx >= 0) { - MixChannel_t* mixc = mixChannels_g[ctx]; + MixChannel* mixc = mixChannels[ctx]; numBuffered = BufferMixChannel(mixc, data, numberElements); } @@ -809,20 +809,20 @@ int PlayMusicStream(int index, char *fileName) { int mixIndex; - if (musicChannels_g[index].stream || musicChannels_g[index].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error + if (musicStreams[index].stream || musicStreams[index].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { - if (mixChannels_g[mixIndex] == NULL) break; + if (mixChannels[mixIndex] == NULL) break; else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error } if (strcmp(GetExtension(fileName),"ogg") == 0) { // Open audio stream - musicChannels_g[index].stream = stb_vorbis_open_filename(fileName, NULL, NULL); + musicStreams[index].stream = stb_vorbis_open_filename(fileName, NULL, NULL); - if (musicChannels_g[index].stream == NULL) + if (musicStreams[index].stream == NULL) { TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); return ERROR_LOADING_OGG; // error @@ -830,53 +830,53 @@ int PlayMusicStream(int index, char *fileName) else { // Get file info - stb_vorbis_info info = stb_vorbis_get_info(musicChannels_g[index].stream); + stb_vorbis_info info = stb_vorbis_get_info(musicStreams[index].stream); TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); - musicChannels_g[index].loop = true; // We loop by default - musicChannels_g[index].enabled = true; + musicStreams[index].loop = true; // We loop by default + musicStreams[index].enabled = true; - musicChannels_g[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * info.channels; - musicChannels_g[index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); + musicStreams[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * info.channels; + musicStreams[index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[index].stream); if (info.channels == 2) { - musicChannels_g[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); - musicChannels_g[index].mixc->playing = true; + musicStreams[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + musicStreams[index].mixc->playing = true; } else { - musicChannels_g[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - musicChannels_g[index].mixc->playing = true; + musicStreams[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + musicStreams[index].mixc->playing = true; } - if (!musicChannels_g[index].mixc) return ERROR_LOADING_OGG; // error + if (!musicStreams[index].mixc) return ERROR_LOADING_OGG; // error } } else if (strcmp(GetExtension(fileName),"xm") == 0) { // only stereo is supported for xm - if (!jar_xm_create_context_from_file(&musicChannels_g[index].xmctx, 48000, fileName)) + if (!jar_xm_create_context_from_file(&musicStreams[index].xmctx, 48000, fileName)) { - musicChannels_g[index].chipTune = true; - musicChannels_g[index].loop = true; - jar_xm_set_max_loop_count(musicChannels_g[index].xmctx, 0); // infinite number of loops - musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicChannels_g[index].xmctx); - musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; - musicChannels_g[index].enabled = true; + musicStreams[index].chipTune = true; + musicStreams[index].loop = true; + jar_xm_set_max_loop_count(musicStreams[index].xmctx, 0); // infinite number of loops + musicStreams[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicStreams[index].xmctx); + musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft) / 48000.f; + musicStreams[index].enabled = true; - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicStreams[index].totalLengthSeconds); - musicChannels_g[index].mixc = InitMixChannel(48000, mixIndex, 2, true); + musicStreams[index].mixc = InitMixChannel(48000, mixIndex, 2, true); - if (!musicChannels_g[index].mixc) return ERROR_XM_CONTEXT_CREATION; // error + if (!musicStreams[index].mixc) return ERROR_XM_CONTEXT_CREATION; // error - musicChannels_g[index].mixc->playing = true; + musicStreams[index].mixc->playing = true; } else { @@ -886,24 +886,24 @@ int PlayMusicStream(int index, char *fileName) } else if (strcmp(GetExtension(fileName),"mod") == 0) { - jar_mod_init(&musicChannels_g[index].modctx); + jar_mod_init(&musicStreams[index].modctx); - if (jar_mod_load_file(&musicChannels_g[index].modctx, fileName)) + if (jar_mod_load_file(&musicStreams[index].modctx, fileName)) { - musicChannels_g[index].chipTune = true; - musicChannels_g[index].loop = true; - musicChannels_g[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicChannels_g[index].modctx); - musicChannels_g[index].totalLengthSeconds = ((float)musicChannels_g[index].totalSamplesLeft) / 48000.f; - musicChannels_g[index].enabled = true; + musicStreams[index].chipTune = true; + musicStreams[index].loop = true; + musicStreams[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicStreams[index].modctx); + musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft) / 48000.f; + musicStreams[index].enabled = true; - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicChannels_g[index].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicChannels_g[index].totalLengthSeconds); + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicStreams[index].totalLengthSeconds); - musicChannels_g[index].mixc = InitMixChannel(48000, mixIndex, 2, false); + musicStreams[index].mixc = InitMixChannel(48000, mixIndex, 2, false); - if (!musicChannels_g[index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + if (!musicStreams[index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error - musicChannels_g[index].mixc->playing = true; + musicStreams[index].mixc->playing = true; } else { @@ -920,26 +920,26 @@ int PlayMusicStream(int index, char *fileName) return 0; // normal return } -// Stop music playing for individual music index of musicChannels_g array (close stream) +// Stop music playing for individual music index of musicStreams array (close stream) void StopMusicStream(int index) { - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - CloseMixChannel(musicChannels_g[index].mixc); + CloseMixChannel(musicStreams[index].mixc); - if (musicChannels_g[index].xmctx) - jar_xm_free_context(musicChannels_g[index].xmctx); - else if (musicChannels_g[index].modctx.mod_loaded) - jar_mod_unload(&musicChannels_g[index].modctx); + if (musicStreams[index].xmctx) + jar_xm_free_context(musicStreams[index].xmctx); + else if (musicStreams[index].modctx.mod_loaded) + jar_mod_unload(&musicStreams[index].modctx); else - stb_vorbis_close(musicChannels_g[index].stream); + stb_vorbis_close(musicStreams[index].stream); - musicChannels_g[index].enabled = false; + musicStreams[index].enabled = false; - if (musicChannels_g[index].stream || musicChannels_g[index].xmctx) + if (musicStreams[index].stream || musicStreams[index].xmctx) { - musicChannels_g[index].stream = NULL; - musicChannels_g[index].xmctx = NULL; + musicStreams[index].stream = NULL; + musicStreams[index].xmctx = NULL; } } } @@ -952,7 +952,7 @@ int GetMusicStreamCount(void) // Find empty music slot for (int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) { - if(musicChannels_g[musicIndex].stream != NULL || musicChannels_g[musicIndex].chipTune) musicCount++; + if(musicStreams[musicIndex].stream != NULL || musicStreams[musicIndex].chipTune) musicCount++; } return musicCount; @@ -962,11 +962,11 @@ int GetMusicStreamCount(void) void PauseMusicStream(int index) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc && musicChannels_g[index].enabled) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc && musicStreams[index].enabled) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(musicChannels_g[index].mixc->alSource); - musicChannels_g[index].mixc->playing = false; + alSourcePause(musicStreams[index].mixc->alSource); + musicStreams[index].mixc->playing = false; } } @@ -976,15 +976,15 @@ void ResumeMusicStream(int index) // Resume music playing... if music available! ALenum state; - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(musicChannels_g[index].mixc->alSource); - musicChannels_g[index].mixc->playing = true; + alSourcePlay(musicStreams[index].mixc->alSource); + musicStreams[index].mixc->playing = true; } } } @@ -995,9 +995,9 @@ bool IsMusicPlaying(int index) bool playing = false; ALint state; - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); if (state == AL_PLAYING) playing = true; } @@ -1008,18 +1008,18 @@ bool IsMusicPlaying(int index) // Set volume for music void SetMusicVolume(int index, float volume) { - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - alSourcef(musicChannels_g[index].mixc->alSource, AL_GAIN, volume); + alSourcef(musicStreams[index].mixc->alSource, AL_GAIN, volume); } } // Set pitch for music void SetMusicPitch(int index, float pitch) { - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - alSourcef(musicChannels_g[index].mixc->alSource, AL_PITCH, pitch); + alSourcef(musicStreams[index].mixc->alSource, AL_PITCH, pitch); } } @@ -1028,8 +1028,8 @@ float GetMusicTimeLength(int index) { float totalSeconds; - if (musicChannels_g[index].chipTune) totalSeconds = (float)musicChannels_g[index].totalLengthSeconds; - else totalSeconds = stb_vorbis_stream_length_in_seconds(musicChannels_g[index].stream); + if (musicStreams[index].chipTune) totalSeconds = (float)musicStreams[index].totalLengthSeconds; + else totalSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[index].stream); return totalSeconds; } @@ -1039,24 +1039,24 @@ float GetMusicTimePlayed(int index) { float secondsPlayed = 0.0f; - if (index < MAX_MUSIC_STREAMS && musicChannels_g[index].mixc) + if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { - if (musicChannels_g[index].chipTune && musicChannels_g[index].xmctx) + if (musicStreams[index].chipTune && musicStreams[index].xmctx) { uint64_t samples; - jar_xm_get_position(musicChannels_g[index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000.f * musicChannels_g[index].mixc->channels); // Not sure if this is the correct value + jar_xm_get_position(musicStreams[index].xmctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples / (48000.f * musicStreams[index].mixc->channels); // Not sure if this is the correct value } - else if(musicChannels_g[index].chipTune && musicChannels_g[index].modctx.mod_loaded) + else if(musicStreams[index].chipTune && musicStreams[index].modctx.mod_loaded) { - long numsamp = jar_mod_current_samples(&musicChannels_g[index].modctx); + long numsamp = jar_mod_current_samples(&musicStreams[index].modctx); secondsPlayed = (float)numsamp / (48000.f); } else { - int totalSamples = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; - int samplesPlayed = totalSamples - musicChannels_g[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (musicChannels_g[index].mixc->sampleRate * musicChannels_g[index].mixc->channels); + int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * musicStreams[index].mixc->channels; + int samplesPlayed = totalSamples - musicStreams[index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed / (musicStreams[index].mixc->sampleRate * musicStreams[index].mixc->channels); } } @@ -1076,30 +1076,30 @@ static bool BufferMusicStream(int index, int numBuffers) int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - if (musicChannels_g[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + if (musicStreams[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { for (int i = 0; i < numBuffers; i++) { - if (musicChannels_g[index].modctx.mod_loaded) + if (musicStreams[index].modctx.mod_loaded) { - if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT/2; - else size = musicChannels_g[index].totalSamplesLeft/2; + if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT/2; + else size = musicStreams[index].totalSamplesLeft/2; - jar_mod_fillbuffer(&musicChannels_g[index].modctx, pcm, size, 0 ); - BufferMixChannel(musicChannels_g[index].mixc, pcm, size*2); + jar_mod_fillbuffer(&musicStreams[index].modctx, pcm, size, 0 ); + BufferMixChannel(musicStreams[index].mixc, pcm, size*2); } - else if (musicChannels_g[index].xmctx) + else if (musicStreams[index].xmctx) { - if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT/2; - else size = musicChannels_g[index].totalSamplesLeft/2; + if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT/2; + else size = musicStreams[index].totalSamplesLeft/2; - jar_xm_generate_samples(musicChannels_g[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location - BufferMixChannel(musicChannels_g[index].mixc, pcmf, size*2); + jar_xm_generate_samples(musicStreams[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location + BufferMixChannel(musicStreams[index].mixc, pcmf, size*2); } - musicChannels_g[index].totalSamplesLeft -= size; + musicStreams[index].totalSamplesLeft -= size; - if (musicChannels_g[index].totalSamplesLeft <= 0) + if (musicStreams[index].totalSamplesLeft <= 0) { active = false; break; @@ -1108,16 +1108,16 @@ static bool BufferMusicStream(int index, int numBuffers) } else { - if (musicChannels_g[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; - else size = musicChannels_g[index].totalSamplesLeft; + if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; + else size = musicStreams[index].totalSamplesLeft; for (int i = 0; i < numBuffers; i++) { - int streamedBytes = stb_vorbis_get_samples_short_interleaved(musicChannels_g[index].stream, musicChannels_g[index].mixc->channels, pcm, size); - BufferMixChannel(musicChannels_g[index].mixc, pcm, streamedBytes * musicChannels_g[index].mixc->channels); - musicChannels_g[index].totalSamplesLeft -= streamedBytes * musicChannels_g[index].mixc->channels; + int streamedBytes = stb_vorbis_get_samples_short_interleaved(musicStreams[index].stream, musicStreams[index].mixc->channels, pcm, size); + BufferMixChannel(musicStreams[index].mixc, pcm, streamedBytes * musicStreams[index].mixc->channels); + musicStreams[index].totalSamplesLeft -= streamedBytes * musicStreams[index].mixc->channels; - if (musicChannels_g[index].totalSamplesLeft <= 0) + if (musicStreams[index].totalSamplesLeft <= 0) { active = false; break; @@ -1134,11 +1134,11 @@ static void EmptyMusicStream(int index) ALuint buffer = 0; int queued = 0; - alGetSourcei(musicChannels_g[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); + alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); while (queued > 0) { - alSourceUnqueueBuffers(musicChannels_g[index].mixc->alSource, 1, &buffer); + alSourceUnqueueBuffers(musicStreams[index].mixc->alSource, 1, &buffer); queued--; } @@ -1148,7 +1148,7 @@ static void EmptyMusicStream(int index) static int IsMusicStreamReadyForBuffering(int index) { ALint processed = 0; - alGetSourcei(musicChannels_g[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); return processed; } @@ -1159,22 +1159,22 @@ void UpdateMusicStream(int index) bool active = true; int numBuffers = IsMusicStreamReadyForBuffering(index); - if (musicChannels_g[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicChannels_g[index].enabled && musicChannels_g[index].mixc && numBuffers) + if (musicStreams[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicStreams[index].enabled && musicStreams[index].mixc && numBuffers) { active = BufferMusicStream(index, numBuffers); - if (!active && musicChannels_g[index].loop) + if (!active && musicStreams[index].loop) { - if (musicChannels_g[index].chipTune) + if (musicStreams[index].chipTune) { - if(musicChannels_g[index].modctx.mod_loaded) jar_mod_seek_start(&musicChannels_g[index].modctx); + if(musicStreams[index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[index].modctx); - musicChannels_g[index].totalSamplesLeft = musicChannels_g[index].totalLengthSeconds * 48000.f; + musicStreams[index].totalSamplesLeft = musicStreams[index].totalLengthSeconds * 48000.f; } else { - stb_vorbis_seek_start(musicChannels_g[index].stream); - musicChannels_g[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicChannels_g[index].stream) * musicChannels_g[index].mixc->channels; + stb_vorbis_seek_start(musicStreams[index].stream); + musicStreams[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * musicStreams[index].mixc->channels; } active = BufferMusicStream(index, IsMusicStreamReadyForBuffering(index)); @@ -1182,9 +1182,9 @@ void UpdateMusicStream(int index) if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - alGetSourcei(musicChannels_g[index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING && active) alSourcePlay(musicChannels_g[index].mixc->alSource); + if (state != AL_PLAYING && active) alSourcePlay(musicStreams[index].mixc->alSource); if (!active) StopMusicStream(index); -- cgit v1.2.3 From 7959ccd84dd9eedd7aad10fe8b6bea988f828f40 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 15 Jul 2016 18:16:34 +0200 Subject: Review some functions, formatting and comments --- src/audio.c | 240 ++++++++++++++++++++++++++++++++--------------------------- src/audio.h | 31 +++++--- src/raylib.h | 2 - 3 files changed, 148 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2941b9fb..38fefd12 100644 --- a/src/audio.c +++ b/src/audio.c @@ -2,13 +2,26 @@ * * raylib.audio * -* Basic functions to manage Audio: InitAudioDevice, LoadAudioFiles, PlayAudioFiles +* Basic functions to manage Audio: +* Manage audio device (init/close) +* Load and Unload audio files +* Play/Stop/Pause/Resume loaded audio +* Manage mixing channels +* Manage raw audio context * * Uses external lib: * OpenAL Soft - Audio device management lib (http://kcat.strangesoft.net/openal.html) * stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) +* jar_xm - XM module file loading +* jar_mod - MOD audio file loading * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: +* XM audio module support (jar_xm) +* MOD audio module support (jar_mod) +* Mixing channels support +* Raw audio context support +* +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -68,9 +81,9 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_STREAM_BUFFERS 2 // Number of buffers for each alSource -#define MAX_MIX_CHANNELS 4 // Number of OpenAL sources +#define MAX_STREAM_BUFFERS 2 // Number of buffers for each source #define MAX_MUSIC_STREAMS 2 // Number of simultanious music sources +#define MAX_MIX_CHANNELS 4 // Number of mix channels (OpenAL sources) #if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) // NOTE: On RPI and Android should be lower to avoid frame-stalls @@ -143,7 +156,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; // Global Variables Definition //---------------------------------------------------------------------------------- static Music musicStreams[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time -static MixChannel *mixChannels[MAX_MIX_CHANNELS]; // What mix channels are currently active +static MixChannel *mixChannels[MAX_MIX_CHANNELS]; // Mix channels currently active (from music streams) static int lastAudioError = 0; // Registers last audio error @@ -157,13 +170,11 @@ static void UnloadWave(Wave wave); // Unload wave data static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data static void EmptyMusicStream(int index); // Empty music buffers -static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); // For streaming into mix channels. +static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); static void CloseMixChannel(MixChannel *mixc); // Frees mix channel -static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements); // Pushes more audio data into mixc mix channel, if NULL is passed it pauses -static int FillAlBufferWithSilence(MixChannel *mixc, ALuint buffer); // Fill buffer with zeros, returns number processed -static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in -static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in -static int IsMusicStreamReadyForBuffering(int index); // Checks if music buffer is ready to be refilled +static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements); // Pushes more audio data into mix channel +//static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in +//static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -204,7 +215,7 @@ void InitAudioDevice(void) // Close the audio device for all contexts void CloseAudioDevice(void) { - for (int index=0; index= MAX_MIX_CHANNELS) return NULL; @@ -280,7 +291,20 @@ static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixCh alGenBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); // Fill buffers - for (int i = 0; i < MAX_STREAM_BUFFERS; i++) FillAlBufferWithSilence(mixc, mixc->alBuffer[i]); + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) + { + // Initialize buffer with zeros by default + if (mixc->floatingPoint) + { + float pcm[MUSIC_BUFFER_SIZE_FLOAT] = { 0.0f }; + alBufferData(mixc->alBuffer[i], mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), mixc->sampleRate); + } + else + { + short pcm[MUSIC_BUFFER_SIZE_SHORT] = { 0 }; + alBufferData(mixc->alBuffer[i], mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); + } + } alSourceQueueBuffers(mixc->alSource, MAX_STREAM_BUFFERS, mixc->alBuffer); mixc->playing = true; @@ -320,9 +344,9 @@ static void CloseMixChannel(MixChannel *mixc) } } -// Pushes more audio data into mixc mix channel, only one buffer per call +// Pushes more audio data into mix channel, only one buffer per call // Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. -// @Returns number of samples that where processed. +// Returns number of samples that where processed. static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) { if (!mixc || (mixChannels[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples @@ -368,28 +392,11 @@ static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) return numberElements; } -// fill buffer with zeros, returns number processed -static int FillAlBufferWithSilence(MixChannel *mixc, ALuint buffer) -{ - if (mixc->floatingPoint) - { - float pcm[MUSIC_BUFFER_SIZE_FLOAT] = { 0.0f }; - alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), mixc->sampleRate); - - return MUSIC_BUFFER_SIZE_FLOAT; - } - else - { - short pcm[MUSIC_BUFFER_SIZE_SHORT] = { 0 }; - alBufferData(buffer, mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); - - return MUSIC_BUFFER_SIZE_SHORT; - } -} - +/* +// Convert data from short to float // example usage: -// short sh[3] = {1,2,3};float fl[3]; -// ResampleShortToFloat(sh,fl,3); +// short sh[3] = {1,2,3};float fl[3]; +// ResampleShortToFloat(sh,fl,3); static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len) { for (int i = 0; i < len; i++) @@ -399,9 +406,10 @@ static void ResampleShortToFloat(short *shorts, float *floats, unsigned short le } } +// Convert data from float to short // example usage: -// char ch[3] = {1,2,3};float fl[3]; -// ResampleByteToFloat(ch,fl,3); +// char ch[3] = {1,2,3};float fl[3]; +// ResampleByteToFloat(ch,fl,3); static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) { for (int i = 0; i < len; i++) @@ -410,43 +418,55 @@ static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) else floats[i] = (float)chars[i]/128.0f; } } +*/ -// used to output raw audio streams, returns negative numbers on error, + number represents the mix channel index -// if floating point is false the data size is 16bit short, otherwise it is float 32bit -RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint) +// Initialize raw audio mix channel for audio buffering +// NOTE: Returns mix channel index or -1 if it fails (errors are registered on lastAudioError) +int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint) { int mixIndex; + for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if (mixChannels[mixIndex] == NULL) break; - else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error + else if (mixIndex == (MAX_MIX_CHANNELS - 1)) + { + lastAudioError = ERROR_OUT_OF_MIX_CHANNELS; + return -1; + } } if (InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) return mixIndex; - else return ERROR_RAW_CONTEXT_CREATION; // error -} - -void CloseRawAudioContext(RawAudioContext ctx) -{ - if (mixChannels[ctx]) CloseMixChannel(mixChannels[ctx]); + else + { + lastAudioError = ERROR_RAW_CONTEXT_CREATION; + return -1; + } } -// if 0 is returned, the buffers are still full and you need to keep trying with the same data until a + number is returned. -// any + number returned is the number of samples that was processed and passed into buffer. -// data either needs to be array of floats or shorts. -int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements) +// Buffers data directly to raw mix channel +// if 0 is returned, buffers are still full and you need to keep trying with the same data +// otherwise it will return number of samples buffered. +// NOTE: Data could be either be an array of floats or shorts, depending on the created context +int BufferRawAudioContext(int ctx, void *data, unsigned short numberElements) { int numBuffered = 0; if (ctx >= 0) { - MixChannel* mixc = mixChannels[ctx]; + MixChannel *mixc = mixChannels[ctx]; numBuffered = BufferMixChannel(mixc, data, numberElements); } return numBuffered; } +// Closes and frees raw mix channel +void CloseRawAudioContext(int ctx) +{ + if (mixChannels[ctx]) CloseMixChannel(mixChannels[ctx]); +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- @@ -804,7 +824,7 @@ void SetSoundPitch(Sound sound, float pitch) //---------------------------------------------------------------------------------- // Start music playing (open stream) -// returns 0 on success +// returns 0 on success or error code int PlayMusicStream(int index, char *fileName) { int mixIndex; @@ -866,7 +886,7 @@ int PlayMusicStream(int index, char *fileName) musicStreams[index].loop = true; jar_xm_set_max_loop_count(musicStreams[index].xmctx, 0); // infinite number of loops musicStreams[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicStreams[index].xmctx); - musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft) / 48000.f; + musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft)/48000.0f; musicStreams[index].enabled = true; TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); @@ -893,7 +913,7 @@ int PlayMusicStream(int index, char *fileName) musicStreams[index].chipTune = true; musicStreams[index].loop = true; musicStreams[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicStreams[index].modctx); - musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft) / 48000.f; + musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft)/48000.0f; musicStreams[index].enabled = true; TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); @@ -944,6 +964,51 @@ void StopMusicStream(int index) } } +// Update (re-fill) music buffers if data already processed +void UpdateMusicStream(int index) +{ + ALenum state; + bool active = true; + ALint processed = 0; + + // Determine if music stream is ready to be written + alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + + if (musicStreams[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicStreams[index].enabled && musicStreams[index].mixc && (processed > 0)) + { + active = BufferMusicStream(index, processed); + + if (!active && musicStreams[index].loop) + { + if (musicStreams[index].chipTune) + { + if(musicStreams[index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[index].modctx); + + musicStreams[index].totalSamplesLeft = musicStreams[index].totalLengthSeconds*48000.0f; + } + else + { + stb_vorbis_seek_start(musicStreams[index].stream); + musicStreams[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[index].stream)*musicStreams[index].mixc->channels; + } + + // Determine if music stream is ready to be written + alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + + active = BufferMusicStream(index, processed); + } + + if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); + + alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); + + if (state != AL_PLAYING && active) alSourcePlay(musicStreams[index].mixc->alSource); + + if (!active) StopMusicStream(index); + + } +} + //get number of music channels active at this time, this does not mean they are playing int GetMusicStreamCount(void) { @@ -1045,18 +1110,18 @@ float GetMusicTimePlayed(int index) { uint64_t samples; jar_xm_get_position(musicStreams[index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples / (48000.f * musicStreams[index].mixc->channels); // Not sure if this is the correct value + secondsPlayed = (float)samples/(48000.0f*musicStreams[index].mixc->channels); // Not sure if this is the correct value } else if(musicStreams[index].chipTune && musicStreams[index].modctx.mod_loaded) { long numsamp = jar_mod_current_samples(&musicStreams[index].modctx); - secondsPlayed = (float)numsamp / (48000.f); + secondsPlayed = (float)numsamp/(48000.0f); } else { - int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * musicStreams[index].mixc->channels; + int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[index].stream)*musicStreams[index].mixc->channels; int samplesPlayed = totalSamples - musicStreams[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed / (musicStreams[index].mixc->sampleRate * musicStreams[index].mixc->channels); + secondsPlayed = (float)samplesPlayed/(musicStreams[index].mixc->sampleRate*musicStreams[index].mixc->channels); } } @@ -1144,53 +1209,6 @@ static void EmptyMusicStream(int index) } } -// Determine if a music stream is ready to be written -static int IsMusicStreamReadyForBuffering(int index) -{ - ALint processed = 0; - alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); - return processed; -} - -// Update (re-fill) music buffers if data already processed -void UpdateMusicStream(int index) -{ - ALenum state; - bool active = true; - int numBuffers = IsMusicStreamReadyForBuffering(index); - - if (musicStreams[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicStreams[index].enabled && musicStreams[index].mixc && numBuffers) - { - active = BufferMusicStream(index, numBuffers); - - if (!active && musicStreams[index].loop) - { - if (musicStreams[index].chipTune) - { - if(musicStreams[index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[index].modctx); - - musicStreams[index].totalSamplesLeft = musicStreams[index].totalLengthSeconds * 48000.f; - } - else - { - stb_vorbis_seek_start(musicStreams[index].stream); - musicStreams[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * musicStreams[index].mixc->channels; - } - - active = BufferMusicStream(index, IsMusicStreamReadyForBuffering(index)); - } - - if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - - alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); - - if (state != AL_PLAYING && active) alSourcePlay(musicStreams[index].mixc->alSource); - - if (!active) StopMusicStream(index); - - } -} - // Load WAV file into Wave structure static Wave LoadWAV(const char *fileName) { diff --git a/src/audio.h b/src/audio.h index 3ffe575c..f4a82a55 100644 --- a/src/audio.h +++ b/src/audio.h @@ -2,13 +2,26 @@ * * raylib.audio * -* Basic functions to manage Audio: InitAudioDevice, LoadAudioFiles, PlayAudioFiles +* Basic functions to manage Audio: +* Manage audio device (init/close) +* Load and Unload audio files +* Play/Stop/Pause/Resume loaded audio +* Manage mixing channels +* Manage raw audio context * * Uses external lib: * OpenAL Soft - Audio device management lib (http://kcat.strangesoft.net/openal.html) * stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) +* jar_xm - XM module file loading +* jar_mod - MOD audio file loading * -* Copyright (c) 2015 Ramon Santamaria (@raysan5) +* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: +* XM audio module support (jar_xm) +* MOD audio module support (jar_mod) +* Mixing channels support +* Raw audio context support +* +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -63,9 +76,6 @@ typedef struct Wave { short channels; } Wave; -typedef int RawAudioContext; - - #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -80,7 +90,7 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet +bool IsAudioDeviceReady(void); // Check if device has been initialized successfully Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data @@ -105,12 +115,9 @@ float GetMusicTimeLength(int index); // Get music tim float GetMusicTimePlayed(int index); // Get current music time played (in seconds) int GetMusicStreamCount(void); // Get number of streams loaded -// used to output raw audio streams, returns negative numbers on error -// if floating point is false the data size is 16bit short, otherwise it is float 32bit -RawAudioContext InitRawAudioContext(int sampleRate, int channels, bool floatingPoint); - -void CloseRawAudioContext(RawAudioContext ctx); -int BufferRawAudioContext(RawAudioContext ctx, void *data, unsigned short numberElements); // returns number of elements buffered +int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint); // Initialize raw audio mix channel for audio buffering +int BufferRawMixChannel(int mixc, void *data, unsigned short numberElements); // Buffers data directly to raw mix channel +void CloseRawMixChannel(int mixc); // Closes and frees raw mix channel #ifdef __cplusplus } diff --git a/src/raylib.h b/src/raylib.h index 9225c5ee..e3a17ebb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -468,8 +468,6 @@ typedef struct Wave { short channels; } Wave; -typedef int RawAudioContext; - // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { -- cgit v1.2.3 From 0fbd48a8890d5f3e2158dbec12a6e452b6fb81b0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 16 Jul 2016 14:58:53 +0200 Subject: Corrected bug on OpenGL 1.1 Set makefile to default OpenGL 3.3 compilation --- src/Makefile | 6 +++--- src/rlgl.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 33b666b4..b37cccf8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -49,10 +49,10 @@ ifeq ($(PLATFORM),PLATFORM_RPI) # define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used) GRAPHICS = GRAPHICS_API_OPENGL_ES2 else - # define raylib graphics api to use (OpenGL 1.1 by default) - GRAPHICS ?= GRAPHICS_API_OPENGL_11 + # define raylib graphics api to use (OpenGL 3.3 by default) + GRAPHICS ?= GRAPHICS_API_OPENGL_33 + #GRAPHICS = GRAPHICS_API_OPENGL_11 # Uncomment to use OpenGL 1.1 #GRAPHICS = GRAPHICS_API_OPENGL_21 # Uncomment to use OpenGL 2.1 - #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 endif ifeq ($(PLATFORM),PLATFORM_WEB) GRAPHICS = GRAPHICS_API_OPENGL_ES2 diff --git a/src/rlgl.c b/src/rlgl.c index 586c15e3..adccb0c7 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2645,6 +2645,10 @@ void InitVrDevice(int hmdDevice) vrEnabled = true; } #endif + +#if defined(GRAPHICS_API_OPENGL_11) + TraceLog(WARNING, "VR device or simulator not supported on OpenGL 1.1"); +#endif } // Close VR device (or simulator) @@ -2672,6 +2676,7 @@ bool IsVrDeviceReady(void) // Enable/Disable VR experience (device or simulator) void ToggleVrMode(void) { +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (vrDeviceReady || vrSimulator) vrEnabled = !vrEnabled; else vrEnabled = false; @@ -2683,6 +2688,7 @@ void ToggleVrMode(void) MatrixTranspose(&projection); modelview = MatrixIdentity(); } +#endif } // Update VR tracking (position and orientation) -- cgit v1.2.3 From dbec22f2df42811216454ffa3e9bdd4d5e4b8d45 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 16 Jul 2016 17:31:54 +0200 Subject: restyle Makefile of 'src/' folder and fix targets --- src/Makefile | 72 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index b37cccf8..b0ddadad 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,25 +1,28 @@ -#************************************************************************************************** +#****************************************************************************** # -# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) +# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) # -# Copyright (c) 2014 Ramon Santamaria (@raysan5) -# -# This software is provided "as-is", without any express or implied warranty. In no event -# will the authors be held liable for any damages arising from the use of this software. +# Copyright (c) 2014 Ramon Santamaria (@raysan5) # -# Permission is granted to anyone to use this software for any purpose, including commercial -# applications, and to alter it and redistribute it freely, subject to the following restrictions: +# This software is provided "as-is", without any express or implied warranty. +# In no event will the authors be held liable for any damages arising from +# the use of this software. # -# 1. The origin of this software must not be misrepresented; you must not claim that you -# wrote the original software. If you use this software in a product, an acknowledgment -# in the product documentation would be appreciated but is not required. +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: # -# 2. Altered source versions must be plainly marked as such, and must not be misrepresented -# as being the original software. +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software in a +# product, an acknowledgment in the product documentation would be +# appreciated but is not required. # -# 3. This notice may not be removed or altered from any source distribution. +# 2. Altered source versions must be plainly marked as such, and must not +# be misrepresented as being the original software. # -#************************************************************************************************** +# 3. This notice may not be removed or altered from any source distribution. +# +#****************************************************************************** .PHONY: all clean @@ -29,7 +32,8 @@ PLATFORM ?= PLATFORM_DESKTOP # determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) - # No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows + # No uname.exe on MinGW!, but OS=Windows_NT on Windows! + # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) PLATFORM_OS=WINDOWS else @@ -74,7 +78,7 @@ endif # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) # -std=gnu99 defines C language mode (GNU C from 1999 revision) -# -fgnu89-inline declaring inline functions support (GCC optimized, faster) +# -fgnu89-inline declaring inline functions support (GCC optimized) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces @@ -82,7 +86,9 @@ CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces # define any directories containing required header files ifeq ($(PLATFORM),PLATFORM_RPI) - INCLUDES = -I. -Iexternal -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads + INCLUDES = -I. -Iexternal -I/opt/vc/include \ + -I/opt/vc/include/interface/vmcs_host/linux \ + -I/opt/vc/include/interface/vcos/pthreads else # STB libraries and others INCLUDES = -I. -Iexternal @@ -93,19 +99,29 @@ else endif # define all object files required -OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o utils.o camera.o gestures.o stb_vorbis.o +OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o utils.o \ + camera.o gestures.o stb_vorbis.o -# typing 'make' will invoke the default target entry called 'all', -# in this case, the 'default' target entry is raylib -all: raylib +# typing 'make', it will invoke the first target on the file. +# 'all' target compile raylib into static, web and dynamic library versions. +# WIP: allow compiling of other versions. +all: libraylib.a -# compile raylib library -raylib: $(OBJS) -ifeq ($(PLATFORM),PLATFORM_WEB) - emcc -O1 $(OBJS) -o libraylib.bc -else +# compile raylib static library for desktop platforms +libraylib.a : $(OBJS) ar rcs libraylib.a $(OBJS) -endif + @echo "\t**libraylib.a generated!**" + +libraylib.bc : $(OBJS) + emcc -O1 $(OBJS) -o libraylib.bc + +# compile raylib library +# raylib: $(OBJS) +# ifeq ($(PLATFORM),PLATFORM_WEB) +# emcc -O1 $(OBJS) -o libraylib.bc +#else +# ar rcs libraylib.a $(OBJS) +#endif # compile core module # emcc core.c -o core.bc -DPLATFORM_DESKTOP -- cgit v1.2.3 From 6f335d2c9ea346c44f4000424cc389fd8db6a035 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 16 Jul 2016 18:38:17 +0200 Subject: add 'install' and 'unistall' target The first target allow makefile to install the dev files (static library and header) to standard directories on GNU/Linux platforms; the second allow it to unistall (remove) the dev files. It needs lot of improvements. --- src/Makefile | 52 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index b0ddadad..c294a813 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,12 +24,15 @@ # #****************************************************************************** -.PHONY: all clean +.PHONY: all clean install unistall # define raylib platform to compile for # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP +# determine if the file has root access (only for installing raylib) +ROOT = $(shell whoami) + # determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) # No uname.exe on MinGW!, but OS=Windows_NT on Windows! @@ -103,25 +106,17 @@ OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o utils.o \ camera.o gestures.o stb_vorbis.o # typing 'make', it will invoke the first target on the file. -# 'all' target compile raylib into static, web and dynamic library versions. -# WIP: allow compiling of other versions. +# The target 'all' compile raylib into static, web and dynamic library. +# TODO: add possibility to compile web and dynamic version of raylib. all: libraylib.a - # compile raylib static library for desktop platforms libraylib.a : $(OBJS) ar rcs libraylib.a $(OBJS) - @echo "\t**libraylib.a generated!**" + @echo "libraylib.a generated (static library)!" libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o libraylib.bc - -# compile raylib library -# raylib: $(OBJS) -# ifeq ($(PLATFORM),PLATFORM_WEB) -# emcc -O1 $(OBJS) -o libraylib.bc -#else -# ar rcs libraylib.a $(OBJS) -#endif + @echo "libraylib.bc generated (web version)!" # compile core module # emcc core.c -o core.bc -DPLATFORM_DESKTOP @@ -168,6 +163,37 @@ gestures.o: gestures.c stb_vorbis.o: external/stb_vorbis.c $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) +# It installs (copy) raylib dev files (static library and header) to standard +# directories on GNU/Linux platform. +# TODO: add other platforms. +install : +ifeq ($(ROOT),root) + ifeq ($(UNAMEOS),Linux) + cp --update libraylib.a /usr/local/lib/libraylib.a + cp --update raylib.h /usr/local/include/raylib.h + @echo "raylib dev files installed/updated!" + else + @echo "This function works only on GNU/Linux systems" + endif +else + @echo "Error: no root permissions" +endif + +# it removes raylib dev files installed on the system. +# TODO: see 'install' target. +unistall : +ifeq ($(ROOT),root) + ifeq ($(UNAMEOS),Linux) + rm --force /usr/local/lib/libraylib.a + rm --force /usr/local/include/raylib.h + @echo "raylib dev files removed!" + else + @echo "This function works only on GNU/Linux systems" + endif +else + @echo "Error: no root permissions" +endif + # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) -- cgit v1.2.3 From a05150392a14ded407ffbf8c735dd4f92354fcb8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 16 Jul 2016 19:24:08 +0200 Subject: Added audio standalone sample --- src/audio.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio.h b/src/audio.h index f4a82a55..b6850911 100644 --- a/src/audio.h +++ b/src/audio.h @@ -62,17 +62,16 @@ // Sound source type typedef struct Sound { - unsigned int source; - unsigned int buffer; - AudioError error; // if there was any error during the creation or use of this Sound + unsigned int source; // Sound audio source id + unsigned int buffer; // Sound audio buffer id } Sound; // Wave type, defines audio wave data typedef struct Wave { void *data; // Buffer data pointer unsigned int dataSize; // Data size in bytes - unsigned int sampleRate; - short bitsPerSample; + unsigned int sampleRate; // Samples per second to be played + short bitsPerSample; // Sample size in bits short channels; } Wave; -- cgit v1.2.3 From bfb5ffedda8ba9a9be41c6210e72cd5c98e1c702 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 16 Jul 2016 19:25:15 +0200 Subject: Added rlgl standalone sample --- src/rlgl.c | 4 ++-- src/rlgl.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index adccb0c7..ae016be9 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2683,8 +2683,8 @@ void ToggleVrMode(void) if (!vrEnabled) { // Reset viewport and default projection-modelview matrices - rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); - projection = MatrixOrtho(0, GetScreenWidth(), GetScreenHeight(), 0, 0.0f, 1.0f); + rlViewport(0, 0, screenWidth, screenHeight); + projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f); MatrixTranspose(&projection); modelview = MatrixIdentity(); } diff --git a/src/rlgl.h b/src/rlgl.h index 9afafc52..6608b4b2 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -239,6 +239,19 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // TraceLog message types typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; + + // Head Mounted Display devices + typedef enum { + HMD_DEFAULT_DEVICE = 0, + HMD_OCULUS_RIFT_DK2, + HMD_OCULUS_RIFT_CV1, + HMD_VALVE_HTC_VIVE, + HMD_SAMSUNG_GEAR_VR, + HMD_GOOGLE_CARDBOARD, + HMD_SONY_PLAYSTATION_VR, + HMD_RAZER_OSVR, + HMD_FOVE_VR, + } HmdDevice; #endif #ifdef __cplusplus -- cgit v1.2.3 From e62c30c8b1098d718aa419189c3f86adbe9c9383 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 16 Jul 2016 20:24:14 +0200 Subject: improve 'clean' target of 'src/' makefile --- src/Makefile | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index c294a813..3a45e73e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -196,24 +196,12 @@ endif # clean everything clean: -ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - del *.o libraylib.a - else - rm -f *.o libraylib.a - endif -endif -ifeq ($(PLATFORM),PLATFORM_WEB) - ifeq ($(PLATFORM_OS),WINDOWS) - del *.o libraylib.bc - else - rm -f *.o libraylib.bc - endif -endif -ifeq ($(PLATFORM),PLATFORM_RPI) - rm -f *.o libraylib.a +ifeq ($(PLATFORM_OS),WINDOWS) + del *.o libraylib.a libraylib.bc +else + rm -f *.o libraylib.a libraylib.bc endif - @echo Cleaning done + @echo "removed all generated files!" # instead of defining every module one by one, we can define a pattern # this pattern below will automatically compile every module defined on $(OBJS) -- cgit v1.2.3 From 6efaa78058b3ce5f38cdaf7dd53dcbfb044b01ba Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 16 Jul 2016 21:01:43 +0200 Subject: improve the compilation of all modules --- src/Makefile | 61 ++++++++++++++---------------------------------------------- 1 file changed, 14 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 3a45e73e..39f3c8a3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -101,14 +101,14 @@ else INCLUDES += -Iexternal/openal_soft/include endif -# define all object files required -OBJS = core.o rlgl.o shapes.o text.o textures.o models.o audio.o utils.o \ - camera.o gestures.o stb_vorbis.o +# define all object files required with a wildcard +OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) # typing 'make', it will invoke the first target on the file. # The target 'all' compile raylib into static, web and dynamic library. # TODO: add possibility to compile web and dynamic version of raylib. all: libraylib.a + # compile raylib static library for desktop platforms libraylib.a : $(OBJS) ar rcs libraylib.a $(OBJS) @@ -118,57 +118,24 @@ libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o libraylib.bc @echo "libraylib.bc generated (web version)!" -# compile core module -# emcc core.c -o core.bc -DPLATFORM_DESKTOP -core.o: core.c - $(CC) -c core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile rlgl module -rlgl.o: rlgl.c - $(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile shapes module -shapes.o: shapes.c - $(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile textures module -textures.o: textures.c - $(CC) -c textures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile text module -text.o: text.c - $(CC) -c text.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile models module -models.o: models.c - $(CC) -c models.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -# compile audio module -audio.o: audio.c - $(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile utils module -utils.o: utils.c - $(CC) -c utils.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile camera module -camera.o: camera.c - $(CC) -c camera.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - -# compile gestures module -gestures.o: gestures.c - $(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +# compile all modules +%.o : %.c %.h +ifneq ($(PLATFORM),PLATTFORM_WEB) + $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) +else + emcc $< -o $@ -DPLATFORM_DEKSTOP +endif # compile stb_vorbis library -stb_vorbis.o: external/stb_vorbis.c - $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) +#stb_vorbis.o: external/stb_vorbis.c +# $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) # It installs (copy) raylib dev files (static library and header) to standard # directories on GNU/Linux platform. # TODO: add other platforms. install : ifeq ($(ROOT),root) - ifeq ($(UNAMEOS),Linux) + ifeq ($(PLATFORM_OS),LINUX) cp --update libraylib.a /usr/local/lib/libraylib.a cp --update raylib.h /usr/local/include/raylib.h @echo "raylib dev files installed/updated!" @@ -183,7 +150,7 @@ endif # TODO: see 'install' target. unistall : ifeq ($(ROOT),root) - ifeq ($(UNAMEOS),Linux) + ifeq ($(PLATFORM_OS),LINUX) rm --force /usr/local/lib/libraylib.a rm --force /usr/local/include/raylib.h @echo "raylib dev files removed!" -- cgit v1.2.3 From d38fb9bda278134c749c4ccbd736edf028dd131c Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sat, 16 Jul 2016 21:23:21 +0200 Subject: fix small things on makefile of 'src/' folder --- src/Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 39f3c8a3..034bb6a0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -69,11 +69,9 @@ endif # define compiler: gcc for C program, define as g++ for C++ ifeq ($(PLATFORM),PLATFORM_WEB) - # define emscripten compiler - CC = emcc + CC = emcc # emscripten compiler else - # define default gcc compiler - CC = gcc + CC = gcc # default gcc compiler endif # define compiler flags: @@ -106,16 +104,16 @@ OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) # typing 'make', it will invoke the first target on the file. # The target 'all' compile raylib into static, web and dynamic library. -# TODO: add possibility to compile web and dynamic version of raylib. -all: libraylib.a +# TODO: add possibility to compile dynamic version of raylib. +all: libraylib.a libraylib.bc # compile raylib static library for desktop platforms libraylib.a : $(OBJS) - ar rcs libraylib.a $(OBJS) + ar rcs $@ $(OBJS) @echo "libraylib.a generated (static library)!" libraylib.bc : $(OBJS) - emcc -O1 $(OBJS) -o libraylib.bc + emcc -O1 $(OBJS) -o $@ @echo "libraylib.bc generated (web version)!" # compile all modules @@ -123,7 +121,7 @@ libraylib.bc : $(OBJS) ifneq ($(PLATFORM),PLATTFORM_WEB) $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) else - emcc $< -o $@ -DPLATFORM_DEKSTOP + emcc -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(GRAPHICS) -DPLATFORM_DEKSTOP endif # compile stb_vorbis library -- cgit v1.2.3 From 55b9a2479ad51ed02a1d231169c81f7cb81fa193 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 16 Jul 2016 22:41:13 +0200 Subject: Expose Oculus Rift functionality directly --- src/rlgl.c | 31 ++++++++++++++++++++----------- src/rlgl.h | 8 ++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index ae016be9..defbe04f 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -54,12 +54,11 @@ #include // OpenGL 3 library for OSX #else #define GLAD_IMPLEMENTATION -#if defined(RLGL_STANDALONE) - #include "glad.h" // GLAD extensions loading library, includes OpenGL headers -#else - #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers -#endif - + #if defined(RLGL_STANDALONE) + #include "glad.h" // GLAD extensions loading library, includes OpenGL headers + #else + #include "external/glad.h" // GLAD extensions loading library, includes OpenGL headers + #endif #endif #endif @@ -86,6 +85,12 @@ #include "external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h" // Oculus SDK for OpenGL #endif +#if defined(RLGL_STANDALONE) + #define OCULUSAPI +#else + #define OCULUSAPI static +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -362,11 +367,13 @@ static char *ReadTextFile(const char *fileName); // Read chars array from text f #endif #if defined(RLGL_OCULUS_SUPPORT) +#if !defined(RLGL_STANDALONE) static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) static void CloseOculusDevice(void); // Close Oculus device static void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror +#endif static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers static void UnloadOculusBuffer(ovrSession session, OculusBuffer buffer); // Unload texture required buffers @@ -377,6 +384,8 @@ static OculusLayer InitOculusLayer(ovrSession session); static Matrix FromOvrMatrix(ovrMatrix4f ovrM); // Convert from Oculus ovrMatrix4f struct to raymath Matrix struct #endif + + #if defined(GRAPHICS_API_OPENGL_11) static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight); static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight); @@ -3936,7 +3945,7 @@ static Color *GenNextMipmap(Color *srcData, int srcWidth, int srcHeight) #if defined(RLGL_OCULUS_SUPPORT) // Initialize Oculus device (returns true if success) -static bool InitOculusDevice(void) +OCULUSAPI bool InitOculusDevice(void) { bool oculusReady = false; @@ -3983,7 +3992,7 @@ static bool InitOculusDevice(void) } // Close Oculus device (and unload buffers) -static void CloseOculusDevice(void) +OCULUSAPI void CloseOculusDevice(void) { UnloadOculusMirror(session, mirror); // Unload Oculus mirror buffer UnloadOculusBuffer(session, buffer); // Unload Oculus texture buffers @@ -3993,7 +4002,7 @@ static void CloseOculusDevice(void) } // Update Oculus head position-orientation tracking -static void UpdateOculusTracking(void) +OCULUSAPI void UpdateOculusTracking(void) { frameIndex++; @@ -4016,7 +4025,7 @@ static void UpdateOculusTracking(void) } // Setup Oculus buffers for drawing -static void BeginOculusDrawing(void) +OCULUSAPI void BeginOculusDrawing(void) { GLuint currentTexId; int currentIndex; @@ -4030,7 +4039,7 @@ static void BeginOculusDrawing(void) } // Finish Oculus drawing and blit framebuffer to mirror -static void EndOculusDrawing(void) +OCULUSAPI void EndOculusDrawing(void) { // Unbind current framebuffer (Oculus buffer) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); diff --git a/src/rlgl.h b/src/rlgl.h index 6608b4b2..306e5361 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -363,6 +363,7 @@ Light CreateLight(int type, Vector3 position, Color diffuse); // Create a void DestroyLight(Light light); // Destroy a light and take it out of the list void TraceLog(int msgType, const char *text, ...); +float *MatrixToFloat(Matrix mat); void InitVrDevice(int hmdDevice); // Init VR device void CloseVrDevice(void); // Close VR device @@ -371,6 +372,13 @@ void BeginVrDrawing(void); // Begin VR drawing configuration void EndVrDrawing(void); // End VR drawing process (and desktop mirror) bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) + +// Oculus Rift API for direct access the device (no simulator) +bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) +void CloseOculusDevice(void); // Close Oculus device +void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking +void BeginOculusDrawing(void); // Setup Oculus buffers for drawing +void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror #endif #ifdef __cplusplus -- cgit v1.2.3 From a36cc7075ab714cee7efdc8b15380656488d87d4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Jul 2016 12:40:56 +0200 Subject: Corrected issue on drawing order --- src/shapes.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 2a4e19c2..d9b172f1 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -276,12 +276,29 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color) // Draw a triangle void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color) { - rlBegin(RL_TRIANGLES); - rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2f(v1.x, v1.y); - rlVertex2f(v2.x, v2.y); - rlVertex2f(v3.x, v3.y); - rlEnd(); + if (rlGetVersion() == OPENGL_11) + { + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(v1.x, v1.y); + rlVertex2f(v2.x, v2.y); + rlVertex2f(v3.x, v3.y); + rlEnd(); + } + else if ((rlGetVersion() == OPENGL_21) || (rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20)) + { + rlEnableTexture(GetDefaultTexture().id); // Default white texture + + rlBegin(RL_QUADS); + rlColor4ub(color.r, color.g, color.b, color.a); + rlVertex2f(v1.x, v1.y); + rlVertex2f(v2.x, v2.y); + rlVertex2f(v2.x, v2.y); + rlVertex2f(v3.x, v3.y); + rlEnd(); + + rlDisableTexture(); + } } void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color) -- cgit v1.2.3 From 94a5fc5c2c816c9d38a5065bbc267c339b3845a1 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 17 Jul 2016 15:54:52 +0200 Subject: add some explanation of makefile in 'src/' --- src/Makefile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 034bb6a0..88b9da04 100644 --- a/src/Makefile +++ b/src/Makefile @@ -31,6 +31,8 @@ PLATFORM ?= PLATFORM_DESKTOP # determine if the file has root access (only for installing raylib) +# "whoami" prints the name of the user that calls him (so, if it is the root +# user, "whoami" prints "root"). ROOT = $(shell whoami) # determine PLATFORM_OS in case PLATFORM_DESKTOP selected @@ -100,6 +102,8 @@ else endif # define all object files required with a wildcard +# The wildcard takes all files that finish with ".c", then it replaces the +# extentions with ".o", that are the object files. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) # typing 'make', it will invoke the first target on the file. @@ -116,7 +120,13 @@ libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o $@ @echo "libraylib.bc generated (web version)!" -# compile all modules +# Instead of defining every module one by one, we can define a pattern that +# automatically compiles every module defined on $(OBJS). +# core.o : core.c core.h +# $(CC) -c -o core.o core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +# +# The automatic variables "$@" and "$<" are the target and the first +# prerequisite. %.o : %.c %.h ifneq ($(PLATFORM),PLATTFORM_WEB) $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) @@ -125,8 +135,8 @@ else endif # compile stb_vorbis library -#stb_vorbis.o: external/stb_vorbis.c -# $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) +stb_vorbis.o: external/stb_vorbis.c + $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) # It installs (copy) raylib dev files (static library and header) to standard # directories on GNU/Linux platform. @@ -149,6 +159,10 @@ endif unistall : ifeq ($(ROOT),root) ifeq ($(PLATFORM_OS),LINUX) + # On GNU/Linux there are some standard directories that contain + # libraries and header files. These directory (/usr/local/lib and + # /usr/local/include/) are for libraries that are installed + # manually (without a package manager). rm --force /usr/local/lib/libraylib.a rm --force /usr/local/include/raylib.h @echo "raylib dev files removed!" @@ -167,8 +181,3 @@ else rm -f *.o libraylib.a libraylib.bc endif @echo "removed all generated files!" - -# instead of defining every module one by one, we can define a pattern -# this pattern below will automatically compile every module defined on $(OBJS) -#%.o : %.c -# $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) -- cgit v1.2.3 From 2272a4722fc22fd700e03511a956d382f391a8dd Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 17 Jul 2016 17:18:34 +0200 Subject: restore the original method to compile all modules This commit restores the original method to compile all modules, but fix prerequisites. --- src/Makefile | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 88b9da04..6c1a2a7c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -106,37 +106,56 @@ endif # extentions with ".o", that are the object files. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) +AUDIO_PREREQUISITES = external/stb_vorbis.o external/jar_xm.h \ + external/jar_mod.h + # typing 'make', it will invoke the first target on the file. # The target 'all' compile raylib into static, web and dynamic library. -# TODO: add possibility to compile dynamic version of raylib. -all: libraylib.a libraylib.bc +all: libraylib.a #libraylib.bc #libraylib.so -# compile raylib static library for desktop platforms +# compile raylib static library for desktop platforms. libraylib.a : $(OBJS) ar rcs $@ $(OBJS) @echo "libraylib.a generated (static library)!" +# compile raylib for web. libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o $@ @echo "libraylib.bc generated (web version)!" -# Instead of defining every module one by one, we can define a pattern that -# automatically compiles every module defined on $(OBJS). -# core.o : core.c core.h -# $(CC) -c -o core.o core.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -# -# The automatic variables "$@" and "$<" are the target and the first -# prerequisite. -%.o : %.c %.h -ifneq ($(PLATFORM),PLATTFORM_WEB) - $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) -else - emcc -c -o $@ $< $(CFLAGS) $(INCLUDES) -D$(GRAPHICS) -DPLATFORM_DEKSTOP -endif +camera.o : camera.c camera.h raylib.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) + +core.o : core.c raylib.h rlgl.h utils.h raymath.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) + +gestures.o : gestures.c gestures.h raylib.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) + +models.o : models.c raylib.h rlgl.h raymath.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) + +rlgl.o : rlgl.c rlgl.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(GRAPHICS) + +shapes.o : shapes.c raylib.h rlgl.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) + +text.o : text.c raylib.h utils.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) + +textures.o : textures.c rlgl.h utils.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + +utils.o : utils.c utils.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +audio.o : audio.c audio.h external/stb_vorbis.o + $(CC) -c $< external/stb_vorbis.o $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile stb_vorbis library -stb_vorbis.o: external/stb_vorbis.c - $(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM) +external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h + $(CC) -c -o $@ $< -O1 $(INCLUDES) -D$(PLATFORM) # It installs (copy) raylib dev files (static library and header) to standard # directories on GNU/Linux platform. -- cgit v1.2.3 From 13c56887f11b0def4e2b55f9514c2aaceeb0e4c7 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 17 Jul 2016 17:23:41 +0200 Subject: fix 'external/stb_vorbis.c" compilation --- src/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 6c1a2a7c..29d4f398 100644 --- a/src/Makefile +++ b/src/Makefile @@ -105,9 +105,7 @@ endif # The wildcard takes all files that finish with ".c", then it replaces the # extentions with ".o", that are the object files. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) - -AUDIO_PREREQUISITES = external/stb_vorbis.o external/jar_xm.h \ - external/jar_mod.h +OBJS += external/stb_vorbis.o # typing 'make', it will invoke the first target on the file. # The target 'all' compile raylib into static, web and dynamic library. @@ -123,6 +121,8 @@ libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o $@ @echo "libraylib.bc generated (web version)!" +# compile all modules with relative prerequisites (header files of the +# project). camera.o : camera.c camera.h raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDES) @@ -150,8 +150,8 @@ textures.o : textures.c rlgl.h utils.h utils.o : utils.c utils.h $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -audio.o : audio.c audio.h external/stb_vorbis.o - $(CC) -c $< external/stb_vorbis.o $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +audio.o : audio.c audio.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile stb_vorbis library external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h -- cgit v1.2.3 From ebfb1978b84bc4254b4da663885c1a81993214ae Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Sun, 17 Jul 2016 17:56:57 +0200 Subject: allow to compile shared version of raylib --- src/Makefile | 51 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 29d4f398..c5465c68 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,12 +24,18 @@ # #****************************************************************************** +# Please read the wiki to know how to compile raylib, because there are +# different methods. + .PHONY: all clean install unistall # define raylib platform to compile for # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP +# define if you want shared or static version of library. +SHARED ?= NO + # determine if the file has root access (only for installing raylib) # "whoami" prints the name of the user that calls him (so, if it is the root # user, "whoami" prints "root"). @@ -84,6 +90,9 @@ endif # -fgnu89-inline declaring inline functions support (GCC optimized) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces +ifeq ($(SHARED),YES) + CFLAGS += -fPIC +endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -107,15 +116,17 @@ endif OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) OBJS += external/stb_vorbis.o -# typing 'make', it will invoke the first target on the file. -# The target 'all' compile raylib into static, web and dynamic library. -all: libraylib.a #libraylib.bc #libraylib.so - # compile raylib static library for desktop platforms. +# The automatic variable "$@" is the target name, while "$<" is the first +# prerequisite. libraylib.a : $(OBJS) ar rcs $@ $(OBJS) @echo "libraylib.a generated (static library)!" +# compile raylib to shared library version. +libraylib.so : $(OBJS) + $(CC) -shared -o $@ $(OBJS) + # compile raylib for web. libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o $@ @@ -123,13 +134,13 @@ libraylib.bc : $(OBJS) # compile all modules with relative prerequisites (header files of the # project). -camera.o : camera.c camera.h raylib.h +camera.o : camera.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDES) core.o : core.c raylib.h rlgl.h utils.h raymath.h $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) -gestures.o : gestures.c gestures.h raylib.h +gestures.o : gestures.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDE) models.o : models.c raylib.h rlgl.h raymath.h @@ -155,7 +166,7 @@ audio.o : audio.c audio.h # compile stb_vorbis library external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h - $(CC) -c -o $@ $< -O1 $(INCLUDES) -D$(PLATFORM) + $(CC) -c -o $@ $< -O1 $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # It installs (copy) raylib dev files (static library and header) to standard # directories on GNU/Linux platform. @@ -163,8 +174,16 @@ external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h install : ifeq ($(ROOT),root) ifeq ($(PLATFORM_OS),LINUX) - cp --update libraylib.a /usr/local/lib/libraylib.a + # On GNU/Linux there are some standard directories that contain + # libraries and header files. These directory (/usr/local/lib and + # /usr/local/include/) are for libraries that are installed + # manually (without a package manager). cp --update raylib.h /usr/local/include/raylib.h + ifeq ($(SHARED),YES) + cp --update libraylib.so /usr/local/lib/libraylib.so + else + cp --update libraylib.a /usr/local/lib/libraylib.a + endif @echo "raylib dev files installed/updated!" else @echo "This function works only on GNU/Linux systems" @@ -178,12 +197,12 @@ endif unistall : ifeq ($(ROOT),root) ifeq ($(PLATFORM_OS),LINUX) - # On GNU/Linux there are some standard directories that contain - # libraries and header files. These directory (/usr/local/lib and - # /usr/local/include/) are for libraries that are installed - # manually (without a package manager). - rm --force /usr/local/lib/libraylib.a - rm --force /usr/local/include/raylib.h + rm --force /usr/local/include/raylib.h + ifeq ($(SHARED),YES) + rm --force /usr/local/lib/libraylib.so + else + rm --force /usr/local/lib/libraylib.a + endif @echo "raylib dev files removed!" else @echo "This function works only on GNU/Linux systems" @@ -195,8 +214,8 @@ endif # clean everything clean: ifeq ($(PLATFORM_OS),WINDOWS) - del *.o libraylib.a libraylib.bc + del *.o libraylib.a libraylib.bc libraylib.so external/stb_vorbis.o else - rm -f *.o libraylib.a libraylib.bc + rm -f *.o libraylib.a libraylib.bc libraylib.so external/stb_vorbis.o endif @echo "removed all generated files!" -- cgit v1.2.3 From 697e1d49416e9765b9aebc539d5f1ad4441dc46d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Jul 2016 14:53:11 +0200 Subject: Update pthreads library (win32) This library is only required by physac module to compulte physics in a second thread --- src/external/pthread/COPYING | 150 ++++ src/external/pthread/include/pthread.h | 1368 ++++++++++++++++++++++++++++++ src/external/pthread/include/sched.h | 183 ++++ src/external/pthread/include/semaphore.h | 169 ++++ src/external/pthread/lib/libpthreadGC2.a | Bin 0 -> 93480 bytes src/external/pthread/pthreadGC2.dll | Bin 119888 -> 0 bytes 6 files changed, 1870 insertions(+) create mode 100644 src/external/pthread/COPYING create mode 100644 src/external/pthread/include/pthread.h create mode 100644 src/external/pthread/include/sched.h create mode 100644 src/external/pthread/include/semaphore.h create mode 100644 src/external/pthread/lib/libpthreadGC2.a delete mode 100644 src/external/pthread/pthreadGC2.dll (limited to 'src') diff --git a/src/external/pthread/COPYING b/src/external/pthread/COPYING new file mode 100644 index 00000000..5cfea0d0 --- /dev/null +++ b/src/external/pthread/COPYING @@ -0,0 +1,150 @@ + pthreads-win32 - a POSIX threads library for Microsoft Windows + + +This file is Copyrighted +------------------------ + + This file is covered under the following Copyright: + + Copyright (C) 2001,2006 Ross P. Johnson + All rights reserved. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Pthreads-win32 is covered by the GNU Lesser General Public License +------------------------------------------------------------------ + + Pthreads-win32 is open software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation version 2.1 of the + License. + + Pthreads-win32 is several binary link libraries, several modules, + associated interface definition files and scripts used to control + its compilation and installation. + + Pthreads-win32 is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + A copy of the GNU Lesser General Public License is distributed with + pthreads-win32 under the filename: + + COPYING.LIB + + You should have received a copy of the version 2.1 GNU Lesser General + Public License with pthreads-win32; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place + Suite 330 + Boston, MA 02111-1307 + USA + + The contact addresses for pthreads-win32 is as follows: + + Web: http://sources.redhat.com/pthreads-win32 + Email: Ross Johnson + Please use: Firstname.Lastname@homemail.com.au + + + +Pthreads-win32 copyrights and exception files +--------------------------------------------- + + With the exception of the files listed below, Pthreads-win32 + is covered under the following GNU Lesser General Public License + Copyrights: + + Pthreads-win32 - POSIX Threads Library for Win32 + Copyright(C) 1998 John E. Bossom + Copyright(C) 1999,2006 Pthreads-win32 contributors + + The current list of contributors is contained + in the file CONTRIBUTORS included with the source + code distribution. The current list of CONTRIBUTORS + can also be seen at the following WWW location: + http://sources.redhat.com/pthreads-win32/contributors.html + + Contact Email: Ross Johnson + Please use: Firstname.Lastname@homemail.com.au + + These files are not covered under one of the Copyrights listed above: + + COPYING + COPYING.LIB + tests/rwlock7.c + + This file, COPYING, is distributed under the Copyright found at the + top of this file. It is important to note that you may distribute + verbatim copies of this file but you may not modify this file. + + The file COPYING.LIB, which contains a copy of the version 2.1 + GNU Lesser General Public License, is itself copyrighted by the + Free Software Foundation, Inc. Please note that the Free Software + Foundation, Inc. does NOT have a copyright over Pthreads-win32, + only the COPYING.LIB that is supplied with pthreads-win32. + + The file tests/rwlock7.c is derived from code written by + Dave Butenhof for his book 'Programming With POSIX(R) Threads'. + The original code was obtained by free download from his website + http://home.earthlink.net/~anneart/family/Threads/source.html + and did not contain a copyright or author notice. It is assumed to + be freely distributable. + + In all cases one may use and distribute these exception files freely. + And because one may freely distribute the LGPL covered files, the + entire pthreads-win32 source may be freely used and distributed. + + + +General Copyleft and License info +--------------------------------- + + For general information on Copylefts, see: + + http://www.gnu.org/copyleft/ + + For information on GNU Lesser General Public Licenses, see: + + http://www.gnu.org/copyleft/lesser.html + http://www.gnu.org/copyleft/lesser.txt + + +Why pthreads-win32 did not use the GNU General Public License +------------------------------------------------------------- + + The goal of the pthreads-win32 project has been to + provide a quality and complete implementation of the POSIX + threads API for Microsoft Windows within the limits imposed + by virtue of it being a stand-alone library and not + linked directly to other POSIX compliant libraries. For + example, some functions and features, such as those based + on POSIX signals, are missing. + + Pthreads-win32 is a library, available in several different + versions depending on supported compilers, and may be used + as a dynamically linked module or a statically linked set of + binary modules. It is not an application on it's own. + + It was fully intended that pthreads-win32 be usable with + commercial software not covered by either the GPL or the LGPL + licenses. Pthreads-win32 has many contributors to it's + code base, many of whom have done so because they have + used the library in commercial or proprietry software + projects. + + Releasing pthreads-win32 under the LGPL ensures that the + library can be used widely, while at the same time ensures + that bug fixes and improvements to the pthreads-win32 code + itself is returned to benefit all current and future users + of the library. + + Although pthreads-win32 makes it possible for applications + that use POSIX threads to be ported to Win32 platforms, the + broader goal of the project is to encourage the use of open + standards, and in particular, to make it just a little easier + for developers writing Win32 applications to consider + widening the potential market for their products. diff --git a/src/external/pthread/include/pthread.h b/src/external/pthread/include/pthread.h new file mode 100644 index 00000000..b4072f72 --- /dev/null +++ b/src/external/pthread/include/pthread.h @@ -0,0 +1,1368 @@ +/* This is an implementation of the threads API of POSIX 1003.1-2001. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2005 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#if !defined( PTHREAD_H ) +#define PTHREAD_H + +/* + * See the README file for an explanation of the pthreads-win32 version + * numbering scheme and how the DLL is named etc. + */ +#define PTW32_VERSION 2,9,1,0 +#define PTW32_VERSION_STRING "2, 9, 1, 0\0" + +/* There are three implementations of cancel cleanup. + * Note that pthread.h is included in both application + * compilation units and also internally for the library. + * The code here and within the library aims to work + * for all reasonable combinations of environments. + * + * The three implementations are: + * + * WIN32 SEH + * C + * C++ + * + * Please note that exiting a push/pop block via + * "return", "exit", "break", or "continue" will + * lead to different behaviour amongst applications + * depending upon whether the library was built + * using SEH, C++, or C. For example, a library built + * with SEH will call the cleanup routine, while both + * C++ and C built versions will not. + */ + +/* + * Define defaults for cleanup code. + * Note: Unless the build explicitly defines one of the following, then + * we default to standard C style cleanup. This style uses setjmp/longjmp + * in the cancelation and thread exit implementations and therefore won't + * do stack unwinding if linked to applications that have it (e.g. + * C++ apps). This is currently consistent with most/all commercial Unix + * POSIX threads implementations. + */ +#if !defined( __CLEANUP_SEH ) && !defined( __CLEANUP_CXX ) && !defined( __CLEANUP_C ) +# define __CLEANUP_C +#endif + +#if defined( __CLEANUP_SEH ) && ( !defined( _MSC_VER ) && !defined(PTW32_RC_MSC)) +#error ERROR [__FILE__, line __LINE__]: SEH is not supported for this compiler. +#endif + +/* + * Stop here if we are being included by the resource compiler. + */ +#if !defined(RC_INVOKED) + +#undef PTW32_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_LEVEL +#define PTW32_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_LEVEL +#define PTW32_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_LEVEL_MAX 3 + +#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_LEVEL) +#define PTW32_LEVEL PTW32_LEVEL_MAX +/* Include everything */ +#endif + +#if defined(_UWIN) +# define HAVE_STRUCT_TIMESPEC 1 +# define HAVE_SIGNAL_H 1 +# undef HAVE_PTW32_CONFIG_H +# pragma comment(lib, "pthread") +#endif + +/* + * ------------------------------------------------------------- + * + * + * Module: pthread.h + * + * Purpose: + * Provides an implementation of PThreads based upon the + * standard: + * + * POSIX 1003.1-2001 + * and + * The Single Unix Specification version 3 + * + * (these two are equivalent) + * + * in order to enhance code portability between Windows, + * various commercial Unix implementations, and Linux. + * + * See the ANNOUNCE file for a full list of conforming + * routines and defined constants, and a list of missing + * routines and constants not defined in this implementation. + * + * Authors: + * There have been many contributors to this library. + * The initial implementation was contributed by + * John Bossom, and several others have provided major + * sections or revisions of parts of the implementation. + * Often significant effort has been contributed to + * find and fix important bugs and other problems to + * improve the reliability of the library, which sometimes + * is not reflected in the amount of code which changed as + * result. + * As much as possible, the contributors are acknowledged + * in the ChangeLog file in the source code distribution + * where their changes are noted in detail. + * + * Contributors are listed in the CONTRIBUTORS file. + * + * As usual, all bouquets go to the contributors, and all + * brickbats go to the project maintainer. + * + * Maintainer: + * The code base for this project is coordinated and + * eventually pre-tested, packaged, and made available by + * + * Ross Johnson + * + * QA Testers: + * Ultimately, the library is tested in the real world by + * a host of competent and demanding scientists and + * engineers who report bugs and/or provide solutions + * which are then fixed or incorporated into subsequent + * versions of the library. Each time a bug is fixed, a + * test case is written to prove the fix and ensure + * that later changes to the code don't reintroduce the + * same error. The number of test cases is slowly growing + * and therefore so is the code reliability. + * + * Compliance: + * See the file ANNOUNCE for the list of implemented + * and not-implemented routines and defined options. + * Of course, these are all defined is this file as well. + * + * Web site: + * The source code and other information about this library + * are available from + * + * http://sources.redhat.com/pthreads-win32/ + * + * ------------------------------------------------------------- + */ + +/* Try to avoid including windows.h */ +#if (defined(__MINGW64__) || defined(__MINGW32__)) && defined(__cplusplus) +#define PTW32_INCLUDE_WINDOWS_H +#endif + +#if defined(PTW32_INCLUDE_WINDOWS_H) +#include +#endif + +#if defined(_MSC_VER) && _MSC_VER < 1300 || defined(__DMC__) +/* + * VC++6.0 or early compiler's header has no DWORD_PTR type. + */ +typedef unsigned long DWORD_PTR; +typedef unsigned long ULONG_PTR; +#endif +/* + * ----------------- + * autoconf switches + * ----------------- + */ + +#if defined(HAVE_PTW32_CONFIG_H) +#include "config.h" +#endif /* HAVE_PTW32_CONFIG_H */ + +#if !defined(NEED_FTIME) +#include +#else /* NEED_FTIME */ +/* use native WIN32 time API */ +#endif /* NEED_FTIME */ + +#if defined(HAVE_SIGNAL_H) +#include +#endif /* HAVE_SIGNAL_H */ + +#include + +/* + * Boolean values to make us independent of system includes. + */ +enum { + PTW32_FALSE = 0, + PTW32_TRUE = (! PTW32_FALSE) +}; + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#if !defined(PTW32_CONFIG_H) +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(__MINGW64__) +# define HAVE_STRUCT_TIMESPEC +# define HAVE_MODE_T +# elif defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +#if defined(NEED_ERRNO) +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Several systems don't define some error numbers. + */ +#if !defined(ENOTSUP) +# define ENOTSUP 48 /* This is the value in Solaris. */ +#endif + +#if !defined(ETIMEDOUT) +# define ETIMEDOUT 10060 /* Same as WSAETIMEDOUT */ +#endif + +#if !defined(ENOSYS) +# define ENOSYS 140 /* Semi-arbitrary value */ +#endif + +#if !defined(EDEADLK) +# if defined(EDEADLOCK) +# define EDEADLK EDEADLOCK +# else +# define EDEADLK 36 /* This is the value in MSVC. */ +# endif +#endif + +/* POSIX 2008 - related to robust mutexes */ +#if !defined(EOWNERDEAD) +# define EOWNERDEAD 43 +#endif +#if !defined(ENOTRECOVERABLE) +# define ENOTRECOVERABLE 44 +#endif + +#include + +/* + * To avoid including windows.h we define only those things that we + * actually need from it. + */ +#if !defined(PTW32_INCLUDE_WINDOWS_H) +#if !defined(HANDLE) +# define PTW32__HANDLE_DEF +# define HANDLE void * +#endif +#if !defined(DWORD) +# define PTW32__DWORD_DEF +# define DWORD unsigned long +#endif +#endif + +#if !defined(HAVE_STRUCT_TIMESPEC) +#define HAVE_STRUCT_TIMESPEC +#if !defined(_TIMESPEC_DEFINED) +#define _TIMESPEC_DEFINED +struct timespec { + time_t tv_sec; + long tv_nsec; +}; +#endif /* _TIMESPEC_DEFINED */ +#endif /* HAVE_STRUCT_TIMESPEC */ + +#if !defined(SIG_BLOCK) +#define SIG_BLOCK 0 +#endif /* SIG_BLOCK */ + +#if !defined(SIG_UNBLOCK) +#define SIG_UNBLOCK 1 +#endif /* SIG_UNBLOCK */ + +#if !defined(SIG_SETMASK) +#define SIG_SETMASK 2 +#endif /* SIG_SETMASK */ + +#if defined(__cplusplus) +extern "C" +{ +#endif /* __cplusplus */ + +/* + * ------------------------------------------------------------- + * + * POSIX 1003.1-2001 Options + * ========================= + * + * Options are normally set in , which is not provided + * with pthreads-win32. + * + * For conformance with the Single Unix Specification (version 3), all of the + * options below are defined, and have a value of either -1 (not supported) + * or 200112L (supported). + * + * These options can neither be left undefined nor have a value of 0, because + * either indicates that sysconf(), which is not implemented, may be used at + * runtime to check the status of the option. + * + * _POSIX_THREADS (== 200112L) + * If == 200112L, you can use threads + * + * _POSIX_THREAD_ATTR_STACKSIZE (== 200112L) + * If == 200112L, you can control the size of a thread's + * stack + * pthread_attr_getstacksize + * pthread_attr_setstacksize + * + * _POSIX_THREAD_ATTR_STACKADDR (== -1) + * If == 200112L, you can allocate and control a thread's + * stack. If not supported, the following functions + * will return ENOSYS, indicating they are not + * supported: + * pthread_attr_getstackaddr + * pthread_attr_setstackaddr + * + * _POSIX_THREAD_PRIORITY_SCHEDULING (== -1) + * If == 200112L, you can use realtime scheduling. + * This option indicates that the behaviour of some + * implemented functions conforms to the additional TPS + * requirements in the standard. E.g. rwlocks favour + * writers over readers when threads have equal priority. + * + * _POSIX_THREAD_PRIO_INHERIT (== -1) + * If == 200112L, you can create priority inheritance + * mutexes. + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PRIO_PROTECT (== -1) + * If == 200112L, you can create priority ceiling mutexes + * Indicates the availability of: + * pthread_mutex_getprioceiling + * pthread_mutex_setprioceiling + * pthread_mutexattr_getprioceiling + * pthread_mutexattr_getprotocol + + * pthread_mutexattr_setprioceiling + * pthread_mutexattr_setprotocol + + * + * _POSIX_THREAD_PROCESS_SHARED (== -1) + * If set, you can create mutexes and condition + * variables that can be shared with another + * process.If set, indicates the availability + * of: + * pthread_mutexattr_getpshared + * pthread_mutexattr_setpshared + * pthread_condattr_getpshared + * pthread_condattr_setpshared + * + * _POSIX_THREAD_SAFE_FUNCTIONS (== 200112L) + * If == 200112L you can use the special *_r library + * functions that provide thread-safe behaviour + * + * _POSIX_READER_WRITER_LOCKS (== 200112L) + * If == 200112L, you can use read/write locks + * + * _POSIX_SPIN_LOCKS (== 200112L) + * If == 200112L, you can use spin locks + * + * _POSIX_BARRIERS (== 200112L) + * If == 200112L, you can use barriers + * + * + These functions provide both 'inherit' and/or + * 'protect' protocol, based upon these macro + * settings. + * + * ------------------------------------------------------------- + */ + +/* + * POSIX Options + */ +#undef _POSIX_THREADS +#define _POSIX_THREADS 200809L + +#undef _POSIX_READER_WRITER_LOCKS +#define _POSIX_READER_WRITER_LOCKS 200809L + +#undef _POSIX_SPIN_LOCKS +#define _POSIX_SPIN_LOCKS 200809L + +#undef _POSIX_BARRIERS +#define _POSIX_BARRIERS 200809L + +#undef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L + +#undef _POSIX_THREAD_ATTR_STACKSIZE +#define _POSIX_THREAD_ATTR_STACKSIZE 200809L + +/* + * The following options are not supported + */ +#undef _POSIX_THREAD_ATTR_STACKADDR +#define _POSIX_THREAD_ATTR_STACKADDR -1 + +#undef _POSIX_THREAD_PRIO_INHERIT +#define _POSIX_THREAD_PRIO_INHERIT -1 + +#undef _POSIX_THREAD_PRIO_PROTECT +#define _POSIX_THREAD_PRIO_PROTECT -1 + +/* TPS is not fully supported. */ +#undef _POSIX_THREAD_PRIORITY_SCHEDULING +#define _POSIX_THREAD_PRIORITY_SCHEDULING -1 + +#undef _POSIX_THREAD_PROCESS_SHARED +#define _POSIX_THREAD_PROCESS_SHARED -1 + + +/* + * POSIX 1003.1-2001 Limits + * =========================== + * + * These limits are normally set in , which is not provided with + * pthreads-win32. + * + * PTHREAD_DESTRUCTOR_ITERATIONS + * Maximum number of attempts to destroy + * a thread's thread-specific data on + * termination (must be at least 4) + * + * PTHREAD_KEYS_MAX + * Maximum number of thread-specific data keys + * available per process (must be at least 128) + * + * PTHREAD_STACK_MIN + * Minimum supported stack size for a thread + * + * PTHREAD_THREADS_MAX + * Maximum number of threads supported per + * process (must be at least 64). + * + * SEM_NSEMS_MAX + * The maximum number of semaphores a process can have. + * (must be at least 256) + * + * SEM_VALUE_MAX + * The maximum value a semaphore can have. + * (must be at least 32767) + * + */ +#undef _POSIX_THREAD_DESTRUCTOR_ITERATIONS +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 + +#undef PTHREAD_DESTRUCTOR_ITERATIONS +#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS + +#undef _POSIX_THREAD_KEYS_MAX +#define _POSIX_THREAD_KEYS_MAX 128 + +#undef PTHREAD_KEYS_MAX +#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX + +#undef PTHREAD_STACK_MIN +#define PTHREAD_STACK_MIN 0 + +#undef _POSIX_THREAD_THREADS_MAX +#define _POSIX_THREAD_THREADS_MAX 64 + + /* Arbitrary value */ +#undef PTHREAD_THREADS_MAX +#define PTHREAD_THREADS_MAX 2019 + +#undef _POSIX_SEM_NSEMS_MAX +#define _POSIX_SEM_NSEMS_MAX 256 + + /* Arbitrary value */ +#undef SEM_NSEMS_MAX +#define SEM_NSEMS_MAX 1024 + +#undef _POSIX_SEM_VALUE_MAX +#define _POSIX_SEM_VALUE_MAX 32767 + +#undef SEM_VALUE_MAX +#define SEM_VALUE_MAX INT_MAX + + +#if defined(__GNUC__) && !defined(__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the library, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the library, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#if !defined(PTW32_STATIC_LIB) +# if defined(PTW32_BUILD) +# define PTW32_DLLPORT __declspec (dllexport) +# else +# define PTW32_DLLPORT __declspec (dllimport) +# endif +#else +# define PTW32_DLLPORT +#endif + +/* + * The Open Watcom C/C++ compiler uses a non-standard calling convention + * that passes function args in registers unless __cdecl is explicitly specified + * in exposed function prototypes. + * + * We force all calls to cdecl even though this could slow Watcom code down + * slightly. If you know that the Watcom compiler will be used to build both + * the DLL and application, then you can probably define this as a null string. + * Remember that pthread.h (this file) is used for both the DLL and application builds. + */ +#define PTW32_CDECL __cdecl + +#if defined(_UWIN) && PTW32_LEVEL >= PTW32_LEVEL_MAX +# include +#else +/* + * Generic handle type - intended to extend uniqueness beyond + * that available with a simple pointer. It should scale for either + * IA-32 or IA-64. + */ +typedef struct { + void * p; /* Pointer to actual object */ + unsigned int x; /* Extra information - reuse count etc */ +} ptw32_handle_t; + +typedef ptw32_handle_t pthread_t; +typedef struct pthread_attr_t_ * pthread_attr_t; +typedef struct pthread_once_t_ pthread_once_t; +typedef struct pthread_key_t_ * pthread_key_t; +typedef struct pthread_mutex_t_ * pthread_mutex_t; +typedef struct pthread_mutexattr_t_ * pthread_mutexattr_t; +typedef struct pthread_cond_t_ * pthread_cond_t; +typedef struct pthread_condattr_t_ * pthread_condattr_t; +#endif +typedef struct pthread_rwlock_t_ * pthread_rwlock_t; +typedef struct pthread_rwlockattr_t_ * pthread_rwlockattr_t; +typedef struct pthread_spinlock_t_ * pthread_spinlock_t; +typedef struct pthread_barrier_t_ * pthread_barrier_t; +typedef struct pthread_barrierattr_t_ * pthread_barrierattr_t; + +/* + * ==================== + * ==================== + * POSIX Threads + * ==================== + * ==================== + */ + +enum { +/* + * pthread_attr_{get,set}detachstate + */ + PTHREAD_CREATE_JOINABLE = 0, /* Default */ + PTHREAD_CREATE_DETACHED = 1, + +/* + * pthread_attr_{get,set}inheritsched + */ + PTHREAD_INHERIT_SCHED = 0, + PTHREAD_EXPLICIT_SCHED = 1, /* Default */ + +/* + * pthread_{get,set}scope + */ + PTHREAD_SCOPE_PROCESS = 0, + PTHREAD_SCOPE_SYSTEM = 1, /* Default */ + +/* + * pthread_setcancelstate paramters + */ + PTHREAD_CANCEL_ENABLE = 0, /* Default */ + PTHREAD_CANCEL_DISABLE = 1, + +/* + * pthread_setcanceltype parameters + */ + PTHREAD_CANCEL_ASYNCHRONOUS = 0, + PTHREAD_CANCEL_DEFERRED = 1, /* Default */ + +/* + * pthread_mutexattr_{get,set}pshared + * pthread_condattr_{get,set}pshared + */ + PTHREAD_PROCESS_PRIVATE = 0, + PTHREAD_PROCESS_SHARED = 1, + +/* + * pthread_mutexattr_{get,set}robust + */ + PTHREAD_MUTEX_STALLED = 0, /* Default */ + PTHREAD_MUTEX_ROBUST = 1, + +/* + * pthread_barrier_wait + */ + PTHREAD_BARRIER_SERIAL_THREAD = -1 +}; + +/* + * ==================== + * ==================== + * Cancelation + * ==================== + * ==================== + */ +#define PTHREAD_CANCELED ((void *)(size_t) -1) + + +/* + * ==================== + * ==================== + * Once Key + * ==================== + * ==================== + */ +#define PTHREAD_ONCE_INIT { PTW32_FALSE, 0, 0, 0} + +struct pthread_once_t_ +{ + int done; /* indicates if user function has been executed */ + void * lock; + int reserved1; + int reserved2; +}; + + +/* + * ==================== + * ==================== + * Object initialisers + * ==================== + * ==================== + */ +#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -1) +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -2) +#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t)(size_t) -3) + +/* + * Compatibility with LinuxThreads + */ +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER +#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER + +#define PTHREAD_COND_INITIALIZER ((pthread_cond_t)(size_t) -1) + +#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t)(size_t) -1) + +#define PTHREAD_SPINLOCK_INITIALIZER ((pthread_spinlock_t)(size_t) -1) + + +/* + * Mutex types. + */ +enum +{ + /* Compatibility with LinuxThreads */ + PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_TIMED_NP = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_ADAPTIVE_NP = PTHREAD_MUTEX_FAST_NP, + /* For compatibility with POSIX */ + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_FAST_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL +}; + + +typedef struct ptw32_cleanup_t ptw32_cleanup_t; + +#if defined(_MSC_VER) +/* Disable MSVC 'anachronism used' warning */ +#pragma warning( disable : 4229 ) +#endif + +typedef void (* PTW32_CDECL ptw32_cleanup_callback_t)(void *); + +#if defined(_MSC_VER) +#pragma warning( default : 4229 ) +#endif + +struct ptw32_cleanup_t +{ + ptw32_cleanup_callback_t routine; + void *arg; + struct ptw32_cleanup_t *prev; +}; + +#if defined(__CLEANUP_SEH) + /* + * WIN32 SEH version of cancel cleanup. + */ + +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + ptw32_cleanup_t _cleanup; \ + \ + _cleanup.routine = (ptw32_cleanup_callback_t)(_rout); \ + _cleanup.arg = (_arg); \ + __try \ + { \ + +#define pthread_cleanup_pop( _execute ) \ + } \ + __finally \ + { \ + if( _execute || AbnormalTermination()) \ + { \ + (*(_cleanup.routine))( _cleanup.arg ); \ + } \ + } \ + } + +#else /* __CLEANUP_SEH */ + +#if defined(__CLEANUP_C) + + /* + * C implementation of PThreads cancel cleanup + */ + +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + ptw32_cleanup_t _cleanup; \ + \ + ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \ + +#define pthread_cleanup_pop( _execute ) \ + (void) ptw32_pop_cleanup( _execute ); \ + } + +#else /* __CLEANUP_C */ + +#if defined(__CLEANUP_CXX) + + /* + * C++ version of cancel cleanup. + * - John E. Bossom. + */ + + class PThreadCleanup { + /* + * PThreadCleanup + * + * Purpose + * This class is a C++ helper class that is + * used to implement pthread_cleanup_push/ + * pthread_cleanup_pop. + * The destructor of this class automatically + * pops the pushed cleanup routine regardless + * of how the code exits the scope + * (i.e. such as by an exception) + */ + ptw32_cleanup_callback_t cleanUpRout; + void * obj; + int executeIt; + + public: + PThreadCleanup() : + cleanUpRout( 0 ), + obj( 0 ), + executeIt( 0 ) + /* + * No cleanup performed + */ + { + } + + PThreadCleanup( + ptw32_cleanup_callback_t routine, + void * arg ) : + cleanUpRout( routine ), + obj( arg ), + executeIt( 1 ) + /* + * Registers a cleanup routine for 'arg' + */ + { + } + + ~PThreadCleanup() + { + if ( executeIt && ((void *) cleanUpRout != (void *) 0) ) + { + (void) (*cleanUpRout)( obj ); + } + } + + void execute( int exec ) + { + executeIt = exec; + } + }; + + /* + * C++ implementation of PThreads cancel cleanup; + * This implementation takes advantage of a helper + * class who's destructor automatically calls the + * cleanup routine if we exit our scope weirdly + */ +#define pthread_cleanup_push( _rout, _arg ) \ + { \ + PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \ + (void *) (_arg) ); + +#define pthread_cleanup_pop( _execute ) \ + cleanup.execute( _execute ); \ + } + +#else + +#error ERROR [__FILE__, line __LINE__]: Cleanup type undefined. + +#endif /* __CLEANUP_CXX */ + +#endif /* __CLEANUP_C */ + +#endif /* __CLEANUP_SEH */ + +/* + * =============== + * =============== + * Methods + * =============== + * =============== + */ + +/* + * PThread Attribute Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_attr_init (pthread_attr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_destroy (pthread_attr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getdetachstate (const pthread_attr_t * attr, + int *detachstate); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstackaddr (const pthread_attr_t * attr, + void **stackaddr); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getstacksize (const pthread_attr_t * attr, + size_t * stacksize); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setdetachstate (pthread_attr_t * attr, + int detachstate); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstackaddr (pthread_attr_t * attr, + void *stackaddr); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setstacksize (pthread_attr_t * attr, + size_t stacksize); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedparam (const pthread_attr_t *attr, + struct sched_param *param); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedparam (pthread_attr_t *attr, + const struct sched_param *param); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setschedpolicy (pthread_attr_t *, + int); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getschedpolicy (const pthread_attr_t *, + int *); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setinheritsched(pthread_attr_t * attr, + int inheritsched); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getinheritsched(const pthread_attr_t * attr, + int * inheritsched); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_setscope (pthread_attr_t *, + int); + +PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *, + int *); + +/* + * PThread Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid, + const pthread_attr_t * attr, + void *(PTW32_CDECL *start) (void *), + void *arg); + +PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid); + +PTW32_DLLPORT int PTW32_CDECL pthread_equal (pthread_t t1, + pthread_t t2); + +PTW32_DLLPORT void PTW32_CDECL pthread_exit (void *value_ptr); + +PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread, + void **value_ptr); + +PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void); + +PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread); + +PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state, + int *oldstate); + +PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type, + int *oldtype); + +PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void); + +PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control, + void (PTW32_CDECL *init_routine) (void)); + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX +PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute); + +PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup, + ptw32_cleanup_callback_t routine, + void *arg); +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Thread Specific Data Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key, + void (PTW32_CDECL *destructor) (void *)); + +PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key); + +PTW32_DLLPORT int PTW32_CDECL pthread_setspecific (pthread_key_t key, + const void *value); + +PTW32_DLLPORT void * PTW32_CDECL pthread_getspecific (pthread_key_t key); + + +/* + * Mutex Attribute Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_init (pthread_mutexattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_destroy (pthread_mutexattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getpshared (const pthread_mutexattr_t + * attr, + int *pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, + int pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind); +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_gettype (const pthread_mutexattr_t * attr, int *kind); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setrobust( + pthread_mutexattr_t *attr, + int robust); +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getrobust( + const pthread_mutexattr_t * attr, + int * robust); + +/* + * Barrier Attribute Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_init (pthread_barrierattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_destroy (pthread_barrierattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_getpshared (const pthread_barrierattr_t + * attr, + int *pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_barrierattr_setpshared (pthread_barrierattr_t * attr, + int pshared); + +/* + * Mutex Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex, + const pthread_mutexattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t * mutex, + const struct timespec *abstime); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_unlock (pthread_mutex_t * mutex); + +PTW32_DLLPORT int PTW32_CDECL pthread_mutex_consistent (pthread_mutex_t * mutex); + +/* + * Spinlock Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_spin_init (pthread_spinlock_t * lock, int pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_spin_destroy (pthread_spinlock_t * lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_spin_lock (pthread_spinlock_t * lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_spin_trylock (pthread_spinlock_t * lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock); + +/* + * Barrier Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_barrier_init (pthread_barrier_t * barrier, + const pthread_barrierattr_t * attr, + unsigned int count); + +PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barrier); + +PTW32_DLLPORT int PTW32_CDECL pthread_barrier_wait (pthread_barrier_t * barrier); + +/* + * Condition Variable Attribute Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_condattr_init (pthread_condattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_condattr_destroy (pthread_condattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_condattr_getpshared (const pthread_condattr_t * attr, + int *pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * attr, + int pshared); + +/* + * Condition Variable Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_cond_init (pthread_cond_t * cond, + const pthread_condattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_cond_destroy (pthread_cond_t * cond); + +PTW32_DLLPORT int PTW32_CDECL pthread_cond_wait (pthread_cond_t * cond, + pthread_mutex_t * mutex); + +PTW32_DLLPORT int PTW32_CDECL pthread_cond_timedwait (pthread_cond_t * cond, + pthread_mutex_t * mutex, + const struct timespec *abstime); + +PTW32_DLLPORT int PTW32_CDECL pthread_cond_signal (pthread_cond_t * cond); + +PTW32_DLLPORT int PTW32_CDECL pthread_cond_broadcast (pthread_cond_t * cond); + +/* + * Scheduling + */ +PTW32_DLLPORT int PTW32_CDECL pthread_setschedparam (pthread_t thread, + int policy, + const struct sched_param *param); + +PTW32_DLLPORT int PTW32_CDECL pthread_getschedparam (pthread_t thread, + int *policy, + struct sched_param *param); + +PTW32_DLLPORT int PTW32_CDECL pthread_setconcurrency (int); + +PTW32_DLLPORT int PTW32_CDECL pthread_getconcurrency (void); + +/* + * Read-Write Lock Functions + */ +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_init(pthread_rwlock_t *lock, + const pthread_rwlockattr_t *attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_destroy(pthread_rwlock_t *lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_tryrdlock(pthread_rwlock_t *); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_trywrlock(pthread_rwlock_t *); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_rdlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedrdlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_wrlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_timedwrlock(pthread_rwlock_t *lock, + const struct timespec *abstime); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlock_unlock(pthread_rwlock_t *lock); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_init (pthread_rwlockattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_destroy (pthread_rwlockattr_t * attr); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * attr, + int *pshared); + +PTW32_DLLPORT int PTW32_CDECL pthread_rwlockattr_setpshared (pthread_rwlockattr_t * attr, + int pshared); + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 + +/* + * Signal Functions. Should be defined in but MSVC and MinGW32 + * already have signal.h that don't define these. + */ +PTW32_DLLPORT int PTW32_CDECL pthread_kill(pthread_t thread, int sig); + +/* + * Non-portable functions + */ + +/* + * Compatibility with Linux. + */ +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_setkind_np(pthread_mutexattr_t * attr, + int kind); +PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * attr, + int *kind); + +/* + * Possibly supported by other POSIX threads implementations + */ +PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval); +PTW32_DLLPORT int PTW32_CDECL pthread_num_processors_np(void); +PTW32_DLLPORT unsigned __int64 PTW32_CDECL pthread_getunique_np(pthread_t thread); + +/* + * Useful if an application wants to statically link + * the lib rather than load the DLL at run-time. + */ +PTW32_DLLPORT int PTW32_CDECL pthread_win32_process_attach_np(void); +PTW32_DLLPORT int PTW32_CDECL pthread_win32_process_detach_np(void); +PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_attach_np(void); +PTW32_DLLPORT int PTW32_CDECL pthread_win32_thread_detach_np(void); + +/* + * Features that are auto-detected at load/run time. + */ +PTW32_DLLPORT int PTW32_CDECL pthread_win32_test_features_np(int); +enum ptw32_features { + PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE = 0x0001, /* System provides it. */ + PTW32_ALERTABLE_ASYNC_CANCEL = 0x0002 /* Can cancel blocked threads. */ +}; + +/* + * Register a system time change with the library. + * Causes the library to perform various functions + * in response to the change. Should be called whenever + * the application's top level window receives a + * WM_TIMECHANGE message. It can be passed directly to + * pthread_create() as a new thread if desired. + */ +PTW32_DLLPORT void * PTW32_CDECL pthread_timechange_handler_np(void *); + +#endif /*PTW32_LEVEL >= PTW32_LEVEL_MAX - 1 */ + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX + +/* + * Returns the Win32 HANDLE for the POSIX thread. + */ +PTW32_DLLPORT HANDLE PTW32_CDECL pthread_getw32threadhandle_np(pthread_t thread); +/* + * Returns the win32 thread ID for POSIX thread. + */ +PTW32_DLLPORT DWORD PTW32_CDECL pthread_getw32threadid_np (pthread_t thread); + + +/* + * Protected Methods + * + * This function blocks until the given WIN32 handle + * is signaled or pthread_cancel had been called. + * This function allows the caller to hook into the + * PThreads cancel mechanism. It is implemented using + * + * WaitForMultipleObjects + * + * on 'waitHandle' and a manually reset WIN32 Event + * used to implement pthread_cancel. The 'timeout' + * argument to TimedWait is simply passed to + * WaitForMultipleObjects. + */ +PTW32_DLLPORT int PTW32_CDECL pthreadCancelableWait (HANDLE waitHandle); +PTW32_DLLPORT int PTW32_CDECL pthreadCancelableTimedWait (HANDLE waitHandle, + DWORD timeout); + +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +/* + * Thread-Safe C Runtime Library Mappings. + */ +#if !defined(_UWIN) +# if defined(NEED_ERRNO) + PTW32_DLLPORT int * PTW32_CDECL _errno( void ); +# else +# if !defined(errno) +# if (defined(_MT) || defined(_DLL)) + __declspec(dllimport) extern int * __cdecl _errno(void); +# define errno (*_errno()) +# endif +# endif +# endif +#endif + +/* + * Some compiler environments don't define some things. + */ +#if defined(__BORLANDC__) +# define _ftime ftime +# define _timeb timeb +#endif + +#if defined(__cplusplus) + +/* + * Internal exceptions + */ +class ptw32_exception {}; +class ptw32_exception_cancel : public ptw32_exception {}; +class ptw32_exception_exit : public ptw32_exception {}; + +#endif + +#if PTW32_LEVEL >= PTW32_LEVEL_MAX + +/* FIXME: This is only required if the library was built using SEH */ +/* + * Get internal SEH tag + */ +PTW32_DLLPORT DWORD PTW32_CDECL ptw32_get_exception_services_code(void); + +#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ + +#if !defined(PTW32_BUILD) + +#if defined(__CLEANUP_SEH) + +/* + * Redefine the SEH __except keyword to ensure that applications + * propagate our internal exceptions up to the library's internal handlers. + */ +#define __except( E ) \ + __except( ( GetExceptionCode() == ptw32_get_exception_services_code() ) \ + ? EXCEPTION_CONTINUE_SEARCH : ( E ) ) + +#endif /* __CLEANUP_SEH */ + +#if defined(__CLEANUP_CXX) + +/* + * Redefine the C++ catch keyword to ensure that applications + * propagate our internal exceptions up to the library's internal handlers. + */ +#if defined(_MSC_VER) + /* + * WARNING: Replace any 'catch( ... )' with 'PtW32CatchAll' + * if you want Pthread-Win32 cancelation and pthread_exit to work. + */ + +#if !defined(PtW32NoCatchWarn) + +#pragma message("Specify \"/DPtW32NoCatchWarn\" compiler flag to skip this message.") +#pragma message("------------------------------------------------------------------") +#pragma message("When compiling applications with MSVC++ and C++ exception handling:") +#pragma message(" Replace any 'catch( ... )' in routines called from POSIX threads") +#pragma message(" with 'PtW32CatchAll' or 'CATCHALL' if you want POSIX thread") +#pragma message(" cancelation and pthread_exit to work. For example:") +#pragma message("") +#pragma message(" #if defined(PtW32CatchAll)") +#pragma message(" PtW32CatchAll") +#pragma message(" #else") +#pragma message(" catch(...)") +#pragma message(" #endif") +#pragma message(" {") +#pragma message(" /* Catchall block processing */") +#pragma message(" }") +#pragma message("------------------------------------------------------------------") + +#endif + +#define PtW32CatchAll \ + catch( ptw32_exception & ) { throw; } \ + catch( ... ) + +#else /* _MSC_VER */ + +#define catch( E ) \ + catch( ptw32_exception & ) { throw; } \ + catch( E ) + +#endif /* _MSC_VER */ + +#endif /* __CLEANUP_CXX */ + +#endif /* ! PTW32_BUILD */ + +#if defined(__cplusplus) +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#if defined(PTW32__HANDLE_DEF) +# undef HANDLE +#endif +#if defined(PTW32__DWORD_DEF) +# undef DWORD +#endif + +#undef PTW32_LEVEL +#undef PTW32_LEVEL_MAX + +#endif /* ! RC_INVOKED */ + +#endif /* PTHREAD_H */ diff --git a/src/external/pthread/include/sched.h b/src/external/pthread/include/sched.h new file mode 100644 index 00000000..f36a97a6 --- /dev/null +++ b/src/external/pthread/include/sched.h @@ -0,0 +1,183 @@ +/* + * Module: sched.h + * + * Purpose: + * Provides an implementation of POSIX realtime extensions + * as defined in + * + * POSIX 1003.1b-1993 (POSIX.1b) + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2005 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined(_SCHED_H) +#define _SCHED_H + +#undef PTW32_SCHED_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_SCHED_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_SCHED_LEVEL +#define PTW32_SCHED_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_SCHED_LEVEL +#define PTW32_SCHED_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_SCHED_LEVEL_MAX 3 + +#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_SCHED_LEVEL) +#define PTW32_SCHED_LEVEL PTW32_SCHED_LEVEL_MAX +/* Include everything */ +#endif + + +#if defined(__GNUC__) && !defined(__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the library, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the library, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#if !defined(PTW32_STATIC_LIB) +# if defined(PTW32_BUILD) +# define PTW32_DLLPORT __declspec (dllexport) +# else +# define PTW32_DLLPORT __declspec (dllimport) +# endif +#else +# define PTW32_DLLPORT +#endif + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#if !defined(PTW32_CONFIG_H) +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(__MINGW64__) +# define HAVE_STRUCT_TIMESPEC +# define HAVE_MODE_T +# elif defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX +#if defined(NEED_ERRNO) +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */ + +#if (defined(__MINGW64__) || defined(__MINGW32__)) || defined(_UWIN) +# if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX +/* For pid_t */ +# include +/* Required by Unix 98 */ +# include +# else + typedef int pid_t; +# endif +#else + typedef int pid_t; +#endif + +/* Thread scheduling policies */ + +enum { + SCHED_OTHER = 0, + SCHED_FIFO, + SCHED_RR, + SCHED_MIN = SCHED_OTHER, + SCHED_MAX = SCHED_RR +}; + +struct sched_param { + int sched_priority; +}; + +#if defined(__cplusplus) +extern "C" +{ +#endif /* __cplusplus */ + +PTW32_DLLPORT int __cdecl sched_yield (void); + +PTW32_DLLPORT int __cdecl sched_get_priority_min (int policy); + +PTW32_DLLPORT int __cdecl sched_get_priority_max (int policy); + +PTW32_DLLPORT int __cdecl sched_setscheduler (pid_t pid, int policy); + +PTW32_DLLPORT int __cdecl sched_getscheduler (pid_t pid); + +/* + * Note that this macro returns ENOTSUP rather than + * ENOSYS as might be expected. However, returning ENOSYS + * should mean that sched_get_priority_{min,max} are + * not implemented as well as sched_rr_get_interval. + * This is not the case, since we just don't support + * round-robin scheduling. Therefore I have chosen to + * return the same value as sched_setscheduler when + * SCHED_RR is passed to it. + */ +#define sched_rr_get_interval(_pid, _interval) \ + ( errno = ENOTSUP, (int) -1 ) + + +#if defined(__cplusplus) +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#undef PTW32_SCHED_LEVEL +#undef PTW32_SCHED_LEVEL_MAX + +#endif /* !_SCHED_H */ + diff --git a/src/external/pthread/include/semaphore.h b/src/external/pthread/include/semaphore.h new file mode 100644 index 00000000..c6e9407e --- /dev/null +++ b/src/external/pthread/include/semaphore.h @@ -0,0 +1,169 @@ +/* + * Module: semaphore.h + * + * Purpose: + * Semaphores aren't actually part of the PThreads standard. + * They are defined by the POSIX Standard: + * + * POSIX 1003.1b-1993 (POSIX.1b) + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2005 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ +#if !defined( SEMAPHORE_H ) +#define SEMAPHORE_H + +#undef PTW32_SEMAPHORE_LEVEL + +#if defined(_POSIX_SOURCE) +#define PTW32_SEMAPHORE_LEVEL 0 +/* Early POSIX */ +#endif + +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309 +#undef PTW32_SEMAPHORE_LEVEL +#define PTW32_SEMAPHORE_LEVEL 1 +/* Include 1b, 1c and 1d */ +#endif + +#if defined(INCLUDE_NP) +#undef PTW32_SEMAPHORE_LEVEL +#define PTW32_SEMAPHORE_LEVEL 2 +/* Include Non-Portable extensions */ +#endif + +#define PTW32_SEMAPHORE_LEVEL_MAX 3 + +#if !defined(PTW32_SEMAPHORE_LEVEL) +#define PTW32_SEMAPHORE_LEVEL PTW32_SEMAPHORE_LEVEL_MAX +/* Include everything */ +#endif + +#if defined(__GNUC__) && ! defined (__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the library, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the library, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#if !defined(PTW32_STATIC_LIB) +# if defined(PTW32_BUILD) +# define PTW32_DLLPORT __declspec (dllexport) +# else +# define PTW32_DLLPORT __declspec (dllimport) +# endif +#else +# define PTW32_DLLPORT +#endif + +/* + * This is a duplicate of what is in the autoconf config.h, + * which is only used when building the pthread-win32 libraries. + */ + +#if !defined(PTW32_CONFIG_H) +# if defined(WINCE) +# define NEED_ERRNO +# define NEED_SEM +# endif +# if defined(__MINGW64__) +# define HAVE_STRUCT_TIMESPEC +# define HAVE_MODE_T +# elif defined(_UWIN) || defined(__MINGW32__) +# define HAVE_MODE_T +# endif +#endif + +/* + * + */ + +#if PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX +#if defined(NEED_ERRNO) +#include "need_errno.h" +#else +#include +#endif +#endif /* PTW32_SEMAPHORE_LEVEL >= PTW32_SEMAPHORE_LEVEL_MAX */ + +#define _POSIX_SEMAPHORES + +#if defined(__cplusplus) +extern "C" +{ +#endif /* __cplusplus */ + +#if !defined(HAVE_MODE_T) +typedef unsigned int mode_t; +#endif + + +typedef struct sem_t_ * sem_t; + +PTW32_DLLPORT int __cdecl sem_init (sem_t * sem, + int pshared, + unsigned int value); + +PTW32_DLLPORT int __cdecl sem_destroy (sem_t * sem); + +PTW32_DLLPORT int __cdecl sem_trywait (sem_t * sem); + +PTW32_DLLPORT int __cdecl sem_wait (sem_t * sem); + +PTW32_DLLPORT int __cdecl sem_timedwait (sem_t * sem, + const struct timespec * abstime); + +PTW32_DLLPORT int __cdecl sem_post (sem_t * sem); + +PTW32_DLLPORT int __cdecl sem_post_multiple (sem_t * sem, + int count); + +PTW32_DLLPORT int __cdecl sem_open (const char * name, + int oflag, + mode_t mode, + unsigned int value); + +PTW32_DLLPORT int __cdecl sem_close (sem_t * sem); + +PTW32_DLLPORT int __cdecl sem_unlink (const char * name); + +PTW32_DLLPORT int __cdecl sem_getvalue (sem_t * sem, + int * sval); + +#if defined(__cplusplus) +} /* End of extern "C" */ +#endif /* __cplusplus */ + +#undef PTW32_SEMAPHORE_LEVEL +#undef PTW32_SEMAPHORE_LEVEL_MAX + +#endif /* !SEMAPHORE_H */ diff --git a/src/external/pthread/lib/libpthreadGC2.a b/src/external/pthread/lib/libpthreadGC2.a new file mode 100644 index 00000000..df211759 Binary files /dev/null and b/src/external/pthread/lib/libpthreadGC2.a differ diff --git a/src/external/pthread/pthreadGC2.dll b/src/external/pthread/pthreadGC2.dll deleted file mode 100644 index 67b9289d..00000000 Binary files a/src/external/pthread/pthreadGC2.dll and /dev/null differ -- cgit v1.2.3 From de865a9b55776ba830c7b7f11ded0cf19ceda49c Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Mon, 18 Jul 2016 15:13:43 +0200 Subject: fix small things on 'src/' makefile --- src/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index c5465c68..10f4a2e4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -119,21 +119,27 @@ OBJS += external/stb_vorbis.o # compile raylib static library for desktop platforms. # The automatic variable "$@" is the target name, while "$<" is the first # prerequisite. +# WARNING: you must type "make clean" before doing this target if you have +# done "make libraylib.so". libraylib.a : $(OBJS) ar rcs $@ $(OBJS) @echo "libraylib.a generated (static library)!" -# compile raylib to shared library version. +# compile raylib to shared library version for GNU/Linux. +# WARNING: you must type "make clean" before doing this target if you have +# done "make libraylib.so". libraylib.so : $(OBJS) $(CC) -shared -o $@ $(OBJS) + @echo "libraylib.so generated (shared library)!" # compile raylib for web. +# WARNING: you must type "make clean" before doing this target if you have +# done "make libraylib.a/.bc". libraylib.bc : $(OBJS) emcc -O1 $(OBJS) -o $@ @echo "libraylib.bc generated (web version)!" -# compile all modules with relative prerequisites (header files of the -# project). +# It compile all modules with their prerequisite. camera.o : camera.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDES) @@ -168,8 +174,8 @@ audio.o : audio.c audio.h external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h $(CC) -c -o $@ $< -O1 $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -# It installs (copy) raylib dev files (static library and header) to standard -# directories on GNU/Linux platform. +# It installs generated and needed files to compile projects using raylib. +# The installation works manually. # TODO: add other platforms. install : ifeq ($(ROOT),root) @@ -178,10 +184,10 @@ ifeq ($(ROOT),root) # libraries and header files. These directory (/usr/local/lib and # /usr/local/include/) are for libraries that are installed # manually (without a package manager). - cp --update raylib.h /usr/local/include/raylib.h ifeq ($(SHARED),YES) cp --update libraylib.so /usr/local/lib/libraylib.so else + cp --update raylib.h /usr/local/include/raylib.h cp --update libraylib.a /usr/local/lib/libraylib.a endif @echo "raylib dev files installed/updated!" -- cgit v1.2.3 From 5ff9811ea8ece7adb8e999a0beb063a678b502d0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Jul 2016 17:06:33 +0200 Subject: Some code tweaks --- src/raylib.h | 32 +++++++++++++++++++------------- src/rlgl.c | 11 ++++++----- src/rlgl.h | 9 +++++---- src/utils.c | 7 ++++++- 4 files changed, 36 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index e3a17ebb..19c67712 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -7,14 +7,18 @@ * Features: * Library written in plain C code (C99) * Uses C# PascalCase/camelCase notation -* Hardware accelerated with OpenGL (1.1, 3.3 or ES2) -* Unique OpenGL abstraction layer [rlgl] -* Powerful fonts module with SpriteFonts support (including AngelCode fonts and TTF) +* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) +* Unique OpenGL abstraction layer (usable as standalone module): [rlgl] +* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) * Multiple textures support, including compressed formats and mipmaps generation -* Basic 3d support for Shapes, Models, Heightmaps and Billboards -* Powerful math module for Vector and Matrix operations [raymath] -* Audio loading and playing with streaming support (WAV and OGG) -* Multiplatform support, including Android devices, Raspberry Pi and HTML5 +* Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps +* Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support +* Powerful math module for Vector, Matrix and Quaternion operations [raymath] +* Audio loading and playing with streaming support and mixing channels (WAV, OGG, XM, MOD) +* VR stereo rendering support with configurable HMD device parameters +* Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 +* Custom color palette for fancy visuals on raywhite background +* Minimal external dependencies (GLFW3, OpenGL, OpenAL) * * Used external libs: * GLFW3 (www.glfw.org) for window/context management and input @@ -23,6 +27,8 @@ * stb_image_write (Sean Barret) for image writting (PNG) * stb_vorbis (Sean Barret) for ogg audio loading * stb_truetype (Sean Barret) for ttf fonts loading +* jar_xm (Joshua Reisenauer) for XM audio module loading +* jar_mod (Joshua Reisenauer) for MOD audio module loading * OpenAL Soft for audio device/context management * tinfl for data decompression (DEFLATE algorithm) * @@ -37,7 +43,7 @@ * raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, * BSD-like license that allows static linking with closed source software: * -* Copyright (c) 2013 Ramon Santamaria (@raysan5) +* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -536,7 +542,7 @@ typedef enum { HMD_SONY_PLAYSTATION_VR, HMD_RAZER_OSVR, HMD_FOVE_VR, -} HmdDevice; +} VrDevice; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -778,8 +784,6 @@ const char *SubText(const char *text, int position, int length); //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ -void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires @@ -794,6 +798,8 @@ void DrawRay(Ray ray, Color color); void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) void DrawGizmo(Vector3 position); // Draw simple gizmo void DrawLight(Light light); // Draw light in 3D world +void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space //DrawTorus(), DrawTeapot() are useless... //------------------------------------------------------------------------------------ @@ -837,7 +843,7 @@ Shader LoadShader(char *vsFileName, char *fsFileName); // Load a cu void UnloadShader(Shader shader); // Unload a custom shader from memory Shader GetDefaultShader(void); // Get default shader -Shader GetStandardShader(void); // Get default shader +Shader GetStandardShader(void); // Get standard shader Texture2D GetDefaultTexture(void); // Get default texture int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location @@ -860,7 +866,7 @@ void DestroyLight(Light light); // Destroy a // VR experience Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -void InitVrDevice(int hmdDevice); // Init VR device +void InitVrDevice(int vdDevice); // Init VR device void CloseVrDevice(void); // Close VR device void UpdateVrTracking(void); // Update VR tracking (position and orientation) void BeginVrDrawing(void); // Begin VR drawing configuration diff --git a/src/rlgl.c b/src/rlgl.c index defbe04f..6477efaa 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -4,10 +4,11 @@ * * raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: * OpenGL 1.1 - Direct map rl* -> gl* +* OpenGL 2.1 - Vertex data is stored in VBOs, call rlglDraw() to render * OpenGL 3.3 - Vertex data is stored in VAOs, call rlglDraw() to render * OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -2566,10 +2567,10 @@ void DestroyLight(Light light) // Init VR device (or simulator) // NOTE: If device is not available, it fallbacks to default device (simulator) // NOTE: It modifies the global variable: VrDeviceInfo hmd -void InitVrDevice(int hmdDevice) +void InitVrDevice(int vrDevice) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - switch (hmdDevice) + switch (vrDevice) { case HMD_DEFAULT_DEVICE: TraceLog(INFO, "Initializing default VR Device (Oculus Rift CV1)"); case HMD_OCULUS_RIFT_DK2: @@ -2594,7 +2595,7 @@ void InitVrDevice(int hmdDevice) { TraceLog(WARNING, "VR Device not found: Initializing VR Simulator (Oculus Rift CV1)"); - if (hmdDevice == HMD_OCULUS_RIFT_DK2) + if (vrDevice == HMD_OCULUS_RIFT_DK2) { // Oculus Rift DK2 parameters hmd.hResolution = 1280; // HMD horizontal resolution in pixels @@ -2614,7 +2615,7 @@ void InitVrDevice(int hmdDevice) hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 } - else if ((hmdDevice == HMD_DEFAULT_DEVICE) || (hmdDevice == HMD_OCULUS_RIFT_CV1)) + else if ((vrDevice == HMD_DEFAULT_DEVICE) || (vrDevice == HMD_OCULUS_RIFT_CV1)) { // Oculus Rift CV1 parameters // NOTE: CV1 represents a complete HMD redesign compared to previous versions, diff --git a/src/rlgl.h b/src/rlgl.h index 306e5361..425871a9 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -4,10 +4,11 @@ * * raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: * OpenGL 1.1 - Direct map rl* -> gl* +* OpenGL 2.1 - Vertex data is stored in VBOs, call rlglDraw() to render * OpenGL 3.3 - Vertex data is stored in VAOs, call rlglDraw() to render * OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -240,7 +241,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // TraceLog message types typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; - // Head Mounted Display devices + // VR Head Mounted Display devices typedef enum { HMD_DEFAULT_DEVICE = 0, HMD_OCULUS_RIFT_DK2, @@ -251,7 +252,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; HMD_SONY_PLAYSTATION_VR, HMD_RAZER_OSVR, HMD_FOVE_VR, - } HmdDevice; + } VrDevice; #endif #ifdef __cplusplus @@ -365,7 +366,7 @@ void DestroyLight(Light light); // Destroy a void TraceLog(int msgType, const char *text, ...); float *MatrixToFloat(Matrix mat); -void InitVrDevice(int hmdDevice); // Init VR device +void InitVrDevice(int vrDevice); // Init VR device void CloseVrDevice(void); // Close VR device void UpdateVrTracking(void); // Update VR tracking (position and orientation) void BeginVrDrawing(void); // Begin VR drawing configuration diff --git a/src/utils.c b/src/utils.c index 5340b3e5..36b06f0f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -205,6 +205,11 @@ void TraceLog(int msgType, const char *text, ...) void TraceLog(int msgType, const char *text, ...) { static char buffer[100]; + int traceDebugMsgs = 1; + +#ifdef DO_NOT_TRACE_DEBUG_MSGS + traceDebugMsgs = 0; +#endif switch(msgType) { @@ -226,7 +231,7 @@ void TraceLog(int msgType, const char *text, ...) case INFO: __android_log_vprint(ANDROID_LOG_INFO, "raylib", buffer, args); break; case ERROR: __android_log_vprint(ANDROID_LOG_ERROR, "raylib", buffer, args); break; case WARNING: __android_log_vprint(ANDROID_LOG_WARN, "raylib", buffer, args); break; - case DEBUG: __android_log_vprint(ANDROID_LOG_DEBUG, "raylib", buffer, args); break; + case DEBUG: if (traceDebugMsgs) __android_log_vprint(ANDROID_LOG_DEBUG, "raylib", buffer, args); break; default: break; } -- cgit v1.2.3 From 0e6b249260a25e540aaceff1d3127948066dc401 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Jul 2016 17:07:50 +0200 Subject: Review outputs by platform --- src/Makefile | 127 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 10f4a2e4..3c66e4f4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,10 @@ #****************************************************************************** # # raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten) +# +# Many Thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline. # -# Copyright (c) 2014 Ramon Santamaria (@raysan5) +# Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. # In no event will the authors be held liable for any damages arising from @@ -77,9 +79,11 @@ endif # define compiler: gcc for C program, define as g++ for C++ ifeq ($(PLATFORM),PLATFORM_WEB) - CC = emcc # emscripten compiler + # emscripten compiler + CC = emcc else - CC = gcc # default gcc compiler + # default gcc compiler + CC = gcc endif # define compiler flags: @@ -90,6 +94,7 @@ endif # -fgnu89-inline declaring inline functions support (GCC optimized) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces + ifeq ($(SHARED),YES) CFLAGS += -fPIC endif @@ -110,70 +115,102 @@ else INCLUDES += -Iexternal/openal_soft/include endif +# define output directory for compiled library +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(PLATFORM_OS),WINDOWS) + OUTPUT_PATH = ../release/win32/mingw32 + endif + ifeq ($(PLATFORM_OS),LINUX) + OUTPUT_PATH = ../release/linux + endif + ifeq ($(PLATFORM_OS),OSX) + OUTPUT_PATH = ../release/osx + endif +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + OUTPUT_PATH = ../release/html5 +endif +ifeq ($(PLATFORM),PLATFORM_RPI) + OUTPUT_PATH = ../release/rpi +endif + # define all object files required with a wildcard # The wildcard takes all files that finish with ".c", then it replaces the # extentions with ".o", that are the object files. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) OBJS += external/stb_vorbis.o -# compile raylib static library for desktop platforms. -# The automatic variable "$@" is the target name, while "$<" is the first -# prerequisite. -# WARNING: you must type "make clean" before doing this target if you have -# done "make libraylib.so". -libraylib.a : $(OBJS) - ar rcs $@ $(OBJS) - @echo "libraylib.a generated (static library)!" - -# compile raylib to shared library version for GNU/Linux. -# WARNING: you must type "make clean" before doing this target if you have -# done "make libraylib.so". -libraylib.so : $(OBJS) - $(CC) -shared -o $@ $(OBJS) - @echo "libraylib.so generated (shared library)!" - -# compile raylib for web. -# WARNING: you must type "make clean" before doing this target if you have -# done "make libraylib.a/.bc". -libraylib.bc : $(OBJS) - emcc -O1 $(OBJS) -o $@ +# typing 'make' will invoke the default target entry called 'all', +# in this case, the 'default' target entry is raylib +all: raylib + +# compile raylib library +raylib: $(OBJS) +ifeq ($(PLATFORM),PLATFORM_WEB) + # compile raylib for web. + emcc -O1 $(OBJS) -o $(OUTPUT_PATH)/libraylib.bc @echo "libraylib.bc generated (web version)!" +else + ifeq ($(SHARED),YES) + ifeq ($(PLATFORM_OS),LINUX) + # compile raylib to shared library version for GNU/Linux. + # WARNING: you should type "make clean" before doing this target + $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) + @echo "libraylib.so generated (shared library)!" + endif + else + # compile raylib static library for desktop platforms. + ar rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) + @echo "libraylib.a generated (static library)!" + endif +endif -# It compile all modules with their prerequisite. -camera.o : camera.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) +# compile all modules with their prerequisites +# compile core module core.o : core.c raylib.h rlgl.h utils.h raymath.h $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) -gestures.o : gestures.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) - -models.o : models.c raylib.h rlgl.h raymath.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) - -rlgl.o : rlgl.c rlgl.h +# compile rlgl module +rlgl.o : rlgl.c rlgl.h raymath.h $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(GRAPHICS) - + +# compile shapes module shapes.o : shapes.c raylib.h rlgl.h $(CC) -c $< $(CFLAGS) $(INCLUDE) + +# compile textures module +textures.o : textures.c rlgl.h utils.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) +# compile text module text.o : text.c raylib.h utils.h $(CC) -c $< $(CFLAGS) $(INCLUDE) -textures.o : textures.c rlgl.h utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) - -utils.o : utils.c utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +# compile models module +models.o : models.c raylib.h rlgl.h raymath.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) -audio.o : audio.c audio.h +# compile audio module +audio.o : audio.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) - + # compile stb_vorbis library external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h $(CC) -c -o $@ $< -O1 $(CFLAGS) $(INCLUDES) -D$(PLATFORM) +# compile utils module +utils.o : utils.c utils.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + +# compile camera module +camera.o : camera.c raylib.h + $(CC) -c $< $(CFLAGS) $(INCLUDES) + +#compile gestures module +gestures.o : gestures.c raylib.h + $(CC) -c $< $(CFLAGS) $(INCLUDE) + # It installs generated and needed files to compile projects using raylib. # The installation works manually. # TODO: add other platforms. @@ -211,7 +248,7 @@ ifeq ($(ROOT),root) endif @echo "raylib dev files removed!" else - @echo "This function works only on GNU/Linux systems" + @echo "This function works only on GNU/Linux systems" endif else @echo "Error: no root permissions" @@ -220,8 +257,8 @@ endif # clean everything clean: ifeq ($(PLATFORM_OS),WINDOWS) - del *.o libraylib.a libraylib.bc libraylib.so external/stb_vorbis.o + del *.o $(OUTPUT_PATH)/libraylib.a $(OUTPUT_PATH)/libraylib.bc $(OUTPUT_PATH)/libraylib.so external/stb_vorbis.o else - rm -f *.o libraylib.a libraylib.bc libraylib.so external/stb_vorbis.o + rm -f *.o $(OUTPUT_PATH)/libraylib.a $(OUTPUT_PATH)/libraylib.bc $(OUTPUT_PATH)/libraylib.so external/stb_vorbis.o endif @echo "removed all generated files!" -- cgit v1.2.3 From af46222b1257049abd17df6e9e57a8d041845c5f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 18 Jul 2016 17:23:50 +0200 Subject: Updated --- src/resources | Bin 107204 -> 107204 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/resources b/src/resources index 6fc578e0..e0fe66ba 100644 Binary files a/src/resources and b/src/resources differ -- cgit v1.2.3 From 5139948ef935dae9999ae668d093a7614b1428eb Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 19 Jul 2016 09:42:48 +0200 Subject: Updated to Oculus PC SDK 1.6 --- .../OculusSDK/LibOVR/Include/Extras/OVR_Math.h | 4 +- src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h | 103 +++++++++++++++++---- .../OculusSDK/LibOVR/Include/OVR_Version.h | 2 +- 3 files changed, 89 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h index 718c21cb..89293ff8 100644 --- a/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h +++ b/src/external/OculusSDK/LibOVR/Include/Extras/OVR_Math.h @@ -1501,9 +1501,9 @@ public: if (len == 0) twist->w = T(1); // identity else - twist /= len; // normalize + *twist /= len; // normalize - return *this * twist.Inverted(); + return *this * twist->Inverted(); } // Normalized linear interpolation of quaternions diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h index cf7aab62..53340478 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h @@ -756,17 +756,11 @@ typedef enum ovrButton_ ovrButton_RThumb = 0x00000004, ovrButton_RShoulder = 0x00000008, - // Bit mask of all buttons on the right Touch controller - ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, - ovrButton_X = 0x00000100, ovrButton_Y = 0x00000200, ovrButton_LThumb = 0x00000400, ovrButton_LShoulder = 0x00000800, - // Bit mask of all buttons on the left Touch controller - ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder, - // Navigation through DPad. ovrButton_Up = 0x00010000, ovrButton_Down = 0x00020000, @@ -779,6 +773,13 @@ typedef enum ovrButton_ ovrButton_Home = 0x01000000, ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, + // Bit mask of all buttons on the right Touch controller + ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder, + + // Bit mask of all buttons on the left Touch controller + ovrButton_LMask = ovrButton_X | ovrButton_Y | ovrButton_LThumb | ovrButton_LShoulder | + ovrButton_Enter, + ovrButton_EnumSize = 0x7fffffff ///< \internal Force type int32_t. } ovrButton; @@ -823,6 +824,25 @@ typedef enum ovrTouch_ ovrTouch_EnumSize = 0x7fffffff ///< \internal Force type int32_t. } ovrTouch; +/// Describes the Touch Haptics engine. +/// Currently, those values will NOT change during a session. +typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) ovrTouchHapticsDesc_ +{ + // Haptics engine frequency/sample-rate, sample time in seconds equals 1.0/sampleRateHz + int SampleRateHz; + // Size of each Haptics sample, sample value range is [0, 2^(Bytes*8)-1] + int SampleSizeInBytes; + + // Queue size that would guarantee Haptics engine would not starve for data + // Make sure size doesn't drop below it for best results + int QueueMinSizeToAvoidStarvation; + + // Minimum, Maximum and Optimal number of samples that can be sent to Haptics through ovr_SubmitControllerVibration + int SubmitMinSamples; + int SubmitMaxSamples; + int SubmitOptimalSamples; +} ovrTouchHapticsDesc; + /// Specifies which controller is connected; multiple can be connected at once. typedef enum ovrControllerType_ { @@ -838,6 +858,31 @@ typedef enum ovrControllerType_ ovrControllerType_EnumSize = 0x7fffffff ///< \internal Force type int32_t. } ovrControllerType; +/// Haptics buffer submit mode +typedef enum ovrHapticsBufferSubmitMode_ +{ + // Enqueue buffer for later playback + ovrHapticsBufferSubmit_Enqueue +} ovrHapticsBufferSubmitMode; + +/// Haptics buffer descriptor, contains amplitude samples used for Touch vibration +typedef struct ovrHapticsBuffer_ +{ + const void* Samples; + int SamplesCount; + ovrHapticsBufferSubmitMode SubmitMode; +} ovrHapticsBuffer; + +/// State of the Haptics playback for Touch vibration +typedef struct ovrHapticsPlaybackState_ +{ + // Remaining space available to queue more samples + int RemainingQueueSpace; + + // Number of samples currently queued + int SamplesQueued; +} ovrHapticsPlaybackState; + /// Provides names for the left and right hand array indexes. /// @@ -1358,25 +1403,49 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetInputState(ovrSession session, ovrControll /// OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetConnectedControllerTypes(ovrSession session); +/// Gets information about Haptics engine for the specified Touch controller. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] controllerType The controller to retrieve the information from. +/// +/// \return Returns an ovrTouchHapticsDesc. +/// +OVR_PUBLIC_FUNCTION(ovrTouchHapticsDesc) ovr_GetTouchHapticsDesc(ovrSession session, ovrControllerType controllerType); -/// Turns on vibration of the given controller. +/// Sets constant vibration (with specified frequency and amplitude) to a controller. +/// Note: ovr_SetControllerVibration cannot be used interchangeably with ovr_SubmitControllerVibration. /// -/// To disable vibration, call ovr_SetControllerVibration with an amplitude of 0. -/// Vibration automatically stops after a nominal amount of time, so if you want vibration -/// to be continuous over multiple seconds then you need to call this function periodically. +/// This method should be called periodically, vibration lasts for a maximum of 2.5 seconds. +/// It's recommended to call this method once a second, calls will be rejected if called too frequently (over 30hz). /// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. -/// \param[in] controllerType Specifies the controller to apply the vibration to. -/// \param[in] frequency Specifies a vibration frequency in the range of 0.0 to 1.0. -/// Currently the only valid values are 0.0, 0.5, and 1.0 and other values will -/// be clamped to one of these. -/// \param[in] amplitude Specifies a vibration amplitude in the range of 0.0 to 1.0. +/// \param[in] controllerType The controller to set the vibration to. +/// \param[in] frequency Vibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non valid values will be clamped. +/// \param[in] amplitude Vibration amplitude in the [0.0, 1.0] range. +/// \return Returns ovrSuccess upon success. /// +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, float frequency, float amplitude); + +/// Submits a Haptics buffer (used for vibration) to Touch (only) controllers. +/// Note: ovr_SubmitControllerVibration cannot be used interchangeably with ovr_SetControllerVibration. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] controllerType Controller where the Haptics buffer will be played. +/// \param[in] buffer Haptics buffer containing amplitude samples to be played. /// \return Returns ovrSuccess upon success. +/// \see ovrHapticsBuffer /// -/// \see ovrControllerType +OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitControllerVibration(ovrSession session, ovrControllerType controllerType, const ovrHapticsBuffer* buffer); + +/// Gets the Haptics engine playback state of a specific Touch controller. +/// +/// \param[in] session Specifies an ovrSession previously returned by ovr_Create. +/// \param[in] controllerType Controller where the Haptics buffer wil be played. +/// \param[in] outState State of the haptics engine. +/// \return Returns ovrSuccess upon success. +/// \see ovrHapticsPlaybackState /// -OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetControllerVibration(ovrSession session, ovrControllerType controllerType, float frequency, float amplitude); +OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetControllerVibrationState(ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState* outState); ///@} diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h index 376fa7d5..d8378304 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h @@ -19,7 +19,7 @@ // Master version numbers #define OVR_PRODUCT_VERSION 1 // Product version doesn't participate in semantic versioning. #define OVR_MAJOR_VERSION 1 // If you change these values then you need to also make sure to change LibOVR/Projects/Windows/LibOVR.props in parallel. -#define OVR_MINOR_VERSION 5 // +#define OVR_MINOR_VERSION 6 // #define OVR_PATCH_VERSION 0 #define OVR_BUILD_NUMBER 0 -- cgit v1.2.3 From 76c9e9883d8b66d2f48e5416102c818e90481a8f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 19 Jul 2016 10:02:44 +0200 Subject: Update runtime DLL to version 1.6 --- src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll | Bin 1018320 -> 1023952 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll index 8553ce11..843c0e44 100644 Binary files a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll and b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll differ -- cgit v1.2.3 From 32a671b9da172a5e8405bf6da916c53fc748c126 Mon Sep 17 00:00:00 2001 From: sol-prog Date: Fri, 22 Jul 2016 11:55:04 -0400 Subject: OS X comaptiblity changes and compiled library --- src/Makefile | 12 ++++++------ src/raylib.h | 10 +++++++--- src/rlgl.c | 16 +++++++++++----- 3 files changed, 24 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 3c66e4f4..c41fe2f5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -169,15 +169,15 @@ endif # compile core module core.o : core.c raylib.h rlgl.h utils.h raymath.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile rlgl module rlgl.o : rlgl.c rlgl.h raymath.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(GRAPHICS) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(GRAPHICS) # compile shapes module shapes.o : shapes.c raylib.h rlgl.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) + $(CC) -c $< $(CFLAGS) $(INCLUDES) # compile textures module textures.o : textures.c rlgl.h utils.h @@ -185,11 +185,11 @@ textures.o : textures.c rlgl.h utils.h # compile text module text.o : text.c raylib.h utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) + $(CC) -c $< $(CFLAGS) $(INCLUDES) # compile models module models.o : models.c raylib.h rlgl.h raymath.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile audio module audio.o : audio.c raylib.h @@ -209,7 +209,7 @@ camera.o : camera.c raylib.h #compile gestures module gestures.o : gestures.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDE) + $(CC) -c $< $(CFLAGS) $(INCLUDES) # It installs generated and needed files to compile projects using raylib. # The installation works manually. diff --git a/src/raylib.h b/src/raylib.h index 19c67712..fee6aa91 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -268,9 +268,13 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type - #if !defined(_STDBOOL_H) - typedef enum { false, true } bool; - #define _STDBOOL_H + #ifndef __APPLE__ + #if !defined(_STDBOOL_H) + typedef enum { false, true } bool; + #define _STDBOOL_H + #endif + #else + #include #endif #endif diff --git a/src/rlgl.c b/src/rlgl.c index 6477efaa..2b551469 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1275,14 +1275,20 @@ void rlglLoadExtensions(void *loader) { #if defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_33) // NOTE: glad is generated and contains only required OpenGL 3.3 Core extensions (and lower versions) - if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); - else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); + #ifndef __APPLE__ + if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); + else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); + #endif #if defined(GRAPHICS_API_OPENGL_21) - if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); + #ifndef __APPLE__ + if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); + #endif #elif defined(GRAPHICS_API_OPENGL_33) - if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); - else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); + #ifndef __APPLE__ + if(GLAD_GL_VERSION_3_3) TraceLog(INFO, "OpenGL 3.3 Core profile supported"); + else TraceLog(ERROR, "OpenGL 3.3 Core profile not supported"); + #endif #endif // With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans -- cgit v1.2.3 From 4facc03a64bece341c553a53c92c19a27137c1ab Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 25 Jul 2016 08:50:40 +0200 Subject: Upload ptheads Win32 DLL --- src/external/pthread/lib/pthreadGC2.dll | Bin 0 -> 119888 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/external/pthread/lib/pthreadGC2.dll (limited to 'src') diff --git a/src/external/pthread/lib/pthreadGC2.dll b/src/external/pthread/lib/pthreadGC2.dll new file mode 100644 index 00000000..67b9289d Binary files /dev/null and b/src/external/pthread/lib/pthreadGC2.dll differ -- cgit v1.2.3 From 6d68c789891b35f06724bea9436db91f3bd17fcf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 26 Jul 2016 12:44:33 +0200 Subject: Updated log output info --- src/audio.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 38fefd12..3c618dd2 100644 --- a/src/audio.c +++ b/src/audio.c @@ -482,8 +482,8 @@ Sound LoadSound(char *fileName) // Audio file loading // NOTE: Buffer space is allocated inside function, Wave must be freed - if (strcmp(GetExtension(fileName),"wav") == 0) wave = LoadWAV(fileName); - else if (strcmp(GetExtension(fileName),"ogg") == 0) wave = LoadOGG(fileName); + if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); + else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); else { TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); @@ -528,7 +528,7 @@ Sound LoadSound(char *fileName) // Attach sound buffer to source alSourcei(source, AL_BUFFER, buffer); - TraceLog(INFO, "[%s] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", fileName, wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.bitsPerSample, wave.channels); // Unallocate WAV data UnloadWave(wave); @@ -759,7 +759,7 @@ void UnloadSound(Sound sound) alDeleteSources(1, &sound.source); alDeleteBuffers(1, &sound.buffer); - TraceLog(INFO, "Unloaded sound data"); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Unloaded sound data from RAM", sound.source, sound.buffer); } // Play a sound @@ -837,7 +837,7 @@ int PlayMusicStream(int index, char *fileName) else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error } - if (strcmp(GetExtension(fileName),"ogg") == 0) + if (strcmp(GetExtension(fileName), "ogg") == 0) { // Open audio stream musicStreams[index].stream = stb_vorbis_open_filename(fileName, NULL, NULL); @@ -852,14 +852,13 @@ int PlayMusicStream(int index, char *fileName) // Get file info stb_vorbis_info info = stb_vorbis_get_info(musicStreams[index].stream); - TraceLog(INFO, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); - TraceLog(INFO, "[%s] Ogg channels: %i", fileName, info.channels); + TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); + TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); musicStreams[index].loop = true; // We loop by default musicStreams[index].enabled = true; - musicStreams[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * info.channels; musicStreams[index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[index].stream); @@ -877,7 +876,7 @@ int PlayMusicStream(int index, char *fileName) if (!musicStreams[index].mixc) return ERROR_LOADING_OGG; // error } } - else if (strcmp(GetExtension(fileName),"xm") == 0) + else if (strcmp(GetExtension(fileName), "xm") == 0) { // only stereo is supported for xm if (!jar_xm_create_context_from_file(&musicStreams[index].xmctx, 48000, fileName)) @@ -904,7 +903,7 @@ int PlayMusicStream(int index, char *fileName) return ERROR_LOADING_XM; // error } } - else if (strcmp(GetExtension(fileName),"mod") == 0) + else if (strcmp(GetExtension(fileName), "mod") == 0) { jar_mod_init(&musicStreams[index].modctx); @@ -1369,7 +1368,7 @@ static void UnloadWave(Wave wave) { free(wave.data); - TraceLog(INFO, "Unloaded wave data"); + TraceLog(INFO, "Unloaded wave data from RAM"); } // Some required functions for audio standalone module version -- cgit v1.2.3 From 07a375e2d626428f5a1b9f02907120a4b3b3a08a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 26 Jul 2016 13:02:25 +0200 Subject: Corrected issue with HIghDPI display on OSX Well, not tested yet but it should work... --- src/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index a3253d79..022fbfe9 100644 --- a/src/core.c +++ b/src/core.c @@ -1614,7 +1614,14 @@ static void InitGraphicsDevice(int width, int height) TraceLog(INFO, "Trying to enable VSYNC"); } - //glfwGetFramebufferSize(window, &renderWidth, &renderHeight); // Get framebuffer size of current window +#ifdef __APPLE__ + // Get framebuffer size of current window + // NOTE: Required to handle HighDPI display correctly + // TODO: Probably should be added for other systems too or managed + // internally by GLFW3 callback: glfwSetFramebufferSizeCallback() + glfwGetFramebufferSize(window, &renderWidth, &renderHeight); +#endif + #endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1765,6 +1772,7 @@ static void InitGraphicsDevice(int width, int height) #endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) // Initialize OpenGL context (states and resources) + // NOTE: screenWidth and screenHeight not used, just stored as globals rlglInit(screenWidth, screenHeight); // Initialize screen viewport (area of the screen that you will actually draw to) -- cgit v1.2.3 From a422e394925e68ab687ef70527c3e207234d8bd7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 26 Jul 2016 16:55:46 +0200 Subject: Corrected issue on OSX with High DPI display Many thanks to Marcelo Paez (paezao) --- src/core.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 022fbfe9..0008ef2f 100644 --- a/src/core.c +++ b/src/core.c @@ -1612,16 +1612,7 @@ static void InitGraphicsDevice(int width, int height) { glfwSwapInterval(1); TraceLog(INFO, "Trying to enable VSYNC"); - } - -#ifdef __APPLE__ - // Get framebuffer size of current window - // NOTE: Required to handle HighDPI display correctly - // TODO: Probably should be added for other systems too or managed - // internally by GLFW3 callback: glfwSetFramebufferSizeCallback() - glfwGetFramebufferSize(window, &renderWidth, &renderHeight); -#endif - + } #endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1775,9 +1766,19 @@ static void InitGraphicsDevice(int width, int height) // NOTE: screenWidth and screenHeight not used, just stored as globals rlglInit(screenWidth, screenHeight); +#ifdef __APPLE__ + // Get framebuffer size of current window + // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer + // is automatically reasized to adapt to new DPI. + // When OS does that, it can be detected using GLFW3 callback: glfwSetFramebufferSizeCallback() + int fbWidth, fbHeight; + glfwGetFramebufferSize(window, &fbWidth, &fbHeight); + rlViewport(renderOffsetX/2, renderOffsetY/2, fbWidth - renderOffsetX, fbHeight - renderOffsetY); +#else // Initialize screen viewport (area of the screen that you will actually draw to) // NOTE: Viewport must be recalculated if screen is resized rlViewport(renderOffsetX/2, renderOffsetY/2, renderWidth - renderOffsetX, renderHeight - renderOffsetY); +#endif // Initialize internal projection and modelview matrices // NOTE: Default to orthographic projection mode with top-left corner at (0,0) -- cgit v1.2.3 From a008d49230c0f7543d8921e68f757dea7934a8c5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 29 Jul 2016 13:17:50 +0200 Subject: Corrected some issues to compile with MSC --- src/audio.c | 4 ++++ src/external/jar_xm.h | 2 +- src/rlgl.c | 47 ++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 43 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3c618dd2..3e2d8347 100644 --- a/src/audio.c +++ b/src/audio.c @@ -78,6 +78,10 @@ #define JAR_MOD_IMPLEMENTATION #include "external/jar_mod.h" // MOD loading functions +#ifdef _MSC_VER + #undef bool +#endif + //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h index f9ddb511..02463e08 100644 --- a/src/external/jar_xm.h +++ b/src/external/jar_xm.h @@ -1435,7 +1435,7 @@ static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) { } } -static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* restrict a, jar_xm_envelope_point_t* restrict b, uint16_t pos) { +static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* a, jar_xm_envelope_point_t* b, uint16_t pos) { /* Linear interpolation between two envelope points */ if(pos <= a->frame) return a->value; else if(pos >= b->frame) return b->value; diff --git a/src/rlgl.c b/src/rlgl.c index 2b551469..d027495f 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -415,14 +415,14 @@ void rlMatrixMode(int mode) } } -void rlFrustum(double left, double right, double bottom, double top, double near, double far) +void rlFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { - glFrustum(left, right, bottom, top, near, far); + glFrustum(left, right, bottom, top, zNear, zFar); } -void rlOrtho(double left, double right, double bottom, double top, double near, double far) +void rlOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { - glOrtho(left, right, bottom, top, near, far); + glOrtho(left, right, bottom, top, zNear, zFar); } void rlPushMatrix(void) { glPushMatrix(); } @@ -1056,8 +1056,13 @@ void rlglInit(int width, int height) // We get a list of available extensions and we check for some of them (compressed textures) // NOTE: We don't need to check again supported extensions but we do (GLAD already dealt with that) glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); - const char *extList[numExt]; +#ifdef _MSC_VER + const char **extList = malloc(sizeof(const char *)*numExt); +#else + const char *extList[numExt]; +#endif + for (int i = 0; i < numExt; i++) extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i); #elif defined(GRAPHICS_API_OPENGL_ES2) @@ -1137,6 +1142,10 @@ void rlglInit(int width, int height) if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) texCompASTCSupported = true; } +#ifdef _MSC_VER + free(extList); +#endif + #if defined(GRAPHICS_API_OPENGL_ES2) if (vaoSupported) TraceLog(INFO, "[EXTENSION] VAO extension detected, VAO functions initialized successfully"); else TraceLog(WARNING, "[EXTENSION] VAO extension not found, VAO usage not supported"); @@ -2891,11 +2900,18 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &maxLength); +#ifdef _MSC_VER + char *log = malloc(maxLength); +#else char log[maxLength]; - +#endif glGetShaderInfoLog(vertexShader, maxLength, &length, log); TraceLog(INFO, "%s", log); + +#ifdef _MSC_VER + free(log); +#endif } else TraceLog(INFO, "[VSHDR ID %i] Vertex shader compiled successfully", vertexShader); @@ -2912,11 +2928,18 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glGetShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &maxLength); +#ifdef _MSC_VER + char *log = malloc(maxLength); +#else char log[maxLength]; - +#endif glGetShaderInfoLog(fragmentShader, maxLength, &length, log); TraceLog(INFO, "%s", log); + +#ifdef _MSC_VER + free(log); +#endif } else TraceLog(INFO, "[FSHDR ID %i] Fragment shader compiled successfully", fragmentShader); @@ -2950,12 +2973,18 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength); +#ifdef _MSC_VER + char *log = malloc(maxLength); +#else char log[maxLength]; - +#endif glGetProgramInfoLog(program, maxLength, &length, log); TraceLog(INFO, "%s", log); - + +#ifdef _MSC_VER + free(log); +#endif glDeleteProgram(program); program = 0; -- cgit v1.2.3 From 8f7cb6fb190834dc07f275e8a4666ec5815c89f6 Mon Sep 17 00:00:00 2001 From: Bil152 Date: Fri, 29 Jul 2016 21:35:57 +0200 Subject: Code refractoring of music model to be more friendly-user (issue #144) --- src/audio.c | 409 +++++++++++++++++++++++++++++++++-------------------------- src/audio.h | 28 ++-- src/raylib.h | 47 ++++--- 3 files changed, 271 insertions(+), 213 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3c618dd2..19a80712 100644 --- a/src/audio.c +++ b/src/audio.c @@ -2,7 +2,7 @@ * * raylib.audio * -* Basic functions to manage Audio: +* Basic functions to manage Audio: * Manage audio device (init/close) * Load and Unload audio files * Play/Stop/Pause/Resume loaded audio @@ -99,8 +99,8 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -// Used to create custom audio streams that are not bound to a specific file. -// There can be no more than 4 concurrent mixchannels in use. +// Used to create custom audio streams that are not bound to a specific file. +// There can be no more than 4 concurrent mixchannels in use. // This is due to each active mixc being tied to a dedicated mix channel. typedef struct MixChannel { unsigned short sampleRate; // default is 48000 @@ -108,7 +108,7 @@ typedef struct MixChannel { unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream bool floatingPoint; // if false then the short datatype is used instead bool playing; // false if paused - + ALenum alFormat; // OpenAL format specifier ALuint alSource; // OpenAL source ALuint alBuffer[MAX_STREAM_BUFFERS]; // OpenAL sample buffer @@ -121,7 +121,7 @@ typedef struct Music { jar_xm_context_t *xmctx; // XM chiptune context jar_mod_context_t modctx; // MOD chiptune context MixChannel *mixc; // Mix channel - + unsigned int totalSamplesLeft; float totalLengthSeconds; bool loop; @@ -145,7 +145,8 @@ typedef enum { ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, ERROR_INVALID_RRES_FILE = 4096, ERROR_INVALID_RRES_RESOURCE = 8192, - ERROR_UNINITIALIZED_CHANNELS = 16384 + ERROR_UNINITIALIZED_CHANNELS = 16384, + ERROR_UNINTIALIZED_MUSIC_BUFFER = 32768 } AudioError; #if defined(AUDIO_STANDALONE) @@ -217,7 +218,7 @@ void CloseAudioDevice(void) { for (int index = 0; index < MAX_MUSIC_STREAMS; index++) { - if (musicStreams[index].mixc) StopMusicStream(index); // Stop music streaming and close current stream + if (musicStreams[index].mixc) StopMusicStreamEx(index); // Stop music streaming and close current stream } ALCdevice *device; @@ -236,12 +237,12 @@ void CloseAudioDevice(void) bool IsAudioDeviceReady(void) { ALCcontext *context = alcGetCurrentContext(); - + if (context == NULL) return false; else { ALCdevice *device = alcGetContextsDevice(context); - + if (device == NULL) return false; else return true; } @@ -252,13 +253,13 @@ bool IsAudioDeviceReady(void) //---------------------------------------------------------------------------------- // Init mix channel for streaming -// The mixChannel is what audio muxing channel you want to operate on, 0-3 are the ones available. +// The mixChannel is what audio muxing channel you want to operate on, 0-3 are the ones available. // Each mix channel can only be used one at a time. static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint) { if (mixChannel >= MAX_MIX_CHANNELS) return NULL; if (!IsAudioDeviceReady()) InitAudioDevice(); - + if (!mixChannels[mixChannel]) { MixChannel *mixc = (MixChannel *)malloc(sizeof(MixChannel)); @@ -267,7 +268,7 @@ static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixCh mixc->mixChannel = mixChannel; mixc->floatingPoint = floatingPoint; mixChannels[mixChannel] = mixc; - + // Setup OpenAL format if (channels == 1) { @@ -279,17 +280,17 @@ static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixCh if (floatingPoint) mixc->alFormat = AL_FORMAT_STEREO_FLOAT32; else mixc->alFormat = AL_FORMAT_STEREO16; } - + // Create an audio source alGenSources(1, &mixc->alSource); alSourcef(mixc->alSource, AL_PITCH, 1); alSourcef(mixc->alSource, AL_GAIN, 1); alSource3f(mixc->alSource, AL_POSITION, 0, 0, 0); alSource3f(mixc->alSource, AL_VELOCITY, 0, 0, 0); - + // Create Buffer alGenBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - + // Fill buffers for (int i = 0; i < MAX_STREAM_BUFFERS; i++) { @@ -305,14 +306,14 @@ static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixCh alBufferData(mixc->alBuffer[i], mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); } } - + alSourceQueueBuffers(mixc->alSource, MAX_STREAM_BUFFERS, mixc->alBuffer); mixc->playing = true; alSourcePlay(mixc->alSource); - + return mixc; } - + return NULL; } @@ -323,18 +324,18 @@ static void CloseMixChannel(MixChannel *mixc) { alSourceStop(mixc->alSource); mixc->playing = false; - + // Flush out all queued buffers ALuint buffer = 0; int queued = 0; alGetSourcei(mixc->alSource, AL_BUFFERS_QUEUED, &queued); - + while (queued > 0) { alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); queued--; } - + // Delete source and buffers alDeleteSources(1, &mixc->alSource); alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); @@ -350,30 +351,30 @@ static void CloseMixChannel(MixChannel *mixc) static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) { if (!mixc || (mixChannels[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples - - if (!data || !numberElements) - { + + if (!data || !numberElements) + { // Pauses audio until data is given if (mixc->playing) { alSourcePause(mixc->alSource); mixc->playing = false; } - + return 0; } else if (!mixc->playing) - { + { // Restart audio otherwise alSourcePlay(mixc->alSource); mixc->playing = true; } ALuint buffer = 0; - + alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); if (!buffer) return 0; - + if (mixc->floatingPoint) { // Process float buffers @@ -386,9 +387,9 @@ static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) short *ptr = (short *)data; alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(short), mixc->sampleRate); } - + alSourceQueueBuffers(mixc->alSource, 1, &buffer); - + return numberElements; } @@ -435,7 +436,7 @@ int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint) return -1; } } - + if (InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) return mixIndex; else { @@ -451,13 +452,13 @@ int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint) int BufferRawAudioContext(int ctx, void *data, unsigned short numberElements) { int numBuffered = 0; - + if (ctx >= 0) { MixChannel *mixc = mixChannels[ctx]; numBuffered = BufferMixChannel(mixc, data, numberElements); } - + return numBuffered; } @@ -482,12 +483,12 @@ Sound LoadSound(char *fileName) // Audio file loading // NOTE: Buffer space is allocated inside function, Wave must be freed - if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); - else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); + if (strcmp(GetExtension(fileName),"wav") == 0) wave = LoadWAV(fileName); + else if (strcmp(GetExtension(fileName),"ogg") == 0) wave = LoadOGG(fileName); else { TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); - + // TODO: Find a better way to register errors (similar to glGetError()) lastAudioError = ERROR_EXTENSION_NOT_RECOGNIZED; } @@ -528,7 +529,7 @@ Sound LoadSound(char *fileName) // Attach sound buffer to source alSourcei(source, AL_BUFFER, buffer); - TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[%s] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", fileName, wave.sampleRate, wave.bitsPerSample, wave.channels); // Unallocate WAV data UnloadWave(wave); @@ -602,9 +603,9 @@ Sound LoadSoundFromRES(const char *rresName, int resId) #if defined(AUDIO_STANDALONE) TraceLog(WARNING, "Sound loading from rRES resource file not supported on standalone mode"); #else - + bool found = false; - + char id[4]; // rRES file identifier unsigned char version; // rRES file version and subversion char useless; // rRES header reserved data @@ -758,8 +759,8 @@ void UnloadSound(Sound sound) { alDeleteSources(1, &sound.source); alDeleteBuffers(1, &sound.buffer); - - TraceLog(INFO, "[SND ID %i][BUFR ID %i] Unloaded sound data from RAM", sound.source, sound.buffer); + + TraceLog(INFO, "Unloaded sound data"); } // Play a sound @@ -823,138 +824,182 @@ void SetSoundPitch(Sound sound, float pitch) // Module Functions Definition - Music loading and stream playing (.OGG) //---------------------------------------------------------------------------------- +MusicBuffer LoadMusicBufferStream(char *fileName, int index) +{ + MusicBuffer buffer = { 0 }; + + if(index > MAX_MUSIC_STREAMS) + { + TraceLog("[%s] index is greater than MAX_MUSIC_STREAMS", ERROR); + return; // error + } + + buffer.fileName = fileName; + buffer.index = index; + + + if (musicStreams[buffer.index].stream || musicStreams[buffer.index].xmctx) return; // error + + return buffer; +} + // Start music playing (open stream) // returns 0 on success or error code -int PlayMusicStream(int index, char *fileName) +int PlayMusicStream(MusicBuffer musicBuffer) { + if(musicBuffer.fileName == 0) + { + return ERROR_UNINTIALIZED_MUSIC_BUFFER; + } int mixIndex; - - if (musicStreams[index].stream || musicStreams[index].xmctx) return ERROR_UNINITIALIZED_CHANNELS; // error - for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot { if (mixChannels[mixIndex] == NULL) break; else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error } - - if (strcmp(GetExtension(fileName), "ogg") == 0) + + if (strcmp(GetExtension(musicBuffer.fileName),"ogg") == 0) { // Open audio stream - musicStreams[index].stream = stb_vorbis_open_filename(fileName, NULL, NULL); + musicStreams[musicBuffer.index].stream = stb_vorbis_open_filename(musicBuffer.fileName, NULL, NULL); - if (musicStreams[index].stream == NULL) + if (musicStreams[musicBuffer.index].stream == NULL) { - TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); + TraceLog(WARNING, "[%s] OGG audio file could not be opened", musicBuffer.fileName); return ERROR_LOADING_OGG; // error } else { // Get file info - stb_vorbis_info info = stb_vorbis_get_info(musicStreams[index].stream); - - TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); - TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); - TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); - - musicStreams[index].loop = true; // We loop by default - musicStreams[index].enabled = true; - - musicStreams[index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicStreams[index].stream) * info.channels; - musicStreams[index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[index].stream); - + stb_vorbis_info info = stb_vorbis_get_info(musicStreams[musicBuffer.index].stream); + + TraceLog(INFO, "[%s] Ogg sample rate: %i", musicBuffer.fileName, info.sample_rate); + TraceLog(INFO, "[%s] Ogg channels: %i", musicBuffer.fileName, info.channels); + TraceLog(DEBUG, "[%s] Temp memory required: %i", musicBuffer.fileName, info.temp_memory_required); + + musicStreams[musicBuffer.index].loop = true; // We loop by default + musicStreams[musicBuffer.index].enabled = true; + + + musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream) * info.channels; + musicStreams[musicBuffer.index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[musicBuffer.index].stream); + if (info.channels == 2) { - musicStreams[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); - musicStreams[index].mixc->playing = true; + musicStreams[musicBuffer.index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); + musicStreams[musicBuffer.index].mixc->playing = true; } else { - musicStreams[index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - musicStreams[index].mixc->playing = true; + musicStreams[musicBuffer.index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); + musicStreams[musicBuffer.index].mixc->playing = true; } - - if (!musicStreams[index].mixc) return ERROR_LOADING_OGG; // error + + if (!musicStreams[musicBuffer.index].mixc) return ERROR_LOADING_OGG; // error } } - else if (strcmp(GetExtension(fileName), "xm") == 0) + else if (strcmp(GetExtension(musicBuffer.fileName),"xm") == 0) { // only stereo is supported for xm - if (!jar_xm_create_context_from_file(&musicStreams[index].xmctx, 48000, fileName)) + if (!jar_xm_create_context_from_file(&musicStreams[musicBuffer.index].xmctx, 48000, musicBuffer.fileName)) { - musicStreams[index].chipTune = true; - musicStreams[index].loop = true; - jar_xm_set_max_loop_count(musicStreams[index].xmctx, 0); // infinite number of loops - musicStreams[index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicStreams[index].xmctx); - musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft)/48000.0f; - musicStreams[index].enabled = true; - - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, musicStreams[index].totalLengthSeconds); - - musicStreams[index].mixc = InitMixChannel(48000, mixIndex, 2, true); - - if (!musicStreams[index].mixc) return ERROR_XM_CONTEXT_CREATION; // error - - musicStreams[index].mixc->playing = true; + musicStreams[musicBuffer.index].chipTune = true; + musicStreams[musicBuffer.index].loop = true; + jar_xm_set_max_loop_count(musicStreams[musicBuffer.index].xmctx, 0); // infinite number of loops + musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicStreams[musicBuffer.index].xmctx); + musicStreams[musicBuffer.index].totalLengthSeconds = ((float)musicStreams[musicBuffer.index].totalSamplesLeft)/48000.0f; + musicStreams[musicBuffer.index].enabled = true; + + TraceLog(INFO, "[%s] XM number of samples: %i", musicBuffer.fileName, musicStreams[musicBuffer.index].totalSamplesLeft); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", musicBuffer.fileName, musicStreams[musicBuffer.index].totalLengthSeconds); + + musicStreams[musicBuffer.index].mixc = InitMixChannel(48000, mixIndex, 2, true); + + if (!musicStreams[musicBuffer.index].mixc) return ERROR_XM_CONTEXT_CREATION; // error + + musicStreams[musicBuffer.index].mixc->playing = true; } else { - TraceLog(WARNING, "[%s] XM file could not be opened", fileName); + TraceLog(WARNING, "[%s] XM file could not be opened", musicBuffer.fileName); return ERROR_LOADING_XM; // error } } - else if (strcmp(GetExtension(fileName), "mod") == 0) + else if (strcmp(GetExtension(musicBuffer.fileName),"mod") == 0) { - jar_mod_init(&musicStreams[index].modctx); - - if (jar_mod_load_file(&musicStreams[index].modctx, fileName)) + jar_mod_init(&musicStreams[musicBuffer.index].modctx); + + if (jar_mod_load_file(&musicStreams[musicBuffer.index].modctx, musicBuffer.fileName)) { - musicStreams[index].chipTune = true; - musicStreams[index].loop = true; - musicStreams[index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicStreams[index].modctx); - musicStreams[index].totalLengthSeconds = ((float)musicStreams[index].totalSamplesLeft)/48000.0f; - musicStreams[index].enabled = true; - - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, musicStreams[index].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, musicStreams[index].totalLengthSeconds); - - musicStreams[index].mixc = InitMixChannel(48000, mixIndex, 2, false); - - if (!musicStreams[index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error - - musicStreams[index].mixc->playing = true; + musicStreams[musicBuffer.index].chipTune = true; + musicStreams[musicBuffer.index].loop = true; + musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicStreams[musicBuffer.index].modctx); + musicStreams[musicBuffer.index].totalLengthSeconds = ((float)musicStreams[musicBuffer.index].totalSamplesLeft)/48000.0f; + musicStreams[musicBuffer.index].enabled = true; + + TraceLog(INFO, "[%s] MOD number of samples: %i", musicBuffer.fileName, musicStreams[musicBuffer.index].totalSamplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", musicBuffer.fileName, musicStreams[musicBuffer.index].totalLengthSeconds); + + musicStreams[musicBuffer.index].mixc = InitMixChannel(48000, mixIndex, 2, false); + + if (!musicStreams[musicBuffer.index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error + + musicStreams[musicBuffer.index].mixc->playing = true; } else { - TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); + TraceLog(WARNING, "[%s] MOD file could not be opened", musicBuffer.fileName); return ERROR_LOADING_MOD; // error } } else { - TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); + TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", musicBuffer.fileName); return ERROR_EXTENSION_NOT_RECOGNIZED; // error } - + return 0; // normal return } // Stop music playing for individual music index of musicStreams array (close stream) -void StopMusicStream(int index) +void StopMusicStream(MusicBuffer musicBuffer) +{ + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) + { + CloseMixChannel(musicStreams[musicBuffer.index].mixc); + + if (musicStreams[musicBuffer.index].xmctx) + jar_xm_free_context(musicStreams[musicBuffer.index].xmctx); + else if (musicStreams[musicBuffer.index].modctx.mod_loaded) + jar_mod_unload(&musicStreams[musicBuffer.index].modctx); + else + stb_vorbis_close(musicStreams[musicBuffer.index].stream); + + musicStreams[musicBuffer.index].enabled = false; + + if (musicStreams[musicBuffer.index].stream || musicStreams[musicBuffer.index].xmctx) + { + musicStreams[musicBuffer.index].stream = NULL; + musicStreams[musicBuffer.index].xmctx = NULL; + } + } +} + +void StopMusicStreamEx(int index) { if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) { CloseMixChannel(musicStreams[index].mixc); - + if (musicStreams[index].xmctx) jar_xm_free_context(musicStreams[index].xmctx); else if (musicStreams[index].modctx.mod_loaded) jar_mod_unload(&musicStreams[index].modctx); else stb_vorbis_close(musicStreams[index].stream); - + musicStreams[index].enabled = false; - + if (musicStreams[index].stream || musicStreams[index].xmctx) { musicStreams[index].stream = NULL; @@ -964,47 +1009,47 @@ void StopMusicStream(int index) } // Update (re-fill) music buffers if data already processed -void UpdateMusicStream(int index) +void UpdateMusicStream(MusicBuffer musicBuffer) { ALenum state; bool active = true; ALint processed = 0; - + // Determine if music stream is ready to be written - alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); - - if (musicStreams[index].mixc->playing && (index < MAX_MUSIC_STREAMS) && musicStreams[index].enabled && musicStreams[index].mixc && (processed > 0)) + alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + + if (musicStreams[musicBuffer.index].mixc->playing && (musicBuffer.index < MAX_MUSIC_STREAMS) && musicStreams[musicBuffer.index].enabled && musicStreams[musicBuffer.index].mixc && (processed > 0)) { - active = BufferMusicStream(index, processed); - - if (!active && musicStreams[index].loop) + active = BufferMusicStream(musicBuffer.index, processed); + + if (!active && musicStreams[musicBuffer.index].loop) { - if (musicStreams[index].chipTune) + if (musicStreams[musicBuffer.index].chipTune) { - if(musicStreams[index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[index].modctx); - - musicStreams[index].totalSamplesLeft = musicStreams[index].totalLengthSeconds*48000.0f; + if(musicStreams[musicBuffer.index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[musicBuffer.index].modctx); + + musicStreams[musicBuffer.index].totalSamplesLeft = musicStreams[musicBuffer.index].totalLengthSeconds*48000.0f; } else { - stb_vorbis_seek_start(musicStreams[index].stream); - musicStreams[index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[index].stream)*musicStreams[index].mixc->channels; + stb_vorbis_seek_start(musicStreams[musicBuffer.index].stream); + musicStreams[musicBuffer.index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream)*musicStreams[musicBuffer.index].mixc->channels; } - + // Determine if music stream is ready to be written - alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); - - active = BufferMusicStream(index, processed); + alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + + active = BufferMusicStream(musicBuffer.index, processed); } if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - - alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); - if (state != AL_PLAYING && active) alSourcePlay(musicStreams[index].mixc->alSource); + alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); + + if (state != AL_PLAYING && active) alSourcePlay(musicStreams[musicBuffer.index].mixc->alSource); + + if (!active) StopMusicStream(musicBuffer); - if (!active) StopMusicStream(index); - } } @@ -1012,57 +1057,57 @@ void UpdateMusicStream(int index) int GetMusicStreamCount(void) { int musicCount = 0; - + // Find empty music slot for (int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) { if(musicStreams[musicIndex].stream != NULL || musicStreams[musicIndex].chipTune) musicCount++; } - + return musicCount; } // Pause music playing -void PauseMusicStream(int index) +void PauseMusicStream(MusicBuffer musicBuffer) { // Pause music stream if music available! - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc && musicStreams[index].enabled) + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc && musicStreams[musicBuffer.index].enabled) { TraceLog(INFO, "Pausing music stream"); - alSourcePause(musicStreams[index].mixc->alSource); - musicStreams[index].mixc->playing = false; + alSourcePause(musicStreams[musicBuffer.index].mixc->alSource); + musicStreams[musicBuffer.index].mixc->playing = false; } } // Resume music playing -void ResumeMusicStream(int index) +void ResumeMusicStream(MusicBuffer musicBuffer) { // Resume music playing... if music available! ALenum state; - - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) + + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) { - alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); - + alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PAUSED) { TraceLog(INFO, "Resuming music stream"); - alSourcePlay(musicStreams[index].mixc->alSource); - musicStreams[index].mixc->playing = true; + alSourcePlay(musicStreams[musicBuffer.index].mixc->alSource); + musicStreams[musicBuffer.index].mixc->playing = true; } } } // Check if any music is playing -bool IsMusicPlaying(int index) +bool IsMusicPlaying(MusicBuffer musicBuffer) { bool playing = false; ALint state; - - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) + + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) { - alGetSourcei(musicStreams[index].mixc->alSource, AL_SOURCE_STATE, &state); - + alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); + if (state == AL_PLAYING) playing = true; } @@ -1070,57 +1115,57 @@ bool IsMusicPlaying(int index) } // Set volume for music -void SetMusicVolume(int index, float volume) +void SetMusicVolume(MusicBuffer musicBuffer, float volume) { - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) { - alSourcef(musicStreams[index].mixc->alSource, AL_GAIN, volume); + alSourcef(musicStreams[musicBuffer.index].mixc->alSource, AL_GAIN, volume); } } // Set pitch for music -void SetMusicPitch(int index, float pitch) +void SetMusicPitch(MusicBuffer musicBuffer, float pitch) { - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) { - alSourcef(musicStreams[index].mixc->alSource, AL_PITCH, pitch); + alSourcef(musicStreams[musicBuffer.index].mixc->alSource, AL_PITCH, pitch); } } // Get music time length (in seconds) -float GetMusicTimeLength(int index) +float GetMusicTimeLength(MusicBuffer musicBuffer) { float totalSeconds; - - if (musicStreams[index].chipTune) totalSeconds = (float)musicStreams[index].totalLengthSeconds; - else totalSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[index].stream); + + if (musicStreams[musicBuffer.index].chipTune) totalSeconds = (float)musicStreams[musicBuffer.index].totalLengthSeconds; + else totalSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[musicBuffer.index].stream); return totalSeconds; } // Get current music time played (in seconds) -float GetMusicTimePlayed(int index) +float GetMusicTimePlayed(MusicBuffer musicBuffer) { float secondsPlayed = 0.0f; - - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) + + if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) { - if (musicStreams[index].chipTune && musicStreams[index].xmctx) + if (musicStreams[musicBuffer.index].chipTune && musicStreams[musicBuffer.index].xmctx) { uint64_t samples; - jar_xm_get_position(musicStreams[index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples/(48000.0f*musicStreams[index].mixc->channels); // Not sure if this is the correct value + jar_xm_get_position(musicStreams[musicBuffer.index].xmctx, NULL, NULL, NULL, &samples); + secondsPlayed = (float)samples/(48000.0f*musicStreams[musicBuffer.index].mixc->channels); // Not sure if this is the correct value } - else if(musicStreams[index].chipTune && musicStreams[index].modctx.mod_loaded) + else if(musicStreams[musicBuffer.index].chipTune && musicStreams[musicBuffer.index].modctx.mod_loaded) { - long numsamp = jar_mod_current_samples(&musicStreams[index].modctx); + long numsamp = jar_mod_current_samples(&musicStreams[musicBuffer.index].modctx); secondsPlayed = (float)numsamp/(48000.0f); } else { - int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[index].stream)*musicStreams[index].mixc->channels; - int samplesPlayed = totalSamples - musicStreams[index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed/(musicStreams[index].mixc->sampleRate*musicStreams[index].mixc->channels); + int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream)*musicStreams[musicBuffer.index].mixc->channels; + int samplesPlayed = totalSamples - musicStreams[musicBuffer.index].totalSamplesLeft; + secondsPlayed = (float)samplesPlayed/(musicStreams[musicBuffer.index].mixc->sampleRate*musicStreams[musicBuffer.index].mixc->channels); } } @@ -1136,10 +1181,10 @@ static bool BufferMusicStream(int index, int numBuffers) { short pcm[MUSIC_BUFFER_SIZE_SHORT]; float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; - + int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - + if (musicStreams[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { for (int i = 0; i < numBuffers; i++) @@ -1148,7 +1193,7 @@ static bool BufferMusicStream(int index, int numBuffers) { if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT/2; else size = musicStreams[index].totalSamplesLeft/2; - + jar_mod_fillbuffer(&musicStreams[index].modctx, pcm, size, 0 ); BufferMixChannel(musicStreams[index].mixc, pcm, size*2); } @@ -1156,13 +1201,13 @@ static bool BufferMusicStream(int index, int numBuffers) { if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT/2; else size = musicStreams[index].totalSamplesLeft/2; - + jar_xm_generate_samples(musicStreams[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location BufferMixChannel(musicStreams[index].mixc, pcmf, size*2); } musicStreams[index].totalSamplesLeft -= size; - + if (musicStreams[index].totalSamplesLeft <= 0) { active = false; @@ -1174,13 +1219,13 @@ static bool BufferMusicStream(int index, int numBuffers) { if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; else size = musicStreams[index].totalSamplesLeft; - + for (int i = 0; i < numBuffers; i++) { int streamedBytes = stb_vorbis_get_samples_short_interleaved(musicStreams[index].stream, musicStreams[index].mixc->channels, pcm, size); BufferMixChannel(musicStreams[index].mixc, pcm, streamedBytes * musicStreams[index].mixc->channels); musicStreams[index].totalSamplesLeft -= streamedBytes * musicStreams[index].mixc->channels; - + if (musicStreams[index].totalSamplesLeft <= 0) { active = false; @@ -1367,8 +1412,8 @@ static Wave LoadOGG(char *fileName) static void UnloadWave(Wave wave) { free(wave.data); - - TraceLog(INFO, "Unloaded wave data from RAM"); + + TraceLog(INFO, "Unloaded wave data"); } // Some required functions for audio standalone module version diff --git a/src/audio.h b/src/audio.h index b6850911..d39162b5 100644 --- a/src/audio.h +++ b/src/audio.h @@ -2,7 +2,7 @@ * * raylib.audio * -* Basic functions to manage Audio: +* Basic functions to manage Audio: * Manage audio device (init/close) * Load and Unload audio files * Play/Stop/Pause/Resume loaded audio @@ -75,6 +75,11 @@ typedef struct Wave { short channels; } Wave; +typedef struct MusicBuffer { + char *fileName; + int index; // index in musicStreams +} MusicBuffer; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -102,16 +107,17 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -int PlayMusicStream(int index, char *fileName); // Start music playing (open stream) -void UpdateMusicStream(int index); // Updates buffers for music streaming -void StopMusicStream(int index); // Stop music playing (close stream) -void PauseMusicStream(int index); // Pause music playing -void ResumeMusicStream(int index); // Resume playing paused music -bool IsMusicPlaying(int index); // Check if music is playing -void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(int index, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(int index); // Get music time length (in seconds) -float GetMusicTimePlayed(int index); // Get current music time played (in seconds) +MusicBuffer LoadMusicBufferStream(char *fileName, int index); +int PlayMusicStream(MusicBuffer buffer); // Start music playing (open stream) +void UpdateMusicStream(MusicBuffer buffer); // Updates buffers for music streaming +void StopMusicStream(MusicBuffer buffer); // Stop music playing (close stream) +void PauseMusicStream(MusicBuffer buffer); // Pause music playing +void ResumeMusicStream(MusicBuffer buffer); // Resume playing paused music +bool IsMusicPlaying(MusicBuffer buffer); // Check if music is playing +void SetMusicVolume(MusicBuffer buffer float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(MusicBuffer buffer, float pitch); // Set pitch for a music (1.0 is base level) +float GetMusicTimeLength(MusicBuffer buffer); // Get music time length (in seconds) +float GetMusicTimePlayed(MusicBuffer buffer); // Get current music time played (in seconds) int GetMusicStreamCount(void); // Get number of streams loaded int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint); // Initialize raw audio mix channel for audio buffering diff --git a/src/raylib.h b/src/raylib.h index fee6aa91..1966f75e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -397,7 +397,7 @@ typedef struct Mesh { // Shader type (generic shader) typedef struct Shader { unsigned int id; // Shader program id - + // Vertex attributes locations (default locations) int vertexLoc; // Vertex attribute location point (default-location = 0) int texcoordLoc; // Texcoord attribute location point (default-location = 1) @@ -409,7 +409,7 @@ typedef struct Shader { // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Diffuse color uniform location point (fragment shader) - + // Texture map locations (generic for any kind of map) int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) @@ -423,11 +423,11 @@ typedef struct Material { Texture2D texDiffuse; // Diffuse texture (binded to shader mapTexture0Loc) Texture2D texNormal; // Normal texture (binded to shader mapTexture1Loc) Texture2D texSpecular; // Specular texture (binded to shader mapTexture2Loc) - + Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color - + float glossiness; // Glossiness level (Ranges from 0 to 1000) } Material; @@ -443,14 +443,14 @@ typedef struct LightData { unsigned int id; // Light unique id bool enabled; // Light enabled int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - + Vector3 position; // Light position Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) float radius; // Light attenuation radius light intensity reduced with distance (world distance) - + Color diffuse; // Light diffuse color float intensity; // Light intensity level - + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; @@ -478,6 +478,11 @@ typedef struct Wave { short channels; } Wave; +typedef struct MusicBuffer { + char *fileName; + int index; // index in musicStreams +} MusicBuffer; + // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { @@ -647,7 +652,7 @@ void SetMousePosition(Vector2 position); // Set mouse position XY int GetMouseWheelMove(void); // Returns mouse wheel movement Y int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) -int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) +int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) #if defined(PLATFORM_ANDROID) @@ -687,8 +692,8 @@ void SetCameraPanControl(int panKey); // Set camera pan ke void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraMoveControls(int frontKey, int backKey, - int leftKey, int rightKey, +void SetCameraMoveControls(int frontKey, int backKey, + int leftKey, int rightKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) @@ -815,6 +820,7 @@ Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d mod Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) void UnloadModel(Model model); // Unload 3d model from memory +Mesh GenMeshCube(float width, float height, float depth); Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) @@ -896,16 +902,17 @@ bool IsSoundPlaying(Sound sound); // Check if a so void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -int PlayMusicStream(int index, char *fileName); // Start music playing (open stream) -void UpdateMusicStream(int index); // Updates buffers for music streaming -void StopMusicStream(int index); // Stop music playing (close stream) -void PauseMusicStream(int index); // Pause music playing -void ResumeMusicStream(int index); // Resume playing paused music -bool IsMusicPlaying(int index); // Check if music is playing -void SetMusicVolume(int index, float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(int index, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(int index); // Get current music time length (in seconds) -float GetMusicTimePlayed(int index); // Get current music time played (in seconds) +MusicBuffer LoadMusicBufferStream(char *fileName, int index); +int PlayMusicStream(MusicBuffer buffer); // Start music playing (open stream) +void UpdateMusicStream(MusicBuffer buffer); // Updates buffers for music streaming +void StopMusicStream(MusicBuffer buffer); // Stop music playing (close stream) +void PauseMusicStream(MusicBuffer buffer); // Pause music playing +void ResumeMusicStream(MusicBuffer buffer); // Resume playing paused music +bool IsMusicPlaying(MusicBuffer buffer); // Check if music is playing +void SetMusicVolume(MusicBuffer buffer, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(MusicBuffer buffer, float pitch); // Set pitch for a music (1.0 is base level) +float GetMusicTimeLength(MusicBuffer buffer); // Get music time length (in seconds) +float GetMusicTimePlayed(MusicBuffer buffer); // Get current music time played (in seconds) int GetMusicStreamCount(void); // Get number of streams loaded #ifdef __cplusplus -- cgit v1.2.3 From 02c456432d7f284c41519f6d540ad6c4dfb4a065 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 1 Aug 2016 12:49:17 +0200 Subject: Complete review of audio system Still some work left... --- src/audio.c | 1091 +++++++++++++++++-------------------------------- src/audio.h | 36 +- src/external/jar_xm.h | 60 ++- src/raylib.h | 32 +- 4 files changed, 445 insertions(+), 774 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 93987c6e..94bbb376 100644 --- a/src/audio.c +++ b/src/audio.c @@ -55,6 +55,7 @@ #include // Required for: strcmp(), strncmp() #include // Required for: FILE, fopen(), fclose(), fread() +// Tokens defined by OpenAL extension: AL_EXT_float32 #ifndef AL_FORMAT_MONO_FLOAT32 #define AL_FORMAT_MONO_FLOAT32 0x10010 #endif @@ -85,55 +86,47 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_STREAM_BUFFERS 2 // Number of buffers for each source -#define MAX_MUSIC_STREAMS 2 // Number of simultanious music sources -#define MAX_MIX_CHANNELS 4 // Number of mix channels (OpenAL sources) - -#if defined(PLATFORM_RPI) || defined(PLATFORM_ANDROID) - // NOTE: On RPI and Android should be lower to avoid frame-stalls - #define MUSIC_BUFFER_SIZE_SHORT 4096*2 // PCM data buffer (short) - 16Kb (RPI) - #define MUSIC_BUFFER_SIZE_FLOAT 4096 // PCM data buffer (float) - 16Kb (RPI) -#else - // NOTE: On HTML5 (emscripten) this is allocated on heap, by default it's only 16MB!...just take care... - #define MUSIC_BUFFER_SIZE_SHORT 4096*8 // PCM data buffer (short) - 64Kb - #define MUSIC_BUFFER_SIZE_FLOAT 4096*4 // PCM data buffer (float) - 64Kb -#endif +#define MAX_STREAM_BUFFERS 2 // Number of buffers for each audio stream + +// NOTE: Music buffer size is defined by number of samples, independent of sample size +// After some math, considering a sampleRate of 48000, a buffer refill rate of 1/60 seconds +// and double-buffering system, I concluded that a 4096 samples buffer should be enough +// In case of music-stalls, just inclease this number +#define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. short: 32Kb) //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- +typedef enum { MUSIC_AUDIO_OGG = 0, MUSIC_MODULE_XM, MUSIC_MODULE_MOD } MusicContextType; + // Used to create custom audio streams that are not bound to a specific file. -// There can be no more than 4 concurrent mixchannels in use. -// This is due to each active mixc being tied to a dedicated mix channel. -typedef struct MixChannel { - unsigned short sampleRate; // default is 48000 - unsigned char channels; // 1=mono,2=stereo - unsigned char mixChannel; // 0-3 or mixA-mixD, each mix channel can receive up to one dedicated audio stream - bool floatingPoint; // if false then the short datatype is used instead - bool playing; // false if paused - - ALenum alFormat; // OpenAL format specifier - ALuint alSource; // OpenAL source - ALuint alBuffer[MAX_STREAM_BUFFERS]; // OpenAL sample buffer -} MixChannel; +typedef struct AudioStream { + unsigned int sampleRate; // Frequency (samples per second): default is 48000 + unsigned int sampleSize; // BitDepth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels + + ALenum format; // OpenAL format specifier + ALuint source; // OpenAL source + ALuint buffers[MAX_STREAM_BUFFERS]; // OpenAL buffers (double buffering) +} AudioStream; // Music type (file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... typedef struct Music { - stb_vorbis *stream; - jar_xm_context_t *xmctx; // XM chiptune context - jar_mod_context_t modctx; // MOD chiptune context - MixChannel *mixc; // Mix channel - - unsigned int totalSamplesLeft; - float totalLengthSeconds; - bool loop; - bool chipTune; // chiptune is loaded? - bool enabled; -} Music; - -// Audio errors registered + MusicContextType ctxType; // Type of music context (OGG, XM, MOD) + stb_vorbis *ctxOgg; // OGG audio context + jar_xm_context_t *ctxXm; // XM chiptune context + jar_mod_context_t ctxMod; // MOD chiptune context + + AudioStream stream; // Audio stream + + bool loop; // Repeat music after finish (loop) + unsigned int totalSamples; // Total number of samples + unsigned int samplesLeft; // Number of samples left to end +} MusicData, *Music; + +// Audio errors to register +/* typedef enum { ERROR_RAW_CONTEXT_CREATION = 1, ERROR_XM_CONTEXT_CREATION = 2, @@ -152,6 +145,7 @@ typedef enum { ERROR_UNINITIALIZED_CHANNELS = 16384, ERROR_UNINTIALIZED_MUSIC_BUFFER = 32768 } AudioError; +*/ #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; @@ -160,10 +154,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Music musicStreams[MAX_MUSIC_STREAMS]; // Current music loaded, up to two can play at the same time -static MixChannel *mixChannels[MAX_MIX_CHANNELS]; // Mix channels currently active (from music streams) - -static int lastAudioError = 0; // Registers last audio error +static int lastAudioError = 0; // Registers last audio error //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -172,14 +163,11 @@ static Wave LoadWAV(const char *fileName); // Load WAV file static Wave LoadOGG(char *fileName); // Load OGG file static void UnloadWave(Wave wave); // Unload wave data -static bool BufferMusicStream(int index, int numBuffers); // Fill music buffers with data -static void EmptyMusicStream(int index); // Empty music buffers +static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); +static void CloseAudioStream(AudioStream stream); // Frees mix channel +static int BufferAudioStream(AudioStream stream, void *data, int numberElements); // Pushes more audio data into mix channel -static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint); -static void CloseMixChannel(MixChannel *mixc); // Frees mix channel -static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements); // Pushes more audio data into mix channel -//static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len); // Pass two arrays of the same legnth in -//static void ResampleByteToFloat(char *chars, float *floats, unsigned short len); // Pass two arrays of same length in +static bool BufferMusicStream(Music music, int numBuffersToProcess); // Fill music buffers with data #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -190,45 +178,44 @@ void TraceLog(int msgType, const char *text, ...); // Outputs a trace log messa // Module Functions Definition - Audio Device initialization and Closing //---------------------------------------------------------------------------------- -// Initialize audio device and mixc +// Initialize audio device void InitAudioDevice(void) { // Open and initialize a device with default settings ALCdevice *device = alcOpenDevice(NULL); if (!device) TraceLog(ERROR, "Audio device could not be opened"); - - ALCcontext *context = alcCreateContext(device, NULL); - - if ((context == NULL) || (alcMakeContextCurrent(context) == ALC_FALSE)) + else { - if (context != NULL) alcDestroyContext(context); + ALCcontext *context = alcCreateContext(device, NULL); - alcCloseDevice(device); + if ((context == NULL) || (alcMakeContextCurrent(context) == ALC_FALSE)) + { + if (context != NULL) alcDestroyContext(context); - TraceLog(ERROR, "Could not setup mix channel"); - } + alcCloseDevice(device); - TraceLog(INFO, "Audio device and context initialized successfully: %s", alcGetString(device, ALC_DEVICE_SPECIFIER)); + TraceLog(ERROR, "Could not initialize audio context"); + } + else + { + TraceLog(INFO, "Audio device and context initialized successfully: %s", alcGetString(device, ALC_DEVICE_SPECIFIER)); - // Listener definition (just for 2D) - alListener3f(AL_POSITION, 0, 0, 0); - alListener3f(AL_VELOCITY, 0, 0, 0); - alListener3f(AL_ORIENTATION, 0, 0, -1); + // Listener definition (just for 2D) + alListener3f(AL_POSITION, 0, 0, 0); + alListener3f(AL_VELOCITY, 0, 0, 0); + alListener3f(AL_ORIENTATION, 0, 0, -1); + } + } } // Close the audio device for all contexts void CloseAudioDevice(void) { - for (int index = 0; index < MAX_MUSIC_STREAMS; index++) - { - if (musicStreams[index].mixc) StopMusicStreamEx(index); // Stop music streaming and close current stream - } - ALCdevice *device; ALCcontext *context = alcGetCurrentContext(); - if (context == NULL) TraceLog(WARNING, "Could not get current mix channel for closing"); + if (context == NULL) TraceLog(WARNING, "Could not get current audio context for closing"); device = alcGetContextsDevice(context); @@ -252,300 +239,30 @@ bool IsAudioDeviceReady(void) } } -//---------------------------------------------------------------------------------- -// Module Functions Definition - Custom audio output -//---------------------------------------------------------------------------------- - -// Init mix channel for streaming -// The mixChannel is what audio muxing channel you want to operate on, 0-3 are the ones available. -// Each mix channel can only be used one at a time. -static MixChannel *InitMixChannel(unsigned short sampleRate, unsigned char mixChannel, unsigned char channels, bool floatingPoint) -{ - if (mixChannel >= MAX_MIX_CHANNELS) return NULL; - if (!IsAudioDeviceReady()) InitAudioDevice(); - - if (!mixChannels[mixChannel]) - { - MixChannel *mixc = (MixChannel *)malloc(sizeof(MixChannel)); - mixc->sampleRate = sampleRate; - mixc->channels = channels; - mixc->mixChannel = mixChannel; - mixc->floatingPoint = floatingPoint; - mixChannels[mixChannel] = mixc; - - // Setup OpenAL format - if (channels == 1) - { - if (floatingPoint) mixc->alFormat = AL_FORMAT_MONO_FLOAT32; - else mixc->alFormat = AL_FORMAT_MONO16; - } - else if (channels == 2) - { - if (floatingPoint) mixc->alFormat = AL_FORMAT_STEREO_FLOAT32; - else mixc->alFormat = AL_FORMAT_STEREO16; - } - - // Create an audio source - alGenSources(1, &mixc->alSource); - alSourcef(mixc->alSource, AL_PITCH, 1); - alSourcef(mixc->alSource, AL_GAIN, 1); - alSource3f(mixc->alSource, AL_POSITION, 0, 0, 0); - alSource3f(mixc->alSource, AL_VELOCITY, 0, 0, 0); - - // Create Buffer - alGenBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - - // Fill buffers - for (int i = 0; i < MAX_STREAM_BUFFERS; i++) - { - // Initialize buffer with zeros by default - if (mixc->floatingPoint) - { - float pcm[MUSIC_BUFFER_SIZE_FLOAT] = { 0.0f }; - alBufferData(mixc->alBuffer[i], mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_FLOAT*sizeof(float), mixc->sampleRate); - } - else - { - short pcm[MUSIC_BUFFER_SIZE_SHORT] = { 0 }; - alBufferData(mixc->alBuffer[i], mixc->alFormat, pcm, MUSIC_BUFFER_SIZE_SHORT*sizeof(short), mixc->sampleRate); - } - } - - alSourceQueueBuffers(mixc->alSource, MAX_STREAM_BUFFERS, mixc->alBuffer); - mixc->playing = true; - alSourcePlay(mixc->alSource); - - return mixc; - } - - return NULL; -} - -// Frees buffer in mix channel -static void CloseMixChannel(MixChannel *mixc) -{ - if (mixc) - { - alSourceStop(mixc->alSource); - mixc->playing = false; - - // Flush out all queued buffers - ALuint buffer = 0; - int queued = 0; - alGetSourcei(mixc->alSource, AL_BUFFERS_QUEUED, &queued); - - while (queued > 0) - { - alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); - queued--; - } - - // Delete source and buffers - alDeleteSources(1, &mixc->alSource); - alDeleteBuffers(MAX_STREAM_BUFFERS, mixc->alBuffer); - mixChannels[mixc->mixChannel] = NULL; - free(mixc); - mixc = NULL; - } -} - -// Pushes more audio data into mix channel, only one buffer per call -// Call "BufferMixChannel(mixc, NULL, 0)" if you want to pause the audio. -// Returns number of samples that where processed. -static int BufferMixChannel(MixChannel *mixc, void *data, int numberElements) -{ - if (!mixc || (mixChannels[mixc->mixChannel] != mixc)) return 0; // When there is two channels there must be an even number of samples - - if (!data || !numberElements) - { - // Pauses audio until data is given - if (mixc->playing) - { - alSourcePause(mixc->alSource); - mixc->playing = false; - } - - return 0; - } - else if (!mixc->playing) - { - // Restart audio otherwise - alSourcePlay(mixc->alSource); - mixc->playing = true; - } - - ALuint buffer = 0; - - alSourceUnqueueBuffers(mixc->alSource, 1, &buffer); - if (!buffer) return 0; - - if (mixc->floatingPoint) - { - // Process float buffers - float *ptr = (float *)data; - alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(float), mixc->sampleRate); - } - else - { - // Process short buffers - short *ptr = (short *)data; - alBufferData(buffer, mixc->alFormat, ptr, numberElements*sizeof(short), mixc->sampleRate); - } - - alSourceQueueBuffers(mixc->alSource, 1, &buffer); - - return numberElements; -} - -/* -// Convert data from short to float -// example usage: -// short sh[3] = {1,2,3};float fl[3]; -// ResampleShortToFloat(sh,fl,3); -static void ResampleShortToFloat(short *shorts, float *floats, unsigned short len) -{ - for (int i = 0; i < len; i++) - { - if (shorts[i] < 0) floats[i] = (float)shorts[i]/32766.0f; - else floats[i] = (float)shorts[i]/32767.0f; - } -} - -// Convert data from float to short -// example usage: -// char ch[3] = {1,2,3};float fl[3]; -// ResampleByteToFloat(ch,fl,3); -static void ResampleByteToFloat(char *chars, float *floats, unsigned short len) -{ - for (int i = 0; i < len; i++) - { - if (chars[i] < 0) floats[i] = (float)chars[i]/127.0f; - else floats[i] = (float)chars[i]/128.0f; - } -} -*/ - -// Initialize raw audio mix channel for audio buffering -// NOTE: Returns mix channel index or -1 if it fails (errors are registered on lastAudioError) -int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint) -{ - int mixIndex; - - for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot - { - if (mixChannels[mixIndex] == NULL) break; - else if (mixIndex == (MAX_MIX_CHANNELS - 1)) - { - lastAudioError = ERROR_OUT_OF_MIX_CHANNELS; - return -1; - } - } - - if (InitMixChannel(sampleRate, mixIndex, channels, floatingPoint)) return mixIndex; - else - { - lastAudioError = ERROR_RAW_CONTEXT_CREATION; - return -1; - } -} - -// Buffers data directly to raw mix channel -// if 0 is returned, buffers are still full and you need to keep trying with the same data -// otherwise it will return number of samples buffered. -// NOTE: Data could be either be an array of floats or shorts, depending on the created context -int BufferRawAudioContext(int ctx, void *data, unsigned short numberElements) -{ - int numBuffered = 0; - - if (ctx >= 0) - { - MixChannel *mixc = mixChannels[ctx]; - numBuffered = BufferMixChannel(mixc, data, numberElements); - } - - return numBuffered; -} - -// Closes and frees raw mix channel -void CloseRawAudioContext(int ctx) -{ - if (mixChannels[ctx]) CloseMixChannel(mixChannels[ctx]); -} - //---------------------------------------------------------------------------------- // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- // Load sound to memory +// NOTE: The entire file is loaded to memory to be played (no-streaming) Sound LoadSound(char *fileName) { - Sound sound = { 0 }; Wave wave = { 0 }; - // NOTE: The entire file is loaded to memory to play it all at once (no-streaming) - - // Audio file loading - // NOTE: Buffer space is allocated inside function, Wave must be freed - - if (strcmp(GetExtension(fileName),"wav") == 0) wave = LoadWAV(fileName); - else if (strcmp(GetExtension(fileName),"ogg") == 0) wave = LoadOGG(fileName); - else - { - TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); - - // TODO: Find a better way to register errors (similar to glGetError()) - lastAudioError = ERROR_EXTENSION_NOT_RECOGNIZED; - } - - if (wave.data != NULL) - { - ALenum format = 0; - // The OpenAL format is worked out by looking at the number of channels and the bits per sample - if (wave.channels == 1) - { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_MONO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_MONO16; - } - else if (wave.channels == 2) - { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_STEREO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_STEREO16; - } - - // Create an audio source - ALuint source; - alGenSources(1, &source); // Generate pointer to audio source + if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); + else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); + else TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); - alSourcef(source, AL_PITCH, 1); - alSourcef(source, AL_GAIN, 1); - alSource3f(source, AL_POSITION, 0, 0, 0); - alSource3f(source, AL_VELOCITY, 0, 0, 0); - alSourcei(source, AL_LOOPING, AL_FALSE); - - // Convert loaded data to OpenAL buffer - //---------------------------------------- - ALuint buffer; - alGenBuffers(1, &buffer); // Generate pointer to buffer - - // Upload sound data to buffer - alBufferData(buffer, format, wave.data, wave.dataSize, wave.sampleRate); - - // Attach sound buffer to source - alSourcei(source, AL_BUFFER, buffer); - - TraceLog(INFO, "[%s] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", fileName, wave.sampleRate, wave.bitsPerSample, wave.channels); - - // Unallocate WAV data - UnloadWave(wave); - - sound.source = source; - sound.buffer = buffer; - } + Sound sound = LoadSoundFromWave(wave); + + // Sound is loaded, we can unload wave + UnloadWave(wave); return sound; } // Load sound from wave data +// NOTE: Wave data must be unallocated manually Sound LoadSoundFromWave(Wave wave) { Sound sound = { 0 }; @@ -586,10 +303,7 @@ Sound LoadSoundFromWave(Wave wave) // Attach sound buffer to source alSourcei(source, AL_BUFFER, buffer); - // Unallocate WAV data - UnloadWave(wave); - - TraceLog(INFO, "[Wave] Sound file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound data loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.bitsPerSample, wave.channels); sound.source = source; sound.buffer = buffer; @@ -619,11 +333,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) FILE *rresFile = fopen(rresName, "rb"); - if (rresFile == NULL) - { - TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); - lastAudioError = ERROR_UNABLE_TO_OPEN_RRES_FILE; - } + if (rresFile == NULL) TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); else { // Read rres file (basic file check - id) @@ -637,7 +347,6 @@ Sound LoadSoundFromRES(const char *rresName, int resId) if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) { TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); - lastAudioError = ERROR_INVALID_RRES_FILE; } else { @@ -681,55 +390,12 @@ Sound LoadSoundFromRES(const char *rresName, int resId) free(data); - // Convert wave to Sound (OpenAL) - ALenum format = 0; - - // The OpenAL format is worked out by looking at the number of channels and the bits per sample - if (wave.channels == 1) - { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_MONO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_MONO16; - } - else if (wave.channels == 2) - { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_STEREO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_STEREO16; - } - - // Create an audio source - ALuint source; - alGenSources(1, &source); // Generate pointer to audio source - - alSourcef(source, AL_PITCH, 1); - alSourcef(source, AL_GAIN, 1); - alSource3f(source, AL_POSITION, 0, 0, 0); - alSource3f(source, AL_VELOCITY, 0, 0, 0); - alSourcei(source, AL_LOOPING, AL_FALSE); - - // Convert loaded data to OpenAL buffer - //---------------------------------------- - ALuint buffer; - alGenBuffers(1, &buffer); // Generate pointer to buffer - - // Upload sound data to buffer - alBufferData(buffer, format, (void*)wave.data, wave.dataSize, wave.sampleRate); - - // Attach sound buffer to source - alSourcei(source, AL_BUFFER, buffer); - - TraceLog(INFO, "[%s] Sound loaded successfully from resource (SampleRate: %i, BitRate: %i, Channels: %i)", rresName, wave.sampleRate, wave.bitsPerSample, wave.channels); - - // Unallocate WAV data + sound = LoadSoundFromWave(wave); + + // Sound is loaded, we can unload wave data UnloadWave(wave); - - sound.source = source; - sound.buffer = buffer; - } - else - { - TraceLog(WARNING, "[%s] Required resource do not seem to be a valid SOUND resource", rresName); - lastAudioError = ERROR_INVALID_RRES_RESOURCE; } + else TraceLog(WARNING, "[%s] Required resource do not seem to be a valid SOUND resource", rresName); } else { @@ -764,7 +430,7 @@ void UnloadSound(Sound sound) alDeleteSources(1, &sound.source); alDeleteBuffers(1, &sound.buffer); - TraceLog(INFO, "Unloaded sound data"); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Unloaded sound data from RAM", sound.source, sound.buffer); } // Play a sound @@ -794,6 +460,16 @@ void PauseSound(Sound sound) alSourcePause(sound.source); } +// Resume a paused sound +void ResumeSound(Sound sound) +{ + ALenum state; + + alGetSourcei(sound.source, AL_SOURCE_STATE, &state); + + if (state == AL_PAUSED) alSourcePlay(sound.source); +} + // Stop reproducing a sound void StopSound(Sound sound) { @@ -828,409 +504,426 @@ void SetSoundPitch(Sound sound, float pitch) // Module Functions Definition - Music loading and stream playing (.OGG) //---------------------------------------------------------------------------------- -MusicBuffer LoadMusicBufferStream(char *fileName, int index) +// Load music stream from file +Music LoadMusicStream(char *fileName) { - MusicBuffer buffer = { 0 }; + Music music = (MusicData *)malloc(sizeof(MusicData)); - if(index > MAX_MUSIC_STREAMS) + if (strcmp(GetExtension(fileName), "ogg") == 0) { - TraceLog("[%s] index is greater than MAX_MUSIC_STREAMS", ERROR); - return; // error - } - - buffer.fileName = fileName; - buffer.index = index; - - - if (musicStreams[buffer.index].stream || musicStreams[buffer.index].xmctx) return; // error + // Open ogg audio stream + music->ctxOgg = stb_vorbis_open_filename(fileName, NULL, NULL); - return buffer; -} - -// Start music playing (open stream) -// returns 0 on success or error code -int PlayMusicStream(MusicBuffer musicBuffer) -{ - if(musicBuffer.fileName == 0) - { - return ERROR_UNINTIALIZED_MUSIC_BUFFER; - } - int mixIndex; - for (mixIndex = 0; mixIndex < MAX_MIX_CHANNELS; mixIndex++) // find empty mix channel slot - { - if (mixChannels[mixIndex] == NULL) break; - else if (mixIndex == (MAX_MIX_CHANNELS - 1)) return ERROR_OUT_OF_MIX_CHANNELS; // error - } - - if (strcmp(GetExtension(musicBuffer.fileName),"ogg") == 0) - { - // Open audio stream - musicStreams[musicBuffer.index].stream = stb_vorbis_open_filename(musicBuffer.fileName, NULL, NULL); - - if (musicStreams[musicBuffer.index].stream == NULL) + if (music->ctxOgg == NULL) { - TraceLog(WARNING, "[%s] OGG audio file could not be opened", musicBuffer.fileName); - return ERROR_LOADING_OGG; // error + TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); } else { - // Get file info - stb_vorbis_info info = stb_vorbis_get_info(musicStreams[musicBuffer.index].stream); - - TraceLog(INFO, "[%s] Ogg sample rate: %i", musicBuffer.fileName, info.sample_rate); - TraceLog(INFO, "[%s] Ogg channels: %i", musicBuffer.fileName, info.channels); - TraceLog(DEBUG, "[%s] Temp memory required: %i", musicBuffer.fileName, info.temp_memory_required); + stb_vorbis_info info = stb_vorbis_get_info(music->ctxOgg); // Get Ogg file info - musicStreams[musicBuffer.index].loop = true; // We loop by default - musicStreams[musicBuffer.index].enabled = true; + TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); + TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); + TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); + // TODO: Support 32-bit sampleSize OGGs + music->stream = InitAudioStream(info.sample_rate, 16, info.channels); + + music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg)*info.channels; + music->samplesLeft = music->totalSamples; + //float totalLengthSeconds = stb_vorbis_stream_length_in_seconds(music->ctxOgg); - musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream) * info.channels; - musicStreams[musicBuffer.index].totalLengthSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[musicBuffer.index].stream); - - if (info.channels == 2) - { - musicStreams[musicBuffer.index].mixc = InitMixChannel(info.sample_rate, mixIndex, 2, false); - musicStreams[musicBuffer.index].mixc->playing = true; - } - else - { - musicStreams[musicBuffer.index].mixc = InitMixChannel(info.sample_rate, mixIndex, 1, false); - musicStreams[musicBuffer.index].mixc->playing = true; - } - - if (!musicStreams[musicBuffer.index].mixc) return ERROR_LOADING_OGG; // error + music->ctxType = MUSIC_AUDIO_OGG; + music->loop = true; // We loop by default } } - else if (strcmp(GetExtension(musicBuffer.fileName),"xm") == 0) + else if (strcmp(GetExtension(fileName), "xm") == 0) { - // only stereo is supported for xm - if (!jar_xm_create_context_from_file(&musicStreams[musicBuffer.index].xmctx, 48000, musicBuffer.fileName)) + int result = jar_xm_create_context_from_file(&music->ctxXm, 48000, fileName); + + if (!result) // XM context created successfully { - musicStreams[musicBuffer.index].chipTune = true; - musicStreams[musicBuffer.index].loop = true; - jar_xm_set_max_loop_count(musicStreams[musicBuffer.index].xmctx, 0); // infinite number of loops - musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)jar_xm_get_remaining_samples(musicStreams[musicBuffer.index].xmctx); - musicStreams[musicBuffer.index].totalLengthSeconds = ((float)musicStreams[musicBuffer.index].totalSamplesLeft)/48000.0f; - musicStreams[musicBuffer.index].enabled = true; - - TraceLog(INFO, "[%s] XM number of samples: %i", musicBuffer.fileName, musicStreams[musicBuffer.index].totalSamplesLeft); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", musicBuffer.fileName, musicStreams[musicBuffer.index].totalLengthSeconds); - - musicStreams[musicBuffer.index].mixc = InitMixChannel(48000, mixIndex, 2, true); - - if (!musicStreams[musicBuffer.index].mixc) return ERROR_XM_CONTEXT_CREATION; // error - - musicStreams[musicBuffer.index].mixc->playing = true; - } - else - { - TraceLog(WARNING, "[%s] XM file could not be opened", musicBuffer.fileName); - return ERROR_LOADING_XM; // error + jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops + + music->totalSamples = (unsigned int)jar_xm_get_remaining_samples(music->ctxXm); + music->samplesLeft = music->totalSamples; + + TraceLog(INFO, "[%s] XM number of samples: %i", fileName, music->totalSamples); + TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); + + // NOTE: Only stereo is supported for XM + music->stream = InitAudioStream(48000, 32, 2); + + music->ctxType = MUSIC_MODULE_XM; + music->loop = true; } + else TraceLog(WARNING, "[%s] XM file could not be opened", fileName); } - else if (strcmp(GetExtension(musicBuffer.fileName),"mod") == 0) + else if (strcmp(GetExtension(fileName), "mod") == 0) { - jar_mod_init(&musicStreams[musicBuffer.index].modctx); + jar_mod_init(&music->ctxMod); - if (jar_mod_load_file(&musicStreams[musicBuffer.index].modctx, musicBuffer.fileName)) + if (jar_mod_load_file(&music->ctxMod, fileName)) { - musicStreams[musicBuffer.index].chipTune = true; - musicStreams[musicBuffer.index].loop = true; - musicStreams[musicBuffer.index].totalSamplesLeft = (unsigned int)jar_mod_max_samples(&musicStreams[musicBuffer.index].modctx); - musicStreams[musicBuffer.index].totalLengthSeconds = ((float)musicStreams[musicBuffer.index].totalSamplesLeft)/48000.0f; - musicStreams[musicBuffer.index].enabled = true; + music->totalSamples = (unsigned int)jar_mod_max_samples(&music->ctxMod); + music->samplesLeft = music->totalSamples; - TraceLog(INFO, "[%s] MOD number of samples: %i", musicBuffer.fileName, musicStreams[musicBuffer.index].totalSamplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", musicBuffer.fileName, musicStreams[musicBuffer.index].totalLengthSeconds); + TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, music->samplesLeft); + TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); - musicStreams[musicBuffer.index].mixc = InitMixChannel(48000, mixIndex, 2, false); + music->stream = InitAudioStream(48000, 16, 2); - if (!musicStreams[musicBuffer.index].mixc) return ERROR_MOD_CONTEXT_CREATION; // error - - musicStreams[musicBuffer.index].mixc->playing = true; - } - else - { - TraceLog(WARNING, "[%s] MOD file could not be opened", musicBuffer.fileName); - return ERROR_LOADING_MOD; // error + music->ctxType = MUSIC_MODULE_MOD; + music->loop = true; } + else TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); } - else - { - TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", musicBuffer.fileName); - return ERROR_EXTENSION_NOT_RECOGNIZED; // error - } + else TraceLog(WARNING, "[%s] Music extension not recognized, it can't be loaded", fileName); - return 0; // normal return + return music; } -// Stop music playing for individual music index of musicStreams array (close stream) -void StopMusicStream(MusicBuffer musicBuffer) +// Unload music stream +void UnloadMusicStream(Music music) { - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) - { - CloseMixChannel(musicStreams[musicBuffer.index].mixc); - - if (musicStreams[musicBuffer.index].xmctx) - jar_xm_free_context(musicStreams[musicBuffer.index].xmctx); - else if (musicStreams[musicBuffer.index].modctx.mod_loaded) - jar_mod_unload(&musicStreams[musicBuffer.index].modctx); - else - stb_vorbis_close(musicStreams[musicBuffer.index].stream); - - musicStreams[musicBuffer.index].enabled = false; + CloseAudioStream(music->stream); + + if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close(music->ctxOgg); + else if (music->ctxType == MUSIC_MODULE_XM) jar_xm_free_context(music->ctxXm); + else if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_unload(&music->ctxMod); + + free(music); +} - if (musicStreams[musicBuffer.index].stream || musicStreams[musicBuffer.index].xmctx) - { - musicStreams[musicBuffer.index].stream = NULL; - musicStreams[musicBuffer.index].xmctx = NULL; - } - } +// Start music playing (open stream) +void PlayMusicStream(Music music) +{ + alSourcePlay(music->stream.source); } -void StopMusicStreamEx(int index) +// Pause music playing +void PauseMusicStream(Music music) { - if (index < MAX_MUSIC_STREAMS && musicStreams[index].mixc) - { - CloseMixChannel(musicStreams[index].mixc); + alSourcePause(music->stream.source); +} - if (musicStreams[index].xmctx) - jar_xm_free_context(musicStreams[index].xmctx); - else if (musicStreams[index].modctx.mod_loaded) - jar_mod_unload(&musicStreams[index].modctx); - else - stb_vorbis_close(musicStreams[index].stream); +// Resume music playing +void ResumeMusicStream(Music music) +{ + ALenum state; + alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); - musicStreams[index].enabled = false; + if (state == AL_PAUSED) alSourcePlay(music->stream.source); +} - if (musicStreams[index].stream || musicStreams[index].xmctx) - { - musicStreams[index].stream = NULL; - musicStreams[index].xmctx = NULL; - } - } +// Stop music playing (close stream) +void StopMusicStream(Music music) +{ + alSourceStop(music->stream.source); } // Update (re-fill) music buffers if data already processed -void UpdateMusicStream(MusicBuffer musicBuffer) +void UpdateMusicStream(Music music) { ALenum state; bool active = true; ALint processed = 0; // Determine if music stream is ready to be written - alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - if (musicStreams[musicBuffer.index].mixc->playing && (musicBuffer.index < MAX_MUSIC_STREAMS) && musicStreams[musicBuffer.index].enabled && musicStreams[musicBuffer.index].mixc && (processed > 0)) + if (processed > 0) { - active = BufferMusicStream(musicBuffer.index, processed); + active = BufferMusicStream(music, processed); - if (!active && musicStreams[musicBuffer.index].loop) + if (!active && music->loop) { - if (musicStreams[musicBuffer.index].chipTune) - { - if(musicStreams[musicBuffer.index].modctx.mod_loaded) jar_mod_seek_start(&musicStreams[musicBuffer.index].modctx); - - musicStreams[musicBuffer.index].totalSamplesLeft = musicStreams[musicBuffer.index].totalLengthSeconds*48000.0f; - } - else - { - stb_vorbis_seek_start(musicStreams[musicBuffer.index].stream); - musicStreams[musicBuffer.index].totalSamplesLeft = stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream)*musicStreams[musicBuffer.index].mixc->channels; - } + // Restart music context (if required) + if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_seek_start(&music->ctxMod); + else if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_seek_start(music->ctxOgg); + + music->samplesLeft = music->totalSamples; // Determine if music stream is ready to be written - alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_BUFFERS_PROCESSED, &processed); + alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - active = BufferMusicStream(musicBuffer.index, processed); + active = BufferMusicStream(music, processed); } if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); - alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); - - if (state != AL_PLAYING && active) alSourcePlay(musicStreams[musicBuffer.index].mixc->alSource); + alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); - if (!active) StopMusicStream(musicBuffer); + if (state != AL_PLAYING && active) alSourcePlay(music->stream.source); - } -} - -//get number of music channels active at this time, this does not mean they are playing -int GetMusicStreamCount(void) -{ - int musicCount = 0; - - // Find empty music slot - for (int musicIndex = 0; musicIndex < MAX_MUSIC_STREAMS; musicIndex++) - { - if(musicStreams[musicIndex].stream != NULL || musicStreams[musicIndex].chipTune) musicCount++; - } - - return musicCount; -} - -// Pause music playing -void PauseMusicStream(MusicBuffer musicBuffer) -{ - // Pause music stream if music available! - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc && musicStreams[musicBuffer.index].enabled) - { - TraceLog(INFO, "Pausing music stream"); - alSourcePause(musicStreams[musicBuffer.index].mixc->alSource); - musicStreams[musicBuffer.index].mixc->playing = false; - } -} - -// Resume music playing -void ResumeMusicStream(MusicBuffer musicBuffer) -{ - // Resume music playing... if music available! - ALenum state; - - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) - { - alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); - - if (state == AL_PAUSED) - { - TraceLog(INFO, "Resuming music stream"); - alSourcePlay(musicStreams[musicBuffer.index].mixc->alSource); - musicStreams[musicBuffer.index].mixc->playing = true; - } + if (!active) StopMusicStream(music); } } // Check if any music is playing -bool IsMusicPlaying(MusicBuffer musicBuffer) +bool IsMusicPlaying(Music music) { bool playing = false; ALint state; - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) - { - alGetSourcei(musicStreams[musicBuffer.index].mixc->alSource, AL_SOURCE_STATE, &state); + alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); - if (state == AL_PLAYING) playing = true; - } + if (state == AL_PLAYING) playing = true; return playing; } // Set volume for music -void SetMusicVolume(MusicBuffer musicBuffer, float volume) +void SetMusicVolume(Music music, float volume) { - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) - { - alSourcef(musicStreams[musicBuffer.index].mixc->alSource, AL_GAIN, volume); - } + alSourcef(music->stream.source, AL_GAIN, volume); } // Set pitch for music -void SetMusicPitch(MusicBuffer musicBuffer, float pitch) +void SetMusicPitch(Music music, float pitch) { - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) - { - alSourcef(musicStreams[musicBuffer.index].mixc->alSource, AL_PITCH, pitch); - } + alSourcef(music->stream.source, AL_PITCH, pitch); } // Get music time length (in seconds) -float GetMusicTimeLength(MusicBuffer musicBuffer) +float GetMusicTimeLength(Music music) { - float totalSeconds; - - if (musicStreams[musicBuffer.index].chipTune) totalSeconds = (float)musicStreams[musicBuffer.index].totalLengthSeconds; - else totalSeconds = stb_vorbis_stream_length_in_seconds(musicStreams[musicBuffer.index].stream); - + float totalSeconds = (float)music->totalSamples/music->stream.sampleRate; + return totalSeconds; } // Get current music time played (in seconds) -float GetMusicTimePlayed(MusicBuffer musicBuffer) +float GetMusicTimePlayed(Music music) { float secondsPlayed = 0.0f; - if (musicBuffer.index < MAX_MUSIC_STREAMS && musicStreams[musicBuffer.index].mixc) + if (music->ctxType == MUSIC_MODULE_XM) { - if (musicStreams[musicBuffer.index].chipTune && musicStreams[musicBuffer.index].xmctx) + uint64_t samplesPlayed; + jar_xm_get_position(music->ctxXm, NULL, NULL, NULL, &samplesPlayed); + + // TODO: Not sure if this is the correct value + secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); + } + else if (music->ctxType == MUSIC_MODULE_MOD) + { + long samplesPlayed = jar_mod_current_samples(&music->ctxMod); + + secondsPlayed = (float)samplesPlayed/music->stream.sampleRate; + } + else if (music->ctxType == MUSIC_AUDIO_OGG) + { + unsigned int samplesPlayed = music->totalSamples - music->samplesLeft; + + secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); + } + + return secondsPlayed; +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Init audio stream (to stream audio pcm data) +static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) +{ + AudioStream stream = { 0 }; + + stream.sampleRate = sampleRate; + stream.sampleSize = sampleSize; + stream.channels = channels; + + // Setup OpenAL format + if (channels == 1) + { + switch (sampleSize) { - uint64_t samples; - jar_xm_get_position(musicStreams[musicBuffer.index].xmctx, NULL, NULL, NULL, &samples); - secondsPlayed = (float)samples/(48000.0f*musicStreams[musicBuffer.index].mixc->channels); // Not sure if this is the correct value + case 8: stream.format = AL_FORMAT_MONO8; break; + case 16: stream.format = AL_FORMAT_MONO16; break; + case 32: stream.format = AL_FORMAT_MONO_FLOAT32; break; + default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } - else if(musicStreams[musicBuffer.index].chipTune && musicStreams[musicBuffer.index].modctx.mod_loaded) + } + else if (channels == 2) + { + switch (sampleSize) { - long numsamp = jar_mod_current_samples(&musicStreams[musicBuffer.index].modctx); - secondsPlayed = (float)numsamp/(48000.0f); + case 8: stream.format = AL_FORMAT_STEREO8; break; + case 16: stream.format = AL_FORMAT_STEREO16; break; + case 32: stream.format = AL_FORMAT_STEREO_FLOAT32; break; + default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } - else + } + else TraceLog(WARNING, "Init audio stream: Number of channels not supported: %i", channels); + + // Create an audio source + alGenSources(1, &stream.source); + alSourcef(stream.source, AL_PITCH, 1); + alSourcef(stream.source, AL_GAIN, 1); + alSource3f(stream.source, AL_POSITION, 0, 0, 0); + alSource3f(stream.source, AL_VELOCITY, 0, 0, 0); + + // Create Buffers + alGenBuffers(MAX_STREAM_BUFFERS, stream.buffers); + + // Initialize buffer with zeros by default + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) + { + if (stream.sampleSize == 8) { - int totalSamples = stb_vorbis_stream_length_in_samples(musicStreams[musicBuffer.index].stream)*musicStreams[musicBuffer.index].mixc->channels; - int samplesPlayed = totalSamples - musicStreams[musicBuffer.index].totalSamplesLeft; - secondsPlayed = (float)samplesPlayed/(musicStreams[musicBuffer.index].mixc->sampleRate*musicStreams[musicBuffer.index].mixc->channels); + unsigned char pcm[AUDIO_BUFFER_SIZE] = { 0 }; + alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(unsigned char), stream.sampleRate); + } + else if (stream.sampleSize == 16) + { + short pcm[AUDIO_BUFFER_SIZE] = { 0 }; + alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(short), stream.sampleRate); + } + else if (stream.sampleSize == 32) + { + float pcm[AUDIO_BUFFER_SIZE] = { 0.0f }; + alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(float), stream.sampleRate); } } - return secondsPlayed; + alSourceQueueBuffers(stream.source, MAX_STREAM_BUFFERS, stream.buffers); + + TraceLog(INFO, "[AUD ID %i] Audio stream loaded successfully", stream.source); + + return stream; } -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- +// Close audio stream and free memory +static void CloseAudioStream(AudioStream stream) +{ + // Stop playing channel + alSourceStop(stream.source); + + // Flush out all queued buffers + int queued = 0; + alGetSourcei(stream.source, AL_BUFFERS_QUEUED, &queued); + + ALuint buffer = 0; + + while (queued > 0) + { + alSourceUnqueueBuffers(stream.source, 1, &buffer); + queued--; + } + + // Delete source and buffers + alDeleteSources(1, &stream.source); + alDeleteBuffers(MAX_STREAM_BUFFERS, stream.buffers); + + TraceLog(INFO, "[AUD ID %i] Unloaded audio stream data", stream.source); +} + +// Push more audio data into audio stream, only one buffer per call +// NOTE: Returns number of samples that were processed +static int BufferAudioStream(AudioStream stream, void *data, int numberElements) +{ + if (!data || !numberElements) + { + // Pauses audio until data is given + alSourcePause(stream.source); + return 0; + } + + ALuint buffer = 0; + alSourceUnqueueBuffers(stream.source, 1, &buffer); + + if (!buffer) return 0; + + // Reference + //void alBufferData(ALuint bufferName, ALenum format, const ALvoid *data, ALsizei size, ALsizei frequency); + + // ALuint bufferName: buffer id + // ALenum format: Valid formats are + // AL_FORMAT_MONO8, // unsigned char + // AL_FORMAT_MONO16, // short + // AL_FORMAT_STEREO8, + // AL_FORMAT_STEREO16 // stereo data is interleaved: left+right channels sample + // AL_FORMAT_MONO_FLOAT32 (extension) + // AL_FORMAT_STEREO_FLOAT32 (extension) + // ALsizei size: Number of bytes, must be coherent with format + // ALsizei frequency: sample rate + + if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numberElements*sizeof(unsigned char), stream.sampleRate); + else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numberElements*sizeof(short), stream.sampleRate); + else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numberElements*sizeof(float), stream.sampleRate); + + alSourceQueueBuffers(stream.source, 1, &buffer); + + return numberElements; +} // Fill music buffers with new data from music stream -static bool BufferMusicStream(int index, int numBuffers) +static bool BufferMusicStream(Music music, int numBuffersToProcess) { - short pcm[MUSIC_BUFFER_SIZE_SHORT]; - float pcmf[MUSIC_BUFFER_SIZE_FLOAT]; + short pcm[AUDIO_BUFFER_SIZE]; + float pcmf[AUDIO_BUFFER_SIZE]; int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - if (musicStreams[index].chipTune) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + if (music->ctxType == MUSIC_MODULE_XM) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. { - for (int i = 0; i < numBuffers; i++) + for (int i = 0; i < numBuffersToProcess; i++) { - if (musicStreams[index].modctx.mod_loaded) - { - if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT/2; - else size = musicStreams[index].totalSamplesLeft/2; + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE/2; + else size = music->samplesLeft/2; - jar_mod_fillbuffer(&musicStreams[index].modctx, pcm, size, 0 ); - BufferMixChannel(musicStreams[index].mixc, pcm, size*2); - } - else if (musicStreams[index].xmctx) - { - if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_FLOAT) size = MUSIC_BUFFER_SIZE_FLOAT/2; - else size = musicStreams[index].totalSamplesLeft/2; + // Read 2*shorts and moves them to buffer+size memory location + jar_xm_generate_samples(music->ctxXm, pcmf, size); + + BufferAudioStream(music->stream, pcmf, size*2); + + music->samplesLeft -= size; - jar_xm_generate_samples(musicStreams[index].xmctx, pcmf, size); // reads 2*readlen shorts and moves them to buffer+size memory location - BufferMixChannel(musicStreams[index].mixc, pcmf, size*2); + if (music->samplesLeft <= 0) + { + active = false; + break; } + } + } + else if (music->ctxType == MUSIC_MODULE_MOD) + { + for (int i = 0; i < numBuffersToProcess; i++) + { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE/2; + else size = music->samplesLeft/2; + + jar_mod_fillbuffer(&music->ctxMod, pcm, size, 0); + + BufferAudioStream(music->stream, pcm, size*2); - musicStreams[index].totalSamplesLeft -= size; + music->samplesLeft -= size; - if (musicStreams[index].totalSamplesLeft <= 0) + if (music->samplesLeft <= 0) { active = false; break; } } } - else + else if (music->ctxType == MUSIC_AUDIO_OGG) { - if (musicStreams[index].totalSamplesLeft >= MUSIC_BUFFER_SIZE_SHORT) size = MUSIC_BUFFER_SIZE_SHORT; - else size = musicStreams[index].totalSamplesLeft; + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE; + else size = music->samplesLeft; - for (int i = 0; i < numBuffers; i++) + for (int i = 0; i < numBuffersToProcess; i++) { - int streamedBytes = stb_vorbis_get_samples_short_interleaved(musicStreams[index].stream, musicStreams[index].mixc->channels, pcm, size); - BufferMixChannel(musicStreams[index].mixc, pcm, streamedBytes * musicStreams[index].mixc->channels); - musicStreams[index].totalSamplesLeft -= streamedBytes * musicStreams[index].mixc->channels; - - if (musicStreams[index].totalSamplesLeft <= 0) + // NOTE: Returns the number of samples stored per channel + int numSamples = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, size); + + BufferAudioStream(music->stream, pcm, numSamples*music->stream.channels); + + music->samplesLeft -= (numSamples*music->stream.channels); + + if (music->samplesLeft <= 0) { active = false; break; @@ -1241,22 +934,6 @@ static bool BufferMusicStream(int index, int numBuffers) return active; } -// Empty music buffers -static void EmptyMusicStream(int index) -{ - ALuint buffer = 0; - int queued = 0; - - alGetSourcei(musicStreams[index].mixc->alSource, AL_BUFFERS_QUEUED, &queued); - - while (queued > 0) - { - alSourceUnqueueBuffers(musicStreams[index].mixc->alSource, 1, &buffer); - - queued--; - } -} - // Load WAV file into Wave structure static Wave LoadWAV(const char *fileName) { @@ -1382,7 +1059,7 @@ static Wave LoadOGG(char *fileName) TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); - int totalSamplesLength = (stb_vorbis_stream_length_in_samples(oggFile) * info.channels); + int totalSamplesLength = (stb_vorbis_stream_length_in_samples(oggFile)*info.channels); wave.dataSize = totalSamplesLength*sizeof(short); // Size must be in bytes @@ -1417,7 +1094,7 @@ static void UnloadWave(Wave wave) { free(wave.data); - TraceLog(INFO, "Unloaded wave data"); + TraceLog(INFO, "Unloaded wave data from RAM"); } // Some required functions for audio standalone module version diff --git a/src/audio.h b/src/audio.h index d39162b5..c9171339 100644 --- a/src/audio.h +++ b/src/audio.h @@ -75,10 +75,9 @@ typedef struct Wave { short channels; } Wave; -typedef struct MusicBuffer { - char *fileName; - int index; // index in musicStreams -} MusicBuffer; +// Music type (file streaming from memory) +// NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... +typedef struct Music *Music; #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -102,27 +101,24 @@ Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound +void ResumeSound(Sound sound); // Resume a paused sound void StopSound(Sound sound); // Stop playing a sound bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -MusicBuffer LoadMusicBufferStream(char *fileName, int index); -int PlayMusicStream(MusicBuffer buffer); // Start music playing (open stream) -void UpdateMusicStream(MusicBuffer buffer); // Updates buffers for music streaming -void StopMusicStream(MusicBuffer buffer); // Stop music playing (close stream) -void PauseMusicStream(MusicBuffer buffer); // Pause music playing -void ResumeMusicStream(MusicBuffer buffer); // Resume playing paused music -bool IsMusicPlaying(MusicBuffer buffer); // Check if music is playing -void SetMusicVolume(MusicBuffer buffer float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(MusicBuffer buffer, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(MusicBuffer buffer); // Get music time length (in seconds) -float GetMusicTimePlayed(MusicBuffer buffer); // Get current music time played (in seconds) -int GetMusicStreamCount(void); // Get number of streams loaded - -int InitRawMixChannel(int sampleRate, int channels, bool floatingPoint); // Initialize raw audio mix channel for audio buffering -int BufferRawMixChannel(int mixc, void *data, unsigned short numberElements); // Buffers data directly to raw mix channel -void CloseRawMixChannel(int mixc); // Closes and frees raw mix channel +Music LoadMusicStream(char *fileName); // Load music stream from file +void UnloadMusicStream(Music music); // Unload music stream +void PlayMusicStream(Music music); // Start music playing (open stream) +void UpdateMusicStream(Music music); // Updates buffers for music streaming +void StopMusicStream(Music music); // Stop music playing (close stream) +void PauseMusicStream(Music music); // Pause music playing +void ResumeMusicStream(Music music); // Resume playing paused music +bool IsMusicPlaying(Music music); // Check if music is playing +void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +float GetMusicTimeLength(Music music); // Get music time length (in seconds) +float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) #ifdef __cplusplus } diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h index 02463e08..7f0517df 100644 --- a/src/external/jar_xm.h +++ b/src/external/jar_xm.h @@ -102,7 +102,7 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const * @deprecated This function is unsafe! * @see jar_xm_create_context_safe() */ -int jar_xm_create_context(jar_xm_context_t**, const char* moddata, uint32_t rate); +int jar_xm_create_context(jar_xm_context_t** ctx, const char* moddata, uint32_t rate); /** Create a XM context. * @@ -114,17 +114,17 @@ int jar_xm_create_context(jar_xm_context_t**, const char* moddata, uint32_t rate * @returns 1 if module data is not sane * @returns 2 if memory allocation failed */ -int jar_xm_create_context_safe(jar_xm_context_t**, const char* moddata, size_t moddata_length, uint32_t rate); +int jar_xm_create_context_safe(jar_xm_context_t** ctx, const char* moddata, size_t moddata_length, uint32_t rate); /** Free a XM context created by jar_xm_create_context(). */ -void jar_xm_free_context(jar_xm_context_t*); +void jar_xm_free_context(jar_xm_context_t* ctx); /** Play the module and put the sound samples in an output buffer. * * @param output buffer of 2*numsamples elements (A left and right value for each sample) * @param numsamples number of samples to generate */ -void jar_xm_generate_samples(jar_xm_context_t*, float* output, size_t numsamples); +void jar_xm_generate_samples(jar_xm_context_t* ctx, float* output, size_t numsamples); /** Play the module, resample from 32 bit to 16 bit, and put the sound samples in an output buffer. * @@ -173,12 +173,12 @@ void jar_xm_generate_samples_8bit(jar_xm_context_t* ctx, char* output, size_t nu * * @param loopcnt maximum number of loops. Use 0 to loop * indefinitely. */ -void jar_xm_set_max_loop_count(jar_xm_context_t*, uint8_t loopcnt); +void jar_xm_set_max_loop_count(jar_xm_context_t* ctx, uint8_t loopcnt); /** Get the loop count of the currently playing module. This value is * 0 when the module is still playing, 1 when the module has looped * once, etc. */ -uint8_t jar_xm_get_loop_count(jar_xm_context_t*); +uint8_t jar_xm_get_loop_count(jar_xm_context_t* ctx); @@ -188,7 +188,7 @@ uint8_t jar_xm_get_loop_count(jar_xm_context_t*); * * @return whether the channel was muted. */ -bool jar_xm_mute_channel(jar_xm_context_t*, uint16_t, bool); +bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t, bool); /** Mute or unmute an instrument. * @@ -197,43 +197,43 @@ bool jar_xm_mute_channel(jar_xm_context_t*, uint16_t, bool); * * @return whether the instrument was muted. */ -bool jar_xm_mute_instrument(jar_xm_context_t*, uint16_t, bool); +bool jar_xm_mute_instrument(jar_xm_context_t* ctx, uint16_t, bool); /** Get the module name as a NUL-terminated string. */ -const char* jar_xm_get_module_name(jar_xm_context_t*); +const char* jar_xm_get_module_name(jar_xm_context_t* ctx); /** Get the tracker name as a NUL-terminated string. */ -const char* jar_xm_get_tracker_name(jar_xm_context_t*); +const char* jar_xm_get_tracker_name(jar_xm_context_t* ctx); /** Get the number of channels. */ -uint16_t jar_xm_get_number_of_channels(jar_xm_context_t*); +uint16_t jar_xm_get_number_of_channels(jar_xm_context_t* ctx); /** Get the module length (in patterns). */ uint16_t jar_xm_get_module_length(jar_xm_context_t*); /** Get the number of patterns. */ -uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t*); +uint16_t jar_xm_get_number_of_patterns(jar_xm_context_t* ctx); /** Get the number of rows of a pattern. * * @note Pattern numbers go from 0 to * jar_xm_get_number_of_patterns(...)-1. */ -uint16_t jar_xm_get_number_of_rows(jar_xm_context_t*, uint16_t); +uint16_t jar_xm_get_number_of_rows(jar_xm_context_t* ctx, uint16_t); /** Get the number of instruments. */ -uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t*); +uint16_t jar_xm_get_number_of_instruments(jar_xm_context_t* ctx); /** Get the number of samples of an instrument. * * @note Instrument numbers go from 1 to * jar_xm_get_number_of_instruments(...). */ -uint16_t jar_xm_get_number_of_samples(jar_xm_context_t*, uint16_t); +uint16_t jar_xm_get_number_of_samples(jar_xm_context_t* ctx, uint16_t); @@ -242,7 +242,7 @@ uint16_t jar_xm_get_number_of_samples(jar_xm_context_t*, uint16_t); * @param bpm will receive the current BPM * @param tempo will receive the current tempo (ticks per line) */ -void jar_xm_get_playing_speed(jar_xm_context_t*, uint16_t* bpm, uint16_t* tempo); +void jar_xm_get_playing_speed(jar_xm_context_t* ctx, uint16_t* bpm, uint16_t* tempo); /** Get the current position in the module being played. * @@ -257,7 +257,7 @@ void jar_xm_get_playing_speed(jar_xm_context_t*, uint16_t* bpm, uint16_t* tempo) * generated samples (divide by sample rate to get seconds of * generated audio) */ -void jar_xm_get_position(jar_xm_context_t*, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); +void jar_xm_get_position(jar_xm_context_t* ctx, uint8_t* pattern_index, uint8_t* pattern, uint8_t* row, uint64_t* samples); /** Get the latest time (in number of generated samples) when a * particular instrument was triggered in any channel. @@ -265,7 +265,7 @@ void jar_xm_get_position(jar_xm_context_t*, uint8_t* pattern_index, uint8_t* pat * @note Instrument numbers go from 1 to * jar_xm_get_number_of_instruments(...). */ -uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t*, uint16_t); +uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t* ctx, uint16_t); /** Get the latest time (in number of generated samples) when a * particular sample was triggered in any channel. @@ -276,21 +276,21 @@ uint64_t jar_xm_get_latest_trigger_of_instrument(jar_xm_context_t*, uint16_t); * @note Sample numbers go from 0 to * jar_xm_get_nubmer_of_samples(...,instr)-1. */ -uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t*, uint16_t instr, uint16_t sample); +uint64_t jar_xm_get_latest_trigger_of_sample(jar_xm_context_t* ctx, uint16_t instr, uint16_t sample); /** Get the latest time (in number of generated samples) when any * instrument was triggered in a given channel. * * @note Channel numbers go from 1 to jar_xm_get_number_of_channels(...). */ -uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t*, uint16_t); +uint64_t jar_xm_get_latest_trigger_of_channel(jar_xm_context_t* ctx, uint16_t); /** Get the number of remaining samples. Divide by 2 to get the number of individual LR data samples. * * @note This is the remaining number of samples before the loop starts module again, or halts if on last pass. * @note This function is very slow and should only be run once, if at all. */ -uint64_t jar_xm_get_remaining_samples(jar_xm_context_t*); +uint64_t jar_xm_get_remaining_samples(jar_xm_context_t* ctx); #ifdef __cplusplus } @@ -308,7 +308,7 @@ uint64_t jar_xm_get_remaining_samples(jar_xm_context_t*); #include #include -#if JAR_XM_DEBUG +#ifdef JAR_XM_DEBUG #include #define DEBUG(fmt, ...) do { \ fprintf(stderr, "%s(): " fmt "\n", __func__, __VA_ARGS__); \ @@ -638,7 +638,7 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz /* Initialize most of the fields to 0, 0.f, NULL or false depending on type */ memset(mempool, 0, bytes_needed); - ctx = (*ctxp = (jar_xm_context_t*)mempool); + ctx = (*ctxp = (jar_xm_context_t *)mempool); ctx->allocated_memory = mempool; /* Keep original pointer for free() */ mempool += sizeof(jar_xm_context_t); @@ -685,20 +685,18 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz return 0; } -void jar_xm_free_context(jar_xm_context_t* context) { - free(context->allocated_memory); +void jar_xm_free_context(jar_xm_context_t* ctx) { + free(ctx->allocated_memory); } -void jar_xm_set_max_loop_count(jar_xm_context_t* context, uint8_t loopcnt) { - context->max_loop_count = loopcnt; +void jar_xm_set_max_loop_count(jar_xm_context_t* ctx, uint8_t loopcnt) { + ctx->max_loop_count = loopcnt; } -uint8_t jar_xm_get_loop_count(jar_xm_context_t* context) { - return context->loop_count; +uint8_t jar_xm_get_loop_count(jar_xm_context_t* ctx) { + return ctx->loop_count; } - - bool jar_xm_mute_channel(jar_xm_context_t* ctx, uint16_t channel, bool mute) { bool old = ctx->channels[channel - 1].muted; ctx->channels[channel - 1].muted = mute; diff --git a/src/raylib.h b/src/raylib.h index 1966f75e..f8dd8359 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -478,10 +478,9 @@ typedef struct Wave { short channels; } Wave; -typedef struct MusicBuffer { - char *fileName; - int index; // index in musicStreams -} MusicBuffer; +// Music type (file streaming from memory) +// NOTE: Anything longer than ~10 seconds should be streamed +typedef struct Music *Music; // Texture formats // NOTE: Support depends on OpenGL version and platform @@ -897,23 +896,24 @@ Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound +void ResumeSound(Sound sound); // Resume a paused sound void StopSound(Sound sound); // Stop playing a sound bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) -MusicBuffer LoadMusicBufferStream(char *fileName, int index); -int PlayMusicStream(MusicBuffer buffer); // Start music playing (open stream) -void UpdateMusicStream(MusicBuffer buffer); // Updates buffers for music streaming -void StopMusicStream(MusicBuffer buffer); // Stop music playing (close stream) -void PauseMusicStream(MusicBuffer buffer); // Pause music playing -void ResumeMusicStream(MusicBuffer buffer); // Resume playing paused music -bool IsMusicPlaying(MusicBuffer buffer); // Check if music is playing -void SetMusicVolume(MusicBuffer buffer, float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(MusicBuffer buffer, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(MusicBuffer buffer); // Get music time length (in seconds) -float GetMusicTimePlayed(MusicBuffer buffer); // Get current music time played (in seconds) -int GetMusicStreamCount(void); // Get number of streams loaded +Music LoadMusicStream(char *fileName); // Load music stream from file +void UnloadMusicStream(Music music); // Unload music stream +void PlayMusicStream(Music music); // Start music playing (open stream) +void UpdateMusicStream(Music music); // Updates buffers for music streaming +void StopMusicStream(Music music); // Stop music playing (close stream) +void PauseMusicStream(Music music); // Pause music playing +void ResumeMusicStream(Music music); // Resume playing paused music +bool IsMusicPlaying(Music music); // Check if music is playing +void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +float GetMusicTimeLength(Music music); // Get music time length (in seconds) +float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) #ifdef __cplusplus } -- cgit v1.2.3 From 2dc5f580a6b18345be999bf70dcbfd563459de5d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 1 Aug 2016 12:58:30 +0200 Subject: Removed audio errors register --- src/audio.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 94bbb376..2ff56737 100644 --- a/src/audio.c +++ b/src/audio.c @@ -125,28 +125,6 @@ typedef struct Music { unsigned int samplesLeft; // Number of samples left to end } MusicData, *Music; -// Audio errors to register -/* -typedef enum { - ERROR_RAW_CONTEXT_CREATION = 1, - ERROR_XM_CONTEXT_CREATION = 2, - ERROR_MOD_CONTEXT_CREATION = 4, - ERROR_MIX_CHANNEL_CREATION = 8, - ERROR_MUSIC_CHANNEL_CREATION = 16, - ERROR_LOADING_XM = 32, - ERROR_LOADING_MOD = 64, - ERROR_LOADING_WAV = 128, - ERROR_LOADING_OGG = 256, - ERROR_OUT_OF_MIX_CHANNELS = 512, - ERROR_EXTENSION_NOT_RECOGNIZED = 1024, - ERROR_UNABLE_TO_OPEN_RRES_FILE = 2048, - ERROR_INVALID_RRES_FILE = 4096, - ERROR_INVALID_RRES_RESOURCE = 8192, - ERROR_UNINITIALIZED_CHANNELS = 16384, - ERROR_UNINTIALIZED_MUSIC_BUFFER = 32768 -} AudioError; -*/ - #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; #endif @@ -154,7 +132,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static int lastAudioError = 0; // Registers last audio error +// ... //---------------------------------------------------------------------------------- // Module specific Functions Declaration -- cgit v1.2.3 From 36cf1f7dfd8865310c21b0f78cf1de9976d9197a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 1 Aug 2016 18:05:07 +0200 Subject: Improved support for C++ Added compound literals (C99) alternative for C++ compilers that don't support this feature --- src/raylib.h | 91 +++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index f8dd8359..4b9f6ca0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -235,33 +235,64 @@ // Some Basic Colors // NOTE: Custom raylib color palette for amazing visuals on WHITE background -#define LIGHTGRAY (Color){ 200, 200, 200, 255 } // Light Gray -#define GRAY (Color){ 130, 130, 130, 255 } // Gray -#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray -#define YELLOW (Color){ 253, 249, 0, 255 } // Yellow -#define GOLD (Color){ 255, 203, 0, 255 } // Gold -#define ORANGE (Color){ 255, 161, 0, 255 } // Orange -#define PINK (Color){ 255, 109, 194, 255 } // Pink -#define RED (Color){ 230, 41, 55, 255 } // Red -#define MAROON (Color){ 190, 33, 55, 255 } // Maroon -#define GREEN (Color){ 0, 228, 48, 255 } // Green -#define LIME (Color){ 0, 158, 47, 255 } // Lime -#define DARKGREEN (Color){ 0, 117, 44, 255 } // Dark Green -#define SKYBLUE (Color){ 102, 191, 255, 255 } // Sky Blue -#define BLUE (Color){ 0, 121, 241, 255 } // Blue -#define DARKBLUE (Color){ 0, 82, 172, 255 } // Dark Blue -#define PURPLE (Color){ 200, 122, 255, 255 } // Purple -#define VIOLET (Color){ 135, 60, 190, 255 } // Violet -#define DARKPURPLE (Color){ 112, 31, 126, 255 } // Dark Purple -#define BEIGE (Color){ 211, 176, 131, 255 } // Beige -#define BROWN (Color){ 127, 106, 79, 255 } // Brown -#define DARKBROWN (Color){ 76, 63, 47, 255 } // Dark Brown - -#define WHITE (Color){ 255, 255, 255, 255 } // White -#define BLACK (Color){ 0, 0, 0, 255 } // Black -#define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) -#define MAGENTA (Color){ 255, 0, 255, 255 } // Magenta -#define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) +#ifdef __cplusplus + // NOTE: MSC C++ compiler does not support compound literals (C99 feature) + #define LIGHTGRAY Color(200, 200, 200, 255) // Light Gray + #define GRAY Color(130, 130, 130, 255) // Gray + #define DARKGRAY Color(80, 80, 80, 255) // Dark Gray + #define YELLOW Color(253, 249, 0, 255) // Yellow + #define GOLD Color(255, 203, 0, 255) // Gold + #define ORANGE Color(255, 161, 0, 255) // Orange + #define PINK Color(255, 109, 194, 255) // Pink + #define RED Color(230, 41, 55, 255) // Red + #define MAROON Color(190, 33, 55, 255) // Maroon + #define GREEN Color(0, 228, 48, 255) // Green + #define LIME Color(0, 158, 47, 255) // Lime + #define DARKGREEN Color(0, 117, 44, 255) // Dark Green + #define SKYBLUE Color(102, 191, 255, 255) // Sky Blue + #define BLUE Color(0, 121, 241, 255) // Blue + #define DARKBLUE Color(0, 82, 172, 255) // Dark Blue + #define PURPLE Color(200, 122, 255, 255) // Purple + #define VIOLET Color(135, 60, 190, 255) // Violet + #define DARKPURPLE Color(112, 31, 126, 255) // Dark Purple + #define BEIGE Color(211, 176, 131, 255) // Beige + #define BROWN Color(127, 106, 79, 255) // Brown + #define DARKBROWN Color(76, 63, 47, 255) // Dark Brown + + #define WHITE Color(255, 255, 255, 255) // White + #define BLACK Color(0, 0, 0, 255) // Black + #define BLANK Color(0, 0, 0, 0) // Blank (Transparent) + #define MAGENTA Color(255, 0, 255, 255) // Magenta + #define RAYWHITE Color(245, 245, 245, 255) // My own White (raylib logo) +#else + #define LIGHTGRAY (Color){ 200, 200, 200, 255 } // Light Gray + #define GRAY (Color){ 130, 130, 130, 255 } // Gray + #define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray + #define YELLOW (Color){ 253, 249, 0, 255 } // Yellow + #define GOLD (Color){ 255, 203, 0, 255 } // Gold + #define ORANGE (Color){ 255, 161, 0, 255 } // Orange + #define PINK (Color){ 255, 109, 194, 255 } // Pink + #define RED (Color){ 230, 41, 55, 255 } // Red + #define MAROON (Color){ 190, 33, 55, 255 } // Maroon + #define GREEN (Color){ 0, 228, 48, 255 } // Green + #define LIME (Color){ 0, 158, 47, 255 } // Lime + #define DARKGREEN (Color){ 0, 117, 44, 255 } // Dark Green + #define SKYBLUE (Color){ 102, 191, 255, 255 } // Sky Blue + #define BLUE (Color){ 0, 121, 241, 255 } // Blue + #define DARKBLUE (Color){ 0, 82, 172, 255 } // Dark Blue + #define PURPLE (Color){ 200, 122, 255, 255 } // Purple + #define VIOLET (Color){ 135, 60, 190, 255 } // Violet + #define DARKPURPLE (Color){ 112, 31, 126, 255 } // Dark Purple + #define BEIGE (Color){ 211, 176, 131, 255 } // Beige + #define BROWN (Color){ 127, 106, 79, 255 } // Brown + #define DARKBROWN (Color){ 76, 63, 47, 255 } // Dark Brown + + #define WHITE (Color){ 255, 255, 255, 255 } // White + #define BLACK (Color){ 0, 0, 0, 255 } // Black + #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) + #define MAGENTA (Color){ 255, 0, 255, 255 } // Magenta + #define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) +#endif //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -308,6 +339,9 @@ typedef struct Color { unsigned char g; unsigned char b; unsigned char a; +#ifdef __cplusplus + Color(unsigned char cr, unsigned char cg, unsigned char cb, unsigned char ca) : r(cr), g(cg), b(cb), a(ca) { } +#endif } Color; // Rectangle type @@ -819,7 +853,8 @@ Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d mod Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) void UnloadModel(Model model); // Unload 3d model from memory -Mesh GenMeshCube(float width, float height, float depth); + +Mesh GenMeshCube(float width, float height, float depth); // Generate mesh: cube Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) -- cgit v1.2.3 From 58d2f70b7e11aadb5eab5f9fa1c081b22a59ef91 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 1 Aug 2016 21:37:45 +0200 Subject: Review audio module and examples --- src/audio.c | 179 +++++++++++++++++++++--------------------------------------- 1 file changed, 63 insertions(+), 116 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 2ff56737..d1c425d5 100644 --- a/src/audio.c +++ b/src/audio.c @@ -86,13 +86,13 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_STREAM_BUFFERS 2 // Number of buffers for each audio stream +#define MAX_STREAM_BUFFERS 2 // Number of buffers for each audio stream // NOTE: Music buffer size is defined by number of samples, independent of sample size // After some math, considering a sampleRate of 48000, a buffer refill rate of 1/60 seconds // and double-buffering system, I concluded that a 4096 samples buffer should be enough -// In case of music-stalls, just inclease this number -#define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. short: 32Kb) +// In case of music-stalls, just increase this number +#define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. short: 32Kb) //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -141,12 +141,12 @@ static Wave LoadWAV(const char *fileName); // Load WAV file static Wave LoadOGG(char *fileName); // Load OGG file static void UnloadWave(Wave wave); // Unload wave data -static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); -static void CloseAudioStream(AudioStream stream); // Frees mix channel -static int BufferAudioStream(AudioStream stream, void *data, int numberElements); // Pushes more audio data into mix channel - static bool BufferMusicStream(Music music, int numBuffersToProcess); // Fill music buffers with data +static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); +static void BufferAudioStream(AudioStream stream, void *data, int numSamples); +static void CloseAudioStream(AudioStream stream); + #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message (INFO, ERROR, WARNING) @@ -492,27 +492,23 @@ Music LoadMusicStream(char *fileName) // Open ogg audio stream music->ctxOgg = stb_vorbis_open_filename(fileName, NULL, NULL); - if (music->ctxOgg == NULL) - { - TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); - } + if (music->ctxOgg == NULL) TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); else { stb_vorbis_info info = stb_vorbis_get_info(music->ctxOgg); // Get Ogg file info - - TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); - TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); - TraceLog(DEBUG, "[%s] Temp memory required: %i", fileName, info.temp_memory_required); + //float totalLengthSeconds = stb_vorbis_stream_length_in_seconds(music->ctxOgg); // TODO: Support 32-bit sampleSize OGGs music->stream = InitAudioStream(info.sample_rate, 16, info.channels); - music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg)*info.channels; music->samplesLeft = music->totalSamples; - //float totalLengthSeconds = stb_vorbis_stream_length_in_seconds(music->ctxOgg); - music->ctxType = MUSIC_AUDIO_OGG; music->loop = true; // We loop by default + + TraceLog(DEBUG, "[%s] OGG sample rate: %i", fileName, info.sample_rate); + TraceLog(DEBUG, "[%s] OGG channels: %i", fileName, info.channels); + TraceLog(DEBUG, "[%s] OGG memory required: %i", fileName, info.temp_memory_required); + } } else if (strcmp(GetExtension(fileName), "xm") == 0) @@ -523,17 +519,15 @@ Music LoadMusicStream(char *fileName) { jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops - music->totalSamples = (unsigned int)jar_xm_get_remaining_samples(music->ctxXm); - music->samplesLeft = music->totalSamples; - - TraceLog(INFO, "[%s] XM number of samples: %i", fileName, music->totalSamples); - TraceLog(INFO, "[%s] XM track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); - // NOTE: Only stereo is supported for XM music->stream = InitAudioStream(48000, 32, 2); - + music->totalSamples = (unsigned int)jar_xm_get_remaining_samples(music->ctxXm); + music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_MODULE_XM; music->loop = true; + + TraceLog(DEBUG, "[%s] XM number of samples: %i", fileName, music->totalSamples); + TraceLog(DEBUG, "[%s] XM track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); } else TraceLog(WARNING, "[%s] XM file could not be opened", fileName); } @@ -543,16 +537,14 @@ Music LoadMusicStream(char *fileName) if (jar_mod_load_file(&music->ctxMod, fileName)) { + music->stream = InitAudioStream(48000, 16, 2); music->totalSamples = (unsigned int)jar_mod_max_samples(&music->ctxMod); music->samplesLeft = music->totalSamples; + music->ctxType = MUSIC_MODULE_MOD; + music->loop = true; TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, music->samplesLeft); TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); - - music->stream = InitAudioStream(48000, 16, 2); - - music->ctxType = MUSIC_MODULE_MOD; - music->loop = true; } else TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); } @@ -799,42 +791,18 @@ static void CloseAudioStream(AudioStream stream) } // Push more audio data into audio stream, only one buffer per call -// NOTE: Returns number of samples that were processed -static int BufferAudioStream(AudioStream stream, void *data, int numberElements) -{ - if (!data || !numberElements) - { - // Pauses audio until data is given - alSourcePause(stream.source); - return 0; - } - +static void BufferAudioStream(AudioStream stream, void *data, int numSamples) +{ ALuint buffer = 0; alSourceUnqueueBuffers(stream.source, 1, &buffer); - if (!buffer) return 0; - - // Reference - //void alBufferData(ALuint bufferName, ALenum format, const ALvoid *data, ALsizei size, ALsizei frequency); - - // ALuint bufferName: buffer id - // ALenum format: Valid formats are - // AL_FORMAT_MONO8, // unsigned char - // AL_FORMAT_MONO16, // short - // AL_FORMAT_STEREO8, - // AL_FORMAT_STEREO16 // stereo data is interleaved: left+right channels sample - // AL_FORMAT_MONO_FLOAT32 (extension) - // AL_FORMAT_STEREO_FLOAT32 (extension) - // ALsizei size: Number of bytes, must be coherent with format - // ALsizei frequency: sample rate - - if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numberElements*sizeof(unsigned char), stream.sampleRate); - else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numberElements*sizeof(short), stream.sampleRate); - else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numberElements*sizeof(float), stream.sampleRate); + //TraceLog(DEBUG, "Buffer to refill: %i", buffer); - alSourceQueueBuffers(stream.source, 1, &buffer); + if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numSamples*sizeof(unsigned char), stream.sampleRate); + else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numSamples*sizeof(short), stream.sampleRate); + else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numSamples*sizeof(float), stream.sampleRate); - return numberElements; + alSourceQueueBuffers(stream.source, 1, &buffer); } // Fill music buffers with new data from music stream @@ -845,70 +813,49 @@ static bool BufferMusicStream(Music music, int numBuffersToProcess) int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts bool active = true; // We can get more data from stream (not finished) - - if (music->ctxType == MUSIC_MODULE_XM) // There is no end of stream for xmfiles, once the end is reached zeros are generated for non looped chiptunes. + + for (int i = 0; i < numBuffersToProcess; i++) { - for (int i = 0; i < numBuffersToProcess; i++) - { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE/2; - else size = music->samplesLeft/2; - - // Read 2*shorts and moves them to buffer+size memory location - jar_xm_generate_samples(music->ctxXm, pcmf, size); - - BufferAudioStream(music->stream, pcmf, size*2); - - music->samplesLeft -= size; + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE; + else size = music->samplesLeft; - if (music->samplesLeft <= 0) - { - active = false; - break; - } - } - } - else if (music->ctxType == MUSIC_MODULE_MOD) - { - for (int i = 0; i < numBuffersToProcess; i++) + switch (music->ctxType) { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE/2; - else size = music->samplesLeft/2; - - jar_mod_fillbuffer(&music->ctxMod, pcm, size, 0); - - BufferAudioStream(music->stream, pcm, size*2); - - music->samplesLeft -= size; - - if (music->samplesLeft <= 0) + case MUSIC_AUDIO_OGG: { - active = false; - break; - } + // NOTE: Returns the number of samples to process (should be the same as size) + int numSamples = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, size); + + BufferAudioStream(music->stream, pcm, numSamples*music->stream.channels); + music->samplesLeft -= (numSamples*music->stream.channels); + + } break; + case MUSIC_MODULE_XM: + { + // NOTE: Output buffer is 2*numsamples elements (left and right value for each sample) + jar_xm_generate_samples(music->ctxXm, pcmf, size/2); + BufferAudioStream(music->stream, pcmf, size); // Using 32bit PCM data + music->samplesLeft -= (size/2); + + } break; + case MUSIC_MODULE_MOD: + { + // NOTE: Output buffer size is nbsample*channels (default: 48000Hz, 16bit, Stereo) + jar_mod_fillbuffer(&music->ctxMod, pcm, size/2, 0); + BufferAudioStream(music->stream, pcm, size); + music->samplesLeft -= (size/2); + + } break; + default: break; } - } - else if (music->ctxType == MUSIC_AUDIO_OGG) - { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE; - else size = music->samplesLeft; - for (int i = 0; i < numBuffersToProcess; i++) + if (music->samplesLeft <= 0) { - // NOTE: Returns the number of samples stored per channel - int numSamples = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, size); - - BufferAudioStream(music->stream, pcm, numSamples*music->stream.channels); - - music->samplesLeft -= (numSamples*music->stream.channels); - - if (music->samplesLeft <= 0) - { - active = false; - break; - } + active = false; + break; } } - + return active; } -- cgit v1.2.3 From 68d647c1af1b9f0479f680dbd7c4f93586cd51a2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 2 Aug 2016 17:32:24 +0200 Subject: Complete review and update Simplified module for Music and AudioStream Added support for raw audio streaming (with example) --- src/audio.c | 230 +++++++++++++++++++++++++++++++---------------------------- src/audio.h | 27 ++++++- src/raylib.h | 29 +++++++- 3 files changed, 170 insertions(+), 116 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index d1c425d5..befed61c 100644 --- a/src/audio.c +++ b/src/audio.c @@ -100,17 +100,6 @@ typedef enum { MUSIC_AUDIO_OGG = 0, MUSIC_MODULE_XM, MUSIC_MODULE_MOD } MusicContextType; -// Used to create custom audio streams that are not bound to a specific file. -typedef struct AudioStream { - unsigned int sampleRate; // Frequency (samples per second): default is 48000 - unsigned int sampleSize; // BitDepth (bits per sample): 8, 16, 32 (24 not supported) - unsigned int channels; // Number of channels - - ALenum format; // OpenAL format specifier - ALuint source; // OpenAL source - ALuint buffers[MAX_STREAM_BUFFERS]; // OpenAL buffers (double buffering) -} AudioStream; - // Music type (file streaming from memory) typedef struct Music { MusicContextType ctxType; // Type of music context (OGG, XM, MOD) @@ -118,7 +107,7 @@ typedef struct Music { jar_xm_context_t *ctxXm; // XM chiptune context jar_mod_context_t ctxMod; // MOD chiptune context - AudioStream stream; // Audio stream + AudioStream stream; // Audio stream (double buffering) bool loop; // Repeat music after finish (loop) unsigned int totalSamples; // Total number of samples @@ -141,12 +130,6 @@ static Wave LoadWAV(const char *fileName); // Load WAV file static Wave LoadOGG(char *fileName); // Load OGG file static void UnloadWave(Wave wave); // Unload wave data -static bool BufferMusicStream(Music music, int numBuffersToProcess); // Fill music buffers with data - -static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); -static void BufferAudioStream(AudioStream stream, void *data, int numSamples); -static void CloseAudioStream(AudioStream stream); - #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message (INFO, ERROR, WARNING) @@ -595,33 +578,89 @@ void StopMusicStream(Music music) // Update (re-fill) music buffers if data already processed void UpdateMusicStream(Music music) { - ALenum state; - bool active = true; ALint processed = 0; // Determine if music stream is ready to be written alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - + + int numBuffersToProcess = processed; + if (processed > 0) { - active = BufferMusicStream(music, processed); + bool active = true; + short pcm[AUDIO_BUFFER_SIZE]; + float pcmf[AUDIO_BUFFER_SIZE]; + + int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, + // individual L or R for ogg shorts + + for (int i = 0; i < numBuffersToProcess; i++) + { + switch (music->ctxType) + { + case MUSIC_AUDIO_OGG: + { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; + else numSamples = music->samplesLeft; + + // NOTE: Returns the number of samples to process (should be the same as numSamples -> it is) + int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, numSamples); + + // TODO: Review stereo channels Ogg, not enough samples served! + UpdateAudioStream(music->stream, pcm, numSamples*music->stream.channels); + music->samplesLeft -= (numSamples*music->stream.channels); + + } break; + case MUSIC_MODULE_XM: + { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; + else numSamples = music->samplesLeft; + + // NOTE: Output buffer is 2*numsamples elements (left and right value for each sample) + jar_xm_generate_samples(music->ctxXm, pcmf, numSamples); + UpdateAudioStream(music->stream, pcmf, numSamples*2); // Using 32bit PCM data + music->samplesLeft -= numSamples; + + //TraceLog(INFO, "Samples left: %i", music->samplesLeft); + + } break; + case MUSIC_MODULE_MOD: + { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; + else numSamples = music->samplesLeft; + + // NOTE: Output buffer size is nbsample*channels (default: 48000Hz, 16bit, Stereo) + jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); + UpdateAudioStream(music->stream, pcm, numSamples*2); + music->samplesLeft -= numSamples; + + } break; + default: break; + } + if (music->samplesLeft <= 0) + { + active = false; + break; + } + } + + // Reset audio stream for looping if (!active && music->loop) { // Restart music context (if required) + //if (music->ctxType == MUSIC_MODULE_XM) if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_seek_start(&music->ctxMod); else if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_seek_start(music->ctxOgg); + // Reset samples left to total samples music->samplesLeft = music->totalSamples; - - // Determine if music stream is ready to be written - alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - - active = BufferMusicStream(music, processed); } - if (alGetError() != AL_NO_ERROR) TraceLog(WARNING, "Error buffering data..."); + // This error is registered when UpdateAudioStream() fails + if (alGetError() == AL_INVALID_VALUE) TraceLog(WARNING, "OpenAL: Error buffering data..."); + ALenum state; alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); if (state != AL_PLAYING && active) alSourcePlay(music->stream.source); @@ -668,36 +707,14 @@ float GetMusicTimePlayed(Music music) { float secondsPlayed = 0.0f; - if (music->ctxType == MUSIC_MODULE_XM) - { - uint64_t samplesPlayed; - jar_xm_get_position(music->ctxXm, NULL, NULL, NULL, &samplesPlayed); - - // TODO: Not sure if this is the correct value - secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); - } - else if (music->ctxType == MUSIC_MODULE_MOD) - { - long samplesPlayed = jar_mod_current_samples(&music->ctxMod); - - secondsPlayed = (float)samplesPlayed/music->stream.sampleRate; - } - else if (music->ctxType == MUSIC_AUDIO_OGG) - { - unsigned int samplesPlayed = music->totalSamples - music->samplesLeft; - - secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); - } + unsigned int samplesPlayed = music->totalSamples - music->samplesLeft; + secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); return secondsPlayed; } -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - // Init audio stream (to stream audio pcm data) -static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) +AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) { AudioStream stream = { 0 }; @@ -735,7 +752,7 @@ static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleS alSource3f(stream.source, AL_POSITION, 0, 0, 0); alSource3f(stream.source, AL_VELOCITY, 0, 0, 0); - // Create Buffers + // Create Buffers (double buffering) alGenBuffers(MAX_STREAM_BUFFERS, stream.buffers); // Initialize buffer with zeros by default @@ -766,7 +783,7 @@ static AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleS } // Close audio stream and free memory -static void CloseAudioStream(AudioStream stream) +void CloseAudioStream(AudioStream stream) { // Stop playing channel alSourceStop(stream.source); @@ -790,75 +807,66 @@ static void CloseAudioStream(AudioStream stream) TraceLog(INFO, "[AUD ID %i] Unloaded audio stream data", stream.source); } -// Push more audio data into audio stream, only one buffer per call -static void BufferAudioStream(AudioStream stream, void *data, int numSamples) -{ +// Update audio stream buffers with data +// NOTE: Only one buffer per call +void UpdateAudioStream(AudioStream stream, void *data, int numSamples) +{ ALuint buffer = 0; alSourceUnqueueBuffers(stream.source, 1, &buffer); - //TraceLog(DEBUG, "Buffer to refill: %i", buffer); + // Check if any buffer was available for unqueue + if (alGetError() != AL_INVALID_VALUE) + { + if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numSamples*sizeof(unsigned char), stream.sampleRate); + else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numSamples*sizeof(short), stream.sampleRate); + else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numSamples*sizeof(float), stream.sampleRate); + + alSourceQueueBuffers(stream.source, 1, &buffer); + } +} + +// Check if any audio stream buffers requires refill +bool IsAudioBufferProcessed(AudioStream stream) +{ + ALint processed = 0; - if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numSamples*sizeof(unsigned char), stream.sampleRate); - else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numSamples*sizeof(short), stream.sampleRate); - else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numSamples*sizeof(float), stream.sampleRate); + // Determine if music stream is ready to be written + alGetSourcei(stream.source, AL_BUFFERS_PROCESSED, &processed); - alSourceQueueBuffers(stream.source, 1, &buffer); + return (processed > 0); } -// Fill music buffers with new data from music stream -static bool BufferMusicStream(Music music, int numBuffersToProcess) +// Play audio stream +void PlayAudioStream(AudioStream stream) { - short pcm[AUDIO_BUFFER_SIZE]; - float pcmf[AUDIO_BUFFER_SIZE]; + alSourcePlay(stream.source); +} - int size = 0; // Total size of data steamed in L+R samples for xm floats, individual L or R for ogg shorts - bool active = true; // We can get more data from stream (not finished) - - for (int i = 0; i < numBuffersToProcess; i++) - { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) size = AUDIO_BUFFER_SIZE; - else size = music->samplesLeft; +// Play audio stream +void PauseAudioStream(AudioStream stream) +{ + alSourcePause(stream.source); +} - switch (music->ctxType) - { - case MUSIC_AUDIO_OGG: - { - // NOTE: Returns the number of samples to process (should be the same as size) - int numSamples = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, size); - - BufferAudioStream(music->stream, pcm, numSamples*music->stream.channels); - music->samplesLeft -= (numSamples*music->stream.channels); - - } break; - case MUSIC_MODULE_XM: - { - // NOTE: Output buffer is 2*numsamples elements (left and right value for each sample) - jar_xm_generate_samples(music->ctxXm, pcmf, size/2); - BufferAudioStream(music->stream, pcmf, size); // Using 32bit PCM data - music->samplesLeft -= (size/2); - - } break; - case MUSIC_MODULE_MOD: - { - // NOTE: Output buffer size is nbsample*channels (default: 48000Hz, 16bit, Stereo) - jar_mod_fillbuffer(&music->ctxMod, pcm, size/2, 0); - BufferAudioStream(music->stream, pcm, size); - music->samplesLeft -= (size/2); - - } break; - default: break; - } +// Resume audio stream playing +void ResumeAudioStream(AudioStream stream) +{ + ALenum state; + alGetSourcei(stream.source, AL_SOURCE_STATE, &state); - if (music->samplesLeft <= 0) - { - active = false; - break; - } - } - - return active; + if (state == AL_PAUSED) alSourcePlay(stream.source); } +// Stop audio stream +void StopAudioStream(AudioStream stream) +{ + alSourceStop(stream.source); +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + // Load WAV file into Wave structure static Wave LoadWAV(const char *fileName) { diff --git a/src/audio.h b/src/audio.h index c9171339..dbd88939 100644 --- a/src/audio.h +++ b/src/audio.h @@ -76,9 +76,21 @@ typedef struct Wave { } Wave; // Music type (file streaming from memory) -// NOTE: Anything longer than ~10 seconds should be streamed into a mix channel... +// NOTE: Anything longer than ~10 seconds should be streamed typedef struct Music *Music; +// Audio stream type +// NOTE: Useful to create custom audio streams not bound to a specific file +typedef struct AudioStream { + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) + + int format; // OpenAL audio format specifier + unsigned int source; // OpenAL audio source id + unsigned int buffers[2]; // OpenAL audio buffers (double buffering) +} AudioStream; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -93,7 +105,7 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool IsAudioDeviceReady(void); // Check if device has been initialized successfully +bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data @@ -120,6 +132,17 @@ void SetMusicPitch(Music music, float pitch); // Set pitch for float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) +AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, + unsigned int channels); // Init audio stream (to stream audio pcm data) +void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +void PlayAudioStream(AudioStream stream); // Play audio stream +void PauseAudioStream(AudioStream stream); // Pause audio stream +void ResumeAudioStream(AudioStream stream); // Resume audio stream +void StopAudioStream(AudioStream stream); // Stop audio stream + #ifdef __cplusplus } #endif diff --git a/src/raylib.h b/src/raylib.h index 4b9f6ca0..3ee7a793 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -499,8 +499,8 @@ typedef struct Ray { // Sound source type typedef struct Sound { - unsigned int source; // Sound audio source id - unsigned int buffer; // Sound audio buffer id + unsigned int source; // OpenAL audio source id + unsigned int buffer; // OpenAL audio buffer id } Sound; // Wave type, defines audio wave data @@ -516,6 +516,18 @@ typedef struct Wave { // NOTE: Anything longer than ~10 seconds should be streamed typedef struct Music *Music; +// Audio stream type +// NOTE: Useful to create custom audio streams not bound to a specific file +typedef struct AudioStream { + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) + + int format; // OpenAL audio format specifier + unsigned int source; // OpenAL audio source id + unsigned int buffers[2]; // OpenAL audio buffers (double buffering) +} AudioStream; + // Texture formats // NOTE: Support depends on OpenGL version and platform typedef enum { @@ -923,7 +935,7 @@ void ToggleVrMode(void); // Enable/Disable VR experience (dev //------------------------------------------------------------------------------------ void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool IsAudioDeviceReady(void); // True if call to InitAudioDevice() was successful and CloseAudioDevice() has not been called yet +bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data @@ -950,6 +962,17 @@ void SetMusicPitch(Music music, float pitch); // Set pitch for float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) +AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, + unsigned int channels); // Init audio stream (to stream audio pcm data) +void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +void PlayAudioStream(AudioStream stream); // Play audio stream +void PauseAudioStream(AudioStream stream); // Pause audio stream +void ResumeAudioStream(AudioStream stream); // Resume audio stream +void StopAudioStream(AudioStream stream); // Stop audio stream + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 8c0bd30fcb62550f71237cce73fc80efacbf8909 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 2 Aug 2016 19:09:07 +0200 Subject: Corrected issue with Music type --- src/audio.c | 2 +- src/raylib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index befed61c..0896e4ca 100644 --- a/src/audio.c +++ b/src/audio.c @@ -101,7 +101,7 @@ typedef enum { MUSIC_AUDIO_OGG = 0, MUSIC_MODULE_XM, MUSIC_MODULE_MOD } MusicContextType; // Music type (file streaming from memory) -typedef struct Music { +typedef struct MusicData { MusicContextType ctxType; // Type of music context (OGG, XM, MOD) stb_vorbis *ctxOgg; // OGG audio context jar_xm_context_t *ctxXm; // XM chiptune context diff --git a/src/raylib.h b/src/raylib.h index 3ee7a793..d9a12cec 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -514,7 +514,7 @@ typedef struct Wave { // Music type (file streaming from memory) // NOTE: Anything longer than ~10 seconds should be streamed -typedef struct Music *Music; +typedef struct MusicData *Music; // Audio stream type // NOTE: Useful to create custom audio streams not bound to a specific file -- cgit v1.2.3 From 735968e68543bb5141122f181608d0d7ada9a3be Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 3 Aug 2016 21:38:21 +0200 Subject: [rlua] new module: raylib Lua binding --- src/external/lua/include/lauxlib.h | 256 +++ src/external/lua/include/lua.h | 486 +++++ src/external/lua/include/lua.hpp | 9 + src/external/lua/include/luaconf.h | 769 ++++++++ src/external/lua/include/lualib.h | 58 + src/external/lua/lib/liblua53.a | Bin 0 -> 322424 bytes src/external/lua/lib/liblua53dll.a | Bin 0 -> 91416 bytes src/rlua.h | 3631 ++++++++++++++++++++++++++++++++++++ 8 files changed, 5209 insertions(+) create mode 100644 src/external/lua/include/lauxlib.h create mode 100644 src/external/lua/include/lua.h create mode 100644 src/external/lua/include/lua.hpp create mode 100644 src/external/lua/include/luaconf.h create mode 100644 src/external/lua/include/lualib.h create mode 100644 src/external/lua/lib/liblua53.a create mode 100644 src/external/lua/lib/liblua53dll.a create mode 100644 src/rlua.h (limited to 'src') diff --git a/src/external/lua/include/lauxlib.h b/src/external/lua/include/lauxlib.h new file mode 100644 index 00000000..ddb7c228 --- /dev/null +++ b/src/external/lua/include/lauxlib.h @@ -0,0 +1,256 @@ +/* +** $Id: lauxlib.h,v 1.129 2015/11/23 11:29:43 roberto Exp $ +** Auxiliary functions for building Lua libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lauxlib_h +#define lauxlib_h + + +#include +#include + +#include "lua.h" + + + +/* extra error code for 'luaL_load' */ +#define LUA_ERRFILE (LUA_ERRERR+1) + + +typedef struct luaL_Reg { + const char *name; + lua_CFunction func; +} luaL_Reg; + + +#define LUAL_NUMSIZES (sizeof(lua_Integer)*16 + sizeof(lua_Number)) + +LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver, size_t sz); +#define luaL_checkversion(L) \ + luaL_checkversion_(L, LUA_VERSION_NUM, LUAL_NUMSIZES) + +LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); +LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); +LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len); +LUALIB_API int (luaL_argerror) (lua_State *L, int arg, const char *extramsg); +LUALIB_API const char *(luaL_checklstring) (lua_State *L, int arg, + size_t *l); +LUALIB_API const char *(luaL_optlstring) (lua_State *L, int arg, + const char *def, size_t *l); +LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int arg); +LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int arg, lua_Number def); + +LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int arg); +LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int arg, + lua_Integer def); + +LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); +LUALIB_API void (luaL_checktype) (lua_State *L, int arg, int t); +LUALIB_API void (luaL_checkany) (lua_State *L, int arg); + +LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); +LUALIB_API void (luaL_setmetatable) (lua_State *L, const char *tname); +LUALIB_API void *(luaL_testudata) (lua_State *L, int ud, const char *tname); +LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); + +LUALIB_API void (luaL_where) (lua_State *L, int lvl); +LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); + +LUALIB_API int (luaL_checkoption) (lua_State *L, int arg, const char *def, + const char *const lst[]); + +LUALIB_API int (luaL_fileresult) (lua_State *L, int stat, const char *fname); +LUALIB_API int (luaL_execresult) (lua_State *L, int stat); + +/* predefined references */ +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + +LUALIB_API int (luaL_ref) (lua_State *L, int t); +LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); + +LUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename, + const char *mode); + +#define luaL_loadfile(L,f) luaL_loadfilex(L,f,NULL) + +LUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, + const char *name, const char *mode); +LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); + +LUALIB_API lua_State *(luaL_newstate) (void); + +LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx); + +LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, + const char *r); + +LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup); + +LUALIB_API int (luaL_getsubtable) (lua_State *L, int idx, const char *fname); + +LUALIB_API void (luaL_traceback) (lua_State *L, lua_State *L1, + const char *msg, int level); + +LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname, + lua_CFunction openf, int glb); + +/* +** =============================================================== +** some useful macros +** =============================================================== +*/ + + +#define luaL_newlibtable(L,l) \ + lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1) + +#define luaL_newlib(L,l) \ + (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) + +#define luaL_argcheck(L, cond,arg,extramsg) \ + ((void)((cond) || luaL_argerror(L, (arg), (extramsg)))) +#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) +#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) + +#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) + +#define luaL_dofile(L, fn) \ + (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_dostring(L, s) \ + (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) + +#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) + +#define luaL_loadbuffer(L,s,sz,n) luaL_loadbufferx(L,s,sz,n,NULL) + + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + +typedef struct luaL_Buffer { + char *b; /* buffer address */ + size_t size; /* buffer size */ + size_t n; /* number of characters in buffer */ + lua_State *L; + char initb[LUAL_BUFFERSIZE]; /* initial buffer */ +} luaL_Buffer; + + +#define luaL_addchar(B,c) \ + ((void)((B)->n < (B)->size || luaL_prepbuffsize((B), 1)), \ + ((B)->b[(B)->n++] = (c))) + +#define luaL_addsize(B,s) ((B)->n += (s)) + +LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); +LUALIB_API char *(luaL_prepbuffsize) (luaL_Buffer *B, size_t sz); +LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); +LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); +LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); +LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); +LUALIB_API void (luaL_pushresultsize) (luaL_Buffer *B, size_t sz); +LUALIB_API char *(luaL_buffinitsize) (lua_State *L, luaL_Buffer *B, size_t sz); + +#define luaL_prepbuffer(B) luaL_prepbuffsize(B, LUAL_BUFFERSIZE) + +/* }====================================================== */ + + + +/* +** {====================================================== +** File handles for IO library +** ======================================================= +*/ + +/* +** A file handle is a userdata with metatable 'LUA_FILEHANDLE' and +** initial structure 'luaL_Stream' (it may contain other fields +** after that initial structure). +*/ + +#define LUA_FILEHANDLE "FILE*" + + +typedef struct luaL_Stream { + FILE *f; /* stream (NULL for incompletely created streams) */ + lua_CFunction closef; /* to close stream (NULL for closed streams) */ +} luaL_Stream; + +/* }====================================================== */ + + + +/* compatibility with old module system */ +#if defined(LUA_COMPAT_MODULE) + +LUALIB_API void (luaL_pushmodule) (lua_State *L, const char *modname, + int sizehint); +LUALIB_API void (luaL_openlib) (lua_State *L, const char *libname, + const luaL_Reg *l, int nup); + +#define luaL_register(L,n,l) (luaL_openlib(L,(n),(l),0)) + +#endif + + +/* +** {================================================================== +** "Abstraction Layer" for basic report of messages and errors +** =================================================================== +*/ + +/* print a string */ +#if !defined(lua_writestring) +#define lua_writestring(s,l) fwrite((s), sizeof(char), (l), stdout) +#endif + +/* print a newline and flush the output */ +#if !defined(lua_writeline) +#define lua_writeline() (lua_writestring("\n", 1), fflush(stdout)) +#endif + +/* print an error message */ +#if !defined(lua_writestringerror) +#define lua_writestringerror(s,p) \ + (fprintf(stderr, (s), (p)), fflush(stderr)) +#endif + +/* }================================================================== */ + + +/* +** {============================================================ +** Compatibility with deprecated conversions +** ============================================================= +*/ +#if defined(LUA_COMPAT_APIINTCASTS) + +#define luaL_checkunsigned(L,a) ((lua_Unsigned)luaL_checkinteger(L,a)) +#define luaL_optunsigned(L,a,d) \ + ((lua_Unsigned)luaL_optinteger(L,a,(lua_Integer)(d))) + +#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) +#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) + +#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) +#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) + +#endif +/* }============================================================ */ + + + +#endif + + diff --git a/src/external/lua/include/lua.h b/src/external/lua/include/lua.h new file mode 100644 index 00000000..f78899fc --- /dev/null +++ b/src/external/lua/include/lua.h @@ -0,0 +1,486 @@ +/* +** $Id: lua.h,v 1.331 2016/05/30 15:53:28 roberto Exp $ +** Lua - A Scripting Language +** Lua.org, PUC-Rio, Brazil (http://www.lua.org) +** See Copyright Notice at the end of this file +*/ + + +#ifndef lua_h +#define lua_h + +#include +#include + + +#include "luaconf.h" + + +#define LUA_VERSION_MAJOR "5" +#define LUA_VERSION_MINOR "3" +#define LUA_VERSION_NUM 503 +#define LUA_VERSION_RELEASE "3" + +#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR +#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2016 Lua.org, PUC-Rio" +#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" + + +/* mark for precompiled code ('Lua') */ +#define LUA_SIGNATURE "\x1bLua" + +/* option for multiple returns in 'lua_pcall' and 'lua_call' */ +#define LUA_MULTRET (-1) + + +/* +** Pseudo-indices +** (-LUAI_MAXSTACK is the minimum valid index; we keep some free empty +** space after that to help overflow detection) +*/ +#define LUA_REGISTRYINDEX (-LUAI_MAXSTACK - 1000) +#define lua_upvalueindex(i) (LUA_REGISTRYINDEX - (i)) + + +/* thread status */ +#define LUA_OK 0 +#define LUA_YIELD 1 +#define LUA_ERRRUN 2 +#define LUA_ERRSYNTAX 3 +#define LUA_ERRMEM 4 +#define LUA_ERRGCMM 5 +#define LUA_ERRERR 6 + + +typedef struct lua_State lua_State; + + +/* +** basic types +*/ +#define LUA_TNONE (-1) + +#define LUA_TNIL 0 +#define LUA_TBOOLEAN 1 +#define LUA_TLIGHTUSERDATA 2 +#define LUA_TNUMBER 3 +#define LUA_TSTRING 4 +#define LUA_TTABLE 5 +#define LUA_TFUNCTION 6 +#define LUA_TUSERDATA 7 +#define LUA_TTHREAD 8 + +#define LUA_NUMTAGS 9 + + + +/* minimum Lua stack available to a C function */ +#define LUA_MINSTACK 20 + + +/* predefined values in the registry */ +#define LUA_RIDX_MAINTHREAD 1 +#define LUA_RIDX_GLOBALS 2 +#define LUA_RIDX_LAST LUA_RIDX_GLOBALS + + +/* type of numbers in Lua */ +typedef LUA_NUMBER lua_Number; + + +/* type for integer functions */ +typedef LUA_INTEGER lua_Integer; + +/* unsigned integer type */ +typedef LUA_UNSIGNED lua_Unsigned; + +/* type for continuation-function contexts */ +typedef LUA_KCONTEXT lua_KContext; + + +/* +** Type for C functions registered with Lua +*/ +typedef int (*lua_CFunction) (lua_State *L); + +/* +** Type for continuation functions +*/ +typedef int (*lua_KFunction) (lua_State *L, int status, lua_KContext ctx); + + +/* +** Type for functions that read/write blocks when loading/dumping Lua chunks +*/ +typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); + +typedef int (*lua_Writer) (lua_State *L, const void *p, size_t sz, void *ud); + + +/* +** Type for memory-allocation functions +*/ +typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); + + + +/* +** generic extra include file +*/ +#if defined(LUA_USER_H) +#include LUA_USER_H +#endif + + +/* +** RCS ident string +*/ +extern const char lua_ident[]; + + +/* +** state manipulation +*/ +LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); +LUA_API void (lua_close) (lua_State *L); +LUA_API lua_State *(lua_newthread) (lua_State *L); + +LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); + + +LUA_API const lua_Number *(lua_version) (lua_State *L); + + +/* +** basic stack manipulation +*/ +LUA_API int (lua_absindex) (lua_State *L, int idx); +LUA_API int (lua_gettop) (lua_State *L); +LUA_API void (lua_settop) (lua_State *L, int idx); +LUA_API void (lua_pushvalue) (lua_State *L, int idx); +LUA_API void (lua_rotate) (lua_State *L, int idx, int n); +LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx); +LUA_API int (lua_checkstack) (lua_State *L, int n); + +LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); + + +/* +** access functions (stack -> C) +*/ + +LUA_API int (lua_isnumber) (lua_State *L, int idx); +LUA_API int (lua_isstring) (lua_State *L, int idx); +LUA_API int (lua_iscfunction) (lua_State *L, int idx); +LUA_API int (lua_isinteger) (lua_State *L, int idx); +LUA_API int (lua_isuserdata) (lua_State *L, int idx); +LUA_API int (lua_type) (lua_State *L, int idx); +LUA_API const char *(lua_typename) (lua_State *L, int tp); + +LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); +LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); +LUA_API int (lua_toboolean) (lua_State *L, int idx); +LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); +LUA_API size_t (lua_rawlen) (lua_State *L, int idx); +LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); +LUA_API void *(lua_touserdata) (lua_State *L, int idx); +LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); +LUA_API const void *(lua_topointer) (lua_State *L, int idx); + + +/* +** Comparison and arithmetic functions +*/ + +#define LUA_OPADD 0 /* ORDER TM, ORDER OP */ +#define LUA_OPSUB 1 +#define LUA_OPMUL 2 +#define LUA_OPMOD 3 +#define LUA_OPPOW 4 +#define LUA_OPDIV 5 +#define LUA_OPIDIV 6 +#define LUA_OPBAND 7 +#define LUA_OPBOR 8 +#define LUA_OPBXOR 9 +#define LUA_OPSHL 10 +#define LUA_OPSHR 11 +#define LUA_OPUNM 12 +#define LUA_OPBNOT 13 + +LUA_API void (lua_arith) (lua_State *L, int op); + +#define LUA_OPEQ 0 +#define LUA_OPLT 1 +#define LUA_OPLE 2 + +LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); +LUA_API int (lua_compare) (lua_State *L, int idx1, int idx2, int op); + + +/* +** push functions (C -> stack) +*/ +LUA_API void (lua_pushnil) (lua_State *L); +LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); +LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); +LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len); +LUA_API const char *(lua_pushstring) (lua_State *L, const char *s); +LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, + va_list argp); +LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); +LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); +LUA_API void (lua_pushboolean) (lua_State *L, int b); +LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); +LUA_API int (lua_pushthread) (lua_State *L); + + +/* +** get functions (Lua -> stack) +*/ +LUA_API int (lua_getglobal) (lua_State *L, const char *name); +LUA_API int (lua_gettable) (lua_State *L, int idx); +LUA_API int (lua_getfield) (lua_State *L, int idx, const char *k); +LUA_API int (lua_geti) (lua_State *L, int idx, lua_Integer n); +LUA_API int (lua_rawget) (lua_State *L, int idx); +LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); +LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); + +LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); +LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); +LUA_API int (lua_getmetatable) (lua_State *L, int objindex); +LUA_API int (lua_getuservalue) (lua_State *L, int idx); + + +/* +** set functions (stack -> Lua) +*/ +LUA_API void (lua_setglobal) (lua_State *L, const char *name); +LUA_API void (lua_settable) (lua_State *L, int idx); +LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_seti) (lua_State *L, int idx, lua_Integer n); +LUA_API void (lua_rawset) (lua_State *L, int idx); +LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n); +LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p); +LUA_API int (lua_setmetatable) (lua_State *L, int objindex); +LUA_API void (lua_setuservalue) (lua_State *L, int idx); + + +/* +** 'load' and 'call' functions (load and run Lua code) +*/ +LUA_API void (lua_callk) (lua_State *L, int nargs, int nresults, + lua_KContext ctx, lua_KFunction k); +#define lua_call(L,n,r) lua_callk(L, (n), (r), 0, NULL) + +LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc, + lua_KContext ctx, lua_KFunction k); +#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL) + +LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, + const char *chunkname, const char *mode); + +LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip); + + +/* +** coroutine functions +*/ +LUA_API int (lua_yieldk) (lua_State *L, int nresults, lua_KContext ctx, + lua_KFunction k); +LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg); +LUA_API int (lua_status) (lua_State *L); +LUA_API int (lua_isyieldable) (lua_State *L); + +#define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL) + + +/* +** garbage-collection function and options +*/ + +#define LUA_GCSTOP 0 +#define LUA_GCRESTART 1 +#define LUA_GCCOLLECT 2 +#define LUA_GCCOUNT 3 +#define LUA_GCCOUNTB 4 +#define LUA_GCSTEP 5 +#define LUA_GCSETPAUSE 6 +#define LUA_GCSETSTEPMUL 7 +#define LUA_GCISRUNNING 9 + +LUA_API int (lua_gc) (lua_State *L, int what, int data); + + +/* +** miscellaneous functions +*/ + +LUA_API int (lua_error) (lua_State *L); + +LUA_API int (lua_next) (lua_State *L, int idx); + +LUA_API void (lua_concat) (lua_State *L, int n); +LUA_API void (lua_len) (lua_State *L, int idx); + +LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s); + +LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); +LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); + + + +/* +** {============================================================== +** some useful macros +** =============================================================== +*/ + +#define lua_getextraspace(L) ((void *)((char *)(L) - LUA_EXTRASPACE)) + +#define lua_tonumber(L,i) lua_tonumberx(L,(i),NULL) +#define lua_tointeger(L,i) lua_tointegerx(L,(i),NULL) + +#define lua_pop(L,n) lua_settop(L, -(n)-1) + +#define lua_newtable(L) lua_createtable(L, 0, 0) + +#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) + +#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) + +#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) +#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) +#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) +#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) +#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) +#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) +#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) +#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) + +#define lua_pushliteral(L, s) lua_pushstring(L, "" s) + +#define lua_pushglobaltable(L) \ + ((void)lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS)) + +#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) + + +#define lua_insert(L,idx) lua_rotate(L, (idx), 1) + +#define lua_remove(L,idx) (lua_rotate(L, (idx), -1), lua_pop(L, 1)) + +#define lua_replace(L,idx) (lua_copy(L, -1, (idx)), lua_pop(L, 1)) + +/* }============================================================== */ + + +/* +** {============================================================== +** compatibility macros for unsigned conversions +** =============================================================== +*/ +#if defined(LUA_COMPAT_APIINTCASTS) + +#define lua_pushunsigned(L,n) lua_pushinteger(L, (lua_Integer)(n)) +#define lua_tounsignedx(L,i,is) ((lua_Unsigned)lua_tointegerx(L,i,is)) +#define lua_tounsigned(L,i) lua_tounsignedx(L,(i),NULL) + +#endif +/* }============================================================== */ + +/* +** {====================================================================== +** Debug API +** ======================================================================= +*/ + + +/* +** Event codes +*/ +#define LUA_HOOKCALL 0 +#define LUA_HOOKRET 1 +#define LUA_HOOKLINE 2 +#define LUA_HOOKCOUNT 3 +#define LUA_HOOKTAILCALL 4 + + +/* +** Event masks +*/ +#define LUA_MASKCALL (1 << LUA_HOOKCALL) +#define LUA_MASKRET (1 << LUA_HOOKRET) +#define LUA_MASKLINE (1 << LUA_HOOKLINE) +#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) + +typedef struct lua_Debug lua_Debug; /* activation record */ + + +/* Functions to be called by the debugger in specific events */ +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); + + +LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar); +LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar); +LUA_API const char *(lua_getlocal) (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *(lua_setlocal) (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *(lua_getupvalue) (lua_State *L, int funcindex, int n); +LUA_API const char *(lua_setupvalue) (lua_State *L, int funcindex, int n); + +LUA_API void *(lua_upvalueid) (lua_State *L, int fidx, int n); +LUA_API void (lua_upvaluejoin) (lua_State *L, int fidx1, int n1, + int fidx2, int n2); + +LUA_API void (lua_sethook) (lua_State *L, lua_Hook func, int mask, int count); +LUA_API lua_Hook (lua_gethook) (lua_State *L); +LUA_API int (lua_gethookmask) (lua_State *L); +LUA_API int (lua_gethookcount) (lua_State *L); + + +struct lua_Debug { + int event; + const char *name; /* (n) */ + const char *namewhat; /* (n) 'global', 'local', 'field', 'method' */ + const char *what; /* (S) 'Lua', 'C', 'main', 'tail' */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int linedefined; /* (S) */ + int lastlinedefined; /* (S) */ + unsigned char nups; /* (u) number of upvalues */ + unsigned char nparams;/* (u) number of parameters */ + char isvararg; /* (u) */ + char istailcall; /* (t) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + struct CallInfo *i_ci; /* active function */ +}; + +/* }====================================================================== */ + + +/****************************************************************************** +* Copyright (C) 1994-2016 Lua.org, PUC-Rio. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ + + +#endif diff --git a/src/external/lua/include/lua.hpp b/src/external/lua/include/lua.hpp new file mode 100644 index 00000000..ec417f59 --- /dev/null +++ b/src/external/lua/include/lua.hpp @@ -0,0 +1,9 @@ +// lua.hpp +// Lua header files for C++ +// <> not supplied automatically because Lua also compiles as C++ + +extern "C" { +#include "lua.h" +#include "lualib.h" +#include "lauxlib.h" +} diff --git a/src/external/lua/include/luaconf.h b/src/external/lua/include/luaconf.h new file mode 100644 index 00000000..867e9cb1 --- /dev/null +++ b/src/external/lua/include/luaconf.h @@ -0,0 +1,769 @@ +/* +** $Id: luaconf.h,v 1.255 2016/05/01 20:06:09 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef luaconf_h +#define luaconf_h + +#include +#include + + +/* +** =================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +** {==================================================================== +** System Configuration: macros to adapt (if needed) Lua to some +** particular platform, for instance compiling it with 32-bit numbers or +** restricting it to C89. +** ===================================================================== +*/ + +/* +@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You +** can also define LUA_32BITS in the make file, but changing here you +** ensure that all software connected to Lua will be compiled with the +** same configuration. +*/ +/* #define LUA_32BITS */ + + +/* +@@ LUA_USE_C89 controls the use of non-ISO-C89 features. +** Define it if you want Lua to avoid the use of a few C99 features +** or Windows-specific features on Windows. +*/ +/* #define LUA_USE_C89 */ + + +/* +** By default, Lua on Windows use (some) specific Windows features +*/ +#if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) +#define LUA_USE_WINDOWS /* enable goodies for regular Windows */ +#endif + + +#if defined(LUA_USE_WINDOWS) +#define LUA_DL_DLL /* enable support for DLL */ +#define LUA_USE_C89 /* broadly, Windows is C89 */ +#endif + + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +#define LUA_USE_READLINE /* needs an extra library: -lreadline */ +#endif + + +/* +@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for +** C89 ('long' and 'double'); Windows always has '__int64', so it does +** not need to use this case. +*/ +#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS) +#define LUA_C89_NUMBERS +#endif + + + +/* +@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'. +*/ +/* avoid undefined shifts */ +#if ((INT_MAX >> 15) >> 15) >= 1 +#define LUAI_BITSINT 32 +#else +/* 'int' always must have at least 16 bits */ +#define LUAI_BITSINT 16 +#endif + + +/* +@@ LUA_INT_TYPE defines the type for Lua integers. +@@ LUA_FLOAT_TYPE defines the type for Lua floats. +** Lua should work fine with any mix of these options (if supported +** by your C compiler). The usual configurations are 64-bit integers +** and 'double' (the default), 32-bit integers and 'float' (for +** restricted platforms), and 'long'/'double' (for C compilers not +** compliant with C99, which may not have support for 'long long'). +*/ + +/* predefined options for LUA_INT_TYPE */ +#define LUA_INT_INT 1 +#define LUA_INT_LONG 2 +#define LUA_INT_LONGLONG 3 + +/* predefined options for LUA_FLOAT_TYPE */ +#define LUA_FLOAT_FLOAT 1 +#define LUA_FLOAT_DOUBLE 2 +#define LUA_FLOAT_LONGDOUBLE 3 + +#if defined(LUA_32BITS) /* { */ +/* +** 32-bit integers and 'float' +*/ +#if LUAI_BITSINT >= 32 /* use 'int' if big enough */ +#define LUA_INT_TYPE LUA_INT_INT +#else /* otherwise use 'long' */ +#define LUA_INT_TYPE LUA_INT_LONG +#endif +#define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT + +#elif defined(LUA_C89_NUMBERS) /* }{ */ +/* +** largest types available for C89 ('long' and 'double') +*/ +#define LUA_INT_TYPE LUA_INT_LONG +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE + +#endif /* } */ + + +/* +** default configuration for 64-bit Lua ('long long' and 'double') +*/ +#if !defined(LUA_INT_TYPE) +#define LUA_INT_TYPE LUA_INT_LONGLONG +#endif + +#if !defined(LUA_FLOAT_TYPE) +#define LUA_FLOAT_TYPE LUA_FLOAT_DOUBLE +#endif + +/* }================================================================== */ + + + + +/* +** {================================================================== +** Configuration for Paths. +** =================================================================== +*/ + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +** Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +** C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR +#if defined(_WIN32) /* { */ +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_SHRDIR "!\\..\\share\\lua\\" LUA_VDIR "\\" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua;" \ + LUA_SHRDIR"?.lua;" LUA_SHRDIR"?\\init.lua;" \ + ".\\?.lua;" ".\\?\\init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.dll;" \ + LUA_CDIR"..\\lib\\lua\\" LUA_VDIR "\\?.dll;" \ + LUA_CDIR"loadall.dll;" ".\\?.dll;" \ + LUA_CDIR"?53.dll;" ".\\?53.dll" + +#else /* }{ */ + +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" +#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" +#define LUA_PATH_DEFAULT \ + LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ + "./?.lua;" "./?/init.lua" +#define LUA_CPATH_DEFAULT \ + LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so;" \ + LUA_CDIR"lib?53.so;" "./lib?53.so" +#endif /* } */ + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Marks for exported symbols in the C code +** =================================================================== +*/ + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all auxiliary library functions. +@@ LUAMOD_API is a mark for all standard library opening functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) /* { */ + +#if defined(LUA_CORE) || defined(LUA_LIB) /* { */ +#define LUA_API __declspec(dllexport) +#else /* }{ */ +#define LUA_API __declspec(dllimport) +#endif /* } */ + +#else /* }{ */ + +#define LUA_API extern + +#endif /* } */ + + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API +#define LUAMOD_API LUALIB_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +** exported to outside modules. +@@ LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables +** that are not to be exported to outside modules (LUAI_DDEF for +** definitions and LUAI_DDEC for declarations). +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. Not all elf targets support +** this attribute. Unfortunately, gcc does not offer a way to check +** whether the target offers that support, and those without support +** give a warning about it. To avoid these warnings, change to the +** default definition. +*/ +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) /* { */ +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#else /* }{ */ +#define LUAI_FUNC extern +#endif /* } */ + +#define LUAI_DDEC LUAI_FUNC +#define LUAI_DDEF /* empty */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Compatibility with previous versions +** =================================================================== +*/ + +/* +@@ LUA_COMPAT_5_2 controls other macros for compatibility with Lua 5.2. +@@ LUA_COMPAT_5_1 controls other macros for compatibility with Lua 5.1. +** You can define it to get all options, or change specific options +** to fit your specific needs. +*/ +#if defined(LUA_COMPAT_5_2) /* { */ + +/* +@@ LUA_COMPAT_MATHLIB controls the presence of several deprecated +** functions in the mathematical library. +*/ +#define LUA_COMPAT_MATHLIB + +/* +@@ LUA_COMPAT_BITLIB controls the presence of library 'bit32'. +*/ +#define LUA_COMPAT_BITLIB + +/* +@@ LUA_COMPAT_IPAIRS controls the effectiveness of the __ipairs metamethod. +*/ +#define LUA_COMPAT_IPAIRS + +/* +@@ LUA_COMPAT_APIINTCASTS controls the presence of macros for +** manipulating other integer types (lua_pushunsigned, lua_tounsigned, +** luaL_checkint, luaL_checklong, etc.) +*/ +#define LUA_COMPAT_APIINTCASTS + +#endif /* } */ + + +#if defined(LUA_COMPAT_5_1) /* { */ + +/* Incompatibilities from 5.2 -> 5.3 */ +#define LUA_COMPAT_MATHLIB +#define LUA_COMPAT_APIINTCASTS + +/* +@@ LUA_COMPAT_UNPACK controls the presence of global 'unpack'. +** You can replace it with 'table.unpack'. +*/ +#define LUA_COMPAT_UNPACK + +/* +@@ LUA_COMPAT_LOADERS controls the presence of table 'package.loaders'. +** You can replace it with 'package.searchers'. +*/ +#define LUA_COMPAT_LOADERS + +/* +@@ macro 'lua_cpcall' emulates deprecated function lua_cpcall. +** You can call your C function directly (with light C functions). +*/ +#define lua_cpcall(L,f,u) \ + (lua_pushcfunction(L, (f)), \ + lua_pushlightuserdata(L,(u)), \ + lua_pcall(L,1,0,0)) + + +/* +@@ LUA_COMPAT_LOG10 defines the function 'log10' in the math library. +** You can rewrite 'log10(x)' as 'log(x, 10)'. +*/ +#define LUA_COMPAT_LOG10 + +/* +@@ LUA_COMPAT_LOADSTRING defines the function 'loadstring' in the base +** library. You can rewrite 'loadstring(s)' as 'load(s)'. +*/ +#define LUA_COMPAT_LOADSTRING + +/* +@@ LUA_COMPAT_MAXN defines the function 'maxn' in the table library. +*/ +#define LUA_COMPAT_MAXN + +/* +@@ The following macros supply trivial compatibility for some +** changes in the API. The macros themselves document how to +** change your code to avoid using them. +*/ +#define lua_strlen(L,i) lua_rawlen(L, (i)) + +#define lua_objlen(L,i) lua_rawlen(L, (i)) + +#define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) +#define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) + +/* +@@ LUA_COMPAT_MODULE controls compatibility with previous +** module functions 'module' (Lua) and 'luaL_register' (C). +*/ +#define LUA_COMPAT_MODULE + +#endif /* } */ + + +/* +@@ LUA_COMPAT_FLOATSTRING makes Lua format integral floats without a +@@ a float mark ('.0'). +** This macro is not on by default even in compatibility mode, +** because this is not really an incompatibility. +*/ +/* #define LUA_COMPAT_FLOATSTRING */ + +/* }================================================================== */ + + + +/* +** {================================================================== +** Configuration for Numbers. +** Change these definitions if no predefined LUA_FLOAT_* / LUA_INT_* +** satisfy your needs. +** =================================================================== +*/ + +/* +@@ LUA_NUMBER is the floating-point type used by Lua. +@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' +@@ over a floating number. +@@ l_mathlim(x) corrects limit name 'x' to the proper float type +** by prefixing it with one of FLT/DBL/LDBL. +@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. +@@ LUA_NUMBER_FMT is the format for writing floats. +@@ lua_number2str converts a float to a string. +@@ l_mathop allows the addition of an 'l' or 'f' to all math operations. +@@ l_floor takes the floor of a float. +@@ lua_str2number converts a decimal numeric string to a number. +*/ + + +/* The following definitions are good for most cases here */ + +#define l_floor(x) (l_mathop(floor)(x)) + +#define lua_number2str(s,sz,n) l_sprintf((s), sz, LUA_NUMBER_FMT, (n)) + +/* +@@ lua_numbertointeger converts a float number to an integer, or +** returns 0 if float is not within the range of a lua_Integer. +** (The range comparisons are tricky because of rounding. The tests +** here assume a two-complement representation, where MININTEGER always +** has an exact representation as a float; MAXINTEGER may not have one, +** and therefore its conversion to float may have an ill-defined value.) +*/ +#define lua_numbertointeger(n,p) \ + ((n) >= (LUA_NUMBER)(LUA_MININTEGER) && \ + (n) < -(LUA_NUMBER)(LUA_MININTEGER) && \ + (*(p) = (LUA_INTEGER)(n), 1)) + + +/* now the variable definitions */ + +#if LUA_FLOAT_TYPE == LUA_FLOAT_FLOAT /* { single float */ + +#define LUA_NUMBER float + +#define l_mathlim(n) (FLT_##n) + +#define LUAI_UACNUMBER double + +#define LUA_NUMBER_FRMLEN "" +#define LUA_NUMBER_FMT "%.7g" + +#define l_mathop(op) op##f + +#define lua_str2number(s,p) strtof((s), (p)) + + +#elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ + +#define LUA_NUMBER long double + +#define l_mathlim(n) (LDBL_##n) + +#define LUAI_UACNUMBER long double + +#define LUA_NUMBER_FRMLEN "L" +#define LUA_NUMBER_FMT "%.19Lg" + +#define l_mathop(op) op##l + +#define lua_str2number(s,p) strtold((s), (p)) + +#elif LUA_FLOAT_TYPE == LUA_FLOAT_DOUBLE /* }{ double */ + +#define LUA_NUMBER double + +#define l_mathlim(n) (DBL_##n) + +#define LUAI_UACNUMBER double + +#define LUA_NUMBER_FRMLEN "" +#define LUA_NUMBER_FMT "%.14g" + +#define l_mathop(op) op + +#define lua_str2number(s,p) strtod((s), (p)) + +#else /* }{ */ + +#error "numeric float type not defined" + +#endif /* } */ + + + +/* +@@ LUA_INTEGER is the integer type used by Lua. +** +@@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER. +** +@@ LUAI_UACINT is the result of an 'usual argument conversion' +@@ over a lUA_INTEGER. +@@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers. +@@ LUA_INTEGER_FMT is the format for writing integers. +@@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER. +@@ LUA_MININTEGER is the minimum value for a LUA_INTEGER. +@@ lua_integer2str converts an integer to a string. +*/ + + +/* The following definitions are good for most cases here */ + +#define LUA_INTEGER_FMT "%" LUA_INTEGER_FRMLEN "d" +#define lua_integer2str(s,sz,n) l_sprintf((s), sz, LUA_INTEGER_FMT, (n)) + +#define LUAI_UACINT LUA_INTEGER + +/* +** use LUAI_UACINT here to avoid problems with promotions (which +** can turn a comparison between unsigneds into a signed comparison) +*/ +#define LUA_UNSIGNED unsigned LUAI_UACINT + + +/* now the variable definitions */ + +#if LUA_INT_TYPE == LUA_INT_INT /* { int */ + +#define LUA_INTEGER int +#define LUA_INTEGER_FRMLEN "" + +#define LUA_MAXINTEGER INT_MAX +#define LUA_MININTEGER INT_MIN + +#elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */ + +#define LUA_INTEGER long +#define LUA_INTEGER_FRMLEN "l" + +#define LUA_MAXINTEGER LONG_MAX +#define LUA_MININTEGER LONG_MIN + +#elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */ + +/* use presence of macro LLONG_MAX as proxy for C99 compliance */ +#if defined(LLONG_MAX) /* { */ +/* use ISO C99 stuff */ + +#define LUA_INTEGER long long +#define LUA_INTEGER_FRMLEN "ll" + +#define LUA_MAXINTEGER LLONG_MAX +#define LUA_MININTEGER LLONG_MIN + +#elif defined(LUA_USE_WINDOWS) /* }{ */ +/* in Windows, can use specific Windows types */ + +#define LUA_INTEGER __int64 +#define LUA_INTEGER_FRMLEN "I64" + +#define LUA_MAXINTEGER _I64_MAX +#define LUA_MININTEGER _I64_MIN + +#else /* }{ */ + +#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ + or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" + +#endif /* } */ + +#else /* }{ */ + +#error "numeric integer type not defined" + +#endif /* } */ + +/* }================================================================== */ + + +/* +** {================================================================== +** Dependencies with C99 and other C details +** =================================================================== +*/ + +/* +@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89. +** (All uses in Lua have only one format item.) +*/ +#if !defined(LUA_USE_C89) +#define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i) +#else +#define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i)) +#endif + + +/* +@@ lua_strx2number converts an hexadecimal numeric string to a number. +** In C99, 'strtod' does that conversion. Otherwise, you can +** leave 'lua_strx2number' undefined and Lua will provide its own +** implementation. +*/ +#if !defined(LUA_USE_C89) +#define lua_strx2number(s,p) lua_str2number(s,p) +#endif + + +/* +@@ lua_number2strx converts a float to an hexadecimal numeric string. +** In C99, 'sprintf' (with format specifiers '%a'/'%A') does that. +** Otherwise, you can leave 'lua_number2strx' undefined and Lua will +** provide its own implementation. +*/ +#if !defined(LUA_USE_C89) +#define lua_number2strx(L,b,sz,f,n) ((void)L, l_sprintf(b,sz,f,n)) +#endif + + +/* +** 'strtof' and 'opf' variants for math functions are not valid in +** C89. Otherwise, the macro 'HUGE_VALF' is a good proxy for testing the +** availability of these variants. ('math.h' is already included in +** all files that use these macros.) +*/ +#if defined(LUA_USE_C89) || (defined(HUGE_VAL) && !defined(HUGE_VALF)) +#undef l_mathop /* variants not available */ +#undef lua_str2number +#define l_mathop(op) (lua_Number)op /* no variant */ +#define lua_str2number(s,p) ((lua_Number)strtod((s), (p))) +#endif + + +/* +@@ LUA_KCONTEXT is the type of the context ('ctx') for continuation +** functions. It must be a numerical type; Lua will use 'intptr_t' if +** available, otherwise it will use 'ptrdiff_t' (the nearest thing to +** 'intptr_t' in C89) +*/ +#define LUA_KCONTEXT ptrdiff_t + +#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 199901L +#include +#if defined(INTPTR_MAX) /* even in C99 this type is optional */ +#undef LUA_KCONTEXT +#define LUA_KCONTEXT intptr_t +#endif +#endif + + +/* +@@ lua_getlocaledecpoint gets the locale "radix character" (decimal point). +** Change that if you do not want to use C locales. (Code using this +** macro must include header 'locale.h'.) +*/ +#if !defined(lua_getlocaledecpoint) +#define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Language Variations +** ===================================================================== +*/ + +/* +@@ LUA_NOCVTN2S/LUA_NOCVTS2N control how Lua performs some +** coercions. Define LUA_NOCVTN2S to turn off automatic coercion from +** numbers to strings. Define LUA_NOCVTS2N to turn off automatic +** coercion from strings to numbers. +*/ +/* #define LUA_NOCVTN2S */ +/* #define LUA_NOCVTS2N */ + + +/* +@@ LUA_USE_APICHECK turns on several consistency checks on the C API. +** Define it as a help when debugging C code. +*/ +#if defined(LUA_USE_APICHECK) +#include +#define luai_apicheck(l,e) assert(e) +#endif + +/* }================================================================== */ + + +/* +** {================================================================== +** Macros that affect the API and must be stable (that is, must be the +** same when you compile Lua and when you compile code that links to +** Lua). You probably do not want/need to change them. +** ===================================================================== +*/ + +/* +@@ LUAI_MAXSTACK limits the size of the Lua stack. +** CHANGE it if you need a different limit. This limit is arbitrary; +** its only purpose is to stop Lua from consuming unlimited stack +** space (and to reserve some numbers for pseudo-indices). +*/ +#if LUAI_BITSINT >= 32 +#define LUAI_MAXSTACK 1000000 +#else +#define LUAI_MAXSTACK 15000 +#endif + + +/* +@@ LUA_EXTRASPACE defines the size of a raw memory area associated with +** a Lua state with very fast access. +** CHANGE it if you need a different size. +*/ +#define LUA_EXTRASPACE (sizeof(void *)) + + +/* +@@ LUA_IDSIZE gives the maximum size for the description of the source +@@ of a function in debug information. +** CHANGE it if you want a different size. +*/ +#define LUA_IDSIZE 60 + + +/* +@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +** CHANGE it if it uses too much C-stack space. (For long double, +** 'string.format("%.99f", 1e4932)' needs ~5030 bytes, so a +** smaller buffer would force a memory allocation for each call to +** 'string.format'.) +*/ +#if defined(LUA_FLOAT_LONGDOUBLE) +#define LUAL_BUFFERSIZE 8192 +#else +#define LUAL_BUFFERSIZE ((int)(0x80 * sizeof(void*) * sizeof(lua_Integer))) +#endif + +/* }================================================================== */ + + +/* +@@ LUA_QL describes how error messages quote program elements. +** Lua does not use these macros anymore; they are here for +** compatibility only. +*/ +#define LUA_QL(x) "'" x "'" +#define LUA_QS LUA_QL("%s") + + + + +/* =================================================================== */ + +/* +** Local configuration. You can use this space to add your redefinitions +** without modifying the main part of the file. +*/ + + + + + +#endif + diff --git a/src/external/lua/include/lualib.h b/src/external/lua/include/lualib.h new file mode 100644 index 00000000..5165c0fb --- /dev/null +++ b/src/external/lua/include/lualib.h @@ -0,0 +1,58 @@ +/* +** $Id: lualib.h,v 1.44 2014/02/06 17:32:33 roberto Exp $ +** Lua standard libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lualib_h +#define lualib_h + +#include "lua.h" + + + +LUAMOD_API int (luaopen_base) (lua_State *L); + +#define LUA_COLIBNAME "coroutine" +LUAMOD_API int (luaopen_coroutine) (lua_State *L); + +#define LUA_TABLIBNAME "table" +LUAMOD_API int (luaopen_table) (lua_State *L); + +#define LUA_IOLIBNAME "io" +LUAMOD_API int (luaopen_io) (lua_State *L); + +#define LUA_OSLIBNAME "os" +LUAMOD_API int (luaopen_os) (lua_State *L); + +#define LUA_STRLIBNAME "string" +LUAMOD_API int (luaopen_string) (lua_State *L); + +#define LUA_UTF8LIBNAME "utf8" +LUAMOD_API int (luaopen_utf8) (lua_State *L); + +#define LUA_BITLIBNAME "bit32" +LUAMOD_API int (luaopen_bit32) (lua_State *L); + +#define LUA_MATHLIBNAME "math" +LUAMOD_API int (luaopen_math) (lua_State *L); + +#define LUA_DBLIBNAME "debug" +LUAMOD_API int (luaopen_debug) (lua_State *L); + +#define LUA_LOADLIBNAME "package" +LUAMOD_API int (luaopen_package) (lua_State *L); + + +/* open all previous libraries */ +LUALIB_API void (luaL_openlibs) (lua_State *L); + + + +#if !defined(lua_assert) +#define lua_assert(x) ((void)0) +#endif + + +#endif diff --git a/src/external/lua/lib/liblua53.a b/src/external/lua/lib/liblua53.a new file mode 100644 index 00000000..e51c0c80 Binary files /dev/null and b/src/external/lua/lib/liblua53.a differ diff --git a/src/external/lua/lib/liblua53dll.a b/src/external/lua/lib/liblua53dll.a new file mode 100644 index 00000000..32646db3 Binary files /dev/null and b/src/external/lua/lib/liblua53dll.a differ diff --git a/src/rlua.h b/src/rlua.h new file mode 100644 index 00000000..6a909c43 --- /dev/null +++ b/src/rlua.h @@ -0,0 +1,3631 @@ +/********************************************************************************************** +* +* rlua - raylib Lua bindings +* +* NOTE 01: +* The following types: +* Color, Vector2, Vector3, Rectangle, Ray, Camera +* are treated as objects with named fields, same as in C. +* +* Lua defines utility functions for creating those objects. +* Usage: +* local cl = Color(255,255,255,255) +* local rec = Rectangle(10, 10, 100, 100) +* local ray = Ray(Vector3(20, 20, 20), Vector3(50, 50, 50)) +* local x2 = rec.x + rec.width +* +* The following types: +* Image, Texture2D, SpriteFont +* are immutable, and you can only read their non-pointer arguments (e.g. sprfnt.size). +* +* All other object types are opaque, that is, you cannot access or +* change their fields directly. +* +* Remember that ALL raylib types have REFERENCE SEMANTICS in Lua. +* There is currently no way to create a copy of an opaque object. +* +* NOTE 02: +* Some raylib functions take a pointer to an array, and the size of that array. +* The equivalent Lua functions take only an array table of the specified type UNLESS +* it's a pointer to a large char array (e.g. for images), then it takes (and potentially returns) +* a Lua string (without the size argument, as Lua strings are sized by default). +* +* NOTE 03: +* Some raylib functions take pointers to objects to modify (e.g. ImageToPOT, etc.) +* In Lua, these functions take values and return a new changed value, instead. +* So, in C: +* ImageToPOT(&img, BLACK); +* In Lua becomes: +* img = ImageToPOT(img, BLACK) +* +* Remember that functions can return multiple values, so: +* UpdateCameraPlayer(&cam, &playerPos); +* Vector3 vec = ResolveCollisionCubicmap(img, mapPos, &playerPos, 5.0); +* becomes: +* cam, playerPos = UpdateCameraPlayer(cam, playerPos) +* vec, playerPos = ResolveCollisionCubicmap(img, mapPos, playerPos, 5) +* +* This is to preserve value semantics of raylib objects. +* +* +* This Lua binding for raylib was originally created by Ghassan Al-Mashareqa (ghassan@ghassan.pl) +* for raylib 1.3 and later on reviewed and updated to raylib 1.6 by Ramon Santamaria. +* +* Copyright (c) 2015-2016 Ghassan Al-Mashareqa and Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#pragma once + +#include "raylib.h" + +#define RLUA_STATIC +#ifdef RLUA_STATIC + #define RLUADEF static // Functions just visible to module including this file +#else + #ifdef __cplusplus + #define RLUADEF extern "C" // Functions visible from other files (no name mangling of functions in C++) + #else + #define RLUADEF extern // Functions visible from other files + #endif +#endif + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +// ... + +//---------------------------------------------------------------------------------- +// Module Functions Declaration +//---------------------------------------------------------------------------------- +RLUADEF void InitLuaDevice(void); // Initialize Lua system +RLUADEF void ExecuteLuaCode(const char *code); // Execute raylib Lua code +RLUADEF void ExecuteLuaFile(const char *filename); // Execute raylib Lua script +RLUADEF void CloseLuaDevice(void); // De-initialize Lua system + +/*********************************************************************************** +* +* RLUA IMPLEMENTATION +* +************************************************************************************/ + +#if defined(RLUA_IMPLEMENTATION) + +#include "raylib.h" +#include "utils.h" +#include "raymath.h" + +#include +#include + +#include +#include +#include + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +#define LuaPush_Image(L, img) LuaPushOpaqueTypeWithMetatable(L, img, Image) +#define LuaPush_Texture2D(L, tex) LuaPushOpaqueTypeWithMetatable(L, tex, Texture2D) +#define LuaPush_RenderTexture2D(L, tex) LuaPushOpaqueTypeWithMetatable(L, tex, RenderTexture2D) +#define LuaPush_SpriteFont(L, sf) LuaPushOpaqueTypeWithMetatable(L, sf, SpriteFont) +#define LuaPush_Mesh(L, vd) LuaPushOpaqueType(L, vd) +#define LuaPush_Shader(L, s) LuaPushOpaqueType(L, s) +#define LuaPush_Sound(L, snd) LuaPushOpaqueType(L, snd) +#define LuaPush_Wave(L, wav) LuaPushOpaqueType(L, wav) +#define LuaPush_Music(L, mus) LuaPushOpaqueType(L, mus) + +#define LuaGetArgument_string luaL_checkstring +#define LuaGetArgument_int (int)luaL_checkinteger +#define LuaGetArgument_unsigned (unsigned)luaL_checkinteger +#define LuaGetArgument_char (char)luaL_checkinteger +#define LuaGetArgument_float (float)luaL_checknumber +#define LuaGetArgument_double luaL_checknumber +#define LuaGetArgument_Image(L, img) *(Image*)LuaGetArgumentOpaqueTypeWithMetatable(L, img, "Image") +#define LuaGetArgument_Texture2D(L, tex) *(Texture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, tex, "Texture2D") +#define LuaGetArgument_RenderTexture2D(L, rtex) *(RenderTexture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, rtex, "RenderTexture2D") +#define LuaGetArgument_SpriteFont(L, sf) *(SpriteFont*)LuaGetArgumentOpaqueTypeWithMetatable(L, sf, "SpriteFont") +#define LuaGetArgument_Mesh(L, vd) *(Mesh*)LuaGetArgumentOpaqueType(L, vd) +#define LuaGetArgument_Shader(L, s) *(Shader*)LuaGetArgumentOpaqueType(L, s) +#define LuaGetArgument_Sound(L, snd) *(Sound*)LuaGetArgumentOpaqueType(L, snd) +#define LuaGetArgument_Wave(L, wav) *(Wave*)LuaGetArgumentOpaqueType(L, wav) +#define LuaGetArgument_Music(L, mus) *(Music*)LuaGetArgumentOpaqueType(L, mus) + +#define LuaPushOpaqueType(L, str) LuaPushOpaque(L, &str, sizeof(str)) +#define LuaPushOpaqueTypeWithMetatable(L, str, meta) LuaPushOpaqueWithMetatable(L, &str, sizeof(str), #meta) + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +static lua_State* mainLuaState = 0; +static lua_State* L = 0; + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static void LuaPush_Color(lua_State* L, Color color); +static void LuaPush_Vector2(lua_State* L, Vector2 vec); +static void LuaPush_Vector3(lua_State* L, Vector3 vec); +static void LuaPush_Quaternion(lua_State* L, Quaternion vec); +static void LuaPush_Matrix(lua_State* L, Matrix *matrix); +static void LuaPush_Rectangle(lua_State* L, Rectangle rect); +static void LuaPush_Model(lua_State* L, Model mdl); +static void LuaPush_Ray(lua_State* L, Ray ray); +static void LuaPush_Camera(lua_State* L, Camera cam); + +static Vector2 LuaGetArgument_Vector2(lua_State* L, int index); +static Vector3 LuaGetArgument_Vector3(lua_State* L, int index); +static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index); +static Color LuaGetArgument_Color(lua_State* L, int index); +static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index); +static Camera LuaGetArgument_Camera(lua_State* L, int index); +static Ray LuaGetArgument_Ray(lua_State* L, int index); +static Matrix LuaGetArgument_Matrix(lua_State* L, int index); +static Model LuaGetArgument_Model(lua_State* L, int index); + +//---------------------------------------------------------------------------------- +// rlua Helper Functions +//---------------------------------------------------------------------------------- +static void LuaStartEnum(void) +{ + lua_newtable(L); +} + +static void LuaSetEnum(const char *name, int value) +{ + lua_pushinteger(L, value); + lua_setfield(L, -2, name); +} + +static void LuaSetEnumColor(const char *name, Color color) +{ + LuaPush_Color(L, color); + lua_setfield(L, -2, name); +} + +static void LuaEndEnum(const char *name) +{ + lua_setglobal(L, name); +} + +static void LuaPushOpaque(lua_State* L, void *ptr, size_t size) +{ + void *ud = lua_newuserdata(L, size); + memcpy(ud, ptr, size); +} + +static void LuaPushOpaqueWithMetatable(lua_State* L, void *ptr, size_t size, const char *metatable_name) +{ + void *ud = lua_newuserdata(L, size); + memcpy(ud, ptr, size); + luaL_setmetatable(L, metatable_name); +} + +static void* LuaGetArgumentOpaqueType(lua_State* L, int index) +{ + return lua_touserdata(L, index); +} + +static void* LuaGetArgumentOpaqueTypeWithMetatable(lua_State* L, int index, const char *metatable_name) +{ + return luaL_checkudata(L, index, metatable_name); +} + +//---------------------------------------------------------------------------------- +// LuaIndex* functions +//---------------------------------------------------------------------------------- +static int LuaIndexImage(lua_State* L) +{ + Image img = LuaGetArgument_Image(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "width")) + lua_pushinteger(L, img.width); + else if (!strcmp(key, "height")) + lua_pushinteger(L, img.height); + else if (!strcmp(key, "mipmaps")) + lua_pushinteger(L, img.mipmaps); + else if (!strcmp(key, "format")) + lua_pushinteger(L, img.format); + else + return 0; + return 1; +} + +static int LuaIndexTexture2D(lua_State* L) +{ + Texture2D img = LuaGetArgument_Texture2D(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "width")) + lua_pushinteger(L, img.width); + else if (!strcmp(key, "height")) + lua_pushinteger(L, img.height); + else if (!strcmp(key, "mipmaps")) + lua_pushinteger(L, img.mipmaps); + else if (!strcmp(key, "format")) + lua_pushinteger(L, img.format); + else + return 0; + return 1; +} + +// TODO: RenderTexture2D? + +static int LuaIndexSpriteFont(lua_State* L) +{ + SpriteFont img = LuaGetArgument_SpriteFont(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "size")) + lua_pushinteger(L, img.size); + else if (!strcmp(key, "texture")) + LuaPush_Texture2D(L, img.texture); + else if (!strcmp(key, "numChars")) + lua_pushinteger(L, img.numChars); + else + return 0; + return 1; +} + +static void LuaBuildOpaqueMetatables(void) +{ + luaL_newmetatable(L, "Image"); + lua_pushcfunction(L, &LuaIndexImage); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + + luaL_newmetatable(L, "Texture2D"); + lua_pushcfunction(L, &LuaIndexTexture2D); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + + // TODO? + /* + luaL_newmetatable(L, "RenderTexture2D"); + lua_pushcfunction(L, &LuaIndexRenderTexture2D); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + */ + luaL_newmetatable(L, "SpriteFont"); + lua_pushcfunction(L, &LuaIndexSpriteFont); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); +} + +//---------------------------------------------------------------------------------- +// LuaGetArgument functions +//---------------------------------------------------------------------------------- + +static Vector2 LuaGetArgument_Vector2(lua_State* L, int index) +{ + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector2"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector2"); + float y = (float)lua_tonumber(L, -1); + lua_pop(L, 2); + return (Vector2) { x, y }; +} + +static Vector3 LuaGetArgument_Vector3(lua_State* L, int index) +{ + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector3"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector3"); + float y = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Vector3"); + float z = (float)lua_tonumber(L, -1); + lua_pop(L, 3); + return (Vector3) { x, y, z }; +} + +static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index) +{ + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Quaternion"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Quaternion"); + float y = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Quaternion"); + float z = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "w") == LUA_TNUMBER, index, "Expected Quaternion"); + float w = (float)lua_tonumber(L, -1); + lua_pop(L, 4); + return (Quaternion) { x, y, z, w }; +} + +static Color LuaGetArgument_Color(lua_State* L, int index) +{ + luaL_argcheck(L, lua_getfield(L, index, "r") == LUA_TNUMBER, index, "Expected Color"); + unsigned char r = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "g") == LUA_TNUMBER, index, "Expected Color"); + unsigned char g = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "b") == LUA_TNUMBER, index, "Expected Color"); + unsigned char b = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "a") == LUA_TNUMBER, index, "Expected Color"); + unsigned char a = (unsigned char)lua_tointeger(L, -1); + lua_pop(L, 4); + return (Color) { r, g, b, a }; +} + +static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index) +{ + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Rectangle"); + int x = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Rectangle"); + int y = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "width") == LUA_TNUMBER, index, "Expected Rectangle"); + int w = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "height") == LUA_TNUMBER, index, "Expected Rectangle"); + int h = (int)lua_tointeger(L, -1); + lua_pop(L, 4); + return (Rectangle) { x, y, w, h }; +} + +static Camera LuaGetArgument_Camera(lua_State* L, int index) +{ + Camera result; + luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Camera"); + result.position = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera"); + result.target = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "up") == LUA_TTABLE, index, "Expected Camera"); + result.up = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "fovy") == LUA_TTABLE, index, "Expected Camera"); + result.fovy = LuaGetArgument_float(L, -1); + lua_pop(L, 4); + return result; +} + +static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) +{ + Camera2D result; + luaL_argcheck(L, lua_getfield(L, index, "offset") == LUA_TTABLE, index, "Expected Camera2D"); + result.offset = LuaGetArgument_Vector2(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera2D"); + result.target = LuaGetArgument_Vector2(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TTABLE, index, "Expected Camera2D"); + result.rotation = LuaGetArgument_float(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "zoom") == LUA_TTABLE, index, "Expected Camera2D"); + result.zoom = LuaGetArgument_float(L, -1); + lua_pop(L, 4); + return result; +} + +// TODO: +//BoundingBox +//LightData, *Light +//MusicData *Music; +//AudioStream + +// TODO: Review Mesh, Shader + +static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) +{ + BoundingBox result; + luaL_argcheck(L, lua_getfield(L, index, "min") == LUA_TTABLE, index, "Expected BoundingBox"); + result.min = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "max") == LUA_TTABLE, index, "Expected BoundingBox"); + result.max = LuaGetArgument_Vector3(L, -1); + lua_pop(L, 2); + return result; +} + +static Ray LuaGetArgument_Ray(lua_State* L, int index) +{ + Ray result; + luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Ray"); + result.position = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "direction") == LUA_TTABLE, index, "Expected Ray"); + result.direction = LuaGetArgument_Vector3(L, -1); + lua_pop(L, 2); + return result; +} + +static Matrix LuaGetArgument_Matrix(lua_State* L, int index) +{ + Matrix result = { 0 }; + float* ptr = &result.m0; + for (int i = 0; i < 16; i++) + { + lua_geti(L, -1, i+1); + ptr[i] = luaL_checkinteger(L, -1); + } + lua_pop(L, 16); + return result; +} + +static Material LuaGetArgument_Material(lua_State* L, int index) +{ + Material result; + luaL_argcheck(L, lua_getfield(L, index, "shader") == LUA_TUSERDATA, index, "Expected Material"); + result.shader = LuaGetArgument_Shader(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "texDiffuse") == LUA_TUSERDATA, index, "Expected Material"); + result.texDiffuse = LuaGetArgument_Texture2D(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "texNormal") == LUA_TUSERDATA, index, "Expected Material"); + result.texNormal = LuaGetArgument_Texture2D(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "texSpecular") == LUA_TUSERDATA, index, "Expected Material"); + result.texSpecular = LuaGetArgument_Texture2D(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "colDiffuse") == LUA_TUSERDATA, index, "Expected Material"); + result.colDiffuse = LuaGetArgument_Color(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "colAmbient") == LUA_TUSERDATA, index, "Expected Material"); + result.colAmbient = LuaGetArgument_Color(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "colSpecular") == LUA_TUSERDATA, index, "Expected Material"); + result.colSpecular = LuaGetArgument_Color(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "glossiness") == LUA_TUSERDATA, index, "Expected Material"); + result.glossiness = LuaGetArgument_float(L, -1); + lua_pop(L, 8); + return result; +} + +static Model LuaGetArgument_Model(lua_State* L, int index) +{ + Model result; + luaL_argcheck(L, lua_getfield(L, index, "mesh") == LUA_TUSERDATA, index, "Expected Model"); + result.mesh = LuaGetArgument_Mesh(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "transform") == LUA_TTABLE, index, "Expected Model"); + result.transform = LuaGetArgument_Matrix(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "material") == LUA_TTABLE, index, "Expected Model"); + result.material = LuaGetArgument_Material(L, -1); + lua_pop(L, 3); + return result; +} + +//---------------------------------------------------------------------------------- +// LuaPush functions +//---------------------------------------------------------------------------------- +static void LuaPush_Color(lua_State* L, Color color) +{ + lua_createtable(L, 0, 4); + lua_pushinteger(L, color.r); + lua_setfield(L, -2, "r"); + lua_pushinteger(L, color.g); + lua_setfield(L, -2, "g"); + lua_pushinteger(L, color.b); + lua_setfield(L, -2, "b"); + lua_pushinteger(L, color.a); + lua_setfield(L, -2, "a"); +} + +static void LuaPush_Vector2(lua_State* L, Vector2 vec) +{ + lua_createtable(L, 0, 2); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); +} + +static void LuaPush_Vector3(lua_State* L, Vector3 vec) +{ + lua_createtable(L, 0, 3); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); + lua_pushnumber(L, vec.z); + lua_setfield(L, -2, "z"); +} + +static void LuaPush_Quaternion(lua_State* L, Quaternion vec) +{ + lua_createtable(L, 0, 4); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); + lua_pushnumber(L, vec.z); + lua_setfield(L, -2, "z"); + lua_pushnumber(L, vec.w); + lua_setfield(L, -2, "w"); +} + +static void LuaPush_Matrix(lua_State* L, Matrix *matrix) +{ + int i; + lua_createtable(L, 16, 0); + float* num = (&matrix->m0); + for (i = 0; i < 16; i++) + { + lua_pushnumber(L, num[i]); + lua_rawseti(L, -2, i + 1); + } +} + +static void LuaPush_Rectangle(lua_State* L, Rectangle rect) +{ + lua_createtable(L, 0, 4); + lua_pushinteger(L, rect.x); + lua_setfield(L, -2, "x"); + lua_pushinteger(L, rect.y); + lua_setfield(L, -2, "y"); + lua_pushinteger(L, rect.width); + lua_setfield(L, -2, "width"); + lua_pushinteger(L, rect.height); + lua_setfield(L, -2, "height"); +} + +static void LuaPush_Ray(lua_State* L, Ray ray) +{ + lua_createtable(L, 0, 2); + LuaPush_Vector3(L, ray.position); + lua_setfield(L, -2, "position"); + LuaPush_Vector3(L, ray.direction); + lua_setfield(L, -2, "direction"); +} + +static void LuaPush_BoundingBox(lua_State* L, BoundingBox bb) +{ + lua_createtable(L, 0, 2); + LuaPush_Vector3(L, bb.min); + lua_setfield(L, -2, "min"); + LuaPush_Vector3(L, bb.max); + lua_setfield(L, -2, "max"); +} + +static void LuaPush_Camera(lua_State* L, Camera cam) +{ + lua_createtable(L, 0, 4); + LuaPush_Vector3(L, cam.position); + lua_setfield(L, -2, "position"); + LuaPush_Vector3(L, cam.target); + lua_setfield(L, -2, "target"); + LuaPush_Vector3(L, cam.up); + lua_setfield(L, -2, "up"); + lua_pushnumber(L, cam.fovy); + lua_setfield(L, -2, "fovy"); +} + +static void LuaPush_Camera2D(lua_State* L, Camera2D cam) +{ + lua_createtable(L, 0, 3); + LuaPush_Vector2(L, cam.offset); + lua_setfield(L, -2, "offset"); + LuaPush_Vector2(L, cam.target); + lua_setfield(L, -2, "target"); + lua_pushnumber(L, cam.rotation); + lua_setfield(L, -2, "rotation"); + lua_pushnumber(L, cam.zoom); + lua_setfield(L, -2, "zoom"); +} + +static void LuaPush_Material(lua_State* L, Material mat) +{ + lua_createtable(L, 0, 8); + LuaPush_Shader(L, mat.shader); + lua_setfield(L, -2, "shader"); + LuaPush_Texture2D(L, mat.texDiffuse); + lua_setfield(L, -2, "texDiffuse"); + LuaPush_Texture2D(L, mat.texNormal); + lua_setfield(L, -2, "texNormal"); + LuaPush_Texture2D(L, mat.texSpecular); + lua_setfield(L, -2, "texSpecular"); + LuaPush_Color(L, mat.colDiffuse); + lua_setfield(L, -2, "colDiffuse"); + LuaPush_Color(L, mat.colAmbient); + lua_setfield(L, -2, "colAmbient"); + LuaPush_Color(L, mat.colSpecular); + lua_setfield(L, -2, "colSpecular"); + lua_pushnumber(L, mat.glossiness); + lua_setfield(L, -2, "glossiness"); +} + +static void LuaPush_Model(lua_State* L, Model mdl) +{ + lua_createtable(L, 0, 4); + LuaPush_Mesh(L, mdl.mesh); + lua_setfield(L, -2, "mesh"); + LuaPush_Matrix(L, &mdl.transform); + lua_setfield(L, -2, "transform"); + LuaPush_Material(L, mdl.material); + lua_setfield(L, -2, "material"); +} + +//---------------------------------------------------------------------------------- +// raylib Lua Structure constructors +//---------------------------------------------------------------------------------- +static int lua_Color(lua_State* L) +{ + LuaPush_Color(L, (Color) { (unsigned char)luaL_checkinteger(L, 1), (unsigned char)luaL_checkinteger(L, 2), (unsigned char)luaL_checkinteger(L, 3), (unsigned char)luaL_checkinteger(L, 4) }); + return 1; +} + +static int lua_Vector2(lua_State* L) +{ + LuaPush_Vector2(L, (Vector2) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2) }); + return 1; +} + +static int lua_Vector3(lua_State* L) +{ + LuaPush_Vector3(L, (Vector3) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3) }); + return 1; +} + +static int lua_Rectangle(lua_State* L) +{ + LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); + return 1; +} + +static int lua_Ray(lua_State* L) +{ + Vector2 pos = LuaGetArgument_Vector2(L, 1); + Vector2 dir = LuaGetArgument_Vector2(L, 2); + LuaPush_Ray(L, (Ray) { { pos.x, pos.y }, { dir.x, dir.y } }); + return 1; +} + +static int lua_Camera(lua_State* L) +{ + Vector3 pos = LuaGetArgument_Vector3(L, 1); + Vector3 tar = LuaGetArgument_Vector3(L, 2); + Vector3 up = LuaGetArgument_Vector3(L, 3); + float fovy = LuaGetArgument_float(L, 4); + LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, fovy }); + return 1; +} + +static int lua_Camera2D(lua_State* L) +{ + Vector2 off = LuaGetArgument_Vector2(L, 1); + Vector2 tar = LuaGetArgument_Vector2(L, 2); + float rot = LuaGetArgument_float(L, 3); + float zoom = LuaGetArgument_float(L, 4); + LuaPush_Camera2D(L, (Camera2D) { { off.x, off.y }, { tar.x, tar.y }, rot, zoom }); + return 1; +} + + +/************************************************************************************* +* raylib Lua Functions Bindings +**************************************************************************************/ + +//------------------------------------------------------------------------------------ +// raylib [core] module functions - Window and Graphics Device +//------------------------------------------------------------------------------------ +int lua_InitWindow(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + const char* arg3 = LuaGetArgument_string(L, 3); + InitWindow(arg1, arg2, arg3); + return 0; +} + +int lua_CloseWindow(lua_State* L) +{ + CloseWindow(); + return 0; +} + +int lua_WindowShouldClose(lua_State* L) +{ + bool result = WindowShouldClose(); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsWindowMinimized(lua_State* L) +{ + bool result = IsWindowMinimized(); + lua_pushboolean(L, result); + return 1; +} + +int lua_ToggleFullscreen(lua_State* L) +{ + ToggleFullscreen(); + return 0; +} + +int lua_GetScreenWidth(lua_State* L) +{ + int result = GetScreenWidth(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetScreenHeight(lua_State* L) +{ + int result = GetScreenHeight(); + lua_pushinteger(L, result); + return 1; +} + +int lua_ShowCursor(lua_State* L) +{ + ShowCursor(); + return 0; +} + +int lua_HideCursor(lua_State* L) +{ + HideCursor(); + return 0; +} + +int lua_IsCursorHidden(lua_State* L) +{ + bool result = IsCursorHidden(); + lua_pushboolean(L, result); + return 1; +} + +// TODO: +/* +void EnableCursor(void); // Enables cursor +void DisableCursor(void); // Disables cursor +*/ + +int lua_ClearBackground(lua_State* L) +{ + Color arg1 = LuaGetArgument_Color(L, 1); + ClearBackground(arg1); + return 0; +} + +int lua_BeginDrawing(lua_State* L) +{ + BeginDrawing(); + return 0; +} + +int lua_EndDrawing(lua_State* L) +{ + EndDrawing(); + return 0; +} + +// TODO: +//void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera +//void End2dMode(void); // Ends 2D mode custom camera usage + +int lua_Begin3dMode(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + Begin3dMode(arg1); + return 0; +} + +int lua_End3dMode(lua_State* L) +{ + End3dMode(); + return 0; +} + +// TODO: +//void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing +//void EndTextureMode(void); // Ends drawing to render texture + +int lua_GetMouseRay(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Camera arg2 = LuaGetArgument_Camera(L, 2); + Ray result = GetMouseRay(arg1, arg2); + LuaPush_Ray(L, result); + return 1; +} + +// TODO: +//Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position +//Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) + +#if defined(PLATFORM_WEB) + +static int LuaDrawLoopFunc; + +static void LuaDrawLoop() +{ + lua_rawgeti(L, LUA_REGISTRYINDEX, LuaDrawLoopFunc); + lua_call(L, 0, 0); +} + +int lua_SetDrawingLoop(lua_State* L) +{ + luaL_argcheck(L, lua_isfunction(L, 1), 1, "Loop function expected"); + lua_pushvalue(L, 1); + LuaDrawLoopFunc = luaL_ref(L, LUA_REGISTRYINDEX); + SetDrawingLoop(&LuaDrawLoop); + return 0; +} + +#else + +int lua_SetTargetFPS(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetTargetFPS(arg1); + return 0; +} +#endif + +int lua_GetFPS(lua_State* L) +{ + float result = GetFPS(); + lua_pushnumber(L, result); + return 1; +} + +int lua_GetFrameTime(lua_State* L) +{ + float result = GetFrameTime(); + lua_pushnumber(L, result); + return 1; +} + +int lua_GetColor(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + Color result = GetColor(arg1); + LuaPush_Color(L, result); + return 1; +} + +int lua_GetHexValue(lua_State* L) +{ + Color arg1 = LuaGetArgument_Color(L, 1); + int result = GetHexValue(arg1); + lua_pushinteger(L, result); + return 1; +} + +// TODO: +/* +float *ColorToFloat(Color color); // Converts Color to float array and normalizes +float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array +float *MatrixToFloat(Matrix mat); // Converts Matrix to float array +*/ + +int lua_GetRandomValue(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int result = GetRandomValue(arg1, arg2); + lua_pushinteger(L, result); + return 1; +} + +int lua_Fade(lua_State* L) +{ + Color arg1 = LuaGetArgument_Color(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color result = Fade(arg1, arg2); + LuaPush_Color(L, result); + return 1; +} + +int lua_SetConfigFlags(lua_State* L) +{ + char arg1 = LuaGetArgument_char(L, 1); + SetConfigFlags(arg1); + return 0; +} + +int lua_ShowLogo(lua_State* L) +{ + ShowLogo(); + return 0; +} + +int lua_IsFileDropped(lua_State* L) +{ + bool result = IsFileDropped(); + lua_pushboolean(L, result); + return 1; +} +/* +int lua_*GetDroppedFiles(lua_State* L) +{ + int * arg1 = LuaGetArgument_int *(L, 1); + //char * result = *GetDroppedFiles(arg1); + LuaPush_//char *(L, result); + return 1; +} +*/ +int lua_ClearDroppedFiles(lua_State* L) +{ + ClearDroppedFiles(); + return 0; +} + +int lua_StorageSaveValue(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + StorageSaveValue(arg1, arg2); + return 0; +} + +int lua_StorageLoadValue(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int result = StorageLoadValue(arg1); + lua_pushinteger(L, result); + return 1; +} + +//------------------------------------------------------------------------------------ +// raylib [core] module functions - Input Handling +//------------------------------------------------------------------------------------ +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) +int lua_IsKeyPressed(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyPressed(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsKeyDown(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyDown(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsKeyReleased(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyReleased(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsKeyUp(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyUp(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_GetKeyPressed(lua_State* L) +{ + int result = GetKeyPressed(); + lua_pushinteger(L, result); + return 1; +} + +int lua_SetExitKey(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetExitKey(arg1); + return 0; +} + +int lua_IsGamepadAvailable(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsGamepadAvailable(arg1); + lua_pushboolean(L, result); + return 1; +} + +// TODO: Review +// float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +/* +int lua_GetGamepadMovement(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + Vector2 result = GetGamepadMovement(arg1); + LuaPush_Vector2(L, result); + return 1; +} +*/ + +int lua_IsGamepadButtonPressed(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonPressed(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsGamepadButtonDown(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonDown(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsGamepadButtonReleased(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonReleased(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsGamepadButtonUp(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonUp(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} +#endif + +int lua_IsMouseButtonPressed(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonPressed(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsMouseButtonDown(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonDown(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsMouseButtonReleased(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonReleased(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsMouseButtonUp(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonUp(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_GetMouseX(lua_State* L) +{ + int result = GetMouseX(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetMouseY(lua_State* L) +{ + int result = GetMouseY(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetMousePosition(lua_State* L) +{ + Vector2 result = GetMousePosition(); + LuaPush_Vector2(L, result); + return 1; +} + +int lua_SetMousePosition(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + SetMousePosition(arg1); + return 0; +} + +int lua_GetMouseWheelMove(lua_State* L) +{ + int result = GetMouseWheelMove(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetTouchX(lua_State* L) +{ + int result = GetTouchX(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetTouchY(lua_State* L) +{ + int result = GetTouchY(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetTouchPosition(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + Vector2 result = GetTouchPosition(arg1); + LuaPush_Vector2(L, result); + return 1; +} + +// TODO: +/* +#if defined(PLATFORM_ANDROID) +bool IsButtonPressed(int button); // Detect if an android physic button has been pressed +bool IsButtonDown(int button); // Detect if an android physic button is being pressed +bool IsButtonReleased(int button); // Detect if an android physic button has been released +#endif +*/ + +//------------------------------------------------------------------------------------ +// raylib [gestures] module functions - Gestures and Touch Handling +//------------------------------------------------------------------------------------ +int lua_SetGesturesEnabled(lua_State* L) +{ + unsigned arg1 = LuaGetArgument_unsigned(L, 1); + SetGesturesEnabled(arg1); + return 0; +} + +int lua_IsGestureDetected(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsGestureDetected(arg1); + lua_pushboolean(L, result); + return 1; +} + +// TODO: +///void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures + +int lua_UpdateGestures(lua_State* L) +{ + UpdateGestures(); + return 0; +} + +int lua_GetTouchPointsCount(lua_State* L) +{ + int result = GetTouchPointsCount(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetGestureDetected(lua_State* L) +{ + int result = GetGestureDetected(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetGestureHoldDuration(lua_State* L) +{ + int result = GetGestureHoldDuration(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetGestureDragVector(lua_State* L) +{ + Vector2 result = GetGestureDragVector(); + LuaPush_Vector2(L, result); + return 1; +} + +int lua_GetGestureDragAngle(lua_State* L) +{ + float result = GetGestureDragAngle(); + lua_pushnumber(L, result); + return 1; +} + +int lua_GetGesturePinchVector(lua_State* L) +{ + Vector2 result = GetGesturePinchVector(); + LuaPush_Vector2(L, result); + return 1; +} + +int lua_GetGesturePinchAngle(lua_State* L) +{ + float result = GetGesturePinchAngle(); + lua_pushnumber(L, result); + return 1; +} + +//------------------------------------------------------------------------------------ +// raylib [camera] module functions - Camera System +//------------------------------------------------------------------------------------ +int lua_SetCameraMode(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetCameraMode(arg1); + return 0; +} + +int lua_UpdateCamera(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + UpdateCamera(&arg1); + LuaPush_Camera(L, arg1); + return 1; +} + +int lua_UpdateCameraPlayer(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + UpdateCameraPlayer(&arg1, &arg2); + LuaPush_Camera(L, arg1); + LuaPush_Vector3(L, arg2); + return 2; +} + +int lua_SetCameraPosition(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + SetCameraPosition(arg1); + return 0; +} + +int lua_SetCameraTarget(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + SetCameraTarget(arg1); + return 0; +} + +int lua_SetCameraFovy(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + SetCameraFovy(arg1); + return 0; +} + +int lua_SetCameraPanControl(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetCameraPanControl(arg1); + return 0; +} + +int lua_SetCameraAltControl(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetCameraAltControl(arg1); + return 0; +} + +int lua_SetCameraSmoothZoomControl(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + SetCameraSmoothZoomControl(arg1); + return 0; +} + +int lua_SetCameraMoveControls(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + int arg6 = LuaGetArgument_int(L, 6); + SetCameraMoveControls(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_SetCameraMouseSensitivity(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + SetCameraMouseSensitivity(arg1); + return 0; +} + +//------------------------------------------------------------------------------------ +// raylib [shapes] module functions - Basic Shapes Drawing +//------------------------------------------------------------------------------------ +int lua_DrawPixel(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawPixel(arg1, arg2, arg3); + return 0; +} + +int lua_DrawPixelV(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPixelV(arg1, arg2); + return 0; +} + +int lua_DrawLine(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawLine(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawLineV(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawLineV(arg1, arg2, arg3); + return 0; +} + +int lua_DrawCircle(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawCircle(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawCircleGradient(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCircleGradient(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawCircleV(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawCircleV(arg1, arg2, arg3); + return 0; +} + +int lua_DrawCircleLines(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawCircleLines(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawRectangle(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawRectangle(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawRectangleRec(lua_State* L) +{ + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawRectangleRec(arg1, arg2); + return 0; +} + +int lua_DrawRectangleGradient(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawRectangleGradient(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawRectangleV(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawRectangleV(arg1, arg2, arg3); + return 0; +} + +int lua_DrawRectangleLines(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawRectangleLines(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawTriangle(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTriangle(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawTriangleLines(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTriangleLines(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawPoly(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawPoly(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +#define GET_TABLE(type, name, index) \ + type* name = 0; \ + size_t name##_size = 0; \ + { \ + size_t sz = 0; \ + luaL_checktype(L, index, LUA_TTABLE); \ + lua_pushnil(L); \ + while (lua_next(L, index)) { \ + LuaGetArgument_##type(L, -1); \ + sz++; \ + lua_pop(L, 1); \ + } \ + lua_pop(L, 1); \ + name = calloc(sz, sizeof(type)); \ + sz = 0; \ + lua_pushnil(L); \ + while (lua_next(L, index)) { \ + name[sz] = LuaGetArgument_##type(L, -1); \ + sz++; \ + lua_pop(L, 1); \ + } \ + lua_pop(L, 1); \ + name##_size = sz; \ + } + + +int lua_DrawPolyEx(lua_State* L) +{ + GET_TABLE(Vector2, arg1, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPolyEx(arg1, arg1_size, arg2); + free(arg1); + return 0; +} + +int lua_DrawPolyExLines(lua_State* L) +{ + GET_TABLE(Vector2, arg1, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPolyExLines(arg1, arg1_size, arg2); + free(arg1); + return 0; +} + +int lua_CheckCollisionRecs(lua_State* L) +{ + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + bool result = CheckCollisionRecs(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionCircles(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + bool result = CheckCollisionCircles(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionCircleRec(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + bool result = CheckCollisionCircleRec(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; +} + +int lua_GetCollisionRec(lua_State* L) +{ + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Rectangle result = GetCollisionRec(arg1, arg2); + LuaPush_Rectangle(L, result); + return 1; +} + +int lua_CheckCollisionPointRec(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + bool result = CheckCollisionPointRec(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionPointCircle(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + bool result = CheckCollisionPointCircle(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionPointTriangle(lua_State* L) +{ + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Vector2 arg4 = LuaGetArgument_Vector2(L, 4); + bool result = CheckCollisionPointTriangle(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; +} + +//------------------------------------------------------------------------------------ +// raylib [textures] module functions - Texture Loading and Drawing +//------------------------------------------------------------------------------------ +int lua_LoadImage(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Image result = LoadImage(arg1); + LuaPush_Image(L, result); + return 1; +} + +int lua_LoadImageEx(lua_State* L) +{ + //Color * arg1 = LuaGetArgument_Color *(L, 1); + GET_TABLE(Color, arg1, 1); + + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + Image result = LoadImageEx(arg1, arg2, arg3); + LuaPush_Image(L, result); + + free(arg1); + return 1; +} + +int lua_LoadImageRaw(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Image result = LoadImageRaw(arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, result); + return 1; +} + +int lua_LoadImageFromRES(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Image result = LoadImageFromRES(arg1, arg2); + LuaPush_Image(L, result); + return 1; +} + +int lua_LoadTexture(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Texture2D result = LoadTexture(arg1); + LuaPush_Texture2D(L, result); + return 1; +} + +// TODO: Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); +int lua_LoadTextureEx(lua_State* L) +{ + void * arg1 = LuaGetArgument_string(L, 1); // TODO: How to get a void * ? + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Texture2D result = LoadTextureEx(arg1, arg2, arg3, arg4); + LuaPush_Texture2D(L, result); + return 1; +} + +int lua_LoadTextureFromRES(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Texture2D result = LoadTextureFromRES(arg1, arg2); + LuaPush_Texture2D(L, result); + return 1; +} + +int lua_LoadTextureFromImage(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Texture2D result = LoadTextureFromImage(arg1); + LuaPush_Texture2D(L, result); + return 1; +} + +int lua_LoadRenderTexture(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + RenderTexture2D result = LoadRenderTexture(arg1, arg2); + LuaPush_RenderTexture2D(L, result); + return 1; +} + +int lua_UnloadImage(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + UnloadImage(arg1); + return 0; +} + +int lua_UnloadTexture(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + UnloadTexture(arg1); + return 0; +} + +int lua_UnloadRenderTexture(lua_State* L) +{ + RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); + UnloadRenderTexture(arg1); + return 0; +} + +int lua_GetImageData(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Color * result = GetImageData(arg1); + lua_createtable(L, arg1.width*arg1.height, 0); + for (int i = 0; i < arg1.width*arg1.height; i++) + { + LuaPush_Color(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; +} + +int lua_GetTextureData(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Image result = GetTextureData(arg1); + LuaPush_Image(L, result); + return 1; +} + +int lua_ImageToPOT(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + ImageToPOT(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageFormat(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + ImageFormat(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} + +// TODO: +/* +void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) +void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) +Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) +void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image +void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) +void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) +void ImageFlipVertical(Image *image); // Flip image vertically +void ImageFlipHorizontal(Image *image); // Flip image horizontally +void ImageColorTint(Image *image, Color color); // Modify image color: tint +void ImageColorInvert(Image *image); // Modify image color: invert +void ImageColorGrayscale(Image *image); // Modify image color: grayscale +void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +*/ + +int lua_GenTextureMipmaps(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + GenTextureMipmaps(arg1); + return 0; +} + +// TODO: void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data + +int lua_DrawTexture(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTexture(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawTextureV(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawTextureV(arg1, arg2, arg3); + return 0; +} + +int lua_DrawTextureEx(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawTextureEx(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawTextureRec(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTextureRec(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawTexturePro(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Vector2 arg4 = LuaGetArgument_Vector2(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawTexturePro(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +//------------------------------------------------------------------------------------ +// raylib [text] module functions - Font Loading and Text Drawing +//------------------------------------------------------------------------------------ +int lua_GetDefaultFont(lua_State* L) +{ + SpriteFont result = GetDefaultFont(); + LuaPush_SpriteFont(L, result); + return 1; +} + +int lua_LoadSpriteFont(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + SpriteFont result = LoadSpriteFont(arg1); + LuaPush_SpriteFont(L, result); + return 1; +} + +int lua_UnloadSpriteFont(lua_State* L) +{ + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + UnloadSpriteFont(arg1); + return 0; +} + +int lua_DrawText(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawText(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawTextEx(lua_State* L) +{ + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + const char* arg2 = LuaGetArgument_string(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawTextEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_MeasureText(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int result = MeasureText(arg1, arg2); + lua_pushinteger(L, result); + return 1; +} + +int lua_MeasureTextEx(lua_State* L) +{ + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Vector2 result = MeasureTextEx(arg1, arg2, arg3, arg4); + LuaPush_Vector2(L, result); + return 1; +} + +int lua_DrawFPS(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + DrawFPS(arg1, arg2); + return 0; +} + +// TODO: +/* +const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' +const char *SubText(const char *text, int position, int length); // Get a piece of a text string +*/ + +int lua_DrawCube(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCube(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawCubeV(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawCubeV(arg1, arg2, arg3); + return 0; +} + +int lua_DrawCubeWires(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCubeWires(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawCubeTexture(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCubeTexture(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawSphere(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawSphere(arg1, arg2, arg3); + return 0; +} + +int lua_DrawSphereEx(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawSphereEx(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawSphereWires(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawSphereWires(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawCylinder(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCylinder(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawCylinderWires(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCylinderWires(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawPlane(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawPlane(arg1, arg2, arg3); + return 0; +} + +int lua_DrawRay(lua_State* L) +{ + Ray arg1 = LuaGetArgument_Ray(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawRay(arg1, arg2); + return 0; +} + +int lua_DrawGrid(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + DrawGrid(arg1, arg2); + return 0; +} + +int lua_DrawGizmo(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + DrawGizmo(arg1); + return 0; +} + +// TODO: +/* +void DrawLight(Light light); // Draw light in 3D world +void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space +*/ + +//------------------------------------------------------------------------------------ +// raylib [models] module functions +//------------------------------------------------------------------------------------ +int lua_LoadModel(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Model result = LoadModel(arg1); + LuaPush_Model(L, result); + return 1; +} + +int lua_LoadModelEx(lua_State* L) +{ + Mesh arg1 = LuaGetArgument_Mesh(L, 1); + bool arg2 = LuaGetArgument_int(L, 2); + Model result = LoadModelEx(arg1, arg2); + LuaPush_Model(L, result); + return 1; +} + +int lua_LoadModelFromRES(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Model result = LoadModelFromRES(arg1, arg2); + LuaPush_Model(L, result); + return 1; +} + +int lua_LoadHeightmap(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Model result = LoadHeightmap(arg1, arg2); + LuaPush_Model(L, result); + return 1; +} + +int lua_LoadCubicmap(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Model result = LoadCubicmap(arg1); + LuaPush_Model(L, result); + return 1; +} + +int lua_UnloadModel(lua_State* L) +{ + Model arg1 = LuaGetArgument_Model(L, 1); + UnloadModel(arg1); + return 0; +} + +// TODO: GenMesh*() + +int lua_LoadMaterial(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Material result = LoadMaterial(arg1); + LuaPush_Material(L, result); + return 1; +} + +int lua_LoadDefaultMaterial(lua_State* L) +{ + Material result = LoadDefaultMaterial(); + LuaPush_Material(L, result); + return 1; +} + +int lua_LoadStandardMaterial(lua_State* L) +{ + Material result = LoadStandardMaterial(); + LuaPush_Material(L, result); + return 1; +} + +int lua_UnloadMaterial(lua_State* L) +{ + Material arg1 = LuaGetArgument_Material(L, 1); + UnloadMaterial(arg1); + return 0; +} + +int lua_DrawModel(lua_State* L) +{ + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawModel(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawModelEx(lua_State* L) +{ + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Vector3 arg5 = LuaGetArgument_Vector3(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawModelEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawModelWires(lua_State* L) +{ + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawModelWires(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_DrawModelWiresEx(lua_State* L) +{ + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Vector3 arg5 = LuaGetArgument_Vector3(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawModelWiresEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_DrawBillboard(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawBillboard(arg1, arg2, arg3, arg4, arg5); + return 0; +} + +int lua_DrawBillboardRec(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawBillboardRec(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; +} + +int lua_CalculateBoundingBox(lua_State* L) +{ + Mesh arg1 = LuaGetArgument_Mesh(L, 1); + BoundingBox result = CalculateBoundingBox(arg1); + LuaPush_BoundingBox(L, result); + return 0; +} + +int lua_CheckCollisionSpheres(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + bool result = CheckCollisionSpheres(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionBoxes(lua_State* L) +{ + BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); + BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); + bool result = CheckCollisionBoxes(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionBoxSphere(lua_State* L) +{ + BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 4); + bool result = CheckCollisionBoxSphere(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; +} + +// TODO: +/* +bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere +bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection +bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box +Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap +*/ + +int lua_ResolveCollisionCubicmap(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Vector3 result = ResolveCollisionCubicmap(arg1, arg2, &arg3, arg4); + LuaPush_Vector3(L, result); + LuaPush_Vector3(L, arg3); + return 2; +} + +//------------------------------------------------------------------------------------ +// raylib [raymath] module functions - Shaders +//------------------------------------------------------------------------------------ +int lua_LoadShader(lua_State* L) +{ + char * arg1 = (char*)LuaGetArgument_string(L, 1); + char * arg2 = (char*)LuaGetArgument_string(L, 2); + Shader result = LoadShader(arg1, arg2); + LuaPush_Shader(L, result); + return 1; +} + +int lua_UnloadShader(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + UnloadShader(arg1); + return 0; +} + +int lua_GetDefaultShader(lua_State* L) +{ + Shader result = GetDefaultShader(); + LuaPush_Shader(L, result); + return 1; +} + +int lua_GetStandardShader(lua_State* L) +{ + Shader result = GetStandardShader(); + LuaPush_Shader(L, result); + return 1; +} + +int lua_GetDefaultTexture(lua_State* L) +{ + Texture2D result = GetDefaultTexture(); + LuaPush_Texture2D(L, result); + return 1; +} + +int lua_GetShaderLocation(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int result = GetShaderLocation(arg1, arg2); + lua_pushinteger(L, result); + return 1; +} + +int lua_SetShaderValue(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + GET_TABLE(float, arg3, 3); + SetShaderValue(arg1, arg2, arg3, arg3_size); + free(arg3); + return 0; +} + +int lua_SetShaderValuei(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + GET_TABLE(int, arg3, 3); + SetShaderValuei(arg1, arg2, arg3, arg3_size); + free(arg3); + return 0; +} + +int lua_SetShaderValueMatrix(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Matrix arg3 = LuaGetArgument_Matrix(L, 3); + SetShaderValueMatrix(arg1, arg2, arg3); + return 0; +} + +int lua_SetMatrixProjection(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + SetMatrixProjection(arg1); + return 0; +} + +int lua_SetMatrixModelview(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + SetMatrixModelview(arg1); + return 0; +} + +int lua_BeginShaderMode(lua_State* L) +{ + Shader arg1 = LuaGetArgument_Shader(L, 1); + BeginShaderMode(arg1); + return 0; +} + +int lua_EndShaderMode(lua_State* L) +{ + EndShaderMode(); + return 0; +} + +int lua_BeginBlendMode(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + BeginBlendMode(arg1); + return 0; +} + +int lua_EndBlendMode(lua_State* L) +{ + EndBlendMode(); + return 0; +} + +// TODO: +//Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +//void DestroyLight(Light light); // Destroy a light and take it out of the list + +// TODO: +/* +//------------------------------------------------------------------------------------ +// raylib [rlgl] module functions - VR experience +//------------------------------------------------------------------------------------ +void InitVrDevice(int vdDevice); // Init VR device +void CloseVrDevice(void); // Close VR device +void UpdateVrTracking(void); // Update VR tracking (position and orientation) +void BeginVrDrawing(void); // Begin VR drawing configuration +void EndVrDrawing(void); // End VR drawing process (and desktop mirror) +bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) +*/ + +//------------------------------------------------------------------------------------ +// raylib [audio] module functions +//------------------------------------------------------------------------------------ +int lua_InitAudioDevice(lua_State* L) +{ + InitAudioDevice(); + return 0; +} + +int lua_CloseAudioDevice(lua_State* L) +{ + CloseAudioDevice(); + return 0; +} + +int lua_IsAudioDeviceReady(lua_State* L) +{ + bool result = IsAudioDeviceReady(); + lua_pushboolean(L, result); + return 0; +} + +int lua_LoadSound(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Sound result = LoadSound((char*)arg1); + LuaPush_Sound(L, result); + return 1; +} + +int lua_LoadSoundFromWave(lua_State* L) +{ + Wave arg1 = LuaGetArgument_Wave(L, 1); + Sound result = LoadSoundFromWave(arg1); + LuaPush_Sound(L, result); + return 1; +} + +int lua_LoadSoundFromRES(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Sound result = LoadSoundFromRES(arg1, arg2); + LuaPush_Sound(L, result); + return 1; +} + +int lua_UnloadSound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + UnloadSound(arg1); + return 0; +} + +int lua_PlaySound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + PlaySound(arg1); + return 0; +} + +int lua_PauseSound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + PauseSound(arg1); + return 0; +} + +int lua_ResumeSound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + ResumeSound(arg1); + return 0; +} + +int lua_StopSound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + StopSound(arg1); + return 0; +} + +int lua_IsSoundPlaying(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + bool result = IsSoundPlaying(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_SetSoundVolume(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetSoundVolume(arg1, arg2); + return 0; +} + +int lua_SetSoundPitch(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetSoundPitch(arg1, arg2); + return 0; +} + +int lua_LoadMusicStream(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Music result = LoadMusicStream((char *)arg1); + LuaPush_Music(L, result); + return 0; +} + +int lua_UnloadMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + UnloadMusicStream(arg1); + return 0; +} + +int lua_PlayMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + PlayMusicStream(arg1); + return 0; +} + +int lua_UpdateMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + UpdateMusicStream(arg1); + return 0; +} + +int lua_StopMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + StopMusicStream(arg1); + return 0; +} + +int lua_PauseMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + PauseMusicStream(arg1); + return 0; +} + +int lua_ResumeMusicStream(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + ResumeMusicStream(arg1); + return 0; +} + +int lua_IsMusicPlaying(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + bool result = IsMusicPlaying(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_SetMusicVolume(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetMusicVolume(arg1, arg2); + return 0; +} + +int lua_GetMusicTimeLength(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + float result = GetMusicTimeLength(arg1); + lua_pushnumber(L, result); + return 1; +} + +int lua_GetMusicTimePlayed(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + float result = GetMusicTimePlayed(arg1); + lua_pushnumber(L, result); + return 1; +} + +// TODO: +/* +AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, + unsigned int channels); // Init audio stream (to stream audio pcm data) +void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +void PlayAudioStream(AudioStream stream); // Play audio stream +void PauseAudioStream(AudioStream stream); // Pause audio stream +void ResumeAudioStream(AudioStream stream); // Resume audio stream +void StopAudioStream(AudioStream stream); // Stop audio stream +*/ + +//---------------------------------------------------------------------------------- +// raylib [utils] module functions +//---------------------------------------------------------------------------------- +int lua_DecompressData(lua_State* L) +{ + unsigned char *arg1 = (unsigned char *)LuaGetArgument_string(L, 1); + unsigned arg2 = (unsigned)LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + unsigned char *result = DecompressData(arg1, arg2, arg3); + lua_pushlstring(L, (const char *)result, arg3); + return 1; +} + +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +int lua_WriteBitmap(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + WriteBitmap(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_WritePNG(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + WritePNG(arg1, arg2, arg3, arg4, arg5); + return 0; +} +#endif + +int lua_TraceLog(lua_State* L) +{ + int num_args = lua_gettop(L) - 1; + int arg1 = LuaGetArgument_int(L, 1); + + /// type, fmt, args... + + lua_rotate(L, 1, -1); /// fmt, args..., type + lua_pop(L, 1); /// fmt, args... + + lua_getglobal(L, "string"); /// fmt, args..., [string] + lua_getfield(L, 1, "format"); /// fmt, args..., [string], format() + lua_rotate(L, 1, 2); /// [string], format(), fmt, args... + lua_call(L, num_args, 1); /// [string], formatted_string + + TraceLog(arg1, "%s", luaL_checkstring(L,-1)); + return 0; +} + +int lua_GetExtension(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + const char* result = GetExtension(arg1); + lua_pushstring(L, result); + return 1; +} + +int lua_GetNextPOT(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int result = GetNextPOT(arg1); + lua_pushinteger(L, result); + return 1; +} + +//---------------------------------------------------------------------------------- +// raylib [raymath] module functions - Vector3 math +//---------------------------------------------------------------------------------- +int lua_VectorAdd(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorAdd(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorSubtract(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorSubtract(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorCrossProduct(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorCrossProduct(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorPerpendicular(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 result = VectorPerpendicular(arg1); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorDotProduct(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float result = VectorDotProduct(arg1, arg2); + lua_pushnumber(L, result); + return 1; +} + +int lua_VectorLength(lua_State* L) +{ + const Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float result = VectorLength(arg1); + lua_pushnumber(L, result); + return 1; +} + +int lua_VectorScale(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + VectorScale(&arg1, arg2); + LuaPush_Vector3(L, arg1); + return 1; +} + +int lua_VectorNegate(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + VectorNegate(&arg1); + LuaPush_Vector3(L, arg1); + return 1; +} + +int lua_VectorNormalize(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + VectorNormalize(&arg1); + LuaPush_Vector3(L, arg1); + return 1; +} + +int lua_VectorDistance(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float result = VectorDistance(arg1, arg2); + lua_pushnumber(L, result); + return 1; +} + +int lua_VectorLerp(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Vector3 result = VectorLerp(arg1, arg2, arg3); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorReflect(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorReflect(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; +} + +int lua_VectorTransform(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + VectorTransform(&arg1, arg2); + LuaPush_Vector3(L, arg1); + return 1; +} + +int lua_VectorZero(lua_State* L) +{ + Vector3 result = VectorZero(); + LuaPush_Vector3(L, result); + return 1; +} + +//---------------------------------------------------------------------------------- +// raylib [raymath] module functions - Matrix math +//---------------------------------------------------------------------------------- +int lua_MatrixDeterminant(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float result = MatrixDeterminant(arg1); + lua_pushnumber(L, result); + return 1; +} + +int lua_MatrixTrace(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float result = MatrixTrace(arg1); + lua_pushnumber(L, result); + return 1; +} + +int lua_MatrixTranspose(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixTranspose(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; +} + +int lua_MatrixInvert(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixInvert(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; +} + +int lua_MatrixNormalize(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixNormalize(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; +} + +int lua_MatrixIdentity(lua_State* L) +{ + Matrix result = MatrixIdentity(); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixAdd(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixAdd(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixSubstract(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixSubstract(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixTranslate(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Matrix result = MatrixTranslate(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixRotate(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Matrix result = MatrixRotate(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixRotateX(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateX(arg1); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixRotateY(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateY(arg1); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixRotateZ(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateZ(arg1); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixScale(lua_State* L) +{ + float arg1 = LuaGetArgument_float(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Matrix result = MatrixScale(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixMultiply(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixMultiply(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixFrustum(lua_State* L) +{ + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + double arg5 = LuaGetArgument_double(L, 5); + double arg6 = LuaGetArgument_double(L, 6); + Matrix result = MatrixFrustum(arg1, arg2, arg3, arg4, arg5, arg6); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixPerspective(lua_State* L) +{ + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + Matrix result = MatrixPerspective(arg1, arg2, arg3, arg4); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixOrtho(lua_State* L) +{ + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + double arg5 = LuaGetArgument_double(L, 5); + double arg6 = LuaGetArgument_double(L, 6); + Matrix result = MatrixOrtho(arg1, arg2, arg3, arg4, arg5, arg6); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_MatrixLookAt(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + Matrix result = MatrixLookAt(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; +} + +//---------------------------------------------------------------------------------- +// raylib [raymath] module functions - Quaternion math +//---------------------------------------------------------------------------------- +int lua_QuaternionLength(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + float result = QuaternionLength(arg1); + lua_pushnumber(L, result); + return 1; +} + +int lua_QuaternionNormalize(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + QuaternionNormalize(&arg1); + LuaPush_Quaternion(L, arg1); + return 1; +} + +int lua_QuaternionMultiply(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); + Quaternion result = QuaternionMultiply(arg1, arg2); + LuaPush_Quaternion(L, result); + return 1; +} + +int lua_QuaternionSlerp(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Quaternion result = QuaternionSlerp(arg1, arg2, arg3); + LuaPush_Quaternion(L, result); + return 1; +} + +int lua_QuaternionFromMatrix(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Quaternion result = QuaternionFromMatrix(arg1); + LuaPush_Quaternion(L, result); + return 1; +} + +int lua_QuaternionToMatrix(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Matrix result = QuaternionToMatrix(arg1); + LuaPush_Matrix(L, &result); + return 1; +} + +int lua_QuaternionFromAxisAngle(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Quaternion result = QuaternionFromAxisAngle(arg1, arg2); + LuaPush_Quaternion(L, result); + return 1; +} + +int lua_QuaternionToAxisAngle(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Vector3 arg2; + float arg3 = 0; + QuaternionToAxisAngle(arg1, &arg2, &arg3); + LuaPush_Vector3(L, arg2); + lua_pushnumber(L, arg3); + return 2; +} + +int lua_QuaternionTransform(lua_State* L) +{ + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + QuaternionTransform(&arg1, arg2); + LuaPush_Quaternion(L, arg1); + return 1; +} + + +//---------------------------------------------------------------------------------- +// Functions Registering +//---------------------------------------------------------------------------------- +#define REG(name) { #name, lua_##name }, + +// raylib Functions (and data types) list +static luaL_Reg raylib_functions[] = { + REG(Color) + REG(Vector2) + REG(Vector3) + REG(Rectangle) + REG(Ray) + REG(Camera) + // TODO: Additional structs + + // TODO: Review registered functions + REG(InitWindow) + REG(CloseWindow) + REG(WindowShouldClose) + REG(IsWindowMinimized) + REG(ToggleFullscreen) + + REG(GetScreenWidth) + REG(GetScreenHeight) + REG(ClearBackground) + REG(BeginDrawing) + REG(EndDrawing) + REG(Begin3dMode) + REG(End3dMode) + REG(GetMouseRay) +#if defined(PLATFORM_WEB) + REG(SetDrawingLoop) +#else + REG(SetTargetFPS) +#endif + REG(GetFPS) + REG(GetFrameTime) + REG(GetColor) + REG(GetHexValue) + REG(GetRandomValue) + REG(Fade) + REG(SetConfigFlags) + REG(ShowLogo) + REG(IsFileDropped) + //REG(*GetDroppedFiles) + REG(ClearDroppedFiles) +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) + REG(IsKeyPressed) + REG(IsKeyDown) + REG(IsKeyReleased) + REG(IsKeyUp) + REG(GetKeyPressed) + REG(IsMouseButtonPressed) + REG(IsMouseButtonDown) + REG(IsMouseButtonReleased) + REG(IsMouseButtonUp) + REG(GetMouseX) + REG(GetMouseY) + REG(GetMousePosition) + REG(SetMousePosition) + REG(GetMouseWheelMove) + REG(ShowCursor) + REG(HideCursor) + REG(IsCursorHidden) +#endif + +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + REG(IsGamepadAvailable) + + REG(IsGamepadButtonPressed) + REG(IsGamepadButtonDown) + REG(IsGamepadButtonReleased) + REG(IsGamepadButtonUp) +#endif + +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) + REG(GetTouchX) + REG(GetTouchY) + REG(GetTouchPosition) +#if defined(PLATFORM_WEB) + REG(InitGesturesSystem) +#elif defined(PLATFORM_ANDROID) + //REG(InitGesturesSystem) +#endif + REG(UpdateGestures) + REG(IsGestureDetected) + REG(GetGestureType) + REG(SetGesturesEnabled) + REG(GetGestureDragIntensity) + REG(GetGestureDragAngle) + REG(GetGestureDragVector) + REG(GetGestureHoldDuration) + REG(GetGesturePinchDelta) + REG(GetGesturePinchAngle) +#endif + REG(SetCameraMode) + REG(UpdateCamera) + REG(UpdateCameraPlayer) + REG(SetCameraPosition) + REG(SetCameraTarget) + REG(SetCameraPanControl) + REG(SetCameraAltControl) + REG(SetCameraSmoothZoomControl) + REG(SetCameraMoveControls) + REG(SetCameraMouseSensitivity) + REG(DrawPixel) + REG(DrawPixelV) + REG(DrawLine) + REG(DrawLineV) + REG(DrawCircle) + REG(DrawCircleGradient) + REG(DrawCircleV) + REG(DrawCircleLines) + REG(DrawRectangle) + REG(DrawRectangleRec) + REG(DrawRectangleGradient) + REG(DrawRectangleV) + REG(DrawRectangleLines) + REG(DrawTriangle) + REG(DrawTriangleLines) + REG(DrawPoly) + REG(DrawPolyEx) + REG(DrawPolyExLines) + REG(CheckCollisionRecs) + REG(CheckCollisionCircles) + REG(CheckCollisionCircleRec) + REG(GetCollisionRec) + REG(CheckCollisionPointRec) + REG(CheckCollisionPointCircle) + REG(CheckCollisionPointTriangle) + REG(LoadImage) + REG(LoadImageEx) + REG(LoadImageRaw) + REG(LoadImageFromRES) + REG(LoadTexture) + REG(LoadTextureFromRES) + REG(LoadTextureFromImage) + REG(UnloadImage) + REG(UnloadTexture) + REG(GetImageData) + REG(GetTextureData) + REG(ImageToPOT) + REG(ImageFormat) + REG(GenTextureMipmaps) + REG(DrawTexture) + REG(DrawTextureV) + REG(DrawTextureEx) + REG(DrawTextureRec) + REG(DrawTexturePro) + REG(GetDefaultFont) + REG(LoadSpriteFont) + REG(UnloadSpriteFont) + REG(DrawText) + REG(DrawTextEx) + REG(MeasureText) + REG(MeasureTextEx) + REG(DrawFPS) + REG(DrawCube) + REG(DrawCubeV) + REG(DrawCubeWires) + REG(DrawCubeTexture) + REG(DrawSphere) + REG(DrawSphereEx) + REG(DrawSphereWires) + REG(DrawCylinder) + REG(DrawCylinderWires) + REG(DrawPlane) + REG(DrawRay) + REG(DrawGrid) + REG(DrawGizmo) + REG(LoadModel) + REG(LoadModelEx) + REG(LoadHeightmap) + REG(LoadCubicmap) + REG(UnloadModel) + REG(DrawModel) + REG(DrawModelEx) + REG(DrawModelWires) + REG(DrawBillboard) + REG(DrawBillboardRec) + REG(CheckCollisionSpheres) + REG(CheckCollisionBoxes) + REG(CheckCollisionBoxSphere) + REG(ResolveCollisionCubicmap) + REG(LoadShader) + REG(UnloadShader) + REG(GetShaderLocation) + REG(SetShaderValue) + REG(SetShaderValuei) + + REG(BeginBlendMode) + REG(EndBlendMode) + REG(InitAudioDevice) + REG(CloseAudioDevice) + REG(LoadSound) + REG(LoadSoundFromWave) + REG(LoadSoundFromRES) + REG(UnloadSound) + REG(PlaySound) + REG(PauseSound) + REG(StopSound) + REG(IsSoundPlaying) + REG(SetSoundVolume) + REG(SetSoundPitch) + REG(PlayMusicStream) + REG(UpdateMusicStream) + REG(StopMusicStream) + REG(PauseMusicStream) + REG(ResumeMusicStream) + REG(IsMusicPlaying) + REG(SetMusicVolume) + REG(GetMusicTimeLength) + REG(GetMusicTimePlayed) + + /// Math and util + REG(DecompressData) +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) + REG(WriteBitmap) + REG(WritePNG) +#endif + REG(TraceLog) + REG(GetExtension) + REG(GetNextPOT) + REG(VectorAdd) + REG(VectorSubtract) + REG(VectorCrossProduct) + REG(VectorPerpendicular) + REG(VectorDotProduct) + REG(VectorLength) + REG(VectorScale) + REG(VectorNegate) + REG(VectorNormalize) + REG(VectorDistance) + REG(VectorLerp) + REG(VectorReflect) + REG(VectorTransform) + REG(VectorZero) + REG(MatrixDeterminant) + REG(MatrixTrace) + REG(MatrixTranspose) + REG(MatrixInvert) + REG(MatrixNormalize) + REG(MatrixIdentity) + REG(MatrixAdd) + REG(MatrixSubstract) + REG(MatrixTranslate) + REG(MatrixRotate) + REG(MatrixRotateX) + REG(MatrixRotateY) + REG(MatrixRotateZ) + REG(MatrixScale) + REG(MatrixMultiply) + REG(MatrixFrustum) + REG(MatrixPerspective) + REG(MatrixOrtho) + REG(MatrixLookAt) + REG(QuaternionLength) + REG(QuaternionNormalize) + REG(QuaternionMultiply) + REG(QuaternionSlerp) + REG(QuaternionFromMatrix) + REG(QuaternionToMatrix) + REG(QuaternionFromAxisAngle) + REG(QuaternionToAxisAngle) + REG(QuaternionTransform) + + {0,0} +}; + +// Register raylib functionality +static void LuaRegisterRayLib(const char *opt_table) +{ + if (opt_table) lua_createtable(L, 0, sizeof(raylib_functions)/sizeof(raylib_functions[0])); + else lua_pushglobaltable(L); + + luaL_setfuncs(L, raylib_functions, 0); +} + +//---------------------------------------------------------------------------------- +// raylib Lua API +//---------------------------------------------------------------------------------- + +// Initialize Lua system +RLUADEF void InitLuaDevice(void) +{ + mainLuaState = luaL_newstate(); + L = mainLuaState; + + LuaStartEnum(); + LuaSetEnum("FULLSCREEN_MODE", 1); + LuaSetEnum("SHOW_LOGO", 2); + LuaSetEnum("SHOW_MOUSE_CURSOR", 4); + LuaSetEnum("CENTERED_MODE", 8); + LuaSetEnum("MSAA_4X_HINT", 16); + LuaSetEnum("VSYNC_HINT", 32); + LuaEndEnum("FLAG"); + + LuaStartEnum(); + LuaSetEnum("SPACE", 32); + LuaSetEnum("ESCAPE", 256); + LuaSetEnum("ENTER", 257); + LuaSetEnum("BACKSPACE", 259); + LuaSetEnum("RIGHT", 262); + LuaSetEnum("LEFT", 263); + LuaSetEnum("DOWN", 264); + LuaSetEnum("UP", 265); + LuaSetEnum("F1", 290); + LuaSetEnum("F2", 291); + LuaSetEnum("F3", 292); + LuaSetEnum("F4", 293); + LuaSetEnum("F5", 294); + LuaSetEnum("F6", 295); + LuaSetEnum("F7", 296); + LuaSetEnum("F8", 297); + LuaSetEnum("F9", 298); + LuaSetEnum("F10", 299); + LuaSetEnum("LEFT_SHIFT", 340); + LuaSetEnum("LEFT_CONTROL", 341); + LuaSetEnum("LEFT_ALT", 342); + LuaSetEnum("RIGHT_SHIFT", 344); + LuaSetEnum("RIGHT_CONTROL", 345); + LuaSetEnum("RIGHT_ALT", 346); + LuaSetEnum("ZERO", 48); + LuaSetEnum("ONE", 49); + LuaSetEnum("TWO", 50); + LuaSetEnum("THREE", 51); + LuaSetEnum("FOUR", 52); + LuaSetEnum("FIVE", 53); + LuaSetEnum("SIX", 54); + LuaSetEnum("SEVEN", 55); + LuaSetEnum("EIGHT", 56); + LuaSetEnum("NINE", 57); + LuaSetEnum("A", 65); + LuaSetEnum("B", 66); + LuaSetEnum("C", 67); + LuaSetEnum("D", 68); + LuaSetEnum("E", 69); + LuaSetEnum("F", 70); + LuaSetEnum("G", 71); + LuaSetEnum("H", 72); + LuaSetEnum("I", 73); + LuaSetEnum("J", 74); + LuaSetEnum("K", 75); + LuaSetEnum("L", 76); + LuaSetEnum("M", 77); + LuaSetEnum("N", 78); + LuaSetEnum("O", 79); + LuaSetEnum("P", 80); + LuaSetEnum("Q", 81); + LuaSetEnum("R", 82); + LuaSetEnum("S", 83); + LuaSetEnum("T", 84); + LuaSetEnum("U", 85); + LuaSetEnum("V", 86); + LuaSetEnum("W", 87); + LuaSetEnum("X", 88); + LuaSetEnum("Y", 89); + LuaSetEnum("Z", 90); + LuaEndEnum("KEY"); + + LuaStartEnum(); + LuaSetEnum("LEFT_BUTTON", 0); + LuaSetEnum("RIGHT_BUTTON", 1); + LuaSetEnum("MIDDLE_BUTTON", 2); + LuaEndEnum("MOUSE"); + + LuaStartEnum(); + LuaSetEnum("PLAYER1", 0); + LuaSetEnum("PLAYER2", 1); + LuaSetEnum("PLAYER3", 2); + LuaSetEnum("PLAYER4", 3); + + LuaSetEnum("BUTTON_A", 2); + LuaSetEnum("BUTTON_B", 1); + LuaSetEnum("BUTTON_X", 3); + LuaSetEnum("BUTTON_Y", 4); + LuaSetEnum("BUTTON_R1", 7); + LuaSetEnum("BUTTON_R2", 5); + LuaSetEnum("BUTTON_L1", 6); + LuaSetEnum("BUTTON_L2", 8); + LuaSetEnum("BUTTON_SELECT", 9); + LuaSetEnum("BUTTON_START", 10); + LuaEndEnum("GAMEPAD"); + + LuaStartEnum(); + LuaSetEnum("PLAYER1", 0); + LuaSetEnum("PLAYER2", 1); + LuaSetEnum("PLAYER3", 2); + LuaSetEnum("PLAYER4", 3); + + LuaSetEnum("BUTTON_A", 2); + LuaSetEnum("BUTTON_B", 1); + LuaSetEnum("BUTTON_X", 3); + LuaSetEnum("BUTTON_Y", 4); + LuaSetEnum("BUTTON_R1", 7); + LuaSetEnum("BUTTON_R2", 5); + LuaSetEnum("BUTTON_L1", 6); + LuaSetEnum("BUTTON_L2", 8); + LuaSetEnum("BUTTON_SELECT", 9); + LuaSetEnum("BUTTON_START", 10); + LuaEndEnum("GAMEPAD"); + + // TODO: XBOX controller buttons enum + + lua_pushglobaltable(L); + LuaSetEnumColor("LIGHTGRAY", LIGHTGRAY); + LuaSetEnumColor("GRAY", GRAY); + LuaSetEnumColor("DARKGRAY", DARKGRAY); + LuaSetEnumColor("YELLOW", YELLOW); + LuaSetEnumColor("GOLD", GOLD); + LuaSetEnumColor("ORANGE", ORANGE); + LuaSetEnumColor("PINK", PINK); + LuaSetEnumColor("RED", RED); + LuaSetEnumColor("MAROON", MAROON); + LuaSetEnumColor("GREEN", GREEN); + LuaSetEnumColor("LIME", LIME); + LuaSetEnumColor("DARKGREEN", DARKGREEN); + LuaSetEnumColor("SKYBLUE", SKYBLUE); + LuaSetEnumColor("BLUE", BLUE); + LuaSetEnumColor("DARKBLUE", DARKBLUE); + LuaSetEnumColor("PURPLE", PURPLE); + LuaSetEnumColor("VIOLET", VIOLET); + LuaSetEnumColor("DARKPURPLE", DARKPURPLE); + LuaSetEnumColor("BEIGE", BEIGE); + LuaSetEnumColor("BROWN", BROWN); + LuaSetEnumColor("DARKBROWN", DARKBROWN); + LuaSetEnumColor("WHITE", WHITE); + LuaSetEnumColor("BLACK", BLACK); + LuaSetEnumColor("BLANK", BLANK); + LuaSetEnumColor("MAGENTA", MAGENTA); + LuaSetEnumColor("RAYWHITE", RAYWHITE); + lua_pop(L, 1); + + LuaStartEnum(); + LuaSetEnum("UNCOMPRESSED_GRAYSCALE", UNCOMPRESSED_GRAYSCALE); + LuaSetEnum("UNCOMPRESSED_GRAY_ALPHA", UNCOMPRESSED_GRAY_ALPHA); + LuaSetEnum("UNCOMPRESSED_R5G6B5", UNCOMPRESSED_R5G6B5); + LuaSetEnum("UNCOMPRESSED_R8G8B8", UNCOMPRESSED_R8G8B8); + LuaSetEnum("UNCOMPRESSED_R5G5B5A1", UNCOMPRESSED_R5G5B5A1); + LuaSetEnum("UNCOMPRESSED_R4G4B4A4", UNCOMPRESSED_R4G4B4A4); + LuaSetEnum("UNCOMPRESSED_R8G8B8A8", UNCOMPRESSED_R8G8B8A8); + LuaSetEnum("COMPRESSED_DXT1_RGB", COMPRESSED_DXT1_RGB); + LuaSetEnum("COMPRESSED_DXT1_RGBA", COMPRESSED_DXT1_RGBA); + LuaSetEnum("COMPRESSED_DXT3_RGBA", COMPRESSED_DXT3_RGBA); + LuaSetEnum("COMPRESSED_DXT5_RGBA", COMPRESSED_DXT5_RGBA); + LuaSetEnum("COMPRESSED_ETC1_RGB", COMPRESSED_ETC1_RGB); + LuaSetEnum("COMPRESSED_ETC2_RGB", COMPRESSED_ETC2_RGB); + LuaSetEnum("COMPRESSED_ETC2_EAC_RGBA", COMPRESSED_ETC2_EAC_RGBA); + LuaSetEnum("COMPRESSED_PVRT_RGB", COMPRESSED_PVRT_RGB); + LuaSetEnum("COMPRESSED_PVRT_RGBA", COMPRESSED_PVRT_RGBA); + LuaSetEnum("COMPRESSED_ASTC_4x4_RGBA", COMPRESSED_ASTC_4x4_RGBA); + LuaSetEnum("COMPRESSED_ASTC_8x8_RGBA", COMPRESSED_ASTC_8x8_RGBA); + LuaEndEnum("TextureFormat"); + + LuaStartEnum(); + LuaSetEnum("ALPHA", BLEND_ALPHA); + LuaSetEnum("ADDITIVE", BLEND_ADDITIVE); + LuaSetEnum("MULTIPLIED", BLEND_MULTIPLIED); + LuaEndEnum("BlendMode"); + + LuaStartEnum(); + LuaSetEnum("NONE", GESTURE_NONE); + LuaSetEnum("TAP", GESTURE_TAP); + LuaSetEnum("DOUBLETAP", GESTURE_DOUBLETAP); + LuaSetEnum("HOLD", GESTURE_HOLD); + LuaSetEnum("DRAG", GESTURE_DRAG); + LuaSetEnum("SWIPE_RIGHT", GESTURE_SWIPE_RIGHT); + LuaSetEnum("SWIPE_LEFT", GESTURE_SWIPE_LEFT); + LuaSetEnum("SWIPE_UP", GESTURE_SWIPE_UP); + LuaSetEnum("SWIPE_DOWN", GESTURE_SWIPE_DOWN); + LuaSetEnum("PINCH_IN", GESTURE_PINCH_IN); + LuaSetEnum("PINCH_OUT", GESTURE_PINCH_OUT); + LuaEndEnum("Gestures"); + + LuaStartEnum(); + LuaSetEnum("CUSTOM", CAMERA_CUSTOM); + LuaSetEnum("FREE", CAMERA_FREE); + LuaSetEnum("ORBITAL", CAMERA_ORBITAL); + LuaSetEnum("FIRST_PERSON", CAMERA_FIRST_PERSON); + LuaSetEnum("THIRD_PERSON", CAMERA_THIRD_PERSON); + LuaEndEnum("CameraMode"); + + LuaStartEnum(); + LuaSetEnum("HMD_DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); + LuaSetEnum("HMD_OCULUS_RIFT_DK2", HMD_OCULUS_RIFT_DK2); + LuaSetEnum("HMD_OCULUS_RIFT_CV1", HMD_OCULUS_RIFT_CV1); + LuaSetEnum("HMD_VALVE_HTC_VIVE", HMD_VALVE_HTC_VIVE); + LuaSetEnum("HMD_SAMSUNG_GEAR_VR", HMD_SAMSUNG_GEAR_VR); + LuaSetEnum("HMD_GOOGLE_CARDBOARD", HMD_GOOGLE_CARDBOARD); + LuaSetEnum("HMD_SONY_PLAYSTATION_VR", HMD_SONY_PLAYSTATION_VR); + LuaSetEnum("HMD_RAZER_OSVR", HMD_RAZER_OSVR); + LuaSetEnum("HMD_FOVE_VR", HMD_FOVE_VR); + LuaEndEnum("VrDevice"); + + lua_pushglobaltable(L); + LuaSetEnum("INFO", INFO); + LuaSetEnum("ERROR", ERROR); + LuaSetEnum("WARNING", WARNING); + LuaSetEnum("DEBUG", DEBUG); + LuaSetEnum("OTHER", OTHER); + lua_pop(L, 1); + + lua_pushboolean(L, true); +#if defined(PLATFORM_DESKTOP) + lua_setglobal(L, "PLATFORM_DESKTOP"); +#elif defined(PLATFORM_ANDROID) + lua_setglobal(L, "PLATFORM_ANDROID"); +#elif defined(PLATFORM_RPI) + lua_setglobal(L, "PLATFORM_RPI"); +#elif defined(PLATFORM_WEB) + lua_setglobal(L, "PLATFORM_WEB"); +#endif + + luaL_openlibs(L); + LuaBuildOpaqueMetatables(); + + LuaRegisterRayLib(0); +} + +// De-initialize Lua system +RLUADEF void CloseLuaDevice(void) +{ + if (mainLuaState) + { + lua_close(mainLuaState); + mainLuaState = 0; + L = 0; + } +} + +// Execute raylib Lua code +RLUADEF void ExecuteLuaCode(const char *code) +{ + if (!mainLuaState) + { + TraceLog(WARNING, "Lua device not initialized"); + return; + } + + int result = luaL_dostring(L, code); + + switch (result) + { + case LUA_OK: break; + case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); break; + case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); break; + default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); break; + } +} + +// Execute raylib Lua script +RLUADEF void ExecuteLuaFile(const char *filename) +{ + if (!mainLuaState) + { + TraceLog(WARNING, "Lua device not initialized"); + return; + } + + int result = luaL_dofile(L, filename); + + switch (result) + { + case LUA_OK: break; + case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); + case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); + default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); + } +} + +#endif // RLUA_IMPLEMENTATION -- cgit v1.2.3 From 5c30e079f4da0c042248f48e5cc39b48e948ab10 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 3 Aug 2016 21:39:22 +0200 Subject: [rlua] new module: raylib Lua binding --- src/rlua.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 6a909c43..d157002d 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -3628,4 +3628,4 @@ RLUADEF void ExecuteLuaFile(const char *filename) } } -#endif // RLUA_IMPLEMENTATION +#endif // RLUA_IMPLEMENTATION \ No newline at end of file -- cgit v1.2.3 From 70ec517fdaa927ff3dacb60ff0090a9312a22dca Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 3 Aug 2016 23:15:44 +0200 Subject: Updated some functions --- src/rlua.h | 179 ++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 105 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index d157002d..df6eef1c 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -263,7 +263,7 @@ static int LuaIndexTexture2D(lua_State* L) return 1; } -// TODO: RenderTexture2D? +// TODO: Build opaque metatable for RenderTexture2D? static int LuaIndexSpriteFont(lua_State* L) { @@ -292,7 +292,7 @@ static void LuaBuildOpaqueMetatables(void) lua_setfield(L, -2, "__index"); lua_pop(L, 1); - // TODO? + // TODO: Build opaque metatable for RenderTexture2D? /* luaL_newmetatable(L, "RenderTexture2D"); lua_pushcfunction(L, &LuaIndexRenderTexture2D); @@ -403,13 +403,9 @@ static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) return result; } -// TODO: -//BoundingBox -//LightData, *Light -//MusicData *Music; -//AudioStream - -// TODO: Review Mesh, Shader +// TODO: LightData, *Light +// TODO: MusicData *Music; +// TODO: AudioStream static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) { @@ -699,7 +695,7 @@ int lua_InitWindow(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); int arg2 = LuaGetArgument_int(L, 2); - const char* arg3 = LuaGetArgument_string(L, 3); + const char * arg3 = LuaGetArgument_string(L, 3); InitWindow(arg1, arg2, arg3); return 0; } @@ -763,11 +759,17 @@ int lua_IsCursorHidden(lua_State* L) return 1; } -// TODO: -/* -void EnableCursor(void); // Enables cursor -void DisableCursor(void); // Disables cursor -*/ +int lua_EnableCursor(lua_State* L) +{ + EnableCursor(); + return 0; +} + +int lua_DisableCursor(lua_State* L) +{ + DisableCursor(); + return 0; +} int lua_ClearBackground(lua_State* L) { @@ -788,9 +790,18 @@ int lua_EndDrawing(lua_State* L) return 0; } -// TODO: -//void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera -//void End2dMode(void); // Ends 2D mode custom camera usage +int lua_Begin2dMode(lua_State* L) +{ + Camera2D arg1 = LuaGetArgument_Camera2D(L, 1); + Begin2dMode(arg1); + return 0; +} + +int lua_End2dMode(lua_State* L) +{ + End2dMode(); + return 0; +} int lua_Begin3dMode(lua_State* L) { @@ -805,9 +816,18 @@ int lua_End3dMode(lua_State* L) return 0; } -// TODO: -//void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing -//void EndTextureMode(void); // Ends drawing to render texture +int lua_BeginTextureMode(lua_State* L) +{ + RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); + BeginTextureMode(arg1); + return 0; +} + +int lua_EndTextureMode(lua_State* L) +{ + EndTextureMode(); + return 0; +} int lua_GetMouseRay(lua_State* L) { @@ -818,9 +838,22 @@ int lua_GetMouseRay(lua_State* L) return 1; } -// TODO: -//Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position -//Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) +int lua_GetWorldToScreen(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Camera arg2 = LuaGetArgument_Camera(L, 2); + Vector2 result = GetWorldToScreen(arg1, arg2); + LuaPush_Vector2(L, result); + return 1; +} + +int lua_GetCameraMatrix(lua_State* L) +{ + Camera arg1 = LuaGetArgument_Camera(L, 1); + Matrix result = GetCameraMatrix(arg1); + LuaPush_Matrix(L, &result); + return 1; +} #if defined(PLATFORM_WEB) @@ -1014,17 +1047,14 @@ int lua_IsGamepadAvailable(lua_State* L) return 1; } -// TODO: Review -// float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis -/* -int lua_GetGamepadMovement(lua_State* L) +int GetGamepadAxisMovement(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - Vector2 result = GetGamepadMovement(arg1); - LuaPush_Vector2(L, result); + int arg2 = LuaGetArgument_int(L, 2); + float result = GetGamepadAxisMovement(arg1, arg2); + LuaPush_float(L, result); return 1; } -*/ int lua_IsGamepadButtonPressed(lua_State* L) { @@ -1152,14 +1182,32 @@ int lua_GetTouchPosition(lua_State* L) return 1; } -// TODO: -/* + #if defined(PLATFORM_ANDROID) -bool IsButtonPressed(int button); // Detect if an android physic button has been pressed -bool IsButtonDown(int button); // Detect if an android physic button is being pressed -bool IsButtonReleased(int button); // Detect if an android physic button has been released +int lua_IsButtonPressed(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonPressed(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsButtonDown(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonDown(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_IsButtonReleased(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonReleased(arg1); + lua_pushboolean(L, result); + return 1; +} #endif -*/ //------------------------------------------------------------------------------------ // raylib [gestures] module functions - Gestures and Touch Handling @@ -1179,8 +1227,7 @@ int lua_IsGestureDetected(lua_State* L) return 1; } -// TODO: -///void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures +// TODO: void ProcessGestureEvent(GestureEvent event); int lua_UpdateGestures(lua_State* L) { @@ -1655,10 +1702,9 @@ int lua_LoadTexture(lua_State* L) return 1; } -// TODO: Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); int lua_LoadTextureEx(lua_State* L) { - void * arg1 = LuaGetArgument_string(L, 1); // TODO: How to get a void * ? + void * arg1 = LuaGetArgument_string(L, 1); // NOTE: getting argument as string int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); @@ -1782,7 +1828,13 @@ int lua_GenTextureMipmaps(lua_State* L) return 0; } -// TODO: void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data +int lua_UpdateTexture(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + void * arg2 = LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string + UpdateTexture(arg1, arg2); + return 0; +} int lua_DrawTexture(lua_State* L) { @@ -1875,7 +1927,7 @@ int lua_DrawText(lua_State* L) int lua_DrawTextEx(lua_State* L) { SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char* arg2 = LuaGetArgument_string(L, 2); + const char * arg2 = LuaGetArgument_string(L, 2); Vector2 arg3 = LuaGetArgument_Vector2(L, 3); int arg4 = LuaGetArgument_int(L, 4); int arg5 = LuaGetArgument_int(L, 5); @@ -1912,11 +1964,8 @@ int lua_DrawFPS(lua_State* L) return 0; } -// TODO: -/* -const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' -const char *SubText(const char *text, int position, int length); // Get a piece of a text string -*/ +// TODO: const char *FormatText(const char *text, ...); +// TODO: const char *SubText(const char *text, int position, int length); int lua_DrawCube(lua_State* L) { @@ -2108,7 +2157,7 @@ int lua_UnloadModel(lua_State* L) return 0; } -// TODO: GenMesh*() +// TODO: GenMesh*() functionality (not ready yet on raylib 1.6) int lua_LoadMaterial(lua_State* L) { @@ -2211,7 +2260,7 @@ int lua_CalculateBoundingBox(lua_State* L) Mesh arg1 = LuaGetArgument_Mesh(L, 1); BoundingBox result = CalculateBoundingBox(arg1); LuaPush_BoundingBox(L, result); - return 0; + return 1; } int lua_CheckCollisionSpheres(lua_State* L) @@ -2269,8 +2318,8 @@ int lua_ResolveCollisionCubicmap(lua_State* L) //------------------------------------------------------------------------------------ int lua_LoadShader(lua_State* L) { - char * arg1 = (char*)LuaGetArgument_string(L, 1); - char * arg2 = (char*)LuaGetArgument_string(L, 2); + const char * arg1 = LuaGetArgument_string(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); Shader result = LoadShader(arg1, arg2); LuaPush_Shader(L, result); return 1; @@ -2401,7 +2450,7 @@ void ToggleVrMode(void); // Enable/Disable VR experience (dev */ //------------------------------------------------------------------------------------ -// raylib [audio] module functions +// raylib [audio] module functions - Audio Loading and Playing //------------------------------------------------------------------------------------ int lua_InitAudioDevice(lua_State* L) { @@ -2419,7 +2468,7 @@ int lua_IsAudioDeviceReady(lua_State* L) { bool result = IsAudioDeviceReady(); lua_pushboolean(L, result); - return 0; + return 1; } int lua_LoadSound(lua_State* L) @@ -2511,7 +2560,7 @@ int lua_LoadMusicStream(lua_State* L) const char * arg1 = LuaGetArgument_string(L, 1); Music result = LoadMusicStream((char *)arg1); LuaPush_Music(L, result); - return 0; + return 1; } int lua_UnloadMusicStream(lua_State* L) @@ -3442,24 +3491,6 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("BUTTON_START", 10); LuaEndEnum("GAMEPAD"); - LuaStartEnum(); - LuaSetEnum("PLAYER1", 0); - LuaSetEnum("PLAYER2", 1); - LuaSetEnum("PLAYER3", 2); - LuaSetEnum("PLAYER4", 3); - - LuaSetEnum("BUTTON_A", 2); - LuaSetEnum("BUTTON_B", 1); - LuaSetEnum("BUTTON_X", 3); - LuaSetEnum("BUTTON_Y", 4); - LuaSetEnum("BUTTON_R1", 7); - LuaSetEnum("BUTTON_R2", 5); - LuaSetEnum("BUTTON_L1", 6); - LuaSetEnum("BUTTON_L2", 8); - LuaSetEnum("BUTTON_SELECT", 9); - LuaSetEnum("BUTTON_START", 10); - LuaEndEnum("GAMEPAD"); - // TODO: XBOX controller buttons enum lua_pushglobaltable(L); @@ -3628,4 +3659,4 @@ RLUADEF void ExecuteLuaFile(const char *filename) } } -#endif // RLUA_IMPLEMENTATION \ No newline at end of file +#endif // RLUA_IMPLEMENTATION -- cgit v1.2.3 From 055d50134567474224f050dc014f6158d496026e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 3 Aug 2016 23:25:39 +0200 Subject: Corrected bug --- src/rlua.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index df6eef1c..ae899945 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -1047,12 +1047,12 @@ int lua_IsGamepadAvailable(lua_State* L) return 1; } -int GetGamepadAxisMovement(lua_State* L) +int lua_GetGamepadAxisMovement(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); int arg2 = LuaGetArgument_int(L, 2); float result = GetGamepadAxisMovement(arg1, arg2); - LuaPush_float(L, result); + lua_pushnumber(L, result); return 1; } @@ -2318,8 +2318,8 @@ int lua_ResolveCollisionCubicmap(lua_State* L) //------------------------------------------------------------------------------------ int lua_LoadShader(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); + char * arg1 = (char *)LuaGetArgument_string(L, 1); + char * arg2 = (char *)LuaGetArgument_string(L, 2); Shader result = LoadShader(arg1, arg2); LuaPush_Shader(L, result); return 1; -- cgit v1.2.3 From 80789e6140fd86a8063ff13e4e8db9dccdff804d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 4 Aug 2016 13:40:53 +0200 Subject: Updated Lua binding --- src/rlua.h | 692 ++++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 574 insertions(+), 118 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index ae899945..76a79c7c 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -15,7 +15,7 @@ * local x2 = rec.x + rec.width * * The following types: -* Image, Texture2D, SpriteFont +* Image, Texture2D, RenderTexture2D, SpriteFont * are immutable, and you can only read their non-pointer arguments (e.g. sprfnt.size). * * All other object types are opaque, that is, you cannot access or @@ -126,9 +126,11 @@ RLUADEF void CloseLuaDevice(void); // De-initialize Lua system #define LuaPush_SpriteFont(L, sf) LuaPushOpaqueTypeWithMetatable(L, sf, SpriteFont) #define LuaPush_Mesh(L, vd) LuaPushOpaqueType(L, vd) #define LuaPush_Shader(L, s) LuaPushOpaqueType(L, s) +#define LuaPush_Light(L, light) LuaPushOpaqueType(L, light) #define LuaPush_Sound(L, snd) LuaPushOpaqueType(L, snd) #define LuaPush_Wave(L, wav) LuaPushOpaqueType(L, wav) #define LuaPush_Music(L, mus) LuaPushOpaqueType(L, mus) +#define LuaPush_AudioStream(L, aud) LuaPushOpaqueType(L, aud) #define LuaGetArgument_string luaL_checkstring #define LuaGetArgument_int (int)luaL_checkinteger @@ -142,9 +144,11 @@ RLUADEF void CloseLuaDevice(void); // De-initialize Lua system #define LuaGetArgument_SpriteFont(L, sf) *(SpriteFont*)LuaGetArgumentOpaqueTypeWithMetatable(L, sf, "SpriteFont") #define LuaGetArgument_Mesh(L, vd) *(Mesh*)LuaGetArgumentOpaqueType(L, vd) #define LuaGetArgument_Shader(L, s) *(Shader*)LuaGetArgumentOpaqueType(L, s) +#define LuaGetArgument_Light(L, light) *(Light*)LuaGetArgumentOpaqueType(L, light) #define LuaGetArgument_Sound(L, snd) *(Sound*)LuaGetArgumentOpaqueType(L, snd) #define LuaGetArgument_Wave(L, wav) *(Wave*)LuaGetArgumentOpaqueType(L, wav) #define LuaGetArgument_Music(L, mus) *(Music*)LuaGetArgumentOpaqueType(L, mus) +#define LuaGetArgument_AudioStream(L, aud) *(AudioStream*)LuaGetArgumentOpaqueType(L, aud) #define LuaPushOpaqueType(L, str) LuaPushOpaque(L, &str, sizeof(str)) #define LuaPushOpaqueTypeWithMetatable(L, str, meta) LuaPushOpaqueWithMetatable(L, &str, sizeof(str), #meta) @@ -263,7 +267,18 @@ static int LuaIndexTexture2D(lua_State* L) return 1; } -// TODO: Build opaque metatable for RenderTexture2D? +static int LuaIndexRenderTexture2D(lua_State* L) +{ + RenderTexture2D img = LuaGetArgument_RenderTexture2D(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "texture")) + LuaPush_Texture2D(L, img.texture); + else if (!strcmp(key, "depth")) + LuaPush_Texture2D(L, img.depth); + else + return 0; + return 1; +} static int LuaIndexSpriteFont(lua_State* L) { @@ -292,13 +307,11 @@ static void LuaBuildOpaqueMetatables(void) lua_setfield(L, -2, "__index"); lua_pop(L, 1); - // TODO: Build opaque metatable for RenderTexture2D? - /* luaL_newmetatable(L, "RenderTexture2D"); lua_pushcfunction(L, &LuaIndexRenderTexture2D); lua_setfield(L, -2, "__index"); lua_pop(L, 1); - */ + luaL_newmetatable(L, "SpriteFont"); lua_pushcfunction(L, &LuaIndexSpriteFont); lua_setfield(L, -2, "__index"); @@ -403,10 +416,6 @@ static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) return result; } -// TODO: LightData, *Light -// TODO: MusicData *Music; -// TODO: AudioStream - static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) { BoundingBox result; @@ -649,6 +658,23 @@ static int lua_Vector3(lua_State* L) return 1; } +static int lua_Quaternion(lua_State* L) +{ + LuaPush_Quaternion(L, (Quaternion) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4) }); + return 1; +} + +/* +static int lua_Matrix(lua_State* L) +{ + LuaPush_Matrix(L, (Matrix) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4), + (float)luaL_checknumber(L, 5), (float)luaL_checknumber(L, 6), (float)luaL_checknumber(L, 7), (float)luaL_checknumber(L, 8), + (float)luaL_checknumber(L, 9), (float)luaL_checknumber(L, 10), (float)luaL_checknumber(L, 11), (float)luaL_checknumber(L, 12), + (float)luaL_checknumber(L, 13), (float)luaL_checknumber(L, 14), (float)luaL_checknumber(L, 15), (float)luaL_checknumber(L, 16) }); + return 1; +} +*/ + static int lua_Rectangle(lua_State* L) { LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); @@ -663,6 +689,14 @@ static int lua_Ray(lua_State* L) return 1; } +static int lua_BoundingBox(lua_State* L) +{ + Vector3 min = LuaGetArgument_Vector3(L, 1); + Vector3 max = LuaGetArgument_Vector3(L, 2); + LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y }, { max.x, max.y } }); + return 1; +} + static int lua_Camera(lua_State* L) { Vector3 pos = LuaGetArgument_Vector3(L, 1); @@ -683,6 +717,22 @@ static int lua_Camera2D(lua_State* L) return 1; } +/* +// NOTE: does it make sense to have this constructor? Probably not... +static int lua_Material(lua_State* L) +{ + Shader sdr = LuaGetArgument_Shader(L, 1); + Texture2D td = LuaGetArgument_Texture2D(L, 2); + Texture2D tn = LuaGetArgument_Texture2D(L, 3); + Texture2D ts = LuaGetArgument_Texture2D(L, 4); + Color cd = LuaGetArgument_Color(L, 5); + Color ca = LuaGetArgument_Color(L, 6); + Color cs = LuaGetArgument_Color(L, 7); + float gloss = LuaGetArgument_float(L, 8); + LuaPush_Material(L, (Material) { sdr, td, tn, ts cd, ca, cs, gloss }); + return 1; +} +*/ /************************************************************************************* * raylib Lua Functions Bindings @@ -914,12 +964,47 @@ int lua_GetHexValue(lua_State* L) return 1; } -// TODO: -/* -float *ColorToFloat(Color color); // Converts Color to float array and normalizes -float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array -float *MatrixToFloat(Matrix mat); // Converts Matrix to float array -*/ +int lua_ColorToFloat(lua_State* L) +{ + Color arg1 = LuaGetArgument_Color(L, 1); + float * result = ColorToFloat(arg1); + lua_createtable(L, 4, 0); + for (int i = 0; i < 4; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; +} + +int lua_VectorToFloat(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float * result = VectorToFloat(arg1); + lua_createtable(L, 3, 0); + for (int i = 0; i < 3; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; +} + +int lua_MatrixToFloat(lua_State* L) +{ + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float * result = MatrixToFloat(arg1); + lua_createtable(L, 16, 0); + for (int i = 0; i < 16; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; +} int lua_GetRandomValue(lua_State* L) { @@ -1227,8 +1312,6 @@ int lua_IsGestureDetected(lua_State* L) return 1; } -// TODO: void ProcessGestureEvent(GestureEvent event); - int lua_UpdateGestures(lua_State* L) { UpdateGestures(); @@ -1704,7 +1787,7 @@ int lua_LoadTexture(lua_State* L) int lua_LoadTextureEx(lua_State* L) { - void * arg1 = LuaGetArgument_string(L, 1); // NOTE: getting argument as string + void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); @@ -1800,26 +1883,172 @@ int lua_ImageFormat(lua_State* L) return 1; } -// TODO: -/* -void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) -void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) -Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image -void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) -void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) -void ImageFlipVertical(Image *image); // Flip image vertically -void ImageFlipHorizontal(Image *image); // Flip image horizontally -void ImageColorTint(Image *image, Color color); // Modify image color: tint -void ImageColorInvert(Image *image); // Modify image color: invert -void ImageColorGrayscale(Image *image); // Modify image color: grayscale -void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -*/ +int lua_ImageDither(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + ImageDither(&arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageCopy(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Image result = ImageCopy(arg1); + LuaPush_Image(L, result); + return 1; +} + +int lua_ImageCrop(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + ImageCrop(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageResize(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + ImageResize(&arg1, arg2, arg3); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageResizeNN(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + ImageResizeNN(&arg1, arg2, arg3); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageText(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + Image result = ImageText(arg1, arg2, arg3); + LuaPush_Image(L, result); + return 1; +} + +int lua_ImageTextEx(lua_State* L) +{ + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Image result = ImageTextEx(arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, result); + return 1; +} + +int lua_ImageDraw(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Image arg2 = LuaGetArgument_Image(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Rectangle arg4 = LuaGetArgument_Rectangle(L, 4); + ImageDraw(&arg1, arg2, arg3, arg4); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageDrawText(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + const char * arg3 = LuaGetArgument_string(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + ImageDrawText(&arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageDrawTextEx(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + SpriteFont arg3 = LuaGetArgument_SpriteFont(L, 3); + const char * arg4 = LuaGetArgument_string(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + int arg6 = LuaGetArgument_int(L, 6); + Color arg7 = LuaGetArgument_Color(L, 7); + ImageDrawTextEx(&arg1, arg2, arg3, arg4, arg5, arg6, arg7); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageFlipVertical(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + ImageFlipVertical(&arg1); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageFlipHorizontal(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + ImageFlipHorizontal(&arg1); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageColorTint(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + ImageColorTint(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageColorInvert(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + ImageColorInvert(&arg1); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageColorGrayscale(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + ImageColorGrayscale(&arg1); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageColorContrast(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + ImageColorContrast(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} + +int lua_ImageColorBrightness(lua_State* L) +{ + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + ImageColorBrightness(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; +} int lua_GenTextureMipmaps(lua_State* L) { @@ -1831,7 +2060,7 @@ int lua_GenTextureMipmaps(lua_State* L) int lua_UpdateTexture(lua_State* L) { Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - void * arg2 = LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string + void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? UpdateTexture(arg1, arg2); return 0; } @@ -2097,12 +2326,27 @@ int lua_DrawGizmo(lua_State* L) return 0; } -// TODO: -/* -void DrawLight(Light light); // Draw light in 3D world -void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space -*/ +// TODO: DrawLight(Light light); + +int lua_Draw3DLine(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + Draw3DLine(arg1, arg2, arg3); + return 0; +} + +int lua_Draw3DCircle(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Draw3DCircle(arg1, arg2, arg3, arg4, arg5); + return 0; +} //------------------------------------------------------------------------------------ // raylib [models] module functions @@ -2287,19 +2531,42 @@ int lua_CheckCollisionBoxSphere(lua_State* L) { BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 4); + float arg3 = LuaGetArgument_float(L, 3); bool result = CheckCollisionBoxSphere(arg1, arg2, arg3); lua_pushboolean(L, result); return 1; } -// TODO: -/* -bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere -bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection -bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap -*/ +int lua_CheckCollisionRaySphere(lua_State* L) +{ + Ray arg1 = LuaGetArgument_Ray(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + bool result = CheckCollisionRaySphere(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; +} + +int lua_CheckCollisionRaySphereEx(lua_State* L) +{ + Ray arg1 = LuaGetArgument_Ray(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + bool result = CheckCollisionRaySphereEx(arg1, arg2, arg3, &arg4); + lua_pushboolean(L, result); + LuaPush_Vector3(L, arg4); + return 2; +} + +int lua_CheckCollisionRayBox(lua_State* L) +{ + Ray arg1 = LuaGetArgument_Ray(L, 1); + BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); + bool result = CheckCollisionRayBox(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} int lua_ResolveCollisionCubicmap(lua_State* L) { @@ -2431,23 +2698,55 @@ int lua_EndBlendMode(lua_State* L) return 0; } -// TODO: -//Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool -//void DestroyLight(Light light); // Destroy a light and take it out of the list +// TODO: Light CreateLight(int type, Vector3 position, Color diffuse); +// TODO: void DestroyLight(Light light); -// TODO: -/* //------------------------------------------------------------------------------------ // raylib [rlgl] module functions - VR experience //------------------------------------------------------------------------------------ -void InitVrDevice(int vdDevice); // Init VR device -void CloseVrDevice(void); // Close VR device -void UpdateVrTracking(void); // Update VR tracking (position and orientation) -void BeginVrDrawing(void); // Begin VR drawing configuration -void EndVrDrawing(void); // End VR drawing process (and desktop mirror) -bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready -void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) -*/ +int lua_InitVrDevice(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + InitVrDevice(arg1); + return 0; +} + +int lua_CloseVrDevice(lua_State* L) +{ + CloseVrDevice(); + return 0; +} + +int lua_UpdateVrTracking(lua_State* L) +{ + UpdateVrTracking(); + return 0; +} + +int lua_BeginVrDrawing(lua_State* L) +{ + BeginVrDrawing(); + return 0; +} + +int lua_EndVrDrawing(lua_State* L) +{ + EndVrDrawing(); + return 0; +} + +int lua_IsVrDeviceReady(lua_State* L) +{ + bool result = IsVrDeviceReady(); + lua_pushboolean(L, result); + return 1; +} + +int lua_ToggleVrMode(lua_State* L) +{ + ToggleVrMode(); + return 0; +} //------------------------------------------------------------------------------------ // raylib [audio] module functions - Audio Loading and Playing @@ -2570,20 +2869,21 @@ int lua_UnloadMusicStream(lua_State* L) return 0; } -int lua_PlayMusicStream(lua_State* L) +int lua_UpdateMusicStream(lua_State* L) { - Music arg1 = LuaGetArgument_Music(L, 1); - PlayMusicStream(arg1); + Music arg1 = LuaGetArgument_Music(L, 1); + UpdateMusicStream(arg1); return 0; } -int lua_UpdateMusicStream(lua_State* L) +int lua_PlayMusicStream(lua_State* L) { - Music arg1 = LuaGetArgument_Music(L, 1); - UpdateMusicStream(arg1); + Music arg1 = LuaGetArgument_Music(L, 1); + PlayMusicStream(arg1); return 0; } + int lua_StopMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); @@ -2621,6 +2921,14 @@ int lua_SetMusicVolume(lua_State* L) return 0; } +int lua_SetMusicPitch(lua_State* L) +{ + Music arg1 = LuaGetArgument_Music(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetMusicPitch(arg1, arg2); + return 0; +} + int lua_GetMusicTimeLength(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); @@ -2637,19 +2945,68 @@ int lua_GetMusicTimePlayed(lua_State* L) return 1; } -// TODO: -/* -AudioStream InitAudioStream(unsigned int sampleRate, - unsigned int sampleSize, - unsigned int channels); // Init audio stream (to stream audio pcm data) -void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data -void CloseAudioStream(AudioStream stream); // Close audio stream and free memory -bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -void PlayAudioStream(AudioStream stream); // Play audio stream -void PauseAudioStream(AudioStream stream); // Pause audio stream -void ResumeAudioStream(AudioStream stream); // Resume audio stream -void StopAudioStream(AudioStream stream); // Stop audio stream -*/ +int lua_InitAudioStream(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + AudioStream result = InitAudioStream(arg1, arg2, arg3); + LuaPush_AudioStream(L, result); + return 1; +} + +int lua_CloseAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + CloseAudioStream(arg1); + return 0; +} + +int lua_UpdateAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + void * arg2 = (char *)LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + UpdateAudioStream(arg1, arg2, arg3); + return 0; +} + +int lua_IsAudioBufferProcessed(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + bool result = IsAudioBufferProcessed(arg1); + lua_pushboolean(L, result); + return 1; +} + +int lua_PlayAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + PlayAudioStream(arg1); + return 0; +} + + +int lua_StopAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + StopAudioStream(arg1); + return 0; +} + +int lua_PauseAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + PauseAudioStream(arg1); + return 0; +} + +int lua_ResumeAudioStream(lua_State* L) +{ + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + ResumeAudioStream(arg1); + return 0; +} //---------------------------------------------------------------------------------- // raylib [utils] module functions @@ -3114,29 +3471,49 @@ int lua_QuaternionTransform(lua_State* L) // raylib Functions (and data types) list static luaL_Reg raylib_functions[] = { - REG(Color) + + // Register non-opaque data types + REG(Color) REG(Vector2) REG(Vector3) + //REG(Matrix) + REG(Quaternion) REG(Rectangle) REG(Ray) REG(Camera) - // TODO: Additional structs + REG(Camera2D) + REG(BoundingBox) + //REG(Material) - // TODO: Review registered functions + // Register functions REG(InitWindow) REG(CloseWindow) REG(WindowShouldClose) REG(IsWindowMinimized) REG(ToggleFullscreen) - REG(GetScreenWidth) REG(GetScreenHeight) + + REG(ShowCursor) + REG(HideCursor) + REG(IsCursorHidden) + REG(EnableCursor) + REG(DisableCursor) + REG(ClearBackground) REG(BeginDrawing) REG(EndDrawing) + REG(Begin2dMode) + REG(End2dMode) REG(Begin3dMode) REG(End3dMode) + REG(BeginTextureMode) + REG(EndTextureMode) + REG(GetMouseRay) + REG(GetWorldToScreen) + REG(GetCameraMatrix) + #if defined(PLATFORM_WEB) REG(SetDrawingLoop) #else @@ -3144,21 +3521,39 @@ static luaL_Reg raylib_functions[] = { #endif REG(GetFPS) REG(GetFrameTime) + REG(GetColor) REG(GetHexValue) + REG(ColorToFloat) + REG(VectorToFloat) + REG(MatrixToFloat) REG(GetRandomValue) REG(Fade) REG(SetConfigFlags) REG(ShowLogo) + REG(IsFileDropped) //REG(*GetDroppedFiles) REG(ClearDroppedFiles) + REG(StorageSaveValue) + REG(StorageLoadValue) + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) REG(IsKeyPressed) REG(IsKeyDown) REG(IsKeyReleased) REG(IsKeyUp) REG(GetKeyPressed) + REG(SetExitKey) + + REG(IsGamepadAvailable) + REG(GetGamepadAxisMovement) + REG(IsGamepadButtonPressed) + REG(IsGamepadButtonDown) + REG(IsGamepadButtonReleased) + REG(IsGamepadButtonUp) +#endif + REG(IsMouseButtonPressed) REG(IsMouseButtonDown) REG(IsMouseButtonReleased) @@ -3168,50 +3563,41 @@ static luaL_Reg raylib_functions[] = { REG(GetMousePosition) REG(SetMousePosition) REG(GetMouseWheelMove) - REG(ShowCursor) - REG(HideCursor) - REG(IsCursorHidden) -#endif - -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - REG(IsGamepadAvailable) - - REG(IsGamepadButtonPressed) - REG(IsGamepadButtonDown) - REG(IsGamepadButtonReleased) - REG(IsGamepadButtonUp) -#endif - -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) REG(GetTouchX) REG(GetTouchY) REG(GetTouchPosition) -#if defined(PLATFORM_WEB) - REG(InitGesturesSystem) -#elif defined(PLATFORM_ANDROID) - //REG(InitGesturesSystem) + +#if defined(PLATFORM_ANDROID) + REG(IsButtonPressed) + REG(IsButtonDown) + REG(IsButtonReleased) #endif - REG(UpdateGestures) - REG(IsGestureDetected) - REG(GetGestureType) + REG(SetGesturesEnabled) - REG(GetGestureDragIntensity) - REG(GetGestureDragAngle) - REG(GetGestureDragVector) + REG(IsGestureDetected) + //REG(ProcessGestureEvent) + REG(UpdateGestures) + REG(GetTouchPointsCount) + REG(GetGestureDetected) REG(GetGestureHoldDuration) - REG(GetGesturePinchDelta) + REG(GetGestureDragVector) + REG(GetGestureDragAngle) + REG(GetGesturePinchVector) REG(GetGesturePinchAngle) -#endif + REG(SetCameraMode) REG(UpdateCamera) REG(UpdateCameraPlayer) REG(SetCameraPosition) REG(SetCameraTarget) + REG(SetCameraFovy) + REG(SetCameraPanControl) REG(SetCameraAltControl) REG(SetCameraSmoothZoomControl) REG(SetCameraMoveControls) REG(SetCameraMouseSensitivity) + REG(DrawPixel) REG(DrawPixelV) REG(DrawLine) @@ -3230,6 +3616,7 @@ static luaL_Reg raylib_functions[] = { REG(DrawPoly) REG(DrawPolyEx) REG(DrawPolyExLines) + REG(CheckCollisionRecs) REG(CheckCollisionCircles) REG(CheckCollisionCircleRec) @@ -3237,25 +3624,48 @@ static luaL_Reg raylib_functions[] = { REG(CheckCollisionPointRec) REG(CheckCollisionPointCircle) REG(CheckCollisionPointTriangle) + REG(LoadImage) REG(LoadImageEx) REG(LoadImageRaw) REG(LoadImageFromRES) REG(LoadTexture) + REG(LoadTextureEx) REG(LoadTextureFromRES) REG(LoadTextureFromImage) + REG(LoadRenderTexture) REG(UnloadImage) REG(UnloadTexture) REG(GetImageData) REG(GetTextureData) REG(ImageToPOT) REG(ImageFormat) + REG(ImageDither) + REG(ImageCopy) + REG(ImageCrop) + REG(ImageResize) + REG(ImageResizeNN) + REG(ImageText) + REG(ImageTextEx) + REG(ImageDraw) + REG(ImageDrawText) + REG(ImageDrawTextEx) + REG(ImageFlipVertical) + REG(ImageFlipHorizontal) + REG(ImageColorTint) + REG(ImageColorInvert) + REG(ImageColorGrayscale) + REG(ImageColorContrast) + REG(ImageColorBrightness) REG(GenTextureMipmaps) + REG(UpdateTexture) + REG(DrawTexture) REG(DrawTextureV) REG(DrawTextureEx) REG(DrawTextureRec) REG(DrawTexturePro) + REG(GetDefaultFont) REG(LoadSpriteFont) REG(UnloadSpriteFont) @@ -3264,6 +3674,9 @@ static luaL_Reg raylib_functions[] = { REG(MeasureText) REG(MeasureTextEx) REG(DrawFPS) + //REG(FormatText) + //REG(SubText) + REG(DrawCube) REG(DrawCubeV) REG(DrawCubeWires) @@ -3277,49 +3690,92 @@ static luaL_Reg raylib_functions[] = { REG(DrawRay) REG(DrawGrid) REG(DrawGizmo) + REG(LoadModel) REG(LoadModelEx) + REG(LoadModelFromRES) REG(LoadHeightmap) REG(LoadCubicmap) REG(UnloadModel) + //REG(GenMesh*) // Not ready yet... + REG(DrawModel) REG(DrawModelEx) REG(DrawModelWires) + REG(DrawModelWiresEx) REG(DrawBillboard) REG(DrawBillboardRec) + REG(CalculateBoundingBox) REG(CheckCollisionSpheres) REG(CheckCollisionBoxes) REG(CheckCollisionBoxSphere) + REG(CheckCollisionRaySphere) + REG(CheckCollisionRaySphereEx) + REG(CheckCollisionRayBox) REG(ResolveCollisionCubicmap) + REG(LoadShader) REG(UnloadShader) + REG(GetDefaultShader) + REG(GetStandardShader) + REG(GetDefaultTexture) REG(GetShaderLocation) REG(SetShaderValue) REG(SetShaderValuei) - + REG(SetShaderValueMatrix) + REG(SetMatrixProjection) + REG(SetMatrixModelview) + REG(BeginShaderMode) + REG(EndShaderMode) REG(BeginBlendMode) REG(EndBlendMode) + //REG(CreateLight) + //REG(DestroyLight) + + REG(InitVrDevice) + REG(CloseVrDevice) + REG(UpdateVrTracking) + REG(BeginVrDrawing) + REG(EndVrDrawing) + REG(IsVrDeviceReady) + REG(ToggleVrMode) + REG(InitAudioDevice) REG(CloseAudioDevice) + REG(IsAudioDeviceReady) REG(LoadSound) REG(LoadSoundFromWave) REG(LoadSoundFromRES) REG(UnloadSound) REG(PlaySound) REG(PauseSound) + REG(ResumeSound) REG(StopSound) REG(IsSoundPlaying) REG(SetSoundVolume) REG(SetSoundPitch) - REG(PlayMusicStream) + + REG(LoadMusicStream) + REG(UnloadMusicStream) REG(UpdateMusicStream) + REG(PlayMusicStream) REG(StopMusicStream) REG(PauseMusicStream) REG(ResumeMusicStream) REG(IsMusicPlaying) REG(SetMusicVolume) + REG(SetMusicPitch) REG(GetMusicTimeLength) REG(GetMusicTimePlayed) + + REG(InitAudioStream) + REG(UpdateAudioStream) + REG(CloseAudioStream) + REG(IsAudioBufferProcessed) + REG(PlayAudioStream) + REG(PauseAudioStream) + REG(ResumeAudioStream) + REG(StopAudioStream) /// Math and util REG(DecompressData) -- cgit v1.2.3 From 3d519c7a397f38f4d1d219615ec0ec74b4eaabd3 Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Thu, 4 Aug 2016 15:48:37 +0200 Subject: Fix install command of src/ makefile --- src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index c41fe2f5..1360a920 100644 --- a/src/Makefile +++ b/src/Makefile @@ -222,10 +222,10 @@ ifeq ($(ROOT),root) # /usr/local/include/) are for libraries that are installed # manually (without a package manager). ifeq ($(SHARED),YES) - cp --update libraylib.so /usr/local/lib/libraylib.so + cp --update $(OUTPUT_PATH)/libraylib.so /usr/local/lib/libraylib.so else cp --update raylib.h /usr/local/include/raylib.h - cp --update libraylib.a /usr/local/lib/libraylib.a + cp --update $(OUTPUT_PATH)/libraylib.a /usr/local/lib/libraylib.a endif @echo "raylib dev files installed/updated!" else -- cgit v1.2.3 From 5f1b4e94745303ab9df87421cdd9ffb9448fee01 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 11:30:34 +0200 Subject: Updated Lua module --- src/rlua.h | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 76a79c7c..675edbfc 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -4,7 +4,7 @@ * * NOTE 01: * The following types: -* Color, Vector2, Vector3, Rectangle, Ray, Camera +* Color, Vector2, Vector3, Rectangle, Ray, Camera, Camera2D * are treated as objects with named fields, same as in C. * * Lua defines utility functions for creating those objects. @@ -178,6 +178,7 @@ static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index); static Color LuaGetArgument_Color(lua_State* L, int index); static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index); static Camera LuaGetArgument_Camera(lua_State* L, int index); +static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index); static Ray LuaGetArgument_Ray(lua_State* L, int index); static Matrix LuaGetArgument_Matrix(lua_State* L, int index); static Model LuaGetArgument_Model(lua_State* L, int index); @@ -594,7 +595,7 @@ static void LuaPush_Camera(lua_State* L, Camera cam) static void LuaPush_Camera2D(lua_State* L, Camera2D cam) { - lua_createtable(L, 0, 3); + lua_createtable(L, 0, 4); LuaPush_Vector2(L, cam.offset); lua_setfield(L, -2, "offset"); LuaPush_Vector2(L, cam.target); @@ -702,8 +703,8 @@ static int lua_Camera(lua_State* L) Vector3 pos = LuaGetArgument_Vector3(L, 1); Vector3 tar = LuaGetArgument_Vector3(L, 2); Vector3 up = LuaGetArgument_Vector3(L, 3); - float fovy = LuaGetArgument_float(L, 4); - LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, fovy }); + //float fovy = LuaGetArgument_float(L, 4); // ??? + LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, (float)luaL_checknumber(L, 4) }); return 1; } @@ -3945,9 +3946,33 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("BUTTON_L2", 8); LuaSetEnum("BUTTON_SELECT", 9); LuaSetEnum("BUTTON_START", 10); - LuaEndEnum("GAMEPAD"); - // TODO: XBOX controller buttons enum + LuaSetEnum("XBOX_BUTTON_A", 0); + LuaSetEnum("XBOX_BUTTON_B", 1); + LuaSetEnum("XBOX_BUTTON_X", 2); + LuaSetEnum("XBOX_BUTTON_Y", 3); + LuaSetEnum("XBOX_BUTTON_LB", 4); + LuaSetEnum("XBOX_BUTTON_RB", 5); + LuaSetEnum("XBOX_BUTTON_SELECT", 6); + LuaSetEnum("XBOX_BUTTON_START", 7); + +#if defined(PLATFORM_RPI) + LuaSetEnum("XBOX_AXIS_DPAD_X", 7); + LuaSetEnum("XBOX_AXIS_DPAD_Y", 6); + LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); + LuaSetEnum("XBOX_AXIS_LT", 2); + LuaSetEnum("XBOX_AXIS_RT", 5); +#else + LuaSetEnum("XBOX_BUTTON_UP", 10); + LuaSetEnum("XBOX_BUTTON_DOWN", 12); + LuaSetEnum("XBOX_BUTTON_LEFT", 13); + LuaSetEnum("XBOX_BUTTON_RIGHT", 11); + LuaSetEnum("XBOX_AXIS_RIGHT_X", 4); + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); + LuaSetEnum("XBOX_AXIS_LT_RT", 2); +#endif + LuaEndEnum("GAMEPAD"); lua_pushglobaltable(L); LuaSetEnumColor("LIGHTGRAY", LIGHTGRAY); @@ -4028,15 +4053,15 @@ RLUADEF void InitLuaDevice(void) LuaEndEnum("CameraMode"); LuaStartEnum(); - LuaSetEnum("HMD_DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); - LuaSetEnum("HMD_OCULUS_RIFT_DK2", HMD_OCULUS_RIFT_DK2); - LuaSetEnum("HMD_OCULUS_RIFT_CV1", HMD_OCULUS_RIFT_CV1); - LuaSetEnum("HMD_VALVE_HTC_VIVE", HMD_VALVE_HTC_VIVE); - LuaSetEnum("HMD_SAMSUNG_GEAR_VR", HMD_SAMSUNG_GEAR_VR); - LuaSetEnum("HMD_GOOGLE_CARDBOARD", HMD_GOOGLE_CARDBOARD); - LuaSetEnum("HMD_SONY_PLAYSTATION_VR", HMD_SONY_PLAYSTATION_VR); - LuaSetEnum("HMD_RAZER_OSVR", HMD_RAZER_OSVR); - LuaSetEnum("HMD_FOVE_VR", HMD_FOVE_VR); + LuaSetEnum("DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); + LuaSetEnum("OCULUS_RIFT_DK2", HMD_OCULUS_RIFT_DK2); + LuaSetEnum("OCULUS_RIFT_CV1", HMD_OCULUS_RIFT_CV1); + LuaSetEnum("VALVE_HTC_VIVE", HMD_VALVE_HTC_VIVE); + LuaSetEnum("SAMSUNG_GEAR_VR", HMD_SAMSUNG_GEAR_VR); + LuaSetEnum("GOOGLE_CARDBOARD", HMD_GOOGLE_CARDBOARD); + LuaSetEnum("SONY_PLAYSTATION_VR", HMD_SONY_PLAYSTATION_VR); + LuaSetEnum("RAZER_OSVR", HMD_RAZER_OSVR); + LuaSetEnum("FOVE_VR", HMD_FOVE_VR); LuaEndEnum("VrDevice"); lua_pushglobaltable(L); -- cgit v1.2.3 From d5f5f0a9302435945b730e5ec001bda39741f3c7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 11:33:05 +0200 Subject: Updated raylib version to 1.6 --- src/core.c | 4 ++-- src/raylib.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 0008ef2f..47463a23 100644 --- a/src/core.c +++ b/src/core.c @@ -293,7 +293,7 @@ static void *GamepadThread(void *arg); // Mouse reading thread // Initialize Window and Graphics Context (OpenGL) void InitWindow(int width, int height, const char *title) { - TraceLog(INFO, "Initializing raylib (v1.5.0)"); + TraceLog(INFO, "Initializing raylib (v1.6.0)"); // Store window title (could be useful...) windowTitle = title; @@ -347,7 +347,7 @@ void InitWindow(int width, int height, const char *title) // Android activity initialization void InitWindow(int width, int height, struct android_app *state) { - TraceLog(INFO, "Initializing raylib (v1.5.0)"); + TraceLog(INFO, "Initializing raylib (v1.6.0)"); app_dummy(); diff --git a/src/raylib.h b/src/raylib.h index d9a12cec..104d5677 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib 1.5.0 (www.raylib.com) +* raylib 1.6.0 (www.raylib.com) * * A simple and easy-to-use library to learn videogames programming * -- cgit v1.2.3 From 3b80e2c1e03e0f87d50ca8876b50a11c7df1f56f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 16:32:46 +0200 Subject: Redesigned gestures module to header-only --- src/Makefile | 6 +- src/core.c | 16 +- src/gestures.c | 423 -------------------------------------------------- src/gestures.h | 480 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- src/raylib.h | 17 +- src/rlua.h | 10 +- 6 files changed, 458 insertions(+), 494 deletions(-) delete mode 100644 src/gestures.c (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 1360a920..e82c2861 100644 --- a/src/Makefile +++ b/src/Makefile @@ -168,7 +168,7 @@ endif # compile all modules with their prerequisites # compile core module -core.o : core.c raylib.h rlgl.h utils.h raymath.h +core.o : core.c raylib.h rlgl.h utils.h raymath.h gestures.h $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) # compile rlgl module @@ -207,10 +207,6 @@ utils.o : utils.c utils.h camera.o : camera.c raylib.h $(CC) -c $< $(CFLAGS) $(INCLUDES) -#compile gestures module -gestures.o : gestures.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) - # It installs generated and needed files to compile projects using raylib. # The installation works manually. # TODO: add other platforms. diff --git a/src/core.c b/src/core.c index 47463a23..4cb34b0a 100644 --- a/src/core.c +++ b/src/core.c @@ -39,13 +39,15 @@ #include "raylib.h" // raylib main header #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 -#include "utils.h" // TraceLog() function - // NOTE: Includes Android fopen map, InitAssetManager() - +#include "utils.h" // Includes Android fopen map, InitAssetManager(), TraceLog() + #define RAYMATH_IMPLEMENTATION // Use raymath as a header-only library (includes implementation) #define RAYMATH_EXTERN_INLINE // Compile raymath functions as static inline (remember, it's a compiler hint) #include "raymath.h" // Required for Vector3 and Matrix functions +#define GESTURES_IMPLEMENTATION +#include "gestures.h" // Gestures detection functionality + #include // Standard input / output lib #include // Declares malloc() and free() for memory management, rand(), atexit() #include // Required for typedef unsigned long long int uint64_t, used by hi-res timer @@ -234,6 +236,9 @@ static bool showLogo = false; // Track if showing logo at init is extern void LoadDefaultFont(void); // [Module: text] Loads default font on InitWindow() extern void UnloadDefaultFont(void); // [Module: text] Unloads default font from GPU memory +extern void ProcessGestureEvent(GestureEvent event); // [Module: gestures] Process gesture event and translate it into gestures +extern void UpdateGestures(void); // [Module: gestures] Update gestures detected (called in PollInputEvents()) + //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -2052,10 +2057,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i // NOTE: Before closing window, while loop must be left! } #if defined(PLATFORM_DESKTOP) - else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) - { - TakeScreenshot(); - } + else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) TakeScreenshot(); #endif else { diff --git a/src/gestures.c b/src/gestures.c deleted file mode 100644 index 57b96bd2..00000000 --- a/src/gestures.c +++ /dev/null @@ -1,423 +0,0 @@ -/********************************************************************************************** -* -* raylib Gestures System - Gestures Processing based on input gesture events (touch/mouse) -* -* Initial design by Marc Palau -* Redesigned by Albert Martos and Ian Eito -* Reviewed by Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -//#define GESTURES_STANDALONE // NOTE: To use the gestures module as standalone lib, just uncomment this line - -#if defined(GESTURES_STANDALONE) - #include "gestures.h" -#else - #include "raylib.h" // Required for: Vector2, Gestures -#endif - -#include // Required for: atan2(), sqrt() -#include // Required for: uint64_t - -#if defined(_WIN32) - // Functions required to query time on Windows - int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); - int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); -#elif defined(__linux) - #include // Required for: timespec - #include // Required for: clock_gettime() -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define FORCE_TO_SWIPE 0.0005f // Measured in normalized screen units/time -#define MINIMUM_DRAG 0.015f // Measured in normalized screen units (0.0f to 1.0f) -#define MINIMUM_PINCH 0.005f // Measured in normalized screen units (0.0f to 1.0f) -#define TAP_TIMEOUT 300 // Time in milliseconds -#define PINCH_TIMEOUT 300 // Time in milliseconds -#define DOUBLETAP_RANGE 0.03f // Measured in normalized screen units (0.0f to 1.0f) - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- - -// Touch gesture variables -static Vector2 touchDownPosition = { 0.0f, 0.0f }; -static Vector2 touchDownPosition2 = { 0.0f, 0.0f }; -static Vector2 touchDownDragPosition = { 0.0f, 0.0f }; -static Vector2 touchUpPosition = { 0.0f, 0.0f }; -static Vector2 moveDownPosition = { 0.0f, 0.0f }; -static Vector2 moveDownPosition2 = { 0.0f, 0.0f }; -static int numTap = 0; - -static int pointCount = 0; -static int firstTouchId = -1; - -static double eventTime = 0.0; -static double swipeTime = 0.0; - -// Hold gesture variables -static int numHold = 0; -static float timeHold = 0.0f; - -// Drag gesture variables -static Vector2 dragVector = { 0.0f , 0.0f }; // DRAG vector (between initial and current position) -static float dragAngle = 0.0f; // DRAG angle (relative to x-axis) -static float dragDistance = 0.0f; // DRAG distance (from initial touch point to final) (normalized [0..1]) -static float dragIntensity = 0.0f; // DRAG intensity, how far why did the DRAG (pixels per frame) -static bool startMoving = false; // SWIPE used to define when start measuring swipeTime - -// Pinch gesture variables -static Vector2 pinchVector = { 0.0f , 0.0f }; // PINCH vector (between first and second touch points) -static float pinchAngle = 0.0f; // PINCH angle (relative to x-axis) -static float pinchDistance = 0.0f; // PINCH displacement distance (normalized [0..1]) - -// Detected gestures -static int previousGesture = GESTURE_NONE; -static int currentGesture = GESTURE_NONE; - -// Enabled gestures flags, all gestures enabled by default -static unsigned int enabledGestures = 0b0000001111111111; - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition); -static float Vector2Distance(Vector2 v1, Vector2 v2); -static double GetCurrentTime(void); - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- - -// Enable only desired getures to be detected -void SetGesturesEnabled(unsigned int gestureFlags) -{ - enabledGestures = gestureFlags; -} - -// Check if a gesture have been detected -bool IsGestureDetected(int gesture) -{ - if ((enabledGestures & currentGesture) == gesture) return true; - else return false; -} - -// Process gesture event and translate it into gestures -void ProcessGestureEvent(GestureEvent event) -{ - // Reset required variables - previousGesture = currentGesture; - - pointCount = event.pointCount; // Required on UpdateGestures() - - if (pointCount < 2) - { - if (event.touchAction == TOUCH_DOWN) - { - numTap++; // Tap counter - - // Detect GESTURE_DOUBLE_TAP - if ((currentGesture == GESTURE_NONE) && (numTap >= 2) && ((GetCurrentTime() - eventTime) < TAP_TIMEOUT) && (Vector2Distance(touchDownPosition, event.position[0]) < DOUBLETAP_RANGE)) - { - currentGesture = GESTURE_DOUBLETAP; - numTap = 0; - } - else // Detect GESTURE_TAP - { - numTap = 1; - currentGesture = GESTURE_TAP; - } - - touchDownPosition = event.position[0]; - touchDownDragPosition = event.position[0]; - - touchUpPosition = touchDownPosition; - eventTime = GetCurrentTime(); - - firstTouchId = event.pointerId[0]; - - dragVector = (Vector2){ 0.0f, 0.0f }; - } - else if (event.touchAction == TOUCH_UP) - { - if (currentGesture == GESTURE_DRAG) touchUpPosition = event.position[0]; - - // NOTE: dragIntensity dependend on the resolution of the screen - dragDistance = Vector2Distance(touchDownPosition, touchUpPosition); - dragIntensity = dragDistance/(float)((GetCurrentTime() - swipeTime)); - - startMoving = false; - - // Detect GESTURE_SWIPE - if ((dragIntensity > FORCE_TO_SWIPE) && firstTouchId == event.pointerId[0]) - { - // NOTE: Angle should be inverted in Y - dragAngle = 360.0f - Vector2Angle(touchDownPosition, touchUpPosition); - - if ((dragAngle < 30) || (dragAngle > 330)) currentGesture = GESTURE_SWIPE_RIGHT; // Right - else if ((dragAngle > 30) && (dragAngle < 120)) currentGesture = GESTURE_SWIPE_UP; // Up - else if ((dragAngle > 120) && (dragAngle < 210)) currentGesture = GESTURE_SWIPE_LEFT; // Left - else if ((dragAngle > 210) && (dragAngle < 300)) currentGesture = GESTURE_SWIPE_DOWN; // Down - else currentGesture = GESTURE_NONE; - } - else - { - dragDistance = 0.0f; - dragIntensity = 0.0f; - dragAngle = 0.0f; - - currentGesture = GESTURE_NONE; - } - - touchDownDragPosition = (Vector2){ 0.0f, 0.0f }; - pointCount = 0; - } - else if (event.touchAction == TOUCH_MOVE) - { - if (currentGesture == GESTURE_DRAG) eventTime = GetCurrentTime(); - - if (!startMoving) - { - swipeTime = GetCurrentTime(); - startMoving = true; - } - - moveDownPosition = event.position[0]; - - if (currentGesture == GESTURE_HOLD) - { - if (numHold == 1) touchDownPosition = event.position[0]; - - numHold = 2; - - // Detect GESTURE_DRAG - if (Vector2Distance(touchDownPosition, moveDownPosition) >= MINIMUM_DRAG) - { - eventTime = GetCurrentTime(); - currentGesture = GESTURE_DRAG; - } - } - - dragVector.x = moveDownPosition.x - touchDownDragPosition.x; - dragVector.y = moveDownPosition.y - touchDownDragPosition.y; - } - } - else // Two touch points - { - if (event.touchAction == TOUCH_DOWN) - { - touchDownPosition = event.position[0]; - touchDownPosition2 = event.position[1]; - - //pinchDistance = Vector2Distance(touchDownPosition, touchDownPosition2); - - pinchVector.x = touchDownPosition2.x - touchDownPosition.x; - pinchVector.y = touchDownPosition2.y - touchDownPosition.y; - - currentGesture = GESTURE_HOLD; - timeHold = GetCurrentTime(); - } - else if (event.touchAction == TOUCH_MOVE) - { - pinchDistance = Vector2Distance(moveDownPosition, moveDownPosition2); - - touchDownPosition = moveDownPosition; - touchDownPosition2 = moveDownPosition2; - - moveDownPosition = event.position[0]; - moveDownPosition2 = event.position[1]; - - pinchVector.x = moveDownPosition2.x - moveDownPosition.x; - pinchVector.y = moveDownPosition2.y - moveDownPosition.y; - - if ((Vector2Distance(touchDownPosition, moveDownPosition) >= MINIMUM_PINCH) || (Vector2Distance(touchDownPosition2, moveDownPosition2) >= MINIMUM_PINCH)) - { - if ((Vector2Distance(moveDownPosition, moveDownPosition2) - pinchDistance) < 0) currentGesture = GESTURE_PINCH_IN; - else currentGesture = GESTURE_PINCH_OUT; - } - else - { - currentGesture = GESTURE_HOLD; - timeHold = GetCurrentTime(); - } - - // NOTE: Angle should be inverted in Y - pinchAngle = 360.0f - Vector2Angle(moveDownPosition, moveDownPosition2); - } - else if (event.touchAction == TOUCH_UP) - { - pinchDistance = 0.0f; - pinchAngle = 0.0f; - pinchVector = (Vector2){ 0.0f, 0.0f }; - pointCount = 0; - - currentGesture = GESTURE_NONE; - } - } -} - -// Update gestures detected (must be called every frame) -void UpdateGestures(void) -{ - // NOTE: Gestures are processed through system callbacks on touch events - - // Detect GESTURE_HOLD - if (((currentGesture == GESTURE_TAP) || (currentGesture == GESTURE_DOUBLETAP)) && (pointCount < 2)) - { - currentGesture = GESTURE_HOLD; - timeHold = GetCurrentTime(); - } - - if (((GetCurrentTime() - eventTime) > TAP_TIMEOUT) && (currentGesture == GESTURE_DRAG) && (pointCount < 2)) - { - currentGesture = GESTURE_HOLD; - timeHold = GetCurrentTime(); - numHold = 1; - } - - // Detect GESTURE_NONE - if ((currentGesture == GESTURE_SWIPE_RIGHT) || (currentGesture == GESTURE_SWIPE_UP) || (currentGesture == GESTURE_SWIPE_LEFT) || (currentGesture == GESTURE_SWIPE_DOWN)) - { - currentGesture = GESTURE_NONE; - } -} - -// Get number of touch points -int GetTouchPointsCount(void) -{ - // NOTE: point count is calculated when ProcessGestureEvent(GestureEvent event) is called - - return pointCount; -} - -// Get latest detected gesture -int GetGestureDetected(void) -{ - // Get current gesture only if enabled - return (enabledGestures & currentGesture); -} - -// Hold time measured in ms -float GetGestureHoldDuration(void) -{ - // NOTE: time is calculated on current gesture HOLD - - float time = 0.0f; - - if (currentGesture == GESTURE_HOLD) time = (float)GetCurrentTime() - timeHold; - - return time; -} - -// Get drag vector (between initial touch point to current) -Vector2 GetGestureDragVector(void) -{ - // NOTE: drag vector is calculated on one touch points TOUCH_MOVE - - return dragVector; -} - -// Get drag angle -// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise -float GetGestureDragAngle(void) -{ - // NOTE: drag angle is calculated on one touch points TOUCH_UP - - return dragAngle; -} - -// Get distance between two pinch points -Vector2 GetGesturePinchVector(void) -{ - // NOTE: The position values used for pinchDistance are not modified like the position values of [core.c]-->GetTouchPosition(int index) - // NOTE: pinch distance is calculated on two touch points TOUCH_MOVE - - return pinchVector; -} - -// Get angle beween two pinch points -// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise -float GetGesturePinchAngle(void) -{ - // NOTE: pinch angle is calculated on two touch points TOUCH_MOVE - - return pinchAngle; -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -// Returns angle from two-points vector with X-axis -static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition) -{ - float angle; - - angle = atan2(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x); - angle *= RAD2DEG; - - if (angle < 0) angle += 360.0f; - - return angle; -} - -// Calculate distance between two Vector2 -static float Vector2Distance(Vector2 v1, Vector2 v2) -{ - float result; - - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - - result = sqrt(dx*dx + dy*dy); - - return result; -} - -// Time measure returned are milliseconds -static double GetCurrentTime(void) -{ - double time = 0; - -#if defined(_WIN32) - unsigned long long int clockFrequency, currentTime; - - QueryPerformanceFrequency(&clockFrequency); - QueryPerformanceCounter(¤tTime); - - time = (double)currentTime/clockFrequency*1000.0f; // Time in miliseconds -#endif - -#if defined(__linux) - // NOTE: Only for Linux-based systems - struct timespec now; - clock_gettime(CLOCK_MONOTONIC, &now); - uint64_t nowTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; // Time in nanoseconds - - time = ((double)nowTime/1000000.0); // Time in miliseconds -#endif - - return time; -} diff --git a/src/gestures.h b/src/gestures.h index 912d0b92..4c59ee39 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -1,8 +1,21 @@ /********************************************************************************************** * -* raylib Gestures System - Gestures Detection and Usage Functions (Android and HTML5) +* raylib Gestures System - Gestures Processing based on input gesture events (touch/mouse) * -* Copyright (c) 2015 Marc Palau and Ramon Santamaria +* #define GESTURES_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. +* +* #define GESTURES_STANDALONE +* If defined, the library can be used as standalone to process gesture events with +* no external dependencies. +* +* NOTE: Memory footprint of this library is aproximately 128 bytes +* +* Initial design by Marc Palau +* Redesigned by Albert Martos and Ian Eito +* Reviewed by Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -28,9 +41,6 @@ #define PI 3.14159265358979323846 #endif -#define DEG2RAD (PI / 180.0f) -#define RAD2DEG (180.0f / PI) - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -40,32 +50,34 @@ // Types and Structures Definition // NOTE: Below types are required for GESTURES_STANDALONE usage //---------------------------------------------------------------------------------- -#ifndef __cplusplus - // Boolean type - typedef enum { false, true } bool; -#endif +#if defined(GESTURES_STANDALONE) + #ifndef __cplusplus + // Boolean type + typedef enum { false, true } bool; + #endif + + // Vector2 type + typedef struct Vector2 { + float x; + float y; + } Vector2; -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; - -// Gestures type -// NOTE: It could be used as flags to enable only some gestures -typedef enum { - GESTURE_NONE = 1, - GESTURE_TAP = 2, - GESTURE_DOUBLETAP = 4, - GESTURE_HOLD = 8, - GESTURE_DRAG = 16, - GESTURE_SWIPE_RIGHT = 32, - GESTURE_SWIPE_LEFT = 64, - GESTURE_SWIPE_UP = 128, - GESTURE_SWIPE_DOWN = 256, - GESTURE_PINCH_IN = 512, - GESTURE_PINCH_OUT = 1024 -} Gestures; + // Gestures type + // NOTE: It could be used as flags to enable only some gestures + typedef enum { + GESTURE_NONE = 1, + GESTURE_TAP = 2, + GESTURE_DOUBLETAP = 4, + GESTURE_HOLD = 8, + GESTURE_DRAG = 16, + GESTURE_SWIPE_RIGHT = 32, + GESTURE_SWIPE_LEFT = 64, + GESTURE_SWIPE_UP = 128, + GESTURE_SWIPE_DOWN = 256, + GESTURE_PINCH_IN = 512, + GESTURE_PINCH_OUT = 1024 + } Gestures; +#endif typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction; @@ -90,22 +102,422 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -bool IsGestureDetected(int gesture); // Check if a gesture have been detected void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures void UpdateGestures(void); // Update gestures detected (must be called every frame) -int GetTouchPointsCount(void); // Get touch points count +#if defined(GESTURES_STANDALONE) +void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +bool IsGestureDetected(int gesture); // Check if a gesture have been detected int GetGestureDetected(void); // Get latest detected gesture +int GetTouchPointsCount(void); // Get touch points count float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle Vector2 GetGesturePinchVector(void); // Get gesture pinch delta float GetGesturePinchAngle(void); // Get gesture pinch angle - +#endif #ifdef __cplusplus } #endif #endif // GESTURES_H + +/*********************************************************************************** +* +* GESTURES IMPLEMENTATION +* +************************************************************************************/ + +#if defined(GESTURES_IMPLEMENTATION) + +#include // Required for: atan2(), sqrt() +#include // Required for: uint64_t + +#if defined(_WIN32) + // Functions required to query time on Windows + int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); + int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); +#elif defined(__linux) + #include // Required for: timespec + #include // Required for: clock_gettime() +#endif + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +#define FORCE_TO_SWIPE 0.0005f // Measured in normalized screen units/time +#define MINIMUM_DRAG 0.015f // Measured in normalized screen units (0.0f to 1.0f) +#define MINIMUM_PINCH 0.005f // Measured in normalized screen units (0.0f to 1.0f) +#define TAP_TIMEOUT 300 // Time in milliseconds +#define PINCH_TIMEOUT 300 // Time in milliseconds +#define DOUBLETAP_RANGE 0.03f // Measured in normalized screen units (0.0f to 1.0f) + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- +// ... + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- + +// Touch gesture variables +static Vector2 touchDownPosition = { 0.0f, 0.0f }; +static Vector2 touchDownPosition2 = { 0.0f, 0.0f }; +static Vector2 touchDownDragPosition = { 0.0f, 0.0f }; +static Vector2 touchUpPosition = { 0.0f, 0.0f }; +static Vector2 moveDownPosition = { 0.0f, 0.0f }; +static Vector2 moveDownPosition2 = { 0.0f, 0.0f }; + +static int pointCount = 0; // Touch points counter +static int firstTouchId = -1; // Touch id for first touch point +static double eventTime = 0.0; // Time stamp when an event happened + +// Tap gesture variables +static int tapCounter = 0; // TAP counter (one tap implies TOUCH_DOWN and TOUCH_UP actions) + +// Hold gesture variables +static bool resetHold = false; // HOLD reset to get first touch point again +static float timeHold = 0.0f; // HOLD duration in milliseconds + +// Drag gesture variables +static Vector2 dragVector = { 0.0f , 0.0f }; // DRAG vector (between initial and current position) +static float dragAngle = 0.0f; // DRAG angle (relative to x-axis) +static float dragDistance = 0.0f; // DRAG distance (from initial touch point to final) (normalized [0..1]) +static float dragIntensity = 0.0f; // DRAG intensity, how far why did the DRAG (pixels per frame) + +// Swipe gestures variables +static bool startMoving = false; // SWIPE used to define when start measuring swipeTime +static double swipeTime = 0.0; // SWIPE time to calculate drag intensity + +// Pinch gesture variables +static Vector2 pinchVector = { 0.0f , 0.0f }; // PINCH vector (between first and second touch points) +static float pinchAngle = 0.0f; // PINCH angle (relative to x-axis) +static float pinchDistance = 0.0f; // PINCH displacement distance (normalized [0..1]) + +static int currentGesture = GESTURE_NONE; // Current detected gesture + +// Enabled gestures flags, all gestures enabled by default +static unsigned int enabledGestures = 0b0000001111111111; + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition); +static float Vector2Distance(Vector2 v1, Vector2 v2); +static double GetCurrentTime(void); + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Enable only desired getures to be detected +void SetGesturesEnabled(unsigned int gestureFlags) +{ + enabledGestures = gestureFlags; +} + +// Check if a gesture have been detected +bool IsGestureDetected(int gesture) +{ + if ((enabledGestures & currentGesture) == gesture) return true; + else return false; +} + +// Process gesture event and translate it into gestures +void ProcessGestureEvent(GestureEvent event) +{ + // Reset required variables + pointCount = event.pointCount; // Required on UpdateGestures() + + if (pointCount < 2) + { + if (event.touchAction == TOUCH_DOWN) + { + tapCounter++; // Tap counter + + // Detect GESTURE_DOUBLE_TAP + if ((currentGesture == GESTURE_NONE) && (tapCounter >= 2) && ((GetCurrentTime() - eventTime) < TAP_TIMEOUT) && (Vector2Distance(touchDownPosition, event.position[0]) < DOUBLETAP_RANGE)) + { + currentGesture = GESTURE_DOUBLETAP; + tapCounter = 0; + } + else // Detect GESTURE_TAP + { + tapCounter = 1; + currentGesture = GESTURE_TAP; + } + + touchDownPosition = event.position[0]; + touchDownDragPosition = event.position[0]; + + touchUpPosition = touchDownPosition; + eventTime = GetCurrentTime(); + + firstTouchId = event.pointerId[0]; + + dragVector = (Vector2){ 0.0f, 0.0f }; + } + else if (event.touchAction == TOUCH_UP) + { + if (currentGesture == GESTURE_DRAG) touchUpPosition = event.position[0]; + + // NOTE: dragIntensity dependend on the resolution of the screen + dragDistance = Vector2Distance(touchDownPosition, touchUpPosition); + dragIntensity = dragDistance/(float)((GetCurrentTime() - swipeTime)); + + startMoving = false; + + // Detect GESTURE_SWIPE + if ((dragIntensity > FORCE_TO_SWIPE) && (firstTouchId == event.pointerId[0])) + { + // NOTE: Angle should be inverted in Y + dragAngle = 360.0f - Vector2Angle(touchDownPosition, touchUpPosition); + + if ((dragAngle < 30) || (dragAngle > 330)) currentGesture = GESTURE_SWIPE_RIGHT; // Right + else if ((dragAngle > 30) && (dragAngle < 120)) currentGesture = GESTURE_SWIPE_UP; // Up + else if ((dragAngle > 120) && (dragAngle < 210)) currentGesture = GESTURE_SWIPE_LEFT; // Left + else if ((dragAngle > 210) && (dragAngle < 300)) currentGesture = GESTURE_SWIPE_DOWN; // Down + else currentGesture = GESTURE_NONE; + } + else + { + dragDistance = 0.0f; + dragIntensity = 0.0f; + dragAngle = 0.0f; + + currentGesture = GESTURE_NONE; + } + + touchDownDragPosition = (Vector2){ 0.0f, 0.0f }; + pointCount = 0; + } + else if (event.touchAction == TOUCH_MOVE) + { + if (currentGesture == GESTURE_DRAG) eventTime = GetCurrentTime(); + + if (!startMoving) + { + swipeTime = GetCurrentTime(); + startMoving = true; + } + + moveDownPosition = event.position[0]; + + if (currentGesture == GESTURE_HOLD) + { + if (resetHold) touchDownPosition = event.position[0]; + + resetHold = false; + + // Detect GESTURE_DRAG + if (Vector2Distance(touchDownPosition, moveDownPosition) >= MINIMUM_DRAG) + { + eventTime = GetCurrentTime(); + currentGesture = GESTURE_DRAG; + } + } + + dragVector.x = moveDownPosition.x - touchDownDragPosition.x; + dragVector.y = moveDownPosition.y - touchDownDragPosition.y; + } + } + else // Two touch points + { + if (event.touchAction == TOUCH_DOWN) + { + touchDownPosition = event.position[0]; + touchDownPosition2 = event.position[1]; + + //pinchDistance = Vector2Distance(touchDownPosition, touchDownPosition2); + + pinchVector.x = touchDownPosition2.x - touchDownPosition.x; + pinchVector.y = touchDownPosition2.y - touchDownPosition.y; + + currentGesture = GESTURE_HOLD; + timeHold = GetCurrentTime(); + } + else if (event.touchAction == TOUCH_MOVE) + { + pinchDistance = Vector2Distance(moveDownPosition, moveDownPosition2); + + touchDownPosition = moveDownPosition; + touchDownPosition2 = moveDownPosition2; + + moveDownPosition = event.position[0]; + moveDownPosition2 = event.position[1]; + + pinchVector.x = moveDownPosition2.x - moveDownPosition.x; + pinchVector.y = moveDownPosition2.y - moveDownPosition.y; + + if ((Vector2Distance(touchDownPosition, moveDownPosition) >= MINIMUM_PINCH) || (Vector2Distance(touchDownPosition2, moveDownPosition2) >= MINIMUM_PINCH)) + { + if ((Vector2Distance(moveDownPosition, moveDownPosition2) - pinchDistance) < 0) currentGesture = GESTURE_PINCH_IN; + else currentGesture = GESTURE_PINCH_OUT; + } + else + { + currentGesture = GESTURE_HOLD; + timeHold = GetCurrentTime(); + } + + // NOTE: Angle should be inverted in Y + pinchAngle = 360.0f - Vector2Angle(moveDownPosition, moveDownPosition2); + } + else if (event.touchAction == TOUCH_UP) + { + pinchDistance = 0.0f; + pinchAngle = 0.0f; + pinchVector = (Vector2){ 0.0f, 0.0f }; + pointCount = 0; + + currentGesture = GESTURE_NONE; + } + } +} + +// Update gestures detected (must be called every frame) +void UpdateGestures(void) +{ + // NOTE: Gestures are processed through system callbacks on touch events + + // Detect GESTURE_HOLD + if (((currentGesture == GESTURE_TAP) || (currentGesture == GESTURE_DOUBLETAP)) && (pointCount < 2)) + { + currentGesture = GESTURE_HOLD; + timeHold = GetCurrentTime(); + } + + if (((GetCurrentTime() - eventTime) > TAP_TIMEOUT) && (currentGesture == GESTURE_DRAG) && (pointCount < 2)) + { + currentGesture = GESTURE_HOLD; + timeHold = GetCurrentTime(); + resetHold = true; + } + + // Detect GESTURE_NONE + if ((currentGesture == GESTURE_SWIPE_RIGHT) || (currentGesture == GESTURE_SWIPE_UP) || (currentGesture == GESTURE_SWIPE_LEFT) || (currentGesture == GESTURE_SWIPE_DOWN)) + { + currentGesture = GESTURE_NONE; + } +} + +// Get number of touch points +int GetTouchPointsCount(void) +{ + // NOTE: point count is calculated when ProcessGestureEvent(GestureEvent event) is called + + return pointCount; +} + +// Get latest detected gesture +int GetGestureDetected(void) +{ + // Get current gesture only if enabled + return (enabledGestures & currentGesture); +} + +// Hold time measured in ms +float GetGestureHoldDuration(void) +{ + // NOTE: time is calculated on current gesture HOLD + + float time = 0.0f; + + if (currentGesture == GESTURE_HOLD) time = (float)GetCurrentTime() - timeHold; + + return time; +} + +// Get drag vector (between initial touch point to current) +Vector2 GetGestureDragVector(void) +{ + // NOTE: drag vector is calculated on one touch points TOUCH_MOVE + + return dragVector; +} + +// Get drag angle +// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise +float GetGestureDragAngle(void) +{ + // NOTE: drag angle is calculated on one touch points TOUCH_UP + + return dragAngle; +} + +// Get distance between two pinch points +Vector2 GetGesturePinchVector(void) +{ + // NOTE: The position values used for pinchDistance are not modified like the position values of [core.c]-->GetTouchPosition(int index) + // NOTE: pinch distance is calculated on two touch points TOUCH_MOVE + + return pinchVector; +} + +// Get angle beween two pinch points +// NOTE: Angle in degrees, horizontal-right is 0, counterclock-wise +float GetGesturePinchAngle(void) +{ + // NOTE: pinch angle is calculated on two touch points TOUCH_MOVE + + return pinchAngle; +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Returns angle from two-points vector with X-axis +static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition) +{ + float angle; + + angle = atan2(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI); + + if (angle < 0) angle += 360.0f; + + return angle; +} + +// Calculate distance between two Vector2 +static float Vector2Distance(Vector2 v1, Vector2 v2) +{ + float result; + + float dx = v2.x - v1.x; + float dy = v2.y - v1.y; + + result = sqrt(dx*dx + dy*dy); + + return result; +} + +// Time measure returned are milliseconds +static double GetCurrentTime(void) +{ + double time = 0; + +#if defined(_WIN32) + unsigned long long int clockFrequency, currentTime; + + QueryPerformanceFrequency(&clockFrequency); + QueryPerformanceCounter(¤tTime); + + time = (double)currentTime/clockFrequency*1000.0f; // Time in miliseconds +#endif + +#if defined(__linux) + // NOTE: Only for Linux-based systems + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + uint64_t nowTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; // Time in nanoseconds + + time = ((double)nowTime/1000000.0); // Time in miliseconds +#endif + + return time; +} + +#endif // GESTURES_IMPLEMENTATION diff --git a/src/raylib.h b/src/raylib.h index 104d5677..1489546a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -570,18 +570,6 @@ typedef enum { GESTURE_PINCH_OUT = 512 } Gestures; -// Touch action (fingers or mouse) -typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction; - -// Gesture events -// NOTE: MAX_TOUCH_POINTS fixed to 2 -typedef struct GestureEvent { - int touchAction; - int pointCount; - int pointerId[MAX_TOUCH_POINTS]; - Vector2 position[MAX_TOUCH_POINTS]; -} GestureEvent; - // Camera system modes typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; @@ -711,11 +699,8 @@ bool IsButtonReleased(int button); // Detect if an android //------------------------------------------------------------------------------------ void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags bool IsGestureDetected(int gesture); // Check if a gesture have been detected -void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures -void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents()) - -int GetTouchPointsCount(void); // Get touch points count int GetGestureDetected(void); // Get latest detected gesture +int GetTouchPointsCount(void); // Get touch points count float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds Vector2 GetGestureDragVector(void); // Get gesture drag vector float GetGestureDragAngle(void); // Get gesture drag angle diff --git a/src/rlua.h b/src/rlua.h index 675edbfc..acd0d037 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -1313,12 +1313,6 @@ int lua_IsGestureDetected(lua_State* L) return 1; } -int lua_UpdateGestures(lua_State* L) -{ - UpdateGestures(); - return 0; -} - int lua_GetTouchPointsCount(lua_State* L) { int result = GetTouchPointsCount(); @@ -3576,10 +3570,8 @@ static luaL_Reg raylib_functions[] = { REG(SetGesturesEnabled) REG(IsGestureDetected) - //REG(ProcessGestureEvent) - REG(UpdateGestures) - REG(GetTouchPointsCount) REG(GetGestureDetected) + REG(GetTouchPointsCount) REG(GetGestureHoldDuration) REG(GetGestureDragVector) REG(GetGestureDragAngle) -- cgit v1.2.3 From 4960e6b6d7b4cba6125cfb8bb2fef043db8e5ba5 Mon Sep 17 00:00:00 2001 From: ghassanpl Date: Sat, 6 Aug 2016 16:58:48 +0200 Subject: Fixes for some Lua bugs --- src/rlua.h | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 675edbfc..ee7766ab 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -325,6 +325,7 @@ static void LuaBuildOpaqueMetatables(void) static Vector2 LuaGetArgument_Vector2(lua_State* L, int index) { + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector2"); float x = (float)lua_tonumber(L, -1); luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector2"); @@ -335,6 +336,7 @@ static Vector2 LuaGetArgument_Vector2(lua_State* L, int index) static Vector3 LuaGetArgument_Vector3(lua_State* L, int index) { + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector3"); float x = (float)lua_tonumber(L, -1); luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector3"); @@ -347,6 +349,7 @@ static Vector3 LuaGetArgument_Vector3(lua_State* L, int index) static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index) { + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Quaternion"); float x = (float)lua_tonumber(L, -1); luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Quaternion"); @@ -361,6 +364,7 @@ static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index) static Color LuaGetArgument_Color(lua_State* L, int index) { + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "r") == LUA_TNUMBER, index, "Expected Color"); unsigned char r = (unsigned char)lua_tointeger(L, -1); luaL_argcheck(L, lua_getfield(L, index, "g") == LUA_TNUMBER, index, "Expected Color"); @@ -375,6 +379,7 @@ static Color LuaGetArgument_Color(lua_State* L, int index) static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index) { + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Rectangle"); int x = (int)lua_tointeger(L, -1); luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Rectangle"); @@ -390,13 +395,14 @@ static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index) static Camera LuaGetArgument_Camera(lua_State* L, int index) { Camera result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Camera"); result.position = LuaGetArgument_Vector3(L, -1); luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera"); result.target = LuaGetArgument_Vector3(L, -1); luaL_argcheck(L, lua_getfield(L, index, "up") == LUA_TTABLE, index, "Expected Camera"); result.up = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "fovy") == LUA_TTABLE, index, "Expected Camera"); + luaL_argcheck(L, lua_getfield(L, index, "fovy") == LUA_TNUMBER, index, "Expected Camera"); result.fovy = LuaGetArgument_float(L, -1); lua_pop(L, 4); return result; @@ -405,13 +411,14 @@ static Camera LuaGetArgument_Camera(lua_State* L, int index) static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) { Camera2D result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "offset") == LUA_TTABLE, index, "Expected Camera2D"); result.offset = LuaGetArgument_Vector2(L, -1); luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera2D"); result.target = LuaGetArgument_Vector2(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TTABLE, index, "Expected Camera2D"); + luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TNUMBER, index, "Expected Camera2D"); result.rotation = LuaGetArgument_float(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "zoom") == LUA_TTABLE, index, "Expected Camera2D"); + luaL_argcheck(L, lua_getfield(L, index, "zoom") == LUA_TNUMBER, index, "Expected Camera2D"); result.zoom = LuaGetArgument_float(L, -1); lua_pop(L, 4); return result; @@ -420,6 +427,7 @@ static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) { BoundingBox result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "min") == LUA_TTABLE, index, "Expected BoundingBox"); result.min = LuaGetArgument_Vector3(L, -1); luaL_argcheck(L, lua_getfield(L, index, "max") == LUA_TTABLE, index, "Expected BoundingBox"); @@ -431,6 +439,7 @@ static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) static Ray LuaGetArgument_Ray(lua_State* L, int index) { Ray result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Ray"); result.position = LuaGetArgument_Vector3(L, -1); luaL_argcheck(L, lua_getfield(L, index, "direction") == LUA_TTABLE, index, "Expected Ray"); @@ -443,10 +452,12 @@ static Matrix LuaGetArgument_Matrix(lua_State* L, int index) { Matrix result = { 0 }; float* ptr = &result.m0; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + for (int i = 0; i < 16; i++) { - lua_geti(L, -1, i+1); - ptr[i] = luaL_checkinteger(L, -1); + lua_geti(L, index, i+1); + ptr[i] = luaL_checknumber(L, -1); } lua_pop(L, 16); return result; @@ -455,6 +466,7 @@ static Matrix LuaGetArgument_Matrix(lua_State* L, int index) static Material LuaGetArgument_Material(lua_State* L, int index) { Material result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "shader") == LUA_TUSERDATA, index, "Expected Material"); result.shader = LuaGetArgument_Shader(L, -1); luaL_argcheck(L, lua_getfield(L, index, "texDiffuse") == LUA_TUSERDATA, index, "Expected Material"); @@ -463,13 +475,13 @@ static Material LuaGetArgument_Material(lua_State* L, int index) result.texNormal = LuaGetArgument_Texture2D(L, -1); luaL_argcheck(L, lua_getfield(L, index, "texSpecular") == LUA_TUSERDATA, index, "Expected Material"); result.texSpecular = LuaGetArgument_Texture2D(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colDiffuse") == LUA_TUSERDATA, index, "Expected Material"); + luaL_argcheck(L, lua_getfield(L, index, "colDiffuse") == LUA_TTABLE, index, "Expected Material"); result.colDiffuse = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colAmbient") == LUA_TUSERDATA, index, "Expected Material"); + luaL_argcheck(L, lua_getfield(L, index, "colAmbient") == LUA_TTABLE, index, "Expected Material"); result.colAmbient = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colSpecular") == LUA_TUSERDATA, index, "Expected Material"); + luaL_argcheck(L, lua_getfield(L, index, "colSpecular") == LUA_TTABLE, index, "Expected Material"); result.colSpecular = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "glossiness") == LUA_TUSERDATA, index, "Expected Material"); + luaL_argcheck(L, lua_getfield(L, index, "glossiness") == LUA_TNUMBER, index, "Expected Material"); result.glossiness = LuaGetArgument_float(L, -1); lua_pop(L, 8); return result; @@ -478,6 +490,7 @@ static Material LuaGetArgument_Material(lua_State* L, int index) static Model LuaGetArgument_Model(lua_State* L, int index) { Model result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "mesh") == LUA_TUSERDATA, index, "Expected Model"); result.mesh = LuaGetArgument_Mesh(L, -1); luaL_argcheck(L, lua_getfield(L, index, "transform") == LUA_TTABLE, index, "Expected Model"); @@ -3637,6 +3650,7 @@ static luaL_Reg raylib_functions[] = { REG(LoadRenderTexture) REG(UnloadImage) REG(UnloadTexture) + REG(UnloadRenderTexture) REG(GetImageData) REG(GetTextureData) REG(ImageToPOT) @@ -3698,6 +3712,10 @@ static luaL_Reg raylib_functions[] = { REG(LoadHeightmap) REG(LoadCubicmap) REG(UnloadModel) + REG(LoadMaterial) + REG(LoadDefaultMaterial) + REG(LoadStandardMaterial) + REG(UnloadMaterial) //REG(GenMesh*) // Not ready yet... REG(DrawModel) @@ -3972,6 +3990,8 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); LuaSetEnum("XBOX_AXIS_LT_RT", 2); #endif + LuaSetEnum("XBOX_AXIS_LEFT_X", 0); + LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); LuaEndEnum("GAMEPAD"); lua_pushglobaltable(L); -- cgit v1.2.3 From 58c762baa3738b3e8e326d2f51c96f8b241fcb04 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 19:30:13 +0200 Subject: Replaced tabs by spaces --- src/rlua.h | 4481 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 2243 insertions(+), 2238 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 77a51ed5..08ffbca0 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -188,47 +188,47 @@ static Model LuaGetArgument_Model(lua_State* L, int index); //---------------------------------------------------------------------------------- static void LuaStartEnum(void) { - lua_newtable(L); + lua_newtable(L); } static void LuaSetEnum(const char *name, int value) { - lua_pushinteger(L, value); - lua_setfield(L, -2, name); + lua_pushinteger(L, value); + lua_setfield(L, -2, name); } static void LuaSetEnumColor(const char *name, Color color) { - LuaPush_Color(L, color); - lua_setfield(L, -2, name); + LuaPush_Color(L, color); + lua_setfield(L, -2, name); } static void LuaEndEnum(const char *name) { - lua_setglobal(L, name); + lua_setglobal(L, name); } static void LuaPushOpaque(lua_State* L, void *ptr, size_t size) { - void *ud = lua_newuserdata(L, size); - memcpy(ud, ptr, size); + void *ud = lua_newuserdata(L, size); + memcpy(ud, ptr, size); } static void LuaPushOpaqueWithMetatable(lua_State* L, void *ptr, size_t size, const char *metatable_name) { - void *ud = lua_newuserdata(L, size); - memcpy(ud, ptr, size); - luaL_setmetatable(L, metatable_name); + void *ud = lua_newuserdata(L, size); + memcpy(ud, ptr, size); + luaL_setmetatable(L, metatable_name); } static void* LuaGetArgumentOpaqueType(lua_State* L, int index) { - return lua_touserdata(L, index); + return lua_touserdata(L, index); } static void* LuaGetArgumentOpaqueTypeWithMetatable(lua_State* L, int index, const char *metatable_name) { - return luaL_checkudata(L, index, metatable_name); + return luaL_checkudata(L, index, metatable_name); } //---------------------------------------------------------------------------------- @@ -236,87 +236,87 @@ static void* LuaGetArgumentOpaqueTypeWithMetatable(lua_State* L, int index, cons //---------------------------------------------------------------------------------- static int LuaIndexImage(lua_State* L) { - Image img = LuaGetArgument_Image(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "width")) - lua_pushinteger(L, img.width); - else if (!strcmp(key, "height")) - lua_pushinteger(L, img.height); - else if (!strcmp(key, "mipmaps")) - lua_pushinteger(L, img.mipmaps); - else if (!strcmp(key, "format")) - lua_pushinteger(L, img.format); - else - return 0; - return 1; + Image img = LuaGetArgument_Image(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "width")) + lua_pushinteger(L, img.width); + else if (!strcmp(key, "height")) + lua_pushinteger(L, img.height); + else if (!strcmp(key, "mipmaps")) + lua_pushinteger(L, img.mipmaps); + else if (!strcmp(key, "format")) + lua_pushinteger(L, img.format); + else + return 0; + return 1; } static int LuaIndexTexture2D(lua_State* L) { - Texture2D img = LuaGetArgument_Texture2D(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "width")) - lua_pushinteger(L, img.width); - else if (!strcmp(key, "height")) - lua_pushinteger(L, img.height); - else if (!strcmp(key, "mipmaps")) - lua_pushinteger(L, img.mipmaps); - else if (!strcmp(key, "format")) - lua_pushinteger(L, img.format); - else - return 0; - return 1; + Texture2D img = LuaGetArgument_Texture2D(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "width")) + lua_pushinteger(L, img.width); + else if (!strcmp(key, "height")) + lua_pushinteger(L, img.height); + else if (!strcmp(key, "mipmaps")) + lua_pushinteger(L, img.mipmaps); + else if (!strcmp(key, "format")) + lua_pushinteger(L, img.format); + else + return 0; + return 1; } static int LuaIndexRenderTexture2D(lua_State* L) { - RenderTexture2D img = LuaGetArgument_RenderTexture2D(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "texture")) - LuaPush_Texture2D(L, img.texture); - else if (!strcmp(key, "depth")) - LuaPush_Texture2D(L, img.depth); - else - return 0; - return 1; + RenderTexture2D img = LuaGetArgument_RenderTexture2D(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "texture")) + LuaPush_Texture2D(L, img.texture); + else if (!strcmp(key, "depth")) + LuaPush_Texture2D(L, img.depth); + else + return 0; + return 1; } static int LuaIndexSpriteFont(lua_State* L) { - SpriteFont img = LuaGetArgument_SpriteFont(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "size")) - lua_pushinteger(L, img.size); - else if (!strcmp(key, "texture")) - LuaPush_Texture2D(L, img.texture); - else if (!strcmp(key, "numChars")) - lua_pushinteger(L, img.numChars); - else - return 0; - return 1; + SpriteFont img = LuaGetArgument_SpriteFont(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "size")) + lua_pushinteger(L, img.size); + else if (!strcmp(key, "texture")) + LuaPush_Texture2D(L, img.texture); + else if (!strcmp(key, "numChars")) + lua_pushinteger(L, img.numChars); + else + return 0; + return 1; } static void LuaBuildOpaqueMetatables(void) { - luaL_newmetatable(L, "Image"); - lua_pushcfunction(L, &LuaIndexImage); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + luaL_newmetatable(L, "Image"); + lua_pushcfunction(L, &LuaIndexImage); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); - luaL_newmetatable(L, "Texture2D"); - lua_pushcfunction(L, &LuaIndexTexture2D); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + luaL_newmetatable(L, "Texture2D"); + lua_pushcfunction(L, &LuaIndexTexture2D); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); luaL_newmetatable(L, "RenderTexture2D"); - lua_pushcfunction(L, &LuaIndexRenderTexture2D); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + lua_pushcfunction(L, &LuaIndexRenderTexture2D); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); - luaL_newmetatable(L, "SpriteFont"); - lua_pushcfunction(L, &LuaIndexSpriteFont); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + luaL_newmetatable(L, "SpriteFont"); + lua_pushcfunction(L, &LuaIndexSpriteFont); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); } //---------------------------------------------------------------------------------- @@ -325,180 +325,180 @@ static void LuaBuildOpaqueMetatables(void) static Vector2 LuaGetArgument_Vector2(lua_State* L, int index) { - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector2"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector2"); - float y = (float)lua_tonumber(L, -1); - lua_pop(L, 2); - return (Vector2) { x, y }; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector2"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector2"); + float y = (float)lua_tonumber(L, -1); + lua_pop(L, 2); + return (Vector2) { x, y }; } static Vector3 LuaGetArgument_Vector3(lua_State* L, int index) { - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector3"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector3"); - float y = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Vector3"); - float z = (float)lua_tonumber(L, -1); - lua_pop(L, 3); - return (Vector3) { x, y, z }; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector3"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector3"); + float y = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Vector3"); + float z = (float)lua_tonumber(L, -1); + lua_pop(L, 3); + return (Vector3) { x, y, z }; } static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index) { - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Quaternion"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Quaternion"); - float y = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Quaternion"); - float z = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "w") == LUA_TNUMBER, index, "Expected Quaternion"); - float w = (float)lua_tonumber(L, -1); - lua_pop(L, 4); - return (Quaternion) { x, y, z, w }; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Quaternion"); + float x = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Quaternion"); + float y = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Quaternion"); + float z = (float)lua_tonumber(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "w") == LUA_TNUMBER, index, "Expected Quaternion"); + float w = (float)lua_tonumber(L, -1); + lua_pop(L, 4); + return (Quaternion) { x, y, z, w }; } static Color LuaGetArgument_Color(lua_State* L, int index) { - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "r") == LUA_TNUMBER, index, "Expected Color"); - unsigned char r = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "g") == LUA_TNUMBER, index, "Expected Color"); - unsigned char g = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "b") == LUA_TNUMBER, index, "Expected Color"); - unsigned char b = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "a") == LUA_TNUMBER, index, "Expected Color"); - unsigned char a = (unsigned char)lua_tointeger(L, -1); - lua_pop(L, 4); - return (Color) { r, g, b, a }; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "r") == LUA_TNUMBER, index, "Expected Color"); + unsigned char r = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "g") == LUA_TNUMBER, index, "Expected Color"); + unsigned char g = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "b") == LUA_TNUMBER, index, "Expected Color"); + unsigned char b = (unsigned char)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "a") == LUA_TNUMBER, index, "Expected Color"); + unsigned char a = (unsigned char)lua_tointeger(L, -1); + lua_pop(L, 4); + return (Color) { r, g, b, a }; } static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index) { - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Rectangle"); - int x = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Rectangle"); - int y = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "width") == LUA_TNUMBER, index, "Expected Rectangle"); - int w = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "height") == LUA_TNUMBER, index, "Expected Rectangle"); - int h = (int)lua_tointeger(L, -1); - lua_pop(L, 4); - return (Rectangle) { x, y, w, h }; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Rectangle"); + int x = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Rectangle"); + int y = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "width") == LUA_TNUMBER, index, "Expected Rectangle"); + int w = (int)lua_tointeger(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "height") == LUA_TNUMBER, index, "Expected Rectangle"); + int h = (int)lua_tointeger(L, -1); + lua_pop(L, 4); + return (Rectangle) { x, y, w, h }; } static Camera LuaGetArgument_Camera(lua_State* L, int index) { - Camera result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Camera"); - result.position = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera"); - result.target = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "up") == LUA_TTABLE, index, "Expected Camera"); - result.up = LuaGetArgument_Vector3(L, -1); + Camera result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Camera"); + result.position = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera"); + result.target = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "up") == LUA_TTABLE, index, "Expected Camera"); + result.up = LuaGetArgument_Vector3(L, -1); luaL_argcheck(L, lua_getfield(L, index, "fovy") == LUA_TNUMBER, index, "Expected Camera"); - result.fovy = LuaGetArgument_float(L, -1); - lua_pop(L, 4); - return result; + result.fovy = LuaGetArgument_float(L, -1); + lua_pop(L, 4); + return result; } static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) { - Camera2D result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "offset") == LUA_TTABLE, index, "Expected Camera2D"); - result.offset = LuaGetArgument_Vector2(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera2D"); - result.target = LuaGetArgument_Vector2(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TNUMBER, index, "Expected Camera2D"); - result.rotation = LuaGetArgument_float(L, -1); + Camera2D result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "offset") == LUA_TTABLE, index, "Expected Camera2D"); + result.offset = LuaGetArgument_Vector2(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera2D"); + result.target = LuaGetArgument_Vector2(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TNUMBER, index, "Expected Camera2D"); + result.rotation = LuaGetArgument_float(L, -1); luaL_argcheck(L, lua_getfield(L, index, "zoom") == LUA_TNUMBER, index, "Expected Camera2D"); - result.zoom = LuaGetArgument_float(L, -1); - lua_pop(L, 4); - return result; + result.zoom = LuaGetArgument_float(L, -1); + lua_pop(L, 4); + return result; } static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) { - BoundingBox result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "min") == LUA_TTABLE, index, "Expected BoundingBox"); - result.min = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "max") == LUA_TTABLE, index, "Expected BoundingBox"); - result.max = LuaGetArgument_Vector3(L, -1); - lua_pop(L, 2); - return result; + BoundingBox result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "min") == LUA_TTABLE, index, "Expected BoundingBox"); + result.min = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "max") == LUA_TTABLE, index, "Expected BoundingBox"); + result.max = LuaGetArgument_Vector3(L, -1); + lua_pop(L, 2); + return result; } static Ray LuaGetArgument_Ray(lua_State* L, int index) { - Ray result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Ray"); - result.position = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "direction") == LUA_TTABLE, index, "Expected Ray"); - result.direction = LuaGetArgument_Vector3(L, -1); - lua_pop(L, 2); - return result; + Ray result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Ray"); + result.position = LuaGetArgument_Vector3(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "direction") == LUA_TTABLE, index, "Expected Ray"); + result.direction = LuaGetArgument_Vector3(L, -1); + lua_pop(L, 2); + return result; } static Matrix LuaGetArgument_Matrix(lua_State* L, int index) { - Matrix result = { 0 }; - float* ptr = &result.m0; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + Matrix result = { 0 }; + float* ptr = &result.m0; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - for (int i = 0; i < 16; i++) - { - lua_geti(L, index, i+1); - ptr[i] = luaL_checknumber(L, -1); - } - lua_pop(L, 16); - return result; + for (int i = 0; i < 16; i++) + { + lua_geti(L, index, i+1); + ptr[i] = luaL_checknumber(L, -1); + } + lua_pop(L, 16); + return result; } static Material LuaGetArgument_Material(lua_State* L, int index) { Material result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values luaL_argcheck(L, lua_getfield(L, index, "shader") == LUA_TUSERDATA, index, "Expected Material"); - result.shader = LuaGetArgument_Shader(L, -1); + result.shader = LuaGetArgument_Shader(L, -1); luaL_argcheck(L, lua_getfield(L, index, "texDiffuse") == LUA_TUSERDATA, index, "Expected Material"); - result.texDiffuse = LuaGetArgument_Texture2D(L, -1); + result.texDiffuse = LuaGetArgument_Texture2D(L, -1); luaL_argcheck(L, lua_getfield(L, index, "texNormal") == LUA_TUSERDATA, index, "Expected Material"); - result.texNormal = LuaGetArgument_Texture2D(L, -1); + result.texNormal = LuaGetArgument_Texture2D(L, -1); luaL_argcheck(L, lua_getfield(L, index, "texSpecular") == LUA_TUSERDATA, index, "Expected Material"); - result.texSpecular = LuaGetArgument_Texture2D(L, -1); + result.texSpecular = LuaGetArgument_Texture2D(L, -1); luaL_argcheck(L, lua_getfield(L, index, "colDiffuse") == LUA_TTABLE, index, "Expected Material"); - result.colDiffuse = LuaGetArgument_Color(L, -1); + result.colDiffuse = LuaGetArgument_Color(L, -1); luaL_argcheck(L, lua_getfield(L, index, "colAmbient") == LUA_TTABLE, index, "Expected Material"); - result.colAmbient = LuaGetArgument_Color(L, -1); + result.colAmbient = LuaGetArgument_Color(L, -1); luaL_argcheck(L, lua_getfield(L, index, "colSpecular") == LUA_TTABLE, index, "Expected Material"); - result.colSpecular = LuaGetArgument_Color(L, -1); + result.colSpecular = LuaGetArgument_Color(L, -1); luaL_argcheck(L, lua_getfield(L, index, "glossiness") == LUA_TNUMBER, index, "Expected Material"); - result.glossiness = LuaGetArgument_float(L, -1); + result.glossiness = LuaGetArgument_float(L, -1); lua_pop(L, 8); return result; } static Model LuaGetArgument_Model(lua_State* L, int index) { - Model result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "mesh") == LUA_TUSERDATA, index, "Expected Model"); - result.mesh = LuaGetArgument_Mesh(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "transform") == LUA_TTABLE, index, "Expected Model"); - result.transform = LuaGetArgument_Matrix(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "material") == LUA_TTABLE, index, "Expected Model"); - result.material = LuaGetArgument_Material(L, -1); - lua_pop(L, 3); - return result; + Model result; + index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values + luaL_argcheck(L, lua_getfield(L, index, "mesh") == LUA_TUSERDATA, index, "Expected Model"); + result.mesh = LuaGetArgument_Mesh(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "transform") == LUA_TTABLE, index, "Expected Model"); + result.transform = LuaGetArgument_Matrix(L, -1); + luaL_argcheck(L, lua_getfield(L, index, "material") == LUA_TTABLE, index, "Expected Model"); + result.material = LuaGetArgument_Material(L, -1); + lua_pop(L, 3); + return result; } //---------------------------------------------------------------------------------- @@ -506,149 +506,149 @@ static Model LuaGetArgument_Model(lua_State* L, int index) //---------------------------------------------------------------------------------- static void LuaPush_Color(lua_State* L, Color color) { - lua_createtable(L, 0, 4); - lua_pushinteger(L, color.r); - lua_setfield(L, -2, "r"); - lua_pushinteger(L, color.g); - lua_setfield(L, -2, "g"); - lua_pushinteger(L, color.b); - lua_setfield(L, -2, "b"); - lua_pushinteger(L, color.a); - lua_setfield(L, -2, "a"); + lua_createtable(L, 0, 4); + lua_pushinteger(L, color.r); + lua_setfield(L, -2, "r"); + lua_pushinteger(L, color.g); + lua_setfield(L, -2, "g"); + lua_pushinteger(L, color.b); + lua_setfield(L, -2, "b"); + lua_pushinteger(L, color.a); + lua_setfield(L, -2, "a"); } static void LuaPush_Vector2(lua_State* L, Vector2 vec) { - lua_createtable(L, 0, 2); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); + lua_createtable(L, 0, 2); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); } static void LuaPush_Vector3(lua_State* L, Vector3 vec) { - lua_createtable(L, 0, 3); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); - lua_pushnumber(L, vec.z); - lua_setfield(L, -2, "z"); + lua_createtable(L, 0, 3); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); + lua_pushnumber(L, vec.z); + lua_setfield(L, -2, "z"); } static void LuaPush_Quaternion(lua_State* L, Quaternion vec) { - lua_createtable(L, 0, 4); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); - lua_pushnumber(L, vec.z); - lua_setfield(L, -2, "z"); - lua_pushnumber(L, vec.w); - lua_setfield(L, -2, "w"); + lua_createtable(L, 0, 4); + lua_pushnumber(L, vec.x); + lua_setfield(L, -2, "x"); + lua_pushnumber(L, vec.y); + lua_setfield(L, -2, "y"); + lua_pushnumber(L, vec.z); + lua_setfield(L, -2, "z"); + lua_pushnumber(L, vec.w); + lua_setfield(L, -2, "w"); } static void LuaPush_Matrix(lua_State* L, Matrix *matrix) { - int i; - lua_createtable(L, 16, 0); - float* num = (&matrix->m0); - for (i = 0; i < 16; i++) - { - lua_pushnumber(L, num[i]); - lua_rawseti(L, -2, i + 1); - } + int i; + lua_createtable(L, 16, 0); + float* num = (&matrix->m0); + for (i = 0; i < 16; i++) + { + lua_pushnumber(L, num[i]); + lua_rawseti(L, -2, i + 1); + } } static void LuaPush_Rectangle(lua_State* L, Rectangle rect) { - lua_createtable(L, 0, 4); - lua_pushinteger(L, rect.x); - lua_setfield(L, -2, "x"); - lua_pushinteger(L, rect.y); - lua_setfield(L, -2, "y"); - lua_pushinteger(L, rect.width); - lua_setfield(L, -2, "width"); - lua_pushinteger(L, rect.height); - lua_setfield(L, -2, "height"); + lua_createtable(L, 0, 4); + lua_pushinteger(L, rect.x); + lua_setfield(L, -2, "x"); + lua_pushinteger(L, rect.y); + lua_setfield(L, -2, "y"); + lua_pushinteger(L, rect.width); + lua_setfield(L, -2, "width"); + lua_pushinteger(L, rect.height); + lua_setfield(L, -2, "height"); } static void LuaPush_Ray(lua_State* L, Ray ray) { - lua_createtable(L, 0, 2); - LuaPush_Vector3(L, ray.position); - lua_setfield(L, -2, "position"); - LuaPush_Vector3(L, ray.direction); - lua_setfield(L, -2, "direction"); + lua_createtable(L, 0, 2); + LuaPush_Vector3(L, ray.position); + lua_setfield(L, -2, "position"); + LuaPush_Vector3(L, ray.direction); + lua_setfield(L, -2, "direction"); } static void LuaPush_BoundingBox(lua_State* L, BoundingBox bb) { - lua_createtable(L, 0, 2); - LuaPush_Vector3(L, bb.min); - lua_setfield(L, -2, "min"); - LuaPush_Vector3(L, bb.max); - lua_setfield(L, -2, "max"); + lua_createtable(L, 0, 2); + LuaPush_Vector3(L, bb.min); + lua_setfield(L, -2, "min"); + LuaPush_Vector3(L, bb.max); + lua_setfield(L, -2, "max"); } static void LuaPush_Camera(lua_State* L, Camera cam) { - lua_createtable(L, 0, 4); - LuaPush_Vector3(L, cam.position); - lua_setfield(L, -2, "position"); - LuaPush_Vector3(L, cam.target); - lua_setfield(L, -2, "target"); - LuaPush_Vector3(L, cam.up); - lua_setfield(L, -2, "up"); + lua_createtable(L, 0, 4); + LuaPush_Vector3(L, cam.position); + lua_setfield(L, -2, "position"); + LuaPush_Vector3(L, cam.target); + lua_setfield(L, -2, "target"); + LuaPush_Vector3(L, cam.up); + lua_setfield(L, -2, "up"); lua_pushnumber(L, cam.fovy); - lua_setfield(L, -2, "fovy"); + lua_setfield(L, -2, "fovy"); } static void LuaPush_Camera2D(lua_State* L, Camera2D cam) { - lua_createtable(L, 0, 4); - LuaPush_Vector2(L, cam.offset); - lua_setfield(L, -2, "offset"); - LuaPush_Vector2(L, cam.target); - lua_setfield(L, -2, "target"); - lua_pushnumber(L, cam.rotation); - lua_setfield(L, -2, "rotation"); + lua_createtable(L, 0, 4); + LuaPush_Vector2(L, cam.offset); + lua_setfield(L, -2, "offset"); + LuaPush_Vector2(L, cam.target); + lua_setfield(L, -2, "target"); + lua_pushnumber(L, cam.rotation); + lua_setfield(L, -2, "rotation"); lua_pushnumber(L, cam.zoom); - lua_setfield(L, -2, "zoom"); + lua_setfield(L, -2, "zoom"); } static void LuaPush_Material(lua_State* L, Material mat) { - lua_createtable(L, 0, 8); - LuaPush_Shader(L, mat.shader); - lua_setfield(L, -2, "shader"); - LuaPush_Texture2D(L, mat.texDiffuse); - lua_setfield(L, -2, "texDiffuse"); - LuaPush_Texture2D(L, mat.texNormal); - lua_setfield(L, -2, "texNormal"); + lua_createtable(L, 0, 8); + LuaPush_Shader(L, mat.shader); + lua_setfield(L, -2, "shader"); + LuaPush_Texture2D(L, mat.texDiffuse); + lua_setfield(L, -2, "texDiffuse"); + LuaPush_Texture2D(L, mat.texNormal); + lua_setfield(L, -2, "texNormal"); LuaPush_Texture2D(L, mat.texSpecular); - lua_setfield(L, -2, "texSpecular"); + lua_setfield(L, -2, "texSpecular"); LuaPush_Color(L, mat.colDiffuse); - lua_setfield(L, -2, "colDiffuse"); + lua_setfield(L, -2, "colDiffuse"); LuaPush_Color(L, mat.colAmbient); - lua_setfield(L, -2, "colAmbient"); + lua_setfield(L, -2, "colAmbient"); LuaPush_Color(L, mat.colSpecular); - lua_setfield(L, -2, "colSpecular"); + lua_setfield(L, -2, "colSpecular"); lua_pushnumber(L, mat.glossiness); - lua_setfield(L, -2, "glossiness"); + lua_setfield(L, -2, "glossiness"); } static void LuaPush_Model(lua_State* L, Model mdl) { - lua_createtable(L, 0, 4); - LuaPush_Mesh(L, mdl.mesh); - lua_setfield(L, -2, "mesh"); - LuaPush_Matrix(L, &mdl.transform); - lua_setfield(L, -2, "transform"); - LuaPush_Material(L, mdl.material); - lua_setfield(L, -2, "material"); + lua_createtable(L, 0, 4); + LuaPush_Mesh(L, mdl.mesh); + lua_setfield(L, -2, "mesh"); + LuaPush_Matrix(L, &mdl.transform); + lua_setfield(L, -2, "transform"); + LuaPush_Material(L, mdl.material); + lua_setfield(L, -2, "material"); } //---------------------------------------------------------------------------------- @@ -656,95 +656,95 @@ static void LuaPush_Model(lua_State* L, Model mdl) //---------------------------------------------------------------------------------- static int lua_Color(lua_State* L) { - LuaPush_Color(L, (Color) { (unsigned char)luaL_checkinteger(L, 1), (unsigned char)luaL_checkinteger(L, 2), (unsigned char)luaL_checkinteger(L, 3), (unsigned char)luaL_checkinteger(L, 4) }); - return 1; + LuaPush_Color(L, (Color) { (unsigned char)luaL_checkinteger(L, 1), (unsigned char)luaL_checkinteger(L, 2), (unsigned char)luaL_checkinteger(L, 3), (unsigned char)luaL_checkinteger(L, 4) }); + return 1; } static int lua_Vector2(lua_State* L) { - LuaPush_Vector2(L, (Vector2) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2) }); - return 1; + LuaPush_Vector2(L, (Vector2) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2) }); + return 1; } static int lua_Vector3(lua_State* L) { - LuaPush_Vector3(L, (Vector3) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3) }); - return 1; + LuaPush_Vector3(L, (Vector3) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3) }); + return 1; } static int lua_Quaternion(lua_State* L) { - LuaPush_Quaternion(L, (Quaternion) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4) }); - return 1; + LuaPush_Quaternion(L, (Quaternion) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4) }); + return 1; } /* static int lua_Matrix(lua_State* L) { - LuaPush_Matrix(L, (Matrix) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4), + LuaPush_Matrix(L, (Matrix) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4), (float)luaL_checknumber(L, 5), (float)luaL_checknumber(L, 6), (float)luaL_checknumber(L, 7), (float)luaL_checknumber(L, 8), (float)luaL_checknumber(L, 9), (float)luaL_checknumber(L, 10), (float)luaL_checknumber(L, 11), (float)luaL_checknumber(L, 12), (float)luaL_checknumber(L, 13), (float)luaL_checknumber(L, 14), (float)luaL_checknumber(L, 15), (float)luaL_checknumber(L, 16) }); - return 1; + return 1; } */ static int lua_Rectangle(lua_State* L) { - LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); - return 1; + LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); + return 1; } static int lua_Ray(lua_State* L) { - Vector2 pos = LuaGetArgument_Vector2(L, 1); - Vector2 dir = LuaGetArgument_Vector2(L, 2); - LuaPush_Ray(L, (Ray) { { pos.x, pos.y }, { dir.x, dir.y } }); - return 1; + Vector2 pos = LuaGetArgument_Vector2(L, 1); + Vector2 dir = LuaGetArgument_Vector2(L, 2); + LuaPush_Ray(L, (Ray) { { pos.x, pos.y }, { dir.x, dir.y } }); + return 1; } static int lua_BoundingBox(lua_State* L) { - Vector3 min = LuaGetArgument_Vector3(L, 1); - Vector3 max = LuaGetArgument_Vector3(L, 2); - LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y }, { max.x, max.y } }); - return 1; + Vector3 min = LuaGetArgument_Vector3(L, 1); + Vector3 max = LuaGetArgument_Vector3(L, 2); + LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y }, { max.x, max.y } }); + return 1; } static int lua_Camera(lua_State* L) { - Vector3 pos = LuaGetArgument_Vector3(L, 1); - Vector3 tar = LuaGetArgument_Vector3(L, 2); - Vector3 up = LuaGetArgument_Vector3(L, 3); + Vector3 pos = LuaGetArgument_Vector3(L, 1); + Vector3 tar = LuaGetArgument_Vector3(L, 2); + Vector3 up = LuaGetArgument_Vector3(L, 3); //float fovy = LuaGetArgument_float(L, 4); // ??? - LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, (float)luaL_checknumber(L, 4) }); - return 1; + LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, (float)luaL_checknumber(L, 4) }); + return 1; } static int lua_Camera2D(lua_State* L) { - Vector2 off = LuaGetArgument_Vector2(L, 1); - Vector2 tar = LuaGetArgument_Vector2(L, 2); - float rot = LuaGetArgument_float(L, 3); + Vector2 off = LuaGetArgument_Vector2(L, 1); + Vector2 tar = LuaGetArgument_Vector2(L, 2); + float rot = LuaGetArgument_float(L, 3); float zoom = LuaGetArgument_float(L, 4); - LuaPush_Camera2D(L, (Camera2D) { { off.x, off.y }, { tar.x, tar.y }, rot, zoom }); - return 1; + LuaPush_Camera2D(L, (Camera2D) { { off.x, off.y }, { tar.x, tar.y }, rot, zoom }); + return 1; } /* // NOTE: does it make sense to have this constructor? Probably not... static int lua_Material(lua_State* L) { - Shader sdr = LuaGetArgument_Shader(L, 1); - Texture2D td = LuaGetArgument_Texture2D(L, 2); - Texture2D tn = LuaGetArgument_Texture2D(L, 3); - Texture2D ts = LuaGetArgument_Texture2D(L, 4); - Color cd = LuaGetArgument_Color(L, 5); - Color ca = LuaGetArgument_Color(L, 6); - Color cs = LuaGetArgument_Color(L, 7); + Shader sdr = LuaGetArgument_Shader(L, 1); + Texture2D td = LuaGetArgument_Texture2D(L, 2); + Texture2D tn = LuaGetArgument_Texture2D(L, 3); + Texture2D ts = LuaGetArgument_Texture2D(L, 4); + Color cd = LuaGetArgument_Color(L, 5); + Color ca = LuaGetArgument_Color(L, 6); + Color cs = LuaGetArgument_Color(L, 7); float gloss = LuaGetArgument_float(L, 8); - LuaPush_Material(L, (Material) { sdr, td, tn, ts cd, ca, cs, gloss }); - return 1; + LuaPush_Material(L, (Material) { sdr, td, tn, ts cd, ca, cs, gloss }); + return 1; } */ @@ -757,166 +757,166 @@ static int lua_Material(lua_State* L) //------------------------------------------------------------------------------------ int lua_InitWindow(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - const char * arg3 = LuaGetArgument_string(L, 3); - InitWindow(arg1, arg2, arg3); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + const char * arg3 = LuaGetArgument_string(L, 3); + InitWindow(arg1, arg2, arg3); + return 0; } int lua_CloseWindow(lua_State* L) { - CloseWindow(); - return 0; + CloseWindow(); + return 0; } int lua_WindowShouldClose(lua_State* L) { - bool result = WindowShouldClose(); - lua_pushboolean(L, result); - return 1; + bool result = WindowShouldClose(); + lua_pushboolean(L, result); + return 1; } int lua_IsWindowMinimized(lua_State* L) { - bool result = IsWindowMinimized(); - lua_pushboolean(L, result); - return 1; + bool result = IsWindowMinimized(); + lua_pushboolean(L, result); + return 1; } int lua_ToggleFullscreen(lua_State* L) { - ToggleFullscreen(); - return 0; + ToggleFullscreen(); + return 0; } int lua_GetScreenWidth(lua_State* L) { - int result = GetScreenWidth(); - lua_pushinteger(L, result); - return 1; + int result = GetScreenWidth(); + lua_pushinteger(L, result); + return 1; } int lua_GetScreenHeight(lua_State* L) { - int result = GetScreenHeight(); - lua_pushinteger(L, result); - return 1; + int result = GetScreenHeight(); + lua_pushinteger(L, result); + return 1; } int lua_ShowCursor(lua_State* L) { - ShowCursor(); - return 0; + ShowCursor(); + return 0; } int lua_HideCursor(lua_State* L) { - HideCursor(); - return 0; + HideCursor(); + return 0; } int lua_IsCursorHidden(lua_State* L) { - bool result = IsCursorHidden(); - lua_pushboolean(L, result); - return 1; + bool result = IsCursorHidden(); + lua_pushboolean(L, result); + return 1; } int lua_EnableCursor(lua_State* L) { - EnableCursor(); - return 0; + EnableCursor(); + return 0; } int lua_DisableCursor(lua_State* L) { - DisableCursor(); - return 0; + DisableCursor(); + return 0; } int lua_ClearBackground(lua_State* L) { - Color arg1 = LuaGetArgument_Color(L, 1); - ClearBackground(arg1); - return 0; + Color arg1 = LuaGetArgument_Color(L, 1); + ClearBackground(arg1); + return 0; } int lua_BeginDrawing(lua_State* L) { - BeginDrawing(); - return 0; + BeginDrawing(); + return 0; } int lua_EndDrawing(lua_State* L) { - EndDrawing(); - return 0; + EndDrawing(); + return 0; } int lua_Begin2dMode(lua_State* L) { - Camera2D arg1 = LuaGetArgument_Camera2D(L, 1); - Begin2dMode(arg1); - return 0; + Camera2D arg1 = LuaGetArgument_Camera2D(L, 1); + Begin2dMode(arg1); + return 0; } int lua_End2dMode(lua_State* L) { - End2dMode(); - return 0; + End2dMode(); + return 0; } int lua_Begin3dMode(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - Begin3dMode(arg1); - return 0; + Camera arg1 = LuaGetArgument_Camera(L, 1); + Begin3dMode(arg1); + return 0; } int lua_End3dMode(lua_State* L) { - End3dMode(); - return 0; + End3dMode(); + return 0; } int lua_BeginTextureMode(lua_State* L) { - RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); - BeginTextureMode(arg1); - return 0; + RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); + BeginTextureMode(arg1); + return 0; } int lua_EndTextureMode(lua_State* L) { - EndTextureMode(); - return 0; + EndTextureMode(); + return 0; } int lua_GetMouseRay(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Camera arg2 = LuaGetArgument_Camera(L, 2); - Ray result = GetMouseRay(arg1, arg2); - LuaPush_Ray(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Camera arg2 = LuaGetArgument_Camera(L, 2); + Ray result = GetMouseRay(arg1, arg2); + LuaPush_Ray(L, result); + return 1; } int lua_GetWorldToScreen(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Camera arg2 = LuaGetArgument_Camera(L, 2); - Vector2 result = GetWorldToScreen(arg1, arg2); - LuaPush_Vector2(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Camera arg2 = LuaGetArgument_Camera(L, 2); + Vector2 result = GetWorldToScreen(arg1, arg2); + LuaPush_Vector2(L, result); + return 1; } int lua_GetCameraMatrix(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - Matrix result = GetCameraMatrix(arg1); - LuaPush_Matrix(L, &result); - return 1; + Camera arg1 = LuaGetArgument_Camera(L, 1); + Matrix result = GetCameraMatrix(arg1); + LuaPush_Matrix(L, &result); + return 1; } #if defined(PLATFORM_WEB) @@ -925,167 +925,167 @@ static int LuaDrawLoopFunc; static void LuaDrawLoop() { - lua_rawgeti(L, LUA_REGISTRYINDEX, LuaDrawLoopFunc); - lua_call(L, 0, 0); + lua_rawgeti(L, LUA_REGISTRYINDEX, LuaDrawLoopFunc); + lua_call(L, 0, 0); } int lua_SetDrawingLoop(lua_State* L) { - luaL_argcheck(L, lua_isfunction(L, 1), 1, "Loop function expected"); - lua_pushvalue(L, 1); - LuaDrawLoopFunc = luaL_ref(L, LUA_REGISTRYINDEX); - SetDrawingLoop(&LuaDrawLoop); - return 0; + luaL_argcheck(L, lua_isfunction(L, 1), 1, "Loop function expected"); + lua_pushvalue(L, 1); + LuaDrawLoopFunc = luaL_ref(L, LUA_REGISTRYINDEX); + SetDrawingLoop(&LuaDrawLoop); + return 0; } #else int lua_SetTargetFPS(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetTargetFPS(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetTargetFPS(arg1); + return 0; } #endif int lua_GetFPS(lua_State* L) { - float result = GetFPS(); - lua_pushnumber(L, result); - return 1; + float result = GetFPS(); + lua_pushnumber(L, result); + return 1; } int lua_GetFrameTime(lua_State* L) { - float result = GetFrameTime(); - lua_pushnumber(L, result); - return 1; + float result = GetFrameTime(); + lua_pushnumber(L, result); + return 1; } int lua_GetColor(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - Color result = GetColor(arg1); - LuaPush_Color(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + Color result = GetColor(arg1); + LuaPush_Color(L, result); + return 1; } int lua_GetHexValue(lua_State* L) { - Color arg1 = LuaGetArgument_Color(L, 1); - int result = GetHexValue(arg1); - lua_pushinteger(L, result); - return 1; + Color arg1 = LuaGetArgument_Color(L, 1); + int result = GetHexValue(arg1); + lua_pushinteger(L, result); + return 1; } int lua_ColorToFloat(lua_State* L) { - Color arg1 = LuaGetArgument_Color(L, 1); - float * result = ColorToFloat(arg1); - lua_createtable(L, 4, 0); - for (int i = 0; i < 4; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; + Color arg1 = LuaGetArgument_Color(L, 1); + float * result = ColorToFloat(arg1); + lua_createtable(L, 4, 0); + for (int i = 0; i < 4; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; } int lua_VectorToFloat(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float * result = VectorToFloat(arg1); - lua_createtable(L, 3, 0); - for (int i = 0; i < 3; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float * result = VectorToFloat(arg1); + lua_createtable(L, 3, 0); + for (int i = 0; i < 3; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; } int lua_MatrixToFloat(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float * result = MatrixToFloat(arg1); - lua_createtable(L, 16, 0); - for (int i = 0; i < 16; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float * result = MatrixToFloat(arg1); + lua_createtable(L, 16, 0); + for (int i = 0; i < 16; i++) + { + lua_pushnumber(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; } int lua_GetRandomValue(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int result = GetRandomValue(arg1, arg2); - lua_pushinteger(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int result = GetRandomValue(arg1, arg2); + lua_pushinteger(L, result); + return 1; } int lua_Fade(lua_State* L) { - Color arg1 = LuaGetArgument_Color(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color result = Fade(arg1, arg2); - LuaPush_Color(L, result); - return 1; + Color arg1 = LuaGetArgument_Color(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color result = Fade(arg1, arg2); + LuaPush_Color(L, result); + return 1; } int lua_SetConfigFlags(lua_State* L) { - char arg1 = LuaGetArgument_char(L, 1); - SetConfigFlags(arg1); - return 0; + char arg1 = LuaGetArgument_char(L, 1); + SetConfigFlags(arg1); + return 0; } int lua_ShowLogo(lua_State* L) { - ShowLogo(); - return 0; + ShowLogo(); + return 0; } int lua_IsFileDropped(lua_State* L) { - bool result = IsFileDropped(); - lua_pushboolean(L, result); - return 1; + bool result = IsFileDropped(); + lua_pushboolean(L, result); + return 1; } /* int lua_*GetDroppedFiles(lua_State* L) { - int * arg1 = LuaGetArgument_int *(L, 1); - //char * result = *GetDroppedFiles(arg1); - LuaPush_//char *(L, result); - return 1; + int * arg1 = LuaGetArgument_int *(L, 1); + //char * result = *GetDroppedFiles(arg1); + LuaPush_//char *(L, result); + return 1; } */ int lua_ClearDroppedFiles(lua_State* L) { - ClearDroppedFiles(); - return 0; + ClearDroppedFiles(); + return 0; } int lua_StorageSaveValue(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - StorageSaveValue(arg1, arg2); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + StorageSaveValue(arg1, arg2); + return 0; } int lua_StorageLoadValue(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - int result = StorageLoadValue(arg1); - lua_pushinteger(L, result); - return 1; + int result = StorageLoadValue(arg1); + lua_pushinteger(L, result); + return 1; } //------------------------------------------------------------------------------------ @@ -1094,217 +1094,217 @@ int lua_StorageLoadValue(lua_State* L) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) int lua_IsKeyPressed(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyPressed(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyPressed(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsKeyDown(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyDown(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyDown(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsKeyReleased(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyReleased(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyReleased(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsKeyUp(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyUp(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsKeyUp(arg1); + lua_pushboolean(L, result); + return 1; } int lua_GetKeyPressed(lua_State* L) { - int result = GetKeyPressed(); - lua_pushinteger(L, result); - return 1; + int result = GetKeyPressed(); + lua_pushinteger(L, result); + return 1; } int lua_SetExitKey(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetExitKey(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetExitKey(arg1); + return 0; } int lua_IsGamepadAvailable(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsGamepadAvailable(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsGamepadAvailable(arg1); + lua_pushboolean(L, result); + return 1; } int lua_GetGamepadAxisMovement(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float result = GetGamepadAxisMovement(arg1, arg2); - lua_pushnumber(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float result = GetGamepadAxisMovement(arg1, arg2); + lua_pushnumber(L, result); + return 1; } int lua_IsGamepadButtonPressed(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonPressed(arg1, arg2); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonPressed(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_IsGamepadButtonDown(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonDown(arg1, arg2); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonDown(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_IsGamepadButtonReleased(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonReleased(arg1, arg2); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonReleased(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_IsGamepadButtonUp(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonUp(arg1, arg2); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + bool result = IsGamepadButtonUp(arg1, arg2); + lua_pushboolean(L, result); + return 1; } #endif int lua_IsMouseButtonPressed(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonPressed(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonPressed(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsMouseButtonDown(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonDown(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonDown(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsMouseButtonReleased(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonReleased(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonReleased(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsMouseButtonUp(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonUp(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsMouseButtonUp(arg1); + lua_pushboolean(L, result); + return 1; } int lua_GetMouseX(lua_State* L) { - int result = GetMouseX(); - lua_pushinteger(L, result); - return 1; + int result = GetMouseX(); + lua_pushinteger(L, result); + return 1; } int lua_GetMouseY(lua_State* L) { - int result = GetMouseY(); - lua_pushinteger(L, result); - return 1; + int result = GetMouseY(); + lua_pushinteger(L, result); + return 1; } int lua_GetMousePosition(lua_State* L) { - Vector2 result = GetMousePosition(); - LuaPush_Vector2(L, result); - return 1; + Vector2 result = GetMousePosition(); + LuaPush_Vector2(L, result); + return 1; } int lua_SetMousePosition(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - SetMousePosition(arg1); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + SetMousePosition(arg1); + return 0; } int lua_GetMouseWheelMove(lua_State* L) { - int result = GetMouseWheelMove(); - lua_pushinteger(L, result); - return 1; + int result = GetMouseWheelMove(); + lua_pushinteger(L, result); + return 1; } int lua_GetTouchX(lua_State* L) { - int result = GetTouchX(); - lua_pushinteger(L, result); - return 1; + int result = GetTouchX(); + lua_pushinteger(L, result); + return 1; } int lua_GetTouchY(lua_State* L) { - int result = GetTouchY(); - lua_pushinteger(L, result); - return 1; + int result = GetTouchY(); + lua_pushinteger(L, result); + return 1; } int lua_GetTouchPosition(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - Vector2 result = GetTouchPosition(arg1); - LuaPush_Vector2(L, result); - return 1; + Vector2 result = GetTouchPosition(arg1); + LuaPush_Vector2(L, result); + return 1; } #if defined(PLATFORM_ANDROID) int lua_IsButtonPressed(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonPressed(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonPressed(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsButtonDown(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonDown(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonDown(arg1); + lua_pushboolean(L, result); + return 1; } int lua_IsButtonReleased(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonReleased(arg1); - lua_pushboolean(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + bool result = IsButtonReleased(arg1); + lua_pushboolean(L, result); + return 1; } #endif @@ -1313,66 +1313,66 @@ int lua_IsButtonReleased(lua_State* L) //------------------------------------------------------------------------------------ int lua_SetGesturesEnabled(lua_State* L) { - unsigned arg1 = LuaGetArgument_unsigned(L, 1); - SetGesturesEnabled(arg1); - return 0; + unsigned arg1 = LuaGetArgument_unsigned(L, 1); + SetGesturesEnabled(arg1); + return 0; } int lua_IsGestureDetected(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - bool result = IsGestureDetected(arg1); - lua_pushboolean(L, result); - return 1; + bool result = IsGestureDetected(arg1); + lua_pushboolean(L, result); + return 1; } int lua_GetTouchPointsCount(lua_State* L) { - int result = GetTouchPointsCount(); - lua_pushinteger(L, result); - return 1; + int result = GetTouchPointsCount(); + lua_pushinteger(L, result); + return 1; } int lua_GetGestureDetected(lua_State* L) { - int result = GetGestureDetected(); - lua_pushinteger(L, result); - return 1; + int result = GetGestureDetected(); + lua_pushinteger(L, result); + return 1; } int lua_GetGestureHoldDuration(lua_State* L) { - int result = GetGestureHoldDuration(); - lua_pushinteger(L, result); - return 1; + int result = GetGestureHoldDuration(); + lua_pushinteger(L, result); + return 1; } int lua_GetGestureDragVector(lua_State* L) { - Vector2 result = GetGestureDragVector(); - LuaPush_Vector2(L, result); - return 1; + Vector2 result = GetGestureDragVector(); + LuaPush_Vector2(L, result); + return 1; } int lua_GetGestureDragAngle(lua_State* L) { - float result = GetGestureDragAngle(); - lua_pushnumber(L, result); - return 1; + float result = GetGestureDragAngle(); + lua_pushnumber(L, result); + return 1; } int lua_GetGesturePinchVector(lua_State* L) { - Vector2 result = GetGesturePinchVector(); - LuaPush_Vector2(L, result); - return 1; + Vector2 result = GetGesturePinchVector(); + LuaPush_Vector2(L, result); + return 1; } int lua_GetGesturePinchAngle(lua_State* L) { - float result = GetGesturePinchAngle(); - lua_pushnumber(L, result); - return 1; + float result = GetGesturePinchAngle(); + lua_pushnumber(L, result); + return 1; } //------------------------------------------------------------------------------------ @@ -1380,88 +1380,88 @@ int lua_GetGesturePinchAngle(lua_State* L) //------------------------------------------------------------------------------------ int lua_SetCameraMode(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetCameraMode(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetCameraMode(arg1); + return 0; } int lua_UpdateCamera(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - UpdateCamera(&arg1); - LuaPush_Camera(L, arg1); - return 1; + Camera arg1 = LuaGetArgument_Camera(L, 1); + UpdateCamera(&arg1); + LuaPush_Camera(L, arg1); + return 1; } int lua_UpdateCameraPlayer(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - UpdateCameraPlayer(&arg1, &arg2); - LuaPush_Camera(L, arg1); - LuaPush_Vector3(L, arg2); - return 2; + Camera arg1 = LuaGetArgument_Camera(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + UpdateCameraPlayer(&arg1, &arg2); + LuaPush_Camera(L, arg1); + LuaPush_Vector3(L, arg2); + return 2; } int lua_SetCameraPosition(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - SetCameraPosition(arg1); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + SetCameraPosition(arg1); + return 0; } int lua_SetCameraTarget(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - SetCameraTarget(arg1); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + SetCameraTarget(arg1); + return 0; } int lua_SetCameraFovy(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - SetCameraFovy(arg1); - return 0; + float arg1 = LuaGetArgument_float(L, 1); + SetCameraFovy(arg1); + return 0; } int lua_SetCameraPanControl(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetCameraPanControl(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetCameraPanControl(arg1); + return 0; } int lua_SetCameraAltControl(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetCameraAltControl(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetCameraAltControl(arg1); + return 0; } int lua_SetCameraSmoothZoomControl(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetCameraSmoothZoomControl(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + SetCameraSmoothZoomControl(arg1); + return 0; } int lua_SetCameraMoveControls(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - int arg6 = LuaGetArgument_int(L, 6); - SetCameraMoveControls(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + int arg6 = LuaGetArgument_int(L, 6); + SetCameraMoveControls(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_SetCameraMouseSensitivity(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - SetCameraMouseSensitivity(arg1); - return 0; + float arg1 = LuaGetArgument_float(L, 1); + SetCameraMouseSensitivity(arg1); + return 0; } //------------------------------------------------------------------------------------ @@ -1469,274 +1469,274 @@ int lua_SetCameraMouseSensitivity(lua_State* L) //------------------------------------------------------------------------------------ int lua_DrawPixel(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawPixel(arg1, arg2, arg3); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawPixel(arg1, arg2, arg3); + return 0; } int lua_DrawPixelV(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPixelV(arg1, arg2); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPixelV(arg1, arg2); + return 0; } int lua_DrawLine(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawLine(arg1, arg2, arg3, arg4, arg5); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawLine(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawLineV(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawLineV(arg1, arg2, arg3); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawLineV(arg1, arg2, arg3); + return 0; } int lua_DrawCircle(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawCircle(arg1, arg2, arg3, arg4); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawCircle(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawCircleGradient(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCircleGradient(arg1, arg2, arg3, arg4, arg5); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCircleGradient(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawCircleV(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawCircleV(arg1, arg2, arg3); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawCircleV(arg1, arg2, arg3); + return 0; } int lua_DrawCircleLines(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawCircleLines(arg1, arg2, arg3, arg4); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawCircleLines(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawRectangle(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawRectangle(arg1, arg2, arg3, arg4, arg5); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawRectangle(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawRectangleRec(lua_State* L) { - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawRectangleRec(arg1, arg2); - return 0; + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawRectangleRec(arg1, arg2); + return 0; } int lua_DrawRectangleGradient(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawRectangleGradient(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawRectangleGradient(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawRectangleV(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawRectangleV(arg1, arg2, arg3); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawRectangleV(arg1, arg2, arg3); + return 0; } int lua_DrawRectangleLines(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawRectangleLines(arg1, arg2, arg3, arg4, arg5); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawRectangleLines(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawTriangle(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTriangle(arg1, arg2, arg3, arg4); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTriangle(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawTriangleLines(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTriangleLines(arg1, arg2, arg3, arg4); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTriangleLines(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawPoly(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawPoly(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawPoly(arg1, arg2, arg3, arg4, arg5); + return 0; } #define GET_TABLE(type, name, index) \ - type* name = 0; \ - size_t name##_size = 0; \ - { \ - size_t sz = 0; \ - luaL_checktype(L, index, LUA_TTABLE); \ - lua_pushnil(L); \ - while (lua_next(L, index)) { \ - LuaGetArgument_##type(L, -1); \ - sz++; \ - lua_pop(L, 1); \ - } \ - lua_pop(L, 1); \ - name = calloc(sz, sizeof(type)); \ - sz = 0; \ - lua_pushnil(L); \ - while (lua_next(L, index)) { \ - name[sz] = LuaGetArgument_##type(L, -1); \ - sz++; \ - lua_pop(L, 1); \ - } \ - lua_pop(L, 1); \ - name##_size = sz; \ - } + type* name = 0; \ + size_t name##_size = 0; \ + { \ + size_t sz = 0; \ + luaL_checktype(L, index, LUA_TTABLE); \ + lua_pushnil(L); \ + while (lua_next(L, index)) { \ + LuaGetArgument_##type(L, -1); \ + sz++; \ + lua_pop(L, 1); \ + } \ + lua_pop(L, 1); \ + name = calloc(sz, sizeof(type)); \ + sz = 0; \ + lua_pushnil(L); \ + while (lua_next(L, index)) { \ + name[sz] = LuaGetArgument_##type(L, -1); \ + sz++; \ + lua_pop(L, 1); \ + } \ + lua_pop(L, 1); \ + name##_size = sz; \ + } int lua_DrawPolyEx(lua_State* L) { - GET_TABLE(Vector2, arg1, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPolyEx(arg1, arg1_size, arg2); - free(arg1); - return 0; + GET_TABLE(Vector2, arg1, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPolyEx(arg1, arg1_size, arg2); + free(arg1); + return 0; } int lua_DrawPolyExLines(lua_State* L) { - GET_TABLE(Vector2, arg1, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPolyExLines(arg1, arg1_size, arg2); - free(arg1); - return 0; + GET_TABLE(Vector2, arg1, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawPolyExLines(arg1, arg1_size, arg2); + free(arg1); + return 0; } int lua_CheckCollisionRecs(lua_State* L) { - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - bool result = CheckCollisionRecs(arg1, arg2); - lua_pushboolean(L, result); - return 1; + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + bool result = CheckCollisionRecs(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionCircles(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - bool result = CheckCollisionCircles(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + bool result = CheckCollisionCircles(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionCircleRec(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - bool result = CheckCollisionCircleRec(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + bool result = CheckCollisionCircleRec(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; } int lua_GetCollisionRec(lua_State* L) { - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Rectangle result = GetCollisionRec(arg1, arg2); - LuaPush_Rectangle(L, result); - return 1; + Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Rectangle result = GetCollisionRec(arg1, arg2); + LuaPush_Rectangle(L, result); + return 1; } int lua_CheckCollisionPointRec(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - bool result = CheckCollisionPointRec(arg1, arg2); - lua_pushboolean(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + bool result = CheckCollisionPointRec(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionPointCircle(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionPointCircle(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + bool result = CheckCollisionPointCircle(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionPointTriangle(lua_State* L) { - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Vector2 arg4 = LuaGetArgument_Vector2(L, 4); - bool result = CheckCollisionPointTriangle(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; + Vector2 arg1 = LuaGetArgument_Vector2(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Vector2 arg4 = LuaGetArgument_Vector2(L, 4); + bool result = CheckCollisionPointTriangle(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; } //------------------------------------------------------------------------------------ @@ -1744,385 +1744,385 @@ int lua_CheckCollisionPointTriangle(lua_State* L) //------------------------------------------------------------------------------------ int lua_LoadImage(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - Image result = LoadImage(arg1); - LuaPush_Image(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + Image result = LoadImage(arg1); + LuaPush_Image(L, result); + return 1; } int lua_LoadImageEx(lua_State* L) { - //Color * arg1 = LuaGetArgument_Color *(L, 1); - GET_TABLE(Color, arg1, 1); + //Color * arg1 = LuaGetArgument_Color *(L, 1); + GET_TABLE(Color, arg1, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - Image result = LoadImageEx(arg1, arg2, arg3); - LuaPush_Image(L, result); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + Image result = LoadImageEx(arg1, arg2, arg3); + LuaPush_Image(L, result); - free(arg1); - return 1; + free(arg1); + return 1; } int lua_LoadImageRaw(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Image result = LoadImageRaw(arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Image result = LoadImageRaw(arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, result); + return 1; } int lua_LoadImageFromRES(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Image result = LoadImageFromRES(arg1, arg2); - LuaPush_Image(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Image result = LoadImageFromRES(arg1, arg2); + LuaPush_Image(L, result); + return 1; } int lua_LoadTexture(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - Texture2D result = LoadTexture(arg1); - LuaPush_Texture2D(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + Texture2D result = LoadTexture(arg1); + LuaPush_Texture2D(L, result); + return 1; } int lua_LoadTextureEx(lua_State* L) { - void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string + void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Texture2D result = LoadTextureEx(arg1, arg2, arg3, arg4); - LuaPush_Texture2D(L, result); - return 1; + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Texture2D result = LoadTextureEx(arg1, arg2, arg3, arg4); + LuaPush_Texture2D(L, result); + return 1; } int lua_LoadTextureFromRES(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Texture2D result = LoadTextureFromRES(arg1, arg2); - LuaPush_Texture2D(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Texture2D result = LoadTextureFromRES(arg1, arg2); + LuaPush_Texture2D(L, result); + return 1; } int lua_LoadTextureFromImage(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Texture2D result = LoadTextureFromImage(arg1); - LuaPush_Texture2D(L, result); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Texture2D result = LoadTextureFromImage(arg1); + LuaPush_Texture2D(L, result); + return 1; } int lua_LoadRenderTexture(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - RenderTexture2D result = LoadRenderTexture(arg1, arg2); - LuaPush_RenderTexture2D(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + RenderTexture2D result = LoadRenderTexture(arg1, arg2); + LuaPush_RenderTexture2D(L, result); + return 1; } int lua_UnloadImage(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - UnloadImage(arg1); - return 0; + Image arg1 = LuaGetArgument_Image(L, 1); + UnloadImage(arg1); + return 0; } int lua_UnloadTexture(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - UnloadTexture(arg1); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + UnloadTexture(arg1); + return 0; } int lua_UnloadRenderTexture(lua_State* L) { - RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); - UnloadRenderTexture(arg1); - return 0; + RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); + UnloadRenderTexture(arg1); + return 0; } int lua_GetImageData(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Color * result = GetImageData(arg1); - lua_createtable(L, arg1.width*arg1.height, 0); - for (int i = 0; i < arg1.width*arg1.height; i++) - { - LuaPush_Color(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Color * result = GetImageData(arg1); + lua_createtable(L, arg1.width*arg1.height, 0); + for (int i = 0; i < arg1.width*arg1.height; i++) + { + LuaPush_Color(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + free(result); + return 1; } int lua_GetTextureData(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Image result = GetTextureData(arg1); - LuaPush_Image(L, result); - return 1; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Image result = GetTextureData(arg1); + LuaPush_Image(L, result); + return 1; } int lua_ImageToPOT(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - ImageToPOT(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + ImageToPOT(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageFormat(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - ImageFormat(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + ImageFormat(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageDither(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); + Image arg1 = LuaGetArgument_Image(L, 1); int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); int arg5 = LuaGetArgument_int(L, 5); - ImageDither(&arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, arg1); - return 1; + ImageDither(&arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageCopy(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Image result = ImageCopy(arg1); - LuaPush_Image(L, result); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Image result = ImageCopy(arg1); + LuaPush_Image(L, result); + return 1; } int lua_ImageCrop(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - ImageCrop(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + ImageCrop(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageResize(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - ImageResize(&arg1, arg2, arg3); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + ImageResize(&arg1, arg2, arg3); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageResizeNN(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - ImageResizeNN(&arg1, arg2, arg3); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + ImageResizeNN(&arg1, arg2, arg3); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageText(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - Image result = ImageText(arg1, arg2, arg3); - LuaPush_Image(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + Image result = ImageText(arg1, arg2, arg3); + LuaPush_Image(L, result); + return 1; } int lua_ImageTextEx(lua_State* L) { SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Image result = ImageTextEx(arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, result); - return 1; + const char * arg2 = LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Image result = ImageTextEx(arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, result); + return 1; } int lua_ImageDraw(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Image arg2 = LuaGetArgument_Image(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Rectangle arg4 = LuaGetArgument_Rectangle(L, 4); - ImageDraw(&arg1, arg2, arg3, arg4); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Image arg2 = LuaGetArgument_Image(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Rectangle arg4 = LuaGetArgument_Rectangle(L, 4); + ImageDraw(&arg1, arg2, arg3, arg4); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageDrawText(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - const char * arg3 = LuaGetArgument_string(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - ImageDrawText(&arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + const char * arg3 = LuaGetArgument_string(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + ImageDrawText(&arg1, arg2, arg3, arg4, arg5); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageDrawTextEx(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - SpriteFont arg3 = LuaGetArgument_SpriteFont(L, 3); - const char * arg4 = LuaGetArgument_string(L, 4); - int arg5 = LuaGetArgument_int(L, 5); + Image arg1 = LuaGetArgument_Image(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + SpriteFont arg3 = LuaGetArgument_SpriteFont(L, 3); + const char * arg4 = LuaGetArgument_string(L, 4); + int arg5 = LuaGetArgument_int(L, 5); int arg6 = LuaGetArgument_int(L, 6); - Color arg7 = LuaGetArgument_Color(L, 7); - ImageDrawTextEx(&arg1, arg2, arg3, arg4, arg5, arg6, arg7); - LuaPush_Image(L, arg1); - return 1; + Color arg7 = LuaGetArgument_Color(L, 7); + ImageDrawTextEx(&arg1, arg2, arg3, arg4, arg5, arg6, arg7); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageFlipVertical(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - ImageFlipVertical(&arg1); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + ImageFlipVertical(&arg1); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageFlipHorizontal(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - ImageFlipHorizontal(&arg1); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + ImageFlipHorizontal(&arg1); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageColorTint(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - ImageColorTint(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + ImageColorTint(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageColorInvert(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - ImageColorInvert(&arg1); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + ImageColorInvert(&arg1); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageColorGrayscale(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - ImageColorGrayscale(&arg1); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + ImageColorGrayscale(&arg1); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageColorContrast(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - ImageColorContrast(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + ImageColorContrast(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_ImageColorBrightness(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - ImageColorBrightness(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + ImageColorBrightness(&arg1, arg2); + LuaPush_Image(L, arg1); + return 1; } int lua_GenTextureMipmaps(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - GenTextureMipmaps(arg1); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + GenTextureMipmaps(arg1); + return 0; } int lua_UpdateTexture(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? - UpdateTexture(arg1, arg2); - return 0; + UpdateTexture(arg1, arg2); + return 0; } int lua_DrawTexture(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTexture(arg1, arg2, arg3, arg4); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTexture(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawTextureV(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawTextureV(arg1, arg2, arg3); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawTextureV(arg1, arg2, arg3); + return 0; } int lua_DrawTextureEx(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawTextureEx(arg1, arg2, arg3, arg4, arg5); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawTextureEx(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawTextureRec(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTextureRec(arg1, arg2, arg3, arg4); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawTextureRec(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawTexturePro(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Vector2 arg4 = LuaGetArgument_Vector2(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawTexturePro(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Vector2 arg4 = LuaGetArgument_Vector2(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawTexturePro(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } //------------------------------------------------------------------------------------ @@ -2130,230 +2130,230 @@ int lua_DrawTexturePro(lua_State* L) //------------------------------------------------------------------------------------ int lua_GetDefaultFont(lua_State* L) { - SpriteFont result = GetDefaultFont(); - LuaPush_SpriteFont(L, result); - return 1; + SpriteFont result = GetDefaultFont(); + LuaPush_SpriteFont(L, result); + return 1; } int lua_LoadSpriteFont(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - SpriteFont result = LoadSpriteFont(arg1); - LuaPush_SpriteFont(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + SpriteFont result = LoadSpriteFont(arg1); + LuaPush_SpriteFont(L, result); + return 1; } int lua_UnloadSpriteFont(lua_State* L) { - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - UnloadSpriteFont(arg1); - return 0; + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + UnloadSpriteFont(arg1); + return 0; } int lua_DrawText(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawText(arg1, arg2, arg3, arg4, arg5); - return 0; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawText(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawTextEx(lua_State* L) { - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawTextEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + Vector2 arg3 = LuaGetArgument_Vector2(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawTextEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_MeasureText(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int result = MeasureText(arg1, arg2); - lua_pushinteger(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int result = MeasureText(arg1, arg2); + lua_pushinteger(L, result); + return 1; } int lua_MeasureTextEx(lua_State* L) { - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Vector2 result = MeasureTextEx(arg1, arg2, arg3, arg4); - LuaPush_Vector2(L, result); - return 1; + SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Vector2 result = MeasureTextEx(arg1, arg2, arg3, arg4); + LuaPush_Vector2(L, result); + return 1; } int lua_DrawFPS(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - DrawFPS(arg1, arg2); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + DrawFPS(arg1, arg2); + return 0; } -// TODO: const char *FormatText(const char *text, ...); -// TODO: const char *SubText(const char *text, int position, int length); +// NOTE: FormatText() can be replaced by Lua function: string.format() +// NOTE: SubText() can be replaced by Lua function: string.sub() int lua_DrawCube(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCube(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCube(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawCubeV(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawCubeV(arg1, arg2, arg3); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawCubeV(arg1, arg2, arg3); + return 0; } int lua_DrawCubeWires(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCubeWires(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCubeWires(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawCubeTexture(lua_State* L) { - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCubeTexture(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCubeTexture(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawSphere(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawSphere(arg1, arg2, arg3); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawSphere(arg1, arg2, arg3); + return 0; } int lua_DrawSphereEx(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawSphereEx(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawSphereEx(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawSphereWires(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawSphereWires(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawSphereWires(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawCylinder(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCylinder(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCylinder(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawCylinderWires(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCylinderWires(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawCylinderWires(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawPlane(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawPlane(arg1, arg2, arg3); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector2 arg2 = LuaGetArgument_Vector2(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawPlane(arg1, arg2, arg3); + return 0; } int lua_DrawRay(lua_State* L) { - Ray arg1 = LuaGetArgument_Ray(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawRay(arg1, arg2); - return 0; + Ray arg1 = LuaGetArgument_Ray(L, 1); + Color arg2 = LuaGetArgument_Color(L, 2); + DrawRay(arg1, arg2); + return 0; } int lua_DrawGrid(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - DrawGrid(arg1, arg2); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + DrawGrid(arg1, arg2); + return 0; } int lua_DrawGizmo(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - DrawGizmo(arg1); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + DrawGizmo(arg1); + return 0; } // TODO: DrawLight(Light light); int lua_Draw3DLine(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - Draw3DLine(arg1, arg2, arg3); - return 0; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + Draw3DLine(arg1, arg2, arg3); + return 0; } int lua_Draw3DCircle(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); float arg2 = LuaGetArgument_float(L, 2); float arg3 = LuaGetArgument_float(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Draw3DCircle(arg1, arg2, arg3, arg4, arg5); - return 0; + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + Draw3DCircle(arg1, arg2, arg3, arg4, arg5); + return 0; } //------------------------------------------------------------------------------------ @@ -2361,231 +2361,231 @@ int lua_Draw3DCircle(lua_State* L) //------------------------------------------------------------------------------------ int lua_LoadModel(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - Model result = LoadModel(arg1); - LuaPush_Model(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + Model result = LoadModel(arg1); + LuaPush_Model(L, result); + return 1; } int lua_LoadModelEx(lua_State* L) { - Mesh arg1 = LuaGetArgument_Mesh(L, 1); - bool arg2 = LuaGetArgument_int(L, 2); - Model result = LoadModelEx(arg1, arg2); - LuaPush_Model(L, result); - return 1; + Mesh arg1 = LuaGetArgument_Mesh(L, 1); + bool arg2 = LuaGetArgument_int(L, 2); + Model result = LoadModelEx(arg1, arg2); + LuaPush_Model(L, result); + return 1; } int lua_LoadModelFromRES(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Model result = LoadModelFromRES(arg1, arg2); - LuaPush_Model(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Model result = LoadModelFromRES(arg1, arg2); + LuaPush_Model(L, result); + return 1; } int lua_LoadHeightmap(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Model result = LoadHeightmap(arg1, arg2); - LuaPush_Model(L, result); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Model result = LoadHeightmap(arg1, arg2); + LuaPush_Model(L, result); + return 1; } int lua_LoadCubicmap(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Model result = LoadCubicmap(arg1); - LuaPush_Model(L, result); - return 1; + Image arg1 = LuaGetArgument_Image(L, 1); + Model result = LoadCubicmap(arg1); + LuaPush_Model(L, result); + return 1; } int lua_UnloadModel(lua_State* L) { - Model arg1 = LuaGetArgument_Model(L, 1); - UnloadModel(arg1); - return 0; + Model arg1 = LuaGetArgument_Model(L, 1); + UnloadModel(arg1); + return 0; } // TODO: GenMesh*() functionality (not ready yet on raylib 1.6) int lua_LoadMaterial(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - Material result = LoadMaterial(arg1); - LuaPush_Material(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + Material result = LoadMaterial(arg1); + LuaPush_Material(L, result); + return 1; } int lua_LoadDefaultMaterial(lua_State* L) { - Material result = LoadDefaultMaterial(); - LuaPush_Material(L, result); - return 1; + Material result = LoadDefaultMaterial(); + LuaPush_Material(L, result); + return 1; } int lua_LoadStandardMaterial(lua_State* L) { - Material result = LoadStandardMaterial(); - LuaPush_Material(L, result); - return 1; + Material result = LoadStandardMaterial(); + LuaPush_Material(L, result); + return 1; } int lua_UnloadMaterial(lua_State* L) { - Material arg1 = LuaGetArgument_Material(L, 1); - UnloadMaterial(arg1); - return 0; + Material arg1 = LuaGetArgument_Material(L, 1); + UnloadMaterial(arg1); + return 0; } int lua_DrawModel(lua_State* L) { - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawModel(arg1, arg2, arg3, arg4); - return 0; + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawModel(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawModelEx(lua_State* L) { - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 arg5 = LuaGetArgument_Vector3(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawModelEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + float arg4 = LuaGetArgument_float(L, 4); + Vector3 arg5 = LuaGetArgument_Vector3(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawModelEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawModelWires(lua_State* L) { - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawModelWires(arg1, arg2, arg3, arg4); - return 0; + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Color arg4 = LuaGetArgument_Color(L, 4); + DrawModelWires(arg1, arg2, arg3, arg4); + return 0; } int lua_DrawModelWiresEx(lua_State* L) { - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Model arg1 = LuaGetArgument_Model(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 arg5 = LuaGetArgument_Vector3(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawModelWiresEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + float arg4 = LuaGetArgument_float(L, 4); + Vector3 arg5 = LuaGetArgument_Vector3(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawModelWiresEx(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_DrawBillboard(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawBillboard(arg1, arg2, arg3, arg4, arg5); - return 0; + Camera arg1 = LuaGetArgument_Camera(L, 1); + Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawBillboard(arg1, arg2, arg3, arg4, arg5); + return 0; } int lua_DrawBillboardRec(lua_State* L) { - Camera arg1 = LuaGetArgument_Camera(L, 1); - Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawBillboardRec(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; + Camera arg1 = LuaGetArgument_Camera(L, 1); + Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); + Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + float arg5 = LuaGetArgument_float(L, 5); + Color arg6 = LuaGetArgument_Color(L, 6); + DrawBillboardRec(arg1, arg2, arg3, arg4, arg5, arg6); + return 0; } int lua_CalculateBoundingBox(lua_State* L) { - Mesh arg1 = LuaGetArgument_Mesh(L, 1); + Mesh arg1 = LuaGetArgument_Mesh(L, 1); BoundingBox result = CalculateBoundingBox(arg1); - LuaPush_BoundingBox(L, result); - return 1; + LuaPush_BoundingBox(L, result); + return 1; } int lua_CheckCollisionSpheres(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - bool result = CheckCollisionSpheres(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + bool result = CheckCollisionSpheres(arg1, arg2, arg3, arg4); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionBoxes(lua_State* L) { - BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); - BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); - bool result = CheckCollisionBoxes(arg1, arg2); - lua_pushboolean(L, result); - return 1; + BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); + BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); + bool result = CheckCollisionBoxes(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionBoxSphere(lua_State* L) { - BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionBoxSphere(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; + BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + bool result = CheckCollisionBoxSphere(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionRaySphere(lua_State* L) { - Ray arg1 = LuaGetArgument_Ray(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionRaySphere(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; + Ray arg1 = LuaGetArgument_Ray(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + bool result = CheckCollisionRaySphere(arg1, arg2, arg3); + lua_pushboolean(L, result); + return 1; } int lua_CheckCollisionRaySphereEx(lua_State* L) { - Ray arg1 = LuaGetArgument_Ray(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); + Ray arg1 = LuaGetArgument_Ray(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - bool result = CheckCollisionRaySphereEx(arg1, arg2, arg3, &arg4); - lua_pushboolean(L, result); + bool result = CheckCollisionRaySphereEx(arg1, arg2, arg3, &arg4); + lua_pushboolean(L, result); LuaPush_Vector3(L, arg4); - return 2; + return 2; } int lua_CheckCollisionRayBox(lua_State* L) { - Ray arg1 = LuaGetArgument_Ray(L, 1); - BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); - bool result = CheckCollisionRayBox(arg1, arg2); - lua_pushboolean(L, result); - return 1; + Ray arg1 = LuaGetArgument_Ray(L, 1); + BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); + bool result = CheckCollisionRayBox(arg1, arg2); + lua_pushboolean(L, result); + return 1; } int lua_ResolveCollisionCubicmap(lua_State* L) { - Image arg1 = LuaGetArgument_Image(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 result = ResolveCollisionCubicmap(arg1, arg2, &arg3, arg4); - LuaPush_Vector3(L, result); - LuaPush_Vector3(L, arg3); - return 2; + Image arg1 = LuaGetArgument_Image(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); + Vector3 result = ResolveCollisionCubicmap(arg1, arg2, &arg3, arg4); + LuaPush_Vector3(L, result); + LuaPush_Vector3(L, arg3); + return 2; } //------------------------------------------------------------------------------------ @@ -2593,167 +2593,170 @@ int lua_ResolveCollisionCubicmap(lua_State* L) //------------------------------------------------------------------------------------ int lua_LoadShader(lua_State* L) { - char * arg1 = (char *)LuaGetArgument_string(L, 1); - char * arg2 = (char *)LuaGetArgument_string(L, 2); - Shader result = LoadShader(arg1, arg2); - LuaPush_Shader(L, result); - return 1; + char * arg1 = (char *)LuaGetArgument_string(L, 1); + char * arg2 = (char *)LuaGetArgument_string(L, 2); + Shader result = LoadShader(arg1, arg2); + LuaPush_Shader(L, result); + return 1; } int lua_UnloadShader(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - UnloadShader(arg1); - return 0; + Shader arg1 = LuaGetArgument_Shader(L, 1); + UnloadShader(arg1); + return 0; } int lua_GetDefaultShader(lua_State* L) { - Shader result = GetDefaultShader(); - LuaPush_Shader(L, result); - return 1; + Shader result = GetDefaultShader(); + LuaPush_Shader(L, result); + return 1; } int lua_GetStandardShader(lua_State* L) { - Shader result = GetStandardShader(); - LuaPush_Shader(L, result); - return 1; + Shader result = GetStandardShader(); + LuaPush_Shader(L, result); + return 1; } int lua_GetDefaultTexture(lua_State* L) { - Texture2D result = GetDefaultTexture(); - LuaPush_Texture2D(L, result); - return 1; + Texture2D result = GetDefaultTexture(); + LuaPush_Texture2D(L, result); + return 1; } int lua_GetShaderLocation(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int result = GetShaderLocation(arg1, arg2); - lua_pushinteger(L, result); - return 1; + Shader arg1 = LuaGetArgument_Shader(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int result = GetShaderLocation(arg1, arg2); + lua_pushinteger(L, result); + return 1; } int lua_SetShaderValue(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - GET_TABLE(float, arg3, 3); - SetShaderValue(arg1, arg2, arg3, arg3_size); - free(arg3); - return 0; + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + GET_TABLE(float, arg3, 3); + SetShaderValue(arg1, arg2, arg3, arg3_size); + free(arg3); + return 0; } int lua_SetShaderValuei(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - GET_TABLE(int, arg3, 3); - SetShaderValuei(arg1, arg2, arg3, arg3_size); - free(arg3); - return 0; + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + GET_TABLE(int, arg3, 3); + SetShaderValuei(arg1, arg2, arg3, arg3_size); + free(arg3); + return 0; } int lua_SetShaderValueMatrix(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Matrix arg3 = LuaGetArgument_Matrix(L, 3); - SetShaderValueMatrix(arg1, arg2, arg3); - return 0; + Shader arg1 = LuaGetArgument_Shader(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Matrix arg3 = LuaGetArgument_Matrix(L, 3); + SetShaderValueMatrix(arg1, arg2, arg3); + return 0; } int lua_SetMatrixProjection(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - SetMatrixProjection(arg1); - return 0; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + SetMatrixProjection(arg1); + return 0; } int lua_SetMatrixModelview(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - SetMatrixModelview(arg1); - return 0; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + SetMatrixModelview(arg1); + return 0; } int lua_BeginShaderMode(lua_State* L) { - Shader arg1 = LuaGetArgument_Shader(L, 1); - BeginShaderMode(arg1); - return 0; + Shader arg1 = LuaGetArgument_Shader(L, 1); + BeginShaderMode(arg1); + return 0; } int lua_EndShaderMode(lua_State* L) { - EndShaderMode(); - return 0; + EndShaderMode(); + return 0; } int lua_BeginBlendMode(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - BeginBlendMode(arg1); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + BeginBlendMode(arg1); + return 0; } int lua_EndBlendMode(lua_State* L) { - EndBlendMode(); - return 0; + EndBlendMode(); + return 0; } -// TODO: Light CreateLight(int type, Vector3 position, Color diffuse); -// TODO: void DestroyLight(Light light); - -//------------------------------------------------------------------------------------ -// raylib [rlgl] module functions - VR experience -//------------------------------------------------------------------------------------ -int lua_InitVrDevice(lua_State* L) +int lua_CreateLight(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - InitVrDevice(arg1); - return 0; + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + Light result = CreateLight(arg1, arg2, arg3); + LuaPush_Light(L, result); + return 1; } -int lua_CloseVrDevice(lua_State* L) +int lua_DestroyLight(lua_State* L) { - CloseVrDevice(); - return 0; + Light arg1 = LuaGetArgument_Light(L, 1); + DestroyLight(arg1); + return 0; } -int lua_UpdateVrTracking(lua_State* L) + +//------------------------------------------------------------------------------------ +// raylib [rlgl] module functions - VR experience +//------------------------------------------------------------------------------------ +int lua_InitVrDevice(lua_State* L) { - UpdateVrTracking(); - return 0; + int arg1 = LuaGetArgument_int(L, 1); + InitVrDevice(arg1); + return 0; } -int lua_BeginVrDrawing(lua_State* L) +int lua_CloseVrDevice(lua_State* L) { - BeginVrDrawing(); - return 0; + CloseVrDevice(); + return 0; } -int lua_EndVrDrawing(lua_State* L) +int lua_IsVrDeviceReady(lua_State* L) { - EndVrDrawing(); - return 0; + bool result = IsVrDeviceReady(); + lua_pushboolean(L, result); + return 1; } -int lua_IsVrDeviceReady(lua_State* L) +int lua_UpdateVrTracking(lua_State* L) { - bool result = IsVrDeviceReady(); - lua_pushboolean(L, result); - return 1; + UpdateVrTracking(); + return 0; } int lua_ToggleVrMode(lua_State* L) { - ToggleVrMode(); - return 0; + ToggleVrMode(); + return 0; } //------------------------------------------------------------------------------------ @@ -2761,213 +2764,213 @@ int lua_ToggleVrMode(lua_State* L) //------------------------------------------------------------------------------------ int lua_InitAudioDevice(lua_State* L) { - InitAudioDevice(); - return 0; + InitAudioDevice(); + return 0; } int lua_CloseAudioDevice(lua_State* L) { - CloseAudioDevice(); - return 0; + CloseAudioDevice(); + return 0; } int lua_IsAudioDeviceReady(lua_State* L) { - bool result = IsAudioDeviceReady(); + bool result = IsAudioDeviceReady(); lua_pushboolean(L, result); - return 1; + return 1; } int lua_LoadSound(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - Sound result = LoadSound((char*)arg1); - LuaPush_Sound(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + Sound result = LoadSound((char*)arg1); + LuaPush_Sound(L, result); + return 1; } int lua_LoadSoundFromWave(lua_State* L) { - Wave arg1 = LuaGetArgument_Wave(L, 1); - Sound result = LoadSoundFromWave(arg1); - LuaPush_Sound(L, result); - return 1; + Wave arg1 = LuaGetArgument_Wave(L, 1); + Sound result = LoadSoundFromWave(arg1); + LuaPush_Sound(L, result); + return 1; } int lua_LoadSoundFromRES(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Sound result = LoadSoundFromRES(arg1, arg2); - LuaPush_Sound(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + Sound result = LoadSoundFromRES(arg1, arg2); + LuaPush_Sound(L, result); + return 1; } int lua_UnloadSound(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - UnloadSound(arg1); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + UnloadSound(arg1); + return 0; } int lua_PlaySound(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - PlaySound(arg1); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + PlaySound(arg1); + return 0; } int lua_PauseSound(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - PauseSound(arg1); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + PauseSound(arg1); + return 0; } int lua_ResumeSound(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - ResumeSound(arg1); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + ResumeSound(arg1); + return 0; } int lua_StopSound(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - StopSound(arg1); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + StopSound(arg1); + return 0; } int lua_IsSoundPlaying(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - bool result = IsSoundPlaying(arg1); - lua_pushboolean(L, result); - return 1; + Sound arg1 = LuaGetArgument_Sound(L, 1); + bool result = IsSoundPlaying(arg1); + lua_pushboolean(L, result); + return 1; } int lua_SetSoundVolume(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetSoundVolume(arg1, arg2); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetSoundVolume(arg1, arg2); + return 0; } int lua_SetSoundPitch(lua_State* L) { - Sound arg1 = LuaGetArgument_Sound(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetSoundPitch(arg1, arg2); - return 0; + Sound arg1 = LuaGetArgument_Sound(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + SetSoundPitch(arg1, arg2); + return 0; } int lua_LoadMusicStream(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); + const char * arg1 = LuaGetArgument_string(L, 1); Music result = LoadMusicStream((char *)arg1); - LuaPush_Music(L, result); - return 1; + LuaPush_Music(L, result); + return 1; } int lua_UnloadMusicStream(lua_State* L) { - Music arg1 = LuaGetArgument_Music(L, 1); - UnloadMusicStream(arg1); - return 0; + Music arg1 = LuaGetArgument_Music(L, 1); + UnloadMusicStream(arg1); + return 0; } int lua_UpdateMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - UpdateMusicStream(arg1); - return 0; + UpdateMusicStream(arg1); + return 0; } int lua_PlayMusicStream(lua_State* L) { - Music arg1 = LuaGetArgument_Music(L, 1); - PlayMusicStream(arg1); - return 0; + Music arg1 = LuaGetArgument_Music(L, 1); + PlayMusicStream(arg1); + return 0; } int lua_StopMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - StopMusicStream(arg1); - return 0; + StopMusicStream(arg1); + return 0; } int lua_PauseMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - PauseMusicStream(arg1); - return 0; + PauseMusicStream(arg1); + return 0; } int lua_ResumeMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - ResumeMusicStream(arg1); - return 0; + ResumeMusicStream(arg1); + return 0; } int lua_IsMusicPlaying(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - bool result = IsMusicPlaying(arg1); - lua_pushboolean(L, result); - return 1; + bool result = IsMusicPlaying(arg1); + lua_pushboolean(L, result); + return 1; } int lua_SetMusicVolume(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetMusicVolume(arg1, arg2); - return 0; + float arg2 = LuaGetArgument_float(L, 2); + SetMusicVolume(arg1, arg2); + return 0; } int lua_SetMusicPitch(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetMusicPitch(arg1, arg2); - return 0; + float arg2 = LuaGetArgument_float(L, 2); + SetMusicPitch(arg1, arg2); + return 0; } int lua_GetMusicTimeLength(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - float result = GetMusicTimeLength(arg1); - lua_pushnumber(L, result); - return 1; + float result = GetMusicTimeLength(arg1); + lua_pushnumber(L, result); + return 1; } int lua_GetMusicTimePlayed(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); - float result = GetMusicTimePlayed(arg1); - lua_pushnumber(L, result); - return 1; + float result = GetMusicTimePlayed(arg1); + lua_pushnumber(L, result); + return 1; } int lua_InitAudioStream(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); AudioStream result = InitAudioStream(arg1, arg2, arg3); - LuaPush_AudioStream(L, result); - return 1; + LuaPush_AudioStream(L, result); + return 1; } int lua_CloseAudioStream(lua_State* L) { - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - CloseAudioStream(arg1); - return 0; + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + CloseAudioStream(arg1); + return 0; } int lua_UpdateAudioStream(lua_State* L) @@ -2975,45 +2978,45 @@ int lua_UpdateAudioStream(lua_State* L) AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); void * arg2 = (char *)LuaGetArgument_string(L, 2); int arg3 = LuaGetArgument_int(L, 3); - UpdateAudioStream(arg1, arg2, arg3); - return 0; + UpdateAudioStream(arg1, arg2, arg3); + return 0; } int lua_IsAudioBufferProcessed(lua_State* L) { AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - bool result = IsAudioBufferProcessed(arg1); - lua_pushboolean(L, result); - return 1; + bool result = IsAudioBufferProcessed(arg1); + lua_pushboolean(L, result); + return 1; } int lua_PlayAudioStream(lua_State* L) { - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - PlayAudioStream(arg1); - return 0; + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); + PlayAudioStream(arg1); + return 0; } int lua_StopAudioStream(lua_State* L) { AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - StopAudioStream(arg1); - return 0; + StopAudioStream(arg1); + return 0; } int lua_PauseAudioStream(lua_State* L) { AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - PauseAudioStream(arg1); - return 0; + PauseAudioStream(arg1); + return 0; } int lua_ResumeAudioStream(lua_State* L) { AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - ResumeAudioStream(arg1); - return 0; + ResumeAudioStream(arg1); + return 0; } //---------------------------------------------------------------------------------- @@ -3021,70 +3024,70 @@ int lua_ResumeAudioStream(lua_State* L) //---------------------------------------------------------------------------------- int lua_DecompressData(lua_State* L) { - unsigned char *arg1 = (unsigned char *)LuaGetArgument_string(L, 1); - unsigned arg2 = (unsigned)LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - unsigned char *result = DecompressData(arg1, arg2, arg3); - lua_pushlstring(L, (const char *)result, arg3); - return 1; + unsigned char *arg1 = (unsigned char *)LuaGetArgument_string(L, 1); + unsigned arg2 = (unsigned)LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + unsigned char *result = DecompressData(arg1, arg2, arg3); + lua_pushlstring(L, (const char *)result, arg3); + return 1; } #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) int lua_WriteBitmap(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - WriteBitmap(arg1, arg2, arg3, arg4); - return 0; + const char * arg1 = LuaGetArgument_string(L, 1); + unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + WriteBitmap(arg1, arg2, arg3, arg4); + return 0; } int lua_WritePNG(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - WritePNG(arg1, arg2, arg3, arg4, arg5); - return 0; + const char * arg1 = LuaGetArgument_string(L, 1); + unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + WritePNG(arg1, arg2, arg3, arg4, arg5); + return 0; } #endif int lua_TraceLog(lua_State* L) { - int num_args = lua_gettop(L) - 1; - int arg1 = LuaGetArgument_int(L, 1); + int num_args = lua_gettop(L) - 1; + int arg1 = LuaGetArgument_int(L, 1); - /// type, fmt, args... + /// type, fmt, args... - lua_rotate(L, 1, -1); /// fmt, args..., type - lua_pop(L, 1); /// fmt, args... + lua_rotate(L, 1, -1); /// fmt, args..., type + lua_pop(L, 1); /// fmt, args... - lua_getglobal(L, "string"); /// fmt, args..., [string] - lua_getfield(L, 1, "format"); /// fmt, args..., [string], format() - lua_rotate(L, 1, 2); /// [string], format(), fmt, args... - lua_call(L, num_args, 1); /// [string], formatted_string - - TraceLog(arg1, "%s", luaL_checkstring(L,-1)); - return 0; + lua_getglobal(L, "string"); /// fmt, args..., [string] + lua_getfield(L, 1, "format"); /// fmt, args..., [string], format() + lua_rotate(L, 1, 2); /// [string], format(), fmt, args... + lua_call(L, num_args, 1); /// [string], formatted_string + + TraceLog(arg1, "%s", luaL_checkstring(L,-1)); + return 0; } int lua_GetExtension(lua_State* L) { - const char * arg1 = LuaGetArgument_string(L, 1); - const char* result = GetExtension(arg1); - lua_pushstring(L, result); - return 1; + const char * arg1 = LuaGetArgument_string(L, 1); + const char* result = GetExtension(arg1); + lua_pushstring(L, result); + return 1; } int lua_GetNextPOT(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - int result = GetNextPOT(arg1); - lua_pushinteger(L, result); - return 1; + int arg1 = LuaGetArgument_int(L, 1); + int result = GetNextPOT(arg1); + lua_pushinteger(L, result); + return 1; } //---------------------------------------------------------------------------------- @@ -3092,123 +3095,123 @@ int lua_GetNextPOT(lua_State* L) //---------------------------------------------------------------------------------- int lua_VectorAdd(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorAdd(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorAdd(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorSubtract(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorSubtract(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorSubtract(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorCrossProduct(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorCrossProduct(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorCrossProduct(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorPerpendicular(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 result = VectorPerpendicular(arg1); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 result = VectorPerpendicular(arg1); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorDotProduct(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float result = VectorDotProduct(arg1, arg2); - lua_pushnumber(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float result = VectorDotProduct(arg1, arg2); + lua_pushnumber(L, result); + return 1; } int lua_VectorLength(lua_State* L) { - const Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float result = VectorLength(arg1); - lua_pushnumber(L, result); - return 1; + const Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float result = VectorLength(arg1); + lua_pushnumber(L, result); + return 1; } int lua_VectorScale(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - VectorScale(&arg1, arg2); - LuaPush_Vector3(L, arg1); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + VectorScale(&arg1, arg2); + LuaPush_Vector3(L, arg1); + return 1; } int lua_VectorNegate(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - VectorNegate(&arg1); - LuaPush_Vector3(L, arg1); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + VectorNegate(&arg1); + LuaPush_Vector3(L, arg1); + return 1; } int lua_VectorNormalize(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - VectorNormalize(&arg1); - LuaPush_Vector3(L, arg1); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + VectorNormalize(&arg1); + LuaPush_Vector3(L, arg1); + return 1; } int lua_VectorDistance(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float result = VectorDistance(arg1, arg2); - lua_pushnumber(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float result = VectorDistance(arg1, arg2); + lua_pushnumber(L, result); + return 1; } int lua_VectorLerp(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Vector3 result = VectorLerp(arg1, arg2, arg3); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Vector3 result = VectorLerp(arg1, arg2, arg3); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorReflect(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorReflect(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 result = VectorReflect(arg1, arg2); + LuaPush_Vector3(L, result); + return 1; } int lua_VectorTransform(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - VectorTransform(&arg1, arg2); - LuaPush_Vector3(L, arg1); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + VectorTransform(&arg1, arg2); + LuaPush_Vector3(L, arg1); + return 1; } int lua_VectorZero(lua_State* L) { - Vector3 result = VectorZero(); - LuaPush_Vector3(L, result); - return 1; + Vector3 result = VectorZero(); + LuaPush_Vector3(L, result); + return 1; } //---------------------------------------------------------------------------------- @@ -3216,176 +3219,176 @@ int lua_VectorZero(lua_State* L) //---------------------------------------------------------------------------------- int lua_MatrixDeterminant(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float result = MatrixDeterminant(arg1); - lua_pushnumber(L, result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float result = MatrixDeterminant(arg1); + lua_pushnumber(L, result); + return 1; } int lua_MatrixTrace(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float result = MatrixTrace(arg1); - lua_pushnumber(L, result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + float result = MatrixTrace(arg1); + lua_pushnumber(L, result); + return 1; } int lua_MatrixTranspose(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixTranspose(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixTranspose(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; } int lua_MatrixInvert(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixInvert(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixInvert(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; } int lua_MatrixNormalize(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixNormalize(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + MatrixNormalize(&arg1); + LuaPush_Matrix(L, &arg1); + return 1; } int lua_MatrixIdentity(lua_State* L) { - Matrix result = MatrixIdentity(); - LuaPush_Matrix(L, &result); - return 1; + Matrix result = MatrixIdentity(); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixAdd(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixAdd(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixAdd(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixSubstract(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixSubstract(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixSubstract(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixTranslate(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Matrix result = MatrixTranslate(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; + float arg1 = LuaGetArgument_float(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Matrix result = MatrixTranslate(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixRotate(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Matrix result = MatrixRotate(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Matrix result = MatrixRotate(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixRotateX(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateX(arg1); - LuaPush_Matrix(L, &result); - return 1; + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateX(arg1); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixRotateY(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateY(arg1); - LuaPush_Matrix(L, &result); - return 1; + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateY(arg1); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixRotateZ(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateZ(arg1); - LuaPush_Matrix(L, &result); - return 1; + float arg1 = LuaGetArgument_float(L, 1); + Matrix result = MatrixRotateZ(arg1); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixScale(lua_State* L) { - float arg1 = LuaGetArgument_float(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Matrix result = MatrixScale(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; + float arg1 = LuaGetArgument_float(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Matrix result = MatrixScale(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixMultiply(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixMultiply(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + Matrix result = MatrixMultiply(arg1, arg2); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixFrustum(lua_State* L) { - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - double arg5 = LuaGetArgument_double(L, 5); - double arg6 = LuaGetArgument_double(L, 6); - Matrix result = MatrixFrustum(arg1, arg2, arg3, arg4, arg5, arg6); - LuaPush_Matrix(L, &result); - return 1; + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + double arg5 = LuaGetArgument_double(L, 5); + double arg6 = LuaGetArgument_double(L, 6); + Matrix result = MatrixFrustum(arg1, arg2, arg3, arg4, arg5, arg6); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixPerspective(lua_State* L) { - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - Matrix result = MatrixPerspective(arg1, arg2, arg3, arg4); - LuaPush_Matrix(L, &result); - return 1; + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + Matrix result = MatrixPerspective(arg1, arg2, arg3, arg4); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixOrtho(lua_State* L) { - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - double arg5 = LuaGetArgument_double(L, 5); - double arg6 = LuaGetArgument_double(L, 6); - Matrix result = MatrixOrtho(arg1, arg2, arg3, arg4, arg5, arg6); - LuaPush_Matrix(L, &result); - return 1; + double arg1 = LuaGetArgument_double(L, 1); + double arg2 = LuaGetArgument_double(L, 2); + double arg3 = LuaGetArgument_double(L, 3); + double arg4 = LuaGetArgument_double(L, 4); + double arg5 = LuaGetArgument_double(L, 5); + double arg6 = LuaGetArgument_double(L, 6); + Matrix result = MatrixOrtho(arg1, arg2, arg3, arg4, arg5, arg6); + LuaPush_Matrix(L, &result); + return 1; } int lua_MatrixLookAt(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - Matrix result = MatrixLookAt(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + Matrix result = MatrixLookAt(arg1, arg2, arg3); + LuaPush_Matrix(L, &result); + return 1; } //---------------------------------------------------------------------------------- @@ -3393,82 +3396,82 @@ int lua_MatrixLookAt(lua_State* L) //---------------------------------------------------------------------------------- int lua_QuaternionLength(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - float result = QuaternionLength(arg1); - lua_pushnumber(L, result); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + float result = QuaternionLength(arg1); + lua_pushnumber(L, result); + return 1; } int lua_QuaternionNormalize(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - QuaternionNormalize(&arg1); - LuaPush_Quaternion(L, arg1); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + QuaternionNormalize(&arg1); + LuaPush_Quaternion(L, arg1); + return 1; } int lua_QuaternionMultiply(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); - Quaternion result = QuaternionMultiply(arg1, arg2); - LuaPush_Quaternion(L, result); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); + Quaternion result = QuaternionMultiply(arg1, arg2); + LuaPush_Quaternion(L, result); + return 1; } int lua_QuaternionSlerp(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Quaternion result = QuaternionSlerp(arg1, arg2, arg3); - LuaPush_Quaternion(L, result); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Quaternion result = QuaternionSlerp(arg1, arg2, arg3); + LuaPush_Quaternion(L, result); + return 1; } int lua_QuaternionFromMatrix(lua_State* L) { - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Quaternion result = QuaternionFromMatrix(arg1); - LuaPush_Quaternion(L, result); - return 1; + Matrix arg1 = LuaGetArgument_Matrix(L, 1); + Quaternion result = QuaternionFromMatrix(arg1); + LuaPush_Quaternion(L, result); + return 1; } int lua_QuaternionToMatrix(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Matrix result = QuaternionToMatrix(arg1); - LuaPush_Matrix(L, &result); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Matrix result = QuaternionToMatrix(arg1); + LuaPush_Matrix(L, &result); + return 1; } int lua_QuaternionFromAxisAngle(lua_State* L) { - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Quaternion result = QuaternionFromAxisAngle(arg1, arg2); - LuaPush_Quaternion(L, result); - return 1; + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + Quaternion result = QuaternionFromAxisAngle(arg1, arg2); + LuaPush_Quaternion(L, result); + return 1; } int lua_QuaternionToAxisAngle(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); Vector3 arg2; - float arg3 = 0; - QuaternionToAxisAngle(arg1, &arg2, &arg3); - LuaPush_Vector3(L, arg2); - lua_pushnumber(L, arg3); - return 2; + float arg3 = 0; + QuaternionToAxisAngle(arg1, &arg2, &arg3); + LuaPush_Vector3(L, arg2); + lua_pushnumber(L, arg3); + return 2; } int lua_QuaternionTransform(lua_State* L) { - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - QuaternionTransform(&arg1, arg2); - LuaPush_Quaternion(L, arg1); - return 1; + Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); + Matrix arg2 = LuaGetArgument_Matrix(L, 2); + QuaternionTransform(&arg1, arg2); + LuaPush_Quaternion(L, arg1); + return 1; } @@ -3479,174 +3482,174 @@ int lua_QuaternionTransform(lua_State* L) // raylib Functions (and data types) list static luaL_Reg raylib_functions[] = { - + // Register non-opaque data types REG(Color) - REG(Vector2) - REG(Vector3) + REG(Vector2) + REG(Vector3) //REG(Matrix) REG(Quaternion) - REG(Rectangle) - REG(Ray) - REG(Camera) - REG(Camera2D) + REG(Rectangle) + REG(Ray) + REG(Camera) + REG(Camera2D) REG(BoundingBox) //REG(Material) // Register functions - REG(InitWindow) - REG(CloseWindow) - REG(WindowShouldClose) - REG(IsWindowMinimized) - REG(ToggleFullscreen) - REG(GetScreenWidth) - REG(GetScreenHeight) + REG(InitWindow) + REG(CloseWindow) + REG(WindowShouldClose) + REG(IsWindowMinimized) + REG(ToggleFullscreen) + REG(GetScreenWidth) + REG(GetScreenHeight) - REG(ShowCursor) - REG(HideCursor) - REG(IsCursorHidden) - REG(EnableCursor) - REG(DisableCursor) - - REG(ClearBackground) - REG(BeginDrawing) - REG(EndDrawing) + REG(ShowCursor) + REG(HideCursor) + REG(IsCursorHidden) + REG(EnableCursor) + REG(DisableCursor) + + REG(ClearBackground) + REG(BeginDrawing) + REG(EndDrawing) REG(Begin2dMode) - REG(End2dMode) - REG(Begin3dMode) - REG(End3dMode) + REG(End2dMode) + REG(Begin3dMode) + REG(End3dMode) REG(BeginTextureMode) - REG(EndTextureMode) + REG(EndTextureMode) - REG(GetMouseRay) - REG(GetWorldToScreen) - REG(GetCameraMatrix) + REG(GetMouseRay) + REG(GetWorldToScreen) + REG(GetCameraMatrix) #if defined(PLATFORM_WEB) - REG(SetDrawingLoop) + REG(SetDrawingLoop) #else - REG(SetTargetFPS) + REG(SetTargetFPS) #endif - REG(GetFPS) - REG(GetFrameTime) + REG(GetFPS) + REG(GetFrameTime) - REG(GetColor) - REG(GetHexValue) - REG(ColorToFloat) - REG(VectorToFloat) - REG(MatrixToFloat) - REG(GetRandomValue) - REG(Fade) - REG(SetConfigFlags) - REG(ShowLogo) + REG(GetColor) + REG(GetHexValue) + REG(ColorToFloat) + REG(VectorToFloat) + REG(MatrixToFloat) + REG(GetRandomValue) + REG(Fade) + REG(SetConfigFlags) + REG(ShowLogo) - REG(IsFileDropped) - //REG(*GetDroppedFiles) - REG(ClearDroppedFiles) - REG(StorageSaveValue) - REG(StorageLoadValue) + REG(IsFileDropped) + //REG(*GetDroppedFiles) + REG(ClearDroppedFiles) + REG(StorageSaveValue) + REG(StorageLoadValue) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) - REG(IsKeyPressed) - REG(IsKeyDown) - REG(IsKeyReleased) - REG(IsKeyUp) - REG(GetKeyPressed) + REG(IsKeyPressed) + REG(IsKeyDown) + REG(IsKeyReleased) + REG(IsKeyUp) + REG(GetKeyPressed) REG(SetExitKey) - REG(IsGamepadAvailable) + REG(IsGamepadAvailable) REG(GetGamepadAxisMovement) - REG(IsGamepadButtonPressed) - REG(IsGamepadButtonDown) - REG(IsGamepadButtonReleased) - REG(IsGamepadButtonUp) + REG(IsGamepadButtonPressed) + REG(IsGamepadButtonDown) + REG(IsGamepadButtonReleased) + REG(IsGamepadButtonUp) #endif - REG(IsMouseButtonPressed) - REG(IsMouseButtonDown) - REG(IsMouseButtonReleased) - REG(IsMouseButtonUp) - REG(GetMouseX) - REG(GetMouseY) - REG(GetMousePosition) - REG(SetMousePosition) - REG(GetMouseWheelMove) - REG(GetTouchX) - REG(GetTouchY) - REG(GetTouchPosition) + REG(IsMouseButtonPressed) + REG(IsMouseButtonDown) + REG(IsMouseButtonReleased) + REG(IsMouseButtonUp) + REG(GetMouseX) + REG(GetMouseY) + REG(GetMousePosition) + REG(SetMousePosition) + REG(GetMouseWheelMove) + REG(GetTouchX) + REG(GetTouchY) + REG(GetTouchPosition) #if defined(PLATFORM_ANDROID) - REG(IsButtonPressed) - REG(IsButtonDown) - REG(IsButtonReleased) + REG(IsButtonPressed) + REG(IsButtonDown) + REG(IsButtonReleased) #endif - REG(SetGesturesEnabled) - REG(IsGestureDetected) - REG(GetGestureDetected) + REG(SetGesturesEnabled) + REG(IsGestureDetected) + REG(GetGestureDetected) REG(GetTouchPointsCount) - REG(GetGestureHoldDuration) - REG(GetGestureDragVector) - REG(GetGestureDragAngle) - REG(GetGesturePinchVector) - REG(GetGesturePinchAngle) - - REG(SetCameraMode) - REG(UpdateCamera) - REG(UpdateCameraPlayer) - REG(SetCameraPosition) - REG(SetCameraTarget) + REG(GetGestureHoldDuration) + REG(GetGestureDragVector) + REG(GetGestureDragAngle) + REG(GetGesturePinchVector) + REG(GetGesturePinchAngle) + + REG(SetCameraMode) + REG(UpdateCamera) + REG(UpdateCameraPlayer) + REG(SetCameraPosition) + REG(SetCameraTarget) REG(SetCameraFovy) - REG(SetCameraPanControl) - REG(SetCameraAltControl) - REG(SetCameraSmoothZoomControl) - REG(SetCameraMoveControls) - REG(SetCameraMouseSensitivity) + REG(SetCameraPanControl) + REG(SetCameraAltControl) + REG(SetCameraSmoothZoomControl) + REG(SetCameraMoveControls) + REG(SetCameraMouseSensitivity) - REG(DrawPixel) - REG(DrawPixelV) - REG(DrawLine) - REG(DrawLineV) - REG(DrawCircle) - REG(DrawCircleGradient) - REG(DrawCircleV) - REG(DrawCircleLines) - REG(DrawRectangle) - REG(DrawRectangleRec) - REG(DrawRectangleGradient) - REG(DrawRectangleV) - REG(DrawRectangleLines) - REG(DrawTriangle) - REG(DrawTriangleLines) - REG(DrawPoly) - REG(DrawPolyEx) - REG(DrawPolyExLines) + REG(DrawPixel) + REG(DrawPixelV) + REG(DrawLine) + REG(DrawLineV) + REG(DrawCircle) + REG(DrawCircleGradient) + REG(DrawCircleV) + REG(DrawCircleLines) + REG(DrawRectangle) + REG(DrawRectangleRec) + REG(DrawRectangleGradient) + REG(DrawRectangleV) + REG(DrawRectangleLines) + REG(DrawTriangle) + REG(DrawTriangleLines) + REG(DrawPoly) + REG(DrawPolyEx) + REG(DrawPolyExLines) - REG(CheckCollisionRecs) - REG(CheckCollisionCircles) - REG(CheckCollisionCircleRec) - REG(GetCollisionRec) - REG(CheckCollisionPointRec) - REG(CheckCollisionPointCircle) - REG(CheckCollisionPointTriangle) + REG(CheckCollisionRecs) + REG(CheckCollisionCircles) + REG(CheckCollisionCircleRec) + REG(GetCollisionRec) + REG(CheckCollisionPointRec) + REG(CheckCollisionPointCircle) + REG(CheckCollisionPointTriangle) - REG(LoadImage) - REG(LoadImageEx) - REG(LoadImageRaw) - REG(LoadImageFromRES) - REG(LoadTexture) - REG(LoadTextureEx) - REG(LoadTextureFromRES) - REG(LoadTextureFromImage) + REG(LoadImage) + REG(LoadImageEx) + REG(LoadImageRaw) + REG(LoadImageFromRES) + REG(LoadTexture) + REG(LoadTextureEx) + REG(LoadTextureFromRES) + REG(LoadTextureFromImage) REG(LoadRenderTexture) - REG(UnloadImage) - REG(UnloadTexture) - REG(UnloadRenderTexture) - REG(GetImageData) - REG(GetTextureData) - REG(ImageToPOT) - REG(ImageFormat) + REG(UnloadImage) + REG(UnloadTexture) + REG(UnloadRenderTexture) + REG(GetImageData) + REG(GetTextureData) + REG(ImageToPOT) + REG(ImageFormat) REG(ImageDither) REG(ImageCopy) REG(ImageCrop) @@ -3664,192 +3667,188 @@ static luaL_Reg raylib_functions[] = { REG(ImageColorGrayscale) REG(ImageColorContrast) REG(ImageColorBrightness) - REG(GenTextureMipmaps) + REG(GenTextureMipmaps) REG(UpdateTexture) - REG(DrawTexture) - REG(DrawTextureV) - REG(DrawTextureEx) - REG(DrawTextureRec) - REG(DrawTexturePro) + REG(DrawTexture) + REG(DrawTextureV) + REG(DrawTextureEx) + REG(DrawTextureRec) + REG(DrawTexturePro) - REG(GetDefaultFont) - REG(LoadSpriteFont) - REG(UnloadSpriteFont) - REG(DrawText) - REG(DrawTextEx) - REG(MeasureText) - REG(MeasureTextEx) - REG(DrawFPS) - //REG(FormatText) - //REG(SubText) + REG(GetDefaultFont) + REG(LoadSpriteFont) + REG(UnloadSpriteFont) + REG(DrawText) + REG(DrawTextEx) + REG(MeasureText) + REG(MeasureTextEx) + REG(DrawFPS) - REG(DrawCube) - REG(DrawCubeV) - REG(DrawCubeWires) - REG(DrawCubeTexture) - REG(DrawSphere) - REG(DrawSphereEx) - REG(DrawSphereWires) - REG(DrawCylinder) - REG(DrawCylinderWires) - REG(DrawPlane) - REG(DrawRay) - REG(DrawGrid) - REG(DrawGizmo) + REG(DrawCube) + REG(DrawCubeV) + REG(DrawCubeWires) + REG(DrawCubeTexture) + REG(DrawSphere) + REG(DrawSphereEx) + REG(DrawSphereWires) + REG(DrawCylinder) + REG(DrawCylinderWires) + REG(DrawPlane) + REG(DrawRay) + REG(DrawGrid) + REG(DrawGizmo) - REG(LoadModel) - REG(LoadModelEx) + REG(LoadModel) + REG(LoadModelEx) REG(LoadModelFromRES) - REG(LoadHeightmap) - REG(LoadCubicmap) - REG(UnloadModel) - REG(LoadMaterial) - REG(LoadDefaultMaterial) - REG(LoadStandardMaterial) - REG(UnloadMaterial) + REG(LoadHeightmap) + REG(LoadCubicmap) + REG(UnloadModel) + REG(LoadMaterial) + REG(LoadDefaultMaterial) + REG(LoadStandardMaterial) + REG(UnloadMaterial) //REG(GenMesh*) // Not ready yet... - REG(DrawModel) - REG(DrawModelEx) - REG(DrawModelWires) - REG(DrawModelWiresEx) - REG(DrawBillboard) - REG(DrawBillboardRec) + REG(DrawModel) + REG(DrawModelEx) + REG(DrawModelWires) + REG(DrawModelWiresEx) + REG(DrawBillboard) + REG(DrawBillboardRec) REG(CalculateBoundingBox) - REG(CheckCollisionSpheres) - REG(CheckCollisionBoxes) - REG(CheckCollisionBoxSphere) + REG(CheckCollisionSpheres) + REG(CheckCollisionBoxes) + REG(CheckCollisionBoxSphere) REG(CheckCollisionRaySphere) REG(CheckCollisionRaySphereEx) REG(CheckCollisionRayBox) - REG(ResolveCollisionCubicmap) + REG(ResolveCollisionCubicmap) - REG(LoadShader) - REG(UnloadShader) + REG(LoadShader) + REG(UnloadShader) REG(GetDefaultShader) REG(GetStandardShader) REG(GetDefaultTexture) - REG(GetShaderLocation) - REG(SetShaderValue) - REG(SetShaderValuei) - REG(SetShaderValueMatrix) - REG(SetMatrixProjection) - REG(SetMatrixModelview) - REG(BeginShaderMode) - REG(EndShaderMode) - REG(BeginBlendMode) - REG(EndBlendMode) - //REG(CreateLight) - //REG(DestroyLight) + REG(GetShaderLocation) + REG(SetShaderValue) + REG(SetShaderValuei) + REG(SetShaderValueMatrix) + REG(SetMatrixProjection) + REG(SetMatrixModelview) + REG(BeginShaderMode) + REG(EndShaderMode) + REG(BeginBlendMode) + REG(EndBlendMode) + REG(CreateLight) + REG(DestroyLight) - REG(InitVrDevice) - REG(CloseVrDevice) - REG(UpdateVrTracking) - REG(BeginVrDrawing) - REG(EndVrDrawing) - REG(IsVrDeviceReady) - REG(ToggleVrMode) + REG(InitVrDevice) + REG(CloseVrDevice) + REG(IsVrDeviceReady) + REG(UpdateVrTracking) + REG(ToggleVrMode) - REG(InitAudioDevice) - REG(CloseAudioDevice) + REG(InitAudioDevice) + REG(CloseAudioDevice) REG(IsAudioDeviceReady) - REG(LoadSound) - REG(LoadSoundFromWave) - REG(LoadSoundFromRES) - REG(UnloadSound) - REG(PlaySound) - REG(PauseSound) - REG(ResumeSound) - REG(StopSound) - REG(IsSoundPlaying) - REG(SetSoundVolume) - REG(SetSoundPitch) + REG(LoadSound) + REG(LoadSoundFromWave) + REG(LoadSoundFromRES) + REG(UnloadSound) + REG(PlaySound) + REG(PauseSound) + REG(ResumeSound) + REG(StopSound) + REG(IsSoundPlaying) + REG(SetSoundVolume) + REG(SetSoundPitch) - REG(LoadMusicStream) - REG(UnloadMusicStream) - REG(UpdateMusicStream) + REG(LoadMusicStream) + REG(UnloadMusicStream) + REG(UpdateMusicStream) REG(PlayMusicStream) - REG(StopMusicStream) - REG(PauseMusicStream) - REG(ResumeMusicStream) - REG(IsMusicPlaying) - REG(SetMusicVolume) - REG(SetMusicPitch) - REG(GetMusicTimeLength) - REG(GetMusicTimePlayed) + REG(StopMusicStream) + REG(PauseMusicStream) + REG(ResumeMusicStream) + REG(IsMusicPlaying) + REG(SetMusicVolume) + REG(SetMusicPitch) + REG(GetMusicTimeLength) + REG(GetMusicTimePlayed) - REG(InitAudioStream) - REG(UpdateAudioStream) - REG(CloseAudioStream) - REG(IsAudioBufferProcessed) - REG(PlayAudioStream) - REG(PauseAudioStream) - REG(ResumeAudioStream) - REG(StopAudioStream) - - /// Math and util - REG(DecompressData) + REG(InitAudioStream) + REG(UpdateAudioStream) + REG(CloseAudioStream) + REG(IsAudioBufferProcessed) + REG(PlayAudioStream) + REG(PauseAudioStream) + REG(ResumeAudioStream) + REG(StopAudioStream) + + /// Math and util + REG(DecompressData) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) - REG(WriteBitmap) - REG(WritePNG) + REG(WriteBitmap) + REG(WritePNG) #endif - REG(TraceLog) - REG(GetExtension) - REG(GetNextPOT) - REG(VectorAdd) - REG(VectorSubtract) - REG(VectorCrossProduct) - REG(VectorPerpendicular) - REG(VectorDotProduct) - REG(VectorLength) - REG(VectorScale) - REG(VectorNegate) - REG(VectorNormalize) - REG(VectorDistance) - REG(VectorLerp) - REG(VectorReflect) - REG(VectorTransform) - REG(VectorZero) - REG(MatrixDeterminant) - REG(MatrixTrace) - REG(MatrixTranspose) - REG(MatrixInvert) - REG(MatrixNormalize) - REG(MatrixIdentity) - REG(MatrixAdd) - REG(MatrixSubstract) - REG(MatrixTranslate) - REG(MatrixRotate) - REG(MatrixRotateX) - REG(MatrixRotateY) - REG(MatrixRotateZ) - REG(MatrixScale) - REG(MatrixMultiply) - REG(MatrixFrustum) - REG(MatrixPerspective) - REG(MatrixOrtho) - REG(MatrixLookAt) - REG(QuaternionLength) - REG(QuaternionNormalize) - REG(QuaternionMultiply) - REG(QuaternionSlerp) - REG(QuaternionFromMatrix) - REG(QuaternionToMatrix) - REG(QuaternionFromAxisAngle) - REG(QuaternionToAxisAngle) - REG(QuaternionTransform) - - {0,0} + REG(TraceLog) + REG(GetExtension) + REG(GetNextPOT) + REG(VectorAdd) + REG(VectorSubtract) + REG(VectorCrossProduct) + REG(VectorPerpendicular) + REG(VectorDotProduct) + REG(VectorLength) + REG(VectorScale) + REG(VectorNegate) + REG(VectorNormalize) + REG(VectorDistance) + REG(VectorLerp) + REG(VectorReflect) + REG(VectorTransform) + REG(VectorZero) + REG(MatrixDeterminant) + REG(MatrixTrace) + REG(MatrixTranspose) + REG(MatrixInvert) + REG(MatrixNormalize) + REG(MatrixIdentity) + REG(MatrixAdd) + REG(MatrixSubstract) + REG(MatrixTranslate) + REG(MatrixRotate) + REG(MatrixRotateX) + REG(MatrixRotateY) + REG(MatrixRotateZ) + REG(MatrixScale) + REG(MatrixMultiply) + REG(MatrixFrustum) + REG(MatrixPerspective) + REG(MatrixOrtho) + REG(MatrixLookAt) + REG(QuaternionLength) + REG(QuaternionNormalize) + REG(QuaternionMultiply) + REG(QuaternionSlerp) + REG(QuaternionFromMatrix) + REG(QuaternionToMatrix) + REG(QuaternionFromAxisAngle) + REG(QuaternionToAxisAngle) + REG(QuaternionTransform) + + {0,0} }; // Register raylib functionality static void LuaRegisterRayLib(const char *opt_table) { - if (opt_table) lua_createtable(L, 0, sizeof(raylib_functions)/sizeof(raylib_functions[0])); - else lua_pushglobaltable(L); + if (opt_table) lua_createtable(L, 0, sizeof(raylib_functions)/sizeof(raylib_functions[0])); + else lua_pushglobaltable(L); - luaL_setfuncs(L, raylib_functions, 0); + luaL_setfuncs(L, raylib_functions, 0); } //---------------------------------------------------------------------------------- @@ -3859,210 +3858,216 @@ static void LuaRegisterRayLib(const char *opt_table) // Initialize Lua system RLUADEF void InitLuaDevice(void) { - mainLuaState = luaL_newstate(); - L = mainLuaState; + mainLuaState = luaL_newstate(); + L = mainLuaState; - LuaStartEnum(); - LuaSetEnum("FULLSCREEN_MODE", 1); - LuaSetEnum("SHOW_LOGO", 2); - LuaSetEnum("SHOW_MOUSE_CURSOR", 4); - LuaSetEnum("CENTERED_MODE", 8); - LuaSetEnum("MSAA_4X_HINT", 16); - LuaSetEnum("VSYNC_HINT", 32); - LuaEndEnum("FLAG"); - - LuaStartEnum(); - LuaSetEnum("SPACE", 32); - LuaSetEnum("ESCAPE", 256); - LuaSetEnum("ENTER", 257); - LuaSetEnum("BACKSPACE", 259); - LuaSetEnum("RIGHT", 262); - LuaSetEnum("LEFT", 263); - LuaSetEnum("DOWN", 264); - LuaSetEnum("UP", 265); - LuaSetEnum("F1", 290); - LuaSetEnum("F2", 291); - LuaSetEnum("F3", 292); - LuaSetEnum("F4", 293); - LuaSetEnum("F5", 294); - LuaSetEnum("F6", 295); - LuaSetEnum("F7", 296); - LuaSetEnum("F8", 297); - LuaSetEnum("F9", 298); - LuaSetEnum("F10", 299); - LuaSetEnum("LEFT_SHIFT", 340); - LuaSetEnum("LEFT_CONTROL", 341); - LuaSetEnum("LEFT_ALT", 342); - LuaSetEnum("RIGHT_SHIFT", 344); - LuaSetEnum("RIGHT_CONTROL", 345); - LuaSetEnum("RIGHT_ALT", 346); - LuaSetEnum("ZERO", 48); - LuaSetEnum("ONE", 49); - LuaSetEnum("TWO", 50); - LuaSetEnum("THREE", 51); - LuaSetEnum("FOUR", 52); - LuaSetEnum("FIVE", 53); - LuaSetEnum("SIX", 54); - LuaSetEnum("SEVEN", 55); - LuaSetEnum("EIGHT", 56); - LuaSetEnum("NINE", 57); - LuaSetEnum("A", 65); - LuaSetEnum("B", 66); - LuaSetEnum("C", 67); - LuaSetEnum("D", 68); - LuaSetEnum("E", 69); - LuaSetEnum("F", 70); - LuaSetEnum("G", 71); - LuaSetEnum("H", 72); - LuaSetEnum("I", 73); - LuaSetEnum("J", 74); - LuaSetEnum("K", 75); - LuaSetEnum("L", 76); - LuaSetEnum("M", 77); - LuaSetEnum("N", 78); - LuaSetEnum("O", 79); - LuaSetEnum("P", 80); - LuaSetEnum("Q", 81); - LuaSetEnum("R", 82); - LuaSetEnum("S", 83); - LuaSetEnum("T", 84); - LuaSetEnum("U", 85); - LuaSetEnum("V", 86); - LuaSetEnum("W", 87); - LuaSetEnum("X", 88); - LuaSetEnum("Y", 89); - LuaSetEnum("Z", 90); - LuaEndEnum("KEY"); - - LuaStartEnum(); - LuaSetEnum("LEFT_BUTTON", 0); - LuaSetEnum("RIGHT_BUTTON", 1); - LuaSetEnum("MIDDLE_BUTTON", 2); - LuaEndEnum("MOUSE"); - - LuaStartEnum(); - LuaSetEnum("PLAYER1", 0); - LuaSetEnum("PLAYER2", 1); - LuaSetEnum("PLAYER3", 2); - LuaSetEnum("PLAYER4", 3); - - LuaSetEnum("BUTTON_A", 2); - LuaSetEnum("BUTTON_B", 1); - LuaSetEnum("BUTTON_X", 3); - LuaSetEnum("BUTTON_Y", 4); - LuaSetEnum("BUTTON_R1", 7); - LuaSetEnum("BUTTON_R2", 5); - LuaSetEnum("BUTTON_L1", 6); - LuaSetEnum("BUTTON_L2", 8); - LuaSetEnum("BUTTON_SELECT", 9); - LuaSetEnum("BUTTON_START", 10); + LuaStartEnum(); + LuaSetEnum("FULLSCREEN_MODE", 1); + LuaSetEnum("SHOW_LOGO", 2); + LuaSetEnum("SHOW_MOUSE_CURSOR", 4); + LuaSetEnum("CENTERED_MODE", 8); + LuaSetEnum("MSAA_4X_HINT", 16); + LuaSetEnum("VSYNC_HINT", 32); + LuaEndEnum("FLAG"); + + LuaStartEnum(); + LuaSetEnum("SPACE", 32); + LuaSetEnum("ESCAPE", 256); + LuaSetEnum("ENTER", 257); + LuaSetEnum("BACKSPACE", 259); + LuaSetEnum("RIGHT", 262); + LuaSetEnum("LEFT", 263); + LuaSetEnum("DOWN", 264); + LuaSetEnum("UP", 265); + LuaSetEnum("F1", 290); + LuaSetEnum("F2", 291); + LuaSetEnum("F3", 292); + LuaSetEnum("F4", 293); + LuaSetEnum("F5", 294); + LuaSetEnum("F6", 295); + LuaSetEnum("F7", 296); + LuaSetEnum("F8", 297); + LuaSetEnum("F9", 298); + LuaSetEnum("F10", 299); + LuaSetEnum("LEFT_SHIFT", 340); + LuaSetEnum("LEFT_CONTROL", 341); + LuaSetEnum("LEFT_ALT", 342); + LuaSetEnum("RIGHT_SHIFT", 344); + LuaSetEnum("RIGHT_CONTROL", 345); + LuaSetEnum("RIGHT_ALT", 346); + LuaSetEnum("ZERO", 48); + LuaSetEnum("ONE", 49); + LuaSetEnum("TWO", 50); + LuaSetEnum("THREE", 51); + LuaSetEnum("FOUR", 52); + LuaSetEnum("FIVE", 53); + LuaSetEnum("SIX", 54); + LuaSetEnum("SEVEN", 55); + LuaSetEnum("EIGHT", 56); + LuaSetEnum("NINE", 57); + LuaSetEnum("A", 65); + LuaSetEnum("B", 66); + LuaSetEnum("C", 67); + LuaSetEnum("D", 68); + LuaSetEnum("E", 69); + LuaSetEnum("F", 70); + LuaSetEnum("G", 71); + LuaSetEnum("H", 72); + LuaSetEnum("I", 73); + LuaSetEnum("J", 74); + LuaSetEnum("K", 75); + LuaSetEnum("L", 76); + LuaSetEnum("M", 77); + LuaSetEnum("N", 78); + LuaSetEnum("O", 79); + LuaSetEnum("P", 80); + LuaSetEnum("Q", 81); + LuaSetEnum("R", 82); + LuaSetEnum("S", 83); + LuaSetEnum("T", 84); + LuaSetEnum("U", 85); + LuaSetEnum("V", 86); + LuaSetEnum("W", 87); + LuaSetEnum("X", 88); + LuaSetEnum("Y", 89); + LuaSetEnum("Z", 90); + LuaEndEnum("KEY"); + + LuaStartEnum(); + LuaSetEnum("LEFT_BUTTON", 0); + LuaSetEnum("RIGHT_BUTTON", 1); + LuaSetEnum("MIDDLE_BUTTON", 2); + LuaEndEnum("MOUSE"); + + LuaStartEnum(); + LuaSetEnum("PLAYER1", 0); + LuaSetEnum("PLAYER2", 1); + LuaSetEnum("PLAYER3", 2); + LuaSetEnum("PLAYER4", 3); + + LuaSetEnum("BUTTON_A", 2); + LuaSetEnum("BUTTON_B", 1); + LuaSetEnum("BUTTON_X", 3); + LuaSetEnum("BUTTON_Y", 4); + LuaSetEnum("BUTTON_R1", 7); + LuaSetEnum("BUTTON_R2", 5); + LuaSetEnum("BUTTON_L1", 6); + LuaSetEnum("BUTTON_L2", 8); + LuaSetEnum("BUTTON_SELECT", 9); + LuaSetEnum("BUTTON_START", 10); - LuaSetEnum("XBOX_BUTTON_A", 0); - LuaSetEnum("XBOX_BUTTON_B", 1); - LuaSetEnum("XBOX_BUTTON_X", 2); - LuaSetEnum("XBOX_BUTTON_Y", 3); - LuaSetEnum("XBOX_BUTTON_LB", 4); - LuaSetEnum("XBOX_BUTTON_RB", 5); - LuaSetEnum("XBOX_BUTTON_SELECT", 6); - LuaSetEnum("XBOX_BUTTON_START", 7); + LuaSetEnum("XBOX_BUTTON_A", 0); + LuaSetEnum("XBOX_BUTTON_B", 1); + LuaSetEnum("XBOX_BUTTON_X", 2); + LuaSetEnum("XBOX_BUTTON_Y", 3); + LuaSetEnum("XBOX_BUTTON_LB", 4); + LuaSetEnum("XBOX_BUTTON_RB", 5); + LuaSetEnum("XBOX_BUTTON_SELECT", 6); + LuaSetEnum("XBOX_BUTTON_START", 7); #if defined(PLATFORM_RPI) - LuaSetEnum("XBOX_AXIS_DPAD_X", 7); - LuaSetEnum("XBOX_AXIS_DPAD_Y", 6); - LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); - LuaSetEnum("XBOX_AXIS_LT", 2); - LuaSetEnum("XBOX_AXIS_RT", 5); + LuaSetEnum("XBOX_AXIS_DPAD_X", 7); + LuaSetEnum("XBOX_AXIS_DPAD_Y", 6); + LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); + LuaSetEnum("XBOX_AXIS_LT", 2); + LuaSetEnum("XBOX_AXIS_RT", 5); #else - LuaSetEnum("XBOX_BUTTON_UP", 10); - LuaSetEnum("XBOX_BUTTON_DOWN", 12); - LuaSetEnum("XBOX_BUTTON_LEFT", 13); - LuaSetEnum("XBOX_BUTTON_RIGHT", 11); - LuaSetEnum("XBOX_AXIS_RIGHT_X", 4); - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); - LuaSetEnum("XBOX_AXIS_LT_RT", 2); + LuaSetEnum("XBOX_BUTTON_UP", 10); + LuaSetEnum("XBOX_BUTTON_DOWN", 12); + LuaSetEnum("XBOX_BUTTON_LEFT", 13); + LuaSetEnum("XBOX_BUTTON_RIGHT", 11); + LuaSetEnum("XBOX_AXIS_RIGHT_X", 4); + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); + LuaSetEnum("XBOX_AXIS_LT_RT", 2); #endif - LuaSetEnum("XBOX_AXIS_LEFT_X", 0); - LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); - LuaEndEnum("GAMEPAD"); - - lua_pushglobaltable(L); - LuaSetEnumColor("LIGHTGRAY", LIGHTGRAY); - LuaSetEnumColor("GRAY", GRAY); - LuaSetEnumColor("DARKGRAY", DARKGRAY); - LuaSetEnumColor("YELLOW", YELLOW); - LuaSetEnumColor("GOLD", GOLD); - LuaSetEnumColor("ORANGE", ORANGE); - LuaSetEnumColor("PINK", PINK); - LuaSetEnumColor("RED", RED); - LuaSetEnumColor("MAROON", MAROON); - LuaSetEnumColor("GREEN", GREEN); - LuaSetEnumColor("LIME", LIME); - LuaSetEnumColor("DARKGREEN", DARKGREEN); - LuaSetEnumColor("SKYBLUE", SKYBLUE); - LuaSetEnumColor("BLUE", BLUE); - LuaSetEnumColor("DARKBLUE", DARKBLUE); - LuaSetEnumColor("PURPLE", PURPLE); - LuaSetEnumColor("VIOLET", VIOLET); - LuaSetEnumColor("DARKPURPLE", DARKPURPLE); - LuaSetEnumColor("BEIGE", BEIGE); - LuaSetEnumColor("BROWN", BROWN); - LuaSetEnumColor("DARKBROWN", DARKBROWN); - LuaSetEnumColor("WHITE", WHITE); - LuaSetEnumColor("BLACK", BLACK); - LuaSetEnumColor("BLANK", BLANK); - LuaSetEnumColor("MAGENTA", MAGENTA); - LuaSetEnumColor("RAYWHITE", RAYWHITE); - lua_pop(L, 1); - - LuaStartEnum(); - LuaSetEnum("UNCOMPRESSED_GRAYSCALE", UNCOMPRESSED_GRAYSCALE); - LuaSetEnum("UNCOMPRESSED_GRAY_ALPHA", UNCOMPRESSED_GRAY_ALPHA); - LuaSetEnum("UNCOMPRESSED_R5G6B5", UNCOMPRESSED_R5G6B5); - LuaSetEnum("UNCOMPRESSED_R8G8B8", UNCOMPRESSED_R8G8B8); - LuaSetEnum("UNCOMPRESSED_R5G5B5A1", UNCOMPRESSED_R5G5B5A1); - LuaSetEnum("UNCOMPRESSED_R4G4B4A4", UNCOMPRESSED_R4G4B4A4); - LuaSetEnum("UNCOMPRESSED_R8G8B8A8", UNCOMPRESSED_R8G8B8A8); - LuaSetEnum("COMPRESSED_DXT1_RGB", COMPRESSED_DXT1_RGB); - LuaSetEnum("COMPRESSED_DXT1_RGBA", COMPRESSED_DXT1_RGBA); - LuaSetEnum("COMPRESSED_DXT3_RGBA", COMPRESSED_DXT3_RGBA); - LuaSetEnum("COMPRESSED_DXT5_RGBA", COMPRESSED_DXT5_RGBA); - LuaSetEnum("COMPRESSED_ETC1_RGB", COMPRESSED_ETC1_RGB); - LuaSetEnum("COMPRESSED_ETC2_RGB", COMPRESSED_ETC2_RGB); - LuaSetEnum("COMPRESSED_ETC2_EAC_RGBA", COMPRESSED_ETC2_EAC_RGBA); - LuaSetEnum("COMPRESSED_PVRT_RGB", COMPRESSED_PVRT_RGB); - LuaSetEnum("COMPRESSED_PVRT_RGBA", COMPRESSED_PVRT_RGBA); - LuaSetEnum("COMPRESSED_ASTC_4x4_RGBA", COMPRESSED_ASTC_4x4_RGBA); - LuaSetEnum("COMPRESSED_ASTC_8x8_RGBA", COMPRESSED_ASTC_8x8_RGBA); - LuaEndEnum("TextureFormat"); - - LuaStartEnum(); - LuaSetEnum("ALPHA", BLEND_ALPHA); - LuaSetEnum("ADDITIVE", BLEND_ADDITIVE); - LuaSetEnum("MULTIPLIED", BLEND_MULTIPLIED); - LuaEndEnum("BlendMode"); - - LuaStartEnum(); - LuaSetEnum("NONE", GESTURE_NONE); - LuaSetEnum("TAP", GESTURE_TAP); - LuaSetEnum("DOUBLETAP", GESTURE_DOUBLETAP); - LuaSetEnum("HOLD", GESTURE_HOLD); - LuaSetEnum("DRAG", GESTURE_DRAG); - LuaSetEnum("SWIPE_RIGHT", GESTURE_SWIPE_RIGHT); - LuaSetEnum("SWIPE_LEFT", GESTURE_SWIPE_LEFT); - LuaSetEnum("SWIPE_UP", GESTURE_SWIPE_UP); - LuaSetEnum("SWIPE_DOWN", GESTURE_SWIPE_DOWN); - LuaSetEnum("PINCH_IN", GESTURE_PINCH_IN); - LuaSetEnum("PINCH_OUT", GESTURE_PINCH_OUT); - LuaEndEnum("Gestures"); - - LuaStartEnum(); - LuaSetEnum("CUSTOM", CAMERA_CUSTOM); - LuaSetEnum("FREE", CAMERA_FREE); - LuaSetEnum("ORBITAL", CAMERA_ORBITAL); - LuaSetEnum("FIRST_PERSON", CAMERA_FIRST_PERSON); - LuaSetEnum("THIRD_PERSON", CAMERA_THIRD_PERSON); - LuaEndEnum("CameraMode"); + LuaSetEnum("XBOX_AXIS_LEFT_X", 0); + LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); + LuaEndEnum("GAMEPAD"); + + lua_pushglobaltable(L); + LuaSetEnumColor("LIGHTGRAY", LIGHTGRAY); + LuaSetEnumColor("GRAY", GRAY); + LuaSetEnumColor("DARKGRAY", DARKGRAY); + LuaSetEnumColor("YELLOW", YELLOW); + LuaSetEnumColor("GOLD", GOLD); + LuaSetEnumColor("ORANGE", ORANGE); + LuaSetEnumColor("PINK", PINK); + LuaSetEnumColor("RED", RED); + LuaSetEnumColor("MAROON", MAROON); + LuaSetEnumColor("GREEN", GREEN); + LuaSetEnumColor("LIME", LIME); + LuaSetEnumColor("DARKGREEN", DARKGREEN); + LuaSetEnumColor("SKYBLUE", SKYBLUE); + LuaSetEnumColor("BLUE", BLUE); + LuaSetEnumColor("DARKBLUE", DARKBLUE); + LuaSetEnumColor("PURPLE", PURPLE); + LuaSetEnumColor("VIOLET", VIOLET); + LuaSetEnumColor("DARKPURPLE", DARKPURPLE); + LuaSetEnumColor("BEIGE", BEIGE); + LuaSetEnumColor("BROWN", BROWN); + LuaSetEnumColor("DARKBROWN", DARKBROWN); + LuaSetEnumColor("WHITE", WHITE); + LuaSetEnumColor("BLACK", BLACK); + LuaSetEnumColor("BLANK", BLANK); + LuaSetEnumColor("MAGENTA", MAGENTA); + LuaSetEnumColor("RAYWHITE", RAYWHITE); + lua_pop(L, 1); + + LuaStartEnum(); + LuaSetEnum("UNCOMPRESSED_GRAYSCALE", UNCOMPRESSED_GRAYSCALE); + LuaSetEnum("UNCOMPRESSED_GRAY_ALPHA", UNCOMPRESSED_GRAY_ALPHA); + LuaSetEnum("UNCOMPRESSED_R5G6B5", UNCOMPRESSED_R5G6B5); + LuaSetEnum("UNCOMPRESSED_R8G8B8", UNCOMPRESSED_R8G8B8); + LuaSetEnum("UNCOMPRESSED_R5G5B5A1", UNCOMPRESSED_R5G5B5A1); + LuaSetEnum("UNCOMPRESSED_R4G4B4A4", UNCOMPRESSED_R4G4B4A4); + LuaSetEnum("UNCOMPRESSED_R8G8B8A8", UNCOMPRESSED_R8G8B8A8); + LuaSetEnum("COMPRESSED_DXT1_RGB", COMPRESSED_DXT1_RGB); + LuaSetEnum("COMPRESSED_DXT1_RGBA", COMPRESSED_DXT1_RGBA); + LuaSetEnum("COMPRESSED_DXT3_RGBA", COMPRESSED_DXT3_RGBA); + LuaSetEnum("COMPRESSED_DXT5_RGBA", COMPRESSED_DXT5_RGBA); + LuaSetEnum("COMPRESSED_ETC1_RGB", COMPRESSED_ETC1_RGB); + LuaSetEnum("COMPRESSED_ETC2_RGB", COMPRESSED_ETC2_RGB); + LuaSetEnum("COMPRESSED_ETC2_EAC_RGBA", COMPRESSED_ETC2_EAC_RGBA); + LuaSetEnum("COMPRESSED_PVRT_RGB", COMPRESSED_PVRT_RGB); + LuaSetEnum("COMPRESSED_PVRT_RGBA", COMPRESSED_PVRT_RGBA); + LuaSetEnum("COMPRESSED_ASTC_4x4_RGBA", COMPRESSED_ASTC_4x4_RGBA); + LuaSetEnum("COMPRESSED_ASTC_8x8_RGBA", COMPRESSED_ASTC_8x8_RGBA); + LuaEndEnum("TextureFormat"); + + LuaStartEnum(); + LuaSetEnum("ALPHA", BLEND_ALPHA); + LuaSetEnum("ADDITIVE", BLEND_ADDITIVE); + LuaSetEnum("MULTIPLIED", BLEND_MULTIPLIED); + LuaEndEnum("BlendMode"); + + LuaStartEnum(); + LuaSetEnum("POINT", LIGHT_POINT); + LuaSetEnum("DIRECTIONAL", LIGHT_DIRECTIONAL); + LuaSetEnum("SPOT", LIGHT_SPOT); + LuaEndEnum("LightType"); + + LuaStartEnum(); + LuaSetEnum("NONE", GESTURE_NONE); + LuaSetEnum("TAP", GESTURE_TAP); + LuaSetEnum("DOUBLETAP", GESTURE_DOUBLETAP); + LuaSetEnum("HOLD", GESTURE_HOLD); + LuaSetEnum("DRAG", GESTURE_DRAG); + LuaSetEnum("SWIPE_RIGHT", GESTURE_SWIPE_RIGHT); + LuaSetEnum("SWIPE_LEFT", GESTURE_SWIPE_LEFT); + LuaSetEnum("SWIPE_UP", GESTURE_SWIPE_UP); + LuaSetEnum("SWIPE_DOWN", GESTURE_SWIPE_DOWN); + LuaSetEnum("PINCH_IN", GESTURE_PINCH_IN); + LuaSetEnum("PINCH_OUT", GESTURE_PINCH_OUT); + LuaEndEnum("Gestures"); + + LuaStartEnum(); + LuaSetEnum("CUSTOM", CAMERA_CUSTOM); + LuaSetEnum("FREE", CAMERA_FREE); + LuaSetEnum("ORBITAL", CAMERA_ORBITAL); + LuaSetEnum("FIRST_PERSON", CAMERA_FIRST_PERSON); + LuaSetEnum("THIRD_PERSON", CAMERA_THIRD_PERSON); + LuaEndEnum("CameraMode"); LuaStartEnum(); LuaSetEnum("DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); @@ -4074,82 +4079,82 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("SONY_PLAYSTATION_VR", HMD_SONY_PLAYSTATION_VR); LuaSetEnum("RAZER_OSVR", HMD_RAZER_OSVR); LuaSetEnum("FOVE_VR", HMD_FOVE_VR); - LuaEndEnum("VrDevice"); + LuaEndEnum("VrDevice"); - lua_pushglobaltable(L); - LuaSetEnum("INFO", INFO); - LuaSetEnum("ERROR", ERROR); - LuaSetEnum("WARNING", WARNING); - LuaSetEnum("DEBUG", DEBUG); - LuaSetEnum("OTHER", OTHER); - lua_pop(L, 1); + lua_pushglobaltable(L); + LuaSetEnum("INFO", INFO); + LuaSetEnum("ERROR", ERROR); + LuaSetEnum("WARNING", WARNING); + LuaSetEnum("DEBUG", DEBUG); + LuaSetEnum("OTHER", OTHER); + lua_pop(L, 1); - lua_pushboolean(L, true); + lua_pushboolean(L, true); #if defined(PLATFORM_DESKTOP) - lua_setglobal(L, "PLATFORM_DESKTOP"); + lua_setglobal(L, "PLATFORM_DESKTOP"); #elif defined(PLATFORM_ANDROID) - lua_setglobal(L, "PLATFORM_ANDROID"); + lua_setglobal(L, "PLATFORM_ANDROID"); #elif defined(PLATFORM_RPI) - lua_setglobal(L, "PLATFORM_RPI"); + lua_setglobal(L, "PLATFORM_RPI"); #elif defined(PLATFORM_WEB) - lua_setglobal(L, "PLATFORM_WEB"); + lua_setglobal(L, "PLATFORM_WEB"); #endif - luaL_openlibs(L); - LuaBuildOpaqueMetatables(); + luaL_openlibs(L); + LuaBuildOpaqueMetatables(); - LuaRegisterRayLib(0); + LuaRegisterRayLib(0); } // De-initialize Lua system RLUADEF void CloseLuaDevice(void) { - if (mainLuaState) - { - lua_close(mainLuaState); - mainLuaState = 0; - L = 0; - } + if (mainLuaState) + { + lua_close(mainLuaState); + mainLuaState = 0; + L = 0; + } } // Execute raylib Lua code RLUADEF void ExecuteLuaCode(const char *code) { - if (!mainLuaState) - { - TraceLog(WARNING, "Lua device not initialized"); - return; - } + if (!mainLuaState) + { + TraceLog(WARNING, "Lua device not initialized"); + return; + } - int result = luaL_dostring(L, code); + int result = luaL_dostring(L, code); - switch (result) - { + switch (result) + { case LUA_OK: break; case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); break; case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); break; default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); break; - } + } } // Execute raylib Lua script RLUADEF void ExecuteLuaFile(const char *filename) { - if (!mainLuaState) - { - TraceLog(WARNING, "Lua device not initialized"); - return; - } + if (!mainLuaState) + { + TraceLog(WARNING, "Lua device not initialized"); + return; + } - int result = luaL_dofile(L, filename); + int result = luaL_dofile(L, filename); - switch (result) - { + switch (result) + { case LUA_OK: break; case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); - } + } } #endif // RLUA_IMPLEMENTATION -- cgit v1.2.3 From 16ac468bdb121cc9539959d7e921b32932f6fc75 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 19:30:41 +0200 Subject: Remove functions from user exposure --- src/raylib.h | 4 +--- src/rlgl.h | 8 +++++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 1489546a..bbf83ccd 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -909,10 +909,8 @@ void DestroyLight(Light light); // Destroy a //------------------------------------------------------------------------------------ void InitVrDevice(int vdDevice); // Init VR device void CloseVrDevice(void); // Close VR device -void UpdateVrTracking(void); // Update VR tracking (position and orientation) -void BeginVrDrawing(void); // Begin VR drawing configuration -void EndVrDrawing(void); // End VR drawing process (and desktop mirror) bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +void UpdateVrTracking(void); // Update VR tracking (position and orientation) void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) //------------------------------------------------------------------------------------ diff --git a/src/rlgl.h b/src/rlgl.h index 425871a9..bcb7c24f 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -332,6 +332,10 @@ Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view); // Get world unsigned char *rlglReadScreenPixels(int width, int height); // Read screen pixel data (color buffer) void *rlglReadTexturePixels(Texture2D texture); // Read texture pixel data +// VR functions exposed to core module but not to raylib users +void BeginVrDrawing(void); // Begin VR drawing configuration +void EndVrDrawing(void); // End VR drawing process (and desktop mirror) + // NOTE: There is a set of shader related functions that are available to end user, // to avoid creating function wrappers through core module, they have been directly declared in raylib.h @@ -368,10 +372,8 @@ float *MatrixToFloat(Matrix mat); void InitVrDevice(int vrDevice); // Init VR device void CloseVrDevice(void); // Close VR device -void UpdateVrTracking(void); // Update VR tracking (position and orientation) -void BeginVrDrawing(void); // Begin VR drawing configuration -void EndVrDrawing(void); // End VR drawing process (and desktop mirror) bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +void UpdateVrTracking(void); // Update VR tracking (position and orientation) void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) // Oculus Rift API for direct access the device (no simulator) -- cgit v1.2.3 From 306945fe147ea7742880635e77a5c2656f6e1fdc Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 6 Aug 2016 19:30:56 +0200 Subject: Added trace on audio device closing --- src/audio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 0896e4ca..32911865 100644 --- a/src/audio.c +++ b/src/audio.c @@ -183,6 +183,8 @@ void CloseAudioDevice(void) alcMakeContextCurrent(NULL); alcDestroyContext(context); alcCloseDevice(device); + + TraceLog(INFO, "Audio device closed successfully"); } // Check if device has been initialized successfully -- cgit v1.2.3 From 6f27941e286eba9872d1c341b446c9d13272405a Mon Sep 17 00:00:00 2001 From: ghassanpl Date: Sat, 6 Aug 2016 21:51:08 +0200 Subject: GetDroppedFiles and SetShaderValue in Lua working Exposed Texture2D.id to Lua Lights now have settable/gettable fields --- src/rlua.h | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 08ffbca0..fb3a6698 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -126,7 +126,7 @@ RLUADEF void CloseLuaDevice(void); // De-initialize Lua system #define LuaPush_SpriteFont(L, sf) LuaPushOpaqueTypeWithMetatable(L, sf, SpriteFont) #define LuaPush_Mesh(L, vd) LuaPushOpaqueType(L, vd) #define LuaPush_Shader(L, s) LuaPushOpaqueType(L, s) -#define LuaPush_Light(L, light) LuaPushOpaqueType(L, light) +#define LuaPush_Light(L, light) LuaPushOpaqueTypeWithMetatable(L, light, Light) #define LuaPush_Sound(L, snd) LuaPushOpaqueType(L, snd) #define LuaPush_Wave(L, wav) LuaPushOpaqueType(L, wav) #define LuaPush_Music(L, mus) LuaPushOpaqueType(L, mus) @@ -263,6 +263,8 @@ static int LuaIndexTexture2D(lua_State* L) lua_pushinteger(L, img.mipmaps); else if (!strcmp(key, "format")) lua_pushinteger(L, img.format); + else if (!strcmp(key, "id")) + lua_pushinteger(L, img.id); else return 0; return 1; @@ -296,6 +298,58 @@ static int LuaIndexSpriteFont(lua_State* L) return 1; } +static int LuaIndexLight(lua_State* L) +{ + Light light = LuaGetArgument_Light(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "id")) + lua_pushinteger(L, light->id); + else if (!strcmp(key, "enabled")) + lua_pushboolean(L, light->enabled); + else if (!strcmp(key, "type")) + lua_pushinteger(L, light->type); + else if (!strcmp(key, "position")) + LuaPush_Vector3(L, light->position); + else if (!strcmp(key, "target")) + LuaPush_Vector3(L, light->target); + else if (!strcmp(key, "radius")) + lua_pushnumber(L, light->radius); + else if (!strcmp(key, "diffuse")) + LuaPush_Color(L, light->diffuse); + else if (!strcmp(key, "intensity")) + lua_pushnumber(L, light->intensity); + else if (!strcmp(key, "coneAngle")) + lua_pushnumber(L, light->coneAngle); + else + return 0; + return 1; +} + +static int LuaNewIndexLight(lua_State* L) +{ + Light light = LuaGetArgument_Light(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "id")) + light->id = LuaGetArgument_int(L, 3); + else if (!strcmp(key, "enabled")) + light->enabled = lua_toboolean(L, 3); + else if (!strcmp(key, "type")) + light->type = LuaGetArgument_int(L, 3); + else if (!strcmp(key, "position")) + light->position = LuaGetArgument_Vector3(L, 3); + else if (!strcmp(key, "target")) + light->target = LuaGetArgument_Vector3(L, 3); + else if (!strcmp(key, "radius")) + light->radius = LuaGetArgument_float(L, 3); + else if (!strcmp(key, "diffuse")) + light->diffuse = LuaGetArgument_Color(L, 3); + else if (!strcmp(key, "intensity")) + light->intensity = LuaGetArgument_float(L, 3); + else if (!strcmp(key, "coneAngle")) + light->coneAngle = LuaGetArgument_float(L, 3); + return 0; +} + static void LuaBuildOpaqueMetatables(void) { luaL_newmetatable(L, "Image"); @@ -313,10 +367,17 @@ static void LuaBuildOpaqueMetatables(void) lua_setfield(L, -2, "__index"); lua_pop(L, 1); - luaL_newmetatable(L, "SpriteFont"); - lua_pushcfunction(L, &LuaIndexSpriteFont); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + luaL_newmetatable(L, "SpriteFont"); + lua_pushcfunction(L, &LuaIndexSpriteFont); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + + luaL_newmetatable(L, "Light"); + lua_pushcfunction(L, &LuaIndexLight); + lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, &LuaNewIndexLight); + lua_setfield(L, -2, "__newindex"); + lua_pop(L, 1); } //---------------------------------------------------------------------------------- @@ -1057,15 +1118,20 @@ int lua_IsFileDropped(lua_State* L) lua_pushboolean(L, result); return 1; } -/* -int lua_*GetDroppedFiles(lua_State* L) + +int lua_GetDroppedFiles(lua_State* L) { - int * arg1 = LuaGetArgument_int *(L, 1); - //char * result = *GetDroppedFiles(arg1); - LuaPush_//char *(L, result); - return 1; + int count = 0; + char ** result = GetDroppedFiles(&count); + lua_createtable(L, count, 0); + for (int i = 0; i < count; i++) + { + lua_pushstring(L, result[i]); + lua_rawseti(L, -2, i + 1); + } + return 1; } -*/ + int lua_ClearDroppedFiles(lua_State* L) { ClearDroppedFiles(); @@ -1638,7 +1704,6 @@ int lua_DrawPoly(lua_State* L) sz++; \ lua_pop(L, 1); \ } \ - lua_pop(L, 1); \ name = calloc(sz, sizeof(type)); \ sz = 0; \ lua_pushnil(L); \ @@ -2334,7 +2399,12 @@ int lua_DrawGizmo(lua_State* L) return 0; } -// TODO: DrawLight(Light light); +int lua_DrawLight(lua_State* L) +{ + Light arg1 = LuaGetArgument_Light(L, 1); + DrawLight(arg1); + return 0; +} int lua_Draw3DLine(lua_State* L) { @@ -3544,7 +3614,7 @@ static luaL_Reg raylib_functions[] = { REG(ShowLogo) REG(IsFileDropped) - //REG(*GetDroppedFiles) + REG(GetDroppedFiles) REG(ClearDroppedFiles) REG(StorageSaveValue) REG(StorageLoadValue) @@ -3698,6 +3768,8 @@ static luaL_Reg raylib_functions[] = { REG(DrawRay) REG(DrawGrid) REG(DrawGizmo) + + REG(DrawLight) REG(LoadModel) REG(LoadModelEx) -- cgit v1.2.3 From 47b6e627449187f5385e9beafeda3b8517faae26 Mon Sep 17 00:00:00 2001 From: ghassanpl Date: Sat, 6 Aug 2016 22:14:49 +0200 Subject: Fixed bug with BoundingBox Lua constructor Fixed use-after-free in DestroyLight --- src/rlgl.c | 7 ++++--- src/rlua.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index d027495f..6fb4bf3d 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2559,11 +2559,13 @@ void DestroyLight(Light light) { if (light != NULL) { + int light_id = light->id; + // Free dynamic memory allocation - free(lights[light->id]); + free(lights[light_id]); // Remove *obj from the pointers array - for (int i = light->id; i < lightsCount; i++) + for (int i = light_id; i < lightsCount; i++) { // Resort all the following pointers of the array if ((i + 1) < lightsCount) @@ -2571,7 +2573,6 @@ void DestroyLight(Light light) lights[i] = lights[i + 1]; lights[i]->id = lights[i + 1]->id; } - else free(lights[i]); } // Decrease enabled physic objects count diff --git a/src/rlua.h b/src/rlua.h index fb3a6698..85853793 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -768,7 +768,7 @@ static int lua_BoundingBox(lua_State* L) { Vector3 min = LuaGetArgument_Vector3(L, 1); Vector3 max = LuaGetArgument_Vector3(L, 2); - LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y }, { max.x, max.y } }); + LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y, min.z }, { max.x, max.y, max.z } }); return 1; } -- cgit v1.2.3 From 2c079d7c6ea0a5a252f0d3f93bc39e8f5700e23a Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 7 Aug 2016 11:14:08 +0200 Subject: Review Lua examples and formatting --- src/rlgl.c | 8 ++--- src/rlua.h | 100 ++++++++++++++++++++++++++++++------------------------------- 2 files changed, 54 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 6fb4bf3d..68d562c7 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2559,13 +2559,13 @@ void DestroyLight(Light light) { if (light != NULL) { - int light_id = light->id; + int lightId = light->id; // Free dynamic memory allocation - free(lights[light_id]); - + free(lights[lightId]); + // Remove *obj from the pointers array - for (int i = light_id; i < lightsCount; i++) + for (int i = lightId; i < lightsCount; i++) { // Resort all the following pointers of the array if ((i + 1) < lightsCount) diff --git a/src/rlua.h b/src/rlua.h index 85853793..153f2c37 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -300,29 +300,29 @@ static int LuaIndexSpriteFont(lua_State* L) static int LuaIndexLight(lua_State* L) { - Light light = LuaGetArgument_Light(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "id")) - lua_pushinteger(L, light->id); - else if (!strcmp(key, "enabled")) - lua_pushboolean(L, light->enabled); - else if (!strcmp(key, "type")) - lua_pushinteger(L, light->type); - else if (!strcmp(key, "position")) - LuaPush_Vector3(L, light->position); - else if (!strcmp(key, "target")) - LuaPush_Vector3(L, light->target); - else if (!strcmp(key, "radius")) - lua_pushnumber(L, light->radius); - else if (!strcmp(key, "diffuse")) - LuaPush_Color(L, light->diffuse); - else if (!strcmp(key, "intensity")) - lua_pushnumber(L, light->intensity); - else if (!strcmp(key, "coneAngle")) - lua_pushnumber(L, light->coneAngle); - else - return 0; - return 1; + Light light = LuaGetArgument_Light(L, 1); + const char *key = luaL_checkstring(L, 2); + if (!strcmp(key, "id")) + lua_pushinteger(L, light->id); + else if (!strcmp(key, "enabled")) + lua_pushboolean(L, light->enabled); + else if (!strcmp(key, "type")) + lua_pushinteger(L, light->type); + else if (!strcmp(key, "position")) + LuaPush_Vector3(L, light->position); + else if (!strcmp(key, "target")) + LuaPush_Vector3(L, light->target); + else if (!strcmp(key, "radius")) + lua_pushnumber(L, light->radius); + else if (!strcmp(key, "diffuse")) + LuaPush_Color(L, light->diffuse); + else if (!strcmp(key, "intensity")) + lua_pushnumber(L, light->intensity); + else if (!strcmp(key, "coneAngle")) + lua_pushnumber(L, light->coneAngle); + else + return 0; + return 1; } static int LuaNewIndexLight(lua_State* L) @@ -335,17 +335,17 @@ static int LuaNewIndexLight(lua_State* L) light->enabled = lua_toboolean(L, 3); else if (!strcmp(key, "type")) light->type = LuaGetArgument_int(L, 3); - else if (!strcmp(key, "position")) + else if (!strcmp(key, "position")) light->position = LuaGetArgument_Vector3(L, 3); - else if (!strcmp(key, "target")) + else if (!strcmp(key, "target")) light->target = LuaGetArgument_Vector3(L, 3); - else if (!strcmp(key, "radius")) + else if (!strcmp(key, "radius")) light->radius = LuaGetArgument_float(L, 3); - else if (!strcmp(key, "diffuse")) + else if (!strcmp(key, "diffuse")) light->diffuse = LuaGetArgument_Color(L, 3); - else if (!strcmp(key, "intensity")) + else if (!strcmp(key, "intensity")) light->intensity = LuaGetArgument_float(L, 3); - else if (!strcmp(key, "coneAngle")) + else if (!strcmp(key, "coneAngle")) light->coneAngle = LuaGetArgument_float(L, 3); return 0; } @@ -367,17 +367,17 @@ static void LuaBuildOpaqueMetatables(void) lua_setfield(L, -2, "__index"); lua_pop(L, 1); - luaL_newmetatable(L, "SpriteFont"); - lua_pushcfunction(L, &LuaIndexSpriteFont); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); + luaL_newmetatable(L, "SpriteFont"); + lua_pushcfunction(L, &LuaIndexSpriteFont); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); - luaL_newmetatable(L, "Light"); - lua_pushcfunction(L, &LuaIndexLight); - lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, &LuaNewIndexLight); - lua_setfield(L, -2, "__newindex"); - lua_pop(L, 1); + luaL_newmetatable(L, "Light"); + lua_pushcfunction(L, &LuaIndexLight); + lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, &LuaNewIndexLight); + lua_setfield(L, -2, "__newindex"); + lua_pop(L, 1); } //---------------------------------------------------------------------------------- @@ -1121,14 +1121,14 @@ int lua_IsFileDropped(lua_State* L) int lua_GetDroppedFiles(lua_State* L) { - int count = 0; + int count = 0; char ** result = GetDroppedFiles(&count); - lua_createtable(L, count, 0); - for (int i = 0; i < count; i++) - { - lua_pushstring(L, result[i]); - lua_rawseti(L, -2, i + 1); - } + lua_createtable(L, count, 0); + for (int i = 0; i < count; i++) + { + lua_pushstring(L, result[i]); + lua_rawseti(L, -2, i + 1); + } return 1; } @@ -2401,9 +2401,9 @@ int lua_DrawGizmo(lua_State* L) int lua_DrawLight(lua_State* L) { - Light arg1 = LuaGetArgument_Light(L, 1); - DrawLight(arg1); - return 0; + Light arg1 = LuaGetArgument_Light(L, 1); + DrawLight(arg1); + return 0; } int lua_Draw3DLine(lua_State* L) @@ -3769,7 +3769,7 @@ static luaL_Reg raylib_functions[] = { REG(DrawGrid) REG(DrawGizmo) - REG(DrawLight) + REG(DrawLight) REG(LoadModel) REG(LoadModelEx) -- cgit v1.2.3 From cae209816c11d4e50ad7f807e0138e51b9cbf7df Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 7 Aug 2016 13:38:14 +0200 Subject: Code tweak to avoid warning --- src/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 32911865..4b8641ab 100644 --- a/src/audio.c +++ b/src/audio.c @@ -609,8 +609,8 @@ void UpdateMusicStream(Music music) int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, numSamples); // TODO: Review stereo channels Ogg, not enough samples served! - UpdateAudioStream(music->stream, pcm, numSamples*music->stream.channels); - music->samplesLeft -= (numSamples*music->stream.channels); + UpdateAudioStream(music->stream, pcm, numSamplesOgg*music->stream.channels); + music->samplesLeft -= (numSamplesOgg*music->stream.channels); } break; case MUSIC_MODULE_XM: -- cgit v1.2.3 From f69f930b51d64d8f1dff5cb4d6c810b4a5e7335a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 7 Aug 2016 13:38:48 +0200 Subject: Some functions review --- src/raylib.h | 31 +++++++++++++++++-------------- src/text.c | 40 +++++++++++++++++++++++----------------- src/textures.c | 8 ++++---- 3 files changed, 44 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index bbf83ccd..8045e436 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -185,17 +185,20 @@ #define GAMEPAD_PLAYER4 3 // Not supported // Gamepad Buttons -// NOTE: Adjusted for a PS3 USB Controller -#define GAMEPAD_BUTTON_A 2 -#define GAMEPAD_BUTTON_B 1 -#define GAMEPAD_BUTTON_X 3 -#define GAMEPAD_BUTTON_Y 4 -#define GAMEPAD_BUTTON_R1 7 -#define GAMEPAD_BUTTON_R2 5 -#define GAMEPAD_BUTTON_L1 6 -#define GAMEPAD_BUTTON_L2 8 -#define GAMEPAD_BUTTON_SELECT 9 -#define GAMEPAD_BUTTON_START 10 + +// PS3 USB Controller +#define GAMEPAD_PS3_BUTTON_A 2 +#define GAMEPAD_PS3_BUTTON_B 1 +#define GAMEPAD_PS3_BUTTON_X 3 +#define GAMEPAD_PS3_BUTTON_Y 4 +#define GAMEPAD_PS3_BUTTON_R1 7 +#define GAMEPAD_PS3_BUTTON_R2 5 +#define GAMEPAD_PS3_BUTTON_L1 6 +#define GAMEPAD_PS3_BUTTON_L2 8 +#define GAMEPAD_PS3_BUTTON_SELECT 9 +#define GAMEPAD_PS3_BUTTON_START 10 + +// TODO: Add PS3 d-pad axis // Xbox360 USB Controller Buttons #define GAMEPAD_XBOX_BUTTON_A 0 @@ -782,10 +785,10 @@ void ImageCrop(Image *image, Rectangle crop); void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) +Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) -void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) +void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) void ImageFlipVertical(Image *image); // Flip image vertically void ImageFlipHorizontal(Image *image); // Flip image horizontally void ImageColorTint(Image *image, Color color); // Modify image color: tint @@ -812,7 +815,7 @@ void UnloadSpriteFont(SpriteFont spriteFont); void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters - int fontSize, int spacing, Color tint); + float fontSize, int spacing, Color tint); int MeasureText(const char *text, int fontSize); // Measure string width for default font Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont diff --git a/src/text.c b/src/text.c index ec2480e3..d6a44bec 100644 --- a/src/text.c +++ b/src/text.c @@ -34,7 +34,7 @@ // Following libs are used on LoadTTF() #define STB_TRUETYPE_IMPLEMENTATION -#include "external/stb_truetype.h" // Required for: stbtt_BakeFontBitmap() +#include "external/stb_truetype.h" // Required for: stbtt_BakeFontBitmap() // Rectangle packing functions (not used at the moment) //#define STB_RECT_PACK_IMPLEMENTATION @@ -43,8 +43,7 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define FONT_FIRST_CHAR 32 -#define MAX_FONTCHARS 128 +#define FONT_FIRST_CHAR 32 // NOTE: Expected first char for a sprite font #define MAX_FORMATTEXT_LENGTH 64 #define MAX_SUBTEXT_LENGTH 64 @@ -72,7 +71,9 @@ static SpriteFont defaultFont; // Default font provided by raylib static SpriteFont LoadImageFont(Image image, Color key, int firstChar); // Load a Image font file (XNA style) static SpriteFont LoadRBMF(const char *fileName); // Load a rBMF font file (raylib BitMap Font) static SpriteFont LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) -static SpriteFont LoadTTF(const char *fileName, int fontSize); // Generate a sprite font image from TTF data (font size required) + +// Generate a sprite font image from TTF data +static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int numChars); extern void LoadDefaultFont(void); extern void UnloadDefaultFont(void); @@ -245,16 +246,20 @@ SpriteFont GetDefaultFont() // Load a SpriteFont image into GPU memory SpriteFont LoadSpriteFont(const char *fileName) { + // Default hardcoded values for ttf file loading + #define DEFAULT_TTF_FONTSIZE 32 // Font first character (32 - space) + #define DEFAULT_TTF_NUMCHARS 95 // ASCII 32..126 is 95 glyphs + SpriteFont spriteFont = { 0 }; // Check file extension if (strcmp(GetExtension(fileName),"rbmf") == 0) spriteFont = LoadRBMF(fileName); - else if (strcmp(GetExtension(fileName),"ttf") == 0) spriteFont = LoadTTF(fileName, 32); + else if (strcmp(GetExtension(fileName),"ttf") == 0) spriteFont = LoadTTF(fileName, DEFAULT_TTF_FONTSIZE, FONT_FIRST_CHAR, DEFAULT_TTF_NUMCHARS); else if (strcmp(GetExtension(fileName),"fnt") == 0) spriteFont = LoadBMFont(fileName); else { Image image = LoadImage(fileName); - if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, 32); + if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, FONT_FIRST_CHAR); UnloadImage(image); } @@ -294,12 +299,12 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) if (fontSize < defaultFontSize) fontSize = defaultFontSize; int spacing = fontSize / defaultFontSize; - DrawTextEx(defaultFont, text, position, fontSize, spacing, color); + DrawTextEx(defaultFont, text, position, (float)fontSize, spacing, color); } // Draw text using SpriteFont // NOTE: chars spacing is NOT proportional to fontSize -void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, int fontSize, int spacing, Color tint) +void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float fontSize, int spacing, Color tint) { int length = strlen(text); int textOffsetX = 0; @@ -309,7 +314,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, int f Rectangle rec; - scaleFactor = (float)fontSize/spriteFont.size; + scaleFactor = fontSize/spriteFont.size; // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly // written in C code files (codified by default as UTF-8) @@ -497,6 +502,9 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int x = 0; int y = 0; + + // Default number of characters expected supported + #define MAX_FONTCHARS 128 // We allocate a temporal arrays for chars data measures, // once we get the actual number of chars, we copy data to a sized arrays @@ -634,7 +642,7 @@ static SpriteFont LoadRBMF(const char *fileName) spriteFont.numChars = (int)rbmfHeader.numChars; - int numPixelBits = rbmfHeader.imgWidth * rbmfHeader.imgHeight / 32; + int numPixelBits = rbmfHeader.imgWidth*rbmfHeader.imgHeight/32; rbmfFileData = (unsigned int *)malloc(numPixelBits * sizeof(unsigned int)); @@ -843,17 +851,15 @@ static SpriteFont LoadBMFont(const char *fileName) // Generate a sprite font from TTF file data (font size required) // TODO: Review texture packing method and generation (use oversampling) -static SpriteFont LoadTTF(const char *fileName, int fontSize) +static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int numChars) { // NOTE: Generated font uses some hardcoded values #define FONT_TEXTURE_WIDTH 512 // Font texture width #define FONT_TEXTURE_HEIGHT 512 // Font texture height - #define FONT_FIRST_CHAR 32 // Font first character (32 - space) - #define FONT_NUM_CHARS 95 // ASCII 32..126 is 95 glyphs unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); unsigned char *dataBitmap = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)); // One channel bitmap returned! - stbtt_bakedchar charData[FONT_NUM_CHARS]; // ASCII 32..126 is 95 glyphs + stbtt_bakedchar charData[numChars]; SpriteFont font = { 0 }; @@ -868,7 +874,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize) fread(ttfBuffer, 1, 1<<25, ttfFile); // NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image... - stbtt_BakeFontBitmap(ttfBuffer,0, fontSize, dataBitmap, FONT_TEXTURE_WIDTH, FONT_TEXTURE_HEIGHT, FONT_FIRST_CHAR, FONT_NUM_CHARS, charData); + stbtt_BakeFontBitmap(ttfBuffer,0, fontSize, dataBitmap, FONT_TEXTURE_WIDTH, FONT_TEXTURE_HEIGHT, firstChar, numChars, charData); free(ttfBuffer); @@ -898,7 +904,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize) UnloadImage(image); // Unloads dataGrayAlpha font.size = fontSize; - font.numChars = FONT_NUM_CHARS; + font.numChars = numChars; font.charValues = (int *)malloc(font.numChars*sizeof(int)); font.charRecs = (Rectangle *)malloc(font.numChars*sizeof(Rectangle)); font.charOffsets = (Vector2 *)malloc(font.numChars*sizeof(Vector2)); @@ -906,7 +912,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize) for (int i = 0; i < font.numChars; i++) { - font.charValues[i] = i + FONT_FIRST_CHAR; + font.charValues[i] = i + firstChar; font.charRecs[i].x = (int)charData[i].x0; font.charRecs[i].y = (int)charData[i].y0; diff --git a/src/textures.c b/src/textures.c index f5523a3e..c6b7e0bb 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1053,7 +1053,7 @@ Image ImageText(const char *text, int fontSize, Color color) } // Create an image from text (custom sprite font) -Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint) +Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint) { int length = strlen(text); int posX = 0; @@ -1091,9 +1091,9 @@ Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Image imText = LoadImageEx(pixels, (int)imSize.x, (int)imSize.y); // Scale image depending on text size - if (fontSize > (int)imSize.y) + if (fontSize > imSize.y) { - float scaleFactor = (float)fontSize/imSize.y; + float scaleFactor = fontSize/imSize.y; TraceLog(INFO, "Scalefactor: %f", scaleFactor); // Using nearest-neighbor scaling algorithm for default font @@ -1114,7 +1114,7 @@ void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, } // Draw text (custom sprite font) within an image (destination) -void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, int fontSize, int spacing, Color color) +void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color) { Image imText = ImageTextEx(font, text, fontSize, spacing, color); -- cgit v1.2.3 From 7fbd821727228396e03f47786a4db27f00aaebba Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 7 Aug 2016 13:51:01 +0200 Subject: Some code review tweaks --- src/rlua.h | 70 ++++++++++++++++++-------------------------------------------- 1 file changed, 20 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 153f2c37..849c1c64 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -138,6 +138,7 @@ RLUADEF void CloseLuaDevice(void); // De-initialize Lua system #define LuaGetArgument_char (char)luaL_checkinteger #define LuaGetArgument_float (float)luaL_checknumber #define LuaGetArgument_double luaL_checknumber + #define LuaGetArgument_Image(L, img) *(Image*)LuaGetArgumentOpaqueTypeWithMetatable(L, img, "Image") #define LuaGetArgument_Texture2D(L, tex) *(Texture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, tex, "Texture2D") #define LuaGetArgument_RenderTexture2D(L, rtex) *(RenderTexture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, rtex, "RenderTexture2D") @@ -739,17 +740,6 @@ static int lua_Quaternion(lua_State* L) return 1; } -/* -static int lua_Matrix(lua_State* L) -{ - LuaPush_Matrix(L, (Matrix) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4), - (float)luaL_checknumber(L, 5), (float)luaL_checknumber(L, 6), (float)luaL_checknumber(L, 7), (float)luaL_checknumber(L, 8), - (float)luaL_checknumber(L, 9), (float)luaL_checknumber(L, 10), (float)luaL_checknumber(L, 11), (float)luaL_checknumber(L, 12), - (float)luaL_checknumber(L, 13), (float)luaL_checknumber(L, 14), (float)luaL_checknumber(L, 15), (float)luaL_checknumber(L, 16) }); - return 1; -} -*/ - static int lua_Rectangle(lua_State* L) { LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); @@ -777,8 +767,8 @@ static int lua_Camera(lua_State* L) Vector3 pos = LuaGetArgument_Vector3(L, 1); Vector3 tar = LuaGetArgument_Vector3(L, 2); Vector3 up = LuaGetArgument_Vector3(L, 3); - //float fovy = LuaGetArgument_float(L, 4); // ??? - LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, (float)luaL_checknumber(L, 4) }); + float fovy = LuaGetArgument_float(L, 4); + LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, fovy }); return 1; } @@ -792,23 +782,6 @@ static int lua_Camera2D(lua_State* L) return 1; } -/* -// NOTE: does it make sense to have this constructor? Probably not... -static int lua_Material(lua_State* L) -{ - Shader sdr = LuaGetArgument_Shader(L, 1); - Texture2D td = LuaGetArgument_Texture2D(L, 2); - Texture2D tn = LuaGetArgument_Texture2D(L, 3); - Texture2D ts = LuaGetArgument_Texture2D(L, 4); - Color cd = LuaGetArgument_Color(L, 5); - Color ca = LuaGetArgument_Color(L, 6); - Color cs = LuaGetArgument_Color(L, 7); - float gloss = LuaGetArgument_float(L, 8); - LuaPush_Material(L, (Material) { sdr, td, tn, ts cd, ca, cs, gloss }); - return 1; -} -*/ - /************************************************************************************* * raylib Lua Functions Bindings **************************************************************************************/ @@ -1817,14 +1790,11 @@ int lua_LoadImage(lua_State* L) int lua_LoadImageEx(lua_State* L) { - //Color * arg1 = LuaGetArgument_Color *(L, 1); GET_TABLE(Color, arg1, 1); - int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); - Image result = LoadImageEx(arg1, arg2, arg3); + Image result = LoadImageEx(arg1, arg2, arg3); // ISSUE: #3 number expected, got no value LuaPush_Image(L, result); - free(arg1); return 1; } @@ -1860,7 +1830,7 @@ int lua_LoadTexture(lua_State* L) int lua_LoadTextureEx(lua_State* L) { - void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string + void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string? int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); @@ -2056,7 +2026,7 @@ int lua_ImageDrawTextEx(lua_State* L) Vector2 arg2 = LuaGetArgument_Vector2(L, 2); SpriteFont arg3 = LuaGetArgument_SpriteFont(L, 3); const char * arg4 = LuaGetArgument_string(L, 4); - int arg5 = LuaGetArgument_int(L, 5); + float arg5 = LuaGetArgument_float(L, 5); int arg6 = LuaGetArgument_int(L, 6); Color arg7 = LuaGetArgument_Color(L, 7); ImageDrawTextEx(&arg1, arg2, arg3, arg4, arg5, arg6, arg7); @@ -2134,7 +2104,7 @@ int lua_UpdateTexture(lua_State* L) { Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? - UpdateTexture(arg1, arg2); + UpdateTexture(arg1, arg2); // ISSUE: #2 string expected, got table -> GetImageData() returns a table! return 0; } @@ -2231,7 +2201,7 @@ int lua_DrawTextEx(lua_State* L) SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); const char * arg2 = LuaGetArgument_string(L, 2); Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - int arg4 = LuaGetArgument_int(L, 4); + float arg4 = LuaGetArgument_float(L, 4); int arg5 = LuaGetArgument_int(L, 5); Color arg6 = LuaGetArgument_Color(L, 6); DrawTextEx(arg1, arg2, arg3, arg4, arg5, arg6); @@ -3911,7 +3881,7 @@ static luaL_Reg raylib_functions[] = { REG(QuaternionToAxisAngle) REG(QuaternionTransform) - {0,0} + {NULL, NULL} // sentinel: end signal }; // Register raylib functionality @@ -4017,16 +3987,16 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("PLAYER3", 2); LuaSetEnum("PLAYER4", 3); - LuaSetEnum("BUTTON_A", 2); - LuaSetEnum("BUTTON_B", 1); - LuaSetEnum("BUTTON_X", 3); - LuaSetEnum("BUTTON_Y", 4); - LuaSetEnum("BUTTON_R1", 7); - LuaSetEnum("BUTTON_R2", 5); - LuaSetEnum("BUTTON_L1", 6); - LuaSetEnum("BUTTON_L2", 8); - LuaSetEnum("BUTTON_SELECT", 9); - LuaSetEnum("BUTTON_START", 10); + LuaSetEnum("PS3_BUTTON_A", 2); + LuaSetEnum("PS3_BUTTON_B", 1); + LuaSetEnum("PS3_BUTTON_X", 3); + LuaSetEnum("PS3_BUTTON_Y", 4); + LuaSetEnum("PS3_BUTTON_R1", 7); + LuaSetEnum("PS3_BUTTON_R2", 5); + LuaSetEnum("PS3_BUTTON_L1", 6); + LuaSetEnum("PS3_BUTTON_L2", 8); + LuaSetEnum("PS3_BUTTON_SELECT", 9); + LuaSetEnum("PS3_BUTTON_START", 10); LuaSetEnum("XBOX_BUTTON_A", 0); LuaSetEnum("XBOX_BUTTON_B", 1); @@ -4040,7 +4010,7 @@ RLUADEF void InitLuaDevice(void) #if defined(PLATFORM_RPI) LuaSetEnum("XBOX_AXIS_DPAD_X", 7); LuaSetEnum("XBOX_AXIS_DPAD_Y", 6); - LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); + LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); LuaSetEnum("XBOX_AXIS_LT", 2); LuaSetEnum("XBOX_AXIS_RT", 5); -- cgit v1.2.3 From ed387d00aaaee50ef7d4dc2f355123e16c7727ca Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 8 Aug 2016 17:21:46 +0200 Subject: Corrected issue with VS --- src/text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index d6a44bec..2f347b5d 100644 --- a/src/text.c +++ b/src/text.c @@ -859,7 +859,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); unsigned char *dataBitmap = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)); // One channel bitmap returned! - stbtt_bakedchar charData[numChars]; + stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); SpriteFont font = { 0 }; @@ -922,6 +922,8 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int font.charOffsets[i] = (Vector2){ charData[i].xoff, charData[i].yoff }; font.charAdvanceX[i] = (int)charData[i].xadvance; } + + free(charData); return font; } \ No newline at end of file -- cgit v1.2.3 From cc2b3228d18f3bc4cd58ee4298cde78846cfde9e Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 9 Aug 2016 23:03:29 +0200 Subject: Updated for C++ --- src/raylib.h | 94 ++++++++++++++++++++++-------------------------------------- 1 file changed, 34 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 8045e436..41c32476 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -236,67 +236,44 @@ #define ANDROID_VOLUME_UP 24 #define ANDROID_VOLUME_DOWN 25 -// Some Basic Colors -// NOTE: Custom raylib color palette for amazing visuals on WHITE background +// NOTE: MSC C++ compiler does not support compound literals (C99 feature) +// Plain structures in C++ (without constructors) can be initialized from { } initializers. #ifdef __cplusplus - // NOTE: MSC C++ compiler does not support compound literals (C99 feature) - #define LIGHTGRAY Color(200, 200, 200, 255) // Light Gray - #define GRAY Color(130, 130, 130, 255) // Gray - #define DARKGRAY Color(80, 80, 80, 255) // Dark Gray - #define YELLOW Color(253, 249, 0, 255) // Yellow - #define GOLD Color(255, 203, 0, 255) // Gold - #define ORANGE Color(255, 161, 0, 255) // Orange - #define PINK Color(255, 109, 194, 255) // Pink - #define RED Color(230, 41, 55, 255) // Red - #define MAROON Color(190, 33, 55, 255) // Maroon - #define GREEN Color(0, 228, 48, 255) // Green - #define LIME Color(0, 158, 47, 255) // Lime - #define DARKGREEN Color(0, 117, 44, 255) // Dark Green - #define SKYBLUE Color(102, 191, 255, 255) // Sky Blue - #define BLUE Color(0, 121, 241, 255) // Blue - #define DARKBLUE Color(0, 82, 172, 255) // Dark Blue - #define PURPLE Color(200, 122, 255, 255) // Purple - #define VIOLET Color(135, 60, 190, 255) // Violet - #define DARKPURPLE Color(112, 31, 126, 255) // Dark Purple - #define BEIGE Color(211, 176, 131, 255) // Beige - #define BROWN Color(127, 106, 79, 255) // Brown - #define DARKBROWN Color(76, 63, 47, 255) // Dark Brown - - #define WHITE Color(255, 255, 255, 255) // White - #define BLACK Color(0, 0, 0, 255) // Black - #define BLANK Color(0, 0, 0, 0) // Blank (Transparent) - #define MAGENTA Color(255, 0, 255, 255) // Magenta - #define RAYWHITE Color(245, 245, 245, 255) // My own White (raylib logo) + #define CLITERAL #else - #define LIGHTGRAY (Color){ 200, 200, 200, 255 } // Light Gray - #define GRAY (Color){ 130, 130, 130, 255 } // Gray - #define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray - #define YELLOW (Color){ 253, 249, 0, 255 } // Yellow - #define GOLD (Color){ 255, 203, 0, 255 } // Gold - #define ORANGE (Color){ 255, 161, 0, 255 } // Orange - #define PINK (Color){ 255, 109, 194, 255 } // Pink - #define RED (Color){ 230, 41, 55, 255 } // Red - #define MAROON (Color){ 190, 33, 55, 255 } // Maroon - #define GREEN (Color){ 0, 228, 48, 255 } // Green - #define LIME (Color){ 0, 158, 47, 255 } // Lime - #define DARKGREEN (Color){ 0, 117, 44, 255 } // Dark Green - #define SKYBLUE (Color){ 102, 191, 255, 255 } // Sky Blue - #define BLUE (Color){ 0, 121, 241, 255 } // Blue - #define DARKBLUE (Color){ 0, 82, 172, 255 } // Dark Blue - #define PURPLE (Color){ 200, 122, 255, 255 } // Purple - #define VIOLET (Color){ 135, 60, 190, 255 } // Violet - #define DARKPURPLE (Color){ 112, 31, 126, 255 } // Dark Purple - #define BEIGE (Color){ 211, 176, 131, 255 } // Beige - #define BROWN (Color){ 127, 106, 79, 255 } // Brown - #define DARKBROWN (Color){ 76, 63, 47, 255 } // Dark Brown - - #define WHITE (Color){ 255, 255, 255, 255 } // White - #define BLACK (Color){ 0, 0, 0, 255 } // Black - #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) - #define MAGENTA (Color){ 255, 0, 255, 255 } // Magenta - #define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo) + #define CLITERAL (Color) #endif +// Some Basic Colors +// NOTE: Custom raylib color palette for amazing visuals on WHITE background +#define LIGHTGRAY CLITERAL{ 200, 200, 200, 255 } // Light Gray +#define GRAY CLITERAL{ 130, 130, 130, 255 } // Gray +#define DARKGRAY CLITERAL{ 80, 80, 80, 255 } // Dark Gray +#define YELLOW CLITERAL{ 253, 249, 0, 255 } // Yellow +#define GOLD CLITERAL{ 255, 203, 0, 255 } // Gold +#define ORANGE CLITERAL{ 255, 161, 0, 255 } // Orange +#define PINK CLITERAL{ 255, 109, 194, 255 } // Pink +#define RED CLITERAL{ 230, 41, 55, 255 } // Red +#define MAROON CLITERAL{ 190, 33, 55, 255 } // Maroon +#define GREEN CLITERAL{ 0, 228, 48, 255 } // Green +#define LIME CLITERAL{ 0, 158, 47, 255 } // Lime +#define DARKGREEN CLITERAL{ 0, 117, 44, 255 } // Dark Green +#define SKYBLUE CLITERAL{ 102, 191, 255, 255 } // Sky Blue +#define BLUE CLITERAL{ 0, 121, 241, 255 } // Blue +#define DARKBLUE CLITERAL{ 0, 82, 172, 255 } // Dark Blue +#define PURPLE CLITERAL{ 200, 122, 255, 255 } // Purple +#define VIOLET CLITERAL{ 135, 60, 190, 255 } // Violet +#define DARKPURPLE CLITERAL{ 112, 31, 126, 255 } // Dark Purple +#define BEIGE CLITERAL{ 211, 176, 131, 255 } // Beige +#define BROWN CLITERAL{ 127, 106, 79, 255 } // Brown +#define DARKBROWN CLITERAL{ 76, 63, 47, 255 } // Dark Brown + +#define WHITE CLITERAL{ 255, 255, 255, 255 } // White +#define BLACK CLITERAL{ 0, 0, 0, 255 } // Black +#define BLANK CLITERAL{ 0, 0, 0, 0 } // Blank (Transparent) +#define MAGENTA CLITERAL{ 255, 0, 255, 255 } // Magenta +#define RAYWHITE CLITERAL{ 245, 245, 245, 255 } // My own White (raylib logo) + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -342,9 +319,6 @@ typedef struct Color { unsigned char g; unsigned char b; unsigned char a; -#ifdef __cplusplus - Color(unsigned char cr, unsigned char cg, unsigned char cb, unsigned char ca) : r(cr), g(cg), b(cb), a(ca) { } -#endif } Color; // Rectangle type -- cgit v1.2.3 From eb9072a2f133cdad9fb4fed4c8b80aca04770d55 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 10 Aug 2016 12:20:46 +0200 Subject: Renamed functions for consistency --- src/models.c | 14 +++++++------- src/raylib.h | 4 ++-- src/rlua.h | 56 ++++++++++++++++++++++++++++++-------------------------- 3 files changed, 39 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index b194a0db..7f248aa2 100644 --- a/src/models.c +++ b/src/models.c @@ -66,7 +66,7 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); //---------------------------------------------------------------------------------- // Draw a line in 3D world space -void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color) +void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) { rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -76,7 +76,7 @@ void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color) } // Draw a circle in 3D world space -void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color) +void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color) { rlPushMatrix(); rlTranslatef(center.x, center.y, center.z); @@ -578,19 +578,19 @@ void DrawLight(Light light) case LIGHT_POINT: { DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); - Draw3DCircle(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); - Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); - Draw3DCircle(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); + DrawCircle3D(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); + DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); } break; case LIGHT_DIRECTIONAL: { - Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); } break; case LIGHT_SPOT: { - Draw3DLine(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : BLACK)); DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); } break; diff --git a/src/raylib.h b/src/raylib.h index 41c32476..1673578d 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -800,6 +800,8 @@ const char *SubText(const char *text, int position, int length); //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ +void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires @@ -814,8 +816,6 @@ void DrawRay(Ray ray, Color color); void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) void DrawGizmo(Vector3 position); // Draw simple gizmo void DrawLight(Light light); // Draw light in 3D world -void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space //DrawTorus(), DrawTeapot() are useless... //------------------------------------------------------------------------------------ diff --git a/src/rlua.h b/src/rlua.h index 849c1c64..b100b06d 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -2239,6 +2239,29 @@ int lua_DrawFPS(lua_State* L) // NOTE: FormatText() can be replaced by Lua function: string.format() // NOTE: SubText() can be replaced by Lua function: string.sub() +//------------------------------------------------------------------------------------ +// raylib [models] module functions - Basic 3d Shapes Drawing Functions +//------------------------------------------------------------------------------------ +int lua_DrawLine3D(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + Vector3 arg2 = LuaGetArgument_Vector3(L, 2); + Color arg3 = LuaGetArgument_Color(L, 3); + DrawLine3D(arg1, arg2, arg3); + return 0; +} + +int lua_DrawCircle3D(lua_State* L) +{ + Vector3 arg1 = LuaGetArgument_Vector3(L, 1); + float arg2 = LuaGetArgument_float(L, 2); + float arg3 = LuaGetArgument_float(L, 3); + Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + Color arg5 = LuaGetArgument_Color(L, 5); + DrawCircle3D(arg1, arg2, arg3, arg4, arg5); + return 0; +} + int lua_DrawCube(lua_State* L) { Vector3 arg1 = LuaGetArgument_Vector3(L, 1); @@ -2376,26 +2399,6 @@ int lua_DrawLight(lua_State* L) return 0; } -int lua_Draw3DLine(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - Draw3DLine(arg1, arg2, arg3); - return 0; -} - -int lua_Draw3DCircle(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Draw3DCircle(arg1, arg2, arg3, arg4, arg5); - return 0; -} - //------------------------------------------------------------------------------------ // raylib [models] module functions //------------------------------------------------------------------------------------ @@ -3725,6 +3728,8 @@ static luaL_Reg raylib_functions[] = { REG(MeasureTextEx) REG(DrawFPS) + REG(DrawLine3D) + REG(DrawCircle3D) REG(DrawCube) REG(DrawCubeV) REG(DrawCubeWires) @@ -3738,8 +3743,7 @@ static luaL_Reg raylib_functions[] = { REG(DrawRay) REG(DrawGrid) REG(DrawGizmo) - - REG(DrawLight) + REG(DrawLight) REG(LoadModel) REG(LoadModelEx) @@ -3747,10 +3751,10 @@ static luaL_Reg raylib_functions[] = { REG(LoadHeightmap) REG(LoadCubicmap) REG(UnloadModel) - REG(LoadMaterial) - REG(LoadDefaultMaterial) - REG(LoadStandardMaterial) - REG(UnloadMaterial) + REG(LoadMaterial) + REG(LoadDefaultMaterial) + REG(LoadStandardMaterial) + REG(UnloadMaterial) //REG(GenMesh*) // Not ready yet... REG(DrawModel) -- cgit v1.2.3 From a1b6b217e4797caf0ab2b5e297a91013ac24333d Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 10 Aug 2016 12:55:31 +0200 Subject: Comment tweak --- src/gestures.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gestures.h b/src/gestures.h index 4c59ee39..481ef317 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -13,9 +13,9 @@ * * NOTE: Memory footprint of this library is aproximately 128 bytes * -* Initial design by Marc Palau -* Redesigned by Albert Martos and Ian Eito -* Reviewed by Ramon Santamaria (@raysan5) +* Initial design by Marc Palau (2014) +* Redesigned by Albert Martos and Ian Eito (2015) +* Reviewed by Ramon Santamaria (2015-2016) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. -- cgit v1.2.3 From 289e04a62a64a6e82aa5da3397baaa7f48cc45ed Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 10 Aug 2016 12:55:54 +0200 Subject: Ported camera module to header-only --- src/Makefile | 4 - src/camera.c | 523 ---------------------------------------------------- src/camera.h | 586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/core.c | 3 + 4 files changed, 559 insertions(+), 557 deletions(-) delete mode 100644 src/camera.c (limited to 'src') diff --git a/src/Makefile b/src/Makefile index e82c2861..b4eccdb2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -203,10 +203,6 @@ external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h utils.o : utils.c utils.h $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -# compile camera module -camera.o : camera.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) - # It installs generated and needed files to compile projects using raylib. # The installation works manually. # TODO: add other platforms. diff --git a/src/camera.c b/src/camera.c deleted file mode 100644 index 11571cca..00000000 --- a/src/camera.c +++ /dev/null @@ -1,523 +0,0 @@ -/********************************************************************************************** -* -* raylib Camera System - Camera Modes Setup and Control Functions -* -* Copyright (c) 2015 Marc Palau and Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -//#define CAMERA_STANDALONE // NOTE: To use the camera module as standalone lib, just uncomment this line - // NOTE: ProcessCamera() should be reviewed to adapt inputs to other systems - -#if defined(CAMERA_STANDALONE) - #include "camera.h" -#else - #include "raylib.h" -#endif - -#include // Required for: sqrt(), sin(), cos() - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -// CAMERA_GENERIC -#define CAMERA_SCROLL_SENSITIVITY 1.5f - -// FREE_CAMERA -#define FREE_CAMERA_MOUSE_SENSITIVITY 0.01f -#define FREE_CAMERA_DISTANCE_MIN_CLAMP 0.3f -#define FREE_CAMERA_DISTANCE_MAX_CLAMP 120.0f -#define FREE_CAMERA_MIN_CLAMP 85.0f -#define FREE_CAMERA_MAX_CLAMP -85.0f -#define FREE_CAMERA_SMOOTH_ZOOM_SENSITIVITY 0.05f -#define FREE_CAMERA_PANNING_DIVIDER 5.1f - -// ORBITAL_CAMERA -#define ORBITAL_CAMERA_SPEED 0.01f - -// FIRST_PERSON -//#define FIRST_PERSON_MOUSE_SENSITIVITY 0.003f -#define FIRST_PERSON_FOCUS_DISTANCE 25.0f -#define FIRST_PERSON_MIN_CLAMP 85.0f -#define FIRST_PERSON_MAX_CLAMP -85.0f - -#define FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER 5.0f -#define FIRST_PERSON_STEP_DIVIDER 30.0f -#define FIRST_PERSON_WAVING_DIVIDER 200.0f - -#define FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION 0.85f - -// THIRD_PERSON -//#define THIRD_PERSON_MOUSE_SENSITIVITY 0.003f -#define THIRD_PERSON_DISTANCE_CLAMP 1.2f -#define THIRD_PERSON_MIN_CLAMP 5.0f -#define THIRD_PERSON_MAX_CLAMP -85.0f -#define THIRD_PERSON_OFFSET (Vector3){ 0.4f, 0.0f, 0.0f } - -// PLAYER (used by camera) -#define PLAYER_WIDTH 0.4f -#define PLAYER_HEIGHT 0.9f -#define PLAYER_DEPTH 0.4f -#define PLAYER_MOVEMENT_DIVIDER 20.0f - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- -// Camera move modes (first person and third person cameras) -typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_DOWN } CameraMove; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -static Camera internalCamera = {{ 2.0f, 0.0f, 2.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; -static Vector2 cameraAngle = { 0.0f, 0.0f }; -static float cameraTargetDistance = 5.0f; -static Vector2 cameraMousePosition = { 0.0f, 0.0f }; -static Vector2 cameraMouseVariation = { 0.0f, 0.0f }; -static float mouseSensitivity = 0.003f; -static int cameraMoveControl[6] = { 'W', 'A', 'S', 'D', 'E', 'Q' }; -static int cameraMoveCounter = 0; -static int cameraUseGravity = 1; -static int panControlKey = 2; // raylib: MOUSE_MIDDLE_BUTTON -static int altControlKey = 342; // raylib: KEY_LEFT_ALT -static int smoothZoomControlKey = 341; // raylib: KEY_LEFT_CONTROL - -static int cameraMode = CAMERA_CUSTOM; - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static void ProcessCamera(Camera *camera, Vector3 *playerPosition); - -#if defined(CAMERA_STANDALONE) -// NOTE: Camera controls depend on some raylib input functions -// TODO: Set your own input functions (used in ProcessCamera()) -static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } -static void SetMousePosition(Vector2 pos) {} -static int IsMouseButtonDown(int button) { return 0;} -static int GetMouseWheelMove() { return 0; } -static int GetScreenWidth() { return 1280; } -static int GetScreenHeight() { return 720; } -static void ShowCursor() {} -static void HideCursor() {} -static int IsKeyDown(int key) { return 0; } -#endif - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- - -// Select camera mode (multiple camera modes available) -// TODO: Review hardcoded values when changing modes... -void SetCameraMode(int mode) -{ - if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_FREE)) - { - cameraMode = CAMERA_THIRD_PERSON; - cameraTargetDistance = 5.0f; - cameraAngle.y = -40*DEG2RAD; - ProcessCamera(&internalCamera, &internalCamera.position); - } - else if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_ORBITAL)) - { - cameraMode = CAMERA_THIRD_PERSON; - cameraTargetDistance = 5.0f; - cameraAngle.y = -40*DEG2RAD; - ProcessCamera(&internalCamera, &internalCamera.position); - } - else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_FREE)) - { - cameraTargetDistance = 10.0f; - cameraAngle.x = 45*DEG2RAD; - cameraAngle.y = -40*DEG2RAD; - internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - ProcessCamera(&internalCamera, &internalCamera.position); - - ShowCursor(); - } - else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_ORBITAL)) - { - cameraTargetDistance = 10.0f; - cameraAngle.x = 225*DEG2RAD; - cameraAngle.y = -40*DEG2RAD; - internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - ProcessCamera(&internalCamera, &internalCamera.position); - } - - cameraMode = mode; -} - -// Update camera (player position is ignored) -void UpdateCamera(Camera *camera) -{ - Vector3 position = { 0.0f, 0.0f, 0.0f }; - - // Process internal camera and player position (if required) - if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, &position); - - *camera = internalCamera; -} - -// Update camera and player position (1st person and 3rd person cameras) -void UpdateCameraPlayer(Camera *camera, Vector3 *position) -{ - // Process internal camera and player position (if required) - if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, position); - - *camera = internalCamera; -} - -// Set internal camera position -void SetCameraPosition(Vector3 position) -{ - internalCamera.position = position; - - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; - - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} - -// Set internal camera target -void SetCameraTarget(Vector3 target) -{ - internalCamera.target = target; - - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; - - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} - -// Set internal camera fovy -void SetCameraFovy(float fovy) -{ - internalCamera.fovy = fovy; -} - -// Set camera pan key to combine with mouse movement (free camera) -void SetCameraPanControl(int panKey) -{ - panControlKey = panKey; -} - -// Set camera alt key to combine with mouse movement (free camera) -void SetCameraAltControl(int altKey) -{ - altControlKey = altKey; -} - -// Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraSmoothZoomControl(int szKey) -{ - smoothZoomControlKey = szKey; -} - -// Set camera move controls (1st person and 3rd person cameras) -void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) -{ - cameraMoveControl[MOVE_FRONT] = frontKey; - cameraMoveControl[MOVE_LEFT] = leftKey; - cameraMoveControl[MOVE_BACK] = backKey; - cameraMoveControl[MOVE_RIGHT] = rightKey; - cameraMoveControl[MOVE_UP] = upKey; - cameraMoveControl[MOVE_DOWN] = downKey; -} - -// Set camera mouse sensitivity (1st person and 3rd person cameras) -void SetCameraMouseSensitivity(float sensitivity) -{ - mouseSensitivity = (sensitivity/10000.0f); -} - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -// Process desired camera mode and controls -// NOTE: Camera controls depend on some raylib functions: -// Mouse: GetMousePosition(), SetMousePosition(), IsMouseButtonDown(), GetMouseWheelMove() -// System: GetScreenWidth(), GetScreenHeight(), ShowCursor(), HideCursor() -// Keys: IsKeyDown() -static void ProcessCamera(Camera *camera, Vector3 *playerPosition) -{ - // Mouse movement detection - Vector2 mousePosition = GetMousePosition(); - int mouseWheelMove = GetMouseWheelMove(); - int panKey = IsMouseButtonDown(panControlKey); // bool value - - int screenWidth = GetScreenWidth(); - int screenHeight = GetScreenHeight(); - - if ((cameraMode != CAMERA_FREE) && (cameraMode != CAMERA_ORBITAL)) - { - HideCursor(); - - if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y}); - else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3}); - else if (mousePosition.x > screenWidth - screenHeight/3) SetMousePosition((Vector2) { screenHeight/3, mousePosition.y}); - else if (mousePosition.y > screenHeight - screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3}); - else - { - cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; - cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; - } - } - else - { - ShowCursor(); - - cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; - cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; - } - - // NOTE: We GetMousePosition() again because it can be modified by a previous SetMousePosition() call - // If using directly mousePosition variable we have problems on CAMERA_FIRST_PERSON and CAMERA_THIRD_PERSON - cameraMousePosition = GetMousePosition(); - - // Support for multiple automatic camera modes - switch (cameraMode) - { - case CAMERA_FREE: - { - // Camera zoom - if ((cameraTargetDistance < FREE_CAMERA_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) - { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); - - if (cameraTargetDistance > FREE_CAMERA_DISTANCE_MAX_CLAMP) cameraTargetDistance = FREE_CAMERA_DISTANCE_MAX_CLAMP; - } - // Camera looking down - else if ((camera->position.y > camera->target.y) && (cameraTargetDistance == FREE_CAMERA_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) - { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - } - else if ((camera->position.y > camera->target.y) && (camera->target.y >= 0)) - { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - - // if (camera->target.y < 0) camera->target.y = -0.001; - } - else if ((camera->position.y > camera->target.y) && (camera->target.y < 0) && (mouseWheelMove > 0)) - { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); - if (cameraTargetDistance < FREE_CAMERA_DISTANCE_MIN_CLAMP) cameraTargetDistance = FREE_CAMERA_DISTANCE_MIN_CLAMP; - } - // Camera looking up - else if ((camera->position.y < camera->target.y) && (cameraTargetDistance == FREE_CAMERA_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) - { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - } - else if ((camera->position.y < camera->target.y) && (camera->target.y <= 0)) - { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - - // if (camera->target.y > 0) camera->target.y = 0.001; - } - else if ((camera->position.y < camera->target.y) && (camera->target.y > 0) && (mouseWheelMove > 0)) - { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); - if (cameraTargetDistance < FREE_CAMERA_DISTANCE_MIN_CLAMP) cameraTargetDistance = FREE_CAMERA_DISTANCE_MIN_CLAMP; - } - - // Inputs - if (IsKeyDown(altControlKey)) - { - if (IsKeyDown(smoothZoomControlKey)) - { - // Camera smooth zoom - if (panKey) cameraTargetDistance += (cameraMouseVariation.y*FREE_CAMERA_SMOOTH_ZOOM_SENSITIVITY); - } - // Camera orientation calculation - else if (panKey) - { - // Camera orientation calculation - // Get the mouse sensitivity - cameraAngle.x += cameraMouseVariation.x*-FREE_CAMERA_MOUSE_SENSITIVITY; - cameraAngle.y += cameraMouseVariation.y*-FREE_CAMERA_MOUSE_SENSITIVITY; - - // Angle clamp - if (cameraAngle.y > FREE_CAMERA_MIN_CLAMP*DEG2RAD) cameraAngle.y = FREE_CAMERA_MIN_CLAMP*DEG2RAD; - else if (cameraAngle.y < FREE_CAMERA_MAX_CLAMP*DEG2RAD) cameraAngle.y = FREE_CAMERA_MAX_CLAMP*DEG2RAD; - } - } - // Paning - else if (panKey) - { - camera->target.x += ((cameraMouseVariation.x*-FREE_CAMERA_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (cameraMouseVariation.y*FREE_CAMERA_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/FREE_CAMERA_PANNING_DIVIDER); - camera->target.y += ((cameraMouseVariation.y*FREE_CAMERA_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/FREE_CAMERA_PANNING_DIVIDER); - camera->target.z += ((cameraMouseVariation.x*FREE_CAMERA_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (cameraMouseVariation.y*FREE_CAMERA_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/FREE_CAMERA_PANNING_DIVIDER); - } - - // Focus to center - // TODO: Move this function out of this module? - if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - - // Camera position update - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; - - } break; - case CAMERA_ORBITAL: - { - cameraAngle.x += ORBITAL_CAMERA_SPEED; - - // Camera zoom - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); - - // Camera distance clamp - if (cameraTargetDistance < THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = THIRD_PERSON_DISTANCE_CLAMP; - - // Focus to center - if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - - // Camera position update - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; - - } break; - case CAMERA_FIRST_PERSON: - case CAMERA_THIRD_PERSON: - { - bool isMoving = false; - - // Keyboard inputs - if (IsKeyDown(cameraMoveControl[MOVE_FRONT])) - { - playerPosition->x -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - if (!cameraUseGravity) camera->position.y += sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - else if (IsKeyDown(cameraMoveControl[MOVE_BACK])) - { - playerPosition->x += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - if (!cameraUseGravity) camera->position.y -= sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - - if (IsKeyDown(cameraMoveControl[MOVE_LEFT])) - { - playerPosition->x -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - else if (IsKeyDown(cameraMoveControl[MOVE_RIGHT])) - { - playerPosition->x += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - - if (IsKeyDown(cameraMoveControl[MOVE_UP])) - { - if (!cameraUseGravity) playerPosition->y += 1.0f/PLAYER_MOVEMENT_DIVIDER; - } - else if (IsKeyDown(cameraMoveControl[MOVE_DOWN])) - { - if (!cameraUseGravity) playerPosition->y -= 1.0f/PLAYER_MOVEMENT_DIVIDER; - } - - if (cameraMode == CAMERA_THIRD_PERSON) - { - // Camera orientation calculation - cameraAngle.x += cameraMouseVariation.x*-mouseSensitivity; - cameraAngle.y += cameraMouseVariation.y*-mouseSensitivity; - - // Angle clamp - if (cameraAngle.y > THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = THIRD_PERSON_MIN_CLAMP*DEG2RAD; - else if (cameraAngle.y < THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = THIRD_PERSON_MAX_CLAMP*DEG2RAD; - - // Camera zoom - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); - - // Camera distance clamp - if (cameraTargetDistance < THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = THIRD_PERSON_DISTANCE_CLAMP; - - // Camera is always looking at player - camera->target.x = playerPosition->x + THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); - camera->target.y = playerPosition->y + PLAYER_HEIGHT*FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + THIRD_PERSON_OFFSET.y; - camera->target.z = playerPosition->z + THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); - - // Camera position update - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; - } - else // CAMERA_FIRST_PERSON - { - if (isMoving) cameraMoveCounter++; - - // Camera orientation calculation - cameraAngle.x += (cameraMouseVariation.x * -mouseSensitivity); - cameraAngle.y += (cameraMouseVariation.y * -mouseSensitivity); - - // Angle clamp - if (cameraAngle.y > FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = FIRST_PERSON_MIN_CLAMP*DEG2RAD; - else if (cameraAngle.y < FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = FIRST_PERSON_MAX_CLAMP*DEG2RAD; - - // Camera is always looking at player - camera->target.x = camera->position.x - sin(cameraAngle.x)*FIRST_PERSON_FOCUS_DISTANCE; - camera->target.y = camera->position.y + sin(cameraAngle.y)*FIRST_PERSON_FOCUS_DISTANCE; - camera->target.z = camera->position.z - cos(cameraAngle.x)*FIRST_PERSON_FOCUS_DISTANCE; - - camera->position.x = playerPosition->x; - camera->position.y = (playerPosition->y + PLAYER_HEIGHT*FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) - sin(cameraMoveCounter/FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/FIRST_PERSON_STEP_DIVIDER; - camera->position.z = playerPosition->z; - - camera->up.x = sin(cameraMoveCounter/(FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/FIRST_PERSON_WAVING_DIVIDER; - camera->up.z = -sin(cameraMoveCounter/(FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/FIRST_PERSON_WAVING_DIVIDER; - } - } break; - default: break; - } -} diff --git a/src/camera.h b/src/camera.h index 8d8029af..f5bb867d 100644 --- a/src/camera.h +++ b/src/camera.h @@ -2,7 +2,19 @@ * * raylib Camera System - Camera Modes Setup and Control Functions * -* Copyright (c) 2015 Marc Palau and Ramon Santamaria +* #define CAMERA_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. +* +* #define CAMERA_STANDALONE +* If defined, the library can be used as standalone as a camera system but some +* functions must be redefined to manage inputs accordingly. +* +* NOTE: Memory footprint of this library is aproximately 112 bytes +* +* Initial design by Marc Palau (2014) +* Reviewed by Ramon Santamaria (2015-2016) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -24,13 +36,6 @@ #ifndef CAMERA_H #define CAMERA_H -#ifndef PI - #define PI 3.14159265358979323846 -#endif - -#define DEG2RAD (PI/180.0f) -#define RAD2DEG (180.0f/PI) - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- @@ -40,28 +45,30 @@ // Types and Structures Definition // NOTE: Below types are required for CAMERA_STANDALONE usage //---------------------------------------------------------------------------------- -// Camera modes -typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; - -// Vector2 type -typedef struct Vector2 { - float x; - float y; -} Vector2; - -// Vector3 type -typedef struct Vector3 { - float x; - float y; - float z; -} Vector3; - -// Camera type, defines a camera position/orientation in 3d space -typedef struct Camera { - Vector3 position; - Vector3 target; - Vector3 up; -} Camera; +#if defined(CAMERA_STANDALONE) + // Camera modes + typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; + + // Vector2 type + typedef struct Vector2 { + float x; + float y; + } Vector2; + + // Vector3 type + typedef struct Vector3 { + float x; + float y; + float z; + } Vector3; + + // Camera type, defines a camera position/orientation in 3d space + typedef struct Camera { + Vector3 position; + Vector3 target; + Vector3 up; + } Camera; +#endif #ifdef __cplusplus extern "C" { // Prevents name mangling of functions @@ -75,6 +82,7 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- +#if defined(CAMERA_STANDALONE) void SetCameraMode(int mode); // Set camera mode (multiple camera modes available) void UpdateCamera(Camera *camera); // Update camera (player position is ignored) void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and player position (1st person and 3rd person cameras) @@ -91,9 +99,527 @@ void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) +#endif #ifdef __cplusplus } #endif #endif // CAMERA_H + + +/*********************************************************************************** +* +* CAMERA IMPLEMENTATION +* +************************************************************************************/ + +#if defined(CAMERA_IMPLEMENTATION) + +#include // Required for: sqrt(), sin(), cos() + +#ifndef PI + #define PI 3.14159265358979323846 +#endif + +#ifndef DEG2RAD + #define DEG2RAD (PI/180.0f) +#endif + +#ifndef RAD2DEG + #define RAD2DEG (180.0f/PI) +#endif + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +// CAMERA_GENERIC +#define CAMERA_SCROLL_SENSITIVITY 1.5f + +// FREE_CAMERA +#define CAMERA_FREE_MOUSE_SENSITIVITY 0.01f +#define CAMERA_FREE_DISTANCE_MIN_CLAMP 0.3f +#define CAMERA_FREE_DISTANCE_MAX_CLAMP 120.0f +#define CAMERA_FREE_MIN_CLAMP 85.0f +#define CAMERA_FREE_MAX_CLAMP -85.0f +#define CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY 0.05f +#define CAMERA_FREE_PANNING_DIVIDER 5.1f + +// ORBITAL_CAMERA +#define CAMERA_ORBITAL_SPEED 0.01f + +// FIRST_PERSON +//#define CAMERA_FIRST_PERSON_MOUSE_SENSITIVITY 0.003f +#define CAMERA_FIRST_PERSON_FOCUS_DISTANCE 25.0f +#define CAMERA_FIRST_PERSON_MIN_CLAMP 85.0f +#define CAMERA_FIRST_PERSON_MAX_CLAMP -85.0f + +#define CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER 5.0f +#define CAMERA_FIRST_PERSON_STEP_DIVIDER 30.0f +#define CAMERA_FIRST_PERSON_WAVING_DIVIDER 200.0f + +#define CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION 0.85f + +// THIRD_PERSON +//#define CAMERA_THIRD_PERSON_MOUSE_SENSITIVITY 0.003f +#define CAMERA_THIRD_PERSON_DISTANCE_CLAMP 1.2f +#define CAMERA_THIRD_PERSON_MIN_CLAMP 5.0f +#define CAMERA_THIRD_PERSON_MAX_CLAMP -85.0f +#define CAMERA_THIRD_PERSON_OFFSET (Vector3){ 0.4f, 0.0f, 0.0f } + +// PLAYER (used by camera) +#define PLAYER_WIDTH 0.4f +#define PLAYER_HEIGHT 0.9f +#define PLAYER_DEPTH 0.4f +#define PLAYER_MOVEMENT_DIVIDER 20.0f + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- +// Camera move modes (first person and third person cameras) +typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_DOWN } CameraMove; + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +static Camera internalCamera = {{ 2.0f, 0.0f, 2.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; + +static Vector2 cameraAngle = { 0.0f, 0.0f }; +static float cameraTargetDistance = 5.0f; +static Vector2 cameraMousePosition = { 0.0f, 0.0f }; +static Vector2 cameraMouseVariation = { 0.0f, 0.0f }; + +static int cameraMoveControl[6] = { 'W', 'A', 'S', 'D', 'E', 'Q' }; +static int cameraPanControlKey = 2; // raylib: MOUSE_MIDDLE_BUTTON +static int cameraAltControlKey = 342; // raylib: KEY_LEFT_ALT +static int cameraSmoothZoomControlKey = 341; // raylib: KEY_LEFT_CONTROL + +static int cameraMoveCounter = 0; // Used for 1st person swinging movement +static float cameraMouseSensitivity = 0.003f; // How sensible is camera movement to mouse movement + +static int cameraMode = CAMERA_CUSTOM; // Current internal camera mode + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static void ProcessCamera(Camera *camera, Vector3 *playerPosition); + +#if defined(CAMERA_STANDALONE) +// NOTE: Camera controls depend on some raylib input functions +// TODO: Set your own input functions (used in ProcessCamera()) +static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } +static void SetMousePosition(Vector2 pos) {} +static int IsMouseButtonDown(int button) { return 0;} +static int GetMouseWheelMove() { return 0; } +static int GetScreenWidth() { return 1280; } +static int GetScreenHeight() { return 720; } +static void ShowCursor() {} +static void HideCursor() {} +static int IsKeyDown(int key) { return 0; } +#endif + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Select camera mode (multiple camera modes available) +// TODO: Review hardcoded values when changing modes... +void SetCameraMode(int mode) +{ + if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_FREE)) + { + cameraMode = CAMERA_THIRD_PERSON; + cameraTargetDistance = 5.0f; + cameraAngle.y = -40*DEG2RAD; + ProcessCamera(&internalCamera, &internalCamera.position); + } + else if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_ORBITAL)) + { + cameraMode = CAMERA_THIRD_PERSON; + cameraTargetDistance = 5.0f; + cameraAngle.y = -40*DEG2RAD; + ProcessCamera(&internalCamera, &internalCamera.position); + } + else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_FREE)) + { + cameraTargetDistance = 10.0f; + cameraAngle.x = 45*DEG2RAD; + cameraAngle.y = -40*DEG2RAD; + internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + ProcessCamera(&internalCamera, &internalCamera.position); + + ShowCursor(); + } + else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_ORBITAL)) + { + cameraTargetDistance = 10.0f; + cameraAngle.x = 225*DEG2RAD; + cameraAngle.y = -40*DEG2RAD; + internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + ProcessCamera(&internalCamera, &internalCamera.position); + } + + cameraMode = mode; +} + +// Update camera (player position is ignored) +void UpdateCamera(Camera *camera) +{ + Vector3 position = { 0.0f, 0.0f, 0.0f }; + + // Process internal camera and player position (if required) + if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, &position); + + *camera = internalCamera; +} + +// Update camera and player position (1st person and 3rd person cameras) +void UpdateCameraPlayer(Camera *camera, Vector3 *position) +{ + // Process internal camera and player position (if required) + if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, position); + + *camera = internalCamera; +} + +// Set internal camera position +void SetCameraPosition(Vector3 position) +{ + internalCamera.position = position; + + Vector3 v1 = internalCamera.position; + Vector3 v2 = internalCamera.target; + + float dx = v2.x - v1.x; + float dy = v2.y - v1.y; + float dz = v2.z - v1.z; + + cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); +} + +// Set internal camera target +void SetCameraTarget(Vector3 target) +{ + internalCamera.target = target; + + Vector3 v1 = internalCamera.position; + Vector3 v2 = internalCamera.target; + + float dx = v2.x - v1.x; + float dy = v2.y - v1.y; + float dz = v2.z - v1.z; + + cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); +} + +// Set internal camera fovy +void SetCameraFovy(float fovy) +{ + internalCamera.fovy = fovy; +} + +// Set camera pan key to combine with mouse movement (free camera) +void SetCameraPanControl(int panKey) +{ + cameraPanControlKey = panKey; +} + +// Set camera alt key to combine with mouse movement (free camera) +void SetCameraAltControl(int altKey) +{ + cameraAltControlKey = altKey; +} + +// Set camera smooth zoom key to combine with mouse (free camera) +void SetCameraSmoothZoomControl(int szKey) +{ + cameraSmoothZoomControlKey = szKey; +} + +// Set camera move controls (1st person and 3rd person cameras) +void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) +{ + cameraMoveControl[MOVE_FRONT] = frontKey; + cameraMoveControl[MOVE_LEFT] = leftKey; + cameraMoveControl[MOVE_BACK] = backKey; + cameraMoveControl[MOVE_RIGHT] = rightKey; + cameraMoveControl[MOVE_UP] = upKey; + cameraMoveControl[MOVE_DOWN] = downKey; +} + +// Set camera mouse sensitivity (1st person and 3rd person cameras) +void SetCameracameraMouseSensitivity(float sensitivity) +{ + cameraMouseSensitivity = (sensitivity/10000.0f); +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Process desired camera mode and controls +// NOTE: Camera controls depend on some raylib functions: +// Mouse: GetMousePosition(), SetMousePosition(), IsMouseButtonDown(), GetMouseWheelMove() +// System: GetScreenWidth(), GetScreenHeight(), ShowCursor(), HideCursor() +// Keys: IsKeyDown() +static void ProcessCamera(Camera *camera, Vector3 *playerPosition) +{ + // Mouse movement detection + Vector2 mousePosition = GetMousePosition(); + int mouseWheelMove = GetMouseWheelMove(); + int panKey = IsMouseButtonDown(cameraPanControlKey); // bool value + + int screenWidth = GetScreenWidth(); + int screenHeight = GetScreenHeight(); + + if ((cameraMode != CAMERA_FREE) && (cameraMode != CAMERA_ORBITAL)) + { + HideCursor(); + + if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y}); + else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3}); + else if (mousePosition.x > screenWidth - screenHeight/3) SetMousePosition((Vector2) { screenHeight/3, mousePosition.y}); + else if (mousePosition.y > screenHeight - screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3}); + else + { + cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; + cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; + } + } + else + { + ShowCursor(); + + cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; + cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; + } + + // NOTE: We GetMousePosition() again because it can be modified by a previous SetMousePosition() call + // If using directly mousePosition variable we have problems on CAMERA_FIRST_PERSON and CAMERA_THIRD_PERSON + cameraMousePosition = GetMousePosition(); + + // Support for multiple automatic camera modes + switch (cameraMode) + { + case CAMERA_FREE: + { + // Camera zoom + if ((cameraTargetDistance < CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) + { + cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + + if (cameraTargetDistance > CAMERA_FREE_DISTANCE_MAX_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MAX_CLAMP; + } + // Camera looking down + else if ((camera->position.y > camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) + { + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + } + else if ((camera->position.y > camera->target.y) && (camera->target.y >= 0)) + { + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + + // if (camera->target.y < 0) camera->target.y = -0.001; + } + else if ((camera->position.y > camera->target.y) && (camera->target.y < 0) && (mouseWheelMove > 0)) + { + cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; + } + // Camera looking up + else if ((camera->position.y < camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) + { + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + } + else if ((camera->position.y < camera->target.y) && (camera->target.y <= 0)) + { + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + + // if (camera->target.y > 0) camera->target.y = 0.001; + } + else if ((camera->position.y < camera->target.y) && (camera->target.y > 0) && (mouseWheelMove > 0)) + { + cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; + } + + // Inputs + if (IsKeyDown(cameraAltControlKey)) + { + if (IsKeyDown(cameraSmoothZoomControlKey)) + { + // Camera smooth zoom + if (panKey) cameraTargetDistance += (cameraMouseVariation.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); + } + // Camera orientation calculation + else if (panKey) + { + // Camera orientation calculation + // Get the mouse sensitivity + cameraAngle.x += cameraMouseVariation.x*-CAMERA_FREE_MOUSE_SENSITIVITY; + cameraAngle.y += cameraMouseVariation.y*-CAMERA_FREE_MOUSE_SENSITIVITY; + + // Angle clamp + if (cameraAngle.y > CAMERA_FREE_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MIN_CLAMP*DEG2RAD; + else if (cameraAngle.y < CAMERA_FREE_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MAX_CLAMP*DEG2RAD; + } + } + // Paning + else if (panKey) + { + camera->target.x += ((cameraMouseVariation.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.y += ((cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.z += ((cameraMouseVariation.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + } + + // Focus to center + // TODO: Move this function out of this module? + if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; + + // Camera position update + camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; + + if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + + camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; + + } break; + case CAMERA_ORBITAL: + { + cameraAngle.x += CAMERA_ORBITAL_SPEED; + + // Camera zoom + cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + + // Camera distance clamp + if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; + + // Focus to center + if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; + + // Camera position update + camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; + + if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + + camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; + + } break; + case CAMERA_FIRST_PERSON: + case CAMERA_THIRD_PERSON: + { + bool isMoving = false; + + // Keyboard inputs + if (IsKeyDown(cameraMoveControl[MOVE_FRONT])) + { + playerPosition->x -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + playerPosition->z -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + + camera->position.y += sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; + + isMoving = true; + } + else if (IsKeyDown(cameraMoveControl[MOVE_BACK])) + { + playerPosition->x += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + playerPosition->z += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + + camera->position.y -= sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; + + isMoving = true; + } + + if (IsKeyDown(cameraMoveControl[MOVE_LEFT])) + { + playerPosition->x -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + playerPosition->z += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + + isMoving = true; + } + else if (IsKeyDown(cameraMoveControl[MOVE_RIGHT])) + { + playerPosition->x += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + playerPosition->z -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + + isMoving = true; + } + + if (IsKeyDown(cameraMoveControl[MOVE_UP])) + { + playerPosition->y += 1.0f/PLAYER_MOVEMENT_DIVIDER; + } + else if (IsKeyDown(cameraMoveControl[MOVE_DOWN])) + { + playerPosition->y -= 1.0f/PLAYER_MOVEMENT_DIVIDER; + } + + if (cameraMode == CAMERA_THIRD_PERSON) + { + // Camera orientation calculation + cameraAngle.x += cameraMouseVariation.x*-cameraMouseSensitivity; + cameraAngle.y += cameraMouseVariation.y*-cameraMouseSensitivity; + + // Angle clamp + if (cameraAngle.y > CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD; + else if (cameraAngle.y < CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD; + + // Camera zoom + cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + + // Camera distance clamp + if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; + + // Camera is always looking at player + camera->target.x = playerPosition->x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); + camera->target.y = playerPosition->y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; + camera->target.z = playerPosition->z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); + + // Camera position update + camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; + + if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + + camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; + } + else // CAMERA_FIRST_PERSON + { + if (isMoving) cameraMoveCounter++; + + // Camera orientation calculation + cameraAngle.x += (cameraMouseVariation.x*-cameraMouseSensitivity); + cameraAngle.y += (cameraMouseVariation.y*-cameraMouseSensitivity); + + // Angle clamp + if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD; + else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD; + + // Camera is always looking at player + camera->target.x = camera->position.x - sin(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + camera->target.y = camera->position.y + sin(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + camera->target.z = camera->position.z - cos(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + + camera->position.x = playerPosition->x; + camera->position.y = (playerPosition->y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) - sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + camera->position.z = playerPosition->z; + + camera->up.x = sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + camera->up.z = -sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + } + } break; + default: break; + } +} + +#endif // CAMERA_IMPLEMENTATION diff --git a/src/core.c b/src/core.c index 4cb34b0a..2b5329e3 100644 --- a/src/core.c +++ b/src/core.c @@ -48,6 +48,9 @@ #define GESTURES_IMPLEMENTATION #include "gestures.h" // Gestures detection functionality +#define CAMERA_IMPLEMENTATION +#include "camera.h" // Camera system functionality + #include // Standard input / output lib #include // Declares malloc() and free() for memory management, rand(), atexit() #include // Required for typedef unsigned long long int uint64_t, used by hi-res timer -- cgit v1.2.3 From 6e20037f7d72931f52a0bd03abbb45e2e7abf2e8 Mon Sep 17 00:00:00 2001 From: Teodor Stoenescu Date: Fri, 12 Aug 2016 21:42:17 +0300 Subject: Small fix for GenMeshCubicmap() This fix allows GenMeshCubicmap() to create cubic maps having cells of arbitrary sizes. --- src/models.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 7f248aa2..42798483 100644 --- a/src/models.c +++ b/src/models.c @@ -920,8 +920,8 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) Color *cubicmapPixels = GetImageData(cubicmap); - int mapWidth = cubicmap.width*(int)cubeSize.x; - int mapHeight = cubicmap.height*(int)cubeSize.z; + int mapWidth = cubicmap.width; + int mapHeight = cubicmap.height; // NOTE: Max possible number of triangles numCubes * (12 triangles by cube) int maxTriangles = cubicmap.width*cubicmap.height*12; @@ -961,19 +961,19 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) RectangleF topTexUV = { 0.0f, 0.5f, 0.5f, 0.5f }; RectangleF bottomTexUV = { 0.5f, 0.5f, 0.5f, 0.5f }; - for (int z = 0; z < mapHeight; z += cubeSize.z) + for (int z = 0; z < mapHeight; ++z) { - for (int x = 0; x < mapWidth; x += cubeSize.x) + for (int x = 0; x < mapWidth; ++x) { // Define the 8 vertex of the cube, we will combine them accordingly later... - Vector3 v1 = { x - w/2, h2, z - h/2 }; - Vector3 v2 = { x - w/2, h2, z + h/2 }; - Vector3 v3 = { x + w/2, h2, z + h/2 }; - Vector3 v4 = { x + w/2, h2, z - h/2 }; - Vector3 v5 = { x + w/2, 0, z - h/2 }; - Vector3 v6 = { x - w/2, 0, z - h/2 }; - Vector3 v7 = { x - w/2, 0, z + h/2 }; - Vector3 v8 = { x + w/2, 0, z + h/2 }; + Vector3 v1 = { w * (x - .5f), h2, h * (z - .5f) }; + Vector3 v2 = { w * (x - .5f), h2, h * (z + .5f) }; + Vector3 v3 = { w * (x + .5f), h2, h * (z + .5f) }; + Vector3 v4 = { w * (x + .5f), h2, h * (z - .5f) }; + Vector3 v5 = { w * (x + .5f), 0, h * (z - .5f) }; + Vector3 v6 = { w * (x - .5f), 0, h * (z - .5f) }; + Vector3 v7 = { w * (x - .5f), 0, h * (z + .5f) }; + Vector3 v8 = { w * (x + .5f), 0, h * (z + .5f) }; // We check pixel color to be WHITE, we will full cubes if ((cubicmapPixels[z*cubicmap.width + x].r == 255) && -- cgit v1.2.3 From 3377a4485b309ef52092cdf4da608313b266d919 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 13 Aug 2016 11:31:15 +0200 Subject: Support shared/dynamic raylib compilation Generates: Win32: raylib.dll, libraylibdll.a (import library) Linux: libraylib.so --- src/Makefile | 35 ++-- src/raylib.h | 574 ++++++++++++++++++++++++++++++----------------------------- 2 files changed, 312 insertions(+), 297 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index b4eccdb2..75812566 100644 --- a/src/Makefile +++ b/src/Makefile @@ -35,7 +35,7 @@ # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP -# define if you want shared or static version of library. +# define YES if you want shared/dynamic version of library instead of static (default) SHARED ?= NO # determine if the file has root access (only for installing raylib) @@ -95,8 +95,11 @@ endif # -Wno-missing-braces ignore invalid warning (GCC bug 53119) CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces +# if shared library required, make sure code is compiled as position independent ifeq ($(SHARED),YES) CFLAGS += -fPIC + SHAREDFLAG = BUILDING_DLL + SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lopenal32 -lgdi32 endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes @@ -152,12 +155,16 @@ ifeq ($(PLATFORM),PLATFORM_WEB) @echo "libraylib.bc generated (web version)!" else ifeq ($(SHARED),YES) - ifeq ($(PLATFORM_OS),LINUX) - # compile raylib to shared library version for GNU/Linux. - # WARNING: you should type "make clean" before doing this target - $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) - @echo "libraylib.so generated (shared library)!" - endif + ifeq ($(PLATFORM_OS),LINUX) + # compile raylib to shared library version for GNU/Linux. + # WARNING: you should type "make clean" before doing this target + $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) + @echo "raylib shared library (libraylib.so) generated!" + endif + ifeq ($(PLATFORM_OS),WINDOWS) + $(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a + @echo "raylib dynamic library (raylib.dll) and MSVC required import library (libraylibdll.a) generated!" + endif else # compile raylib static library for desktop platforms. ar rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) @@ -169,7 +176,7 @@ endif # compile core module core.o : core.c raylib.h rlgl.h utils.h raymath.h gestures.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) # compile rlgl module rlgl.o : rlgl.c rlgl.h raymath.h @@ -177,23 +184,23 @@ rlgl.o : rlgl.c rlgl.h raymath.h # compile shapes module shapes.o : shapes.c raylib.h rlgl.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(SHAREDFLAG) # compile textures module textures.o : textures.c rlgl.h utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS) -D$(SHAREDFLAG) # compile text module text.o : text.c raylib.h utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(SHAREDFLAG) # compile models module models.o : models.c raylib.h rlgl.h raymath.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) # compile audio module audio.o : audio.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) # compile stb_vorbis library external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h @@ -201,7 +208,7 @@ external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h # compile utils module utils.o : utils.c utils.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) # It installs generated and needed files to compile projects using raylib. # The installation works manually. diff --git a/src/raylib.h b/src/raylib.h index 1673578d..c2e65b68 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -81,6 +81,14 @@ typedef struct android_app; // Define android_app struct (android_native_app_glue.h) #endif +#if defined(_WIN32) && defined(BUILDING_DLL) + #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 DLL +#elif defined(_WIN32) && defined(RAYLIB_DLL) + #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 DLL +#else + #define RLAPI // We are building or using raylib as a static library (or Linux shared library) +#endif + //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- @@ -576,94 +584,94 @@ extern "C" { // Prevents name mangling of functions // Window and Graphics Device Functions (Module: core) //------------------------------------------------------------------------------------ #if defined(PLATFORM_ANDROID) -void InitWindow(int width, int height, struct android_app *state); // Init Android Activity and OpenGL Graphics +RLAPI void InitWindow(int width, int height, struct android_app *state); // Init Android Activity and OpenGL Graphics #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) -void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics +RLAPI void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics #endif -void CloseWindow(void); // Close Window and Terminate Context -bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed -bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) -void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP) -int GetScreenWidth(void); // Get current screen width -int GetScreenHeight(void); // Get current screen height - -void ShowCursor(void); // Shows cursor -void HideCursor(void); // Hides cursor -bool IsCursorHidden(void); // Returns true if cursor is not visible -void EnableCursor(void); // Enables cursor -void DisableCursor(void); // Disables cursor - -void ClearBackground(Color color); // Sets Background Color -void BeginDrawing(void); // Setup drawing canvas to start drawing -void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) - -void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera -void End2dMode(void); // Ends 2D mode custom camera usage -void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) -void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode -void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing -void EndTextureMode(void); // Ends drawing to render texture - -Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position -Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position -Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) - -void SetTargetFPS(int fps); // Set target FPS (maximum) -float GetFPS(void); // Returns current FPS -float GetFrameTime(void); // Returns time in seconds for one frame - -Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -int GetHexValue(Color color); // Returns hexadecimal value for a Color -float *ColorToFloat(Color color); // Converts Color to float array and normalizes -float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array -float *MatrixToFloat(Matrix mat); // Converts Matrix to float array - -int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) -Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f - -void SetConfigFlags(char flags); // Setup some window configuration flags -void ShowLogo(void); // Activates raylib logo at startup (can be done with flags) - -bool IsFileDropped(void); // Check if a file have been dropped into window -char **GetDroppedFiles(int *count); // Retrieve dropped files into window -void ClearDroppedFiles(void); // Clear dropped files paths buffer - -void StorageSaveValue(int position, int value); // Storage save integer value (to defined position) -int StorageLoadValue(int position); // Storage load integer value (from defined position) +RLAPI void CloseWindow(void); // Close Window and Terminate Context +RLAPI bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed +RLAPI bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) +RLAPI void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP) +RLAPI int GetScreenWidth(void); // Get current screen width +RLAPI int GetScreenHeight(void); // Get current screen height + +RLAPI void ShowCursor(void); // Shows cursor +RLAPI void HideCursor(void); // Hides cursor +RLAPI bool IsCursorHidden(void); // Returns true if cursor is not visible +RLAPI void EnableCursor(void); // Enables cursor +RLAPI void DisableCursor(void); // Disables cursor + +RLAPI void ClearBackground(Color color); // Sets Background Color +RLAPI void BeginDrawing(void); // Setup drawing canvas to start drawing +RLAPI void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) + +RLAPI void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera +RLAPI void End2dMode(void); // Ends 2D mode custom camera usage +RLAPI void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) +RLAPI void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode +RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing +RLAPI void EndTextureMode(void); // Ends drawing to render texture + +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position +RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) + +RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) +RLAPI float GetFPS(void); // Returns current FPS +RLAPI float GetFrameTime(void); // Returns time in seconds for one frame + +RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value +RLAPI int GetHexValue(Color color); // Returns hexadecimal value for a Color +RLAPI float *ColorToFloat(Color color); // Converts Color to float array and normalizes +RLAPI float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array +RLAPI float *MatrixToFloat(Matrix mat); // Converts Matrix to float array + +RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) +RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f + +RLAPI void SetConfigFlags(char flags); // Setup some window configuration flags +RLAPI void ShowLogo(void); // Activates raylib logo at startup (can be done with flags) + +RLAPI bool IsFileDropped(void); // Check if a file have been dropped into window +RLAPI char **GetDroppedFiles(int *count); // Retrieve dropped files into window +RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer + +RLAPI void StorageSaveValue(int position, int value); // Storage save integer value (to defined position) +RLAPI int StorageLoadValue(int position); // Storage load integer value (from defined position) //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) -bool IsKeyPressed(int key); // Detect if a key has been pressed once -bool IsKeyDown(int key); // Detect if a key is being pressed -bool IsKeyReleased(int key); // Detect if a key has been released once -bool IsKeyUp(int key); // Detect if a key is NOT being pressed -int GetKeyPressed(void); // Get latest key pressed -void SetExitKey(int key); // Set a custom key to exit program (default is ESC) - -bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available -float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis -bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once -bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed -bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once -bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed +RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once +RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed +RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once +RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed +RLAPI int GetKeyPressed(void); // Get latest key pressed +RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) + +RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed #endif -bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once -bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed -bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once -bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed -int GetMouseX(void); // Returns mouse position X -int GetMouseY(void); // Returns mouse position Y -Vector2 GetMousePosition(void); // Returns mouse position XY -void SetMousePosition(Vector2 position); // Set mouse position XY -int GetMouseWheelMove(void); // Returns mouse wheel movement Y +RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed +RLAPI int GetMouseX(void); // Returns mouse position X +RLAPI int GetMouseY(void); // Returns mouse position Y +RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY +RLAPI void SetMousePosition(Vector2 position); // Set mouse position XY +RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y -int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) -int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) -Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) +RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) +RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) +RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) #if defined(PLATFORM_ANDROID) bool IsButtonPressed(int button); // Detect if an android physic button has been pressed @@ -674,264 +682,264 @@ bool IsButtonReleased(int button); // Detect if an android //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ -void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags -bool IsGestureDetected(int gesture); // Check if a gesture have been detected -int GetGestureDetected(void); // Get latest detected gesture -int GetTouchPointsCount(void); // Get touch points count -float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds -Vector2 GetGestureDragVector(void); // Get gesture drag vector -float GetGestureDragAngle(void); // Get gesture drag angle -Vector2 GetGesturePinchVector(void); // Get gesture pinch delta -float GetGesturePinchAngle(void); // Get gesture pinch angle +RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI int GetTouchPointsCount(void); // Get touch points count +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle //------------------------------------------------------------------------------------ // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ -void SetCameraMode(int mode); // Set camera mode (multiple camera modes available) -void UpdateCamera(Camera *camera); // Update camera (player position is ignored) -void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and player position (1st person and 3rd person cameras) +RLAPI void SetCameraMode(int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera (player position is ignored) +RLAPI void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and player position (1st person and 3rd person cameras) -void SetCameraPosition(Vector3 position); // Set internal camera position -void SetCameraTarget(Vector3 target); // Set internal camera target -void SetCameraFovy(float fovy); // Set internal camera field-of-view-y +RLAPI void SetCameraPosition(Vector3 position); // Set internal camera position +RLAPI void SetCameraTarget(Vector3 target); // Set internal camera target +RLAPI void SetCameraFovy(float fovy); // Set internal camera field-of-view-y -void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) -void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) -void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraMoveControls(int frontKey, int backKey, +RLAPI void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, - int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) -void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) + int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) +RLAPI void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) //------------------------------------------------------------------------------------ -void DrawPixel(int posX, int posY, Color color); // Draw a pixel -void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) -void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line -void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) -void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle -void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle -void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) -void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline -void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle -void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle -void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle -void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) -void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline -void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle -void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline -void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) -void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points -void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines - -bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles -bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles -bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle -Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision -bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle -bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line +RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) +RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) +RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle +RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle +RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline +RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) +RLAPI void DrawPolyEx(Vector2 *points, int numPoints, Color color); // Draw a closed polygon defined by points +RLAPI void DrawPolyExLines(Vector2 *points, int numPoints, Color color); // Draw polygon lines + +RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles +RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles +RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision +RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle +RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle //------------------------------------------------------------------------------------ // Texture Loading and Drawing Functions (Module: textures) //------------------------------------------------------------------------------------ -Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM) -Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit) -Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file -Image LoadImageFromRES(const char *rresName, int resId); // Load an image from rRES file (raylib Resource) -Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory -Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); // Load a texture from raw data into GPU memory -Texture2D LoadTextureFromRES(const char *rresName, int resId); // Load an image as texture from rRES file (raylib Resource) -Texture2D LoadTextureFromImage(Image image); // Load a texture from image data -RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering -void UnloadImage(Image image); // Unload image from CPU memory (RAM) -void UnloadTexture(Texture2D texture); // Unload texture from GPU memory -void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory -Color *GetImageData(Image image); // Get pixel data from image as a Color struct array -Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image -void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) -void ImageFormat(Image *image, int newFormat); // Convert image data to desired format -void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) -void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle -void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) -void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) -Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) -Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image -void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) -void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) -void ImageFlipVertical(Image *image); // Flip image vertically -void ImageFlipHorizontal(Image *image); // Flip image horizontally -void ImageColorTint(Image *image, Color color); // Modify image color: tint -void ImageColorInvert(Image *image); // Modify image color: invert -void ImageColorGrayscale(Image *image); // Modify image color: grayscale -void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) -void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture -void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data - -void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D -void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters -void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle -void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM) +RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit) +RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file +RLAPI Image LoadImageFromRES(const char *rresName, int resId); // Load an image from rRES file (raylib Resource) +RLAPI Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory +RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); // Load a texture from raw data into GPU memory +RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId); // Load an image as texture from rRES file (raylib Resource) +RLAPI Texture2D LoadTextureFromImage(Image image); // Load a texture from image data +RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering +RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) +RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory +RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory +RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array +RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image +RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) +RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering) +RLAPI void ImageResizeNN(Image *image,int newWidth,int newHeight); // Resize and image (Nearest-Neighbor scaling algorithm) +RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image +RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) +RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) +RLAPI void ImageFlipVertical(Image *image); // Flip image vertically +RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint +RLAPI void ImageColorInvert(Image *image); // Modify image color: invert +RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale +RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +RLAPI void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture +RLAPI void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data + +RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D +RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, // Draw a part of a texture defined by a rectangle with 'pro' parameters float rotation, Color tint); //------------------------------------------------------------------------------------ // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ -SpriteFont GetDefaultFont(void); // Get the default SpriteFont -SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory -void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory +RLAPI SpriteFont GetDefaultFont(void); // Get the default SpriteFont +RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory +RLAPI void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory -void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) -void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters +RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters float fontSize, int spacing, Color tint); -int MeasureText(const char *text, int fontSize); // Measure string width for default font -Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont +RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font +RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont -void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner -const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' -const char *SubText(const char *text, int position, int length); // Get a piece of a text string +RLAPI void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner +RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' +RLAPI const char *SubText(const char *text, int position, int length); // Get a piece of a text string //------------------------------------------------------------------------------------ // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ -void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space -void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube -void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires -void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float lenght, Color color); // Draw cube textured -void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere -void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters -void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone -void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires -void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ -void DrawRay(Ray ray, Color color); // Draw a ray line -void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) -void DrawGizmo(Vector3 position); // Draw simple gizmo -void DrawLight(Light light); // Draw light in 3D world +RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +RLAPI void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space +RLAPI void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube +RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) +RLAPI void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires +RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float lenght, Color color); // Draw cube textured +RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires +RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ +RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line +RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) +RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo +RLAPI void DrawLight(Light light); // Draw light in 3D world //DrawTorus(), DrawTeapot() are useless... //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ -Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) -Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) -Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) -Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model -Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) -void UnloadModel(Model model); // Unload 3d model from memory - -Mesh GenMeshCube(float width, float height, float depth); // Generate mesh: cube - -Material LoadMaterial(const char *fileName); // Load material data (from file) -Material LoadDefaultMaterial(void); // Load default material (uses default models shader) -Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) -void UnloadMaterial(Material material); // Unload material textures from VRAM - -void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters -void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) - -void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture -void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec - -BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits -bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres -bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes -bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere -bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere -bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection -bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap +RLAPI Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) +RLAPI Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) +RLAPI Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) +RLAPI Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model +RLAPI Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) +RLAPI void UnloadModel(Model model); // Unload 3d model from memory + +RLAPI Mesh GenMeshCube(float width, float height, float depth); // Generate mesh: cube + +RLAPI Material LoadMaterial(const char *fileName); // Load material data (from file) +RLAPI Material LoadDefaultMaterial(void); // Load default material (uses default models shader) +RLAPI Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) +RLAPI void UnloadMaterial(Material material); // Unload material textures from VRAM + +RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) + +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec + +RLAPI BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits +RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere +RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere +RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection +RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box +RLAPI Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap // NOTE: Return the normal vector of the impacted surface //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations -void UnloadShader(Shader shader); // Unload a custom shader from memory +RLAPI Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations +RLAPI void UnloadShader(Shader shader); // Unload a custom shader from memory -Shader GetDefaultShader(void); // Get default shader -Shader GetStandardShader(void); // Get standard shader -Texture2D GetDefaultTexture(void); // Get default texture +RLAPI Shader GetDefaultShader(void); // Get default shader +RLAPI Shader GetStandardShader(void); // Get standard shader +RLAPI Texture2D GetDefaultTexture(void); // Get default texture -int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location -void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) -void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) -void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float) +RLAPI void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int) +RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) -void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) -void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) +RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) +RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) -void BeginShaderMode(Shader shader); // Begin custom shader drawing -void EndShaderMode(void); // End custom shader drawing (use default shader) -void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) -void EndBlendMode(void); // End blending mode (reset to default: alpha blending) +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool -void DestroyLight(Light light); // Destroy a light and take it out of the list +RLAPI Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool +RLAPI void DestroyLight(Light light); // Destroy a light and take it out of the list //------------------------------------------------------------------------------------ // VR experience Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -void InitVrDevice(int vdDevice); // Init VR device -void CloseVrDevice(void); // Close VR device -bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready -void UpdateVrTracking(void); // Update VR tracking (position and orientation) -void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) +RLAPI void InitVrDevice(int vdDevice); // Init VR device +RLAPI void CloseVrDevice(void); // Close VR device +RLAPI bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +RLAPI void UpdateVrTracking(void); // Update VR tracking (position and orientation) +RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) //------------------------------------------------------------------------------------ // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ -void InitAudioDevice(void); // Initialize audio device and context -void CloseAudioDevice(void); // Close the audio device and context (and music stream) -bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully - -Sound LoadSound(char *fileName); // Load sound to memory -Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) -void UnloadSound(Sound sound); // Unload sound -void PlaySound(Sound sound); // Play a sound -void PauseSound(Sound sound); // Pause a sound -void ResumeSound(Sound sound); // Resume a paused sound -void StopSound(Sound sound); // Stop playing a sound -bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing -void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) -void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) - -Music LoadMusicStream(char *fileName); // Load music stream from file -void UnloadMusicStream(Music music); // Unload music stream -void PlayMusicStream(Music music); // Start music playing (open stream) -void UpdateMusicStream(Music music); // Updates buffers for music streaming -void StopMusicStream(Music music); // Stop music playing (close stream) -void PauseMusicStream(Music music); // Pause music playing -void ResumeMusicStream(Music music); // Resume playing paused music -bool IsMusicPlaying(Music music); // Check if music is playing -void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) -void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) -float GetMusicTimeLength(Music music); // Get music time length (in seconds) -float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) - -AudioStream InitAudioStream(unsigned int sampleRate, - unsigned int sampleSize, - unsigned int channels); // Init audio stream (to stream audio pcm data) -void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data -void CloseAudioStream(AudioStream stream); // Close audio stream and free memory -bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill -void PlayAudioStream(AudioStream stream); // Play audio stream -void PauseAudioStream(AudioStream stream); // Pause audio stream -void ResumeAudioStream(AudioStream stream); // Resume audio stream -void StopAudioStream(AudioStream stream); // Stop audio stream +RLAPI void InitAudioDevice(void); // Initialize audio device and context +RLAPI void CloseAudioDevice(void); // Close the audio device and context (and music stream) +RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully + +RLAPI Sound LoadSound(char *fileName); // Load sound to memory +RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data +RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) +RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI void PlaySound(Sound sound); // Play a sound +RLAPI void PauseSound(Sound sound); // Pause a sound +RLAPI void ResumeSound(Sound sound); // Resume a paused sound +RLAPI void StopSound(Sound sound); // Stop playing a sound +RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) +RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) + +RLAPI Music LoadMusicStream(char *fileName); // Load music stream from file +RLAPI void UnloadMusicStream(Music music); // Unload music stream +RLAPI void PlayMusicStream(Music music); // Start music playing (open stream) +RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming +RLAPI void StopMusicStream(Music music); // Stop music playing (close stream) +RLAPI void PauseMusicStream(Music music); // Pause music playing +RLAPI void ResumeMusicStream(Music music); // Resume playing paused music +RLAPI bool IsMusicPlaying(Music music); // Check if music is playing +RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) +RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) + +RLAPI AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, + unsigned int channels); // Init audio stream (to stream audio pcm data) +RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream +RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream +RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream +RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream #ifdef __cplusplus } -- cgit v1.2.3 From 1ffc4c7825ab732328040d2d650c6bf6d0e2f24c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 15 Aug 2016 16:34:10 +0200 Subject: Corrected naming bug --- src/camera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/camera.h b/src/camera.h index f5bb867d..72a0e706 100644 --- a/src/camera.h +++ b/src/camera.h @@ -348,7 +348,7 @@ void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, } // Set camera mouse sensitivity (1st person and 3rd person cameras) -void SetCameracameraMouseSensitivity(float sensitivity) +void SetCameraMouseSensitivity(float sensitivity) { cameraMouseSensitivity = (sensitivity/10000.0f); } -- cgit v1.2.3 From 852813bdf19445a80fa8de9daef052f9f1b72c74 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 15 Aug 2016 16:34:21 +0200 Subject: Reviewed formatting --- src/models.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 42798483..24238ed2 100644 --- a/src/models.c +++ b/src/models.c @@ -966,14 +966,14 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) for (int x = 0; x < mapWidth; ++x) { // Define the 8 vertex of the cube, we will combine them accordingly later... - Vector3 v1 = { w * (x - .5f), h2, h * (z - .5f) }; - Vector3 v2 = { w * (x - .5f), h2, h * (z + .5f) }; - Vector3 v3 = { w * (x + .5f), h2, h * (z + .5f) }; - Vector3 v4 = { w * (x + .5f), h2, h * (z - .5f) }; - Vector3 v5 = { w * (x + .5f), 0, h * (z - .5f) }; - Vector3 v6 = { w * (x - .5f), 0, h * (z - .5f) }; - Vector3 v7 = { w * (x - .5f), 0, h * (z + .5f) }; - Vector3 v8 = { w * (x + .5f), 0, h * (z + .5f) }; + Vector3 v1 = { w*(x - 0.5f), h2, h*(z - 0.5f) }; + Vector3 v2 = { w*(x - 0.5f), h2, h*(z + 0.5f) }; + Vector3 v3 = { w*(x + 0.5f), h2, h*(z + 0.5f) }; + Vector3 v4 = { w*(x + 0.5f), h2, h*(z - 0.5f) }; + Vector3 v5 = { w*(x + 0.5f), 0, h*(z - 0.5f) }; + Vector3 v6 = { w*(x - 0.5f), 0, h*(z - 0.5f) }; + Vector3 v7 = { w*(x - 0.5f), 0, h*(z + 0.5f) }; + Vector3 v8 = { w*(x + 0.5f), 0, h*(z + 0.5f) }; // We check pixel color to be WHITE, we will full cubes if ((cubicmapPixels[z*cubicmap.width + x].r == 255) && -- cgit v1.2.3 From 342b89c5b920ceec8cd41a8f4cf5ab69f2d825f6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 15 Aug 2016 16:35:11 +0200 Subject: Review Wave struct --- src/audio.c | 62 +++++++++++++++++++++++++++++++----------------------------- src/audio.h | 8 ++++---- src/raylib.h | 8 ++++---- 3 files changed, 40 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 4b8641ab..683ee66b 100644 --- a/src/audio.c +++ b/src/audio.c @@ -233,18 +233,30 @@ Sound LoadSoundFromWave(Wave wave) if (wave.data != NULL) { ALenum format = 0; - // The OpenAL format is worked out by looking at the number of channels and the bits per sample + + // The OpenAL format is worked out by looking at the number of channels and the sample size (bits per sample) if (wave.channels == 1) { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_MONO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_MONO16; + switch (wave.sampleSize) + { + case 8: format = AL_FORMAT_MONO8; break; + case 16: format = AL_FORMAT_MONO16; break; + case 32: format = AL_FORMAT_MONO_FLOAT32; break; + default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; + } } else if (wave.channels == 2) { - if (wave.bitsPerSample == 8 ) format = AL_FORMAT_STEREO8; - else if (wave.bitsPerSample == 16) format = AL_FORMAT_STEREO16; + switch (wave.sampleSize) + { + case 8: format = AL_FORMAT_STEREO8; break; + case 16: format = AL_FORMAT_STEREO16; break; + case 32: format = AL_FORMAT_STEREO_FLOAT32; break; + default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; + } } - + else TraceLog(WARNING, "Wave number of channels not supported: %i", wave.channels); + // Create an audio source ALuint source; alGenSources(1, &source); // Generate pointer to audio source @@ -259,14 +271,16 @@ Sound LoadSoundFromWave(Wave wave) //---------------------------------------- ALuint buffer; alGenBuffers(1, &buffer); // Generate pointer to buffer + + unsigned int dataSize = wave.sampleCount*wave.sampleSize/8; // Size in bytes // Upload sound data to buffer - alBufferData(buffer, format, wave.data, wave.dataSize, wave.sampleRate); + alBufferData(buffer, format, wave.data, dataSize, wave.sampleRate); // Attach sound buffer to source alSourcei(source, AL_BUFFER, buffer); - TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound data loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound data loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.sampleSize, wave.channels); sound.source = source; sound.buffer = buffer; @@ -341,8 +355,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) fread(&reserved, 1, 1, rresFile); // wave.sampleRate = sampleRate; - wave.dataSize = infoHeader.srcSize; - wave.bitsPerSample = bps; + wave.sampleSize = bps; wave.channels = (short)channels; unsigned char *data = malloc(infoHeader.size); @@ -948,18 +961,18 @@ static Wave LoadWAV(const char *fileName) else { // Allocate memory for data - wave.data = (unsigned char *)malloc(sizeof(unsigned char) * waveData.subChunkSize); + wave.data = (unsigned char *)malloc(sizeof(unsigned char)*waveData.subChunkSize); // Read in the sound data into the soundData variable fread(wave.data, waveData.subChunkSize, 1, wavFile); // Now we set the variables that we need later - wave.dataSize = waveData.subChunkSize; + wave.sampleCount = waveData.subChunkSize; wave.sampleRate = waveFormat.sampleRate; + wave.sampleSize = waveFormat.bitsPerSample; wave.channels = waveFormat.numChannels; - wave.bitsPerSample = waveFormat.bitsPerSample; - TraceLog(INFO, "[%s] WAV file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", fileName, wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[%s] WAV file loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", fileName, wave.sampleRate, wave.sampleSize, wave.channels); } } } @@ -988,35 +1001,24 @@ static Wave LoadOGG(char *fileName) stb_vorbis_info info = stb_vorbis_get_info(oggFile); wave.sampleRate = info.sample_rate; - wave.bitsPerSample = 16; + wave.sampleSize = 16; // 16 bit per sample (short) wave.channels = info.channels; - TraceLog(DEBUG, "[%s] Ogg sample rate: %i", fileName, info.sample_rate); - TraceLog(DEBUG, "[%s] Ogg channels: %i", fileName, info.channels); - int totalSamplesLength = (stb_vorbis_stream_length_in_samples(oggFile)*info.channels); - - wave.dataSize = totalSamplesLength*sizeof(short); // Size must be in bytes - - TraceLog(DEBUG, "[%s] Samples length: %i", fileName, totalSamplesLength); - float totalSeconds = stb_vorbis_stream_length_in_seconds(oggFile); - TraceLog(DEBUG, "[%s] Total seconds: %f", fileName, totalSeconds); - if (totalSeconds > 10) TraceLog(WARNING, "[%s] Ogg audio lenght is larger than 10 seconds (%f), that's a big file in memory, consider music streaming", fileName, totalSeconds); int totalSamples = totalSeconds*info.sample_rate*info.channels; + wave.sampleCount = totalSamples; - TraceLog(DEBUG, "[%s] Total samples calculated: %i", fileName, totalSamples); - - wave.data = malloc(sizeof(short)*totalSamplesLength); + wave.data = (short *)malloc(totalSamplesLength*sizeof(short)); - int samplesObtained = stb_vorbis_get_samples_short_interleaved(oggFile, info.channels, wave.data, totalSamplesLength); + int samplesObtained = stb_vorbis_get_samples_short_interleaved(oggFile, info.channels, (short *)wave.data, totalSamplesLength); TraceLog(DEBUG, "[%s] Samples obtained: %i", fileName, samplesObtained); - TraceLog(INFO, "[%s] OGG file loaded successfully (SampleRate: %i, BitRate: %i, Channels: %i)", fileName, wave.sampleRate, wave.bitsPerSample, wave.channels); + TraceLog(INFO, "[%s] OGG file loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", fileName, wave.sampleRate, wave.sampleSize, wave.channels); stb_vorbis_close(oggFile); } diff --git a/src/audio.h b/src/audio.h index dbd88939..4ee9559e 100644 --- a/src/audio.h +++ b/src/audio.h @@ -68,11 +68,11 @@ typedef struct Sound { // Wave type, defines audio wave data typedef struct Wave { + unsigned int sampleCount; // Number of samples + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) void *data; // Buffer data pointer - unsigned int dataSize; // Data size in bytes - unsigned int sampleRate; // Samples per second to be played - short bitsPerSample; // Sample size in bits - short channels; } Wave; // Music type (file streaming from memory) diff --git a/src/raylib.h b/src/raylib.h index c2e65b68..22494aec 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -490,11 +490,11 @@ typedef struct Sound { // Wave type, defines audio wave data typedef struct Wave { + unsigned int sampleCount; // Number of samples + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) void *data; // Buffer data pointer - unsigned int dataSize; // Data size in bytes - unsigned int sampleRate; // Samples per second to be played - short bitsPerSample; // Sample size in bits - short channels; } Wave; // Music type (file streaming from memory) -- cgit v1.2.3 From 959a228815edcecdde692fcd47a7b540844c5712 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 16 Aug 2016 11:09:55 +0200 Subject: Removed useless spacing --- src/audio.c | 74 +++++------ src/core.c | 342 ++++++++++++++++++++++++------------------------- src/models.c | 134 +++++++++---------- src/raylib.h | 4 +- src/rlgl.h | 26 ++-- src/rlua.h | 72 +++++------ src/text.c | 146 ++++++++++----------- src/textures.c | 398 ++++++++++++++++++++++++++++----------------------------- 8 files changed, 598 insertions(+), 598 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 683ee66b..1772196f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -183,7 +183,7 @@ void CloseAudioDevice(void) alcMakeContextCurrent(NULL); alcDestroyContext(context); alcCloseDevice(device); - + TraceLog(INFO, "Audio device closed successfully"); } @@ -217,7 +217,7 @@ Sound LoadSound(char *fileName) else TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); Sound sound = LoadSoundFromWave(wave); - + // Sound is loaded, we can unload wave UnloadWave(wave); @@ -233,7 +233,7 @@ Sound LoadSoundFromWave(Wave wave) if (wave.data != NULL) { ALenum format = 0; - + // The OpenAL format is worked out by looking at the number of channels and the sample size (bits per sample) if (wave.channels == 1) { @@ -256,7 +256,7 @@ Sound LoadSoundFromWave(Wave wave) } } else TraceLog(WARNING, "Wave number of channels not supported: %i", wave.channels); - + // Create an audio source ALuint source; alGenSources(1, &source); // Generate pointer to audio source @@ -271,7 +271,7 @@ Sound LoadSoundFromWave(Wave wave) //---------------------------------------- ALuint buffer; alGenBuffers(1, &buffer); // Generate pointer to buffer - + unsigned int dataSize = wave.sampleCount*wave.sampleSize/8; // Size in bytes // Upload sound data to buffer @@ -367,7 +367,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) free(data); sound = LoadSoundFromWave(wave); - + // Sound is loaded, we can unload wave data UnloadWave(wave); } @@ -506,13 +506,13 @@ Music LoadMusicStream(char *fileName) TraceLog(DEBUG, "[%s] OGG sample rate: %i", fileName, info.sample_rate); TraceLog(DEBUG, "[%s] OGG channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] OGG memory required: %i", fileName, info.temp_memory_required); - + } } else if (strcmp(GetExtension(fileName), "xm") == 0) { int result = jar_xm_create_context_from_file(&music->ctxXm, 48000, fileName); - + if (!result) // XM context created successfully { jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops @@ -523,7 +523,7 @@ Music LoadMusicStream(char *fileName) music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_MODULE_XM; music->loop = true; - + TraceLog(DEBUG, "[%s] XM number of samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] XM track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); } @@ -555,11 +555,11 @@ Music LoadMusicStream(char *fileName) void UnloadMusicStream(Music music) { CloseAudioStream(music->stream); - + if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close(music->ctxOgg); else if (music->ctxType == MUSIC_MODULE_XM) jar_xm_free_context(music->ctxXm); else if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_unload(&music->ctxMod); - + free(music); } @@ -597,58 +597,58 @@ void UpdateMusicStream(Music music) // Determine if music stream is ready to be written alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - + int numBuffersToProcess = processed; - + if (processed > 0) { bool active = true; short pcm[AUDIO_BUFFER_SIZE]; float pcmf[AUDIO_BUFFER_SIZE]; - - int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, + + int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, // individual L or R for ogg shorts for (int i = 0; i < numBuffersToProcess; i++) { switch (music->ctxType) { - case MUSIC_AUDIO_OGG: + case MUSIC_AUDIO_OGG: { if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; else numSamples = music->samplesLeft; - + // NOTE: Returns the number of samples to process (should be the same as numSamples -> it is) int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, numSamples); // TODO: Review stereo channels Ogg, not enough samples served! UpdateAudioStream(music->stream, pcm, numSamplesOgg*music->stream.channels); music->samplesLeft -= (numSamplesOgg*music->stream.channels); - + } break; - case MUSIC_MODULE_XM: + case MUSIC_MODULE_XM: { if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; else numSamples = music->samplesLeft; - + // NOTE: Output buffer is 2*numsamples elements (left and right value for each sample) jar_xm_generate_samples(music->ctxXm, pcmf, numSamples); UpdateAudioStream(music->stream, pcmf, numSamples*2); // Using 32bit PCM data music->samplesLeft -= numSamples; - + //TraceLog(INFO, "Samples left: %i", music->samplesLeft); - + } break; - case MUSIC_MODULE_MOD: + case MUSIC_MODULE_MOD: { if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; else numSamples = music->samplesLeft; - + // NOTE: Output buffer size is nbsample*channels (default: 48000Hz, 16bit, Stereo) - jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); + jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); UpdateAudioStream(music->stream, pcm, numSamples*2); music->samplesLeft -= numSamples; - + } break; default: break; } @@ -659,15 +659,15 @@ void UpdateMusicStream(Music music) break; } } - + // Reset audio stream for looping if (!active && music->loop) { // Restart music context (if required) - //if (music->ctxType == MUSIC_MODULE_XM) + //if (music->ctxType == MUSIC_MODULE_XM) if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_seek_start(&music->ctxMod); else if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_seek_start(music->ctxOgg); - + // Reset samples left to total samples music->samplesLeft = music->totalSamples; } @@ -713,7 +713,7 @@ void SetMusicPitch(Music music, float pitch) float GetMusicTimeLength(Music music) { float totalSeconds = (float)music->totalSamples/music->stream.sampleRate; - + return totalSeconds; } @@ -732,7 +732,7 @@ float GetMusicTimePlayed(Music music) AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels) { AudioStream stream = { 0 }; - + stream.sampleRate = sampleRate; stream.sampleSize = sampleSize; stream.channels = channels; @@ -791,7 +791,7 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un } alSourceQueueBuffers(stream.source, MAX_STREAM_BUFFERS, stream.buffers); - + TraceLog(INFO, "[AUD ID %i] Audio stream loaded successfully", stream.source); return stream; @@ -806,9 +806,9 @@ void CloseAudioStream(AudioStream stream) // Flush out all queued buffers int queued = 0; alGetSourcei(stream.source, AL_BUFFERS_QUEUED, &queued); - + ALuint buffer = 0; - + while (queued > 0) { alSourceUnqueueBuffers(stream.source, 1, &buffer); @@ -818,7 +818,7 @@ void CloseAudioStream(AudioStream stream) // Delete source and buffers alDeleteSources(1, &stream.source); alDeleteBuffers(MAX_STREAM_BUFFERS, stream.buffers); - + TraceLog(INFO, "[AUD ID %i] Unloaded audio stream data", stream.source); } @@ -828,14 +828,14 @@ void UpdateAudioStream(AudioStream stream, void *data, int numSamples) { ALuint buffer = 0; alSourceUnqueueBuffers(stream.source, 1, &buffer); - + // Check if any buffer was available for unqueue if (alGetError() != AL_INVALID_VALUE) { if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numSamples*sizeof(unsigned char), stream.sampleRate); else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numSamples*sizeof(short), stream.sampleRate); else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numSamples*sizeof(float), stream.sampleRate); - + alSourceQueueBuffers(stream.source, 1, &buffer); } } diff --git a/src/core.c b/src/core.c index 2b5329e3..a76fe0be 100644 --- a/src/core.c +++ b/src/core.c @@ -120,9 +120,9 @@ //#define DEFAULT_KEYBOARD_DEV "/dev/input/eventN" //#define DEFAULT_MOUSE_DEV "/dev/input/eventN" //#define DEFAULT_GAMEPAD_DEV "/dev/input/eventN" - + #define MOUSE_SENSITIVITY 0.8f - + #define MAX_GAMEPADS 2 // Max number of gamepads supported #define MAX_GAMEPAD_BUTTONS 11 // Max bumber of buttons supported (per gamepad) #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) @@ -333,7 +333,7 @@ void InitWindow(int width, int height, const char *title) emscripten_set_touchend_callback("#canvas", NULL, 1, EmscriptenInputCallback); emscripten_set_touchmove_callback("#canvas", NULL, 1, EmscriptenInputCallback); emscripten_set_touchcancel_callback("#canvas", NULL, 1, EmscriptenInputCallback); - + // TODO: Add gamepad support (not provided by GLFW3 on emscripten) //emscripten_set_gamepadconnected_callback(NULL, 1, EmscriptenInputCallback); //emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenInputCallback); @@ -394,7 +394,7 @@ void InitWindow(int width, int height, struct android_app *state) //state->userData = &engine; app->onAppCmd = AndroidCommandCallback; app->onInputEvent = AndroidInputCallback; - + InitAssetManager(app->activity->assetManager); TraceLog(INFO, "Android app initialized successfully"); @@ -447,7 +447,7 @@ void CloseWindow(void) eglTerminate(display); display = EGL_NO_DISPLAY; - } + } #endif #if defined(PLATFORM_RPI) @@ -527,7 +527,7 @@ void BeginDrawing(void) currentTime = GetTime(); // Number of elapsed seconds since InitTimer() was called updateTime = currentTime - previousTime; previousTime = currentTime; - + rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) rlMultMatrixf(MatrixToFloat(downscaleView)); // If downscale required, apply it here @@ -543,7 +543,7 @@ void EndDrawing(void) SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events - + // Frame time control system currentTime = GetTime(); drawTime = currentTime - previousTime; @@ -575,9 +575,9 @@ void Begin2dMode(Camera2D camera) Matrix matRotation = MatrixRotate((Vector3){ 0.0f, 0.0f, 1.0f }, camera.rotation*DEG2RAD); Matrix matScale = MatrixScale(camera.zoom, camera.zoom, 1.0f); Matrix matTranslation = MatrixTranslate(camera.offset.x + camera.target.x, camera.offset.y + camera.target.y, 0.0f); - + Matrix matTransform = MatrixMultiply(MatrixMultiply(matOrigin, MatrixMultiply(matScale, matRotation)), matTranslation); - + rlMultMatrixf(MatrixToFloat(matTransform)); } @@ -593,14 +593,14 @@ void End2dMode(void) void Begin3dMode(Camera camera) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - + if (IsVrDeviceReady()) BeginVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPushMatrix(); // Save previous matrix, which contains the settings for the 2d ortho projection rlLoadIdentity(); // Reset current matrix (PROJECTION) - + // Setup perspective projection float aspect = (float)screenWidth/(float)screenHeight; double top = 0.01*tan(camera.fovy*PI/360.0); @@ -615,15 +615,15 @@ void Begin3dMode(Camera camera) // Setup Camera view Matrix cameraView = MatrixLookAt(camera.position, camera.target, camera.up); rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) - + rlEnableDepthTest(); // Enable DEPTH_TEST for 3D } // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void) -{ +{ rlglDraw(); // Process internal buffers (update + draw) - + if (IsVrDeviceReady()) EndVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix @@ -633,7 +633,7 @@ void End3dMode(void) rlLoadIdentity(); // Reset current matrix (MODELVIEW) //rlTranslatef(0.375, 0.375, 0); // HACK to ensure pixel-perfect drawing on OpenGL (after exiting 3D mode) - + rlDisableDepthTest(); // Disable DEPTH_TEST for 2D } @@ -645,16 +645,16 @@ void BeginTextureMode(RenderTexture2D target) rlEnableRenderTexture(target.id); // Enable render target rlClearScreenBuffers(); // Clear render texture buffers - + // Set viewport to framebuffer size - rlViewport(0, 0, target.texture.width, target.texture.height); - + rlViewport(0, 0, target.texture.width, target.texture.height); + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix rlLoadIdentity(); // Reset current matrix (PROJECTION) // Set orthographic projection to current framebuffer size // NOTE: Configured top-left corner as (0, 0) - rlOrtho(0, target.texture.width, target.texture.height, 0, 0.0f, 1.0f); + rlOrtho(0, target.texture.width, target.texture.height, 0, 0.0f, 1.0f); rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -672,10 +672,10 @@ void EndTextureMode(void) // Set viewport to default framebuffer size (screen size) // TODO: consider possible viewport offsets rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); - + rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix rlLoadIdentity(); // Reset current matrix (PROJECTION) - + // Set orthographic projection to current framebuffer size // NOTE: Configured top-left corner as (0, 0) rlOrtho(0, GetScreenWidth(), GetScreenHeight(), 0, 0.0f, 1.0f); @@ -701,7 +701,7 @@ float GetFPS(void) // Returns time in seconds for one frame float GetFrameTime(void) { - // As we are operate quite a lot with frameTime, + // As we are operate quite a lot with frameTime, // it could be no stable, so we round it before passing it around // NOTE: There are still problems with high framerates (>500fps) double roundedFrameTime = round(frameTime*10000)/10000.0; @@ -735,7 +735,7 @@ float *VectorToFloat(Vector3 vec) } // Converts Matrix to float array -// NOTE: Returned vector is a transposed version of the Matrix struct, +// NOTE: Returned vector is a transposed version of the Matrix struct, // it should be this way because, despite raymath use OpenGL column-major convention, // Matrix struct memory alignment and variables naming are not coherent float *MatrixToFloat(Matrix mat) @@ -799,7 +799,7 @@ Color Fade(Color color, float alpha) { if (alpha < 0.0f) alpha = 0.0f; else if (alpha > 1.0f) alpha = 1.0f; - + float colorAlpha = (float)color.a*alpha; return (Color){color.r, color.g, color.b, (unsigned char)colorAlpha}; @@ -841,9 +841,9 @@ void ClearDroppedFiles(void) if (dropFilesCount > 0) { for (int i = 0; i < dropFilesCount; i++) free(dropFilesPath[i]); - + free(dropFilesPath); - + dropFilesCount = 0; } } @@ -854,7 +854,7 @@ void ClearDroppedFiles(void) void StorageSaveValue(int position, int value) { FILE *storageFile = NULL; - + char path[128]; #if defined(PLATFORM_ANDROID) strcpy(path, internalDataPath); @@ -865,7 +865,7 @@ void StorageSaveValue(int position, int value) #endif // Try open existing file to append data - storageFile = fopen(path, "rb+"); + storageFile = fopen(path, "rb+"); // If file doesn't exist, create a new storage data file if (!storageFile) storageFile = fopen(path, "wb"); @@ -877,14 +877,14 @@ void StorageSaveValue(int position, int value) fseek(storageFile, 0, SEEK_END); int fileSize = ftell(storageFile); // Size in bytes fseek(storageFile, 0, SEEK_SET); - + if (fileSize < (position*4)) TraceLog(WARNING, "Storage position could not be found"); else { fseek(storageFile, (position*4), SEEK_SET); fwrite(&value, 1, 4, storageFile); } - + fclose(storageFile); } } @@ -894,7 +894,7 @@ void StorageSaveValue(int position, int value) int StorageLoadValue(int position) { int value = 0; - + char path[128]; #if defined(PLATFORM_ANDROID) strcpy(path, internalDataPath); @@ -903,9 +903,9 @@ int StorageLoadValue(int position) #else strcpy(path, STORAGE_FILENAME); #endif - + // Try open existing file to append data - FILE *storageFile = fopen(path, "rb"); + FILE *storageFile = fopen(path, "rb"); if (!storageFile) TraceLog(WARNING, "Storage data file could not be found"); else @@ -914,42 +914,42 @@ int StorageLoadValue(int position) fseek(storageFile, 0, SEEK_END); int fileSize = ftell(storageFile); // Size in bytes rewind(storageFile); - + if (fileSize < (position*4)) TraceLog(WARNING, "Storage position could not be found"); else { fseek(storageFile, (position*4), SEEK_SET); fread(&value, 1, 4, storageFile); } - + fclose(storageFile); } - + return value; } // Returns a ray trace from mouse position Ray GetMouseRay(Vector2 mousePosition, Camera camera) -{ +{ Ray ray; - + // Calculate normalized device coordinates // NOTE: y value is negative float x = (2.0f*mousePosition.x)/(float)GetScreenWidth() - 1.0f; float y = 1.0f - (2.0f*mousePosition.y)/(float)GetScreenHeight(); float z = 1.0f; - + // Store values in a vector Vector3 deviceCoords = { x, y, z }; - + TraceLog(DEBUG, "Device coordinates: (%f, %f, %f)", deviceCoords.x, deviceCoords.y, deviceCoords.z); - + // Calculate projection matrix (from perspective instead of frustum) Matrix matProj = MatrixPerspective(camera.fovy, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0); - + // Calculate view matrix from camera look at Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - + // Do I need to transpose it? It seems that yes... // NOTE: matrix order may be incorrect... In OpenGL to get world position from // camera view it just needs to get inverted, but here we need to transpose it too. @@ -957,10 +957,10 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) // to a vector, you will get its 3d world position coordinates (camera.position). // If you don't transpose, final position will be wrong. MatrixTranspose(&matView); - + //#define USE_RLGL_UNPROJECT #if defined(USE_RLGL_UNPROJECT) // OPTION 1: Use rlglUnproject() - + Vector3 nearPoint = rlglUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 0.0f }, matProj, matView); Vector3 farPoint = rlglUnproject((Vector3){ deviceCoords.x, deviceCoords.y, 1.0f }, matProj, matView); @@ -969,56 +969,56 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) // Calculate unproject matrix (multiply projection matrix and view matrix) and invert it Matrix matProjView = MatrixMultiply(matProj, matView); MatrixInvert(&matProjView); - + // Calculate far and near points Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; - + // Multiply points by unproject matrix QuaternionTransform(&near, matProjView); QuaternionTransform(&far, matProjView); - + // Calculate normalized world points in vectors Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w}; Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w}; #endif - + // Calculate normalized direction vector Vector3 direction = VectorSubtract(farPoint, nearPoint); VectorNormalize(&direction); - + // Apply calculated vectors to ray ray.position = camera.position; ray.direction = direction; - + return ray; } // Returns the screen space position from a 3d world space position Vector2 GetWorldToScreen(Vector3 position, Camera camera) -{ +{ // Calculate projection matrix (from perspective instead of frustum Matrix matProj = MatrixPerspective(camera.fovy, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0); - + // Calculate view matrix from camera look at (and transpose it) Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); MatrixTranspose(&matView); - + // Convert world position vector to quaternion Quaternion worldPos = { position.x, position.y, position.z, 1.0f }; - + // Transform world position to view QuaternionTransform(&worldPos, matView); - + // Transform result to projection (clip space position) QuaternionTransform(&worldPos, matProj); - + // Calculate normalized device coordinates (inverted y) Vector3 ndcPos = { worldPos.x / worldPos.w, -worldPos.y / worldPos.w, worldPos.z / worldPos.z }; - + // Calculate 2d screen position vector Vector2 screenPosition = { (ndcPos.x + 1.0f)/2.0f*(float)GetScreenWidth(), (ndcPos.y + 1.0f)/2.0f*(float)GetScreenHeight() }; - + return screenPosition; } @@ -1144,7 +1144,7 @@ bool IsCursorHidden() bool IsGamepadAvailable(int gamepad) { bool result = false; - + #if defined(PLATFORM_RPI) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true; #else @@ -1158,7 +1158,7 @@ bool IsGamepadAvailable(int gamepad) float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; - + #if defined(PLATFORM_RPI) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) { @@ -1167,9 +1167,9 @@ float GetGamepadAxisMovement(int gamepad, int axis) #else const float *axes; int axisCount = 0; - + axes = glfwGetJoystickAxes(gamepad, &axisCount); - + if (axis < axisCount) value = axes[axis]; #endif @@ -1197,7 +1197,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; - + #if defined(PLATFORM_RPI) // Get gamepad buttons information if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (gamepadButtons[gamepad][button] == 1)) result = true; @@ -1205,13 +1205,13 @@ bool IsGamepadButtonDown(int gamepad, int button) #else const unsigned char *buttons; int buttonsCount; - + buttons = glfwGetJoystickButtons(gamepad, &buttonsCount); if ((buttons != NULL) && (buttons[button] == GLFW_PRESS)) result = true; else result = false; #endif - + return result; } @@ -1260,7 +1260,7 @@ bool IsGamepadButtonUp(int gamepad, int button) bool IsMouseButtonPressed(int button) { bool pressed = false; - + #if defined(PLATFORM_ANDROID) if (IsGestureDetected(GESTURE_TAP)) pressed = true; #else @@ -1274,13 +1274,13 @@ bool IsMouseButtonPressed(int button) bool IsMouseButtonDown(int button) { bool down = false; - + #if defined(PLATFORM_ANDROID) if (IsGestureDetected(GESTURE_HOLD)) down = true; #else if (GetMouseButtonStatus(button) == 1) down = true; #endif - + return down; } @@ -1288,7 +1288,7 @@ bool IsMouseButtonDown(int button) bool IsMouseButtonReleased(int button) { bool released = false; - + #if !defined(PLATFORM_ANDROID) if ((currentMouseState[button] != previousMouseState[button]) && (currentMouseState[button] == 0)) released = true; #endif @@ -1300,7 +1300,7 @@ bool IsMouseButtonReleased(int button) bool IsMouseButtonUp(int button) { bool up = false; - + #if !defined(PLATFORM_ANDROID) if (GetMouseButtonStatus(button) == 0) up = true; #endif @@ -1385,7 +1385,7 @@ int GetTouchY(void) Vector2 GetTouchPosition(int index) { Vector2 position = { -1.0f, -1.0f }; - + #if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB) if (index < MAX_TOUCH_POINTS) position = touchPosition[index]; else TraceLog(WARNING, "Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS); @@ -1493,7 +1493,7 @@ static void InitGraphicsDevice(int width, int height) // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // with forward compatibility to older OpenGL versions. // For example, if using OpenGL 1.1, driver can provide a 3.3 context fordward compatible. - + if (configFlags & FLAG_MSAA_4X_HINT) { glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 @@ -1513,7 +1513,7 @@ static void InitGraphicsDevice(int width, int height) glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // Profiles Hint: Only 3.3 and above! // Other values: GLFW_OPENGL_ANY_PROFILE, GLFW_OPENGL_COMPAT_PROFILE #ifdef __APPLE__ - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // OSX Requires #else glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); // Fordward Compatibility Hint: Only 3.3 and above! #endif @@ -1523,9 +1523,9 @@ static void InitGraphicsDevice(int width, int height) if (fullscreen) { // Obtain recommended displayWidth/displayHeight from a valid videomode for the monitor - int count; + int count; const GLFWvidmode *modes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count); - + // Get closest videomode to desired screenWidth/screenHeight for (int i = 0; i < count; i++) { @@ -1539,7 +1539,7 @@ static void InitGraphicsDevice(int width, int height) } } } - + TraceLog(WARNING, "Closest fullscreen videomode: %i x %i", displayWidth, displayHeight); // NOTE: ISSUE: Closest videomode could not match monitor aspect-ratio, for example, @@ -1548,12 +1548,12 @@ static void InitGraphicsDevice(int width, int height) // by the sides to fit all monitor space... // At this point we need to manage render size vs screen size - // NOTE: This function uses and modifies global module variables: + // NOTE: This function uses and modifies global module variables: // screenWidth/screenHeight - renderWidth/renderHeight - downscaleView SetupFramebufferSize(displayWidth, displayHeight); window = glfwCreateWindow(displayWidth, displayHeight, windowTitle, glfwGetPrimaryMonitor(), NULL); - + // NOTE: Full-screen change, not working properly... //glfwSetWindowMonitor(window, glfwGetPrimaryMonitor(), 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE); } @@ -1561,15 +1561,15 @@ static void InitGraphicsDevice(int width, int height) { // No-fullscreen window creation window = glfwCreateWindow(screenWidth, screenHeight, windowTitle, NULL, NULL); - + #if defined(PLATFORM_DESKTOP) // Center window on screen int windowPosX = displayWidth/2 - screenWidth/2; int windowPosY = displayHeight/2 - screenHeight/2; - + if (windowPosX < 0) windowPosX = 0; if (windowPosY < 0) windowPosY = 0; - + glfwSetWindowPos(window, windowPosX, windowPosY); #endif renderWidth = screenWidth; @@ -1612,7 +1612,7 @@ static void InitGraphicsDevice(int width, int height) // NOTE: GLFW loader function is passed as parameter rlglLoadExtensions(glfwGetProcAddress); #endif - + // Enables GPU v-sync, so frames are not limited to screen refresh rate (60Hz -> 60 FPS) // If not set, swap interval uses GPU v-sync configuration // Framerate can be setup using SetTargetFPS() @@ -1620,7 +1620,7 @@ static void InitGraphicsDevice(int width, int height) { glfwSwapInterval(1); TraceLog(INFO, "Trying to enable VSYNC"); - } + } #endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1643,13 +1643,13 @@ static void InitGraphicsDevice(int width, int height) EGLint samples = 0; EGLint sampleBuffer = 0; - if (configFlags & FLAG_MSAA_4X_HINT) + if (configFlags & FLAG_MSAA_4X_HINT) { samples = 4; sampleBuffer = 1; TraceLog(INFO, "Trying to enable MSAA x4"); } - + const EGLint framebufferAttribs[] = { EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Type of context support -> Required on RPI? @@ -1773,10 +1773,10 @@ static void InitGraphicsDevice(int width, int height) // Initialize OpenGL context (states and resources) // NOTE: screenWidth and screenHeight not used, just stored as globals rlglInit(screenWidth, screenHeight); - + #ifdef __APPLE__ // Get framebuffer size of current window - // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer + // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer // is automatically reasized to adapt to new DPI. // When OS does that, it can be detected using GLFW3 callback: glfwSetFramebufferSizeCallback() int fbWidth, fbHeight; @@ -1792,7 +1792,7 @@ static void InitGraphicsDevice(int width, int height) // NOTE: Default to orthographic projection mode with top-left corner at (0,0) rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix rlLoadIdentity(); // Reset current matrix (PROJECTION) - rlOrtho(0, renderWidth - renderOffsetX, renderHeight - renderOffsetY, 0, 0.0f, 1.0f); + rlOrtho(0, renderWidth - renderOffsetX, renderHeight - renderOffsetY, 0, 0.0f, 1.0f); rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -1806,7 +1806,7 @@ static void InitGraphicsDevice(int width, int height) // Compute framebuffer size relative to screen size and display size // NOTE: Global variables renderWidth/renderHeight and renderOffsetX/renderOffsetY can be modified static void SetupFramebufferSize(int displayWidth, int displayHeight) -{ +{ // Calculate renderWidth and renderHeight, we have the display size (input params) and the desired screen size (global var) if ((screenWidth > displayWidth) || (screenHeight > displayHeight)) { @@ -1945,7 +1945,7 @@ static void PollInputEvents(void) // NOTE: Gestures update must be called every frame to reset gestures correctly // because ProcessGestureEvent() is just called on an event, not every frame UpdateGestures(); - + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // Mouse input polling double mouseX; @@ -2025,7 +2025,7 @@ static void TakeScreenshot(void) unsigned char *imgData = rlglReadScreenPixels(renderWidth, renderHeight); sprintf(buffer, "screenshot%03i.png", shotNum); - + // Save image as PNG WritePNG(buffer, imgData, renderWidth, renderHeight, 4); @@ -2062,7 +2062,7 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i #if defined(PLATFORM_DESKTOP) else if (key == GLFW_KEY_F12 && action == GLFW_PRESS) TakeScreenshot(); #endif - else + else { currentKeyState[key] = action; if (action == GLFW_PRESS) lastKeyPressed = key; @@ -2073,27 +2073,27 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods) { currentMouseState[button] = action; - + #define ENABLE_MOUSE_GESTURES #if defined(ENABLE_MOUSE_GESTURES) // Process mouse events as touches to be able to use mouse-gestures GestureEvent gestureEvent; - + // Register touch actions if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_DOWN; else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) gestureEvent.touchAction = TOUCH_UP; - + // NOTE: TOUCH_MOVE event is registered in MouseCursorPosCallback() - + // Assign a pointer ID gestureEvent.pointerId[0] = 0; - + // Register touch points count gestureEvent.pointCount = 1; - + // Register touch points position, only one point registered gestureEvent.position[0] = GetMousePosition(); - + // Normalize gestureEvent.position[0] for screenWidth and screenHeight gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); @@ -2112,20 +2112,20 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y) GestureEvent gestureEvent; gestureEvent.touchAction = TOUCH_MOVE; - + // Assign a pointer ID gestureEvent.pointerId[0] = 0; // Register touch points count gestureEvent.pointCount = 1; - + // Register touch points position, only one point registered gestureEvent.position[0] = (Vector2){ (float)x, (float)y }; - + touchPosition[0] = gestureEvent.position[0]; - + // Normalize gestureEvent.position[0] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); // Gesture data is sent to gestures system for processing @@ -2166,7 +2166,7 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height) screenHeight = height; renderWidth = width; renderHeight = height; - + // NOTE: Postprocessing texture is not scaled to new size } @@ -2185,9 +2185,9 @@ static void WindowIconifyCallback(GLFWwindow* window, int iconified) static void WindowDropCallback(GLFWwindow *window, int count, const char **paths) { ClearDroppedFiles(); - + dropFilesPath = (char **)malloc(sizeof(char *)*count); - + for (int i = 0; i < count; i++) { dropFilesPath[i] = (char *)malloc(sizeof(char)*256); // Max path length set to 256 char @@ -2249,7 +2249,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) for (int i = 0; i < assetsCount; i++) { // TODO: Unload old asset if required - + // Load texture again to pointed texture (*textureAsset + i) = LoadTexture(assetPath[i]); } @@ -2292,7 +2292,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // NOTE 2: In some cases (too many context loaded), OS could unload context automatically... :( eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroySurface(display, surface); - + contextRebindRequired = true; TraceLog(INFO, "APP_CMD_TERM_WINDOW"); @@ -2329,7 +2329,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) { //http://developer.android.com/ndk/reference/index.html - + int type = AInputEvent_getType(event); if (type == AINPUT_EVENT_TYPE_MOTION) @@ -2337,7 +2337,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) // Get first touch position touchPosition[0].x = AMotionEvent_getX(event, 0); touchPosition[0].y = AMotionEvent_getY(event, 0); - + // Get second touch position touchPosition[1].x = AMotionEvent_getX(event, 1); touchPosition[1].y = AMotionEvent_getY(event, 1); @@ -2346,7 +2346,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) { int32_t keycode = AKeyEvent_getKeyCode(event); //int32_t AKeyEvent_getMetaState(event); - + // Save current button and its state currentButtonState[keycode] = AKeyEvent_getAction(event); // Down = 0, Up = 1 @@ -2358,7 +2358,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) // NOTE: AndroidManifest.xml must have // Before that change, activity was calling CMD_TERM_WINDOW and CMD_DESTROY when locking mobile, so that was not a normal behaviour return 0; - } + } else if ((keycode == AKEYCODE_BACK) || (keycode == AKEYCODE_MENU)) { // Eat BACK_BUTTON and AKEYCODE_MENU, just do nothing... and don't let to be handled by OS! @@ -2370,36 +2370,36 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) return 0; } } - + int32_t action = AMotionEvent_getAction(event); unsigned int flags = action & AMOTION_EVENT_ACTION_MASK; - + GestureEvent gestureEvent; - + // Register touch actions if (flags == AMOTION_EVENT_ACTION_DOWN) gestureEvent.touchAction = TOUCH_DOWN; else if (flags == AMOTION_EVENT_ACTION_UP) gestureEvent.touchAction = TOUCH_UP; else if (flags == AMOTION_EVENT_ACTION_MOVE) gestureEvent.touchAction = TOUCH_MOVE; - + // Register touch points count gestureEvent.pointCount = AMotionEvent_getPointerCount(event); - + // Register touch points id gestureEvent.pointerId[0] = AMotionEvent_getPointerId(event, 0); gestureEvent.pointerId[1] = AMotionEvent_getPointerId(event, 1); - + // Register touch points position // NOTE: Only two points registered gestureEvent.position[0] = (Vector2){ AMotionEvent_getX(event, 0), AMotionEvent_getY(event, 0) }; gestureEvent.position[1] = (Vector2){ AMotionEvent_getX(event, 1), AMotionEvent_getY(event, 1) }; - + // Normalize gestureEvent.position[x] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); - - gestureEvent.position[1].x /= (float)GetScreenWidth(); + + gestureEvent.position[1].x /= (float)GetScreenWidth(); gestureEvent.position[1].y /= (float)GetScreenHeight(); - + // Gesture data is sent to gestures system for processing ProcessGestureEvent(gestureEvent); @@ -2410,13 +2410,13 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) #if defined(PLATFORM_WEB) static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) { - //isFullscreen: int e->isFullscreen - //fullscreenEnabled: int e->fullscreenEnabled + //isFullscreen: int e->isFullscreen + //fullscreenEnabled: int e->fullscreenEnabled //fs element nodeName: (char *) e->nodeName //fs element id: (char *) e->id //Current element size: (int) e->elementWidth, (int) e->elementHeight //Screen size:(int) e->screenWidth, (int) e->screenHeight - + if (e->isFullscreen) { TraceLog(INFO, "Canvas scaled to fullscreen. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); @@ -2425,7 +2425,7 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte { TraceLog(INFO, "Canvas scaled to windowed. ElementSize: (%ix%i), ScreenSize(%ix%i)", e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); } - + // TODO: Depending on scaling factor (screen vs element), calculate factor to scale mouse/touch input return 0; @@ -2445,33 +2445,33 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent x = touchEvent->touches[i].canvasX; y = touchEvent->touches[i].canvasY; } - + printf("%s, numTouches: %d %s%s%s%s\n", emscripten_event_type_to_string(eventType), event->numTouches, event->ctrlKey ? " CTRL" : "", event->shiftKey ? " SHIFT" : "", event->altKey ? " ALT" : "", event->metaKey ? " META" : ""); for(int i = 0; i < event->numTouches; ++i) { const EmscriptenTouchPoint *t = &event->touches[i]; - + printf(" %ld: screen: (%ld,%ld), client: (%ld,%ld), page: (%ld,%ld), isChanged: %d, onTarget: %d, canvas: (%ld, %ld)\n", t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY); } */ - + GestureEvent gestureEvent; // Register touch actions if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) gestureEvent.touchAction = TOUCH_DOWN; else if (eventType == EMSCRIPTEN_EVENT_TOUCHEND) gestureEvent.touchAction = TOUCH_UP; else if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) gestureEvent.touchAction = TOUCH_MOVE; - + // Register touch points count gestureEvent.pointCount = touchEvent->numTouches; - + // Register touch points id gestureEvent.pointerId[0] = touchEvent->touches[0].identifier; gestureEvent.pointerId[1] = touchEvent->touches[1].identifier; - + // Register touch points position // NOTE: Only two points registered // TODO: Touch data should be scaled accordingly! @@ -2482,12 +2482,12 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent touchPosition[0] = gestureEvent.position[0]; touchPosition[1] = gestureEvent.position[1]; - + // Normalize gestureEvent.position[x] for screenWidth and screenHeight - gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].x /= (float)GetScreenWidth(); gestureEvent.position[0].y /= (float)GetScreenHeight(); - - gestureEvent.position[1].x /= (float)GetScreenWidth(); + + gestureEvent.position[1].x /= (float)GetScreenWidth(); gestureEvent.position[1].y /= (float)GetScreenHeight(); // Gesture data is sent to gestures system for processing @@ -2533,7 +2533,7 @@ static void InitKeyboard(void) else { // We reconfigure keyboard mode to get: - // - scancodes (K_RAW) + // - scancodes (K_RAW) // - keycodes (K_MEDIUMRAW) // - ASCII chars (K_XLATE) // - UNICODE chars (K_UNICODE) @@ -2549,7 +2549,7 @@ static void InitKeyboard(void) static void ProcessKeyboard(void) { #define MAX_KEYBUFFER_SIZE 32 // Max size in bytes to read - + // Keyboard input polling (fill keys[256] array with status) int bufferByteCount = 0; // Bytes available on the buffer char keysBuffer[MAX_KEYBUFFER_SIZE]; // Max keys to be read at a time @@ -2564,7 +2564,7 @@ static void ProcessKeyboard(void) for (int i = 0; i < bufferByteCount; i++) { TraceLog(DEBUG, "Bytes on keysBuffer: %i", bufferByteCount); - + //printf("Key(s) bytes: "); //for (int i = 0; i < bufferByteCount; i++) printf("0x%02x ", keysBuffer[i]); //printf("\n"); @@ -2598,7 +2598,7 @@ static void ProcessKeyboard(void) case 0x34: currentKeyState[301] = 1; break; // raylib KEY_F12 default: break; } - + if (keysBuffer[i + 2] == 0x5b) i += 4; else if ((keysBuffer[i + 2] == 0x31) || (keysBuffer[i + 2] == 0x32)) i += 5; } @@ -2615,7 +2615,7 @@ static void ProcessKeyboard(void) i += 3; // Jump to next key } - + // NOTE: Some keys are not directly keymapped (CTRL, ALT, SHIFT) } } @@ -2625,7 +2625,7 @@ static void ProcessKeyboard(void) else { TraceLog(DEBUG, "Pressed key (ASCII): 0x%02x", keysBuffer[i]); - + // Translate lowercase a-z letters to A-Z if ((keysBuffer[i] >= 97) && (keysBuffer[i] <= 122)) { @@ -2634,10 +2634,10 @@ static void ProcessKeyboard(void) else currentKeyState[(int)keysBuffer[i]] = 1; } } - + // Check exit key (same functionality as GLFW3 KeyCallback()) if (currentKeyState[exitKey] == 1) windowShouldClose = true; - + // Check screen capture key if (currentKeyState[301] == 1) TakeScreenshot(); // raylib key: KEY_F12 (GLFW_KEY_F12) } @@ -2647,7 +2647,7 @@ static void RestoreKeyboard(void) { // Reset to default keyboard settings tcsetattr(STDIN_FILENO, TCSANOW, &defaultKeyboardSettings); - + // Reconfigure keyboard to default mode ioctl(STDIN_FILENO, KDSKBMODE, defaultKeyboardMode); } @@ -2677,14 +2677,14 @@ static void InitMouse(void) static void *MouseThread(void *arg) { const unsigned char XSIGN = 1<<4, YSIGN = 1<<5; - - typedef struct { + + typedef struct { char buttons; - char dx, dy; + char dx, dy; } MouseEvent; - + MouseEvent mouse; - + int mouseRelX = 0; int mouseRelY = 0; @@ -2693,7 +2693,7 @@ static void *MouseThread(void *arg) if (read(mouseStream, &mouse, sizeof(MouseEvent)) == (int)sizeof(MouseEvent)) { if ((mouse.buttons & 0x08) == 0) break; // This bit should always be set - + // Check Left button pressed if ((mouse.buttons & 0x01) > 0) currentMouseState[0] = 1; else currentMouseState[0] = 0; @@ -2701,27 +2701,27 @@ static void *MouseThread(void *arg) // Check Right button pressed if ((mouse.buttons & 0x02) > 0) currentMouseState[1] = 1; else currentMouseState[1] = 0; - + // Check Middle button pressed if ((mouse.buttons & 0x04) > 0) currentMouseState[2] = 1; else currentMouseState[2] = 0; - + mouseRelX = (int)mouse.dx; mouseRelY = (int)mouse.dy; - + if ((mouse.buttons & XSIGN) > 0) mouseRelX = -1*(255 - mouseRelX); if ((mouse.buttons & YSIGN) > 0) mouseRelY = -1*(255 - mouseRelY); - + // NOTE: Mouse movement is normalized to not be screen resolution dependant // We suppose 2*255 (max relative movement) is equivalent to screenWidth (max pixels width) // Result after normalization is multiplied by MOUSE_SENSITIVITY factor mousePosition.x += (float)mouseRelX*((float)screenWidth/(2*255))*MOUSE_SENSITIVITY; mousePosition.y -= (float)mouseRelY*((float)screenHeight/(2*255))*MOUSE_SENSITIVITY; - + if (mousePosition.x < 0) mousePosition.x = 0; if (mousePosition.y < 0) mousePosition.y = 0; - + if (mousePosition.x > screenWidth) mousePosition.x = screenWidth; if (mousePosition.y > screenHeight) mousePosition.y = screenHeight; } @@ -2735,12 +2735,12 @@ static void *MouseThread(void *arg) static void InitGamepad(void) { char gamepadDev[128] = ""; - + for (int i = 0; i < MAX_GAMEPADS; i++) { sprintf(gamepadDev, "%s%i", DEFAULT_GAMEPAD_DEV, i); - - if ((gamepadStream[i] = open(gamepadDev, O_RDONLY|O_NONBLOCK)) < 0) + + if ((gamepadStream[i] = open(gamepadDev, O_RDONLY|O_NONBLOCK)) < 0) { // NOTE: Only show message for first gamepad if (i == 0) TraceLog(WARNING, "Gamepad device could not be opened, no gamepad available"); @@ -2758,7 +2758,7 @@ static void InitGamepad(void) else TraceLog(INFO, "Gamepad device initialized successfully"); } } - } + } } // Process Gamepad (/dev/input/js0) @@ -2777,7 +2777,7 @@ static void *GamepadThread(void *arg) // Read gamepad event struct js_event gamepadEvent; - + while (!windowShouldClose) { for (int i = 0; i < MAX_GAMEPADS; i++) @@ -2785,22 +2785,22 @@ static void *GamepadThread(void *arg) if (read(gamepadStream[i], &gamepadEvent, sizeof(struct js_event)) == (int)sizeof(struct js_event)) { gamepadEvent.type &= ~JS_EVENT_INIT; // Ignore synthetic events - + // Process gamepad events by type - if (gamepadEvent.type == JS_EVENT_BUTTON) + if (gamepadEvent.type == JS_EVENT_BUTTON) { TraceLog(DEBUG, "Gamepad button: %i, value: %i", gamepadEvent.number, gamepadEvent.value); - - if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) + + if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) { // 1 - button pressed, 0 - button released gamepadButtons[i][gamepadEvent.number] = (int)gamepadEvent.value; } } - else if (gamepadEvent.type == JS_EVENT_AXIS) + else if (gamepadEvent.type == JS_EVENT_AXIS) { TraceLog(DEBUG, "Gamepad axis: %i, value: %i", gamepadEvent.number, gamepadEvent.value); - + if (gamepadEvent.number < MAX_GAMEPAD_AXIS) { // NOTE: Scaling of gamepadEvent.value to get values between -1..1 diff --git a/src/models.c b/src/models.c index 24238ed2..e9044e96 100644 --- a/src/models.c +++ b/src/models.c @@ -81,12 +81,12 @@ void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rot rlPushMatrix(); rlTranslatef(center.x, center.y, center.z); rlRotatef(rotationAngle, rotation.x, rotation.y, rotation.z); - + rlBegin(RL_LINES); for (int i = 0; i < 360; i += 10) { rlColor4ub(color.r, color.g, color.b, color.a); - + rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f); rlVertex3f(sin(DEG2RAD*(i + 10)) * radius, cos(DEG2RAD*(i + 10)) * radius, 0.0f); } @@ -583,13 +583,13 @@ void DrawLight(Light light) DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); } break; case LIGHT_DIRECTIONAL: - { + { DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); } break; case LIGHT_SPOT: - { + { DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : BLACK)); DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); @@ -602,7 +602,7 @@ void DrawLight(Light light) Model LoadModel(const char *fileName) { Model model = { 0 }; - + // TODO: Initialize default data for model in case loading fails, maybe a cube? if (strcmp(GetExtension(fileName), "obj") == 0) model.mesh = LoadOBJ(fileName); @@ -612,7 +612,7 @@ Model LoadModel(const char *fileName) else { rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) - + model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); } @@ -626,12 +626,12 @@ Model LoadModelEx(Mesh data, bool dynamic) Model model = { 0 }; model.mesh = data; - + rlglLoadMesh(&model.mesh, dynamic); // Upload vertex data to GPU - + model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); - + return model; } @@ -723,11 +723,11 @@ Model LoadModelFromRES(const char *rresName, int resId) Model LoadHeightmap(Image heightmap, Vector3 size) { Model model = { 0 }; - + model.mesh = GenMeshHeightmap(heightmap, size); - + rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) - + model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -738,11 +738,11 @@ Model LoadHeightmap(Image heightmap, Vector3 size) Model LoadCubicmap(Image cubicmap) { Model model = { 0 }; - + model.mesh = GenMeshCubicmap(cubicmap, (Vector3){ 1.0f, 1.5f, 1.0f }); - + rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) - + model.transform = MatrixIdentity(); model.material = LoadDefaultMaterial(); @@ -755,7 +755,7 @@ void UnloadModel(Model model) rlglUnloadMesh(&model.mesh); UnloadMaterial(model.material); - + TraceLog(INFO, "Unloaded model data from RAM and VRAM"); } @@ -763,10 +763,10 @@ void UnloadModel(Model model) Material LoadMaterial(const char *fileName) { Material material = { 0 }; - + if (strcmp(GetExtension(fileName), "mtl") == 0) material = LoadMTL(fileName); else TraceLog(WARNING, "[%s] Material extension not recognized, it can't be loaded", fileName); - + return material; } @@ -774,7 +774,7 @@ Material LoadMaterial(const char *fileName) Material LoadDefaultMaterial(void) { Material material = { 0 }; - + material.shader = GetDefaultShader(); material.texDiffuse = GetDefaultTexture(); // White texture (1x1 pixel) //material.texNormal; // NOTE: By default, not set @@ -783,9 +783,9 @@ Material LoadDefaultMaterial(void) material.colDiffuse = WHITE; // Diffuse color material.colAmbient = WHITE; // Ambient color material.colSpecular = WHITE; // Specular color - + material.glossiness = 100.0f; // Glossiness level - + return material; } @@ -794,7 +794,7 @@ Material LoadDefaultMaterial(void) Material LoadStandardMaterial(void) { Material material = LoadDefaultMaterial(); - + material.shader = GetStandardShader(); return material; @@ -812,12 +812,12 @@ void UnloadMaterial(Material material) static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) { #define GRAY_VALUE(c) ((c.r+c.g+c.b)/3) - + Mesh mesh = { 0 }; int mapX = heightmap.width; int mapZ = heightmap.height; - + Color *pixels = GetImageData(heightmap); // NOTE: One vertex per pixel @@ -908,7 +908,7 @@ static Mesh GenMeshHeightmap(Image heightmap, Vector3 size) trisCounter += 2; } } - + free(pixels); return mesh; @@ -919,7 +919,7 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) Mesh mesh = { 0 }; Color *cubicmapPixels = GetImageData(cubicmap); - + int mapWidth = cubicmap.width; int mapHeight = cubicmap.height; @@ -1262,9 +1262,9 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) free(mapVertices); free(mapNormals); free(mapTexcoords); - + free(cubicmapPixels); // Free image pixel data - + return mesh; } @@ -1273,7 +1273,7 @@ void DrawModel(Model model, Vector3 position, float scale, Color tint) { Vector3 vScale = { scale, scale, scale }; Vector3 rotationAxis = { 0.0f, 0.0f, 0.0f }; - + DrawModelEx(model, position, rotationAxis, 0.0f, vScale, tint); } @@ -1285,13 +1285,13 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD); Matrix matScale = MatrixScale(scale.x, scale.y, scale.z); Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z); - + // Combine model transformation matrix (model.transform) with matrix generated by function parameters (matTransform) //Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates - + model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation); model.material.colDiffuse = tint; // TODO: Multiply tint color by diffuse color? - + rlglDrawMesh(model.mesh, model.material, model.transform); } @@ -1299,9 +1299,9 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota void DrawModelWires(Model model, Vector3 position, float scale, Color tint) { rlEnableWireMode(); - + DrawModel(model, position, scale, tint); - + rlDisableWireMode(); } @@ -1309,9 +1309,9 @@ void DrawModelWires(Model model, Vector3 position, float scale, Color tint) void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) { rlEnableWireMode(); - + DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint); - + rlDisableWireMode(); } @@ -1319,7 +1319,7 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint) { Rectangle sourceRec = { 0, 0, texture.width, texture.height }; - + DrawBillboardRec(camera, texture, sourceRec, center, size, tint); } @@ -1334,7 +1334,7 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec Vector3 right = { viewMatrix.m0, viewMatrix.m4, viewMatrix.m8 }; //Vector3 up = { viewMatrix.m1, viewMatrix.m5, viewMatrix.m9 }; - + // NOTE: Billboard locked on axis-Y Vector3 up = { 0.0f, 1.0f, 0.0f }; /* @@ -1384,13 +1384,13 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec void DrawBoundingBox(BoundingBox box, Color color) { Vector3 size; - + size.x = fabsf(box.max.x - box.min.x); size.y = fabsf(box.max.y - box.min.y); size.z = fabsf(box.max.z - box.min.z); - + Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f }; - + DrawCubeWires(center, size.x, size.y, size.z, color); } @@ -1451,14 +1451,14 @@ bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radius bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius) { bool collision = false; - + Vector3 raySpherePos = VectorSubtract(spherePosition, ray.position); float distance = VectorLength(raySpherePos); float vector = VectorDotProduct(raySpherePos, ray.direction); float d = sphereRadius*sphereRadius - (distance*distance - vector*vector); - + if (d >= 0.0f) collision = true; - + return collision; } @@ -1466,29 +1466,29 @@ bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint) { bool collision = false; - + Vector3 raySpherePos = VectorSubtract(spherePosition, ray.position); float distance = VectorLength(raySpherePos); float vector = VectorDotProduct(raySpherePos, ray.direction); float d = sphereRadius*sphereRadius - (distance*distance - vector*vector); - + if (d >= 0.0f) collision = true; - + // Calculate collision point Vector3 offset = ray.direction; float collisionDistance = 0; - + // Check if ray origin is inside the sphere to calculate the correct collision point if (distance < sphereRadius) collisionDistance = vector + sqrt(d); else collisionDistance = vector - sqrt(d); - + VectorScale(&offset, collisionDistance); Vector3 cPoint = VectorAdd(ray.position, offset); - + collisionPoint->x = cPoint.x; collisionPoint->y = cPoint.y; collisionPoint->z = cPoint.z; - + return collision; } @@ -1496,7 +1496,7 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadi bool CheckCollisionRayBox(Ray ray, BoundingBox box) { bool collision = false; - + float t[8]; t[0] = (box.min.x - ray.position.x)/ray.direction.x; t[1] = (box.max.x - ray.position.x)/ray.direction.x; @@ -1506,9 +1506,9 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box) t[5] = (box.max.z - ray.position.z)/ray.direction.z; t[6] = fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5])); t[7] = fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5])); - + collision = !(t[7] < 0 || t[6] > t[7]); - + return collision; } @@ -1524,19 +1524,19 @@ BoundingBox CalculateBoundingBox(Mesh mesh) { minVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; maxVertex = (Vector3){ mesh.vertices[0], mesh.vertices[1], mesh.vertices[2] }; - + for (int i = 1; i < mesh.vertexCount; i++) { minVertex = VectorMin(minVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); maxVertex = VectorMax(maxVertex, (Vector3){ mesh.vertices[i*3], mesh.vertices[i*3 + 1], mesh.vertices[i*3 + 2] }); } } - + // Create the bounding box BoundingBox box; box.min = minVertex; box.max = maxVertex; - + return box; } @@ -1546,9 +1546,9 @@ BoundingBox CalculateBoundingBox(Mesh mesh) Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius) { #define CUBIC_MAP_HALF_BLOCK_SIZE 0.5 - + Color *cubicmapPixels = GetImageData(cubicmap); - + // Detect the cell where the player is located Vector3 impactDirection = { 0.0f, 0.0f, 0.0f }; @@ -1784,7 +1784,7 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p playerPosition->y = (1.5f - radius) - 0.01f; impactDirection = (Vector3) { impactDirection.x, 1, impactDirection.z}; } - + free(cubicmapPixels); return impactDirection; @@ -2049,9 +2049,9 @@ static Mesh LoadOBJ(const char *fileName) static Material LoadMTL(const char *fileName) { #define MAX_BUFFER_SIZE 128 - + Material material = { 0 }; // LoadDefaultMaterial(); - + char buffer[MAX_BUFFER_SIZE]; Vector3 color = { 1.0f, 1.0f, 1.0f }; char *mapFileName = NULL; @@ -2069,14 +2069,14 @@ static Material LoadMTL(const char *fileName) while (!feof(mtlFile)) { fgets(buffer, MAX_BUFFER_SIZE, mtlFile); - + switch (buffer[0]) { case 'n': // newmtl string Material name. Begins a new material description. { // TODO: Support multiple materials in a single .mtl sscanf(buffer, "newmtl %s", mapFileName); - + TraceLog(INFO, "[%s] Loading material...", mapFileName); } case 'i': // illum int Illumination model @@ -2123,7 +2123,7 @@ static Material LoadMTL(const char *fileName) { int shininess = 0; sscanf(buffer, "Ns %i", &shininess); - + material.glossiness = (float)shininess; } else if (buffer[1] == 'i') // Ni int Refraction index. @@ -2192,7 +2192,7 @@ static Material LoadMTL(const char *fileName) float ialpha = 0.0f; sscanf(buffer, "Tr %f", &ialpha); material.colDiffuse.a = (unsigned char)((1.0f - ialpha)*255); - + } break; case 'r': // refl string Reflection texture map default: break; @@ -2203,6 +2203,6 @@ static Material LoadMTL(const char *fileName) // NOTE: At this point we have all material data TraceLog(INFO, "[%s] Material loaded successfully", fileName); - + return material; } diff --git a/src/raylib.h b/src/raylib.h index 22494aec..7b7348c8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -930,8 +930,8 @@ RLAPI void SetMusicPitch(Music music, float pitch); // Set pit RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) -RLAPI AudioStream InitAudioStream(unsigned int sampleRate, - unsigned int sampleSize, +RLAPI AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream audio pcm data) RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory diff --git a/src/rlgl.h b/src/rlgl.h index bcb7c24f..3fc54219 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -107,7 +107,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // byte type typedef unsigned char byte; - + // Color type, RGBA (32bit) typedef struct Color { unsigned char r; @@ -117,7 +117,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; } Color; // Texture formats (support depends on OpenGL version) - typedef enum { + typedef enum { UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) UNCOMPRESSED_GRAY_ALPHA, UNCOMPRESSED_R5G6B5, // 16 bpp @@ -157,7 +157,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // Shader type (generic shader) typedef struct Shader { unsigned int id; // Shader program id - + // Vertex attributes locations (default locations) int vertexLoc; // Vertex attribute location point (default-location = 0) int texcoordLoc; // Texcoord attribute location point (default-location = 1) @@ -169,7 +169,7 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) int tintColorLoc; // Color uniform location point (fragment shader) - + // Texture map locations (generic for any kind of map) int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) int mapTexture1Loc; // Map texture uniform location point (default-texture-unit = 1) @@ -185,14 +185,14 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; int mipmaps; // Mipmap levels, 1 by default int format; // Data format (TextureFormat) } Texture2D; - + // RenderTexture2D type, for texture rendering typedef struct RenderTexture2D { unsigned int id; // Render texture (fbo) id Texture2D texture; // Color buffer attachment texture Texture2D depth; // Depth buffer attachment texture } RenderTexture2D; - + // Material type typedef struct Material { Shader shader; // Standard shader (supports 3 map types: diffuse, normal, specular) @@ -204,10 +204,10 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; Color colDiffuse; // Diffuse color Color colAmbient; // Ambient color Color colSpecular; // Specular color - + float glossiness; // Glossiness level (Ranges from 0 to 1000) } Material; - + // Camera type, defines a camera position/orientation in 3d space typedef struct Camera { Vector3 position; // Camera position @@ -225,22 +225,22 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; Vector3 position; // Light position Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) float radius; // Light attenuation radius light intensity reduced with distance (world distance) - + Color diffuse; // Light diffuse color float intensity; // Light intensity level - + float coneAngle; // Light cone max angle: LIGHT_SPOT } LightData, *Light; - + // Light types typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; - + // TraceLog message types typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; - + // VR Head Mounted Display devices typedef enum { HMD_DEFAULT_DEVICE = 0, diff --git a/src/rlua.h b/src/rlua.h index b100b06d..1c8c7b38 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -6,7 +6,7 @@ * The following types: * Color, Vector2, Vector3, Rectangle, Ray, Camera, Camera2D * are treated as objects with named fields, same as in C. -* +* * Lua defines utility functions for creating those objects. * Usage: * local cl = Color(255,255,255,255) @@ -27,7 +27,7 @@ * NOTE 02: * Some raylib functions take a pointer to an array, and the size of that array. * The equivalent Lua functions take only an array table of the specified type UNLESS -* it's a pointer to a large char array (e.g. for images), then it takes (and potentially returns) +* it's a pointer to a large char array (e.g. for images), then it takes (and potentially returns) * a Lua string (without the size argument, as Lua strings are sized by default). * * NOTE 03: @@ -362,7 +362,7 @@ static void LuaBuildOpaqueMetatables(void) lua_pushcfunction(L, &LuaIndexTexture2D); lua_setfield(L, -2, "__index"); lua_pop(L, 1); - + luaL_newmetatable(L, "RenderTexture2D"); lua_pushcfunction(L, &LuaIndexRenderTexture2D); lua_setfield(L, -2, "__index"); @@ -3112,7 +3112,7 @@ int lua_TraceLog(lua_State* L) lua_getfield(L, 1, "format"); /// fmt, args..., [string], format() lua_rotate(L, 1, 2); /// [string], format(), fmt, args... lua_call(L, num_args, 1); /// [string], formatted_string - + TraceLog(arg1, "%s", luaL_checkstring(L,-1)); return 0; } @@ -3525,7 +3525,7 @@ int lua_QuaternionTransform(lua_State* L) // raylib Functions (and data types) list static luaL_Reg raylib_functions[] = { - + // Register non-opaque data types REG(Color) REG(Vector2) @@ -3547,7 +3547,7 @@ static luaL_Reg raylib_functions[] = { REG(ToggleFullscreen) REG(GetScreenWidth) REG(GetScreenHeight) - + REG(ShowCursor) REG(HideCursor) REG(IsCursorHidden) @@ -3563,11 +3563,11 @@ static luaL_Reg raylib_functions[] = { REG(End3dMode) REG(BeginTextureMode) REG(EndTextureMode) - + REG(GetMouseRay) REG(GetWorldToScreen) REG(GetCameraMatrix) - + #if defined(PLATFORM_WEB) REG(SetDrawingLoop) #else @@ -3575,7 +3575,7 @@ static luaL_Reg raylib_functions[] = { #endif REG(GetFPS) REG(GetFrameTime) - + REG(GetColor) REG(GetHexValue) REG(ColorToFloat) @@ -3585,13 +3585,13 @@ static luaL_Reg raylib_functions[] = { REG(Fade) REG(SetConfigFlags) REG(ShowLogo) - + REG(IsFileDropped) REG(GetDroppedFiles) REG(ClearDroppedFiles) REG(StorageSaveValue) REG(StorageLoadValue) - + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) REG(IsKeyPressed) REG(IsKeyDown) @@ -3599,7 +3599,7 @@ static luaL_Reg raylib_functions[] = { REG(IsKeyUp) REG(GetKeyPressed) REG(SetExitKey) - + REG(IsGamepadAvailable) REG(GetGamepadAxisMovement) REG(IsGamepadButtonPressed) @@ -3643,13 +3643,13 @@ static luaL_Reg raylib_functions[] = { REG(SetCameraPosition) REG(SetCameraTarget) REG(SetCameraFovy) - + REG(SetCameraPanControl) REG(SetCameraAltControl) REG(SetCameraSmoothZoomControl) REG(SetCameraMoveControls) REG(SetCameraMouseSensitivity) - + REG(DrawPixel) REG(DrawPixelV) REG(DrawLine) @@ -3668,7 +3668,7 @@ static luaL_Reg raylib_functions[] = { REG(DrawPoly) REG(DrawPolyEx) REG(DrawPolyExLines) - + REG(CheckCollisionRecs) REG(CheckCollisionCircles) REG(CheckCollisionCircleRec) @@ -3676,7 +3676,7 @@ static luaL_Reg raylib_functions[] = { REG(CheckCollisionPointRec) REG(CheckCollisionPointCircle) REG(CheckCollisionPointTriangle) - + REG(LoadImage) REG(LoadImageEx) REG(LoadImageRaw) @@ -3712,13 +3712,13 @@ static luaL_Reg raylib_functions[] = { REG(ImageColorBrightness) REG(GenTextureMipmaps) REG(UpdateTexture) - + REG(DrawTexture) REG(DrawTextureV) REG(DrawTextureEx) REG(DrawTextureRec) REG(DrawTexturePro) - + REG(GetDefaultFont) REG(LoadSpriteFont) REG(UnloadSpriteFont) @@ -3727,7 +3727,7 @@ static luaL_Reg raylib_functions[] = { REG(MeasureText) REG(MeasureTextEx) REG(DrawFPS) - + REG(DrawLine3D) REG(DrawCircle3D) REG(DrawCube) @@ -3744,7 +3744,7 @@ static luaL_Reg raylib_functions[] = { REG(DrawGrid) REG(DrawGizmo) REG(DrawLight) - + REG(LoadModel) REG(LoadModelEx) REG(LoadModelFromRES) @@ -3756,7 +3756,7 @@ static luaL_Reg raylib_functions[] = { REG(LoadStandardMaterial) REG(UnloadMaterial) //REG(GenMesh*) // Not ready yet... - + REG(DrawModel) REG(DrawModelEx) REG(DrawModelWires) @@ -3771,7 +3771,7 @@ static luaL_Reg raylib_functions[] = { REG(CheckCollisionRaySphereEx) REG(CheckCollisionRayBox) REG(ResolveCollisionCubicmap) - + REG(LoadShader) REG(UnloadShader) REG(GetDefaultShader) @@ -3789,13 +3789,13 @@ static luaL_Reg raylib_functions[] = { REG(EndBlendMode) REG(CreateLight) REG(DestroyLight) - + REG(InitVrDevice) REG(CloseVrDevice) REG(IsVrDeviceReady) REG(UpdateVrTracking) REG(ToggleVrMode) - + REG(InitAudioDevice) REG(CloseAudioDevice) REG(IsAudioDeviceReady) @@ -3810,7 +3810,7 @@ static luaL_Reg raylib_functions[] = { REG(IsSoundPlaying) REG(SetSoundVolume) REG(SetSoundPitch) - + REG(LoadMusicStream) REG(UnloadMusicStream) REG(UpdateMusicStream) @@ -3823,7 +3823,7 @@ static luaL_Reg raylib_functions[] = { REG(SetMusicPitch) REG(GetMusicTimeLength) REG(GetMusicTimePlayed) - + REG(InitAudioStream) REG(UpdateAudioStream) REG(CloseAudioStream) @@ -3906,7 +3906,7 @@ RLUADEF void InitLuaDevice(void) { mainLuaState = luaL_newstate(); L = mainLuaState; - + LuaStartEnum(); LuaSetEnum("FULLSCREEN_MODE", 1); LuaSetEnum("SHOW_LOGO", 2); @@ -4001,7 +4001,7 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("PS3_BUTTON_L2", 8); LuaSetEnum("PS3_BUTTON_SELECT", 9); LuaSetEnum("PS3_BUTTON_START", 10); - + LuaSetEnum("XBOX_BUTTON_A", 0); LuaSetEnum("XBOX_BUTTON_B", 1); LuaSetEnum("XBOX_BUTTON_X", 2); @@ -4086,9 +4086,9 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("ADDITIVE", BLEND_ADDITIVE); LuaSetEnum("MULTIPLIED", BLEND_MULTIPLIED); LuaEndEnum("BlendMode"); - + LuaStartEnum(); - LuaSetEnum("POINT", LIGHT_POINT); + LuaSetEnum("POINT", LIGHT_POINT); LuaSetEnum("DIRECTIONAL", LIGHT_DIRECTIONAL); LuaSetEnum("SPOT", LIGHT_SPOT); LuaEndEnum("LightType"); @@ -4114,7 +4114,7 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("FIRST_PERSON", CAMERA_FIRST_PERSON); LuaSetEnum("THIRD_PERSON", CAMERA_THIRD_PERSON); LuaEndEnum("CameraMode"); - + LuaStartEnum(); LuaSetEnum("DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); LuaSetEnum("OCULUS_RIFT_DK2", HMD_OCULUS_RIFT_DK2); @@ -4138,9 +4138,9 @@ RLUADEF void InitLuaDevice(void) lua_pushboolean(L, true); #if defined(PLATFORM_DESKTOP) lua_setglobal(L, "PLATFORM_DESKTOP"); -#elif defined(PLATFORM_ANDROID) +#elif defined(PLATFORM_ANDROID) lua_setglobal(L, "PLATFORM_ANDROID"); -#elif defined(PLATFORM_RPI) +#elif defined(PLATFORM_RPI) lua_setglobal(L, "PLATFORM_RPI"); #elif defined(PLATFORM_WEB) lua_setglobal(L, "PLATFORM_WEB"); @@ -4148,7 +4148,7 @@ RLUADEF void InitLuaDevice(void) luaL_openlibs(L); LuaBuildOpaqueMetatables(); - + LuaRegisterRayLib(0); } @@ -4173,7 +4173,7 @@ RLUADEF void ExecuteLuaCode(const char *code) } int result = luaL_dostring(L, code); - + switch (result) { case LUA_OK: break; @@ -4193,7 +4193,7 @@ RLUADEF void ExecuteLuaFile(const char *filename) } int result = luaL_dofile(L, filename); - + switch (result) { case LUA_OK: break; diff --git a/src/text.c b/src/text.c index 2f347b5d..8dc55455 100644 --- a/src/text.c +++ b/src/text.c @@ -151,7 +151,7 @@ extern void LoadDefaultFont(void) //---------------------------------------------------------------------- int imWidth = 128; int imHeight = 128; - + Color *imagePixels = (Color *)malloc(imWidth*imHeight*sizeof(Color)); for (int i = 0; i < imWidth*imHeight; i++) imagePixels[i] = BLANK; // Initialize array @@ -174,7 +174,7 @@ extern void LoadDefaultFont(void) //FILE *myimage = fopen("default_font.raw", "wb"); //fwrite(image.pixels, 1, 128*128*4, myimage); //fclose(myimage); - + Image image = LoadImageEx(imagePixels, imWidth, imHeight); ImageFormat(&image, UNCOMPRESSED_GRAY_ALPHA); @@ -185,13 +185,13 @@ extern void LoadDefaultFont(void) // Reconstruct charSet using charsWidth[], charsHeight, charsDivisor, numChars //------------------------------------------------------------------------------ - defaultFont.charValues = (int *)malloc(defaultFont.numChars*sizeof(int)); + defaultFont.charValues = (int *)malloc(defaultFont.numChars*sizeof(int)); defaultFont.charRecs = (Rectangle *)malloc(defaultFont.numChars*sizeof(Rectangle)); // Allocate space for our character rectangle data // This memory should be freed at end! --> Done on CloseWindow() - + defaultFont.charOffsets = (Vector2 *)malloc(defaultFont.numChars*sizeof(Vector2)); defaultFont.charAdvanceX = (int *)malloc(defaultFont.numChars*sizeof(int)); - + int currentLine = 0; int currentPosX = charsDivisor; int testPosX = charsDivisor; @@ -199,7 +199,7 @@ extern void LoadDefaultFont(void) for (int i = 0; i < defaultFont.numChars; i++) { defaultFont.charValues[i] = FONT_FIRST_CHAR + i; // First char is 32 - + defaultFont.charRecs[i].x = currentPosX; defaultFont.charRecs[i].y = charsDivisor + currentLine * (charsHeight + charsDivisor); defaultFont.charRecs[i].width = charsWidth[i]; @@ -217,12 +217,12 @@ extern void LoadDefaultFont(void) defaultFont.charRecs[i].y = charsDivisor + currentLine*(charsHeight + charsDivisor); } else currentPosX = testPosX; - + // NOTE: On default font character offsets and xAdvance are not required defaultFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; defaultFont.charAdvanceX[i] = 0; } - + defaultFont.size = defaultFont.charRecs[0].height; TraceLog(INFO, "[TEX ID %i] Default font loaded successfully", defaultFont.texture.id); @@ -262,7 +262,7 @@ SpriteFont LoadSpriteFont(const char *fileName) if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, FONT_FIRST_CHAR); UnloadImage(image); } - + if (spriteFont.texture.id == 0) { TraceLog(WARNING, "[%s] SpriteFont could not be loaded, using default font", fileName); @@ -316,15 +316,15 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float scaleFactor = fontSize/spriteFont.size; - // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly + // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly // written in C code files (codified by default as UTF-8) - + for(int i = 0; i < length; i++) { // TODO: Right now we are supposing characters that follow a continous order and start at FONT_FIRST_CHAR, // this sytem can be improved to support any characters order and init value... // An intermediate table could be created to link char values with predefined char position index in chars rectangle array - + if ((unsigned char)text[i] == 0xc2) // UTF-8 encoding identification HACK! { // Support UTF-8 encoded values from [0xc2 0x80] -> [0xc2 0xbf](¿) @@ -353,8 +353,8 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float if (rec.x > 0) { - DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].x*scaleFactor, - position.y + textOffsetY + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].y*scaleFactor, + DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].x*scaleFactor, + position.y + textOffsetY + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].y*scaleFactor, rec.width*scaleFactor, rec.height*scaleFactor} , (Vector2){ 0, 0 }, 0.0f, tint); if (spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR] == 0) textOffsetX += (rec.width*scaleFactor + spacing); @@ -381,15 +381,15 @@ const char *SubText(const char *text, int position, int length) { static char buffer[MAX_SUBTEXT_LENGTH]; int textLength = strlen(text); - + if (position >= textLength) { position = textLength - 1; length = 0; } - + if (length >= textLength) length = textLength; - + for (int c = 0 ; c < length ; c++) { *(buffer+c) = *(text+position); @@ -421,17 +421,17 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int int len = strlen(text); int tempLen = 0; // Used to count longer text line num chars int lenCounter = 0; - + int textWidth = 0; int tempTextWidth = 0; // Used to count longer text line width - + int textHeight = spriteFont.size; float scaleFactor; for (int i = 0; i < len; i++) { lenCounter++; - + if (text[i] != '\n') { if (spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR] != 0) textWidth += spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR]; @@ -444,10 +444,10 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int textWidth = 0; textHeight += (spriteFont.size + spriteFont.size/2); // NOTE: Fixed line spacing of 1.5 lines } - + if (tempLen < lenCounter) tempLen = lenCounter; } - + if (tempTextWidth < textWidth) tempTextWidth = textWidth; if (fontSize <= spriteFont.size) scaleFactor = 1.0f; @@ -496,21 +496,21 @@ void DrawFPS(int posX, int posY) static SpriteFont LoadImageFont(Image image, Color key, int firstChar) { #define COLOR_EQUAL(col1, col2) ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) - + int charSpacing = 0; int lineSpacing = 0; int x = 0; int y = 0; - + // Default number of characters expected supported #define MAX_FONTCHARS 128 - // We allocate a temporal arrays for chars data measures, + // We allocate a temporal arrays for chars data measures, // once we get the actual number of chars, we copy data to a sized arrays int tempCharValues[MAX_FONTCHARS]; Rectangle tempCharRecs[MAX_FONTCHARS]; - + Color *pixels = GetImageData(image); // Parse image data to get charSpacing and lineSpacing @@ -545,7 +545,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) !COLOR_EQUAL((pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead]), key)) { tempCharValues[index] = firstChar + index; - + tempCharRecs[index].x = xPosToRead; tempCharRecs[index].y = lineSpacing + lineToRead * (charHeight + lineSpacing); tempCharRecs[index].height = charHeight; @@ -564,14 +564,14 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) lineToRead++; xPosToRead = charSpacing; } - + free(pixels); - + TraceLog(DEBUG, "SpriteFont data parsed correctly from image"); - + // Create spritefont with all data parsed from image SpriteFont spriteFont = { 0 }; - + spriteFont.texture = LoadTextureFromImage(image); // Convert loaded image to OpenGL texture spriteFont.numChars = index; @@ -586,12 +586,12 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) { spriteFont.charValues[i] = tempCharValues[i]; spriteFont.charRecs[i] = tempCharRecs[i]; - + // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; spriteFont.charAdvanceX[i] = 0; } - + spriteFont.size = spriteFont.charRecs[0].height; return spriteFont; @@ -631,7 +631,7 @@ static SpriteFont LoadRBMF(const char *fileName) if (rbmfFile == NULL) { TraceLog(WARNING, "[%s] rBMF font file could not be opened, using default font", fileName); - + spriteFont = GetDefaultFont(); } else @@ -670,10 +670,10 @@ static SpriteFont LoadRBMF(const char *fileName) counter++; } - + Image image = LoadImageEx(imagePixels, rbmfHeader.imgWidth, rbmfHeader.imgHeight); ImageFormat(&image, UNCOMPRESSED_GRAY_ALPHA); - + free(imagePixels); TraceLog(DEBUG, "[%s] Image reconstructed correctly, now converting it to texture", fileName); @@ -685,7 +685,7 @@ static SpriteFont LoadRBMF(const char *fileName) //TraceLog(INFO, "[%s] Starting chars set reconstruction", fileName); // Get characters data using rbmfCharWidthData, rbmfHeader.charHeight, charsDivisor, rbmfHeader.numChars - spriteFont.charValues = (int *)malloc(spriteFont.numChars*sizeof(int)); + spriteFont.charValues = (int *)malloc(spriteFont.numChars*sizeof(int)); spriteFont.charRecs = (Rectangle *)malloc(spriteFont.numChars*sizeof(Rectangle)); spriteFont.charOffsets = (Vector2 *)malloc(spriteFont.numChars*sizeof(Vector2)); spriteFont.charAdvanceX = (int *)malloc(spriteFont.numChars*sizeof(int)); @@ -697,12 +697,12 @@ static SpriteFont LoadRBMF(const char *fileName) for (int i = 0; i < spriteFont.numChars; i++) { spriteFont.charValues[i] = (int)rbmfHeader.firstChar + i; - + spriteFont.charRecs[i].x = currentPosX; spriteFont.charRecs[i].y = charsDivisor + currentLine * ((int)rbmfHeader.charHeight + charsDivisor); spriteFont.charRecs[i].width = (int)rbmfCharWidthData[i]; spriteFont.charRecs[i].height = (int)rbmfHeader.charHeight; - + // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; spriteFont.charAdvanceX[i] = 0; @@ -720,7 +720,7 @@ static SpriteFont LoadRBMF(const char *fileName) } else currentPosX = testPosX; } - + spriteFont.size = spriteFont.charRecs[0].height; TraceLog(INFO, "[%s] rBMF file loaded correctly as SpriteFont", fileName); @@ -738,20 +738,20 @@ static SpriteFont LoadRBMF(const char *fileName) static SpriteFont LoadBMFont(const char *fileName) { #define MAX_BUFFER_SIZE 256 - + SpriteFont font = { 0 }; font.texture.id = 0; - + char buffer[MAX_BUFFER_SIZE]; char *searchPoint = NULL; - + int fontSize = 0; int texWidth, texHeight; char texFileName[128]; int numChars = 0; int base; // Useless data - + FILE *fntFile; fntFile = fopen(fileName, "rt"); @@ -766,42 +766,42 @@ static SpriteFont LoadBMFont(const char *fileName) fgets(buffer, MAX_BUFFER_SIZE, fntFile); //searchPoint = strstr(buffer, "size"); //sscanf(searchPoint, "size=%i", &fontSize); - + fgets(buffer, MAX_BUFFER_SIZE, fntFile); searchPoint = strstr(buffer, "lineHeight"); sscanf(searchPoint, "lineHeight=%i base=%i scaleW=%i scaleH=%i", &fontSize, &base, &texWidth, &texHeight); - + TraceLog(DEBUG, "[%s] Font size: %i", fileName, fontSize); TraceLog(DEBUG, "[%s] Font texture scale: %ix%i", fileName, texWidth, texHeight); - + fgets(buffer, MAX_BUFFER_SIZE, fntFile); searchPoint = strstr(buffer, "file"); sscanf(searchPoint, "file=\"%128[^\"]\"", texFileName); - + TraceLog(DEBUG, "[%s] Font texture filename: %s", fileName, texFileName); - + fgets(buffer, MAX_BUFFER_SIZE, fntFile); searchPoint = strstr(buffer, "count"); sscanf(searchPoint, "count=%i", &numChars); - + TraceLog(DEBUG, "[%s] Font num chars: %i", fileName, numChars); - + // Compose correct path using route of .fnt file (fileName) and texFileName char *texPath = NULL; char *lastSlash = NULL; lastSlash = strrchr(fileName, '/'); - + // NOTE: We need some extra space to avoid memory corruption on next allocations! texPath = malloc(strlen(fileName) - strlen(lastSlash) + strlen(texFileName) + 4); - + // NOTE: strcat() and strncat() required a '\0' terminated string to work! *texPath = '\0'; strncat(texPath, fileName, strlen(fileName) - strlen(lastSlash) + 1); strncat(texPath, texFileName, strlen(texFileName)); TraceLog(DEBUG, "[%s] Font texture loading path: %s", fileName, texPath); - + font.texture = LoadTexture(texPath); font.size = fontSize; font.numChars = numChars; @@ -809,35 +809,35 @@ static SpriteFont LoadBMFont(const char *fileName) font.charRecs = (Rectangle *)malloc(numChars*sizeof(Rectangle)); font.charOffsets = (Vector2 *)malloc(numChars*sizeof(Vector2)); font.charAdvanceX = (int *)malloc(numChars*sizeof(int)); - + free(texPath); - + int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; - + bool unorderedChars = false; int firstChar = 0; - + for (int i = 0; i < numChars; i++) { fgets(buffer, MAX_BUFFER_SIZE, fntFile); - sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", + sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", &charId, &charX, &charY, &charWidth, &charHeight, &charOffsetX, &charOffsetY, &charAdvanceX); - + if (i == 0) firstChar = charId; else if (i != (charId - firstChar)) unorderedChars = true; - + // Save data properly in sprite font font.charValues[i] = charId; font.charRecs[i] = (Rectangle){ charX, charY, charWidth, charHeight }; font.charOffsets[i] = (Vector2){ (float)charOffsetX, (float)charOffsetY }; font.charAdvanceX[i] = charAdvanceX; } - + fclose(fntFile); - + if (firstChar != FONT_FIRST_CHAR) TraceLog(WARNING, "BMFont not supported: expected SPACE(32) as first character, falling back to default font"); else if (unorderedChars) TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); - + // NOTE: Font data could be not ordered by charId: 32,33,34,35... raylib does not support unordered BMFonts if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars) || (font.texture.id == 0)) { @@ -862,9 +862,9 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); SpriteFont font = { 0 }; - + FILE *ttfFile = fopen(fileName, "rb"); - + if (ttfFile == NULL) { TraceLog(WARNING, "[%s] FNT file could not be opened", fileName); @@ -877,11 +877,11 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int stbtt_BakeFontBitmap(ttfBuffer,0, fontSize, dataBitmap, FONT_TEXTURE_WIDTH, FONT_TEXTURE_HEIGHT, firstChar, numChars, charData); free(ttfBuffer); - + // Convert image data from grayscale to to UNCOMPRESSED_GRAY_ALPHA unsigned char *dataGrayAlpha = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)*2); // Two channels int k = 0; - + for (int i = 0; i < FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT; i++) { dataGrayAlpha[k] = 255; @@ -889,9 +889,9 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int k += 2; } - + free(dataBitmap); - + // Sprite font generation from TTF extracted data Image image; image.width = FONT_TEXTURE_WIDTH; @@ -909,7 +909,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int font.charRecs = (Rectangle *)malloc(font.numChars*sizeof(Rectangle)); font.charOffsets = (Vector2 *)malloc(font.numChars*sizeof(Vector2)); font.charAdvanceX = (int *)malloc(font.numChars*sizeof(int)); - + for (int i = 0; i < font.numChars; i++) { font.charValues[i] = i + firstChar; @@ -918,11 +918,11 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int font.charRecs[i].y = (int)charData[i].y0; font.charRecs[i].width = (int)charData[i].x1 - (int)charData[i].x0; font.charRecs[i].height = (int)charData[i].y1 - (int)charData[i].y0; - + font.charOffsets[i] = (Vector2){ charData[i].xoff, charData[i].yoff }; font.charAdvanceX[i] = (int)charData[i].xadvance; } - + free(charData); return font; diff --git a/src/textures.c b/src/textures.c index c6b7e0bb..8f4fa301 100644 --- a/src/textures.c +++ b/src/textures.c @@ -33,7 +33,7 @@ #include // Required for: strcmp(), strrchr(), strncmp() #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2 - // Required: rlglLoadTexture() rlDeleteTextures(), + // Required: rlglLoadTexture() rlDeleteTextures(), // rlglGenerateMipmaps(), some funcs for DrawTexturePro() #include "utils.h" // rRES data decompression utility function @@ -44,7 +44,7 @@ // NOTE: Used to read image data (multiple formats support) #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() +#include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() // NOTE: Used for image scaling on ImageResize() //---------------------------------------------------------------------------------- @@ -103,14 +103,14 @@ Image LoadImage(const char *fileName) int imgWidth = 0; int imgHeight = 0; int imgBpp = 0; - + // NOTE: Using stb_image to load images (Supports: BMP, TGA, PNG, JPG, ...) image.data = stbi_load(fileName, &imgWidth, &imgHeight, &imgBpp, 0); image.width = imgWidth; image.height = imgHeight; image.mipmaps = 1; - + if (imgBpp == 1) image.format = UNCOMPRESSED_GRAYSCALE; else if (imgBpp == 2) image.format = UNCOMPRESSED_GRAY_ALPHA; else if (imgBpp == 3) image.format = UNCOMPRESSED_R8G8B8; @@ -121,12 +121,12 @@ Image LoadImage(const char *fileName) else if (strcmp(GetExtension(fileName),"ktx") == 0) image = LoadKTX(fileName); else if (strcmp(GetExtension(fileName),"pvr") == 0) image = LoadPVR(fileName); else if (strcmp(GetExtension(fileName),"astc") == 0) image = LoadASTC(fileName); - + if (image.data != NULL) - { + { TraceLog(INFO, "[%s] Image loaded successfully (%ix%i)", fileName, image.width, image.height); } - else TraceLog(WARNING, "[%s] Image could not be loaded, file not recognized", fileName); + else TraceLog(WARNING, "[%s] Image could not be loaded, file not recognized", fileName); return image; } @@ -141,11 +141,11 @@ Image LoadImageEx(Color *pixels, int width, int height) image.height = height; image.mipmaps = 1; image.format = UNCOMPRESSED_R8G8B8A8; - + int k = 0; image.data = (unsigned char *)malloc(image.width*image.height*4*sizeof(unsigned char)); - + for (int i = 0; i < image.width*image.height*4; i += 4) { ((unsigned char *)image.data)[i] = pixels[k].r; @@ -180,7 +180,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int if (headerSize > 0) fseek(rawFile, headerSize, SEEK_SET); unsigned int size = width*height; - + switch (format) { case UNCOMPRESSED_GRAYSCALE: image.data = (unsigned char *)malloc(size); break; // 8 bit per pixel (no alpha) @@ -192,16 +192,16 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int case UNCOMPRESSED_R8G8B8A8: image.data = (unsigned char *)malloc(size*4); size *= 4; break; // 32 bpp default: TraceLog(WARNING, "Image format not suported"); break; } - + fread(image.data, size, 1, rawFile); - + // TODO: Check if data have been read - + image.width = width; image.height = height; image.mipmaps = 0; image.format = format; - + fclose(rawFile); } @@ -326,9 +326,9 @@ Texture2D LoadTexture(const char *fileName) Texture2D texture; Image image = LoadImage(fileName); - + if (image.data != NULL) - { + { texture = LoadTextureFromImage(image); UnloadImage(image); } @@ -350,9 +350,9 @@ Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat) texture.height = height; texture.mipmaps = 1; texture.format = textureFormat; - + texture.id = rlglLoadTexture(data, width, height, textureFormat, 1); - + return texture; } @@ -380,7 +380,7 @@ Texture2D LoadTextureFromImage(Image image) texture.height = 0; texture.mipmaps = 0; texture.format = 0; - + texture.id = rlglLoadTexture(image.data, image.width, image.height, image.format, image.mipmaps); texture.width = image.width; @@ -395,7 +395,7 @@ Texture2D LoadTextureFromImage(Image image) RenderTexture2D LoadRenderTexture(int width, int height) { RenderTexture2D target = rlglLoadRenderTexture(width, height); - + return target; } @@ -403,7 +403,7 @@ RenderTexture2D LoadRenderTexture(int width, int height) void UnloadImage(Image image) { free(image.data); - + // NOTE: It becomes anoying every time a texture is loaded //TraceLog(INFO, "Unloaded image data"); } @@ -414,7 +414,7 @@ void UnloadTexture(Texture2D texture) if (texture.id != 0) { rlDeleteTextures(texture.id); - + TraceLog(INFO, "[TEX ID %i] Unloaded texture data from VRAM (GPU)", texture.id); } } @@ -429,7 +429,7 @@ void UnloadRenderTexture(RenderTexture2D target) Color *GetImageData(Image image) { Color *pixels = (Color *)malloc(image.width*image.height*sizeof(Color)); - + int k = 0; for (int i = 0; i < image.width*image.height; i++) @@ -442,7 +442,7 @@ Color *GetImageData(Image image) pixels[i].g = ((unsigned char *)image.data)[k]; pixels[i].b = ((unsigned char *)image.data)[k]; pixels[i].a = 255; - + k++; } break; case UNCOMPRESSED_GRAY_ALPHA: @@ -451,7 +451,7 @@ Color *GetImageData(Image image) pixels[i].g = ((unsigned char *)image.data)[k]; pixels[i].b = ((unsigned char *)image.data)[k]; pixels[i].a = ((unsigned char *)image.data)[k + 1]; - + k += 2; } break; case UNCOMPRESSED_R5G5B5A1: @@ -462,7 +462,7 @@ Color *GetImageData(Image image) pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111000000) >> 6)*(255/31)); pixels[i].b = (unsigned char)((float)((pixel & 0b0000000000111110) >> 1)*(255/31)); pixels[i].a = (unsigned char)((pixel & 0b0000000000000001)*255); - + k++; } break; case UNCOMPRESSED_R5G6B5: @@ -473,18 +473,18 @@ Color *GetImageData(Image image) pixels[i].g = (unsigned char)((float)((pixel & 0b0000011111100000) >> 5)*(255/63)); pixels[i].b = (unsigned char)((float)(pixel & 0b0000000000011111)*(255/31)); pixels[i].a = 255; - + k++; } break; case UNCOMPRESSED_R4G4B4A4: { unsigned short pixel = ((unsigned short *)image.data)[k]; - + pixels[i].r = (unsigned char)((float)((pixel & 0b1111000000000000) >> 12)*(255/15)); pixels[i].g = (unsigned char)((float)((pixel & 0b0000111100000000) >> 8)*(255/15)); pixels[i].b = (unsigned char)((float)((pixel & 0b0000000011110000) >> 4)*(255/15)); pixels[i].a = (unsigned char)((float)(pixel & 0b0000000000001111)*(255/15)); - + k++; } break; case UNCOMPRESSED_R8G8B8A8: @@ -493,7 +493,7 @@ Color *GetImageData(Image image) pixels[i].g = ((unsigned char *)image.data)[k + 1]; pixels[i].b = ((unsigned char *)image.data)[k + 2]; pixels[i].a = ((unsigned char *)image.data)[k + 3]; - + k += 4; } break; case UNCOMPRESSED_R8G8B8: @@ -502,11 +502,11 @@ Color *GetImageData(Image image) pixels[i].g = (unsigned char)((unsigned char *)image.data)[k + 1]; pixels[i].b = (unsigned char)((unsigned char *)image.data)[k + 2]; pixels[i].a = 255; - + k += 3; } break; default: TraceLog(WARNING, "Format not supported for pixel data retrieval"); break; - } + } } return pixels; @@ -522,7 +522,7 @@ Image GetTextureData(Texture2D texture) if (texture.format < 8) { image.data = rlglReadTexturePixels(texture); - + if (image.data != NULL) { image.width = texture.width; @@ -551,29 +551,29 @@ void ImageFormat(Image *image, int newFormat) if ((image->format < 8) && (newFormat < 8)) { Color *pixels = GetImageData(*image); - + free(image->data); - + image->format = newFormat; int k = 0; - + switch (image->format) { case UNCOMPRESSED_GRAYSCALE: { image->data = (unsigned char *)malloc(image->width*image->height*sizeof(unsigned char)); - + for (int i = 0; i < image->width*image->height; i++) { ((unsigned char *)image->data)[i] = (unsigned char)((float)pixels[i].r*0.299f + (float)pixels[i].g*0.587f + (float)pixels[i].b*0.114f); } - + } break; case UNCOMPRESSED_GRAY_ALPHA: { image->data = (unsigned char *)malloc(image->width*image->height*2*sizeof(unsigned char)); - + for (int i = 0; i < image->width*image->height*2; i += 2) { ((unsigned char *)image->data)[i] = (unsigned char)((float)pixels[k].r*0.299f + (float)pixels[k].g*0.587f + (float)pixels[k].b*0.114f); @@ -585,17 +585,17 @@ void ImageFormat(Image *image, int newFormat) case UNCOMPRESSED_R5G6B5: { image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - + unsigned char r = 0; unsigned char g = 0; unsigned char b = 0; - + for (int i = 0; i < image->width*image->height; i++) { r = (unsigned char)(round((float)pixels[k].r*31/255)); g = (unsigned char)(round((float)pixels[k].g*63/255)); b = (unsigned char)(round((float)pixels[k].b*31/255)); - + ((unsigned short *)image->data)[i] = (unsigned short)r << 11 | (unsigned short)g << 5 | (unsigned short)b; } @@ -603,7 +603,7 @@ void ImageFormat(Image *image, int newFormat) case UNCOMPRESSED_R8G8B8: { image->data = (unsigned char *)malloc(image->width*image->height*3*sizeof(unsigned char)); - + for (int i = 0; i < image->width*image->height*3; i += 3) { ((unsigned char *)image->data)[i] = pixels[k].r; @@ -615,49 +615,49 @@ void ImageFormat(Image *image, int newFormat) case UNCOMPRESSED_R5G5B5A1: { #define ALPHA_THRESHOLD 50 - + image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - + unsigned char r = 0; unsigned char g = 0; unsigned char b = 0; unsigned char a = 0; - + for (int i = 0; i < image->width*image->height; i++) { r = (unsigned char)(round((float)pixels[i].r*31/255)); g = (unsigned char)(round((float)pixels[i].g*31/255)); b = (unsigned char)(round((float)pixels[i].b*31/255)); a = (pixels[i].a > ALPHA_THRESHOLD) ? 1 : 0; - + ((unsigned short *)image->data)[i] = (unsigned short)r << 11 | (unsigned short)g << 6 | (unsigned short)b << 1 | (unsigned short)a; } - + } break; case UNCOMPRESSED_R4G4B4A4: { image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - + unsigned char r = 0; unsigned char g = 0; unsigned char b = 0; unsigned char a = 0; - + for (int i = 0; i < image->width*image->height; i++) { r = (unsigned char)(round((float)pixels[i].r*15/255)); g = (unsigned char)(round((float)pixels[i].g*15/255)); b = (unsigned char)(round((float)pixels[i].b*15/255)); a = (unsigned char)(round((float)pixels[i].a*15/255)); - + ((unsigned short *)image->data)[i] = (unsigned short)r << 12 | (unsigned short)g << 8| (unsigned short)b << 4| (unsigned short)a; } - + } break; case UNCOMPRESSED_R8G8B8A8: { image->data = (unsigned char *)malloc(image->width*image->height*4*sizeof(unsigned char)); - + for (int i = 0; i < image->width*image->height*4; i += 4) { ((unsigned char *)image->data)[i] = pixels[k].r; @@ -669,7 +669,7 @@ void ImageFormat(Image *image, int newFormat) } break; default: break; } - + free(pixels); } else TraceLog(WARNING, "Image data format is compressed, can not be converted"); @@ -677,7 +677,7 @@ void ImageFormat(Image *image, int newFormat) } // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) -// NOTE: In case selected bpp do not represent an known 16bit format, +// NOTE: In case selected bpp do not represent an known 16bit format, // dithered data is stored in the LSB part of the unsigned short void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) { @@ -694,14 +694,14 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) else { Color *pixels = GetImageData(*image); - + free(image->data); // free old image data - + if ((image->format != UNCOMPRESSED_R8G8B8) && (image->format != UNCOMPRESSED_R8G8B8A8)) { TraceLog(WARNING, "Image format is already 16bpp or lower, dithering could have no effect"); } - + // Define new image format, check if desired bpp match internal known format if ((rBpp == 5) && (gBpp == 6) && (bBpp == 5) && (aBpp == 0)) image->format = UNCOMPRESSED_R5G6B5; else if ((rBpp == 5) && (gBpp == 5) && (bBpp == 5) && (aBpp == 1)) image->format = UNCOMPRESSED_R5G5B5A1; @@ -714,13 +714,13 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) // NOTE: We will store the dithered data as unsigned short (16bpp) image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - + Color oldpixel = WHITE; Color newpixel = WHITE; - + int error_r, error_g, error_b; unsigned short pixel_r, pixel_g, pixel_b, pixel_a; // Used for 16bit pixel composition - + #define MIN(a,b) (((a)<(b))?(a):(b)) for (int y = 0; y < image->height; y++) @@ -728,7 +728,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) for (int x = 0; x < image->width; x++) { oldpixel = pixels[y*image->width + x]; - + // NOTE: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat()) newpixel.r = oldpixel.r>>(8 - rBpp); // R bits newpixel.g = oldpixel.g>>(8 - gBpp); // G bits @@ -740,7 +740,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) error_r = (int)oldpixel.r - (int)(newpixel.r<<(8 - rBpp)); error_g = (int)oldpixel.g - (int)(newpixel.g<<(8 - gBpp)); error_b = (int)oldpixel.b - (int)(newpixel.b<<(8 - bBpp)); - + pixels[y*image->width + x] = newpixel; // NOTE: Some cases are out of the array and should be ignored @@ -750,21 +750,21 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) pixels[y*image->width + x+1].g = MIN((int)pixels[y*image->width + x+1].g + (int)((float)error_g*7.0f/16), 0xff); pixels[y*image->width + x+1].b = MIN((int)pixels[y*image->width + x+1].b + (int)((float)error_b*7.0f/16), 0xff); } - + if ((x > 0) && (y < (image->height - 1))) { pixels[(y+1)*image->width + x-1].r = MIN((int)pixels[(y+1)*image->width + x-1].r + (int)((float)error_r*3.0f/16), 0xff); pixels[(y+1)*image->width + x-1].g = MIN((int)pixels[(y+1)*image->width + x-1].g + (int)((float)error_g*3.0f/16), 0xff); pixels[(y+1)*image->width + x-1].b = MIN((int)pixels[(y+1)*image->width + x-1].b + (int)((float)error_b*3.0f/16), 0xff); } - + if (y < (image->height - 1)) { pixels[(y+1)*image->width + x].r = MIN((int)pixels[(y+1)*image->width + x].r + (int)((float)error_r*5.0f/16), 0xff); pixels[(y+1)*image->width + x].g = MIN((int)pixels[(y+1)*image->width + x].g + (int)((float)error_g*5.0f/16), 0xff); pixels[(y+1)*image->width + x].b = MIN((int)pixels[(y+1)*image->width + x].b + (int)((float)error_b*5.0f/16), 0xff); } - + if ((x < (image->width - 1)) && (y < (image->height - 1))) { pixels[(y+1)*image->width + x+1].r = MIN((int)pixels[(y+1)*image->width + x+1].r + (int)((float)error_r*1.0f/16), 0xff); @@ -776,7 +776,7 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) pixel_g = (unsigned short)newpixel.g; pixel_b = (unsigned short)newpixel.b; pixel_a = (unsigned short)newpixel.a; - + ((unsigned short *)image->data)[y*image->width + x] = (pixel_r<<(gBpp + bBpp + aBpp)) | (pixel_g<<(bBpp + aBpp)) | (pixel_b<width); int potHeight = GetNextPOT(image->height); @@ -816,13 +816,13 @@ void ImageToPOT(Image *image, Color fillColor) free(pixels); // Free pixels data free(image->data); // Free old image data - + int format = image->format; // Store image data format to reconvert later - + // TODO: Image width and height changes... do we want to store new values or keep the old ones? // NOTE: Issues when using image.width and image.height for sprite animations... *image = LoadImageEx(pixelsPOT, potWidth, potHeight); - + free(pixelsPOT); // Free POT pixels data ImageFormat(image, format); // Reconvert image to previous format @@ -833,9 +833,9 @@ void ImageToPOT(Image *image, Color fillColor) Image ImageCopy(Image image) { Image newImage; - + int size = image.width*image.height; - + switch (image.format) { case UNCOMPRESSED_GRAYSCALE: newImage.data = (unsigned char *)malloc(size); break; // 8 bit per pixel (no alpha) @@ -847,24 +847,24 @@ Image ImageCopy(Image image) case UNCOMPRESSED_R8G8B8A8: newImage.data = (unsigned char *)malloc(size*4); size *= 4; break; // 32 bpp default: TraceLog(WARNING, "Image format not suported for copy"); break; } - + if (newImage.data != NULL) { // NOTE: Size must be provided in bytes memcpy(newImage.data, image.data, size); - + newImage.width = image.width; newImage.height = image.height; newImage.mipmaps = image.mipmaps; newImage.format = image.format; } - + return newImage; } // Crop an image to area defined by a rectangle // NOTE: Security checks are performed in case rectangle goes out of bounds -void ImageCrop(Image *image, Rectangle crop) +void ImageCrop(Image *image, Rectangle crop) { // Security checks to make sure cropping rectangle is inside margins if ((crop.x + crop.width) > image->width) @@ -872,13 +872,13 @@ void ImageCrop(Image *image, Rectangle crop) crop.width = image->width - crop.x; TraceLog(WARNING, "Crop rectangle width out of bounds, rescaled crop width: %i", crop.width); } - + if ((crop.y + crop.height) > image->height) { crop.height = image->height - crop.y; TraceLog(WARNING, "Crop rectangle height out of bounds, rescaled crop height: %i", crop.height); } - + if ((crop.x < image->width) && (crop.y < image->height)) { // Start the cropping process @@ -903,7 +903,7 @@ void ImageCrop(Image *image, Rectangle crop) free(cropPixels); - // Reformat 32bit RGBA image to original format + // Reformat 32bit RGBA image to original format ImageFormat(image, format); } else @@ -916,7 +916,7 @@ void ImageCrop(Image *image, Rectangle crop) // NOTE: Uses stb default scaling filters (both bicubic): // STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM // STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL (high-quality Catmull-Rom) -void ImageResize(Image *image, int newWidth, int newHeight) +void ImageResize(Image *image, int newWidth, int newHeight) { // Get data as Color pixels array to work with it Color *pixels = GetImageData(*image); @@ -930,81 +930,81 @@ void ImageResize(Image *image, int newWidth, int newHeight) UnloadImage(*image); *image = LoadImageEx(output, newWidth, newHeight); - ImageFormat(image, format); // Reformat 32bit RGBA image to original format - + ImageFormat(image, format); // Reformat 32bit RGBA image to original format + free(output); free(pixels); } // Resize and image to new size using Nearest-Neighbor scaling algorithm -void ImageResizeNN(Image *image,int newWidth,int newHeight) +void ImageResizeNN(Image *image,int newWidth,int newHeight) { Color *pixels = GetImageData(*image); Color *output = (Color *)malloc(newWidth*newHeight*sizeof(Color)); - + // EDIT: added +1 to account for an early rounding problem int x_ratio = (int)((image->width<<16)/newWidth) + 1; int y_ratio = (int)((image->height<<16)/newHeight) + 1; - + int x2, y2; - for (int i = 0; i < newHeight; i++) + for (int i = 0; i < newHeight; i++) { - for (int j = 0; j < newWidth; j++) + for (int j = 0; j < newWidth; j++) { x2 = ((j*x_ratio) >> 16); y2 = ((i*y_ratio) >> 16); - + output[(i*newWidth) + j] = pixels[(y2*image->width) + x2] ; - } - } + } + } int format = image->format; UnloadImage(*image); *image = LoadImageEx(output, newWidth, newHeight); - ImageFormat(image, format); // Reformat 32bit RGBA image to original format - + ImageFormat(image, format); // Reformat 32bit RGBA image to original format + free(output); free(pixels); } // Draw an image (source) within an image (destination) -void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) +void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) { // Security checks to avoid size and rectangle issues (out of bounds) // Check that srcRec is inside src image if (srcRec.x < 0) srcRec.x = 0; if (srcRec.y < 0) srcRec.y = 0; - + if ((srcRec.x + srcRec.width) > src.width) { srcRec.width = src.width - srcRec.x; TraceLog(WARNING, "Source rectangle width out of bounds, rescaled width: %i", srcRec.width); } - + if ((srcRec.y + srcRec.height) > src.height) { srcRec.height = src.height - srcRec.y; TraceLog(WARNING, "Source rectangle height out of bounds, rescaled height: %i", srcRec.height); } - + // Check that dstRec is inside dst image if (dstRec.x < 0) dstRec.x = 0; if (dstRec.y < 0) dstRec.y = 0; - + if ((dstRec.x + dstRec.width) > dst->width) { dstRec.width = dst->width - dstRec.x; TraceLog(WARNING, "Destination rectangle width out of bounds, rescaled width: %i", dstRec.width); } - + if ((dstRec.y + dstRec.height) > dst->height) { dstRec.height = dst->height - dstRec.y; TraceLog(WARNING, "Destination rectangle height out of bounds, rescaled height: %i", dstRec.height); } - + // Get dstination image data as Color pixels array to work with it Color *dstPixels = GetImageData(*dst); @@ -1012,14 +1012,14 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) ImageCrop(&srcCopy, srcRec); // Crop source image to desired source rectangle // Scale source image in case destination rec size is different than source rec size - if ((dstRec.width != srcRec.width) || (dstRec.height != srcRec.height)) + if ((dstRec.width != srcRec.width) || (dstRec.height != srcRec.height)) { ImageResize(&srcCopy, dstRec.width, dstRec.height); } // Get source image data as Color array Color *srcPixels = GetImageData(srcCopy); - + UnloadImage(srcCopy); // Blit pixels, copy source image into destination @@ -1030,7 +1030,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) dstPixels[j*dst->width + i] = srcPixels[(j - dstRec.y)*dstRec.width + (i - dstRec.x)]; } } - + UnloadImage(*dst); // NOTE: Only dst->data is unloaded *dst = LoadImageEx(dstPixels, dst->width, dst->height); @@ -1046,9 +1046,9 @@ Image ImageText(const char *text, int fontSize, Color color) int defaultFontSize = 10; // Default Font chars height in pixel if (fontSize < defaultFontSize) fontSize = defaultFontSize; int spacing = fontSize / defaultFontSize; - + Image imText = ImageTextEx(GetDefaultFont(), text, fontSize, spacing, color); - + return imText; } @@ -1062,19 +1062,19 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing // NOTE: GetTextureData() not available in OpenGL ES Image imFont = GetTextureData(font.texture); - + ImageFormat(&imFont, UNCOMPRESSED_R8G8B8A8); // Required for color tint ImageColorTint(&imFont, tint); // Apply color tint to font Color *fontPixels = GetImageData(imFont); - + // Create image to store text Color *pixels = (Color *)malloc(sizeof(Color)*(int)imSize.x*(int)imSize.y); - + for (int i = 0; i < length; i++) { Rectangle letterRec = font.charRecs[(int)text[i] - 32]; - + for (int y = letterRec.y; y < (letterRec.y + letterRec.height); y++) { for (int x = posX; x < (posX + letterRec.width); x++) @@ -1082,28 +1082,28 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing pixels[(y - letterRec.y)*(int)imSize.x + x] = fontPixels[y*font.texture.width + (x - posX + letterRec.x)]; } } - + posX += letterRec.width + spacing; } - + UnloadImage(imFont); - + Image imText = LoadImageEx(pixels, (int)imSize.x, (int)imSize.y); - + // Scale image depending on text size if (fontSize > imSize.y) { float scaleFactor = fontSize/imSize.y; TraceLog(INFO, "Scalefactor: %f", scaleFactor); - + // Using nearest-neighbor scaling algorithm for default font if (font.texture.id == GetDefaultFont().texture.id) ImageResizeNN(&imText, (int)(imSize.x*scaleFactor), (int)(imSize.y*scaleFactor)); else ImageResize(&imText, (int)(imSize.x*scaleFactor), (int)(imSize.y*scaleFactor)); } - + free(pixels); free(fontPixels); - + return imText; } @@ -1117,12 +1117,12 @@ void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color) { Image imText = ImageTextEx(font, text, fontSize, spacing, color); - + Rectangle srcRec = { 0, 0, imText.width, imText.height }; Rectangle dstRec = { (int)position.x, (int)position.y, imText.width, imText.height }; - + ImageDraw(dst, imText, srcRec, dstRec); - + UnloadImage(imText); } @@ -1131,7 +1131,7 @@ void ImageFlipVertical(Image *image) { Color *srcPixels = GetImageData(*image); Color *dstPixels = (Color *)malloc(sizeof(Color)*image->width*image->height); - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1139,14 +1139,14 @@ void ImageFlipVertical(Image *image) dstPixels[y*image->width + x] = srcPixels[(image->height - 1 - y)*image->width + x]; } } - + Image processed = LoadImageEx(dstPixels, image->width, image->height); ImageFormat(&processed, image->format); UnloadImage(*image); - + free(srcPixels); free(dstPixels); - + image->data = processed.data; } @@ -1155,7 +1155,7 @@ void ImageFlipHorizontal(Image *image) { Color *srcPixels = GetImageData(*image); Color *dstPixels = (Color *)malloc(sizeof(Color)*image->width*image->height); - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1163,14 +1163,14 @@ void ImageFlipHorizontal(Image *image) dstPixels[y*image->width + x] = srcPixels[y*image->width + (image->width - 1 - x)]; } } - + Image processed = LoadImageEx(dstPixels, image->width, image->height); ImageFormat(&processed, image->format); UnloadImage(*image); - + free(srcPixels); free(dstPixels); - + image->data = processed.data; } @@ -1178,12 +1178,12 @@ void ImageFlipHorizontal(Image *image) void ImageColorTint(Image *image, Color color) { Color *pixels = GetImageData(*image); - + float cR = (float)color.r/255; float cG = (float)color.g/255; float cB = (float)color.b/255; float cA = (float)color.a/255; - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1204,7 +1204,7 @@ void ImageColorTint(Image *image, Color color) ImageFormat(&processed, image->format); UnloadImage(*image); free(pixels); - + image->data = processed.data; } @@ -1212,7 +1212,7 @@ void ImageColorTint(Image *image, Color color) void ImageColorInvert(Image *image) { Color *pixels = GetImageData(*image); - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1222,12 +1222,12 @@ void ImageColorInvert(Image *image) pixels[y*image->width + x].b = 255 - pixels[y*image->width + x].b; } } - + Image processed = LoadImageEx(pixels, image->width, image->height); ImageFormat(&processed, image->format); UnloadImage(*image); free(pixels); - + image->data = processed.data; } @@ -1243,12 +1243,12 @@ void ImageColorContrast(Image *image, float contrast) { if (contrast < -100) contrast = -100; if (contrast > 100) contrast = 100; - + contrast = (100.0 + contrast)/100.0; contrast *= contrast; - + Color *pixels = GetImageData(*image); - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1287,7 +1287,7 @@ void ImageColorContrast(Image *image, float contrast) ImageFormat(&processed, image->format); UnloadImage(*image); free(pixels); - + image->data = processed.data; } @@ -1297,9 +1297,9 @@ void ImageColorBrightness(Image *image, int brightness) { if (brightness < -255) brightness = -255; if (brightness > 255) brightness = 255; - + Color *pixels = GetImageData(*image); - + for (int y = 0; y < image->height; y++) { for (int x = 0; x < image->width; x++) @@ -1316,7 +1316,7 @@ void ImageColorBrightness(Image *image, int brightness) if (cB < 0) cB = 1; if (cB > 255) cB = 255; - + pixels[y*image->width + x].r = (unsigned char)cR; pixels[y*image->width + x].g = (unsigned char)cG; pixels[y*image->width + x].b = (unsigned char)cB; @@ -1327,7 +1327,7 @@ void ImageColorBrightness(Image *image, int brightness) ImageFormat(&processed, image->format); UnloadImage(*image); free(pixels); - + image->data = processed.data; } @@ -1396,7 +1396,7 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V { if (sourceRec.width < 0) sourceRec.x -= sourceRec.width; if (sourceRec.height < 0) sourceRec.y -= sourceRec.height; - + rlEnableTexture(texture.id); rlPushMatrix(); @@ -1439,13 +1439,13 @@ static Image LoadDDS(const char *fileName) { // Required extension: // GL_EXT_texture_compression_s3tc - + // Supported tokens (defined by extensions) // GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 - + #define FOURCC_DXT1 0x31545844 // Equivalent to "DXT1" in ASCII #define FOURCC_DXT3 0x33545844 // Equivalent to "DXT3" in ASCII #define FOURCC_DXT5 0x35545844 // Equivalent to "DXT5" in ASCII @@ -1508,7 +1508,7 @@ static Image LoadDDS(const char *fileName) else { ddsHeader header; - + // Get the image header fread(&header, sizeof(ddsHeader), 1, ddsFile); @@ -1537,9 +1537,9 @@ static Image LoadDDS(const char *fileName) { image.data = (unsigned short *)malloc(image.width*image.height*sizeof(unsigned short)); fread(image.data, image.width*image.height*sizeof(unsigned short), 1, ddsFile); - + unsigned char alpha = 0; - + // NOTE: Data comes as A1R5G5B5, it must be reordered to R5G5B5A1 for (int i = 0; i < image.width*image.height; i++) { @@ -1554,9 +1554,9 @@ static Image LoadDDS(const char *fileName) { image.data = (unsigned short *)malloc(image.width*image.height*sizeof(unsigned short)); fread(image.data, image.width*image.height*sizeof(unsigned short), 1, ddsFile); - + unsigned char alpha = 0; - + // NOTE: Data comes as A4R4G4B4, it must be reordered R4G4B4A4 for (int i = 0; i < image.width*image.height; i++) { @@ -1564,7 +1564,7 @@ static Image LoadDDS(const char *fileName) ((unsigned short *)image.data)[i] = ((unsigned short *)image.data)[i] << 4; ((unsigned short *)image.data)[i] += alpha; } - + image.format = UNCOMPRESSED_R4G4B4A4; } } @@ -1574,14 +1574,14 @@ static Image LoadDDS(const char *fileName) // NOTE: not sure if this case exists... image.data = (unsigned char *)malloc(image.width*image.height*3*sizeof(unsigned char)); fread(image.data, image.width*image.height*3, 1, ddsFile); - + image.format = UNCOMPRESSED_R8G8B8; } else if (header.ddspf.flags == 0x41 && header.ddspf.rgbBitCount == 32) // DDS_RGBA, no compressed { image.data = (unsigned char *)malloc(image.width*image.height*4*sizeof(unsigned char)); fread(image.data, image.width*image.height*4, 1, ddsFile); - + unsigned char blue = 0; // NOTE: Data comes as A8R8G8B8, it must be reordered R8G8B8A8 (view next comment) @@ -1593,7 +1593,7 @@ static Image LoadDDS(const char *fileName) ((unsigned char *)image.data)[i] = ((unsigned char *)image.data)[i + 2]; ((unsigned char *)image.data)[i + 2] = blue; } - + image.format = UNCOMPRESSED_R8G8B8A8; } else if (((header.ddspf.flags == 0x04) || (header.ddspf.flags == 0x05)) && (header.ddspf.fourCC > 0)) // Compressed @@ -1603,7 +1603,7 @@ static Image LoadDDS(const char *fileName) // Calculate data size, including all mipmaps if (header.mipmapCount > 1) bufsize = header.pitchOrLinearSize*2; else bufsize = header.pitchOrLinearSize; - + TraceLog(DEBUG, "Pitch or linear size: %i", header.pitchOrLinearSize); image.data = (unsigned char*)malloc(bufsize*sizeof(unsigned char)); @@ -1625,7 +1625,7 @@ static Image LoadDDS(const char *fileName) } } } - + fclose(ddsFile); // Close file pointer } @@ -1640,9 +1640,9 @@ static Image LoadPKM(const char *fileName) // Required extensions: // GL_OES_compressed_ETC1_RGB8_texture (ETC1) (OpenGL ES 2.0) // GL_ARB_ES3_compatibility (ETC2/EAC) (OpenGL ES 3.0) - + // Supported tokens (defined by extensions) - // GL_ETC1_RGB8_OES 0x8D64 + // GL_ETC1_RGB8_OES 0x8D64 // GL_COMPRESSED_RGB8_ETC2 0x9274 // GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 @@ -1656,7 +1656,7 @@ static Image LoadPKM(const char *fileName) unsigned short origWidth; // Original width (big-endian) unsigned short origHeight; // Original height (big-endian) } pkmHeader; - + // Formats list // version 10: format: 0=ETC1_RGB, [1=ETC1_RGBA, 2=ETC1_RGB_MIP, 3=ETC1_RGBA_MIP] (not used) // version 20: format: 0=ETC1_RGB, 1=ETC2_RGB, 2=ETC2_RGBA_OLD, 3=ETC2_RGBA, 4=ETC2_RGBA1, 5=ETC2_R, 6=ETC2_RG, 7=ETC2_SIGNED_R, 8=ETC2_SIGNED_R @@ -1665,7 +1665,7 @@ static Image LoadPKM(const char *fileName) // NOTE: ETC is always 4bit per pixel (64 bit for each 4x4 block of pixels) Image image; - + image.data = NULL; image.width = 0; image.height = 0; @@ -1695,18 +1695,18 @@ static Image LoadPKM(const char *fileName) header.format = ((header.format & 0x00FF) << 8) | ((header.format & 0xFF00) >> 8); header.width = ((header.width & 0x00FF) << 8) | ((header.width & 0xFF00) >> 8); header.height = ((header.height & 0x00FF) << 8) | ((header.height & 0xFF00) >> 8); - + TraceLog(DEBUG, "PKM (ETC) image width: %i", header.width); TraceLog(DEBUG, "PKM (ETC) image height: %i", header.height); TraceLog(DEBUG, "PKM (ETC) image format: %i", header.format); - + image.width = header.width; image.height = header.height; image.mipmaps = 1; - + int bpp = 4; if (header.format == 3) bpp = 8; - + int size = image.width*image.height*bpp/8; // Total data size in bytes image.data = (unsigned char*)malloc(size * sizeof(unsigned char)); @@ -1717,7 +1717,7 @@ static Image LoadPKM(const char *fileName) else if (header.format == 1) image.format = COMPRESSED_ETC2_RGB; else if (header.format == 3) image.format = COMPRESSED_ETC2_EAC_RGBA; } - + fclose(pkmFile); // Close file pointer } @@ -1730,12 +1730,12 @@ static Image LoadKTX(const char *fileName) // Required extensions: // GL_OES_compressed_ETC1_RGB8_texture (ETC1) // GL_ARB_ES3_compatibility (ETC2/EAC) - + // Supported tokens (defined by extensions) // GL_ETC1_RGB8_OES 0x8D64 // GL_COMPRESSED_RGB8_ETC2 0x9274 // GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 - + // KTX file Header (64 bytes) // https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/ typedef struct { @@ -1754,16 +1754,16 @@ static Image LoadKTX(const char *fileName) unsigned int mipmapLevels; // Non-mipmapped textures = 1 unsigned int keyValueDataSize; // Used to encode any arbitrary data... } ktxHeader; - + // NOTE: Before start of every mipmap data block, we have: unsigned int dataSize - + Image image; image.width = 0; image.height = 0; image.mipmaps = 0; image.format = 0; - + FILE *ktxFile = fopen(fileName, "rb"); if (ktxFile == NULL) @@ -1783,22 +1783,22 @@ static Image LoadKTX(const char *fileName) TraceLog(WARNING, "[%s] KTX file does not seem to be a valid file", fileName); } else - { + { image.width = header.width; image.height = header.height; image.mipmaps = header.mipmapLevels; - + TraceLog(DEBUG, "KTX (ETC) image width: %i", header.width); TraceLog(DEBUG, "KTX (ETC) image height: %i", header.height); TraceLog(DEBUG, "KTX (ETC) image format: 0x%x", header.glInternalFormat); - + unsigned char unused; - + if (header.keyValueDataSize > 0) { for (int i = 0; i < header.keyValueDataSize; i++) fread(&unused, 1, 1, ktxFile); } - + int dataSize; fread(&dataSize, sizeof(unsigned int), 1, ktxFile); @@ -1810,10 +1810,10 @@ static Image LoadKTX(const char *fileName) else if (header.glInternalFormat == 0x9274) image.format = COMPRESSED_ETC2_RGB; else if (header.glInternalFormat == 0x9278) image.format = COMPRESSED_ETC2_EAC_RGBA; } - + fclose(ktxFile); // Close file pointer } - + return image; } @@ -1823,11 +1823,11 @@ static Image LoadPVR(const char *fileName) { // Required extension: // GL_IMG_texture_compression_pvrtc - + // Supported tokens (defined by extensions) // GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 // GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 - + #if 0 // Not used... // PVR file v2 Header (52 bytes) typedef struct { @@ -1864,7 +1864,7 @@ static Image LoadPVR(const char *fileName) unsigned int numMipmaps; unsigned int metaDataSize; } pvrHeaderV3; - + #if 0 // Not used... // Metadata (usually 15 bytes) typedef struct { @@ -1872,7 +1872,7 @@ static Image LoadPVR(const char *fileName) unsigned int key; unsigned int dataSize; // Not used? unsigned char *data; // Not used? - } pvrMetadata; + } pvrMetadata; #endif Image image; @@ -1895,15 +1895,15 @@ static Image LoadPVR(const char *fileName) unsigned char pvrVersion = 0; fread(&pvrVersion, sizeof(unsigned char), 1, pvrFile); fseek(pvrFile, 0, SEEK_SET); - + // Load different PVR data formats if (pvrVersion == 0x50) { pvrHeaderV3 header; - + // Get PVR image header fread(&header, sizeof(pvrHeaderV3), 1, pvrFile); - + if ((header.id[0] != 'P') || (header.id[1] != 'V') || (header.id[2] != 'R') || (header.id[3] != 3)) { TraceLog(WARNING, "[%s] PVR file does not seem to be a valid image", fileName); @@ -1913,7 +1913,7 @@ static Image LoadPVR(const char *fileName) image.width = header.width; image.height = header.height; image.mipmaps = header.numMipmaps; - + // Check data format if (((header.channels[0] == 'l') && (header.channels[1] == 0)) && (header.channelDepth[0] == 8)) image.format = UNCOMPRESSED_GRAYSCALE; else if (((header.channels[0] == 'l') && (header.channels[1] == 'a')) && ((header.channelDepth[0] == 8) && (header.channelDepth[1] == 8))) image.format = UNCOMPRESSED_GRAY_ALPHA; @@ -1933,14 +1933,14 @@ static Image LoadPVR(const char *fileName) } else if (header.channels[0] == 2) image.format = COMPRESSED_PVRT_RGB; else if (header.channels[0] == 3) image.format = COMPRESSED_PVRT_RGBA; - + // Skip meta data header unsigned char unused = 0; for (int i = 0; i < header.metaDataSize; i++) fread(&unused, sizeof(unsigned char), 1, pvrFile); - + // Calculate data size (depends on format) int bpp = 0; - + switch (image.format) { case UNCOMPRESSED_GRAYSCALE: bpp = 8; break; @@ -1954,7 +1954,7 @@ static Image LoadPVR(const char *fileName) case COMPRESSED_PVRT_RGBA: bpp = 4; break; default: break; } - + int dataSize = image.width*image.height*bpp/8; // Total data size in bytes image.data = (unsigned char*)malloc(dataSize*sizeof(unsigned char)); @@ -1976,11 +1976,11 @@ static Image LoadASTC(const char *fileName) // Required extensions: // GL_KHR_texture_compression_astc_hdr // GL_KHR_texture_compression_astc_ldr - + // Supported tokens (defined by extensions) // GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93b0 // GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93b7 - + // ASTC file Header (16 bytes) typedef struct { unsigned char id[4]; // Signature: 0x13 0xAB 0xA1 0x5C @@ -1999,7 +1999,7 @@ static Image LoadASTC(const char *fileName) image.height = 0; image.mipmaps = 0; image.format = 0; - + FILE *astcFile = fopen(fileName, "rb"); if (astcFile == NULL) @@ -2012,7 +2012,7 @@ static Image LoadASTC(const char *fileName) // Get ASTC image header fread(&header, sizeof(astcHeader), 1, astcFile); - + if ((header.id[3] != 0x5c) || (header.id[2] != 0xa1) || (header.id[1] != 0xab) || (header.id[0] != 0x13)) { TraceLog(WARNING, "[%s] ASTC file does not seem to be a valid image", fileName); @@ -2022,31 +2022,31 @@ static Image LoadASTC(const char *fileName) // NOTE: Assuming Little Endian (could it be wrong?) image.width = 0x00000000 | ((int)header.width[2] << 16) | ((int)header.width[1] << 8) | ((int)header.width[0]); image.height = 0x00000000 | ((int)header.height[2] << 16) | ((int)header.height[1] << 8) | ((int)header.height[0]); - + // NOTE: ASTC format only contains one mipmap level image.mipmaps = 1; - + TraceLog(DEBUG, "ASTC image width: %i", image.width); TraceLog(DEBUG, "ASTC image height: %i", image.height); TraceLog(DEBUG, "ASTC image blocks: %ix%i", header.blockX, header.blockY); - + // NOTE: Each block is always stored in 128bit so we can calculate the bpp int bpp = 128/(header.blockX*header.blockY); // NOTE: Currently we only support 2 blocks configurations: 4x4 and 8x8 - if ((bpp == 8) || (bpp == 2)) + if ((bpp == 8) || (bpp == 2)) { int dataSize = image.width*image.height*bpp/8; // Data size in bytes - + image.data = (unsigned char *)malloc(dataSize*sizeof(unsigned char)); fread(image.data, dataSize, 1, astcFile); - + if (bpp == 8) image.format = COMPRESSED_ASTC_4x4_RGBA; else if (bpp == 2) image.format = COMPRESSED_ASTC_4x4_RGBA; } else TraceLog(WARNING, "[%s] ASTC block size configuration not supported", fileName); } - + fclose(astcFile); } -- cgit v1.2.3 From 1d71e1b7542b88c2d5a690d09c0d2a5411549527 Mon Sep 17 00:00:00 2001 From: Wilhem Barbier Date: Thu, 25 Aug 2016 14:18:43 +0200 Subject: Fix a typo in the DrawCube, DrawCubeWires and DrawCubeTexture definitions --- src/raylib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 7b7348c8..68cddc5a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -810,10 +810,10 @@ RLAPI const char *SubText(const char *text, int position, int length); //------------------------------------------------------------------------------------ RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space RLAPI void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space -RLAPI void DrawCube(Vector3 position, float width, float height, float lenght, Color color); // Draw cube +RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) -RLAPI void DrawCubeWires(Vector3 position, float width, float height, float lenght, Color color); // Draw cube wires -RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float lenght, Color color); // Draw cube textured +RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires -- cgit v1.2.3 From f1c3f2870b1acd5073999f27ac4ad06e7a036586 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 25 Aug 2016 15:11:52 +0200 Subject: Added TraceLog info on image spritefont loading --- src/text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/text.c b/src/text.c index 8dc55455..3d28fc3c 100644 --- a/src/text.c +++ b/src/text.c @@ -593,6 +593,8 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) } spriteFont.size = spriteFont.charRecs[0].height; + + TraceLog(INFO, "Image file loaded correctly as SpriteFont"); return spriteFont; } -- cgit v1.2.3 From 4770e2010d2451d28305bea874f81e50ed6560f5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 26 Aug 2016 19:40:37 +0200 Subject: Review Android project --- src/android/jni/Android.mk | 3 +-- src/core.c | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/android/jni/Android.mk b/src/android/jni/Android.mk index 66851d08..687c6577 100644 --- a/src/android/jni/Android.mk +++ b/src/android/jni/Android.mk @@ -4,7 +4,7 @@ # # Static library compilation # -# Copyright (c) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com) +# Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. In no event # will the authors be held liable for any damages arising from the use of this software. @@ -42,7 +42,6 @@ LOCAL_SRC_FILES :=\ ../../textures.c \ ../../text.c \ ../../shapes.c \ - ../../gestures.c \ ../../models.c \ ../../utils.c \ ../../audio.c \ diff --git a/src/core.c b/src/core.c index a76fe0be..81c2942a 100644 --- a/src/core.c +++ b/src/core.c @@ -48,8 +48,10 @@ #define GESTURES_IMPLEMENTATION #include "gestures.h" // Gestures detection functionality -#define CAMERA_IMPLEMENTATION -#include "camera.h" // Camera system functionality +#if !defined(PLATFORM_ANDROID) + #define CAMERA_IMPLEMENTATION + #include "camera.h" // Camera system functionality +#endif #include // Standard input / output lib #include // Declares malloc() and free() for memory management, rand(), atexit() -- cgit v1.2.3 From be97583f00997fa918a15d0164190ae6876d0571 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 29 Aug 2016 11:17:58 +0200 Subject: Added function: UpdateSound() --- src/audio.c | 28 ++++++++++++++++++++++++++++ src/audio.h | 1 + src/raylib.h | 2 ++ 3 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 1772196f..3bace5f7 100644 --- a/src/audio.c +++ b/src/audio.c @@ -284,6 +284,7 @@ Sound LoadSoundFromWave(Wave wave) sound.source = source; sound.buffer = buffer; + sound.format = format; } return sound; @@ -409,6 +410,33 @@ void UnloadSound(Sound sound) TraceLog(INFO, "[SND ID %i][BUFR ID %i] Unloaded sound data from RAM", sound.source, sound.buffer); } +// Update sound buffer with new data +// NOTE: data must match sound.format +void UpdateSound(Sound sound, void *data, int numSamples) +{ + ALint sampleRate, sampleSize, channels; + alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); + alGetBufferi(sound.buffer, AL_BITS, &sampleSize); // It could also be retrieved from sound.format + alGetBufferi(sound.buffer, AL_CHANNELS, &channels); // It could also be retrieved from sound.format + + TraceLog(DEBUG, "UpdateSound() : AL_FREQUENCY: %i", sampleRate); + TraceLog(DEBUG, "UpdateSound() : AL_BITS: %i", sampleSize); + TraceLog(DEBUG, "UpdateSound() : AL_CHANNELS: %i", channels); + + unsigned int dataSize = numSamples*sampleSize/8; // Size of data in bytes + + alSourceStop(sound.source); // Stop sound + alSourcei(sound.source, AL_BUFFER, 0); // Unbind buffer from sound to update + //alDeleteBuffers(1, &sound.buffer); // Delete current buffer data + //alGenBuffers(1, &sound.buffer); // Generate new buffer + + // Upload new data to sound buffer + alBufferData(sound.buffer, sound.format, data, dataSize, sampleRate); + + // Attach sound buffer to source again + alSourcei(sound.source, AL_BUFFER, sound.buffer); +} + // Play a sound void PlaySound(Sound sound) { diff --git a/src/audio.h b/src/audio.h index 4ee9559e..923492ca 100644 --- a/src/audio.h +++ b/src/audio.h @@ -110,6 +110,7 @@ bool IsAudioDeviceReady(void); // Check if audi Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) +void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound diff --git a/src/raylib.h b/src/raylib.h index 68cddc5a..d295ef90 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -486,6 +486,7 @@ typedef struct Ray { typedef struct Sound { unsigned int source; // OpenAL audio source id unsigned int buffer; // OpenAL audio buffer id + int format; // OpenAL audio format specifier } Sound; // Wave type, defines audio wave data @@ -908,6 +909,7 @@ RLAPI bool IsAudioDeviceReady(void); // Check i RLAPI Sound LoadSound(char *fileName); // Load sound to memory RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) +RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound RLAPI void PauseSound(Sound sound); // Pause a sound -- cgit v1.2.3 From d0cf19e03559eb5cd60035d54d4ca7b5991344b8 Mon Sep 17 00:00:00 2001 From: Teodor Stoenescu Date: Wed, 31 Aug 2016 09:24:39 +0300 Subject: Greater LoadOBJ() flexibility LoadOBJ can now load objects with having no texture coordinates or objects having texture coordinates specified as tuples. --- src/models.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 42798483..92b9850e 100644 --- a/src/models.c +++ b/src/models.c @@ -1898,9 +1898,7 @@ static Mesh LoadOBJ(const char *fileName) if (dataType == 't') // Read texCoord { - float useless = 0; - - fscanf(objFile, "%f %f %f", &midTexCoords[countTexCoords].x, &midTexCoords[countTexCoords].y, &useless); + fscanf(objFile, "%f %f%*[^\n]s\n", &midTexCoords[countTexCoords].x, &midTexCoords[countTexCoords].y); countTexCoords++; fscanf(objFile, "%c", &dataType); @@ -1959,6 +1957,7 @@ static Mesh LoadOBJ(const char *fileName) if ((numNormals == 0) && (numTexCoords == 0)) fscanf(objFile, "%i %i %i", &vNum[0], &vNum[1], &vNum[2]); else if (numNormals == 0) fscanf(objFile, "%i/%i %i/%i %i/%i", &vNum[0], &vtNum[0], &vNum[1], &vtNum[1], &vNum[2], &vtNum[2]); + else if (numTexCoords == 0) fscanf(objFile, "%i//%i %i//%i %i//%i", &vNum[0], &vnNum[0], &vNum[1], &vnNum[1], &vNum[2], &vnNum[2]); else fscanf(objFile, "%i/%i/%i %i/%i/%i %i/%i/%i", &vNum[0], &vtNum[0], &vnNum[0], &vNum[1], &vtNum[1], &vnNum[1], &vNum[2], &vtNum[2], &vnNum[2]); mesh.vertices[vCounter] = midVertices[vNum[0]-1].x; -- cgit v1.2.3 From a9ab516dae83d95a8701160bb7dcc72917e2d2ab Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 31 Aug 2016 10:27:29 +0200 Subject: Formatting tweaks --- src/audio.c | 4 ++-- src/core.c | 2 +- src/models.c | 12 ++++++------ src/text.c | 18 +++++++++--------- src/textures.c | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3bace5f7..ea14d77d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1068,7 +1068,7 @@ static void UnloadWave(Wave wave) const char *GetExtension(const char *fileName) { const char *dot = strrchr(fileName, '.'); - if(!dot || dot == fileName) return ""; + if (!dot || dot == fileName) return ""; return (dot + 1); } @@ -1083,7 +1083,7 @@ void TraceLog(int msgType, const char *text, ...) traceDebugMsgs = 0; #endif - switch(msgType) + switch (msgType) { case INFO: fprintf(stdout, "INFO: "); break; case ERROR: fprintf(stdout, "ERROR: "); break; diff --git a/src/core.c b/src/core.c index 81c2942a..b9ffe87b 100644 --- a/src/core.c +++ b/src/core.c @@ -2451,7 +2451,7 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent printf("%s, numTouches: %d %s%s%s%s\n", emscripten_event_type_to_string(eventType), event->numTouches, event->ctrlKey ? " CTRL" : "", event->shiftKey ? " SHIFT" : "", event->altKey ? " ALT" : "", event->metaKey ? " META" : ""); - for(int i = 0; i < event->numTouches; ++i) + for (int i = 0; i < event->numTouches; ++i) { const EmscriptenTouchPoint *t = &event->touches[i]; diff --git a/src/models.c b/src/models.c index 55de3d4f..25eb1fe0 100644 --- a/src/models.c +++ b/src/models.c @@ -270,25 +270,25 @@ void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float hei rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x+width/2, y+height/2, z+length/2); // Top Right Of The Texture and Quad rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x-width/2, y+height/2, z+length/2); // Top Left Of The Texture and Quad // Back Face - rlNormal3f( 0.0f, 0.0f,-1.0f); // Normal Pointing Away From Viewer + rlNormal3f(0.0f, 0.0f,-1.0f); // Normal Pointing Away From Viewer rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x-width/2, y-height/2, z-length/2); // Bottom Right Of The Texture and Quad rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x-width/2, y+height/2, z-length/2); // Top Right Of The Texture and Quad rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x+width/2, y+height/2, z-length/2); // Top Left Of The Texture and Quad rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x+width/2, y-height/2, z-length/2); // Bottom Left Of The Texture and Quad // Top Face - rlNormal3f( 0.0f, 1.0f, 0.0f); // Normal Pointing Up + rlNormal3f(0.0f, 1.0f, 0.0f); // Normal Pointing Up rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x-width/2, y+height/2, z-length/2); // Top Left Of The Texture and Quad rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x-width/2, y+height/2, z+length/2); // Bottom Left Of The Texture and Quad rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x+width/2, y+height/2, z+length/2); // Bottom Right Of The Texture and Quad rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x+width/2, y+height/2, z-length/2); // Top Right Of The Texture and Quad // Bottom Face - rlNormal3f( 0.0f,-1.0f, 0.0f); // Normal Pointing Down + rlNormal3f(0.0f,-1.0f, 0.0f); // Normal Pointing Down rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x-width/2, y-height/2, z-length/2); // Top Right Of The Texture and Quad rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x+width/2, y-height/2, z-length/2); // Top Left Of The Texture and Quad rlTexCoord2f(0.0f, 0.0f); rlVertex3f(x+width/2, y-height/2, z+length/2); // Bottom Left Of The Texture and Quad rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x-width/2, y-height/2, z+length/2); // Bottom Right Of The Texture and Quad // Right face - rlNormal3f( 1.0f, 0.0f, 0.0f); // Normal Pointing Right + rlNormal3f(1.0f, 0.0f, 0.0f); // Normal Pointing Right rlTexCoord2f(1.0f, 0.0f); rlVertex3f(x+width/2, y-height/2, z-length/2); // Bottom Right Of The Texture and Quad rlTexCoord2f(1.0f, 1.0f); rlVertex3f(x+width/2, y+height/2, z-length/2); // Top Right Of The Texture and Quad rlTexCoord2f(0.0f, 1.0f); rlVertex3f(x+width/2, y+height/2, z+length/2); // Top Left Of The Texture and Quad @@ -1905,14 +1905,14 @@ static Mesh LoadOBJ(const char *fileName) } else if (dataType == 'n') // Read normals { - fscanf(objFile, "%f %f %f", &midNormals[countNormals].x, &midNormals[countNormals].y, &midNormals[countNormals].z ); + fscanf(objFile, "%f %f %f", &midNormals[countNormals].x, &midNormals[countNormals].y, &midNormals[countNormals].z); countNormals++; fscanf(objFile, "%c", &dataType); } else // Read vertex { - fscanf(objFile, "%f %f %f", &midVertices[countVertex].x, &midVertices[countVertex].y, &midVertices[countVertex].z ); + fscanf(objFile, "%f %f %f", &midVertices[countVertex].x, &midVertices[countVertex].y, &midVertices[countVertex].z); countVertex++; fscanf(objFile, "%c", &dataType); diff --git a/src/text.c b/src/text.c index 3d28fc3c..d00f01d7 100644 --- a/src/text.c +++ b/src/text.c @@ -319,7 +319,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly // written in C code files (codified by default as UTF-8) - for(int i = 0; i < length; i++) + for (int i = 0; i < length; i++) { // TODO: Right now we are supposing characters that follow a continous order and start at FONT_FIRST_CHAR, // this sytem can be improved to support any characters order and init value... @@ -514,9 +514,9 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) Color *pixels = GetImageData(image); // Parse image data to get charSpacing and lineSpacing - for(y = 0; y < image.height; y++) + for (y = 0; y < image.height; y++) { - for(x = 0; x < image.width; x++) + for (x = 0; x < image.width; x++) { if (!COLOR_EQUAL(pixels[y*image.width + x], key)) break; } @@ -529,7 +529,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int charHeight = 0; int j = 0; - while(!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++; + while (!COLOR_EQUAL(pixels[(lineSpacing + j)*image.width + charSpacing], key)) j++; charHeight = j; @@ -539,9 +539,9 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int xPosToRead = charSpacing; // Parse image data to get rectangle sizes - while((lineSpacing + lineToRead * (charHeight + lineSpacing)) < image.height) + while ((lineSpacing + lineToRead * (charHeight + lineSpacing)) < image.height) { - while((xPosToRead < image.width) && + while ((xPosToRead < image.width) && !COLOR_EQUAL((pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead]), key)) { tempCharValues[index] = firstChar + index; @@ -552,7 +552,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int charWidth = 0; - while(!COLOR_EQUAL(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++; + while (!COLOR_EQUAL(pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead + charWidth], key)) charWidth++; tempCharRecs[index].width = charWidth; @@ -648,11 +648,11 @@ static SpriteFont LoadRBMF(const char *fileName) rbmfFileData = (unsigned int *)malloc(numPixelBits * sizeof(unsigned int)); - for(int i = 0; i < numPixelBits; i++) fread(&rbmfFileData[i], sizeof(unsigned int), 1, rbmfFile); + for (int i = 0; i < numPixelBits; i++) fread(&rbmfFileData[i], sizeof(unsigned int), 1, rbmfFile); rbmfCharWidthData = (unsigned char *)malloc(spriteFont.numChars * sizeof(unsigned char)); - for(int i = 0; i < spriteFont.numChars; i++) fread(&rbmfCharWidthData[i], sizeof(unsigned char), 1, rbmfFile); + for (int i = 0; i < spriteFont.numChars; i++) fread(&rbmfCharWidthData[i], sizeof(unsigned char), 1, rbmfFile); // Re-construct image from rbmfFileData //----------------------------------------- diff --git a/src/textures.c b/src/textures.c index 8f4fa301..4d9fc6b0 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1612,7 +1612,7 @@ static Image LoadDDS(const char *fileName) image.mipmaps = header.mipmapCount; - switch(header.ddspf.fourCC) + switch (header.ddspf.fourCC) { case FOURCC_DXT1: { -- cgit v1.2.3 From 9d66bc4a05f17f5dfe0e81b9be38f044b0dc16d4 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 5 Sep 2016 10:08:28 +0200 Subject: Added function: ImageAlphaMask() --- src/raylib.h | 1 + src/textures.c | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index d295ef90..d86b1745 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -762,6 +762,7 @@ RLAPI Color *GetImageData(Image image); RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle diff --git a/src/textures.c b/src/textures.c index 4d9fc6b0..87ac1f85 100644 --- a/src/textures.c +++ b/src/textures.c @@ -548,7 +548,7 @@ void ImageFormat(Image *image, int newFormat) { if (image->format != newFormat) { - if ((image->format < 8) && (newFormat < 8)) + if ((image->format < COMPRESSED_DXT1_RGB) && (newFormat < COMPRESSED_DXT1_RGB)) { Color *pixels = GetImageData(*image); @@ -676,12 +676,40 @@ void ImageFormat(Image *image, int newFormat) } } +// Apply alpha mask to image +// NOTE: alphaMask must be should be same size as image +void ImageAlphaMask(Image *image, Image alphaMask) +{ + if (image->format >= COMPRESSED_DXT1_RGB) + { + TraceLog(WARNING, "Alpha mask can not be applied to compressed data formats"); + return; + } + else + { + // Force mask to be Grayscale + Image mask = ImageCopy(alphaMask); + ImageFormat(&mask, UNCOMPRESSED_GRAYSCALE); + + // Convert image to RGBA + if (image->format != UNCOMPRESSED_R8G8B8A8) ImageFormat(image, UNCOMPRESSED_R8G8B8A8); + + // Apply alpha mask to alpha channel + for (int i = 0, k = 3; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 4) + { + ((unsigned char *)image->data)[k] = ((unsigned char *)mask.data)[i]; + } + + UnloadImage(mask); + } +} + // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) // NOTE: In case selected bpp do not represent an known 16bit format, // dithered data is stored in the LSB part of the unsigned short void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) { - if (image->format >= 8) + if (image->format >= COMPRESSED_DXT1_RGB) { TraceLog(WARNING, "Compressed data formats can not be dithered"); return; -- cgit v1.2.3 From 36f20376e67c8f281467df74b82759c9a05d7018 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 5 Sep 2016 20:15:21 +0200 Subject: Redesigned lighting shader system --- src/raylib.h | 6 +- src/rlgl.c | 209 +++++++++++++++++++++++++++++++++++------------------------ src/rlgl.h | 4 +- 3 files changed, 130 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index d86b1745..dff69705 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -427,7 +427,9 @@ typedef struct Shader { // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) - int tintColorLoc; // Diffuse color uniform location point (fragment shader) + int colDiffuseLoc; // Diffuse color uniform location point (fragment shader) + int colAmbientLoc; // Ambient color uniform location point (fragment shader) + int colSpecularLoc; // Specular color uniform location point (fragment shader) // Texture map locations (generic for any kind of map) int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) @@ -464,7 +466,7 @@ typedef struct LightData { int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT Vector3 position; // Light position - Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) + Vector3 target; // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) float radius; // Light attenuation radius light intensity reduced with distance (world distance) Color diffuse; // Light diffuse color diff --git a/src/rlgl.c b/src/rlgl.c index 68d562c7..1b3d9898 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -337,6 +337,8 @@ static int screenHeight; // Default framebuffer height // Lighting data static Light lights[MAX_LIGHTS]; // Lights pool static int lightsCount = 0; // Enabled lights counter +static int lightsLocs[MAX_LIGHTS][8]; // 8 possible location points per light: + // enabled, type, position, target, radius, diffuse, intensity, coneAngle //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -362,9 +364,10 @@ static void SetStereoConfig(VrDeviceInfo info); // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); -static void SetShaderLights(Shader shader); // Sets shader uniform values for lights array +static void GetShaderLightsLocations(Shader shader); // Get shader locations for lights (up to MAX_LIGHTS) +static void SetShaderLightsValues(Shader shader); // Set shader uniform values for lights -static char *ReadTextFile(const char *fileName); // Read chars array from text file +static char *ReadTextFile(const char *fileName); // Read chars array from text file #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -1939,9 +1942,14 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glUseProgram(material.shader.id); // Upload to shader material.colDiffuse - float vColorDiffuse[4] = { (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255 }; - glUniform4fv(material.shader.tintColorLoc, 1, vColorDiffuse); + glUniform4f(material.shader.colDiffuseLoc, (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255); + // Upload to shader material.colAmbient (if available) + if (material.shader.colAmbientLoc != -1) glUniform4f(material.shader.colAmbientLoc, (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); + + // Upload to shader material.colSpecular (if available) + if (material.shader.colSpecularLoc != -1) glUniform4f(material.shader.colSpecularLoc, (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); + // At this point the modelview matrix just contains the view matrix (camera) // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() Matrix matView = modelview; // View matrix (camera) @@ -1950,32 +1958,35 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Calculate model-view matrix combining matModel and matView Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates - // Check if using standard shader to get location points - // NOTE: standard shader specific locations are got at render time to keep Shader struct as simple as possible (with just default shader locations) - if (material.shader.id == standardShader.id) + // If not using default shader, we check for some additional location points + // NOTE: This method is quite inefficient... it's a temporal solution while looking for a better one + if (material.shader.id != defaultShader.id) { - // Transpose and inverse model transformations matrix for fragment normal calculations - Matrix transInvTransform = transform; - MatrixTranspose(&transInvTransform); - MatrixInvert(&transInvTransform); - - // Send model transformations matrix to shader - glUniformMatrix4fv(glGetUniformLocation(material.shader.id, "modelMatrix"), 1, false, MatrixToFloat(transInvTransform)); - - // Send view transformation matrix to shader. View matrix 8, 9 and 10 are view direction vector axis values (target - position) - glUniform3f(glGetUniformLocation(material.shader.id, "viewDir"), matView.m8, matView.m9, matView.m10); - - // Setup shader uniforms for lights - SetShaderLights(material.shader); - - // Upload to shader material.colAmbient - glUniform4f(glGetUniformLocation(material.shader.id, "colAmbient"), (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); - - // Upload to shader material.colSpecular - glUniform4f(glGetUniformLocation(material.shader.id, "colSpecular"), (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); - - // Upload to shader glossiness - glUniform1f(glGetUniformLocation(material.shader.id, "glossiness"), material.glossiness); + // Check if model matrix is located in shader and upload value + int modelMatrixLoc = glGetUniformLocation(material.shader.id, "modelMatrix"); + if (modelMatrixLoc != -1) + { + // Transpose and inverse model transformations matrix for fragment normal calculations + Matrix transInvTransform = transform; + MatrixTranspose(&transInvTransform); + MatrixInvert(&transInvTransform); + + // Send model transformations matrix to shader + glUniformMatrix4fv(modelMatrixLoc, 1, false, MatrixToFloat(transInvTransform)); + } + + // Check if view direction is located in shader and upload value + // NOTE: View matrix values m8, m9 and m10 are view direction vector axis (target - position) + int viewDirLoc = glGetUniformLocation(material.shader.id, "viewDir"); + if (viewDirLoc != -1) glUniform3f(viewDirLoc, matView.m8, matView.m9, matView.m10); + + // Check if glossiness is located in shader and upload value + int glossinessLoc = glGetUniformLocation(material.shader.id, "glossiness"); + if (glossinessLoc != -1) glUniform1f(glossinessLoc, material.glossiness); + + // Set shader lights values for enabled lights + // NOTE: Lights array location points are obtained on shader loading (if available) + if (lightsCount > 0) SetShaderLightsValues(material.shader); } // Set shader textures (diffuse, normal, specular) @@ -3100,7 +3111,7 @@ static Shader LoadStandardShader(void) shader = GetDefaultShader(); } #else - shader = defaultShader; + shader = GetDefaultShader(); TraceLog(WARNING, "[SHDR ID %i] Standard shader not available, using default shader", shader.id); #endif @@ -3112,12 +3123,12 @@ static Shader LoadStandardShader(void) static void LoadDefaultShaderLocations(Shader *shader) { // NOTE: Default shader attrib locations have been fixed before linking: - // vertex position location = 0 - // vertex texcoord location = 1 - // vertex normal location = 2 - // vertex color location = 3 - // vertex tangent location = 4 - // vertex texcoord2 location = 5 + // vertex position location = 0 + // vertex texcoord location = 1 + // vertex normal location = 2 + // vertex color location = 3 + // vertex tangent location = 4 + // vertex texcoord2 location = 5 // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_POSITION_NAME); @@ -3131,10 +3142,18 @@ static void LoadDefaultShaderLocations(Shader *shader) shader->mvpLoc = glGetUniformLocation(shader->id, "mvpMatrix"); // Get handles to GLSL uniform locations (fragment shader) - shader->tintColorLoc = glGetUniformLocation(shader->id, "colDiffuse"); + shader->colDiffuseLoc = glGetUniformLocation(shader->id, "colDiffuse"); + shader->colAmbientLoc = glGetUniformLocation(shader->id, "colAmbient"); + shader->colSpecularLoc = glGetUniformLocation(shader->id, "colSpecular"); + shader->mapTexture0Loc = glGetUniformLocation(shader->id, "texture0"); shader->mapTexture1Loc = glGetUniformLocation(shader->id, "texture1"); shader->mapTexture2Loc = glGetUniformLocation(shader->id, "texture2"); + + // TODO: Try to find all expected/recognized shader locations (predefined names, must be documented) + + // Try to get lights location points (if available) + GetShaderLightsLocations(*shader); } // Unload default shader @@ -3425,7 +3444,7 @@ static void DrawDefaultBuffers(int eyesCount) Matrix matMVP = MatrixMultiply(modelview, projection); glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); - glUniform4f(currentShader.tintColorLoc, 1.0f, 1.0f, 1.0f, 1.0f); + glUniform4f(currentShader.colDiffuseLoc, 1.0f, 1.0f, 1.0f, 1.0f); glUniform1i(currentShader.mapTexture0Loc, 0); // NOTE: Additional map textures not considered for default buffers drawing @@ -3620,82 +3639,100 @@ static void UnloadDefaultBuffers(void) free(quads.indices); } -// Setup shader uniform values for lights array -// NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0f -static void SetShaderLights(Shader shader) +// Get shader locations for lights (up to MAX_LIGHTS) +static void GetShaderLightsLocations(Shader shader) { - int locPoint = -1; - char locName[32] = "lights[x].position\0"; - + char locName[32] = "lights[x].\0"; + char locNameUpdated[64]; + for (int i = 0; i < MAX_LIGHTS; i++) { locName[7] = '0' + i; + + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "enabled\0"); + lightsLocs[i][0] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "type\0"); + lightsLocs[i][1] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "position\0"); + lightsLocs[i][2] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "direction\0"); + lightsLocs[i][3] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "radius\0"); + lightsLocs[i][4] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "diffuse\0"); + lightsLocs[i][5] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "intensity\0"); + lightsLocs[i][6] = glGetUniformLocation(shader.id, locNameUpdated); + + locNameUpdated[0] = '\0'; + strcpy(locNameUpdated, locName); + strcat(locNameUpdated, "coneAngle\0"); + lightsLocs[i][7] = glGetUniformLocation(shader.id, locNameUpdated); + } +} - if (lights[i] != NULL) // Only upload registered lights data +// Set shader uniform values for lights +// NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0 +static void SetShaderLightsValues(Shader shader) +{ + for (int i = 0; i < MAX_LIGHTS; i++) + { + if (i < lightsCount) { - memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform1i(locPoint, lights[i]->enabled); - - memcpy(&locName[10], "type\0", strlen("type\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform1i(locPoint, lights[i]->type); - - memcpy(&locName[10], "diffuse\0", strlen("diffuse\0") + 2); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform4f(locPoint, (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); - - memcpy(&locName[10], "intensity\0", strlen("intensity\0")); - locPoint = glGetUniformLocation(shader.id, locName); - glUniform1f(locPoint, lights[i]->intensity); + glUniform1i(lightsLocs[i][0], lights[i]->enabled); + + glUniform1i(lightsLocs[i][1], lights[i]->type); + glUniform4f(lightsLocs[i][5], (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); + glUniform1f(lightsLocs[i][6], lights[i]->intensity); switch (lights[i]->type) { case LIGHT_POINT: { - memcpy(&locName[10], "position\0", strlen("position\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - - memcpy(&locName[10], "radius\0", strlen("radius\0") + 2); - locPoint = GetShaderLocation(shader, locName); - glUniform1f(locPoint, lights[i]->radius); + glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); + glUniform1f(lightsLocs[i][4], lights[i]->radius); } break; case LIGHT_DIRECTIONAL: { - memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); - locPoint = GetShaderLocation(shader, locName); Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; VectorNormalize(&direction); - glUniform3f(locPoint, direction.x, direction.y, direction.z); + glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); } break; case LIGHT_SPOT: { - memcpy(&locName[10], "position\0", strlen("position\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform3f(locPoint, lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - - memcpy(&locName[10], "direction\0", strlen("direction\0") + 2); - locPoint = GetShaderLocation(shader, locName); + glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; VectorNormalize(&direction); - glUniform3f(locPoint, direction.x, direction.y, direction.z); + glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); - memcpy(&locName[10], "coneAngle\0", strlen("coneAngle\0")); - locPoint = GetShaderLocation(shader, locName); - glUniform1f(locPoint, lights[i]->coneAngle); + glUniform1f(lightsLocs[i][7], lights[i]->coneAngle); } break; default: break; } - - // TODO: Pass to the shader any other required data from LightData struct } - else // Not enabled lights + else { - memcpy(&locName[10], "enabled\0", strlen("enabled\0") + 1); - locPoint = GetShaderLocation(shader, locName); - glUniform1i(locPoint, 0); + glUniform1i(lightsLocs[i][0], 0); // Light disabled } } } diff --git a/src/rlgl.h b/src/rlgl.h index 3fc54219..5fc9f8b9 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -168,7 +168,9 @@ typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; // Uniform locations int mvpLoc; // ModelView-Projection matrix uniform location point (vertex shader) - int tintColorLoc; // Color uniform location point (fragment shader) + int colDiffuseLoc; // Color uniform location point (fragment shader) + int colAmbientLoc; // Ambient color uniform location point (fragment shader) + int colSpecularLoc; // Specular color uniform location point (fragment shader) // Texture map locations (generic for any kind of map) int mapTexture0Loc; // Map texture uniform location point (default-texture-unit = 0) -- cgit v1.2.3 From 10280c4b91871065ea2fc15a3f3e939820f3e0a0 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 7 Sep 2016 23:14:16 +0200 Subject: Some code tweaks --- src/rlgl.c | 6 +++--- src/textures.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 1b3d9898..518f2a66 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -337,7 +337,7 @@ static int screenHeight; // Default framebuffer height // Lighting data static Light lights[MAX_LIGHTS]; // Lights pool static int lightsCount = 0; // Enabled lights counter -static int lightsLocs[MAX_LIGHTS][8]; // 8 possible location points per light: +static int lightsLocs[MAX_LIGHTS][8]; // Lights location points in shader: 8 possible points per light: // enabled, type, position, target, radius, diffuse, intensity, coneAngle //---------------------------------------------------------------------------------- @@ -3713,7 +3713,7 @@ static void SetShaderLightsValues(Shader shader) } break; case LIGHT_DIRECTIONAL: { - Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position); VectorNormalize(&direction); glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); } break; @@ -3721,7 +3721,7 @@ static void SetShaderLightsValues(Shader shader) { glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - Vector3 direction = { lights[i]->target.x - lights[i]->position.x, lights[i]->target.y - lights[i]->position.y, lights[i]->target.z - lights[i]->position.z }; + Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position); VectorNormalize(&direction); glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); diff --git a/src/textures.c b/src/textures.c index 87ac1f85..5186c0ba 100644 --- a/src/textures.c +++ b/src/textures.c @@ -677,7 +677,8 @@ void ImageFormat(Image *image, int newFormat) } // Apply alpha mask to image -// NOTE: alphaMask must be should be same size as image +// NOTE 1: Returned image is RGBA - 32bit +// NOTE 2: alphaMask should be same size as image void ImageAlphaMask(Image *image, Image alphaMask) { if (image->format >= COMPRESSED_DXT1_RGB) -- cgit v1.2.3 From 8b35de3276d0fbf0487ed73fe2c2dfb2340e0431 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 8 Sep 2016 00:20:06 +0200 Subject: Added new audio functions -IN PROGRESS- - LoadWave() - LoadWaveEx() - UnloadWave() - WaveFormat() - WaveCopy() - WaveCrop() - GetWaveData() --- src/audio.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- src/raylib.h | 26 +++++++---- 2 files changed, 144 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index ea14d77d..11d0d6b9 100644 --- a/src/audio.c +++ b/src/audio.c @@ -126,9 +126,8 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static Wave LoadWAV(const char *fileName); // Load WAV file -static Wave LoadOGG(char *fileName); // Load OGG file -static void UnloadWave(Wave wave); // Unload wave data +static Wave LoadWAV(const char *fileName); // Load WAV file +static Wave LoadOGG(const char *fileName); // Load OGG file #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -206,20 +205,39 @@ bool IsAudioDeviceReady(void) // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- -// Load sound to memory -// NOTE: The entire file is loaded to memory to be played (no-streaming) -Sound LoadSound(char *fileName) +// Load wave data from file into RAM +Wave LoadWave(const char *fileName) { Wave wave = { 0 }; if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); - else TraceLog(WARNING, "[%s] Sound extension not recognized, it can't be loaded", fileName); + else TraceLog(WARNING, "[%s] File extension not recognized, it can't be loaded", fileName); - Sound sound = LoadSoundFromWave(wave); + return wave; +} - // Sound is loaded, we can unload wave - UnloadWave(wave); +// Load wave data from float array data (32bit) +Wave LoadWaveEx(float *data, int sampleRate, int sampleSize, int channels) +{ + Wave wave; + + wave.data = data; + + WaveFormat(&wave, sampleRate, sampleSize, channels); + + return wave; +} + +// Load sound to memory +// NOTE: The entire file is loaded to memory to be played (no-streaming) +Sound LoadSound(const char *fileName) +{ + Wave wave = LoadWave(fileName); + + Sound sound = LoadSoundFromWave(wave); + + UnloadWave(wave); // Sound is loaded, we can unload wave return sound; } @@ -401,6 +419,14 @@ Sound LoadSoundFromRES(const char *rresName, int resId) return sound; } +// Unload Wave data +void UnloadWave(Wave wave) +{ + free(wave.data); + + TraceLog(INFO, "Unloaded wave data from RAM"); +} + // Unload sound void UnloadSound(Sound sound) { @@ -504,12 +530,102 @@ void SetSoundPitch(Sound sound, float pitch) alSourcef(sound.source, AL_PITCH, pitch); } +// Convert wave data to desired format +void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) +{ + if (wave->sampleSize != sampleSize) + { + float *samples = GetWaveData(*wave); //Color *pixels = GetImageData(*image); + + free(wave->data); + + //image->format = newFormat; + + if (sampleSize == 8) + { + wave->data = (unsigned char *)malloc(wave->sampleCount*sizeof(unsigned char)); + + for (int i = 0; i < wave->sampleCount; i++) + { + ((unsigned char *)wave->data)[i] = (unsigned char)((float)samples[i]); // TODO: review conversion + } + } + else if (sampleSize == 16) + { + wave->data = (short *)malloc(wave->sampleCount*sizeof(short)); + + for (int i = 0; i < wave->sampleCount; i++) + { + ((short *)wave->data)[i] = (short)((float)samples[i]); // TODO: review conversion + } + } + else if (sampleSize == 32) + { + wave->data = (float *)malloc(wave->sampleCount*sizeof(float)); + + for (int i = 0; i < wave->sampleCount; i++) + { + ((float *)wave->data)[i] = (float)samples[i]; // TODO: review conversion + } + } + else TraceLog(WARNING, "Wave formatting: Sample size not supported"); + } + + // TODO: Consider channels (mono vs stereo) +} + +// Copy a wave to a new wave +Wave WaveCopy(Wave wave) +{ + Wave newWave; + + if (wave.sampleSize == 8) newWave.data = (unsigned char *)malloc(wave.sampleCount*sizeof(unsigned char)); + else if (wave.sampleSize == 16) newWave.data = (short *)malloc(wave.sampleCount*sizeof(short)); + else if (wave.sampleSize == 32) newWave.data = (float *)malloc(wave.sampleCount*sizeof(float)); + else TraceLog(WARNING, "Wave sample size not supported for copy"); + + if (newWave.data != NULL) + { + // NOTE: Size must be provided in bytes + memcpy(newWave.data, wave.data, wave.sampleCount); + + newWave.sampleCount = wave.sampleCount; + newWave.sampleRate = wave.sampleRate; + newWave.sampleSize = wave.sampleSize; + newWave.channels = wave.channels; + } + + return newWave; +} + +// Crop a wave to defined samples range +// NOTE: Security check in case of out-of-range +void WaveCrop(Wave *wave, int initSample, int finalSample) +{ + // TODO: Crop wave to a samples range +} + +// Get samples data from wave as a floats array +float *GetWaveData(Wave wave) +{ + float *samples = (float *)malloc(wave.sampleCount*sizeof(float)); + + for (int i = 0; i < wave.sampleCount; i++) + { + if (wave.sampleSize == 8) samples[i] = (float)((unsigned char *)wave.data)[i]; // TODO: review conversion + else if (wave.sampleSize == 16) samples[i] = (float)((short *)wave.data)[i]; // TODO: review conversion + else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; // TODO: review conversion + } + + return samples; +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Music loading and stream playing (.OGG) //---------------------------------------------------------------------------------- // Load music stream from file -Music LoadMusicStream(char *fileName) +Music LoadMusicStream(const char *fileName) { Music music = (MusicData *)malloc(sizeof(MusicData)); @@ -1013,7 +1129,7 @@ static Wave LoadWAV(const char *fileName) // Load OGG file into Wave structure // NOTE: Using stb_vorbis library -static Wave LoadOGG(char *fileName) +static Wave LoadOGG(const char *fileName) { Wave wave; @@ -1054,14 +1170,6 @@ static Wave LoadOGG(char *fileName) return wave; } -// Unload Wave data -static void UnloadWave(Wave wave) -{ - free(wave.data); - - TraceLog(INFO, "Unloaded wave data from RAM"); -} - // Some required functions for audio standalone module version #if defined(AUDIO_STANDALONE) // Get the extension for a filename diff --git a/src/raylib.h b/src/raylib.h index dff69705..ae3de038 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -484,13 +484,6 @@ typedef struct Ray { Vector3 direction; // Ray direction } Ray; -// Sound source type -typedef struct Sound { - unsigned int source; // OpenAL audio source id - unsigned int buffer; // OpenAL audio buffer id - int format; // OpenAL audio format specifier -} Sound; - // Wave type, defines audio wave data typedef struct Wave { unsigned int sampleCount; // Number of samples @@ -500,6 +493,13 @@ typedef struct Wave { void *data; // Buffer data pointer } Wave; +// Sound source type +typedef struct Sound { + unsigned int source; // OpenAL audio source id + unsigned int buffer; // OpenAL audio buffer id + int format; // OpenAL audio format specifier +} Sound; + // Music type (file streaming from memory) // NOTE: Anything longer than ~10 seconds should be streamed typedef struct MusicData *Music; @@ -909,10 +909,13 @@ RLAPI void InitAudioDevice(void); // Initial RLAPI void CloseAudioDevice(void); // Close the audio device and context (and music stream) RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -RLAPI Sound LoadSound(char *fileName); // Load sound to memory +RLAPI Wave LoadWave(const char *fileName); // Load wave data from file into RAM +RLAPI Wave LoadWaveEx(float *data, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) +RLAPI Sound LoadSound(const char *fileName); // Load sound to memory RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data +RLAPI void UnloadWave(Wave wave); RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound RLAPI void PauseSound(Sound sound); // Pause a sound @@ -921,8 +924,11 @@ RLAPI void StopSound(Sound sound); // Stop pl RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) - -RLAPI Music LoadMusicStream(char *fileName); // Load music stream from file +RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave +RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array +RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing (open stream) RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming -- cgit v1.2.3 From 1e55c30824a1fbf4449a1646ca0cf15cd96fa63d Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 8 Sep 2016 01:02:42 +0200 Subject: Removed raygui from raylib repo (own repo) --- src/raygui.h | 1499 ---------------------------------------------------------- 1 file changed, 1499 deletions(-) delete mode 100644 src/raygui.h (limited to 'src') diff --git a/src/raygui.h b/src/raygui.h deleted file mode 100644 index 42cf264b..00000000 --- a/src/raygui.h +++ /dev/null @@ -1,1499 +0,0 @@ -/******************************************************************************************* -* -* raygui 1.0 - IMGUI (Immedite Mode GUI) library for raylib (https://github.com/raysan5/raylib) -* -* raygui is a library for creating simple IMGUI interfaces using raylib. -* It provides a set of basic components: -* -* - Label -* - Button -* - ToggleButton -* - ToggleGroup -* - ComboBox -* - CheckBox -* - Slider -* - SliderBar -* - ProgressBar -* - Spinner -* - TextBox -* -* It also provides a set of functions for styling the components based on its properties (size, color). -* -* CONFIGURATION: -* -* #define RAYGUI_IMPLEMENTATION -* Generates the implementation of the library into the included file. -* If not defined, the library is in header only mode and can be included in other headers -* or source files without problems. But only ONE file should hold the implementation. -* -* #define RAYGUI_STATIC (defined by default) -* The generated implementation will stay private inside implementation file and all -* internal symbols and functions will only be visible inside that file. -* -* #define RAYGUI_STANDALONE -* Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined -* internally in the library and input management and drawing functions must be provided by -* the user (check library implementation for further details). -* -* #define RAYGUI_MALLOC() -* #define RAYGUI_FREE() -* You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions. -* Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. -* -* LIMITATIONS: -* -* // TODO. -* -* VERSIONS: -* -* 1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria. -* 0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria. -* 0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria. -* -* CONTRIBUTORS: -* Ramon Santamaria: Functions design and naming conventions. -* Kevin Gato: Initial implementation of basic components. -* Daniel Nicolas: Initial implementation of basic components. -* Albert Martos: Review and testing of library. -* Ian Eito: Review and testing of the library. -* Sergio Martinez: Review and testing of the library. -* -* LICENSE: zlib/libpng -* -* Copyright (c) 2015-2016 emegeme (@emegemegames) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -#ifndef RAYGUI_H -#define RAYGUI_H - -#if !defined(RAYGUI_STANDALONE) - #include "raylib.h" -#endif - -#define RAYGUI_STATIC -#ifdef RAYGUI_STATIC - #define RAYGUIDEF static // Functions just visible to module including this file -#else - #ifdef __cplusplus - #define RAYGUIDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) - #else - #define RAYGUIDEF extern // Functions visible from other files - #endif -#endif - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define NUM_PROPERTIES 98 - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -// NOTE: Some types are required for RAYGUI_STANDALONE usage -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) - #ifndef __cplusplus - // Boolean type - #ifndef true - typedef enum { false, true } bool; - #endif - #endif - - // Vector2 type - typedef struct Vector2 { - float x; - float y; - } Vector2; - - // Color type, RGBA (32bit) - typedef struct Color { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; - } Color; - - // Rectangle type - typedef struct Rectangle { - int x; - int y; - int width; - int height; - } Rectangle; -#endif - -// Gui properties enumeration -typedef enum GuiProperty { - GLOBAL_BASE_COLOR = 0, - GLOBAL_BORDER_COLOR, - GLOBAL_TEXT_COLOR, - GLOBAL_TEXT_FONTSIZE, - GLOBAL_BORDER_WIDTH, - BACKGROUND_COLOR, - LABEL_BORDER_WIDTH, - LABEL_TEXT_COLOR, - LABEL_TEXT_PADDING, - BUTTON_BORDER_WIDTH, - BUTTON_TEXT_PADDING, - BUTTON_DEFAULT_BORDER_COLOR, - BUTTON_DEFAULT_INSIDE_COLOR, - BUTTON_DEFAULT_TEXT_COLOR, - BUTTON_HOVER_BORDER_COLOR, - BUTTON_HOVER_INSIDE_COLOR, - BUTTON_HOVER_TEXT_COLOR, - BUTTON_PRESSED_BORDER_COLOR, - BUTTON_PRESSED_INSIDE_COLOR, - BUTTON_PRESSED_TEXT_COLOR, - TOGGLE_TEXT_PADDING, - TOGGLE_BORDER_WIDTH, - TOGGLE_DEFAULT_BORDER_COLOR, - TOGGLE_DEFAULT_INSIDE_COLOR, - TOGGLE_DEFAULT_TEXT_COLOR, - TOGGLE_HOVER_BORDER_COLOR, - TOGGLE_HOVER_INSIDE_COLOR, - TOGGLE_HOVER_TEXT_COLOR, - TOGGLE_PRESSED_BORDER_COLOR, - TOGGLE_PRESSED_INSIDE_COLOR, - TOGGLE_PRESSED_TEXT_COLOR, - TOGGLE_ACTIVE_BORDER_COLOR, - TOGGLE_ACTIVE_INSIDE_COLOR, - TOGGLE_ACTIVE_TEXT_COLOR, - TOGGLEGROUP_PADDING, - SLIDER_BORDER_WIDTH, - SLIDER_BUTTON_BORDER_WIDTH, - SLIDER_BORDER_COLOR, - SLIDER_INSIDE_COLOR, - SLIDER_DEFAULT_COLOR, - SLIDER_HOVER_COLOR, - SLIDER_ACTIVE_COLOR, - SLIDERBAR_BORDER_COLOR, - SLIDERBAR_INSIDE_COLOR, - SLIDERBAR_DEFAULT_COLOR, - SLIDERBAR_HOVER_COLOR, - SLIDERBAR_ACTIVE_COLOR, - SLIDERBAR_ZERO_LINE_COLOR, - PROGRESSBAR_BORDER_COLOR, - PROGRESSBAR_INSIDE_COLOR, - PROGRESSBAR_PROGRESS_COLOR, - PROGRESSBAR_BORDER_WIDTH, - SPINNER_LABEL_BORDER_COLOR, - SPINNER_LABEL_INSIDE_COLOR, - SPINNER_DEFAULT_BUTTON_BORDER_COLOR, - SPINNER_DEFAULT_BUTTON_INSIDE_COLOR, - SPINNER_DEFAULT_SYMBOL_COLOR, - SPINNER_DEFAULT_TEXT_COLOR, - SPINNER_HOVER_BUTTON_BORDER_COLOR, - SPINNER_HOVER_BUTTON_INSIDE_COLOR, - SPINNER_HOVER_SYMBOL_COLOR, - SPINNER_HOVER_TEXT_COLOR, - SPINNER_PRESSED_BUTTON_BORDER_COLOR, - SPINNER_PRESSED_BUTTON_INSIDE_COLOR, - SPINNER_PRESSED_SYMBOL_COLOR, - SPINNER_PRESSED_TEXT_COLOR, - COMBOBOX_PADDING, - COMBOBOX_BUTTON_WIDTH, - COMBOBOX_BUTTON_HEIGHT, - COMBOBOX_BORDER_WIDTH, - COMBOBOX_DEFAULT_BORDER_COLOR, - COMBOBOX_DEFAULT_INSIDE_COLOR, - COMBOBOX_DEFAULT_TEXT_COLOR, - COMBOBOX_DEFAULT_LIST_TEXT_COLOR, - COMBOBOX_HOVER_BORDER_COLOR, - COMBOBOX_HOVER_INSIDE_COLOR, - COMBOBOX_HOVER_TEXT_COLOR, - COMBOBOX_HOVER_LIST_TEXT_COLOR, - COMBOBOX_PRESSED_BORDER_COLOR, - COMBOBOX_PRESSED_INSIDE_COLOR, - COMBOBOX_PRESSED_TEXT_COLOR, - COMBOBOX_PRESSED_LIST_BORDER_COLOR, - COMBOBOX_PRESSED_LIST_INSIDE_COLOR, - COMBOBOX_PRESSED_LIST_TEXT_COLOR, - CHECKBOX_DEFAULT_BORDER_COLOR, - CHECKBOX_DEFAULT_INSIDE_COLOR, - CHECKBOX_HOVER_BORDER_COLOR, - CHECKBOX_HOVER_INSIDE_COLOR, - CHECKBOX_CLICK_BORDER_COLOR, - CHECKBOX_CLICK_INSIDE_COLOR, - CHECKBOX_STATUS_ACTIVE_COLOR, - CHECKBOX_INSIDE_WIDTH, - TEXTBOX_BORDER_WIDTH, - TEXTBOX_BORDER_COLOR, - TEXTBOX_INSIDE_COLOR, - TEXTBOX_TEXT_COLOR, - TEXTBOX_LINE_COLOR, - TEXTBOX_TEXT_FONTSIZE -} GuiProperty; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- -RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text); // Label element, show text -RAYGUIDEF void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner); // Label element extended, configurable colors -RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text); // Button element, returns true when clicked -RAYGUIDEF bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle); // Toggle Button element, returns true when active -RAYGUIDEF int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive); // Toggle Group element, returns toggled button index -RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive); // Combo Box element, returns selected item index -RAYGUIDEF bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box element, returns true when active -RAYGUIDEF float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue); // Slider element, returns selected value -RAYGUIDEF float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue); // Slider Bar element, returns selected value -RAYGUIDEF void GuiProgressBar(Rectangle bounds, float value); // Progress Bar element, shows current progress value -RAYGUIDEF int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue); // Spinner element, returns selected value -RAYGUIDEF char *GuiTextBox(Rectangle bounds, char *text); // Text Box element, returns input text - -RAYGUIDEF void SaveGuiStyle(const char *fileName); // Save GUI style file -RAYGUIDEF void LoadGuiStyle(const char *fileName); // Load GUI style file - -RAYGUIDEF void SetStyleProperty(int guiProperty, int value); // Set one style property -RAYGUIDEF int GetStyleProperty(int guiProperty); // Get one style property - -#endif // RAYGUI_H - - -/*********************************************************************************** -* -* RAYGUI IMPLEMENTATION -* -************************************************************************************/ - -#if defined(RAYGUI_IMPLEMENTATION) - -#include // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf() - // NOTE: Those functions are only used in SaveGuiStyle() and LoadGuiStyle() - -// Check if custom malloc/free functions defined, if not, using standard ones -#if !defined(RAYGUI_MALLOC) - #include // Required for: malloc(), free() [Used only on LoadGuiStyle()] - - #define RAYGUI_MALLOC(size) malloc(size) - #define RAYGUI_FREE(ptr) free(ptr) -#endif - -#include // Required for: strcmp() [Used only on LoadGuiStyle()] -#include // Required for: va_list, va_start(), vfprintf(), va_end() - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#if defined(RAYGUI_STANDALONE) - #define KEY_LEFT 263 - #define KEY_RIGHT 262 - #define MOUSE_LEFT_BUTTON 0 -#endif - -//---------------------------------------------------------------------------------- -// Types and Structures Definition -//---------------------------------------------------------------------------------- - -// GUI elements states -typedef enum { BUTTON_DEFAULT, BUTTON_HOVER, BUTTON_PRESSED, BUTTON_CLICKED } ButtonState; -typedef enum { TOGGLE_UNACTIVE, TOGGLE_HOVER, TOGGLE_PRESSED, TOGGLE_ACTIVE } ToggleState; -typedef enum { COMBOBOX_UNACTIVE, COMBOBOX_HOVER, COMBOBOX_PRESSED, COMBOBOX_ACTIVE } ComboBoxState; -typedef enum { SPINNER_DEFAULT, SPINNER_HOVER, SPINNER_PRESSED } SpinnerState; -typedef enum { CHECKBOX_STATUS, CHECKBOX_HOVER, CHECKBOX_PRESSED } CheckBoxState; -typedef enum { SLIDER_DEFAULT, SLIDER_HOVER, SLIDER_ACTIVE } SliderState; - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- - -// Current GUI style (default light) -static int style[NUM_PROPERTIES] = { - 0xf5f5f5ff, // GLOBAL_BASE_COLOR, - 0xf5f5f5ff, // GLOBAL_BORDER_COLOR, - 0xf5f5f5ff, // GLOBAL_TEXT_COLOR, - 10, // GLOBAL_TEXT_FONTSIZE - 1, // GLOBAL_BORDER_WIDTH - 0xf5f5f5ff, // BACKGROUND_COLOR - 1, // LABEL_BORDER_WIDTH - 0x4d4d4dff, // LABEL_TEXT_COLOR - 20, // LABEL_TEXT_PADDING - 2, // BUTTON_BORDER_WIDTH - 20, // BUTTON_TEXT_PADDING - 0x828282ff, // BUTTON_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // BUTTON_DEFAULT_INSIDE_COLOR - 0x4d4d4dff, // BUTTON_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // BUTTON_HOVER_BORDER_COLOR - 0xffffffff, // BUTTON_HOVER_INSIDE_COLOR - 0x353535ff, // BUTTON_HOVER_TEXT_COLOR - 0x7bb0d6ff, // BUTTON_PRESSED_BORDER_COLOR - 0xbcecffff, // BUTTON_PRESSED_INSIDE_COLOR - 0x5f9aa7ff, // BUTTON_PRESSED_TEXT_COLOR - 20, // TOGGLE_TEXT_PADDING - 1, // TOGGLE_BORDER_WIDTH - 0x828282ff, // TOGGLE_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // TOGGLE_DEFAULT_INSIDE_COLOR - 0x828282ff, // TOGGLE_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // TOGGLE_HOVER_BORDER_COLOR - 0xffffffff, // TOGGLE_HOVER_INSIDE_COLOR - 0x828282ff, // TOGGLE_HOVER_TEXT_COLOR - 0xbdd7eaff, // TOGGLE_PRESSED_BORDER_COLOR - 0xddf5ffff, // TOGGLE_PRESSED_INSIDE_COLOR - 0xafccd3ff, // TOGGLE_PRESSED_TEXT_COLOR - 0x7bb0d6ff, // TOGGLE_ACTIVE_BORDER_COLOR - 0xbcecffff, // TOGGLE_ACTIVE_INSIDE_COLOR - 0x5f9aa7ff, // TOGGLE_ACTIVE_TEXT_COLOR - 3, // TOGGLEGROUP_PADDING - 1, // SLIDER_BORDER_WIDTH - 1, // SLIDER_BUTTON_BORDER_WIDTH - 0x828282ff, // SLIDER_BORDER_COLOR - 0xc8c8c8ff, // SLIDER_INSIDE_COLOR - 0xbcecffff, // SLIDER_DEFAULT_COLOR - 0xffffffff, // SLIDER_HOVER_COLOR - 0xddf5ffff, // SLIDER_ACTIVE_COLOR - 0x828282ff, // SLIDERBAR_BORDER_COLOR - 0xc8c8c8ff, // SLIDERBAR_INSIDE_COLOR - 0xbcecffff, // SLIDERBAR_DEFAULT_COLOR - 0xffffffff, // SLIDERBAR_HOVER_COLOR - 0xddf5ffff, // SLIDERBAR_ACTIVE_COLOR - 0x828282ff, // SLIDERBAR_ZERO_LINE_COLOR - 0x828282ff, // PROGRESSBAR_BORDER_COLOR - 0xc8c8c8ff, // PROGRESSBAR_INSIDE_COLOR - 0xbcecffff, // PROGRESSBAR_PROGRESS_COLOR - 2, // PROGRESSBAR_BORDER_WIDTH - 0x828282ff, // SPINNER_LABEL_BORDER_COLOR - 0xc8c8c8ff, // SPINNER_LABEL_INSIDE_COLOR - 0x828282ff, // SPINNER_DEFAULT_BUTTON_BORDER_COLOR - 0xc8c8c8ff, // SPINNER_DEFAULT_BUTTON_INSIDE_COLOR - 0x000000ff, // SPINNER_DEFAULT_SYMBOL_COLOR - 0x000000ff, // SPINNER_DEFAULT_TEXT_COLOR - 0xc8c8c8ff, // SPINNER_HOVER_BUTTON_BORDER_COLOR - 0xffffffff, // SPINNER_HOVER_BUTTON_INSIDE_COLOR - 0x000000ff, // SPINNER_HOVER_SYMBOL_COLOR - 0x000000ff, // SPINNER_HOVER_TEXT_COLOR - 0x7bb0d6ff, // SPINNER_PRESSED_BUTTON_BORDER_COLOR - 0xbcecffff, // SPINNER_PRESSED_BUTTON_INSIDE_COLOR - 0x5f9aa7ff, // SPINNER_PRESSED_SYMBOL_COLOR - 0x000000ff, // SPINNER_PRESSED_TEXT_COLOR - 1, // COMBOBOX_PADDING - 30, // COMBOBOX_BUTTON_WIDTH - 20, // COMBOBOX_BUTTON_HEIGHT - 1, // COMBOBOX_BORDER_WIDTH - 0x828282ff, // COMBOBOX_DEFAULT_BORDER_COLOR - 0xc8c8c8ff, // COMBOBOX_DEFAULT_INSIDE_COLOR - 0x828282ff, // COMBOBOX_DEFAULT_TEXT_COLOR - 0x828282ff, // COMBOBOX_DEFAULT_LIST_TEXT_COLOR - 0xc8c8c8ff, // COMBOBOX_HOVER_BORDER_COLOR - 0xffffffff, // COMBOBOX_HOVER_INSIDE_COLOR - 0x828282ff, // COMBOBOX_HOVER_TEXT_COLOR - 0x828282ff, // COMBOBOX_HOVER_LIST_TEXT_COLOR - 0x7bb0d6ff, // COMBOBOX_PRESSED_BORDER_COLOR - 0xbcecffff, // COMBOBOX_PRESSED_INSIDE_COLOR - 0x5f9aa7ff, // COMBOBOX_PRESSED_TEXT_COLOR - 0x0078acff, // COMBOBOX_PRESSED_LIST_BORDER_COLOR - 0x66e7ffff, // COMBOBOX_PRESSED_LIST_INSIDE_COLOR - 0x0078acff, // COMBOBOX_PRESSED_LIST_TEXT_COLOR - 0x828282ff, // CHECKBOX_DEFAULT_BORDER_COLOR - 0xffffffff, // CHECKBOX_DEFAULT_INSIDE_COLOR - 0xc8c8c8ff, // CHECKBOX_HOVER_BORDER_COLOR - 0xffffffff, // CHECKBOX_HOVER_INSIDE_COLOR - 0x66e7ffff, // CHECKBOX_CLICK_BORDER_COLOR - 0xddf5ffff, // CHECKBOX_CLICK_INSIDE_COLOR - 0x7bb0d6ff, // CHECKBOX_STATUS_ACTIVE_COLOR - 4, // CHECKBOX_INSIDE_WIDTH - 1, // TEXTBOX_BORDER_WIDTH - 0x828282ff, // TEXTBOX_BORDER_COLOR - 0xf5f5f5ff, // TEXTBOX_INSIDE_COLOR - 0x000000ff, // TEXTBOX_TEXT_COLOR - 0x000000ff, // TEXTBOX_LINE_COLOR - 10 // TEXTBOX_TEXT_FONTSIZE -}; - -// GUI property names (to read/write style text files) -static const char *guiPropertyName[] = { - "GLOBAL_BASE_COLOR", - "GLOBAL_BORDER_COLOR", - "GLOBAL_TEXT_COLOR", - "GLOBAL_TEXT_FONTSIZE", - "GLOBAL_BORDER_WIDTH", - "BACKGROUND_COLOR", - "LABEL_BORDER_WIDTH", - "LABEL_TEXT_COLOR", - "LABEL_TEXT_PADDING", - "BUTTON_BORDER_WIDTH", - "BUTTON_TEXT_PADDING", - "BUTTON_DEFAULT_BORDER_COLOR", - "BUTTON_DEFAULT_INSIDE_COLOR", - "BUTTON_DEFAULT_TEXT_COLOR", - "BUTTON_HOVER_BORDER_COLOR", - "BUTTON_HOVER_INSIDE_COLOR", - "BUTTON_HOVER_TEXT_COLOR", - "BUTTON_PRESSED_BORDER_COLOR", - "BUTTON_PRESSED_INSIDE_COLOR", - "BUTTON_PRESSED_TEXT_COLOR", - "TOGGLE_TEXT_PADDING", - "TOGGLE_BORDER_WIDTH", - "TOGGLE_DEFAULT_BORDER_COLOR", - "TOGGLE_DEFAULT_INSIDE_COLOR", - "TOGGLE_DEFAULT_TEXT_COLOR", - "TOGGLE_HOVER_BORDER_COLOR", - "TOGGLE_HOVER_INSIDE_COLOR", - "TOGGLE_HOVER_TEXT_COLOR", - "TOGGLE_PRESSED_BORDER_COLOR", - "TOGGLE_PRESSED_INSIDE_COLOR", - "TOGGLE_PRESSED_TEXT_COLOR", - "TOGGLE_ACTIVE_BORDER_COLOR", - "TOGGLE_ACTIVE_INSIDE_COLOR", - "TOGGLE_ACTIVE_TEXT_COLOR", - "TOGGLEGROUP_PADDING", - "SLIDER_BORDER_WIDTH", - "SLIDER_BUTTON_BORDER_WIDTH", - "SLIDER_BORDER_COLOR", - "SLIDER_INSIDE_COLOR", - "SLIDER_DEFAULT_COLOR", - "SLIDER_HOVER_COLOR", - "SLIDER_ACTIVE_COLOR", - "SLIDERBAR_BORDER_COLOR", - "SLIDERBAR_INSIDE_COLOR", - "SLIDERBAR_DEFAULT_COLOR", - "SLIDERBAR_HOVER_COLOR", - "SLIDERBAR_ACTIVE_COLOR", - "SLIDERBAR_ZERO_LINE_COLOR", - "PROGRESSBAR_BORDER_COLOR", - "PROGRESSBAR_INSIDE_COLOR", - "PROGRESSBAR_PROGRESS_COLOR", - "PROGRESSBAR_BORDER_WIDTH", - "SPINNER_LABEL_BORDER_COLOR", - "SPINNER_LABEL_INSIDE_COLOR", - "SPINNER_DEFAULT_BUTTON_BORDER_COLOR", - "SPINNER_DEFAULT_BUTTON_INSIDE_COLOR", - "SPINNER_DEFAULT_SYMBOL_COLOR", - "SPINNER_DEFAULT_TEXT_COLOR", - "SPINNER_HOVER_BUTTON_BORDER_COLOR", - "SPINNER_HOVER_BUTTON_INSIDE_COLOR", - "SPINNER_HOVER_SYMBOL_COLOR", - "SPINNER_HOVER_TEXT_COLOR", - "SPINNER_PRESSED_BUTTON_BORDER_COLOR", - "SPINNER_PRESSED_BUTTON_INSIDE_COLOR", - "SPINNER_PRESSED_SYMBOL_COLOR", - "SPINNER_PRESSED_TEXT_COLOR", - "COMBOBOX_PADDING", - "COMBOBOX_BUTTON_WIDTH", - "COMBOBOX_BUTTON_HEIGHT", - "COMBOBOX_BORDER_WIDTH", - "COMBOBOX_DEFAULT_BORDER_COLOR", - "COMBOBOX_DEFAULT_INSIDE_COLOR", - "COMBOBOX_DEFAULT_TEXT_COLOR", - "COMBOBOX_DEFAULT_LIST_TEXT_COLOR", - "COMBOBOX_HOVER_BORDER_COLOR", - "COMBOBOX_HOVER_INSIDE_COLOR", - "COMBOBOX_HOVER_TEXT_COLOR", - "COMBOBOX_HOVER_LIST_TEXT_COLOR", - "COMBOBOX_PRESSED_BORDER_COLOR", - "COMBOBOX_PRESSED_INSIDE_COLOR", - "COMBOBOX_PRESSED_TEXT_COLOR", - "COMBOBOX_PRESSED_LIST_BORDER_COLOR", - "COMBOBOX_PRESSED_LIST_INSIDE_COLOR", - "COMBOBOX_PRESSED_LIST_TEXT_COLOR", - "CHECKBOX_DEFAULT_BORDER_COLOR", - "CHECKBOX_DEFAULT_INSIDE_COLOR", - "CHECKBOX_HOVER_BORDER_COLOR", - "CHECKBOX_HOVER_INSIDE_COLOR", - "CHECKBOX_CLICK_BORDER_COLOR", - "CHECKBOX_CLICK_INSIDE_COLOR", - "CHECKBOX_STATUS_ACTIVE_COLOR", - "CHECKBOX_INSIDE_WIDTH", - "TEXTBOX_BORDER_WIDTH", - "TEXTBOX_BORDER_COLOR", - "TEXTBOX_INSIDE_COLOR", - "TEXTBOX_TEXT_COLOR", - "TEXTBOX_LINE_COLOR", - "TEXTBOX_TEXT_FONTSIZE" -}; - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static Color ColorMultiply(Color baseColor, float value); - -#if defined RAYGUI_STANDALONE -static Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -static int GetHexValue(Color color); // Returns hexadecimal value for a Color -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle -static const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' - -// NOTE: raygui depend on some raylib input and drawing functions -// TODO: To use raygui as standalone library, those functions must be overwrite by custom ones - -// Input management functions -static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } -static int IsMouseButtonDown(int button) { return 0; } -static int IsMouseButtonPressed(int button) { return 0; } -static int IsMouseButtonReleased(int button) { return 0; } -static int IsMouseButtonUp(int button) { return 0; } - -static int GetKeyPressed(void) { return 0; } // NOTE: Only used by GuiTextBox() -static int IsKeyDown(int key) { return 0; } // NOTE: Only used by GuiSpinner() - -// Drawing related functions -static int MeasureText(const char *text, int fontSize) { return 0; } -static void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { } -static void DrawRectangleRec(Rectangle rec, Color color) { } -static void DrawRectangle(int posX, int posY, int width, int height, Color color) { DrawRectangleRec((Rectangle){ posX, posY, width, height }, color); } -#endif - -//---------------------------------------------------------------------------------- -// Module Functions Definition -//---------------------------------------------------------------------------------- - -// Label element, show text -RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text) -{ - #define BLANK (Color){ 0, 0, 0, 0 } // Blank (Transparent) - - GuiLabelEx(bounds, text, GetColor(style[LABEL_TEXT_COLOR]), BLANK, BLANK); -} - -// Label element extended, configurable colors -RAYGUIDEF void GuiLabelEx(Rectangle bounds, const char *text, Color textColor, Color border, Color inner) -{ - // Update control - //-------------------------------------------------------------------- - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - if (bounds.width < textWidth) bounds.width = textWidth + style[LABEL_TEXT_PADDING]; - if (bounds.height < textHeight) bounds.height = textHeight + style[LABEL_TEXT_PADDING]/2; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, border); - DrawRectangle(bounds.x + style[LABEL_BORDER_WIDTH], bounds.y + style[LABEL_BORDER_WIDTH], bounds.width - (2 * style[LABEL_BORDER_WIDTH]), bounds.height - (2 * style[LABEL_BORDER_WIDTH]), inner); - DrawText(text, bounds.x + ((bounds.width/2) - (textWidth/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], textColor); - //-------------------------------------------------------------------- -} - -// Button element, returns true when clicked -RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text) -{ - ButtonState buttonState = BUTTON_DEFAULT; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - // Update control - //-------------------------------------------------------------------- - if (bounds.width < textWidth) bounds.width = textWidth + style[BUTTON_TEXT_PADDING]; - if (bounds.height < textHeight) bounds.height = textHeight + style[BUTTON_TEXT_PADDING]/2; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) buttonState = BUTTON_CLICKED; - else buttonState = BUTTON_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (buttonState) - { - case BUTTON_DEFAULT: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_DEFAULT_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_DEFAULT_TEXT_COLOR])); - } break; - case BUTTON_HOVER: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_HOVER_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_HOVER_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_HOVER_TEXT_COLOR])); - } break; - case BUTTON_PRESSED: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); - DrawText(text, bounds.x + ((bounds.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), bounds.y + ((bounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[BUTTON_PRESSED_TEXT_COLOR])); - } break; - case BUTTON_CLICKED: - { - DrawRectangleRec(bounds, GetColor(style[BUTTON_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[BUTTON_BORDER_WIDTH]), (int)(bounds.y + style[BUTTON_BORDER_WIDTH]) , (int)(bounds.width - (2 * style[BUTTON_BORDER_WIDTH])), (int)(bounds.height - (2 * style[BUTTON_BORDER_WIDTH])), GetColor(style[BUTTON_PRESSED_INSIDE_COLOR])); - } break; - default: break; - } - //------------------------------------------------------------------ - - if (buttonState == BUTTON_CLICKED) return true; - else return false; -} - -// Toggle Button element, returns true when active -RAYGUIDEF bool GuiToggleButton(Rectangle bounds, const char *text, bool toggle) -{ - ToggleState toggleState = TOGGLE_UNACTIVE; - Rectangle toggleButton = bounds; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(text, style[GLOBAL_TEXT_FONTSIZE]); - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - // Update control - //-------------------------------------------------------------------- - if (toggleButton.width < textWidth) toggleButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - if (toggleButton.height < textHeight) toggleButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - if (toggle) toggleState = TOGGLE_ACTIVE; - else toggleState = TOGGLE_UNACTIVE; - - if (CheckCollisionPointRec(mousePoint, toggleButton)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) toggleState = TOGGLE_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - if (toggle) - { - toggle = false; - toggleState = TOGGLE_UNACTIVE; - } - else - { - toggle = true; - toggleState = TOGGLE_ACTIVE; - } - } - else toggleState = TOGGLE_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (toggleState) - { - case TOGGLE_UNACTIVE: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_DEFAULT_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_DEFAULT_TEXT_COLOR])); - } break; - case TOGGLE_HOVER: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_HOVER_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_HOVER_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_HOVER_TEXT_COLOR])); - } break; - case TOGGLE_PRESSED: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_PRESSED_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_PRESSED_TEXT_COLOR])); - } break; - case TOGGLE_ACTIVE: - { - DrawRectangleRec(toggleButton, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); - DrawRectangle((int)(toggleButton.x + style[TOGGLE_BORDER_WIDTH]), (int)(toggleButton.y + style[TOGGLE_BORDER_WIDTH]) , (int)(toggleButton.width - (2 * style[TOGGLE_BORDER_WIDTH])), (int)(toggleButton.height - (2 * style[TOGGLE_BORDER_WIDTH])), GetColor(style[TOGGLE_ACTIVE_INSIDE_COLOR])); - DrawText(text, toggleButton.x + ((toggleButton.width/2) - (MeasureText(text, style[GLOBAL_TEXT_FONTSIZE])/2)), toggleButton.y + ((toggleButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[TOGGLE_ACTIVE_TEXT_COLOR])); - } break; - default: break; - } - //-------------------------------------------------------------------- - - return toggle; -} - -// Toggle Group element, returns toggled button index -RAYGUIDEF int GuiToggleGroup(Rectangle bounds, int toggleNum, char **toggleText, int toggleActive) -{ - for (int i = 0; i < toggleNum; i++) - { - if (i == toggleActive) GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], true); - else if (GuiToggleButton((Rectangle){bounds.x + i*(bounds.width + style[TOGGLEGROUP_PADDING]),bounds.y,bounds.width,bounds.height}, toggleText[i], false) == true) toggleActive = i; - } - - return toggleActive; -} - -// Combo Box element, returns selected item index -RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int comboActive) -{ - ComboBoxState comboBoxState = COMBOBOX_UNACTIVE; - Rectangle comboBoxButton = bounds; - Rectangle click = { bounds.x + bounds.width + style[COMBOBOX_PADDING], bounds.y, style[COMBOBOX_BUTTON_WIDTH], style[COMBOBOX_BUTTON_HEIGHT] }; - Vector2 mousePoint = GetMousePosition(); - - int textHeight = style[GLOBAL_TEXT_FONTSIZE]; - - for (int i = 0; i < comboNum; i++) - { - if (i == comboActive) - { - // Update control - //-------------------------------------------------------------------- - int textWidth = MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE]); - - if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - if (CheckCollisionPointRec(mousePoint, comboBoxButton) || CheckCollisionPointRec(mousePoint, click)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) comboBoxState = COMBOBOX_ACTIVE; - else comboBoxState = COMBOBOX_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (comboBoxState) - { - case COMBOBOX_UNACTIVE: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_DEFAULT_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_DEFAULT_TEXT_COLOR])); - } break; - case COMBOBOX_HOVER: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_HOVER_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_HOVER_TEXT_COLOR])); - } break; - case COMBOBOX_PRESSED: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); - } break; - case COMBOBOX_ACTIVE: - { - DrawRectangleRec(comboBoxButton, GetColor(style[COMBOBOX_PRESSED_BORDER_COLOR])); - DrawRectangle((int)(comboBoxButton.x + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.y + style[COMBOBOX_BORDER_WIDTH]), (int)(comboBoxButton.width - (2 * style[COMBOBOX_BORDER_WIDTH])), (int)(comboBoxButton.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_INSIDE_COLOR])); - - DrawRectangleRec(click, GetColor(style[COMBOBOX_PRESSED_LIST_BORDER_COLOR])); - DrawRectangle((int)(click.x + style[COMBOBOX_BORDER_WIDTH]), (int)(click.y + style[COMBOBOX_BORDER_WIDTH]) , (int)(click.width - (2*style[COMBOBOX_BORDER_WIDTH])), (int)(click.height - (2*style[COMBOBOX_BORDER_WIDTH])), GetColor(style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR])); - DrawText(FormatText("%i/%i", comboActive + 1, comboNum), click.x + ((click.width/2) - (MeasureText(FormatText("%i/%i", comboActive + 1, comboNum), style[GLOBAL_TEXT_FONTSIZE])/2)), click.y + ((click.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_LIST_TEXT_COLOR])); - DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE])/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[COMBOBOX_PRESSED_TEXT_COLOR])); - } break; - default: break; - } - - //DrawText(comboText[i], comboBoxButton.x + ((comboBoxButton.width/2) - (MeasureText(comboText[i], style[]globalTextFontSize)/2)), comboBoxButton.y + ((comboBoxButton.height/2) - (style[]globalTextFontSize/2)), style[]globalTextFontSize, COMBOBOX_PRESSED_TEXT_COLOR); - //-------------------------------------------------------------------- - } - } - - if (CheckCollisionPointRec(GetMousePosition(), bounds) || CheckCollisionPointRec(GetMousePosition(), click)) - { - if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) - { - comboActive += 1; - if(comboActive >= comboNum) comboActive = 0; - } - } - - return comboActive; -} - -// Check Box element, returns true when active -RAYGUIDEF bool GuiCheckBox(Rectangle checkBoxBounds, const char *text, bool checked) -{ - CheckBoxState checkBoxState = CHECKBOX_STATUS; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, checkBoxBounds)) - { - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) checkBoxState = CHECKBOX_PRESSED; - else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) - { - checkBoxState = CHECKBOX_STATUS; - checked = !checked; - } - else checkBoxState = CHECKBOX_HOVER; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (checkBoxState) - { - case CHECKBOX_HOVER: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_HOVER_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_HOVER_INSIDE_COLOR])); - } break; - case CHECKBOX_STATUS: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_DEFAULT_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_DEFAULT_INSIDE_COLOR])); - } break; - case CHECKBOX_PRESSED: - { - DrawRectangleRec(checkBoxBounds, GetColor(style[CHECKBOX_CLICK_BORDER_COLOR])); - DrawRectangle((int)(checkBoxBounds.x + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.y + style[TOGGLE_BORDER_WIDTH]), (int)(checkBoxBounds.width - (2*style[TOGGLE_BORDER_WIDTH])), (int)(checkBoxBounds.height - (2*style[TOGGLE_BORDER_WIDTH])), GetColor(style[CHECKBOX_CLICK_INSIDE_COLOR])); - } break; - default: break; - } - - if (text != NULL) DrawText(text, checkBoxBounds.x + checkBoxBounds.width + 2, checkBoxBounds.y + ((checkBoxBounds.height/2) - (style[GLOBAL_TEXT_FONTSIZE]/2) + 1), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[LABEL_TEXT_COLOR])); - - if (checked) - { - DrawRectangle((int)(checkBoxBounds.x + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.y + style[CHECKBOX_INSIDE_WIDTH]), (int)(checkBoxBounds.width - (2*style[CHECKBOX_INSIDE_WIDTH])), (int)(checkBoxBounds.height - (2*style[CHECKBOX_INSIDE_WIDTH])), GetColor(style[CHECKBOX_STATUS_ACTIVE_COLOR])); - } - //-------------------------------------------------------------------- - - return checked; -} - -// Slider element, returns selected value -RAYGUIDEF float GuiSlider(Rectangle bounds, float value, float minValue, float maxValue) -{ - SliderState sliderState = SLIDER_DEFAULT; - float buttonTravelDistance = 0; - float sliderPos = 0; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - if (value < minValue) value = minValue; - else if (value >= maxValue) value = maxValue; - - sliderPos = (value - minValue)/(maxValue - minValue); - - Rectangle sliderButton; - sliderButton.width = ((int)(bounds.width - (2 * style[SLIDER_BUTTON_BORDER_WIDTH]))/10 - 8); - sliderButton.height =((int)(bounds.height - ( 2 * style[SLIDER_BORDER_WIDTH] + 2 * style[SLIDER_BUTTON_BORDER_WIDTH]))); - - float sliderButtonMinPos = bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]; - float sliderButtonMaxPos = bounds.x + bounds.width - (style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH] + sliderButton.width); - - buttonTravelDistance = sliderButtonMaxPos - sliderButtonMinPos; - - sliderButton.x = ((int)(bounds.x + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH]) + (sliderPos * buttonTravelDistance)); - sliderButton.y = ((int)(bounds.y + style[SLIDER_BORDER_WIDTH] + style[SLIDER_BUTTON_BORDER_WIDTH])); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - sliderState = SLIDER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) sliderState = SLIDER_ACTIVE; - - if ((sliderState == SLIDER_ACTIVE) && (IsMouseButtonDown(MOUSE_LEFT_BUTTON))) - { - sliderButton.x = mousePoint.x - sliderButton.width / 2; - - if (sliderButton.x <= sliderButtonMinPos) sliderButton.x = sliderButtonMinPos; - else if (sliderButton.x >= sliderButtonMaxPos) sliderButton.x = sliderButtonMaxPos; - - sliderPos = (sliderButton.x - sliderButtonMinPos) / buttonTravelDistance; - } - } - else sliderState = SLIDER_DEFAULT; - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[SLIDER_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]), (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDER_INSIDE_COLOR])); - - switch (sliderState) - { - case SLIDER_DEFAULT: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_DEFAULT_COLOR])); break; - case SLIDER_HOVER: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_HOVER_COLOR])); break; - case SLIDER_ACTIVE: DrawRectangleRec(sliderButton, GetColor(style[SLIDER_ACTIVE_COLOR])); break; - default: break; - } - //-------------------------------------------------------------------- - - return minValue + (maxValue - minValue)*sliderPos; -} - -// Slider Bar element, returns selected value -RAYGUIDEF float GuiSliderBar(Rectangle bounds, float value, float minValue, float maxValue) -{ - SliderState sliderState = SLIDER_DEFAULT; - Vector2 mousePoint = GetMousePosition(); - float fixedValue; - float fixedMinValue; - - fixedValue = value - minValue; - maxValue = maxValue - minValue; - fixedMinValue = 0; - - // Update control - //-------------------------------------------------------------------- - if (fixedValue <= fixedMinValue) fixedValue = fixedMinValue; - else if (fixedValue >= maxValue) fixedValue = maxValue; - - Rectangle sliderBar; - - sliderBar.x = bounds.x + style[SLIDER_BORDER_WIDTH]; - sliderBar.y = bounds.y + style[SLIDER_BORDER_WIDTH]; - sliderBar.width = ((fixedValue*((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]))/(maxValue - fixedMinValue)); - sliderBar.height = bounds.height - 2*style[SLIDER_BORDER_WIDTH]; - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - sliderState = SLIDER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - sliderState = SLIDER_ACTIVE; - - sliderBar.width = (mousePoint.x - bounds.x - style[SLIDER_BORDER_WIDTH]); - - if (mousePoint.x <= (bounds.x + style[SLIDER_BORDER_WIDTH])) sliderBar.width = 0; - else if (mousePoint.x >= (bounds.x + bounds.width - style[SLIDER_BORDER_WIDTH])) sliderBar.width = bounds.width - 2*style[SLIDER_BORDER_WIDTH]; - } - } - else sliderState = SLIDER_DEFAULT; - - fixedValue = ((float)sliderBar.width*(maxValue - fixedMinValue))/((float)bounds.width - 2*style[SLIDER_BORDER_WIDTH]); - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[SLIDERBAR_BORDER_COLOR])); - DrawRectangle((int)(bounds.x + style[SLIDER_BORDER_WIDTH]), (int)(bounds.y + style[SLIDER_BORDER_WIDTH]) , (int)(bounds.width - (2*style[SLIDER_BORDER_WIDTH])), (int)(bounds.height - (2*style[SLIDER_BORDER_WIDTH])), GetColor(style[SLIDERBAR_INSIDE_COLOR])); - - switch (sliderState) - { - case SLIDER_DEFAULT: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_DEFAULT_COLOR])); break; - case SLIDER_HOVER: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_HOVER_COLOR])); break; - case SLIDER_ACTIVE: DrawRectangleRec(sliderBar, GetColor(style[SLIDERBAR_ACTIVE_COLOR])); break; - default: break; - } - - if (minValue < 0 && maxValue > 0) DrawRectangle((bounds.x + style[SLIDER_BORDER_WIDTH]) - (minValue * ((bounds.width - (style[SLIDER_BORDER_WIDTH]*2))/maxValue)), sliderBar.y, 1, sliderBar.height, GetColor(style[SLIDERBAR_ZERO_LINE_COLOR])); - //-------------------------------------------------------------------- - - return fixedValue + minValue; -} - -// Progress Bar element, shows current progress value -RAYGUIDEF void GuiProgressBar(Rectangle bounds, float value) -{ - if (value > 1.0f) value = 1.0f; - else if (value < 0.0f) value = 0.0f; - - Rectangle progressBar = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; - Rectangle progressValue = { bounds.x + style[PROGRESSBAR_BORDER_WIDTH], bounds.y + style[PROGRESSBAR_BORDER_WIDTH], value * (bounds.width - (style[PROGRESSBAR_BORDER_WIDTH] * 2)), bounds.height - (style[PROGRESSBAR_BORDER_WIDTH] * 2)}; - - // Draw control - //-------------------------------------------------------------------- - DrawRectangleRec(bounds, GetColor(style[PROGRESSBAR_BORDER_COLOR])); - DrawRectangleRec(progressBar, GetColor(style[PROGRESSBAR_INSIDE_COLOR])); - DrawRectangleRec(progressValue, GetColor(style[PROGRESSBAR_PROGRESS_COLOR])); - //-------------------------------------------------------------------- -} - -// Spinner element, returns selected value -// NOTE: Requires static variables: framesCounter, valueSpeed - ERROR! -RAYGUIDEF int GuiSpinner(Rectangle bounds, int value, int minValue, int maxValue) -{ - SpinnerState spinnerState = SPINNER_DEFAULT; - Rectangle labelBoxBound = { bounds.x + bounds.width/4 + 1, bounds.y, bounds.width/2, bounds.height }; - Rectangle leftButtonBound = { bounds.x, bounds.y, bounds.width/4, bounds.height }; - Rectangle rightButtonBound = { bounds.x + bounds.width - bounds.width/4 + 1, bounds.y, bounds.width/4, bounds.height }; - Vector2 mousePoint = GetMousePosition(); - - int textWidth = MeasureText(FormatText("%i", value), style[GLOBAL_TEXT_FONTSIZE]); - //int textHeight = style[GLOBAL_TEXT_FONTSIZE]; // Unused variable - - int buttonSide = 0; - - static int framesCounter = 0; - static bool valueSpeed = false;; - - //if (comboBoxButton.width < textWidth) comboBoxButton.width = textWidth + style[TOGGLE_TEXT_PADDING]; - //if (comboBoxButton.height < textHeight) comboBoxButton.height = textHeight + style[TOGGLE_TEXT_PADDING]/2; - - // Update control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, leftButtonBound) || CheckCollisionPointRec(mousePoint, rightButtonBound) || CheckCollisionPointRec(mousePoint, labelBoxBound)) - { - if (IsKeyDown(KEY_LEFT)) - { - spinnerState = SPINNER_PRESSED; - buttonSide = 1; - - if (value > minValue) value -= 1; - } - else if (IsKeyDown(KEY_RIGHT)) - { - spinnerState = SPINNER_PRESSED; - buttonSide = 2; - - if (value < maxValue) value += 1; - } - } - - if (CheckCollisionPointRec(mousePoint, leftButtonBound)) - { - buttonSide = 1; - spinnerState = SPINNER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!valueSpeed) - { - if (value > minValue) value--; - valueSpeed = true; - } - else framesCounter++; - - spinnerState = SPINNER_PRESSED; - - if (value > minValue) - { - if (framesCounter >= 30) value -= 1; - } - } - } - else if (CheckCollisionPointRec(mousePoint, rightButtonBound)) - { - buttonSide = 2; - spinnerState = SPINNER_HOVER; - - if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) - { - if (!valueSpeed) - { - if (value < maxValue) value++; - valueSpeed = true; - } - else framesCounter++; - - spinnerState = SPINNER_PRESSED; - - if (value < maxValue) - { - if (framesCounter >= 30) value += 1; - } - } - } - else if (!CheckCollisionPointRec(mousePoint, labelBoxBound)) buttonSide = 0; - - if (IsMouseButtonUp(MOUSE_LEFT_BUTTON)) - { - valueSpeed = false; - framesCounter = 0; - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - switch (spinnerState) - { - case SPINNER_DEFAULT: - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_TEXT_COLOR])); - } break; - case SPINNER_HOVER: - { - if (buttonSide == 1) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - } - else if (buttonSide == 2) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_HOVER_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_HOVER_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_SYMBOL_COLOR])); - } - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_HOVER_TEXT_COLOR])); - } break; - case SPINNER_PRESSED: - { - if (buttonSide == 1) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - } - else if (buttonSide == 2) - { - DrawRectangleRec(leftButtonBound, GetColor(style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR])); - DrawRectangle(leftButtonBound.x + 2, leftButtonBound.y + 2, leftButtonBound.width - 4, leftButtonBound.height - 4, GetColor(style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR])); - - DrawRectangleRec(rightButtonBound, GetColor(style[SPINNER_PRESSED_BUTTON_BORDER_COLOR])); - DrawRectangle(rightButtonBound.x + 2, rightButtonBound.y + 2, rightButtonBound.width - 4, rightButtonBound.height - 4, GetColor(style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR])); - - DrawText(FormatText("-"), leftButtonBound.x + (leftButtonBound.width/2 - (MeasureText(FormatText("+"), style[GLOBAL_TEXT_FONTSIZE]))/2), leftButtonBound.y + (leftButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_DEFAULT_SYMBOL_COLOR])); - DrawText(FormatText("+"), rightButtonBound.x + (rightButtonBound.width/2 - (MeasureText(FormatText("-"), style[GLOBAL_TEXT_FONTSIZE]))/2), rightButtonBound.y + (rightButtonBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_SYMBOL_COLOR])); - } - - DrawRectangleRec(labelBoxBound, GetColor(style[SPINNER_LABEL_BORDER_COLOR])); - DrawRectangle(labelBoxBound.x + 1, labelBoxBound.y + 1, labelBoxBound.width - 2, labelBoxBound.height - 2, GetColor(style[SPINNER_LABEL_INSIDE_COLOR])); - - DrawText(FormatText("%i", value), labelBoxBound.x + (labelBoxBound.width/2 - textWidth/2), labelBoxBound.y + (labelBoxBound.height/2 - (style[GLOBAL_TEXT_FONTSIZE]/2)), style[GLOBAL_TEXT_FONTSIZE], GetColor(style[SPINNER_PRESSED_TEXT_COLOR])); - } break; - default: break; - } - - return value; -} - -// Text Box element, returns input text -// NOTE: Requires static variables: framesCounter - ERROR! -RAYGUIDEF char *GuiTextBox(Rectangle bounds, char *text) -{ - #define MAX_CHARS_LENGTH 20 - #define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256 - - int initPos = bounds.x + 4; - int letter = -1; - static int framesCounter = 0; - Vector2 mousePoint = GetMousePosition(); - - // Update control - //-------------------------------------------------------------------- - framesCounter++; - - letter = GetKeyPressed(); - - if (CheckCollisionPointRec(mousePoint, bounds)) - { - if (letter != -1) - { - if (letter == KEY_BACKSPACE_TEXT) - { - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if ((text[i] == '\0') && (i > 0)) - { - text[i - 1] = '\0'; - break; - } - } - - text[MAX_CHARS_LENGTH - 1] = '\0'; - } - else - { - if ((letter >= 32) && (letter < 127)) - { - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if (text[i] == '\0') - { - text[i] = (char)letter; - break; - } - } - } - } - } - } - //-------------------------------------------------------------------- - - // Draw control - //-------------------------------------------------------------------- - if (CheckCollisionPointRec(mousePoint, bounds)) DrawRectangleRec(bounds, GetColor(style[TOGGLE_ACTIVE_BORDER_COLOR])); - else DrawRectangleRec(bounds, GetColor(style[TEXTBOX_BORDER_COLOR])); - - DrawRectangle(bounds.x + style[TEXTBOX_BORDER_WIDTH], bounds.y + style[TEXTBOX_BORDER_WIDTH], bounds.width - (style[TEXTBOX_BORDER_WIDTH] * 2), bounds.height - (style[TEXTBOX_BORDER_WIDTH] * 2), GetColor(style[TEXTBOX_INSIDE_COLOR])); - - for (int i = 0; i < MAX_CHARS_LENGTH; i++) - { - if (text[i] == '\0') break; - - DrawText(FormatText("%c", text[i]), initPos, bounds.y + style[TEXTBOX_TEXT_FONTSIZE], style[TEXTBOX_TEXT_FONTSIZE], GetColor(style[TEXTBOX_TEXT_COLOR])); - - initPos += (MeasureText(FormatText("%c", text[i]), style[GLOBAL_TEXT_FONTSIZE]) + 2); - //initPos += ((GetDefaultFont().charRecs[(int)text[i] - 32].width + 2)); - } - - if ((framesCounter/20)%2 && CheckCollisionPointRec(mousePoint, bounds)) DrawRectangle(initPos + 2, bounds.y + 5, 1, 20, GetColor(style[TEXTBOX_LINE_COLOR])); - //-------------------------------------------------------------------- - - return text; -} - -// Save current GUI style into a text file -RAYGUIDEF void SaveGuiStyle(const char *fileName) -{ - FILE *styleFile = fopen(fileName, "wt"); - - for (int i = 0; i < NUM_PROPERTIES; i++) fprintf(styleFile, "%-40s0x%x\n", guiPropertyName[i], GetStyleProperty(i)); - - fclose(styleFile); -} - -// Load GUI style from a text file -RAYGUIDEF void LoadGuiStyle(const char *fileName) -{ - #define MAX_STYLE_PROPERTIES 128 - - typedef struct { - char id[64]; - int value; - } StyleProperty; - - StyleProperty *styleProp = (StyleProperty *)RAYGUI_MALLOC(MAX_STYLE_PROPERTIES*sizeof(StyleProperty));; - int counter = 0; - - FILE *styleFile = fopen(fileName, "rt"); - - while (!feof(styleFile)) - { - fscanf(styleFile, "%s %i\n", styleProp[counter].id, &styleProp[counter].value); - counter++; - } - - fclose(styleFile); - - for (int i = 0; i < counter; i++) - { - for (int j = 0; j < NUM_PROPERTIES; j++) - { - if (strcmp(styleProp[i].id, guiPropertyName[j]) == 0) - { - // Assign correct property to style - style[j] = styleProp[i].value; - } - } - } - - RAYGUI_FREE(styleProp); -} - -// Set one style property value -RAYGUIDEF void SetStyleProperty(int guiProperty, int value) -{ - #define NUM_COLOR_SAMPLES 10 - - if (guiProperty == GLOBAL_BASE_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_BASE_COLOR] = value; - style[BACKGROUND_COLOR] = GetHexValue(fadeColor[3]); - style[BUTTON_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[BUTTON_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[BUTTON_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[TOGGLE_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[TOGGLE_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_ACTIVE_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[SLIDER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SLIDER_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); - style[SLIDER_HOVER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDER_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDERBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SLIDERBAR_DEFAULT_COLOR] = GetHexValue(fadeColor[6]); - style[SLIDERBAR_HOVER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDERBAR_ACTIVE_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDERBAR_ZERO_LINE_COLOR] = GetHexValue(fadeColor[8]); - style[PROGRESSBAR_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[PROGRESSBAR_PROGRESS_COLOR] = GetHexValue(fadeColor[6]); - style[SPINNER_LABEL_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_DEFAULT_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_HOVER_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[SPINNER_PRESSED_BUTTON_INSIDE_COLOR] = GetHexValue(fadeColor[5]); - style[COMBOBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_HOVER_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_PRESSED_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_LIST_INSIDE_COLOR] = GetHexValue(fadeColor[8]); - style[CHECKBOX_DEFAULT_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - style[CHECKBOX_CLICK_INSIDE_COLOR] = GetHexValue(fadeColor[6]); - style[CHECKBOX_STATUS_ACTIVE_COLOR] = GetHexValue(fadeColor[8]); - style[TEXTBOX_INSIDE_COLOR] = GetHexValue(fadeColor[4]); - } - else if (guiProperty == GLOBAL_BORDER_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_BORDER_COLOR] = value; - style[BUTTON_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[BUTTON_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[BUTTON_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[TOGGLE_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[TOGGLE_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_ACTIVE_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[SLIDER_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SLIDERBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[PROGRESSBAR_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_LABEL_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_DEFAULT_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[SPINNER_HOVER_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_PRESSED_BUTTON_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[COMBOBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_PRESSED_LIST_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[CHECKBOX_DEFAULT_BORDER_COLOR] = GetHexValue(fadeColor[7]); - style[CHECKBOX_HOVER_BORDER_COLOR] = GetHexValue(fadeColor[8]); - style[CHECKBOX_CLICK_BORDER_COLOR] = GetHexValue(fadeColor[9]); - style[TEXTBOX_BORDER_COLOR] = GetHexValue(fadeColor[7]); - } - else if (guiProperty == GLOBAL_TEXT_COLOR) - { - Color baseColor = GetColor(value); - Color fadeColor[NUM_COLOR_SAMPLES]; - - for (int i = 0; i < NUM_COLOR_SAMPLES; i++) fadeColor[i] = ColorMultiply(baseColor, 1.0f - (float)i/(NUM_COLOR_SAMPLES - 1)); - - style[GLOBAL_TEXT_COLOR] = value; - style[LABEL_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[BUTTON_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[BUTTON_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[BUTTON_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[TOGGLE_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[TOGGLE_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[TOGGLE_ACTIVE_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[SPINNER_DEFAULT_SYMBOL_COLOR] = GetHexValue(fadeColor[9]); - style[SPINNER_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[SPINNER_HOVER_SYMBOL_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[SPINNER_PRESSED_SYMBOL_COLOR] = GetHexValue(fadeColor[5]); - style[SPINNER_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[5]); - style[COMBOBOX_DEFAULT_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_DEFAULT_LIST_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[COMBOBOX_HOVER_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_HOVER_LIST_TEXT_COLOR] = GetHexValue(fadeColor[8]); - style[COMBOBOX_PRESSED_TEXT_COLOR] = GetHexValue(fadeColor[4]); - style[COMBOBOX_PRESSED_LIST_TEXT_COLOR] = GetHexValue(fadeColor[4]); - style[TEXTBOX_TEXT_COLOR] = GetHexValue(fadeColor[9]); - style[TEXTBOX_LINE_COLOR] = GetHexValue(fadeColor[6]); - } - else style[guiProperty] = value; - -} - -// Get one style property value -RAYGUIDEF int GetStyleProperty(int guiProperty) { return style[guiProperty]; } - -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -static Color ColorMultiply(Color baseColor, float value) -{ - Color multColor = baseColor; - - if (value > 1.0f) value = 1.0f; - else if (value < 0.0f) value = 0.0f; - - multColor.r += (255 - multColor.r)*value; - multColor.g += (255 - multColor.g)*value; - multColor.b += (255 - multColor.b)*value; - - return multColor; -} - -#if defined (RAYGUI_STANDALONE) -// Returns a Color struct from hexadecimal value -static Color GetColor(int hexValue) -{ - Color color; - - color.r = (unsigned char)(hexValue >> 24) & 0xFF; - color.g = (unsigned char)(hexValue >> 16) & 0xFF; - color.b = (unsigned char)(hexValue >> 8) & 0xFF; - color.a = (unsigned char)hexValue & 0xFF; - - return color; -} - -// Returns hexadecimal value for a Color -static int GetHexValue(Color color) -{ - return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); -} - -// Check if point is inside rectangle -static bool CheckCollisionPointRec(Vector2 point, Rectangle rec) -{ - bool collision = false; - - if ((point.x >= rec.x) && (point.x <= (rec.x + rec.width)) && (point.y >= rec.y) && (point.y <= (rec.y + rec.height))) collision = true; - - return collision; -} - -// Formatting of text with variables to 'embed' -static const char *FormatText(const char *text, ...) -{ - #define MAX_FORMATTEXT_LENGTH 64 - - static char buffer[MAX_FORMATTEXT_LENGTH]; - - va_list args; - va_start(args, text); - vsprintf(buffer, text, args); - va_end(args); - - return buffer; -} -#endif - -#endif // RAYGUI_IMPLEMENTATION - -- cgit v1.2.3 From 0c58c1198f51c8c8799490bbb6f1b224a43278b2 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 8 Sep 2016 01:03:05 +0200 Subject: Working on new audio functions... --- src/audio.c | 32 ++++++++++++++++++++++++++------ src/raylib.h | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 11d0d6b9..7ef5afe1 100644 --- a/src/audio.c +++ b/src/audio.c @@ -218,11 +218,15 @@ Wave LoadWave(const char *fileName) } // Load wave data from float array data (32bit) -Wave LoadWaveEx(float *data, int sampleRate, int sampleSize, int channels) +Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels) { Wave wave; wave.data = data; + wave.sampleCount = sampleCount; + wave.sampleRate = sampleRate; + wave.sampleSize = sampleSize; + wave.channels = channels; WaveFormat(&wave, sampleRate, sampleSize, channels); @@ -579,15 +583,15 @@ Wave WaveCopy(Wave wave) { Wave newWave; - if (wave.sampleSize == 8) newWave.data = (unsigned char *)malloc(wave.sampleCount*sizeof(unsigned char)); - else if (wave.sampleSize == 16) newWave.data = (short *)malloc(wave.sampleCount*sizeof(short)); - else if (wave.sampleSize == 32) newWave.data = (float *)malloc(wave.sampleCount*sizeof(float)); + if (wave.sampleSize == 8) newWave.data = (unsigned char *)malloc(wave.sampleCount*wave.channels*sizeof(unsigned char)); + else if (wave.sampleSize == 16) newWave.data = (short *)malloc(wave.sampleCount*wave.channels*sizeof(short)); + else if (wave.sampleSize == 32) newWave.data = (float *)malloc(wave.sampleCount*wave.channels*sizeof(float)); else TraceLog(WARNING, "Wave sample size not supported for copy"); if (newWave.data != NULL) { // NOTE: Size must be provided in bytes - memcpy(newWave.data, wave.data, wave.sampleCount); + memcpy(newWave.data, wave.data, wave.sampleCount*wave.channels*wave.sampleSize/8); newWave.sampleCount = wave.sampleCount; newWave.sampleRate = wave.sampleRate; @@ -602,7 +606,23 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initSample, int finalSample) { - // TODO: Crop wave to a samples range + if ((initSample >= 0) && (finalSample > 0) && (finalSample < wave->sampleCount)) + { + // TODO: Review cropping (it could be simplified...) + + float *samples = GetWaveData(*wave); + float *cropSamples = (float *)malloc((finalSample - initSample)*sizeof(float)); + + for (int i = initSample; i < finalSample; i++) cropSamples[i] = samples[i]; + + free(wave->data); + wave->data = cropSamples; + int sampleSize = wave->sampleSize; + wave->sampleSize = 32; + + WaveFormat(wave, wave->sampleRate, sampleSize, wave->channels); + } + else TraceLog(WARNING, "Wave crop range out of bounds"); } // Get samples data from wave as a floats array diff --git a/src/raylib.h b/src/raylib.h index ae3de038..3c815031 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -910,7 +910,7 @@ RLAPI void CloseAudioDevice(void); // Close t RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully RLAPI Wave LoadWave(const char *fileName); // Load wave data from file into RAM -RLAPI Wave LoadWaveEx(float *data, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) +RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) RLAPI Sound LoadSound(const char *fileName); // Load sound to memory RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) -- cgit v1.2.3 From 94142ecce53d2eae42fa60bc609c2d8f6248160e Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 9 Sep 2016 01:34:30 +0200 Subject: Some more work on audio... --- src/audio.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 7ef5afe1..fa18f7c8 100644 --- a/src/audio.c +++ b/src/audio.c @@ -535,6 +535,7 @@ void SetSoundPitch(Sound sound, float pitch) } // Convert wave data to desired format +// TODO: Consider channels (mono - stereo) void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) { if (wave->sampleSize != sampleSize) @@ -542,8 +543,12 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) float *samples = GetWaveData(*wave); //Color *pixels = GetImageData(*image); free(wave->data); + + wave->sampleSize = sampleSize; - //image->format = newFormat; + //sample *= 4.0f; // Arbitrary gain to get reasonable output volume... + //if (sample > 1.0f) sample = 1.0f; + //if (sample < -1.0f) sample = -1.0f; if (sampleSize == 8) { @@ -551,7 +556,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) for (int i = 0; i < wave->sampleCount; i++) { - ((unsigned char *)wave->data)[i] = (unsigned char)((float)samples[i]); // TODO: review conversion + ((unsigned char *)wave->data)[i] = (unsigned char)((float)samples[i]*127 + 128); } } else if (sampleSize == 16) @@ -560,7 +565,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) for (int i = 0; i < wave->sampleCount; i++) { - ((short *)wave->data)[i] = (short)((float)samples[i]); // TODO: review conversion + ((short *)wave->data)[i] = (short)((float)samples[i]*32000); // SHRT_MAX = 32767 } } else if (sampleSize == 32) @@ -569,13 +574,17 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) for (int i = 0; i < wave->sampleCount; i++) { - ((float *)wave->data)[i] = (float)samples[i]; // TODO: review conversion + ((float *)wave->data)[i] = (float)samples[i]; } } else TraceLog(WARNING, "Wave formatting: Sample size not supported"); } - // TODO: Consider channels (mono vs stereo) + // NOTE: Only supported 1 or 2 channels (mono or stereo) + if ((channels > 0) && (channels < 3) && (wave->channels != channels)) + { + // TODO: Add/remove channels interlaced data if required... + } } // Copy a wave to a new wave @@ -626,15 +635,16 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) } // Get samples data from wave as a floats array +// NOTE: Returned sample values are normalized to range [-1..1] float *GetWaveData(Wave wave) { float *samples = (float *)malloc(wave.sampleCount*sizeof(float)); for (int i = 0; i < wave.sampleCount; i++) { - if (wave.sampleSize == 8) samples[i] = (float)((unsigned char *)wave.data)[i]; // TODO: review conversion - else if (wave.sampleSize == 16) samples[i] = (float)((short *)wave.data)[i]; // TODO: review conversion - else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; // TODO: review conversion + if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f; + else if (wave.sampleSize == 16) samples[i] = (float)((short *)wave.data)[i]/32767.0f; + else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; } return samples; -- cgit v1.2.3 From 173f1993132485ab8fe16b170ad7bf7e32f47ac7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 12 Sep 2016 19:25:58 +0200 Subject: Corrected text drawing within an image --- src/textures.c | 71 ++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 5186c0ba..15293371 100644 --- a/src/textures.c +++ b/src/textures.c @@ -999,8 +999,11 @@ void ImageResizeNN(Image *image,int newWidth,int newHeight) } // Draw an image (source) within an image (destination) +// TODO: Feel this function could be simplified... void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) { + bool cropRequired = false; + // Security checks to avoid size and rectangle issues (out of bounds) // Check that srcRec is inside src image if (srcRec.x < 0) srcRec.x = 0; @@ -1016,47 +1019,69 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) { srcRec.height = src.height - srcRec.y; TraceLog(WARNING, "Source rectangle height out of bounds, rescaled height: %i", srcRec.height); + cropRequired = true; } - + + Image srcCopy = ImageCopy(src); // Make a copy of source image to work with it + ImageCrop(&srcCopy, srcRec); // Crop source image to desired source rectangle + // Check that dstRec is inside dst image + // TODO: Allow negative position within destination with cropping if (dstRec.x < 0) dstRec.x = 0; if (dstRec.y < 0) dstRec.y = 0; + + // Scale source image in case destination rec size is different than source rec size + if ((dstRec.width != srcRec.width) || (dstRec.height != srcRec.height)) + { + ImageResize(&srcCopy, dstRec.width, dstRec.height); + } if ((dstRec.x + dstRec.width) > dst->width) { dstRec.width = dst->width - dstRec.x; TraceLog(WARNING, "Destination rectangle width out of bounds, rescaled width: %i", dstRec.width); + cropRequired = true; } if ((dstRec.y + dstRec.height) > dst->height) { dstRec.height = dst->height - dstRec.y; TraceLog(WARNING, "Destination rectangle height out of bounds, rescaled height: %i", dstRec.height); + cropRequired = true; } - - // Get dstination image data as Color pixels array to work with it - Color *dstPixels = GetImageData(*dst); - - Image srcCopy = ImageCopy(src); // Make a copy of source image to work with it - ImageCrop(&srcCopy, srcRec); // Crop source image to desired source rectangle - - // Scale source image in case destination rec size is different than source rec size - if ((dstRec.width != srcRec.width) || (dstRec.height != srcRec.height)) + + if (cropRequired) { - ImageResize(&srcCopy, dstRec.width, dstRec.height); + // Crop destination rectangle if out of bounds + Rectangle crop = { 0, 0, dstRec.width, dstRec.height }; + ImageCrop(&srcCopy, crop); } - - // Get source image data as Color array + + // Get image data as Color pixels array to work with it + Color *dstPixels = GetImageData(*dst); Color *srcPixels = GetImageData(srcCopy); - UnloadImage(srcCopy); + UnloadImage(srcCopy); // Source copy not required any more... + + Color srcCol, dstCol; // Blit pixels, copy source image into destination + // TODO: Probably out-of-bounds blitting could be considering here instead of so much cropping... for (int j = dstRec.y; j < (dstRec.y + dstRec.height); j++) { for (int i = dstRec.x; i < (dstRec.x + dstRec.width); i++) { - dstPixels[j*dst->width + i] = srcPixels[(j - dstRec.y)*dstRec.width + (i - dstRec.x)]; + // Alpha blending implementation + dstCol = dstPixels[j*dst->width + i]; + srcCol = srcPixels[(j - dstRec.y)*dstRec.width + (i - dstRec.x)]; + + dstCol.r = ((srcCol.a*(srcCol.r - dstCol.r)) >> 8) + dstCol.r; + dstCol.g = ((srcCol.a*(srcCol.g - dstCol.g)) >> 8) + dstCol.g; + dstCol.b = ((srcCol.a*(srcCol.b - dstCol.b)) >> 8) + dstCol.b; + + dstPixels[j*dst->width + i] = dstCol; + + // TODO: Support other blending options } } @@ -1074,7 +1099,7 @@ Image ImageText(const char *text, int fontSize, Color color) { int defaultFontSize = 10; // Default Font chars height in pixel if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize / defaultFontSize; + int spacing = fontSize/defaultFontSize; Image imText = ImageTextEx(GetDefaultFont(), text, fontSize, spacing, color); @@ -1098,7 +1123,8 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing Color *fontPixels = GetImageData(imFont); // Create image to store text - Color *pixels = (Color *)malloc(sizeof(Color)*(int)imSize.x*(int)imSize.y); + // NOTE: Pixels are initialized to BLANK color (0, 0, 0, 0) + Color *pixels = (Color *)calloc((int)imSize.x*(int)imSize.y, sizeof(Color)); for (int i = 0; i < length; i++) { @@ -1139,7 +1165,8 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing // Draw text (default font) within an image (destination) void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color) { - ImageDrawTextEx(dst, position, GetDefaultFont(), text, fontSize, 0, color); + // NOTE: For default font, sapcing is set to desired font size / default font size (10) + ImageDrawTextEx(dst, position, GetDefaultFont(), text, fontSize, fontSize/10, color); } // Draw text (custom sprite font) within an image (destination) @@ -1438,19 +1465,19 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer // Bottom-left corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)sourceRec.y / texture.height); + rlTexCoord2f((float)sourceRec.x/texture.width, (float)sourceRec.y/texture.height); rlVertex2f(0.0f, 0.0f); // Bottom-right corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlTexCoord2f((float)sourceRec.x/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); rlVertex2f(0.0f, destRec.height); // Top-right corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); rlVertex2f(destRec.width, destRec.height); // Top-left corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)sourceRec.y / texture.height); + rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)sourceRec.y/texture.height); rlVertex2f(destRec.width, 0.0f); rlEnd(); rlPopMatrix(); -- cgit v1.2.3 From 7f0880a73580c14312e18966d8aae568b7a3f7cb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 12 Sep 2016 19:36:41 +0200 Subject: Review spacing formatting raylib uses spaces between '+' and '-' signs but not between '*' and '/' signs, it's a chosen convention --- src/audio.c | 2 +- src/core.c | 2 +- src/models.c | 144 ++++++++++++++++++++++++++++++--------------------------- src/rlgl.c | 8 ++-- src/shapes.c | 10 ++-- src/text.c | 20 ++++---- src/textures.c | 4 +- 7 files changed, 99 insertions(+), 91 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index fa18f7c8..06bf55d4 100644 --- a/src/audio.c +++ b/src/audio.c @@ -482,7 +482,7 @@ void PlaySound(Sound sound) //int sampleRate; //alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); // AL_CHANNELS, AL_BITS (bps) - //float seconds = (float)byteOffset / sampleRate; // Number of seconds since the beginning of the sound + //float seconds = (float)byteOffset/sampleRate; // Number of seconds since the beginning of the sound //or //float result; //alGetSourcef(sound.source, AL_SEC_OFFSET, &result); // AL_SAMPLE_OFFSET diff --git a/src/core.c b/src/core.c index b9ffe87b..d5b07e7a 100644 --- a/src/core.c +++ b/src/core.c @@ -1016,7 +1016,7 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera) QuaternionTransform(&worldPos, matProj); // Calculate normalized device coordinates (inverted y) - Vector3 ndcPos = { worldPos.x / worldPos.w, -worldPos.y / worldPos.w, worldPos.z / worldPos.z }; + Vector3 ndcPos = { worldPos.x/worldPos.w, -worldPos.y/worldPos.w, worldPos.z/worldPos.z }; // Calculate 2d screen position vector Vector2 screenPosition = { (ndcPos.x + 1.0f)/2.0f*(float)GetScreenWidth(), (ndcPos.y + 1.0f)/2.0f*(float)GetScreenHeight() }; diff --git a/src/models.c b/src/models.c index 25eb1fe0..8195c5f6 100644 --- a/src/models.c +++ b/src/models.c @@ -88,7 +88,7 @@ void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rot rlColor4ub(color.r, color.g, color.b, color.a); rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f); - rlVertex3f(sin(DEG2RAD*(i + 10)) * radius, cos(DEG2RAD*(i + 10)) * radius, 0.0f); + rlVertex3f(sin(DEG2RAD*(i + 10))*radius, cos(DEG2RAD*(i + 10))*radius, 0.0f); } rlEnd(); rlPopMatrix(); @@ -325,25 +325,25 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color { for (int j = 0; j < slices; j++) { - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices))); + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i))) * sin(DEG2RAD*((j+1)*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i)))*sin(DEG2RAD*((j+1)*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i))) * cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*(i)))*cos(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices))); + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); } } rlEnd(); @@ -364,26 +364,26 @@ void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Col { for (int j = 0; j < slices; j++) { - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices))); + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*((j+1)*360/slices)), + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices))); + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * sin(DEG2RAD*(j*360/slices)), + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1))) * cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i)) * sin(DEG2RAD*(j*360/slices)), + cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); + rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i)) * cos(DEG2RAD*(j*360/slices))); + cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); } } rlEnd(); @@ -407,21 +407,21 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h // Draw Body ------------------------------------------------------------------------------------- for (int i = 0; i < 360; i += 360/sides) { - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); //Bottom Left - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); //Bottom Right - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusTop, height, cos(DEG2RAD*(i+360/sides)) * radiusTop); //Top Right + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); //Bottom Left + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); //Bottom Right + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); //Top Right - rlVertex3f(sin(DEG2RAD*i) * radiusTop, height, cos(DEG2RAD*i) * radiusTop); //Top Left - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); //Bottom Left - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusTop, height, cos(DEG2RAD*(i+360/sides)) * radiusTop); //Top Right + rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); //Top Left + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); //Bottom Left + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); //Top Right } // Draw Cap -------------------------------------------------------------------------------------- for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); - rlVertex3f(sin(DEG2RAD*i) * radiusTop, height, cos(DEG2RAD*i) * radiusTop); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusTop, height, cos(DEG2RAD*(i+360/sides)) * radiusTop); + rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); } } else @@ -430,8 +430,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); } } @@ -439,8 +439,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, 0, 0); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); } rlEnd(); rlPopMatrix(); @@ -460,17 +460,17 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl for (int i = 0; i < 360; i += 360/sides) { - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusBottom, 0, cos(DEG2RAD*(i+360/sides)) * radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusTop, height, cos(DEG2RAD*(i+360/sides)) * radiusTop); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); - rlVertex3f(sin(DEG2RAD*(i+360/sides)) * radiusTop, height, cos(DEG2RAD*(i+360/sides)) * radiusTop); - rlVertex3f(sin(DEG2RAD*i) * radiusTop, height, cos(DEG2RAD*i) * radiusTop); + rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); + rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); - rlVertex3f(sin(DEG2RAD*i) * radiusTop, height, cos(DEG2RAD*i) * radiusTop); - rlVertex3f(sin(DEG2RAD*i) * radiusBottom, 0, cos(DEG2RAD*i) * radiusBottom); + rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); + rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); } rlEnd(); rlPopMatrix(); @@ -516,7 +516,7 @@ void DrawRay(Ray ray, Color color) // Draw a grid centered at (0, 0, 0) void DrawGrid(int slices, float spacing) { - int halfSlices = slices / 2; + int halfSlices = slices/2; rlBegin(RL_LINES); for (int i = -halfSlices; i <= halfSlices; i++) @@ -577,22 +577,30 @@ void DrawLight(Light light) { case LIGHT_POINT: { - DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); - DrawCircle3D(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); - DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : BLACK)); - DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : BLACK)); + DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); + + DrawCircle3D(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : GRAY)); } break; case LIGHT_DIRECTIONAL: { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); - DrawSphereWires(light->position, 0.3f*light->intensity, 4, 8, (light->enabled ? light->diffuse : BLACK)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); + + DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); } break; case LIGHT_SPOT: { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : BLACK)); - DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : BLACK)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : BLACK)); + DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); + + Vector3 dir = VectorSubtract(light->target, light->position); + VectorNormalize(&dir); + + DrawCircle3D(light->position, 0.5f, 0.0f, dir, (light->enabled ? light->diffuse : GRAY)); + + //DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : GRAY)); + DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); } break; default: break; } @@ -1361,19 +1369,19 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec rlColor4ub(tint.r, tint.g, tint.b, tint.a); // Bottom-left corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)sourceRec.y / texture.height); + rlTexCoord2f((float)sourceRec.x/texture.width, (float)sourceRec.y/texture.height); rlVertex3f(a.x, a.y, a.z); // Top-left corner for texture and quad - rlTexCoord2f((float)sourceRec.x / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlTexCoord2f((float)sourceRec.x/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); rlVertex3f(d.x, d.y, d.z); // Top-right corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)(sourceRec.y + sourceRec.height) / texture.height); + rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); rlVertex3f(c.x, c.y, c.z); // Bottom-right corner for texture and quad - rlTexCoord2f((float)(sourceRec.x + sourceRec.width) / texture.width, (float)sourceRec.y / texture.height); + rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)sourceRec.y/texture.height); rlVertex3f(b.x, b.y, b.z); rlEnd(); @@ -1693,8 +1701,8 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p else playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius / 3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius / 3)) + if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius/3) && + ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius/3)) { impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; } @@ -1716,8 +1724,8 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p else playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius / 3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius / 3)) + if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius/3) && + ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius/3)) { impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; } @@ -1739,8 +1747,8 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p else playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius / 3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius / 3)) + if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius/3) && + ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius/3)) { impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; } @@ -1762,8 +1770,8 @@ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *p else playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius / 3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius / 3)) + if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius/3) && + ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius/3)) { impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; } diff --git a/src/rlgl.c b/src/rlgl.c index 518f2a66..244de52c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -708,7 +708,7 @@ void rlVertex3f(float x, float y, float z) case RL_LINES: { // Verify that MAX_LINES_BATCH limit not reached - if (lines.vCounter / 2 < MAX_LINES_BATCH) + if (lines.vCounter/2 < MAX_LINES_BATCH) { lines.vertices[3*lines.vCounter] = x; lines.vertices[3*lines.vCounter + 1] = y; @@ -722,7 +722,7 @@ void rlVertex3f(float x, float y, float z) case RL_TRIANGLES: { // Verify that MAX_TRIANGLES_BATCH limit not reached - if (triangles.vCounter / 3 < MAX_TRIANGLES_BATCH) + if (triangles.vCounter/3 < MAX_TRIANGLES_BATCH) { triangles.vertices[3*triangles.vCounter] = x; triangles.vertices[3*triangles.vCounter + 1] = y; @@ -736,7 +736,7 @@ void rlVertex3f(float x, float y, float z) case RL_QUADS: { // Verify that MAX_QUADS_BATCH limit not reached - if (quads.vCounter / 4 < MAX_QUADS_BATCH) + if (quads.vCounter/4 < MAX_QUADS_BATCH) { quads.vertices[3*quads.vCounter] = x; quads.vertices[3*quads.vCounter + 1] = y; @@ -3542,7 +3542,7 @@ static void DrawDefaultBuffers(int eyesCount) for (int i = 0; i < drawsCounter; i++) { quadsCount = draws[i].vertexCount/4; - numIndicesToProcess = quadsCount*6; // Get number of Quads * 6 index by Quad + numIndicesToProcess = quadsCount*6; // Get number of Quads*6 index by Quad //TraceLog(DEBUG, "Quads to render: %i - Vertex Count: %i", quadsCount, draws[i].vertexCount); diff --git a/src/shapes.c b/src/shapes.c index d9b172f1..6200a823 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -113,7 +113,7 @@ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Co rlColor4ub(color2.r, color2.g, color2.b, color2.a); rlVertex2f(centerX + sin(DEG2RAD*i)*radius, centerY + cos(DEG2RAD*i)*radius); rlColor4ub(color2.r, color2.g, color2.b, color2.a); - rlVertex2f(centerX + sin(DEG2RAD*(i + 10)) * radius, centerY + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(centerX + sin(DEG2RAD*(i + 10))*radius, centerY + cos(DEG2RAD*(i + 10))*radius); } rlEnd(); } @@ -131,7 +131,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) rlVertex2i(center.x, center.y); rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 10)) * radius, center.y + cos(DEG2RAD*(i + 10)) * radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); } rlEnd(); } @@ -146,8 +146,8 @@ void DrawCircleV(Vector2 center, float radius, Color color) rlVertex2i(center.x, center.y); rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 10)) * radius, center.y + cos(DEG2RAD*(i + 10)) * radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 20)) * radius, center.y + cos(DEG2RAD*(i + 20)) * radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(center.x + sin(DEG2RAD*(i + 20))*radius, center.y + cos(DEG2RAD*(i + 20))*radius); } rlEnd(); @@ -165,7 +165,7 @@ void DrawCircleLines(int centerX, int centerY, float radius, Color color) for (int i = 0; i < 360; i += 10) { rlVertex2f(centerX + sin(DEG2RAD*i)*radius, centerY + cos(DEG2RAD*i)*radius); - rlVertex2f(centerX + sin(DEG2RAD*(i + 10)) * radius, centerY + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(centerX + sin(DEG2RAD*(i + 10))*radius, centerY + cos(DEG2RAD*(i + 10))*radius); } rlEnd(); } diff --git a/src/text.c b/src/text.c index d00f01d7..c538ea56 100644 --- a/src/text.c +++ b/src/text.c @@ -201,7 +201,7 @@ extern void LoadDefaultFont(void) defaultFont.charValues[i] = FONT_FIRST_CHAR + i; // First char is 32 defaultFont.charRecs[i].x = currentPosX; - defaultFont.charRecs[i].y = charsDivisor + currentLine * (charsHeight + charsDivisor); + defaultFont.charRecs[i].y = charsDivisor + currentLine*(charsHeight + charsDivisor); defaultFont.charRecs[i].width = charsWidth[i]; defaultFont.charRecs[i].height = charsHeight; @@ -297,7 +297,7 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) int defaultFontSize = 10; // Default Font chars height in pixel if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize / defaultFontSize; + int spacing = fontSize/defaultFontSize; DrawTextEx(defaultFont, text, position, (float)fontSize, spacing, color); } @@ -408,7 +408,7 @@ int MeasureText(const char *text, int fontSize) int defaultFontSize = 10; // Default Font chars height in pixel if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize / defaultFontSize; + int spacing = fontSize/defaultFontSize; vec = MeasureTextEx(defaultFont, text, fontSize, spacing); @@ -539,7 +539,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int xPosToRead = charSpacing; // Parse image data to get rectangle sizes - while ((lineSpacing + lineToRead * (charHeight + lineSpacing)) < image.height) + while ((lineSpacing + lineToRead*(charHeight + lineSpacing)) < image.height) { while ((xPosToRead < image.width) && !COLOR_EQUAL((pixels[(lineSpacing + (charHeight+lineSpacing)*lineToRead)*image.width + xPosToRead]), key)) @@ -547,7 +547,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) tempCharValues[index] = firstChar + index; tempCharRecs[index].x = xPosToRead; - tempCharRecs[index].y = lineSpacing + lineToRead * (charHeight + lineSpacing); + tempCharRecs[index].y = lineSpacing + lineToRead*(charHeight + lineSpacing); tempCharRecs[index].height = charHeight; int charWidth = 0; @@ -646,11 +646,11 @@ static SpriteFont LoadRBMF(const char *fileName) int numPixelBits = rbmfHeader.imgWidth*rbmfHeader.imgHeight/32; - rbmfFileData = (unsigned int *)malloc(numPixelBits * sizeof(unsigned int)); + rbmfFileData = (unsigned int *)malloc(numPixelBits*sizeof(unsigned int)); for (int i = 0; i < numPixelBits; i++) fread(&rbmfFileData[i], sizeof(unsigned int), 1, rbmfFile); - rbmfCharWidthData = (unsigned char *)malloc(spriteFont.numChars * sizeof(unsigned char)); + rbmfCharWidthData = (unsigned char *)malloc(spriteFont.numChars*sizeof(unsigned char)); for (int i = 0; i < spriteFont.numChars; i++) fread(&rbmfCharWidthData[i], sizeof(unsigned char), 1, rbmfFile); @@ -701,7 +701,7 @@ static SpriteFont LoadRBMF(const char *fileName) spriteFont.charValues[i] = (int)rbmfHeader.firstChar + i; spriteFont.charRecs[i].x = currentPosX; - spriteFont.charRecs[i].y = charsDivisor + currentLine * ((int)rbmfHeader.charHeight + charsDivisor); + spriteFont.charRecs[i].y = charsDivisor + currentLine*((int)rbmfHeader.charHeight + charsDivisor); spriteFont.charRecs[i].width = (int)rbmfCharWidthData[i]; spriteFont.charRecs[i].height = (int)rbmfHeader.charHeight; @@ -714,11 +714,11 @@ static SpriteFont LoadRBMF(const char *fileName) if (testPosX > spriteFont.texture.width) { currentLine++; - currentPosX = 2 * charsDivisor + (int)rbmfCharWidthData[i]; + currentPosX = 2*charsDivisor + (int)rbmfCharWidthData[i]; testPosX = currentPosX; spriteFont.charRecs[i].x = charsDivisor; - spriteFont.charRecs[i].y = charsDivisor + currentLine * (rbmfHeader.charHeight + charsDivisor); + spriteFont.charRecs[i].y = charsDivisor + currentLine*(rbmfHeader.charHeight + charsDivisor); } else currentPosX = testPosX; } diff --git a/src/textures.c b/src/textures.c index 15293371..d4dd2ac2 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1765,7 +1765,7 @@ static Image LoadPKM(const char *fileName) int size = image.width*image.height*bpp/8; // Total data size in bytes - image.data = (unsigned char*)malloc(size * sizeof(unsigned char)); + image.data = (unsigned char*)malloc(size*sizeof(unsigned char)); fread(image.data, 1, size, pkmFile); @@ -1858,7 +1858,7 @@ static Image LoadKTX(const char *fileName) int dataSize; fread(&dataSize, sizeof(unsigned int), 1, ktxFile); - image.data = (unsigned char*)malloc(dataSize * sizeof(unsigned char)); + image.data = (unsigned char*)malloc(dataSize*sizeof(unsigned char)); fread(image.data, 1, dataSize, ktxFile); -- cgit v1.2.3 From 9923fe51a7f69f94c765cfe0dbbf718f287a7a2f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 12 Sep 2016 19:36:55 +0200 Subject: Tweak to avoid warning --- src/external/jar_mod.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h index c39db65a..bee9f6ee 100644 --- a/src/external/jar_mod.h +++ b/src/external/jar_mod.h @@ -59,7 +59,7 @@ // - Initialize the jar_mod_context_t buffer. Must be called before doing anything else. // Return 1 if success. 0 in case of error. // ------------------------------------------- -// mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) +// mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename) // // - "Load" a MOD from file, context must already be initialized. // Return size of file in bytes. @@ -247,7 +247,7 @@ bool jar_mod_init(jar_mod_context_t * modctx); bool jar_mod_setcfg(jar_mod_context_t * modctx, int samplerate, int bits, int stereo, int stereo_separation, int filter); void jar_mod_fillbuffer(jar_mod_context_t * modctx, short * outbuffer, unsigned long nbsample, jar_mod_tracker_buffer_state * trkbuf); void jar_mod_unload(jar_mod_context_t * modctx); -mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename); +mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename); mulong jar_mod_current_samples(jar_mod_context_t * modctx); mulong jar_mod_max_samples(jar_mod_context_t * modctx); void jar_mod_seek_start(jar_mod_context_t * ctx); @@ -1516,7 +1516,7 @@ void jar_mod_unload( jar_mod_context_t * modctx) -mulong jar_mod_load_file(jar_mod_context_t * modctx, char* filename) +mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename) { mulong fsize = 0; if(modctx->modfile) -- cgit v1.2.3 From 79c8eb543ef93fbfbc4073c6c4ea71e22e7e02c4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 15 Sep 2016 11:53:16 +0200 Subject: Corrected audio bugs and improved examples --- src/audio.c | 68 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 06bf55d4..90bf4968 100644 --- a/src/audio.c +++ b/src/audio.c @@ -225,12 +225,16 @@ Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, in wave.data = data; wave.sampleCount = sampleCount; wave.sampleRate = sampleRate; - wave.sampleSize = sampleSize; + wave.sampleSize = 32; wave.channels = channels; - WaveFormat(&wave, sampleRate, sampleSize, channels); + // NOTE: Copy wave data to work with, + // user is responsible of input data to free + Wave cwave = WaveCopy(wave); - return wave; + WaveFormat(&cwave, sampleRate, sampleSize, channels); + + return cwave; } // Load sound to memory @@ -578,6 +582,8 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) } } else TraceLog(WARNING, "Wave formatting: Sample size not supported"); + + free(samples); } // NOTE: Only supported 1 or 2 channels (mono or stereo) @@ -615,7 +621,8 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initSample, int finalSample) { - if ((initSample >= 0) && (finalSample > 0) && (finalSample < wave->sampleCount)) + if ((initSample >= 0) && (initSample < finalSample) && + (finalSample > 0) && (finalSample < wave->sampleCount)) { // TODO: Review cropping (it could be simplified...) @@ -636,6 +643,7 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) // Get samples data from wave as a floats array // NOTE: Returned sample values are normalized to range [-1..1] +// TODO: Consider multiple channels (mono - stereo) float *GetWaveData(Wave wave) { float *samples = (float *)malloc(wave.sampleCount*sizeof(float)); @@ -759,26 +767,37 @@ void ResumeMusicStream(Music music) } // Stop music playing (close stream) +// TODO: Restart XM context void StopMusicStream(Music music) { alSourceStop(music->stream.source); + + switch (music->ctxType) + { + case MUSIC_AUDIO_OGG: stb_vorbis_seek_start(music->ctxOgg); break; + case MUSIC_MODULE_XM: break; + case MUSIC_MODULE_MOD: jar_mod_seek_start(&music->ctxMod); break; + default: break; + } + + music->samplesLeft = music->totalSamples; } // Update (re-fill) music buffers if data already processed void UpdateMusicStream(Music music) { + ALenum state; ALint processed = 0; - - // Determine if music stream is ready to be written - alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); - - int numBuffersToProcess = processed; + + alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); // Get music stream state + alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); // Get processed buffers if (processed > 0) { bool active = true; short pcm[AUDIO_BUFFER_SIZE]; float pcmf[AUDIO_BUFFER_SIZE]; + int numBuffersToProcess = processed; int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, // individual L or R for ogg shorts @@ -833,28 +852,23 @@ void UpdateMusicStream(Music music) break; } } + + // This error is registered when UpdateAudioStream() fails + if (alGetError() == AL_INVALID_VALUE) TraceLog(WARNING, "OpenAL: Error buffering data..."); // Reset audio stream for looping - if (!active && music->loop) + if (!active) { - // Restart music context (if required) - //if (music->ctxType == MUSIC_MODULE_XM) - if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_seek_start(&music->ctxMod); - else if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_seek_start(music->ctxOgg); - - // Reset samples left to total samples - music->samplesLeft = music->totalSamples; + StopMusicStream(music); // Stop music (and reset) + + if (music->loop) PlayMusicStream(music); // Play again + } + else + { + // NOTE: In case window is minimized, music stream is stopped, + // just make sure to play again on window restore + if (state != AL_PLAYING) PlayMusicStream(music); } - - // This error is registered when UpdateAudioStream() fails - if (alGetError() == AL_INVALID_VALUE) TraceLog(WARNING, "OpenAL: Error buffering data..."); - - ALenum state; - alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); - - if (state != AL_PLAYING && active) alSourcePlay(music->stream.source); - - if (!active) StopMusicStream(music); } } -- cgit v1.2.3 From c5bf9623d155efc94325b1ecc311d66a8ee2a704 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 20 Sep 2016 20:16:19 +0200 Subject: Updated LibOVR to SDK version 1.8 Weird, OVR_Version.h still points to 1.7, probably a typo... --- src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h | 151 +++++++++++++-------- .../OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h | 4 + .../OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h | 3 + .../OculusSDK/LibOVR/Include/OVR_CAPI_GL.h | 3 + .../OculusSDK/LibOVR/Include/OVR_ErrorCode.h | 9 ++ .../OculusSDK/LibOVR/Include/OVR_Version.h | 2 +- src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll | Bin 1023952 -> 1044944 bytes 7 files changed, 114 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h index 53340478..eaabcf59 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI.h @@ -271,6 +271,12 @@ typedef char ovrBool; ///< Boolean type //----------------------------------------------------------------------------------- // ***** Simple Math Structures +/// A RGBA color with normalized float components. +typedef struct OVR_ALIGNAS(4) ovrColorf_ +{ + float r, g, b, a; +} ovrColorf; + /// A 2D vector with integer components. typedef struct OVR_ALIGNAS(4) ovrVector2i_ { @@ -326,7 +332,7 @@ typedef struct OVR_ALIGNAS(4) ovrPosef_ /// A full pose (rigid body) configuration with first and second derivatives. /// /// Body refers to any object for which ovrPoseStatef is providing data. -/// It can be the HMD, Touch controller, sensor or something else. The context +/// It can be the HMD, Touch controller, sensor or something else. The context /// depends on the usage of the struct. typedef struct OVR_ALIGNAS(8) ovrPoseStatef_ { @@ -687,7 +693,7 @@ typedef enum ovrTextureFormat_ /// typedef enum ovrTextureMiscFlags_ { - ovrTextureMisc_None, + ovrTextureMisc_None, /// DX only: The underlying texture is created with a TYPELESS equivalent of the /// format specified in the texture desc. The SDK will still access the @@ -745,12 +751,12 @@ typedef struct ovrMirrorTextureData* ovrMirrorTexture; //----------------------------------------------------------------------------------- /// Describes button input types. -/// Button inputs are combined; that is they will be reported as pressed if they are +/// Button inputs are combined; that is they will be reported as pressed if they are /// pressed on either one of the two devices. /// The ovrButton_Up/Down/Left/Right map to both XBox D-Pad and directional buttons. /// The ovrButton_Enter and ovrButton_Return map to Start and Back controller buttons, respectively. typedef enum ovrButton_ -{ +{ ovrButton_A = 0x00000001, ovrButton_B = 0x00000002, ovrButton_RThumb = 0x00000004, @@ -758,7 +764,7 @@ typedef enum ovrButton_ ovrButton_X = 0x00000100, ovrButton_Y = 0x00000200, - ovrButton_LThumb = 0x00000400, + ovrButton_LThumb = 0x00000400, ovrButton_LShoulder = 0x00000800, // Navigation through DPad. @@ -770,7 +776,7 @@ typedef enum ovrButton_ ovrButton_Back = 0x00200000, // Back on Xbox controller. ovrButton_VolUp = 0x00400000, // only supported by Remote. ovrButton_VolDown = 0x00800000, // only supported by Remote. - ovrButton_Home = 0x01000000, + ovrButton_Home = 0x01000000, ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home, // Bit mask of all buttons on the right Touch controller @@ -807,7 +813,7 @@ typedef enum ovrTouch_ // Bit mask of all the button touches on the left controller ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger, - // Finger pose state + // Finger pose state // Derived internally based on distance, proximity to sensors and filtering. ovrTouch_RIndexPointing = 0x00000020, ovrTouch_RThumbUp = 0x00000040, @@ -883,11 +889,20 @@ typedef struct ovrHapticsPlaybackState_ int SamplesQueued; } ovrHapticsPlaybackState; +/// Position tracked devices +typedef enum ovrTrackedDeviceType_ +{ + ovrTrackedDevice_HMD = 0x0001, + ovrTrackedDevice_LTouch = 0x0002, + ovrTrackedDevice_RTouch = 0x0004, + ovrTrackedDevice_Touch = 0x0006, + ovrTrackedDevice_All = 0xFFFF, +} ovrTrackedDeviceType; /// Provides names for the left and right hand array indexes. /// /// \see ovrInputState, ovrTrackingState -/// +/// typedef enum ovrHandType_ { ovrHand_Left = 0, @@ -903,27 +918,43 @@ typedef enum ovrHandType_ /// their inputs are combined. typedef struct ovrInputState_ { - // System type when the controller state was last updated. + /// System type when the controller state was last updated. double TimeInSeconds; - // Values for buttons described by ovrButton. + /// Values for buttons described by ovrButton. unsigned int Buttons; - // Touch values for buttons and sensors as described by ovrTouch. + /// Touch values for buttons and sensors as described by ovrTouch. unsigned int Touches; - - // Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + + /// Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + /// Returns 0 if the value would otherwise be less than 0.1176, for ovrControllerType_XBox float IndexTrigger[ovrHand_Count]; - - // Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + + /// Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. float HandTrigger[ovrHand_Count]; - // Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range -1.0f to 1.0f. + /// Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range -1.0f to 1.0f. + /// Returns a deadzone (value 0) per each axis if the value on that axis would otherwise have been between -.2746 to +.2746, for ovrControllerType_XBox ovrVector2f Thumbstick[ovrHand_Count]; - // The type of the controller this state is for. + /// The type of the controller this state is for. ovrControllerType ControllerType; - + + /// Left and right finger trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + /// Does not apply a deadzone + /// Added in 1.7 + float IndexTriggerNoDeadzone[ovrHand_Count]; + + /// Left and right hand trigger values (ovrHand_Left and ovrHand_Right), in the range 0.0 to 1.0f. + /// Does not apply a deadzone + /// Added in 1.7 + float HandTriggerNoDeadzone[ovrHand_Count]; + + /// Horizontal and vertical thumbstick axis values (ovrHand_Left and ovrHand_Right), in the range -1.0f to 1.0f + /// Does not apply a deadzone + /// Added in 1.7 + ovrVector2f ThumbstickNoDeadzone[ovrHand_Count]; } ovrInputState; @@ -996,8 +1027,8 @@ typedef struct OVR_ALIGNAS(8) ovrInitParams_ /// Use NULL to specify no log callback. ovrLogCallback LogCallback; - /// User-supplied data which is passed as-is to LogCallback. Typically this - /// is used to store an application-specific pointer which is read in the + /// User-supplied data which is passed as-is to LogCallback. Typically this + /// is used to store an application-specific pointer which is read in the /// callback function. uintptr_t UserData; @@ -1014,6 +1045,7 @@ typedef struct OVR_ALIGNAS(8) ovrInitParams_ extern "C" { #endif +#if !defined(OVR_EXPORTING_CAPI) // ----------------------------------------------------------------------------------- // ***** API Interfaces @@ -1026,7 +1058,7 @@ extern "C" { /// followed by a call to ovr_Shutdown. ovr_Initialize calls are idempotent. /// Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown. /// If already initialized, the return value is ovr_Success. -/// +/// /// LibOVRRT shared library search order: /// -# Current working directory (often the same as the application directory). /// -# Module directory (usually the same as the application directory, @@ -1166,21 +1198,21 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_IdentifyClient(const char* identity); /// /// ovr_Initialize must have first been called in order for this to succeed, otherwise ovrHmdDesc::Type /// will be reported as ovrHmd_None. -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create, else NULL in which /// case this function detects whether an HMD is present and returns its info if so. /// -/// \return Returns an ovrHmdDesc. If the hmd is NULL and ovrHmdDesc::Type is ovrHmd_None then +/// \return Returns an ovrHmdDesc. If the hmd is NULL and ovrHmdDesc::Type is ovrHmd_None then /// no HMD is present. /// OVR_PUBLIC_FUNCTION(ovrHmdDesc) ovr_GetHmdDesc(ovrSession session); -/// Returns the number of sensors. +/// Returns the number of sensors. /// -/// The number of sensors may change at any time, so this function should be called before use +/// The number of sensors may change at any time, so this function should be called before use /// as opposed to once on startup. -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// /// \return Returns unsigned int count. @@ -1190,15 +1222,15 @@ OVR_PUBLIC_FUNCTION(unsigned int) ovr_GetTrackerCount(ovrSession session); /// Returns a given sensor description. /// -/// It's possible that sensor desc [0] may indicate a unconnnected or non-pose tracked sensor, but +/// It's possible that sensor desc [0] may indicate a unconnnected or non-pose tracked sensor, but /// sensor desc [1] may be connected. /// /// ovr_Initialize must have first been called in order for this to succeed, otherwise the returned /// trackerDescArray will be zero-initialized. The data returned by this function can change at runtime. -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. -/// -/// \param[in] trackerDescIndex Specifies a sensor index. The valid indexes are in the range of 0 to +/// +/// \param[in] trackerDescIndex Specifies a sensor index. The valid indexes are in the range of 0 to /// the sensor count returned by ovr_GetTrackerCount. /// /// \return Returns ovrTrackerDesc. An empty ovrTrackerDesc will be returned if trackerDescIndex is out of range. @@ -1242,6 +1274,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_Create(ovrSession* pSession, ovrGraphicsLuid* /// OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session); +#endif // !defined(OVR_EXPORTING_CAPI) /// Specifies status information for the current session. /// @@ -1253,10 +1286,11 @@ typedef struct ovrSessionStatus_ ovrBool HmdPresent; ///< True if an HMD is present. ovrBool HmdMounted; ///< True if the HMD is on the user's head. ovrBool DisplayLost; ///< True if the session is in a display-lost state. See ovr_SubmitFrame. - ovrBool ShouldQuit; ///< True if the application should initiate shutdown. + ovrBool ShouldQuit; ///< True if the application should initiate shutdown. ovrBool ShouldRecenter; ///< True if UX has requested re-centering. Must call ovr_ClearShouldRecenterFlag or ovr_RecenterTrackingOrigin. }ovrSessionStatus; +#if !defined(OVR_EXPORTING_CAPI) /// Returns status information for the application. /// @@ -1293,7 +1327,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetSessionStatus(ovrSession session, ovrSessi /// /// When the tracking origin is changed, all of the calls that either provide /// or accept ovrPosef will use the new tracking origin provided. -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// \param[in] origin Specifies an ovrTrackingOrigin to be used for all ovrPosef /// @@ -1305,7 +1339,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_SetTrackingOriginType(ovrSession session, ovr /// Gets the tracking origin state -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// /// \return Returns the ovrTrackingOrigin that was either set by default, or previous set by the application. @@ -1319,9 +1353,9 @@ OVR_PUBLIC_FUNCTION(ovrTrackingOrigin) ovr_GetTrackingOriginType(ovrSession sess /// This resets the (x,y,z) positional components and the yaw orientation component. /// The Roll and pitch orientation components are always determined by gravity and cannot /// be redefined. All future tracking will report values relative to this new reference position. -/// If you are using ovrTrackerPoses then you will need to call ovr_GetTrackerPose after +/// If you are using ovrTrackerPoses then you will need to call ovr_GetTrackerPose after /// this, because the sensor position(s) will change as a result of this. -/// +/// /// The headset cannot be facing vertically upward or downward but rather must be roughly /// level otherwise this function will fail with ovrError_InvalidHeadsetOrientation. /// @@ -1343,7 +1377,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_RecenterTrackingOrigin(ovrSession session); /// Clears the ShouldRecenter status bit in ovrSessionStatus. /// -/// Clears the ShouldRecenter status bit in ovrSessionStatus, allowing further recenter +/// Clears the ShouldRecenter status bit in ovrSessionStatus, allowing further recenter /// requests to be detected. Since this is automatically done by ovr_RecenterTrackingOrigin, /// this is only needs to be called when application is doing its own re-centering. OVR_PUBLIC_FUNCTION(void) ovr_ClearShouldRecenterFlag(ovrSession session); @@ -1444,11 +1478,11 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitControllerVibration(ovrSession session, /// \param[in] outState State of the haptics engine. /// \return Returns ovrSuccess upon success. /// \see ovrHapticsPlaybackState -/// +/// OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetControllerVibrationState(ovrSession session, ovrControllerType controllerType, ovrHapticsPlaybackState* outState); -///@} +#endif // !defined(OVR_EXPORTING_CAPI) //------------------------------------------------------------------------------------- // @name Layers @@ -1672,7 +1706,7 @@ typedef union ovrLayer_Union_ //@} - +#if !defined(OVR_EXPORTING_CAPI) /// @name SDK Distortion Rendering /// @@ -1695,7 +1729,7 @@ typedef union ovrLayer_Union_ /// \param[in] chain Specifies the ovrTextureSwapChain for which the length should be retrieved. /// \param[out] out_Length Returns the number of buffers in the specified chain. /// -/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. /// /// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL /// @@ -1707,7 +1741,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainLength(ovrSession session, /// \param[in] chain Specifies the ovrTextureSwapChain for which the index should be retrieved. /// \param[out] out_Index Returns the current (free) index in specified chain. /// -/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. /// /// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL /// @@ -1719,7 +1753,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainCurrentIndex(ovrSession se /// \param[in] chain Specifies the ovrTextureSwapChain for which the description should be retrieved. /// \param[out] out_Desc Returns the description of the specified chain. /// -/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. /// /// \see ovr_CreateTextureSwapChainDX, ovr_CreateTextureSwapChainGL /// @@ -1736,7 +1770,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetTextureSwapChainDesc(ovrSession session, o /// it will synchronize with the app's graphics context and pick up the submitted index, opening up /// room in the swap chain for further commits. /// -/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. +/// \return Returns an ovrResult for which OVR_SUCCESS(result) is false upon error. /// Failures include but aren't limited to: /// - ovrError_TextureSwapChainFull: ovr_CommitTextureSwapChain was called too many times on a texture swapchain without calling submit to use the chain. /// @@ -1864,7 +1898,7 @@ OVR_PUBLIC_FUNCTION(ovrEyeRenderDesc) ovr_GetRenderDesc(ovrSession session, /// destroyed (ovr_Destroy) and recreated (ovr_Create), and new resources need to be created /// (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not /// need to be recreated unless the new ovr_Create call returns a different GraphicsLuid. -/// - ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. +/// - ovrError_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. /// Ensure ovr_CommitTextureSwapChain was called at least once first. /// /// \see ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader @@ -1874,7 +1908,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitFrame(ovrSession session, long long fra ovrLayerHeader const * const * layerPtrList, unsigned int layerCount); ///@} - +#endif // !defined(OVR_EXPORTING_CAPI) //------------------------------------------------------------------------------------- /// @name Frame Timing @@ -1882,26 +1916,28 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_SubmitFrame(ovrSession session, long long fra //@{ +#if !defined(OVR_EXPORTING_CAPI) + /// Gets the time of the specified frame midpoint. /// -/// Predicts the time at which the given frame will be displayed. The predicted time -/// is the middle of the time period during which the corresponding eye images will -/// be displayed. +/// Predicts the time at which the given frame will be displayed. The predicted time +/// is the middle of the time period during which the corresponding eye images will +/// be displayed. /// /// The application should increment frameIndex for each successively targeted frame, -/// and pass that index to any relevent OVR functions that need to apply to the frame +/// and pass that index to any relevant OVR functions that need to apply to the frame /// identified by that index. /// /// This function is thread-safe and allows for multiple application threads to target /// their processing to the same displayed frame. -/// +/// /// In the even that prediction fails due to various reasons (e.g. the display being off /// or app has yet to present any frames), the return value will be current CPU time. -/// +/// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. /// \param[in] frameIndex Identifies the frame the caller wishes to target. /// A value of zero returns the next frame index. -/// \return Returns the absolute frame midpoint time for the given frameIndex. +/// \return Returns the absolute frame midpoint time for the given frameIndex. /// \see ovr_GetTimeInSeconds /// OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, long long frameIndex); @@ -1917,6 +1953,7 @@ OVR_PUBLIC_FUNCTION(double) ovr_GetPredictedDisplayTime(ovrSession session, long /// OVR_PUBLIC_FUNCTION(double) ovr_GetTimeInSeconds(); +#endif // !defined(OVR_EXPORTING_CAPI) /// Performance HUD enables the HMD user to see information critical to /// the real-time operation of the VR application such as latency timing, @@ -1958,7 +1995,7 @@ typedef enum ovrLayerHudMode_ ///@} /// Debug HUD is provided to help developers gauge and debug the fidelity of their app's -/// stereo rendering characteristics. Using the provided quad and crosshair guides, +/// stereo rendering characteristics. Using the provided quad and crosshair guides, /// the developer can verify various aspects such as VR tracking units (e.g. meters), /// stereo camera-parallax properties (e.g. making sure objects at infinity are rendered /// with the proper separation), measuring VR geometry sizes and distances and more. @@ -1984,7 +2021,7 @@ typedef enum ovrDebugHudStereoMode_ } ovrDebugHudStereoMode; - +#if !defined(OVR_EXPORTING_CAPI) // ----------------------------------------------------------------------------------- /// @name Property Access @@ -2102,7 +2139,7 @@ OVR_PUBLIC_FUNCTION(ovrBool) ovr_SetString(ovrSession session, const char* prope ///@} - +#endif // !defined(OVR_EXPORTING_CAPI) #ifdef __cplusplus } // extern "C" @@ -2163,10 +2200,10 @@ OVR_STATIC_ASSERT(sizeof(ovrLogLevel) == 4, "ovrLogLevel size mismatch"); OVR_STATIC_ASSERT(sizeof(ovrInitParams) == 4 + 4 + sizeof(ovrLogCallback) + sizeof(uintptr_t) + 4 + 4, "ovrInitParams size mismatch"); -OVR_STATIC_ASSERT(sizeof(ovrHmdDesc) == +OVR_STATIC_ASSERT(sizeof(ovrHmdDesc) == + sizeof(ovrHmdType) // Type OVR_ON64(+ 4) // pad0 - + 64 // ProductName + + 64 // ProductName + 64 // Manufacturer + 2 // VendorId + 2 // ProductId diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h index 930dfcbe..dc61e19e 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_Audio.h @@ -17,6 +17,8 @@ #include "OVR_CAPI.h" #define OVR_AUDIO_MAX_DEVICE_STR_SIZE 128 +#if !defined(OVR_EXPORTING_CAPI) + /// Gets the ID of the preferred VR audio output device. /// /// \param[out] deviceOutId The ID of the user's preferred VR audio device to use, which will be valid upon a successful return value, else it will be WAVE_MAPPER. @@ -75,6 +77,8 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceInGuidStr(WCHAR deviceInStrBuff /// OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetAudioDeviceInGuid(GUID* deviceInGuid); +#endif // !defined(OVR_EXPORTING_CAPI) + #endif //OVR_OS_MS #endif // OVR_CAPI_Audio_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h index 982af8f0..374dab84 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_D3D.h @@ -14,6 +14,8 @@ #if defined (_WIN32) #include +#if !defined(OVR_EXPORTING_CAPI) + //----------------------------------------------------------------------------------- // ***** Direct3D Specific @@ -149,6 +151,7 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferDX(ovrSession session, IID iid, void** out_Buffer); +#endif // !defined(OVR_EXPORTING_CAPI) #endif // _WIN32 diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h index 81487947..1c073f46 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_CAPI_GL.h @@ -9,6 +9,8 @@ #include "OVR_CAPI.h" +#if !defined(OVR_EXPORTING_CAPI) + /// Creates a TextureSwapChain suitable for use with OpenGL. /// /// \param[in] session Specifies an ovrSession previously returned by ovr_Create. @@ -95,5 +97,6 @@ OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetMirrorTextureBufferGL(ovrSession session, ovrMirrorTexture mirrorTexture, unsigned int* out_TexId); +#endif // !defined(OVR_EXPORTING_CAPI) #endif // OVR_CAPI_GL_h diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h index 9fc527c7..a8b810ea 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_ErrorCode.h @@ -88,6 +88,7 @@ typedef enum ovrErrorType_ ovrError_ClientSkippedDestroy = -1012, ///< The client failed to call ovr_Destroy on an active session before calling ovr_Shutdown. Or the client crashed. ovrError_ClientSkippedShutdown = -1013, ///< The client failed to call ovr_Shutdown or the client crashed. ovrError_ServiceDeadlockDetected = -1014, ///< The service watchdog discovered a deadlock. + ovrError_InvalidOperation = -1015, ///< Function call is invalid for object's current state /* Audio error range, reserved for Audio errors. */ ovrError_AudioDeviceNotFound = -2001, ///< Failure to find the specified audio device. @@ -115,6 +116,9 @@ typedef enum ovrErrorType_ ovrError_HybridGraphicsNotSupported = -3018, ///< The system is using hybrid graphics (Optimus, etc...), which is not support. ovrError_DisplayManagerInit = -3019, ///< Initialization of the DisplayManager failed. ovrError_TrackerDriverInit = -3020, ///< Failed to get the interface for an attached tracker + ovrError_LibSignCheck = -3021, ///< LibOVRRT signature check failure. + ovrError_LibPath = -3022, ///< LibOVRRT path failure. + ovrError_LibSymbols = -3023, ///< LibOVRRT symbol resolution failure. /* Rendering errors */ ovrError_DisplayLost = -6000, ///< In the event of a system-wide graphics reset or cable unplug this is returned to the app. @@ -130,6 +134,11 @@ typedef enum ovrErrorType_ /* Fatal errors */ ovrError_RuntimeException = -7000, ///< A runtime exception occurred. The application is required to shutdown LibOVR and re-initialize it before this error state will be cleared. + /* Calibration errors */ + ovrError_NoCalibration = -9000, ///< Result of a missing calibration block + ovrError_OldVersion = -9001, ///< Result of an old calibration block + ovrError_MisformattedBlock = -9002, ///< Result of a bad calibration block due to lengths + } ovrErrorType; diff --git a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h index d8378304..8d213df5 100644 --- a/src/external/OculusSDK/LibOVR/Include/OVR_Version.h +++ b/src/external/OculusSDK/LibOVR/Include/OVR_Version.h @@ -19,7 +19,7 @@ // Master version numbers #define OVR_PRODUCT_VERSION 1 // Product version doesn't participate in semantic versioning. #define OVR_MAJOR_VERSION 1 // If you change these values then you need to also make sure to change LibOVR/Projects/Windows/LibOVR.props in parallel. -#define OVR_MINOR_VERSION 6 // +#define OVR_MINOR_VERSION 7 // #define OVR_PATCH_VERSION 0 #define OVR_BUILD_NUMBER 0 diff --git a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll index 843c0e44..7a42d443 100644 Binary files a/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll and b/src/external/OculusSDK/LibOVR/LibOVRRT32_1.dll differ -- cgit v1.2.3 From 1ffe713d930db1ecfae57d162452162a8c521d17 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 21 Sep 2016 12:29:03 +0200 Subject: Corrected bug --- src/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 75812566..ee3f0c12 100644 --- a/src/Makefile +++ b/src/Makefile @@ -100,6 +100,8 @@ ifeq ($(SHARED),YES) CFLAGS += -fPIC SHAREDFLAG = BUILDING_DLL SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lopenal32 -lgdi32 +else + SHAREDFLAG = BUILDING_STATIC endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes -- cgit v1.2.3 From 4a65b19f0f48104567f36ebc5c2cea75f5866377 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 22 Sep 2016 14:35:50 +0200 Subject: Simplify supported image formats Removed support for some unusual image formats --- src/textures.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index d4dd2ac2..5de0590b 100644 --- a/src/textures.c +++ b/src/textures.c @@ -39,6 +39,16 @@ #include "utils.h" // rRES data decompression utility function // NOTE: Includes Android fopen function map +// Support only desired texture formats, by default: JPEG, PNG, BMP, TGA +//#define STBI_NO_JPEG // Image format .jpg and .jpeg +//#define STBI_NO_PNG +//#define STBI_NO_BMP +//#define STBI_NO_TGA +#define STBI_NO_PSD +#define STBI_NO_GIF +#define STBI_NO_HDR +#define STBI_NO_PIC +#define STBI_NO_PNM // Image format .ppm and .pgm #define STB_IMAGE_IMPLEMENTATION #include "external/stb_image.h" // Required for: stbi_load() // NOTE: Used to read image data (multiple formats support) @@ -95,10 +105,17 @@ Image LoadImage(const char *fileName) if ((strcmp(GetExtension(fileName),"png") == 0) || (strcmp(GetExtension(fileName),"bmp") == 0) || (strcmp(GetExtension(fileName),"tga") == 0) || - (strcmp(GetExtension(fileName),"jpg") == 0) || - (strcmp(GetExtension(fileName),"gif") == 0) || - (strcmp(GetExtension(fileName),"psd") == 0) || - (strcmp(GetExtension(fileName),"pic") == 0)) + (strcmp(GetExtension(fileName),"jpg") == 0) +#ifndef STBI_NO_GIF + || (strcmp(GetExtension(fileName),"gif") == 0) +#endif +#ifndef STBI_NO_PSD + || (strcmp(GetExtension(fileName),"psd") == 0) +#endif +#ifndef STBI_NO_PIC + || (strcmp(GetExtension(fileName),"pic") == 0) +#endif + ) { int imgWidth = 0; int imgHeight = 0; -- cgit v1.2.3 From 65d4eb5e826ee416feb951281e805df93a455a65 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 22 Sep 2016 14:38:17 +0200 Subject: Simplify camera module -IN PROGRESS- Removed internal Camera, not required any more Removed useless functions --- src/camera.h | 231 ++++++++++++++++++++++++++--------------------------------- 1 file changed, 101 insertions(+), 130 deletions(-) (limited to 'src') diff --git a/src/camera.h b/src/camera.h index 72a0e706..cda09df4 100644 --- a/src/camera.h +++ b/src/camera.h @@ -182,10 +182,8 @@ typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_D //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Camera internalCamera = {{ 2.0f, 0.0f, 2.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, 45.0f }; - static Vector2 cameraAngle = { 0.0f, 0.0f }; -static float cameraTargetDistance = 5.0f; +static float cameraTargetDistance = 5.0f; // TODO: Remove! Use predefined camera->target to camera->position distance static Vector2 cameraMousePosition = { 0.0f, 0.0f }; static Vector2 cameraMouseVariation = { 0.0f, 0.0f }; @@ -202,8 +200,6 @@ static int cameraMode = CAMERA_CUSTOM; // Current internal camera //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static void ProcessCamera(Camera *camera, Vector3 *playerPosition); - #if defined(CAMERA_STANDALONE) // NOTE: Camera controls depend on some raylib input functions // TODO: Set your own input functions (used in ProcessCamera()) @@ -228,65 +224,30 @@ void SetCameraMode(int mode) { if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_FREE)) { - cameraMode = CAMERA_THIRD_PERSON; - cameraTargetDistance = 5.0f; + cameraTargetDistance = 5.0f; // TODO: Review hardcode! cameraAngle.y = -40*DEG2RAD; - ProcessCamera(&internalCamera, &internalCamera.position); } else if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_ORBITAL)) { - cameraMode = CAMERA_THIRD_PERSON; - cameraTargetDistance = 5.0f; + cameraTargetDistance = 5.0f; // TODO: Review hardcode! cameraAngle.y = -40*DEG2RAD; - ProcessCamera(&internalCamera, &internalCamera.position); } else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_FREE)) { - cameraTargetDistance = 10.0f; + cameraTargetDistance = 10.0f; // TODO: Review hardcode! cameraAngle.x = 45*DEG2RAD; cameraAngle.y = -40*DEG2RAD; - internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - ProcessCamera(&internalCamera, &internalCamera.position); ShowCursor(); } else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_ORBITAL)) { - cameraTargetDistance = 10.0f; + //cameraTargetDistance = 10.0f; // TODO: Review hardcode! cameraAngle.x = 225*DEG2RAD; cameraAngle.y = -40*DEG2RAD; - internalCamera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; - ProcessCamera(&internalCamera, &internalCamera.position); } - - cameraMode = mode; -} - -// Update camera (player position is ignored) -void UpdateCamera(Camera *camera) -{ - Vector3 position = { 0.0f, 0.0f, 0.0f }; - - // Process internal camera and player position (if required) - if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, &position); - - *camera = internalCamera; -} - -// Update camera and player position (1st person and 3rd person cameras) -void UpdateCameraPlayer(Camera *camera, Vector3 *position) -{ - // Process internal camera and player position (if required) - if (cameraMode != CAMERA_CUSTOM) ProcessCamera(&internalCamera, position); - - *camera = internalCamera; -} - -// Set internal camera position -void SetCameraPosition(Vector3 position) -{ - internalCamera.position = position; + /* Vector3 v1 = internalCamera.position; Vector3 v2 = internalCamera.target; @@ -295,75 +256,24 @@ void SetCameraPosition(Vector3 position) float dz = v2.z - v1.z; cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} - -// Set internal camera target -void SetCameraTarget(Vector3 target) -{ - internalCamera.target = target; - - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; + */ - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} - -// Set internal camera fovy -void SetCameraFovy(float fovy) -{ - internalCamera.fovy = fovy; -} - -// Set camera pan key to combine with mouse movement (free camera) -void SetCameraPanControl(int panKey) -{ - cameraPanControlKey = panKey; -} - -// Set camera alt key to combine with mouse movement (free camera) -void SetCameraAltControl(int altKey) -{ - cameraAltControlKey = altKey; -} - -// Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraSmoothZoomControl(int szKey) -{ - cameraSmoothZoomControlKey = szKey; -} - -// Set camera move controls (1st person and 3rd person cameras) -void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) -{ - cameraMoveControl[MOVE_FRONT] = frontKey; - cameraMoveControl[MOVE_LEFT] = leftKey; - cameraMoveControl[MOVE_BACK] = backKey; - cameraMoveControl[MOVE_RIGHT] = rightKey; - cameraMoveControl[MOVE_UP] = upKey; - cameraMoveControl[MOVE_DOWN] = downKey; -} - -// Set camera mouse sensitivity (1st person and 3rd person cameras) -void SetCameraMouseSensitivity(float sensitivity) -{ - cameraMouseSensitivity = (sensitivity/10000.0f); + cameraMode = mode; } -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- - -// Process desired camera mode and controls +// Update camera depending on selected mode // NOTE: Camera controls depend on some raylib functions: // Mouse: GetMousePosition(), SetMousePosition(), IsMouseButtonDown(), GetMouseWheelMove() // System: GetScreenWidth(), GetScreenHeight(), ShowCursor(), HideCursor() // Keys: IsKeyDown() -static void ProcessCamera(Camera *camera, Vector3 *playerPosition) +void UpdateCamera(Camera *camera) { + /* + if (cameraMode != CAMERA_CUSTOM) + { + + } + */ // Mouse movement detection Vector2 mousePosition = GetMousePosition(); int mouseWheelMove = GetMouseWheelMove(); @@ -523,46 +433,38 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition) // Keyboard inputs if (IsKeyDown(cameraMoveControl[MOVE_FRONT])) { - playerPosition->x -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - + camera->position.x -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; camera->position.y += sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; + camera->position.z -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; isMoving = true; } else if (IsKeyDown(cameraMoveControl[MOVE_BACK])) { - playerPosition->x += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - + camera->position.x += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; camera->position.y -= sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; + camera->position.z += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; isMoving = true; } if (IsKeyDown(cameraMoveControl[MOVE_LEFT])) { - playerPosition->x -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + camera->position.x -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + camera->position.z += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; isMoving = true; } else if (IsKeyDown(cameraMoveControl[MOVE_RIGHT])) { - playerPosition->x += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - playerPosition->z -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + camera->position.x += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; + camera->position.z -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; isMoving = true; } - if (IsKeyDown(cameraMoveControl[MOVE_UP])) - { - playerPosition->y += 1.0f/PLAYER_MOVEMENT_DIVIDER; - } - else if (IsKeyDown(cameraMoveControl[MOVE_DOWN])) - { - playerPosition->y -= 1.0f/PLAYER_MOVEMENT_DIVIDER; - } + if (IsKeyDown(cameraMoveControl[MOVE_UP])) camera->position.y += 1.0f/PLAYER_MOVEMENT_DIVIDER; + else if (IsKeyDown(cameraMoveControl[MOVE_DOWN])) camera->position.y -= 1.0f/PLAYER_MOVEMENT_DIVIDER; if (cameraMode == CAMERA_THIRD_PERSON) { @@ -581,9 +483,9 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition) if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; // Camera is always looking at player - camera->target.x = playerPosition->x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); - camera->target.y = playerPosition->y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; - camera->target.z = playerPosition->z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); + camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); + camera->target.y = camera->position.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; + camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); // Camera position update camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; @@ -610,9 +512,12 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition) camera->target.y = camera->position.y + sin(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; camera->target.z = camera->position.z - cos(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; - camera->position.x = playerPosition->x; - camera->position.y = (playerPosition->y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) - sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; - camera->position.z = playerPosition->z; + // Camera position update + //camera->position.y = (playerPosition.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) + // - sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + + // TODO: Review limits, avoid moving under the ground (y = 0.0f) and over the 'eyes position', weird movement (rounding issues...) + camera->position.y -= sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; camera->up.x = sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; camera->up.z = -sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; @@ -622,4 +527,70 @@ static void ProcessCamera(Camera *camera, Vector3 *playerPosition) } } +/* +// Set internal camera position +void SetCameraPosition(Vector3 position) +{ + internalCamera.position = position; + + Vector3 v1 = internalCamera.position; + Vector3 v2 = internalCamera.target; + + float dx = v2.x - v1.x; + float dy = v2.y - v1.y; + float dz = v2.z - v1.z; + + cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); +} + +// Set internal camera target +void SetCameraTarget(Vector3 target) +{ + internalCamera.target = target; + + Vector3 v1 = internalCamera.position; + Vector3 v2 = internalCamera.target; + + float dx = v2.x - v1.x; + float dy = v2.y - v1.y; + float dz = v2.z - v1.z; + + cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); +} +*/ +// Set camera pan key to combine with mouse movement (free camera) +void SetCameraPanControl(int panKey) +{ + cameraPanControlKey = panKey; +} + +// Set camera alt key to combine with mouse movement (free camera) +void SetCameraAltControl(int altKey) +{ + cameraAltControlKey = altKey; +} + +// Set camera smooth zoom key to combine with mouse (free camera) +void SetCameraSmoothZoomControl(int szKey) +{ + cameraSmoothZoomControlKey = szKey; +} + +// Set camera move controls (1st person and 3rd person cameras) +void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) +{ + cameraMoveControl[MOVE_FRONT] = frontKey; + cameraMoveControl[MOVE_LEFT] = leftKey; + cameraMoveControl[MOVE_BACK] = backKey; + cameraMoveControl[MOVE_RIGHT] = rightKey; + cameraMoveControl[MOVE_UP] = upKey; + cameraMoveControl[MOVE_DOWN] = downKey; +} + +// Set camera mouse sensitivity (1st person and 3rd person cameras) +void SetCameraMouseSensitivity(float sensitivity) +{ + cameraMouseSensitivity = (sensitivity/10000.0f); +} + #endif // CAMERA_IMPLEMENTATION -- cgit v1.2.3 From 87fc7254e725f4e5c5137b31d1dfe56be8e22cf0 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 23 Sep 2016 23:25:13 +0200 Subject: Corrected crashing bug! When SetTargetFPS(0) app crashes horribly (division by zero) --- src/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index d5b07e7a..63c880f1 100644 --- a/src/core.c +++ b/src/core.c @@ -689,7 +689,8 @@ void EndTextureMode(void) // Set target FPS for the game void SetTargetFPS(int fps) { - targetTime = 1.0/(double)fps; + if (fps < 1) targetTime = 0.0; + else targetTime = 1.0/(double)fps; TraceLog(INFO, "Target time per frame: %02.03f milliseconds", (float)targetTime*1000); } -- cgit v1.2.3 From 753b549aa5c6a010fc4de8acc2f64afdfce69cee Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Sep 2016 14:28:24 +0200 Subject: Improving camera system -IN PROGRESS- --- src/camera.h | 280 ++++++++++++++++++++++++----------------------------------- src/raylib.h | 17 ++-- 2 files changed, 123 insertions(+), 174 deletions(-) (limited to 'src') diff --git a/src/camera.h b/src/camera.h index cda09df4..0c7b5a13 100644 --- a/src/camera.h +++ b/src/camera.h @@ -47,7 +47,13 @@ //---------------------------------------------------------------------------------- #if defined(CAMERA_STANDALONE) // Camera modes - typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; + typedef enum { + CAMERA_CUSTOM = 0, + CAMERA_FREE, + CAMERA_ORBITAL, + CAMERA_FIRST_PERSON, + CAMERA_THIRD_PERSON + } CameraMode; // Vector2 type typedef struct Vector2 { @@ -67,6 +73,7 @@ Vector3 position; Vector3 target; Vector3 up; + float fovy; } Camera; #endif @@ -83,22 +90,16 @@ extern "C" { // Prevents name mangling of functions // Module Functions Declaration //---------------------------------------------------------------------------------- #if defined(CAMERA_STANDALONE) -void SetCameraMode(int mode); // Set camera mode (multiple camera modes available) +void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) void UpdateCamera(Camera *camera); // Update camera (player position is ignored) -void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and player position (1st person and 3rd person cameras) - -void SetCameraPosition(Vector3 position); // Set internal camera position -void SetCameraTarget(Vector3 target); // Set internal camera target -void SetCameraFovy(float fovy); // Set internal camera field-of-view-y +// TODO: Do we really need all those functions? void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) - void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) -void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) #endif #ifdef __cplusplus @@ -133,8 +134,10 @@ void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -// CAMERA_GENERIC -#define CAMERA_SCROLL_SENSITIVITY 1.5f +// Camera mouse movement sensitivity +#define CAMERA_MOUSE_MOVE_SENSITIVITY 0.003f +#define CAMERA_MOUSE_SCROLL_SENSITIVITY 1.5f + // FREE_CAMERA #define CAMERA_FREE_MOUSE_SENSITIVITY 0.01f @@ -182,20 +185,15 @@ typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_D //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Vector2 cameraAngle = { 0.0f, 0.0f }; -static float cameraTargetDistance = 5.0f; // TODO: Remove! Use predefined camera->target to camera->position distance -static Vector2 cameraMousePosition = { 0.0f, 0.0f }; -static Vector2 cameraMouseVariation = { 0.0f, 0.0f }; +static Vector2 cameraAngle = { 0.0f, 0.0f }; // TODO: Remove! Compute it in UpdateCamera() using camera->target and camera->position +static float cameraTargetDistance = 5.0f; // TODO: Remove! Compute it in UpdateCamera() using camera->target and camera->position static int cameraMoveControl[6] = { 'W', 'A', 'S', 'D', 'E', 'Q' }; static int cameraPanControlKey = 2; // raylib: MOUSE_MIDDLE_BUTTON static int cameraAltControlKey = 342; // raylib: KEY_LEFT_ALT static int cameraSmoothZoomControlKey = 341; // raylib: KEY_LEFT_CONTROL -static int cameraMoveCounter = 0; // Used for 1st person swinging movement -static float cameraMouseSensitivity = 0.003f; // How sensible is camera movement to mouse movement - -static int cameraMode = CAMERA_CUSTOM; // Current internal camera mode +static int cameraMode = CAMERA_CUSTOM; // Current camera mode //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -219,45 +217,21 @@ static int IsKeyDown(int key) { return 0; } //---------------------------------------------------------------------------------- // Select camera mode (multiple camera modes available) -// TODO: Review hardcoded values when changing modes... -void SetCameraMode(int mode) +void SetCameraMode(Camera camera, int mode) { - if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_FREE)) - { - cameraTargetDistance = 5.0f; // TODO: Review hardcode! - cameraAngle.y = -40*DEG2RAD; - } - else if ((cameraMode == CAMERA_FIRST_PERSON) && (mode == CAMERA_ORBITAL)) - { - cameraTargetDistance = 5.0f; // TODO: Review hardcode! - cameraAngle.y = -40*DEG2RAD; - } - else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_FREE)) - { - cameraTargetDistance = 10.0f; // TODO: Review hardcode! - cameraAngle.x = 45*DEG2RAD; - cameraAngle.y = -40*DEG2RAD; - - ShowCursor(); - } - else if ((cameraMode == CAMERA_CUSTOM) && (mode == CAMERA_ORBITAL)) - { - //cameraTargetDistance = 10.0f; // TODO: Review hardcode! - cameraAngle.x = 225*DEG2RAD; - cameraAngle.y = -40*DEG2RAD; - } - - /* - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; + // TODO: cameraTargetDistance and cameraAngle should be + // calculated using camera parameters on UpdateCamera() + + Vector3 v1 = camera.position; + Vector3 v2 = camera.target; float dx = v2.x - v1.x; float dy = v2.y - v1.y; float dz = v2.z - v1.z; cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); - */ - + cameraAngle.y = -40*DEG2RAD; + cameraMode = mode; } @@ -266,48 +240,73 @@ void SetCameraMode(int mode) // Mouse: GetMousePosition(), SetMousePosition(), IsMouseButtonDown(), GetMouseWheelMove() // System: GetScreenWidth(), GetScreenHeight(), ShowCursor(), HideCursor() // Keys: IsKeyDown() +// TODO: Consider touch inputs for camera! +// TODO: Port to quaternion-based camera! void UpdateCamera(Camera *camera) { + static int swingCounter = 0; // Used for 1st person swinging movement + static Vector2 previousMousePosition = { 0.0f, 0.0f }; + + // TODO: Compute cameraTargetDistance and cameraAngle + // NOTE: If cameraTargetDistance and cameraAngle change, camera->position is accordingly updated /* - if (cameraMode != CAMERA_CUSTOM) - { - - } + Vector2 cameraAngle = { 0.0f, 0.0f }; + float cameraTargetDistance = 0.0f; + + float dx = camera->target.x - camera->position.x; + float dy = camera->target.y - camera->position.y; + float dz = camera->target.z - camera->position.z; + + cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); + + Vector2 distance = { 0.0f, 0.0f }; + distance.x = sqrt(dx*dx + dy*dy); + distance.y = sqrt(dx*dx + dz*dz); + + cameraAngle.x = asin(fabs(dx)/distance.x); + cameraAngle.y = asin(fabs(dz)/distance.y); */ + // Mouse movement detection + Vector2 mousePositionDelta = { 0.0f, 0.0f }; Vector2 mousePosition = GetMousePosition(); int mouseWheelMove = GetMouseWheelMove(); int panKey = IsMouseButtonDown(cameraPanControlKey); // bool value - int screenWidth = GetScreenWidth(); - int screenHeight = GetScreenHeight(); - - if ((cameraMode != CAMERA_FREE) && (cameraMode != CAMERA_ORBITAL)) + if (cameraMode != CAMERA_CUSTOM) { - HideCursor(); + // Get screen size + int screenWidth = GetScreenWidth(); + int screenHeight = GetScreenHeight(); + + if ((cameraMode == CAMERA_FIRST_PERSON) || + (cameraMode == CAMERA_THIRD_PERSON)) + { + HideCursor(); - if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y}); - else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3}); - else if (mousePosition.x > screenWidth - screenHeight/3) SetMousePosition((Vector2) { screenHeight/3, mousePosition.y}); - else if (mousePosition.y > screenHeight - screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3}); - else + if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y}); + else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3}); + else if (mousePosition.x > screenWidth - screenHeight/3) SetMousePosition((Vector2) { screenHeight/3, mousePosition.y}); + else if (mousePosition.y > screenHeight - screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3}); + else + { + mousePositionDelta.x = mousePosition.x - previousMousePosition.x; + mousePositionDelta.y = mousePosition.y - previousMousePosition.y; + } + } + else // CAMERA_FREE, CAMERA_ORBITAL { - cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; - cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; + ShowCursor(); + + mousePositionDelta.x = mousePosition.x - previousMousePosition.x; + mousePositionDelta.y = mousePosition.y - previousMousePosition.y; } - } - else - { - ShowCursor(); - cameraMouseVariation.x = mousePosition.x - cameraMousePosition.x; - cameraMouseVariation.y = mousePosition.y - cameraMousePosition.y; + // NOTE: We GetMousePosition() again because it can be modified by a previous SetMousePosition() call + // If using directly mousePosition variable we have problems on CAMERA_FIRST_PERSON and CAMERA_THIRD_PERSON + previousMousePosition = GetMousePosition(); } - // NOTE: We GetMousePosition() again because it can be modified by a previous SetMousePosition() call - // If using directly mousePosition variable we have problems on CAMERA_FIRST_PERSON and CAMERA_THIRD_PERSON - cameraMousePosition = GetMousePosition(); - // Support for multiple automatic camera modes switch (cameraMode) { @@ -316,48 +315,48 @@ void UpdateCamera(Camera *camera) // Camera zoom if ((cameraTargetDistance < CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); if (cameraTargetDistance > CAMERA_FREE_DISTANCE_MAX_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MAX_CLAMP; } // Camera looking down else if ((camera->position.y > camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; } else if ((camera->position.y > camera->target.y) && (camera->target.y >= 0)) { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; // if (camera->target.y < 0) camera->target.y = -0.001; } else if ((camera->position.y > camera->target.y) && (camera->target.y < 0) && (mouseWheelMove > 0)) { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; } // Camera looking up else if ((camera->position.y < camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; } else if ((camera->position.y < camera->target.y) && (camera->target.y <= 0)) { - camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; - camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.y += mouseWheelMove*(camera->target.y - camera->position.y)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; + camera->target.z += mouseWheelMove*(camera->target.z - camera->position.z)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; // if (camera->target.y > 0) camera->target.y = 0.001; } else if ((camera->position.y < camera->target.y) && (camera->target.y > 0) && (mouseWheelMove > 0)) { - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; } @@ -367,15 +366,15 @@ void UpdateCamera(Camera *camera) if (IsKeyDown(cameraSmoothZoomControlKey)) { // Camera smooth zoom - if (panKey) cameraTargetDistance += (cameraMouseVariation.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); + if (panKey) cameraTargetDistance += (mousePositionDelta.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); } // Camera orientation calculation else if (panKey) { // Camera orientation calculation // Get the mouse sensitivity - cameraAngle.x += cameraMouseVariation.x*-CAMERA_FREE_MOUSE_SENSITIVITY; - cameraAngle.y += cameraMouseVariation.y*-CAMERA_FREE_MOUSE_SENSITIVITY; + cameraAngle.x += mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY; + cameraAngle.y += mousePositionDelta.y*-CAMERA_FREE_MOUSE_SENSITIVITY; // Angle clamp if (cameraAngle.y > CAMERA_FREE_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MIN_CLAMP*DEG2RAD; @@ -385,9 +384,9 @@ void UpdateCamera(Camera *camera) // Paning else if (panKey) { - camera->target.x += ((cameraMouseVariation.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.y += ((cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.z += ((cameraMouseVariation.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (cameraMouseVariation.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); } // Focus to center @@ -396,10 +395,8 @@ void UpdateCamera(Camera *camera) // Camera position update camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; } break; @@ -408,7 +405,7 @@ void UpdateCamera(Camera *camera) cameraAngle.x += CAMERA_ORBITAL_SPEED; // Camera zoom - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); // Camera distance clamp if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; @@ -417,19 +414,20 @@ void UpdateCamera(Camera *camera) if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; // Camera position update + // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; } break; case CAMERA_FIRST_PERSON: case CAMERA_THIRD_PERSON: { - bool isMoving = false; + bool isMoving = false; // TODO: Really required for swinging? + // TODO: Get movement direction value [-1, 0, 1] in XZ and just multiply + // Keyboard inputs if (IsKeyDown(cameraMoveControl[MOVE_FRONT])) { @@ -469,15 +467,15 @@ void UpdateCamera(Camera *camera) if (cameraMode == CAMERA_THIRD_PERSON) { // Camera orientation calculation - cameraAngle.x += cameraMouseVariation.x*-cameraMouseSensitivity; - cameraAngle.y += cameraMouseVariation.y*-cameraMouseSensitivity; + cameraAngle.x += mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY; + cameraAngle.y += mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY; // Angle clamp if (cameraAngle.y > CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD; else if (cameraAngle.y < CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD; // Camera zoom - cameraTargetDistance -= (mouseWheelMove*CAMERA_SCROLL_SENSITIVITY); + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); // Camera distance clamp if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; @@ -489,19 +487,17 @@ void UpdateCamera(Camera *camera) // Camera position update camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; } else // CAMERA_FIRST_PERSON { - if (isMoving) cameraMoveCounter++; + if (isMoving) swingCounter++; // Camera orientation calculation - cameraAngle.x += (cameraMouseVariation.x*-cameraMouseSensitivity); - cameraAngle.y += (cameraMouseVariation.y*-cameraMouseSensitivity); + cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); + cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY); // Angle clamp if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD; @@ -514,67 +510,27 @@ void UpdateCamera(Camera *camera) // Camera position update //camera->position.y = (playerPosition.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) - // - sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + // - sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; // TODO: Review limits, avoid moving under the ground (y = 0.0f) and over the 'eyes position', weird movement (rounding issues...) - camera->position.y -= sin(cameraMoveCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + camera->position.y -= sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; - camera->up.x = sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; - camera->up.z = -sin(cameraMoveCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + camera->up.x = sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + camera->up.z = -sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; } } break; default: break; } } -/* -// Set internal camera position -void SetCameraPosition(Vector3 position) -{ - internalCamera.position = position; - - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; - - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} - -// Set internal camera target -void SetCameraTarget(Vector3 target) -{ - internalCamera.target = target; - - Vector3 v1 = internalCamera.position; - Vector3 v2 = internalCamera.target; - - float dx = v2.x - v1.x; - float dy = v2.y - v1.y; - float dz = v2.z - v1.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); -} -*/ // Set camera pan key to combine with mouse movement (free camera) -void SetCameraPanControl(int panKey) -{ - cameraPanControlKey = panKey; -} +void SetCameraPanControl(int panKey) { cameraPanControlKey = panKey; } // Set camera alt key to combine with mouse movement (free camera) -void SetCameraAltControl(int altKey) -{ - cameraAltControlKey = altKey; -} +void SetCameraAltControl(int altKey) { cameraAltControlKey = altKey; } // Set camera smooth zoom key to combine with mouse (free camera) -void SetCameraSmoothZoomControl(int szKey) -{ - cameraSmoothZoomControlKey = szKey; -} +void SetCameraSmoothZoomControl(int szKey) { cameraSmoothZoomControlKey = szKey; } // Set camera move controls (1st person and 3rd person cameras) void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) @@ -587,10 +543,4 @@ void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, cameraMoveControl[MOVE_DOWN] = downKey; } -// Set camera mouse sensitivity (1st person and 3rd person cameras) -void SetCameraMouseSensitivity(float sensitivity) -{ - cameraMouseSensitivity = (sensitivity/10000.0f); -} - #endif // CAMERA_IMPLEMENTATION diff --git a/src/raylib.h b/src/raylib.h index 3c815031..66260ca2 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -559,7 +559,13 @@ typedef enum { } Gestures; // Camera system modes -typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode; +typedef enum { + CAMERA_CUSTOM = 0, + CAMERA_FREE, + CAMERA_ORBITAL, + CAMERA_FIRST_PERSON, + CAMERA_THIRD_PERSON +} CameraMode; // Head Mounted Display devices typedef enum { @@ -698,22 +704,15 @@ RLAPI float GetGesturePinchAngle(void); // Get gesture pin //------------------------------------------------------------------------------------ // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(int mode); // Set camera mode (multiple camera modes available) +RLAPI void SetCameraMode(Camera, int mode); // Set camera mode (multiple camera modes available) RLAPI void UpdateCamera(Camera *camera); // Update camera (player position is ignored) -RLAPI void UpdateCameraPlayer(Camera *camera, Vector3 *position); // Update camera and player position (1st person and 3rd person cameras) - -RLAPI void SetCameraPosition(Vector3 position); // Set internal camera position -RLAPI void SetCameraTarget(Vector3 target); // Set internal camera target -RLAPI void SetCameraFovy(float fovy); // Set internal camera field-of-view-y RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) - RLAPI void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) -RLAPI void SetCameraMouseSensitivity(float sensitivity); // Set camera mouse sensitivity (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) -- cgit v1.2.3 From 978c49472a1cdffa0bf12aba1638806c65e3f8ba Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 26 Sep 2016 19:15:44 +0200 Subject: Working on camera system... --- src/camera.h | 215 +++++++++++++++++++++++------------------------------------ src/raylib.h | 6 +- 2 files changed, 87 insertions(+), 134 deletions(-) (limited to 'src') diff --git a/src/camera.h b/src/camera.h index 0c7b5a13..9bf9132b 100644 --- a/src/camera.h +++ b/src/camera.h @@ -11,7 +11,7 @@ * If defined, the library can be used as standalone as a camera system but some * functions must be redefined to manage inputs accordingly. * -* NOTE: Memory footprint of this library is aproximately 112 bytes +* NOTE: Memory footprint of this library is aproximately 52 bytes (global variables) * * Initial design by Marc Palau (2014) * Reviewed by Ramon Santamaria (2015-2016) @@ -91,14 +91,13 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- #if defined(CAMERA_STANDALONE) void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) -void UpdateCamera(Camera *camera); // Update camera (player position is ignored) +void UpdateCamera(Camera *camera); // Update camera position for selected mode -// TODO: Do we really need all those functions? void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) void SetCameraMoveControls(int frontKey, int backKey, - int leftKey, int rightKey, + int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) #endif @@ -138,7 +137,6 @@ void SetCameraMoveControls(int frontKey, int backKey, #define CAMERA_MOUSE_MOVE_SENSITIVITY 0.003f #define CAMERA_MOUSE_SCROLL_SENSITIVITY 1.5f - // FREE_CAMERA #define CAMERA_FREE_MOUSE_SENSITIVITY 0.01f #define CAMERA_FREE_DISTANCE_MIN_CLAMP 0.3f @@ -171,24 +169,21 @@ void SetCameraMoveControls(int frontKey, int backKey, #define CAMERA_THIRD_PERSON_OFFSET (Vector3){ 0.4f, 0.0f, 0.0f } // PLAYER (used by camera) -#define PLAYER_WIDTH 0.4f -#define PLAYER_HEIGHT 0.9f -#define PLAYER_DEPTH 0.4f -#define PLAYER_MOVEMENT_DIVIDER 20.0f +#define PLAYER_MOVEMENT_DIVIDER 20.0f //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- // Camera move modes (first person and third person cameras) -typedef enum { MOVE_FRONT = 0, MOVE_LEFT, MOVE_BACK, MOVE_RIGHT, MOVE_UP, MOVE_DOWN } CameraMove; +typedef enum { MOVE_FRONT = 0, MOVE_BACK, MOVE_RIGHT, MOVE_LEFT, MOVE_UP, MOVE_DOWN } CameraMove; //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static Vector2 cameraAngle = { 0.0f, 0.0f }; // TODO: Remove! Compute it in UpdateCamera() using camera->target and camera->position -static float cameraTargetDistance = 5.0f; // TODO: Remove! Compute it in UpdateCamera() using camera->target and camera->position +static Vector2 cameraAngle = { 0.0f, 0.0f }; // TODO: Remove! Compute it in UpdateCamera() +static float cameraTargetDistance = 0.0f; // TODO: Remove! Compute it in UpdateCamera() -static int cameraMoveControl[6] = { 'W', 'A', 'S', 'D', 'E', 'Q' }; +static int cameraMoveControl[6] = { 'W', 'S', 'D', 'A', 'E', 'Q' }; static int cameraPanControlKey = 2; // raylib: MOUSE_MIDDLE_BUTTON static int cameraAltControlKey = 342; // raylib: KEY_LEFT_ALT static int cameraSmoothZoomControlKey = 341; // raylib: KEY_LEFT_CONTROL @@ -200,7 +195,7 @@ static int cameraMode = CAMERA_CUSTOM; // Current camera mode //---------------------------------------------------------------------------------- #if defined(CAMERA_STANDALONE) // NOTE: Camera controls depend on some raylib input functions -// TODO: Set your own input functions (used in ProcessCamera()) +// TODO: Set your own input functions (used in UpdateCamera()) static Vector2 GetMousePosition() { return (Vector2){ 0.0f, 0.0f }; } static void SetMousePosition(Vector2 pos) {} static int IsMouseButtonDown(int button) { return 0;} @@ -230,7 +225,18 @@ void SetCameraMode(Camera camera, int mode) float dz = v2.z - v1.z; cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); - cameraAngle.y = -40*DEG2RAD; + + Vector2 distance = { 0.0f, 0.0f }; + distance.x = sqrt(dx*dx + dy*dy); + distance.y = sqrt(dx*dx + dz*dz); + + // TODO: Review cameraAngle calculation + //cameraAngle.x = asin(fabs(dx)/distance.x); + //cameraAngle.y = -asin(fabs(dz)/distance.y); + + // NOTE: Just testing what cameraAngle means + cameraAngle.x = 90.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) + cameraAngle.y = -80.0f*DEG2RAD; // Camera angle in plane XY (0 aligned with X, move positive CW) cameraMode = mode; } @@ -240,39 +246,33 @@ void SetCameraMode(Camera camera, int mode) // Mouse: GetMousePosition(), SetMousePosition(), IsMouseButtonDown(), GetMouseWheelMove() // System: GetScreenWidth(), GetScreenHeight(), ShowCursor(), HideCursor() // Keys: IsKeyDown() -// TODO: Consider touch inputs for camera! -// TODO: Port to quaternion-based camera! +// TODO: Port to quaternion-based camera void UpdateCamera(Camera *camera) { static int swingCounter = 0; // Used for 1st person swinging movement static Vector2 previousMousePosition = { 0.0f, 0.0f }; - // TODO: Compute cameraTargetDistance and cameraAngle - // NOTE: If cameraTargetDistance and cameraAngle change, camera->position is accordingly updated - /* - Vector2 cameraAngle = { 0.0f, 0.0f }; - float cameraTargetDistance = 0.0f; - - float dx = camera->target.x - camera->position.x; - float dy = camera->target.y - camera->position.y; - float dz = camera->target.z - camera->position.z; - - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); - - Vector2 distance = { 0.0f, 0.0f }; - distance.x = sqrt(dx*dx + dy*dy); - distance.y = sqrt(dx*dx + dz*dz); - - cameraAngle.x = asin(fabs(dx)/distance.x); - cameraAngle.y = asin(fabs(dz)/distance.y); - */ + // TODO: Compute cameraTargetDistance and cameraAngle here // Mouse movement detection Vector2 mousePositionDelta = { 0.0f, 0.0f }; Vector2 mousePosition = GetMousePosition(); int mouseWheelMove = GetMouseWheelMove(); - int panKey = IsMouseButtonDown(cameraPanControlKey); // bool value + // Keys input detection + bool panKey = IsMouseButtonDown(cameraPanControlKey); + bool altKey = IsKeyDown(cameraAltControlKey); + bool szoomKey = IsKeyDown(cameraSmoothZoomControlKey); + + bool direction[6] = { IsKeyDown(cameraMoveControl[MOVE_FRONT]), + IsKeyDown(cameraMoveControl[MOVE_BACK]), + IsKeyDown(cameraMoveControl[MOVE_RIGHT]), + IsKeyDown(cameraMoveControl[MOVE_LEFT]), + IsKeyDown(cameraMoveControl[MOVE_UP]), + IsKeyDown(cameraMoveControl[MOVE_DOWN]) }; + + // TODO: Consider touch inputs for camera + if (cameraMode != CAMERA_CUSTOM) { // Get screen size @@ -284,10 +284,10 @@ void UpdateCamera(Camera *camera) { HideCursor(); - if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y}); - else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3}); - else if (mousePosition.x > screenWidth - screenHeight/3) SetMousePosition((Vector2) { screenHeight/3, mousePosition.y}); - else if (mousePosition.y > screenHeight - screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3}); + if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y }); + else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3 }); + else if (mousePosition.x > (screenWidth - screenHeight/3)) SetMousePosition((Vector2){ screenHeight/3, mousePosition.y }); + else if (mousePosition.y > (screenHeight - screenHeight/3)) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3 }); else { mousePositionDelta.x = mousePosition.x - previousMousePosition.x; @@ -360,19 +360,15 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; } - // Inputs - if (IsKeyDown(cameraAltControlKey)) + // Input keys checks + if (altKey) { - if (IsKeyDown(cameraSmoothZoomControlKey)) + if (szoomKey) // Camera smooth zoom { - // Camera smooth zoom if (panKey) cameraTargetDistance += (mousePositionDelta.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); } - // Camera orientation calculation else if (panKey) { - // Camera orientation calculation - // Get the mouse sensitivity cameraAngle.x += mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY; cameraAngle.y += mousePositionDelta.y*-CAMERA_FREE_MOUSE_SENSITIVITY; @@ -381,95 +377,50 @@ void UpdateCamera(Camera *camera) else if (cameraAngle.y < CAMERA_FREE_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MAX_CLAMP*DEG2RAD; } } - // Paning - else if (panKey) + else if (panKey) // Paning { camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); } - // Focus to center - // TODO: Move this function out of this module? - if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - - // Camera position update - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; - } break; case CAMERA_ORBITAL: { - cameraAngle.x += CAMERA_ORBITAL_SPEED; - - // Camera zoom - cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); + cameraAngle.x += CAMERA_ORBITAL_SPEED; // Camera orbit angle + cameraTargetDistance -= (mouseWheelMove*CAMERA_MOUSE_SCROLL_SENSITIVITY); // Camera zoom // Camera distance clamp if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; - - // Focus to center - if (IsKeyDown('Z')) camera->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - - // Camera position update - // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; - + } break; case CAMERA_FIRST_PERSON: case CAMERA_THIRD_PERSON: { + camera->position.x += (sin(cameraAngle.x)*direction[MOVE_BACK] - + sin(cameraAngle.x)*direction[MOVE_FRONT] - + cos(cameraAngle.x)*direction[MOVE_LEFT] + + cos(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_DIVIDER; + + camera->position.y += (sin(cameraAngle.y)*direction[MOVE_FRONT] - + sin(cameraAngle.y)*direction[MOVE_BACK] + + 1.0f*direction[MOVE_UP] - 1.0f*direction[MOVE_DOWN])/PLAYER_MOVEMENT_DIVIDER; + + camera->position.z += (cos(cameraAngle.x)*direction[MOVE_BACK] - + cos(cameraAngle.x)*direction[MOVE_FRONT] + + sin(cameraAngle.x)*direction[MOVE_LEFT] - + sin(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_DIVIDER; + bool isMoving = false; // TODO: Really required for swinging? - // TODO: Get movement direction value [-1, 0, 1] in XZ and just multiply + //for (int i = 0; i < 6; i++) if (direction[i]) { isMoving = true; break; } + + // Camera orientation calculation + cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); + cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY); - // Keyboard inputs - if (IsKeyDown(cameraMoveControl[MOVE_FRONT])) - { - camera->position.x -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - camera->position.y += sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; - camera->position.z -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - else if (IsKeyDown(cameraMoveControl[MOVE_BACK])) - { - camera->position.x += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - camera->position.y -= sin(cameraAngle.y)/PLAYER_MOVEMENT_DIVIDER; - camera->position.z += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - - if (IsKeyDown(cameraMoveControl[MOVE_LEFT])) - { - camera->position.x -= cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - camera->position.z += sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - else if (IsKeyDown(cameraMoveControl[MOVE_RIGHT])) - { - camera->position.x += cos(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - camera->position.z -= sin(cameraAngle.x)/PLAYER_MOVEMENT_DIVIDER; - - isMoving = true; - } - - if (IsKeyDown(cameraMoveControl[MOVE_UP])) camera->position.y += 1.0f/PLAYER_MOVEMENT_DIVIDER; - else if (IsKeyDown(cameraMoveControl[MOVE_DOWN])) camera->position.y -= 1.0f/PLAYER_MOVEMENT_DIVIDER; - if (cameraMode == CAMERA_THIRD_PERSON) { - // Camera orientation calculation - cameraAngle.x += mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY; - cameraAngle.y += mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY; - // Angle clamp if (cameraAngle.y > CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MIN_CLAMP*DEG2RAD; else if (cameraAngle.y < CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_THIRD_PERSON_MAX_CLAMP*DEG2RAD; @@ -482,23 +433,11 @@ void UpdateCamera(Camera *camera) // Camera is always looking at player camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); - camera->target.y = camera->position.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; + camera->target.y = camera->position.y + CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); - - // Camera position update - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; } else // CAMERA_FIRST_PERSON { - if (isMoving) swingCounter++; - - // Camera orientation calculation - cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); - cameraAngle.y += (mousePositionDelta.y*-CAMERA_MOUSE_MOVE_SENSITIVITY); - // Angle clamp if (cameraAngle.y > CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MIN_CLAMP*DEG2RAD; else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD; @@ -507,6 +446,8 @@ void UpdateCamera(Camera *camera) camera->target.x = camera->position.x - sin(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; camera->target.y = camera->position.y + sin(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; camera->target.z = camera->position.z - cos(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + + if (isMoving) swingCounter++; // Camera position update //camera->position.y = (playerPosition.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) @@ -521,6 +462,18 @@ void UpdateCamera(Camera *camera) } break; default: break; } + + // Update camera position with changes + if ((cameraMode == CAMERA_FREE) || + (cameraMode == CAMERA_ORBITAL) || + (cameraMode == CAMERA_THIRD_PERSON)) + { + // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... + camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; + if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; + camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; + } } // Set camera pan key to combine with mouse movement (free camera) @@ -533,12 +486,12 @@ void SetCameraAltControl(int altKey) { cameraAltControlKey = altKey; } void SetCameraSmoothZoomControl(int szKey) { cameraSmoothZoomControlKey = szKey; } // Set camera move controls (1st person and 3rd person cameras) -void SetCameraMoveControls(int frontKey, int backKey, int leftKey, int rightKey, int upKey, int downKey) +void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey) { cameraMoveControl[MOVE_FRONT] = frontKey; - cameraMoveControl[MOVE_LEFT] = leftKey; cameraMoveControl[MOVE_BACK] = backKey; cameraMoveControl[MOVE_RIGHT] = rightKey; + cameraMoveControl[MOVE_LEFT] = leftKey; cameraMoveControl[MOVE_UP] = upKey; cameraMoveControl[MOVE_DOWN] = downKey; } diff --git a/src/raylib.h b/src/raylib.h index 66260ca2..35319d6a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -705,14 +705,14 @@ RLAPI float GetGesturePinchAngle(void); // Get gesture pin // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ RLAPI void SetCameraMode(Camera, int mode); // Set camera mode (multiple camera modes available) -RLAPI void UpdateCamera(Camera *camera); // Update camera (player position is ignored) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) RLAPI void SetCameraMoveControls(int frontKey, int backKey, - int leftKey, int rightKey, - int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) + int rightKey, int leftKey, + int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) //------------------------------------------------------------------------------------ // Basic Shapes Drawing Functions (Module: shapes) -- cgit v1.2.3 From 2ae9ce29eb254870fc82d106027bd4c561e74af8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 2 Oct 2016 23:04:46 +0200 Subject: Corrected issue on DrawPolyEx() --- src/shapes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 6200a823..362dc0f7 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -347,11 +347,11 @@ void DrawPolyEx(Vector2 *points, int numPoints, Color color) rlBegin(RL_TRIANGLES); rlColor4ub(color.r, color.g, color.b, color.a); - for (int i = 0; i < numPoints - 2; i++) + for (int i = 1; i < numPoints - 1; i++) { + rlVertex2f(points[0].x, points[0].y); rlVertex2f(points[i].x, points[i].y); rlVertex2f(points[i + 1].x, points[i + 1].y); - rlVertex2f(points[i + 2].x, points[i + 2].y); } rlEnd(); } -- cgit v1.2.3 From 637d3195ec705e7f014395ad20cd574bc7fa015e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 3 Oct 2016 13:27:22 +0200 Subject: More review on camera system... Sincerely, don't like it... it should be ported to quaternions... the way it manages cameraTargetDistange and cameraAngle is confusing... --- src/camera.h | 80 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/camera.h b/src/camera.h index 9bf9132b..33220390 100644 --- a/src/camera.h +++ b/src/camera.h @@ -147,7 +147,7 @@ void SetCameraMoveControls(int frontKey, int backKey, #define CAMERA_FREE_PANNING_DIVIDER 5.1f // ORBITAL_CAMERA -#define CAMERA_ORBITAL_SPEED 0.01f +#define CAMERA_ORBITAL_SPEED 0.01f // Radians per frame // FIRST_PERSON //#define CAMERA_FIRST_PERSON_MOUSE_SENSITIVITY 0.003f @@ -159,8 +159,6 @@ void SetCameraMoveControls(int frontKey, int backKey, #define CAMERA_FIRST_PERSON_STEP_DIVIDER 30.0f #define CAMERA_FIRST_PERSON_WAVING_DIVIDER 200.0f -#define CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION 0.85f - // THIRD_PERSON //#define CAMERA_THIRD_PERSON_MOUSE_SENSITIVITY 0.003f #define CAMERA_THIRD_PERSON_DISTANCE_CLAMP 1.2f @@ -169,7 +167,7 @@ void SetCameraMoveControls(int frontKey, int backKey, #define CAMERA_THIRD_PERSON_OFFSET (Vector3){ 0.4f, 0.0f, 0.0f } // PLAYER (used by camera) -#define PLAYER_MOVEMENT_DIVIDER 20.0f +#define PLAYER_MOVEMENT_SENSITIVITY 20.0f //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -182,6 +180,7 @@ typedef enum { MOVE_FRONT = 0, MOVE_BACK, MOVE_RIGHT, MOVE_LEFT, MOVE_UP, MOVE_D //---------------------------------------------------------------------------------- static Vector2 cameraAngle = { 0.0f, 0.0f }; // TODO: Remove! Compute it in UpdateCamera() static float cameraTargetDistance = 0.0f; // TODO: Remove! Compute it in UpdateCamera() +static float playerEyesPosition = 1.85f; // Default player eyes position from ground (in meters) static int cameraMoveControl[6] = { 'W', 'S', 'D', 'A', 'E', 'Q' }; static int cameraPanControlKey = 2; // raylib: MOUSE_MIDDLE_BUTTON @@ -227,16 +226,18 @@ void SetCameraMode(Camera camera, int mode) cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); Vector2 distance = { 0.0f, 0.0f }; - distance.x = sqrt(dx*dx + dy*dy); - distance.y = sqrt(dx*dx + dz*dz); + distance.x = sqrt(dx*dx + dz*dz); + distance.y = sqrt(dx*dx + dy*dy); - // TODO: Review cameraAngle calculation - //cameraAngle.x = asin(fabs(dx)/distance.x); - //cameraAngle.y = -asin(fabs(dz)/distance.y); + // Camera angle calculation + cameraAngle.x = asin(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) + cameraAngle.y = -asin(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) // NOTE: Just testing what cameraAngle means - cameraAngle.x = 90.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) - cameraAngle.y = -80.0f*DEG2RAD; // Camera angle in plane XY (0 aligned with X, move positive CW) + //cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) + //cameraAngle.y = -60.0f*DEG2RAD; // Camera angle in plane XY (0 aligned with X, move positive CW) + + playerEyesPosition = camera.position.y; cameraMode = mode; } @@ -361,28 +362,34 @@ void UpdateCamera(Camera *camera) } // Input keys checks - if (altKey) + if (panKey) { - if (szoomKey) // Camera smooth zoom + if (altKey) // Alternative key behaviour { - if (panKey) cameraTargetDistance += (mousePositionDelta.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); + if (szoomKey) + { + // Camera smooth zoom + cameraTargetDistance += (mousePositionDelta.y*CAMERA_FREE_SMOOTH_ZOOM_SENSITIVITY); + } + else + { + // Camera rotation + cameraAngle.x += mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY; + cameraAngle.y += mousePositionDelta.y*-CAMERA_FREE_MOUSE_SENSITIVITY; + + // Angle clamp + if (cameraAngle.y > CAMERA_FREE_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MIN_CLAMP*DEG2RAD; + else if (cameraAngle.y < CAMERA_FREE_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MAX_CLAMP*DEG2RAD; + } } - else if (panKey) + else { - cameraAngle.x += mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY; - cameraAngle.y += mousePositionDelta.y*-CAMERA_FREE_MOUSE_SENSITIVITY; - - // Angle clamp - if (cameraAngle.y > CAMERA_FREE_MIN_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MIN_CLAMP*DEG2RAD; - else if (cameraAngle.y < CAMERA_FREE_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FREE_MAX_CLAMP*DEG2RAD; + // Camera panning + camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); } } - else if (panKey) // Paning - { - camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - } } break; case CAMERA_ORBITAL: @@ -400,20 +407,20 @@ void UpdateCamera(Camera *camera) camera->position.x += (sin(cameraAngle.x)*direction[MOVE_BACK] - sin(cameraAngle.x)*direction[MOVE_FRONT] - cos(cameraAngle.x)*direction[MOVE_LEFT] + - cos(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_DIVIDER; + cos(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; camera->position.y += (sin(cameraAngle.y)*direction[MOVE_FRONT] - sin(cameraAngle.y)*direction[MOVE_BACK] + - 1.0f*direction[MOVE_UP] - 1.0f*direction[MOVE_DOWN])/PLAYER_MOVEMENT_DIVIDER; + 1.0f*direction[MOVE_UP] - 1.0f*direction[MOVE_DOWN])/PLAYER_MOVEMENT_SENSITIVITY; camera->position.z += (cos(cameraAngle.x)*direction[MOVE_BACK] - cos(cameraAngle.x)*direction[MOVE_FRONT] + sin(cameraAngle.x)*direction[MOVE_LEFT] - - sin(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_DIVIDER; + sin(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; - bool isMoving = false; // TODO: Really required for swinging? + bool isMoving = false; // Required for swinging - //for (int i = 0; i < 6; i++) if (direction[i]) { isMoving = true; break; } + for (int i = 0; i < 6; i++) if (direction[i]) { isMoving = true; break; } // Camera orientation calculation cameraAngle.x += (mousePositionDelta.x*-CAMERA_MOUSE_MOVE_SENSITIVITY); @@ -433,7 +440,7 @@ void UpdateCamera(Camera *camera) // Camera is always looking at player camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); - camera->target.y = camera->position.y + CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION + CAMERA_THIRD_PERSON_OFFSET.y; + camera->target.y = camera->position.y + CAMERA_THIRD_PERSON_OFFSET.y; camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); } else // CAMERA_FIRST_PERSON @@ -450,11 +457,8 @@ void UpdateCamera(Camera *camera) if (isMoving) swingCounter++; // Camera position update - //camera->position.y = (playerPosition.y + PLAYER_HEIGHT*CAMERA_FIRST_PERSON_HEIGHT_RELATIVE_EYES_POSITION) - // - sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; - - // TODO: Review limits, avoid moving under the ground (y = 0.0f) and over the 'eyes position', weird movement (rounding issues...) - camera->position.y -= sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + // NOTE: On CAMERA_FIRST_PERSON player Y-movement is limited to player 'eyes position' + camera->position.y = playerEyesPosition - sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; camera->up.x = sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; camera->up.z = -sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; -- cgit v1.2.3 From b082807b0b90bce07e15098d6d0a17574d100277 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 3 Oct 2016 13:29:01 +0200 Subject: Removed function: ResolveCollisionCubicmap() Function was inefficient and should be rewritten from scratch, it probably neither belongs to this module but an example... --- src/models.c | 250 ----------------------------------------------------------- src/raylib.h | 7 +- 2 files changed, 2 insertions(+), 255 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 8195c5f6..822da6e9 100644 --- a/src/models.c +++ b/src/models.c @@ -1548,256 +1548,6 @@ BoundingBox CalculateBoundingBox(Mesh mesh) return box; } -// Detect and resolve cubicmap collisions -// NOTE: player position (or camera) is modified inside this function -// TODO: This functions needs to be completely reviewed! -Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius) -{ - #define CUBIC_MAP_HALF_BLOCK_SIZE 0.5 - - Color *cubicmapPixels = GetImageData(cubicmap); - - // Detect the cell where the player is located - Vector3 impactDirection = { 0.0f, 0.0f, 0.0f }; - - int locationCellX = 0; - int locationCellY = 0; - - locationCellX = floor(playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE); - locationCellY = floor(playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE); - - if ((locationCellX >= 0) && (locationCellY >= 0) && (locationCellX < cubicmap.width) && (locationCellY < cubicmap.height)) - { - // Multiple Axis -------------------------------------------------------------------------------------------- - - // Axis x-, y- - if ((locationCellX > 0) && (locationCellY > 0)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) - { - playerPosition->x = locationCellX + mapPosition.x - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - - // Axis x-, y+ - if ((locationCellX > 0) && (locationCellY < cubicmap.height - 1)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) - { - playerPosition->x = locationCellX + mapPosition.x - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - - // Axis x+, y- - if ((locationCellX < cubicmap.width - 1) && (locationCellY > 0)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) - { - playerPosition->x = locationCellX + mapPosition.x + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - - // Axis x+, y+ - if ((locationCellX < cubicmap.width - 1) && (locationCellY < cubicmap.height - 1)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) - { - playerPosition->x = locationCellX + mapPosition.x + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - - // Single Axis --------------------------------------------------------------------------------------------------- - - // Axis x- - if (locationCellX > 0) - { - if (cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r != 0) - { - if ((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) - { - playerPosition->x = locationCellX + mapPosition.x - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 0.0f }; - } - } - } - // Axis x+ - if (locationCellX < cubicmap.width - 1) - { - if (cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r != 0) - { - if ((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) - { - playerPosition->x = locationCellX + mapPosition.x + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 1.0f, 0.0f, 0.0f }; - } - } - } - // Axis y- - if (locationCellY > 0) - { - if (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r != 0) - { - if ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius) - { - playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 0.0f, 0.0f, 1.0f }; - } - } - } - // Axis y+ - if (locationCellY < cubicmap.height - 1) - { - if (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r != 0) - { - if ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius) - { - playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - impactDirection = (Vector3){ 0.0f, 0.0f, 1.0f }; - } - } - } - - // Diagonals ------------------------------------------------------------------------------------------------------- - - // Axis x-, y- - if ((locationCellX > 0) && (locationCellY > 0)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r == 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX - 1)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX) > ((playerPosition->z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY)) playerPosition->x = locationCellX + mapPosition.x - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - else playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - - // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius/3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius/3)) - { - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - } - - // Axis x-, y+ - if ((locationCellX > 0) && (locationCellY < cubicmap.height - 1)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX - 1)].r == 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX - 1)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX) > (1 - ((playerPosition->z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY))) playerPosition->x = locationCellX + mapPosition.x - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - else playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - - // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX < radius/3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius/3)) - { - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - } - - // Axis x+, y- - if ((locationCellX < cubicmap.width - 1) && (locationCellY > 0)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r == 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY - 1)*cubicmap.width + (locationCellX + 1)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX) < (1 - ((playerPosition->z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY))) playerPosition->x = locationCellX + mapPosition.x + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - else playerPosition->z = locationCellY + mapPosition.z - (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - - // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius/3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY < radius/3)) - { - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - } - - // Axis x+, y+ - if ((locationCellX < cubicmap.width - 1) && (locationCellY < cubicmap.height - 1)) - { - if ((cubicmapPixels[locationCellY*cubicmap.width + (locationCellX + 1)].r == 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX)].r == 0) && - (cubicmapPixels[(locationCellY + 1)*cubicmap.width + (locationCellX + 1)].r != 0)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius)) - { - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX) < ((playerPosition->z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY)) playerPosition->x = locationCellX + mapPosition.x + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - else playerPosition->z = locationCellY + mapPosition.z + (CUBIC_MAP_HALF_BLOCK_SIZE - radius); - - // Return ricochet - if (((playerPosition->x - mapPosition.x + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellX > 1 - radius/3) && - ((playerPosition->z - mapPosition.z + CUBIC_MAP_HALF_BLOCK_SIZE) - locationCellY > 1 - radius/3)) - { - impactDirection = (Vector3){ 1.0f, 0.0f, 1.0f }; - } - } - } - } - } - - // Floor collision - if (playerPosition->y <= radius) - { - playerPosition->y = radius + 0.01f; - impactDirection = (Vector3) { impactDirection.x, 1, impactDirection.z}; - } - // Roof collision - else if (playerPosition->y >= (1.5f - radius)) - { - playerPosition->y = (1.5f - radius) - 0.01f; - impactDirection = (Vector3) { impactDirection.x, 1, impactDirection.z}; - } - - free(cubicmapPixels); - - return impactDirection; -} - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- diff --git a/src/raylib.h b/src/raylib.h index 35319d6a..d022e8f5 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -839,9 +839,7 @@ RLAPI Model LoadHeightmap(Image heightmap, Vector3 size); // Load a RLAPI Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) RLAPI void UnloadModel(Model model); // Unload 3d model from memory -RLAPI Mesh GenMeshCube(float width, float height, float depth); // Generate mesh: cube - -RLAPI Material LoadMaterial(const char *fileName); // Load material data (from file) +RLAPI Material LoadMaterial(const char *fileName); // Load material data (.MTL) RLAPI Material LoadDefaultMaterial(void); // Load default material (uses default models shader) RLAPI Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) RLAPI void UnloadMaterial(Material material); // Unload material textures from VRAM @@ -862,8 +860,7 @@ RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box -RLAPI Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap - // NOTE: Return the normal vector of the impacted surface + //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 -- cgit v1.2.3 From db6538859cd2fabb44f1f29cd87f5b498ca0c2c8 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 5 Oct 2016 00:48:44 +0200 Subject: Added flag to allow resizable window --- src/core.c | 21 +++++++++++++-------- src/raylib.h | 11 ++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 63c880f1..0db1c573 100644 --- a/src/core.c +++ b/src/core.c @@ -1483,15 +1483,20 @@ static void InitGraphicsDevice(int width, int height) displayHeight = screenHeight; #endif // defined(PLATFORM_WEB) - glfwDefaultWindowHints(); // Set default windows hints + glfwDefaultWindowHints(); // Set default windows hints - glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable - //glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window - //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits - //glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default) - //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window + if (configFlags & FLAG_RESIZABLE_WINDOW) + { + glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window + } + else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable + + //glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window + //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits + //glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default) + //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window //glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); // Default OpenGL API to use. Alternative: GLFW_OPENGL_ES_API - //glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers + //glfwWindowHint(GLFW_AUX_BUFFERS, 0); // Number of auxiliar buffers // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // with forward compatibility to older OpenGL versions. @@ -1499,7 +1504,7 @@ static void InitGraphicsDevice(int width, int height) if (configFlags & FLAG_MSAA_4X_HINT) { - glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 + glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 TraceLog(INFO, "Trying to enable MSAA x4"); } diff --git a/src/raylib.h b/src/raylib.h index d022e8f5..e6e510a9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -101,11 +101,12 @@ // raylib Config Flags #define FLAG_FULLSCREEN_MODE 1 -#define FLAG_SHOW_LOGO 2 -#define FLAG_SHOW_MOUSE_CURSOR 4 -#define FLAG_CENTERED_MODE 8 -#define FLAG_MSAA_4X_HINT 16 -#define FLAG_VSYNC_HINT 32 +#define FLAG_RESIZABLE_WINDOW 2 +#define FLAG_SHOW_LOGO 4 +#define FLAG_SHOW_MOUSE_CURSOR 8 +#define FLAG_CENTERED_MODE 16 +#define FLAG_MSAA_4X_HINT 32 +#define FLAG_VSYNC_HINT 64 // Keyboard Function Keys #define KEY_SPACE 32 -- cgit v1.2.3 From b4a3f294bfe8c2c854b45ff56d971c3995b71f62 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Oct 2016 13:07:55 +0200 Subject: Correct warning --- src/textures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 5de0590b..fd5bdd80 100644 --- a/src/textures.c +++ b/src/textures.c @@ -229,7 +229,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int // TODO: Review function to support multiple color modes Image LoadImageFromRES(const char *rresName, int resId) { - Image image; + Image image = { 0 }; bool found = false; char id[4]; // rRES file identifier -- cgit v1.2.3 From efa286a550115ebcb8dfb4e84ea6a719d110fd27 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Oct 2016 13:09:08 +0200 Subject: Allow no default font loading Useful if text module is not required... --- src/core.c | 21 ++++++++++++++++----- src/text.c | 28 ++++++++++++++++++---------- 2 files changed, 34 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 0db1c573..a35dbae0 100644 --- a/src/core.c +++ b/src/core.c @@ -18,6 +18,10 @@ * * On PLATFORM_RPI, graphic device is managed by EGL and input system is coded in raw mode. * +* Module Configuration Flags: +* +* RL_LOAD_DEFAULT_FONT - Use external module functions to load default raylib font (module: text) +* * Copyright (c) 2014 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event @@ -130,6 +134,8 @@ #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) #endif +#define RL_LOAD_DEFAULT_FONT // Load default font on window initialization (module: text) + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -238,11 +244,10 @@ static bool showLogo = false; // Track if showing logo at init is //---------------------------------------------------------------------------------- // Other Modules Functions Declaration (required by core) //---------------------------------------------------------------------------------- +#if defined(RL_LOAD_DEFAULT_FONT) extern void LoadDefaultFont(void); // [Module: text] Loads default font on InitWindow() extern void UnloadDefaultFont(void); // [Module: text] Unloads default font from GPU memory - -extern void ProcessGestureEvent(GestureEvent event); // [Module: gestures] Process gesture event and translate it into gestures -extern void UpdateGestures(void); // [Module: gestures] Update gestures detected (called in PollInputEvents()) +#endif //---------------------------------------------------------------------------------- // Module specific Functions Declaration @@ -311,9 +316,11 @@ void InitWindow(int width, int height, const char *title) // Init graphics device (display device and OpenGL context) InitGraphicsDevice(width, height); - // Load default font for convenience +#if defined(RL_LOAD_DEFAULT_FONT) + // Load default font // NOTE: External function (defined in module: text) LoadDefaultFont(); +#endif // Init hi-res timer InitTimer(); @@ -420,7 +427,9 @@ void InitWindow(int width, int height, struct android_app *state) // Close Window and Terminate Context void CloseWindow(void) { +#if defined(RL_LOAD_DEFAULT_FONT) UnloadDefaultFont(); +#endif rlglClose(); // De-init rlgl @@ -2245,9 +2254,11 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // Init graphics device (display device and OpenGL context) InitGraphicsDevice(screenWidth, screenHeight); - // Load default font for convenience + #if defined(RL_LOAD_DEFAULT_FONT) + // Load default font // NOTE: External function (defined in module: text) LoadDefaultFont(); + #endif // TODO: GPU assets reload in case of lost focus (lost context) // NOTE: This problem has been solved just unbinding and rebinding context from display diff --git a/src/text.c b/src/text.c index c538ea56..d1d7602f 100644 --- a/src/text.c +++ b/src/text.c @@ -293,13 +293,17 @@ void UnloadSpriteFont(SpriteFont spriteFont) // NOTE: chars spacing is proportional to fontSize void DrawText(const char *text, int posX, int posY, int fontSize, Color color) { - Vector2 position = { (float)posX, (float)posY }; + // Check if default font has been loaded + if (defaultFont.texture.id != 0) + { + Vector2 position = { (float)posX, (float)posY }; - int defaultFontSize = 10; // Default Font chars height in pixel - if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize/defaultFontSize; + int defaultFontSize = 10; // Default Font chars height in pixel + if (fontSize < defaultFontSize) fontSize = defaultFontSize; + int spacing = fontSize/defaultFontSize; - DrawTextEx(defaultFont, text, position, (float)fontSize, spacing, color); + DrawTextEx(GetDefaultFont(), text, position, (float)fontSize, spacing, color); + } } // Draw text using SpriteFont @@ -404,13 +408,17 @@ const char *SubText(const char *text, int position, int length) // Measure string width for default font int MeasureText(const char *text, int fontSize) { - Vector2 vec; + Vector2 vec = { 0.0f, 0.0f }; - int defaultFontSize = 10; // Default Font chars height in pixel - if (fontSize < defaultFontSize) fontSize = defaultFontSize; - int spacing = fontSize/defaultFontSize; + // Check if default font has been loaded + if (defaultFont.texture.id != 0) + { + int defaultFontSize = 10; // Default Font chars height in pixel + if (fontSize < defaultFontSize) fontSize = defaultFontSize; + int spacing = fontSize/defaultFontSize; - vec = MeasureTextEx(defaultFont, text, fontSize, spacing); + vec = MeasureTextEx(GetDefaultFont(), text, fontSize, spacing); + } return (int)vec.x; } -- cgit v1.2.3 From 3396743aba163545eb186beb47667d55d38528e9 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Oct 2016 13:25:50 +0200 Subject: Corrected old issue with mouse buttons on web --- src/raylib.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index e6e510a9..3b752785 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -176,13 +176,8 @@ // Mouse Buttons #define MOUSE_LEFT_BUTTON 0 -#if defined(PLATFORM_WEB) - #define MOUSE_RIGHT_BUTTON 2 - #define MOUSE_MIDDLE_BUTTON 1 -#else - #define MOUSE_RIGHT_BUTTON 1 - #define MOUSE_MIDDLE_BUTTON 2 -#endif +#define MOUSE_RIGHT_BUTTON 1 +#define MOUSE_MIDDLE_BUTTON 2 // Touch points registered #define MAX_TOUCH_POINTS 2 -- cgit v1.2.3 From 5af1b4a7c9119cf438e4cb5303009fbe9a25c6d7 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Oct 2016 20:56:58 +0200 Subject: Added simulated head-tracking on VR simulator A simple 1st person camera... still requires some work... --- src/raylib.h | 1 + src/rlgl.c | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 3b752785..df0ee7bc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -891,6 +891,7 @@ RLAPI void DestroyLight(Light light); // Des RLAPI void InitVrDevice(int vdDevice); // Init VR device RLAPI void CloseVrDevice(void); // Close VR device RLAPI bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +RLAPI bool IsVrSimulator(void); // Detect if VR simulator is running RLAPI void UpdateVrTracking(void); // Update VR tracking (position and orientation) RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) diff --git a/src/rlgl.c b/src/rlgl.c index 244de52c..702edb18 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2710,6 +2710,12 @@ bool IsVrDeviceReady(void) return (vrDeviceReady || vrSimulator) && vrEnabled; } +// Detect if VR simulator is running +bool IsVrSimulator(void) +{ + return vrSimulator; +} + // Enable/Disable VR experience (device or simulator) void ToggleVrMode(void) { -- cgit v1.2.3 From 4c791100cc339e9be09c95b3bcebf09951647e9d Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 9 Oct 2016 20:57:14 +0200 Subject: Tweak int to float --- src/shapes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 362dc0f7..9fcbeff7 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -129,7 +129,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) { rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(center.x, center.y); + rlVertex2f(center.x, center.y); rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); } @@ -144,7 +144,7 @@ void DrawCircleV(Vector2 center, float radius, Color color) { rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(center.x, center.y); + rlVertex2f(center.x, center.y); rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); rlVertex2f(center.x + sin(DEG2RAD*(i + 20))*radius, center.y + cos(DEG2RAD*(i + 20))*radius); @@ -330,7 +330,7 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col { rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex2i(0, 0); + rlVertex2f(0, 0); rlVertex2f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius); rlVertex2f(sin(DEG2RAD*(i + 360/sides))*radius, cos(DEG2RAD*(i + 360/sides))*radius); } -- cgit v1.2.3 From b1651baea504411dc47ef257094a089c9107dd73 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 10 Oct 2016 18:22:55 +0200 Subject: Added support for FLAC audio loading/streaming --- src/audio.c | 62 +- src/external/dr_flac.h | 4395 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 4455 insertions(+), 2 deletions(-) create mode 100644 src/external/dr_flac.h (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 90bf4968..bf66f929 100644 --- a/src/audio.c +++ b/src/audio.c @@ -79,6 +79,10 @@ #define JAR_MOD_IMPLEMENTATION #include "external/jar_mod.h" // MOD loading functions +#define DR_FLAC_IMPLEMENTATION +#define DR_FLAC_NO_WIN32_IO +#include "external/dr_flac.h" // FLAC loading functions + #ifdef _MSC_VER #undef bool #endif @@ -98,12 +102,13 @@ // Types and Structures Definition //---------------------------------------------------------------------------------- -typedef enum { MUSIC_AUDIO_OGG = 0, MUSIC_MODULE_XM, MUSIC_MODULE_MOD } MusicContextType; +typedef enum { MUSIC_AUDIO_OGG = 0, MUSIC_AUDIO_FLAC, MUSIC_MODULE_XM, MUSIC_MODULE_MOD } MusicContextType; // Music type (file streaming from memory) typedef struct MusicData { MusicContextType ctxType; // Type of music context (OGG, XM, MOD) stb_vorbis *ctxOgg; // OGG audio context + drflac *ctxFlac; // FLAC audio context jar_xm_context_t *ctxXm; // XM chiptune context jar_mod_context_t ctxMod; // MOD chiptune context @@ -128,6 +133,7 @@ typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; //---------------------------------------------------------------------------------- static Wave LoadWAV(const char *fileName); // Load WAV file static Wave LoadOGG(const char *fileName); // Load OGG file +static Wave LoadFLAC(const char *fileName); // Load FLAC file #if defined(AUDIO_STANDALONE) const char *GetExtension(const char *fileName); // Get the extension for a filename @@ -212,6 +218,7 @@ Wave LoadWave(const char *fileName) if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); + else if (strcmp(GetExtension(fileName), "flac") == 0) wave = LoadFLAC(fileName); else TraceLog(WARNING, "[%s] File extension not recognized, it can't be loaded", fileName); return wave; @@ -672,7 +679,7 @@ Music LoadMusicStream(const char *fileName) // Open ogg audio stream music->ctxOgg = stb_vorbis_open_filename(fileName, NULL, NULL); - if (music->ctxOgg == NULL) TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); + if (music->ctxOgg == NULL) TraceLog(WARNING, "[%s] OGG audio file could not be opened", fileName); else { stb_vorbis_info info = stb_vorbis_get_info(music->ctxOgg); // Get Ogg file info @@ -691,6 +698,24 @@ Music LoadMusicStream(const char *fileName) } } + else if (strcmp(GetExtension(fileName), "flac") == 0) + { + music->ctxFlac = drflac_open_file(fileName); + + if (music->ctxFlac == NULL) TraceLog(WARNING, "[%s] FLAC audio file could not be opened", fileName); + else + { + music->stream = InitAudioStream(music->ctxFlac->sampleRate, music->ctxFlac->bitsPerSample, music->ctxFlac->channels); + music->totalSamples = music->ctxFlac->totalSampleCount; + music->samplesLeft = music->totalSamples; + music->ctxType = MUSIC_AUDIO_FLAC; + music->loop = true; // We loop by default + + TraceLog(DEBUG, "[%s] FLAC sample rate: %i", fileName, music->ctxFlac->sampleRate); + TraceLog(DEBUG, "[%s] FLAC bits per sample: %i", fileName, music->ctxFlac->bitsPerSample); + TraceLog(DEBUG, "[%s] FLAC channels: %i", fileName, music->ctxFlac->channels); + } + } else if (strcmp(GetExtension(fileName), "xm") == 0) { int result = jar_xm_create_context_from_file(&music->ctxXm, 48000, fileName); @@ -739,6 +764,7 @@ void UnloadMusicStream(Music music) CloseAudioStream(music->stream); if (music->ctxType == MUSIC_AUDIO_OGG) stb_vorbis_close(music->ctxOgg); + else if (music->ctxType == MUSIC_AUDIO_FLAC) drflac_free(music->ctxFlac); else if (music->ctxType == MUSIC_MODULE_XM) jar_xm_free_context(music->ctxXm); else if (music->ctxType == MUSIC_MODULE_MOD) jar_mod_unload(&music->ctxMod); @@ -818,6 +844,20 @@ void UpdateMusicStream(Music music) UpdateAudioStream(music->stream, pcm, numSamplesOgg*music->stream.channels); music->samplesLeft -= (numSamplesOgg*music->stream.channels); + } break; + case MUSIC_AUDIO_FLAC: + { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; + else numSamples = music->samplesLeft; + + int pcmi[AUDIO_BUFFER_SIZE]; + + // NOTE: Returns the number of samples to process (should be the same as numSamples) + int numSamplesFlac = drflac_read_s32(music->ctxFlac, numSamples, pcmi); + + UpdateAudioStream(music->stream, pcmi, numSamples*music->stream.channels); + music->samplesLeft -= (numSamples*music->stream.channels); + } break; case MUSIC_MODULE_XM: { @@ -1214,6 +1254,24 @@ static Wave LoadOGG(const char *fileName) return wave; } +// Load FLAC file into Wave structure +// NOTE: Using dr_flac library +static Wave LoadFLAC(const char *fileName) +{ + Wave wave; + + // Decode an entire FLAC file in one go + uint64_t totalSampleCount; + wave.data = drflac_open_and_decode_file_s32(fileName, &wave.channels, &wave.sampleRate, &totalSampleCount); + + wave.sampleCount = (int)totalSampleCount; + wave.sampleSize = 32; + + if (wave.data == NULL) TraceLog(WARNING, "[%s] FLAC data could not be loaded", fileName); + + return wave; +} + // Some required functions for audio standalone module version #if defined(AUDIO_STANDALONE) // Get the extension for a filename diff --git a/src/external/dr_flac.h b/src/external/dr_flac.h new file mode 100644 index 00000000..d7b66f20 --- /dev/null +++ b/src/external/dr_flac.h @@ -0,0 +1,4395 @@ +// FLAC audio decoder. Public domain. See "unlicense" statement at the end of this file. +// dr_flac - v0.4 - 2016-09-29 +// +// David Reid - mackron@gmail.com + +// USAGE +// +// dr_flac is a single-file library. To use it, do something like the following in one .c file. +// #define DR_FLAC_IMPLEMENTATION +// #include "dr_flac.h" +// +// You can then #include this file in other parts of the program as you would with any other header file. To decode audio data, +// do something like the following: +// +// drflac* pFlac = drflac_open_file("MySong.flac"); +// if (pFlac == NULL) { +// // Failed to open FLAC file +// } +// +// int32_t* pSamples = malloc(pFlac->totalSampleCount * sizeof(int32_t)); +// uint64_t numberOfInterleavedSamplesActuallyRead = drflac_read_s32(pFlac, pFlac->totalSampleCount, pSamples); +// +// The drflac object represents the decoder. It is a transparent type so all the information you need, such as the number of +// channels and the bits per sample, should be directly accessible - just make sure you don't change their values. Samples are +// always output as interleaved signed 32-bit PCM. In the example above a native FLAC stream was opened, however dr_flac has +// seamless support for Ogg encapsulated FLAC streams as well. +// +// You do not need to decode the entire stream in one go - you just specify how many samples you'd like at any given time and +// the decoder will give you as many samples as it can, up to the amount requested. Later on when you need the next batch of +// samples, just call it again. Example: +// +// while (drflac_read_s32(pFlac, chunkSize, pChunkSamples) > 0) { +// do_something(); +// } +// +// You can seek to a specific sample with drflac_seek_to_sample(). The given sample is based on interleaving. So for example, +// if you were to seek to the sample at index 0 in a stereo stream, you'll be seeking to the first sample of the left channel. +// The sample at index 1 will be the first sample of the right channel. The sample at index 2 will be the second sample of the +// left channel, etc. +// +// +// If you just want to quickly decode an entire FLAC file in one go you can do something like this: +// +// unsigned int channels; +// unsigned int sampleRate; +// uint64_t totalSampleCount; +// int32_t* pSampleData = drflac_open_and_decode_file("MySong.flac", &channels, &sampleRate, &totalSampleCount); +// if (pSampleData == NULL) { +// // Failed to open and decode FLAC file. +// } +// +// ... +// +// drflac_free(pSampleData); +// +// +// If you need access to metadata (album art, etc.), use drflac_open_with_metadata(), drflac_open_file_with_metdata() or +// drflac_open_memory_with_metadata(). The rationale for keeping these APIs separate is that they're slightly slower than the +// normal versions and also just a little bit harder to use. +// +// dr_flac reports metadata to the application through the use of a callback, and every metadata block is reported before +// drflac_open_with_metdata() returns. See https://github.com/mackron/dr_libs_tests/blob/master/dr_flac/dr_flac_test_2.c for +// an example on how to read metadata. +// +// +// +// OPTIONS +// #define these options before including this file. +// +// #define DR_FLAC_NO_STDIO +// Disable drflac_open_file(). +// +// #define DR_FLAC_NO_OGG +// Disables support for Ogg/FLAC streams. +// +// #define DR_FLAC_NO_WIN32_IO +// In the Win32 build, dr_flac uses the Win32 IO APIs for drflac_open_file() by default. This setting will make it use the +// standard FILE APIs instead. Ignored when DR_FLAC_NO_STDIO is #defined. (The rationale for this configuration is that +// there's a bug in one compiler's Win32 implementation of the FILE APIs which is not present in the Win32 IO APIs.) +// +// #define DR_FLAC_BUFFER_SIZE +// Defines the size of the internal buffer to store data from onRead(). This buffer is used to reduce the number of calls +// back to the client for more data. Larger values means more memory, but better performance. My tests show diminishing +// returns after about 4KB (which is the default). Consider reducing this if you have a very efficient implementation of +// onRead(), or increase it if it's very inefficient. Must be a multiple of 8. +// +// +// +// QUICK NOTES +// - Based on my tests, the performance of the 32-bit build is at about parity with the reference implementation. The 64-bit build +// is slightly faster. +// - dr_flac does not currently do any CRC checks. +// - dr_flac should work fine with valid native FLAC files, but for broadcast streams it won't work if the header and STREAMINFO +// block is unavailable. +// - Audio data is output as signed 32-bit PCM, regardless of the bits per sample the FLAC stream is encoded as. +// - This has not been tested on big-endian architectures. +// - Rice codes in unencoded binary form (see https://xiph.org/flac/format.html#rice_partition) has not been tested. If anybody +// knows where I can find some test files for this, let me know. +// - Perverse and erroneous files have not been tested. Again, if you know where I can get some test files let me know. +// - dr_flac is not thread-safe, but it's APIs can be called from any thread so long as you do your own synchronization. + +#ifndef dr_flac_h +#define dr_flac_h + +#include +#include + +#ifndef DR_BOOL_DEFINED +#define DR_BOOL_DEFINED +#ifdef _WIN32 +typedef char drBool8; +typedef int drBool32; +#else +#include +typedef int8_t drBool8; +typedef int32_t drBool32; +#endif +#define DR_TRUE 1 +#define DR_FALSE 0 +#endif + +// As data is read from the client it is placed into an internal buffer for fast access. This controls the +// size of that buffer. Larger values means more speed, but also more memory. In my testing there is diminishing +// returns after about 4KB, but you can fiddle with this to suit your own needs. Must be a multiple of 8. +#ifndef DR_FLAC_BUFFER_SIZE +#define DR_FLAC_BUFFER_SIZE 4096 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// Check if we can enable 64-bit optimizations. +#if defined(_WIN64) +#define DRFLAC_64BIT +#endif + +#if defined(__GNUC__) +#if defined(__x86_64__) || defined(__ppc64__) +#define DRFLAC_64BIT +#endif +#endif + +#ifdef DRFLAC_64BIT +typedef uint64_t drflac_cache_t; +#else +typedef uint32_t drflac_cache_t; +#endif + +// The various metadata block types. +#define DRFLAC_METADATA_BLOCK_TYPE_STREAMINFO 0 +#define DRFLAC_METADATA_BLOCK_TYPE_PADDING 1 +#define DRFLAC_METADATA_BLOCK_TYPE_APPLICATION 2 +#define DRFLAC_METADATA_BLOCK_TYPE_SEEKTABLE 3 +#define DRFLAC_METADATA_BLOCK_TYPE_VORBIS_COMMENT 4 +#define DRFLAC_METADATA_BLOCK_TYPE_CUESHEET 5 +#define DRFLAC_METADATA_BLOCK_TYPE_PICTURE 6 +#define DRFLAC_METADATA_BLOCK_TYPE_INVALID 127 + +// The various picture types specified in the PICTURE block. +#define DRFLAC_PICTURE_TYPE_OTHER 0 +#define DRFLAC_PICTURE_TYPE_FILE_ICON 1 +#define DRFLAC_PICTURE_TYPE_OTHER_FILE_ICON 2 +#define DRFLAC_PICTURE_TYPE_COVER_FRONT 3 +#define DRFLAC_PICTURE_TYPE_COVER_BACK 4 +#define DRFLAC_PICTURE_TYPE_LEAFLET_PAGE 5 +#define DRFLAC_PICTURE_TYPE_MEDIA 6 +#define DRFLAC_PICTURE_TYPE_LEAD_ARTIST 7 +#define DRFLAC_PICTURE_TYPE_ARTIST 8 +#define DRFLAC_PICTURE_TYPE_CONDUCTOR 9 +#define DRFLAC_PICTURE_TYPE_BAND 10 +#define DRFLAC_PICTURE_TYPE_COMPOSER 11 +#define DRFLAC_PICTURE_TYPE_LYRICIST 12 +#define DRFLAC_PICTURE_TYPE_RECORDING_LOCATION 13 +#define DRFLAC_PICTURE_TYPE_DURING_RECORDING 14 +#define DRFLAC_PICTURE_TYPE_DURING_PERFORMANCE 15 +#define DRFLAC_PICTURE_TYPE_SCREEN_CAPTURE 16 +#define DRFLAC_PICTURE_TYPE_BRIGHT_COLORED_FISH 17 +#define DRFLAC_PICTURE_TYPE_ILLUSTRATION 18 +#define DRFLAC_PICTURE_TYPE_BAND_LOGOTYPE 19 +#define DRFLAC_PICTURE_TYPE_PUBLISHER_LOGOTYPE 20 + +typedef enum +{ + drflac_container_native, + drflac_container_ogg +} drflac_container; + +typedef enum +{ + drflac_seek_origin_start, + drflac_seek_origin_current +} drflac_seek_origin; + +// Packing is important on this structure because we map this directly to the raw data within the SEEKTABLE metadata block. +#pragma pack(2) +typedef struct +{ + uint64_t firstSample; + uint64_t frameOffset; // The offset from the first byte of the header of the first frame. + uint16_t sampleCount; +} drflac_seekpoint; +#pragma pack() + +typedef struct +{ + uint16_t minBlockSize; + uint16_t maxBlockSize; + uint32_t minFrameSize; + uint32_t maxFrameSize; + uint32_t sampleRate; + uint8_t channels; + uint8_t bitsPerSample; + uint64_t totalSampleCount; + uint8_t md5[16]; +} drflac_streaminfo; + +typedef struct +{ + // The metadata type. Use this to know how to interpret the data below. + uint32_t type; + + // A pointer to the raw data. This points to a temporary buffer so don't hold on to it. It's best to + // not modify the contents of this buffer. Use the structures below for more meaningful and structured + // information about the metadata. It's possible for this to be null. + const void* pRawData; + + // The size in bytes of the block and the buffer pointed to by pRawData if it's non-NULL. + uint32_t rawDataSize; + + union + { + drflac_streaminfo streaminfo; + + struct + { + int unused; + } padding; + + struct + { + uint32_t id; + const void* pData; + uint32_t dataSize; + } application; + + struct + { + uint32_t seekpointCount; + const drflac_seekpoint* pSeekpoints; + } seektable; + + struct + { + uint32_t vendorLength; + const char* vendor; + uint32_t commentCount; + const char* comments; + } vorbis_comment; + + struct + { + char catalog[128]; + uint64_t leadInSampleCount; + drBool32 isCD; + uint8_t trackCount; + const uint8_t* pTrackData; + } cuesheet; + + struct + { + uint32_t type; + uint32_t mimeLength; + const char* mime; + uint32_t descriptionLength; + const char* description; + uint32_t width; + uint32_t height; + uint32_t colorDepth; + uint32_t indexColorCount; + uint32_t pictureDataSize; + const uint8_t* pPictureData; + } picture; + } data; + +} drflac_metadata; + + +// Callback for when data needs to be read from the client. +// +// pUserData [in] The user data that was passed to drflac_open() and family. +// pBufferOut [out] The output buffer. +// bytesToRead [in] The number of bytes to read. +// +// Returns the number of bytes actually read. +typedef size_t (* drflac_read_proc)(void* pUserData, void* pBufferOut, size_t bytesToRead); + +// Callback for when data needs to be seeked. +// +// pUserData [in] The user data that was passed to drflac_open() and family. +// offset [in] The number of bytes to move, relative to the origin. Will never be negative. +// origin [in] The origin of the seek - the current position or the start of the stream. +// +// Returns whether or not the seek was successful. +// +// The offset will never be negative. Whether or not it is relative to the beginning or current position is determined +// by the "origin" parameter which will be either drflac_seek_origin_start or drflac_seek_origin_current. +typedef drBool32 (* drflac_seek_proc)(void* pUserData, int offset, drflac_seek_origin origin); + +// Callback for when a metadata block is read. +// +// pUserData [in] The user data that was passed to drflac_open() and family. +// pMetadata [in] A pointer to a structure containing the data of the metadata block. +// +// Use pMetadata->type to determine which metadata block is being handled and how to read the data. +typedef void (* drflac_meta_proc)(void* pUserData, drflac_metadata* pMetadata); + + +// Structure for internal use. Only used for decoders opened with drflac_open_memory. +typedef struct +{ + const uint8_t* data; + size_t dataSize; + size_t currentReadPos; +} drflac__memory_stream; + +// Structure for internal use. Used for bit streaming. +typedef struct +{ + // The function to call when more data needs to be read. + drflac_read_proc onRead; + + // The function to call when the current read position needs to be moved. + drflac_seek_proc onSeek; + + // The user data to pass around to onRead and onSeek. + void* pUserData; + + + // The number of unaligned bytes in the L2 cache. This will always be 0 until the end of the stream is hit. At the end of the + // stream there will be a number of bytes that don't cleanly fit in an L1 cache line, so we use this variable to know whether + // or not the bistreamer needs to run on a slower path to read those last bytes. This will never be more than sizeof(drflac_cache_t). + size_t unalignedByteCount; + + // The content of the unaligned bytes. + drflac_cache_t unalignedCache; + + // The index of the next valid cache line in the "L2" cache. + size_t nextL2Line; + + // The number of bits that have been consumed by the cache. This is used to determine how many valid bits are remaining. + size_t consumedBits; + + // The cached data which was most recently read from the client. There are two levels of cache. Data flows as such: + // Client -> L2 -> L1. The L2 -> L1 movement is aligned and runs on a fast path in just a few instructions. + drflac_cache_t cacheL2[DR_FLAC_BUFFER_SIZE/sizeof(drflac_cache_t)]; + drflac_cache_t cache; + +} drflac_bs; + +typedef struct +{ + // The type of the subframe: SUBFRAME_CONSTANT, SUBFRAME_VERBATIM, SUBFRAME_FIXED or SUBFRAME_LPC. + uint8_t subframeType; + + // The number of wasted bits per sample as specified by the sub-frame header. + uint8_t wastedBitsPerSample; + + // The order to use for the prediction stage for SUBFRAME_FIXED and SUBFRAME_LPC. + uint8_t lpcOrder; + + // The number of bits per sample for this subframe. This is not always equal to the current frame's bit per sample because + // an extra bit is required for side channels when interchannel decorrelation is being used. + uint32_t bitsPerSample; + + // A pointer to the buffer containing the decoded samples in the subframe. This pointer is an offset from drflac::pExtraData, or + // NULL if the heap is not being used. Note that it's a signed 32-bit integer for each value. + int32_t* pDecodedSamples; + +} drflac_subframe; + +typedef struct +{ + // If the stream uses variable block sizes, this will be set to the index of the first sample. If fixed block sizes are used, this will + // always be set to 0. + uint64_t sampleNumber; + + // If the stream uses fixed block sizes, this will be set to the frame number. If variable block sizes are used, this will always be 0. + uint32_t frameNumber; + + // The sample rate of this frame. + uint32_t sampleRate; + + // The number of samples in each sub-frame within this frame. + uint16_t blockSize; + + // The channel assignment of this frame. This is not always set to the channel count. If interchannel decorrelation is being used this + // will be set to DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE, DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE or DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE. + uint8_t channelAssignment; + + // The number of bits per sample within this frame. + uint8_t bitsPerSample; + + // The frame's CRC. This is set, but unused at the moment. + uint8_t crc8; + +} drflac_frame_header; + +typedef struct +{ + // The header. + drflac_frame_header header; + + // The number of samples left to be read in this frame. This is initially set to the block size multiplied by the channel count. As samples + // are read, this will be decremented. When it reaches 0, the decoder will see this frame as fully consumed and load the next frame. + uint32_t samplesRemaining; + + // The list of sub-frames within the frame. There is one sub-frame for each channel, and there's a maximum of 8 channels. + drflac_subframe subframes[8]; + +} drflac_frame; + +typedef struct +{ + // The function to call when a metadata block is read. + drflac_meta_proc onMeta; + + // The user data posted to the metadata callback function. + void* pUserDataMD; + + + // The sample rate. Will be set to something like 44100. + uint32_t sampleRate; + + // The number of channels. This will be set to 1 for monaural streams, 2 for stereo, etc. Maximum 8. This is set based on the + // value specified in the STREAMINFO block. + uint8_t channels; + + // The bits per sample. Will be set to somthing like 16, 24, etc. + uint8_t bitsPerSample; + + // The maximum block size, in samples. This number represents the number of samples in each channel (not combined). + uint16_t maxBlockSize; + + // The total number of samples making up the stream. This includes every channel. For example, if the stream has 2 channels, + // with each channel having a total of 4096, this value will be set to 2*4096 = 8192. Can be 0 in which case it's still a + // valid stream, but just means the total sample count is unknown. Likely the case with streams like internet radio. + uint64_t totalSampleCount; + + + // The container type. This is set based on whether or not the decoder was opened from a native or Ogg stream. + drflac_container container; + + + // The position of the seektable in the file. + uint64_t seektablePos; + + // The size of the seektable. + uint32_t seektableSize; + + + // Information about the frame the decoder is currently sitting on. + drflac_frame currentFrame; + + // The position of the first frame in the stream. This is only ever used for seeking. + uint64_t firstFramePos; + + + // A hack to avoid a malloc() when opening a decoder with drflac_open_memory(). + drflac__memory_stream memoryStream; + + + + // A pointer to the decoded sample data. This is an offset of pExtraData. + int32_t* pDecodedSamples; + + + // The bit streamer. The raw FLAC data is fed through this object. + drflac_bs bs; + + // Variable length extra data. We attach this to the end of the object so we avoid unnecessary mallocs. + uint8_t pExtraData[1]; + +} drflac; + + +// Opens a FLAC decoder. +// +// onRead [in] The function to call when data needs to be read from the client. +// onSeek [in] The function to call when the read position of the client data needs to move. +// pUserData [in, optional] A pointer to application defined data that will be passed to onRead and onSeek. +// +// Returns a pointer to an object representing the decoder. +// +// Close the decoder with drflac_close(). +// +// This function will automatically detect whether or not you are attempting to open a native or Ogg encapsulated +// FLAC, both of which should work seamlessly without any manual intervention. Ogg encapsulation also works with +// multiplexed streams which basically means it can play FLAC encoded audio tracks in videos. +// +// This is the lowest level function for opening a FLAC stream. You can also use drflac_open_file() and drflac_open_memory() +// to open the stream from a file or from a block of memory respectively. +// +// The STREAMINFO block must be present for this to succeed. +// +// See also: drflac_open_file(), drflac_open_memory(), drflac_open_with_metadata(), drflac_close() +drflac* drflac_open(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData); + +// Opens a FLAC decoder and notifies the caller of the metadata chunks (album art, etc.). +// +// onRead [in] The function to call when data needs to be read from the client. +// onSeek [in] The function to call when the read position of the client data needs to move. +// onMeta [in] The function to call for every metadata block. +// pUserData [in, optional] A pointer to application defined data that will be passed to onRead, onSeek and onMeta. +// +// Returns a pointer to an object representing the decoder. +// +// Close the decoder with drflac_close(). +// +// This is slower than drflac_open(), so avoid this one if you don't need metadata. Internally, this will do a malloc() +// and free() for every metadata block except for STREAMINFO and PADDING blocks. +// +// The caller is notified of the metadata via the onMeta callback. All metadata blocks with be handled before the function +// returns. +// +// See also: drflac_open_file_with_metadata(), drflac_open_memory_with_metadata(), drflac_open(), drflac_close() +drflac* drflac_open_with_metadata(drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData); + +// Closes the given FLAC decoder. +// +// pFlac [in] The decoder to close. +// +// This will destroy the decoder object. +void drflac_close(drflac* pFlac); + + +// Reads sample data from the given FLAC decoder, output as interleaved signed 32-bit PCM. +// +// pFlac [in] The decoder. +// samplesToRead [in] The number of samples to read. +// pBufferOut [out, optional] A pointer to the buffer that will receive the decoded samples. +// +// Returns the number of samples actually read. +// +// pBufferOut can be null, in which case the call will act as a seek, and the return value will be the number of samples +// seeked. +uint64_t drflac_read_s32(drflac* pFlac, uint64_t samplesToRead, int32_t* pBufferOut); + +// Seeks to the sample at the given index. +// +// pFlac [in] The decoder. +// sampleIndex [in] The index of the sample to seek to. See notes below. +// +// Returns DR_TRUE if successful; DR_FALSE otherwise. +// +// The sample index is based on interleaving. In a stereo stream, for example, the sample at index 0 is the first sample +// in the left channel; the sample at index 1 is the first sample on the right channel, and so on. +// +// When seeking, you will likely want to ensure it's rounded to a multiple of the channel count. You can do this with +// something like drflac_seek_to_sample(pFlac, (mySampleIndex + (mySampleIndex % pFlac->channels))) +drBool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex); + + + +#ifndef DR_FLAC_NO_STDIO +// Opens a FLAC decoder from the file at the given path. +// +// filename [in] The path of the file to open, either absolute or relative to the current directory. +// +// Returns a pointer to an object representing the decoder. +// +// Close the decoder with drflac_close(). +// +// This will hold a handle to the file until the decoder is closed with drflac_close(). Some platforms will restrict the +// number of files a process can have open at any given time, so keep this mind if you have many decoders open at the +// same time. +// +// See also: drflac_open(), drflac_open_file_with_metadata(), drflac_close() +drflac* drflac_open_file(const char* filename); + +// Opens a FLAC decoder from the file at the given path and notifies the caller of the metadata chunks (album art, etc.) +// +// Look at the documentation for drflac_open_with_metadata() for more information on how metadata is handled. +drflac* drflac_open_file_with_metadata(const char* filename, drflac_meta_proc onMeta, void* pUserData); +#endif + +// Opens a FLAC decoder from a pre-allocated block of memory +// +// This does not create a copy of the data. It is up to the application to ensure the buffer remains valid for +// the lifetime of the decoder. +drflac* drflac_open_memory(const void* data, size_t dataSize); + +// Opens a FLAC decoder from a pre-allocated block of memory and notifies the caller of the metadata chunks (album art, etc.) +// +// Look at the documentation for drflac_open_with_metadata() for more information on how metadata is handled. +drflac* drflac_open_memory_with_metadata(const void* data, size_t dataSize, drflac_meta_proc onMeta, void* pUserData); + + + +//// High Level APIs //// + +// Opens a FLAC stream from the given callbacks and fully decodes it in a single operation. The return value is a +// pointer to the sample data as interleaved signed 32-bit PCM. The returned data must be freed with drflac_free(). +// +// Sometimes a FLAC file won't keep track of the total sample count. In this situation the function will continuously +// read samples into a dynamically sized buffer on the heap until no samples are left. +// +// Do not call this function on a broadcast type of stream (like internet radio streams and whatnot). +int32_t* drflac_open_and_decode_s32(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); + +#ifndef DR_FLAC_NO_STDIO +// Same as drflac_open_and_decode_s32() except opens the decoder from a file. +int32_t* drflac_open_and_decode_file_s32(const char* filename, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); +#endif + +// Same as drflac_open_and_decode_s32() except opens the decoder from a block of memory. +int32_t* drflac_open_and_decode_memory_s32(const void* data, size_t dataSize, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); + +// Frees data returned by drflac_open_and_decode_*(). +void drflac_free(void* pSampleDataReturnedByOpenAndDecode); + + +// Structure representing an iterator for vorbis comments in a VORBIS_COMMENT metadata block. +typedef struct +{ + uint32_t countRemaining; + const char* pRunningData; +} drflac_vorbis_comment_iterator; + +// Initializes a vorbis comment iterator. This can be used for iterating over the vorbis comments in a VORBIS_COMMENT +// metadata block. +void drflac_init_vorbis_comment_iterator(drflac_vorbis_comment_iterator* pIter, uint32_t commentCount, const char* pComments); + +// Goes to the next vorbis comment in the given iterator. If null is returned it means there are no more comments. The +// returned string is NOT null terminated. +const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, uint32_t* pCommentLengthOut); + + + +#ifdef __cplusplus +} +#endif +#endif //dr_flac_h + + +/////////////////////////////////////////////////////////////////////////////// +// +// IMPLEMENTATION +// +/////////////////////////////////////////////////////////////////////////////// +#ifdef DR_FLAC_IMPLEMENTATION +#include +#include +#include + +#ifdef _MSC_VER +#include // For _byteswap_ulong and _byteswap_uint64 +#endif + +#ifdef __linux__ +#define _BSD_SOURCE +#include +#endif + +#ifdef _MSC_VER +#define DRFLAC_INLINE __forceinline +#else +#define DRFLAC_INLINE inline +#endif + +#define DRFLAC_SUBFRAME_CONSTANT 0 +#define DRFLAC_SUBFRAME_VERBATIM 1 +#define DRFLAC_SUBFRAME_FIXED 8 +#define DRFLAC_SUBFRAME_LPC 32 +#define DRFLAC_SUBFRAME_RESERVED 255 + +#define DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE 0 +#define DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE2 1 + +#define DRFLAC_CHANNEL_ASSIGNMENT_INDEPENDENT 0 +#define DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE 8 +#define DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE 9 +#define DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE 10 + + +//// Endian Management //// +static DRFLAC_INLINE drBool32 drflac__is_little_endian() +{ + int n = 1; + return (*(char*)&n) == 1; +} + +static DRFLAC_INLINE uint16_t drflac__swap_endian_uint16(uint16_t n) +{ +#ifdef _MSC_VER + return _byteswap_ushort(n); +#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + return __builtin_bswap16(n); +#else + return ((n & 0xFF00) >> 8) | + ((n & 0x00FF) << 8); +#endif +} + +static DRFLAC_INLINE uint32_t drflac__swap_endian_uint32(uint32_t n) +{ +#ifdef _MSC_VER + return _byteswap_ulong(n); +#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + return __builtin_bswap32(n); +#else + return ((n & 0xFF000000) >> 24) | + ((n & 0x00FF0000) >> 8) | + ((n & 0x0000FF00) << 8) | + ((n & 0x000000FF) << 24); +#endif +} + +static DRFLAC_INLINE uint64_t drflac__swap_endian_uint64(uint64_t n) +{ +#ifdef _MSC_VER + return _byteswap_uint64(n); +#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + return __builtin_bswap64(n); +#else + return ((n & 0xFF00000000000000ULL) >> 56) | + ((n & 0x00FF000000000000ULL) >> 40) | + ((n & 0x0000FF0000000000ULL) >> 24) | + ((n & 0x000000FF00000000ULL) >> 8) | + ((n & 0x00000000FF000000ULL) << 8) | + ((n & 0x0000000000FF0000ULL) << 24) | + ((n & 0x000000000000FF00ULL) << 40) | + ((n & 0x00000000000000FFULL) << 56); +#endif +} + +static DRFLAC_INLINE uint16_t drflac__be2host_16(uint16_t n) +{ +#ifdef __linux__ + return be16toh(n); +#else + if (drflac__is_little_endian()) { + return drflac__swap_endian_uint16(n); + } + + return n; +#endif +} + +static DRFLAC_INLINE uint32_t drflac__be2host_32(uint32_t n) +{ +#ifdef __linux__ + return be32toh(n); +#else + if (drflac__is_little_endian()) { + return drflac__swap_endian_uint32(n); + } + + return n; +#endif +} + +static DRFLAC_INLINE uint64_t drflac__be2host_64(uint64_t n) +{ +#ifdef __linux__ + return be64toh(n); +#else + if (drflac__is_little_endian()) { + return drflac__swap_endian_uint64(n); + } + + return n; +#endif +} + + +static DRFLAC_INLINE uint32_t drflac__le2host_32(uint32_t n) +{ +#ifdef __linux__ + return le32toh(n); +#else + if (!drflac__is_little_endian()) { + return drflac__swap_endian_uint32(n); + } + + return n; +#endif +} + + +#ifdef DRFLAC_64BIT +#define drflac__be2host__cache_line drflac__be2host_64 +#else +#define drflac__be2host__cache_line drflac__be2host_32 +#endif + + +// BIT READING ATTEMPT #2 +// +// This uses a 32- or 64-bit bit-shifted cache - as bits are read, the cache is shifted such that the first valid bit is sitting +// on the most significant bit. It uses the notion of an L1 and L2 cache (borrowed from CPU architecture), where the L1 cache +// is a 32- or 64-bit unsigned integer (depending on whether or not a 32- or 64-bit build is being compiled) and the L2 is an +// array of "cache lines", with each cache line being the same size as the L1. The L2 is a buffer of about 4KB and is where data +// from onRead() is read into. +#define DRFLAC_CACHE_L1_SIZE_BYTES(bs) (sizeof((bs)->cache)) +#define DRFLAC_CACHE_L1_SIZE_BITS(bs) (sizeof((bs)->cache)*8) +#define DRFLAC_CACHE_L1_BITS_REMAINING(bs) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - ((bs)->consumedBits)) +#ifdef DRFLAC_64BIT +#define DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount) (~(((uint64_t)-1LL) >> (_bitCount))) +#else +#define DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount) (~(((uint32_t)-1) >> (_bitCount))) +#endif +#define DRFLAC_CACHE_L1_SELECTION_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SIZE_BITS(bs) - (_bitCount)) +#define DRFLAC_CACHE_L1_SELECT(bs, _bitCount) (((bs)->cache) & DRFLAC_CACHE_L1_SELECTION_MASK(_bitCount)) +#define DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, _bitCount) (DRFLAC_CACHE_L1_SELECT((bs), _bitCount) >> DRFLAC_CACHE_L1_SELECTION_SHIFT((bs), _bitCount)) +#define DRFLAC_CACHE_L2_SIZE_BYTES(bs) (sizeof((bs)->cacheL2)) +#define DRFLAC_CACHE_L2_LINE_COUNT(bs) (DRFLAC_CACHE_L2_SIZE_BYTES(bs) / sizeof((bs)->cacheL2[0])) +#define DRFLAC_CACHE_L2_LINES_REMAINING(bs) (DRFLAC_CACHE_L2_LINE_COUNT(bs) - (bs)->nextL2Line) + +static DRFLAC_INLINE drBool32 drflac__reload_l1_cache_from_l2(drflac_bs* bs) +{ + // Fast path. Try loading straight from L2. + if (bs->nextL2Line < DRFLAC_CACHE_L2_LINE_COUNT(bs)) { + bs->cache = bs->cacheL2[bs->nextL2Line++]; + return DR_TRUE; + } + + // If we get here it means we've run out of data in the L2 cache. We'll need to fetch more from the client, if there's + // any left. + if (bs->unalignedByteCount > 0) { + return DR_FALSE; // If we have any unaligned bytes it means there's not more aligned bytes left in the client. + } + + size_t bytesRead = bs->onRead(bs->pUserData, bs->cacheL2, DRFLAC_CACHE_L2_SIZE_BYTES(bs)); + + bs->nextL2Line = 0; + if (bytesRead == DRFLAC_CACHE_L2_SIZE_BYTES(bs)) { + bs->cache = bs->cacheL2[bs->nextL2Line++]; + return DR_TRUE; + } + + + // If we get here it means we were unable to retrieve enough data to fill the entire L2 cache. It probably + // means we've just reached the end of the file. We need to move the valid data down to the end of the buffer + // and adjust the index of the next line accordingly. Also keep in mind that the L2 cache must be aligned to + // the size of the L1 so we'll need to seek backwards by any misaligned bytes. + size_t alignedL1LineCount = bytesRead / DRFLAC_CACHE_L1_SIZE_BYTES(bs); + + // We need to keep track of any unaligned bytes for later use. + bs->unalignedByteCount = bytesRead - (alignedL1LineCount * DRFLAC_CACHE_L1_SIZE_BYTES(bs)); + if (bs->unalignedByteCount > 0) { + bs->unalignedCache = bs->cacheL2[alignedL1LineCount]; + } + + if (alignedL1LineCount > 0) + { + size_t offset = DRFLAC_CACHE_L2_LINE_COUNT(bs) - alignedL1LineCount; + for (size_t i = alignedL1LineCount; i > 0; --i) { + bs->cacheL2[i-1 + offset] = bs->cacheL2[i-1]; + } + + bs->nextL2Line = offset; + bs->cache = bs->cacheL2[bs->nextL2Line++]; + return DR_TRUE; + } + else + { + // If we get into this branch it means we weren't able to load any L1-aligned data. + bs->nextL2Line = DRFLAC_CACHE_L2_LINE_COUNT(bs); + return DR_FALSE; + } +} + +static drBool32 drflac__reload_cache(drflac_bs* bs) +{ + // Fast path. Try just moving the next value in the L2 cache to the L1 cache. + if (drflac__reload_l1_cache_from_l2(bs)) { + bs->cache = drflac__be2host__cache_line(bs->cache); + bs->consumedBits = 0; + return DR_TRUE; + } + + // Slow path. + + // If we get here it means we have failed to load the L1 cache from the L2. Likely we've just reached the end of the stream and the last + // few bytes did not meet the alignment requirements for the L2 cache. In this case we need to fall back to a slower path and read the + // data from the unaligned cache. + size_t bytesRead = bs->unalignedByteCount; + if (bytesRead == 0) { + return DR_FALSE; + } + + assert(bytesRead < DRFLAC_CACHE_L1_SIZE_BYTES(bs)); + bs->consumedBits = (DRFLAC_CACHE_L1_SIZE_BYTES(bs) - bytesRead) * 8; + + bs->cache = drflac__be2host__cache_line(bs->unalignedCache); + bs->cache &= DRFLAC_CACHE_L1_SELECTION_MASK(DRFLAC_CACHE_L1_SIZE_BITS(bs) - bs->consumedBits); // <-- Make sure the consumed bits are always set to zero. Other parts of the library depend on this property. + return DR_TRUE; +} + +static void drflac__reset_cache(drflac_bs* bs) +{ + bs->nextL2Line = DRFLAC_CACHE_L2_LINE_COUNT(bs); // <-- This clears the L2 cache. + bs->consumedBits = DRFLAC_CACHE_L1_SIZE_BITS(bs); // <-- This clears the L1 cache. + bs->cache = 0; + bs->unalignedByteCount = 0; // <-- This clears the trailing unaligned bytes. + bs->unalignedCache = 0; +} + +static drBool32 drflac__seek_bits(drflac_bs* bs, size_t bitsToSeek) +{ + if (bitsToSeek <= DRFLAC_CACHE_L1_BITS_REMAINING(bs)) { + bs->consumedBits += bitsToSeek; + bs->cache <<= bitsToSeek; + return DR_TRUE; + } else { + // It straddles the cached data. This function isn't called too frequently so I'm favouring simplicity here. + bitsToSeek -= DRFLAC_CACHE_L1_BITS_REMAINING(bs); + bs->consumedBits += DRFLAC_CACHE_L1_BITS_REMAINING(bs); + bs->cache = 0; + + size_t wholeBytesRemaining = bitsToSeek/8; + if (wholeBytesRemaining > 0) + { + // The next bytes to seek will be located in the L2 cache. The problem is that the L2 cache is not byte aligned, + // but rather DRFLAC_CACHE_L1_SIZE_BYTES aligned (usually 4 or 8). If, for example, the number of bytes to seek is + // 3, we'll need to handle it in a special way. + size_t wholeCacheLinesRemaining = wholeBytesRemaining / DRFLAC_CACHE_L1_SIZE_BYTES(bs); + if (wholeCacheLinesRemaining < DRFLAC_CACHE_L2_LINES_REMAINING(bs)) + { + wholeBytesRemaining -= wholeCacheLinesRemaining * DRFLAC_CACHE_L1_SIZE_BYTES(bs); + bitsToSeek -= wholeCacheLinesRemaining * DRFLAC_CACHE_L1_SIZE_BITS(bs); + bs->nextL2Line += wholeCacheLinesRemaining; + } + else + { + wholeBytesRemaining -= DRFLAC_CACHE_L2_LINES_REMAINING(bs) * DRFLAC_CACHE_L1_SIZE_BYTES(bs); + bitsToSeek -= DRFLAC_CACHE_L2_LINES_REMAINING(bs) * DRFLAC_CACHE_L1_SIZE_BITS(bs); + bs->nextL2Line += DRFLAC_CACHE_L2_LINES_REMAINING(bs); + + if (wholeBytesRemaining > 0) { + bs->onSeek(bs->pUserData, (int)wholeBytesRemaining, drflac_seek_origin_current); + bitsToSeek -= wholeBytesRemaining*8; + } + } + } + + + if (bitsToSeek > 0) { + if (!drflac__reload_cache(bs)) { + return DR_FALSE; + } + + return drflac__seek_bits(bs, bitsToSeek); + } + + return DR_TRUE; + } +} + +static drBool32 drflac__read_uint32(drflac_bs* bs, unsigned int bitCount, uint32_t* pResultOut) +{ + assert(bs != NULL); + assert(pResultOut != NULL); + assert(bitCount > 0); + assert(bitCount <= 32); + + if (bs->consumedBits == DRFLAC_CACHE_L1_SIZE_BITS(bs)) { + if (!drflac__reload_cache(bs)) { + return DR_FALSE; + } + } + + if (bitCount <= DRFLAC_CACHE_L1_BITS_REMAINING(bs)) { + if (bitCount < DRFLAC_CACHE_L1_SIZE_BITS(bs)) { + *pResultOut = DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCount); + bs->consumedBits += bitCount; + bs->cache <<= bitCount; + } else { + *pResultOut = (uint32_t)bs->cache; + bs->consumedBits = DRFLAC_CACHE_L1_SIZE_BITS(bs); + bs->cache = 0; + } + return DR_TRUE; + } else { + // It straddles the cached data. It will never cover more than the next chunk. We just read the number in two parts and combine them. + size_t bitCountHi = DRFLAC_CACHE_L1_BITS_REMAINING(bs); + size_t bitCountLo = bitCount - bitCountHi; + uint32_t resultHi = DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountHi); + + if (!drflac__reload_cache(bs)) { + return DR_FALSE; + } + + *pResultOut = (resultHi << bitCountLo) | DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountLo); + bs->consumedBits += bitCountLo; + bs->cache <<= bitCountLo; + return DR_TRUE; + } +} + +static drBool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, int32_t* pResult) +{ + assert(bs != NULL); + assert(pResult != NULL); + assert(bitCount > 0); + assert(bitCount <= 32); + + uint32_t result; + if (!drflac__read_uint32(bs, bitCount, &result)) { + return DR_FALSE; + } + + uint32_t signbit = ((result >> (bitCount-1)) & 0x01); + result |= (~signbit + 1) << bitCount; + + *pResult = (int32_t)result; + return DR_TRUE; +} + +static drBool32 drflac__read_uint64(drflac_bs* bs, unsigned int bitCount, uint64_t* pResultOut) +{ + assert(bitCount <= 64); + assert(bitCount > 32); + + uint32_t resultHi; + if (!drflac__read_uint32(bs, bitCount - 32, &resultHi)) { + return DR_FALSE; + } + + uint32_t resultLo; + if (!drflac__read_uint32(bs, 32, &resultLo)) { + return DR_FALSE; + } + + *pResultOut = (((uint64_t)resultHi) << 32) | ((uint64_t)resultLo); + return DR_TRUE; +} + +// Function below is unused, but leaving it here in case I need to quickly add it again. +#if 0 +static drBool32 drflac__read_int64(drflac_bs* bs, unsigned int bitCount, int64_t* pResultOut) +{ + assert(bitCount <= 64); + + uint64_t result; + if (!drflac__read_uint64(bs, bitCount, &result)) { + return DR_FALSE; + } + + uint64_t signbit = ((result >> (bitCount-1)) & 0x01); + result |= (~signbit + 1) << bitCount; + + *pResultOut = (int64_t)result; + return DR_TRUE; +} +#endif + +static drBool32 drflac__read_uint16(drflac_bs* bs, unsigned int bitCount, uint16_t* pResult) +{ + assert(bs != NULL); + assert(pResult != NULL); + assert(bitCount > 0); + assert(bitCount <= 16); + + uint32_t result; + if (!drflac__read_uint32(bs, bitCount, &result)) { + return DR_FALSE; + } + + *pResult = (uint16_t)result; + return DR_TRUE; +} + +static drBool32 drflac__read_int16(drflac_bs* bs, unsigned int bitCount, int16_t* pResult) +{ + assert(bs != NULL); + assert(pResult != NULL); + assert(bitCount > 0); + assert(bitCount <= 16); + + int32_t result; + if (!drflac__read_int32(bs, bitCount, &result)) { + return DR_FALSE; + } + + *pResult = (int16_t)result; + return DR_TRUE; +} + +static drBool32 drflac__read_uint8(drflac_bs* bs, unsigned int bitCount, uint8_t* pResult) +{ + assert(bs != NULL); + assert(pResult != NULL); + assert(bitCount > 0); + assert(bitCount <= 8); + + uint32_t result; + if (!drflac__read_uint32(bs, bitCount, &result)) { + return DR_FALSE; + } + + *pResult = (uint8_t)result; + return DR_TRUE; +} + +static drBool32 drflac__read_int8(drflac_bs* bs, unsigned int bitCount, int8_t* pResult) +{ + assert(bs != NULL); + assert(pResult != NULL); + assert(bitCount > 0); + assert(bitCount <= 8); + + int32_t result; + if (!drflac__read_int32(bs, bitCount, &result)) { + return DR_FALSE; + } + + *pResult = (int8_t)result; + return DR_TRUE; +} + + +static inline drBool32 drflac__seek_past_next_set_bit(drflac_bs* bs, unsigned int* pOffsetOut) +{ + unsigned int zeroCounter = 0; + while (bs->cache == 0) { + zeroCounter += (unsigned int)DRFLAC_CACHE_L1_BITS_REMAINING(bs); + if (!drflac__reload_cache(bs)) { + return DR_FALSE; + } + } + + // At this point the cache should not be zero, in which case we know the first set bit should be somewhere in here. There is + // no need for us to perform any cache reloading logic here which should make things much faster. + assert(bs->cache != 0); + + unsigned int bitOffsetTable[] = { + 0, + 4, + 3, 3, + 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1 + }; + + unsigned int setBitOffsetPlus1 = bitOffsetTable[DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, 4)]; + if (setBitOffsetPlus1 == 0) { + if (bs->cache == 1) { + setBitOffsetPlus1 = DRFLAC_CACHE_L1_SIZE_BITS(bs); + } else { + setBitOffsetPlus1 = 5; + for (;;) + { + if ((bs->cache & DRFLAC_CACHE_L1_SELECT(bs, setBitOffsetPlus1))) { + break; + } + + setBitOffsetPlus1 += 1; + } + } + } + + bs->consumedBits += setBitOffsetPlus1; + bs->cache <<= setBitOffsetPlus1; + + *pOffsetOut = zeroCounter + setBitOffsetPlus1 - 1; + return DR_TRUE; +} + + + +static drBool32 drflac__seek_to_byte(drflac_bs* bs, uint64_t offsetFromStart) +{ + assert(bs != NULL); + assert(offsetFromStart > 0); + + // Seeking from the start is not quite as trivial as it sounds because the onSeek callback takes a signed 32-bit integer (which + // is intentional because it simplifies the implementation of the onSeek callbacks), however offsetFromStart is unsigned 64-bit. + // To resolve we just need to do an initial seek from the start, and then a series of offset seeks to make up the remainder. + if (offsetFromStart > 0x7FFFFFFF) + { + uint64_t bytesRemaining = offsetFromStart; + if (!bs->onSeek(bs->pUserData, 0x7FFFFFFF, drflac_seek_origin_start)) { + return DR_FALSE; + } + bytesRemaining -= 0x7FFFFFFF; + + + while (bytesRemaining > 0x7FFFFFFF) { + if (!bs->onSeek(bs->pUserData, 0x7FFFFFFF, drflac_seek_origin_current)) { + return DR_FALSE; + } + bytesRemaining -= 0x7FFFFFFF; + } + + + if (bytesRemaining > 0) { + if (!bs->onSeek(bs->pUserData, (int)bytesRemaining, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + } + else + { + if (!bs->onSeek(bs->pUserData, (int)offsetFromStart, drflac_seek_origin_start)) { + return DR_FALSE; + } + } + + + // The cache should be reset to force a reload of fresh data from the client. + drflac__reset_cache(bs); + return DR_TRUE; +} + + +static drBool32 drflac__read_utf8_coded_number(drflac_bs* bs, uint64_t* pNumberOut) +{ + assert(bs != NULL); + assert(pNumberOut != NULL); + + unsigned char utf8[7] = {0}; + if (!drflac__read_uint8(bs, 8, utf8)) { + *pNumberOut = 0; + return DR_FALSE; + } + + if ((utf8[0] & 0x80) == 0) { + *pNumberOut = utf8[0]; + return DR_TRUE; + } + + int byteCount = 1; + if ((utf8[0] & 0xE0) == 0xC0) { + byteCount = 2; + } else if ((utf8[0] & 0xF0) == 0xE0) { + byteCount = 3; + } else if ((utf8[0] & 0xF8) == 0xF0) { + byteCount = 4; + } else if ((utf8[0] & 0xFC) == 0xF8) { + byteCount = 5; + } else if ((utf8[0] & 0xFE) == 0xFC) { + byteCount = 6; + } else if ((utf8[0] & 0xFF) == 0xFE) { + byteCount = 7; + } else { + *pNumberOut = 0; + return DR_FALSE; // Bad UTF-8 encoding. + } + + // Read extra bytes. + assert(byteCount > 1); + + uint64_t result = (uint64_t)(utf8[0] & (0xFF >> (byteCount + 1))); + for (int i = 1; i < byteCount; ++i) { + if (!drflac__read_uint8(bs, 8, utf8 + i)) { + *pNumberOut = 0; + return DR_FALSE; + } + + result = (result << 6) | (utf8[i] & 0x3F); + } + + *pNumberOut = result; + return DR_TRUE; +} + + + +static DRFLAC_INLINE drBool32 drflac__read_and_seek_rice(drflac_bs* bs, uint8_t m) +{ + unsigned int unused; + if (!drflac__seek_past_next_set_bit(bs, &unused)) { + return DR_FALSE; + } + + if (m > 0) { + if (!drflac__seek_bits(bs, m)) { + return DR_FALSE; + } + } + + return DR_TRUE; +} + + +// The next two functions are responsible for calculating the prediction. +// +// When the bits per sample is >16 we need to use 64-bit integer arithmetic because otherwise we'll run out of precision. It's +// safe to assume this will be slower on 32-bit platforms so we use a more optimal solution when the bits per sample is <=16. +static DRFLAC_INLINE int32_t drflac__calculate_prediction_32(uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pDecodedSamples) +{ + assert(order <= 32); + + // 32-bit version. + + // VC++ optimizes this to a single jmp. I've not yet verified this for other compilers. + int32_t prediction = 0; + + switch (order) + { + case 32: prediction += coefficients[31] * pDecodedSamples[-32]; + case 31: prediction += coefficients[30] * pDecodedSamples[-31]; + case 30: prediction += coefficients[29] * pDecodedSamples[-30]; + case 29: prediction += coefficients[28] * pDecodedSamples[-29]; + case 28: prediction += coefficients[27] * pDecodedSamples[-28]; + case 27: prediction += coefficients[26] * pDecodedSamples[-27]; + case 26: prediction += coefficients[25] * pDecodedSamples[-26]; + case 25: prediction += coefficients[24] * pDecodedSamples[-25]; + case 24: prediction += coefficients[23] * pDecodedSamples[-24]; + case 23: prediction += coefficients[22] * pDecodedSamples[-23]; + case 22: prediction += coefficients[21] * pDecodedSamples[-22]; + case 21: prediction += coefficients[20] * pDecodedSamples[-21]; + case 20: prediction += coefficients[19] * pDecodedSamples[-20]; + case 19: prediction += coefficients[18] * pDecodedSamples[-19]; + case 18: prediction += coefficients[17] * pDecodedSamples[-18]; + case 17: prediction += coefficients[16] * pDecodedSamples[-17]; + case 16: prediction += coefficients[15] * pDecodedSamples[-16]; + case 15: prediction += coefficients[14] * pDecodedSamples[-15]; + case 14: prediction += coefficients[13] * pDecodedSamples[-14]; + case 13: prediction += coefficients[12] * pDecodedSamples[-13]; + case 12: prediction += coefficients[11] * pDecodedSamples[-12]; + case 11: prediction += coefficients[10] * pDecodedSamples[-11]; + case 10: prediction += coefficients[ 9] * pDecodedSamples[-10]; + case 9: prediction += coefficients[ 8] * pDecodedSamples[- 9]; + case 8: prediction += coefficients[ 7] * pDecodedSamples[- 8]; + case 7: prediction += coefficients[ 6] * pDecodedSamples[- 7]; + case 6: prediction += coefficients[ 5] * pDecodedSamples[- 6]; + case 5: prediction += coefficients[ 4] * pDecodedSamples[- 5]; + case 4: prediction += coefficients[ 3] * pDecodedSamples[- 4]; + case 3: prediction += coefficients[ 2] * pDecodedSamples[- 3]; + case 2: prediction += coefficients[ 1] * pDecodedSamples[- 2]; + case 1: prediction += coefficients[ 0] * pDecodedSamples[- 1]; + } + + return (int32_t)(prediction >> shift); +} + +static DRFLAC_INLINE int32_t drflac__calculate_prediction_64(uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pDecodedSamples) +{ + assert(order <= 32); + + // 64-bit version. + + // This method is faster on the 32-bit build when compiling with VC++. See note below. +#ifndef DRFLAC_64BIT + int64_t prediction; + if (order == 8) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + prediction += coefficients[7] * (int64_t)pDecodedSamples[-8]; + } + else if (order == 7) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + } + else if (order == 3) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + } + else if (order == 6) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + } + else if (order == 5) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + } + else if (order == 4) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + } + else if (order == 12) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + prediction += coefficients[7] * (int64_t)pDecodedSamples[-8]; + prediction += coefficients[8] * (int64_t)pDecodedSamples[-9]; + prediction += coefficients[9] * (int64_t)pDecodedSamples[-10]; + prediction += coefficients[10] * (int64_t)pDecodedSamples[-11]; + prediction += coefficients[11] * (int64_t)pDecodedSamples[-12]; + } + else if (order == 2) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + } + else if (order == 1) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + } + else if (order == 10) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + prediction += coefficients[7] * (int64_t)pDecodedSamples[-8]; + prediction += coefficients[8] * (int64_t)pDecodedSamples[-9]; + prediction += coefficients[9] * (int64_t)pDecodedSamples[-10]; + } + else if (order == 9) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + prediction += coefficients[7] * (int64_t)pDecodedSamples[-8]; + prediction += coefficients[8] * (int64_t)pDecodedSamples[-9]; + } + else if (order == 11) + { + prediction = coefficients[0] * (int64_t)pDecodedSamples[-1]; + prediction += coefficients[1] * (int64_t)pDecodedSamples[-2]; + prediction += coefficients[2] * (int64_t)pDecodedSamples[-3]; + prediction += coefficients[3] * (int64_t)pDecodedSamples[-4]; + prediction += coefficients[4] * (int64_t)pDecodedSamples[-5]; + prediction += coefficients[5] * (int64_t)pDecodedSamples[-6]; + prediction += coefficients[6] * (int64_t)pDecodedSamples[-7]; + prediction += coefficients[7] * (int64_t)pDecodedSamples[-8]; + prediction += coefficients[8] * (int64_t)pDecodedSamples[-9]; + prediction += coefficients[9] * (int64_t)pDecodedSamples[-10]; + prediction += coefficients[10] * (int64_t)pDecodedSamples[-11]; + } + else + { + prediction = 0; + for (int j = 0; j < (int)order; ++j) { + prediction += coefficients[j] * (int64_t)pDecodedSamples[-j-1]; + } + } +#endif + + // VC++ optimizes this to a single jmp instruction, but only the 64-bit build. The 32-bit build generates less efficient code for some + // reason. The ugly version above is faster so we'll just switch between the two depending on the target platform. +#ifdef DRFLAC_64BIT + int64_t prediction = 0; + + switch (order) + { + case 32: prediction += coefficients[31] * (int64_t)pDecodedSamples[-32]; + case 31: prediction += coefficients[30] * (int64_t)pDecodedSamples[-31]; + case 30: prediction += coefficients[29] * (int64_t)pDecodedSamples[-30]; + case 29: prediction += coefficients[28] * (int64_t)pDecodedSamples[-29]; + case 28: prediction += coefficients[27] * (int64_t)pDecodedSamples[-28]; + case 27: prediction += coefficients[26] * (int64_t)pDecodedSamples[-27]; + case 26: prediction += coefficients[25] * (int64_t)pDecodedSamples[-26]; + case 25: prediction += coefficients[24] * (int64_t)pDecodedSamples[-25]; + case 24: prediction += coefficients[23] * (int64_t)pDecodedSamples[-24]; + case 23: prediction += coefficients[22] * (int64_t)pDecodedSamples[-23]; + case 22: prediction += coefficients[21] * (int64_t)pDecodedSamples[-22]; + case 21: prediction += coefficients[20] * (int64_t)pDecodedSamples[-21]; + case 20: prediction += coefficients[19] * (int64_t)pDecodedSamples[-20]; + case 19: prediction += coefficients[18] * (int64_t)pDecodedSamples[-19]; + case 18: prediction += coefficients[17] * (int64_t)pDecodedSamples[-18]; + case 17: prediction += coefficients[16] * (int64_t)pDecodedSamples[-17]; + case 16: prediction += coefficients[15] * (int64_t)pDecodedSamples[-16]; + case 15: prediction += coefficients[14] * (int64_t)pDecodedSamples[-15]; + case 14: prediction += coefficients[13] * (int64_t)pDecodedSamples[-14]; + case 13: prediction += coefficients[12] * (int64_t)pDecodedSamples[-13]; + case 12: prediction += coefficients[11] * (int64_t)pDecodedSamples[-12]; + case 11: prediction += coefficients[10] * (int64_t)pDecodedSamples[-11]; + case 10: prediction += coefficients[ 9] * (int64_t)pDecodedSamples[-10]; + case 9: prediction += coefficients[ 8] * (int64_t)pDecodedSamples[- 9]; + case 8: prediction += coefficients[ 7] * (int64_t)pDecodedSamples[- 8]; + case 7: prediction += coefficients[ 6] * (int64_t)pDecodedSamples[- 7]; + case 6: prediction += coefficients[ 5] * (int64_t)pDecodedSamples[- 6]; + case 5: prediction += coefficients[ 4] * (int64_t)pDecodedSamples[- 5]; + case 4: prediction += coefficients[ 3] * (int64_t)pDecodedSamples[- 4]; + case 3: prediction += coefficients[ 2] * (int64_t)pDecodedSamples[- 3]; + case 2: prediction += coefficients[ 1] * (int64_t)pDecodedSamples[- 2]; + case 1: prediction += coefficients[ 0] * (int64_t)pDecodedSamples[- 1]; + } +#endif + + return (int32_t)(prediction >> shift); +} + + +// Reads and decodes a string of residual values as Rice codes. The decoder should be sitting on the first bit of the Rice codes. +// +// This is the most frequently called function in the library. It does both the Rice decoding and the prediction in a single loop +// iteration. The prediction is done at the end, and there's an annoying branch I'd like to avoid so the main function is defined +// as a #define - sue me! +#define DRFLAC__DECODE_SAMPLES_WITH_RESIDULE__RICE__PROC(funcName, predictionFunc) \ +static drBool32 funcName (drflac_bs* bs, uint32_t count, uint8_t riceParam, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) \ +{ \ + assert(bs != NULL); \ + assert(count > 0); \ + assert(pSamplesOut != NULL); \ + \ + static unsigned int bitOffsetTable[] = { \ + 0, \ + 4, \ + 3, 3, \ + 2, 2, 2, 2, \ + 1, 1, 1, 1, 1, 1, 1, 1 \ + }; \ + \ + drflac_cache_t riceParamMask = DRFLAC_CACHE_L1_SELECTION_MASK(riceParam); \ + drflac_cache_t resultHiShift = DRFLAC_CACHE_L1_SIZE_BITS(bs) - riceParam; \ + \ + for (int i = 0; i < (int)count; ++i) \ + { \ + unsigned int zeroCounter = 0; \ + while (bs->cache == 0) { \ + zeroCounter += (unsigned int)DRFLAC_CACHE_L1_BITS_REMAINING(bs); \ + if (!drflac__reload_cache(bs)) { \ + return DR_FALSE; \ + } \ + } \ + \ + /* At this point the cache should not be zero, in which case we know the first set bit should be somewhere in here. There is \ + no need for us to perform any cache reloading logic here which should make things much faster. */ \ + assert(bs->cache != 0); \ + unsigned int decodedRice; \ + \ + unsigned int setBitOffsetPlus1 = bitOffsetTable[DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, 4)]; \ + if (setBitOffsetPlus1 > 0) { \ + decodedRice = (zeroCounter + (setBitOffsetPlus1-1)) << riceParam; \ + } else { \ + if (bs->cache == 1) { \ + setBitOffsetPlus1 = DRFLAC_CACHE_L1_SIZE_BITS(bs); \ + decodedRice = (zeroCounter + (DRFLAC_CACHE_L1_SIZE_BITS(bs)-1)) << riceParam; \ + } else { \ + setBitOffsetPlus1 = 5; \ + for (;;) \ + { \ + if ((bs->cache & DRFLAC_CACHE_L1_SELECT(bs, setBitOffsetPlus1))) { \ + decodedRice = (zeroCounter + (setBitOffsetPlus1-1)) << riceParam; \ + break; \ + } \ + \ + setBitOffsetPlus1 += 1; \ + } \ + } \ + } \ + \ + \ + unsigned int bitsLo = 0; \ + unsigned int riceLength = setBitOffsetPlus1 + riceParam; \ + if (riceLength < DRFLAC_CACHE_L1_BITS_REMAINING(bs)) \ + { \ + bitsLo = (unsigned int)((bs->cache & (riceParamMask >> setBitOffsetPlus1)) >> (DRFLAC_CACHE_L1_SIZE_BITS(bs) - riceLength)); \ + \ + bs->consumedBits += riceLength; \ + bs->cache <<= riceLength; \ + } \ + else \ + { \ + bs->consumedBits += riceLength; \ + bs->cache <<= setBitOffsetPlus1; \ + \ + /* It straddles the cached data. It will never cover more than the next chunk. We just read the number in two parts and combine them. */ \ + size_t bitCountLo = bs->consumedBits - DRFLAC_CACHE_L1_SIZE_BITS(bs); \ + drflac_cache_t resultHi = bs->cache & riceParamMask; /* <-- This mask is OK because all bits after the first bits are always zero. */ \ + \ + \ + if (bs->nextL2Line < DRFLAC_CACHE_L2_LINE_COUNT(bs)) { \ + bs->cache = drflac__be2host__cache_line(bs->cacheL2[bs->nextL2Line++]); \ + } else { \ + /* Slow path. We need to fetch more data from the client. */ \ + if (!drflac__reload_cache(bs)) { \ + return DR_FALSE; \ + } \ + } \ + \ + bitsLo = (unsigned int)((resultHi >> resultHiShift) | DRFLAC_CACHE_L1_SELECT_AND_SHIFT(bs, bitCountLo)); \ + bs->consumedBits = bitCountLo; \ + bs->cache <<= bitCountLo; \ + } \ + \ + decodedRice |= bitsLo; \ + decodedRice = (decodedRice >> 1) ^ (~(decodedRice & 0x01) + 1); /* <-- Ah, much faster! :) */ \ + /* \ + if ((decodedRice & 0x01)) { \ + decodedRice = ~(decodedRice >> 1); \ + } else { \ + decodedRice = (decodedRice >> 1); \ + } \ + */ \ + \ + /* In order to properly calculate the prediction when the bits per sample is >16 we need to do it using 64-bit arithmetic. We can assume this \ + is probably going to be slower on 32-bit systems so we'll do a more optimized 32-bit version when the bits per sample is low enough.*/ \ + pSamplesOut[i] = ((int)decodedRice + predictionFunc(order, shift, coefficients, pSamplesOut + i)); \ + } \ + \ + return DR_TRUE; \ +} \ + +DRFLAC__DECODE_SAMPLES_WITH_RESIDULE__RICE__PROC(drflac__decode_samples_with_residual__rice_64, drflac__calculate_prediction_64) +DRFLAC__DECODE_SAMPLES_WITH_RESIDULE__RICE__PROC(drflac__decode_samples_with_residual__rice_32, drflac__calculate_prediction_32) + + +// Reads and seeks past a string of residual values as Rice codes. The decoder should be sitting on the first bit of the Rice codes. +static drBool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, uint32_t count, uint8_t riceParam) +{ + assert(bs != NULL); + assert(count > 0); + + for (uint32_t i = 0; i < count; ++i) { + if (!drflac__read_and_seek_rice(bs, riceParam)) { + return DR_FALSE; + } + } + + return DR_TRUE; +} + +static drBool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* bs, uint32_t bitsPerSample, uint32_t count, uint8_t unencodedBitsPerSample, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) +{ + assert(bs != NULL); + assert(count > 0); + assert(unencodedBitsPerSample > 0 && unencodedBitsPerSample <= 32); + assert(pSamplesOut != NULL); + + for (unsigned int i = 0; i < count; ++i) + { + if (!drflac__read_int32(bs, unencodedBitsPerSample, pSamplesOut + i)) { + return DR_FALSE; + } + + if (bitsPerSample > 16) { + pSamplesOut[i] += drflac__calculate_prediction_64(order, shift, coefficients, pSamplesOut + i); + } else { + pSamplesOut[i] += drflac__calculate_prediction_32(order, shift, coefficients, pSamplesOut + i); + } + } + + return DR_TRUE; +} + + +// Reads and decodes the residual for the sub-frame the decoder is currently sitting on. This function should be called +// when the decoder is sitting at the very start of the RESIDUAL block. The first residuals will be ignored. The +// and parameters are used to determine how many residual values need to be decoded. +static drBool32 drflac__decode_samples_with_residual(drflac_bs* bs, uint32_t bitsPerSample, uint32_t blockSize, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pDecodedSamples) +{ + assert(bs != NULL); + assert(blockSize != 0); + assert(pDecodedSamples != NULL); // <-- Should we allow NULL, in which case we just seek past the residual rather than do a full decode? + + uint8_t residualMethod; + if (!drflac__read_uint8(bs, 2, &residualMethod)) { + return DR_FALSE; + } + + if (residualMethod != DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE && residualMethod != DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE2) { + return DR_FALSE; // Unknown or unsupported residual coding method. + } + + // Ignore the first values. + pDecodedSamples += order; + + + uint8_t partitionOrder; + if (!drflac__read_uint8(bs, 4, &partitionOrder)) { + return DR_FALSE; + } + + + uint32_t samplesInPartition = (blockSize / (1 << partitionOrder)) - order; + uint32_t partitionsRemaining = (1 << partitionOrder); + for (;;) + { + uint8_t riceParam = 0; + if (residualMethod == DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE) { + if (!drflac__read_uint8(bs, 4, &riceParam)) { + return DR_FALSE; + } + if (riceParam == 16) { + riceParam = 0xFF; + } + } else if (residualMethod == DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE2) { + if (!drflac__read_uint8(bs, 5, &riceParam)) { + return DR_FALSE; + } + if (riceParam == 32) { + riceParam = 0xFF; + } + } + + if (riceParam != 0xFF) { + if (bitsPerSample > 16) { + if (!drflac__decode_samples_with_residual__rice_64(bs, samplesInPartition, riceParam, order, shift, coefficients, pDecodedSamples)) { + return DR_FALSE; + } + } else { + if (!drflac__decode_samples_with_residual__rice_32(bs, samplesInPartition, riceParam, order, shift, coefficients, pDecodedSamples)) { + return DR_FALSE; + } + } + } else { + unsigned char unencodedBitsPerSample = 0; + if (!drflac__read_uint8(bs, 5, &unencodedBitsPerSample)) { + return DR_FALSE; + } + + if (!drflac__decode_samples_with_residual__unencoded(bs, bitsPerSample, samplesInPartition, unencodedBitsPerSample, order, shift, coefficients, pDecodedSamples)) { + return DR_FALSE; + } + } + + pDecodedSamples += samplesInPartition; + + + if (partitionsRemaining == 1) { + break; + } + + partitionsRemaining -= 1; + samplesInPartition = blockSize / (1 << partitionOrder); + } + + return DR_TRUE; +} + +// Reads and seeks past the residual for the sub-frame the decoder is currently sitting on. This function should be called +// when the decoder is sitting at the very start of the RESIDUAL block. The first residuals will be set to 0. The +// and parameters are used to determine how many residual values need to be decoded. +static drBool32 drflac__read_and_seek_residual(drflac_bs* bs, uint32_t blockSize, uint32_t order) +{ + assert(bs != NULL); + assert(blockSize != 0); + + uint8_t residualMethod; + if (!drflac__read_uint8(bs, 2, &residualMethod)) { + return DR_FALSE; + } + + if (residualMethod != DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE && residualMethod != DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE2) { + return DR_FALSE; // Unknown or unsupported residual coding method. + } + + uint8_t partitionOrder; + if (!drflac__read_uint8(bs, 4, &partitionOrder)) { + return DR_FALSE; + } + + uint32_t samplesInPartition = (blockSize / (1 << partitionOrder)) - order; + uint32_t partitionsRemaining = (1 << partitionOrder); + for (;;) + { + uint8_t riceParam = 0; + if (residualMethod == DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE) { + if (!drflac__read_uint8(bs, 4, &riceParam)) { + return DR_FALSE; + } + if (riceParam == 16) { + riceParam = 0xFF; + } + } else if (residualMethod == DRFLAC_RESIDUAL_CODING_METHOD_PARTITIONED_RICE2) { + if (!drflac__read_uint8(bs, 5, &riceParam)) { + return DR_FALSE; + } + if (riceParam == 32) { + riceParam = 0xFF; + } + } + + if (riceParam != 0xFF) { + if (!drflac__read_and_seek_residual__rice(bs, samplesInPartition, riceParam)) { + return DR_FALSE; + } + } else { + unsigned char unencodedBitsPerSample = 0; + if (!drflac__read_uint8(bs, 5, &unencodedBitsPerSample)) { + return DR_FALSE; + } + + if (!drflac__seek_bits(bs, unencodedBitsPerSample * samplesInPartition)) { + return DR_FALSE; + } + } + + + if (partitionsRemaining == 1) { + break; + } + + partitionsRemaining -= 1; + samplesInPartition = blockSize / (1 << partitionOrder); + } + + return DR_TRUE; +} + + +static drBool32 drflac__decode_samples__constant(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) +{ + // Only a single sample needs to be decoded here. + int32_t sample; + if (!drflac__read_int32(bs, bitsPerSample, &sample)) { + return DR_FALSE; + } + + // We don't really need to expand this, but it does simplify the process of reading samples. If this becomes a performance issue (unlikely) + // we'll want to look at a more efficient way. + for (uint32_t i = 0; i < blockSize; ++i) { + pDecodedSamples[i] = sample; + } + + return DR_TRUE; +} + +static drBool32 drflac__decode_samples__verbatim(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) +{ + for (uint32_t i = 0; i < blockSize; ++i) { + int32_t sample; + if (!drflac__read_int32(bs, bitsPerSample, &sample)) { + return DR_FALSE; + } + + pDecodedSamples[i] = sample; + } + + return DR_TRUE; +} + +static drBool32 drflac__decode_samples__fixed(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) +{ + short lpcCoefficientsTable[5][4] = { + {0, 0, 0, 0}, + {1, 0, 0, 0}, + {2, -1, 0, 0}, + {3, -3, 1, 0}, + {4, -6, 4, -1} + }; + + // Warm up samples and coefficients. + for (uint32_t i = 0; i < lpcOrder; ++i) { + int32_t sample; + if (!drflac__read_int32(bs, bitsPerSample, &sample)) { + return DR_FALSE; + } + + pDecodedSamples[i] = sample; + } + + + if (!drflac__decode_samples_with_residual(bs, bitsPerSample, blockSize, lpcOrder, 0, lpcCoefficientsTable[lpcOrder], pDecodedSamples)) { + return DR_FALSE; + } + + return DR_TRUE; +} + +static drBool32 drflac__decode_samples__lpc(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) +{ + // Warm up samples. + for (uint8_t i = 0; i < lpcOrder; ++i) { + int32_t sample; + if (!drflac__read_int32(bs, bitsPerSample, &sample)) { + return DR_FALSE; + } + + pDecodedSamples[i] = sample; + } + + uint8_t lpcPrecision; + if (!drflac__read_uint8(bs, 4, &lpcPrecision)) { + return DR_FALSE; + } + if (lpcPrecision == 15) { + return DR_FALSE; // Invalid. + } + lpcPrecision += 1; + + + int8_t lpcShift; + if (!drflac__read_int8(bs, 5, &lpcShift)) { + return DR_FALSE; + } + + + int16_t coefficients[32]; + for (uint8_t i = 0; i < lpcOrder; ++i) { + if (!drflac__read_int16(bs, lpcPrecision, coefficients + i)) { + return DR_FALSE; + } + } + + if (!drflac__decode_samples_with_residual(bs, bitsPerSample, blockSize, lpcOrder, lpcShift, coefficients, pDecodedSamples)) { + return DR_FALSE; + } + + return DR_TRUE; +} + + +static drBool32 drflac__read_next_frame_header(drflac_bs* bs, uint8_t streaminfoBitsPerSample, drflac_frame_header* header) +{ + assert(bs != NULL); + assert(header != NULL); + + // At the moment the sync code is as a form of basic validation. The CRC is stored, but is unused at the moment. This + // should probably be handled better in the future. + + const uint32_t sampleRateTable[12] = {0, 88200, 176400, 192000, 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000}; + const uint8_t bitsPerSampleTable[8] = {0, 8, 12, (uint8_t)-1, 16, 20, 24, (uint8_t)-1}; // -1 = reserved. + + uint16_t syncCode = 0; + if (!drflac__read_uint16(bs, 14, &syncCode)) { + return DR_FALSE; + } + + if (syncCode != 0x3FFE) { + // TODO: Try and recover by attempting to seek to and read the next frame? + return DR_FALSE; + } + + uint8_t reserved; + if (!drflac__read_uint8(bs, 1, &reserved)) { + return DR_FALSE; + } + + uint8_t blockingStrategy = 0; + if (!drflac__read_uint8(bs, 1, &blockingStrategy)) { + return DR_FALSE; + } + + + + uint8_t blockSize = 0; + if (!drflac__read_uint8(bs, 4, &blockSize)) { + return DR_FALSE; + } + + uint8_t sampleRate = 0; + if (!drflac__read_uint8(bs, 4, &sampleRate)) { + return DR_FALSE; + } + + uint8_t channelAssignment = 0; + if (!drflac__read_uint8(bs, 4, &channelAssignment)) { + return DR_FALSE; + } + + uint8_t bitsPerSample = 0; + if (!drflac__read_uint8(bs, 3, &bitsPerSample)) { + return DR_FALSE; + } + + if (!drflac__read_uint8(bs, 1, &reserved)) { + return DR_FALSE; + } + + + drBool32 isVariableBlockSize = blockingStrategy == 1; + if (isVariableBlockSize) { + uint64_t sampleNumber; + if (!drflac__read_utf8_coded_number(bs, &sampleNumber)) { + return DR_FALSE; + } + header->frameNumber = 0; + header->sampleNumber = sampleNumber; + } else { + uint64_t frameNumber = 0; + if (!drflac__read_utf8_coded_number(bs, &frameNumber)) { + return DR_FALSE; + } + header->frameNumber = (uint32_t)frameNumber; // <-- Safe cast. + header->sampleNumber = 0; + } + + + if (blockSize == 1) { + header->blockSize = 192; + } else if (blockSize >= 2 && blockSize <= 5) { + header->blockSize = 576 * (1 << (blockSize - 2)); + } else if (blockSize == 6) { + if (!drflac__read_uint16(bs, 8, &header->blockSize)) { + return DR_FALSE; + } + header->blockSize += 1; + } else if (blockSize == 7) { + if (!drflac__read_uint16(bs, 16, &header->blockSize)) { + return DR_FALSE; + } + header->blockSize += 1; + } else { + header->blockSize = 256 * (1 << (blockSize - 8)); + } + + + if (sampleRate <= 11) { + header->sampleRate = sampleRateTable[sampleRate]; + } else if (sampleRate == 12) { + if (!drflac__read_uint32(bs, 8, &header->sampleRate)) { + return DR_FALSE; + } + header->sampleRate *= 1000; + } else if (sampleRate == 13) { + if (!drflac__read_uint32(bs, 16, &header->sampleRate)) { + return DR_FALSE; + } + } else if (sampleRate == 14) { + if (!drflac__read_uint32(bs, 16, &header->sampleRate)) { + return DR_FALSE; + } + header->sampleRate *= 10; + } else { + return DR_FALSE; // Invalid. + } + + + header->channelAssignment = channelAssignment; + + header->bitsPerSample = bitsPerSampleTable[bitsPerSample]; + if (header->bitsPerSample == 0) { + header->bitsPerSample = streaminfoBitsPerSample; + } + + if (drflac__read_uint8(bs, 8, &header->crc8) != 1) { + return DR_FALSE; + } + + return DR_TRUE; +} + +static drBool32 drflac__read_subframe_header(drflac_bs* bs, drflac_subframe* pSubframe) +{ + uint8_t header; + if (!drflac__read_uint8(bs, 8, &header)) { + return DR_FALSE; + } + + // First bit should always be 0. + if ((header & 0x80) != 0) { + return DR_FALSE; + } + + int type = (header & 0x7E) >> 1; + if (type == 0) { + pSubframe->subframeType = DRFLAC_SUBFRAME_CONSTANT; + } else if (type == 1) { + pSubframe->subframeType = DRFLAC_SUBFRAME_VERBATIM; + } else { + if ((type & 0x20) != 0) { + pSubframe->subframeType = DRFLAC_SUBFRAME_LPC; + pSubframe->lpcOrder = (type & 0x1F) + 1; + } else if ((type & 0x08) != 0) { + pSubframe->subframeType = DRFLAC_SUBFRAME_FIXED; + pSubframe->lpcOrder = (type & 0x07); + if (pSubframe->lpcOrder > 4) { + pSubframe->subframeType = DRFLAC_SUBFRAME_RESERVED; + pSubframe->lpcOrder = 0; + } + } else { + pSubframe->subframeType = DRFLAC_SUBFRAME_RESERVED; + } + } + + if (pSubframe->subframeType == DRFLAC_SUBFRAME_RESERVED) { + return DR_FALSE; + } + + // Wasted bits per sample. + pSubframe->wastedBitsPerSample = 0; + if ((header & 0x01) == 1) { + unsigned int wastedBitsPerSample; + if (!drflac__seek_past_next_set_bit(bs, &wastedBitsPerSample)) { + return DR_FALSE; + } + pSubframe->wastedBitsPerSample = (unsigned char)wastedBitsPerSample + 1; + } + + return DR_TRUE; +} + +static drBool32 drflac__decode_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex, int32_t* pDecodedSamplesOut) +{ + assert(bs != NULL); + assert(frame != NULL); + + drflac_subframe* pSubframe = frame->subframes + subframeIndex; + if (!drflac__read_subframe_header(bs, pSubframe)) { + return DR_FALSE; + } + + // Side channels require an extra bit per sample. Took a while to figure that one out... + pSubframe->bitsPerSample = frame->header.bitsPerSample; + if ((frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE || frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE) && subframeIndex == 1) { + pSubframe->bitsPerSample += 1; + } else if (frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE && subframeIndex == 0) { + pSubframe->bitsPerSample += 1; + } + + // Need to handle wasted bits per sample. + pSubframe->bitsPerSample -= pSubframe->wastedBitsPerSample; + pSubframe->pDecodedSamples = pDecodedSamplesOut; + + switch (pSubframe->subframeType) + { + case DRFLAC_SUBFRAME_CONSTANT: + { + drflac__decode_samples__constant(bs, frame->header.blockSize, pSubframe->bitsPerSample, pSubframe->pDecodedSamples); + } break; + + case DRFLAC_SUBFRAME_VERBATIM: + { + drflac__decode_samples__verbatim(bs, frame->header.blockSize, pSubframe->bitsPerSample, pSubframe->pDecodedSamples); + } break; + + case DRFLAC_SUBFRAME_FIXED: + { + drflac__decode_samples__fixed(bs, frame->header.blockSize, pSubframe->bitsPerSample, pSubframe->lpcOrder, pSubframe->pDecodedSamples); + } break; + + case DRFLAC_SUBFRAME_LPC: + { + drflac__decode_samples__lpc(bs, frame->header.blockSize, pSubframe->bitsPerSample, pSubframe->lpcOrder, pSubframe->pDecodedSamples); + } break; + + default: return DR_FALSE; + } + + return DR_TRUE; +} + +static drBool32 drflac__seek_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex) +{ + assert(bs != NULL); + assert(frame != NULL); + + drflac_subframe* pSubframe = frame->subframes + subframeIndex; + if (!drflac__read_subframe_header(bs, pSubframe)) { + return DR_FALSE; + } + + // Side channels require an extra bit per sample. Took a while to figure that one out... + pSubframe->bitsPerSample = frame->header.bitsPerSample; + if ((frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE || frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE) && subframeIndex == 1) { + pSubframe->bitsPerSample += 1; + } else if (frame->header.channelAssignment == DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE && subframeIndex == 0) { + pSubframe->bitsPerSample += 1; + } + + // Need to handle wasted bits per sample. + pSubframe->bitsPerSample -= pSubframe->wastedBitsPerSample; + pSubframe->pDecodedSamples = NULL; + //pSubframe->pDecodedSamples = pFlac->pDecodedSamples + (pFlac->currentFrame.header.blockSize * subframeIndex); + + switch (pSubframe->subframeType) + { + case DRFLAC_SUBFRAME_CONSTANT: + { + if (!drflac__seek_bits(bs, pSubframe->bitsPerSample)) { + return DR_FALSE; + } + } break; + + case DRFLAC_SUBFRAME_VERBATIM: + { + unsigned int bitsToSeek = frame->header.blockSize * pSubframe->bitsPerSample; + if (!drflac__seek_bits(bs, bitsToSeek)) { + return DR_FALSE; + } + } break; + + case DRFLAC_SUBFRAME_FIXED: + { + unsigned int bitsToSeek = pSubframe->lpcOrder * pSubframe->bitsPerSample; + if (!drflac__seek_bits(bs, bitsToSeek)) { + return DR_FALSE; + } + + if (!drflac__read_and_seek_residual(bs, frame->header.blockSize, pSubframe->lpcOrder)) { + return DR_FALSE; + } + } break; + + case DRFLAC_SUBFRAME_LPC: + { + unsigned int bitsToSeek = pSubframe->lpcOrder * pSubframe->bitsPerSample; + if (!drflac__seek_bits(bs, bitsToSeek)) { + return DR_FALSE; + } + + unsigned char lpcPrecision; + if (!drflac__read_uint8(bs, 4, &lpcPrecision)) { + return DR_FALSE; + } + if (lpcPrecision == 15) { + return DR_FALSE; // Invalid. + } + lpcPrecision += 1; + + + bitsToSeek = (pSubframe->lpcOrder * lpcPrecision) + 5; // +5 for shift. + if (!drflac__seek_bits(bs, bitsToSeek)) { + return DR_FALSE; + } + + if (!drflac__read_and_seek_residual(bs, frame->header.blockSize, pSubframe->lpcOrder)) { + return DR_FALSE; + } + } break; + + default: return DR_FALSE; + } + + return DR_TRUE; +} + + +static DRFLAC_INLINE uint8_t drflac__get_channel_count_from_channel_assignment(int8_t channelAssignment) +{ + assert(channelAssignment <= 10); + + uint8_t lookup[] = {1, 2, 3, 4, 5, 6, 7, 8, 2, 2, 2}; + return lookup[channelAssignment]; +} + +static drBool32 drflac__decode_frame(drflac* pFlac) +{ + // This function should be called while the stream is sitting on the first byte after the frame header. + memset(pFlac->currentFrame.subframes, 0, sizeof(pFlac->currentFrame.subframes)); + + int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + for (int i = 0; i < channelCount; ++i) + { + if (!drflac__decode_subframe(&pFlac->bs, &pFlac->currentFrame, i, pFlac->pDecodedSamples + (pFlac->currentFrame.header.blockSize * i))) { + return DR_FALSE; + } + } + + // At the end of the frame sits the padding and CRC. We don't use these so we can just seek past. + if (!drflac__seek_bits(&pFlac->bs, (DRFLAC_CACHE_L1_BITS_REMAINING(&pFlac->bs) & 7) + 16)) { + return DR_FALSE; + } + + + pFlac->currentFrame.samplesRemaining = pFlac->currentFrame.header.blockSize * channelCount; + + return DR_TRUE; +} + +static drBool32 drflac__seek_frame(drflac* pFlac) +{ + int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + for (int i = 0; i < channelCount; ++i) + { + if (!drflac__seek_subframe(&pFlac->bs, &pFlac->currentFrame, i)) { + return DR_FALSE; + } + } + + // Padding and CRC. + return drflac__seek_bits(&pFlac->bs, (DRFLAC_CACHE_L1_BITS_REMAINING(&pFlac->bs) & 7) + 16); +} + +static drBool32 drflac__read_and_decode_next_frame(drflac* pFlac) +{ + assert(pFlac != NULL); + + if (!drflac__read_next_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFrame.header)) { + return DR_FALSE; + } + + return drflac__decode_frame(pFlac); +} + + +static void drflac__get_current_frame_sample_range(drflac* pFlac, uint64_t* pFirstSampleInFrameOut, uint64_t* pLastSampleInFrameOut) +{ + assert(pFlac != NULL); + + unsigned int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + + uint64_t firstSampleInFrame = pFlac->currentFrame.header.sampleNumber; + if (firstSampleInFrame == 0) { + firstSampleInFrame = pFlac->currentFrame.header.frameNumber * pFlac->maxBlockSize*channelCount; + } + + uint64_t lastSampleInFrame = firstSampleInFrame + (pFlac->currentFrame.header.blockSize*channelCount); + if (lastSampleInFrame > 0) { + lastSampleInFrame -= 1; // Needs to be zero based. + } + + + if (pFirstSampleInFrameOut) { + *pFirstSampleInFrameOut = firstSampleInFrame; + } + if (pLastSampleInFrameOut) { + *pLastSampleInFrameOut = lastSampleInFrame; + } +} + +static drBool32 drflac__seek_to_first_frame(drflac* pFlac) +{ + assert(pFlac != NULL); + + drBool32 result = drflac__seek_to_byte(&pFlac->bs, pFlac->firstFramePos); + + memset(&pFlac->currentFrame, 0, sizeof(pFlac->currentFrame)); + return result; +} + +static DRFLAC_INLINE drBool32 drflac__seek_to_next_frame(drflac* pFlac) +{ + // This function should only ever be called while the decoder is sitting on the first byte past the FRAME_HEADER section. + assert(pFlac != NULL); + return drflac__seek_frame(pFlac); +} + +static drBool32 drflac__seek_to_frame_containing_sample(drflac* pFlac, uint64_t sampleIndex) +{ + assert(pFlac != NULL); + + if (!drflac__seek_to_first_frame(pFlac)) { + return DR_FALSE; + } + + uint64_t firstSampleInFrame = 0; + uint64_t lastSampleInFrame = 0; + for (;;) + { + // We need to read the frame's header in order to determine the range of samples it contains. + if (!drflac__read_next_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFrame.header)) { + return DR_FALSE; + } + + drflac__get_current_frame_sample_range(pFlac, &firstSampleInFrame, &lastSampleInFrame); + if (sampleIndex >= firstSampleInFrame && sampleIndex <= lastSampleInFrame) { + break; // The sample is in this frame. + } + + if (!drflac__seek_to_next_frame(pFlac)) { + return DR_FALSE; + } + } + + // If we get here we should be right at the start of the frame containing the sample. + return DR_TRUE; +} + +static drBool32 drflac__seek_to_sample__brute_force(drflac* pFlac, uint64_t sampleIndex) +{ + if (!drflac__seek_to_frame_containing_sample(pFlac, sampleIndex)) { + return DR_FALSE; + } + + // At this point we should be sitting on the first byte of the frame containing the sample. We need to decode every sample up to (but + // not including) the sample we're seeking to. + uint64_t firstSampleInFrame = 0; + drflac__get_current_frame_sample_range(pFlac, &firstSampleInFrame, NULL); + + assert(firstSampleInFrame <= sampleIndex); + size_t samplesToDecode = (size_t)(sampleIndex - firstSampleInFrame); // <-- Safe cast because the maximum number of samples in a frame is 65535. + if (samplesToDecode == 0) { + return DR_TRUE; + } + + // At this point we are just sitting on the byte after the frame header. We need to decode the frame before reading anything from it. + if (!drflac__decode_frame(pFlac)) { + return DR_FALSE; + } + + return drflac_read_s32(pFlac, samplesToDecode, NULL) != 0; +} + + +static drBool32 drflac__seek_to_sample__seek_table(drflac* pFlac, uint64_t sampleIndex) +{ + assert(pFlac != NULL); + + if (pFlac->seektablePos == 0) { + return DR_FALSE; + } + + if (!drflac__seek_to_byte(&pFlac->bs, pFlac->seektablePos)) { + return DR_FALSE; + } + + // The number of seek points is derived from the size of the SEEKTABLE block. + uint32_t seekpointCount = pFlac->seektableSize / 18; // 18 = the size of each seek point. + if (seekpointCount == 0) { + return DR_FALSE; // Would this ever happen? + } + + + drflac_seekpoint closestSeekpoint = {0, 0, 0}; + + uint32_t seekpointsRemaining = seekpointCount; + while (seekpointsRemaining > 0) + { + drflac_seekpoint seekpoint; + if (!drflac__read_uint64(&pFlac->bs, 64, &seekpoint.firstSample)) { + break; + } + if (!drflac__read_uint64(&pFlac->bs, 64, &seekpoint.frameOffset)) { + break; + } + if (!drflac__read_uint16(&pFlac->bs, 16, &seekpoint.sampleCount)) { + break; + } + + if (seekpoint.firstSample * pFlac->channels > sampleIndex) { + break; + } + + closestSeekpoint = seekpoint; + seekpointsRemaining -= 1; + } + + // At this point we should have found the seekpoint closest to our sample. We need to seek to it using basically the same + // technique as we use with the brute force method. + if (!drflac__seek_to_byte(&pFlac->bs, pFlac->firstFramePos + closestSeekpoint.frameOffset)) { + return DR_FALSE; + } + + + uint64_t firstSampleInFrame = 0; + uint64_t lastSampleInFrame = 0; + for (;;) + { + // We need to read the frame's header in order to determine the range of samples it contains. + if (!drflac__read_next_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFrame.header)) { + return DR_FALSE; + } + + drflac__get_current_frame_sample_range(pFlac, &firstSampleInFrame, &lastSampleInFrame); + if (sampleIndex >= firstSampleInFrame && sampleIndex <= lastSampleInFrame) { + break; // The sample is in this frame. + } + + if (!drflac__seek_to_next_frame(pFlac)) { + return DR_FALSE; + } + } + + assert(firstSampleInFrame <= sampleIndex); + + // At this point we are just sitting on the byte after the frame header. We need to decode the frame before reading anything from it. + if (!drflac__decode_frame(pFlac)) { + return DR_FALSE; + } + + size_t samplesToDecode = (size_t)(sampleIndex - firstSampleInFrame); // <-- Safe cast because the maximum number of samples in a frame is 65535. + return drflac_read_s32(pFlac, samplesToDecode, NULL) == samplesToDecode; +} + + +#ifndef DR_FLAC_NO_OGG +typedef struct +{ + uint8_t capturePattern[4]; // Should be "OggS" + uint8_t structureVersion; // Always 0. + uint8_t headerType; + uint64_t granulePosition; + uint32_t serialNumber; + uint32_t sequenceNumber; + uint32_t checksum; + uint8_t segmentCount; + uint8_t segmentTable[255]; +} drflac_ogg_page_header; +#endif + +typedef struct +{ + drflac_read_proc onRead; + drflac_seek_proc onSeek; + drflac_meta_proc onMeta; + void* pUserData; + void* pUserDataMD; + drflac_container container; + uint32_t sampleRate; + uint8_t channels; + uint8_t bitsPerSample; + uint64_t totalSampleCount; + uint16_t maxBlockSize; + uint64_t runningFilePos; + drBool32 hasMetadataBlocks; + +#ifndef DR_FLAC_NO_OGG + uint32_t oggSerial; + uint64_t oggFirstBytePos; + drflac_ogg_page_header oggBosHeader; +#endif +} drflac_init_info; + +static DRFLAC_INLINE void drflac__decode_block_header(uint32_t blockHeader, uint8_t* isLastBlock, uint8_t* blockType, uint32_t* blockSize) +{ + blockHeader = drflac__be2host_32(blockHeader); + *isLastBlock = (blockHeader & (0x01 << 31)) >> 31; + *blockType = (blockHeader & (0x7F << 24)) >> 24; + *blockSize = (blockHeader & 0xFFFFFF); +} + +static DRFLAC_INLINE drBool32 drflac__read_and_decode_block_header(drflac_read_proc onRead, void* pUserData, uint8_t* isLastBlock, uint8_t* blockType, uint32_t* blockSize) +{ + uint32_t blockHeader; + if (onRead(pUserData, &blockHeader, 4) != 4) { + return DR_FALSE; + } + + drflac__decode_block_header(blockHeader, isLastBlock, blockType, blockSize); + return DR_TRUE; +} + +drBool32 drflac__read_streaminfo(drflac_read_proc onRead, void* pUserData, drflac_streaminfo* pStreamInfo) +{ + // min/max block size. + uint32_t blockSizes; + if (onRead(pUserData, &blockSizes, 4) != 4) { + return DR_FALSE; + } + + // min/max frame size. + uint64_t frameSizes = 0; + if (onRead(pUserData, &frameSizes, 6) != 6) { + return DR_FALSE; + } + + // Sample rate, channels, bits per sample and total sample count. + uint64_t importantProps; + if (onRead(pUserData, &importantProps, 8) != 8) { + return DR_FALSE; + } + + // MD5 + uint8_t md5[16]; + if (onRead(pUserData, md5, sizeof(md5)) != sizeof(md5)) { + return DR_FALSE; + } + + blockSizes = drflac__be2host_32(blockSizes); + frameSizes = drflac__be2host_64(frameSizes); + importantProps = drflac__be2host_64(importantProps); + + pStreamInfo->minBlockSize = (blockSizes & 0xFFFF0000) >> 16; + pStreamInfo->maxBlockSize = blockSizes & 0x0000FFFF; + pStreamInfo->minFrameSize = (uint32_t)((frameSizes & 0xFFFFFF0000000000ULL) >> 40ULL); + pStreamInfo->maxFrameSize = (uint32_t)((frameSizes & 0x000000FFFFFF0000ULL) >> 16ULL); + pStreamInfo->sampleRate = (uint32_t)((importantProps & 0xFFFFF00000000000ULL) >> 44ULL); + pStreamInfo->channels = (uint8_t )((importantProps & 0x00000E0000000000ULL) >> 41ULL) + 1; + pStreamInfo->bitsPerSample = (uint8_t )((importantProps & 0x000001F000000000ULL) >> 36ULL) + 1; + pStreamInfo->totalSampleCount = (importantProps & 0x0000000FFFFFFFFFULL) * pStreamInfo->channels; + memcpy(pStreamInfo->md5, md5, sizeof(md5)); + + return DR_TRUE; +} + +drBool32 drflac__read_and_decode_metadata(drflac* pFlac) +{ + assert(pFlac != NULL); + + // We want to keep track of the byte position in the stream of the seektable. At the time of calling this function we know that + // we'll be sitting on byte 42. + uint64_t runningFilePos = 42; + uint64_t seektablePos = 0; + uint32_t seektableSize = 0; + + for (;;) + { + uint8_t isLastBlock = 0; + uint8_t blockType; + uint32_t blockSize; + if (!drflac__read_and_decode_block_header(pFlac->bs.onRead, pFlac->bs.pUserData, &isLastBlock, &blockType, &blockSize)) { + return DR_FALSE; + } + runningFilePos += 4; + + + drflac_metadata metadata; + metadata.type = blockType; + metadata.pRawData = NULL; + metadata.rawDataSize = 0; + + switch (blockType) + { + case DRFLAC_METADATA_BLOCK_TYPE_APPLICATION: + { + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + metadata.data.application.id = drflac__be2host_32(*(uint32_t*)pRawData); + metadata.data.application.pData = (const void*)((uint8_t*)pRawData + sizeof(uint32_t)); + metadata.data.application.dataSize = blockSize - sizeof(uint32_t); + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_SEEKTABLE: + { + seektablePos = runningFilePos; + seektableSize = blockSize; + + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + metadata.data.seektable.seekpointCount = blockSize/sizeof(drflac_seekpoint); + metadata.data.seektable.pSeekpoints = (const drflac_seekpoint*)pRawData; + + // Endian swap. + for (uint32_t iSeekpoint = 0; iSeekpoint < metadata.data.seektable.seekpointCount; ++iSeekpoint) { + drflac_seekpoint* pSeekpoint = (drflac_seekpoint*)pRawData + iSeekpoint; + pSeekpoint->firstSample = drflac__be2host_64(pSeekpoint->firstSample); + pSeekpoint->frameOffset = drflac__be2host_64(pSeekpoint->frameOffset); + pSeekpoint->sampleCount = drflac__be2host_16(pSeekpoint->sampleCount); + } + + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_VORBIS_COMMENT: + { + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + + const char* pRunningData = (const char*)pRawData; + metadata.data.vorbis_comment.vendorLength = drflac__le2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.vorbis_comment.vendor = pRunningData; pRunningData += metadata.data.vorbis_comment.vendorLength; + metadata.data.vorbis_comment.commentCount = drflac__le2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.vorbis_comment.comments = pRunningData; + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_CUESHEET: + { + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + + const char* pRunningData = (const char*)pRawData; + memcpy(metadata.data.cuesheet.catalog, pRunningData, 128); pRunningData += 128; + metadata.data.cuesheet.leadInSampleCount = drflac__be2host_64(*(uint64_t*)pRunningData); pRunningData += 4; + metadata.data.cuesheet.isCD = ((pRunningData[0] & 0x80) >> 7) != 0; pRunningData += 259; + metadata.data.cuesheet.trackCount = pRunningData[0]; pRunningData += 1; + metadata.data.cuesheet.pTrackData = (const uint8_t*)pRunningData; + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_PICTURE: + { + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + + const char* pRunningData = (const char*)pRawData; + metadata.data.picture.type = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.mimeLength = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.mime = pRunningData; pRunningData += metadata.data.picture.mimeLength; + metadata.data.picture.descriptionLength = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.description = pRunningData; + metadata.data.picture.width = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.height = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.colorDepth = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.indexColorCount = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.pictureDataSize = drflac__be2host_32(*(uint32_t*)pRunningData); pRunningData += 4; + metadata.data.picture.pPictureData = (const uint8_t*)pRunningData; + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_PADDING: + { + if (pFlac->onMeta) { + metadata.data.padding.unused = 0; + + // Padding doesn't have anything meaningful in it, so just skip over it. + if (!pFlac->bs.onSeek(pFlac->bs.pUserData, blockSize, drflac_seek_origin_current)) { + return DR_FALSE; + } + + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + } + } break; + + case DRFLAC_METADATA_BLOCK_TYPE_INVALID: + { + // Invalid chunk. Just skip over this one. + if (pFlac->onMeta) { + if (!pFlac->bs.onSeek(pFlac->bs.pUserData, blockSize, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + } + + default: + { + // It's an unknown chunk, but not necessarily invalid. There's a chance more metadata blocks might be defined later on, so we + // can at the very least report the chunk to the application and let it look at the raw data. + if (pFlac->onMeta) { + void* pRawData = malloc(blockSize); + if (pRawData == NULL) { + return DR_FALSE; + } + + if (pFlac->bs.onRead(pFlac->bs.pUserData, pRawData, blockSize) != blockSize) { + free(pRawData); + return DR_FALSE; + } + + metadata.pRawData = pRawData; + metadata.rawDataSize = blockSize; + pFlac->onMeta(pFlac->pUserDataMD, &metadata); + + free(pRawData); + } + } break; + } + + // If we're not handling metadata, just skip over the block. If we are, it will have been handled earlier in the switch statement above. + if (pFlac->onMeta == NULL) { + if (!pFlac->bs.onSeek(pFlac->bs.pUserData, blockSize, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + + runningFilePos += blockSize; + if (isLastBlock) { + break; + } + } + + pFlac->seektablePos = seektablePos; + pFlac->seektableSize = seektableSize; + pFlac->firstFramePos = runningFilePos; + + return DR_TRUE; +} + +drBool32 drflac__init_private__native(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +{ + (void)onSeek; + + // Pre: The bit stream should be sitting just past the 4-byte id header. + + pInit->container = drflac_container_native; + + // The first metadata block should be the STREAMINFO block. + uint8_t isLastBlock; + uint8_t blockType; + uint32_t blockSize; + if (!drflac__read_and_decode_block_header(onRead, pUserData, &isLastBlock, &blockType, &blockSize)) { + return DR_FALSE; + } + + if (blockType != DRFLAC_METADATA_BLOCK_TYPE_STREAMINFO || blockSize != 34) { + return DR_FALSE; // Invalid block type. First block must be the STREAMINFO block. + } + + + drflac_streaminfo streaminfo; + if (!drflac__read_streaminfo(onRead, pUserData, &streaminfo)) { + return DR_FALSE; + } + + pInit->sampleRate = streaminfo.sampleRate; + pInit->channels = streaminfo.channels; + pInit->bitsPerSample = streaminfo.bitsPerSample; + pInit->totalSampleCount = streaminfo.totalSampleCount; + pInit->maxBlockSize = streaminfo.maxBlockSize; // Don't care about the min block size - only the max (used for determining the size of the memory allocation). + + if (onMeta) { + drflac_metadata metadata; + metadata.type = DRFLAC_METADATA_BLOCK_TYPE_STREAMINFO; + metadata.pRawData = NULL; + metadata.rawDataSize = 0; + metadata.data.streaminfo = streaminfo; + onMeta(pUserDataMD, &metadata); + } + + pInit->hasMetadataBlocks = !isLastBlock; + return DR_TRUE; +} + +#ifndef DR_FLAC_NO_OGG +static DRFLAC_INLINE drBool32 drflac_ogg__is_capture_pattern(uint8_t pattern[4]) +{ + return pattern[0] == 'O' && pattern[1] == 'g' && pattern[2] == 'g' && pattern[3] == 'S'; +} + +static DRFLAC_INLINE uint32_t drflac_ogg__get_page_header_size(drflac_ogg_page_header* pHeader) +{ + return 27 + pHeader->segmentCount; +} + +static DRFLAC_INLINE uint32_t drflac_ogg__get_page_body_size(drflac_ogg_page_header* pHeader) +{ + uint32_t pageBodySize = 0; + for (int i = 0; i < pHeader->segmentCount; ++i) { + pageBodySize += pHeader->segmentTable[i]; + } + + return pageBodySize; +} + +drBool32 drflac_ogg__read_page_header_after_capture_pattern(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) +{ + if (onRead(pUserData, &pHeader->structureVersion, 1) != 1 || pHeader->structureVersion != 0) { + return DR_FALSE; // Unknown structure version. Possibly corrupt stream. + } + if (onRead(pUserData, &pHeader->headerType, 1) != 1) { + return DR_FALSE; + } + if (onRead(pUserData, &pHeader->granulePosition, 8) != 8) { + return DR_FALSE; + } + if (onRead(pUserData, &pHeader->serialNumber, 4) != 4) { + return DR_FALSE; + } + if (onRead(pUserData, &pHeader->sequenceNumber, 4) != 4) { + return DR_FALSE; + } + if (onRead(pUserData, &pHeader->checksum, 4) != 4) { + return DR_FALSE; + } + if (onRead(pUserData, &pHeader->segmentCount, 1) != 1 || pHeader->segmentCount == 0) { + return DR_FALSE; // Should not have a segment count of 0. + } + if (onRead(pUserData, &pHeader->segmentTable, pHeader->segmentCount) != pHeader->segmentCount) { + return DR_FALSE; + } + + if (pHeaderSize) *pHeaderSize = (27 + pHeader->segmentCount); + return DR_TRUE; +} + +drBool32 drflac_ogg__read_page_header(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) +{ + uint8_t id[4]; + if (onRead(pUserData, id, 4) != 4) { + return DR_FALSE; + } + + if (id[0] != 'O' || id[1] != 'g' || id[2] != 'g' || id[3] != 'S') { + return DR_FALSE; + } + + return drflac_ogg__read_page_header_after_capture_pattern(onRead, pUserData, pHeader, pHeaderSize); +} + + +// The main part of the Ogg encapsulation is the conversion from the physical Ogg bitstream to the native FLAC bitstream. It works +// in three general stages: Ogg Physical Bitstream -> Ogg/FLAC Logical Bitstream -> FLAC Native Bitstream. dr_flac is architecured +// in such a way that the core sections assume everything is delivered in native format. Therefore, for each encapsulation type +// dr_flac is supporting there needs to be a layer sitting on top of the onRead and onSeek callbacks that ensures the bits read from +// the physical Ogg bitstream are converted and delivered in native FLAC format. +typedef struct +{ + drflac_read_proc onRead; // The original onRead callback from drflac_open() and family. + drflac_seek_proc onSeek; // The original onSeek callback from drflac_open() and family. + void* pUserData; // The user data passed on onRead and onSeek. This is the user data that was passed on drflac_open() and family. + uint64_t currentBytePos; // The position of the byte we are sitting on in the physical byte stream. Used for efficient seeking. + uint64_t firstBytePos; // The position of the first byte in the physical bitstream. Points to the start of the "OggS" identifier of the FLAC bos page. + uint32_t serialNumber; // The serial number of the FLAC audio pages. This is determined by the initial header page that was read during initialization. + drflac_ogg_page_header bosPageHeader; // Used for seeking. + drflac_ogg_page_header currentPageHeader; + uint32_t bytesRemainingInPage; +} drflac_oggbs; // oggbs = Ogg Bitstream + +static size_t drflac_oggbs__read_physical(drflac_oggbs* oggbs, void* bufferOut, size_t bytesToRead) +{ + size_t bytesActuallyRead = oggbs->onRead(oggbs->pUserData, bufferOut, bytesToRead); + oggbs->currentBytePos += bytesActuallyRead; + + return bytesActuallyRead; +} + +static drBool32 drflac_oggbs__seek_physical(drflac_oggbs* oggbs, uint64_t offset, drflac_seek_origin origin) +{ + if (origin == drflac_seek_origin_start) + { + if (offset <= 0x7FFFFFFF) { + if (!oggbs->onSeek(oggbs->pUserData, (int)offset, drflac_seek_origin_start)) { + return DR_FALSE; + } + oggbs->currentBytePos = offset; + + return DR_TRUE; + } else { + if (!oggbs->onSeek(oggbs->pUserData, 0x7FFFFFFF, drflac_seek_origin_start)) { + return DR_FALSE; + } + oggbs->currentBytePos = offset; + + return drflac_oggbs__seek_physical(oggbs, offset - 0x7FFFFFFF, drflac_seek_origin_current); + } + } + else + { + while (offset > 0x7FFFFFFF) { + if (!oggbs->onSeek(oggbs->pUserData, 0x7FFFFFFF, drflac_seek_origin_current)) { + return DR_FALSE; + } + oggbs->currentBytePos += 0x7FFFFFFF; + offset -= 0x7FFFFFFF; + } + + if (!oggbs->onSeek(oggbs->pUserData, (int)offset, drflac_seek_origin_current)) { // <-- Safe cast thanks to the loop above. + return DR_FALSE; + } + oggbs->currentBytePos += offset; + + return DR_TRUE; + } +} + +static drBool32 drflac_oggbs__goto_next_page(drflac_oggbs* oggbs) +{ + drflac_ogg_page_header header; + for (;;) + { + uint32_t headerSize; + if (!drflac_ogg__read_page_header(oggbs->onRead, oggbs->pUserData, &header, &headerSize)) { + return DR_FALSE; + } + oggbs->currentBytePos += headerSize; + + + uint32_t pageBodySize = drflac_ogg__get_page_body_size(&header); + + if (header.serialNumber == oggbs->serialNumber) { + oggbs->currentPageHeader = header; + oggbs->bytesRemainingInPage = pageBodySize; + return DR_TRUE; + } + + // If we get here it means the page is not a FLAC page - skip it. + if (pageBodySize > 0 && !drflac_oggbs__seek_physical(oggbs, pageBodySize, drflac_seek_origin_current)) { // <-- Safe cast - maximum size of a page is way below that of an int. + return DR_FALSE; + } + } +} + +// Function below is unused at the moment, but I might be re-adding it later. +#if 0 +static uint8_t drflac_oggbs__get_current_segment_index(drflac_oggbs* oggbs, uint8_t* pBytesRemainingInSeg) +{ + uint32_t bytesConsumedInPage = drflac_ogg__get_page_body_size(&oggbs->currentPageHeader) - oggbs->bytesRemainingInPage; + uint8_t iSeg = 0; + uint32_t iByte = 0; + while (iByte < bytesConsumedInPage) + { + uint8_t segmentSize = oggbs->currentPageHeader.segmentTable[iSeg]; + if (iByte + segmentSize > bytesConsumedInPage) { + break; + } else { + iSeg += 1; + iByte += segmentSize; + } + } + + *pBytesRemainingInSeg = oggbs->currentPageHeader.segmentTable[iSeg] - (uint8_t)(bytesConsumedInPage - iByte); + return iSeg; +} + +static drBool32 drflac_oggbs__seek_to_next_packet(drflac_oggbs* oggbs) +{ + // The current packet ends when we get to the segment with a lacing value of < 255 which is not at the end of a page. + for (;;) // <-- Loop over pages. + { + drBool32 atEndOfPage = DR_FALSE; + + uint8_t bytesRemainingInSeg; + uint8_t iFirstSeg = drflac_oggbs__get_current_segment_index(oggbs, &bytesRemainingInSeg); + + uint32_t bytesToEndOfPacketOrPage = bytesRemainingInSeg; + for (uint8_t iSeg = iFirstSeg; iSeg < oggbs->currentPageHeader.segmentCount; ++iSeg) { + uint8_t segmentSize = oggbs->currentPageHeader.segmentTable[iSeg]; + if (segmentSize < 255) { + if (iSeg == oggbs->currentPageHeader.segmentCount-1) { + atEndOfPage = DR_TRUE; + } + + break; + } + + bytesToEndOfPacketOrPage += segmentSize; + } + + // At this point we will have found either the packet or the end of the page. If were at the end of the page we'll + // want to load the next page and keep searching for the end of the frame. + drflac_oggbs__seek_physical(oggbs, bytesToEndOfPacketOrPage, drflac_seek_origin_current); + oggbs->bytesRemainingInPage -= bytesToEndOfPacketOrPage; + + if (atEndOfPage) + { + // We're potentially at the next packet, but we need to check the next page first to be sure because the packet may + // straddle pages. + if (!drflac_oggbs__goto_next_page(oggbs)) { + return DR_FALSE; + } + + // If it's a fresh packet it most likely means we're at the next packet. + if ((oggbs->currentPageHeader.headerType & 0x01) == 0) { + return DR_TRUE; + } + } + else + { + // We're at the next frame. + return DR_TRUE; + } + } +} + +static drBool32 drflac_oggbs__seek_to_next_frame(drflac_oggbs* oggbs) +{ + // The bitstream should be sitting on the first byte just after the header of the frame. + + // What we're actually doing here is seeking to the start of the next packet. + return drflac_oggbs__seek_to_next_packet(oggbs); +} +#endif + +static size_t drflac__on_read_ogg(void* pUserData, void* bufferOut, size_t bytesToRead) +{ + drflac_oggbs* oggbs = (drflac_oggbs*)pUserData; + assert(oggbs != NULL); + + uint8_t* pRunningBufferOut = (uint8_t*)bufferOut; + + // Reading is done page-by-page. If we've run out of bytes in the page we need to move to the next one. + size_t bytesRead = 0; + while (bytesRead < bytesToRead) + { + size_t bytesRemainingToRead = bytesToRead - bytesRead; + + if (oggbs->bytesRemainingInPage >= bytesRemainingToRead) { + bytesRead += oggbs->onRead(oggbs->pUserData, pRunningBufferOut, bytesRemainingToRead); + oggbs->bytesRemainingInPage -= (uint32_t)bytesRemainingToRead; + break; + } + + // If we get here it means some of the requested data is contained in the next pages. + if (oggbs->bytesRemainingInPage > 0) { + size_t bytesJustRead = oggbs->onRead(oggbs->pUserData, pRunningBufferOut, oggbs->bytesRemainingInPage); + bytesRead += bytesJustRead; + pRunningBufferOut += bytesJustRead; + + if (bytesJustRead != oggbs->bytesRemainingInPage) { + break; // Ran out of data. + } + } + + assert(bytesRemainingToRead > 0); + if (!drflac_oggbs__goto_next_page(oggbs)) { + break; // Failed to go to the next chunk. Might have simply hit the end of the stream. + } + } + + oggbs->currentBytePos += bytesRead; + return bytesRead; +} + +static drBool32 drflac__on_seek_ogg(void* pUserData, int offset, drflac_seek_origin origin) +{ + drflac_oggbs* oggbs = (drflac_oggbs*)pUserData; + assert(oggbs != NULL); + assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); + + // Seeking is always forward which makes things a lot simpler. + if (origin == drflac_seek_origin_start) { + int startBytePos = (int)oggbs->firstBytePos + (79-42); // 79 = size of bos page; 42 = size of FLAC header data. Seek up to the first byte of the native FLAC data. + if (!drflac_oggbs__seek_physical(oggbs, startBytePos, drflac_seek_origin_start)) { + return DR_FALSE; + } + + oggbs->currentPageHeader = oggbs->bosPageHeader; + oggbs->bytesRemainingInPage = 42; // 42 = size of the native FLAC header data. That's our start point for seeking. + + return drflac__on_seek_ogg(pUserData, offset, drflac_seek_origin_current); + } + + + assert(origin == drflac_seek_origin_current); + + int bytesSeeked = 0; + while (bytesSeeked < offset) + { + int bytesRemainingToSeek = offset - bytesSeeked; + assert(bytesRemainingToSeek >= 0); + + if (oggbs->bytesRemainingInPage >= (size_t)bytesRemainingToSeek) { + if (!drflac_oggbs__seek_physical(oggbs, bytesRemainingToSeek, drflac_seek_origin_current)) { + return DR_FALSE; + } + + bytesSeeked += bytesRemainingToSeek; + oggbs->bytesRemainingInPage -= bytesRemainingToSeek; + break; + } + + // If we get here it means some of the requested data is contained in the next pages. + if (oggbs->bytesRemainingInPage > 0) { + if (!drflac_oggbs__seek_physical(oggbs, oggbs->bytesRemainingInPage, drflac_seek_origin_current)) { + return DR_FALSE; + } + + bytesSeeked += (int)oggbs->bytesRemainingInPage; + } + + assert(bytesRemainingToSeek > 0); + if (!drflac_oggbs__goto_next_page(oggbs)) { + break; // Failed to go to the next chunk. Might have simply hit the end of the stream. + } + } + + return DR_TRUE; +} + +drBool32 drflac_ogg__seek_to_sample(drflac* pFlac, uint64_t sample) +{ + drflac_oggbs* oggbs = (drflac_oggbs*)(((int32_t*)pFlac->pExtraData) + pFlac->maxBlockSize*pFlac->channels); + + uint64_t originalBytePos = oggbs->currentBytePos; // For recovery. + + // First seek to the first frame. + if (!drflac__seek_to_byte(&pFlac->bs, pFlac->firstFramePos)) { + return DR_FALSE; + } + oggbs->bytesRemainingInPage = 0; + + uint64_t runningGranulePosition = 0; + uint64_t runningFrameBytePos = oggbs->currentBytePos; // <-- Points to the OggS identifier. + for (;;) + { + if (!drflac_oggbs__goto_next_page(oggbs)) { + drflac_oggbs__seek_physical(oggbs, originalBytePos, drflac_seek_origin_start); + return DR_FALSE; // Never did find that sample... + } + + runningFrameBytePos = oggbs->currentBytePos - drflac_ogg__get_page_header_size(&oggbs->currentPageHeader); + if (oggbs->currentPageHeader.granulePosition*pFlac->channels >= sample) { + break; // The sample is somewhere in the previous page. + } + + + // At this point we know the sample is not in the previous page. It could possibly be in this page. For simplicity we + // disregard any pages that do not begin a fresh packet. + if ((oggbs->currentPageHeader.headerType & 0x01) == 0) { // <-- Is it a fresh page? + if (oggbs->currentPageHeader.segmentTable[0] >= 2) { + uint8_t firstBytesInPage[2]; + if (drflac_oggbs__read_physical(oggbs, firstBytesInPage, 2) != 2) { + drflac_oggbs__seek_physical(oggbs, originalBytePos, drflac_seek_origin_start); + return DR_FALSE; + } + if ((firstBytesInPage[0] == 0xFF) && (firstBytesInPage[1] & 0xFC) == 0xF8) { // <-- Does the page begin with a frame's sync code? + runningGranulePosition = oggbs->currentPageHeader.granulePosition*pFlac->channels; + } + + if (!drflac_oggbs__seek_physical(oggbs, (int)oggbs->bytesRemainingInPage-2, drflac_seek_origin_current)) { + drflac_oggbs__seek_physical(oggbs, originalBytePos, drflac_seek_origin_start); + return DR_FALSE; + } + + continue; + } + } + + if (!drflac_oggbs__seek_physical(oggbs, (int)oggbs->bytesRemainingInPage, drflac_seek_origin_current)) { + drflac_oggbs__seek_physical(oggbs, originalBytePos, drflac_seek_origin_start); + return DR_FALSE; + } + } + + + // We found the page that that is closest to the sample, so now we need to find it. The first thing to do is seek to the + // start of that page. In the loop above we checked that it was a fresh page which means this page is also the start of + // a new frame. This property means that after we've seeked to the page we can immediately start looping over frames until + // we find the one containing the target sample. + if (!drflac_oggbs__seek_physical(oggbs, runningFrameBytePos, drflac_seek_origin_start)) { + return DR_FALSE; + } + if (!drflac_oggbs__goto_next_page(oggbs)) { + return DR_FALSE; + } + + + // At this point we'll be sitting on the first byte of the frame header of the first frame in the page. We just keep + // looping over these frames until we find the one containing the sample we're after. + uint64_t firstSampleInFrame = runningGranulePosition; + for (;;) + { + // NOTE for later: When using Ogg's page/segment based seeking later on we can't use this function (or any drflac__* + // reading functions) because otherwise it will pull extra data for use in it's own internal caches which will then + // break the positioning of the read pointer for the Ogg bitstream. + if (!drflac__read_next_frame_header(&pFlac->bs, pFlac->bitsPerSample, &pFlac->currentFrame.header)) { + return DR_FALSE; + } + + int channels = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + uint64_t lastSampleInFrame = firstSampleInFrame + (pFlac->currentFrame.header.blockSize*channels); + lastSampleInFrame -= 1; // <-- Zero based. + + if (sample >= firstSampleInFrame && sample <= lastSampleInFrame) { + break; // The sample is in this frame. + } + + + // If we get here it means the sample is not in this frame so we need to move to the next one. Now the cool thing + // with Ogg is that we can efficiently seek past the frame by looking at the lacing values of each segment in + // the page. + firstSampleInFrame = lastSampleInFrame+1; + +#if 1 + // Slow way. This uses the native FLAC decoder to seek past the frame. This is slow because it needs to do a partial + // decode of the frame. Although this is how the native version works, we can use Ogg's framing system to make it + // more efficient. Leaving this here for reference and to use as a basis for debugging purposes. + if (!drflac__seek_to_next_frame(pFlac)) { + return DR_FALSE; + } +#else + // TODO: This is not yet complete. See note at the top of this loop body. + + // Fast(er) way. This uses Ogg's framing system to seek past the frame. This should be much more efficient than the + // native FLAC seeking. + if (!drflac_oggbs__seek_to_next_frame(oggbs)) { + return DR_FALSE; + } +#endif + } + + assert(firstSampleInFrame <= sample); + + if (!drflac__decode_frame(pFlac)) { + return DR_FALSE; + } + + size_t samplesToDecode = (size_t)(sample - firstSampleInFrame); // <-- Safe cast because the maximum number of samples in a frame is 65535. + return drflac_read_s32(pFlac, samplesToDecode, NULL) == samplesToDecode; +} + + +drBool32 drflac__init_private__ogg(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +{ + // Pre: The bit stream should be sitting just past the 4-byte OggS capture pattern. + + pInit->container = drflac_container_ogg; + pInit->oggFirstBytePos = 0; + + // We'll get here if the first 4 bytes of the stream were the OggS capture pattern, however it doesn't necessarily mean the + // stream includes FLAC encoded audio. To check for this we need to scan the beginning-of-stream page markers and check if + // any match the FLAC specification. Important to keep in mind that the stream may be multiplexed. + drflac_ogg_page_header header; + + uint32_t headerSize; + if (!drflac_ogg__read_page_header_after_capture_pattern(onRead, pUserData, &header, &headerSize)) { + return DR_FALSE; + } + pInit->runningFilePos = headerSize; + + for (;;) + { + // Break if we're past the beginning of stream page. + if ((header.headerType & 0x02) == 0) { + return DR_FALSE; + } + + + // Check if it's a FLAC header. + int pageBodySize = drflac_ogg__get_page_body_size(&header); + if (pageBodySize == 51) // 51 = the lacing value of the FLAC header packet. + { + // It could be a FLAC page... + uint32_t bytesRemainingInPage = pageBodySize; + + uint8_t packetType; + if (onRead(pUserData, &packetType, 1) != 1) { + return DR_FALSE; + } + + bytesRemainingInPage -= 1; + if (packetType == 0x7F) + { + // Increasingly more likely to be a FLAC page... + uint8_t sig[4]; + if (onRead(pUserData, sig, 4) != 4) { + return DR_FALSE; + } + + bytesRemainingInPage -= 4; + if (sig[0] == 'F' && sig[1] == 'L' && sig[2] == 'A' && sig[3] == 'C') + { + // Almost certainly a FLAC page... + uint8_t mappingVersion[2]; + if (onRead(pUserData, mappingVersion, 2) != 2) { + return DR_FALSE; + } + + if (mappingVersion[0] != 1) { + return DR_FALSE; // Only supporting version 1.x of the Ogg mapping. + } + + // The next 2 bytes are the non-audio packets, not including this one. We don't care about this because we're going to + // be handling it in a generic way based on the serial number and packet types. + if (!onSeek(pUserData, 2, drflac_seek_origin_current)) { + return DR_FALSE; + } + + // Expecting the native FLAC signature "fLaC". + if (onRead(pUserData, sig, 4) != 4) { + return DR_FALSE; + } + + if (sig[0] == 'f' && sig[1] == 'L' && sig[2] == 'a' && sig[3] == 'C') + { + // The remaining data in the page should be the STREAMINFO block. + uint8_t isLastBlock; + uint8_t blockType; + uint32_t blockSize; + if (!drflac__read_and_decode_block_header(onRead, pUserData, &isLastBlock, &blockType, &blockSize)) { + return DR_FALSE; + } + + if (blockType != DRFLAC_METADATA_BLOCK_TYPE_STREAMINFO || blockSize != 34) { + return DR_FALSE; // Invalid block type. First block must be the STREAMINFO block. + } + + drflac_streaminfo streaminfo; + if (drflac__read_streaminfo(onRead, pUserData, &streaminfo)) + { + // Success! + pInit->sampleRate = streaminfo.sampleRate; + pInit->channels = streaminfo.channels; + pInit->bitsPerSample = streaminfo.bitsPerSample; + pInit->totalSampleCount = streaminfo.totalSampleCount; + pInit->maxBlockSize = streaminfo.maxBlockSize; + + if (onMeta) { + drflac_metadata metadata; + metadata.type = DRFLAC_METADATA_BLOCK_TYPE_STREAMINFO; + metadata.pRawData = NULL; + metadata.rawDataSize = 0; + metadata.data.streaminfo = streaminfo; + onMeta(pUserDataMD, &metadata); + } + + pInit->runningFilePos += pageBodySize; + pInit->oggFirstBytePos = pInit->runningFilePos - 79; // Subtracting 79 will place us right on top of the "OggS" identifier of the FLAC bos page. + pInit->oggSerial = header.serialNumber; + pInit->oggBosHeader = header; + break; + } + else + { + // Failed to read STREAMINFO block. Aww, so close... + return DR_FALSE; + } + } + else + { + // Invalid file. + return DR_FALSE; + } + } + else + { + // Not a FLAC header. Skip it. + if (!onSeek(pUserData, bytesRemainingInPage, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + } + else + { + // Not a FLAC header. Seek past the entire page and move on to the next. + if (!onSeek(pUserData, bytesRemainingInPage, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + } + else + { + if (!onSeek(pUserData, pageBodySize, drflac_seek_origin_current)) { + return DR_FALSE; + } + } + + pInit->runningFilePos += pageBodySize; + + + // Read the header of the next page. + if (!drflac_ogg__read_page_header(onRead, pUserData, &header, &headerSize)) { + return DR_FALSE; + } + pInit->runningFilePos += headerSize; + } + + + // If we get here it means we found a FLAC audio stream. We should be sitting on the first byte of the header of the next page. The next + // packets in the FLAC logical stream contain the metadata. The only thing left to do in the initialiation phase for Ogg is to create the + // Ogg bistream object. + pInit->hasMetadataBlocks = DR_TRUE; // <-- Always have at least VORBIS_COMMENT metadata block. + return DR_TRUE; +} +#endif + +drBool32 drflac__init_private(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +{ + if (pInit == NULL || onRead == NULL || onSeek == NULL) { + return DR_FALSE; + } + + pInit->onRead = onRead; + pInit->onSeek = onSeek; + pInit->onMeta = onMeta; + pInit->pUserData = pUserData; + pInit->pUserDataMD = pUserDataMD; + + uint8_t id[4]; + if (onRead(pUserData, id, 4) != 4) { + return DR_FALSE; + } + + if (id[0] == 'f' && id[1] == 'L' && id[2] == 'a' && id[3] == 'C') { + return drflac__init_private__native(pInit, onRead, onSeek, onMeta, pUserData, pUserDataMD); + } + +#ifndef DR_FLAC_NO_OGG + if (id[0] == 'O' && id[1] == 'g' && id[2] == 'g' && id[3] == 'S') { + return drflac__init_private__ogg(pInit, onRead, onSeek, onMeta, pUserData, pUserDataMD); + } +#endif + + // Unsupported container. + return DR_FALSE; +} + +void drflac__init_from_info(drflac* pFlac, drflac_init_info* pInit) +{ + assert(pFlac != NULL); + assert(pInit != NULL); + + memset(pFlac, 0, sizeof(*pFlac)); + pFlac->bs.onRead = pInit->onRead; + pFlac->bs.onSeek = pInit->onSeek; + pFlac->bs.pUserData = pInit->pUserData; + pFlac->bs.nextL2Line = sizeof(pFlac->bs.cacheL2) / sizeof(pFlac->bs.cacheL2[0]); // <-- Initialize to this to force a client-side data retrieval right from the start. + pFlac->bs.consumedBits = sizeof(pFlac->bs.cache)*8; + + pFlac->onMeta = pInit->onMeta; + pFlac->pUserDataMD = pInit->pUserDataMD; + pFlac->maxBlockSize = pInit->maxBlockSize; + pFlac->sampleRate = pInit->sampleRate; + pFlac->channels = (uint8_t)pInit->channels; + pFlac->bitsPerSample = (uint8_t)pInit->bitsPerSample; + pFlac->totalSampleCount = pInit->totalSampleCount; + pFlac->container = pInit->container; +} + +drflac* drflac_open_with_metadata_private(drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +{ + drflac_init_info init; + if (!drflac__init_private(&init, onRead, onSeek, onMeta, pUserData, pUserDataMD)) { + return NULL; + } + + size_t allocationSize = sizeof(drflac); + allocationSize += init.maxBlockSize * init.channels * sizeof(int32_t); + //allocationSize += init.seektableSize; + + +#ifndef DR_FLAC_NO_OGG + // There's additional data required for Ogg streams. + if (init.container == drflac_container_ogg) { + allocationSize += sizeof(drflac_oggbs); + } +#endif + + drflac* pFlac = (drflac*)malloc(allocationSize); + drflac__init_from_info(pFlac, &init); + pFlac->pDecodedSamples = (int32_t*)pFlac->pExtraData; + +#ifndef DR_FLAC_NO_OGG + if (init.container == drflac_container_ogg) { + drflac_oggbs* oggbs = (drflac_oggbs*)(((int32_t*)pFlac->pExtraData) + init.maxBlockSize*init.channels); + oggbs->onRead = onRead; + oggbs->onSeek = onSeek; + oggbs->pUserData = pUserData; + oggbs->currentBytePos = init.oggFirstBytePos; + oggbs->firstBytePos = init.oggFirstBytePos; + oggbs->serialNumber = init.oggSerial; + oggbs->bosPageHeader = init.oggBosHeader; + oggbs->bytesRemainingInPage = 0; + + // The Ogg bistream needs to be layered on top of the original bitstream. + pFlac->bs.onRead = drflac__on_read_ogg; + pFlac->bs.onSeek = drflac__on_seek_ogg; + pFlac->bs.pUserData = (void*)oggbs; + } +#endif + + // Decode metadata before returning. + if (init.hasMetadataBlocks) { + if (!drflac__read_and_decode_metadata(pFlac)) { + free(pFlac); + return NULL; + } + } + + return pFlac; +} + + + +#ifndef DR_FLAC_NO_STDIO +typedef void* drflac_file; + +#if defined(DR_FLAC_NO_WIN32_IO) || !defined(_WIN32) +#include + +static size_t drflac__on_read_stdio(void* pUserData, void* bufferOut, size_t bytesToRead) +{ + return fread(bufferOut, 1, bytesToRead, (FILE*)pUserData); +} + +static drBool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) +{ + assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); + + return fseek((FILE*)pUserData, offset, (origin == drflac_seek_origin_current) ? SEEK_CUR : SEEK_SET) == 0; +} + +static drflac_file drflac__open_file_handle(const char* filename) +{ + FILE* pFile; +#ifdef _MSC_VER + if (fopen_s(&pFile, filename, "rb") != 0) { + return NULL; + } +#else + pFile = fopen(filename, "rb"); + if (pFile == NULL) { + return NULL; + } +#endif + + return (drflac_file)pFile; +} + +static void drflac__close_file_handle(drflac_file file) +{ + fclose((FILE*)file); +} +#else +#include + +static size_t drflac__on_read_stdio(void* pUserData, void* bufferOut, size_t bytesToRead) +{ + assert(bytesToRead < 0xFFFFFFFF); // dr_flac will never request huge amounts of data at a time. This is a safe assertion. + + DWORD bytesRead; + ReadFile((HANDLE)pUserData, bufferOut, (DWORD)bytesToRead, &bytesRead, NULL); + + return (size_t)bytesRead; +} + +static drBool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) +{ + assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); + + return SetFilePointer((HANDLE)pUserData, offset, NULL, (origin == drflac_seek_origin_current) ? FILE_CURRENT : FILE_BEGIN) != INVALID_SET_FILE_POINTER; +} + +static drflac_file drflac__open_file_handle(const char* filename) +{ + HANDLE hFile = CreateFileA(filename, FILE_GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) { + return NULL; + } + + return (drflac_file)hFile; +} + +static void drflac__close_file_handle(drflac_file file) +{ + CloseHandle((HANDLE)file); +} +#endif + + +drflac* drflac_open_file(const char* filename) +{ + drflac_file file = drflac__open_file_handle(filename); + if (file == NULL) { + return NULL; + } + + drflac* pFlac = drflac_open(drflac__on_read_stdio, drflac__on_seek_stdio, (void*)file); + if (pFlac == NULL) { + drflac__close_file_handle(file); + return NULL; + } + + return pFlac; +} + +drflac* drflac_open_file_with_metadata(const char* filename, drflac_meta_proc onMeta, void* pUserData) +{ + drflac_file file = drflac__open_file_handle(filename); + if (file == NULL) { + return NULL; + } + + drflac* pFlac = drflac_open_with_metadata_private(drflac__on_read_stdio, drflac__on_seek_stdio, onMeta, (void*)file, pUserData); + if (pFlac == NULL) { + drflac__close_file_handle(file); + return pFlac; + } + + return pFlac; +} +#endif //DR_FLAC_NO_STDIO + +static size_t drflac__on_read_memory(void* pUserData, void* bufferOut, size_t bytesToRead) +{ + drflac__memory_stream* memoryStream = (drflac__memory_stream*)pUserData; + assert(memoryStream != NULL); + assert(memoryStream->dataSize >= memoryStream->currentReadPos); + + size_t bytesRemaining = memoryStream->dataSize - memoryStream->currentReadPos; + if (bytesToRead > bytesRemaining) { + bytesToRead = bytesRemaining; + } + + if (bytesToRead > 0) { + memcpy(bufferOut, memoryStream->data + memoryStream->currentReadPos, bytesToRead); + memoryStream->currentReadPos += bytesToRead; + } + + return bytesToRead; +} + +static drBool32 drflac__on_seek_memory(void* pUserData, int offset, drflac_seek_origin origin) +{ + drflac__memory_stream* memoryStream = (drflac__memory_stream*)pUserData; + assert(memoryStream != NULL); + assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); + + if (origin == drflac_seek_origin_current) { + if (memoryStream->currentReadPos + offset <= memoryStream->dataSize) { + memoryStream->currentReadPos += offset; + } else { + memoryStream->currentReadPos = memoryStream->dataSize; // Trying to seek too far forward. + } + } else { + if ((uint32_t)offset <= memoryStream->dataSize) { + memoryStream->currentReadPos = offset; + } else { + memoryStream->currentReadPos = memoryStream->dataSize; // Trying to seek too far forward. + } + } + + return DR_TRUE; +} + +drflac* drflac_open_memory(const void* data, size_t dataSize) +{ + drflac__memory_stream memoryStream; + memoryStream.data = (const unsigned char*)data; + memoryStream.dataSize = dataSize; + memoryStream.currentReadPos = 0; + drflac* pFlac = drflac_open(drflac__on_read_memory, drflac__on_seek_memory, &memoryStream); + if (pFlac == NULL) { + return NULL; + } + + pFlac->memoryStream = memoryStream; + + // This is an awful hack... +#ifndef DR_FLAC_NO_OGG + if (pFlac->container == drflac_container_ogg) + { + drflac_oggbs* oggbs = (drflac_oggbs*)(((int32_t*)pFlac->pExtraData) + pFlac->maxBlockSize*pFlac->channels); + oggbs->pUserData = &pFlac->memoryStream; + } + else +#endif + { + pFlac->bs.pUserData = &pFlac->memoryStream; + } + + return pFlac; +} + +drflac* drflac_open_memory_with_metadata(const void* data, size_t dataSize, drflac_meta_proc onMeta, void* pUserData) +{ + drflac__memory_stream memoryStream; + memoryStream.data = (const unsigned char*)data; + memoryStream.dataSize = dataSize; + memoryStream.currentReadPos = 0; + drflac* pFlac = drflac_open_with_metadata_private(drflac__on_read_memory, drflac__on_seek_memory, onMeta, &memoryStream, pUserData); + if (pFlac == NULL) { + return NULL; + } + + pFlac->memoryStream = memoryStream; + + // This is an awful hack... +#ifndef DR_FLAC_NO_OGG + if (pFlac->container == drflac_container_ogg) + { + drflac_oggbs* oggbs = (drflac_oggbs*)(((int32_t*)pFlac->pExtraData) + pFlac->maxBlockSize*pFlac->channels); + oggbs->pUserData = &pFlac->memoryStream; + } + else +#endif + { + pFlac->bs.pUserData = &pFlac->memoryStream; + } + + return pFlac; +} + + + +drflac* drflac_open(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData) +{ + return drflac_open_with_metadata_private(onRead, onSeek, NULL, pUserData, pUserData); +} + +drflac* drflac_open_with_metadata(drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData) +{ + return drflac_open_with_metadata_private(onRead, onSeek, onMeta, pUserData, pUserData); +} + +void drflac_close(drflac* pFlac) +{ + if (pFlac == NULL) { + return; + } + +#ifndef DR_FLAC_NO_STDIO + // If we opened the file with drflac_open_file() we will want to close the file handle. We can know whether or not drflac_open_file() + // was used by looking at the callbacks. + if (pFlac->bs.onRead == drflac__on_read_stdio) { + drflac__close_file_handle((drflac_file)pFlac->bs.pUserData); + } + +#ifndef DR_FLAC_NO_OGG + // Need to clean up Ogg streams a bit differently due to the way the bit streaming is chained. + if (pFlac->container == drflac_container_ogg) { + assert(pFlac->bs.onRead == drflac__on_read_ogg); + drflac_oggbs* oggbs = (drflac_oggbs*)((int32_t*)pFlac->pExtraData + pFlac->maxBlockSize*pFlac->channels); + if (oggbs->onRead == drflac__on_read_stdio) { + drflac__close_file_handle((drflac_file)oggbs->pUserData); + } + } +#endif +#endif + + free(pFlac); +} + +uint64_t drflac__read_s32__misaligned(drflac* pFlac, uint64_t samplesToRead, int32_t* bufferOut) +{ + unsigned int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + + // We should never be calling this when the number of samples to read is >= the sample count. + assert(samplesToRead < channelCount); + assert(pFlac->currentFrame.samplesRemaining > 0 && samplesToRead <= pFlac->currentFrame.samplesRemaining); + + + uint64_t samplesRead = 0; + while (samplesToRead > 0) + { + uint64_t totalSamplesInFrame = pFlac->currentFrame.header.blockSize * channelCount; + uint64_t samplesReadFromFrameSoFar = totalSamplesInFrame - pFlac->currentFrame.samplesRemaining; + unsigned int channelIndex = samplesReadFromFrameSoFar % channelCount; + + uint64_t nextSampleInFrame = samplesReadFromFrameSoFar / channelCount; + + int decodedSample = 0; + switch (pFlac->currentFrame.header.channelAssignment) + { + case DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE: + { + if (channelIndex == 0) { + decodedSample = pFlac->currentFrame.subframes[channelIndex].pDecodedSamples[nextSampleInFrame]; + } else { + int side = pFlac->currentFrame.subframes[channelIndex + 0].pDecodedSamples[nextSampleInFrame]; + int left = pFlac->currentFrame.subframes[channelIndex - 1].pDecodedSamples[nextSampleInFrame]; + decodedSample = left - side; + } + + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE: + { + if (channelIndex == 0) { + int side = pFlac->currentFrame.subframes[channelIndex + 0].pDecodedSamples[nextSampleInFrame]; + int right = pFlac->currentFrame.subframes[channelIndex + 1].pDecodedSamples[nextSampleInFrame]; + decodedSample = side + right; + } else { + decodedSample = pFlac->currentFrame.subframes[channelIndex].pDecodedSamples[nextSampleInFrame]; + } + + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE: + { + int mid; + int side; + if (channelIndex == 0) { + mid = pFlac->currentFrame.subframes[channelIndex + 0].pDecodedSamples[nextSampleInFrame]; + side = pFlac->currentFrame.subframes[channelIndex + 1].pDecodedSamples[nextSampleInFrame]; + + mid = (((unsigned int)mid) << 1) | (side & 0x01); + decodedSample = (mid + side) >> 1; + } else { + mid = pFlac->currentFrame.subframes[channelIndex - 1].pDecodedSamples[nextSampleInFrame]; + side = pFlac->currentFrame.subframes[channelIndex + 0].pDecodedSamples[nextSampleInFrame]; + + mid = (((unsigned int)mid) << 1) | (side & 0x01); + decodedSample = (mid - side) >> 1; + } + + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_INDEPENDENT: + default: + { + decodedSample = pFlac->currentFrame.subframes[channelIndex].pDecodedSamples[nextSampleInFrame]; + } break; + } + + + decodedSample <<= ((32 - pFlac->bitsPerSample) + pFlac->currentFrame.subframes[channelIndex].wastedBitsPerSample); + + if (bufferOut) { + *bufferOut++ = decodedSample; + } + + samplesRead += 1; + pFlac->currentFrame.samplesRemaining -= 1; + samplesToRead -= 1; + } + + return samplesRead; +} + +uint64_t drflac__seek_forward_by_samples(drflac* pFlac, uint64_t samplesToRead) +{ + uint64_t samplesRead = 0; + while (samplesToRead > 0) + { + if (pFlac->currentFrame.samplesRemaining == 0) + { + if (!drflac__read_and_decode_next_frame(pFlac)) { + break; // Couldn't read the next frame, so just break from the loop and return. + } + } + else + { + samplesRead += 1; + pFlac->currentFrame.samplesRemaining -= 1; + samplesToRead -= 1; + } + } + + return samplesRead; +} + +uint64_t drflac_read_s32(drflac* pFlac, uint64_t samplesToRead, int32_t* bufferOut) +{ + // Note that is allowed to be null, in which case this will be treated as something like a seek. + if (pFlac == NULL || samplesToRead == 0) { + return 0; + } + + if (bufferOut == NULL) { + return drflac__seek_forward_by_samples(pFlac, samplesToRead); + } + + + uint64_t samplesRead = 0; + while (samplesToRead > 0) + { + // If we've run out of samples in this frame, go to the next. + if (pFlac->currentFrame.samplesRemaining == 0) + { + if (!drflac__read_and_decode_next_frame(pFlac)) { + break; // Couldn't read the next frame, so just break from the loop and return. + } + } + else + { + // Here is where we grab the samples and interleave them. + + unsigned int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); + uint64_t totalSamplesInFrame = pFlac->currentFrame.header.blockSize * channelCount; + uint64_t samplesReadFromFrameSoFar = totalSamplesInFrame - pFlac->currentFrame.samplesRemaining; + + int misalignedSampleCount = samplesReadFromFrameSoFar % channelCount; + if (misalignedSampleCount > 0) { + uint64_t misalignedSamplesRead = drflac__read_s32__misaligned(pFlac, misalignedSampleCount, bufferOut); + samplesRead += misalignedSamplesRead; + samplesReadFromFrameSoFar += misalignedSamplesRead; + bufferOut += misalignedSamplesRead; + samplesToRead -= misalignedSamplesRead; + } + + + uint64_t alignedSampleCountPerChannel = samplesToRead / channelCount; + if (alignedSampleCountPerChannel > pFlac->currentFrame.samplesRemaining / channelCount) { + alignedSampleCountPerChannel = pFlac->currentFrame.samplesRemaining / channelCount; + } + + uint64_t firstAlignedSampleInFrame = samplesReadFromFrameSoFar / channelCount; + unsigned int unusedBitsPerSample = 32 - pFlac->bitsPerSample; + + switch (pFlac->currentFrame.header.channelAssignment) + { + case DRFLAC_CHANNEL_ASSIGNMENT_LEFT_SIDE: + { + const int* pDecodedSamples0 = pFlac->currentFrame.subframes[0].pDecodedSamples + firstAlignedSampleInFrame; + const int* pDecodedSamples1 = pFlac->currentFrame.subframes[1].pDecodedSamples + firstAlignedSampleInFrame; + + for (uint64_t i = 0; i < alignedSampleCountPerChannel; ++i) { + int left = pDecodedSamples0[i]; + int side = pDecodedSamples1[i]; + int right = left - side; + + bufferOut[i*2+0] = left << (unusedBitsPerSample + pFlac->currentFrame.subframes[0].wastedBitsPerSample); + bufferOut[i*2+1] = right << (unusedBitsPerSample + pFlac->currentFrame.subframes[1].wastedBitsPerSample); + } + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_RIGHT_SIDE: + { + const int* pDecodedSamples0 = pFlac->currentFrame.subframes[0].pDecodedSamples + firstAlignedSampleInFrame; + const int* pDecodedSamples1 = pFlac->currentFrame.subframes[1].pDecodedSamples + firstAlignedSampleInFrame; + + for (uint64_t i = 0; i < alignedSampleCountPerChannel; ++i) { + int side = pDecodedSamples0[i]; + int right = pDecodedSamples1[i]; + int left = right + side; + + bufferOut[i*2+0] = left << (unusedBitsPerSample + pFlac->currentFrame.subframes[0].wastedBitsPerSample); + bufferOut[i*2+1] = right << (unusedBitsPerSample + pFlac->currentFrame.subframes[1].wastedBitsPerSample); + } + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_MID_SIDE: + { + const int* pDecodedSamples0 = pFlac->currentFrame.subframes[0].pDecodedSamples + firstAlignedSampleInFrame; + const int* pDecodedSamples1 = pFlac->currentFrame.subframes[1].pDecodedSamples + firstAlignedSampleInFrame; + + for (uint64_t i = 0; i < alignedSampleCountPerChannel; ++i) { + int side = pDecodedSamples1[i]; + int mid = (((uint32_t)pDecodedSamples0[i]) << 1) | (side & 0x01); + + bufferOut[i*2+0] = ((mid + side) >> 1) << (unusedBitsPerSample + pFlac->currentFrame.subframes[0].wastedBitsPerSample); + bufferOut[i*2+1] = ((mid - side) >> 1) << (unusedBitsPerSample + pFlac->currentFrame.subframes[1].wastedBitsPerSample); + } + } break; + + case DRFLAC_CHANNEL_ASSIGNMENT_INDEPENDENT: + default: + { + if (pFlac->currentFrame.header.channelAssignment == 1) // 1 = Stereo + { + // Stereo optimized inner loop unroll. + const int* pDecodedSamples0 = pFlac->currentFrame.subframes[0].pDecodedSamples + firstAlignedSampleInFrame; + const int* pDecodedSamples1 = pFlac->currentFrame.subframes[1].pDecodedSamples + firstAlignedSampleInFrame; + + for (uint64_t i = 0; i < alignedSampleCountPerChannel; ++i) { + bufferOut[i*2+0] = pDecodedSamples0[i] << (unusedBitsPerSample + pFlac->currentFrame.subframes[0].wastedBitsPerSample); + bufferOut[i*2+1] = pDecodedSamples1[i] << (unusedBitsPerSample + pFlac->currentFrame.subframes[1].wastedBitsPerSample); + } + } + else + { + // Generic interleaving. + for (uint64_t i = 0; i < alignedSampleCountPerChannel; ++i) { + for (unsigned int j = 0; j < channelCount; ++j) { + bufferOut[(i*channelCount)+j] = (pFlac->currentFrame.subframes[j].pDecodedSamples[firstAlignedSampleInFrame + i]) << (unusedBitsPerSample + pFlac->currentFrame.subframes[j].wastedBitsPerSample); + } + } + } + } break; + } + + uint64_t alignedSamplesRead = alignedSampleCountPerChannel * channelCount; + samplesRead += alignedSamplesRead; + samplesReadFromFrameSoFar += alignedSamplesRead; + bufferOut += alignedSamplesRead; + samplesToRead -= alignedSamplesRead; + pFlac->currentFrame.samplesRemaining -= (unsigned int)alignedSamplesRead; + + + + // At this point we may still have some excess samples left to read. + if (samplesToRead > 0 && pFlac->currentFrame.samplesRemaining > 0) + { + uint64_t excessSamplesRead = 0; + if (samplesToRead < pFlac->currentFrame.samplesRemaining) { + excessSamplesRead = drflac__read_s32__misaligned(pFlac, samplesToRead, bufferOut); + } else { + excessSamplesRead = drflac__read_s32__misaligned(pFlac, pFlac->currentFrame.samplesRemaining, bufferOut); + } + + samplesRead += excessSamplesRead; + samplesReadFromFrameSoFar += excessSamplesRead; + bufferOut += excessSamplesRead; + samplesToRead -= excessSamplesRead; + } + } + } + + return samplesRead; +} + +drBool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex) +{ + if (pFlac == NULL) { + return DR_FALSE; + } + + if (sampleIndex == 0) { + return drflac__seek_to_first_frame(pFlac); + } + + // Clamp the sample to the end. + if (sampleIndex >= pFlac->totalSampleCount) { + sampleIndex = pFlac->totalSampleCount - 1; + } + + + // Different techniques depending on encapsulation. Using the native FLAC seektable with Ogg encapsulation is a bit awkward so + // we'll instead use Ogg's natural seeking facility. +#ifndef DR_FLAC_NO_OGG + if (pFlac->container == drflac_container_ogg) + { + return drflac_ogg__seek_to_sample(pFlac, sampleIndex); + } + else +#endif + { + // First try seeking via the seek table. If this fails, fall back to a brute force seek which is much slower. + if (!drflac__seek_to_sample__seek_table(pFlac, sampleIndex)) { + return drflac__seek_to_sample__brute_force(pFlac, sampleIndex); + } + } + + + return DR_TRUE; +} + + + +//// High Level APIs //// + +int32_t* drflac__full_decode_and_close(drflac* pFlac, unsigned int* channelsOut, unsigned int* sampleRateOut, uint64_t* totalSampleCountOut) +{ + assert(pFlac != NULL); + + int32_t* pSampleData = NULL; + uint64_t totalSampleCount = pFlac->totalSampleCount; + + if (totalSampleCount == 0) + { + int32_t buffer[4096]; + + size_t sampleDataBufferSize = sizeof(buffer); + pSampleData = (int32_t*)malloc(sampleDataBufferSize); + if (pSampleData == NULL) { + goto on_error; + } + + uint64_t samplesRead; + while ((samplesRead = (uint64_t)drflac_read_s32(pFlac, sizeof(buffer)/sizeof(buffer[0]), buffer)) > 0) + { + if (((totalSampleCount + samplesRead) * sizeof(int32_t)) > sampleDataBufferSize) { + sampleDataBufferSize *= 2; + int32_t* pNewSampleData = (int32_t*)realloc(pSampleData, sampleDataBufferSize); + if (pNewSampleData == NULL) { + free(pSampleData); + goto on_error; + } + + pSampleData = pNewSampleData; + } + + memcpy(pSampleData + totalSampleCount, buffer, (size_t)(samplesRead*sizeof(int32_t))); + totalSampleCount += samplesRead; + } + + // At this point everything should be decoded, but we just want to fill the unused part buffer with silence - need to + // protect those ears from random noise! + memset(pSampleData + totalSampleCount, 0, (size_t)(sampleDataBufferSize - totalSampleCount*sizeof(int32_t))); + } + else + { + uint64_t dataSize = totalSampleCount * sizeof(int32_t); + if (dataSize > SIZE_MAX) { + goto on_error; // The decoded data is too big. + } + + pSampleData = (int32_t*)malloc((size_t)dataSize); // <-- Safe cast as per the check above. + if (pSampleData == NULL) { + goto on_error; + } + + uint64_t samplesDecoded = drflac_read_s32(pFlac, pFlac->totalSampleCount, pSampleData); + if (samplesDecoded != pFlac->totalSampleCount) { + free(pSampleData); + goto on_error; // Something went wrong when decoding the FLAC stream. + } + } + + + if (sampleRateOut) *sampleRateOut = pFlac->sampleRate; + if (channelsOut) *channelsOut = pFlac->channels; + if (totalSampleCountOut) *totalSampleCountOut = totalSampleCount; + + drflac_close(pFlac); + return pSampleData; + +on_error: + drflac_close(pFlac); + return NULL; +} + +int32_t* drflac_open_and_decode_s32(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + // Safety. + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open(onRead, onSeek, pUserData); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); +} + +#ifndef DR_FLAC_NO_STDIO +int32_t* drflac_open_and_decode_file_s32(const char* filename, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open_file(filename); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); +} +#endif + +int32_t* drflac_open_and_decode_memory_s32(const void* data, size_t dataSize, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open_memory(data, dataSize); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); +} + +void drflac_free(void* pSampleDataReturnedByOpenAndDecode) +{ + free(pSampleDataReturnedByOpenAndDecode); +} + + + + +void drflac_init_vorbis_comment_iterator(drflac_vorbis_comment_iterator* pIter, uint32_t commentCount, const char* pComments) +{ + if (pIter == NULL) { + return; + } + + pIter->countRemaining = commentCount; + pIter->pRunningData = pComments; +} + +const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, uint32_t* pCommentLengthOut) +{ + // Safety. + if (pCommentLengthOut) *pCommentLengthOut = 0; + + if (pIter == NULL || pIter->countRemaining == 0 || pIter->pRunningData == NULL) { + return NULL; + } + + uint32_t length = drflac__le2host_32(*(uint32_t*)pIter->pRunningData); + pIter->pRunningData += 4; + + const char* pComment = pIter->pRunningData; + pIter->pRunningData += length; + pIter->countRemaining -= 1; + + if (pCommentLengthOut) *pCommentLengthOut = length; + return pComment; +} +#endif //DR_FLAC_IMPLEMENTATION + + +// REVISION HISTORY +// +// v0.4 - 2016-09-29 +// - API/ABI CHANGE: Use fixed size 32-bit booleans instead of the built-in bool type. +// - API CHANGE: Rename drflac_open_and_decode*() to drflac_open_and_decode*_s32() +// - API CHANGE: Swap the order of "channels" and "sampleRate" parameters in drflac_open_and_decode*(). Rationale for this is to +// keep it consistent with dr_audio. +// +// v0.3f - 2016-09-21 +// - Fix a warning with GCC. +// +// v0.3e - 2016-09-18 +// - Fixed a bug where GCC 4.3+ was not getting properly identified. +// - Fixed a few typos. +// - Changed date formats to ISO 8601 (YYYY-MM-DD). +// +// v0.3d - 2016-06-11 +// - Minor clean up. +// +// v0.3c - 2016-05-28 +// - Fixed compilation error. +// +// v0.3b - 2016-05-16 +// - Fixed Linux/GCC build. +// - Updated documentation. +// +// v0.3a - 2016-05-15 +// - Minor fixes to documentation. +// +// v0.3 - 2016-05-11 +// - Optimizations. Now at about parity with the reference implementation on 32-bit builds. +// - Lots of clean up. +// +// v0.2b - 2016-05-10 +// - Bug fixes. +// +// v0.2a - 2016-05-10 +// - Made drflac_open_and_decode() more robust. +// - Removed an unused debugging variable +// +// v0.2 - 2016-05-09 +// - Added support for Ogg encapsulation. +// - API CHANGE. Have the onSeek callback take a third argument which specifies whether or not the seek +// should be relative to the start or the current position. Also changes the seeking rules such that +// seeking offsets will never be negative. +// - Have drflac_open_and_decode() fail gracefully if the stream has an unknown total sample count. +// +// v0.1b - 2016-05-07 +// - Properly close the file handle in drflac_open_file() and family when the decoder fails to initialize. +// - Removed a stale comment. +// +// v0.1a - 2016-05-05 +// - Minor formatting changes. +// - Fixed a warning on the GCC build. +// +// v0.1 - 2016-05-03 +// - Initial versioned release. + + +// TODO +// - Add support for initializing the decoder without a header STREAMINFO block. +// - Test CUESHEET metadata blocks. + + +/* +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +*/ -- cgit v1.2.3 From c384b375dfb0651291d8a00bce935e1b5631397d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 10 Oct 2016 19:42:02 +0200 Subject: Tweak to avoid warning --- src/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index bf66f929..9d2eeb47 100644 --- a/src/audio.c +++ b/src/audio.c @@ -855,7 +855,7 @@ void UpdateMusicStream(Music music) // NOTE: Returns the number of samples to process (should be the same as numSamples) int numSamplesFlac = drflac_read_s32(music->ctxFlac, numSamples, pcmi); - UpdateAudioStream(music->stream, pcmi, numSamples*music->stream.channels); + UpdateAudioStream(music->stream, pcmi, numSamplesFlac*music->stream.channels); music->samplesLeft -= (numSamples*music->stream.channels); } break; -- cgit v1.2.3 From 5fecf5c088122dc409bd209b08627e671cbdc175 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 10 Oct 2016 19:42:59 +0200 Subject: Review UpdateVrTracking() and rlglLoadRenderTexture() --- src/raylib.h | 2 +- src/rlgl.c | 17 +++++++++-------- src/rlgl.h | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index df0ee7bc..9bc89130 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -892,7 +892,7 @@ RLAPI void InitVrDevice(int vdDevice); // Init VR device RLAPI void CloseVrDevice(void); // Close VR device RLAPI bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready RLAPI bool IsVrSimulator(void); // Detect if VR simulator is running -RLAPI void UpdateVrTracking(void); // Update VR tracking (position and orientation) +RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) //------------------------------------------------------------------------------------ diff --git a/src/rlgl.c b/src/rlgl.c index 702edb18..e8607925 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1522,7 +1522,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) target.texture.id = 0; target.texture.width = width; target.texture.height = height; - target.texture.format = UNCOMPRESSED_R8G8B8; + target.texture.format = UNCOMPRESSED_R8G8B8A8; target.texture.mipmaps = 1; target.depth.id = 0; @@ -1539,7 +1539,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); #if defined(GRAPHICS_API_OPENGL_33) @@ -2734,16 +2734,17 @@ void ToggleVrMode(void) #endif } -// Update VR tracking (position and orientation) -void UpdateVrTracking(void) +// Update VR tracking (position and orientation) and camera +void UpdateVrTracking(Camera *camera) { #if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) UpdateOculusTracking(); - else -#endif + if (vrDeviceReady) { - // TODO: Use alternative inputs (mouse, keyboard) to simulate tracking data (eyes position/orientation) + UpdateOculusTracking(); + + // TODO: Update camera data (position, target, up) with tracking data } +#endif } // Begin Oculus drawing configuration diff --git a/src/rlgl.h b/src/rlgl.h index 5fc9f8b9..3a47b4c8 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -375,7 +375,7 @@ float *MatrixToFloat(Matrix mat); void InitVrDevice(int vrDevice); // Init VR device void CloseVrDevice(void); // Close VR device bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready -void UpdateVrTracking(void); // Update VR tracking (position and orientation) +void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) // Oculus Rift API for direct access the device (no simulator) -- cgit v1.2.3 From 97e3277d58060df96cd002b1377a51ca4adcbb9e Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 11 Oct 2016 00:39:07 +0200 Subject: Updated standard shader Corrects weird artifacts on web --- src/shader_standard.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/shader_standard.h b/src/shader_standard.h index deae7fe1..995c62ea 100644 --- a/src/shader_standard.h +++ b/src/shader_standard.h @@ -90,7 +90,7 @@ static const char fStandardShaderStr[] = " if (diff > 0.0)\n" " {\n" " vec3 h = normalize(-l.direction + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" " }\n" " return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" "}\n" @@ -103,7 +103,7 @@ static const char fStandardShaderStr[] = " if (diff > 0.0)\n" " {\n" " vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" " }\n" " return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" "}\n" @@ -124,7 +124,7 @@ static const char fStandardShaderStr[] = " if (diffAttenuation > 0.0)\n" " {\n" " vec3 h = normalize(lightDir + v);\n" -" spec = pow(dot(n, h), 3.0 + glossiness)*s;\n" +" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" " }\n" " return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" "}\n" @@ -152,9 +152,9 @@ static const char fStandardShaderStr[] = " }\n" " float spec = 1.0;\n" #if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" if (useSpecular == 1) spec *= normalize(texture2D(texture2, fragTexCoord).r);\n" +" if (useSpecular == 1) spec = texture2D(texture2, fragTexCoord).r;\n" #elif defined(GRAPHICS_API_OPENGL_33) -" if (useSpecular == 1) spec *= normalize(texture(texture2, fragTexCoord).r);\n" +" if (useSpecular == 1) spec = texture(texture2, fragTexCoord).r;\n" #endif " for (int i = 0; i < maxLights; i++)\n" " {\n" -- cgit v1.2.3 From 76a67a149e07225c66275f8657a5928e03234d90 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 12 Oct 2016 10:27:14 +0200 Subject: Added new wave functions to lua binding --- src/raylib.h | 2 +- src/rlua.h | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 9bc89130..4a807d58 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -908,7 +908,7 @@ RLAPI Sound LoadSound(const char *fileName); // Load so RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data -RLAPI void UnloadWave(Wave wave); +RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound RLAPI void PauseSound(Sound sound); // Pause a sound diff --git a/src/rlua.h b/src/rlua.h index 1c8c7b38..97d22922 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -2824,6 +2824,28 @@ int lua_IsAudioDeviceReady(lua_State* L) return 1; } +int lua_LoadWave(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + Wave result = LoadWave((char *)arg1); + LuaPush_Wave(L, result); + return 1; +} + +int lua_LoadWaveEx(lua_State* L) +{ + // TODO: Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); + + int arg1 = 0; + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + int arg5 = LuaGetArgument_int(L, 5); + Wave result = LoadWaveEx(arg1, arg2, arg3, arg4, arg5); + LuaPush_Wave(L, result); + return 1; +} + int lua_LoadSound(lua_State* L) { const char * arg1 = LuaGetArgument_string(L, 1); @@ -2849,6 +2871,22 @@ int lua_LoadSoundFromRES(lua_State* L) return 1; } +int lua_UpdateSound(lua_State* L) +{ + Sound arg1 = LuaGetArgument_Sound(L, 1); + const char * arg2 = LuaGetArgument_string(L, 2); + int * arg3 = LuaGetArgument_int(L, 3); + UpdateSound(arg1, arg2, arg3); + return 0; +} + +int lua_UnloadWave(lua_State* L) +{ + Wave arg1 = LuaGetArgument_Wave(L, 1); + UnloadWave(arg1); + return 0; +} + int lua_UnloadSound(lua_State* L) { Sound arg1 = LuaGetArgument_Sound(L, 1); @@ -2908,6 +2946,43 @@ int lua_SetSoundPitch(lua_State* L) return 0; } +int lua_WaveFormat(lua_State* L) +{ + Wave arg1 = LuaGetArgument_Wave(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + WaveFormat(arg1, arg2, arg3, arg4); + return 0; +} + +int lua_LoadMusicStream(lua_State* L) +{ + Wave arg1 = LuaGetArgument_Wave(L, 1); + Wave result = WaveCopy(arg1); + LuaPush_Wave(L, result); + return 1; +} + +int lua_WaveCrop(lua_State* L) +{ + Wave arg1 = LuaGetArgument_Wave(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + WaveCrop(arg1, arg2, arg3); + return 0; +} + +int lua_GetWaveData(lua_State* L) +{ + // TODO: float *GetWaveData(Wave wave); + + Wave arg1 = LuaGetArgument_Wave(L, 1); + float result = GetWaveData(arg1); + LuaPush_float(L, result); + return 1; +} + int lua_LoadMusicStream(lua_State* L) { const char * arg1 = LuaGetArgument_string(L, 1); @@ -3799,9 +3874,13 @@ static luaL_Reg raylib_functions[] = { REG(InitAudioDevice) REG(CloseAudioDevice) REG(IsAudioDeviceReady) + REG(LoadWave) + REG(LoadWaveEx) REG(LoadSound) REG(LoadSoundFromWave) REG(LoadSoundFromRES) + REG(UpdateSound) + REG(UnloadWave) REG(UnloadSound) REG(PlaySound) REG(PauseSound) @@ -3810,6 +3889,10 @@ static luaL_Reg raylib_functions[] = { REG(IsSoundPlaying) REG(SetSoundVolume) REG(SetSoundPitch) + REG(WaveFormat) + REG(WaveCopy) + REG(WaveCrop) + REG(GetWaveData) REG(LoadMusicStream) REG(UnloadMusicStream) -- cgit v1.2.3 From b3bc4b21d17f7e434e21684ca6a2c111ea150fbb Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 14 Oct 2016 00:47:43 +0200 Subject: Working on better gamepad support --- src/core.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- src/raylib.h | 1 + 2 files changed, 44 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index a35dbae0..b07179d4 100644 --- a/src/core.c +++ b/src/core.c @@ -1166,6 +1166,17 @@ bool IsGamepadAvailable(int gamepad) return result; } +// Return gamepad internal name id +const char *GetGamepadName(int gamepad) +{ +#if defined(PLATFORM_DESKTOP) + if (glfwJoystickPresent(gamepad) == 1) return glfwGetJoystickName(gamepad); + else return NULL; +#else + return NULL; +#endif +} + // Return axis movement vector for a gamepad float GetGamepadAxisMovement(int gamepad, int axis) { @@ -1192,7 +1203,11 @@ float GetGamepadAxisMovement(int gamepad, int axis) bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; + + if ((currentGamepadState[button] != previousGamepadState[button]) && (currentGamepadState[button] == 1)) pressed = true; + else pressed = false; + /* currentGamepadState[button] = IsGamepadButtonDown(gamepad, button); if (currentGamepadState[button] != previousGamepadState[button]) @@ -1201,6 +1216,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) previousGamepadState[button] = currentGamepadState[button]; } else pressed = false; + */ return pressed; } @@ -1222,6 +1238,8 @@ bool IsGamepadButtonDown(int gamepad, int button) if ((buttons != NULL) && (buttons[button] == GLFW_PRESS)) result = true; else result = false; + + //result = currentGamepadState[button]; #endif return result; @@ -1233,14 +1251,19 @@ bool IsGamepadButtonReleased(int gamepad, int button) bool released = false; currentGamepadState[button] = IsGamepadButtonUp(gamepad, button); + + if ((currentGamepadState[button] != previousGamepadState[button]) && (currentGamepadState[button] == 0)) released = true; + else released = false; + /* if (currentGamepadState[button] != previousGamepadState[button]) { if (currentGamepadState[button]) released = true; previousGamepadState[button] = currentGamepadState[button]; } else released = false; - + */ + return released; } @@ -1984,8 +2007,26 @@ static void PollInputEvents(void) previousMouseWheelY = currentMouseWheelY; currentMouseWheelY = 0; + + // Register previous gamepad states + for (int i = 0; i < 32; i++) previousGamepadState[i] = currentGamepadState[i]; + + // Get current gamepad state (no callback) + if (glfwJoystickPresent(GAMEPAD_PLAYER1)) + { + const unsigned char *buttons; + int buttonsCount; + + buttons = glfwGetJoystickButtons(GAMEPAD_PLAYER1, &buttonsCount); + + for (int i = 0; (buttons != NULL) && (buttonsCount < 32) && (i < buttonsCount); i++) + { + if (buttons[i] == GLFW_PRESS) currentGamepadState[i] = true; + else currentGamepadState[i] = false; + } + } - glfwPollEvents(); // Register keyboard/mouse events... and window events! + glfwPollEvents(); // Register keyboard/mouse events (callbacks)... and window events! #endif #if defined(PLATFORM_ANDROID) diff --git a/src/raylib.h b/src/raylib.h index 9bc89130..0d6f4326 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -657,6 +657,7 @@ RLAPI int GetKeyPressed(void); // Get latest key RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed -- cgit v1.2.3 From 98d7a10c087f14b55e2dfb5f07eb6f95899ba959 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 14 Oct 2016 11:14:41 +0200 Subject: Improved gamepad system - Support up to 4 gamepads - Unified system between platforms - Corrected some bugs --- src/core.c | 169 +++++++++++++++++++++++------------------------------------ src/raylib.h | 4 +- 2 files changed, 68 insertions(+), 105 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index b07179d4..78629e8f 100644 --- a/src/core.c +++ b/src/core.c @@ -128,12 +128,12 @@ //#define DEFAULT_GAMEPAD_DEV "/dev/input/eventN" #define MOUSE_SENSITIVITY 0.8f - - #define MAX_GAMEPADS 2 // Max number of gamepads supported - #define MAX_GAMEPAD_BUTTONS 11 // Max bumber of buttons supported (per gamepad) - #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) #endif +#define MAX_GAMEPADS 4 // Max number of gamepads supported +#define MAX_GAMEPAD_BUTTONS 11 // Max bumber of buttons supported (per gamepad) +#define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) + #define RL_LOAD_DEFAULT_FONT // Load default font on window initialization (module: text) //---------------------------------------------------------------------------------- @@ -174,15 +174,11 @@ static int defaultKeyboardMode; // Used to store default keyboar // Mouse input variables static int mouseStream = -1; // Mouse device file descriptor static bool mouseReady = false; // Flag to know if mouse is ready -pthread_t mouseThreadId; // Mouse reading thread id +static pthread_t mouseThreadId; // Mouse reading thread id // Gamepad input variables -static int gamepadStream[MAX_GAMEPADS] = { -1 }; // Gamepad device file descriptor (two gamepads supported) -static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready (two gamepads supported) -pthread_t gamepadThreadId; // Gamepad reading thread id - -int gamepadButtons[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Gamepad buttons state -float gamepadAxisValues[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state +static int gamepadStream[MAX_GAMEPADS] = { -1 };// Gamepad device file descriptor +static pthread_t gamepadThreadId; // Gamepad reading thread id #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -207,18 +203,23 @@ static Matrix downscaleView; // Matrix to downscale view (in case static const char *windowTitle; // Window text title... static bool cursorOnScreen = false; // Tracks if cursor is inside client area -static char previousKeyState[512] = { 0 }; // Required to check if key pressed/released once -static char currentKeyState[512] = { 0 }; // Required to check if key pressed/released once +// Register keyboard states +static char previousKeyState[512] = { 0 }; // Registers previous frame key state +static char currentKeyState[512] = { 0 }; // Registers current frame key state -static char previousGamepadState[32] = {0}; // Required to check if gamepad btn pressed/released once -static char currentGamepadState[32] = {0}; // Required to check if gamepad btn pressed/released once +// Register mouse states +static char previousMouseState[3] = { 0 }; // Registers previous mouse button state +static char currentMouseState[3] = { 0 }; // Registers current mouse button state +static int previousMouseWheelY = 0; // Registers previous mouse wheel variation +static int currentMouseWheelY = 0; // Registers current mouse wheel variation -static char previousMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once -static char currentMouseState[3] = { 0 }; // Required to check if mouse btn pressed/released once - -static int previousMouseWheelY = 0; // Required to track mouse wheel variation -static int currentMouseWheelY = 0; // Required to track mouse wheel variation +// Register gamepads states +static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready +static float gamepadAxisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state +static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS] = { 0 }; +static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS] = { 0 }; +// Keyboard configuration static int exitKey = KEY_ESCAPE; // Default exit key (ESC) static int lastKeyPressed = -1; // Register last key pressed @@ -1157,11 +1158,7 @@ bool IsGamepadAvailable(int gamepad) { bool result = false; -#if defined(PLATFORM_RPI) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true; -#else - if (glfwJoystickPresent(gamepad) == 1) result = true; -#endif return result; } @@ -1182,19 +1179,10 @@ float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; -#if defined(PLATFORM_RPI) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) { - if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisValues[gamepad][axis]; + if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisState[gamepad][axis]; } -#else - const float *axes; - int axisCount = 0; - - axes = glfwGetJoystickAxes(gamepad, &axisCount); - - if (axis < axisCount) value = axes[axis]; -#endif return value; } @@ -1204,19 +1192,9 @@ bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; - if ((currentGamepadState[button] != previousGamepadState[button]) && (currentGamepadState[button] == 1)) pressed = true; - else pressed = false; - - /* - currentGamepadState[button] = IsGamepadButtonDown(gamepad, button); - - if (currentGamepadState[button] != previousGamepadState[button]) - { - if (currentGamepadState[button]) pressed = true; - previousGamepadState[button] = currentGamepadState[button]; - } - else pressed = false; - */ + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && + (currentGamepadState[gamepad][button] == 1)) pressed = true; return pressed; } @@ -1226,21 +1204,8 @@ bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; -#if defined(PLATFORM_RPI) - // Get gamepad buttons information - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (gamepadButtons[gamepad][button] == 1)) result = true; - else result = false; -#else - const unsigned char *buttons; - int buttonsCount; - - buttons = glfwGetJoystickButtons(gamepad, &buttonsCount); - - if ((buttons != NULL) && (buttons[button] == GLFW_PRESS)) result = true; - else result = false; - - //result = currentGamepadState[button]; -#endif + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + (currentGamepadState[gamepad][button] == 1)) result = true; return result; } @@ -1249,21 +1214,11 @@ bool IsGamepadButtonDown(int gamepad, int button) bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; - - currentGamepadState[button] = IsGamepadButtonUp(gamepad, button); - if ((currentGamepadState[button] != previousGamepadState[button]) && (currentGamepadState[button] == 0)) released = true; - else released = false; + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && + (currentGamepadState[gamepad][button] == 0)) released = true; - /* - if (currentGamepadState[button] != previousGamepadState[button]) - { - if (currentGamepadState[button]) released = true; - previousGamepadState[button] = currentGamepadState[button]; - } - else released = false; - */ - return released; } @@ -1272,19 +1227,8 @@ bool IsGamepadButtonUp(int gamepad, int button) { bool result = false; -#if defined(PLATFORM_RPI) - // Get gamepad buttons information - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (gamepadButtons[gamepad][button] == 0)) result = true; - else result = false; -#else - const unsigned char *buttons; - int buttonsCount; - - buttons = glfwGetJoystickButtons(gamepad, &buttonsCount); - - if ((buttons != NULL) && (buttons[button] == GLFW_RELEASE)) result = true; - else result = false; -#endif + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + (currentGamepadState[gamepad][button] == 0)) result = true; return result; } @@ -2008,22 +1952,41 @@ static void PollInputEvents(void) previousMouseWheelY = currentMouseWheelY; currentMouseWheelY = 0; - // Register previous gamepad states - for (int i = 0; i < 32; i++) previousGamepadState[i] = currentGamepadState[i]; - - // Get current gamepad state (no callback) - if (glfwJoystickPresent(GAMEPAD_PLAYER1)) + // Register gamepads buttons events + for (int i = 0; i < MAX_GAMEPADS; i++) { - const unsigned char *buttons; - int buttonsCount; - - buttons = glfwGetJoystickButtons(GAMEPAD_PLAYER1, &buttonsCount); - - for (int i = 0; (buttons != NULL) && (buttonsCount < 32) && (i < buttonsCount); i++) + if (glfwJoystickPresent(i)) // Check if gamepad is available { - if (buttons[i] == GLFW_PRESS) currentGamepadState[i] = true; - else currentGamepadState[i] = false; + gamepadReady[i] = true; + + // Register previous gamepad states + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; + + // Get current gamepad state + // NOTE: There is no callback available, so we get it manually + const unsigned char *buttons; + int buttonsCount; + + buttons = glfwGetJoystickButtons(i, &buttonsCount); + + for (int k = 0; (buttons != NULL) && (k < buttonsCount) && (buttonsCount < MAX_GAMEPAD_BUTTONS); k++) + { + if (buttons[i] == GLFW_PRESS) currentGamepadState[i][k] = 1; + else currentGamepadState[i][k] = 0; + } + + // Get current axis state + const float *axes; + int axisCount = 0; + + axes = glfwGetJoystickAxes(i, &axisCount); + + for (int k = 0; (axes != NULL) && (k < axisCount) && (k < MAX_GAMEPAD_AXIS); k++) + { + gamepadAxisState[i][k] = axes[k]; + } } + else gamepadReady[i] = false; } glfwPollEvents(); // Register keyboard/mouse events (callbacks)... and window events! @@ -2854,7 +2817,7 @@ static void *GamepadThread(void *arg) if (gamepadEvent.number < MAX_GAMEPAD_BUTTONS) { // 1 - button pressed, 0 - button released - gamepadButtons[i][gamepadEvent.number] = (int)gamepadEvent.value; + currentGamepadState[i][gamepadEvent.number] = (int)gamepadEvent.value; } } else if (gamepadEvent.type == JS_EVENT_AXIS) @@ -2864,7 +2827,7 @@ static void *GamepadThread(void *arg) if (gamepadEvent.number < MAX_GAMEPAD_AXIS) { // NOTE: Scaling of gamepadEvent.value to get values between -1..1 - gamepadAxisValues[i][gamepadEvent.number] = (float)gamepadEvent.value/32768; + gamepadAxisState[i][gamepadEvent.number] = (float)gamepadEvent.value/32768; } } } diff --git a/src/raylib.h b/src/raylib.h index 9ca77d69..5834d1c9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -185,8 +185,8 @@ // Gamepad Number #define GAMEPAD_PLAYER1 0 #define GAMEPAD_PLAYER2 1 -#define GAMEPAD_PLAYER3 2 // Not supported -#define GAMEPAD_PLAYER4 3 // Not supported +#define GAMEPAD_PLAYER3 2 +#define GAMEPAD_PLAYER4 3 // Gamepad Buttons -- cgit v1.2.3 From 9e285d8dc33a5a18eeb154c69b04de1c1358678d Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 15 Oct 2016 13:17:57 +0200 Subject: Updated gamepad system with extra check Avoid out-of-bounds situation with button array --- src/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 78629e8f..3bd85fdd 100644 --- a/src/core.c +++ b/src/core.c @@ -1179,9 +1179,9 @@ float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) { - if (axis < MAX_GAMEPAD_AXIS) value = gamepadAxisState[gamepad][axis]; + value = gamepadAxisState[gamepad][axis]; } return value; @@ -1192,7 +1192,7 @@ bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 1)) pressed = true; @@ -1204,7 +1204,7 @@ bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 1)) result = true; return result; @@ -1215,7 +1215,7 @@ bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 0)) released = true; @@ -1227,7 +1227,7 @@ bool IsGamepadButtonUp(int gamepad, int button) { bool result = false; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 0)) result = true; return result; -- cgit v1.2.3 From 1c05017548ea21dd1a44c31e9fc80b8700891f11 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 15 Oct 2016 13:51:33 +0200 Subject: Added OpenAL static library --- src/external/openal_soft/include/AL/alext.h | 5 +++++ src/external/openal_soft/lib/win32/libOpenAL32.a | Bin 0 -> 2226842 bytes 2 files changed, 5 insertions(+) create mode 100644 src/external/openal_soft/lib/win32/libOpenAL32.a (limited to 'src') diff --git a/src/external/openal_soft/include/AL/alext.h b/src/external/openal_soft/include/AL/alext.h index 6af581aa..0090c804 100644 --- a/src/external/openal_soft/include/AL/alext.h +++ b/src/external/openal_soft/include/AL/alext.h @@ -431,6 +431,11 @@ ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCi #endif #endif +#ifndef AL_SOFT_gain_clamp_ex +#define AL_SOFT_gain_clamp_ex 1 +#define AL_GAIN_LIMIT_SOFT 0x200E +#endif + #ifdef __cplusplus } #endif diff --git a/src/external/openal_soft/lib/win32/libOpenAL32.a b/src/external/openal_soft/lib/win32/libOpenAL32.a new file mode 100644 index 00000000..3c0df3c7 Binary files /dev/null and b/src/external/openal_soft/lib/win32/libOpenAL32.a differ -- cgit v1.2.3 From 8f60996b6482246cb8f66d0ba8f6aa1604e6dd01 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 17 Oct 2016 00:03:38 +0200 Subject: Corrected some warnings --- src/audio.c | 6 +-- src/models.c | 122 ++++++++++++++++++++++++++++----------------------------- src/raylib.h | 2 +- src/rlgl.c | 10 ++--- src/shapes.c | 22 +++++------ src/textures.c | 12 +++--- 6 files changed, 87 insertions(+), 87 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 9d2eeb47..3684e10a 100644 --- a/src/audio.c +++ b/src/audio.c @@ -706,7 +706,7 @@ Music LoadMusicStream(const char *fileName) else { music->stream = InitAudioStream(music->ctxFlac->sampleRate, music->ctxFlac->bitsPerSample, music->ctxFlac->channels); - music->totalSamples = music->ctxFlac->totalSampleCount; + music->totalSamples = (unsigned int)music->ctxFlac->totalSampleCount; music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_FLAC; music->loop = true; // We loop by default @@ -853,7 +853,7 @@ void UpdateMusicStream(Music music) int pcmi[AUDIO_BUFFER_SIZE]; // NOTE: Returns the number of samples to process (should be the same as numSamples) - int numSamplesFlac = drflac_read_s32(music->ctxFlac, numSamples, pcmi); + unsigned int numSamplesFlac = (unsigned int)drflac_read_s32(music->ctxFlac, numSamples, pcmi); UpdateAudioStream(music->stream, pcmi, numSamplesFlac*music->stream.channels); music->samplesLeft -= (numSamples*music->stream.channels); @@ -1237,7 +1237,7 @@ static Wave LoadOGG(const char *fileName) if (totalSeconds > 10) TraceLog(WARNING, "[%s] Ogg audio lenght is larger than 10 seconds (%f), that's a big file in memory, consider music streaming", fileName, totalSeconds); - int totalSamples = totalSeconds*info.sample_rate*info.channels; + int totalSamples = (int)(totalSeconds*info.sample_rate*info.channels); wave.sampleCount = totalSamples; wave.data = (short *)malloc(totalSamplesLength*sizeof(short)); diff --git a/src/models.c b/src/models.c index 822da6e9..55ac7893 100644 --- a/src/models.c +++ b/src/models.c @@ -87,8 +87,8 @@ void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rot { rlColor4ub(color.r, color.g, color.b, color.a); - rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f); - rlVertex3f(sin(DEG2RAD*(i + 10))*radius, cos(DEG2RAD*(i + 10))*radius, 0.0f); + rlVertex3f(sinf(DEG2RAD*i)*radius, cosf(DEG2RAD*i)*radius, 0.0f); + rlVertex3f(sinf(DEG2RAD*(i + 10))*radius, cosf(DEG2RAD*(i + 10))*radius, 0.0f); } rlEnd(); rlPopMatrix(); @@ -325,25 +325,25 @@ void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color { for (int j = 0; j < slices; j++) { - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); - - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i)))*sin(DEG2RAD*((j+1)*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i)))*cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*i)), + cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); + + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*i)), + cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*sinf(DEG2RAD*((j+1)*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i)))*cosf(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); } } rlEnd(); @@ -364,26 +364,26 @@ void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Col { for (int j = 0; j < slices; j++) { - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); - - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*((j+1)*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*((j+1)*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); - - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*(i+1))), - cos(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cos(DEG2RAD*(j*360/slices))); - rlVertex3f(cos(DEG2RAD*(270+(180/(rings + 1))*i))*sin(DEG2RAD*(j*360/slices)), - sin(DEG2RAD*(270+(180/(rings + 1))*i)), - cos(DEG2RAD*(270+(180/(rings + 1))*i))*cos(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*i)), + cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); + + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*((j+1)*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*((j+1)*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); + + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*(i+1))), + cosf(DEG2RAD*(270+(180/(rings + 1))*(i+1)))*cosf(DEG2RAD*(j*360/slices))); + rlVertex3f(cosf(DEG2RAD*(270+(180/(rings + 1))*i))*sinf(DEG2RAD*(j*360/slices)), + sinf(DEG2RAD*(270+(180/(rings + 1))*i)), + cosf(DEG2RAD*(270+(180/(rings + 1))*i))*cosf(DEG2RAD*(j*360/slices))); } } rlEnd(); @@ -407,21 +407,21 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h // Draw Body ------------------------------------------------------------------------------------- for (int i = 0; i < 360; i += 360/sides) { - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); //Bottom Right - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i+360/sides))*radiusBottom); //Bottom Right + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusTop, height, cosf(DEG2RAD*(i+360/sides))*radiusTop); //Top Right - rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); //Top Left - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); //Bottom Left - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); //Top Right + rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); //Top Left + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); //Bottom Left + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusTop, height, cosf(DEG2RAD*(i+360/sides))*radiusTop); //Top Right } // Draw Cap -------------------------------------------------------------------------------------- for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); - rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusTop, height, cosf(DEG2RAD*(i+360/sides))*radiusTop); } } else @@ -430,8 +430,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, height, 0); - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i+360/sides))*radiusBottom); } } @@ -439,8 +439,8 @@ void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float h for (int i = 0; i < 360; i += 360/sides) { rlVertex3f(0, 0, 0); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); } rlEnd(); rlPopMatrix(); @@ -460,17 +460,17 @@ void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, fl for (int i = 0; i < 360; i += 360/sides) { - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i+360/sides))*radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusBottom, 0, cos(DEG2RAD*(i+360/sides))*radiusBottom); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusBottom, 0, cosf(DEG2RAD*(i+360/sides))*radiusBottom); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusTop, height, cosf(DEG2RAD*(i+360/sides))*radiusTop); - rlVertex3f(sin(DEG2RAD*(i+360/sides))*radiusTop, height, cos(DEG2RAD*(i+360/sides))*radiusTop); - rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); + rlVertex3f(sinf(DEG2RAD*(i+360/sides))*radiusTop, height, cosf(DEG2RAD*(i+360/sides))*radiusTop); + rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); - rlVertex3f(sin(DEG2RAD*i)*radiusTop, height, cos(DEG2RAD*i)*radiusTop); - rlVertex3f(sin(DEG2RAD*i)*radiusBottom, 0, cos(DEG2RAD*i)*radiusBottom); + rlVertex3f(sinf(DEG2RAD*i)*radiusTop, height, cosf(DEG2RAD*i)*radiusTop); + rlVertex3f(sinf(DEG2RAD*i)*radiusBottom, 0, cosf(DEG2RAD*i)*radiusBottom); } rlEnd(); rlPopMatrix(); diff --git a/src/raylib.h b/src/raylib.h index 5834d1c9..1433268b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -93,7 +93,7 @@ // Some basic Defines //---------------------------------------------------------------------------------- #ifndef PI - #define PI 3.14159265358979323846 + #define PI 3.14159265358979323846f #endif #define DEG2RAD (PI/180.0f) diff --git a/src/rlgl.c b/src/rlgl.c index e8607925..a754678c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2653,7 +2653,7 @@ void InitVrDevice(int vrDevice) hmd.hResolution = 2160; // HMD horizontal resolution in pixels hmd.vResolution = 1200; // HMD vertical resolution in pixels hmd.hScreenSize = 0.133793f; // HMD horizontal size in meters - hmd.vScreenSize = 0.0669; // HMD vertical size in meters + hmd.vScreenSize = 0.0669f; // HMD vertical size in meters hmd.vScreenCenter = 0.04678f; // HMD screen center in meters hmd.eyeToScreenDistance = 0.041f; // HMD distance between eye and display in meters hmd.lensSeparationDistance = 0.07f; // HMD lens separation distance in meters @@ -3786,8 +3786,8 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Compute lens parameters float lensShift = (hmd.hScreenSize*0.25f - hmd.lensSeparationDistance*0.5f)/hmd.hScreenSize; - float leftLensCenter[2] = { 0.25 + lensShift, 0.5f }; - float rightLensCenter[2] = { 0.75 - lensShift, 0.5f }; + float leftLensCenter[2] = { 0.25f + lensShift, 0.5f }; + float rightLensCenter[2] = { 0.75f - lensShift, 0.5f }; float leftScreenCenter[2] = { 0.25f, 0.5f }; float rightScreenCenter[2] = { 0.75f, 0.5f }; @@ -3804,8 +3804,8 @@ static void SetStereoConfig(VrDeviceInfo hmd) float normScreenWidth = 0.5f; float normScreenHeight = 1.0f; - float scaleIn[2] = { 2/normScreenWidth, 2/normScreenHeight/aspect }; - float scale[2] = { normScreenWidth*0.5/distortionScale, normScreenHeight*0.5*aspect/distortionScale }; + float scaleIn[2] = { 2.0f/normScreenWidth, 2.0f/normScreenHeight/aspect }; + float scale[2] = { normScreenWidth*0.5f/distortionScale, normScreenHeight*0.5f*aspect/distortionScale }; TraceLog(DEBUG, "VR: Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); TraceLog(DEBUG, "VR: Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); diff --git a/src/shapes.c b/src/shapes.c index 9fcbeff7..62076b2c 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -71,7 +71,7 @@ void DrawPixelV(Vector2 position, Color color) rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); rlVertex2f(position.x, position.y); - rlVertex2i(position.x + 1, position.y + 1); + rlVertex2f(position.x + 1.0f, position.y + 1.0f); rlEnd(); } @@ -98,7 +98,7 @@ void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) // Draw a color-filled circle void DrawCircle(int centerX, int centerY, float radius, Color color) { - DrawCircleV((Vector2){ centerX, centerY }, radius, color); + DrawCircleV((Vector2){ (float)centerX, (float)centerY }, radius, color); } // Draw a gradient-filled circle @@ -111,9 +111,9 @@ void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Co rlColor4ub(color1.r, color1.g, color1.b, color1.a); rlVertex2i(centerX, centerY); rlColor4ub(color2.r, color2.g, color2.b, color2.a); - rlVertex2f(centerX + sin(DEG2RAD*i)*radius, centerY + cos(DEG2RAD*i)*radius); + rlVertex2f(centerX + sinf(DEG2RAD*i)*radius, centerY + cosf(DEG2RAD*i)*radius); rlColor4ub(color2.r, color2.g, color2.b, color2.a); - rlVertex2f(centerX + sin(DEG2RAD*(i + 10))*radius, centerY + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radius, centerY + cosf(DEG2RAD*(i + 10))*radius); } rlEnd(); } @@ -130,8 +130,8 @@ void DrawCircleV(Vector2 center, float radius, Color color) rlColor4ub(color.r, color.g, color.b, color.a); rlVertex2f(center.x, center.y); - rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(center.x + sinf(DEG2RAD*i)*radius, center.y + cosf(DEG2RAD*i)*radius); + rlVertex2f(center.x + sinf(DEG2RAD*(i + 10))*radius, center.y + cosf(DEG2RAD*(i + 10))*radius); } rlEnd(); } @@ -145,9 +145,9 @@ void DrawCircleV(Vector2 center, float radius, Color color) rlColor4ub(color.r, color.g, color.b, color.a); rlVertex2f(center.x, center.y); - rlVertex2f(center.x + sin(DEG2RAD*i)*radius, center.y + cos(DEG2RAD*i)*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 10))*radius, center.y + cos(DEG2RAD*(i + 10))*radius); - rlVertex2f(center.x + sin(DEG2RAD*(i + 20))*radius, center.y + cos(DEG2RAD*(i + 20))*radius); + rlVertex2f(center.x + sinf(DEG2RAD*i)*radius, center.y + cosf(DEG2RAD*i)*radius); + rlVertex2f(center.x + sinf(DEG2RAD*(i + 10))*radius, center.y + cosf(DEG2RAD*(i + 10))*radius); + rlVertex2f(center.x + sinf(DEG2RAD*(i + 20))*radius, center.y + cosf(DEG2RAD*(i + 20))*radius); } rlEnd(); @@ -164,8 +164,8 @@ void DrawCircleLines(int centerX, int centerY, float radius, Color color) // NOTE: Circle outline is drawn pixel by pixel every degree (0 to 360) for (int i = 0; i < 360; i += 10) { - rlVertex2f(centerX + sin(DEG2RAD*i)*radius, centerY + cos(DEG2RAD*i)*radius); - rlVertex2f(centerX + sin(DEG2RAD*(i + 10))*radius, centerY + cos(DEG2RAD*(i + 10))*radius); + rlVertex2f(centerX + sinf(DEG2RAD*i)*radius, centerY + cosf(DEG2RAD*i)*radius); + rlVertex2f(centerX + sinf(DEG2RAD*(i + 10))*radius, centerY + cosf(DEG2RAD*(i + 10))*radius); } rlEnd(); } diff --git a/src/textures.c b/src/textures.c index fd5bdd80..323c0a8a 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1118,7 +1118,7 @@ Image ImageText(const char *text, int fontSize, Color color) if (fontSize < defaultFontSize) fontSize = defaultFontSize; int spacing = fontSize/defaultFontSize; - Image imText = ImageTextEx(GetDefaultFont(), text, fontSize, spacing, color); + Image imText = ImageTextEx(GetDefaultFont(), text, (float)fontSize, spacing, color); return imText; } @@ -1183,7 +1183,7 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color) { // NOTE: For default font, sapcing is set to desired font size / default font size (10) - ImageDrawTextEx(dst, position, GetDefaultFont(), text, fontSize, fontSize/10, color); + ImageDrawTextEx(dst, position, GetDefaultFont(), text, (float)fontSize, fontSize/10, color); } // Draw text (custom sprite font) within an image (destination) @@ -1317,7 +1317,7 @@ void ImageColorContrast(Image *image, float contrast) if (contrast < -100) contrast = -100; if (contrast > 100) contrast = 100; - contrast = (100.0 + contrast)/100.0; + contrast = (100.0f + contrast)/100.0f; contrast *= contrast; Color *pixels = GetImageData(*image); @@ -1326,7 +1326,7 @@ void ImageColorContrast(Image *image, float contrast) { for (int x = 0; x < image->width; x++) { - float pR = (float)pixels[y*image->width + x].r/255.0; + float pR = (float)pixels[y*image->width + x].r/255.0f; pR -= 0.5; pR *= contrast; pR += 0.5; @@ -1334,7 +1334,7 @@ void ImageColorContrast(Image *image, float contrast) if (pR < 0) pR = 0; if (pR > 255) pR = 255; - float pG = (float)pixels[y*image->width + x].g/255.0; + float pG = (float)pixels[y*image->width + x].g/255.0f; pG -= 0.5; pG *= contrast; pG += 0.5; @@ -1342,7 +1342,7 @@ void ImageColorContrast(Image *image, float contrast) if (pG < 0) pG = 0; if (pG > 255) pG = 255; - float pB = (float)pixels[y*image->width + x].b/255.0; + float pB = (float)pixels[y*image->width + x].b/255.0f; pB -= 0.5; pB *= contrast; pB += 0.5; -- cgit v1.2.3 From d5e0f4e84eb9c8281be7cae8a4a38c231fc4a664 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 17 Oct 2016 17:02:33 +0200 Subject: Added notes on vr tracking -> camera update --- src/rlgl.c | 24 ++++++++++++------------ src/rlgl.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index a754678c..80687958 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -372,11 +372,11 @@ static char *ReadTextFile(const char *fileName); // Read chars array from #if defined(RLGL_OCULUS_SUPPORT) #if !defined(RLGL_STANDALONE) -static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) -static void CloseOculusDevice(void); // Close Oculus device -static void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking -static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing -static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror +static bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) +static void CloseOculusDevice(void); // Close Oculus device +static void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking +static void BeginOculusDrawing(void); // Setup Oculus buffers for drawing +static void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror #endif static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height); // Load Oculus required buffers @@ -2735,15 +2735,11 @@ void ToggleVrMode(void) } // Update VR tracking (position and orientation) and camera +// NOTE: Camera (position, target, up) gets update with head tracking information void UpdateVrTracking(Camera *camera) { #if defined(RLGL_OCULUS_SUPPORT) - if (vrDeviceReady) - { - UpdateOculusTracking(); - - // TODO: Update camera data (position, target, up) with tracking data - } + if (vrDeviceReady) UpdateOculusTracking(camera); #endif } @@ -4083,7 +4079,7 @@ OCULUSAPI void CloseOculusDevice(void) } // Update Oculus head position-orientation tracking -OCULUSAPI void UpdateOculusTracking(void) +OCULUSAPI void UpdateOculusTracking(Camera *camera) { frameIndex++; @@ -4093,6 +4089,10 @@ OCULUSAPI void UpdateOculusTracking(void) layer.eyeLayer.RenderPose[0] = eyePoses[0]; layer.eyeLayer.RenderPose[1] = eyePoses[1]; + // TODO: Update external camera with eyePoses data (position, orientation) + // NOTE: We can simplify to simple camera if we consider IPD and HMD device configuration again later + // it will be useful for the user to draw, lets say, billboards oriented to camera + // Get session status information ovrSessionStatus sessionStatus; ovr_GetSessionStatus(session, &sessionStatus); diff --git a/src/rlgl.h b/src/rlgl.h index 3a47b4c8..d5a39aaf 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -381,7 +381,7 @@ void ToggleVrMode(void); // Enable/Disable VR experience (dev // Oculus Rift API for direct access the device (no simulator) bool InitOculusDevice(void); // Initialize Oculus device (returns true if success) void CloseOculusDevice(void); // Close Oculus device -void UpdateOculusTracking(void); // Update Oculus head position-orientation tracking +void UpdateOculusTracking(Camera *camera); // Update Oculus head position-orientation tracking (and camera) void BeginOculusDrawing(void); // Setup Oculus buffers for drawing void EndOculusDrawing(void); // Finish Oculus drawing and blit framebuffer to mirror #endif -- cgit v1.2.3 From 0ce7f0c4094fa8a6cc74c410aee37413034cb0b9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 17 Oct 2016 18:18:13 +0200 Subject: Some work on multiple inputs... - Corrected bug and tested new gamepad system - Reviewed Android key inputs system, unified with desktop - Reorganize mouse functions on core --- src/core.c | 199 ++++++++++++++++++++++++++++------------------------------- src/raylib.h | 36 +++++------ 2 files changed, 110 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 3bd85fdd..d044a66e 100644 --- a/src/core.c +++ b/src/core.c @@ -131,7 +131,7 @@ #endif #define MAX_GAMEPADS 4 // Max number of gamepads supported -#define MAX_GAMEPAD_BUTTONS 11 // Max bumber of buttons supported (per gamepad) +#define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) #define RL_LOAD_DEFAULT_FONT // Load default font on window initialization (module: text) @@ -158,9 +158,6 @@ static const char *internalDataPath; // Android internal data path to static bool windowReady = false; // Used to detect display initialization static bool appEnabled = true; // Used to detec if app is active static bool contextRebindRequired = false; // Used to know context rebind required - -static int previousButtonState[128] = { 1 }; // Required to check if button pressed/released once -static int currentButtonState[128] = { 1 }; // Required to check if button pressed/released once #endif #if defined(PLATFORM_RPI) @@ -203,10 +200,6 @@ static Matrix downscaleView; // Matrix to downscale view (in case static const char *windowTitle; // Window text title... static bool cursorOnScreen = false; // Tracks if cursor is inside client area -// Register keyboard states -static char previousKeyState[512] = { 0 }; // Registers previous frame key state -static char currentKeyState[512] = { 0 }; // Registers current frame key state - // Register mouse states static char previousMouseState[3] = { 0 }; // Registers previous mouse button state static char currentMouseState[3] = { 0 }; // Registers current mouse button state @@ -221,11 +214,16 @@ static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS] = { 0 }; // Keyboard configuration static int exitKey = KEY_ESCAPE; // Default exit key (ESC) -static int lastKeyPressed = -1; // Register last key pressed static bool cursorHidden; // Track if cursor is hidden #endif +// Register keyboard states +static char previousKeyState[512] = { 0 }; // Registers previous frame key state +static char currentKeyState[512] = { 0 }; // Registers current frame key state + +static int lastKeyPressed = -1; // Register last key pressed + static Vector2 mousePosition; // Mouse position on screen static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen @@ -526,6 +524,63 @@ int GetScreenHeight(void) return screenHeight; } +// Show mouse cursor +void ShowCursor() +{ +#if defined(PLATFORM_DESKTOP) + #ifdef __linux + XUndefineCursor(glfwGetX11Display(), glfwGetX11Window(window)); + #else + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); + #endif +#endif + cursorHidden = false; +} + +// Hide mouse cursor +void HideCursor() +{ +#if defined(PLATFORM_DESKTOP) + #ifdef __linux + XColor Col; + const char Nil[] = {0}; + + Pixmap Pix = XCreateBitmapFromData(glfwGetX11Display(), glfwGetX11Window(window), Nil, 1, 1); + Cursor Cur = XCreatePixmapCursor(glfwGetX11Display(), Pix, Pix, &Col, &Col, 0, 0); + + XDefineCursor(glfwGetX11Display(), glfwGetX11Window(window), Cur); + XFreeCursor(glfwGetX11Display(), Cur); + #else + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); + #endif +#endif + cursorHidden = true; +} + +// Check if mouse cursor is hidden +bool IsCursorHidden() +{ + return cursorHidden; +} + +// Enable mouse cursor +void EnableCursor() +{ +#if defined(PLATFORM_DESKTOP) + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); +#endif + cursorHidden = false; +} + +// Disable mouse cursor +void DisableCursor() +{ +#if defined(PLATFORM_DESKTOP) + glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); +#endif + cursorHidden = true; +} + // Sets Background Color void ClearBackground(Color color) { @@ -1050,8 +1105,13 @@ bool IsKeyPressed(int key) { bool pressed = false; +#if defined(PLATFORM_ANDROID) + if ((currentButtonState[key] != previousButtonState[key]) && (currentButtonState[key] == 0)) pressed = true; + else pressed = false; +#else if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 1)) pressed = true; else pressed = false; +#endif return pressed; } @@ -1067,9 +1127,14 @@ bool IsKeyDown(int key) bool IsKeyReleased(int key) { bool released = false; - + +#if defined(PLATFORM_ANDROID) + if ((currentButtonState[button] != previousButtonState[button]) && (currentButtonState[button] == 1)) released = true; + else released = false; +#else if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true; else released = false; +#endif return released; } @@ -1091,64 +1156,9 @@ int GetKeyPressed(void) // NOTE: default exitKey is ESCAPE void SetExitKey(int key) { +#if !defined(PLATFORM_ANDROID) exitKey = key; -} - -// Hide mouse cursor -void HideCursor() -{ -#if defined(PLATFORM_DESKTOP) - #ifdef __linux - XColor Col; - const char Nil[] = {0}; - - Pixmap Pix = XCreateBitmapFromData(glfwGetX11Display(), glfwGetX11Window(window), Nil, 1, 1); - Cursor Cur = XCreatePixmapCursor(glfwGetX11Display(), Pix, Pix, &Col, &Col, 0, 0); - - XDefineCursor(glfwGetX11Display(), glfwGetX11Window(window), Cur); - XFreeCursor(glfwGetX11Display(), Cur); - #else - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - #endif #endif - cursorHidden = true; -} - -// Show mouse cursor -void ShowCursor() -{ -#if defined(PLATFORM_DESKTOP) - #ifdef __linux - XUndefineCursor(glfwGetX11Display(), glfwGetX11Window(window)); - #else - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - #endif -#endif - cursorHidden = false; -} - -// Disable mouse cursor -void DisableCursor() -{ -#if defined(PLATFORM_DESKTOP) - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); -#endif - cursorHidden = true; -} - -// Enable mouse cursor -void EnableCursor() -{ -#if defined(PLATFORM_DESKTOP) - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -#endif - cursorHidden = false; -} - -// Check if mouse cursor is hidden -bool IsCursorHidden() -{ - return cursorHidden; } // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) @@ -1204,7 +1214,7 @@ bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 1)) result = true; return result; @@ -1387,37 +1397,6 @@ Vector2 GetTouchPosition(int index) return position; } -#if defined(PLATFORM_ANDROID) -// Detect if a button has been pressed once -bool IsButtonPressed(int button) -{ - bool pressed = false; - - if ((currentButtonState[button] != previousButtonState[button]) && (currentButtonState[button] == 0)) pressed = true; - else pressed = false; - - return pressed; -} - -// Detect if a button is being pressed (button held down) -bool IsButtonDown(int button) -{ - if (currentButtonState[button] == 0) return true; - else return false; -} - -// Detect if a button has been released once -bool IsButtonReleased(int button) -{ - bool released = false; - - if ((currentButtonState[button] != previousButtonState[button]) && (currentButtonState[button] == 1)) released = true; - else released = false; - - return released; -} -#endif - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- @@ -1900,8 +1879,9 @@ static bool GetKeyStatus(int key) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetKey(window, key); #elif defined(PLATFORM_ANDROID) - // TODO: Check for virtual keyboard - return false; + // NOTE: Android supports up to 260 keys + if (key < 0 || key > 260) return false; + else return currentKeyState[key]; #elif defined(PLATFORM_RPI) // NOTE: Keys states are filled in PollInputEvents() if (key < 0 || key > 511) return false; @@ -1929,6 +1909,9 @@ static void PollInputEvents(void) // NOTE: Gestures update must be called every frame to reset gestures correctly // because ProcessGestureEvent() is just called on an event, not every frame UpdateGestures(); + + // Reset last key pressed registered + lastKeyPressed = -1; #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // Mouse input polling @@ -1939,9 +1922,8 @@ static void PollInputEvents(void) mousePosition.x = (float)mouseX; mousePosition.y = (float)mouseY; - + // Keyboard input polling (automatically managed by GLFW3 through callback) - lastKeyPressed = -1; // Register previous keys states for (int i = 0; i < 512; i++) previousKeyState[i] = currentKeyState[i]; @@ -1971,7 +1953,7 @@ static void PollInputEvents(void) for (int k = 0; (buttons != NULL) && (k < buttonsCount) && (buttonsCount < MAX_GAMEPAD_BUTTONS); k++) { - if (buttons[i] == GLFW_PRESS) currentGamepadState[i][k] = 1; + if (buttons[k] == GLFW_PRESS) currentGamepadState[i][k] = 1; else currentGamepadState[i][k] = 0; } @@ -1994,7 +1976,8 @@ static void PollInputEvents(void) #if defined(PLATFORM_ANDROID) // Register previous keys states - for (int i = 0; i < 128; i++) previousButtonState[i] = currentButtonState[i]; + // NOTE: Android supports up to 260 keys + for (int i = 0; i < 260; i++) previousKeyState[i] = currentKeyState[i]; // Poll Events (registered events) // NOTE: Activity is paused if not enabled (appEnabled) @@ -2371,7 +2354,13 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) //int32_t AKeyEvent_getMetaState(event); // Save current button and its state - currentButtonState[keycode] = AKeyEvent_getAction(event); // Down = 0, Up = 1 + // NOTE: Android key action is 0 for down and 1 for up + if (AKeyEvent_getAction(event) == 0) + { + currentKeyState[keycode] = 1; // Key down + lastKeyPressed = keycode; + } + else currentKeyState[keycode] = 0; // Key up if (keycode == AKEYCODE_POWER) { diff --git a/src/raylib.h b/src/raylib.h index 1433268b..c1ac2416 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -174,6 +174,14 @@ #define KEY_Y 89 #define KEY_Z 90 +#if defined(PLATFORM_ANDROID) + // Android Physical Buttons + #define KEY_BACK 4 + #define KEY_MENU 82 + #define KEY_VOLUME_UP 24 + #define KEY_VOLUME_DOWN 25 +#endif + // Mouse Buttons #define MOUSE_LEFT_BUTTON 0 #define MOUSE_RIGHT_BUTTON 1 @@ -213,6 +221,13 @@ #define GAMEPAD_XBOX_BUTTON_RB 5 #define GAMEPAD_XBOX_BUTTON_SELECT 6 #define GAMEPAD_XBOX_BUTTON_START 7 +#define GAMEPAD_XBOX_BUTTON_UP 10 +#define GAMEPAD_XBOX_BUTTON_RIGHT 11 +#define GAMEPAD_XBOX_BUTTON_DOWN 12 +#define GAMEPAD_XBOX_BUTTON_LEFT 13 + +#define GAMEPAD_XBOX_AXIS_LEFT_X 0 +#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 #if defined(PLATFORM_RPI) #define GAMEPAD_XBOX_AXIS_DPAD_X 7 @@ -222,24 +237,11 @@ #define GAMEPAD_XBOX_AXIS_LT 2 #define GAMEPAD_XBOX_AXIS_RT 5 #else - #define GAMEPAD_XBOX_BUTTON_UP 10 - #define GAMEPAD_XBOX_BUTTON_DOWN 12 - #define GAMEPAD_XBOX_BUTTON_LEFT 13 - #define GAMEPAD_XBOX_BUTTON_RIGHT 11 #define GAMEPAD_XBOX_AXIS_RIGHT_X 4 #define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 #define GAMEPAD_XBOX_AXIS_LT_RT 2 #endif -#define GAMEPAD_XBOX_AXIS_LEFT_X 0 -#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 - -// Android Physic Buttons -#define ANDROID_BACK 4 -#define ANDROID_MENU 82 -#define ANDROID_VOLUME_UP 24 -#define ANDROID_VOLUME_DOWN 25 - // NOTE: MSC C++ compiler does not support compound literals (C99 feature) // Plain structures in C++ (without constructors) can be initialized from { } initializers. #ifdef __cplusplus @@ -648,7 +650,6 @@ RLAPI int StorageLoadValue(int position); // Storage loa //------------------------------------------------------------------------------------ // Input Handling Functions (Module: core) //------------------------------------------------------------------------------------ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once @@ -656,6 +657,7 @@ RLAPI bool IsKeyUp(int key); // Detect if a key RLAPI int GetKeyPressed(void); // Get latest key pressed RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis @@ -679,12 +681,6 @@ RLAPI int GetTouchX(void); // Returns touch p RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) -#if defined(PLATFORM_ANDROID) -bool IsButtonPressed(int button); // Detect if an android physic button has been pressed -bool IsButtonDown(int button); // Detect if an android physic button is being pressed -bool IsButtonReleased(int button); // Detect if an android physic button has been released -#endif - //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ -- cgit v1.2.3 From b8ce6805117bcd28f80ae92f7faa14abdcb2f741 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 18 Oct 2016 00:15:23 +0200 Subject: Improved Android support --- src/core.c | 21 ++++++--------------- src/raylib.h | 8 +++----- 2 files changed, 9 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index d044a66e..b8a8ac05 100644 --- a/src/core.c +++ b/src/core.c @@ -79,8 +79,7 @@ #endif #if defined(PLATFORM_ANDROID) - #include // Java native interface - #include // Android sensors functions + //#include // Android sensors functions (accelerometer, gyroscope, light...) #include // Defines AWINDOW_FLAG_FULLSCREEN and others #include // Defines basic app state struct and manages activity @@ -361,7 +360,7 @@ void InitWindow(int width, int height, const char *title) #if defined(PLATFORM_ANDROID) // Android activity initialization -void InitWindow(int width, int height, struct android_app *state) +void InitWindow(int width, int height, void *state) { TraceLog(INFO, "Initializing raylib (v1.6.0)"); @@ -370,7 +369,7 @@ void InitWindow(int width, int height, struct android_app *state) screenWidth = width; screenHeight = height; - app = state; + app = (struct android_app *)state; internalDataPath = app->activity->internalDataPath; // Set desired windows flags before initializing anything @@ -524,6 +523,7 @@ int GetScreenHeight(void) return screenHeight; } +#if !defined(PLATFORM_ANDROID) // Show mouse cursor void ShowCursor() { @@ -580,6 +580,7 @@ void DisableCursor() #endif cursorHidden = true; } +#endif // !defined(PLATFORM_ANDROID) // Sets Background Color void ClearBackground(Color color) @@ -1099,19 +1100,13 @@ Matrix GetCameraMatrix(Camera camera) //---------------------------------------------------------------------------------- // Module Functions Definition - Input (Keyboard, Mouse, Gamepad) Functions //---------------------------------------------------------------------------------- -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) // Detect if a key has been pressed once bool IsKeyPressed(int key) { bool pressed = false; -#if defined(PLATFORM_ANDROID) - if ((currentButtonState[key] != previousButtonState[key]) && (currentButtonState[key] == 0)) pressed = true; - else pressed = false; -#else if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 1)) pressed = true; else pressed = false; -#endif return pressed; } @@ -1128,13 +1123,8 @@ bool IsKeyReleased(int key) { bool released = false; -#if defined(PLATFORM_ANDROID) - if ((currentButtonState[button] != previousButtonState[button]) && (currentButtonState[button] == 1)) released = true; - else released = false; -#else if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true; else released = false; -#endif return released; } @@ -1161,6 +1151,7 @@ void SetExitKey(int key) #endif } +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) // Detect if a gamepad is available diff --git a/src/raylib.h b/src/raylib.h index c1ac2416..efb9a71c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -77,10 +77,6 @@ #define PLATFORM_DESKTOP #endif -#if defined(PLATFORM_ANDROID) - typedef struct android_app; // Define android_app struct (android_native_app_glue.h) -#endif - #if defined(_WIN32) && defined(BUILDING_DLL) #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 DLL #elif defined(_WIN32) && defined(RAYLIB_DLL) @@ -591,7 +587,7 @@ extern "C" { // Prevents name mangling of functions // Window and Graphics Device Functions (Module: core) //------------------------------------------------------------------------------------ #if defined(PLATFORM_ANDROID) -RLAPI void InitWindow(int width, int height, struct android_app *state); // Init Android Activity and OpenGL Graphics +RLAPI void InitWindow(int width, int height, void *state); // Init Android Activity and OpenGL Graphics (struct android_app) #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) RLAPI void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics #endif @@ -603,11 +599,13 @@ RLAPI void ToggleFullscreen(void); // Fullscreen RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height +#if !defined(PLATFORM_ANDROID) RLAPI void ShowCursor(void); // Shows cursor RLAPI void HideCursor(void); // Hides cursor RLAPI bool IsCursorHidden(void); // Returns true if cursor is not visible RLAPI void EnableCursor(void); // Enables cursor RLAPI void DisableCursor(void); // Disables cursor +#endif RLAPI void ClearBackground(Color color); // Sets Background Color RLAPI void BeginDrawing(void); // Setup drawing canvas to start drawing -- cgit v1.2.3 From 1142d4edae645f9e5b235c2c3278a8d16a1f97cf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 24 Oct 2016 19:08:23 +0200 Subject: Force threads to finish on CloseWindow() --- src/core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index b8a8ac05..dd005836 100644 --- a/src/core.c +++ b/src/core.c @@ -463,6 +463,9 @@ void CloseWindow(void) // Wait for mouse and gamepad threads to finish before closing // NOTE: Those threads should already have finished at this point // because they are controlled by windowShouldClose variable + + windowShouldClose = true; // Added to force threads to exit when the close window is called + pthread_join(mouseThreadId, NULL); pthread_join(gamepadThreadId, NULL); #endif -- cgit v1.2.3 From 6d34adbd60631001c124ebe48d8d059a5ee8d3d8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 24 Oct 2016 19:11:29 +0200 Subject: Improving sprite fonts support... Support grayscale (8 bit) textures for fonts Load unordered chars data above char 126 --- src/text.c | 31 +++++++++++++++++++++++-------- src/textures.c | 37 +++++++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index d1d7602f..02bc1fe6 100644 --- a/src/text.c +++ b/src/text.c @@ -355,7 +355,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float else rec = spriteFont.charRecs[(int)text[i] - FONT_FIRST_CHAR]; } - if (rec.x > 0) + if (rec.x >= 0) { DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].x*scaleFactor, position.y + textOffsetY + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].y*scaleFactor, @@ -811,8 +811,12 @@ static SpriteFont LoadBMFont(const char *fileName) strncat(texPath, texFileName, strlen(texFileName)); TraceLog(DEBUG, "[%s] Font texture loading path: %s", fileName, texPath); + + Image imFont = LoadImage(texPath); + + if (imFont.format == UNCOMPRESSED_GRAYSCALE) ImageAlphaMask(&imFont, imFont); - font.texture = LoadTexture(texPath); + font.texture = LoadTextureFromImage(imFont); font.size = fontSize; font.numChars = numChars; font.charValues = (int *)malloc(numChars*sizeof(int)); @@ -820,12 +824,14 @@ static SpriteFont LoadBMFont(const char *fileName) font.charOffsets = (Vector2 *)malloc(numChars*sizeof(Vector2)); font.charAdvanceX = (int *)malloc(numChars*sizeof(int)); + UnloadImage(imFont); + free(texPath); int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; bool unorderedChars = false; - int firstChar = 0; + int firstChar = 32; for (int i = 0; i < numChars; i++) { @@ -833,8 +839,20 @@ static SpriteFont LoadBMFont(const char *fileName) sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", &charId, &charX, &charY, &charWidth, &charHeight, &charOffsetX, &charOffsetY, &charAdvanceX); - if (i == 0) firstChar = charId; - else if (i != (charId - firstChar)) unorderedChars = true; + if ((i == 0) && (charId != FONT_FIRST_CHAR)) + { + TraceLog(WARNING, "BMFont not supported: expected SPACE(32) as first character, falling back to default font"); + firstChar = charId; + break; + } + else if ((i < (126 - FONT_FIRST_CHAR)) && (i != (charId - FONT_FIRST_CHAR))) + { + // NOTE: We expect the first 95 chars (32..126) to be ordered for quick drawing access, + // characters above are stored and we look for them (search algorythm) when drawing + TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); + unorderedChars = true; + break; + } // Save data properly in sprite font font.charValues[i] = charId; @@ -845,9 +863,6 @@ static SpriteFont LoadBMFont(const char *fileName) fclose(fntFile); - if (firstChar != FONT_FIRST_CHAR) TraceLog(WARNING, "BMFont not supported: expected SPACE(32) as first character, falling back to default font"); - else if (unorderedChars) TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); - // NOTE: Font data could be not ordered by charId: 32,33,34,35... raylib does not support unordered BMFonts if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars) || (font.texture.id == 0)) { diff --git a/src/textures.c b/src/textures.c index 323c0a8a..eab443b6 100644 --- a/src/textures.c +++ b/src/textures.c @@ -694,28 +694,45 @@ void ImageFormat(Image *image, int newFormat) } // Apply alpha mask to image -// NOTE 1: Returned image is RGBA - 32bit +// NOTE 1: Returned image is GRAY_ALPHA (16bit) or RGBA (32bit) // NOTE 2: alphaMask should be same size as image void ImageAlphaMask(Image *image, Image alphaMask) { - if (image->format >= COMPRESSED_DXT1_RGB) + if ((image->width != alphaMask.width) || (image->height != alphaMask.height)) + { + TraceLog(WARNING, "Alpha mask must be same size as image"); + } + else if (image->format >= COMPRESSED_DXT1_RGB) { TraceLog(WARNING, "Alpha mask can not be applied to compressed data formats"); - return; } else { // Force mask to be Grayscale Image mask = ImageCopy(alphaMask); - ImageFormat(&mask, UNCOMPRESSED_GRAYSCALE); + if (mask.format != UNCOMPRESSED_GRAYSCALE) ImageFormat(&mask, UNCOMPRESSED_GRAYSCALE); - // Convert image to RGBA - if (image->format != UNCOMPRESSED_R8G8B8A8) ImageFormat(image, UNCOMPRESSED_R8G8B8A8); - - // Apply alpha mask to alpha channel - for (int i = 0, k = 3; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 4) + // In case image is only grayscale, we just add alpha channel + if (image->format == UNCOMPRESSED_GRAYSCALE) + { + ImageFormat(image, UNCOMPRESSED_GRAY_ALPHA); + + // Apply alpha mask to alpha channel + for (int i = 0, k = 1; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 2) + { + ((unsigned char *)image->data)[k] = ((unsigned char *)mask.data)[i]; + } + } + else { - ((unsigned char *)image->data)[k] = ((unsigned char *)mask.data)[i]; + // Convert image to RGBA + if (image->format != UNCOMPRESSED_R8G8B8A8) ImageFormat(image, UNCOMPRESSED_R8G8B8A8); + + // Apply alpha mask to alpha channel + for (int i = 0, k = 3; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 4) + { + ((unsigned char *)image->data)[k] = ((unsigned char *)mask.data)[i]; + } } UnloadImage(mask); -- cgit v1.2.3 From 137057f499f0c6a15ad7e306f27fc4d5c02933be Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 27 Oct 2016 13:39:47 +0200 Subject: Function added: GenSpriteFont() --- src/text.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/text.c b/src/text.c index 02bc1fe6..5e978823 100644 --- a/src/text.c +++ b/src/text.c @@ -272,6 +272,27 @@ SpriteFont LoadSpriteFont(const char *fileName) return spriteFont; } +// Generate SpriteFont from TTF file +// NOTE: You can pass an array with desired characters, those characters should be available in the font +// if array is NULL, default char set is selected 32..126 +SpriteFont GenSpriteFont(const char *fileName, int fontSize, int *fontChars) +{ + SpriteFont spriteFont = { 0 }; + + if (strcmp(GetExtension(fileName),"ttf") == 0) + { + spriteFont = LoadTTF(fileName, fontSize, FONT_FIRST_CHAR, DEFAULT_TTF_NUMCHARS); + } + + if (spriteFont.texture.id == 0) + { + TraceLog(WARNING, "[%s] SpriteFont could not be generated, using default font", fileName); + spriteFont = GetDefaultFont(); + } + + return spriteFont; +} + // Unload SpriteFont from GPU memory void UnloadSpriteFont(SpriteFont spriteFont) { @@ -288,6 +309,7 @@ void UnloadSpriteFont(SpriteFont spriteFont) } } + // Draw text (using default font) // NOTE: fontSize work like in any drawing program but if fontSize is lower than font-base-size, then font-base-size is used // NOTE: chars spacing is proportional to fontSize -- cgit v1.2.3 From 5c80f650827337af8054446b21424d39349606d9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 27 Oct 2016 13:40:17 +0200 Subject: Funtions added to set texture parameters SetTextureFilter() SetTextureWrap() --- src/textures.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index eab443b6..867e565d 100644 --- a/src/textures.c +++ b/src/textures.c @@ -442,6 +442,20 @@ void UnloadRenderTexture(RenderTexture2D target) if (target.id != 0) rlDeleteRenderTextures(target); } +// Set texture scale filter +void SetTextureFilter(Texture2D texture, int filterMode) +{ + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, filterMode); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, filterMode); +} + +// Set texture wrap mode +void SetTextureWrap(Texture2D texture, int wrapMode) +{ + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, wrapMode); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, wrapMode); +} + // Get pixel data from image in the form of Color struct array Color *GetImageData(Image image) { -- cgit v1.2.3 From 4ff98f34bbc3233f5eca61dfe07c2336c52918ce Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 27 Oct 2016 13:40:48 +0200 Subject: Function to set texture parameters -IN PROGRESS- --- src/rlgl.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/rlgl.h | 11 +++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 80687958..0a7e3583 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -871,6 +871,48 @@ void rlDisableTexture(void) #endif } +// Set texture parameters +// TODO: Review this function to choose right filter/wrap value +void rlTextureParameters(unsigned int id, int param, int value) +{ +/* +// TextureWrapMode +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F + +// TextureMagFilter +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +// TextureMinFilter +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +*/ + + int glValue = 0; + + glBindTexture(GL_TEXTURE_2D, id); + + switch (value) + { + case FILTER_POINT: glValue = GL_NEAREST; break; + case FILTER_BILINEAR: glValue = GL_LINEAR; break; + case FILTER_TRILINEAR: glValue = GL_LINEAR; break; + //case WRAP_REPEAT: glValue = GL_REPEAT; break; + //case WRAP_CLAMP: glValue = GL_CLAMP_TO_EDGE; break; + //case WRAP_MIRROR: glValue = GL_NEAREST; break; + default: break; + } + + glTexParameteri(GL_TEXTURE_2D, param, glValue); + + glBindTexture(GL_TEXTURE_2D, 0); +} + // Enable rendering to texture (fbo) void rlEnableRenderTexture(unsigned int id) { diff --git a/src/rlgl.h b/src/rlgl.h index d5a39aaf..b6679ef6 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -90,15 +90,21 @@ #define MAX_QUADS_BATCH 1024 // Be careful with text, every letter maps a quad #endif +// Texture parameters (equivalent to OpenGL defines) +#define RL_TEXTURE_MAG_FILTER 0x2800 +#define RL_TEXTURE_MIN_FILTER 0x2801 +#define RL_TEXTURE_WRAP_S 0x2802 +#define RL_TEXTURE_WRAP_T 0x2803 + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- +typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; + typedef enum { RL_PROJECTION, RL_MODELVIEW, RL_TEXTURE } MatrixMode; typedef enum { RL_LINES, RL_TRIANGLES, RL_QUADS } DrawMode; -typedef enum { OPENGL_11 = 1, OPENGL_21, OPENGL_33, OPENGL_ES_20 } GlVersion; - #if defined(RLGL_STANDALONE) #ifndef __cplusplus // Boolean type @@ -296,6 +302,7 @@ void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) //------------------------------------------------------------------------------------ void rlEnableTexture(unsigned int id); // Enable texture usage void rlDisableTexture(void); // Disable texture usage +void rlTextureParameters(unsigned int id, int param, int value); // Set texture parameters (filter, wrap) void rlEnableRenderTexture(unsigned int id); // Enable render texture (fbo) void rlDisableRenderTexture(void); // Disable render texture (fbo), return to default framebuffer void rlEnableDepthTest(void); // Enable depth test -- cgit v1.2.3 From 02842a3e2fefe122baaf40da1bcae5548239d570 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 27 Oct 2016 13:41:43 +0200 Subject: Review gamepad inputs Added funtion: GetGamepadButtonPressed() - This function can be useful for custom gamepad configuration --- src/core.c | 19 ++++++++++++++++++- src/raylib.h | 61 ++++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 61 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index dd005836..8646bf8f 100644 --- a/src/core.c +++ b/src/core.c @@ -222,6 +222,7 @@ static char previousKeyState[512] = { 0 }; // Registers previous frame key stat static char currentKeyState[512] = { 0 }; // Registers current frame key state static int lastKeyPressed = -1; // Register last key pressed +static int lastGamepadButtonPressed = -1; // Register last gamepad button pressed static Vector2 mousePosition; // Mouse position on screen static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen @@ -1236,6 +1237,13 @@ bool IsGamepadButtonUp(int gamepad, int button) return result; } + +// Get the last gamepad button pressed +int GetGamepadButtonPressed(void) +{ + return lastGamepadButtonPressed; +} + #endif //defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) @@ -1906,6 +1914,9 @@ static void PollInputEvents(void) // Reset last key pressed registered lastKeyPressed = -1; + + // Reset last gamepad button pressed registered + lastGamepadButtonPressed = -1; #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // Mouse input polling @@ -1947,7 +1958,11 @@ static void PollInputEvents(void) for (int k = 0; (buttons != NULL) && (k < buttonsCount) && (buttonsCount < MAX_GAMEPAD_BUTTONS); k++) { - if (buttons[k] == GLFW_PRESS) currentGamepadState[i][k] = 1; + if (buttons[k] == GLFW_PRESS) + { + currentGamepadState[i][k] = 1; + lastGamepadButtonPressed = k; + } else currentGamepadState[i][k] = 0; } @@ -2801,6 +2816,8 @@ static void *GamepadThread(void *arg) { // 1 - button pressed, 0 - button released currentGamepadState[i][gamepadEvent.number] = (int)gamepadEvent.value; + + if ((int)gamepadEvent.value == 1) lastGamepadButtonPressed = gamepadEvent.number; } } else if (gamepadEvent.type == JS_EVENT_AXIS) diff --git a/src/raylib.h b/src/raylib.h index efb9a71c..491923dc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -192,21 +192,32 @@ #define GAMEPAD_PLAYER3 2 #define GAMEPAD_PLAYER4 3 -// Gamepad Buttons +// Gamepad Buttons/Axis -// PS3 USB Controller -#define GAMEPAD_PS3_BUTTON_A 2 -#define GAMEPAD_PS3_BUTTON_B 1 -#define GAMEPAD_PS3_BUTTON_X 3 -#define GAMEPAD_PS3_BUTTON_Y 4 +// PS3 USB Controller Buttons +#define GAMEPAD_PS3_BUTTON_TRIANGLE 0 +#define GAMEPAD_PS3_BUTTON_CIRCLE 1 +#define GAMEPAD_PS3_BUTTON_CROSS 2 +#define GAMEPAD_PS3_BUTTON_SQUARE 3 +#define GAMEPAD_PS3_BUTTON_L1 6 #define GAMEPAD_PS3_BUTTON_R1 7 +#define GAMEPAD_PS3_BUTTON_L2 4 #define GAMEPAD_PS3_BUTTON_R2 5 -#define GAMEPAD_PS3_BUTTON_L1 6 -#define GAMEPAD_PS3_BUTTON_L2 8 +#define GAMEPAD_PS3_BUTTON_START 8 #define GAMEPAD_PS3_BUTTON_SELECT 9 -#define GAMEPAD_PS3_BUTTON_START 10 - -// TODO: Add PS3 d-pad axis +#define GAMEPAD_PS3_BUTTON_UP 24 +#define GAMEPAD_PS3_BUTTON_RIGHT 25 +#define GAMEPAD_PS3_BUTTON_DOWN 26 +#define GAMEPAD_PS3_BUTTON_LEFT 27 +#define GAMEPAD_PS3_BUTTON_PS 12 + +// PS3 USB Controller Axis +#define GAMEPAD_PS3_AXIS_LEFT_X 0 +#define GAMEPAD_PS3_AXIS_LEFT_Y 1 +#define GAMEPAD_PS3_AXIS_RIGHT_X 2 +#define GAMEPAD_PS3_AXIS_RIGHT_Y 5 +#define GAMEPAD_PS3_AXIS_L2 3 // 1.0(not pressed) --> -1.0(completely pressed) +#define GAMEPAD_PS3_AXIS_R2 4 // 1.0(not pressed) --> -1.0(completely pressed) // Xbox360 USB Controller Buttons #define GAMEPAD_XBOX_BUTTON_A 0 @@ -221,22 +232,27 @@ #define GAMEPAD_XBOX_BUTTON_RIGHT 11 #define GAMEPAD_XBOX_BUTTON_DOWN 12 #define GAMEPAD_XBOX_BUTTON_LEFT 13 +#define GAMEPAD_XBOX_BUTTON_HOME 9 +// Xbox360 USB Controller Axis #define GAMEPAD_XBOX_AXIS_LEFT_X 0 #define GAMEPAD_XBOX_AXIS_LEFT_Y 1 +#define GAMEPAD_XBOX_AXIS_RIGHT_X 2 +#define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 +#define GAMEPAD_XBOX_AXIS_LT 4 // -1.0(not pressed) --> 1.0(completely pressed) +#define GAMEPAD_XBOX_AXIS_RT 5 // -1.0(not pressed) --> 1.0(completely pressed) +/* +// NOTE: For Raspberry Pi, axis must be reconfigured #if defined(PLATFORM_RPI) - #define GAMEPAD_XBOX_AXIS_DPAD_X 7 - #define GAMEPAD_XBOX_AXIS_DPAD_Y 6 + #define GAMEPAD_XBOX_AXIS_LEFT_X 7 + #define GAMEPAD_XBOX_AXIS_LEFT_Y 6 #define GAMEPAD_XBOX_AXIS_RIGHT_X 3 #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 #define GAMEPAD_XBOX_AXIS_LT 2 #define GAMEPAD_XBOX_AXIS_RT 5 -#else - #define GAMEPAD_XBOX_AXIS_RIGHT_X 4 - #define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 - #define GAMEPAD_XBOX_AXIS_LT_RT 2 #endif +*/ // NOTE: MSC C++ compiler does not support compound literals (C99 feature) // Plain structures in C++ (without constructors) can be initialized from { } initializers. @@ -533,6 +549,12 @@ typedef enum { COMPRESSED_ASTC_8x8_RGBA // 2 bpp } TextureFormat; +// Texture parameters: filter mode +typedef enum { FILTER_POINT = 0, FILTER_BILINEAR, FILTER_TRILINEAR } TextureFilterMode; + +// Texture parameters: wrap mode +typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; + // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; @@ -663,6 +685,7 @@ RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gam RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed #endif RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once @@ -752,6 +775,7 @@ RLAPI void UnloadTexture(Texture2D texture); RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image +RLAPI void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image @@ -773,7 +797,8 @@ RLAPI void ImageColorGrayscale(Image *image); RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) RLAPI void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture -RLAPI void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data +RLAPI void SetTextureFilter(Texture2D texture, int filterMode); +RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 -- cgit v1.2.3 From 43fd9ffe08025a82b79ce41c22c6ae82feb2c9aa Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 29 Oct 2016 22:16:54 +0200 Subject: Tweak to avoid warnings --- src/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 8646bf8f..b8574f0a 100644 --- a/src/core.c +++ b/src/core.c @@ -208,8 +208,8 @@ static int currentMouseWheelY = 0; // Registers current mouse wheel var // Register gamepads states static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready static float gamepadAxisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state -static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS] = { 0 }; -static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS] = { 0 }; +static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state +static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state // Keyboard configuration static int exitKey = KEY_ESCAPE; // Default exit key (ESC) -- cgit v1.2.3 From 988d39029f9c562ae044e4b5b0d129c367ffbe16 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 29 Oct 2016 22:17:19 +0200 Subject: Support textures filtering --- src/raylib.h | 15 ++++++++-- src/rlgl.c | 88 +++++++++++++++++++++++++++++++++++----------------------- src/rlgl.h | 35 ++++++++++++++++++++--- src/textures.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 178 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 491923dc..b0ee96bb 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -550,7 +550,16 @@ typedef enum { } TextureFormat; // Texture parameters: filter mode -typedef enum { FILTER_POINT = 0, FILTER_BILINEAR, FILTER_TRILINEAR } TextureFilterMode; +// NOTE 1: Filtering considers mipmaps if available in the texture +// NOTE 2: Filter is accordingly set for minification and magnification +typedef enum { + FILTER_POINT = 0, // No filter, just pixel aproximation + FILTER_BILINEAR, // Linear filtering + FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) + FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x + FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x + FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x +} TextureFilterMode; // Texture parameters: wrap mode typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; @@ -797,8 +806,8 @@ RLAPI void ImageColorGrayscale(Image *image); RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) RLAPI void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture -RLAPI void SetTextureFilter(Texture2D texture, int filterMode); -RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); +RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 diff --git a/src/rlgl.c b/src/rlgl.c index 0a7e3583..492ca3a6 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -140,6 +140,14 @@ #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93b7 #endif +#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT + #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#endif + #if defined(GRAPHICS_API_OPENGL_11) #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 @@ -283,14 +291,21 @@ static Shader standardShader; // Shader with support for lighting static Shader currentShader; // Shader to be used on rendering (by default, defaultShader) static bool standardShaderLoaded = false; // Flag to track if standard shader has been loaded -// Flags for supported extensions +// Extension supported flag: VAO static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) -// Compressed textures support flags +// Extension supported flag: Compressed textures static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support + +// Extension supported flag: Anisotropic filtering +static bool texAnisotropicFilterSupported = false; // Anisotropic texture filtering support +static float maxAnisotropicLevel = 0.0f; // Maximum anisotropy level supported (minimum is 2.0f) + +// Extension supported flag: Clamp mirror wrap mode +static bool texClampMirrorSupported = false; // Clamp mirror wrap mode supported #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -871,45 +886,34 @@ void rlDisableTexture(void) #endif } -// Set texture parameters -// TODO: Review this function to choose right filter/wrap value +// Set texture parameters (wrap mode/filter mode) void rlTextureParameters(unsigned int id, int param, int value) { -/* -// TextureWrapMode -#define GL_REPEAT 0x2901 -#define GL_CLAMP_TO_EDGE 0x812F - -// TextureMagFilter -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 - -// TextureMinFilter -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -*/ - - int glValue = 0; - glBindTexture(GL_TEXTURE_2D, id); - - switch (value) + + switch (param) { - case FILTER_POINT: glValue = GL_NEAREST; break; - case FILTER_BILINEAR: glValue = GL_LINEAR; break; - case FILTER_TRILINEAR: glValue = GL_LINEAR; break; - //case WRAP_REPEAT: glValue = GL_REPEAT; break; - //case WRAP_CLAMP: glValue = GL_CLAMP_TO_EDGE; break; - //case WRAP_MIRROR: glValue = GL_NEAREST; break; + case RL_TEXTURE_WRAP_S: + case RL_TEXTURE_WRAP_T: + { + if ((value == RL_WRAP_CLAMP_MIRROR) && !texClampMirrorSupported) TraceLog(WARNING, "Clamp mirror wrap mode not supported"); + else glTexParameteri(GL_TEXTURE_2D, param, value); + } break; + case RL_TEXTURE_MAG_FILTER: + case RL_TEXTURE_MIN_FILTER: glTexParameteri(GL_TEXTURE_2D, param, value); break; + case RL_TEXTURE_ANISOTROPIC_FILTER: + { + if (value <= maxAnisotropicLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, value); + else if (maxAnisotropicLevel > 0.0f) + { + TraceLog(WARNING, "[TEX ID %i] Maximum anisotropic filter level supported is %iX", id, maxAnisotropicLevel); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, value); + } + else TraceLog(WARNING, "Anisotropic filtering not supported"); + } break; default: break; } - glTexParameteri(GL_TEXTURE_2D, param, glValue); - glBindTexture(GL_TEXTURE_2D, 0); } @@ -1166,7 +1170,7 @@ void rlglInit(int width, int height) // Check NPOT textures support // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) npotSupported = true; -#endif +#endif // DDS texture compression support if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || @@ -1185,6 +1189,16 @@ void rlglInit(int width, int height) // ASTC texture compression support if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) texCompASTCSupported = true; + + // Anisotropic texture filter support + if (strcmp(extList[i], (const char *)"GL_EXT_texture_filter_anisotropic") == 0) + { + texAnisotropicFilterSupported = true; + glGetFloatv(0x84FF, &maxAnisotropicLevel); // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + } + + // Clamp mirror wrap mode supported + if (strcmp(extList[i], (const char *)"GL_EXT_texture_mirror_clamp") == 0) texClampMirrorSupported = true; } #ifdef _MSC_VER @@ -1204,6 +1218,9 @@ void rlglInit(int width, int height) if (texCompETC2Supported) TraceLog(INFO, "[EXTENSION] ETC2/EAC compressed textures supported"); if (texCompPVRTSupported) TraceLog(INFO, "[EXTENSION] PVRT compressed textures supported"); if (texCompASTCSupported) TraceLog(INFO, "[EXTENSION] ASTC compressed textures supported"); + + if (texAnisotropicFilterSupported) TraceLog(INFO, "[EXTENSION] Anisotropic textures filtering supported (max: %.0fX)", maxAnisotropicLevel); + if (texClampMirrorSupported) TraceLog(INFO, "[EXTENSION] Clamp mirror wrap texture mode supported"); // Initialize buffers, default shaders and default textures //---------------------------------------------------------- @@ -1729,6 +1746,7 @@ void rlglGenerateMipmaps(Texture2D texture) #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) + //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically TraceLog(INFO, "[TEX ID %i] Mipmaps generated automatically", texture.id); diff --git a/src/rlgl.h b/src/rlgl.h index b6679ef6..9be73f36 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -91,10 +91,22 @@ #endif // Texture parameters (equivalent to OpenGL defines) -#define RL_TEXTURE_MAG_FILTER 0x2800 -#define RL_TEXTURE_MIN_FILTER 0x2801 -#define RL_TEXTURE_WRAP_S 0x2802 -#define RL_TEXTURE_WRAP_T 0x2803 +#define RL_TEXTURE_WRAP_S 0x2802 // GL_TEXTURE_WRAP_S +#define RL_TEXTURE_WRAP_T 0x2803 // GL_TEXTURE_WRAP_T +#define RL_TEXTURE_MAG_FILTER 0x2800 // GL_TEXTURE_MAG_FILTER +#define RL_TEXTURE_MIN_FILTER 0x2801 // GL_TEXTURE_MIN_FILTER +#define RL_TEXTURE_ANISOTROPIC_FILTER 0x3000 // Anisotropic filter (custom identifier) + +#define RL_FILTER_NEAREST 0x2600 // GL_NEAREST +#define RL_FILTER_LINEAR 0x2601 // GL_LINEAR +#define RL_FILTER_MIP_NEAREST 0x2700 // GL_NEAREST_MIPMAP_NEAREST +#define RL_FILTER_NEAREST_MIP_LINEAR 0x2702 // GL_NEAREST_MIPMAP_LINEAR +#define RL_FILTER_LINEAR_MIP_NEAREST 0x2701 // GL_LINEAR_MIPMAP_NEAREST +#define RL_FILTER_MIP_LINEAR 0x2703 // GL_LINEAR_MIPMAP_LINEAR + +#define RL_WRAP_REPEAT 0x2901 // GL_REPEAT +#define RL_WRAP_CLAMP 0x812F // GL_CLAMP_TO_EDGE +#define RL_WRAP_CLAMP_MIRROR 0x8742 // GL_MIRROR_CLAMP_EXT //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -242,6 +254,21 @@ typedef enum { RL_LINES, RL_TRIANGLES, RL_QUADS } DrawMode; // Light types typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; + + // Texture parameters: filter mode + // NOTE 1: Filtering considers mipmaps if available in the texture + // NOTE 2: Filter is accordingly set for minification and magnification + typedef enum { + FILTER_POINT = 0, // No filter, just pixel aproximation + FILTER_BILINEAR, // Linear filtering + FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) + FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x + FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x + FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x + } TextureFilterMode; + + // Texture parameters: wrap mode + typedef enum { WRAP_REPEAT = 0, WRAP_CLAMP, WRAP_MIRROR } TextureWrapMode; // Color blending modes (pre-defined) typedef enum { BLEND_ALPHA = 0, BLEND_ADDITIVE, BLEND_MULTIPLIED } BlendMode; diff --git a/src/textures.c b/src/textures.c index 867e565d..729756a5 100644 --- a/src/textures.c +++ b/src/textures.c @@ -442,18 +442,94 @@ void UnloadRenderTexture(RenderTexture2D target) if (target.id != 0) rlDeleteRenderTextures(target); } -// Set texture scale filter +// Set texture scaling filter mode void SetTextureFilter(Texture2D texture, int filterMode) { - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, filterMode); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, filterMode); + switch (filterMode) + { + case FILTER_POINT: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_NEAREST); + + // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + } + else + { + // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_NEAREST); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + } + } break; + case FILTER_BILINEAR: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) + // Alternative: RL_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR_MIP_NEAREST); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + else + { + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + } break; + case FILTER_TRILINEAR: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + else + { + TraceLog(WARNING, "[TEX ID %i] No mipmaps available for TRILINEAR texture filtering", texture.id); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + } break; + case FILTER_ANISOTROPIC_4X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 4); break; + case FILTER_ANISOTROPIC_8X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 8); break; + case FILTER_ANISOTROPIC_16X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 16); break; + default: break; + } } -// Set texture wrap mode +// Set texture wrapping mode void SetTextureWrap(Texture2D texture, int wrapMode) { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, wrapMode); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, wrapMode); + switch (wrapMode) + { + case WRAP_REPEAT: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_REPEAT); + } break; + case WRAP_CLAMP: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP); + } break; + case WRAP_MIRROR: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP_MIRROR); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP_MIRROR); + } break; + default: break; + } } // Get pixel data from image in the form of Color struct array -- cgit v1.2.3 From 836d3341a52f1580ce5ea1b2d691b1988b109b9f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 31 Oct 2016 13:54:37 +0100 Subject: Renamed OpenAL32 dll library --- src/external/openal_soft/lib/win32/libOpenAL32.dll.a | Bin 100246 -> 0 bytes src/external/openal_soft/lib/win32/libOpenAL32dll.a | Bin 0 -> 100246 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/external/openal_soft/lib/win32/libOpenAL32.dll.a create mode 100644 src/external/openal_soft/lib/win32/libOpenAL32dll.a (limited to 'src') diff --git a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a b/src/external/openal_soft/lib/win32/libOpenAL32.dll.a deleted file mode 100644 index 1c4c63c8..00000000 Binary files a/src/external/openal_soft/lib/win32/libOpenAL32.dll.a and /dev/null differ diff --git a/src/external/openal_soft/lib/win32/libOpenAL32dll.a b/src/external/openal_soft/lib/win32/libOpenAL32dll.a new file mode 100644 index 00000000..1c4c63c8 Binary files /dev/null and b/src/external/openal_soft/lib/win32/libOpenAL32dll.a differ -- cgit v1.2.3 From 16101ce3d8c601447f935056b09a36ea3afefe7d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 31 Oct 2016 13:56:57 +0100 Subject: Reorganize defines check --- src/core.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index b8574f0a..9bb7b8cf 100644 --- a/src/core.c +++ b/src/core.c @@ -198,6 +198,7 @@ static Matrix downscaleView; // Matrix to downscale view (in case #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... static bool cursorOnScreen = false; // Tracks if cursor is inside client area +static bool cursorHidden = false; // Track if cursor is hidden // Register mouse states static char previousMouseState[3] = { 0 }; // Registers previous mouse button state @@ -213,8 +214,6 @@ static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Curre // Keyboard configuration static int exitKey = KEY_ESCAPE; // Default exit key (ESC) - -static bool cursorHidden; // Track if cursor is hidden #endif // Register keyboard states @@ -1155,15 +1154,16 @@ void SetExitKey(int key) #endif } -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) // NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB) // Detect if a gamepad is available bool IsGamepadAvailable(int gamepad) { bool result = false; - + +#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true; +#endif return result; } @@ -1183,11 +1183,10 @@ const char *GetGamepadName(int gamepad) float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; - - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) - { - value = gamepadAxisState[gamepad][axis]; - } + +#if !defined(PLATFORM_ANDROID) + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) value = gamepadAxisState[gamepad][axis]; +#endif return value; } @@ -1196,10 +1195,12 @@ float GetGamepadAxisMovement(int gamepad, int axis) bool IsGamepadButtonPressed(int gamepad, int button) { bool pressed = false; - + +#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 1)) pressed = true; +#endif return pressed; } @@ -1209,8 +1210,10 @@ bool IsGamepadButtonDown(int gamepad, int button) { bool result = false; +#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 1)) result = true; +#endif return result; } @@ -1220,9 +1223,11 @@ bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; +#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 0)) released = true; +#endif return released; } @@ -1232,8 +1237,10 @@ bool IsGamepadButtonUp(int gamepad, int button) { bool result = false; +#if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 0)) result = true; +#endif return result; } @@ -1244,9 +1251,6 @@ int GetGamepadButtonPressed(void) return lastGamepadButtonPressed; } -#endif //defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) - - // Detect if a mouse button has been pressed once bool IsMouseButtonPressed(int button) { -- cgit v1.2.3 From cc917fbac6e7007fdb744afaf8f0879c984d95af Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 31 Oct 2016 15:38:15 +0100 Subject: Improve SpriteFont support LoadSpriteFontTTF() - TTF font loading with custom parameters --- src/raylib.h | 3 +-- src/text.c | 74 +++++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 54 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index b0ee96bb..4996bb2b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -686,7 +686,6 @@ RLAPI bool IsKeyUp(int key); // Detect if a key RLAPI int GetKeyPressed(void); // Get latest key pressed RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis @@ -695,7 +694,6 @@ RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gam RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed -#endif RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed @@ -821,6 +819,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest //------------------------------------------------------------------------------------ RLAPI SpriteFont GetDefaultFont(void); // Get the default SpriteFont RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory +RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load a SpriteFont from TTF font with parameters RLAPI void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) diff --git a/src/text.c b/src/text.c index 5e978823..7707db7c 100644 --- a/src/text.c +++ b/src/text.c @@ -33,6 +33,7 @@ #include "utils.h" // Required for: GetExtension() // Following libs are used on LoadTTF() +//#define STBTT_STATIC #define STB_TRUETYPE_IMPLEMENTATION #include "external/stb_truetype.h" // Required for: stbtt_BakeFontBitmap() @@ -268,20 +269,35 @@ SpriteFont LoadSpriteFont(const char *fileName) TraceLog(WARNING, "[%s] SpriteFont could not be loaded, using default font", fileName); spriteFont = GetDefaultFont(); } + else SetTextureFilter(spriteFont.texture, FILTER_BILINEAR); return spriteFont; } -// Generate SpriteFont from TTF file +// Load SpriteFont from TTF file with custom parameters // NOTE: You can pass an array with desired characters, those characters should be available in the font // if array is NULL, default char set is selected 32..126 -SpriteFont GenSpriteFont(const char *fileName, int fontSize, int *fontChars) +SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars) { SpriteFont spriteFont = { 0 }; if (strcmp(GetExtension(fileName),"ttf") == 0) { - spriteFont = LoadTTF(fileName, fontSize, FONT_FIRST_CHAR, DEFAULT_TTF_NUMCHARS); + int firstChar = 0; + int totalChars = 0; + + if ((fontChars == NULL) || (numChars == 0)) + { + firstChar = 32; // Default first character: SPACE[32] + totalChars = 95; // Default charset [32..126] + } + else + { + firstChar = fontChars[0]; + totalChars = numChars; + } + + spriteFont = LoadTTF(fileName, fontSize, firstChar, totalChars); } if (spriteFont.texture.id == 0) @@ -522,7 +538,7 @@ void DrawFPS(int posX, int posY) // Module specific Functions Definition //---------------------------------------------------------------------------------- -// Load a Image font file (XNA style) +// Load an Image font file (XNA style) static SpriteFont LoadImageFont(Image image, Color key, int firstChar) { #define COLOR_EQUAL(col1, col2) ((col1.r == col2.r)&&(col1.g == col2.g)&&(col1.b == col2.b)&&(col1.a == col2.a)) @@ -595,15 +611,24 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) xPosToRead = charSpacing; } - free(pixels); - TraceLog(DEBUG, "SpriteFont data parsed correctly from image"); + + // NOTE: We need to remove key color borders from image to avoid weird + // artifacts on texture scaling when using FILTER_BILINEAR or FILTER_TRILINEAR + for (int i = 0; i < image.height*image.width; i++) if (COLOR_EQUAL(pixels[i], key)) pixels[i] = BLANK; + + // Create a new image with the processed color data (key color replaced by BLANK) + Image fontClear = LoadImageEx(pixels, image.width, image.height); + + free(pixels); // Free pixels array memory // Create spritefont with all data parsed from image SpriteFont spriteFont = { 0 }; - spriteFont.texture = LoadTextureFromImage(image); // Convert loaded image to OpenGL texture + spriteFont.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture spriteFont.numChars = index; + + UnloadImage(fontClear); // Unload processed image once converted to texture // We got tempCharValues and tempCharsRecs populated with chars data // Now we move temp data to sized charValues and charRecs arrays @@ -900,12 +925,15 @@ static SpriteFont LoadBMFont(const char *fileName) // TODO: Review texture packing method and generation (use oversampling) static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int numChars) { - // NOTE: Generated font uses some hardcoded values - #define FONT_TEXTURE_WIDTH 512 // Font texture width - #define FONT_TEXTURE_HEIGHT 512 // Font texture height + // NOTE: Font texture size is predicted (being as much conservative as possible) + // Predictive method consist of supposing same number of chars by line-column (sqrtf) + // and a maximum character width of 3/4 of fontSize... it worked ok with all my tests... + int textureSize = GetNextPOT(ceil((float)fontSize*3/4)*ceil(sqrtf((float)numChars))); + + TraceLog(INFO, "TTF spritefont loading: Predicted texture size: %ix%i", textureSize, textureSize); unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); - unsigned char *dataBitmap = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)); // One channel bitmap returned! + unsigned char *dataBitmap = (unsigned char *)malloc(textureSize*textureSize*sizeof(unsigned char)); // One channel bitmap returned! stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); SpriteFont font = { 0 }; @@ -914,40 +942,44 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int if (ttfFile == NULL) { - TraceLog(WARNING, "[%s] FNT file could not be opened", fileName); + TraceLog(WARNING, "[%s] TTF file could not be opened", fileName); return font; } fread(ttfBuffer, 1, 1<<25, ttfFile); // NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image... - stbtt_BakeFontBitmap(ttfBuffer,0, fontSize, dataBitmap, FONT_TEXTURE_WIDTH, FONT_TEXTURE_HEIGHT, firstChar, numChars, charData); + // TODO: Replace this function by a proper packing method and support random chars order + int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, firstChar, numChars, charData); + //if (result > 0) TraceLog(INFO, "TTF spritefont loading: first unused row of generated bitmap: %i", result); + if (result < 0) TraceLog(WARNING, "TTF spritefont loading: Not all the characters fit in the font"); + free(ttfBuffer); // Convert image data from grayscale to to UNCOMPRESSED_GRAY_ALPHA - unsigned char *dataGrayAlpha = (unsigned char *)malloc(FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT*sizeof(unsigned char)*2); // Two channels - int k = 0; + unsigned char *dataGrayAlpha = (unsigned char *)malloc(textureSize*textureSize*sizeof(unsigned char)*2); // Two channels - for (int i = 0; i < FONT_TEXTURE_WIDTH*FONT_TEXTURE_HEIGHT; i++) + for (int i = 0, k = 0; i < textureSize*textureSize; i++, k += 2) { dataGrayAlpha[k] = 255; dataGrayAlpha[k + 1] = dataBitmap[i]; - - k += 2; } free(dataBitmap); // Sprite font generation from TTF extracted data Image image; - image.width = FONT_TEXTURE_WIDTH; - image.height = FONT_TEXTURE_HEIGHT; + image.width = textureSize; + image.height = textureSize; image.mipmaps = 1; image.format = UNCOMPRESSED_GRAY_ALPHA; image.data = dataGrayAlpha; - + font.texture = LoadTextureFromImage(image); + + //WritePNG("generated_ttf_image.png", (unsigned char *)image.data, image.width, image.height, 2); + UnloadImage(image); // Unloads dataGrayAlpha font.size = fontSize; -- cgit v1.2.3 From 673dcf94364d37f3d52285ac27c88707ae567872 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 31 Oct 2016 20:39:03 +0100 Subject: Comments tweaks --- src/core.c | 2 +- src/models.c | 2 +- src/rlgl.c | 2 +- src/shapes.c | 15 +++++++-------- src/textures.c | 4 ++-- src/utils.c | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 9bb7b8cf..8850eefa 100644 --- a/src/core.c +++ b/src/core.c @@ -22,7 +22,7 @@ * * RL_LOAD_DEFAULT_FONT - Use external module functions to load default raylib font (module: text) * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/models.c b/src/models.c index 55ac7893..c0f04387 100644 --- a/src/models.c +++ b/src/models.c @@ -4,7 +4,7 @@ * * Basic functions to draw 3d shapes and load/draw 3d models (.OBJ) * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/rlgl.c b/src/rlgl.c index 492ca3a6..e2804e9c 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -35,7 +35,7 @@ #include // Required for: atan2() #ifndef RLGL_STANDALONE - #include "raymath.h" // Required for Vector3 and Matrix functions + #include "raymath.h" // Required for: Vector3 and Matrix functions #endif #if defined(GRAPHICS_API_OPENGL_11) diff --git a/src/shapes.c b/src/shapes.c index 62076b2c..79cf567a 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -4,7 +4,7 @@ * * Basic functions to draw 2d Shapes and check collisions * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -25,9 +25,8 @@ #include "raylib.h" -#include // Required for abs() function -#include // Math related functions, sin() and cos() used on DrawCircle* - // sqrt() and pow() and abs() used on CheckCollision* +#include // Required for: abs() +#include // Required for: sinf(), cosf(), sqrtf() #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 @@ -331,8 +330,8 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col rlColor4ub(color.r, color.g, color.b, color.a); rlVertex2f(0, 0); - rlVertex2f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius); - rlVertex2f(sin(DEG2RAD*(i + 360/sides))*radius, cos(DEG2RAD*(i + 360/sides))*radius); + rlVertex2f(sinf(DEG2RAD*i)*radius, cosf(DEG2RAD*i)*radius); + rlVertex2f(sinf(DEG2RAD*(i + 360/sides))*radius, cosf(DEG2RAD*(i + 360/sides))*radius); } rlEnd(); rlPopMatrix(); @@ -434,7 +433,7 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa float dx = center2.x - center1.x; // X distance between centers float dy = center2.y - center1.y; // Y distance between centers - float distance = sqrt(dx*dx + dy*dy); // Distance between centers + float distance = sqrtf(dx*dx + dy*dy); // Distance between centers if (distance <= (radius1 + radius2)) collision = true; @@ -457,7 +456,7 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) if (dx <= (rec.width/2)) { return true; } if (dy <= (rec.height/2)) { return true; } - float cornerDistanceSq = pow(dx - rec.width/2, 2) + pow(dy - rec.height/2, 2); + float cornerDistanceSq = (dx - rec.width/2)*(dx - rec.width/2) + (dy - rec.height/2)*(dy - rec.height/2); return (cornerDistanceSq <= (radius*radius)); } diff --git a/src/textures.c b/src/textures.c index 729756a5..5354a74f 100644 --- a/src/textures.c +++ b/src/textures.c @@ -8,7 +8,7 @@ * stb_image - Multiple formats image loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) * NOTE: stb_image has been slightly modified, original library: https://github.com/nothings/stb * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -1241,7 +1241,7 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing // NOTE: GetTextureData() not available in OpenGL ES Image imFont = GetTextureData(font.texture); - ImageFormat(&imFont, UNCOMPRESSED_R8G8B8A8); // Required for color tint + ImageFormat(&imFont, UNCOMPRESSED_R8G8B8A8); // Convert to 32 bit for color tint ImageColorTint(&imFont, tint); // Apply color tint to font Color *fontPixels = GetImageData(imFont); diff --git a/src/utils.c b/src/utils.c index 36b06f0f..b96e2c70 100644 --- a/src/utils.c +++ b/src/utils.c @@ -8,7 +8,7 @@ * tinfl - zlib DEFLATE algorithm decompression lib * stb_image_write - PNG writting functions * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. -- cgit v1.2.3 From 3393fda384479b237519c70a1cedeb0e5dad369c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 31 Oct 2016 20:39:30 +0100 Subject: Improve TTF loading --- src/text.c | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index 7707db7c..f56f588e 100644 --- a/src/text.c +++ b/src/text.c @@ -4,7 +4,7 @@ * * Basic functions to load SpriteFonts and draw Text * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -30,7 +30,7 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() #include // Required for: FILE, fopen(), fclose(), fscanf(), feof(), rewind(), fgets() -#include "utils.h" // Required for: GetExtension() +#include "utils.h" // Required for: GetExtension(), GetNextPOT() // Following libs are used on LoadTTF() //#define STBTT_STATIC @@ -72,9 +72,7 @@ static SpriteFont defaultFont; // Default font provided by raylib static SpriteFont LoadImageFont(Image image, Color key, int firstChar); // Load a Image font file (XNA style) static SpriteFont LoadRBMF(const char *fileName); // Load a rBMF font file (raylib BitMap Font) static SpriteFont LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) - -// Generate a sprite font image from TTF data -static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int numChars); +static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load spritefont from TTF data extern void LoadDefaultFont(void); extern void UnloadDefaultFont(void); @@ -255,7 +253,7 @@ SpriteFont LoadSpriteFont(const char *fileName) // Check file extension if (strcmp(GetExtension(fileName),"rbmf") == 0) spriteFont = LoadRBMF(fileName); - else if (strcmp(GetExtension(fileName),"ttf") == 0) spriteFont = LoadTTF(fileName, DEFAULT_TTF_FONTSIZE, FONT_FIRST_CHAR, DEFAULT_TTF_NUMCHARS); + else if (strcmp(GetExtension(fileName),"ttf") == 0) spriteFont = LoadSpriteFontTTF(fileName, DEFAULT_TTF_FONTSIZE, 0, NULL); else if (strcmp(GetExtension(fileName),"fnt") == 0) spriteFont = LoadBMFont(fileName); else { @@ -283,21 +281,17 @@ SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, i if (strcmp(GetExtension(fileName),"ttf") == 0) { - int firstChar = 0; - int totalChars = 0; - if ((fontChars == NULL) || (numChars == 0)) { - firstChar = 32; // Default first character: SPACE[32] - totalChars = 95; // Default charset [32..126] - } - else - { - firstChar = fontChars[0]; - totalChars = numChars; + int totalChars = 95; // Default charset [32..126] + + int *defaultFontChars = (int *)malloc(totalChars*sizeof(int)); + + for (int i = 0; i < totalChars; i++) defaultFontChars[i] = i + 32; // Default first character: SPACE[32] + + spriteFont = LoadTTF(fileName, fontSize, totalChars, defaultFontChars); } - - spriteFont = LoadTTF(fileName, fontSize, firstChar, totalChars); + else spriteFont = LoadTTF(fileName, fontSize, numChars, fontChars); } if (spriteFont.texture.id == 0) @@ -325,7 +319,6 @@ void UnloadSpriteFont(SpriteFont spriteFont) } } - // Draw text (using default font) // NOTE: fontSize work like in any drawing program but if fontSize is lower than font-base-size, then font-base-size is used // NOTE: chars spacing is proportional to fontSize @@ -549,8 +542,8 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) int x = 0; int y = 0; - // Default number of characters expected supported - #define MAX_FONTCHARS 128 + // Default number of characters supported + #define MAX_FONTCHARS 256 // We allocate a temporal arrays for chars data measures, // once we get the actual number of chars, we copy data to a sized arrays @@ -923,7 +916,7 @@ static SpriteFont LoadBMFont(const char *fileName) // Generate a sprite font from TTF file data (font size required) // TODO: Review texture packing method and generation (use oversampling) -static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int numChars) +static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int *fontChars) { // NOTE: Font texture size is predicted (being as much conservative as possible) // Predictive method consist of supposing same number of chars by line-column (sqrtf) @@ -947,10 +940,13 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int } fread(ttfBuffer, 1, 1<<25, ttfFile); + + if (fontChars[0] != 32) TraceLog(WARNING, "TTF spritefont loading: first character is not SPACE(32) character"); // NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image... - // TODO: Replace this function by a proper packing method and support random chars order - int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, firstChar, numChars, charData); + // TODO: Replace this function by a proper packing method and support random chars order, + // we already receive a list (fontChars) with the ordered expected characters + int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, fontChars[0], numChars, charData); //if (result > 0) TraceLog(INFO, "TTF spritefont loading: first unused row of generated bitmap: %i", result); if (result < 0) TraceLog(WARNING, "TTF spritefont loading: Not all the characters fit in the font"); @@ -991,7 +987,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int firstChar, int for (int i = 0; i < font.numChars; i++) { - font.charValues[i] = i + firstChar; + font.charValues[i] = fontChars[i]; font.charRecs[i].x = (int)charData[i].x0; font.charRecs[i].y = (int)charData[i].y0; -- cgit v1.2.3 From 6d3b11ef9124c9d938d9ecd2b341837bd5ed5dc1 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Nov 2016 00:58:21 +0100 Subject: Support unordered charset, neither fixed first char Still requires some testing... --- src/text.c | 79 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index f56f588e..23041603 100644 --- a/src/text.c +++ b/src/text.c @@ -44,7 +44,6 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define FONT_FIRST_CHAR 32 // NOTE: Expected first char for a sprite font #define MAX_FORMATTEXT_LENGTH 64 #define MAX_SUBTEXT_LENGTH 64 @@ -69,6 +68,8 @@ static SpriteFont defaultFont; // Default font provided by raylib //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- +static int GetCharIndex(SpriteFont font, int letter); + static SpriteFont LoadImageFont(Image image, Color key, int firstChar); // Load a Image font file (XNA style) static SpriteFont LoadRBMF(const char *fileName); // Load a rBMF font file (raylib BitMap Font) static SpriteFont LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) @@ -197,7 +198,7 @@ extern void LoadDefaultFont(void) for (int i = 0; i < defaultFont.numChars; i++) { - defaultFont.charValues[i] = FONT_FIRST_CHAR + i; // First char is 32 + defaultFont.charValues[i] = 32 + i; // First char is 32 defaultFont.charRecs[i].x = currentPosX; defaultFont.charRecs[i].y = charsDivisor + currentLine*(charsHeight + charsDivisor); @@ -248,6 +249,7 @@ SpriteFont LoadSpriteFont(const char *fileName) // Default hardcoded values for ttf file loading #define DEFAULT_TTF_FONTSIZE 32 // Font first character (32 - space) #define DEFAULT_TTF_NUMCHARS 95 // ASCII 32..126 is 95 glyphs + #define DEFAULT_FIRST_CHAR 32 // Expected first char for image spritefont SpriteFont spriteFont = { 0 }; @@ -258,7 +260,7 @@ SpriteFont LoadSpriteFont(const char *fileName) else { Image image = LoadImage(fileName); - if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, FONT_FIRST_CHAR); + if (image.data != NULL) spriteFont = LoadImageFont(image, MAGENTA, DEFAULT_FIRST_CHAR); UnloadImage(image); } @@ -267,7 +269,7 @@ SpriteFont LoadSpriteFont(const char *fileName) TraceLog(WARNING, "[%s] SpriteFont could not be loaded, using default font", fileName); spriteFont = GetDefaultFont(); } - else SetTextureFilter(spriteFont.texture, FILTER_BILINEAR); + else SetTextureFilter(spriteFont.texture, FILTER_POINT); // By default we set point filter (best performance) return spriteFont; } @@ -356,22 +358,18 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float for (int i = 0; i < length; i++) { - // TODO: Right now we are supposing characters that follow a continous order and start at FONT_FIRST_CHAR, - // this sytem can be improved to support any characters order and init value... - // An intermediate table could be created to link char values with predefined char position index in chars rectangle array - if ((unsigned char)text[i] == 0xc2) // UTF-8 encoding identification HACK! { // Support UTF-8 encoded values from [0xc2 0x80] -> [0xc2 0xbf](¿) letter = (unsigned char)text[i + 1]; - rec = spriteFont.charRecs[letter - FONT_FIRST_CHAR]; + rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)letter)]; i++; } else if ((unsigned char)text[i] == 0xc3) // UTF-8 encoding identification HACK! { // Support UTF-8 encoded values from [0xc3 0x80](À) -> [0xc3 0xbf](ÿ) letter = (unsigned char)text[i + 1]; - rec = spriteFont.charRecs[letter - FONT_FIRST_CHAR + 64]; + rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)letter + 64)]; i++; } else @@ -383,17 +381,19 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float textOffsetX = 0; rec.x = -1; } - else rec = spriteFont.charRecs[(int)text[i] - FONT_FIRST_CHAR]; + else rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)text[i])]; } if (rec.x >= 0) { - DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].x*scaleFactor, - position.y + textOffsetY + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].y*scaleFactor, + int index = GetCharIndex(spriteFont, (int)text[i]); + + DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor, + position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor, rec.width*scaleFactor, rec.height*scaleFactor} , (Vector2){ 0, 0 }, 0.0f, tint); - if (spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR] == 0) textOffsetX += (rec.width*scaleFactor + spacing); - else textOffsetX += (spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR]*scaleFactor + spacing); + if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (rec.width*scaleFactor + spacing); + else textOffsetX += (spriteFont.charAdvanceX[index]*scaleFactor + spacing); } } } @@ -473,8 +473,10 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int if (text[i] != '\n') { - if (spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR] != 0) textWidth += spriteFont.charAdvanceX[(int)text[i] - FONT_FIRST_CHAR]; - else textWidth += (spriteFont.charRecs[(int)text[i] - FONT_FIRST_CHAR].width + spriteFont.charOffsets[(int)text[i] - FONT_FIRST_CHAR].x); + int index = GetCharIndex(spriteFont, (int)text[i]); + + if (spriteFont.charAdvanceX[index] != 0) textWidth += spriteFont.charAdvanceX[index]; + else textWidth += (spriteFont.charRecs[index].width + spriteFont.charOffsets[index].x); } else { @@ -531,6 +533,27 @@ void DrawFPS(int posX, int posY) // Module specific Functions Definition //---------------------------------------------------------------------------------- +static int GetCharIndex(SpriteFont font, int letter) +{ +//#define UNORDERED_CHARSET +#if defined(UNORDERED_CHARSET) + int index = 0; + + for (int i = 0; i < font.numChars; i++) + { + if (font.charValues[i] == letter) + { + index = i; + break; + } + } + + return index; +#else + return (letter - 32); +#endif +} + // Load an Image font file (XNA style) static SpriteFont LoadImageFont(Image image, Color key, int firstChar) { @@ -857,6 +880,7 @@ static SpriteFont LoadBMFont(const char *fileName) if (imFont.format == UNCOMPRESSED_GRAYSCALE) ImageAlphaMask(&imFont, imFont); font.texture = LoadTextureFromImage(imFont); + font.size = fontSize; font.numChars = numChars; font.charValues = (int *)malloc(numChars*sizeof(int)); @@ -870,30 +894,12 @@ static SpriteFont LoadBMFont(const char *fileName) int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; - bool unorderedChars = false; - int firstChar = 32; - for (int i = 0; i < numChars; i++) { fgets(buffer, MAX_BUFFER_SIZE, fntFile); sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", &charId, &charX, &charY, &charWidth, &charHeight, &charOffsetX, &charOffsetY, &charAdvanceX); - if ((i == 0) && (charId != FONT_FIRST_CHAR)) - { - TraceLog(WARNING, "BMFont not supported: expected SPACE(32) as first character, falling back to default font"); - firstChar = charId; - break; - } - else if ((i < (126 - FONT_FIRST_CHAR)) && (i != (charId - FONT_FIRST_CHAR))) - { - // NOTE: We expect the first 95 chars (32..126) to be ordered for quick drawing access, - // characters above are stored and we look for them (search algorythm) when drawing - TraceLog(WARNING, "BMFont not supported: unordered chars data, falling back to default font"); - unorderedChars = true; - break; - } - // Save data properly in sprite font font.charValues[i] = charId; font.charRecs[i] = (Rectangle){ charX, charY, charWidth, charHeight }; @@ -903,8 +909,7 @@ static SpriteFont LoadBMFont(const char *fileName) fclose(fntFile); - // NOTE: Font data could be not ordered by charId: 32,33,34,35... raylib does not support unordered BMFonts - if ((firstChar != FONT_FIRST_CHAR) || (unorderedChars) || (font.texture.id == 0)) + if (font.texture.id == 0) { UnloadSpriteFont(font); font = GetDefaultFont(); -- cgit v1.2.3 From 64f67f6e9f414a54dfc3fb519b892ecd5517f2cf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 1 Nov 2016 14:39:57 +0100 Subject: Improved gamepad support new function: GetGamepadAxisCount() new function: IsGamepadName() --- src/core.c | 50 +++++++++++++++++++++++++++++++++++++++----------- src/raylib.h | 4 +++- 2 files changed, 42 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 8850eefa..3bade07b 100644 --- a/src/core.c +++ b/src/core.c @@ -58,12 +58,12 @@ #endif #include // Standard input / output lib -#include // Declares malloc() and free() for memory management, rand(), atexit() -#include // Required for typedef unsigned long long int uint64_t, used by hi-res timer -#include // Useful to initialize random seed - Android/RPI hi-res timer (NOTE: Linux only!) -#include // Math related functions, tan() used to set perspective -#include // String function definitions, memset() -#include // Macros for reporting and retrieving error conditions through error codes +#include // Required for: malloc(), free(), rand(), atexit() +#include // Required for: typedef unsigned long long int uint64_t, used by hi-res timer +#include // Required for: time() - Android/RPI hi-res timer (NOTE: Linux only!) +#include // Required for: tan() [Used in Begin3dMode() to set perspective] +#include // Required for: strcmp() +//#include // Macros for reporting and retrieving error conditions through error codes #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 @@ -222,6 +222,7 @@ static char currentKeyState[512] = { 0 }; // Registers current frame key state static int lastKeyPressed = -1; // Register last key pressed static int lastGamepadButtonPressed = -1; // Register last gamepad button pressed +static int gamepadAxisCount = 0; // Register number of available gamepad axis static Vector2 mousePosition; // Mouse position on screen static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen @@ -1168,17 +1169,36 @@ bool IsGamepadAvailable(int gamepad) return result; } +// Check gamepad name (if available) +bool IsGamepadName(int gamepad, const char *name) +{ + bool result = false; + const char *gamepadName = NULL; + + if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad); + + if ((name != NULL) && (gamepadName != NULL)) result = (strcmp(name, gamepadName) == 0); + + return result; +} + // Return gamepad internal name id const char *GetGamepadName(int gamepad) { #if defined(PLATFORM_DESKTOP) - if (glfwJoystickPresent(gamepad) == 1) return glfwGetJoystickName(gamepad); + if (gamepadReady[gamepad]) return glfwGetJoystickName(gamepad); else return NULL; #else return NULL; #endif } +// Return gamepad axis count +int GetGamepadAxisCount(int gamepad) +{ + return gamepadAxisCount; +} + // Return axis movement vector for a gamepad float GetGamepadAxisMovement(int gamepad, int axis) { @@ -1921,6 +1941,7 @@ static void PollInputEvents(void) // Reset last gamepad button pressed registered lastGamepadButtonPressed = -1; + gamepadAxisCount = 0; #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // Mouse input polling @@ -1943,13 +1964,19 @@ static void PollInputEvents(void) previousMouseWheelY = currentMouseWheelY; currentMouseWheelY = 0; + // Check if gamepads are ready + // NOTE: We do it here in case of disconection + for (int i = 0; i < MAX_GAMEPADS; i++) + { + if (glfwJoystickPresent(i)) gamepadReady[i] = true; + else gamepadReady[i] = false; + } + // Register gamepads buttons events for (int i = 0; i < MAX_GAMEPADS; i++) { - if (glfwJoystickPresent(i)) // Check if gamepad is available + if (gamepadReady[i]) // Check if gamepad is available { - gamepadReady[i] = true; - // Register previous gamepad states for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; @@ -1980,8 +2007,9 @@ static void PollInputEvents(void) { gamepadAxisState[i][k] = axes[k]; } + + gamepadAxisCount = axisCount; } - else gamepadReady[i] = false; } glfwPollEvents(); // Register keyboard/mouse events (callbacks)... and window events! diff --git a/src/raylib.h b/src/raylib.h index 4996bb2b..58037770 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -687,13 +687,15 @@ RLAPI int GetKeyPressed(void); // Get latest key RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available) RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id -RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed -- cgit v1.2.3 From f16f39e8aaf0ee95a31600e549c0221d1ce46fdd Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 2 Nov 2016 00:50:08 +0100 Subject: code tweaks to avoid some warnings --- src/models.c | 18 +++++++++--------- src/rlgl.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index c0f04387..ad084f05 100644 --- a/src/models.c +++ b/src/models.c @@ -1411,7 +1411,7 @@ bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, floa float dy = centerA.y - centerB.y; // Y distance between centers float dz = centerA.z - centerB.z; // Y distance between centers - float distance = sqrt(dx*dx + dy*dy + dz*dz); // Distance between centers + float distance = sqrtf(dx*dx + dy*dy + dz*dz); // Distance between centers if (distance <= (radiusA + radiusB)) collision = true; @@ -1441,14 +1441,14 @@ bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radius float dmin = 0; - if (centerSphere.x < box.min.x) dmin += pow(centerSphere.x - box.min.x, 2); - else if (centerSphere.x > box.max.x) dmin += pow(centerSphere.x - box.max.x, 2); + if (centerSphere.x < box.min.x) dmin += powf(centerSphere.x - box.min.x, 2); + else if (centerSphere.x > box.max.x) dmin += powf(centerSphere.x - box.max.x, 2); - if (centerSphere.y < box.min.y) dmin += pow(centerSphere.y - box.min.y, 2); - else if (centerSphere.y > box.max.y) dmin += pow(centerSphere.y - box.max.y, 2); + if (centerSphere.y < box.min.y) dmin += powf(centerSphere.y - box.min.y, 2); + else if (centerSphere.y > box.max.y) dmin += powf(centerSphere.y - box.max.y, 2); - if (centerSphere.z < box.min.z) dmin += pow(centerSphere.z - box.min.z, 2); - else if (centerSphere.z > box.max.z) dmin += pow(centerSphere.z - box.max.z, 2); + if (centerSphere.z < box.min.z) dmin += powf(centerSphere.z - box.min.z, 2); + else if (centerSphere.z > box.max.z) dmin += powf(centerSphere.z - box.max.z, 2); if (dmin <= (radiusSphere*radiusSphere)) collision = true; @@ -1487,8 +1487,8 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadi float collisionDistance = 0; // Check if ray origin is inside the sphere to calculate the correct collision point - if (distance < sphereRadius) collisionDistance = vector + sqrt(d); - else collisionDistance = vector - sqrt(d); + if (distance < sphereRadius) collisionDistance = vector + sqrtf(d); + else collisionDistance = vector - sqrtf(d); VectorScale(&offset, collisionDistance); Vector3 cPoint = VectorAdd(ray.position, offset); diff --git a/src/rlgl.c b/src/rlgl.c index e2804e9c..d3bba07b 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -3882,7 +3882,7 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG // ...but with lens distortion it is increased (see Oculus SDK Documentation) //float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? - float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; + float fovy = 2.0f*(float)atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; // Compute camera projection matrices float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] -- cgit v1.2.3 From f2d61d4d432ff302c57d0869d75e72c6462658f5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 2 Nov 2016 13:39:48 +0100 Subject: Improved gamepad support on Raspberry Pi --- src/core.c | 19 ++++++++++++++++--- src/raylib.h | 34 ++++++++++++++++------------------ 2 files changed, 32 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 3bade07b..8e15eb96 100644 --- a/src/core.c +++ b/src/core.c @@ -96,8 +96,8 @@ #include // UNIX System call for device-specific input/output operations - ioctl() #include // Linux: KDSKBMODE, K_MEDIUMRAM constants definition #include // Linux: Keycodes constants definition (KEY_A, ...) - #include - + #include // Linux: Joystick support library + #include "bcm_host.h" // Raspberry Pi VideoCore IV access functions #include "EGL/egl.h" // Khronos EGL library - Native platform display device control functions @@ -175,6 +175,7 @@ static pthread_t mouseThreadId; // Mouse reading thread id // Gamepad input variables static int gamepadStream[MAX_GAMEPADS] = { -1 };// Gamepad device file descriptor static pthread_t gamepadThreadId; // Gamepad reading thread id +static char gamepadName[64]; // Gamepad name holder #endif #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) @@ -1188,6 +1189,10 @@ const char *GetGamepadName(int gamepad) #if defined(PLATFORM_DESKTOP) if (gamepadReady[gamepad]) return glfwGetJoystickName(gamepad); else return NULL; +#elif defined(PLATFORM_RPI) + if (gamepadReady[gamepad]) ioctl(gamepadStream[gamepad], JSIOCGNAME(64), &gamepadName); + + return gamepadName; #else return NULL; #endif @@ -1196,6 +1201,11 @@ const char *GetGamepadName(int gamepad) // Return gamepad axis count int GetGamepadAxisCount(int gamepad) { +#if defined(PLATFORM_RPI) + int axisCount = 0; + if (gamepadReady[gamepad]) ioctl(gamepadStream[gamepad], JSIOCGAXES, &axisCount); + gamepadAxisCount = axisCount; +#endif return gamepadAxisCount; } @@ -1939,9 +1949,11 @@ static void PollInputEvents(void) // Reset last key pressed registered lastKeyPressed = -1; - // Reset last gamepad button pressed registered +#if !defined(PLATFORM_RPI) + // Reset last gamepad button/axis registered state lastGamepadButtonPressed = -1; gamepadAxisCount = 0; +#endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // Mouse input polling @@ -2850,6 +2862,7 @@ static void *GamepadThread(void *arg) currentGamepadState[i][gamepadEvent.number] = (int)gamepadEvent.value; if ((int)gamepadEvent.value == 1) lastGamepadButtonPressed = gamepadEvent.number; + else lastGamepadButtonPressed = -1; } } else if (gamepadEvent.type == JS_EVENT_AXIS) diff --git a/src/raylib.h b/src/raylib.h index 58037770..08acafdd 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -216,8 +216,8 @@ #define GAMEPAD_PS3_AXIS_LEFT_Y 1 #define GAMEPAD_PS3_AXIS_RIGHT_X 2 #define GAMEPAD_PS3_AXIS_RIGHT_Y 5 -#define GAMEPAD_PS3_AXIS_L2 3 // 1.0(not pressed) --> -1.0(completely pressed) -#define GAMEPAD_PS3_AXIS_R2 4 // 1.0(not pressed) --> -1.0(completely pressed) +#define GAMEPAD_PS3_AXIS_L2 3 // [1..-1] (pressure-level) +#define GAMEPAD_PS3_AXIS_R2 4 // [1..-1] (pressure-level) // Xbox360 USB Controller Buttons #define GAMEPAD_XBOX_BUTTON_A 0 @@ -232,27 +232,25 @@ #define GAMEPAD_XBOX_BUTTON_RIGHT 11 #define GAMEPAD_XBOX_BUTTON_DOWN 12 #define GAMEPAD_XBOX_BUTTON_LEFT 13 -#define GAMEPAD_XBOX_BUTTON_HOME 9 +#define GAMEPAD_XBOX_BUTTON_HOME 8 // Xbox360 USB Controller Axis -#define GAMEPAD_XBOX_AXIS_LEFT_X 0 -#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 -#define GAMEPAD_XBOX_AXIS_RIGHT_X 2 -#define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 -#define GAMEPAD_XBOX_AXIS_LT 4 // -1.0(not pressed) --> 1.0(completely pressed) -#define GAMEPAD_XBOX_AXIS_RT 5 // -1.0(not pressed) --> 1.0(completely pressed) - -/* +#define GAMEPAD_XBOX_AXIS_LEFT_X 0 // [-1..1] (left->right) +#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 // [1..-1] (up->down) +#define GAMEPAD_XBOX_AXIS_RIGHT_X 2 // [-1..1] (left->right) +#define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 // [1..-1] (up->down) +#define GAMEPAD_XBOX_AXIS_LT 4 // [-1..1] (pressure-level) +#define GAMEPAD_XBOX_AXIS_RT 5 // [-1..1] (pressure-level) + // NOTE: For Raspberry Pi, axis must be reconfigured #if defined(PLATFORM_RPI) - #define GAMEPAD_XBOX_AXIS_LEFT_X 7 - #define GAMEPAD_XBOX_AXIS_LEFT_Y 6 - #define GAMEPAD_XBOX_AXIS_RIGHT_X 3 - #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 - #define GAMEPAD_XBOX_AXIS_LT 2 - #define GAMEPAD_XBOX_AXIS_RT 5 + #define GAMEPAD_XBOX_AXIS_LEFT_X 0 // [-1..1] (left->right) + #define GAMEPAD_XBOX_AXIS_LEFT_Y 1 // [-1..1] (up->down) + #define GAMEPAD_XBOX_AXIS_RIGHT_X 3 // [-1..1] (left->right) + #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 // [-1..1] (up->down) + #define GAMEPAD_XBOX_AXIS_LT 2 // [-1..1] (pressure-level) + #define GAMEPAD_XBOX_AXIS_RT 5 // [-1..1] (pressure-level) #endif -*/ // NOTE: MSC C++ compiler does not support compound literals (C99 feature) // Plain structures in C++ (without constructors) can be initialized from { } initializers. -- cgit v1.2.3 From ca96122a7b8291f0761fd34f1997e1a051b907f2 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 3 Nov 2016 18:57:16 +0100 Subject: Raspberry Pi custom gamepad axis --- src/raylib.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 08acafdd..00d27466 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -235,13 +235,6 @@ #define GAMEPAD_XBOX_BUTTON_HOME 8 // Xbox360 USB Controller Axis -#define GAMEPAD_XBOX_AXIS_LEFT_X 0 // [-1..1] (left->right) -#define GAMEPAD_XBOX_AXIS_LEFT_Y 1 // [1..-1] (up->down) -#define GAMEPAD_XBOX_AXIS_RIGHT_X 2 // [-1..1] (left->right) -#define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 // [1..-1] (up->down) -#define GAMEPAD_XBOX_AXIS_LT 4 // [-1..1] (pressure-level) -#define GAMEPAD_XBOX_AXIS_RT 5 // [-1..1] (pressure-level) - // NOTE: For Raspberry Pi, axis must be reconfigured #if defined(PLATFORM_RPI) #define GAMEPAD_XBOX_AXIS_LEFT_X 0 // [-1..1] (left->right) @@ -250,6 +243,13 @@ #define GAMEPAD_XBOX_AXIS_RIGHT_Y 4 // [-1..1] (up->down) #define GAMEPAD_XBOX_AXIS_LT 2 // [-1..1] (pressure-level) #define GAMEPAD_XBOX_AXIS_RT 5 // [-1..1] (pressure-level) +#else + #define GAMEPAD_XBOX_AXIS_LEFT_X 0 // [-1..1] (left->right) + #define GAMEPAD_XBOX_AXIS_LEFT_Y 1 // [1..-1] (up->down) + #define GAMEPAD_XBOX_AXIS_RIGHT_X 2 // [-1..1] (left->right) + #define GAMEPAD_XBOX_AXIS_RIGHT_Y 3 // [1..-1] (up->down) + #define GAMEPAD_XBOX_AXIS_LT 4 // [-1..1] (pressure-level) + #define GAMEPAD_XBOX_AXIS_RT 5 // [-1..1] (pressure-level) #endif // NOTE: MSC C++ compiler does not support compound literals (C99 feature) -- cgit v1.2.3 From aa945055fae4f76d428704ecbc9840b57aada35a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 3 Nov 2016 18:57:46 +0100 Subject: Corrected issue on chars drawing Support by default unordered charsets --- src/text.c | 64 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 30 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index 23041603..728e6fbe 100644 --- a/src/text.c +++ b/src/text.c @@ -344,13 +344,13 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float fontSize, int spacing, Color tint) { int length = strlen(text); - int textOffsetX = 0; - int textOffsetY = 0; // Line break! + int textOffsetX = 0; // Offset between characters + int textOffsetY = 0; // Required for line break! float scaleFactor; - unsigned char letter; - - Rectangle rec; - + + unsigned char letter; // Current character + int index; // Index position in sprite font + scaleFactor = fontSize/spriteFont.size; // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly @@ -358,41 +358,37 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float for (int i = 0; i < length; i++) { - if ((unsigned char)text[i] == 0xc2) // UTF-8 encoding identification HACK! - { - // Support UTF-8 encoded values from [0xc2 0x80] -> [0xc2 0xbf](¿) - letter = (unsigned char)text[i + 1]; - rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)letter)]; - i++; - } - else if ((unsigned char)text[i] == 0xc3) // UTF-8 encoding identification HACK! + if ((unsigned char)text[i] == '\n') { - // Support UTF-8 encoded values from [0xc3 0x80](À) -> [0xc3 0xbf](ÿ) - letter = (unsigned char)text[i + 1]; - rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)letter + 64)]; - i++; + // NOTE: Fixed line spacing of 1.5 lines + textOffsetY += ((spriteFont.size + spriteFont.size/2)*scaleFactor); + textOffsetX = 0; } else { - if ((unsigned char)text[i] == '\n') + if ((unsigned char)text[i] == 0xc2) // UTF-8 encoding identification HACK! { - // NOTE: Fixed line spacing of 1.5 lines - textOffsetY += ((spriteFont.size + spriteFont.size/2)*scaleFactor); - textOffsetX = 0; - rec.x = -1; + // Support UTF-8 encoded values from [0xc2 0x80] -> [0xc2 0xbf](¿) + letter = (unsigned char)text[i + 1]; + index = GetCharIndex(spriteFont, (int)letter); + i++; } - else rec = spriteFont.charRecs[GetCharIndex(spriteFont, (int)text[i])]; - } + else if ((unsigned char)text[i] == 0xc3) // UTF-8 encoding identification HACK! + { + // Support UTF-8 encoded values from [0xc3 0x80](À) -> [0xc3 0xbf](ÿ) + letter = (unsigned char)text[i + 1]; + index = GetCharIndex(spriteFont, (int)letter + 64); + i++; + } + else index = GetCharIndex(spriteFont, (int)text[i]); - if (rec.x >= 0) - { - int index = GetCharIndex(spriteFont, (int)text[i]); - - DrawTexturePro(spriteFont.texture, rec, (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor, - position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor, - rec.width*scaleFactor, rec.height*scaleFactor} , (Vector2){ 0, 0 }, 0.0f, tint); + DrawTexturePro(spriteFont.texture, spriteFont.charRecs[index], + (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor, + position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor, + spriteFont.charRecs[index].width*scaleFactor, + spriteFont.charRecs[index].height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint); - if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (rec.width*scaleFactor + spacing); + if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (spriteFont.charRecs[index].width*scaleFactor + spacing); else textOffsetX += (spriteFont.charAdvanceX[index]*scaleFactor + spacing); } } @@ -535,7 +531,7 @@ void DrawFPS(int posX, int posY) static int GetCharIndex(SpriteFont font, int letter) { -//#define UNORDERED_CHARSET +#define UNORDERED_CHARSET #if defined(UNORDERED_CHARSET) int index = 0; -- cgit v1.2.3 From 42452378925e3b1d407a33084cd8cf0495632ee8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 13 Nov 2016 23:47:28 +0100 Subject: Corrected SIGSEV bug --- src/models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index ad084f05..b7e36b8a 100644 --- a/src/models.c +++ b/src/models.c @@ -1811,7 +1811,7 @@ static Material LoadMTL(const char *fileName) char buffer[MAX_BUFFER_SIZE]; Vector3 color = { 1.0f, 1.0f, 1.0f }; - char *mapFileName = NULL; + char mapFileName[128]; FILE *mtlFile; -- cgit v1.2.3 From 38df2cad253251c9fc531c2e9a3a28308aaeb718 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 13 Nov 2016 23:53:28 +0100 Subject: Improved text measurement Still not working correctly, font offsets are not considered correctly... --- src/text.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index 728e6fbe..72d273d4 100644 --- a/src/text.c +++ b/src/text.c @@ -444,14 +444,14 @@ int MeasureText(const char *text, int fontSize) if (fontSize < defaultFontSize) fontSize = defaultFontSize; int spacing = fontSize/defaultFontSize; - vec = MeasureTextEx(GetDefaultFont(), text, fontSize, spacing); + vec = MeasureTextEx(GetDefaultFont(), text, (float)fontSize, spacing); } return (int)vec.x; } // Measure string size for SpriteFont -Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing) +Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing) { int len = strlen(text); int tempLen = 0; // Used to count longer text line num chars @@ -461,7 +461,7 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int int tempTextWidth = 0; // Used to count longer text line width int textHeight = spriteFont.size; - float scaleFactor; + float scaleFactor = fontSize/spriteFont.size; for (int i = 0; i < len; i++) { @@ -487,9 +487,6 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int if (tempTextWidth < textWidth) tempTextWidth = textWidth; - if (fontSize <= spriteFont.size) scaleFactor = 1.0f; - else scaleFactor = (float)fontSize/spriteFont.size; - Vector2 vec; vec.x = (float)tempTextWidth*scaleFactor + (tempLen - 1)*spacing; // Adds chars spacing to measure vec.y = (float)textHeight*scaleFactor; -- cgit v1.2.3 From 9fb6eda5f103e383f3a15d7c2a4d014752dce087 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 13 Nov 2016 23:54:36 +0100 Subject: Improved text measurement --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 00d27466..f6243304 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -826,7 +826,7 @@ RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color co RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters float fontSize, int spacing, Color tint); RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font -RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont +RLAPI Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing); // Measure string size for SpriteFont RLAPI void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner RLAPI const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed' -- cgit v1.2.3 From 9d3ad52160a0e32271a8e3d76d9ea95e9bd0684a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 15 Nov 2016 19:15:25 +0100 Subject: Removed byte typedef --- src/raylib.h | 3 --- src/rlgl.h | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index f6243304..2e3112cf 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -305,9 +305,6 @@ #endif #endif -// byte type -typedef unsigned char byte; - // Vector2 type typedef struct Vector2 { float x; diff --git a/src/rlgl.h b/src/rlgl.h index 9be73f36..78ea6727 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -117,15 +117,14 @@ typedef enum { RL_PROJECTION, RL_MODELVIEW, RL_TEXTURE } MatrixMode; typedef enum { RL_LINES, RL_TRIANGLES, RL_QUADS } DrawMode; +typedef unsigned char byte; + #if defined(RLGL_STANDALONE) #ifndef __cplusplus // Boolean type typedef enum { false, true } bool; #endif - // byte type - typedef unsigned char byte; - // Color type, RGBA (32bit) typedef struct Color { unsigned char r; -- cgit v1.2.3 From 6d1b712a9678a7e1d57d994ab51afafbe06ec5fb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 16 Nov 2016 18:46:13 +0100 Subject: Reviewed modules comments --- src/audio.c | 19 ++++++++++++------- src/audio.h | 16 +++++++++------- src/core.c | 25 +++++++++++++------------ src/external/stb_image.h | 4 ++-- src/models.c | 9 +++++++-- src/raylib.h | 34 ++++++++++++++++++---------------- src/rlgl.c | 29 ++++++++++++++++++++++++----- src/rlgl.h | 26 +++++++++++++++++++++----- src/shapes.c | 10 ++++++++-- src/text.c | 8 +++++++- src/textures.c | 10 +++++++--- src/utils.c | 14 ++++++++++---- src/utils.h | 6 ++---- 13 files changed, 140 insertions(+), 70 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3684e10a..3ddbf0ce 100644 --- a/src/audio.c +++ b/src/audio.c @@ -2,18 +2,22 @@ * * raylib.audio * -* Basic functions to manage Audio: +* This module provides basic functionality to work with audio: * Manage audio device (init/close) -* Load and Unload audio files +* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) * Play/Stop/Pause/Resume loaded audio * Manage mixing channels * Manage raw audio context * -* Uses external lib: -* OpenAL Soft - Audio device management lib (http://kcat.strangesoft.net/openal.html) -* stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) -* jar_xm - XM module file loading -* jar_mod - MOD audio file loading +* External libs: +* OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) +* stb_vorbis - OGG audio files loading (http://www.nothings.org/stb_vorbis/) +* jar_xm - XM module file loading +* jar_mod - MOD audio file loading +* dr_flac - FLAC audio file loading +* +* Module Configuration Flags: +* AUDIO_STANDALONE - Use this module as standalone library (independently of raylib) * * Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * XM audio module support (jar_xm) @@ -21,6 +25,7 @@ * Mixing channels support * Raw audio context support * +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event diff --git a/src/audio.h b/src/audio.h index 923492ca..5de8f613 100644 --- a/src/audio.h +++ b/src/audio.h @@ -2,18 +2,19 @@ * * raylib.audio * -* Basic functions to manage Audio: +* This module provides basic functionality to work with audio: * Manage audio device (init/close) -* Load and Unload audio files +* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) * Play/Stop/Pause/Resume loaded audio * Manage mixing channels * Manage raw audio context * -* Uses external lib: -* OpenAL Soft - Audio device management lib (http://kcat.strangesoft.net/openal.html) -* stb_vorbis - Ogg audio files loading (http://www.nothings.org/stb_vorbis/) -* jar_xm - XM module file loading -* jar_mod - MOD audio file loading +* External libs: +* OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) +* stb_vorbis - OGG audio files loading (http://www.nothings.org/stb_vorbis/) +* jar_xm - XM module file loading +* jar_mod - MOD audio file loading +* dr_flac - FLAC audio file loading * * Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * XM audio module support (jar_xm) @@ -21,6 +22,7 @@ * Mixing channels support * Raw audio context support * +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event diff --git a/src/core.c b/src/core.c index 8e15eb96..991dd4a0 100644 --- a/src/core.c +++ b/src/core.c @@ -4,24 +4,25 @@ * * Basic functions to manage windows, OpenGL context and input on multiple platforms * -* The following platforms are supported: -* PLATFORM_DESKTOP - Windows, Linux, Mac (OSX) -* PLATFORM_ANDROID - Only OpenGL ES 2.0 devices -* PLATFORM_RPI - Rapsberry Pi (tested on Raspbian) -* PLATFORM_WEB - Emscripten, HTML5 -* Oculus Rift CV1 (with desktop mirror) - View [rlgl] module to enable it +* The following platforms are supported: Windows, Linux, Mac (OSX), Android, Raspberry Pi, HTML5, Oculus Rift CV1 * -* On PLATFORM_DESKTOP, the external lib GLFW3 (www.glfw.com) is used to manage graphic -* device, OpenGL context and input on multiple operating systems (Windows, Linux, OSX). -* -* On PLATFORM_ANDROID, graphic device is managed by EGL and input system by Android activity. -* -* On PLATFORM_RPI, graphic device is managed by EGL and input system is coded in raw mode. +* External libs: +* GLFW3 - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX) +* raymath - 3D math functionality (Vector3, Matrix, Quaternion) +* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person) +* gestures - Gestures system for touch-ready devices (or simulated from mouse inputs) * * Module Configuration Flags: +* PLATFORM_DESKTOP - Windows, Linux, Mac (OSX) +* PLATFORM_ANDROID - Android (only OpenGL ES 2.0 devices), graphic device is managed by EGL and input system by Android activity. +* PLATFORM_RPI - Rapsberry Pi (tested on Raspbian), graphic device is managed by EGL and input system is coded in raw mode. +* PLATFORM_WEB - HTML5 (using emscripten compiler) * * RL_LOAD_DEFAULT_FONT - Use external module functions to load default raylib font (module: text) * +* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for render mirror - View [rlgl] module to enable it +* +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event diff --git a/src/external/stb_image.h b/src/external/stb_image.h index ce87646d..5572a880 100644 --- a/src/external/stb_image.h +++ b/src/external/stb_image.h @@ -390,7 +390,7 @@ publish, and distribute this file as you see fit. #define STBI_NO_HDR // RaySan: not required by raylib -#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 +//#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 #ifndef STBI_NO_STDIO #include @@ -398,7 +398,7 @@ publish, and distribute this file as you see fit. // NOTE: Added to work with raylib on Android #if defined(PLATFORM_ANDROID) - #include "utils.h" // Android fopen function map + #include "utils.h" // RaySan: Android fopen function map #endif #define STBI_VERSION 1 diff --git a/src/models.c b/src/models.c index b7e36b8a..4275f89e 100644 --- a/src/models.c +++ b/src/models.c @@ -4,6 +4,12 @@ * * Basic functions to draw 3d shapes and load/draw 3d models (.OBJ) * +* External libs: +* rlgl - raylib OpenGL abstraction layer +* +* Module Configuration Flags: +* ... +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event @@ -34,8 +40,7 @@ #include // Required for: strcmp() #include // Required for: sin(), cos() -#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 -#include "raymath.h" // Matrix data type and Matrix functions +#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 //---------------------------------------------------------------------------------- // Defines and Macros diff --git a/src/raylib.h b/src/raylib.h index 2e3112cf..ef393f63 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -6,37 +6,39 @@ * * Features: * Library written in plain C code (C99) -* Uses C# PascalCase/camelCase notation +* Uses PascalCase/camelCase notation * Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) * Unique OpenGL abstraction layer (usable as standalone module): [rlgl] * Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) * Multiple textures support, including compressed formats and mipmaps generation * Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps * Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support -* Powerful math module for Vector, Matrix and Quaternion operations [raymath] -* Audio loading and playing with streaming support and mixing channels (WAV, OGG, XM, MOD) +* Powerful math module for Vector, Matrix and Quaternion operations: [raymath] +* Audio loading and playing with streaming support and mixing channels [audio] * VR stereo rendering support with configurable HMD device parameters * Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 * Custom color palette for fancy visuals on raywhite background * Minimal external dependencies (GLFW3, OpenGL, OpenAL) +* Complete binding for LUA [rlua] * -* Used external libs: -* GLFW3 (www.glfw.org) for window/context management and input -* GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) -* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA, PSD, GIF, HDR, PIC) -* stb_image_write (Sean Barret) for image writting (PNG) -* stb_vorbis (Sean Barret) for ogg audio loading -* stb_truetype (Sean Barret) for ttf fonts loading -* jar_xm (Joshua Reisenauer) for XM audio module loading -* jar_mod (Joshua Reisenauer) for MOD audio module loading -* OpenAL Soft for audio device/context management -* tinfl for data decompression (DEFLATE algorithm) +* External libs: +* GLFW3 (www.glfw.org) for window/context management and input [core] +* GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] +* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] +* stb_image_write (Sean Barret) for image writting (PNG) [utils] +* stb_truetype (Sean Barret) for ttf fonts loading [text] +* stb_vorbis (Sean Barret) for ogg audio loading [audio] +* jar_xm (Joshua Reisenauer) for XM audio module loading [audio] +* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] +* dr_flac (David Reid) for FLAC audio file loading [audio] +* OpenAL Soft for audio device/context management [audio] +* tinfl for data decompression (DEFLATE algorithm) [utils] * * Some design decisions: * 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) -* One custom default font is loaded automatically when InitWindow() +* One custom default font could be loaded automatically when InitWindow() [core] * If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads -* If using OpenGL 3.3 or ES2, two default shaders are loaded automatically (internally defined) +* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) * * -- LICENSE -- * diff --git a/src/rlgl.c b/src/rlgl.c index d3bba07b..28dc5171 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2,11 +2,30 @@ * * rlgl - raylib OpenGL abstraction layer * -* raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: -* OpenGL 1.1 - Direct map rl* -> gl* -* OpenGL 2.1 - Vertex data is stored in VBOs, call rlglDraw() to render -* OpenGL 3.3 - Vertex data is stored in VAOs, call rlglDraw() to render -* OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render +* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to +* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). +* +* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal +* VBO buffers (and VAOs if available). It requires calling 3 functions: +* rlglInit() - Initialize internal buffers and auxiliar resources +* rlglDraw() - Process internal buffers and send required draw calls +* rlglClose() - De-initialize internal buffers data and other auxiliar resources +* +* External libs: +* raymath - 3D math functionality (Vector3, Matrix, Quaternion) +* GLAD - OpenGL extensions loading (OpenGL 3.3 Core only) +* +* Module Configuration Flags: +* GRAPHICS_API_OPENGL_11 - Use OpenGL 1.1 backend +* GRAPHICS_API_OPENGL_21 - Use OpenGL 2.1 backend +* GRAPHICS_API_OPENGL_33 - Use OpenGL 3.3 Core profile backend +* GRAPHICS_API_OPENGL_ES2 - Use OpenGL ES 2.0 backend +* +* RLGL_STANDALONE - Use rlgl as standalone library (no raylib dependency) +* RLGL_NO_STANDARD_SHADER - Avoid standard shader (shader_standard.h) inclusion +* RLGL_NO_DISTORTION_SHADER - Avoid stereo rendering distortion sahder (shader_distortion.h) inclusion +* RLGL_OCULUS_SUPPORT - Enable Oculus Rift CV1 functionality +* * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * diff --git a/src/rlgl.h b/src/rlgl.h index 78ea6727..e4d40714 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -2,11 +2,27 @@ * * rlgl - raylib OpenGL abstraction layer * -* raylib now uses OpenGL 1.1 style functions (rlVertex) that are mapped to selected OpenGL version: -* OpenGL 1.1 - Direct map rl* -> gl* -* OpenGL 2.1 - Vertex data is stored in VBOs, call rlglDraw() to render -* OpenGL 3.3 - Vertex data is stored in VAOs, call rlglDraw() to render -* OpenGL ES 2 - Vertex data is stored in VBOs or VAOs (when available), call rlglDraw() to render +* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to +* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). +* +* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal +* VBO buffers (and VAOs if available). It requires calling 3 functions: +* rlglInit() - Initialize internal buffers and auxiliar resources +* rlglDraw() - Process internal buffers and send required draw calls +* rlglClose() - De-initialize internal buffers data and other auxiliar resources +* +* External libs: +* raymath - 3D math functionality (Vector3, Matrix, Quaternion) +* GLAD - OpenGL extensions loading (OpenGL 3.3 Core only) +* +* Module Configuration Flags: +* GRAPHICS_API_OPENGL_11 - Use OpenGL 1.1 backend +* GRAPHICS_API_OPENGL_21 - Use OpenGL 2.1 backend +* GRAPHICS_API_OPENGL_33 - Use OpenGL 3.3 Core profile backend +* GRAPHICS_API_OPENGL_ES2 - Use OpenGL ES 2.0 backend +* +* RLGL_STANDALONE - Use rlgl as standalone library (no raylib dependency) +* * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * diff --git a/src/shapes.c b/src/shapes.c index 79cf567a..70aad59a 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -4,6 +4,12 @@ * * Basic functions to draw 2d Shapes and check collisions * +* External libs: +* rlgl - raylib OpenGL abstraction layer +* +* Module Configuration Flags: +* ... +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event @@ -25,11 +31,11 @@ #include "raylib.h" +#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 + #include // Required for: abs() #include // Required for: sinf(), cosf(), sqrtf() -#include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 - //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- diff --git a/src/text.c b/src/text.c index 72d273d4..d752f1cb 100644 --- a/src/text.c +++ b/src/text.c @@ -4,6 +4,12 @@ * * Basic functions to load SpriteFonts and draw Text * +* External libs: +* stb_truetype - Load TTF file and rasterize characters data +* +* Module Configuration Flags: +* ... +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event @@ -33,7 +39,7 @@ #include "utils.h" // Required for: GetExtension(), GetNextPOT() // Following libs are used on LoadTTF() -//#define STBTT_STATIC +#define STBTT_STATIC // Define stb_truetype functions static to this module #define STB_TRUETYPE_IMPLEMENTATION #include "external/stb_truetype.h" // Required for: stbtt_BakeFontBitmap() diff --git a/src/textures.c b/src/textures.c index 5354a74f..af59d035 100644 --- a/src/textures.c +++ b/src/textures.c @@ -4,9 +4,13 @@ * * Basic functions to load and draw Textures (2d) * -* Uses external lib: -* stb_image - Multiple formats image loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) -* NOTE: stb_image has been slightly modified, original library: https://github.com/nothings/stb +* External libs: +* stb_image - Multiple image formats loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) +* NOTE: stb_image has been slightly modified to support Android platform. +* stb_image_resize - Multiple image resize algorythms +* +* Module Configuration Flags: +* ... * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * diff --git a/src/utils.c b/src/utils.c index b96e2c70..640c5720 100644 --- a/src/utils.c +++ b/src/utils.c @@ -2,12 +2,16 @@ * * raylib.utils * -* Utils Functions Definitions +* Some utility functions * -* Uses external libs: -* tinfl - zlib DEFLATE algorithm decompression lib +* External libs: +* tinfl - zlib DEFLATE algorithm decompression * stb_image_write - PNG writting functions * +* Module Configuration Flags: +* DO_NOT_TRACE_DEBUG_MSGS - Avoid showing DEBUG TraceLog() messages +* +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event @@ -46,7 +50,9 @@ #endif #include "external/tinfl.c" // Required for: tinfl_decompress_mem_to_mem() - // NOTE: Deflate algorythm data decompression + // NOTE: DEFLATE algorythm data decompression + +#define DO_NOT_TRACE_DEBUG_MSGS // Avoid DEBUG messages tracing //---------------------------------------------------------------------------------- // Global Variables Definition diff --git a/src/utils.h b/src/utils.h index 899cf583..045b0692 100644 --- a/src/utils.h +++ b/src/utils.h @@ -2,9 +2,9 @@ * * raylib.utils * -* Some utility functions: rRES files data decompression +* Some utility functions * -* Copyright (c) 2014 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -34,8 +34,6 @@ //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- -#define DO_NOT_TRACE_DEBUG_MSGS // Use this define to avoid DEBUG tracing - #if defined(PLATFORM_ANDROID) #define fopen(name, mode) android_fopen(name, mode) #endif -- cgit v1.2.3 From 5d46c27cd56fe482b80132fc3d75e452b1c0f87f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 16 Nov 2016 19:08:42 +0100 Subject: Update resource file for raylib 1.6 --- src/resources | Bin 107204 -> 107212 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/resources b/src/resources index e0fe66ba..5c76749d 100644 Binary files a/src/resources and b/src/resources differ -- cgit v1.2.3 From 41e49c5a6e8b9816c7aae4a9fddecdf5d6b91a7b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 16 Nov 2016 19:10:03 +0100 Subject: Remove CMakeList Working on an updated version... --- src/CMakeLists.txt | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index c094ad96..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -cmake_minimum_required (VERSION 3.0) -project (raylib) -SET(PLATFORM_TO_USE "PLATFORM_DESKTOP" CACHE STRING "Platform to compile for") -SET_PROPERTY(CACHE PLATFORM_TO_USE PROPERTY STRINGS PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB) - -set(CMAKE_C_FLAGS "-O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces") - -IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_DESKTOP") - - add_definitions(-DPLATFORM_DESKTOP, -DGRAPHICS_API_OPENGL_33) - include_directories("." "external/" "external/openal_soft/include" "external/glfw3/include") - -ENDIF() - -IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_RPI") - - add_definitions(-DPLATFORM_RPI, -GRAPHICS_API_OPENGL_ES2) - include_directories("." "external/" "/opt/vc/include" "/opt/vc/include/interface/vmcs_host/linux" "/opt/vc/include/interface/vcos/pthreads") - -ENDIF() - -IF(${PLATFORM_TO_USE} MATCHES "PLATFORM_WEB") - - add_definitions(-DPLATFORM_WEB, -GRAPHICS_API_OPENGL_ES2) - include_directories("." "external/" "external/openal_soft/include" "external/glfw3/include") - -ENDIF() - - -file(GLOB SOURCES "*.c" "external/*.c") -add_library(raylib STATIC ${SOURCES}) -install(TARGETS raylib DESTINATION ../lib/) \ No newline at end of file -- cgit v1.2.3 From f18c8cea160b65cf1fa30eb1578442dbe7edd032 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 16 Nov 2016 19:43:21 +0100 Subject: Updated to support OpenAL Soft static library --- src/Makefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index ee3f0c12..feadc424 100644 --- a/src/Makefile +++ b/src/Makefile @@ -38,6 +38,9 @@ PLATFORM ?= PLATFORM_DESKTOP # define YES if you want shared/dynamic version of library instead of static (default) SHARED ?= NO +# define NO to use OpenAL Soft as static library (or shared by default) +SHARED_OPENAL ?= NO + # determine if the file has root access (only for installing raylib) # "whoami" prints the name of the user that calls him (so, if it is the root # user, "whoami" prints "root"). @@ -99,11 +102,20 @@ CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces ifeq ($(SHARED),YES) CFLAGS += -fPIC SHAREDFLAG = BUILDING_DLL - SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lopenal32 -lgdi32 + SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lgdi32 else SHAREDFLAG = BUILDING_STATIC endif +# if static OpenAL Soft required, define the corresponding flags +ifeq ($(SHARED_OPENAL),NO) + SHAREDLIBS += -lopenal32 -lwinmm + SHAREDOPENALFLAG = AL_LIBTYPE_STATIC +else + SHAREDLIBS += -lopenal32dll + SHAREDOPENALFLAG = SHARED_OPENAL +endif + #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes # define any directories containing required header files @@ -165,7 +177,7 @@ else endif ifeq ($(PLATFORM_OS),WINDOWS) $(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a - @echo "raylib dynamic library (raylib.dll) and MSVC required import library (libraylibdll.a) generated!" + @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" endif else # compile raylib static library for desktop platforms. @@ -202,7 +214,7 @@ models.o : models.c raylib.h rlgl.h raymath.h # compile audio module audio.o : audio.c raylib.h - $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) + $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) -D$(SHAREDOPENALFLAG) # compile stb_vorbis library external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h -- cgit v1.2.3 From bee283b12b348b054bde2eae1a449c363ac26fd7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 17 Nov 2016 12:55:30 +0100 Subject: Some tweaks around --- src/Makefile | 5 +++++ src/core.c | 4 ++-- src/models.c | 12 ++++++------ src/raylib.h | 16 ++++++++-------- src/rlgl.c | 4 ++-- src/rlgl.h | 3 ++- 6 files changed, 25 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index feadc424..2433428f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,11 @@ SHARED ?= NO # define NO to use OpenAL Soft as static library (or shared by default) SHARED_OPENAL ?= NO +# on PLATFORM_WEB force OpenAL Soft shared library +ifeq ($(PLATFORM),PLATFORM_WEB) + SHARED_OPENAL ?= YES +endif + # determine if the file has root access (only for installing raylib) # "whoami" prints the name of the user that calls him (so, if it is the root # user, "whoami" prints "root"). diff --git a/src/core.c b/src/core.c index 991dd4a0..4807b7f6 100644 --- a/src/core.c +++ b/src/core.c @@ -668,7 +668,7 @@ void Begin3dMode(Camera camera) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - if (IsVrDeviceReady()) BeginVrDrawing(); + if (IsVrDeviceReady() || IsVrSimulator()) BeginVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix @@ -698,7 +698,7 @@ void End3dMode(void) { rlglDraw(); // Process internal buffers (update + draw) - if (IsVrDeviceReady()) EndVrDrawing(); + if (IsVrDeviceReady() || IsVrSimulator()) EndVrDrawing(); rlMatrixMode(RL_PROJECTION); // Switch to projection matrix rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack diff --git a/src/models.c b/src/models.c index 4275f89e..be0e6ea4 100644 --- a/src/models.c +++ b/src/models.c @@ -81,11 +81,11 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) } // Draw a circle in 3D world space -void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color) +void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color) { rlPushMatrix(); rlTranslatef(center.x, center.y, center.z); - rlRotatef(rotationAngle, rotation.x, rotation.y, rotation.z); + rlRotatef(rotationAngle, rotationAxis.x, rotationAxis.y, rotationAxis.z); rlBegin(RL_LINES); for (int i = 0; i < 360; i += 10) @@ -584,9 +584,9 @@ void DrawLight(Light light) { DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, 0.0f, (Vector3){ 0, 0, 0 }, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 1, 0, 0 }, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, 90.0f, (Vector3){ 0, 1, 0 }, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : GRAY)); } break; case LIGHT_DIRECTIONAL: { @@ -602,7 +602,7 @@ void DrawLight(Light light) Vector3 dir = VectorSubtract(light->target, light->position); VectorNormalize(&dir); - DrawCircle3D(light->position, 0.5f, 0.0f, dir, (light->enabled ? light->diffuse : GRAY)); + DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : GRAY)); //DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : GRAY)); DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); diff --git a/src/raylib.h b/src/raylib.h index ef393f63..6d67051e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -724,7 +724,7 @@ RLAPI float GetGesturePinchAngle(void); // Get gesture pin //------------------------------------------------------------------------------------ // Camera System Functions (Module: camera) //------------------------------------------------------------------------------------ -RLAPI void SetCameraMode(Camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) @@ -835,7 +835,7 @@ RLAPI const char *SubText(const char *text, int position, int length); // Basic 3d Shapes Drawing Functions (Module: models) //------------------------------------------------------------------------------------ RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space -RLAPI void DrawCircle3D(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color); // Draw a circle in 3D world space +RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires @@ -850,7 +850,7 @@ RLAPI void DrawRay(Ray ray, Color color); RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo RLAPI void DrawLight(Light light); // Draw light in 3D world -//DrawTorus(), DrawTeapot() are useless... +//DrawTorus(), DrawTeapot() could be useful? //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) @@ -917,7 +917,7 @@ RLAPI void DestroyLight(Light light); // Des //------------------------------------------------------------------------------------ RLAPI void InitVrDevice(int vdDevice); // Init VR device RLAPI void CloseVrDevice(void); // Close VR device -RLAPI bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +RLAPI bool IsVrDeviceReady(void); // Detect if VR device is ready RLAPI bool IsVrSimulator(void); // Detect if VR simulator is running RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera RLAPI void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) @@ -926,7 +926,7 @@ RLAPI void ToggleVrMode(void); // Enable/Disable VR experienc // Audio Loading and Playing Functions (Module: audio) //------------------------------------------------------------------------------------ RLAPI void InitAudioDevice(void); // Initialize audio device and context -RLAPI void CloseAudioDevice(void); // Close the audio device and context (and music stream) +RLAPI void CloseAudioDevice(void); // Close the audio device and context RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully RLAPI Wave LoadWave(const char *fileName); // Load wave data from file into RAM @@ -950,9 +950,9 @@ RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI void UnloadMusicStream(Music music); // Unload music stream -RLAPI void PlayMusicStream(Music music); // Start music playing (open stream) +RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming -RLAPI void StopMusicStream(Music music); // Stop music playing (close stream) +RLAPI void StopMusicStream(Music music); // Stop music playing RLAPI void PauseMusicStream(Music music); // Pause music playing RLAPI void ResumeMusicStream(Music music); // Resume playing paused music RLAPI bool IsMusicPlaying(Music music); // Check if music is playing @@ -963,7 +963,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, - unsigned int channels); // Init audio stream (to stream audio pcm data) + unsigned int channels); // Init audio stream (to stream raw audio pcm data) RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill diff --git a/src/rlgl.c b/src/rlgl.c index 28dc5171..b567f8fd 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2786,13 +2786,13 @@ void CloseVrDevice(void) // Detect if VR device is available bool IsVrDeviceReady(void) { - return (vrDeviceReady || vrSimulator) && vrEnabled; + return (vrDeviceReady && vrEnabled); } // Detect if VR simulator is running bool IsVrSimulator(void) { - return vrSimulator; + return (vrSimulator && vrEnabled); } // Enable/Disable VR experience (device or simulator) diff --git a/src/rlgl.h b/src/rlgl.h index e4d40714..7d328a52 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -423,7 +423,8 @@ float *MatrixToFloat(Matrix mat); void InitVrDevice(int vrDevice); // Init VR device void CloseVrDevice(void); // Close VR device -bool IsVrDeviceReady(void); // Detect if VR device (or simulator) is ready +bool IsVrDeviceReady(void); // Detect if VR device is ready +bool IsVrSimulator(void); // Detect if VR simulator is running void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) -- cgit v1.2.3 From b0d5a7a3727c5f36cc187f0a5878392a43b9e1e8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 17 Nov 2016 13:50:56 +0100 Subject: Corrected bug on Android --- src/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4807b7f6..7749eab7 100644 --- a/src/core.c +++ b/src/core.c @@ -1176,11 +1176,12 @@ bool IsGamepadName(int gamepad, const char *name) { bool result = false; const char *gamepadName = NULL; - + +#if !defined(PLATFORM_ANDROID) if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad); - if ((name != NULL) && (gamepadName != NULL)) result = (strcmp(name, gamepadName) == 0); - +#endif + return result; } -- cgit v1.2.3 From f7b706263a820034a93ab88e7582b7001819d8d0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 18 Nov 2016 13:39:57 +0100 Subject: Some code tweaks Correcting details that pop-up when testing the different platforms --- src/Makefile | 7 ++++++- src/audio.c | 12 ++++-------- src/audio.h | 39 +++++++++++++++++++++++---------------- src/core.c | 9 +++++++-- src/models.c | 21 +++++++++++---------- 5 files changed, 51 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 2433428f..2e263189 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,7 +39,7 @@ PLATFORM ?= PLATFORM_DESKTOP SHARED ?= NO # define NO to use OpenAL Soft as static library (or shared by default) -SHARED_OPENAL ?= NO +SHARED_OPENAL ?= YES # on PLATFORM_WEB force OpenAL Soft shared library ifeq ($(PLATFORM),PLATFORM_WEB) @@ -188,6 +188,11 @@ else # compile raylib static library for desktop platforms. ar rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) @echo "libraylib.a generated (static library)!" + ifeq ($(SHARED_OPENAL),NO) + @echo "expected OpenAL Soft static library linking" + else + @echo "expected OpenAL Soft shared library linking" + endif endif endif diff --git a/src/audio.c b/src/audio.c index 3ddbf0ce..49aca4b0 100644 --- a/src/audio.c +++ b/src/audio.c @@ -49,8 +49,11 @@ #if defined(AUDIO_STANDALONE) #include "audio.h" + #include // Required for: va_list, va_start(), vfprintf(), va_end() #else #include "raylib.h" + #include "utils.h" // Required for: DecompressData() + // NOTE: Includes Android fopen() function map #endif #include "AL/al.h" // OpenAL basic header @@ -68,13 +71,6 @@ #define AL_FORMAT_STEREO_FLOAT32 0x10011 #endif -#if defined(AUDIO_STANDALONE) - #include // Required for: va_list, va_start(), vfprintf(), va_end() -#else - #include "utils.h" // Required for: DecompressData() - // NOTE: Includes Android fopen() function map -#endif - //#define STB_VORBIS_HEADER_ONLY #include "external/stb_vorbis.h" // OGG loading functions @@ -122,7 +118,7 @@ typedef struct MusicData { bool loop; // Repeat music after finish (loop) unsigned int totalSamples; // Total number of samples unsigned int samplesLeft; // Number of samples left to end -} MusicData, *Music; +} MusicData; #if defined(AUDIO_STANDALONE) typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; diff --git a/src/audio.h b/src/audio.h index 5de8f613..2b3c5933 100644 --- a/src/audio.h +++ b/src/audio.h @@ -62,12 +62,6 @@ #endif #endif -// Sound source type -typedef struct Sound { - unsigned int source; // Sound audio source id - unsigned int buffer; // Sound audio buffer id -} Sound; - // Wave type, defines audio wave data typedef struct Wave { unsigned int sampleCount; // Number of samples @@ -77,9 +71,16 @@ typedef struct Wave { void *data; // Buffer data pointer } Wave; +// Sound source type +typedef struct Sound { + unsigned int source; // OpenAL audio source id + unsigned int buffer; // OpenAL audio buffer id + int format; // OpenAL audio format specifier +} Sound; + // Music type (file streaming from memory) // NOTE: Anything longer than ~10 seconds should be streamed -typedef struct Music *Music; +typedef struct MusicData *Music; // Audio stream type // NOTE: Useful to create custom audio streams not bound to a specific file @@ -106,13 +107,16 @@ extern "C" { // Prevents name mangling of functions // Module Functions Declaration //---------------------------------------------------------------------------------- void InitAudioDevice(void); // Initialize audio device and context -void CloseAudioDevice(void); // Close the audio device and context (and music stream) +void CloseAudioDevice(void); // Close the audio device and context bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -Sound LoadSound(char *fileName); // Load sound to memory +Wave LoadWave(const char *fileName); // Load wave data from file into RAM +Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) +Sound LoadSound(const char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data +void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound void PauseSound(Sound sound); // Pause a sound @@ -121,12 +125,15 @@ void StopSound(Sound sound); // Stop playing bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) - -Music LoadMusicStream(char *fileName); // Load music stream from file +void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +Wave WaveCopy(Wave wave); // Copy a wave to a new wave +void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +float *GetWaveData(Wave wave); // Get samples data from wave as a floats array +Music LoadMusicStream(const char *fileName); // Load music stream from file void UnloadMusicStream(Music music); // Unload music stream -void PlayMusicStream(Music music); // Start music playing (open stream) +void PlayMusicStream(Music music); // Start music playing void UpdateMusicStream(Music music); // Updates buffers for music streaming -void StopMusicStream(Music music); // Stop music playing (close stream) +void StopMusicStream(Music music); // Stop music playing void PauseMusicStream(Music music); // Pause music playing void ResumeMusicStream(Music music); // Resume playing paused music bool IsMusicPlaying(Music music); // Check if music is playing @@ -135,9 +142,9 @@ void SetMusicPitch(Music music, float pitch); // Set pitch for float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) -AudioStream InitAudioStream(unsigned int sampleRate, - unsigned int sampleSize, - unsigned int channels); // Init audio stream (to stream audio pcm data) +AudioStream InitAudioStream(unsigned int sampleRate, + unsigned int sampleSize, + unsigned int channels); // Init audio stream (to stream raw audio pcm data) void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data void CloseAudioStream(AudioStream stream); // Close audio stream and free memory bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill diff --git a/src/core.c b/src/core.c index 7749eab7..241772ec 100644 --- a/src/core.c +++ b/src/core.c @@ -1175,9 +1175,10 @@ bool IsGamepadAvailable(int gamepad) bool IsGamepadName(int gamepad, const char *name) { bool result = false; - const char *gamepadName = NULL; #if !defined(PLATFORM_ANDROID) + const char *gamepadName = NULL; + if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad); if ((name != NULL) && (gamepadName != NULL)) result = (strcmp(name, gamepadName) == 0); #endif @@ -1977,7 +1978,11 @@ static void PollInputEvents(void) previousMouseWheelY = currentMouseWheelY; currentMouseWheelY = 0; - +#endif + +// NOTE: GLFW3 joystick functionality not available in web +// TODO: Support joysticks using emscripten API +#if defined(PLATFORM_DESKTOP) // Check if gamepads are ready // NOTE: We do it here in case of disconection for (int i = 0; i < MAX_GAMEPADS; i++) diff --git a/src/models.c b/src/models.c index be0e6ea4..48f8b813 100644 --- a/src/models.c +++ b/src/models.c @@ -1817,6 +1817,7 @@ static Material LoadMTL(const char *fileName) char buffer[MAX_BUFFER_SIZE]; Vector3 color = { 1.0f, 1.0f, 1.0f }; char mapFileName[128]; + int result = 0; FILE *mtlFile; @@ -1901,13 +1902,13 @@ static Material LoadMTL(const char *fileName) { if (buffer[5] == 'd') // map_Kd string Diffuse color texture map. { - sscanf(buffer, "map_Kd %s", mapFileName); - if (mapFileName != NULL) material.texDiffuse = LoadTexture(mapFileName); + result = sscanf(buffer, "map_Kd %s", mapFileName); + if (result != EOF) material.texDiffuse = LoadTexture(mapFileName); } else if (buffer[5] == 's') // map_Ks string Specular color texture map. { - sscanf(buffer, "map_Ks %s", mapFileName); - if (mapFileName != NULL) material.texSpecular = LoadTexture(mapFileName); + result = sscanf(buffer, "map_Ks %s", mapFileName); + if (result != EOF) material.texSpecular = LoadTexture(mapFileName); } else if (buffer[5] == 'a') // map_Ka string Ambient color texture map. { @@ -1916,13 +1917,13 @@ static Material LoadMTL(const char *fileName) } break; case 'B': // map_Bump string Bump texture map. { - sscanf(buffer, "map_Bump %s", mapFileName); - if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + result = sscanf(buffer, "map_Bump %s", mapFileName); + if (result != EOF) material.texNormal = LoadTexture(mapFileName); } break; case 'b': // map_bump string Bump texture map. { - sscanf(buffer, "map_bump %s", mapFileName); - if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + result = sscanf(buffer, "map_bump %s", mapFileName); + if (result != EOF) material.texNormal = LoadTexture(mapFileName); } break; case 'd': // map_d string Opacity texture map. { @@ -1946,8 +1947,8 @@ static Material LoadMTL(const char *fileName) } break; case 'b': // bump string Bump texture map { - sscanf(buffer, "bump %s", mapFileName); - if (mapFileName != NULL) material.texNormal = LoadTexture(mapFileName); + result = sscanf(buffer, "bump %s", mapFileName); + if (result != EOF) material.texNormal = LoadTexture(mapFileName); } break; case 'T': // Tr float Transparency Tr (alpha). Tr is inverse of d { -- cgit v1.2.3 From f0626324ab1d5284f64a8a4b0c3dd2dbaeec3688 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 21 Nov 2016 00:00:27 +0100 Subject: rlua: Added some missing functions Updated to raylib 1.6 functionality --- src/rlua.h | 189 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 106 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 97d22922..2f522878 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -1095,14 +1095,14 @@ int lua_IsFileDropped(lua_State* L) int lua_GetDroppedFiles(lua_State* L) { int count = 0; - char ** result = GetDroppedFiles(&count); + char ** result = GetDroppedFiles(&count); lua_createtable(L, count, 0); for (int i = 0; i < count; i++) { lua_pushstring(L, result[i]); lua_rawseti(L, -2, i + 1); } - return 1; + return 1; } int lua_ClearDroppedFiles(lua_State* L) @@ -1130,7 +1130,6 @@ int lua_StorageLoadValue(lua_State* L) //------------------------------------------------------------------------------------ // raylib [core] module functions - Input Handling //------------------------------------------------------------------------------------ -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) int lua_IsKeyPressed(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); @@ -1185,12 +1184,22 @@ int lua_IsGamepadAvailable(lua_State* L) return 1; } -int lua_GetGamepadAxisMovement(lua_State* L) +int lua_IsGamepadName(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float result = GetGamepadAxisMovement(arg1, arg2); - lua_pushnumber(L, result); + const char * arg2 = LuaGetArgument_string(L, 2); + bool result = IsGamepadName(arg1, arg2); + lua_pushboolean(L, result); + return 1; +} + +int lua_GetGamepadName(lua_State* L) +{ + // TODO: Return gamepad name id + + int arg1 = LuaGetArgument_int(L, 1); + char * result = GetGamepadName(arg1); + //lua_pushboolean(L, result); return 1; } @@ -1229,7 +1238,30 @@ int lua_IsGamepadButtonUp(lua_State* L) lua_pushboolean(L, result); return 1; } -#endif + +int lua_GetGamepadButtonPressed(lua_State* L) +{ + int result = GetGamepadButtonPressed(); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetGamepadAxisCount(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int result = GetGamepadAxisCount(arg1); + lua_pushinteger(L, result); + return 1; +} + +int lua_GetGamepadAxisMovement(lua_State* L) +{ + int arg1 = LuaGetArgument_int(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + float result = GetGamepadAxisMovement(arg1, arg2); + lua_pushnumber(L, result); + return 1; +} int lua_IsMouseButtonPressed(lua_State* L) { @@ -1419,8 +1451,9 @@ int lua_GetGesturePinchAngle(lua_State* L) //------------------------------------------------------------------------------------ int lua_SetCameraMode(lua_State* L) { - int arg1 = LuaGetArgument_int(L, 1); - SetCameraMode(arg1); + Camera arg1 = LuaGetArgument_Camera(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + SetCameraMode(arg1, arg2); return 0; } @@ -1432,37 +1465,6 @@ int lua_UpdateCamera(lua_State* L) return 1; } -int lua_UpdateCameraPlayer(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - UpdateCameraPlayer(&arg1, &arg2); - LuaPush_Camera(L, arg1); - LuaPush_Vector3(L, arg2); - return 2; -} - -int lua_SetCameraPosition(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - SetCameraPosition(arg1); - return 0; -} - -int lua_SetCameraTarget(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - SetCameraTarget(arg1); - return 0; -} - -int lua_SetCameraFovy(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - SetCameraFovy(arg1); - return 0; -} - int lua_SetCameraPanControl(lua_State* L) { int arg1 = LuaGetArgument_int(L, 1); @@ -1496,13 +1498,6 @@ int lua_SetCameraMoveControls(lua_State* L) return 0; } -int lua_SetCameraMouseSensitivity(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - SetCameraMouseSensitivity(arg1); - return 0; -} - //------------------------------------------------------------------------------------ // raylib [shapes] module functions - Basic Shapes Drawing //------------------------------------------------------------------------------------ @@ -1908,6 +1903,14 @@ int lua_GetTextureData(lua_State* L) return 1; } +int lua_UpdateTexture(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? + UpdateTexture(arg1, arg2); // ISSUE: #2 string expected, got table -> GetImageData() returns a table! + return 0; +} + int lua_ImageToPOT(lua_State* L) { Image arg1 = LuaGetArgument_Image(L, 1); @@ -2100,11 +2103,19 @@ int lua_GenTextureMipmaps(lua_State* L) return 0; } -int lua_UpdateTexture(lua_State* L) +int lua_SetTextureFilter(lua_State* L) { Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? - UpdateTexture(arg1, arg2); // ISSUE: #2 string expected, got table -> GetImageData() returns a table! + int arg2 = LuaGetArgument_int(L, 2); + SetTextureFilter(arg1, arg2); + return 0; +} + +int lua_SetTextureWrap(lua_State* L) +{ + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + SetTextureWrap(arg1, arg2); return 0; } @@ -2178,6 +2189,18 @@ int lua_LoadSpriteFont(lua_State* L) return 1; } +int lua_LoadSpriteFontTTF(lua_State* L) +{ + const char * arg1 = LuaGetArgument_string(L, 1); + int arg2 = LuaGetArgument_int(L, 2); + int arg3 = LuaGetArgument_int(L, 3); + int arg4 = LuaGetArgument_int(L, 4); + //LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); + SpriteFont result = LoadSpriteFontTTF(arg1, arg2, arg3, &arg4); + LuaPush_SpriteFont(L, result); + return 1; +} + int lua_UnloadSpriteFont(lua_State* L) { SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); @@ -2255,8 +2278,8 @@ int lua_DrawCircle3D(lua_State* L) { Vector3 arg1 = LuaGetArgument_Vector3(L, 1); float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); + Vector3 arg3 = LuaGetArgument_Vector3(L, 3); + float arg4 = LuaGetArgument_float(L, 4); Color arg5 = LuaGetArgument_Color(L, 5); DrawCircle3D(arg1, arg2, arg3, arg4, arg5); return 0; @@ -2619,18 +2642,6 @@ int lua_CheckCollisionRayBox(lua_State* L) return 1; } -int lua_ResolveCollisionCubicmap(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 result = ResolveCollisionCubicmap(arg1, arg2, &arg3, arg4); - LuaPush_Vector3(L, result); - LuaPush_Vector3(L, arg3); - return 2; -} - //------------------------------------------------------------------------------------ // raylib [raymath] module functions - Shaders //------------------------------------------------------------------------------------ @@ -2790,10 +2801,19 @@ int lua_IsVrDeviceReady(lua_State* L) return 1; } +int lua_IsVrSimulator(lua_State* L) +{ + bool result = IsVrSimulator(); + lua_pushboolean(L, result); + return 1; +} + int lua_UpdateVrTracking(lua_State* L) { - UpdateVrTracking(); - return 0; + Camera arg1 = LuaGetArgument_Camera(L, 1); + UpdateVrTracking(&arg1); + LuaPush_Camera(L, arg1); + return 1; } int lua_ToggleVrMode(lua_State* L) @@ -2952,11 +2972,11 @@ int lua_WaveFormat(lua_State* L) int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); - WaveFormat(arg1, arg2, arg3, arg4); + WaveFormat(&arg1, arg2, arg3, arg4); return 0; } -int lua_LoadMusicStream(lua_State* L) +int lua_WaveCopy(lua_State* L) { Wave arg1 = LuaGetArgument_Wave(L, 1); Wave result = WaveCopy(arg1); @@ -2969,7 +2989,7 @@ int lua_WaveCrop(lua_State* L) Wave arg1 = LuaGetArgument_Wave(L, 1); int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); - WaveCrop(arg1, arg2, arg3); + WaveCrop(&arg1, arg2, arg3); return 0; } @@ -2978,9 +2998,10 @@ int lua_GetWaveData(lua_State* L) // TODO: float *GetWaveData(Wave wave); Wave arg1 = LuaGetArgument_Wave(L, 1); - float result = GetWaveData(arg1); - LuaPush_float(L, result); - return 1; + float * result = GetWaveData(arg1); + //LuaPush_float(L, result); + //lua_pushnumber(L, result); + return 0; } int lua_LoadMusicStream(lua_State* L) @@ -3675,12 +3696,17 @@ static luaL_Reg raylib_functions[] = { REG(GetKeyPressed) REG(SetExitKey) + REG(IsGamepadAvailable) - REG(GetGamepadAxisMovement) + REG(IsGamepadName) + REG(GetGamepadName) REG(IsGamepadButtonPressed) REG(IsGamepadButtonDown) REG(IsGamepadButtonReleased) REG(IsGamepadButtonUp) + REG(GetGamepadButtonPressed) + REG(GetGamepadAxisCount) + REG(GetGamepadAxisMovement) #endif REG(IsMouseButtonPressed) @@ -3714,16 +3740,10 @@ static luaL_Reg raylib_functions[] = { REG(SetCameraMode) REG(UpdateCamera) - REG(UpdateCameraPlayer) - REG(SetCameraPosition) - REG(SetCameraTarget) - REG(SetCameraFovy) - REG(SetCameraPanControl) REG(SetCameraAltControl) REG(SetCameraSmoothZoomControl) REG(SetCameraMoveControls) - REG(SetCameraMouseSensitivity) REG(DrawPixel) REG(DrawPixelV) @@ -3766,6 +3786,7 @@ static luaL_Reg raylib_functions[] = { REG(UnloadRenderTexture) REG(GetImageData) REG(GetTextureData) + REG(UpdateTexture) REG(ImageToPOT) REG(ImageFormat) REG(ImageDither) @@ -3786,8 +3807,9 @@ static luaL_Reg raylib_functions[] = { REG(ImageColorContrast) REG(ImageColorBrightness) REG(GenTextureMipmaps) - REG(UpdateTexture) - + REG(SetTextureFilter) + REG(SetTextureWrap) + REG(DrawTexture) REG(DrawTextureV) REG(DrawTextureEx) @@ -3796,6 +3818,7 @@ static luaL_Reg raylib_functions[] = { REG(GetDefaultFont) REG(LoadSpriteFont) + REG(LoadSpriteFontTTF) REG(UnloadSpriteFont) REG(DrawText) REG(DrawTextEx) @@ -3845,7 +3868,6 @@ static luaL_Reg raylib_functions[] = { REG(CheckCollisionRaySphere) REG(CheckCollisionRaySphereEx) REG(CheckCollisionRayBox) - REG(ResolveCollisionCubicmap) REG(LoadShader) REG(UnloadShader) @@ -3868,6 +3890,7 @@ static luaL_Reg raylib_functions[] = { REG(InitVrDevice) REG(CloseVrDevice) REG(IsVrDeviceReady) + REG(IsVrSimulator) REG(UpdateVrTracking) REG(ToggleVrMode) -- cgit v1.2.3 From 85c400c006cd2ef7dd4133ccb47223069334a38d Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 21 Nov 2016 00:07:31 +0100 Subject: rlua: Added functions notes Functions that need to manage big data arrays don't work properly, that functionality should be reviewed... --- src/rlua.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 2f522878..c801a328 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -1785,6 +1785,8 @@ int lua_LoadImage(lua_State* L) int lua_LoadImageEx(lua_State* L) { + // TODO: Image LoadImageEx(Color *pixels, int width, int height); + GET_TABLE(Color, arg1, 1); int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); @@ -1883,6 +1885,8 @@ int lua_UnloadRenderTexture(lua_State* L) int lua_GetImageData(lua_State* L) { + // TODO: Color *GetImageData(Image image); + Image arg1 = LuaGetArgument_Image(L, 1); Color * result = GetImageData(arg1); lua_createtable(L, arg1.width*arg1.height, 0); @@ -1905,6 +1909,8 @@ int lua_GetTextureData(lua_State* L) int lua_UpdateTexture(lua_State* L) { + // TODO: void UpdateTexture(Texture2D texture, void *pixels); + Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? UpdateTexture(arg1, arg2); // ISSUE: #2 string expected, got table -> GetImageData() returns a table! @@ -2893,6 +2899,8 @@ int lua_LoadSoundFromRES(lua_State* L) int lua_UpdateSound(lua_State* L) { + // TODO: void UpdateSound(Sound sound, void *data, int numSamples); + Sound arg1 = LuaGetArgument_Sound(L, 1); const char * arg2 = LuaGetArgument_string(L, 2); int * arg3 = LuaGetArgument_int(L, 3); @@ -3033,7 +3041,6 @@ int lua_PlayMusicStream(lua_State* L) return 0; } - int lua_StopMusicStream(lua_State* L) { Music arg1 = LuaGetArgument_Music(L, 1); @@ -3114,6 +3121,8 @@ int lua_CloseAudioStream(lua_State* L) int lua_UpdateAudioStream(lua_State* L) { + // TODO: void UpdateAudioStream(AudioStream stream, void *data, int numSamples); + AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); void * arg2 = (char *)LuaGetArgument_string(L, 2); int arg3 = LuaGetArgument_int(L, 3); @@ -3688,7 +3697,6 @@ static luaL_Reg raylib_functions[] = { REG(StorageSaveValue) REG(StorageLoadValue) -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) REG(IsKeyPressed) REG(IsKeyDown) REG(IsKeyReleased) @@ -3696,7 +3704,6 @@ static luaL_Reg raylib_functions[] = { REG(GetKeyPressed) REG(SetExitKey) - REG(IsGamepadAvailable) REG(IsGamepadName) REG(GetGamepadName) @@ -3707,7 +3714,6 @@ static luaL_Reg raylib_functions[] = { REG(GetGamepadButtonPressed) REG(GetGamepadAxisCount) REG(GetGamepadAxisMovement) -#endif REG(IsMouseButtonPressed) REG(IsMouseButtonDown) -- cgit v1.2.3 From 481ce3d39d8072d20b425dba928efe4cff522db9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 21 Nov 2016 19:47:58 +0100 Subject: Corrected bug with alpha mask on font Mask was wrongly applied to 8-bit font image, it generated dark borders on the font. Grayscale image has to be considered as the alpha mask for a completely white image to use it correctly. --- src/text.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index d752f1cb..c394889e 100644 --- a/src/text.c +++ b/src/text.c @@ -875,10 +875,18 @@ static SpriteFont LoadBMFont(const char *fileName) TraceLog(DEBUG, "[%s] Font texture loading path: %s", fileName, texPath); Image imFont = LoadImage(texPath); + + if (imFont.format == UNCOMPRESSED_GRAYSCALE) + { + Image imCopy = ImageCopy(imFont); + + for (int i = 0; i < imCopy.width*imCopy.height; i++) ((unsigned char *)imCopy.data)[i] = 0xff; // WHITE pixel - if (imFont.format == UNCOMPRESSED_GRAYSCALE) ImageAlphaMask(&imFont, imFont); - - font.texture = LoadTextureFromImage(imFont); + ImageAlphaMask(&imCopy, imFont); + font.texture = LoadTextureFromImage(imCopy); + UnloadImage(imCopy); + } + else font.texture = LoadTextureFromImage(imFont); font.size = fontSize; font.numChars = numChars; -- cgit v1.2.3 From aa9353feb4bab7fbbc058afdce634c0ae24e6110 Mon Sep 17 00:00:00 2001 From: victorfisac Date: Mon, 21 Nov 2016 20:30:46 +0100 Subject: Updated Physac library --- src/physac.h | 2529 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 1887 insertions(+), 642 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index dd4c4126..e807ffa6 100644 --- a/src/physac.h +++ b/src/physac.h @@ -1,8 +1,11 @@ /********************************************************************************************** * -* physac 1.0 - 2D Physics library for raylib (https://github.com/raysan5/raylib) +* Physac - 2D Physics library for videogames * -* // TODO: Description... +* Description: Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop +* to simluate physics. A physics step contains the following phases: get collision information, apply dynamics, +* collision solving and position correction. It uses a very simple struct for physic bodies with a position vector +* to be used in any 3D rendering API. * * CONFIGURATION: * @@ -24,30 +27,21 @@ * internally in the library and input management and drawing functions must be provided by * the user (check library implementation for further details). * +* #define PHYSAC_DEBUG +* Traces log messages when creating and destroying physics bodies and detects errors in physics +* calculations and reference exceptions; it is useful for debug purposes +* * #define PHYSAC_MALLOC() * #define PHYSAC_FREE() * You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions. * Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. -* -* LIMITATIONS: -* -* - There is a limit of 256 physic objects. -* - Physics behaviour can be unexpected using bounciness or friction values out of 0.0f - 1.0f range. -* - The module is limited to 2D axis oriented physics. -* - Physics colliders must be rectangle or circle shapes (there is not a custom polygon collider type). * -* VERSIONS: -* -* 1.0 (14-Jun-2016) New module defines and fixed some delta time calculation bugs. -* 0.9 (09-Jun-2016) Module names review and converted to header-only. -* 0.8 (23-Mar-2016) Complete module redesign, steps-based for better physics resolution. -* 0.3 (13-Feb-2016) Reviewed to add PhysicObjects pool. -* 0.2 (03-Jan-2016) Improved physics calculations. -* 0.1 (30-Dec-2015) Initial release. +* VERY THANKS TO: +* - Ramón Santamaria (@raysan5) * * LICENSE: zlib/libpng * -* Copyright (c) 2016 Victor Fisac (main developer) and Ramon Santamaria +* Copyright (c) 2016 Victor Fisac * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -66,18 +60,18 @@ * **********************************************************************************************/ -#ifndef PHYSAC_H +#if !defined(PHYSAC_H) #define PHYSAC_H -#if !defined(RAYGUI_STANDALONE) - #include "raylib.h" -#endif - #define PHYSAC_STATIC -#ifdef PHYSAC_STATIC +// #define PHYSAC_NO_THREADS +// #define PHYSAC_STANDALONE +// #define PHYSAC_DEBUG + +#if defined(PHYSAC_STATIC) #define PHYSACDEF static // Functions just visible to module including this file #else - #ifdef __cplusplus + #if defined(__cplusplus) #define PHYSACDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) #else #define PHYSACDEF extern // Functions visible from other files @@ -87,87 +81,141 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -// ... +#define PHYSAC_MAX_BODIES 64 +#define PHYSAC_MAX_MANIFOLDS 4096 +#define PHYSAC_MAX_VERTICES 24 +#define PHYSAC_CIRCLE_VERTICES 24 + +#define PHYSAC_DESIRED_DELTATIME 1.0/60.0 +#define PHYSAC_MAX_TIMESTEP 0.02 +#define PHYSAC_COLLISION_ITERATIONS 100 +#define PHYSAC_PENETRATION_ALLOWANCE 0.05f +#define PHYSAC_PENETRATION_CORRECTION 0.4f + +#define PHYSAC_PI 3.14159265358979323846 +#define PHYSAC_DEG2RAD (PHYSAC_PI/180.0f) + +#define PHYSAC_MALLOC(size) malloc(size) +#define PHYSAC_FREE(ptr) free(ptr) //---------------------------------------------------------------------------------- // Types and Structures Definition // NOTE: Below types are required for PHYSAC_STANDALONE usage //---------------------------------------------------------------------------------- #if defined(PHYSAC_STANDALONE) - #ifndef __cplusplus - // Boolean type - #ifndef true - typedef enum { false, true } bool; - #endif - #endif - // Vector2 type typedef struct Vector2 { float x; float y; } Vector2; - // Rectangle type - typedef struct Rectangle { - int x; - int y; - int width; - int height; - } Rectangle; + // Boolean type + #if !defined(_STDBOOL_H) + typedef enum { false, true } bool; + #define _STDBOOL_H + #endif +#endif + +typedef enum PhysicsShapeType { PHYSICS_CIRCLE, PHYSICS_POLYGON } PhysicsShapeType; + +// Previously defined to be used in PhysicsShape struct as circular dependencies +typedef struct PhysicsBodyData *PhysicsBody; + +// Mat2 type (used for polygon shape rotation matrix) +typedef struct Mat2 +{ + float m00; + float m01; + float m10; + float m11; +} Mat2; + +typedef struct PolygonData { + unsigned int vertexCount; // Current used vertex and normals count + Vector2 vertices[PHYSAC_MAX_VERTICES]; // Polygon vertex positions vectors + Vector2 normals[PHYSAC_MAX_VERTICES]; // Polygon vertex normals vectors + Mat2 transform; // Vertices transform matrix 2x2 +} PolygonData; + +typedef struct PhysicsShape { + PhysicsShapeType type; // Physics shape type (circle or polygon) + PhysicsBody body; // Shape physics body reference + float radius; // Circle shape radius (used for circle shapes) + PolygonData vertexData; // Polygon shape vertices position and normals data (just used for polygon shapes) +} PhysicsShape; + +typedef struct PhysicsBodyData { + unsigned int id; // Reference unique identifier + bool enabled; // Enabled dynamics state (collisions are calculated anyway) + Vector2 position; // Physics body shape pivot + Vector2 velocity; // Current linear velocity applied to position + Vector2 force; // Current linear force (reset to 0 every step) + float angularVelocity; // Current angular velocity applied to orient + float torque; // Current angular force (reset to 0 every step) + float orient; // Rotation in radians + float inertia; // Moment of inertia + float inverseInertia; // Inverse value of inertia + float mass; // Physics body mass + float inverseMass; // Inverse value of mass + float staticFriction; // Friction when the body has not movement (0 to 1) + float dynamicFriction; // Friction when the body has movement (0 to 1) + float restitution; // Restitution coefficient of the body (0 to 1) + bool useGravity; // Apply gravity force to dynamics + bool isGrounded; // Physics grounded on other body state + bool freezeOrient; // Physics rotation constraint + PhysicsShape shape; // Physics body shape information (type, radius, vertices, normals) +} PhysicsBodyData; + +typedef struct PhysicsManifoldData { + unsigned int id; // Reference unique identifier + PhysicsBody bodyA; // Manifold first physics body reference + PhysicsBody bodyB; // Manifold second physics body reference + float penetration; // Depth of penetration from collision + Vector2 normal; // Normal direction vector from 'a' to 'b' + Vector2 contacts[2]; // Points of contact during collision + unsigned int contactsCount; // Current collision number of contacts + float restitution; // Mixed restitution during collision + float dynamicFriction; // Mixed dynamic friction during collision + float staticFriction; // Mixed static friction during collision +} PhysicsManifoldData, *PhysicsManifold; + +#if defined(__cplusplus) +extern "C" { // Prevents name mangling of functions #endif -typedef enum { COLLIDER_CIRCLE, COLLIDER_RECTANGLE } ColliderType; - -typedef struct Transform { - Vector2 position; - float rotation; // Radians (not used) - Vector2 scale; // Just for rectangle physic objects, for circle physic objects use collider radius and keep scale as { 0, 0 } -} Transform; - -typedef struct Rigidbody { - bool enabled; // Acts as kinematic state (collisions are calculated anyway) - float mass; - Vector2 acceleration; - Vector2 velocity; - bool applyGravity; - bool isGrounded; - float friction; // Normalized value - float bounciness; -} Rigidbody; - -typedef struct Collider { - bool enabled; - ColliderType type; - Rectangle bounds; // Used for COLLIDER_RECTANGLE - int radius; // Used for COLLIDER_CIRCLE -} Collider; - -typedef struct PhysicBodyData { - unsigned int id; - Transform transform; - Rigidbody rigidbody; - Collider collider; - bool enabled; -} PhysicBodyData, *PhysicBody; +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +//... //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -PHYSACDEF void InitPhysics(Vector2 gravity); // Initializes pointers array (just pointers, fixed size) -PHYSACDEF void* PhysicsThread(void *arg); // Physics calculations thread function -PHYSACDEF void ClosePhysics(); // Unitialize all physic objects and empty the objects pool - -PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale); // Create a new physic body dinamically, initialize it and add to pool -PHYSACDEF void DestroyPhysicBody(PhysicBody pbody); // Destroy a specific physic body and take it out of the list +PHYSACDEF void InitPhysics(void); // Initializes physics values, pointers and creates physics loop thread +PHYSACDEF bool IsPhysicsEnabled(void); // Returns true if physics thread is currently enabled +PHYSACDEF void SetPhysicsGravity(float x, float y); // Sets physics global gravity force +PHYSACDEF PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters +PHYSACDEF PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters +PHYSACDEF PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters +PHYSACDEF void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body +PHYSACDEF void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body +PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force +PHYSACDEF int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies +PHYSACDEF PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index +PHYSACDEF int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON) +PHYSACDEF int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape +PHYSACDEF Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position) +PHYSACDEF void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter +PHYSACDEF void DestroyPhysicsBody(PhysicsBody body); // Unitializes and destroy a physics body +PHYSACDEF void ResetPhysics(void); // Destroys created physics bodies and manifolds and resets global values +PHYSACDEF void ClosePhysics(void); // Unitializes physics pointers and closes physics loop thread -PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force); // Apply directional force to a physic body -PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius); // Apply radial force to all physic objects in range - -PHYSACDEF Rectangle TransformToRectangle(Transform transform); // Convert Transform data type to Rectangle (position and scale) +#if defined(__cplusplus) +} +#endif #endif // PHYSAC_H - /*********************************************************************************** * * PHYSAC IMPLEMENTATION @@ -176,657 +224,1854 @@ PHYSACDEF Rectangle TransformToRectangle(Transform transform); #if defined(PHYSAC_IMPLEMENTATION) -// Check if custom malloc/free functions defined, if not, using standard ones -#if !defined(PHYSAC_MALLOC) - #include // Required for: malloc(), free() - - #define PHYSAC_MALLOC(size) malloc(size) - #define PHYSAC_FREE(ptr) free(ptr) +#if !defined(PHYSAC_NO_THREADS) + #include // Required for: pthread_t, pthread_create() #endif -#include // Required for: cos(), sin(), abs(), fminf() -#include // Required for typedef unsigned long long int uint64_t, used by hi-res timer - -#ifndef PHYSAC_NO_THREADS - #include // Required for: pthread_create() +#if defined(PHYSAC_DEBUG) + #include // Required for: printf() #endif -#if defined(PLATFORM_DESKTOP) +#include // Required for: malloc(), free(), srand(), rand() +#include // Required for: cosf(), sinf(), fabs(), sqrtf() + +#if defined(_WIN32) // Functions required to query time on Windows int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); -#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - #include // Required for: timespec - #include // Required for: clock_gettime() +#elif defined(__linux) + #include // Required for: timespec + #include // Required for: clock_gettime() #endif //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -#define MAX_PHYSIC_BODIES 256 // Maximum available physic bodies slots in bodies pool -#define PHYSICS_TIMESTEP 0.016666 // Physics fixed time step (1/fps) -#define PHYSICS_ACCURACY 0.0001f // Velocity subtract operations round filter (friction) -#define PHYSICS_ERRORPERCENT 0.001f // Collision resolve position fix +#define min(a,b) (((a)<(b))?(a):(b)) +#define max(a,b) (((a)>(b))?(a):(b)) +#define PHYSAC_FLT_MAX 3.402823466e+38f +#define PHYSAC_EPSILON 0.000001f //---------------------------------------------------------------------------------- // Types and Structures Definition -// NOTE: Below types are required for PHYSAC_STANDALONE usage //---------------------------------------------------------------------------------- // ... //---------------------------------------------------------------------------------- // Global Variables Definition //---------------------------------------------------------------------------------- -static bool physicsThreadEnabled = false; // Physics calculations thread exit control -static uint64_t baseTime; // Base time measure for hi-res timer -static double currentTime, previousTime; // Used to track timmings -static PhysicBody physicBodies[MAX_PHYSIC_BODIES]; // Physic bodies pool -static int physicBodiesCount; // Counts current enabled physic bodies -static Vector2 gravityForce; // Gravity force +#if !defined(PHYSAC_NO_THREADS) + static pthread_t physicsThreadId; // Physics thread id +#endif +static unsigned int usedMemory = 0; // Total allocated dynamic memory +static bool physicsThreadEnabled = false; // Physics thread enabled state +static double currentTime = 0; // Current time in milliseconds +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + static double baseTime = 0; // Android and RPI platforms base time +#endif +static double startTime = 0; // Start time in milliseconds +static double deltaTime = 0; // Delta time used for physics steps +static double accumulator = 0; // Physics time step delta time accumulator +static unsigned int stepsCount = 0; // Total physics steps processed +static Vector2 gravityForce = { 0, 9.81f/1000 }; // Physics world gravity force +static PhysicsBody bodies[PHYSAC_MAX_BODIES]; // Physics bodies pointers array +static unsigned int physicsBodiesCount = 0; // Physics world current bodies counter +static PhysicsManifold contacts[PHYSAC_MAX_MANIFOLDS]; // Physics bodies pointers array +static unsigned int physicsManifoldsCount = 0; // Physics world current manifolds counter //---------------------------------------------------------------------------------- -// Module specific Functions Declaration +// Module Internal Functions Declaration //---------------------------------------------------------------------------------- -static void UpdatePhysics(double deltaTime); // Update physic objects, calculating physic behaviours and collisions detection -static void InitTimer(void); // Initialize hi-resolution timer -static double GetCurrentTime(void); // Time measure returned are microseconds -static float Vector2DotProduct(Vector2 v1, Vector2 v2); // Returns the dot product of two Vector2 -static float Vector2Length(Vector2 v); // Returns the length of a Vector2 +static PolygonData CreateRandomPolygon(float radius, int sides); // Creates a random polygon shape with max vertex distance from polygon pivot +static PolygonData CreateRectanglePolygon(Vector2 pos, Vector2 size); // Creates a rectangle polygon shape based on a min and max positions +static void *PhysicsLoop(void *arg); // Physics loop thread function +static void PhysicsStep(void); // Physics steps calculations (dynamics, collisions and position corrections) +static PhysicsManifold CreatePhysicsManifold(PhysicsBody a, PhysicsBody b); // Creates a new physics manifold to solve collision +static void DestroyPhysicsManifold(PhysicsManifold manifold); // Unitializes and destroys a physics manifold +static void SolvePhysicsManifold(PhysicsManifold manifold); // Solves a created physics manifold between two physics bodies +static void SolveCircleToCircle(PhysicsManifold manifold); // Solves collision between two circle shape physics bodies +static void SolveCircleToPolygon(PhysicsManifold manifold); // Solves collision between a circle to a polygon shape physics bodies +static void SolvePolygonToCircle(PhysicsManifold manifold); // Solves collision between a polygon to a circle shape physics bodies +static void SolvePolygonToPolygon(PhysicsManifold manifold); // Solves collision between two polygons shape physics bodies +static void IntegratePhysicsForces(PhysicsBody body); // Integrates physics forces into velocity +static void InitializePhysicsManifolds(PhysicsManifold manifold); // Initializes physics manifolds to solve collisions +static void IntegratePhysicsImpulses(PhysicsManifold manifold); // Integrates physics collisions impulses to solve collisions +static void IntegratePhysicsVelocity(PhysicsBody body); // Integrates physics velocity into position and forces +static void CorrectPhysicsPositions(PhysicsManifold manifold); // Corrects physics bodies positions based on manifolds collision information +static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, PhysicsShape shapeB); // Finds polygon shapes axis least penetration +static void FindIncidentFace(Vector2 *v0, Vector2 *v1, PhysicsShape ref, PhysicsShape inc, int index); // Finds two polygon shapes incident face +static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB); // Calculates clipping based on a normal and two faces +static bool BiasGreaterThan(float valueA, float valueB); // Check if values are between bias range +static Vector2 TriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3); // Returns the barycenter of a triangle given by 3 points +static void InitTimer(void); // Initializes hi-resolution timer +static double GetCurrentTime(void); // Get current time in milliseconds +static int GetRandomNumber(int min, int max); // Returns a random number between min and max (both included) + +static void MathClamp(double *value, double min, double max); // Clamp a value in a range +static Vector2 MathCross(float value, Vector2 vector); // Returns the cross product of a vector and a value +static float MathCrossVector2(Vector2 v1, Vector2 v2); // Returns the cross product of two vectors +static float MathLenSqr(Vector2 vector); // Returns the len square root of a vector +static float MathDot(Vector2 v1, Vector2 v2); // Returns the dot product of two vectors +static inline float DistSqr(Vector2 v1, Vector2 v2); // Returns the square root of distance between two vectors +static void MathNormalize(Vector2 *vector); // Returns the normalized values of a vector +static Vector2 Vector2Add(Vector2 v1, Vector2 v2); // Returns the sum of two given vectors +static Vector2 Vector2Subtract(Vector2 v1, Vector2 v2); // Returns the subtract of two given vectors + +static Mat2 Mat2Radians(float radians); // Creates a matrix 2x2 from a given radians value +static void Mat2Set(Mat2 *matrix, float radians); // Set values from radians to a created matrix 2x2 +static Mat2 Mat2Transpose(Mat2 matrix); // Returns the transpose of a given matrix 2x2 +static Vector2 Mat2MultiplyVector2(Mat2 matrix, Vector2 vector); // Multiplies a vector by a matrix 2x2 //---------------------------------------------------------------------------------- // Module Functions Definition //---------------------------------------------------------------------------------- +// Initializes physics values, pointers and creates physics loop thread +PHYSACDEF void InitPhysics(void) +{ + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] physics module initialized successfully\n"); + #endif -// Initializes pointers array (just pointers, fixed size) -PHYSACDEF void InitPhysics(Vector2 gravity) -{ - // Initialize physics variables - physicBodiesCount = 0; - gravityForce = gravity; - - #ifndef PHYSAC_NO_THREADS // NOTE: if defined, user will need to create a thread for PhysicsThread function manually - // Create physics thread - pthread_t tid; - pthread_create(&tid, NULL, &PhysicsThread, NULL); + #if !defined(PHYSAC_NO_THREADS) + // NOTE: if defined, user will need to create a thread for PhysicsThread function manually + // Create physics thread using POSIXS thread libraries + pthread_create(&physicsThreadId, NULL, &PhysicsLoop, NULL); #endif } -// Unitialize all physic objects and empty the objects pool -PHYSACDEF void ClosePhysics() +// Returns true if physics thread is currently enabled +PHYSACDEF bool IsPhysicsEnabled(void) { - // Exit physics thread loop - physicsThreadEnabled = false; - - // Free all dynamic memory allocations - for (int i = 0; i < physicBodiesCount; i++) PHYSAC_FREE(physicBodies[i]); - - // Reset enabled physic objects count - physicBodiesCount = 0; + return physicsThreadEnabled; +} + +// Sets physics global gravity force +PHYSACDEF void SetPhysicsGravity(float x, float y) +{ + gravityForce.x = x; + gravityForce.y = y; } -// Create a new physic body dinamically, initialize it and add to pool -PHYSACDEF PhysicBody CreatePhysicBody(Vector2 position, float rotation, Vector2 scale) +// Creates a new circle physics body with generic parameters +PHYSACDEF PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density) { - // Allocate dynamic memory - PhysicBody obj = (PhysicBody)PHYSAC_MALLOC(sizeof(PhysicBodyData)); - - // Initialize physic body values with generic values - obj->id = physicBodiesCount; - obj->enabled = true; - - obj->transform = (Transform){ (Vector2){ position.x - scale.x/2, position.y - scale.y/2 }, rotation, scale }; - - obj->rigidbody.enabled = false; - obj->rigidbody.mass = 1.0f; - obj->rigidbody.acceleration = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.velocity = (Vector2){ 0.0f, 0.0f }; - obj->rigidbody.applyGravity = false; - obj->rigidbody.isGrounded = false; - obj->rigidbody.friction = 0.0f; - obj->rigidbody.bounciness = 0.0f; - - obj->collider.enabled = true; - obj->collider.type = COLLIDER_RECTANGLE; - obj->collider.bounds = TransformToRectangle(obj->transform); - obj->collider.radius = 0.0f; - - // Add new physic body to the pointers array - physicBodies[physicBodiesCount] = obj; - - // Increase enabled physic bodies count - physicBodiesCount++; - - return obj; + PhysicsBody newBody = CreatePhysicsBodyPolygon(pos, radius, PHYSAC_CIRCLE_VERTICES, density); + return newBody; + + /*PhysicsBody newBody = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); + usedMemory += sizeof(PhysicsBodyData); + + int newId = -1; + for (int i = 0; i < PHYSAC_MAX_BODIES; i++) + { + int currentId = i; + + // Check if current id already exist in other physics body + for (int k = 0; k < physicsBodiesCount; k++) + { + if (bodies[k]->id == currentId) + { + currentId++; + break; + } + } + + // If it is not used, use it as new physics body id + if (currentId == i) + { + newId = i; + break; + } + } + + if (newId != -1) + { + // Initialize new body with generic values + newBody->id = newId; + newBody->enabled = true; + newBody->position = pos; + newBody->velocity = (Vector2){ 0 }; + newBody->force = (Vector2){ 0 }; + newBody->angularVelocity = 0; + newBody->torque = 0; + newBody->orient = 0; + newBody->mass = PHYSAC_PI*radius*radius*density; + newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); + newBody->inertia = newBody->mass*radius*radius; + newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); + newBody->staticFriction = 0; + newBody->dynamicFriction = 0; + newBody->restitution = 0; + newBody->useGravity = true; + newBody->freezeOrient = false; + newBody->shape.type = PHYSICS_CIRCLE; + newBody->shape.body = newBody; + newBody->shape.radius = radius; + + // Add new body to bodies pointers array and update bodies count + bodies[physicsBodiesCount] = newBody; + physicsBodiesCount++; + + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] created circle physics body id %i\n", newBody->id); + #endif + } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] new physics body creation failed because there is any available id to use\n"); + #endif + + return newBody;*/ } -// Destroy a specific physic body and take it out of the list -PHYSACDEF void DestroyPhysicBody(PhysicBody pbody) +// Creates a new rectangle physics body with generic parameters +PHYSACDEF PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density) { - // Free dynamic memory allocation - PHYSAC_FREE(physicBodies[pbody->id]); - - // Remove *obj from the pointers array - for (int i = pbody->id; i < physicBodiesCount; i++) + PhysicsBody newBody = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); + usedMemory += sizeof(PhysicsBodyData); + + int newId = -1; + for (int i = 0; i < PHYSAC_MAX_BODIES; i++) + { + int currentId = i; + + // Check if current id already exist in other physics body + for (int k = 0; k < physicsBodiesCount; k++) + { + if (bodies[k]->id == currentId) + { + currentId++; + break; + } + } + + // If it is not used, use it as new physics body id + if (currentId == i) + { + newId = i; + break; + } + } + + if (newId != -1) { - // Resort all the following pointers of the array - if ((i + 1) < physicBodiesCount) + // Initialize new body with generic values + newBody->id = newId; + newBody->enabled = true; + newBody->position = pos; + newBody->velocity = (Vector2){ 0 }; + newBody->force = (Vector2){ 0 }; + newBody->angularVelocity = 0; + newBody->torque = 0; + newBody->orient = 0; + newBody->shape.type = PHYSICS_POLYGON; + newBody->shape.body = newBody; + newBody->shape.vertexData = CreateRectanglePolygon(pos, (Vector2){ width, height }); + + // Calculate centroid and moment of inertia + Vector2 center = { 0 }; + float area = 0; + float inertia = 0; + const float k = 1.0f/3.0f; + + for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + { + // Triangle vertices, third vertex implied as (0, 0) + Vector2 p1 = newBody->shape.vertexData.vertices[i]; + int nextIndex = (((i + 1) < newBody->shape.vertexData.vertexCount) ? (i + 1) : 0); + Vector2 p2 = newBody->shape.vertexData.vertices[nextIndex]; + + float D = MathCrossVector2(p1, p2); + float triangleArea = D/2; + + area += triangleArea; + + // Use area to weight the centroid average, not just vertex position + center.x += triangleArea*k*(p1.x + p2.x); + center.y += triangleArea*k*(p1.y + p2.y); + + float intx2 = p1.x*p1.x + p2.x*p1.x + p2.x*p2.x; + float inty2 = p1.y*p1.y + p2.y*p1.y + p2.y*p2.y; + inertia += (0.25f*k*D)*(intx2 + inty2); + } + + center.x *= 1.0f/area; + center.y *= 1.0f/area; + + // Translate vertices to centroid (make the centroid (0, 0) for the polygon in model space) + // Note: this is not really necessary + for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) { - physicBodies[i] = physicBodies[i + 1]; - physicBodies[i]->id = physicBodies[i + 1]->id; + newBody->shape.vertexData.vertices[i].x -= center.x; + newBody->shape.vertexData.vertices[i].y -= center.y; } - else PHYSAC_FREE(physicBodies[i]); + + newBody->mass = density*area; + newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); + newBody->inertia = density*inertia; + newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); + newBody->staticFriction = 0.4f; + newBody->dynamicFriction = 0.2f; + newBody->restitution = 0; + newBody->useGravity = true; + newBody->isGrounded = false; + newBody->freezeOrient = false; + + // Add new body to bodies pointers array and update bodies count + bodies[physicsBodiesCount] = newBody; + physicsBodiesCount++; + + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] created polygon physics body id %i\n", newBody->id); + #endif } - - // Decrease enabled physic bodies count - physicBodiesCount--; + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] new physics body creation failed because there is any available id to use\n"); + #endif + + return newBody; } -// Apply directional force to a physic body -PHYSACDEF void ApplyForce(PhysicBody pbody, Vector2 force) +// Creates a new polygon physics body with generic parameters +PHYSACDEF PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density) { - if (pbody->rigidbody.enabled) + PhysicsBody newBody = (PhysicsBody)PHYSAC_MALLOC(sizeof(PhysicsBodyData)); + usedMemory += sizeof(PhysicsBodyData); + + int newId = -1; + for (int i = 0; i < PHYSAC_MAX_BODIES; i++) + { + int currentId = i; + + // Check if current id already exist in other physics body + for (int k = 0; k < physicsBodiesCount; k++) + { + if (bodies[k]->id == currentId) + { + currentId++; + break; + } + } + + // If it is not used, use it as new physics body id + if (currentId == i) + { + newId = i; + break; + } + } + + if (newId != -1) { - pbody->rigidbody.velocity.x += force.x/pbody->rigidbody.mass; - pbody->rigidbody.velocity.y += force.y/pbody->rigidbody.mass; + // Initialize new body with generic values + newBody->id = newId; + newBody->enabled = true; + newBody->position = pos; + newBody->velocity = (Vector2){ 0 }; + newBody->force = (Vector2){ 0 }; + newBody->angularVelocity = 0; + newBody->torque = 0; + newBody->orient = 0; + newBody->shape.type = PHYSICS_POLYGON; + newBody->shape.body = newBody; + newBody->shape.vertexData = CreateRandomPolygon(radius, sides); + + // Calculate centroid and moment of inertia + Vector2 center = { 0 }; + float area = 0; + float inertia = 0; + const float alpha = 1.0f/3.0f; + + for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + { + // Triangle vertices, third vertex implied as (0, 0) + Vector2 position1 = newBody->shape.vertexData.vertices[i]; + int nextIndex = (((i + 1) < newBody->shape.vertexData.vertexCount) ? (i + 1) : 0); + Vector2 position2 = newBody->shape.vertexData.vertices[nextIndex]; + + float cross = MathCrossVector2(position1, position2); + float triangleArea = cross/2; + + area += triangleArea; + + // Use area to weight the centroid average, not just vertex position + center.x += triangleArea*alpha*(position1.x + position2.x); + center.y += triangleArea*alpha*(position1.y + position2.y); + + float intx2 = position1.x*position1.x + position2.x*position1.x + position2.x*position2.x; + float inty2 = position1.y*position1.y + position2.y*position1.y + position2.y*position2.y; + inertia += (0.25f*alpha*cross)*(intx2 + inty2); + } + + center.x *= 1.0f/area; + center.y *= 1.0f/area; + + // Translate vertices to centroid (make the centroid (0, 0) for the polygon in model space) + // Note: this is not really necessary + for (int i = 0; i < newBody->shape.vertexData.vertexCount; i++) + { + newBody->shape.vertexData.vertices[i].x -= center.x; + newBody->shape.vertexData.vertices[i].y -= center.y; + } + + newBody->mass = density*area; + newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); + newBody->inertia = density*inertia; + newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); + newBody->staticFriction = 0.4f; + newBody->dynamicFriction = 0.2f; + newBody->restitution = 0; + newBody->useGravity = true; + newBody->isGrounded = false; + newBody->freezeOrient = false; + + // Add new body to bodies pointers array and update bodies count + bodies[physicsBodiesCount] = newBody; + physicsBodiesCount++; + + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] created polygon physics body id %i\n", newBody->id); + #endif } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] new physics body creation failed because there is any available id to use\n"); + #endif + + return newBody; +} + +// Adds a force to a physics body +PHYSACDEF void PhysicsAddForce(PhysicsBody body, Vector2 force) +{ + if (body != NULL) body->force = Vector2Add(body->force, force); +} + +// Adds an angular force to a physics body +PHYSACDEF void PhysicsAddTorque(PhysicsBody body, float amount) +{ + if (body != NULL) body->torque += amount; } -// Apply radial force to all physic objects in range -PHYSACDEF void ApplyForceAtPosition(Vector2 position, float force, float radius) +// Shatters a polygon shape physics body to little physics bodies with explosion force +PHYSACDEF void PhysicsShatter(PhysicsBody body, Vector2 position, float force) { - for (int i = 0; i < physicBodiesCount; i++) + if (body != NULL) { - if (physicBodies[i]->rigidbody.enabled) + if (body->shape.type == PHYSICS_POLYGON) { - // Calculate direction and distance between force and physic body position - Vector2 distance = (Vector2){ physicBodies[i]->transform.position.x - position.x, physicBodies[i]->transform.position.y - position.y }; + PolygonData vertexData = body->shape.vertexData; + bool collision = false; - if (physicBodies[i]->collider.type == COLLIDER_RECTANGLE) + for (int i = 0; i < vertexData.vertexCount; i++) { - distance.x += physicBodies[i]->transform.scale.x/2; - distance.y += physicBodies[i]->transform.scale.y/2; + Vector2 positionA = body->position; + Vector2 positionB = Mat2MultiplyVector2(vertexData.transform, Vector2Add(body->position, vertexData.vertices[i])); + int nextIndex = (((i + 1) < vertexData.vertexCount) ? (i + 1) : 0); + Vector2 positionC = Mat2MultiplyVector2(vertexData.transform, Vector2Add(body->position, vertexData.vertices[nextIndex])); + + // Check collision between each triangle + float alpha = ((positionB.y - positionC.y)*(position.x - positionC.x) + (positionC.x - positionB.x)*(position.y - positionC.y))/ + ((positionB.y - positionC.y)*(positionA.x - positionC.x) + (positionC.x - positionB.x)*(positionA.y - positionC.y)); + + float beta = ((positionC.y - positionA.y)*(position.x - positionC.x) + (positionA.x - positionC.x)*(position.y - positionC.y))/ + ((positionB.y - positionC.y)*(positionA.x - positionC.x) + (positionC.x - positionB.x)*(positionA.y - positionC.y)); + + float gamma = 1.0f - alpha - beta; + + if ((alpha > 0) && (beta > 0) & (gamma > 0)) + { + collision = true; + break; + } } - - float distanceLength = Vector2Length(distance); - - // Check if physic body is in force range - if (distanceLength <= radius) + + if (collision) { - // Normalize force direction - distance.x /= distanceLength; - distance.y /= -distanceLength; - - // Calculate final force - Vector2 finalForce = { distance.x*force, distance.y*force }; - - // Apply force to the physic body - ApplyForce(physicBodies[i], finalForce); + int count = vertexData.vertexCount; + Vector2 bodyPos = body->position; + Vector2 vertices[count]; + Mat2 trans = vertexData.transform; + for (int i = 0; i < count; i++) vertices[i] = vertexData.vertices[i]; + + // Destroy shattered physics body + DestroyPhysicsBody(body); + + for (int i = 0; i < count; i++) + { + int nextIndex = (((i + 1) < count) ? (i + 1) : 0); + Vector2 center = TriangleBarycenter(vertices[i], vertices[nextIndex], (Vector2){ 0, 0 }); + center = Vector2Add(bodyPos, center); + Vector2 offset = Vector2Subtract(center, bodyPos); + + PhysicsBody newBody = CreatePhysicsBodyPolygon(center, 10, 3, 10); // Create polygon physics body with relevant values + + PolygonData newData = { 0 }; + newData.vertexCount = 3; + newData.transform = trans; + + newData.vertices[0] = Vector2Subtract(vertices[i], offset); + newData.vertices[1] = Vector2Subtract(vertices[nextIndex], offset); + newData.vertices[2] = Vector2Subtract(position, center); + + // Separate vertices to avoid unnecessary physics collisions + newData.vertices[0].x *= 0.95f; + newData.vertices[0].y *= 0.95f; + newData.vertices[1].x *= 0.95f; + newData.vertices[1].y *= 0.95f; + newData.vertices[2].x *= 0.95f; + newData.vertices[2].y *= 0.95f; + + // Calculate polygon faces normals + for (int j = 0; j < newData.vertexCount; j++) + { + int nextVertex = (((j + 1) < newData.vertexCount) ? (j + 1) : 0); + Vector2 face = Vector2Subtract(newData.vertices[nextVertex], newData.vertices[j]); + + newData.normals[j] = (Vector2){ face.y, -face.x }; + MathNormalize(&newData.normals[j]); + } + + // Apply computed vertex data to new physics body shape + newBody->shape.vertexData = newData; + + // Calculate centroid and moment of inertia + center = (Vector2){ 0 }; + float area = 0; + float inertia = 0; + const float k = 1.0f/3.0f; + + for (int j = 0; j < newBody->shape.vertexData.vertexCount; j++) + { + // Triangle vertices, third vertex implied as (0, 0) + Vector2 p1 = newBody->shape.vertexData.vertices[j]; + int nextVertex = (((j + 1) < newBody->shape.vertexData.vertexCount) ? (j + 1) : 0); + Vector2 p2 = newBody->shape.vertexData.vertices[nextVertex]; + + float D = MathCrossVector2(p1, p2); + float triangleArea = D/2; + + area += triangleArea; + + // Use area to weight the centroid average, not just vertex position + center.x += triangleArea*k*(p1.x + p2.x); + center.y += triangleArea*k*(p1.y + p2.y); + + float intx2 = p1.x*p1.x + p2.x*p1.x + p2.x*p2.x; + float inty2 = p1.y*p1.y + p2.y*p1.y + p2.y*p2.y; + inertia += (0.25f*k*D)*(intx2 + inty2); + } + + center.x *= 1.0f/area; + center.y *= 1.0f/area; + + newBody->mass = area; + newBody->inverseMass = ((newBody->mass != 0.0f) ? 1.0f/newBody->mass : 0.0f); + newBody->inertia = inertia; + newBody->inverseInertia = ((newBody->inertia != 0.0f) ? 1.0f/newBody->inertia : 0.0f); + + // Calculate explosion force direction + Vector2 pointA = newBody->position; + Vector2 pointB = Vector2Subtract(newData.vertices[1], newData.vertices[0]); + pointB.x /= 2; + pointB.y /= 2; + Vector2 forceDirection = Vector2Subtract(Vector2Add(pointA, Vector2Add(newData.vertices[0], pointB)), newBody->position); + MathNormalize(&forceDirection); + forceDirection.x *= force; + forceDirection.y *= force; + + // Apply force to new physics body + PhysicsAddForce(newBody, forceDirection); + } } } } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] error when trying to shatter a null reference physics body"); + #endif } -// Convert Transform data type to Rectangle (position and scale) -PHYSACDEF Rectangle TransformToRectangle(Transform transform) +// Returns the current amount of created physics bodies +PHYSACDEF int GetPhysicsBodiesCount(void) { - return (Rectangle){transform.position.x, transform.position.y, transform.scale.x, transform.scale.y}; + return physicsBodiesCount; } -// Physics calculations thread function -PHYSACDEF void* PhysicsThread(void *arg) +// Returns a physics body of the bodies pool at a specific index +PHYSACDEF PhysicsBody GetPhysicsBody(int index) { - // Initialize thread loop state - physicsThreadEnabled = true; - - // Initialize hi-resolution timer - InitTimer(); - - // Physics update loop - while (physicsThreadEnabled) + if (index < physicsBodiesCount) { - currentTime = GetCurrentTime(); - double deltaTime = (double)(currentTime - previousTime); - previousTime = currentTime; + PhysicsBody body = bodies[index]; + if (body != NULL) return body; + else + { + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] error when trying to get a null reference physics body"); + #endif - // Delta time value needs to be inverse multiplied by physics time step value (1/target fps) - UpdatePhysics(deltaTime/PHYSICS_TIMESTEP); + return NULL; + } } - - return NULL; + #if defined(PHYSAC_DEBUG) + else + { + printf("[PHYSAC] physics body index is out of bounds"); + return NULL; + } + #endif } -//---------------------------------------------------------------------------------- -// Module specific Functions Definition -//---------------------------------------------------------------------------------- -// Initialize hi-resolution timer -static void InitTimer(void) +// Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON) +PHYSACDEF int GetPhysicsShapeType(int index) { -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec now; - - if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) // Success + if (index < physicsBodiesCount) { - baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + PhysicsBody body = bodies[index]; + if (body != NULL) return body->shape.type; + #if defined(PHYSAC_DEBUG) + else + { + printf("[PHYSAC] error when trying to get a null reference physics body"); + return -1; + } + #endif } -#endif - - previousTime = GetCurrentTime(); // Get time as double + #if defined(PHYSAC_DEBUG) + else + { + printf("[PHYSAC] physics body index is out of bounds"); + return -1; + } + #endif } -// Time measure returned are microseconds -static double GetCurrentTime(void) +// Returns the amount of vertices of a physics body shape +PHYSACDEF int GetPhysicsShapeVerticesCount(int index) { - double time; - -#if defined(PLATFORM_DESKTOP) - unsigned long long int clockFrequency, currentTime; - - QueryPerformanceFrequency(&clockFrequency); - QueryPerformanceCounter(¤tTime); - - time = (double)((double)currentTime/(double)clockFrequency); -#endif - -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; - - time = (double)(temp - baseTime)*1e-9; -#endif - - return time; + if (index < physicsBodiesCount) + { + PhysicsBody body = bodies[index]; + if (body != NULL) + { + switch (body->shape.type) + { + case PHYSICS_CIRCLE: return PHYSAC_CIRCLE_VERTICES; break; + case PHYSICS_POLYGON: return body->shape.vertexData.vertexCount; break; + default: break; + } + } + #if defined(PHYSAC_DEBUG) + else + { + printf("[PHYSAC] error when trying to get a null reference physics body"); + return 0; + } + #endif + } + #if defined(PHYSAC_DEBUG) + else + { + printf("[PHYSAC] physics body index is out of bounds"); + return 0; + } + #endif } -// Returns the dot product of two Vector2 -static float Vector2DotProduct(Vector2 v1, Vector2 v2) +// Returns transformed position of a body shape (body position + vertex transformed position) +PHYSACDEF Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex) { - float result; + Vector2 position = { 0 }; - result = v1.x*v2.x + v1.y*v2.y; + if (body != NULL) + { + switch (body->shape.type) + { + case PHYSICS_CIRCLE: + { + position.x = body->position.x + cosf(360/PHYSAC_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; + position.y = body->position.y + sinf(360/PHYSAC_CIRCLE_VERTICES*vertex*PHYSAC_DEG2RAD)*body->shape.radius; + } break; + case PHYSICS_POLYGON: + { + PolygonData vertexData = body->shape.vertexData; + position = Vector2Add(body->position, Mat2MultiplyVector2(vertexData.transform, vertexData.vertices[vertex])); + } break; + default: break; + } + } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] error when trying to get a null reference physics body"); + #endif - return result; + return position; } -static float Vector2Length(Vector2 v) +// Sets physics body shape transform based on radians parameter +PHYSACDEF void SetPhysicsBodyRotation(PhysicsBody body, float radians) { - float result; - - result = sqrt(v.x*v.x + v.y*v.y); - - return result; + if (body != NULL) + { + body->orient = radians; + + if (body->shape.type == PHYSICS_POLYGON) body->shape.vertexData.transform = Mat2Radians(radians); + } } -// Update physic objects, calculating physic behaviours and collisions detection -static void UpdatePhysics(double deltaTime) +// Unitializes and destroys a physics body +PHYSACDEF void DestroyPhysicsBody(PhysicsBody body) { - for (int i = 0; i < physicBodiesCount; i++) + if (body != NULL) { - if (physicBodies[i]->enabled) + int id = body->id; + int index = -1; + + for (int i = 0; i < physicsBodiesCount; i++) { - // Update physic behaviour - if (physicBodies[i]->rigidbody.enabled) - { - // Apply friction to acceleration in X axis - if (physicBodies[i]->rigidbody.acceleration.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x -= physicBodies[i]->rigidbody.friction*deltaTime; - else if (physicBodies[i]->rigidbody.acceleration.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.x += physicBodies[i]->rigidbody.friction*deltaTime; - else physicBodies[i]->rigidbody.acceleration.x = 0.0f; - - // Apply friction to acceleration in Y axis - if (physicBodies[i]->rigidbody.acceleration.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y -= physicBodies[i]->rigidbody.friction*deltaTime; - else if (physicBodies[i]->rigidbody.acceleration.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.acceleration.y += physicBodies[i]->rigidbody.friction*deltaTime; - else physicBodies[i]->rigidbody.acceleration.y = 0.0f; - - // Apply friction to velocity in X axis - if (physicBodies[i]->rigidbody.velocity.x > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x -= physicBodies[i]->rigidbody.friction*deltaTime; - else if (physicBodies[i]->rigidbody.velocity.x < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.friction*deltaTime; - else physicBodies[i]->rigidbody.velocity.x = 0.0f; - - // Apply friction to velocity in Y axis - if (physicBodies[i]->rigidbody.velocity.y > PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y -= physicBodies[i]->rigidbody.friction*deltaTime; - else if (physicBodies[i]->rigidbody.velocity.y < PHYSICS_ACCURACY) physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.friction*deltaTime; - else physicBodies[i]->rigidbody.velocity.y = 0.0f; - - // Apply gravity to velocity - if (physicBodies[i]->rigidbody.applyGravity) - { - physicBodies[i]->rigidbody.velocity.x += gravityForce.x*deltaTime; - physicBodies[i]->rigidbody.velocity.y += gravityForce.y*deltaTime; - } - - // Apply acceleration to velocity - physicBodies[i]->rigidbody.velocity.x += physicBodies[i]->rigidbody.acceleration.x*deltaTime; - physicBodies[i]->rigidbody.velocity.y += physicBodies[i]->rigidbody.acceleration.y*deltaTime; - - // Apply velocity to position - physicBodies[i]->transform.position.x += physicBodies[i]->rigidbody.velocity.x*deltaTime; - physicBodies[i]->transform.position.y -= physicBodies[i]->rigidbody.velocity.y*deltaTime; - } - - // Update collision detection - if (physicBodies[i]->collider.enabled) + if (bodies[i]->id == id) { - // Update collider bounds - physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); - - // Check collision with other colliders - for (int k = 0; k < physicBodiesCount; k++) - { - if (physicBodies[k]->collider.enabled && i != k) - { - // Resolve physic collision - // NOTE: collision resolve is generic for all directions and conditions (no axis separated cases behaviours) - // and it is separated in rigidbody attributes resolve (velocity changes by impulse) and position correction (position overlap) - - // 1. Calculate collision normal - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Define collision contact normal, direction and penetration depth - Vector2 contactNormal = { 0.0f, 0.0f }; - Vector2 direction = { 0.0f, 0.0f }; - float penetrationDepth = 0.0f; - - switch (physicBodies[i]->collider.type) - { - case COLLIDER_RECTANGLE: - { - switch (physicBodies[k]->collider.type) - { - case COLLIDER_RECTANGLE: - { - // Check if colliders are overlapped - if (CheckCollisionRecs(physicBodies[i]->collider.bounds, physicBodies[k]->collider.bounds)) - { - // Calculate direction vector from i to k - direction.x = (physicBodies[k]->transform.position.x + physicBodies[k]->transform.scale.x/2) - (physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2); - direction.y = (physicBodies[k]->transform.position.y + physicBodies[k]->transform.scale.y/2) - (physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2); - - // Define overlapping and penetration attributes - Vector2 overlap; - - // Calculate overlap on X axis - overlap.x = (physicBodies[i]->transform.scale.x + physicBodies[k]->transform.scale.x)/2 - abs(direction.x); - - // SAT test on X axis - if (overlap.x > 0.0f) - { - // Calculate overlap on Y axis - overlap.y = (physicBodies[i]->transform.scale.y + physicBodies[k]->transform.scale.y)/2 - abs(direction.y); - - // SAT test on Y axis - if (overlap.y > 0.0f) - { - // Find out which axis is axis of least penetration - if (overlap.y > overlap.x) - { - // Point towards k knowing that direction points from i to k - if (direction.x < 0.0f) contactNormal = (Vector2){ -1.0f, 0.0f }; - else contactNormal = (Vector2){ 1.0f, 0.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.x; - } - else - { - // Point towards k knowing that direction points from i to k - if (direction.y < 0.0f) contactNormal = (Vector2){ 0.0f, 1.0f }; - else contactNormal = (Vector2){ 0.0f, -1.0f }; - - // Update penetration depth for position correction - penetrationDepth = overlap.y; - } - } - } - } - } break; - case COLLIDER_CIRCLE: - { - if (CheckCollisionCircleRec(physicBodies[k]->transform.position, physicBodies[k]->collider.radius, physicBodies[i]->collider.bounds)) - { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x + physicBodies[i]->transform.scale.x/2; - direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y + physicBodies[i]->transform.scale.y/2; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width; - else closestPoint.x = physicBodies[i]->collider.bounds.x; - - if (direction.y > 0.0f) closestPoint.y = physicBodies[i]->collider.bounds.y + physicBodies[i]->collider.bounds.height; - else closestPoint.y = physicBodies[i]->collider.bounds.y; - - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) - { - // Recalculate direction based on closest point position - direction.x = physicBodies[k]->transform.position.x - closestPoint.x; - direction.y = physicBodies[k]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicBodies[k]->collider.radius - distance; - } - else - { - if (abs(direction.y) < abs(direction.x)) - { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y - physicBodies[k]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.y - physicBodies[k]->transform.position.y + physicBodies[k]->collider.radius); - } - } - else - { - // Calculate final contact normal - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[k]->transform.position.x + physicBodies[k]->collider.radius - physicBodies[i]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[i]->collider.bounds.x + physicBodies[i]->collider.bounds.width - physicBodies[k]->transform.position.x - physicBodies[k]->collider.radius); - } - } - } - } - } break; - } - } break; - case COLLIDER_CIRCLE: - { - switch (physicBodies[k]->collider.type) - { - case COLLIDER_RECTANGLE: - { - if (CheckCollisionCircleRec(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->collider.bounds)) - { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x + physicBodies[i]->transform.scale.x/2 - physicBodies[i]->transform.position.x; - direction.y = physicBodies[k]->transform.position.y + physicBodies[i]->transform.scale.y/2 - physicBodies[i]->transform.position.y; - - // Calculate closest point on rectangle to circle - Vector2 closestPoint = { 0.0f, 0.0f }; - if (direction.x > 0.0f) closestPoint.x = physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width; - else closestPoint.x = physicBodies[k]->collider.bounds.x; - - if (direction.y > 0.0f) closestPoint.y = physicBodies[k]->collider.bounds.y + physicBodies[k]->collider.bounds.height; - else closestPoint.y = physicBodies[k]->collider.bounds.y; - - // Check if the closest point is inside the circle - if (CheckCollisionPointCircle(closestPoint, physicBodies[i]->transform.position, physicBodies[i]->collider.radius)) - { - // Recalculate direction based on closest point position - direction.x = physicBodies[i]->transform.position.x - closestPoint.x; - direction.y = physicBodies[i]->transform.position.y - closestPoint.y; - float distance = Vector2Length(direction); - - // Calculate final contact normal - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - - // Calculate penetration depth - penetrationDepth = physicBodies[k]->collider.radius - distance; - } - else - { - if (abs(direction.y) < abs(direction.x)) - { - // Calculate final contact normal - if (direction.y > 0.0f) - { - contactNormal = (Vector2){ 0.0f, -1.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y - physicBodies[i]->collider.radius); - } - else - { - contactNormal = (Vector2){ 0.0f, 1.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.y - physicBodies[i]->transform.position.y + physicBodies[i]->collider.radius); - } - } - else - { - // Calculate final contact normal and penetration depth - if (direction.x > 0.0f) - { - contactNormal = (Vector2){ 1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[i]->transform.position.x + physicBodies[i]->collider.radius - physicBodies[k]->collider.bounds.x); - } - else - { - contactNormal = (Vector2){ -1.0f, 0.0f }; - penetrationDepth = fabs(physicBodies[k]->collider.bounds.x + physicBodies[k]->collider.bounds.width - physicBodies[i]->transform.position.x - physicBodies[i]->collider.radius); - } - } - } - } - } break; - case COLLIDER_CIRCLE: - { - // Check if colliders are overlapped - if (CheckCollisionCircles(physicBodies[i]->transform.position, physicBodies[i]->collider.radius, physicBodies[k]->transform.position, physicBodies[k]->collider.radius)) - { - // Calculate direction vector between circles - direction.x = physicBodies[k]->transform.position.x - physicBodies[i]->transform.position.x; - direction.y = physicBodies[k]->transform.position.y - physicBodies[i]->transform.position.y; - - // Calculate distance between circles - float distance = Vector2Length(direction); - - // Check if circles are not completely overlapped - if (distance != 0.0f) - { - // Calculate contact normal direction (Y axis needs to be flipped) - contactNormal.x = direction.x/distance; - contactNormal.y = -direction.y/distance; - } - else contactNormal = (Vector2){ 1.0f, 0.0f }; // Choose random (but consistent) values - } - } break; - default: break; - } - } break; - default: break; - } - - // Update rigidbody grounded state - if (physicBodies[i]->rigidbody.enabled) physicBodies[i]->rigidbody.isGrounded = (contactNormal.y < 0.0f); - - // 2. Calculate collision impulse - // ------------------------------------------------------------------------------------------------------------------------------------- - - // Calculate relative velocity - Vector2 relVelocity = { 0.0f, 0.0f }; - relVelocity.x = physicBodies[k]->rigidbody.velocity.x - physicBodies[i]->rigidbody.velocity.x; - relVelocity.y = physicBodies[k]->rigidbody.velocity.y - physicBodies[i]->rigidbody.velocity.y; - - // Calculate relative velocity in terms of the normal direction - float velAlongNormal = Vector2DotProduct(relVelocity, contactNormal); - - // Dot not resolve if velocities are separating - if (velAlongNormal <= 0.0f) - { - // Calculate minimum bounciness value from both objects - float e = fminf(physicBodies[i]->rigidbody.bounciness, physicBodies[k]->rigidbody.bounciness); - - // Calculate impulse scalar value - float j = -(1.0f + e)*velAlongNormal; - j /= 1.0f/physicBodies[i]->rigidbody.mass + 1.0f/physicBodies[k]->rigidbody.mass; - - // Calculate final impulse vector - Vector2 impulse = { j*contactNormal.x, j*contactNormal.y }; - - // Calculate collision mass ration - float massSum = physicBodies[i]->rigidbody.mass + physicBodies[k]->rigidbody.mass; - float ratio = 0.0f; - - // Apply impulse to current rigidbodies velocities if they are enabled - if (physicBodies[i]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicBodies[i]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicBodies[i]->rigidbody.velocity.x -= impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - physicBodies[i]->rigidbody.velocity.y -= impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - } - - if (physicBodies[k]->rigidbody.enabled) - { - // Calculate inverted mass ration - ratio = physicBodies[k]->rigidbody.mass/massSum; - - // Apply impulse direction to velocity - physicBodies[k]->rigidbody.velocity.x += impulse.x*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - physicBodies[k]->rigidbody.velocity.y += impulse.y*ratio*(1.0f+physicBodies[i]->rigidbody.bounciness); - } - - // 3. Correct colliders overlaping (transform position) - // --------------------------------------------------------------------------------------------------------------------------------- - - // Calculate transform position penetration correction - Vector2 posCorrection; - posCorrection.x = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.x; - posCorrection.y = penetrationDepth/((1.0f/physicBodies[i]->rigidbody.mass) + (1.0f/physicBodies[k]->rigidbody.mass))*PHYSICS_ERRORPERCENT*contactNormal.y; - - // Fix transform positions - if (physicBodies[i]->rigidbody.enabled) - { - // Fix physic objects transform position - physicBodies[i]->transform.position.x -= 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.x; - physicBodies[i]->transform.position.y += 1.0f/physicBodies[i]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicBodies[i]->collider.bounds = TransformToRectangle(physicBodies[i]->transform); - - if (physicBodies[k]->rigidbody.enabled) - { - // Fix physic objects transform position - physicBodies[k]->transform.position.x += 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.x; - physicBodies[k]->transform.position.y -= 1.0f/physicBodies[k]->rigidbody.mass*posCorrection.y; - - // Update collider bounds - physicBodies[k]->collider.bounds = TransformToRectangle(physicBodies[k]->transform); - } - } - } - } - } + index = i; + break; } } + + #if defined(PHYSAC_DEBUG) + if (index == -1) printf("[PHYSAC] cannot find body id %i in pointers array\n", id); + #endif + + // Free body allocated memory + PHYSAC_FREE(bodies[index]); + usedMemory -= sizeof(PhysicsBodyData); + bodies[index] = NULL; + + // Reorder physics bodies pointers array and its catched index + for (int i = index; i < physicsBodiesCount; i++) + { + if ((i + 1) < physicsBodiesCount) bodies[i] = bodies[i + 1]; + } + + // Update physics bodies count + physicsBodiesCount--; + + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] destroyed physics body id %i\n", id); + #endif + } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] error trying to destroy a null referenced body\n"); + #endif +} + +// Destroys created physics bodies and manifolds and resets global values +PHYSACDEF void ResetPhysics(void) +{ + // Unitialize physics bodies dynamic memory allocations + for (int i = physicsBodiesCount - 1; i >= 0; i--) + { + PhysicsBody body = bodies[i]; + + if (body != NULL) + { + PHYSAC_FREE(body); + body = NULL; + usedMemory -= sizeof(PhysicsBodyData); + } + } + + physicsBodiesCount = 0; + + // Unitialize physics manifolds dynamic memory allocations + for (int i = physicsManifoldsCount - 1; i >= 0; i--) + { + PhysicsManifold manifold = contacts[i]; + + if (manifold != NULL) + { + PHYSAC_FREE(manifold); + manifold = NULL; + usedMemory -= sizeof(PhysicsManifoldData); + } } + + physicsManifoldsCount = 0; + + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] physics module reset successfully\n"); + #endif +} + +// Unitializes physics pointers and exits physics loop thread +PHYSACDEF void ClosePhysics(void) +{ + // Exit physics loop thread + physicsThreadEnabled = false; + + #if !defined(PHYSAC_NO_THREADS) + pthread_join(physicsThreadId, NULL); + #endif +} + +//---------------------------------------------------------------------------------- +// Module Internal Functions Definition +//---------------------------------------------------------------------------------- +// Creates a random polygon shape with max vertex distance from polygon pivot +static PolygonData CreateRandomPolygon(float radius, int sides) +{ + PolygonData data = { 0 }; + data.vertexCount = sides; + + float orient = GetRandomNumber(0, 360); + data.transform = Mat2Radians(orient*PHYSAC_DEG2RAD); + + // Calculate polygon vertices positions + for (int i = 0; i < data.vertexCount; i++) + { + data.vertices[i].x = cosf(360/sides*i*PHYSAC_DEG2RAD)*radius; + data.vertices[i].y = sinf(360/sides*i*PHYSAC_DEG2RAD)*radius; + } + + // Calculate polygon faces normals + for (int i = 0; i < data.vertexCount; i++) + { + int nextIndex = (((i + 1) < sides) ? (i + 1) : 0); + Vector2 face = Vector2Subtract(data.vertices[nextIndex], data.vertices[i]); + + data.normals[i] = (Vector2){ face.y, -face.x }; + MathNormalize(&data.normals[i]); + } + + return data; +} + +// Creates a rectangle polygon shape based on a min and max positions +static PolygonData CreateRectanglePolygon(Vector2 pos, Vector2 size) +{ + PolygonData data = { 0 }; + + data.vertexCount = 4; + data.transform = Mat2Radians(0); + + // Calculate polygon vertices positions + data.vertices[0] = (Vector2){ pos.x + size.x/2, pos.y - size.y/2 }; + data.vertices[1] = (Vector2){ pos.x + size.x/2, pos.y + size.y/2 }; + data.vertices[2] = (Vector2){ pos.x - size.x/2, pos.y + size.y/2 }; + data.vertices[3] = (Vector2){ pos.x - size.x/2, pos.y - size.y/2 }; + + // Calculate polygon faces normals + for (int i = 0; i < data.vertexCount; i++) + { + int nextIndex = (((i + 1) < data.vertexCount) ? (i + 1) : 0); + Vector2 face = Vector2Subtract(data.vertices[nextIndex], data.vertices[i]); + + data.normals[i] = (Vector2){ face.y, -face.x }; + MathNormalize(&data.normals[i]); + } + + return data; +} + +// Physics loop thread function +static void *PhysicsLoop(void *arg) +{ + #if defined(PHYSAC_DEBUG) + printf("[PHYSAC] physics thread created with successfully\n"); + #endif + + // Initialize physics loop thread values + physicsThreadEnabled = true; + accumulator = 0; + + // Initialize high resolution timer + InitTimer(); + + // Physics update loop + while (physicsThreadEnabled) + { + // Calculate current time + currentTime = GetCurrentTime(); + + // Calculate current delta time + deltaTime = currentTime - startTime; + + // Store the time elapsed since the last frame began + accumulator += deltaTime; + + // Clamp accumulator to max time step to avoid bad performance + MathClamp(&accumulator, 0, PHYSAC_MAX_TIMESTEP); + + // Fixed time stepping loop + while (accumulator >= PHYSAC_DESIRED_DELTATIME) + { + PhysicsStep(); + accumulator -= deltaTime; + } + + // Record the starting of this frame + startTime = currentTime; + } + + // Unitialize physics manifolds dynamic memory allocations + for (int i = physicsManifoldsCount - 1; i >= 0; i--) DestroyPhysicsManifold(contacts[i]); + + // Unitialize physics bodies dynamic memory allocations + for (int i = physicsBodiesCount - 1; i >= 0; i--) DestroyPhysicsBody(bodies[i]); + + #if defined(PHYSAC_DEBUG) + if (physicsBodiesCount > 0 || usedMemory != 0) printf("[PHYSAC] physics module closed with %i still allocated bodies [MEMORY: %i bytes]\n", physicsBodiesCount, usedMemory); + else if (physicsManifoldsCount > 0 || usedMemory != 0) printf("[PHYSAC] physics module closed with %i still allocated manifolds [MEMORY: %i bytes]\n", physicsManifoldsCount, usedMemory); + else printf("[PHYSAC] physics module closed successfully\n"); + #endif + + return NULL; +} + +// Physics steps calculations (dynamics, collisions and position corrections) +static void PhysicsStep(void) +{ + stepsCount++; + + // Clear previous generated collisions information + for (int i = physicsManifoldsCount - 1; i >= 0; i--) + { + PhysicsManifold manifold = contacts[i]; + if (manifold != NULL) DestroyPhysicsManifold(manifold); + } + + // Generate new collision information + for (int i = 0; i < physicsBodiesCount; i++) + { + PhysicsBody bodyA = bodies[i]; + + if (bodyA != NULL) + { + for (int j = i + 1; j < physicsBodiesCount; j++) + { + PhysicsBody bodyB = bodies[j]; + + if (bodyB != NULL) + { + if ((bodyA->inverseMass == 0) && (bodyB->inverseMass == 0)) continue; + + PhysicsManifold manifold = NULL; + if (bodyA->shape.type == PHYSICS_POLYGON && bodyB->shape.type == PHYSICS_CIRCLE) manifold = CreatePhysicsManifold(bodyB, bodyA); + else manifold = CreatePhysicsManifold(bodyA, bodyB); + SolvePhysicsManifold(manifold); + + if (manifold->contactsCount > 0) + { + // Create a new manifold with same information as previously solved manifold and add it to the manifolds pool last slot + PhysicsManifold newManifold = CreatePhysicsManifold(bodyA, bodyB); + newManifold->penetration = manifold->penetration; + newManifold->normal = manifold->normal; + newManifold->contacts[0] = manifold->contacts[0]; + newManifold->contacts[1] = manifold->contacts[1]; + newManifold->contactsCount = manifold->contactsCount; + newManifold->restitution = manifold->restitution; + newManifold->dynamicFriction = manifold->dynamicFriction; + newManifold->staticFriction = manifold->staticFriction; + } + } + } + } + } + + // Integrate forces to physics bodies + for (int i = 0; i < physicsBodiesCount; i++) + { + PhysicsBody body = bodies[i]; + if (body != NULL) IntegratePhysicsForces(body); + } + + // Initialize physics manifolds to solve collisions + for (int i = 0; i < physicsManifoldsCount; i++) + { + PhysicsManifold manifold = contacts[i]; + if (manifold != NULL) InitializePhysicsManifolds(manifold); + } + + // Integrate physics collisions impulses to solve collisions + for (int i = 0; i < PHYSAC_COLLISION_ITERATIONS; i++) + { + for (int j = 0; j < physicsManifoldsCount; j++) + { + PhysicsManifold manifold = contacts[i]; + if (manifold != NULL) IntegratePhysicsImpulses(manifold); + } + } + + // Integrate velocity to physics bodies + for (int i = 0; i < physicsBodiesCount; i++) + { + PhysicsBody body = bodies[i]; + if (body != NULL) IntegratePhysicsVelocity(body); + } + + // Correct physics bodies positions based on manifolds collision information + for (int i = 0; i < physicsManifoldsCount; i++) + { + PhysicsManifold manifold = contacts[i]; + if (manifold != NULL) CorrectPhysicsPositions(manifold); + } + + // Clear physics bodies forces + for (int i = 0; i < physicsBodiesCount; i++) + { + PhysicsBody body = bodies[i]; + if (body != NULL) + { + body->force = (Vector2){ 0 }; + body->torque = 0; + } + } +} + +// Creates a new physics manifold to solve collision +static PhysicsManifold CreatePhysicsManifold(PhysicsBody a, PhysicsBody b) +{ + PhysicsManifold newManifold = (PhysicsManifold)PHYSAC_MALLOC(sizeof(PhysicsManifoldData)); + usedMemory += sizeof(PhysicsManifoldData); + + int newId = -1; + for (int i = 0; i < PHYSAC_MAX_MANIFOLDS; i++) + { + int currentId = i; + + // Check if current id already exist in other physics body + for (int k = 0; k < physicsManifoldsCount; k++) + { + if (contacts[k]->id == currentId) + { + currentId++; + break; + } + } + + // If it is not used, use it as new physics body id + if (currentId == i) + { + newId = i; + break; + } + } + + if (newId != -1) + { + // Initialize new manifold with generic values + newManifold->id = newId; + newManifold->bodyA = a; + newManifold->bodyB = b; + newManifold->penetration = 0; + newManifold->normal = (Vector2){ 0 }; + newManifold->contacts[0] = (Vector2){ 0 }; + newManifold->contacts[1] = (Vector2){ 0 }; + newManifold->contactsCount = 0; + newManifold->restitution = 0; + newManifold->dynamicFriction = 0; + newManifold->staticFriction = 0; + + // Add new body to bodies pointers array and update bodies count + contacts[physicsManifoldsCount] = newManifold; + physicsManifoldsCount++; + } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] new physics manifold creation failed because there is any available id to use\n"); + #endif + + return newManifold; +} + +// Unitializes and destroys a physics manifold +static void DestroyPhysicsManifold(PhysicsManifold manifold) +{ + if (manifold != NULL) + { + int id = manifold->id; + int index = -1; + + for (int i = 0; i < physicsManifoldsCount; i++) + { + if (contacts[i]->id == id) + { + index = i; + break; + } + } + + #if defined(PHYSAC_DEBUG) + if (index == -1) printf("[PHYSAC] cannot find manifold id %i in pointers array\n", id); + #endif + + // Free manifold allocated memory + PHYSAC_FREE(contacts[index]); + usedMemory -= sizeof(PhysicsManifoldData); + contacts[index] = NULL; + + // Reorder physics manifolds pointers array and its catched index + for (int i = index; i < physicsManifoldsCount; i++) + { + if ((i + 1) < physicsManifoldsCount) contacts[i] = contacts[i + 1]; + } + + // Update physics manifolds count + physicsManifoldsCount--; + } + #if defined(PHYSAC_DEBUG) + else printf("[PHYSAC] error trying to destroy a null referenced manifold\n"); + #endif +} + +// Solves a created physics manifold between two physics bodies +static void SolvePhysicsManifold(PhysicsManifold manifold) +{ + switch (manifold->bodyA->shape.type) + { + case PHYSICS_CIRCLE: + { + switch (manifold->bodyB->shape.type) + { + case PHYSICS_CIRCLE: SolveCircleToCircle(manifold); break; + case PHYSICS_POLYGON: SolveCircleToPolygon(manifold); break; + default: break; + } + } break; + case PHYSICS_POLYGON: + { + switch (manifold->bodyB->shape.type) + { + case PHYSICS_CIRCLE: SolvePolygonToCircle(manifold); break; + case PHYSICS_POLYGON: SolvePolygonToPolygon(manifold); break; + default: break; + } + } break; + default: break; + } + + // Update physics body grounded state if normal direction is downside + manifold->bodyB->isGrounded = (manifold->normal.y < 0); +} + +// Solves collision between two circle shape physics bodies +static void SolveCircleToCircle(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + // Calculate translational vector, which is normal + Vector2 normal = Vector2Subtract(bodyB->position, bodyA->position); + + float distSqr = MathLenSqr(normal); + float radius = bodyA->shape.radius + bodyB->shape.radius; + + // Check if circles are not in contact + if (distSqr >= radius*radius) + { + manifold->contactsCount = 0; + return; + } + + float distance = sqrtf(distSqr); + manifold->contactsCount = 1; + + if (distance == 0) + { + manifold->penetration = bodyA->shape.radius; + manifold->normal = (Vector2){ 1, 0 }; + manifold->contacts[0] = bodyA->position; + } + else + { + manifold->penetration = radius - distance; + manifold->normal = (Vector2){ normal.x/distance, normal.y/distance }; // Faster than using MathNormalize() due to sqrt is already performed + manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + } + + // Update physics body grounded state if normal direction is down + if (manifold->normal.y < 0) bodyA->isGrounded = true; +} + +// Solves collision between a circle to a polygon shape physics bodies +static void SolveCircleToPolygon(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + manifold->contactsCount = 0; + + // Transform circle center to polygon transform space + Vector2 center = bodyA->position; + center = Mat2MultiplyVector2(Mat2Transpose(bodyB->shape.vertexData.transform), Vector2Subtract(center, bodyB->position)); + + // Find edge with minimum penetration + // It is the same concept as using support points in SolvePolygonToPolygon + float separation = -PHYSAC_FLT_MAX; + int faceNormal = 0; + PolygonData vertexData = bodyB->shape.vertexData; + + for (int i = 0; i < vertexData.vertexCount; i++) + { + float currentSeparation = MathDot(vertexData.normals[i], Vector2Subtract(center, vertexData.vertices[i])); + + if (currentSeparation > bodyA->shape.radius) return; + + if (currentSeparation > separation) + { + separation = currentSeparation; + faceNormal = i; + } + } + + // Grab face's vertices + Vector2 v1 = vertexData.vertices[faceNormal]; + int nextIndex = (((faceNormal + 1) < vertexData.vertexCount) ? (faceNormal + 1) : 0); + Vector2 v2 = vertexData.vertices[nextIndex]; + + // Check to see if center is within polygon + if (separation < PHYSAC_EPSILON) + { + manifold->contactsCount = 1; + Vector2 normal = Mat2MultiplyVector2(vertexData.transform, vertexData.normals[faceNormal]); + manifold->normal = (Vector2){ -normal.x, -normal.y }; + manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + manifold->penetration = bodyA->shape.radius; + return; + } + + // Determine which voronoi region of the edge center of circle lies within + float dot1 = MathDot(Vector2Subtract(center, v1), Vector2Subtract(v2, v1)); + float dot2 = MathDot(Vector2Subtract(center, v2), Vector2Subtract(v1, v2)); + manifold->penetration = bodyA->shape.radius - separation; + + if (dot1 <= 0) // Closest to v1 + { + if (DistSqr(center, v1) > bodyA->shape.radius*bodyA->shape.radius) return; + + manifold->contactsCount = 1; + Vector2 normal = Vector2Subtract(v1, center); + normal = Mat2MultiplyVector2(vertexData.transform, normal); + MathNormalize(&normal); + manifold->normal = normal; + v1 = Mat2MultiplyVector2(vertexData.transform, v1); + v1 = Vector2Add(v1, bodyB->position); + manifold->contacts[0] = v1; + } + else if (dot2 <= 0) // Closest to v2 + { + if (DistSqr(center, v2) > bodyA->shape.radius*bodyA->shape.radius) return; + + manifold->contactsCount = 1; + Vector2 normal = Vector2Subtract(v2, center); + v2 = Mat2MultiplyVector2(vertexData.transform, v2); + v2 = Vector2Add(v2, bodyB->position); + manifold->contacts[0] = v2; + normal = Mat2MultiplyVector2(vertexData.transform, normal); + MathNormalize(&normal); + manifold->normal = normal; + } + else // Closest to face + { + Vector2 normal = vertexData.normals[faceNormal]; + + if (MathDot(Vector2Subtract(center, v1), normal) > bodyA->shape.radius) return; + + normal = Mat2MultiplyVector2(vertexData.transform, normal); + manifold->normal = (Vector2){ -normal.x, -normal.y }; + manifold->contacts[0] = (Vector2){ manifold->normal.x*bodyA->shape.radius + bodyA->position.x, manifold->normal.y*bodyA->shape.radius + bodyA->position.y }; + manifold->contactsCount = 1; + } +} + +// Solves collision between a polygon to a circle shape physics bodies +static void SolvePolygonToCircle(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + manifold->bodyA = bodyB; + manifold->bodyB = bodyA; + SolveCircleToPolygon(manifold); + + manifold->normal.x *= -1; + manifold->normal.y *= -1; +} + +// Solves collision between two polygons shape physics bodies +static void SolvePolygonToPolygon(PhysicsManifold manifold) +{ + PhysicsShape bodyA = manifold->bodyA->shape; + PhysicsShape bodyB = manifold->bodyB->shape; + manifold->contactsCount = 0; + + // Check for separating axis with A shape's face planes + int faceA = 0; + float penetrationA = FindAxisLeastPenetration(&faceA, bodyA, bodyB); + if (penetrationA >= 0) return; + + // Check for separating axis with B shape's face planes + int faceB = 0; + float penetrationB = FindAxisLeastPenetration(&faceB, bodyB, bodyA); + if (penetrationB >= 0) return; + + int referenceIndex = 0; + bool flip = false; // Always point from A shape to B shape + + PhysicsShape refPoly; // Reference + PhysicsShape incPoly; // Incident + + // Determine which shape contains reference face + if (BiasGreaterThan(penetrationA, penetrationB)) + { + refPoly = bodyA; + incPoly = bodyB; + referenceIndex = faceA; + } + else + { + refPoly = bodyB; + incPoly = bodyA; + referenceIndex = faceB; + flip = true; + } + + // World space incident face + Vector2 incidentFace[2]; + FindIncidentFace(&incidentFace[0], &incidentFace[1], refPoly, incPoly, referenceIndex); + + // Setup reference face vertices + PolygonData refData = refPoly.vertexData; + Vector2 v1 = refData.vertices[referenceIndex]; + referenceIndex = (((referenceIndex + 1) < refData.vertexCount) ? (referenceIndex + 1) : 0); + Vector2 v2 = refData.vertices[referenceIndex]; + + // Transform vertices to world space + v1 = Mat2MultiplyVector2(refData.transform, v1); + v1 = Vector2Add(v1, refPoly.body->position); + v2 = Mat2MultiplyVector2(refData.transform, v2); + v2 = Vector2Add(v2, refPoly.body->position); + + // Calculate reference face side normal in world space + Vector2 sidePlaneNormal = Vector2Subtract(v2, v1); + MathNormalize(&sidePlaneNormal); + + // Orthogonalize + Vector2 refFaceNormal = { sidePlaneNormal.y, -sidePlaneNormal.x }; + float refC = MathDot(refFaceNormal, v1); + float negSide = MathDot(sidePlaneNormal, v1)*-1; + float posSide = MathDot(sidePlaneNormal, v2); + + // Clip incident face to reference face side planes (due to floating point error, possible to not have required points + if (Clip((Vector2){ -sidePlaneNormal.x, -sidePlaneNormal.y }, negSide, &incidentFace[0], &incidentFace[1]) < 2) return; + if (Clip(sidePlaneNormal, posSide, &incidentFace[0], &incidentFace[1]) < 2) return; + + // Flip normal if required + manifold->normal = (flip ? (Vector2){ -refFaceNormal.x, -refFaceNormal.y } : refFaceNormal); + + // Keep points behind reference face + int currentPoint = 0; // Clipped points behind reference face + float separation = MathDot(refFaceNormal, incidentFace[0]) - refC; + if (separation <= 0) + { + manifold->contacts[currentPoint] = incidentFace[0]; + manifold->penetration = -separation; + currentPoint++; + } + else manifold->penetration = 0; + + separation = MathDot(refFaceNormal, incidentFace[1]) - refC; + + if (separation <= 0) + { + manifold->contacts[currentPoint] = incidentFace[1]; + manifold->penetration += -separation; + currentPoint++; + + // Calculate total penetration average + manifold->penetration /= currentPoint; + } + + manifold->contactsCount = currentPoint; +} + +// Integrates physics forces into velocity +static void IntegratePhysicsForces(PhysicsBody body) +{ + if (body->inverseMass == 0 || !body->enabled) return; + + body->velocity.x += (body->force.x*body->inverseMass)*(deltaTime/2); + body->velocity.y += (body->force.y*body->inverseMass)*(deltaTime/2); + + if (body->useGravity) + { + body->velocity.x += gravityForce.x*(deltaTime/2); + body->velocity.y += gravityForce.y*(deltaTime/2); + } + + if (!body->freezeOrient) body->angularVelocity += body->torque*body->inverseInertia*(deltaTime/2); +} + +// Initializes physics manifolds to solve collisions +static void InitializePhysicsManifolds(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + // Calculate average restitution, static and dynamic friction + manifold->restitution = sqrtf(bodyA->restitution*bodyB->restitution); + manifold->staticFriction = sqrtf(bodyA->staticFriction*bodyB->staticFriction); + manifold->dynamicFriction = sqrtf(bodyA->dynamicFriction*bodyB->dynamicFriction); + + for (int i = 0; i < 2; i++) + { + // Caculate radius from center of mass to contact + Vector2 radiusA = Vector2Subtract(manifold->contacts[i], bodyA->position); + Vector2 radiusB = Vector2Subtract(manifold->contacts[i], bodyB->position); + + Vector2 crossA = MathCross(bodyA->angularVelocity, radiusA); + Vector2 crossB = MathCross(bodyB->angularVelocity, radiusB); + + Vector2 radiusV = { 0 }; + radiusV.x = bodyB->velocity.x + crossB.x - bodyA->velocity.x - crossA.x; + radiusV.y = bodyB->velocity.y + crossB.y - bodyA->velocity.y - crossA.y; + + // Determine if we should perform a resting collision or not; + // The idea is if the only thing moving this object is gravity, then the collision should be performed without any restitution + if (MathLenSqr(radiusV) < (MathLenSqr((Vector2){ gravityForce.x*deltaTime, gravityForce.y*deltaTime }) + PHYSAC_EPSILON)) manifold->restitution = 0; + } +} + +// Integrates physics collisions impulses to solve collisions +static void IntegratePhysicsImpulses(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + // Early out and positional correct if both objects have infinite mass + if (fabs(bodyA->inverseMass + bodyB->inverseMass) <= PHYSAC_EPSILON) + { + bodyA->velocity = (Vector2){ 0 }; + bodyB->velocity = (Vector2){ 0 }; + return; + } + + for (int i = 0; i < manifold->contactsCount; i++) + { + // Calculate radius from center of mass to contact + Vector2 radiusA = Vector2Subtract(manifold->contacts[i], bodyA->position); + Vector2 radiusB = Vector2Subtract(manifold->contacts[i], bodyB->position); + + // Calculate relative velocity + Vector2 radiusV = { 0 }; + radiusV.x = bodyB->velocity.x + MathCross(bodyB->angularVelocity, radiusB).x - bodyA->velocity.x - MathCross(bodyA->angularVelocity, radiusA).x; + radiusV.y = bodyB->velocity.y + MathCross(bodyB->angularVelocity, radiusB).y - bodyA->velocity.y - MathCross(bodyA->angularVelocity, radiusA).y; + + // Relative velocity along the normal + float contactVelocity = MathDot(radiusV, manifold->normal); + + // Do not resolve if velocities are separating + if (contactVelocity > 0) return; + + float raCrossN = MathCrossVector2(radiusA, manifold->normal); + float rbCrossN = MathCrossVector2(radiusB, manifold->normal); + + float inverseMassSum = bodyA->inverseMass + bodyB->inverseMass + (raCrossN*raCrossN)*bodyA->inverseInertia + (rbCrossN*rbCrossN)*bodyB->inverseInertia; + + // Calculate impulse scalar value + float impulse = -(1.0f + manifold->restitution)*contactVelocity; + impulse /= inverseMassSum; + impulse /= (float)manifold->contactsCount; + + // Apply impulse to each physics body + Vector2 impulseV = { manifold->normal.x*impulse, manifold->normal.y*impulse }; + + if (bodyA->enabled) + { + bodyA->velocity.x += bodyA->inverseMass*(-impulseV.x); + bodyA->velocity.y += bodyA->inverseMass*(-impulseV.y); + if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathCrossVector2(radiusA, (Vector2){ -impulseV.x, -impulseV.y }); + } + + if (bodyB->enabled) + { + bodyB->velocity.x += bodyB->inverseMass*(impulseV.x); + bodyB->velocity.y += bodyB->inverseMass*(impulseV.y); + if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathCrossVector2(radiusB, impulseV); + } + + // Apply friction impulse to each physics body + radiusV.x = bodyB->velocity.x + MathCross(bodyB->angularVelocity, radiusB).x - bodyA->velocity.x - MathCross(bodyA->angularVelocity, radiusA).x; + radiusV.y = bodyB->velocity.y + MathCross(bodyB->angularVelocity, radiusB).y - bodyA->velocity.y - MathCross(bodyA->angularVelocity, radiusA).y; + + Vector2 tangent = { radiusV.x - (manifold->normal.x*MathDot(radiusV, manifold->normal)), radiusV.y - (manifold->normal.y*MathDot(radiusV, manifold->normal)) }; + MathNormalize(&tangent); + + // Calculate impulse tangent magnitude + float impulseTangent = -MathDot(radiusV, tangent); + impulseTangent /= inverseMassSum; + impulseTangent /= (float)manifold->contactsCount; + + float absImpulseTangent = fabs(impulseTangent); + + // Don't apply tiny friction impulses + if (absImpulseTangent <= PHYSAC_EPSILON) return; + + // Apply coulumb's law + Vector2 tangentImpulse = { 0 }; + if (absImpulseTangent < impulse*manifold->staticFriction) tangentImpulse = (Vector2){ tangent.x*impulseTangent, tangent.y*impulseTangent }; + else tangentImpulse = (Vector2){ tangent.x*-impulse*manifold->dynamicFriction, tangent.y*-impulse*manifold->dynamicFriction }; + + // Apply friction impulse + if (bodyA->enabled) + { + bodyA->velocity.x += bodyA->inverseMass*(-tangentImpulse.x); + bodyA->velocity.y += bodyA->inverseMass*(-tangentImpulse.y); + + if (!bodyA->freezeOrient) bodyA->angularVelocity += bodyA->inverseInertia*MathCrossVector2(radiusA, (Vector2){ -tangentImpulse.x, -tangentImpulse.y }); + } + + if (bodyB->enabled) + { + bodyB->velocity.x += bodyB->inverseMass*(tangentImpulse.x); + bodyB->velocity.y += bodyB->inverseMass*(tangentImpulse.y); + + if (!bodyB->freezeOrient) bodyB->angularVelocity += bodyB->inverseInertia*MathCrossVector2(radiusB, tangentImpulse); + } + } +} + +// Integrates physics velocity into position and forces +static void IntegratePhysicsVelocity(PhysicsBody body) +{ + if (!body->enabled) return; + + body->position.x += body->velocity.x*deltaTime; + body->position.y += body->velocity.y*deltaTime; + + if (!body->freezeOrient) body->orient += body->angularVelocity*deltaTime; + Mat2Set(&body->shape.vertexData.transform, body->orient); + + IntegratePhysicsForces(body); +} + +// Corrects physics bodies positions based on manifolds collision information +static void CorrectPhysicsPositions(PhysicsManifold manifold) +{ + PhysicsBody bodyA = manifold->bodyA; + PhysicsBody bodyB = manifold->bodyB; + + Vector2 correction = { 0 }; + correction.x = (max(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.x*PHYSAC_PENETRATION_CORRECTION; + correction.y = (max(manifold->penetration - PHYSAC_PENETRATION_ALLOWANCE, 0)/(bodyA->inverseMass + bodyB->inverseMass))*manifold->normal.y*PHYSAC_PENETRATION_CORRECTION; + + if (bodyA->enabled) + { + bodyA->position.x -= correction.x*bodyA->inverseMass; + bodyA->position.y -= correction.y*bodyA->inverseMass; + } + + if (bodyB->enabled) + { + bodyB->position.x += correction.x*bodyB->inverseMass; + bodyB->position.y += correction.y*bodyB->inverseMass; + } +} + +// Returns the extreme point along a direction within a polygon +static Vector2 GetSupport(PhysicsShape shape, Vector2 dir) +{ + float bestProjection = -PHYSAC_FLT_MAX; + Vector2 bestVertex = { 0 }; + PolygonData data = shape.vertexData; + + for (int i = 0; i < data.vertexCount; i++) + { + Vector2 vertex = data.vertices[i]; + float projection = MathDot(vertex, dir); + + if (projection > bestProjection) + { + bestVertex = vertex; + bestProjection = projection; + } + } + + return bestVertex; +} + +// Finds polygon shapes axis least penetration +static float FindAxisLeastPenetration(int *faceIndex, PhysicsShape shapeA, PhysicsShape shapeB) +{ + float bestDistance = -PHYSAC_FLT_MAX; + int bestIndex = 0; + + PolygonData dataA = shapeA.vertexData; + PolygonData dataB = shapeB.vertexData; + + for (int i = 0; i < dataA.vertexCount; i++) + { + // Retrieve a face normal from A shape + Vector2 normal = dataA.normals[i]; + Vector2 transNormal = Mat2MultiplyVector2(dataA.transform, normal); + + // Transform face normal into B shape's model space + Mat2 buT = Mat2Transpose(dataB.transform); + normal = Mat2MultiplyVector2(buT, transNormal); + + // Retrieve support point from B shape along -n + Vector2 support = GetSupport(shapeB, (Vector2){ -normal.x, -normal.y }); + + // Retrieve vertex on face from A shape, transform into B shape's model space + Vector2 vertex = dataA.vertices[i]; + vertex = Mat2MultiplyVector2(dataA.transform, vertex); + vertex = Vector2Add(vertex, shapeA.body->position); + vertex = Vector2Subtract(vertex, shapeB.body->position); + vertex = Mat2MultiplyVector2(buT, vertex); + + // Compute penetration distance in B shape's model space + float distance = MathDot(normal, Vector2Subtract(support, vertex)); + + // Store greatest distance + if (distance > bestDistance) + { + bestDistance = distance; + bestIndex = i; + } + } + + *faceIndex = bestIndex; + return bestDistance; +} + +// Finds two polygon shapes incident face +static void FindIncidentFace(Vector2 *v0, Vector2 *v1, PhysicsShape ref, PhysicsShape inc, int index) +{ + PolygonData refData = ref.vertexData; + PolygonData incData = inc.vertexData; + + Vector2 referenceNormal = refData.normals[index]; + + // Calculate normal in incident's frame of reference + referenceNormal = Mat2MultiplyVector2(refData.transform, referenceNormal); // To world space + referenceNormal = Mat2MultiplyVector2(Mat2Transpose(incData.transform), referenceNormal); // To incident's model space + + // Find most anti-normal face on polygon + int incidentFace = 0; + float minDot = PHYSAC_FLT_MAX; + + for (int i = 0; i < incData.vertexCount; i++) + { + float dot = MathDot(referenceNormal, incData.normals[i]); + + if (dot < minDot) + { + minDot = dot; + incidentFace = i; + } + } + + // Assign face vertices for incident face + *v0 = Mat2MultiplyVector2(incData.transform, incData.vertices[incidentFace]); + *v0 = Vector2Add(*v0, inc.body->position); + incidentFace = (((incidentFace + 1) < incData.vertexCount) ? (incidentFace + 1) : 0); + *v1 = Mat2MultiplyVector2(incData.transform, incData.vertices[incidentFace]); + *v1 = Vector2Add(*v1, inc.body->position); +} + +// Calculates clipping based on a normal and two faces +static int Clip(Vector2 normal, float clip, Vector2 *faceA, Vector2 *faceB) +{ + int sp = 0; + Vector2 out[2] = { *faceA, *faceB }; + + // Retrieve distances from each endpoint to the line + float distanceA = MathDot(normal, *faceA) - clip; + float distanceB = MathDot(normal, *faceB) - clip; + + // If negative (behind plane) + if (distanceA <= 0) out[sp++] = *faceA; + if (distanceB <= 0) out[sp++] = *faceB; + + // If the points are on different sides of the plane + if ((distanceA*distanceB) < 0) + { + // Push intersection point + float alpha = distanceA/(distanceA - distanceB); + out[sp] = *faceA; + Vector2 delta = Vector2Subtract(*faceB, *faceA); + delta.x *= alpha; + delta.y *= alpha; + out[sp] = Vector2Add(out[sp], delta); + sp++; + } + + // Assign the new converted values + *faceA = out[0]; + *faceB = out[1]; + + return sp; +} + +// Check if values are between bias range +static bool BiasGreaterThan(float valueA, float valueB) +{ + return (valueA >= (valueB*0.95f + valueA*0.01f)); +} + +// Returns the barycenter of a triangle given by 3 points +static Vector2 TriangleBarycenter(Vector2 v1, Vector2 v2, Vector2 v3) +{ + Vector2 result = { 0 }; + + result.x = (v1.x + v2.x + v3.x)/3; + result.y = (v1.y + v2.y + v3.y)/3; + + return result; +} + +// Initializes hi-resolution timer +static void InitTimer(void) +{ + srand(time(NULL)); // Initialize random seed + + #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec now; + if (clock_gettime(CLOCK_MONOTONIC, &now) == 0) baseTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; + #endif + + startTime = GetCurrentTime(); +} + +// Get current time in milliseconds +static double GetCurrentTime(void) +{ + double time = 0; + + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + unsigned long long int clockFrequency, currentTime; + + QueryPerformanceFrequency(&clockFrequency); + QueryPerformanceCounter(¤tTime); + + time = (double)((double)currentTime/clockFrequency)*1000; + #endif + + #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; + + time = (double)((double)(temp - baseTime)*1e-6); + #endif + + return time; +} + +// Returns a random number between min and max (both included) +static int GetRandomNumber(int min, int max) +{ + if (min > max) + { + int tmp = max; + max = min; + min = tmp; + } + + return (rand()%(abs(max - min) + 1) + min); +} + +// Clamp a value in a range +static inline void MathClamp(double *value, double min, double max) +{ + if (*value < min) *value = min; + else if (*value > max) *value = max; +} + +// Returns the cross product of a vector and a value +static inline Vector2 MathCross(float value, Vector2 vector) +{ + return (Vector2){ -value*vector.y, value*vector.x }; +} + +// Returns the cross product of two vectors +static inline float MathCrossVector2(Vector2 v1, Vector2 v2) +{ + return (v1.x*v2.y - v1.y*v2.x); +} + +// Returns the len square root of a vector +static inline float MathLenSqr(Vector2 vector) +{ + return (vector.x*vector.x + vector.y*vector.y); +} + +// Returns the dot product of two vectors +static inline float MathDot(Vector2 v1, Vector2 v2) +{ + return (v1.x*v2.x + v1.y*v2.y); +} + +// Returns the square root of distance between two vectors +static inline float DistSqr(Vector2 v1, Vector2 v2) +{ + Vector2 dir = Vector2Subtract(v1, v2); + return MathDot(dir, dir); +} + +// Returns the normalized values of a vector +static void MathNormalize(Vector2 *vector) +{ + float length, ilength; + + Vector2 aux = *vector; + length = sqrtf(aux.x*aux.x + aux.y*aux.y); + + if (length == 0) length = 1.0f; + + ilength = 1.0f/length; + + vector->x *= ilength; + vector->y *= ilength; +} + +// Returns the sum of two given vectors +static inline Vector2 Vector2Add(Vector2 v1, Vector2 v2) +{ + return (Vector2){ v1.x + v2.x, v1.y + v2.y }; +} + +// Returns the subtract of two given vectors +static inline Vector2 Vector2Subtract(Vector2 v1, Vector2 v2) +{ + return (Vector2){ v1.x - v2.x, v1.y - v2.y }; +} + +// Creates a matrix 2x2 from a given radians value +static inline Mat2 Mat2Radians(float radians) +{ + float c = cosf(radians); + float s = sinf(radians); + + return (Mat2){ c, -s, s, c }; +} + +// Set values from radians to a created matrix 2x2 +static void Mat2Set(Mat2 *matrix, float radians) +{ + float cos = cosf(radians); + float sin = sinf(radians); + + matrix->m00 = cos; + matrix->m01 = -sin; + matrix->m10 = sin; + matrix->m11 = cos; +} + +// Returns the transpose of a given matrix 2x2 +static inline Mat2 Mat2Transpose(Mat2 matrix) +{ + return (Mat2){ matrix.m00, matrix.m10, matrix.m01, matrix.m11 }; +} + +// Multiplies a vector by a matrix 2x2 +static inline Vector2 Mat2MultiplyVector2(Mat2 matrix, Vector2 vector) +{ + return (Vector2){ matrix.m00*vector.x + matrix.m01*vector.y, matrix.m10*vector.x + matrix.m11*vector.y }; } -#endif // PHYSAC_IMPLEMENTATION \ No newline at end of file +#endif // PHYSAC_IMPLEMENTATION -- cgit v1.2.3 From f1bcfc1352f73b9da98601f6b67cd15853b1cb8f Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 22 Nov 2016 12:14:55 +0100 Subject: Corrected bug on GenTextureMipmaps() texture.mipmaps value needs to be updated, so, texture must be passed by reference instead of by value --- src/raylib.h | 2 +- src/rlgl.c | 30 ++++++++++++++++++------------ src/rlgl.h | 2 +- src/textures.c | 8 ++++---- 4 files changed, 24 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 6d67051e..d28b07a3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -802,7 +802,7 @@ RLAPI void ImageColorInvert(Image *image); RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) -RLAPI void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture +RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode diff --git a/src/rlgl.c b/src/rlgl.c index b567f8fd..629d7967 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1719,15 +1719,15 @@ void rlglUpdateTexture(unsigned int id, int width, int height, int format, void } // Generate mipmap data for selected texture -void rlglGenerateMipmaps(Texture2D texture) +void rlglGenerateMipmaps(Texture2D *texture) { - glBindTexture(GL_TEXTURE_2D, texture.id); + glBindTexture(GL_TEXTURE_2D, texture->id); // Check if texture is power-of-two (POT) bool texIsPOT = false; - if (((texture.width > 0) && ((texture.width & (texture.width - 1)) == 0)) && - ((texture.height > 0) && ((texture.height & (texture.height - 1)) == 0))) texIsPOT = true; + if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && + ((texture->height > 0) && ((texture->height & (texture->height - 1)) == 0))) texIsPOT = true; if ((texIsPOT) || (npotSupported)) { @@ -1737,13 +1737,13 @@ void rlglGenerateMipmaps(Texture2D texture) // NOTE: data size is reallocated to fit mipmaps data // NOTE: CPU mipmap generation only supports RGBA 32bit data - int mipmapCount = GenerateMipmaps(data, texture.width, texture.height); + int mipmapCount = GenerateMipmaps(data, texture->width, texture->height); - int size = texture.width*texture.height*4; // RGBA 32bit only + int size = texture->width*texture->height*4; // RGBA 32bit only int offset = size; - int mipWidth = texture.width/2; - int mipHeight = texture.height/2; + int mipWidth = texture->width/2; + int mipHeight = texture->height/2; // Load the mipmaps for (int level = 1; level < mipmapCount; level++) @@ -1757,23 +1757,29 @@ void rlglGenerateMipmaps(Texture2D texture) mipHeight /= 2; } - TraceLog(WARNING, "[TEX ID %i] Mipmaps generated manually on CPU side", texture.id); + TraceLog(WARNING, "[TEX ID %i] Mipmaps generated manually on CPU side", texture->id); // NOTE: Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data free(data); + texture->mipmaps = mipmapCount + 1; #endif #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) //glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); // Hint for mipmaps generation algorythm: GL_FASTEST, GL_NICEST, GL_DONT_CARE glGenerateMipmap(GL_TEXTURE_2D); // Generate mipmaps automatically - TraceLog(INFO, "[TEX ID %i] Mipmaps generated automatically", texture.id); + TraceLog(INFO, "[TEX ID %i] Mipmaps generated automatically", texture->id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps (must be available) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps + + #define MIN(a,b) (((a)<(b))?(a):(b)) + #define MAX(a,b) (((a)>(b))?(a):(b)) + + texture->mipmaps = 1 + floor(log2(MAX(texture->width, texture->height))); #endif } - else TraceLog(WARNING, "[TEX ID %i] Mipmaps can not be generated", texture.id); + else TraceLog(WARNING, "[TEX ID %i] Mipmaps can not be generated", texture->id); glBindTexture(GL_TEXTURE_2D, 0); } diff --git a/src/rlgl.h b/src/rlgl.h index 7d328a52..bc12db0f 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -371,7 +371,7 @@ void rlglLoadExtensions(void *loader); // Load OpenGL extensions unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data -void rlglGenerateMipmaps(Texture2D texture); // Generate mipmap data for selected texture +void rlglGenerateMipmaps(Texture2D *texture); // Generate mipmap data for selected texture void rlglLoadMesh(Mesh *mesh, bool dynamic); // Upload vertex data into GPU and provided VAO/VBO ids void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex); // Update vertex data on GPU (upload new data to one buffer) diff --git a/src/textures.c b/src/textures.c index af59d035..126adad3 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1516,14 +1516,14 @@ void ImageColorBrightness(Image *image, int brightness) } // Generate GPU mipmaps for a texture -void GenTextureMipmaps(Texture2D texture) +void GenTextureMipmaps(Texture2D *texture) { #if PLATFORM_WEB - int potWidth = GetNextPOT(texture.width); - int potHeight = GetNextPOT(texture.height); + int potWidth = GetNextPOT(texture->width); + int potHeight = GetNextPOT(texture->height); // Check if texture is POT - if ((potWidth != texture.width) || (potHeight != texture.height)) + if ((potWidth != texture->width) || (potHeight != texture->height)) { TraceLog(WARNING, "Limited NPOT support, no mipmaps available for NPOT textures"); } -- cgit v1.2.3 From b8481369f7209804d70220a29ba2efbd6171d7a9 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 22 Nov 2016 12:15:58 +0100 Subject: Reviewed some lua examples and added new ones --- src/rlua.h | 77 ++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index c801a328..961ed1c1 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -2105,8 +2105,9 @@ int lua_ImageColorBrightness(lua_State* L) int lua_GenTextureMipmaps(lua_State* L) { Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - GenTextureMipmaps(arg1); - return 0; + GenTextureMipmaps(&arg1); + LuaPush_Texture2D(L, arg1); + return 1; } int lua_SetTextureFilter(lua_State* L) @@ -4096,24 +4097,36 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("RIGHT_BUTTON", 1); LuaSetEnum("MIDDLE_BUTTON", 2); LuaEndEnum("MOUSE"); - + LuaStartEnum(); LuaSetEnum("PLAYER1", 0); LuaSetEnum("PLAYER2", 1); LuaSetEnum("PLAYER3", 2); LuaSetEnum("PLAYER4", 3); - LuaSetEnum("PS3_BUTTON_A", 2); - LuaSetEnum("PS3_BUTTON_B", 1); - LuaSetEnum("PS3_BUTTON_X", 3); - LuaSetEnum("PS3_BUTTON_Y", 4); - LuaSetEnum("PS3_BUTTON_R1", 7); - LuaSetEnum("PS3_BUTTON_R2", 5); + LuaSetEnum("PS3_BUTTON_TRIANGLE", 0); + LuaSetEnum("PS3_BUTTON_CIRCLE", 1); + LuaSetEnum("PS3_BUTTON_CROSS", 2); + LuaSetEnum("PS3_BUTTON_SQUARE", 3); LuaSetEnum("PS3_BUTTON_L1", 6); - LuaSetEnum("PS3_BUTTON_L2", 8); + LuaSetEnum("PS3_BUTTON_R1", 7); + LuaSetEnum("PS3_BUTTON_L2", 4); + LuaSetEnum("PS3_BUTTON_R2", 5); + LuaSetEnum("PS3_BUTTON_START", 8); LuaSetEnum("PS3_BUTTON_SELECT", 9); - LuaSetEnum("PS3_BUTTON_START", 10); - + LuaSetEnum("PS3_BUTTON_UP", 24); + LuaSetEnum("PS3_BUTTON_RIGHT", 25); + LuaSetEnum("PS3_BUTTON_DOWN", 26); + LuaSetEnum("PS3_BUTTON_LEFT", 27); + LuaSetEnum("PS3_BUTTON_PS", 12); + LuaSetEnum("PS3_AXIS_LEFT_X", 0); + LuaSetEnum("PS3_AXIS_LEFT_Y", 1); + LuaSetEnum("PS3_AXIS_RIGHT_X", 2); + LuaSetEnum("PS3_AXIS_RIGHT_Y", 5); + LuaSetEnum("PS3_AXIS_L2", 3); // [1..-1] (pressure-level) + LuaSetEnum("PS3_AXIS_R2", 4); // [1..-1] (pressure-level) + +// Xbox360 USB Controller Buttons LuaSetEnum("XBOX_BUTTON_A", 0); LuaSetEnum("XBOX_BUTTON_B", 1); LuaSetEnum("XBOX_BUTTON_X", 2); @@ -4122,25 +4135,26 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("XBOX_BUTTON_RB", 5); LuaSetEnum("XBOX_BUTTON_SELECT", 6); LuaSetEnum("XBOX_BUTTON_START", 7); - -#if defined(PLATFORM_RPI) - LuaSetEnum("XBOX_AXIS_DPAD_X", 7); - LuaSetEnum("XBOX_AXIS_DPAD_Y", 6); - LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); - LuaSetEnum("XBOX_AXIS_LT", 2); - LuaSetEnum("XBOX_AXIS_RT", 5); -#else LuaSetEnum("XBOX_BUTTON_UP", 10); + LuaSetEnum("XBOX_BUTTON_RIGHT", 11); LuaSetEnum("XBOX_BUTTON_DOWN", 12); LuaSetEnum("XBOX_BUTTON_LEFT", 13); - LuaSetEnum("XBOX_BUTTON_RIGHT", 11); - LuaSetEnum("XBOX_AXIS_RIGHT_X", 4); - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); - LuaSetEnum("XBOX_AXIS_LT_RT", 2); + LuaSetEnum("XBOX_BUTTON_HOME", 8); +#if defined(PLATFORM_RPI) + LuaSetEnum("XBOX_AXIS_LEFT_X", 0); // [-1..1] (left->right) + LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); // [-1..1] (up->down) + LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); // [-1..1] (left->right) + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); // [-1..1] (up->down) + LuaSetEnum("XBOX_AXIS_LT", 2); // [-1..1] (pressure-level) + LuaSetEnum("XBOX_AXIS_RT", 5); // [-1..1] (pressure-level) +#else + LuaSetEnum("XBOX_AXIS_LEFT_X", 0); // [-1..1] (left->right) + LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); // [1..-1] (up->down) + LuaSetEnum("XBOX_AXIS_RIGHT_X", 2); // [-1..1] (left->right) + LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); // [1..-1] (up->down) + LuaSetEnum("XBOX_AXIS_LT", 4); // [-1..1] (pressure-level) + LuaSetEnum("XBOX_AXIS_RT", 5); // [-1..1] (pressure-level) #endif - LuaSetEnum("XBOX_AXIS_LEFT_X", 0); - LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); LuaEndEnum("GAMEPAD"); lua_pushglobaltable(L); @@ -4204,6 +4218,15 @@ RLUADEF void InitLuaDevice(void) LuaSetEnum("DIRECTIONAL", LIGHT_DIRECTIONAL); LuaSetEnum("SPOT", LIGHT_SPOT); LuaEndEnum("LightType"); + + LuaStartEnum(); + LuaSetEnum("POINT", FILTER_POINT); + LuaSetEnum("BILINEAR", FILTER_BILINEAR); + LuaSetEnum("TRILINEAR", FILTER_TRILINEAR); + LuaSetEnum("ANISOTROPIC_4X", FILTER_ANISOTROPIC_4X); + LuaSetEnum("ANISOTROPIC_8X", FILTER_ANISOTROPIC_8X); + LuaSetEnum("ANISOTROPIC_16X", FILTER_ANISOTROPIC_16X); + LuaEndEnum("TextureFilter"); LuaStartEnum(); LuaSetEnum("NONE", GESTURE_NONE); -- cgit v1.2.3 From 46ce30a2ebff0ce716adf9e291818d9477cccbbf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 24 Nov 2016 19:02:34 +0100 Subject: Corrected bugs for OpenGL 1.1 backend --- src/rlgl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 629d7967..47e2a57d 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -318,6 +318,7 @@ static bool texCompETC1Supported = false; // ETC1 texture compression support static bool texCompETC2Supported = false; // ETC2/EAC texture compression support static bool texCompPVRTSupported = false; // PVR texture compression support static bool texCompASTCSupported = false; // ASTC texture compression support +#endif // Extension supported flag: Anisotropic filtering static bool texAnisotropicFilterSupported = false; // Anisotropic texture filtering support @@ -325,7 +326,6 @@ static float maxAnisotropicLevel = 0.0f; // Maximum anisotropy level supp // Extension supported flag: Clamp mirror wrap mode static bool texClampMirrorSupported = false; // Clamp mirror wrap mode supported -#endif #if defined(RLGL_OCULUS_SUPPORT) // OVR device variables @@ -1733,7 +1733,7 @@ void rlglGenerateMipmaps(Texture2D *texture) { #if defined(GRAPHICS_API_OPENGL_11) // Compute required mipmaps - void *data = rlglReadTexturePixels(texture); + void *data = rlglReadTexturePixels(*texture); // NOTE: data size is reallocated to fit mipmaps data // NOTE: CPU mipmap generation only supports RGBA 32bit data -- cgit v1.2.3 From f5d792e5514188da56bb35c205e058bca473a300 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 25 Nov 2016 22:26:36 +0100 Subject: Update Lua naming Replaced LUA by Lua --- src/raylib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index d28b07a3..8f69438f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -19,7 +19,7 @@ * Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 * Custom color palette for fancy visuals on raywhite background * Minimal external dependencies (GLFW3, OpenGL, OpenAL) -* Complete binding for LUA [rlua] +* Complete binding for Lua [rlua] * * External libs: * GLFW3 (www.glfw.org) for window/context management and input [core] -- cgit v1.2.3 From 377dcb025fb6957f73263e1913dfc5f29ba21a58 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 5 Dec 2016 01:14:18 +0100 Subject: Corrected some warnings --- src/audio.c | 16 ++++++++------ src/camera.h | 70 ++++++++++++++++++++++++++++++---------------------------- src/core.c | 4 ++-- src/gestures.h | 12 +++++----- src/models.c | 6 +++-- src/raymath.h | 16 +++++++------- src/rlgl.c | 10 ++++++--- src/shapes.c | 15 +++++++------ src/text.c | 33 +++++++++++++-------------- src/textures.c | 25 +++++++++++---------- 10 files changed, 108 insertions(+), 99 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 49aca4b0..eef07154 100644 --- a/src/audio.c +++ b/src/audio.c @@ -411,6 +411,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) else { // Depending on type, skip the right amount of parameters + /* TODO: Review switch (infoHeader.type) { case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters @@ -420,6 +421,7 @@ Sound LoadSoundFromRES(const char *rresName, int resId) case 4: break; // RAW: No parameters default: break; } + */ // Jump DATA to read next infoHeader fseek(rresFile, infoHeader.size, SEEK_CUR); @@ -604,7 +606,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) // Copy a wave to a new wave Wave WaveCopy(Wave wave) { - Wave newWave; + Wave newWave = { 0 }; if (wave.sampleSize == 8) newWave.data = (unsigned char *)malloc(wave.sampleCount*wave.channels*sizeof(unsigned char)); else if (wave.sampleSize == 16) newWave.data = (short *)malloc(wave.sampleCount*wave.channels*sizeof(short)); @@ -822,8 +824,8 @@ void UpdateMusicStream(Music music) if (processed > 0) { bool active = true; - short pcm[AUDIO_BUFFER_SIZE]; - float pcmf[AUDIO_BUFFER_SIZE]; + short pcm[AUDIO_BUFFER_SIZE]; // TODO: Dynamic allocation (uses more than 16KB of stack) + float pcmf[AUDIO_BUFFER_SIZE]; // TODO: Dynamic allocation (uses more than 16KB of stack) int numBuffersToProcess = processed; int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, @@ -952,7 +954,7 @@ float GetMusicTimePlayed(Music music) float secondsPlayed = 0.0f; unsigned int samplesPlayed = music->totalSamples - music->samplesLeft; - secondsPlayed = (float)samplesPlayed/(music->stream.sampleRate*music->stream.channels); + secondsPlayed = (float)(samplesPlayed/(music->stream.sampleRate*music->stream.channels)); return secondsPlayed; } @@ -1004,17 +1006,17 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un { if (stream.sampleSize == 8) { - unsigned char pcm[AUDIO_BUFFER_SIZE] = { 0 }; + unsigned char pcm[AUDIO_BUFFER_SIZE] = { 0 }; // TODO: Dynamic allocation (uses more than 16KB of stack) alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(unsigned char), stream.sampleRate); } else if (stream.sampleSize == 16) { - short pcm[AUDIO_BUFFER_SIZE] = { 0 }; + short pcm[AUDIO_BUFFER_SIZE] = { 0 }; // TODO: Dynamic allocation (uses more than 16KB of stack) alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(short), stream.sampleRate); } else if (stream.sampleSize == 32) { - float pcm[AUDIO_BUFFER_SIZE] = { 0.0f }; + float pcm[AUDIO_BUFFER_SIZE] = { 0.0f }; // TODO: Dynamic allocation (uses more than 16KB of stack) alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(float), stream.sampleRate); } } diff --git a/src/camera.h b/src/camera.h index 33220390..cf542288 100644 --- a/src/camera.h +++ b/src/camera.h @@ -223,15 +223,15 @@ void SetCameraMode(Camera camera, int mode) float dy = v2.y - v1.y; float dz = v2.z - v1.z; - cameraTargetDistance = sqrt(dx*dx + dy*dy + dz*dz); + cameraTargetDistance = sqrtf(dx*dx + dy*dy + dz*dz); Vector2 distance = { 0.0f, 0.0f }; - distance.x = sqrt(dx*dx + dz*dz); - distance.y = sqrt(dx*dx + dy*dy); + distance.x = sqrtf(dx*dx + dz*dz); + distance.y = sqrtf(dx*dx + dy*dy); // Camera angle calculation - cameraAngle.x = asin(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) - cameraAngle.y = -asin(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) + cameraAngle.x = asinf(fabsf(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) + cameraAngle.y = -asinf(fabsf(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) // NOTE: Just testing what cameraAngle means //cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) @@ -285,10 +285,10 @@ void UpdateCamera(Camera *camera) { HideCursor(); - if (mousePosition.x < screenHeight/3) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y }); - else if (mousePosition.y < screenHeight/3) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3 }); - else if (mousePosition.x > (screenWidth - screenHeight/3)) SetMousePosition((Vector2){ screenHeight/3, mousePosition.y }); - else if (mousePosition.y > (screenHeight - screenHeight/3)) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3 }); + if (mousePosition.x < (float)screenHeight/3.0f) SetMousePosition((Vector2){ screenWidth - screenHeight/3, mousePosition.y }); + else if (mousePosition.y < (float)screenHeight/3.0f) SetMousePosition((Vector2){ mousePosition.x, screenHeight - screenHeight/3 }); + else if (mousePosition.x > (screenWidth - (float)screenHeight/3.0f)) SetMousePosition((Vector2){ screenHeight/3, mousePosition.y }); + else if (mousePosition.y > (screenHeight - (float)screenHeight/3.0f)) SetMousePosition((Vector2){ mousePosition.x, screenHeight/3 }); else { mousePositionDelta.x = mousePosition.x - previousMousePosition.x; @@ -321,6 +321,7 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance > CAMERA_FREE_DISTANCE_MAX_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MAX_CLAMP; } // Camera looking down + // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? else if ((camera->position.y > camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; @@ -341,6 +342,7 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance < CAMERA_FREE_DISTANCE_MIN_CLAMP) cameraTargetDistance = CAMERA_FREE_DISTANCE_MIN_CLAMP; } // Camera looking up + // TODO: Review, weird comparisson of cameraTargetDistance == 120.0f? else if ((camera->position.y < camera->target.y) && (cameraTargetDistance == CAMERA_FREE_DISTANCE_MAX_CLAMP) && (mouseWheelMove < 0)) { camera->target.x += mouseWheelMove*(camera->target.x - camera->position.x)*CAMERA_MOUSE_SCROLL_SENSITIVITY/cameraTargetDistance; @@ -385,9 +387,9 @@ void UpdateCamera(Camera *camera) else { // Camera panning - camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); - camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sin(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cos(cameraAngle.x)*sin(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.x += ((mousePositionDelta.x*-CAMERA_FREE_MOUSE_SENSITIVITY)*cosf(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*sinf(cameraAngle.x)*sinf(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.y += ((mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cosf(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); + camera->target.z += ((mousePositionDelta.x*CAMERA_FREE_MOUSE_SENSITIVITY)*sinf(cameraAngle.x) + (mousePositionDelta.y*CAMERA_FREE_MOUSE_SENSITIVITY)*cosf(cameraAngle.x)*sinf(cameraAngle.y))*(cameraTargetDistance/CAMERA_FREE_PANNING_DIVIDER); } } @@ -404,19 +406,19 @@ void UpdateCamera(Camera *camera) case CAMERA_FIRST_PERSON: case CAMERA_THIRD_PERSON: { - camera->position.x += (sin(cameraAngle.x)*direction[MOVE_BACK] - - sin(cameraAngle.x)*direction[MOVE_FRONT] - - cos(cameraAngle.x)*direction[MOVE_LEFT] + - cos(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; + camera->position.x += (sinf(cameraAngle.x)*direction[MOVE_BACK] - + sinf(cameraAngle.x)*direction[MOVE_FRONT] - + cosf(cameraAngle.x)*direction[MOVE_LEFT] + + cosf(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; - camera->position.y += (sin(cameraAngle.y)*direction[MOVE_FRONT] - - sin(cameraAngle.y)*direction[MOVE_BACK] + + camera->position.y += (sinf(cameraAngle.y)*direction[MOVE_FRONT] - + sinf(cameraAngle.y)*direction[MOVE_BACK] + 1.0f*direction[MOVE_UP] - 1.0f*direction[MOVE_DOWN])/PLAYER_MOVEMENT_SENSITIVITY; - camera->position.z += (cos(cameraAngle.x)*direction[MOVE_BACK] - - cos(cameraAngle.x)*direction[MOVE_FRONT] + - sin(cameraAngle.x)*direction[MOVE_LEFT] - - sin(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; + camera->position.z += (cosf(cameraAngle.x)*direction[MOVE_BACK] - + cosf(cameraAngle.x)*direction[MOVE_FRONT] + + sinf(cameraAngle.x)*direction[MOVE_LEFT] - + sinf(cameraAngle.x)*direction[MOVE_RIGHT])/PLAYER_MOVEMENT_SENSITIVITY; bool isMoving = false; // Required for swinging @@ -439,9 +441,9 @@ void UpdateCamera(Camera *camera) if (cameraTargetDistance < CAMERA_THIRD_PERSON_DISTANCE_CLAMP) cameraTargetDistance = CAMERA_THIRD_PERSON_DISTANCE_CLAMP; // Camera is always looking at player - camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cos(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x); + camera->target.x = camera->position.x + CAMERA_THIRD_PERSON_OFFSET.x*cosf(cameraAngle.x) + CAMERA_THIRD_PERSON_OFFSET.z*sinf(cameraAngle.x); camera->target.y = camera->position.y + CAMERA_THIRD_PERSON_OFFSET.y; - camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sin(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sin(cameraAngle.x); + camera->target.z = camera->position.z + CAMERA_THIRD_PERSON_OFFSET.z*sinf(cameraAngle.x) - CAMERA_THIRD_PERSON_OFFSET.x*sinf(cameraAngle.x); } else // CAMERA_FIRST_PERSON { @@ -450,18 +452,18 @@ void UpdateCamera(Camera *camera) else if (cameraAngle.y < CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD) cameraAngle.y = CAMERA_FIRST_PERSON_MAX_CLAMP*DEG2RAD; // Camera is always looking at player - camera->target.x = camera->position.x - sin(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; - camera->target.y = camera->position.y + sin(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; - camera->target.z = camera->position.z - cos(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + camera->target.x = camera->position.x - sinf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + camera->target.y = camera->position.y + sinf(cameraAngle.y)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; + camera->target.z = camera->position.z - cosf(cameraAngle.x)*CAMERA_FIRST_PERSON_FOCUS_DISTANCE; if (isMoving) swingCounter++; // Camera position update // NOTE: On CAMERA_FIRST_PERSON player Y-movement is limited to player 'eyes position' - camera->position.y = playerEyesPosition - sin(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; + camera->position.y = playerEyesPosition - sinf(swingCounter/CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER)/CAMERA_FIRST_PERSON_STEP_DIVIDER; - camera->up.x = sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; - camera->up.z = -sin(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + camera->up.x = sinf(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; + camera->up.z = -sinf(swingCounter/(CAMERA_FIRST_PERSON_STEP_TRIGONOMETRIC_DIVIDER*2))/CAMERA_FIRST_PERSON_WAVING_DIVIDER; } } break; default: break; @@ -473,10 +475,10 @@ void UpdateCamera(Camera *camera) (cameraMode == CAMERA_THIRD_PERSON)) { // TODO: It seems camera->position is not correctly updated or some rounding issue makes the camera move straight to camera->target... - camera->position.x = sin(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.x; - if (cameraAngle.y <= 0.0f) camera->position.y = sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - else camera->position.y = -sin(cameraAngle.y)*cameraTargetDistance*sin(cameraAngle.y) + camera->target.y; - camera->position.z = cos(cameraAngle.x)*cameraTargetDistance*cos(cameraAngle.y) + camera->target.z; + camera->position.x = sinf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.x; + if (cameraAngle.y <= 0.0f) camera->position.y = sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; + else camera->position.y = -sinf(cameraAngle.y)*cameraTargetDistance*sinf(cameraAngle.y) + camera->target.y; + camera->position.z = cosf(cameraAngle.x)*cameraTargetDistance*cosf(cameraAngle.y) + camera->target.z; } } diff --git a/src/core.c b/src/core.c index 241772ec..7fa20979 100644 --- a/src/core.c +++ b/src/core.c @@ -779,7 +779,7 @@ float GetFrameTime(void) // As we are operate quite a lot with frameTime, // it could be no stable, so we round it before passing it around // NOTE: There are still problems with high framerates (>500fps) - double roundedFrameTime = round(frameTime*10000)/10000.0; + double roundedFrameTime = round(frameTime*10000)/10000.0; return (float)roundedFrameTime; // Time in seconds to run a frame } @@ -1089,7 +1089,7 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera) QuaternionTransform(&worldPos, matProj); // Calculate normalized device coordinates (inverted y) - Vector3 ndcPos = { worldPos.x/worldPos.w, -worldPos.y/worldPos.w, worldPos.z/worldPos.z }; + Vector3 ndcPos = { worldPos.x/worldPos.w, -worldPos.y/worldPos.w, worldPos.z/worldPos.w }; // Calculate 2d screen position vector Vector2 screenPosition = { (ndcPos.x + 1.0f)/2.0f*(float)GetScreenWidth(), (ndcPos.y + 1.0f)/2.0f*(float)GetScreenHeight() }; diff --git a/src/gestures.h b/src/gestures.h index 481ef317..19b09269 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -179,7 +179,7 @@ static int tapCounter = 0; // TAP counter (one tap implies // Hold gesture variables static bool resetHold = false; // HOLD reset to get first touch point again -static float timeHold = 0.0f; // HOLD duration in milliseconds +static double timeHold = 0.0f; // HOLD duration in milliseconds // Drag gesture variables static Vector2 dragVector = { 0.0f , 0.0f }; // DRAG vector (between initial and current position) @@ -423,11 +423,11 @@ float GetGestureHoldDuration(void) { // NOTE: time is calculated on current gesture HOLD - float time = 0.0f; + double time = 0.0; - if (currentGesture == GESTURE_HOLD) time = (float)GetCurrentTime() - timeHold; + if (currentGesture == GESTURE_HOLD) time = GetCurrentTime() - timeHold; - return time; + return (float)time; } // Get drag vector (between initial touch point to current) @@ -474,7 +474,7 @@ static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition) { float angle; - angle = atan2(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI); + angle = atan2f(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI); if (angle < 0) angle += 360.0f; @@ -489,7 +489,7 @@ static float Vector2Distance(Vector2 v1, Vector2 v2) float dx = v2.x - v1.x; float dy = v2.y - v1.y; - result = sqrt(dx*dx + dy*dy); + result = (float)sqrt(dx*dx + dy*dy); return result; } diff --git a/src/models.c b/src/models.c index 48f8b813..97c84abc 100644 --- a/src/models.c +++ b/src/models.c @@ -707,6 +707,7 @@ Model LoadModelFromRES(const char *rresName, int resId) else { // Depending on type, skip the right amount of parameters + /* Review switch (infoHeader.type) { case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters @@ -716,6 +717,7 @@ Model LoadModelFromRES(const char *rresName, int resId) case 4: break; // RAW: No parameters default: break; } + */ // Jump DATA to read next infoHeader fseek(rresFile, infoHeader.size, SEEK_CUR); @@ -1517,8 +1519,8 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box) t[3] = (box.max.y - ray.position.y)/ray.direction.y; t[4] = (box.min.z - ray.position.z)/ray.direction.z; t[5] = (box.max.z - ray.position.z)/ray.direction.z; - t[6] = fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5])); - t[7] = fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5])); + t[6] = (float)fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5])); + t[7] = (float)fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5])); collision = !(t[7] < 0 || t[6] > t[7]); diff --git a/src/raymath.h b/src/raymath.h index 10eabb6b..3cd1394e 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -222,16 +222,16 @@ RMDEF Vector3 VectorPerpendicular(Vector3 v) { Vector3 result; - float min = fabs(v.x); + float min = fabsf(v.x); Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f}; - if (fabs(v.y) < min) + if (fabsf(v.y) < min) { - min = fabs(v.y); + min = fabsf(v.y); cardinalAxis = (Vector3){0.0f, 1.0f, 0.0f}; } - if(fabs(v.z) < min) + if(fabsf(v.z) < min) { cardinalAxis = (Vector3){0.0f, 0.0f, 1.0f}; } @@ -256,7 +256,7 @@ RMDEF float VectorLength(const Vector3 v) { float length; - length = sqrt(v.x*v.x + v.y*v.y + v.z*v.z); + length = sqrtf(v.x*v.x + v.y*v.y + v.z*v.z); return length; } @@ -284,7 +284,7 @@ RMDEF void VectorNormalize(Vector3 *v) length = VectorLength(*v); - if (length == 0) length = 1.0f; + if (length == 0.0f) length = 1.0f; ilength = 1.0f/length; @@ -302,7 +302,7 @@ RMDEF float VectorDistance(Vector3 v1, Vector3 v2) float dy = v2.y - v1.y; float dz = v2.z - v1.z; - result = sqrt(dx*dx + dy*dy + dz*dz); + result = sqrtf(dx*dx + dy*dy + dz*dz); return result; } @@ -590,7 +590,7 @@ RMDEF Matrix MatrixRotate(Vector3 axis, float angle) float x = axis.x, y = axis.y, z = axis.z; - float length = sqrt(x*x + y*y + z*z); + float length = sqrtf(x*x + y*y + z*z); if ((length != 1.0f) && (length != 0.0f)) { diff --git a/src/rlgl.c b/src/rlgl.c index 47e2a57d..83cc7050 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -902,6 +902,10 @@ void rlDisableTexture(void) #if defined(GRAPHICS_API_OPENGL_11) glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); +#else + // NOTE: If quads batch limit is reached, + // we force a draw call and next batch starts + if (quads.vCounter/4 >= MAX_QUADS_BATCH) rlglDraw(); #endif } @@ -922,11 +926,11 @@ void rlTextureParameters(unsigned int id, int param, int value) case RL_TEXTURE_MIN_FILTER: glTexParameteri(GL_TEXTURE_2D, param, value); break; case RL_TEXTURE_ANISOTROPIC_FILTER: { - if (value <= maxAnisotropicLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, value); + if (value <= maxAnisotropicLevel) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); else if (maxAnisotropicLevel > 0.0f) { TraceLog(WARNING, "[TEX ID %i] Maximum anisotropic filter level supported is %iX", id, maxAnisotropicLevel); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, value); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)value); } else TraceLog(WARNING, "Anisotropic filtering not supported"); } break; @@ -1776,7 +1780,7 @@ void rlglGenerateMipmaps(Texture2D *texture) #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) - texture->mipmaps = 1 + floor(log2(MAX(texture->width, texture->height))); + texture->mipmaps = 1 + (int)floor(log2(MAX(texture->width, texture->height))); #endif } else TraceLog(WARNING, "[TEX ID %i] Mipmaps can not be generated", texture->id); diff --git a/src/shapes.c b/src/shapes.c index 70aad59a..3d3333c1 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -453,16 +453,17 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) int recCenterX = rec.x + rec.width/2; int recCenterY = rec.y + rec.height/2; - float dx = fabs(center.x - recCenterX); - float dy = fabs(center.y - recCenterY); + float dx = fabsf(center.x - recCenterX); + float dy = fabsf(center.y - recCenterY); - if (dx > (rec.width/2 + radius)) { return false; } - if (dy > (rec.height/2 + radius)) { return false; } + if (dx > ((float)rec.width/2.0f + radius)) { return false; } + if (dy > ((float)rec.height/2.0f + radius)) { return false; } - if (dx <= (rec.width/2)) { return true; } - if (dy <= (rec.height/2)) { return true; } + if (dx <= ((float)rec.width/2.0f)) { return true; } + if (dy <= ((float)rec.height/2.0f)) { return true; } - float cornerDistanceSq = (dx - rec.width/2)*(dx - rec.width/2) + (dy - rec.height/2)*(dy - rec.height/2); + float cornerDistanceSq = (dx - (float)rec.width/2.0f)*(dx - (float)rec.width/2.0f) + + (dy - (float)rec.height/2.0f)*(dy - (float)rec.height/2.0f); return (cornerDistanceSq <= (radius*radius)); } diff --git a/src/text.c b/src/text.c index c394889e..27b0a9ce 100644 --- a/src/text.c +++ b/src/text.c @@ -367,7 +367,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float if ((unsigned char)text[i] == '\n') { // NOTE: Fixed line spacing of 1.5 lines - textOffsetY += ((spriteFont.size + spriteFont.size/2)*scaleFactor); + textOffsetY += (int)((spriteFont.size + spriteFont.size/2)*scaleFactor); textOffsetX = 0; } else @@ -394,8 +394,8 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float spriteFont.charRecs[index].width*scaleFactor, spriteFont.charRecs[index].height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint); - if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (spriteFont.charRecs[index].width*scaleFactor + spacing); - else textOffsetX += (spriteFont.charAdvanceX[index]*scaleFactor + spacing); + if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (int)(spriteFont.charRecs[index].width*scaleFactor + spacing); + else textOffsetX += (int)(spriteFont.charAdvanceX[index]*scaleFactor + spacing); } } } @@ -460,14 +460,14 @@ int MeasureText(const char *text, int fontSize) Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing) { int len = strlen(text); - int tempLen = 0; // Used to count longer text line num chars + int tempLen = 0; // Used to count longer text line num chars int lenCounter = 0; - int textWidth = 0; - int tempTextWidth = 0; // Used to count longer text line width + float textWidth = 0; + float tempTextWidth = 0; // Used to count longer text line width - int textHeight = spriteFont.size; - float scaleFactor = fontSize/spriteFont.size; + float textHeight = (float)spriteFont.size; + float scaleFactor = fontSize/(float)spriteFont.size; for (int i = 0; i < len; i++) { @@ -485,7 +485,7 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i if (tempTextWidth < textWidth) tempTextWidth = textWidth; lenCounter = 0; textWidth = 0; - textHeight += (spriteFont.size + spriteFont.size/2); // NOTE: Fixed line spacing of 1.5 lines + textHeight += ((float)spriteFont.size*1.5f); // NOTE: Fixed line spacing of 1.5 lines } if (tempLen < lenCounter) tempLen = lenCounter; @@ -494,8 +494,8 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i if (tempTextWidth < textWidth) tempTextWidth = textWidth; Vector2 vec; - vec.x = (float)tempTextWidth*scaleFactor + (tempLen - 1)*spacing; // Adds chars spacing to measure - vec.y = (float)textHeight*scaleFactor; + vec.x = tempTextWidth*scaleFactor + (float)((tempLen - 1)*spacing); // Adds chars spacing to measure + vec.y = textHeight*scaleFactor; return vec; } @@ -504,10 +504,8 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i // NOTE: Uses default font void DrawFPS(int posX, int posY) { - char buffer[20]; - // NOTE: We are rendering fps every second for better viewing on high framerates - // TODO: Not working properly on ANDROID and RPI + // TODO: Not working properly on ANDROID and RPI (for high framerates) static float fps = 0.0f; static int counter = 0; @@ -520,12 +518,11 @@ void DrawFPS(int posX, int posY) else { fps = GetFPS(); - refreshRate = fps; + refreshRate = (int)fps; counter = 0; } - - sprintf(buffer, "%2.0f FPS", fps); - DrawText(buffer, posX, posY, 20, LIME); + + DrawText(FormatText("%2.0f FPS", fps), posX, posY, 20, LIME); } //---------------------------------------------------------------------------------- diff --git a/src/textures.c b/src/textures.c index 126adad3..631468f9 100644 --- a/src/textures.c +++ b/src/textures.c @@ -317,6 +317,7 @@ Image LoadImageFromRES(const char *rresName, int resId) else { // Depending on type, skip the right amount of parameters + /* TODO: Review switch (infoHeader.type) { case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters @@ -326,7 +327,7 @@ Image LoadImageFromRES(const char *rresName, int resId) case 4: break; // RAW: No parameters default: break; } - + */ // Jump DATA to read next infoHeader fseek(rresFile, infoHeader.size, SEEK_CUR); } @@ -1100,18 +1101,18 @@ void ImageResizeNN(Image *image,int newWidth,int newHeight) Color *output = (Color *)malloc(newWidth*newHeight*sizeof(Color)); // EDIT: added +1 to account for an early rounding problem - int x_ratio = (int)((image->width<<16)/newWidth) + 1; - int y_ratio = (int)((image->height<<16)/newHeight) + 1; + int xRatio = (int)((image->width << 16)/newWidth) + 1; + int yRatio = (int)((image->height << 16)/newHeight) + 1; int x2, y2; - for (int i = 0; i < newHeight; i++) + for (int y = 0; y < newHeight; y++) { - for (int j = 0; j < newWidth; j++) + for (int x = 0; x < newWidth; x++) { - x2 = ((j*x_ratio) >> 16); - y2 = ((i*y_ratio) >> 16); + x2 = ((x*xRatio) >> 16); + y2 = ((y*yRatio) >> 16); - output[(i*newWidth) + j] = pixels[(y2*image->width) + x2] ; + output[(y*newWidth) + x] = pixels[(y2*image->width) + x2] ; } } @@ -1584,7 +1585,7 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V rlEnableTexture(texture.id); rlPushMatrix(); - rlTranslatef(destRec.x, destRec.y, 0); + rlTranslatef((float)destRec.x, (float)destRec.y, 0); rlRotatef(rotation, 0, 0, 1); rlTranslatef(-origin.x, -origin.y, 0); @@ -1598,15 +1599,15 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V // Bottom-right corner for texture and quad rlTexCoord2f((float)sourceRec.x/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); - rlVertex2f(0.0f, destRec.height); + rlVertex2f(0.0f, (float)destRec.height); // Top-right corner for texture and quad rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)(sourceRec.y + sourceRec.height)/texture.height); - rlVertex2f(destRec.width, destRec.height); + rlVertex2f((float)destRec.width, (float)destRec.height); // Top-left corner for texture and quad rlTexCoord2f((float)(sourceRec.x + sourceRec.width)/texture.width, (float)sourceRec.y/texture.height); - rlVertex2f(destRec.width, 0.0f); + rlVertex2f((float)destRec.width, 0.0f); rlEnd(); rlPopMatrix(); -- cgit v1.2.3 From d5c0f9d3867887f86d754a031c7572ca76dcffd9 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 9 Dec 2016 10:15:44 +0100 Subject: Replaced log2() function by equivalent log2() is not available in some standard C library implementations --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 83cc7050..c694dcdc 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1780,7 +1780,7 @@ void rlglGenerateMipmaps(Texture2D *texture) #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) - texture->mipmaps = 1 + (int)floor(log2(MAX(texture->width, texture->height))); + texture->mipmaps = 1 + (int)floor(log(MAX(texture->width, texture->height))/log(2)); #endif } else TraceLog(WARNING, "[TEX ID %i] Mipmaps can not be generated", texture->id); -- cgit v1.2.3 From 06b8727d70b4eb4ca6d7a295d0702b6f322b89c3 Mon Sep 17 00:00:00 2001 From: Joel Davis Date: Wed, 14 Dec 2016 23:58:15 -0800 Subject: Moved viewport code into SetupViewport so high-DPI fix can be applied to EndTextureMode --- src/core.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 241772ec..40bf3990 100644 --- a/src/core.c +++ b/src/core.c @@ -264,6 +264,7 @@ static void SwapBuffers(void); // Copy back buffer to f static void LogoAnimation(void); // Plays raylib logo appearing animation #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) static void TakeScreenshot(void); // Takes a screenshot and saves it in the same folder as executable +static void SetupViewport(void); #endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -744,8 +745,7 @@ void EndTextureMode(void) rlDisableRenderTexture(); // Disable render target // Set viewport to default framebuffer size (screen size) - // TODO: consider possible viewport offsets - rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + SetupViewport(); rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix rlLoadIdentity(); // Reset current matrix (PROJECTION) @@ -1776,19 +1776,8 @@ static void InitGraphicsDevice(int width, int height) // NOTE: screenWidth and screenHeight not used, just stored as globals rlglInit(screenWidth, screenHeight); -#ifdef __APPLE__ - // Get framebuffer size of current window - // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer - // is automatically reasized to adapt to new DPI. - // When OS does that, it can be detected using GLFW3 callback: glfwSetFramebufferSizeCallback() - int fbWidth, fbHeight; - glfwGetFramebufferSize(window, &fbWidth, &fbHeight); - rlViewport(renderOffsetX/2, renderOffsetY/2, fbWidth - renderOffsetX, fbHeight - renderOffsetY); -#else - // Initialize screen viewport (area of the screen that you will actually draw to) - // NOTE: Viewport must be recalculated if screen is resized - rlViewport(renderOffsetX/2, renderOffsetY/2, renderWidth - renderOffsetX, renderHeight - renderOffsetY); -#endif + // Setup default viewport + SetupViewport(); // Initialize internal projection and modelview matrices // NOTE: Default to orthographic projection mode with top-left corner at (0,0) @@ -1805,6 +1794,23 @@ static void InitGraphicsDevice(int width, int height) #endif } +static void SetupViewport(void) +{ +#ifdef __APPLE__ + // Get framebuffer size of current window + // NOTE: Required to handle HighDPI display correctly on OSX because framebuffer + // is automatically reasized to adapt to new DPI. + // When OS does that, it can be detected using GLFW3 callback: glfwSetFramebufferSizeCallback() + int fbWidth, fbHeight; + glfwGetFramebufferSize(window, &fbWidth, &fbHeight); + rlViewport(renderOffsetX/2, renderOffsetY/2, fbWidth - renderOffsetX, fbHeight - renderOffsetY); +#else + // Initialize screen viewport (area of the screen that you will actually draw to) + // NOTE: Viewport must be recalculated if screen is resized + rlViewport(renderOffsetX/2, renderOffsetY/2, renderWidth - renderOffsetX, renderHeight - renderOffsetY); +#endif +} + // Compute framebuffer size relative to screen size and display size // NOTE: Global variables renderWidth/renderHeight and renderOffsetX/renderOffsetY can be modified static void SetupFramebufferSize(int displayWidth, int displayHeight) -- cgit v1.2.3 From 814507906f56f346d35ca95e7d9888213d3e5974 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 17 Dec 2016 19:05:40 +0100 Subject: Improving rRES custom format support -IN PROGRESS- Start removing old rRES functions. --- src/audio.c | 116 +------------------------------------------------ src/core.c | 7 +-- src/models.c | 85 ------------------------------------ src/raylib.h | 4 -- src/textures.c | 134 ++------------------------------------------------------- src/utils.c | 42 ------------------ 6 files changed, 9 insertions(+), 379 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index eef07154..4435b760 100644 --- a/src/audio.c +++ b/src/audio.c @@ -52,8 +52,7 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() #else #include "raylib.h" - #include "utils.h" // Required for: DecompressData() - // NOTE: Includes Android fopen() function map + #include "utils.h" // Required for: fopen() Android mapping, TraceLog() #endif #include "AL/al.h" // OpenAL basic header @@ -324,119 +323,6 @@ Sound LoadSoundFromWave(Wave wave) return sound; } -// Load sound to memory from rRES file (raylib Resource) -// TODO: Maybe rresName could be directly a char array with all the data? -Sound LoadSoundFromRES(const char *rresName, int resId) -{ - Sound sound = { 0 }; - -#if defined(AUDIO_STANDALONE) - TraceLog(WARNING, "Sound loading from rRES resource file not supported on standalone mode"); -#else - - bool found = false; - - char id[4]; // rRES file identifier - unsigned char version; // rRES file version and subversion - char useless; // rRES header reserved data - short numRes; - - ResInfoHeader infoHeader; - - FILE *rresFile = fopen(rresName, "rb"); - - if (rresFile == NULL) TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); - else - { - // Read rres file (basic file check - id) - fread(&id[0], sizeof(char), 1, rresFile); - fread(&id[1], sizeof(char), 1, rresFile); - fread(&id[2], sizeof(char), 1, rresFile); - fread(&id[3], sizeof(char), 1, rresFile); - fread(&version, sizeof(char), 1, rresFile); - fread(&useless, sizeof(char), 1, rresFile); - - if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) - { - TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); - } - else - { - // Read number of resources embedded - fread(&numRes, sizeof(short), 1, rresFile); - - for (int i = 0; i < numRes; i++) - { - fread(&infoHeader, sizeof(ResInfoHeader), 1, rresFile); - - if (infoHeader.id == resId) - { - found = true; - - // Check data is of valid SOUND type - if (infoHeader.type == 1) // SOUND data type - { - // TODO: Check data compression type - // NOTE: We suppose compression type 2 (DEFLATE - default) - - // Reading SOUND parameters - Wave wave; - short sampleRate, bps; - char channels, reserved; - - fread(&sampleRate, sizeof(short), 1, rresFile); // Sample rate (frequency) - fread(&bps, sizeof(short), 1, rresFile); // Bits per sample - fread(&channels, 1, 1, rresFile); // Channels (1 - mono, 2 - stereo) - fread(&reserved, 1, 1, rresFile); // - - wave.sampleRate = sampleRate; - wave.sampleSize = bps; - wave.channels = (short)channels; - - unsigned char *data = malloc(infoHeader.size); - - fread(data, infoHeader.size, 1, rresFile); - - wave.data = DecompressData(data, infoHeader.size, infoHeader.srcSize); - - free(data); - - sound = LoadSoundFromWave(wave); - - // Sound is loaded, we can unload wave data - UnloadWave(wave); - } - else TraceLog(WARNING, "[%s] Required resource do not seem to be a valid SOUND resource", rresName); - } - else - { - // Depending on type, skip the right amount of parameters - /* TODO: Review - switch (infoHeader.type) - { - case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters - case 1: fseek(rresFile, 6, SEEK_CUR); break; // SOUND: Jump 6 bytes of parameters - case 2: fseek(rresFile, 5, SEEK_CUR); break; // MODEL: Jump 5 bytes of parameters (TODO: Review) - case 3: break; // TEXT: No parameters - case 4: break; // RAW: No parameters - default: break; - } - */ - - // Jump DATA to read next infoHeader - fseek(rresFile, infoHeader.size, SEEK_CUR); - } - } - } - - fclose(rresFile); - } - - if (!found) TraceLog(WARNING, "[%s] Required resource id [%i] could not be found in the raylib resource file", rresName, resId); -#endif - return sound; -} - // Unload Wave data void UnloadWave(Wave wave) { diff --git a/src/core.c b/src/core.c index 455417d2..1e03b757 100644 --- a/src/core.c +++ b/src/core.c @@ -42,13 +42,14 @@ * **********************************************************************************************/ -#include "raylib.h" // raylib main header +#include "raylib.h" + #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 -#include "utils.h" // Includes Android fopen map, InitAssetManager(), TraceLog() +#include "utils.h" // Required for: fopen() Android mapping, TraceLog() #define RAYMATH_IMPLEMENTATION // Use raymath as a header-only library (includes implementation) #define RAYMATH_EXTERN_INLINE // Compile raymath functions as static inline (remember, it's a compiler hint) -#include "raymath.h" // Required for Vector3 and Matrix functions +#include "raymath.h" // Required for: Vector3 and Matrix functions #define GESTURES_IMPLEMENTATION #include "gestures.h" // Gestures detection functionality diff --git a/src/models.c b/src/models.c index 97c84abc..7edf8750 100644 --- a/src/models.c +++ b/src/models.c @@ -648,91 +648,6 @@ Model LoadModelEx(Mesh data, bool dynamic) return model; } -// Load a 3d model from rRES file (raylib Resource) -Model LoadModelFromRES(const char *rresName, int resId) -{ - Model model = { 0 }; - bool found = false; - - char id[4]; // rRES file identifier - unsigned char version; // rRES file version and subversion - char useless; // rRES header reserved data - short numRes; - - ResInfoHeader infoHeader; - - FILE *rresFile = fopen(rresName, "rb"); - - if (rresFile == NULL) - { - TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); - } - else - { - // Read rres file (basic file check - id) - fread(&id[0], sizeof(char), 1, rresFile); - fread(&id[1], sizeof(char), 1, rresFile); - fread(&id[2], sizeof(char), 1, rresFile); - fread(&id[3], sizeof(char), 1, rresFile); - fread(&version, sizeof(char), 1, rresFile); - fread(&useless, sizeof(char), 1, rresFile); - - if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) - { - TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); - } - else - { - // Read number of resources embedded - fread(&numRes, sizeof(short), 1, rresFile); - - for (int i = 0; i < numRes; i++) - { - fread(&infoHeader, sizeof(ResInfoHeader), 1, rresFile); - - if (infoHeader.id == resId) - { - found = true; - - // Check data is of valid MODEL type - if (infoHeader.type == 8) - { - // TODO: Load model data - } - else - { - TraceLog(WARNING, "[%s] Required resource do not seem to be a valid MODEL resource", rresName); - } - } - else - { - // Depending on type, skip the right amount of parameters - /* Review - switch (infoHeader.type) - { - case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters - case 1: fseek(rresFile, 6, SEEK_CUR); break; // SOUND: Jump 6 bytes of parameters - case 2: fseek(rresFile, 5, SEEK_CUR); break; // MODEL: Jump 5 bytes of parameters (TODO: Review) - case 3: break; // TEXT: No parameters - case 4: break; // RAW: No parameters - default: break; - } - */ - - // Jump DATA to read next infoHeader - fseek(rresFile, infoHeader.size, SEEK_CUR); - } - } - } - - fclose(rresFile); - } - - if (!found) TraceLog(WARNING, "[%s] Required resource id [%i] could not be found in the raylib resource file", rresName, resId); - - return model; -} - // Load a heightmap image as a 3d model // NOTE: model map size is defined in generic units Model LoadHeightmap(Image heightmap, Vector3 size) diff --git a/src/raylib.h b/src/raylib.h index 8f69438f..e7d2b74a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -770,10 +770,8 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve RLAPI Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM) RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit) RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file -RLAPI Image LoadImageFromRES(const char *rresName, int resId); // Load an image from rRES file (raylib Resource) RLAPI Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); // Load a texture from raw data into GPU memory -RLAPI Texture2D LoadTextureFromRES(const char *rresName, int resId); // Load an image as texture from rRES file (raylib Resource) RLAPI Texture2D LoadTextureFromImage(Image image); // Load a texture from image data RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) @@ -857,7 +855,6 @@ RLAPI void DrawLight(Light light); //------------------------------------------------------------------------------------ RLAPI Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) RLAPI Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) -RLAPI Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) RLAPI Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model RLAPI Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) RLAPI void UnloadModel(Model model); // Unload 3d model from memory @@ -933,7 +930,6 @@ RLAPI Wave LoadWave(const char *fileName); // Load wa RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) RLAPI Sound LoadSound(const char *fileName); // Load sound to memory RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound diff --git a/src/textures.c b/src/textures.c index 631468f9..92b22317 100644 --- a/src/textures.c +++ b/src/textures.c @@ -37,11 +37,10 @@ #include // Required for: strcmp(), strrchr(), strncmp() #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 3.3 or ES2 - // Required: rlglLoadTexture() rlDeleteTextures(), - // rlglGenerateMipmaps(), some funcs for DrawTexturePro() + // Required for: rlglLoadTexture() rlDeleteTextures(), + // rlglGenerateMipmaps(), some funcs for DrawTexturePro() -#include "utils.h" // rRES data decompression utility function - // NOTE: Includes Android fopen function map +#include "utils.h" // Required for: fopen() Android mapping, TraceLog() // Support only desired texture formats, by default: JPEG, PNG, BMP, TGA //#define STBI_NO_JPEG // Image format .jpg and .jpeg @@ -216,7 +215,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int fread(image.data, size, 1, rawFile); - // TODO: Check if data have been read + // TODO: Check if data has been read image.width = width; image.height = height; @@ -229,119 +228,6 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int return image; } -// Load an image from rRES file (raylib Resource) -// TODO: Review function to support multiple color modes -Image LoadImageFromRES(const char *rresName, int resId) -{ - Image image = { 0 }; - bool found = false; - - char id[4]; // rRES file identifier - unsigned char version; // rRES file version and subversion - char useless; // rRES header reserved data - short numRes; - - ResInfoHeader infoHeader; - - FILE *rresFile = fopen(rresName, "rb"); - - if (rresFile == NULL) - { - TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", rresName); - } - else - { - // Read rres file (basic file check - id) - fread(&id[0], sizeof(char), 1, rresFile); - fread(&id[1], sizeof(char), 1, rresFile); - fread(&id[2], sizeof(char), 1, rresFile); - fread(&id[3], sizeof(char), 1, rresFile); - fread(&version, sizeof(char), 1, rresFile); - fread(&useless, sizeof(char), 1, rresFile); - - if ((id[0] != 'r') && (id[1] != 'R') && (id[2] != 'E') &&(id[3] != 'S')) - { - TraceLog(WARNING, "[%s] This is not a valid raylib resource file", rresName); - } - else - { - // Read number of resources embedded - fread(&numRes, sizeof(short), 1, rresFile); - - for (int i = 0; i < numRes; i++) - { - fread(&infoHeader, sizeof(ResInfoHeader), 1, rresFile); - - if (infoHeader.id == resId) - { - found = true; - - // Check data is of valid IMAGE type - if (infoHeader.type == 0) // IMAGE data type - { - // TODO: Check data compression type - // NOTE: We suppose compression type 2 (DEFLATE - default) - - short imgWidth, imgHeight; - char colorFormat, mipmaps; - - fread(&imgWidth, sizeof(short), 1, rresFile); // Image width - fread(&imgHeight, sizeof(short), 1, rresFile); // Image height - fread(&colorFormat, 1, 1, rresFile); // Image data color format (default: RGBA 32 bit) - fread(&mipmaps, 1, 1, rresFile); // Mipmap images included (default: 0) - - image.width = (int)imgWidth; - image.height = (int)imgHeight; - - unsigned char *compData = malloc(infoHeader.size); - - fread(compData, infoHeader.size, 1, rresFile); - - unsigned char *imgData = DecompressData(compData, infoHeader.size, infoHeader.srcSize); - - // TODO: Review color mode - //image.data = (unsigned char *)malloc(sizeof(unsigned char)*imgWidth*imgHeight*4); - image.data = imgData; - - //free(imgData); - - free(compData); - - TraceLog(INFO, "[%s] Image loaded successfully from resource, size: %ix%i", rresName, image.width, image.height); - } - else - { - TraceLog(WARNING, "[%s] Required resource do not seem to be a valid IMAGE resource", rresName); - } - } - else - { - // Depending on type, skip the right amount of parameters - /* TODO: Review - switch (infoHeader.type) - { - case 0: fseek(rresFile, 6, SEEK_CUR); break; // IMAGE: Jump 6 bytes of parameters - case 1: fseek(rresFile, 6, SEEK_CUR); break; // SOUND: Jump 6 bytes of parameters - case 2: fseek(rresFile, 5, SEEK_CUR); break; // MODEL: Jump 5 bytes of parameters (TODO: Review) - case 3: break; // TEXT: No parameters - case 4: break; // RAW: No parameters - default: break; - } - */ - // Jump DATA to read next infoHeader - fseek(rresFile, infoHeader.size, SEEK_CUR); - } - } - } - - fclose(rresFile); - } - - if (!found) TraceLog(WARNING, "[%s] Required resource id [%i] could not be found in the raylib resource file", rresName, resId); - - return image; -} - // Load an image as texture into GPU memory Texture2D LoadTexture(const char *fileName) { @@ -378,18 +264,6 @@ Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat) return texture; } -// Load an image as texture from rRES file (raylib Resource) -Texture2D LoadTextureFromRES(const char *rresName, int resId) -{ - Texture2D texture; - - Image image = LoadImageFromRES(rresName, resId); - texture = LoadTextureFromImage(image); - UnloadImage(image); - - return texture; -} - // Load a texture from image data // NOTE: image is not unloaded, it must be done manually Texture2D LoadTextureFromImage(Image image) diff --git a/src/utils.c b/src/utils.c index 640c5720..8fedcaad 100644 --- a/src/utils.c +++ b/src/utils.c @@ -49,9 +49,6 @@ #include "external/stb_image_write.h" // Required for: stbi_write_png() #endif -#include "external/tinfl.c" // Required for: tinfl_decompress_mem_to_mem() - // NOTE: DEFLATE algorythm data decompression - #define DO_NOT_TRACE_DEBUG_MSGS // Avoid DEBUG messages tracing //---------------------------------------------------------------------------------- @@ -75,45 +72,6 @@ static int android_close(void *cookie); // Module Functions Definition - Utilities //---------------------------------------------------------------------------------- -// Data decompression function -// NOTE: Allocated data MUST be freed! -unsigned char *DecompressData(const unsigned char *data, unsigned long compSize, int uncompSize) -{ - int tempUncompSize; - unsigned char *pUncomp; - - // Allocate buffer to hold decompressed data - pUncomp = (mz_uint8 *)malloc((size_t)uncompSize); - - // Check correct memory allocation - if (pUncomp == NULL) - { - TraceLog(WARNING, "Out of memory while decompressing data"); - } - else - { - // Decompress data - tempUncompSize = tinfl_decompress_mem_to_mem(pUncomp, (size_t)uncompSize, data, compSize, 1); - - if (tempUncompSize == -1) - { - TraceLog(WARNING, "Data decompression failed"); - free(pUncomp); - } - - if (uncompSize != (int)tempUncompSize) - { - TraceLog(WARNING, "Expected uncompressed size do not match, data may be corrupted"); - TraceLog(WARNING, " -- Expected uncompressed size: %i", uncompSize); - TraceLog(WARNING, " -- Returned uncompressed size: %i", tempUncompSize); - } - - TraceLog(INFO, "Data decompressed successfully from %u bytes to %u bytes", (mz_uint32)compSize, (mz_uint32)tempUncompSize); - } - - return pUncomp; -} - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) // Creates a bitmap (BMP) file from an array of pixel data // NOTE: This function is not explicitly available to raylib users -- cgit v1.2.3 From 4a9b77dd705790ec1c15fb139afdcc7093c8e2ad Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 20 Dec 2016 00:33:45 +0100 Subject: Corrected bug sound playing twice Samples count was not properly calculated on WAV loading --- src/audio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 4435b760..a9c07c39 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1083,11 +1083,13 @@ static Wave LoadWAV(const char *fileName) // Read in the sound data into the soundData variable fread(wave.data, waveData.subChunkSize, 1, wavFile); - // Now we set the variables that we need later - wave.sampleCount = waveData.subChunkSize; + // Store wave parameters wave.sampleRate = waveFormat.sampleRate; wave.sampleSize = waveFormat.bitsPerSample; wave.channels = waveFormat.numChannels; + + // NOTE: subChunkSize comes in bytes, we need to translate it to number of samples + wave.sampleCount = waveData.subChunkSize/(waveFormat.bitsPerSample/8); TraceLog(INFO, "[%s] WAV file loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", fileName, wave.sampleRate, wave.sampleSize, wave.channels); } -- cgit v1.2.3 From c394708c438440db1b756bfe7e86a15341a43cb7 Mon Sep 17 00:00:00 2001 From: Saggi Mizrahi Date: Thu, 22 Dec 2016 03:19:49 +0200 Subject: Change UpdateSound() to accept const void * The function means to accept a const * so let's declare it. Will allow passing const buffers in games. Also constness is next to godliness! Signed-off-by: Saggi Mizrahi --- src/audio.c | 2 +- src/audio.h | 2 +- src/raylib.h | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index a9c07c39..aa89de02 100644 --- a/src/audio.c +++ b/src/audio.c @@ -342,7 +342,7 @@ void UnloadSound(Sound sound) // Update sound buffer with new data // NOTE: data must match sound.format -void UpdateSound(Sound sound, void *data, int numSamples) +void UpdateSound(Sound sound, const void *data, int numSamples) { ALint sampleRate, sampleSize, channels; alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); diff --git a/src/audio.h b/src/audio.h index 2b3c5933..db1bb694 100644 --- a/src/audio.h +++ b/src/audio.h @@ -115,7 +115,7 @@ Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, in Sound LoadSound(const char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) -void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data +void UpdateSound(Sound sound, const void *data, int numSamples); // Update sound buffer with new data void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound diff --git a/src/raylib.h b/src/raylib.h index e7d2b74a..fff0c928 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -549,7 +549,7 @@ typedef enum { // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification -typedef enum { +typedef enum { FILTER_POINT = 0, // No filter, just pixel aproximation FILTER_BILINEAR, // Linear filtering FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) @@ -581,12 +581,12 @@ typedef enum { } Gestures; // Camera system modes -typedef enum { - CAMERA_CUSTOM = 0, - CAMERA_FREE, - CAMERA_ORBITAL, - CAMERA_FIRST_PERSON, - CAMERA_THIRD_PERSON +typedef enum { + CAMERA_CUSTOM = 0, + CAMERA_FREE, + CAMERA_ORBITAL, + CAMERA_FIRST_PERSON, + CAMERA_THIRD_PERSON } CameraMode; // Head Mounted Display devices @@ -930,7 +930,8 @@ RLAPI Wave LoadWave(const char *fileName); // Load wa RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) RLAPI Sound LoadSound(const char *fileName); // Load sound to memory RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data +RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data +RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound -- cgit v1.2.3 From b2d4cd66a72fd765daa64c27f6a8e529d3d18e2d Mon Sep 17 00:00:00 2001 From: Saggi Mizrahi Date: Thu, 22 Dec 2016 03:20:27 +0200 Subject: Fix warnings in lua binding Signed-off-by: Saggi Mizrahi --- src/rlua.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 961ed1c1..10a75e3a 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -133,6 +133,7 @@ RLUADEF void CloseLuaDevice(void); // De-initialize Lua system #define LuaPush_AudioStream(L, aud) LuaPushOpaqueType(L, aud) #define LuaGetArgument_string luaL_checkstring +#define LuaGetArgument_ptr (void *)luaL_checkinteger #define LuaGetArgument_int (int)luaL_checkinteger #define LuaGetArgument_unsigned (unsigned)luaL_checkinteger #define LuaGetArgument_char (char)luaL_checkinteger @@ -1198,7 +1199,7 @@ int lua_GetGamepadName(lua_State* L) // TODO: Return gamepad name id int arg1 = LuaGetArgument_int(L, 1); - char * result = GetGamepadName(arg1); + const char * result = GetGamepadName(arg1); //lua_pushboolean(L, result); return 1; } @@ -2863,7 +2864,7 @@ int lua_LoadWaveEx(lua_State* L) { // TODO: Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); - int arg1 = 0; + float * arg1 = 0; int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); @@ -2904,7 +2905,7 @@ int lua_UpdateSound(lua_State* L) Sound arg1 = LuaGetArgument_Sound(L, 1); const char * arg2 = LuaGetArgument_string(L, 2); - int * arg3 = LuaGetArgument_int(L, 3); + int arg3 = LuaGetArgument_int(L, 3); UpdateSound(arg1, arg2, arg3); return 0; } -- cgit v1.2.3 From 1aa775eca8d5fbacb3d5b19143ca08c6b9eca65d Mon Sep 17 00:00:00 2001 From: Saggi Mizrahi Date: Thu, 22 Dec 2016 03:21:04 +0200 Subject: Fix physac.h building on linux Signed-off-by: Saggi Mizrahi --- src/physac.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/physac.h b/src/physac.h index e807ffa6..d958c701 100644 --- a/src/physac.h +++ b/src/physac.h @@ -239,9 +239,10 @@ PHYSACDEF void ClosePhysics(void); // Functions required to query time on Windows int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount); int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency); -#elif defined(__linux) +#elif defined(__linux) || defined(PLATFORM_WEB) #include // Required for: timespec #include // Required for: clock_gettime() + #include #endif //---------------------------------------------------------------------------------- @@ -266,7 +267,7 @@ PHYSACDEF void ClosePhysics(void); static unsigned int usedMemory = 0; // Total allocated dynamic memory static bool physicsThreadEnabled = false; // Physics thread enabled state static double currentTime = 0; // Current time in milliseconds -#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) +#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(__linux) || defined(PLATFORM_WEB) static double baseTime = 0; // Android and RPI platforms base time #endif static double startTime = 0; // Start time in milliseconds @@ -1942,7 +1943,7 @@ static double GetCurrentTime(void) { double time = 0; - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) + #if defined(_WIN32) unsigned long long int clockFrequency, currentTime; QueryPerformanceFrequency(&clockFrequency); @@ -1951,7 +1952,7 @@ static double GetCurrentTime(void) time = (double)((double)currentTime/clockFrequency)*1000; #endif - #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) + #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(__linux) || defined(PLATFORM_WEB) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); uint64_t temp = (uint64_t)ts.tv_sec*1000000000LLU + (uint64_t)ts.tv_nsec; -- cgit v1.2.3 From 5de597579feff50ab63ba4285984b64473241c46 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 01:58:56 +0100 Subject: Complete review of audio module --- src/audio.c | 375 ++++++++++++++++++++++++++++++------------------------------ src/audio.h | 11 +- 2 files changed, 194 insertions(+), 192 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index aa89de02..04ff90da 100644 --- a/src/audio.c +++ b/src/audio.c @@ -19,6 +19,10 @@ * Module Configuration Flags: * AUDIO_STANDALONE - Use this module as standalone library (independently of raylib) * +* Some design decisions: +* Support only up to two channels: MONO and STEREO (for additional channels, AL_EXT_MCFORMATS) +* Support only the following sample sizes: 8bit PCM and 16bit PCM (for additional size, AL_EXT_FLOAT32) +* * Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * XM audio module support (jar_xm) * MOD audio module support (jar_mod) @@ -57,19 +61,15 @@ #include "AL/al.h" // OpenAL basic header #include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) +//#include "AL/alext.h" // OpenAL extensions header, required for AL_EXT_FLOAT32 and AL_EXT_MCFORMATS + +// OpenAL extension: AL_EXT_FLOAT32 - Support for 32bit float samples +// OpenAL extension: AL_EXT_MCFORMATS - Support for multi-channel formats (Quad, 5.1, 6.1, 7.1) #include // Required for: malloc(), free() #include // Required for: strcmp(), strncmp() #include // Required for: FILE, fopen(), fclose(), fread() -// Tokens defined by OpenAL extension: AL_EXT_float32 -#ifndef AL_FORMAT_MONO_FLOAT32 - #define AL_FORMAT_MONO_FLOAT32 0x10010 -#endif -#ifndef AL_FORMAT_STEREO_FLOAT32 - #define AL_FORMAT_STEREO_FLOAT32 0x10011 -#endif - //#define STB_VORBIS_HEADER_ONLY #include "external/stb_vorbis.h" // OGG loading functions @@ -92,11 +92,11 @@ //---------------------------------------------------------------------------------- #define MAX_STREAM_BUFFERS 2 // Number of buffers for each audio stream -// NOTE: Music buffer size is defined by number of samples, independent of sample size +// NOTE: Music buffer size is defined by number of samples, independent of sample size and channels number // After some math, considering a sampleRate of 48000, a buffer refill rate of 1/60 seconds // and double-buffering system, I concluded that a 4096 samples buffer should be enough // In case of music-stalls, just increase this number -#define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. short: 32Kb) +#define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. 16bit, Mono: 8Kb) //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -211,7 +211,7 @@ bool IsAudioDeviceReady(void) // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- -// Load wave data from file into RAM +// Load wave data from file Wave LoadWave(const char *fileName) { Wave wave = { 0 }; @@ -224,19 +224,18 @@ Wave LoadWave(const char *fileName) return wave; } -// Load wave data from float array data (32bit) -Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels) +// Load wave data from raw array data +Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels) { Wave wave; wave.data = data; wave.sampleCount = sampleCount; wave.sampleRate = sampleRate; - wave.sampleSize = 32; + wave.sampleSize = sampleSize; wave.channels = channels; - // NOTE: Copy wave data to work with, - // user is responsible of input data to free + // NOTE: Copy wave data to work with, user is responsible of input data to free Wave cwave = WaveCopy(wave); WaveFormat(&cwave, sampleRate, sampleSize, channels); @@ -244,7 +243,7 @@ Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, in return cwave; } -// Load sound to memory +// Load sound from file // NOTE: The entire file is loaded to memory to be played (no-streaming) Sound LoadSound(const char *fileName) { @@ -274,7 +273,7 @@ Sound LoadSoundFromWave(Wave wave) { case 8: format = AL_FORMAT_MONO8; break; case 16: format = AL_FORMAT_MONO16; break; - case 32: format = AL_FORMAT_MONO_FLOAT32; break; + case 32: //format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; } } @@ -284,7 +283,7 @@ Sound LoadSoundFromWave(Wave wave) { case 8: format = AL_FORMAT_STEREO8; break; case 16: format = AL_FORMAT_STEREO16; break; - case 32: format = AL_FORMAT_STEREO_FLOAT32; break; + case 32: //format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; } } @@ -305,7 +304,7 @@ Sound LoadSoundFromWave(Wave wave) ALuint buffer; alGenBuffers(1, &buffer); // Generate pointer to buffer - unsigned int dataSize = wave.sampleCount*wave.sampleSize/8; // Size in bytes + unsigned int dataSize = wave.sampleCount*wave.sampleSize/8*wave.channels; // Size in bytes // Upload sound data to buffer alBufferData(buffer, format, wave.data, dataSize, wave.sampleRate); @@ -313,7 +312,7 @@ Sound LoadSoundFromWave(Wave wave) // Attach sound buffer to source alSourcei(source, AL_BUFFER, buffer); - TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound data loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", source, buffer, wave.sampleRate, wave.sampleSize, wave.channels); + TraceLog(INFO, "[SND ID %i][BUFR ID %i] Sound data loaded successfully (%i Hz, %i bit, %s)", source, buffer, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); sound.source = source; sound.buffer = buffer; @@ -323,7 +322,7 @@ Sound LoadSoundFromWave(Wave wave) return sound; } -// Unload Wave data +// Unload wave data void UnloadWave(Wave wave) { free(wave.data); @@ -346,14 +345,14 @@ void UpdateSound(Sound sound, const void *data, int numSamples) { ALint sampleRate, sampleSize, channels; alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); - alGetBufferi(sound.buffer, AL_BITS, &sampleSize); // It could also be retrieved from sound.format - alGetBufferi(sound.buffer, AL_CHANNELS, &channels); // It could also be retrieved from sound.format + alGetBufferi(sound.buffer, AL_BITS, &sampleSize); // It could also be retrieved from sound.format + alGetBufferi(sound.buffer, AL_CHANNELS, &channels); // It could also be retrieved from sound.format TraceLog(DEBUG, "UpdateSound() : AL_FREQUENCY: %i", sampleRate); TraceLog(DEBUG, "UpdateSound() : AL_BITS: %i", sampleSize); TraceLog(DEBUG, "UpdateSound() : AL_CHANNELS: %i", channels); - unsigned int dataSize = numSamples*sampleSize/8; // Size of data in bytes + unsigned int dataSize = numSamples*sampleSize/8*channels; // Size of data in bytes alSourceStop(sound.source); // Stop sound alSourcei(sound.source, AL_BUFFER, 0); // Unbind buffer from sound to update @@ -435,69 +434,86 @@ void SetSoundPitch(Sound sound, float pitch) } // Convert wave data to desired format -// TODO: Consider channels (mono - stereo) void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) { + // Format sample rate + if (wave->sampleRate != sampleRate) wave->sampleRate = sampleRate; + + // Format sample size + // NOTE: Only supported 8 bit <--> 16 bit <--> 32 bit if (wave->sampleSize != sampleSize) { - float *samples = GetWaveData(*wave); //Color *pixels = GetImageData(*image); - - free(wave->data); + void *data = malloc(wave->sampleCount*wave->channels*sampleSize/8); - wave->sampleSize = sampleSize; - - //sample *= 4.0f; // Arbitrary gain to get reasonable output volume... - //if (sample > 1.0f) sample = 1.0f; - //if (sample < -1.0f) sample = -1.0f; - - if (sampleSize == 8) + for (int i = 0; i < wave->sampleCount; i++) { - wave->data = (unsigned char *)malloc(wave->sampleCount*sizeof(unsigned char)); - - for (int i = 0; i < wave->sampleCount; i++) + for (int j = 0; j < wave->channels; j++) { - ((unsigned char *)wave->data)[i] = (unsigned char)((float)samples[i]*127 + 128); + if (sampleSize == 8) + { + if (wave->sampleSize == 16) ((unsigned char *)data)[wave->channels*i + j] = (unsigned char)(((float)(((short *)wave->data)[wave->channels*i + j])/32767.0f)*256); + else if (wave->sampleSize == 32) ((unsigned char *)data)[wave->channels*i + j] = (unsigned char)(((float *)wave->data)[wave->channels*i + j]*127.0f + 127); + } + else if (sampleSize == 16) + { + if (wave->sampleSize == 8) ((short *)data)[wave->channels*i + j] = (short)(((float)(((unsigned char *)wave->data)[wave->channels*i + j] - 127)/256.0f)*32767); + else if (wave->sampleSize == 32) ((short *)data)[wave->channels*i + j] = (short)((((float *)wave->data)[wave->channels*i + j])*32767); + } + else if (sampleSize == 32) + { + if (wave->sampleSize == 8) ((float *)data)[wave->channels*i + j] = (float)(((unsigned char *)wave->data)[wave->channels*i + j] - 127)/256.0f; + else if (wave->sampleSize == 16) ((float *)data)[wave->channels*i + j] = (float)(((short *)wave->data)[wave->channels*i + j])/32767.0f; + } } } - else if (sampleSize == 16) + + wave->sampleSize = sampleSize; + free(wave->data); + wave->data = data; + } + + // Format channels (interlaced mode) + // NOTE: Only supported mono <--> stereo + if (wave->channels != channels) + { + void *data = malloc(wave->sampleCount*channels*wave->sampleSize/8); + + if ((wave->channels == 1) && (channels == 2)) // mono ---> stereo (duplicate mono information) { - wave->data = (short *)malloc(wave->sampleCount*sizeof(short)); - for (int i = 0; i < wave->sampleCount; i++) { - ((short *)wave->data)[i] = (short)((float)samples[i]*32000); // SHRT_MAX = 32767 + for (int j = 0; j < channels; j++) + { + if (wave->sampleSize == 8) ((unsigned char *)data)[channels*i + j] = ((unsigned char *)wave->data)[i]; + else if (wave->sampleSize == 16) ((short *)data)[channels*i + j] = ((short *)wave->data)[i]; + else if (wave->sampleSize == 32) ((float *)data)[channels*i + j] = ((float *)wave->data)[i]; + } } } - else if (sampleSize == 32) + else if ((wave->channels == 2) && (channels == 1)) // stereo ---> mono (mix stereo channels) { - wave->data = (float *)malloc(wave->sampleCount*sizeof(float)); - - for (int i = 0; i < wave->sampleCount; i++) + for (int i = 0, j = 0; i < wave->sampleCount; i++, j += 2) { - ((float *)wave->data)[i] = (float)samples[i]; + if (wave->sampleSize == 8) ((unsigned char *)data)[i] = (((unsigned char *)wave->data)[j] + ((unsigned char *)wave->data)[j + 1])/2; + else if (wave->sampleSize == 16) ((short *)data)[i] = (((short *)wave->data)[j] + ((short *)wave->data)[j + 1])/2; + else if (wave->sampleSize == 32) ((float *)data)[i] = (((float *)wave->data)[j] + ((float *)wave->data)[j + 1])/2.0f; } } - else TraceLog(WARNING, "Wave formatting: Sample size not supported"); - free(samples); - } - - // NOTE: Only supported 1 or 2 channels (mono or stereo) - if ((channels > 0) && (channels < 3) && (wave->channels != channels)) - { - // TODO: Add/remove channels interlaced data if required... + // TODO: Add/remove additional interlaced channels + + wave->channels = channels; + free(wave->data); + wave->data = data; } } // Copy a wave to a new wave Wave WaveCopy(Wave wave) { - Wave newWave = { 0 }; + Wave newWave = { 0 }; - if (wave.sampleSize == 8) newWave.data = (unsigned char *)malloc(wave.sampleCount*wave.channels*sizeof(unsigned char)); - else if (wave.sampleSize == 16) newWave.data = (short *)malloc(wave.sampleCount*wave.channels*sizeof(short)); - else if (wave.sampleSize == 32) newWave.data = (float *)malloc(wave.sampleCount*wave.channels*sizeof(float)); - else TraceLog(WARNING, "Wave sample size not supported for copy"); + newWave.data = malloc(wave.sampleCount*wave.channels*wave.sampleSize/8); if (newWave.data != NULL) { @@ -520,35 +536,32 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) if ((initSample >= 0) && (initSample < finalSample) && (finalSample > 0) && (finalSample < wave->sampleCount)) { - // TODO: Review cropping (it could be simplified...) + int sampleCount = finalSample - initSample; - float *samples = GetWaveData(*wave); - float *cropSamples = (float *)malloc((finalSample - initSample)*sizeof(float)); + void *data = malloc(sampleCount*wave->channels*wave->sampleSize/8); + + memcpy(data, wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->channels*wave->sampleSize/8); - for (int i = initSample; i < finalSample; i++) cropSamples[i] = samples[i]; - free(wave->data); - wave->data = cropSamples; - int sampleSize = wave->sampleSize; - wave->sampleSize = 32; - - WaveFormat(wave, wave->sampleRate, sampleSize, wave->channels); + wave->data = data; } else TraceLog(WARNING, "Wave crop range out of bounds"); } // Get samples data from wave as a floats array // NOTE: Returned sample values are normalized to range [-1..1] -// TODO: Consider multiple channels (mono - stereo) float *GetWaveData(Wave wave) { - float *samples = (float *)malloc(wave.sampleCount*sizeof(float)); + float *samples = (float *)malloc(wave.sampleCount*wave.channels*sizeof(float)); for (int i = 0; i < wave.sampleCount; i++) { - if (wave.sampleSize == 8) samples[i] = (float)(((unsigned char *)wave.data)[i] - 127)/256.0f; - else if (wave.sampleSize == 16) samples[i] = (float)((short *)wave.data)[i]/32767.0f; - else if (wave.sampleSize == 32) samples[i] = ((float *)wave.data)[i]; + for (int j = 0; j < wave.channels; j++) + { + if (wave.sampleSize == 8) samples[wave.channels*i + j] = (float)(((unsigned char *)wave.data)[wave.channels*i + j] - 127)/256.0f; + else if (wave.sampleSize == 16) samples[wave.channels*i + j] = (float)((short *)wave.data)[wave.channels*i + j]/32767.0f; + else if (wave.sampleSize == 32) samples[wave.channels*i + j] = ((float *)wave.data)[wave.channels*i + j]; + } } return samples; @@ -572,11 +585,10 @@ Music LoadMusicStream(const char *fileName) else { stb_vorbis_info info = stb_vorbis_get_info(music->ctxOgg); // Get Ogg file info - //float totalLengthSeconds = stb_vorbis_stream_length_in_seconds(music->ctxOgg); - // TODO: Support 32-bit sampleSize OGGs + // OGG bit rate defaults to 16 bit, it's enough for compressed format music->stream = InitAudioStream(info.sample_rate, 16, info.channels); - music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg)*info.channels; + music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg); music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_OGG; music->loop = true; // We loop by default @@ -584,7 +596,6 @@ Music LoadMusicStream(const char *fileName) TraceLog(DEBUG, "[%s] OGG sample rate: %i", fileName, info.sample_rate); TraceLog(DEBUG, "[%s] OGG channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] OGG memory required: %i", fileName, info.temp_memory_required); - } } else if (strcmp(GetExtension(fileName), "flac") == 0) @@ -614,7 +625,7 @@ Music LoadMusicStream(const char *fileName) jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops // NOTE: Only stereo is supported for XM - music->stream = InitAudioStream(48000, 32, 2); + music->stream = InitAudioStream(48000, 16, 2); music->totalSamples = (unsigned int)jar_xm_get_remaining_samples(music->ctxXm); music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_MODULE_XM; @@ -637,8 +648,8 @@ Music LoadMusicStream(const char *fileName) music->ctxType = MUSIC_MODULE_MOD; music->loop = true; - TraceLog(INFO, "[%s] MOD number of samples: %i", fileName, music->samplesLeft); - TraceLog(INFO, "[%s] MOD track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); + TraceLog(DEBUG, "[%s] MOD number of samples: %i", fileName, music->samplesLeft); + TraceLog(DEBUG, "[%s] MOD track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); } else TraceLog(WARNING, "[%s] MOD file could not be opened", fileName); } @@ -682,7 +693,6 @@ void ResumeMusicStream(Music music) } // Stop music playing (close stream) -// TODO: Restart XM context void StopMusicStream(Music music) { alSourceStop(music->stream.source); @@ -690,7 +700,7 @@ void StopMusicStream(Music music) switch (music->ctxType) { case MUSIC_AUDIO_OGG: stb_vorbis_seek_start(music->ctxOgg); break; - case MUSIC_MODULE_XM: break; + case MUSIC_MODULE_XM: /* TODO: Restart XM context */ break; case MUSIC_MODULE_MOD: jar_mod_seek_start(&music->ctxMod); break; default: break; } @@ -710,70 +720,43 @@ void UpdateMusicStream(Music music) if (processed > 0) { bool active = true; - short pcm[AUDIO_BUFFER_SIZE]; // TODO: Dynamic allocation (uses more than 16KB of stack) - float pcmf[AUDIO_BUFFER_SIZE]; // TODO: Dynamic allocation (uses more than 16KB of stack) - int numBuffersToProcess = processed; + + // NOTE: Using dynamic allocation because it could require more than 16KB + void *pcm = calloc(AUDIO_BUFFER_SIZE*music->stream.channels*music->stream.sampleSize/8, 1); + int numBuffersToProcess = processed; int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, // individual L or R for ogg shorts for (int i = 0; i < numBuffersToProcess; i++) { + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; + else numSamples = music->samplesLeft; + + // TODO: Really don't like ctxType thingy... switch (music->ctxType) { case MUSIC_AUDIO_OGG: { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; - else numSamples = music->samplesLeft; - - // NOTE: Returns the number of samples to process (should be the same as numSamples -> it is) - int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, pcm, numSamples); - - // TODO: Review stereo channels Ogg, not enough samples served! - UpdateAudioStream(music->stream, pcm, numSamplesOgg*music->stream.channels); - music->samplesLeft -= (numSamplesOgg*music->stream.channels); + // NOTE: Returns the number of samples to process (be careful! we ask for number of shorts!) + int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, (short *)pcm, numSamples*music->stream.channels); } break; case MUSIC_AUDIO_FLAC: { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; - else numSamples = music->samplesLeft; - - int pcmi[AUDIO_BUFFER_SIZE]; - - // NOTE: Returns the number of samples to process (should be the same as numSamples) - unsigned int numSamplesFlac = (unsigned int)drflac_read_s32(music->ctxFlac, numSamples, pcmi); + // NOTE: Returns the number of samples to process + unsigned int numSamplesFlac = (unsigned int)drflac_read_s32(music->ctxFlac, numSamples/2, (int *)pcm); - UpdateAudioStream(music->stream, pcmi, numSamplesFlac*music->stream.channels); - music->samplesLeft -= (numSamples*music->stream.channels); - - } break; - case MUSIC_MODULE_XM: - { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; - else numSamples = music->samplesLeft; - - // NOTE: Output buffer is 2*numsamples elements (left and right value for each sample) - jar_xm_generate_samples(music->ctxXm, pcmf, numSamples); - UpdateAudioStream(music->stream, pcmf, numSamples*2); // Using 32bit PCM data - music->samplesLeft -= numSamples; - - //TraceLog(INFO, "Samples left: %i", music->samplesLeft); - - } break; - case MUSIC_MODULE_MOD: - { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE/2) numSamples = AUDIO_BUFFER_SIZE/2; - else numSamples = music->samplesLeft; - - // NOTE: Output buffer size is nbsample*channels (default: 48000Hz, 16bit, Stereo) - jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); - UpdateAudioStream(music->stream, pcm, numSamples*2); - music->samplesLeft -= numSamples; + // TODO: Samples should be provided as 16 bit instead of 32 bit! } break; + case MUSIC_MODULE_XM: jar_xm_generate_samples_16bit(music->ctxXm, pcm, numSamples); break; + case MUSIC_MODULE_MOD: jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); break; default: break; } + + UpdateAudioStream(music->stream, pcm, numSamples); + music->samplesLeft -= numSamples; if (music->samplesLeft <= 0) { @@ -789,7 +772,6 @@ void UpdateMusicStream(Music music) if (!active) { StopMusicStream(music); // Stop music (and reset) - if (music->loop) PlayMusicStream(music); // Play again } else @@ -798,6 +780,8 @@ void UpdateMusicStream(Music music) // just make sure to play again on window restore if (state != AL_PLAYING) PlayMusicStream(music); } + + free(pcm); } } @@ -840,7 +824,7 @@ float GetMusicTimePlayed(Music music) float secondsPlayed = 0.0f; unsigned int samplesPlayed = music->totalSamples - music->samplesLeft; - secondsPlayed = (float)(samplesPlayed/(music->stream.sampleRate*music->stream.channels)); + secondsPlayed = (float)samplesPlayed/music->stream.sampleRate; return secondsPlayed; } @@ -852,30 +836,36 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un stream.sampleRate = sampleRate; stream.sampleSize = sampleSize; - stream.channels = channels; + + // Only mono and stereo channels are supported, more channels require AL_EXT_MCFORMATS extension + if ((channels > 0) && (channels < 3)) stream.channels = channels; + else + { + TraceLog(WARNING, "Init audio stream: Number of channels not supported: %i", channels); + stream.channels = 1; // Fallback to mono channel + } // Setup OpenAL format - if (channels == 1) + if (stream.channels == 1) { switch (sampleSize) { case 8: stream.format = AL_FORMAT_MONO8; break; case 16: stream.format = AL_FORMAT_MONO16; break; - case 32: stream.format = AL_FORMAT_MONO_FLOAT32; break; + case 32: //stream.format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } } - else if (channels == 2) + else if (stream.channels == 2) { switch (sampleSize) { case 8: stream.format = AL_FORMAT_STEREO8; break; case 16: stream.format = AL_FORMAT_STEREO16; break; - case 32: stream.format = AL_FORMAT_STEREO_FLOAT32; break; + case 32: //stream.format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } } - else TraceLog(WARNING, "Init audio stream: Number of channels not supported: %i", channels); // Create an audio source alGenSources(1, &stream.source); @@ -888,28 +878,19 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un alGenBuffers(MAX_STREAM_BUFFERS, stream.buffers); // Initialize buffer with zeros by default + // NOTE: Using dynamic allocation because it requires more than 16KB + void *pcm = calloc(AUDIO_BUFFER_SIZE*stream.sampleSize/8*stream.channels, 1); + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) { - if (stream.sampleSize == 8) - { - unsigned char pcm[AUDIO_BUFFER_SIZE] = { 0 }; // TODO: Dynamic allocation (uses more than 16KB of stack) - alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(unsigned char), stream.sampleRate); - } - else if (stream.sampleSize == 16) - { - short pcm[AUDIO_BUFFER_SIZE] = { 0 }; // TODO: Dynamic allocation (uses more than 16KB of stack) - alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(short), stream.sampleRate); - } - else if (stream.sampleSize == 32) - { - float pcm[AUDIO_BUFFER_SIZE] = { 0.0f }; // TODO: Dynamic allocation (uses more than 16KB of stack) - alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*sizeof(float), stream.sampleRate); - } + alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*stream.sampleSize/8*stream.channels, stream.sampleRate); } + + free(pcm); alSourceQueueBuffers(stream.source, MAX_STREAM_BUFFERS, stream.buffers); - TraceLog(INFO, "[AUD ID %i] Audio stream loaded successfully", stream.source); + TraceLog(INFO, "[AUD ID %i] Audio stream loaded successfully (%i Hz, %i bit, %s)", stream.source, stream.sampleRate, stream.sampleSize, (stream.channels == 1) ? "Mono" : "Stereo"); return stream; } @@ -940,8 +921,8 @@ void CloseAudioStream(AudioStream stream) } // Update audio stream buffers with data -// NOTE: Only one buffer per call -void UpdateAudioStream(AudioStream stream, void *data, int numSamples) +// NOTE: Only updates one buffer per call +void UpdateAudioStream(AudioStream stream, const void *data, int numSamples) { ALuint buffer = 0; alSourceUnqueueBuffers(stream.source, 1, &buffer); @@ -949,10 +930,7 @@ void UpdateAudioStream(AudioStream stream, void *data, int numSamples) // Check if any buffer was available for unqueue if (alGetError() != AL_INVALID_VALUE) { - if (stream.sampleSize == 8) alBufferData(buffer, stream.format, (unsigned char *)data, numSamples*sizeof(unsigned char), stream.sampleRate); - else if (stream.sampleSize == 16) alBufferData(buffer, stream.format, (short *)data, numSamples*sizeof(short), stream.sampleRate); - else if (stream.sampleSize == 32) alBufferData(buffer, stream.format, (float *)data, numSamples*sizeof(float), stream.sampleRate); - + alBufferData(buffer, stream.format, data, numSamples*stream.channels*stream.sampleSize/8, stream.sampleRate); alSourceQueueBuffers(stream.source, 1, &buffer); } } @@ -1007,7 +985,7 @@ static Wave LoadWAV(const char *fileName) char chunkID[4]; int chunkSize; char format[4]; - } RiffHeader; + } WavRiffHeader; typedef struct { char subChunkID[4]; @@ -1018,16 +996,16 @@ static Wave LoadWAV(const char *fileName) int byteRate; short blockAlign; short bitsPerSample; - } WaveFormat; + } WavFormat; typedef struct { char subChunkID[4]; int subChunkSize; - } WaveData; + } WavData; - RiffHeader riffHeader; - WaveFormat waveFormat; - WaveData waveData; + WavRiffHeader wavRiffHeader; + WavFormat wavFormat; + WavData wavData; Wave wave = { 0 }; FILE *wavFile; @@ -1042,56 +1020,70 @@ static Wave LoadWAV(const char *fileName) else { // Read in the first chunk into the struct - fread(&riffHeader, sizeof(RiffHeader), 1, wavFile); + fread(&wavRiffHeader, sizeof(WavRiffHeader), 1, wavFile); // Check for RIFF and WAVE tags - if (strncmp(riffHeader.chunkID, "RIFF", 4) || - strncmp(riffHeader.format, "WAVE", 4)) + if (strncmp(wavRiffHeader.chunkID, "RIFF", 4) || + strncmp(wavRiffHeader.format, "WAVE", 4)) { TraceLog(WARNING, "[%s] Invalid RIFF or WAVE Header", fileName); } else { // Read in the 2nd chunk for the wave info - fread(&waveFormat, sizeof(WaveFormat), 1, wavFile); + fread(&wavFormat, sizeof(WavFormat), 1, wavFile); // Check for fmt tag - if ((waveFormat.subChunkID[0] != 'f') || (waveFormat.subChunkID[1] != 'm') || - (waveFormat.subChunkID[2] != 't') || (waveFormat.subChunkID[3] != ' ')) + if ((wavFormat.subChunkID[0] != 'f') || (wavFormat.subChunkID[1] != 'm') || + (wavFormat.subChunkID[2] != 't') || (wavFormat.subChunkID[3] != ' ')) { TraceLog(WARNING, "[%s] Invalid Wave format", fileName); } else { // Check for extra parameters; - if (waveFormat.subChunkSize > 16) fseek(wavFile, sizeof(short), SEEK_CUR); + if (wavFormat.subChunkSize > 16) fseek(wavFile, sizeof(short), SEEK_CUR); // Read in the the last byte of data before the sound file - fread(&waveData, sizeof(WaveData), 1, wavFile); + fread(&wavData, sizeof(WavData), 1, wavFile); // Check for data tag - if ((waveData.subChunkID[0] != 'd') || (waveData.subChunkID[1] != 'a') || - (waveData.subChunkID[2] != 't') || (waveData.subChunkID[3] != 'a')) + if ((wavData.subChunkID[0] != 'd') || (wavData.subChunkID[1] != 'a') || + (wavData.subChunkID[2] != 't') || (wavData.subChunkID[3] != 'a')) { TraceLog(WARNING, "[%s] Invalid data header", fileName); } else { // Allocate memory for data - wave.data = (unsigned char *)malloc(sizeof(unsigned char)*waveData.subChunkSize); + wave.data = (unsigned char *)malloc(sizeof(unsigned char)*wavData.subChunkSize); // Read in the sound data into the soundData variable - fread(wave.data, waveData.subChunkSize, 1, wavFile); + fread(wave.data, wavData.subChunkSize, 1, wavFile); // Store wave parameters - wave.sampleRate = waveFormat.sampleRate; - wave.sampleSize = waveFormat.bitsPerSample; - wave.channels = waveFormat.numChannels; + wave.sampleRate = wavFormat.sampleRate; + wave.sampleSize = wavFormat.bitsPerSample; + wave.channels = wavFormat.numChannels; + + // NOTE: Only support up to 16 bit sample sizes + if (wave.sampleSize > 16) + { + WaveFormat(&wave, wave.sampleRate, 16, wave.channels); + TraceLog(WARNING, "[%s] WAV sample size (%ibit) not supported, converted to 16bit", fileName, wave.sampleSize); + } + + // NOTE: Only support up to 2 channels (mono, stereo) + if (wave.channels > 2) + { + WaveFormat(&wave, wave.sampleRate, wave.sampleSize, 2); + TraceLog(WARNING, "[%s] WAV channels number (%i) not supported, converted to 2 channels", fileName, wave.channels); + } // NOTE: subChunkSize comes in bytes, we need to translate it to number of samples - wave.sampleCount = waveData.subChunkSize/(waveFormat.bitsPerSample/8); + wave.sampleCount = (wavData.subChunkSize/(wave.sampleSize/8))/wave.channels; - TraceLog(INFO, "[%s] WAV file loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", fileName, wave.sampleRate, wave.sampleSize, wave.channels); + TraceLog(INFO, "[%s] WAV file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); } } } @@ -1137,7 +1129,7 @@ static Wave LoadOGG(const char *fileName) TraceLog(DEBUG, "[%s] Samples obtained: %i", fileName, samplesObtained); - TraceLog(INFO, "[%s] OGG file loaded successfully (SampleRate: %i, SampleSize: %i, Channels: %i)", fileName, wave.sampleRate, wave.sampleSize, wave.channels); + TraceLog(INFO, "[%s] OGG file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); stb_vorbis_close(oggFile); } @@ -1156,9 +1148,20 @@ static Wave LoadFLAC(const char *fileName) wave.data = drflac_open_and_decode_file_s32(fileName, &wave.channels, &wave.sampleRate, &totalSampleCount); wave.sampleCount = (int)totalSampleCount; - wave.sampleSize = 32; + wave.sampleSize = 32; // 32 bit per sample (float) + + // NOTE: By default, dr_flac returns 32bit float samples, needs to be converted to 16bit + WaveFormat(&wave, wave.sampleRate, 16, wave.channels); + + // NOTE: Only support up to 2 channels (mono, stereo) + if (wave.channels > 2) + { + WaveFormat(&wave, wave.sampleRate, wave.sampleSize, 2); + TraceLog(WARNING, "[%s] FLAC channels number (%i) not supported, converted to 2 channels", fileName, wave.channels); + } if (wave.data == NULL) TraceLog(WARNING, "[%s] FLAC data could not be loaded", fileName); + else TraceLog(INFO, "[%s] FLAC file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); return wave; } diff --git a/src/audio.h b/src/audio.h index db1bb694..6f0c235a 100644 --- a/src/audio.h +++ b/src/audio.h @@ -110,12 +110,11 @@ void InitAudioDevice(void); // Initialize au void CloseAudioDevice(void); // Close the audio device and context bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -Wave LoadWave(const char *fileName); // Load wave data from file into RAM -Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) -Sound LoadSound(const char *fileName); // Load sound to memory -Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data -Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) -void UpdateSound(Sound sound, const void *data, int numSamples); // Update sound buffer with new data +Wave LoadWave(const char *fileName); // Load wave data from file +Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data +Sound LoadSound(const char *fileName); // Load sound from file +Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound -- cgit v1.2.3 From d8bf84f118cd311dbbc81e7183f8cd3e8d2d7e27 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 01:59:23 +0100 Subject: Added mesh loading functions --- src/models.c | 74 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 7edf8750..a2043913 100644 --- a/src/models.c +++ b/src/models.c @@ -611,30 +611,57 @@ void DrawLight(Light light) } } -// Load a 3d model (from file) -Model LoadModel(const char *fileName) +// Load mesh from file +Mesh LoadMesh(const char *fileName) { - Model model = { 0 }; + Mesh mesh = { 0 }; - // TODO: Initialize default data for model in case loading fails, maybe a cube? + if (strcmp(GetExtension(fileName), "obj") == 0) mesh = LoadOBJ(fileName); + else TraceLog(WARNING, "[%s] Mesh extension not recognized, it can't be loaded", fileName); - if (strcmp(GetExtension(fileName), "obj") == 0) model.mesh = LoadOBJ(fileName); - else TraceLog(WARNING, "[%s] Model extension not recognized, it can't be loaded", fileName); + if (mesh.vertexCount == 0) TraceLog(WARNING, "Mesh could not be loaded"); + else rlglLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh) + + // TODO: Initialize default mesh data in case loading fails, maybe a cube? - if (model.mesh.vertexCount == 0) TraceLog(WARNING, "Model could not be loaded"); - else - { - rlglLoadMesh(&model.mesh, false); // Upload vertex data to GPU (static model) + return mesh; +} - model.transform = MatrixIdentity(); - model.material = LoadDefaultMaterial(); - } +// Load mesh from vertex data +// NOTE: All vertex data arrays must be same size: numVertex +Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData) +{ + Mesh mesh = { 0 }; + + mesh.vertexCount = numVertex; + mesh.triangleCount = numVertex/3; + mesh.vertices = vData; + mesh.texcoords = vtData; + mesh.texcoords2 = NULL; + mesh.normals = vnData; + mesh.tangents = NULL; + mesh.colors = (unsigned char *)cData; + mesh.indices = NULL; + + rlglLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh) + + return mesh; +} + +// Load model from file +Model LoadModel(const char *fileName) +{ + Model model = { 0 }; + + model.mesh = LoadMesh(fileName); + model.transform = MatrixIdentity(); + model.material = LoadDefaultMaterial(); return model; } -// Load a 3d model (from vertex data) -Model LoadModelEx(Mesh data, bool dynamic) +// Load model from mesh data +Model LoadModelFromMesh(Mesh data, bool dynamic) { Model model = { 0 }; @@ -648,7 +675,7 @@ Model LoadModelEx(Mesh data, bool dynamic) return model; } -// Load a heightmap image as a 3d model +// Load heightmap model from image data // NOTE: model map size is defined in generic units Model LoadHeightmap(Image heightmap, Vector3 size) { @@ -664,7 +691,7 @@ Model LoadHeightmap(Image heightmap, Vector3 size) return model; } -// Load a map image as a 3d model (cubes based) +// Load cubes-based map model from image data Model LoadCubicmap(Image cubicmap) { Model model = { 0 }; @@ -678,15 +705,20 @@ Model LoadCubicmap(Image cubicmap) return model; } + +// Unload mesh from memory (RAM and/or VRAM) +void UnloadMesh(Mesh *mesh) +{ + rlglUnloadMesh(mesh); +} -// Unload 3d model from memory (mesh and material) +// Unload model from memory (RAM and/or VRAM) void UnloadModel(Model model) { - rlglUnloadMesh(&model.mesh); - + UnloadMesh(&model.mesh); UnloadMaterial(model.material); - TraceLog(INFO, "Unloaded model data from RAM and VRAM"); + TraceLog(INFO, "Unloaded model data (mesh and material) from RAM and VRAM"); } // Load material data (from file) -- cgit v1.2.3 From 6d6c542a1dabfddc988c20de669c8a5e4d9b04a0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 02:00:36 +0100 Subject: Review some functions for consistency Removed: LoadTextureEx() Added: LoadImagePro() --- src/textures.c | 239 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 118 insertions(+), 121 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 92b22317..7fd4a3d5 100644 --- a/src/textures.c +++ b/src/textures.c @@ -93,7 +93,7 @@ static Image LoadASTC(const char *fileName); // Load ASTC file // Module Functions Definition //---------------------------------------------------------------------------------- -// Load an image into CPU memory (RAM) +// Load image from file into CPU memory (RAM) Image LoadImage(const char *fileName) { Image image; @@ -142,16 +142,13 @@ Image LoadImage(const char *fileName) else if (strcmp(GetExtension(fileName),"pvr") == 0) image = LoadPVR(fileName); else if (strcmp(GetExtension(fileName),"astc") == 0) image = LoadASTC(fileName); - if (image.data != NULL) - { - TraceLog(INFO, "[%s] Image loaded successfully (%ix%i)", fileName, image.width, image.height); - } - else TraceLog(WARNING, "[%s] Image could not be loaded, file not recognized", fileName); + if (image.data != NULL) TraceLog(INFO, "[%s] Image loaded successfully (%ix%i)", fileName, image.width, image.height); + else TraceLog(WARNING, "[%s] Image could not be loaded", fileName); return image; } -// Load image data from Color array data (RGBA - 32bit) +// Load image from Color array data (RGBA - 32bit) // NOTE: Creates a copy of pixels data array Image LoadImageEx(Color *pixels, int width, int height) { @@ -178,7 +175,22 @@ Image LoadImageEx(Color *pixels, int width, int height) return image; } -// Load an image from RAW file +// Load image from raw data with parameters +// NOTE: This functions does not make a copy of data +Image LoadImagePro(void *data, int width, int height, int format) +{ + Image image; + + image.data = data; + image.width = width; + image.height = height; + image.mipmaps = 1; + image.format = format; + + return image; +} + +// Load an image from RAW file data Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize) { Image image; @@ -228,7 +240,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int return image; } -// Load an image as texture into GPU memory +// Load texture from file into GPU memory (VRAM) Texture2D LoadTexture(const char *fileName) { Texture2D texture; @@ -249,21 +261,6 @@ Texture2D LoadTexture(const char *fileName) return texture; } -// Load a texture from raw data into GPU memory -Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat) -{ - Texture2D texture; - - texture.width = width; - texture.height = height; - texture.mipmaps = 1; - texture.format = textureFormat; - - texture.id = rlglLoadTexture(data, width, height, textureFormat, 1); - - return texture; -} - // Load a texture from image data // NOTE: image is not unloaded, it must be done manually Texture2D LoadTextureFromImage(Image image) @@ -287,7 +284,7 @@ Texture2D LoadTextureFromImage(Image image) return texture; } -// Load a texture to be used for rendering +// Load texture for rendering (framebuffer) RenderTexture2D LoadRenderTexture(int width, int height) { RenderTexture2D target = rlglLoadRenderTexture(width, height); @@ -304,7 +301,7 @@ void UnloadImage(Image image) //TraceLog(INFO, "Unloaded image data"); } -// Unload texture from GPU memory +// Unload texture from GPU memory (VRAM) void UnloadTexture(Texture2D texture) { if (texture.id != 0) @@ -315,102 +312,12 @@ void UnloadTexture(Texture2D texture) } } -// Unload render texture from GPU memory +// Unload render texture from GPU memory (VRAM) void UnloadRenderTexture(RenderTexture2D target) { if (target.id != 0) rlDeleteRenderTextures(target); } -// Set texture scaling filter mode -void SetTextureFilter(Texture2D texture, int filterMode) -{ - switch (filterMode) - { - case FILTER_POINT: - { - if (texture.mipmaps > 1) - { - // RL_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_NEAREST); - - // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); - } - else - { - // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_NEAREST); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); - } - } break; - case FILTER_BILINEAR: - { - if (texture.mipmaps > 1) - { - // RL_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) - // Alternative: RL_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR_MIP_NEAREST); - - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); - } - else - { - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); - } - } break; - case FILTER_TRILINEAR: - { - if (texture.mipmaps > 1) - { - // RL_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); - - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); - } - else - { - TraceLog(WARNING, "[TEX ID %i] No mipmaps available for TRILINEAR texture filtering", texture.id); - - // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps - rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); - rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); - } - } break; - case FILTER_ANISOTROPIC_4X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 4); break; - case FILTER_ANISOTROPIC_8X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 8); break; - case FILTER_ANISOTROPIC_16X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 16); break; - default: break; - } -} - -// Set texture wrapping mode -void SetTextureWrap(Texture2D texture, int wrapMode) -{ - switch (wrapMode) - { - case WRAP_REPEAT: - { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_REPEAT); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_REPEAT); - } break; - case WRAP_CLAMP: - { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP); - } break; - case WRAP_MIRROR: - { - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP_MIRROR); - rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP_MIRROR); - } break; - default: break; - } -} - // Get pixel data from image in the form of Color struct array Color *GetImageData(Image image) { @@ -529,6 +436,13 @@ Image GetTextureData(Texture2D texture) return image; } +// Update GPU texture with new data +// NOTE: pixels data must match texture.format +void UpdateTexture(Texture2D texture, const void *pixels) +{ + rlglUpdateTexture(texture.id, texture.width, texture.height, texture.format, pixels); +} + // Convert image data to desired format void ImageFormat(Image *image, int newFormat) { @@ -1408,11 +1322,94 @@ void GenTextureMipmaps(Texture2D *texture) #endif } -// Update GPU texture with new data -// NOTE: pixels data must match texture.format -void UpdateTexture(Texture2D texture, void *pixels) +// Set texture scaling filter mode +void SetTextureFilter(Texture2D texture, int filterMode) { - rlglUpdateTexture(texture.id, texture.width, texture.height, texture.format, pixels); + switch (filterMode) + { + case FILTER_POINT: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_NEAREST); + + // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + } + else + { + // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_NEAREST); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); + } + } break; + case FILTER_BILINEAR: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) + // Alternative: RL_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR_MIP_NEAREST); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + else + { + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + } break; + case FILTER_TRILINEAR: + { + if (texture.mipmaps > 1) + { + // RL_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + else + { + TraceLog(WARNING, "[TEX ID %i] No mipmaps available for TRILINEAR texture filtering", texture.id); + + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps + rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); + rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); + } + } break; + case FILTER_ANISOTROPIC_4X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 4); break; + case FILTER_ANISOTROPIC_8X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 8); break; + case FILTER_ANISOTROPIC_16X: rlTextureParameters(texture.id, RL_TEXTURE_ANISOTROPIC_FILTER, 16); break; + default: break; + } +} + +// Set texture wrapping mode +void SetTextureWrap(Texture2D texture, int wrapMode) +{ + switch (wrapMode) + { + case WRAP_REPEAT: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_REPEAT); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_REPEAT); + } break; + case WRAP_CLAMP: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP); + } break; + case WRAP_MIRROR: + { + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_S, RL_WRAP_CLAMP_MIRROR); + rlTextureParameters(texture.id, RL_TEXTURE_WRAP_T, RL_WRAP_CLAMP_MIRROR); + } break; + default: break; + } } // Draw a Texture2D -- cgit v1.2.3 From 852f3d4fd0eec8fcebcf39dfc19b2ccc5b008ba3 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 02:01:13 +0100 Subject: Review comments and formatting --- src/core.c | 2 +- src/raylib.h | 110 ++++++++++++++++++++++++++++++++--------------------------- src/rlgl.c | 6 ++-- src/rlgl.h | 2 +- src/text.c | 12 +++---- 5 files changed, 70 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 1e03b757..4793e26a 100644 --- a/src/core.c +++ b/src/core.c @@ -1194,7 +1194,7 @@ const char *GetGamepadName(int gamepad) if (gamepadReady[gamepad]) return glfwGetJoystickName(gamepad); else return NULL; #elif defined(PLATFORM_RPI) - if (gamepadReady[gamepad]) ioctl(gamepadStream[gamepad], JSIOCGNAME(64), &gamepadName); + if (gamepadReady[gamepad]) ioctl(gamepadStream[gamepad], JSIOCGNAME(64), &gamepadName); return gamepadName; #else diff --git a/src/raylib.h b/src/raylib.h index fff0c928..6fd960dc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -351,7 +351,7 @@ typedef struct Image { int width; // Image base width int height; // Image base height int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (TextureFormat) + int format; // Data format (TextureFormat type) } Image; // Texture2D type, bpp always RGBA (32bit) @@ -361,12 +361,12 @@ typedef struct Texture2D { int width; // Texture base width int height; // Texture base height int mipmaps; // Mipmap levels, 1 by default - int format; // Data format (TextureFormat) + int format; // Data format (TextureFormat type) } Texture2D; // RenderTexture2D type, for texture rendering typedef struct RenderTexture2D { - unsigned int id; // Render texture (fbo) id + unsigned int id; // OpenGL Framebuffer Object (FBO) id Texture2D texture; // Color buffer attachment texture Texture2D depth; // Depth buffer attachment texture } RenderTexture2D; @@ -767,19 +767,19 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve //------------------------------------------------------------------------------------ // Texture Loading and Drawing Functions (Module: textures) //------------------------------------------------------------------------------------ -RLAPI Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM) -RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit) -RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file -RLAPI Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory -RLAPI Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat); // Load a texture from raw data into GPU memory -RLAPI Texture2D LoadTextureFromImage(Image image); // Load a texture from image data -RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering +RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit) +RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters +RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) +RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) -RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory -RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory +RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image -RLAPI void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data +RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image @@ -792,7 +792,8 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) -RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) +RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, + float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint @@ -815,9 +816,9 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest // Font Loading and Text Drawing Functions (Module: text) //------------------------------------------------------------------------------------ RLAPI SpriteFont GetDefaultFont(void); // Get the default SpriteFont -RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory -RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load a SpriteFont from TTF font with parameters -RLAPI void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory +RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load SpriteFont from file into GPU memory (VRAM) +RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load SpriteFont from TTF font file with generation parameters +RLAPI void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory (VRAM) RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) RLAPI void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters @@ -853,40 +854,48 @@ RLAPI void DrawLight(Light light); //------------------------------------------------------------------------------------ // Model 3d Loading and Drawing Functions (Module: models) //------------------------------------------------------------------------------------ -RLAPI Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) -RLAPI Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) -RLAPI Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model -RLAPI Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) -RLAPI void UnloadModel(Model model); // Unload 3d model from memory - -RLAPI Material LoadMaterial(const char *fileName); // Load material data (.MTL) -RLAPI Material LoadDefaultMaterial(void); // Load default material (uses default models shader) -RLAPI Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) -RLAPI void UnloadMaterial(Material material); // Unload material textures from VRAM - -RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI Mesh LoadMesh(const char *fileName); // Load mesh from file +RLAPI Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData); // Load mesh from vertex data +RLAPI Model LoadModel(const char *fileName); // Load model from file +RLAPI Model LoadModelFromMesh(Mesh data, bool dynamic); // Load model from mesh data +RLAPI Model LoadHeightmap(Image heightmap, Vector3 size); // Load heightmap model from image data +RLAPI Model LoadCubicmap(Image cubicmap); // Load cubes-based map model from image data +RLAPI void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM) +RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) + +RLAPI Material LoadMaterial(const char *fileName); // Load material from file +RLAPI Material LoadMaterialEx(Shader shader, Texture2D diffuse, Color color); // Load material from basic shading data +RLAPI Material LoadDefaultMaterial(void); // Load default material (uses default models shader) +RLAPI Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) + +RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, + float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters -RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) - -RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec - -RLAPI BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits -RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres -RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes -RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere -RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere -RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection -RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, + float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) + +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, + Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec + +RLAPI BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits +RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere +RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere +RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, + Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point +RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ -RLAPI Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations -RLAPI void UnloadShader(Shader shader); // Unload a custom shader from memory +RLAPI Shader LoadShader(char *vsFileName, char *fsFileName); // Load shader from files and bind default locations +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) RLAPI Shader GetDefaultShader(void); // Get default shader RLAPI Shader GetStandardShader(void); // Get standard shader @@ -926,12 +935,11 @@ RLAPI void InitAudioDevice(void); // Initial RLAPI void CloseAudioDevice(void); // Close the audio device and context RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully -RLAPI Wave LoadWave(const char *fileName); // Load wave data from file into RAM -RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit) -RLAPI Sound LoadSound(const char *fileName); // Load sound to memory -RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data +RLAPI Wave LoadWave(const char *fileName); // Load wave data from file +RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data +RLAPI Sound LoadSound(const char *fileName); // Load sound from file +RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data -RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound @@ -961,7 +969,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) -RLAPI void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int numSamples); // Update audio stream buffers with data RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream diff --git a/src/rlgl.c b/src/rlgl.c index c694dcdc..ae28d9b6 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1690,7 +1690,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) } // Update already loaded texture in GPU with new data -void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data) +void rlglUpdateTexture(unsigned int id, int width, int height, int format, const void *data) { glBindTexture(GL_TEXTURE_2D, id); @@ -2423,7 +2423,7 @@ Texture2D GetDefaultTexture(void) return texture; } -// Load a custom shader and bind default locations +// Load shader from files and bind default locations Shader LoadShader(char *vsFileName, char *fsFileName) { Shader shader = { 0 }; @@ -2455,7 +2455,7 @@ Shader LoadShader(char *vsFileName, char *fsFileName) return shader; } -// Unload a custom shader from memory +// Unload shader from GPU memory (VRAM) void UnloadShader(Shader shader) { if (shader.id != 0) diff --git a/src/rlgl.h b/src/rlgl.h index bc12db0f..b7c9df00 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -370,7 +370,7 @@ void rlglLoadExtensions(void *loader); // Load OpenGL extensions unsigned int rlglLoadTexture(void *data, int width, int height, int textureFormat, int mipmapCount); // Load texture in GPU RenderTexture2D rlglLoadRenderTexture(int width, int height); // Load a texture to be used for rendering (fbo with color and depth attachments) -void rlglUpdateTexture(unsigned int id, int width, int height, int format, void *data); // Update GPU texture with new data +void rlglUpdateTexture(unsigned int id, int width, int height, int format, const void *data); // Update GPU texture with new data void rlglGenerateMipmaps(Texture2D *texture); // Generate mipmap data for selected texture void rlglLoadMesh(Mesh *mesh, bool dynamic); // Upload vertex data into GPU and provided VAO/VBO ids diff --git a/src/text.c b/src/text.c index 27b0a9ce..f97b581d 100644 --- a/src/text.c +++ b/src/text.c @@ -249,7 +249,7 @@ SpriteFont GetDefaultFont() return defaultFont; } -// Load a SpriteFont image into GPU memory +// Load SpriteFont from file into GPU memory (VRAM) SpriteFont LoadSpriteFont(const char *fileName) { // Default hardcoded values for ttf file loading @@ -280,7 +280,7 @@ SpriteFont LoadSpriteFont(const char *fileName) return spriteFont; } -// Load SpriteFont from TTF file with custom parameters +// Load SpriteFont from TTF font file with generation parameters // NOTE: You can pass an array with desired characters, those characters should be available in the font // if array is NULL, default char set is selected 32..126 SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars) @@ -311,7 +311,7 @@ SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, i return spriteFont; } -// Unload SpriteFont from GPU memory +// Unload SpriteFont from GPU memory (VRAM) void UnloadSpriteFont(SpriteFont spriteFont) { // NOTE: Make sure spriteFont is not default font (fallback) @@ -460,13 +460,13 @@ int MeasureText(const char *text, int fontSize) Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, int spacing) { int len = strlen(text); - int tempLen = 0; // Used to count longer text line num chars + int tempLen = 0; // Used to count longer text line num chars int lenCounter = 0; float textWidth = 0; - float tempTextWidth = 0; // Used to count longer text line width + float tempTextWidth = 0; // Used to count longer text line width - float textHeight = (float)spriteFont.size; + float textHeight = (float)spriteFont.size; float scaleFactor = fontSize/(float)spriteFont.size; for (int i = 0; i < len; i++) -- cgit v1.2.3 From 14cdd7fbfff43dbdb869a74dbe846ac38afef532 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 20:41:36 +0100 Subject: Added raw image file reading data check --- src/textures.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 7fd4a3d5..8b223ed0 100644 --- a/src/textures.c +++ b/src/textures.c @@ -225,14 +225,22 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int default: TraceLog(WARNING, "Image format not suported"); break; } - fread(image.data, size, 1, rawFile); + int bytes = fread(image.data, size, 1, rawFile); - // TODO: Check if data has been read - - image.width = width; - image.height = height; - image.mipmaps = 0; - image.format = format; + // Check if data has been read successfully + if (bytes < size) + { + TraceLog(WARNING, "[%s] RAW image data can not be read, wrong requested format or size", fileName); + + if (image.data != NULL) free(image.data); + } + else + { + image.width = width; + image.height = height; + image.mipmaps = 0; + image.format = format; + } fclose(rawFile); } @@ -983,7 +991,7 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) Color srcCol, dstCol; // Blit pixels, copy source image into destination - // TODO: Probably out-of-bounds blitting could be considering here instead of so much cropping... + // TODO: Probably out-of-bounds blitting could be considered here instead of so much cropping... for (int j = dstRec.y; j < (dstRec.y + dstRec.height); j++) { for (int i = dstRec.x; i < (dstRec.x + dstRec.width); i++) -- cgit v1.2.3 From a27be5f2a96810e5dd23cccf52c7a461431ee32c Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 25 Dec 2016 20:42:22 +0100 Subject: Added support for gamepads on PLATFORM_WEB Feature NOT TESTED yet... --- src/core.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 71 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4793e26a..a210df56 100644 --- a/src/core.c +++ b/src/core.c @@ -263,9 +263,9 @@ static bool GetMouseButtonStatus(int button); // Returns if a mouse bu static void PollInputEvents(void); // Register user events static void SwapBuffers(void); // Copy back buffer to front buffers static void LogoAnimation(void); // Plays raylib logo appearing animation +static void SetupViewport(void); // Set viewport parameters #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) static void TakeScreenshot(void); // Takes a screenshot and saves it in the same folder as executable -static void SetupViewport(void); #endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -292,6 +292,7 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) #if defined(PLATFORM_WEB) static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData); static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData); +static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData); #endif #if defined(PLATFORM_RPI) @@ -346,9 +347,9 @@ void InitWindow(int width, int height, const char *title) emscripten_set_touchmove_callback("#canvas", NULL, 1, EmscriptenInputCallback); emscripten_set_touchcancel_callback("#canvas", NULL, 1, EmscriptenInputCallback); - // TODO: Add gamepad support (not provided by GLFW3 on emscripten) - //emscripten_set_gamepadconnected_callback(NULL, 1, EmscriptenInputCallback); - //emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenInputCallback); + // Support gamepad (not provided by GLFW3 on emscripten) + emscripten_set_gamepadconnected_callback(NULL, 1, EmscriptenGamepadCallback); + emscripten_set_gamepaddisconnected_callback(NULL, 1, EmscriptenGamepadCallback); #endif mousePosition.x = (float)screenWidth/2.0f; @@ -1795,6 +1796,7 @@ static void InitGraphicsDevice(int width, int height) #endif } +// Set viewport parameters static void SetupViewport(void) { #ifdef __APPLE__ @@ -1941,7 +1943,7 @@ static bool GetMouseButtonStatus(int button) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetMouseButton(window, button); #elif defined(PLATFORM_ANDROID) - // TODO: Check for virtual mouse + // TODO: Check for virtual mouse? return false; #elif defined(PLATFORM_RPI) // NOTE: Mouse buttons states are filled in PollInputEvents() @@ -1987,8 +1989,6 @@ static void PollInputEvents(void) currentMouseWheelY = 0; #endif -// NOTE: GLFW3 joystick functionality not available in web -// TODO: Support joysticks using emscripten API #if defined(PLATFORM_DESKTOP) // Check if gamepads are ready // NOTE: We do it here in case of disconection @@ -2041,6 +2041,47 @@ static void PollInputEvents(void) glfwPollEvents(); // Register keyboard/mouse events (callbacks)... and window events! #endif +// Gamepad support using emscripten API +// NOTE: GLFW3 joystick functionality not available in web +#if defined(PLATFORM_WEB) + // Get number of gamepads connected + int numGamepads = emscripten_get_num_gamepads(); + + for (int i = 0; (i < numGamepads) && (i < MAX_GAMEPADS); i++) + { + // Register previous gamepad button states + for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; + + EmscriptenGamepadEvent gamepadState; + + int result = emscripten_get_gamepad_status(i, &gamepadState); + + if (result == EMSCRIPTEN_RESULT_SUCCESS) + { + // Register buttons data for every connected gamepad + for (int j = 0; (j < gamepadState.numButtons) && (j < MAX_GAMEPAD_BUTTONS); j++) + { + if (gamepadState.digitalButton[j] == 1) + { + currentGamepadState[i][j] = 1; + lastGamepadButtonPressed = j; + } + else currentGamepadState[i][j] = 0; + + //printf("Gamepad %d, button %d: Digital: %d, Analog: %g\n", gamepadState.index, j, gamepadState.digitalButton[j], gamepadState.analogButton[j]); + } + + // Register axis data for every connected gamepad + for (int j = 0; (j < gamepadState.numAxes) && (j < MAX_GAMEPAD_AXIS); j++) + { + gamepadAxisState[i][j] = gamepadState.axis[j]; + } + + gamepadAxisCount = gamepadState.numAxes; + } + } +#endif + #if defined(PLATFORM_ANDROID) // Register previous keys states // NOTE: Android supports up to 260 keys @@ -2487,6 +2528,8 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event) #endif #if defined(PLATFORM_WEB) + +// Register fullscreen change events static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) { //isFullscreen: int e->isFullscreen @@ -2510,7 +2553,7 @@ static EM_BOOL EmscriptenFullscreenChangeCallback(int eventType, const Emscripte return 0; } -// Web: Get input events +// Register touch input events static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { /* @@ -2574,6 +2617,26 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent return 1; } + +// Register connected/disconnected gamepads events +static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData) +{ + /* + printf("%s: timeStamp: %g, connected: %d, index: %ld, numAxes: %d, numButtons: %d, id: \"%s\", mapping: \"%s\"\n", + eventType != 0 ? emscripten_event_type_to_string(eventType) : "Gamepad state", + gamepadEvent->timestamp, gamepadEvent->connected, gamepadEvent->index, gamepadEvent->numAxes, gamepadEvent->numButtons, gamepadEvent->id, gamepadEvent->mapping); + + for(int i = 0; i < gamepadEvent->numAxes; ++i) printf("Axis %d: %g\n", i, gamepadEvent->axis[i]); + for(int i = 0; i < gamepadEvent->numButtons; ++i) printf("Button %d: Digital: %d, Analog: %g\n", i, gamepadEvent->digitalButton[i], gamepadEvent->analogButton[i]); + */ + + if ((gamepadEvent->connected) && (gamepadEvent->index < MAX_GAMEPADS)) gamepadReady[gamepadEvent->index] = true; + else gamepadReady[gamepadEvent->index] = false; + + // TODO: Test gamepadEvent->index + + return 0; +} #endif #if defined(PLATFORM_RPI) -- cgit v1.2.3 From 5da815234c850dd1f1517e89854bbbed4eeb02e8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 26 Dec 2016 10:52:57 +0100 Subject: Improved FLAC audio support --- src/audio.c | 25 ++-- src/external/dr_flac.h | 323 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 255 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 04ff90da..3a4ca3df 100644 --- a/src/audio.c +++ b/src/audio.c @@ -593,6 +593,7 @@ Music LoadMusicStream(const char *fileName) music->ctxType = MUSIC_AUDIO_OGG; music->loop = true; // We loop by default + TraceLog(DEBUG, "[%s] FLAC total samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] OGG sample rate: %i", fileName, info.sample_rate); TraceLog(DEBUG, "[%s] OGG channels: %i", fileName, info.channels); TraceLog(DEBUG, "[%s] OGG memory required: %i", fileName, info.temp_memory_required); @@ -606,11 +607,12 @@ Music LoadMusicStream(const char *fileName) else { music->stream = InitAudioStream(music->ctxFlac->sampleRate, music->ctxFlac->bitsPerSample, music->ctxFlac->channels); - music->totalSamples = (unsigned int)music->ctxFlac->totalSampleCount; + music->totalSamples = (unsigned int)music->ctxFlac->totalSampleCount/music->ctxFlac->channels; music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_FLAC; music->loop = true; // We loop by default + TraceLog(DEBUG, "[%s] FLAC total samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] FLAC sample rate: %i", fileName, music->ctxFlac->sampleRate); TraceLog(DEBUG, "[%s] FLAC bits per sample: %i", fileName, music->ctxFlac->bitsPerSample); TraceLog(DEBUG, "[%s] FLAC channels: %i", fileName, music->ctxFlac->channels); @@ -745,9 +747,7 @@ void UpdateMusicStream(Music music) case MUSIC_AUDIO_FLAC: { // NOTE: Returns the number of samples to process - unsigned int numSamplesFlac = (unsigned int)drflac_read_s32(music->ctxFlac, numSamples/2, (int *)pcm); - - // TODO: Samples should be provided as 16 bit instead of 32 bit! + unsigned int numSamplesFlac = (unsigned int)drflac_read_s16(music->ctxFlac, numSamples*music->stream.channels, (short *)pcm); } break; case MUSIC_MODULE_XM: jar_xm_generate_samples_16bit(music->ctxXm, pcm, numSamples); break; @@ -1145,21 +1145,14 @@ static Wave LoadFLAC(const char *fileName) // Decode an entire FLAC file in one go uint64_t totalSampleCount; - wave.data = drflac_open_and_decode_file_s32(fileName, &wave.channels, &wave.sampleRate, &totalSampleCount); - - wave.sampleCount = (int)totalSampleCount; - wave.sampleSize = 32; // 32 bit per sample (float) + wave.data = drflac_open_and_decode_file_s16(fileName, &wave.channels, &wave.sampleRate, &totalSampleCount); - // NOTE: By default, dr_flac returns 32bit float samples, needs to be converted to 16bit - WaveFormat(&wave, wave.sampleRate, 16, wave.channels); + wave.sampleCount = (int)totalSampleCount/wave.channels; + wave.sampleSize = 16; // NOTE: Only support up to 2 channels (mono, stereo) - if (wave.channels > 2) - { - WaveFormat(&wave, wave.sampleRate, wave.sampleSize, 2); - TraceLog(WARNING, "[%s] FLAC channels number (%i) not supported, converted to 2 channels", fileName, wave.channels); - } - + if (wave.channels > 2) TraceLog(WARNING, "[%s] FLAC channels number (%i) not supported", fileName, wave.channels); + if (wave.data == NULL) TraceLog(WARNING, "[%s] FLAC data could not be loaded", fileName); else TraceLog(INFO, "[%s] FLAC file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); diff --git a/src/external/dr_flac.h b/src/external/dr_flac.h index d7b66f20..d2bebea5 100644 --- a/src/external/dr_flac.h +++ b/src/external/dr_flac.h @@ -1,5 +1,5 @@ // FLAC audio decoder. Public domain. See "unlicense" statement at the end of this file. -// dr_flac - v0.4 - 2016-09-29 +// dr_flac - v0.4c - 2016-12-26 // // David Reid - mackron@gmail.com @@ -105,18 +105,32 @@ #include #include -#ifndef DR_BOOL_DEFINED -#define DR_BOOL_DEFINED -#ifdef _WIN32 -typedef char drBool8; -typedef int drBool32; +#ifndef DR_SIZED_TYPES_DEFINED +#define DR_SIZED_TYPES_DEFINED +#if defined(_MSC_VER) && _MSC_VER < 1600 +typedef signed char dr_int8; +typedef unsigned char dr_uint8; +typedef signed short dr_int16; +typedef unsigned short dr_uint16; +typedef signed int dr_int32; +typedef unsigned int dr_uint32; +typedef signed __int64 dr_int64; +typedef unsigned __int64 dr_uint64; #else #include -typedef int8_t drBool8; -typedef int32_t drBool32; +typedef int8_t dr_int8; +typedef uint8_t dr_uint8; +typedef int16_t dr_int16; +typedef uint16_t dr_uint16; +typedef int32_t dr_int32; +typedef uint32_t dr_uint32; +typedef int64_t dr_int64; +typedef uint64_t dr_uint64; #endif -#define DR_TRUE 1 -#define DR_FALSE 0 +typedef dr_int8 dr_bool8; +typedef dr_int32 dr_bool32; +#define DR_TRUE 1 +#define DR_FALSE 0 #endif // As data is read from the client it is placed into an internal buffer for fast access. This controls the @@ -262,7 +276,7 @@ typedef struct { char catalog[128]; uint64_t leadInSampleCount; - drBool32 isCD; + dr_bool32 isCD; uint8_t trackCount; const uint8_t* pTrackData; } cuesheet; @@ -305,7 +319,7 @@ typedef size_t (* drflac_read_proc)(void* pUserData, void* pBufferOut, size_t by // // The offset will never be negative. Whether or not it is relative to the beginning or current position is determined // by the "origin" parameter which will be either drflac_seek_origin_start or drflac_seek_origin_current. -typedef drBool32 (* drflac_seek_proc)(void* pUserData, int offset, drflac_seek_origin origin); +typedef dr_bool32 (* drflac_seek_proc)(void* pUserData, int offset, drflac_seek_origin origin); // Callback for when a metadata block is read. // @@ -546,6 +560,10 @@ void drflac_close(drflac* pFlac); // seeked. uint64_t drflac_read_s32(drflac* pFlac, uint64_t samplesToRead, int32_t* pBufferOut); +// Same as drflac_read_s32(), except outputs samples as 16-bit integer PCM rather than 32-bit. Note +// that this is lossey. +uint64_t drflac_read_s16(drflac* pFlac, uint64_t samplesToRead, int16_t* pBufferOut); + // Seeks to the sample at the given index. // // pFlac [in] The decoder. @@ -558,7 +576,7 @@ uint64_t drflac_read_s32(drflac* pFlac, uint64_t samplesToRead, int32_t* pBuffer // // When seeking, you will likely want to ensure it's rounded to a multiple of the channel count. You can do this with // something like drflac_seek_to_sample(pFlac, (mySampleIndex + (mySampleIndex % pFlac->channels))) -drBool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex); +dr_bool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex); @@ -607,14 +625,17 @@ drflac* drflac_open_memory_with_metadata(const void* data, size_t dataSize, drfl // // Do not call this function on a broadcast type of stream (like internet radio streams and whatnot). int32_t* drflac_open_and_decode_s32(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); +int16_t* drflac_open_and_decode_s16(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); #ifndef DR_FLAC_NO_STDIO // Same as drflac_open_and_decode_s32() except opens the decoder from a file. int32_t* drflac_open_and_decode_file_s32(const char* filename, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); +int16_t* drflac_open_and_decode_file_s16(const char* filename, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); #endif // Same as drflac_open_and_decode_s32() except opens the decoder from a block of memory. int32_t* drflac_open_and_decode_memory_s32(const void* data, size_t dataSize, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); +int16_t* drflac_open_and_decode_memory_s16(const void* data, size_t dataSize, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount); // Frees data returned by drflac_open_and_decode_*(). void drflac_free(void* pSampleDataReturnedByOpenAndDecode); @@ -684,7 +705,7 @@ const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, ui //// Endian Management //// -static DRFLAC_INLINE drBool32 drflac__is_little_endian() +static DRFLAC_INLINE dr_bool32 drflac__is_little_endian() { int n = 1; return (*(char*)&n) == 1; @@ -817,7 +838,7 @@ static DRFLAC_INLINE uint32_t drflac__le2host_32(uint32_t n) #define DRFLAC_CACHE_L2_LINE_COUNT(bs) (DRFLAC_CACHE_L2_SIZE_BYTES(bs) / sizeof((bs)->cacheL2[0])) #define DRFLAC_CACHE_L2_LINES_REMAINING(bs) (DRFLAC_CACHE_L2_LINE_COUNT(bs) - (bs)->nextL2Line) -static DRFLAC_INLINE drBool32 drflac__reload_l1_cache_from_l2(drflac_bs* bs) +static DRFLAC_INLINE dr_bool32 drflac__reload_l1_cache_from_l2(drflac_bs* bs) { // Fast path. Try loading straight from L2. if (bs->nextL2Line < DRFLAC_CACHE_L2_LINE_COUNT(bs)) { @@ -871,7 +892,7 @@ static DRFLAC_INLINE drBool32 drflac__reload_l1_cache_from_l2(drflac_bs* bs) } } -static drBool32 drflac__reload_cache(drflac_bs* bs) +static dr_bool32 drflac__reload_cache(drflac_bs* bs) { // Fast path. Try just moving the next value in the L2 cache to the L1 cache. if (drflac__reload_l1_cache_from_l2(bs)) { @@ -907,7 +928,7 @@ static void drflac__reset_cache(drflac_bs* bs) bs->unalignedCache = 0; } -static drBool32 drflac__seek_bits(drflac_bs* bs, size_t bitsToSeek) +static dr_bool32 drflac__seek_bits(drflac_bs* bs, size_t bitsToSeek) { if (bitsToSeek <= DRFLAC_CACHE_L1_BITS_REMAINING(bs)) { bs->consumedBits += bitsToSeek; @@ -958,7 +979,7 @@ static drBool32 drflac__seek_bits(drflac_bs* bs, size_t bitsToSeek) } } -static drBool32 drflac__read_uint32(drflac_bs* bs, unsigned int bitCount, uint32_t* pResultOut) +static dr_bool32 drflac__read_uint32(drflac_bs* bs, unsigned int bitCount, uint32_t* pResultOut) { assert(bs != NULL); assert(pResultOut != NULL); @@ -999,7 +1020,7 @@ static drBool32 drflac__read_uint32(drflac_bs* bs, unsigned int bitCount, uint32 } } -static drBool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, int32_t* pResult) +static dr_bool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, int32_t* pResult) { assert(bs != NULL); assert(pResult != NULL); @@ -1018,7 +1039,7 @@ static drBool32 drflac__read_int32(drflac_bs* bs, unsigned int bitCount, int32_t return DR_TRUE; } -static drBool32 drflac__read_uint64(drflac_bs* bs, unsigned int bitCount, uint64_t* pResultOut) +static dr_bool32 drflac__read_uint64(drflac_bs* bs, unsigned int bitCount, uint64_t* pResultOut) { assert(bitCount <= 64); assert(bitCount > 32); @@ -1039,7 +1060,7 @@ static drBool32 drflac__read_uint64(drflac_bs* bs, unsigned int bitCount, uint64 // Function below is unused, but leaving it here in case I need to quickly add it again. #if 0 -static drBool32 drflac__read_int64(drflac_bs* bs, unsigned int bitCount, int64_t* pResultOut) +static dr_bool32 drflac__read_int64(drflac_bs* bs, unsigned int bitCount, int64_t* pResultOut) { assert(bitCount <= 64); @@ -1056,7 +1077,7 @@ static drBool32 drflac__read_int64(drflac_bs* bs, unsigned int bitCount, int64_t } #endif -static drBool32 drflac__read_uint16(drflac_bs* bs, unsigned int bitCount, uint16_t* pResult) +static dr_bool32 drflac__read_uint16(drflac_bs* bs, unsigned int bitCount, uint16_t* pResult) { assert(bs != NULL); assert(pResult != NULL); @@ -1072,7 +1093,7 @@ static drBool32 drflac__read_uint16(drflac_bs* bs, unsigned int bitCount, uint16 return DR_TRUE; } -static drBool32 drflac__read_int16(drflac_bs* bs, unsigned int bitCount, int16_t* pResult) +static dr_bool32 drflac__read_int16(drflac_bs* bs, unsigned int bitCount, int16_t* pResult) { assert(bs != NULL); assert(pResult != NULL); @@ -1088,7 +1109,7 @@ static drBool32 drflac__read_int16(drflac_bs* bs, unsigned int bitCount, int16_t return DR_TRUE; } -static drBool32 drflac__read_uint8(drflac_bs* bs, unsigned int bitCount, uint8_t* pResult) +static dr_bool32 drflac__read_uint8(drflac_bs* bs, unsigned int bitCount, uint8_t* pResult) { assert(bs != NULL); assert(pResult != NULL); @@ -1104,7 +1125,7 @@ static drBool32 drflac__read_uint8(drflac_bs* bs, unsigned int bitCount, uint8_t return DR_TRUE; } -static drBool32 drflac__read_int8(drflac_bs* bs, unsigned int bitCount, int8_t* pResult) +static dr_bool32 drflac__read_int8(drflac_bs* bs, unsigned int bitCount, int8_t* pResult) { assert(bs != NULL); assert(pResult != NULL); @@ -1121,7 +1142,7 @@ static drBool32 drflac__read_int8(drflac_bs* bs, unsigned int bitCount, int8_t* } -static inline drBool32 drflac__seek_past_next_set_bit(drflac_bs* bs, unsigned int* pOffsetOut) +static inline dr_bool32 drflac__seek_past_next_set_bit(drflac_bs* bs, unsigned int* pOffsetOut) { unsigned int zeroCounter = 0; while (bs->cache == 0) { @@ -1169,7 +1190,7 @@ static inline drBool32 drflac__seek_past_next_set_bit(drflac_bs* bs, unsigned in -static drBool32 drflac__seek_to_byte(drflac_bs* bs, uint64_t offsetFromStart) +static dr_bool32 drflac__seek_to_byte(drflac_bs* bs, uint64_t offsetFromStart) { assert(bs != NULL); assert(offsetFromStart > 0); @@ -1214,7 +1235,7 @@ static drBool32 drflac__seek_to_byte(drflac_bs* bs, uint64_t offsetFromStart) } -static drBool32 drflac__read_utf8_coded_number(drflac_bs* bs, uint64_t* pNumberOut) +static dr_bool32 drflac__read_utf8_coded_number(drflac_bs* bs, uint64_t* pNumberOut) { assert(bs != NULL); assert(pNumberOut != NULL); @@ -1267,7 +1288,7 @@ static drBool32 drflac__read_utf8_coded_number(drflac_bs* bs, uint64_t* pNumberO -static DRFLAC_INLINE drBool32 drflac__read_and_seek_rice(drflac_bs* bs, uint8_t m) +static DRFLAC_INLINE dr_bool32 drflac__read_and_seek_rice(drflac_bs* bs, uint8_t m) { unsigned int unused; if (!drflac__seek_past_next_set_bit(bs, &unused)) { @@ -1520,7 +1541,7 @@ static DRFLAC_INLINE int32_t drflac__calculate_prediction_64(uint32_t order, int // iteration. The prediction is done at the end, and there's an annoying branch I'd like to avoid so the main function is defined // as a #define - sue me! #define DRFLAC__DECODE_SAMPLES_WITH_RESIDULE__RICE__PROC(funcName, predictionFunc) \ -static drBool32 funcName (drflac_bs* bs, uint32_t count, uint8_t riceParam, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) \ +static dr_bool32 funcName (drflac_bs* bs, uint32_t count, uint8_t riceParam, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) \ { \ assert(bs != NULL); \ assert(count > 0); \ @@ -1630,7 +1651,7 @@ DRFLAC__DECODE_SAMPLES_WITH_RESIDULE__RICE__PROC(drflac__decode_samples_with_res // Reads and seeks past a string of residual values as Rice codes. The decoder should be sitting on the first bit of the Rice codes. -static drBool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, uint32_t count, uint8_t riceParam) +static dr_bool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, uint32_t count, uint8_t riceParam) { assert(bs != NULL); assert(count > 0); @@ -1644,7 +1665,7 @@ static drBool32 drflac__read_and_seek_residual__rice(drflac_bs* bs, uint32_t cou return DR_TRUE; } -static drBool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* bs, uint32_t bitsPerSample, uint32_t count, uint8_t unencodedBitsPerSample, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) +static dr_bool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* bs, uint32_t bitsPerSample, uint32_t count, uint8_t unencodedBitsPerSample, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pSamplesOut) { assert(bs != NULL); assert(count > 0); @@ -1671,7 +1692,7 @@ static drBool32 drflac__decode_samples_with_residual__unencoded(drflac_bs* bs, u // Reads and decodes the residual for the sub-frame the decoder is currently sitting on. This function should be called // when the decoder is sitting at the very start of the RESIDUAL block. The first residuals will be ignored. The // and parameters are used to determine how many residual values need to be decoded. -static drBool32 drflac__decode_samples_with_residual(drflac_bs* bs, uint32_t bitsPerSample, uint32_t blockSize, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pDecodedSamples) +static dr_bool32 drflac__decode_samples_with_residual(drflac_bs* bs, uint32_t bitsPerSample, uint32_t blockSize, uint32_t order, int32_t shift, const int16_t* coefficients, int32_t* pDecodedSamples) { assert(bs != NULL); assert(blockSize != 0); @@ -1755,7 +1776,7 @@ static drBool32 drflac__decode_samples_with_residual(drflac_bs* bs, uint32_t bit // Reads and seeks past the residual for the sub-frame the decoder is currently sitting on. This function should be called // when the decoder is sitting at the very start of the RESIDUAL block. The first residuals will be set to 0. The // and parameters are used to determine how many residual values need to be decoded. -static drBool32 drflac__read_and_seek_residual(drflac_bs* bs, uint32_t blockSize, uint32_t order) +static dr_bool32 drflac__read_and_seek_residual(drflac_bs* bs, uint32_t blockSize, uint32_t order) { assert(bs != NULL); assert(blockSize != 0); @@ -1823,7 +1844,7 @@ static drBool32 drflac__read_and_seek_residual(drflac_bs* bs, uint32_t blockSize } -static drBool32 drflac__decode_samples__constant(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) +static dr_bool32 drflac__decode_samples__constant(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) { // Only a single sample needs to be decoded here. int32_t sample; @@ -1840,7 +1861,7 @@ static drBool32 drflac__decode_samples__constant(drflac_bs* bs, uint32_t blockSi return DR_TRUE; } -static drBool32 drflac__decode_samples__verbatim(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) +static dr_bool32 drflac__decode_samples__verbatim(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, int32_t* pDecodedSamples) { for (uint32_t i = 0; i < blockSize; ++i) { int32_t sample; @@ -1854,7 +1875,7 @@ static drBool32 drflac__decode_samples__verbatim(drflac_bs* bs, uint32_t blockSi return DR_TRUE; } -static drBool32 drflac__decode_samples__fixed(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) +static dr_bool32 drflac__decode_samples__fixed(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) { short lpcCoefficientsTable[5][4] = { {0, 0, 0, 0}, @@ -1882,7 +1903,7 @@ static drBool32 drflac__decode_samples__fixed(drflac_bs* bs, uint32_t blockSize, return DR_TRUE; } -static drBool32 drflac__decode_samples__lpc(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) +static dr_bool32 drflac__decode_samples__lpc(drflac_bs* bs, uint32_t blockSize, uint32_t bitsPerSample, uint8_t lpcOrder, int32_t* pDecodedSamples) { // Warm up samples. for (uint8_t i = 0; i < lpcOrder; ++i) { @@ -1925,7 +1946,7 @@ static drBool32 drflac__decode_samples__lpc(drflac_bs* bs, uint32_t blockSize, u } -static drBool32 drflac__read_next_frame_header(drflac_bs* bs, uint8_t streaminfoBitsPerSample, drflac_frame_header* header) +static dr_bool32 drflac__read_next_frame_header(drflac_bs* bs, uint8_t streaminfoBitsPerSample, drflac_frame_header* header) { assert(bs != NULL); assert(header != NULL); @@ -1983,7 +2004,7 @@ static drBool32 drflac__read_next_frame_header(drflac_bs* bs, uint8_t streaminfo } - drBool32 isVariableBlockSize = blockingStrategy == 1; + dr_bool32 isVariableBlockSize = blockingStrategy == 1; if (isVariableBlockSize) { uint64_t sampleNumber; if (!drflac__read_utf8_coded_number(bs, &sampleNumber)) { @@ -2055,7 +2076,7 @@ static drBool32 drflac__read_next_frame_header(drflac_bs* bs, uint8_t streaminfo return DR_TRUE; } -static drBool32 drflac__read_subframe_header(drflac_bs* bs, drflac_subframe* pSubframe) +static dr_bool32 drflac__read_subframe_header(drflac_bs* bs, drflac_subframe* pSubframe) { uint8_t header; if (!drflac__read_uint8(bs, 8, &header)) { @@ -2105,7 +2126,7 @@ static drBool32 drflac__read_subframe_header(drflac_bs* bs, drflac_subframe* pSu return DR_TRUE; } -static drBool32 drflac__decode_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex, int32_t* pDecodedSamplesOut) +static dr_bool32 drflac__decode_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex, int32_t* pDecodedSamplesOut) { assert(bs != NULL); assert(frame != NULL); @@ -2155,7 +2176,7 @@ static drBool32 drflac__decode_subframe(drflac_bs* bs, drflac_frame* frame, int return DR_TRUE; } -static drBool32 drflac__seek_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex) +static dr_bool32 drflac__seek_subframe(drflac_bs* bs, drflac_frame* frame, int subframeIndex) { assert(bs != NULL); assert(frame != NULL); @@ -2249,7 +2270,7 @@ static DRFLAC_INLINE uint8_t drflac__get_channel_count_from_channel_assignment(i return lookup[channelAssignment]; } -static drBool32 drflac__decode_frame(drflac* pFlac) +static dr_bool32 drflac__decode_frame(drflac* pFlac) { // This function should be called while the stream is sitting on the first byte after the frame header. memset(pFlac->currentFrame.subframes, 0, sizeof(pFlac->currentFrame.subframes)); @@ -2273,7 +2294,7 @@ static drBool32 drflac__decode_frame(drflac* pFlac) return DR_TRUE; } -static drBool32 drflac__seek_frame(drflac* pFlac) +static dr_bool32 drflac__seek_frame(drflac* pFlac) { int channelCount = drflac__get_channel_count_from_channel_assignment(pFlac->currentFrame.header.channelAssignment); for (int i = 0; i < channelCount; ++i) @@ -2287,7 +2308,7 @@ static drBool32 drflac__seek_frame(drflac* pFlac) return drflac__seek_bits(&pFlac->bs, (DRFLAC_CACHE_L1_BITS_REMAINING(&pFlac->bs) & 7) + 16); } -static drBool32 drflac__read_and_decode_next_frame(drflac* pFlac) +static dr_bool32 drflac__read_and_decode_next_frame(drflac* pFlac) { assert(pFlac != NULL); @@ -2324,24 +2345,24 @@ static void drflac__get_current_frame_sample_range(drflac* pFlac, uint64_t* pFir } } -static drBool32 drflac__seek_to_first_frame(drflac* pFlac) +static dr_bool32 drflac__seek_to_first_frame(drflac* pFlac) { assert(pFlac != NULL); - drBool32 result = drflac__seek_to_byte(&pFlac->bs, pFlac->firstFramePos); + dr_bool32 result = drflac__seek_to_byte(&pFlac->bs, pFlac->firstFramePos); memset(&pFlac->currentFrame, 0, sizeof(pFlac->currentFrame)); return result; } -static DRFLAC_INLINE drBool32 drflac__seek_to_next_frame(drflac* pFlac) +static DRFLAC_INLINE dr_bool32 drflac__seek_to_next_frame(drflac* pFlac) { // This function should only ever be called while the decoder is sitting on the first byte past the FRAME_HEADER section. assert(pFlac != NULL); return drflac__seek_frame(pFlac); } -static drBool32 drflac__seek_to_frame_containing_sample(drflac* pFlac, uint64_t sampleIndex) +static dr_bool32 drflac__seek_to_frame_containing_sample(drflac* pFlac, uint64_t sampleIndex) { assert(pFlac != NULL); @@ -2372,7 +2393,7 @@ static drBool32 drflac__seek_to_frame_containing_sample(drflac* pFlac, uint64_t return DR_TRUE; } -static drBool32 drflac__seek_to_sample__brute_force(drflac* pFlac, uint64_t sampleIndex) +static dr_bool32 drflac__seek_to_sample__brute_force(drflac* pFlac, uint64_t sampleIndex) { if (!drflac__seek_to_frame_containing_sample(pFlac, sampleIndex)) { return DR_FALSE; @@ -2398,7 +2419,7 @@ static drBool32 drflac__seek_to_sample__brute_force(drflac* pFlac, uint64_t samp } -static drBool32 drflac__seek_to_sample__seek_table(drflac* pFlac, uint64_t sampleIndex) +static dr_bool32 drflac__seek_to_sample__seek_table(drflac* pFlac, uint64_t sampleIndex) { assert(pFlac != NULL); @@ -2508,7 +2529,7 @@ typedef struct uint64_t totalSampleCount; uint16_t maxBlockSize; uint64_t runningFilePos; - drBool32 hasMetadataBlocks; + dr_bool32 hasMetadataBlocks; #ifndef DR_FLAC_NO_OGG uint32_t oggSerial; @@ -2525,7 +2546,7 @@ static DRFLAC_INLINE void drflac__decode_block_header(uint32_t blockHeader, uint *blockSize = (blockHeader & 0xFFFFFF); } -static DRFLAC_INLINE drBool32 drflac__read_and_decode_block_header(drflac_read_proc onRead, void* pUserData, uint8_t* isLastBlock, uint8_t* blockType, uint32_t* blockSize) +static DRFLAC_INLINE dr_bool32 drflac__read_and_decode_block_header(drflac_read_proc onRead, void* pUserData, uint8_t* isLastBlock, uint8_t* blockType, uint32_t* blockSize) { uint32_t blockHeader; if (onRead(pUserData, &blockHeader, 4) != 4) { @@ -2536,7 +2557,7 @@ static DRFLAC_INLINE drBool32 drflac__read_and_decode_block_header(drflac_read_p return DR_TRUE; } -drBool32 drflac__read_streaminfo(drflac_read_proc onRead, void* pUserData, drflac_streaminfo* pStreamInfo) +dr_bool32 drflac__read_streaminfo(drflac_read_proc onRead, void* pUserData, drflac_streaminfo* pStreamInfo) { // min/max block size. uint32_t blockSizes; @@ -2579,7 +2600,7 @@ drBool32 drflac__read_streaminfo(drflac_read_proc onRead, void* pUserData, drfla return DR_TRUE; } -drBool32 drflac__read_and_decode_metadata(drflac* pFlac) +dr_bool32 drflac__read_and_decode_metadata(drflac* pFlac) { assert(pFlac != NULL); @@ -2823,7 +2844,7 @@ drBool32 drflac__read_and_decode_metadata(drflac* pFlac) return DR_TRUE; } -drBool32 drflac__init_private__native(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +dr_bool32 drflac__init_private__native(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) { (void)onSeek; @@ -2869,7 +2890,7 @@ drBool32 drflac__init_private__native(drflac_init_info* pInit, drflac_read_proc } #ifndef DR_FLAC_NO_OGG -static DRFLAC_INLINE drBool32 drflac_ogg__is_capture_pattern(uint8_t pattern[4]) +static DRFLAC_INLINE dr_bool32 drflac_ogg__is_capture_pattern(uint8_t pattern[4]) { return pattern[0] == 'O' && pattern[1] == 'g' && pattern[2] == 'g' && pattern[3] == 'S'; } @@ -2889,7 +2910,7 @@ static DRFLAC_INLINE uint32_t drflac_ogg__get_page_body_size(drflac_ogg_page_hea return pageBodySize; } -drBool32 drflac_ogg__read_page_header_after_capture_pattern(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) +dr_bool32 drflac_ogg__read_page_header_after_capture_pattern(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) { if (onRead(pUserData, &pHeader->structureVersion, 1) != 1 || pHeader->structureVersion != 0) { return DR_FALSE; // Unknown structure version. Possibly corrupt stream. @@ -2920,7 +2941,7 @@ drBool32 drflac_ogg__read_page_header_after_capture_pattern(drflac_read_proc onR return DR_TRUE; } -drBool32 drflac_ogg__read_page_header(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) +dr_bool32 drflac_ogg__read_page_header(drflac_read_proc onRead, void* pUserData, drflac_ogg_page_header* pHeader, uint32_t* pHeaderSize) { uint8_t id[4]; if (onRead(pUserData, id, 4) != 4) { @@ -2961,7 +2982,7 @@ static size_t drflac_oggbs__read_physical(drflac_oggbs* oggbs, void* bufferOut, return bytesActuallyRead; } -static drBool32 drflac_oggbs__seek_physical(drflac_oggbs* oggbs, uint64_t offset, drflac_seek_origin origin) +static dr_bool32 drflac_oggbs__seek_physical(drflac_oggbs* oggbs, uint64_t offset, drflac_seek_origin origin) { if (origin == drflac_seek_origin_start) { @@ -3000,7 +3021,7 @@ static drBool32 drflac_oggbs__seek_physical(drflac_oggbs* oggbs, uint64_t offset } } -static drBool32 drflac_oggbs__goto_next_page(drflac_oggbs* oggbs) +static dr_bool32 drflac_oggbs__goto_next_page(drflac_oggbs* oggbs) { drflac_ogg_page_header header; for (;;) @@ -3049,12 +3070,12 @@ static uint8_t drflac_oggbs__get_current_segment_index(drflac_oggbs* oggbs, uint return iSeg; } -static drBool32 drflac_oggbs__seek_to_next_packet(drflac_oggbs* oggbs) +static dr_bool32 drflac_oggbs__seek_to_next_packet(drflac_oggbs* oggbs) { // The current packet ends when we get to the segment with a lacing value of < 255 which is not at the end of a page. for (;;) // <-- Loop over pages. { - drBool32 atEndOfPage = DR_FALSE; + dr_bool32 atEndOfPage = DR_FALSE; uint8_t bytesRemainingInSeg; uint8_t iFirstSeg = drflac_oggbs__get_current_segment_index(oggbs, &bytesRemainingInSeg); @@ -3099,7 +3120,7 @@ static drBool32 drflac_oggbs__seek_to_next_packet(drflac_oggbs* oggbs) } } -static drBool32 drflac_oggbs__seek_to_next_frame(drflac_oggbs* oggbs) +static dr_bool32 drflac_oggbs__seek_to_next_frame(drflac_oggbs* oggbs) { // The bitstream should be sitting on the first byte just after the header of the frame. @@ -3148,7 +3169,7 @@ static size_t drflac__on_read_ogg(void* pUserData, void* bufferOut, size_t bytes return bytesRead; } -static drBool32 drflac__on_seek_ogg(void* pUserData, int offset, drflac_seek_origin origin) +static dr_bool32 drflac__on_seek_ogg(void* pUserData, int offset, drflac_seek_origin origin) { drflac_oggbs* oggbs = (drflac_oggbs*)pUserData; assert(oggbs != NULL); @@ -3204,7 +3225,7 @@ static drBool32 drflac__on_seek_ogg(void* pUserData, int offset, drflac_seek_ori return DR_TRUE; } -drBool32 drflac_ogg__seek_to_sample(drflac* pFlac, uint64_t sample) +dr_bool32 drflac_ogg__seek_to_sample(drflac* pFlac, uint64_t sample) { drflac_oggbs* oggbs = (drflac_oggbs*)(((int32_t*)pFlac->pExtraData) + pFlac->maxBlockSize*pFlac->channels); @@ -3327,7 +3348,7 @@ drBool32 drflac_ogg__seek_to_sample(drflac* pFlac, uint64_t sample) } -drBool32 drflac__init_private__ogg(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +dr_bool32 drflac__init_private__ogg(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) { // Pre: The bit stream should be sitting just past the 4-byte OggS capture pattern. @@ -3491,7 +3512,7 @@ drBool32 drflac__init_private__ogg(drflac_init_info* pInit, drflac_read_proc onR } #endif -drBool32 drflac__init_private(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) +dr_bool32 drflac__init_private(drflac_init_info* pInit, drflac_read_proc onRead, drflac_seek_proc onSeek, drflac_meta_proc onMeta, void* pUserData, void* pUserDataMD) { if (pInit == NULL || onRead == NULL || onSeek == NULL) { return DR_FALSE; @@ -3610,7 +3631,7 @@ static size_t drflac__on_read_stdio(void* pUserData, void* bufferOut, size_t byt return fread(bufferOut, 1, bytesToRead, (FILE*)pUserData); } -static drBool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) +static dr_bool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) { assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); @@ -3651,7 +3672,7 @@ static size_t drflac__on_read_stdio(void* pUserData, void* bufferOut, size_t byt return (size_t)bytesRead; } -static drBool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) +static dr_bool32 drflac__on_seek_stdio(void* pUserData, int offset, drflac_seek_origin origin) { assert(offset > 0 || (offset == 0 && origin == drflac_seek_origin_start)); @@ -3727,7 +3748,7 @@ static size_t drflac__on_read_memory(void* pUserData, void* bufferOut, size_t by return bytesToRead; } -static drBool32 drflac__on_seek_memory(void* pUserData, int offset, drflac_seek_origin origin) +static dr_bool32 drflac__on_seek_memory(void* pUserData, int offset, drflac_seek_origin origin) { drflac__memory_stream* memoryStream = (drflac__memory_stream*)pUserData; assert(memoryStream != NULL); @@ -4107,7 +4128,32 @@ uint64_t drflac_read_s32(drflac* pFlac, uint64_t samplesToRead, int32_t* bufferO return samplesRead; } -drBool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex) +uint64_t drflac_read_s16(drflac* pFlac, uint64_t samplesToRead, int16_t* pBufferOut) +{ + // This reads samples in 2 passes and can probably be optimized. + uint64_t samplesRead = 0; + + while (samplesToRead > 0) { + int32_t samples32[4096]; + uint64_t samplesJustRead = drflac_read_s32(pFlac, samplesToRead > 4096 ? 4096 : samplesToRead, samples32); + if (samplesJustRead == 0) { + break; // Reached the end. + } + + // s32 -> s16 + for (uint64_t i = 0; i < samplesJustRead; ++i) { + pBufferOut[i] = (int16_t)(samples32[i] >> 16); + } + + samplesRead += samplesJustRead; + samplesToRead -= samplesJustRead; + pBufferOut += samplesJustRead; + } + + return samplesRead; +} + +dr_bool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex) { if (pFlac == NULL) { return DR_FALSE; @@ -4147,7 +4193,7 @@ drBool32 drflac_seek_to_sample(drflac* pFlac, uint64_t sampleIndex) //// High Level APIs //// -int32_t* drflac__full_decode_and_close(drflac* pFlac, unsigned int* channelsOut, unsigned int* sampleRateOut, uint64_t* totalSampleCountOut) +int32_t* drflac__full_decode_and_close_s32(drflac* pFlac, unsigned int* channelsOut, unsigned int* sampleRateOut, uint64_t* totalSampleCountOut) { assert(pFlac != NULL); @@ -4218,6 +4264,77 @@ on_error: return NULL; } +int16_t* drflac__full_decode_and_close_s16(drflac* pFlac, unsigned int* channelsOut, unsigned int* sampleRateOut, uint64_t* totalSampleCountOut) +{ + assert(pFlac != NULL); + + int16_t* pSampleData = NULL; + uint64_t totalSampleCount = pFlac->totalSampleCount; + + if (totalSampleCount == 0) + { + int16_t buffer[4096]; + + size_t sampleDataBufferSize = sizeof(buffer); + pSampleData = (int16_t*)malloc(sampleDataBufferSize); + if (pSampleData == NULL) { + goto on_error; + } + + uint64_t samplesRead; + while ((samplesRead = (uint64_t)drflac_read_s16(pFlac, sizeof(buffer)/sizeof(buffer[0]), buffer)) > 0) + { + if (((totalSampleCount + samplesRead) * sizeof(int16_t)) > sampleDataBufferSize) { + sampleDataBufferSize *= 2; + int16_t* pNewSampleData = (int16_t*)realloc(pSampleData, sampleDataBufferSize); + if (pNewSampleData == NULL) { + free(pSampleData); + goto on_error; + } + + pSampleData = pNewSampleData; + } + + memcpy(pSampleData + totalSampleCount, buffer, (size_t)(samplesRead*sizeof(int16_t))); + totalSampleCount += samplesRead; + } + + // At this point everything should be decoded, but we just want to fill the unused part buffer with silence - need to + // protect those ears from random noise! + memset(pSampleData + totalSampleCount, 0, (size_t)(sampleDataBufferSize - totalSampleCount*sizeof(int16_t))); + } + else + { + uint64_t dataSize = totalSampleCount * sizeof(int16_t); + if (dataSize > SIZE_MAX) { + goto on_error; // The decoded data is too big. + } + + pSampleData = (int16_t*)malloc((size_t)dataSize); // <-- Safe cast as per the check above. + if (pSampleData == NULL) { + goto on_error; + } + + uint64_t samplesDecoded = drflac_read_s16(pFlac, pFlac->totalSampleCount, pSampleData); + if (samplesDecoded != pFlac->totalSampleCount) { + free(pSampleData); + goto on_error; // Something went wrong when decoding the FLAC stream. + } + } + + + if (sampleRateOut) *sampleRateOut = pFlac->sampleRate; + if (channelsOut) *channelsOut = pFlac->channels; + if (totalSampleCountOut) *totalSampleCountOut = totalSampleCount; + + drflac_close(pFlac); + return pSampleData; + +on_error: + drflac_close(pFlac); + return NULL; +} + int32_t* drflac_open_and_decode_s32(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) { // Safety. @@ -4230,7 +4347,22 @@ int32_t* drflac_open_and_decode_s32(drflac_read_proc onRead, drflac_seek_proc on return NULL; } - return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); + return drflac__full_decode_and_close_s32(pFlac, channels, sampleRate, totalSampleCount); +} + +int16_t* drflac_open_and_decode_s16(drflac_read_proc onRead, drflac_seek_proc onSeek, void* pUserData, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + // Safety. + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open(onRead, onSeek, pUserData); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close_s16(pFlac, channels, sampleRate, totalSampleCount); } #ifndef DR_FLAC_NO_STDIO @@ -4245,7 +4377,21 @@ int32_t* drflac_open_and_decode_file_s32(const char* filename, unsigned int* cha return NULL; } - return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); + return drflac__full_decode_and_close_s32(pFlac, channels, sampleRate, totalSampleCount); +} + +int16_t* drflac_open_and_decode_file_s16(const char* filename, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open_file(filename); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close_s16(pFlac, channels, sampleRate, totalSampleCount); } #endif @@ -4260,7 +4406,21 @@ int32_t* drflac_open_and_decode_memory_s32(const void* data, size_t dataSize, un return NULL; } - return drflac__full_decode_and_close(pFlac, channels, sampleRate, totalSampleCount); + return drflac__full_decode_and_close_s32(pFlac, channels, sampleRate, totalSampleCount); +} + +int16_t* drflac_open_and_decode_memory_s16(const void* data, size_t dataSize, unsigned int* channels, unsigned int* sampleRate, uint64_t* totalSampleCount) +{ + if (sampleRate) *sampleRate = 0; + if (channels) *channels = 0; + if (totalSampleCount) *totalSampleCount = 0; + + drflac* pFlac = drflac_open_memory(data, dataSize); + if (pFlac == NULL) { + return NULL; + } + + return drflac__full_decode_and_close_s16(pFlac, channels, sampleRate, totalSampleCount); } void drflac_free(void* pSampleDataReturnedByOpenAndDecode) @@ -4305,6 +4465,15 @@ const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, ui // REVISION HISTORY // +// v0.4c - 2016-12-26 +// - Add support for signed 16-bit integer PCM decoding. +// +// v0.4b - 2016-10-23 +// - A minor change to dr_bool8 and dr_bool32 types. +// +// v0.4a - 2016-10-11 +// - Rename drBool32 to dr_bool32 for styling consistency. +// // v0.4 - 2016-09-29 // - API/ABI CHANGE: Use fixed size 32-bit booleans instead of the built-in bool type. // - API CHANGE: Rename drflac_open_and_decode*() to drflac_open_and_decode*_s32() -- cgit v1.2.3 From e7464d5fc376783912da9086a4bf49d2d5759135 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 27 Dec 2016 17:37:35 +0100 Subject: Review some formatting and naming - Renamed WritePNG() to SavePNG() for consistency with other file loading functions - Renamed WriteBitmap() to SaveBMP() for consistency with other file loading functions - Redesigned SaveBMP() to use stb_image_write --- src/audio.c | 18 +++++++++--------- src/core.c | 5 +++-- src/rlgl.c | 8 ++++---- src/text.c | 6 +++--- src/utils.c | 60 +++++++++--------------------------------------------------- src/utils.h | 8 ++++---- 6 files changed, 32 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3a4ca3df..944d1b9d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -985,7 +985,7 @@ static Wave LoadWAV(const char *fileName) char chunkID[4]; int chunkSize; char format[4]; - } WavRiffHeader; + } WAVRiffHeader; typedef struct { char subChunkID[4]; @@ -996,16 +996,16 @@ static Wave LoadWAV(const char *fileName) int byteRate; short blockAlign; short bitsPerSample; - } WavFormat; + } WAVFormat; typedef struct { char subChunkID[4]; int subChunkSize; - } WavData; + } WAVData; - WavRiffHeader wavRiffHeader; - WavFormat wavFormat; - WavData wavData; + WAVRiffHeader wavRiffHeader; + WAVFormat wavFormat; + WAVData wavData; Wave wave = { 0 }; FILE *wavFile; @@ -1020,7 +1020,7 @@ static Wave LoadWAV(const char *fileName) else { // Read in the first chunk into the struct - fread(&wavRiffHeader, sizeof(WavRiffHeader), 1, wavFile); + fread(&wavRiffHeader, sizeof(WAVRiffHeader), 1, wavFile); // Check for RIFF and WAVE tags if (strncmp(wavRiffHeader.chunkID, "RIFF", 4) || @@ -1031,7 +1031,7 @@ static Wave LoadWAV(const char *fileName) else { // Read in the 2nd chunk for the wave info - fread(&wavFormat, sizeof(WavFormat), 1, wavFile); + fread(&wavFormat, sizeof(WAVFormat), 1, wavFile); // Check for fmt tag if ((wavFormat.subChunkID[0] != 'f') || (wavFormat.subChunkID[1] != 'm') || @@ -1045,7 +1045,7 @@ static Wave LoadWAV(const char *fileName) if (wavFormat.subChunkSize > 16) fseek(wavFile, sizeof(short), SEEK_CUR); // Read in the the last byte of data before the sound file - fread(&wavData, sizeof(WavData), 1, wavFile); + fread(&wavData, sizeof(WAVData), 1, wavFile); // Check for data tag if ((wavData.subChunkID[0] != 'd') || (wavData.subChunkID[1] != 'a') || diff --git a/src/core.c b/src/core.c index a210df56..147010f5 100644 --- a/src/core.c +++ b/src/core.c @@ -2139,7 +2139,7 @@ static void TakeScreenshot(void) sprintf(buffer, "screenshot%03i.png", shotNum); // Save image as PNG - WritePNG(buffer, imgData, renderWidth, renderHeight, 4); + SavePNG(buffer, imgData, renderWidth, renderHeight, 4); free(imgData); @@ -2818,7 +2818,8 @@ static void InitMouse(void) // if too much time passes between reads, queue gets full and new events override older ones... static void *MouseThread(void *arg) { - const unsigned char XSIGN = 1<<4, YSIGN = 1<<5; + const unsigned char XSIGN = (1 << 4); + const unsigned char YSIGN = (1 << 5); typedef struct { char buttons; diff --git a/src/rlgl.c b/src/rlgl.c index ae28d9b6..cb1ac709 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -192,7 +192,7 @@ //---------------------------------------------------------------------------------- // Dynamic vertex buffers (position + texcoords + colors + indices arrays) -typedef struct { +typedef struct DynamicBuffer { int vCounter; // vertex position counter to process (and draw) from full buffer int tcCounter; // vertex texcoord counter to process (and draw) from full buffer int cCounter; // vertex color counter to process (and draw) from full buffer @@ -211,7 +211,7 @@ typedef struct { // Draw call type // NOTE: Used to track required draw-calls, organized by texture -typedef struct { +typedef struct DrawCall { int vertexCount; GLuint vaoId; GLuint textureId; @@ -226,7 +226,7 @@ typedef struct { } DrawCall; // Head-Mounted-Display device parameters -typedef struct { +typedef struct VrDeviceInfo { int hResolution; // HMD horizontal resolution in pixels int vResolution; // HMD vertical resolution in pixels float hScreenSize; // HMD horizontal size in meters @@ -240,7 +240,7 @@ typedef struct { } VrDeviceInfo; // VR Stereo rendering configuration for simulator -typedef struct { +typedef struct VrStereoConfig { RenderTexture2D stereoFbo; // VR stereo rendering framebuffer Shader distortionShader; // VR stereo rendering distortion shader //Rectangle eyesViewport[2]; // VR stereo rendering eyes viewports diff --git a/src/text.c b/src/text.c index f97b581d..74d5940b 100644 --- a/src/text.c +++ b/src/text.c @@ -53,7 +53,7 @@ #define MAX_FORMATTEXT_LENGTH 64 #define MAX_SUBTEXT_LENGTH 64 -#define BIT_CHECK(a,b) ((a) & (1<<(b))) +#define BIT_CHECK(a,b) ((a) & (1 << (b))) //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -948,7 +948,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int return font; } - fread(ttfBuffer, 1, 1<<25, ttfFile); + fread(ttfBuffer, 1, 1 << 25, ttfFile); if (fontChars[0] != 32) TraceLog(WARNING, "TTF spritefont loading: first character is not SPACE(32) character"); @@ -983,7 +983,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int font.texture = LoadTextureFromImage(image); - //WritePNG("generated_ttf_image.png", (unsigned char *)image.data, image.width, image.height, 2); + //SavePNG("generated_ttf_image.png", (unsigned char *)image.data, image.width, image.height, 2); UnloadImage(image); // Unloads dataGrayAlpha diff --git a/src/utils.c b/src/utils.c index 8fedcaad..711ffab3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -42,13 +42,16 @@ #include // Required for: malloc(), free() #include // Required for: fopen(), fclose(), fputc(), fwrite(), printf(), fprintf(), funopen() #include // Required for: va_list, va_start(), vfprintf(), va_end() -//#include // Required for: strlen(), strrchr(), strcmp() +#include // Required for: strlen(), strrchr(), strcmp() #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) #define STB_IMAGE_WRITE_IMPLEMENTATION - #include "external/stb_image_write.h" // Required for: stbi_write_png() + #include "external/stb_image_write.h" // Required for: stbi_write_bmp(), stbi_write_png() #endif +#define RRES_IMPLEMENTATION +#include "rres.h" + #define DO_NOT_TRACE_DEBUG_MSGS // Avoid DEBUG messages tracing //---------------------------------------------------------------------------------- @@ -73,59 +76,14 @@ static int android_close(void *cookie); //---------------------------------------------------------------------------------- #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -// Creates a bitmap (BMP) file from an array of pixel data -// NOTE: This function is not explicitly available to raylib users -void WriteBitmap(const char *fileName, unsigned char *imgData, int width, int height) +// Creates a BMP image file from an array of pixel data +void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize) { - int filesize = 54 + 3*width*height; - - unsigned char bmpFileHeader[14] = {'B','M', 0,0,0,0, 0,0, 0,0, 54,0,0,0}; // Standard BMP file header - unsigned char bmpInfoHeader[40] = {40,0,0,0, 0,0,0,0, 0,0,0,0, 1,0, 24,0}; // Standard BMP info header - - bmpFileHeader[2] = (unsigned char)(filesize); - bmpFileHeader[3] = (unsigned char)(filesize>>8); - bmpFileHeader[4] = (unsigned char)(filesize>>16); - bmpFileHeader[5] = (unsigned char)(filesize>>24); - - bmpInfoHeader[4] = (unsigned char)(width); - bmpInfoHeader[5] = (unsigned char)(width>>8); - bmpInfoHeader[6] = (unsigned char)(width>>16); - bmpInfoHeader[7] = (unsigned char)(width>>24); - bmpInfoHeader[8] = (unsigned char)(height); - bmpInfoHeader[9] = (unsigned char)(height>>8); - bmpInfoHeader[10] = (unsigned char)(height>>16); - bmpInfoHeader[11] = (unsigned char)(height>>24); - - FILE *bmpFile = fopen(fileName, "wb"); // Define a pointer to bitmap file and open it in write-binary mode - - if (bmpFile == NULL) - { - TraceLog(WARNING, "[%s] BMP file could not be created", fileName); - } - else - { - // NOTE: fwrite parameters are: data pointer, size in bytes of each element to be written, number of elements, file-to-write pointer - fwrite(bmpFileHeader, sizeof(unsigned char), 14, bmpFile); // Write BMP file header data - fwrite(bmpInfoHeader, sizeof(unsigned char), 40, bmpFile); // Write BMP info header data - - // Write pixel data to file - for (int y = 0; y < height ; y++) - { - for (int x = 0; x < width; x++) - { - fputc(imgData[(x*4)+2 + (y*width*4)], bmpFile); - fputc(imgData[(x*4)+1 + (y*width*4)], bmpFile); - fputc(imgData[(x*4) + (y*width*4)], bmpFile); - } - } - } - - fclose(bmpFile); // Close bitmap file + stbi_write_bmp(fileName, width, height, compSize, imgData); } // Creates a PNG image file from an array of pixel data -// NOTE: Uses stb_image_write -void WritePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) +void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) { stbi_write_png(fileName, width, height, compSize, imgData, width*compSize); } diff --git a/src/utils.h b/src/utils.h index 045b0692..e0db51fe 100644 --- a/src/utils.h +++ b/src/utils.h @@ -31,6 +31,8 @@ #include // Required for: AAssetManager #endif +#include "rres.h" + //---------------------------------------------------------------------------------- // Some basic Defines //---------------------------------------------------------------------------------- @@ -66,11 +68,9 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -unsigned char *DecompressData(const unsigned char *data, unsigned long compSize, int uncompSize); - #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -void WriteBitmap(const char *fileName, unsigned char *imgData, int width, int height); -void WritePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); +void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize); +void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); #endif void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message -- cgit v1.2.3 From bf3a213e44e8de1f61aeadc692c50290d3852a98 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 27 Dec 2016 17:40:59 +0100 Subject: Some functions review and additions - Improved ImageCopy() to support compressed formats - Renaming file-formats header structs for consistency - Review variables naming on ImageDither() for consistency - Improved LoadImagePro() to make a copy of data - Preliminary support of rRES file format on LoadImage() --- src/textures.c | 305 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 168 insertions(+), 137 deletions(-) (limited to 'src') diff --git a/src/textures.c b/src/textures.c index 8b223ed0..6538c316 100644 --- a/src/textures.c +++ b/src/textures.c @@ -141,6 +141,17 @@ Image LoadImage(const char *fileName) else if (strcmp(GetExtension(fileName),"ktx") == 0) image = LoadKTX(fileName); else if (strcmp(GetExtension(fileName),"pvr") == 0) image = LoadPVR(fileName); else if (strcmp(GetExtension(fileName),"astc") == 0) image = LoadASTC(fileName); + else if (strcmp(GetExtension(fileName),"rres") == 0) + { + RRESData rres = LoadResource(fileName); + + // NOTE: Parameters for RRES_IMAGE type are: width, height, format, mipmaps + + if (rres.type == RRES_IMAGE) image = LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); + else TraceLog(WARNING, "[%s] Resource file does not contain image data", fileName); + + UnloadResource(rres); + } if (image.data != NULL) TraceLog(INFO, "[%s] Image loaded successfully (%ix%i)", fileName, image.width, image.height); else TraceLog(WARNING, "[%s] Image could not be loaded", fileName); @@ -176,18 +187,20 @@ Image LoadImageEx(Color *pixels, int width, int height) } // Load image from raw data with parameters -// NOTE: This functions does not make a copy of data +// NOTE: This functions makes a copy of provided data Image LoadImagePro(void *data, int width, int height, int format) { - Image image; + Image srcImage = { 0 }; + + srcImage.data = data; + srcImage.width = width; + srcImage.height = height; + srcImage.mipmaps = 1; + srcImage.format = format; - image.data = data; - image.width = width; - image.height = height; - image.mipmaps = 1; - image.format = format; + Image dstImage = ImageCopy(srcImage); - return image; + return dstImage; } // Load an image from RAW file data @@ -669,11 +682,11 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) // NOTE: We will store the dithered data as unsigned short (16bpp) image->data = (unsigned short *)malloc(image->width*image->height*sizeof(unsigned short)); - Color oldpixel = WHITE; - Color newpixel = WHITE; + Color oldPixel = WHITE; + Color newPixel = WHITE; - int error_r, error_g, error_b; - unsigned short pixel_r, pixel_g, pixel_b, pixel_a; // Used for 16bit pixel composition + int rError, gError, bError; + unsigned short rPixel, gPixel, bPixel, aPixel; // Used for 16bit pixel composition #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -681,57 +694,57 @@ void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp) { for (int x = 0; x < image->width; x++) { - oldpixel = pixels[y*image->width + x]; + oldPixel = pixels[y*image->width + x]; // NOTE: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat()) - newpixel.r = oldpixel.r>>(8 - rBpp); // R bits - newpixel.g = oldpixel.g>>(8 - gBpp); // G bits - newpixel.b = oldpixel.b>>(8 - bBpp); // B bits - newpixel.a = oldpixel.a>>(8 - aBpp); // A bits (not used on dithering) + newPixel.r = oldPixel.r >> (8 - rBpp); // R bits + newPixel.g = oldPixel.g >> (8 - gBpp); // G bits + newPixel.b = oldPixel.b >> (8 - bBpp); // B bits + newPixel.a = oldPixel.a >> (8 - aBpp); // A bits (not used on dithering) // NOTE: Error must be computed between new and old pixel but using same number of bits! // We want to know how much color precision we have lost... - error_r = (int)oldpixel.r - (int)(newpixel.r<<(8 - rBpp)); - error_g = (int)oldpixel.g - (int)(newpixel.g<<(8 - gBpp)); - error_b = (int)oldpixel.b - (int)(newpixel.b<<(8 - bBpp)); + rError = (int)oldPixel.r - (int)(newPixel.r << (8 - rBpp)); + gError = (int)oldPixel.g - (int)(newPixel.g << (8 - gBpp)); + bError = (int)oldPixel.b - (int)(newPixel.b << (8 - bBpp)); - pixels[y*image->width + x] = newpixel; + pixels[y*image->width + x] = newPixel; // NOTE: Some cases are out of the array and should be ignored if (x < (image->width - 1)) { - pixels[y*image->width + x+1].r = MIN((int)pixels[y*image->width + x+1].r + (int)((float)error_r*7.0f/16), 0xff); - pixels[y*image->width + x+1].g = MIN((int)pixels[y*image->width + x+1].g + (int)((float)error_g*7.0f/16), 0xff); - pixels[y*image->width + x+1].b = MIN((int)pixels[y*image->width + x+1].b + (int)((float)error_b*7.0f/16), 0xff); + pixels[y*image->width + x+1].r = MIN((int)pixels[y*image->width + x+1].r + (int)((float)rError*7.0f/16), 0xff); + pixels[y*image->width + x+1].g = MIN((int)pixels[y*image->width + x+1].g + (int)((float)gError*7.0f/16), 0xff); + pixels[y*image->width + x+1].b = MIN((int)pixels[y*image->width + x+1].b + (int)((float)bError*7.0f/16), 0xff); } if ((x > 0) && (y < (image->height - 1))) { - pixels[(y+1)*image->width + x-1].r = MIN((int)pixels[(y+1)*image->width + x-1].r + (int)((float)error_r*3.0f/16), 0xff); - pixels[(y+1)*image->width + x-1].g = MIN((int)pixels[(y+1)*image->width + x-1].g + (int)((float)error_g*3.0f/16), 0xff); - pixels[(y+1)*image->width + x-1].b = MIN((int)pixels[(y+1)*image->width + x-1].b + (int)((float)error_b*3.0f/16), 0xff); + pixels[(y+1)*image->width + x-1].r = MIN((int)pixels[(y+1)*image->width + x-1].r + (int)((float)rError*3.0f/16), 0xff); + pixels[(y+1)*image->width + x-1].g = MIN((int)pixels[(y+1)*image->width + x-1].g + (int)((float)gError*3.0f/16), 0xff); + pixels[(y+1)*image->width + x-1].b = MIN((int)pixels[(y+1)*image->width + x-1].b + (int)((float)bError*3.0f/16), 0xff); } if (y < (image->height - 1)) { - pixels[(y+1)*image->width + x].r = MIN((int)pixels[(y+1)*image->width + x].r + (int)((float)error_r*5.0f/16), 0xff); - pixels[(y+1)*image->width + x].g = MIN((int)pixels[(y+1)*image->width + x].g + (int)((float)error_g*5.0f/16), 0xff); - pixels[(y+1)*image->width + x].b = MIN((int)pixels[(y+1)*image->width + x].b + (int)((float)error_b*5.0f/16), 0xff); + pixels[(y+1)*image->width + x].r = MIN((int)pixels[(y+1)*image->width + x].r + (int)((float)rError*5.0f/16), 0xff); + pixels[(y+1)*image->width + x].g = MIN((int)pixels[(y+1)*image->width + x].g + (int)((float)gError*5.0f/16), 0xff); + pixels[(y+1)*image->width + x].b = MIN((int)pixels[(y+1)*image->width + x].b + (int)((float)bError*5.0f/16), 0xff); } if ((x < (image->width - 1)) && (y < (image->height - 1))) { - pixels[(y+1)*image->width + x+1].r = MIN((int)pixels[(y+1)*image->width + x+1].r + (int)((float)error_r*1.0f/16), 0xff); - pixels[(y+1)*image->width + x+1].g = MIN((int)pixels[(y+1)*image->width + x+1].g + (int)((float)error_g*1.0f/16), 0xff); - pixels[(y+1)*image->width + x+1].b = MIN((int)pixels[(y+1)*image->width + x+1].b + (int)((float)error_b*1.0f/16), 0xff); + pixels[(y+1)*image->width + x+1].r = MIN((int)pixels[(y+1)*image->width + x+1].r + (int)((float)rError*1.0f/16), 0xff); + pixels[(y+1)*image->width + x+1].g = MIN((int)pixels[(y+1)*image->width + x+1].g + (int)((float)gError*1.0f/16), 0xff); + pixels[(y+1)*image->width + x+1].b = MIN((int)pixels[(y+1)*image->width + x+1].b + (int)((float)bError*1.0f/16), 0xff); } - pixel_r = (unsigned short)newpixel.r; - pixel_g = (unsigned short)newpixel.g; - pixel_b = (unsigned short)newpixel.b; - pixel_a = (unsigned short)newpixel.a; + rPixel = (unsigned short)newPixel.r; + gPixel = (unsigned short)newPixel.g; + bPixel = (unsigned short)newPixel.b; + aPixel = (unsigned short)newPixel.a; - ((unsigned short *)image->data)[y*image->width + x] = (pixel_r<<(gBpp + bBpp + aBpp)) | (pixel_g<<(bBpp + aBpp)) | (pixel_b<data)[y*image->width + x] = (rPixel << (gBpp + bBpp + aBpp)) | (gPixel << (bBpp + aBpp)) | (bPixel << aBpp) | aPixel; } } @@ -788,24 +801,37 @@ Image ImageCopy(Image image) { Image newImage; - int size = image.width*image.height; + int byteSize = image.width*image.height; switch (image.format) { - case UNCOMPRESSED_GRAYSCALE: newImage.data = (unsigned char *)malloc(size); break; // 8 bit per pixel (no alpha) - case UNCOMPRESSED_GRAY_ALPHA: newImage.data = (unsigned char *)malloc(size*2); size *= 2; break; // 16 bpp (2 channels) - case UNCOMPRESSED_R5G6B5: newImage.data = (unsigned short *)malloc(size); size *= 2; break; // 16 bpp - case UNCOMPRESSED_R8G8B8: newImage.data = (unsigned char *)malloc(size*3); size *= 3; break; // 24 bpp - case UNCOMPRESSED_R5G5B5A1: newImage.data = (unsigned short *)malloc(size); size *= 2; break; // 16 bpp (1 bit alpha) - case UNCOMPRESSED_R4G4B4A4: newImage.data = (unsigned short *)malloc(size); size *= 2; break; // 16 bpp (4 bit alpha) - case UNCOMPRESSED_R8G8B8A8: newImage.data = (unsigned char *)malloc(size*4); size *= 4; break; // 32 bpp - default: TraceLog(WARNING, "Image format not suported for copy"); break; + case UNCOMPRESSED_GRAYSCALE: break; // 8 bpp (1 byte) + case UNCOMPRESSED_GRAY_ALPHA: // 16 bpp + case UNCOMPRESSED_R5G6B5: // 16 bpp + case UNCOMPRESSED_R5G5B5A1: // 16 bpp + case UNCOMPRESSED_R4G4B4A4: byteSize *= 2; break; // 16 bpp (2 bytes) + case UNCOMPRESSED_R8G8B8: byteSize *= 3; break; // 24 bpp (3 bytes) + case UNCOMPRESSED_R8G8B8A8: byteSize *= 4; break; // 32 bpp (4 bytes) + case COMPRESSED_DXT3_RGBA: + case COMPRESSED_DXT5_RGBA: + case COMPRESSED_ETC2_EAC_RGBA: + case COMPRESSED_ASTC_4x4_RGBA: break; // 8 bpp (1 byte) + case COMPRESSED_DXT1_RGB: + case COMPRESSED_DXT1_RGBA: + case COMPRESSED_ETC1_RGB: + case COMPRESSED_ETC2_RGB: + case COMPRESSED_PVRT_RGB: + case COMPRESSED_PVRT_RGBA: byteSize /= 2; break; // 4 bpp + case COMPRESSED_ASTC_8x8_RGBA: byteSize /= 4; break;// 2 bpp + default: TraceLog(WARNING, "Image format not recognized"); break; } + newImage.data = malloc(byteSize); + if (newImage.data != NULL) { // NOTE: Size must be provided in bytes - memcpy(newImage.data, image.data, size); + memcpy(newImage.data, image.data, byteSize); newImage.width = image.width; newImage.height = image.height; @@ -1524,7 +1550,7 @@ static Image LoadDDS(const char *fileName) unsigned int gBitMask; unsigned int bBitMask; unsigned int aBitMask; - } ddsPixelFormat; + } DDSPixelFormat; // DDS Header (124 bytes) typedef struct { @@ -1536,13 +1562,13 @@ static Image LoadDDS(const char *fileName) unsigned int depth; unsigned int mipmapCount; unsigned int reserved1[11]; - ddsPixelFormat ddspf; + DDSPixelFormat ddspf; unsigned int caps; unsigned int caps2; unsigned int caps3; unsigned int caps4; unsigned int reserved2; - } ddsHeader; + } DDSHeader; Image image; @@ -1571,33 +1597,33 @@ static Image LoadDDS(const char *fileName) } else { - ddsHeader header; + DDSHeader ddsHeader; // Get the image header - fread(&header, sizeof(ddsHeader), 1, ddsFile); + fread(&ddsHeader, sizeof(DDSHeader), 1, ddsFile); - TraceLog(DEBUG, "[%s] DDS file header size: %i", fileName, sizeof(ddsHeader)); - TraceLog(DEBUG, "[%s] DDS file pixel format size: %i", fileName, header.ddspf.size); - TraceLog(DEBUG, "[%s] DDS file pixel format flags: 0x%x", fileName, header.ddspf.flags); - TraceLog(DEBUG, "[%s] DDS file format: 0x%x", fileName, header.ddspf.fourCC); - TraceLog(DEBUG, "[%s] DDS file bit count: 0x%x", fileName, header.ddspf.rgbBitCount); + TraceLog(DEBUG, "[%s] DDS file header size: %i", fileName, sizeof(DDSHeader)); + TraceLog(DEBUG, "[%s] DDS file pixel format size: %i", fileName, ddsHeader.ddspf.size); + TraceLog(DEBUG, "[%s] DDS file pixel format flags: 0x%x", fileName, ddsHeader.ddspf.flags); + TraceLog(DEBUG, "[%s] DDS file format: 0x%x", fileName, ddsHeader.ddspf.fourCC); + TraceLog(DEBUG, "[%s] DDS file bit count: 0x%x", fileName, ddsHeader.ddspf.rgbBitCount); - image.width = header.width; - image.height = header.height; - image.mipmaps = 1; // Default value, could be changed (header.mipmapCount) + image.width = ddsHeader.width; + image.height = ddsHeader.height; + image.mipmaps = 1; // Default value, could be changed (ddsHeader.mipmapCount) - if (header.ddspf.rgbBitCount == 16) // 16bit mode, no compressed + if (ddsHeader.ddspf.rgbBitCount == 16) // 16bit mode, no compressed { - if (header.ddspf.flags == 0x40) // no alpha channel + if (ddsHeader.ddspf.flags == 0x40) // no alpha channel { image.data = (unsigned short *)malloc(image.width*image.height*sizeof(unsigned short)); fread(image.data, image.width*image.height*sizeof(unsigned short), 1, ddsFile); image.format = UNCOMPRESSED_R5G6B5; } - else if (header.ddspf.flags == 0x41) // with alpha channel + else if (ddsHeader.ddspf.flags == 0x41) // with alpha channel { - if (header.ddspf.aBitMask == 0x8000) // 1bit alpha + if (ddsHeader.ddspf.aBitMask == 0x8000) // 1bit alpha { image.data = (unsigned short *)malloc(image.width*image.height*sizeof(unsigned short)); fread(image.data, image.width*image.height*sizeof(unsigned short), 1, ddsFile); @@ -1614,7 +1640,7 @@ static Image LoadDDS(const char *fileName) image.format = UNCOMPRESSED_R5G5B5A1; } - else if (header.ddspf.aBitMask == 0xf000) // 4bit alpha + else if (ddsHeader.ddspf.aBitMask == 0xf000) // 4bit alpha { image.data = (unsigned short *)malloc(image.width*image.height*sizeof(unsigned short)); fread(image.data, image.width*image.height*sizeof(unsigned short), 1, ddsFile); @@ -1633,7 +1659,7 @@ static Image LoadDDS(const char *fileName) } } } - if (header.ddspf.flags == 0x40 && header.ddspf.rgbBitCount == 24) // DDS_RGB, no compressed + if (ddsHeader.ddspf.flags == 0x40 && ddsHeader.ddspf.rgbBitCount == 24) // DDS_RGB, no compressed { // NOTE: not sure if this case exists... image.data = (unsigned char *)malloc(image.width*image.height*3*sizeof(unsigned char)); @@ -1641,7 +1667,7 @@ static Image LoadDDS(const char *fileName) image.format = UNCOMPRESSED_R8G8B8; } - else if (header.ddspf.flags == 0x41 && header.ddspf.rgbBitCount == 32) // DDS_RGBA, no compressed + else if (ddsHeader.ddspf.flags == 0x41 && ddsHeader.ddspf.rgbBitCount == 32) // DDS_RGBA, no compressed { image.data = (unsigned char *)malloc(image.width*image.height*4*sizeof(unsigned char)); fread(image.data, image.width*image.height*4, 1, ddsFile); @@ -1660,27 +1686,27 @@ static Image LoadDDS(const char *fileName) image.format = UNCOMPRESSED_R8G8B8A8; } - else if (((header.ddspf.flags == 0x04) || (header.ddspf.flags == 0x05)) && (header.ddspf.fourCC > 0)) // Compressed + else if (((ddsHeader.ddspf.flags == 0x04) || (ddsHeader.ddspf.flags == 0x05)) && (ddsHeader.ddspf.fourCC > 0)) // Compressed { int bufsize; // Calculate data size, including all mipmaps - if (header.mipmapCount > 1) bufsize = header.pitchOrLinearSize*2; - else bufsize = header.pitchOrLinearSize; + if (ddsHeader.mipmapCount > 1) bufsize = ddsHeader.pitchOrLinearSize*2; + else bufsize = ddsHeader.pitchOrLinearSize; - TraceLog(DEBUG, "Pitch or linear size: %i", header.pitchOrLinearSize); + TraceLog(DEBUG, "Pitch or linear size: %i", ddsHeader.pitchOrLinearSize); image.data = (unsigned char*)malloc(bufsize*sizeof(unsigned char)); fread(image.data, 1, bufsize, ddsFile); - image.mipmaps = header.mipmapCount; + image.mipmaps = ddsHeader.mipmapCount; - switch (header.ddspf.fourCC) + switch (ddsHeader.ddspf.fourCC) { case FOURCC_DXT1: { - if (header.ddspf.flags == 0x04) image.format = COMPRESSED_DXT1_RGB; + if (ddsHeader.ddspf.flags == 0x04) image.format = COMPRESSED_DXT1_RGB; else image.format = COMPRESSED_DXT1_RGBA; } break; case FOURCC_DXT3: image.format = COMPRESSED_DXT3_RGBA; break; @@ -1719,7 +1745,7 @@ static Image LoadPKM(const char *fileName) unsigned short height; // Texture height (big-endian) (origHeight rounded to multiple of 4) unsigned short origWidth; // Original width (big-endian) unsigned short origHeight; // Original height (big-endian) - } pkmHeader; + } PKMHeader; // Formats list // version 10: format: 0=ETC1_RGB, [1=ETC1_RGBA, 2=ETC1_RGB_MIP, 3=ETC1_RGBA_MIP] (not used) @@ -1744,32 +1770,32 @@ static Image LoadPKM(const char *fileName) } else { - pkmHeader header; + PKMHeader pkmHeader; // Get the image header - fread(&header, sizeof(pkmHeader), 1, pkmFile); + fread(&pkmHeader, sizeof(PKMHeader), 1, pkmFile); - if (strncmp(header.id, "PKM ", 4) != 0) + if (strncmp(pkmHeader.id, "PKM ", 4) != 0) { TraceLog(WARNING, "[%s] PKM file does not seem to be a valid image", fileName); } else { // NOTE: format, width and height come as big-endian, data must be swapped to little-endian - header.format = ((header.format & 0x00FF) << 8) | ((header.format & 0xFF00) >> 8); - header.width = ((header.width & 0x00FF) << 8) | ((header.width & 0xFF00) >> 8); - header.height = ((header.height & 0x00FF) << 8) | ((header.height & 0xFF00) >> 8); + pkmHeader.format = ((pkmHeader.format & 0x00FF) << 8) | ((pkmHeader.format & 0xFF00) >> 8); + pkmHeader.width = ((pkmHeader.width & 0x00FF) << 8) | ((pkmHeader.width & 0xFF00) >> 8); + pkmHeader.height = ((pkmHeader.height & 0x00FF) << 8) | ((pkmHeader.height & 0xFF00) >> 8); - TraceLog(DEBUG, "PKM (ETC) image width: %i", header.width); - TraceLog(DEBUG, "PKM (ETC) image height: %i", header.height); - TraceLog(DEBUG, "PKM (ETC) image format: %i", header.format); + TraceLog(DEBUG, "PKM (ETC) image width: %i", pkmHeader.width); + TraceLog(DEBUG, "PKM (ETC) image height: %i", pkmHeader.height); + TraceLog(DEBUG, "PKM (ETC) image format: %i", pkmHeader.format); - image.width = header.width; - image.height = header.height; + image.width = pkmHeader.width; + image.height = pkmHeader.height; image.mipmaps = 1; int bpp = 4; - if (header.format == 3) bpp = 8; + if (pkmHeader.format == 3) bpp = 8; int size = image.width*image.height*bpp/8; // Total data size in bytes @@ -1777,9 +1803,9 @@ static Image LoadPKM(const char *fileName) fread(image.data, 1, size, pkmFile); - if (header.format == 0) image.format = COMPRESSED_ETC1_RGB; - else if (header.format == 1) image.format = COMPRESSED_ETC2_RGB; - else if (header.format == 3) image.format = COMPRESSED_ETC2_EAC_RGBA; + if (pkmHeader.format == 0) image.format = COMPRESSED_ETC1_RGB; + else if (pkmHeader.format == 1) image.format = COMPRESSED_ETC2_RGB; + else if (pkmHeader.format == 3) image.format = COMPRESSED_ETC2_EAC_RGBA; } fclose(pkmFile); // Close file pointer @@ -1817,7 +1843,7 @@ static Image LoadKTX(const char *fileName) unsigned int faces; // Cubemap faces, for no-cubemap = 1 unsigned int mipmapLevels; // Non-mipmapped textures = 1 unsigned int keyValueDataSize; // Used to encode any arbitrary data... - } ktxHeader; + } KTXHeader; // NOTE: Before start of every mipmap data block, we have: unsigned int dataSize @@ -1836,31 +1862,31 @@ static Image LoadKTX(const char *fileName) } else { - ktxHeader header; + KTXHeader ktxHeader; // Get the image header - fread(&header, sizeof(ktxHeader), 1, ktxFile); + fread(&ktxHeader, sizeof(KTXHeader), 1, ktxFile); - if ((header.id[1] != 'K') || (header.id[2] != 'T') || (header.id[3] != 'X') || - (header.id[4] != ' ') || (header.id[5] != '1') || (header.id[6] != '1')) + if ((ktxHeader.id[1] != 'K') || (ktxHeader.id[2] != 'T') || (ktxHeader.id[3] != 'X') || + (ktxHeader.id[4] != ' ') || (ktxHeader.id[5] != '1') || (ktxHeader.id[6] != '1')) { TraceLog(WARNING, "[%s] KTX file does not seem to be a valid file", fileName); } else { - image.width = header.width; - image.height = header.height; - image.mipmaps = header.mipmapLevels; + image.width = ktxHeader.width; + image.height = ktxHeader.height; + image.mipmaps = ktxHeader.mipmapLevels; - TraceLog(DEBUG, "KTX (ETC) image width: %i", header.width); - TraceLog(DEBUG, "KTX (ETC) image height: %i", header.height); - TraceLog(DEBUG, "KTX (ETC) image format: 0x%x", header.glInternalFormat); + TraceLog(DEBUG, "KTX (ETC) image width: %i", ktxHeader.width); + TraceLog(DEBUG, "KTX (ETC) image height: %i", ktxHeader.height); + TraceLog(DEBUG, "KTX (ETC) image format: 0x%x", ktxHeader.glInternalFormat); unsigned char unused; - if (header.keyValueDataSize > 0) + if (ktxHeader.keyValueDataSize > 0) { - for (int i = 0; i < header.keyValueDataSize; i++) fread(&unused, 1, 1, ktxFile); + for (int i = 0; i < ktxHeader.keyValueDataSize; i++) fread(&unused, 1, 1, ktxFile); } int dataSize; @@ -1870,9 +1896,9 @@ static Image LoadKTX(const char *fileName) fread(image.data, 1, dataSize, ktxFile); - if (header.glInternalFormat == 0x8D64) image.format = COMPRESSED_ETC1_RGB; - else if (header.glInternalFormat == 0x9274) image.format = COMPRESSED_ETC2_RGB; - else if (header.glInternalFormat == 0x9278) image.format = COMPRESSED_ETC2_EAC_RGBA; + if (ktxHeader.glInternalFormat == 0x8D64) image.format = COMPRESSED_ETC1_RGB; + else if (ktxHeader.glInternalFormat == 0x9274) image.format = COMPRESSED_ETC2_RGB; + else if (ktxHeader.glInternalFormat == 0x9278) image.format = COMPRESSED_ETC2_EAC_RGBA; } fclose(ktxFile); // Close file pointer @@ -1908,7 +1934,7 @@ static Image LoadPVR(const char *fileName) unsigned int bitmaskAlpha; unsigned int pvrTag; unsigned int numSurfs; - } pvrHeaderV2; + } PVRHeaderV2; #endif // PVR file v3 Header (52 bytes) @@ -1927,7 +1953,7 @@ static Image LoadPVR(const char *fileName) unsigned int numFaces; unsigned int numMipmaps; unsigned int metaDataSize; - } pvrHeaderV3; + } PVRHeaderV3; #if 0 // Not used... // Metadata (usually 15 bytes) @@ -1936,7 +1962,7 @@ static Image LoadPVR(const char *fileName) unsigned int key; unsigned int dataSize; // Not used? unsigned char *data; // Not used? - } pvrMetadata; + } PVRMetadata; #endif Image image; @@ -1963,44 +1989,49 @@ static Image LoadPVR(const char *fileName) // Load different PVR data formats if (pvrVersion == 0x50) { - pvrHeaderV3 header; + PVRHeaderV3 pvrHeader; // Get PVR image header - fread(&header, sizeof(pvrHeaderV3), 1, pvrFile); + fread(&pvrHeader, sizeof(PVRHeaderV3), 1, pvrFile); - if ((header.id[0] != 'P') || (header.id[1] != 'V') || (header.id[2] != 'R') || (header.id[3] != 3)) + if ((pvrHeader.id[0] != 'P') || (pvrHeader.id[1] != 'V') || (pvrHeader.id[2] != 'R') || (pvrHeader.id[3] != 3)) { TraceLog(WARNING, "[%s] PVR file does not seem to be a valid image", fileName); } else { - image.width = header.width; - image.height = header.height; - image.mipmaps = header.numMipmaps; + image.width = pvrHeader.width; + image.height = pvrHeader.height; + image.mipmaps = pvrHeader.numMipmaps; // Check data format - if (((header.channels[0] == 'l') && (header.channels[1] == 0)) && (header.channelDepth[0] == 8)) image.format = UNCOMPRESSED_GRAYSCALE; - else if (((header.channels[0] == 'l') && (header.channels[1] == 'a')) && ((header.channelDepth[0] == 8) && (header.channelDepth[1] == 8))) image.format = UNCOMPRESSED_GRAY_ALPHA; - else if ((header.channels[0] == 'r') && (header.channels[1] == 'g') && (header.channels[2] == 'b')) + if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 0)) && (pvrHeader.channelDepth[0] == 8)) + image.format = UNCOMPRESSED_GRAYSCALE; + else if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 'a')) && ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8))) + image.format = UNCOMPRESSED_GRAY_ALPHA; + else if ((pvrHeader.channels[0] == 'r') && (pvrHeader.channels[1] == 'g') && (pvrHeader.channels[2] == 'b')) { - if (header.channels[3] == 'a') + if (pvrHeader.channels[3] == 'a') { - if ((header.channelDepth[0] == 5) && (header.channelDepth[1] == 5) && (header.channelDepth[2] == 5) && (header.channelDepth[3] == 1)) image.format = UNCOMPRESSED_R5G5B5A1; - else if ((header.channelDepth[0] == 4) && (header.channelDepth[1] == 4) && (header.channelDepth[2] == 4) && (header.channelDepth[3] == 4)) image.format = UNCOMPRESSED_R4G4B4A4; - else if ((header.channelDepth[0] == 8) && (header.channelDepth[1] == 8) && (header.channelDepth[2] == 8) && (header.channelDepth[3] == 8)) image.format = UNCOMPRESSED_R8G8B8A8; + if ((pvrHeader.channelDepth[0] == 5) && (pvrHeader.channelDepth[1] == 5) && (pvrHeader.channelDepth[2] == 5) && (pvrHeader.channelDepth[3] == 1)) + image.format = UNCOMPRESSED_R5G5B5A1; + else if ((pvrHeader.channelDepth[0] == 4) && (pvrHeader.channelDepth[1] == 4) && (pvrHeader.channelDepth[2] == 4) && (pvrHeader.channelDepth[3] == 4)) + image.format = UNCOMPRESSED_R4G4B4A4; + else if ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8) && (pvrHeader.channelDepth[2] == 8) && (pvrHeader.channelDepth[3] == 8)) + image.format = UNCOMPRESSED_R8G8B8A8; } - else if (header.channels[3] == 0) + else if (pvrHeader.channels[3] == 0) { - if ((header.channelDepth[0] == 5) && (header.channelDepth[1] == 6) && (header.channelDepth[2] == 5)) image.format = UNCOMPRESSED_R5G6B5; - else if ((header.channelDepth[0] == 8) && (header.channelDepth[1] == 8) && (header.channelDepth[2] == 8)) image.format = UNCOMPRESSED_R8G8B8; + if ((pvrHeader.channelDepth[0] == 5) && (pvrHeader.channelDepth[1] == 6) && (pvrHeader.channelDepth[2] == 5)) image.format = UNCOMPRESSED_R5G6B5; + else if ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8) && (pvrHeader.channelDepth[2] == 8)) image.format = UNCOMPRESSED_R8G8B8; } } - else if (header.channels[0] == 2) image.format = COMPRESSED_PVRT_RGB; - else if (header.channels[0] == 3) image.format = COMPRESSED_PVRT_RGBA; + else if (pvrHeader.channels[0] == 2) image.format = COMPRESSED_PVRT_RGB; + else if (pvrHeader.channels[0] == 3) image.format = COMPRESSED_PVRT_RGBA; // Skip meta data header unsigned char unused = 0; - for (int i = 0; i < header.metaDataSize; i++) fread(&unused, sizeof(unsigned char), 1, pvrFile); + for (int i = 0; i < pvrHeader.metaDataSize; i++) fread(&unused, sizeof(unsigned char), 1, pvrFile); // Calculate data size (depends on format) int bpp = 0; @@ -2054,7 +2085,7 @@ static Image LoadASTC(const char *fileName) unsigned char width[3]; // Image width in pixels (24bit value) unsigned char height[3]; // Image height in pixels (24bit value) unsigned char lenght[3]; // Image Z-size (1 for 2D images) - } astcHeader; + } ASTCHeader; Image image; @@ -2072,30 +2103,30 @@ static Image LoadASTC(const char *fileName) } else { - astcHeader header; + ASTCHeader astcHeader; // Get ASTC image header - fread(&header, sizeof(astcHeader), 1, astcFile); + fread(&astcHeader, sizeof(ASTCHeader), 1, astcFile); - if ((header.id[3] != 0x5c) || (header.id[2] != 0xa1) || (header.id[1] != 0xab) || (header.id[0] != 0x13)) + if ((astcHeader.id[3] != 0x5c) || (astcHeader.id[2] != 0xa1) || (astcHeader.id[1] != 0xab) || (astcHeader.id[0] != 0x13)) { TraceLog(WARNING, "[%s] ASTC file does not seem to be a valid image", fileName); } else { // NOTE: Assuming Little Endian (could it be wrong?) - image.width = 0x00000000 | ((int)header.width[2] << 16) | ((int)header.width[1] << 8) | ((int)header.width[0]); - image.height = 0x00000000 | ((int)header.height[2] << 16) | ((int)header.height[1] << 8) | ((int)header.height[0]); + image.width = 0x00000000 | ((int)astcHeader.width[2] << 16) | ((int)astcHeader.width[1] << 8) | ((int)astcHeader.width[0]); + image.height = 0x00000000 | ((int)astcHeader.height[2] << 16) | ((int)astcHeader.height[1] << 8) | ((int)astcHeader.height[0]); // NOTE: ASTC format only contains one mipmap level image.mipmaps = 1; TraceLog(DEBUG, "ASTC image width: %i", image.width); TraceLog(DEBUG, "ASTC image height: %i", image.height); - TraceLog(DEBUG, "ASTC image blocks: %ix%i", header.blockX, header.blockY); + TraceLog(DEBUG, "ASTC image blocks: %ix%i", astcHeader.blockX, astcHeader.blockY); // NOTE: Each block is always stored in 128bit so we can calculate the bpp - int bpp = 128/(header.blockX*header.blockY); + int bpp = 128/(astcHeader.blockX*astcHeader.blockY); // NOTE: Currently we only support 2 blocks configurations: 4x4 and 8x8 if ((bpp == 8) || (bpp == 2)) -- cgit v1.2.3 From 202f45415c98df2201202ba8edb10b6496cbeb62 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Tue, 27 Dec 2016 17:42:22 +0100 Subject: rRES raylib resources custom file format support First version of custom raylib resources file format -IN DEVELOPMENT- --- src/raylib.h | 20 +++ src/rres.h | 444 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 464 insertions(+) create mode 100644 src/rres.h (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 6fd960dc..e2e4ee13 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -602,6 +602,26 @@ typedef enum { HMD_FOVE_VR, } VrDevice; +// rRES data returned when reading a resource, it contains all required data for user (24 byte) +typedef struct { + unsigned int type; // Resource type (4 byte) + + unsigned int param1; // Resouce parameter 1 (4 byte) + unsigned int param2; // Resouce parameter 2 (4 byte) + unsigned int param3; // Resouce parameter 3 (4 byte) + unsigned int param4; // Resouce parameter 4 (4 byte) + + void *data; // Resource data pointer (4 byte) +} RRESData; + +typedef enum { + RRES_RAW = 0, + RRES_IMAGE, + RRES_WAVE, + RRES_VERTEX, + RRES_TEXT +} RRESDataType; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif diff --git a/src/rres.h b/src/rres.h new file mode 100644 index 00000000..dcf7be3f --- /dev/null +++ b/src/rres.h @@ -0,0 +1,444 @@ +/********************************************************************************************** +* +* rres - raylib Resource custom format management functions +* +* Basic functions to load/save rRES resource files +* +* External libs: +* tinfl - DEFLATE decompression functions +* +* Module Configuration Flags: +* +* #define RREM_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* +* +* Copyright (c) 2016-2017 Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#ifndef RRES_H +#define RRES_H + +#if !defined(RRES_STANDALONE) + #include "raylib.h" +#endif + +//#define RRES_STATIC +#ifdef RRES_STATIC + #define RRESDEF static // Functions just visible to module including this file +#else + #ifdef __cplusplus + #define RRESDEF extern "C" // Functions visible from other files (no name mangling of functions in C++) + #else + #define RRESDEF extern // Functions visible from other files + #endif +#endif + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +#define MAX_RESOURCES_SUPPORTED 256 + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +// NOTE: Some types are required for RAYGUI_STANDALONE usage +//---------------------------------------------------------------------------------- +#if defined(RRES_STANDALONE) + // rRES data returned when reading a resource, it contains all required data for user (24 byte) + typedef struct { + unsigned int type; // Resource type (4 byte) + + unsigned int param1; // Resouce parameter 1 (4 byte) + unsigned int param2; // Resouce parameter 2 (4 byte) + unsigned int param3; // Resouce parameter 3 (4 byte) + unsigned int param4; // Resouce parameter 4 (4 byte) + + void *data; // Resource data pointer (4 byte) + } RRESData; + + typedef enum { + RRES_RAW = 0, + RRES_IMAGE, + RRES_WAVE, + RRES_VERTEX, + RRES_TEXT + } RRESDataType; +#endif + +//---------------------------------------------------------------------------------- +// Global variables +//---------------------------------------------------------------------------------- +//... + +//---------------------------------------------------------------------------------- +// Module Functions Declaration +//---------------------------------------------------------------------------------- +RRESDEF RRESData LoadResource(const char *rresFileName); +RRESDEF RRESData LoadResourceById(const char *rresFileName, int rresId); +RRESDEF void UnloadResource(RRESData rres); + +#endif // RRES_H + + +/*********************************************************************************** +* +* RRES IMPLEMENTATION +* +************************************************************************************/ + +#if defined(RRES_IMPLEMENTATION) + +#include // Required for: FILE, fopen(), fclose() + +// Check if custom malloc/free functions defined, if not, using standard ones +#if !defined(RRES_MALLOC) + #include // Required for: malloc(), free() + + #define RRES_MALLOC(size) malloc(size) + #define RRES_FREE(ptr) free(ptr) +#endif + +#include "external/tinfl.c" // Required for: tinfl_decompress_mem_to_mem() + // NOTE: DEFLATE algorythm data decompression + +//---------------------------------------------------------------------------------- +// Defines and Macros +//---------------------------------------------------------------------------------- +//... + +//---------------------------------------------------------------------------------- +// Types and Structures Definition +//---------------------------------------------------------------------------------- + +// rRES file header (8 byte) +typedef struct { + char id[4]; // File identifier: rRES (4 byte) + unsigned short version; // File version and subversion (2 byte) + unsigned short count; // Number of resources in this file (2 byte) +} RRESFileHeader; + +// rRES info header, every resource includes this header (12 byte + 16 byte) +typedef struct { + unsigned short id; // Resource unique identifier (2 byte) + unsigned char dataType; // Resource data type (1 byte) + unsigned char compType; // Resource data compression type (1 byte) + unsigned int dataSize; // Resource data size (compressed or not, only DATA) (4 byte) + unsigned int uncompSize; // Resource data size (uncompressed, only DATA) (4 byte) + + unsigned int param1; // Resouce parameter 1 (4 byte) + unsigned int param2; // Resouce parameter 2 (4 byte) + unsigned int param3; // Resouce parameter 3 (4 byte) + unsigned int param4; // Resouce parameter 4 (4 byte) +} RRESInfoHeader; + +// Compression types +typedef enum { + RRES_COMP_NONE = 0, // No data compression + RRES_COMP_DEFLATE, // DEFLATE compression + RRES_COMP_LZ4, // LZ4 compression + RRES_COMP_LZMA, // LZMA compression + // brotli, zopfli, gzip // Other compression algorythms... +} RRESCompressionType; + +#if defined(RRES_STANDALONE) +typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; +#endif + +//---------------------------------------------------------------------------------- +// Global Variables Definition +//---------------------------------------------------------------------------------- +//... + +//---------------------------------------------------------------------------------- +// Module specific Functions Declaration +//---------------------------------------------------------------------------------- +static void *DecompressData(const unsigned char *data, unsigned long compSize, int uncompSize); + +//---------------------------------------------------------------------------------- +// Module Functions Definition +//---------------------------------------------------------------------------------- + +// Load resource from file (only one) +// NOTE: Returns uncompressed data with parameters, only first resource found +RRESDEF RRESData LoadResource(const char *fileName) +{ + RRESData rres = { 0 }; + + RRESFileHeader fileHeader; + RRESInfoHeader infoHeader; + + FILE *rresFile = fopen(fileName, "rb"); + + if (rresFile == NULL) TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", fileName); + else + { + // Read rres file info header + fread(&fileHeader.id[0], sizeof(char), 1, rresFile); + fread(&fileHeader.id[1], sizeof(char), 1, rresFile); + fread(&fileHeader.id[2], sizeof(char), 1, rresFile); + fread(&fileHeader.id[3], sizeof(char), 1, rresFile); + fread(&fileHeader.version, sizeof(short), 1, rresFile); + fread(&fileHeader.count, sizeof(short), 1, rresFile); + + // Verify "rRES" identifier + if ((fileHeader.id[0] != 'r') && (fileHeader.id[1] != 'R') && (fileHeader.id[2] != 'E') && (fileHeader.id[3] != 'S')) + { + TraceLog(WARNING, "[%s] This is not a valid raylib resource file", fileName); + } + else + { + // Read first resource info and parameters + fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); + + // Register data type and parameters + rres.type = infoHeader.dataType; + rres.param1 = infoHeader.param1; + rres.param2 = infoHeader.param2; + rres.param3 = infoHeader.param3; + rres.param4 = infoHeader.param4; + + // Read resource data block + void *data = RRES_MALLOC(infoHeader.dataSize); + fread(data, infoHeader.dataSize, 1, rresFile); + + if (infoHeader.compType == RRES_COMP_DEFLATE) + { + void *uncompData = DecompressData(data, infoHeader.dataSize, infoHeader.uncompSize); + + rres.data = uncompData; + + RRES_FREE(data); + } + else rres.data = data; + + if (rres.data != NULL) TraceLog(INFO, "[%s] Resource data loaded successfully", fileName); + } + + fclose(rresFile); + } + + return rres; +} + +// Load resource from file by id +// NOTE: Returns uncompressed data with parameters, search resource by id +RRESDEF RRESData LoadResourceById(const char *fileName, int rresId) +{ + RRESData rres = { 0 }; + + RRESFileHeader fileHeader; + RRESInfoHeader infoHeader; + + FILE *rresFile = fopen(fileName, "rb"); + + if (rresFile == NULL) TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", fileName); + else + { + // Read rres file info header + fread(&fileHeader.id[0], sizeof(char), 1, rresFile); + fread(&fileHeader.id[1], sizeof(char), 1, rresFile); + fread(&fileHeader.id[2], sizeof(char), 1, rresFile); + fread(&fileHeader.id[3], sizeof(char), 1, rresFile); + fread(&fileHeader.version, sizeof(short), 1, rresFile); + fread(&fileHeader.count, sizeof(short), 1, rresFile); + + // Verify "rRES" identifier + if ((fileHeader.id[0] != 'r') && (fileHeader.id[1] != 'R') && (fileHeader.id[2] != 'E') && (fileHeader.id[3] != 'S')) + { + TraceLog(WARNING, "[%s] This is not a valid raylib resource file", fileName); + } + else + { + for (int i = 0; i < fileHeader.count; i++) + { + // Read resource info and parameters + fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); + + if (infoHeader.id == rresId) + { + // Register data type and parameters + rres.type = infoHeader.dataType; + rres.param1 = infoHeader.param1; + rres.param2 = infoHeader.param2; + rres.param3 = infoHeader.param3; + rres.param4 = infoHeader.param4; + + // Read resource data block + void *data = RRES_MALLOC(infoHeader.dataSize); + fread(data, infoHeader.dataSize, 1, rresFile); + + if (infoHeader.compType == RRES_COMP_DEFLATE) + { + void *uncompData = DecompressData(data, infoHeader.dataSize, infoHeader.uncompSize); + + rres.data = uncompData; + + RRES_FREE(data); + } + else rres.data = data; + + if (rres.data != NULL) TraceLog(INFO, "[%s][ID %i] Resource data loaded successfully", fileName, (int)rresId); + } + else + { + // Skip required data to read next resource infoHeader + fseek(rresFile, infoHeader.dataSize, SEEK_CUR); + } + } + + if (rres.data == NULL) TraceLog(WARNING, "[%s][ID %i] Requested resource could not be found, wrong id?", fileName, (int)rresId); + } + + fclose(rresFile); + } + + return rres; +} + +RRESDEF void UnloadResource(RRESData rres) +{ + if (rres.data != NULL) free(rres.data); +} + +//---------------------------------------------------------------------------------- +// Module specific Functions Definition +//---------------------------------------------------------------------------------- + +// Data decompression function +// NOTE: Allocated data MUST be freed by user +static void *DecompressData(const unsigned char *data, unsigned long compSize, int uncompSize) +{ + int tempUncompSize; + void *uncompData; + + // Allocate buffer to hold decompressed data + uncompData = (mz_uint8 *)RRES_MALLOC((size_t)uncompSize); + + // Check correct memory allocation + if (uncompData == NULL) + { + TraceLog(WARNING, "Out of memory while decompressing data"); + } + else + { + // Decompress data + tempUncompSize = tinfl_decompress_mem_to_mem(uncompData, (size_t)uncompSize, data, compSize, 1); + + if (tempUncompSize == -1) + { + TraceLog(WARNING, "Data decompression failed"); + RRES_FREE(uncompData); + } + + if (uncompSize != (int)tempUncompSize) + { + TraceLog(WARNING, "Expected uncompressed size do not match, data may be corrupted"); + TraceLog(WARNING, " -- Expected uncompressed size: %i", uncompSize); + TraceLog(WARNING, " -- Returned uncompressed size: %i", tempUncompSize); + } + + TraceLog(INFO, "Data decompressed successfully from %u bytes to %u bytes", (mz_uint32)compSize, (mz_uint32)tempUncompSize); + } + + return uncompData; +} + + +// Some required functions for rres standalone module version +#if defined(RRES_STANDALONE) +// Outputs a trace log message (INFO, ERROR, WARNING) +// NOTE: If a file has been init, output log is written there +void TraceLog(int msgType, const char *text, ...) +{ + va_list args; + int traceDebugMsgs = 0; + +#ifdef DO_NOT_TRACE_DEBUG_MSGS + traceDebugMsgs = 0; +#endif + + switch (msgType) + { + case INFO: fprintf(stdout, "INFO: "); break; + case ERROR: fprintf(stdout, "ERROR: "); break; + case WARNING: fprintf(stdout, "WARNING: "); break; + case DEBUG: if (traceDebugMsgs) fprintf(stdout, "DEBUG: "); break; + default: break; + } + + if ((msgType != DEBUG) || ((msgType == DEBUG) && (traceDebugMsgs))) + { + va_start(args, text); + vfprintf(stdout, text, args); + va_end(args); + + fprintf(stdout, "\n"); + } + + if (msgType == ERROR) exit(1); // If ERROR message, exit program +} +#endif + +#endif // RAYGUI_IMPLEMENTATION + + +/* +//T LoadResource(const char *rresFileName, int resId); + +// ASSUMPTION: rRES files only contain one resource (solution to id requirement...) + +// Now, rres file check and data loading can be managed inside each function: +Image LoadImage(); // -> Texture2D +Wave LoadWave() // -> Sound, Music +const char *LoadText(); // -> Shader, Material + +// NOTE: RRESData uses void* data pointer, so we can load to image.data, wave.data, mesh.*, (unsigned char *) + +Image LoadImagePro(void *data, int width, int height, int format); +Image LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); + +Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData); +Mesh LoadMeshEx(rres.param1, rres.data, rres.data + offset, rres.data + offset*2, rres.data + offset*3); + +Shader LoadShaderV(const char *vsText, int vsLength); +Shader LoadShaderV(rres.data, rres.param1); + +Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); +Wave LoadWaveEx(rres.data, rres.param1, (int)rres.param2, (int)rres.param3, (int)rres.param4); + +// Max value for an unsigned short: 65535 + +// Parameters information depending on resource type (IMAGE, WAVE, MESH, TEXT) + +// Image data params +int imgWidth, imgHeight; +char colorFormat, mipmaps; + +// Wave data params +short sampleRate, bps; +char channels, reserved; + +// Mesh data params +int vertexCount, reserved; +short vertexTypesMask, vertexFormatsMask; + +// Text data params +int numChars; +char textFormat, language, charsetCode; +*/ \ No newline at end of file -- cgit v1.2.3 From 674ee2cf752aa31d688210418a4ceb349afdce38 Mon Sep 17 00:00:00 2001 From: Joel Davis Date: Sat, 31 Dec 2016 14:05:30 -0800 Subject: Fix vbo indexes for rlglUpdateMesh --- src/rlgl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index cb1ac709..9770b647 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -1950,27 +1950,27 @@ void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) } break; case 2: // Update normals (vertex normals) { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.normals, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.normals); } break; case 3: // Update colors (vertex colors) { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*numVertex, mesh.colors, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*numVertex, mesh.colors); } break; case 4: // Update tangents (vertex tangents) { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[4]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.tangents, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.tangents); } break; case 5: // Update texcoords2 (vertex second texture coordinates) { - glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); + glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[5]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*numVertex, mesh.texcoords2, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*2*numVertex, mesh.texcoords2); } break; -- cgit v1.2.3 From 037da8879a3ae61b09d8388bc2b4a2fe5359256a Mon Sep 17 00:00:00 2001 From: Joel Davis Date: Sat, 31 Dec 2016 15:06:39 -0800 Subject: Added RaycastGround and ray picking example --- src/raylib.h | 15 +++++++++++++++ src/shapes.c | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index e2e4ee13..f291ce85 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -97,6 +97,9 @@ #define DEG2RAD (PI/180.0f) #define RAD2DEG (180.0f/PI) +// A small number +#define EPSILON 0.000001 + // raylib Config Flags #define FLAG_FULLSCREEN_MODE 1 #define FLAG_RESIZABLE_WINDOW 2 @@ -491,6 +494,13 @@ typedef struct Ray { Vector3 direction; // Ray direction } Ray; +// Information returned from a raycast +typedef struct RayHitInfo { + bool hit; // Did the ray hit something? + Vector3 hitPosition; // Position of nearest hit + Vector3 hitNormal; // Surface normal of hit +} RayHitInfo; + // Wave type, defines audio wave data typedef struct Wave { unsigned int sampleCount; // Number of samples @@ -910,6 +920,11 @@ RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphe Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box +//------------------------------------------------------------------------------------ +// Ray Casts +//------------------------------------------------------------------------------------ +RLAPI RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ); + //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 diff --git a/src/shapes.c b/src/shapes.c index 3d3333c1..4b2de4f2 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -533,4 +533,24 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) } return retRec; +} + + +RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ) +{ + RayHitInfo result = {0}; + + if (fabs(ray.direction.y) > EPSILON) + { + float t = (ray.position.y - groundHeight) / -ray.direction.y; + if (t >= 0.0) { + Vector3 camDir = ray.direction; + VectorScale( &camDir, t ); + result.hit = true; + result.hitNormal = (Vector3){ 0.0, 1.0, 0.0}; + result.hitPosition = VectorAdd( ray.position, camDir ); + } + } + + return result; } \ No newline at end of file -- cgit v1.2.3 From d5d391faaf69027b8fecb26f30754c3bff83c311 Mon Sep 17 00:00:00 2001 From: Joel Davis Date: Mon, 2 Jan 2017 21:56:25 -0800 Subject: Added RaycastMesh function and example test case --- src/models.c | 38 +++++++++++++++++++++++++++++++ src/raylib.h | 3 +++ src/raymath.h | 26 +++++++++++++++++++++ src/shapes.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 134 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index a2043913..41e527dc 100644 --- a/src/models.c +++ b/src/models.c @@ -1918,3 +1918,41 @@ static Material LoadMTL(const char *fileName) return material; } + +RayHitInfo RaycastMesh( Ray ray, Mesh *mesh ) +{ + RayHitInfo result = {0}; + + // If mesh doesn't have vertex data on CPU, can't test it. + if (!mesh->vertices) { + return result; + } + + // mesh->triangleCount may not be set, vertexCount is more reliable + int triangleCount = mesh->vertexCount / 3; + + // Test against all triangles in mesh + for (int i=0; i < triangleCount; i++) { + Vector3 a, b, c; + Vector3 *vertdata = (Vector3*)mesh->vertices; + if (mesh->indices) { + a = vertdata[ mesh->indices[i*3+0] ]; + b = vertdata[ mesh->indices[i*3+1] ]; + c = vertdata[ mesh->indices[i*3+2] ]; + } else { + a = vertdata[i*3+0]; + b = vertdata[i*3+1]; + c = vertdata[i*3+2]; + } + + RayHitInfo triHitInfo = RaycastTriangle( ray, a, b, c ); + if (triHitInfo.hit) { + // Save the closest hit triangle + if ((!result.hit)||(result.distance > triHitInfo.distance)) { + result = triHitInfo; + } + } + } + + return result; +} diff --git a/src/raylib.h b/src/raylib.h index f291ce85..7252ba4e 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -497,6 +497,7 @@ typedef struct Ray { // Information returned from a raycast typedef struct RayHitInfo { bool hit; // Did the ray hit something? + float distance; // Distance to nearest hit Vector3 hitPosition; // Position of nearest hit Vector3 hitNormal; // Surface normal of hit } RayHitInfo; @@ -924,6 +925,8 @@ RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Ray Casts //------------------------------------------------------------------------------------ RLAPI RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ); +RLAPI RayHitInfo RaycastTriangle( Ray ray, Vector3 a, Vector3 b, Vector3 c ); +RLAPI RayHitInfo RaycastMesh( Ray ray, Mesh *mesh ); //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) diff --git a/src/raymath.h b/src/raymath.h index 3cd1394e..5871e350 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -130,6 +130,7 @@ RMDEF void VectorTransform(Vector3 *v, Matrix mat); // Transforms a Ve RMDEF Vector3 VectorZero(void); // Return a Vector3 init to zero RMDEF Vector3 VectorMin(Vector3 vec1, Vector3 vec2); // Return min value for each pair of components RMDEF Vector3 VectorMax(Vector3 vec1, Vector3 vec2); // Return max value for each pair of components +RMDEF Vector3 Barycentric(Vector3 p, Vector3 a, Vector3 b, Vector3 c); // Barycentric coords for p in triangle abc //------------------------------------------------------------------------------------ // Functions Declaration to work with Matrix @@ -382,6 +383,31 @@ RMDEF Vector3 VectorMax(Vector3 vec1, Vector3 vec2) return result; } +// Compute barycentric coordinates (u, v, w) for +// point p with respect to triangle (a, b, c) +// Assumes P is on the plane of the triangle +RMDEF Vector3 Barycentric(Vector3 p, Vector3 a, Vector3 b, Vector3 c) +{ + + //Vector v0 = b - a, v1 = c - a, v2 = p - a; + Vector3 v0 = VectorSubtract( b, a ); + Vector3 v1 = VectorSubtract( c, a ); + Vector3 v2 = VectorSubtract( p, a ); + float d00 = VectorDotProduct(v0, v0); + float d01 = VectorDotProduct(v0, v1); + float d11 = VectorDotProduct(v1, v1); + float d20 = VectorDotProduct(v2, v0); + float d21 = VectorDotProduct(v2, v1); + float denom = d00 * d11 - d01 * d01; + + Vector3 result; + result.y = (d11 * d20 - d01 * d21) / denom; + result.z = (d00 * d21 - d01 * d20) / denom; + result.x = 1.0f - (result.z + result.y); + + return result; +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Matrix math //---------------------------------------------------------------------------------- diff --git a/src/shapes.c b/src/shapes.c index 4b2de4f2..74480c83 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -544,13 +544,74 @@ RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ) { float t = (ray.position.y - groundHeight) / -ray.direction.y; if (t >= 0.0) { - Vector3 camDir = ray.direction; - VectorScale( &camDir, t ); - result.hit = true; - result.hitNormal = (Vector3){ 0.0, 1.0, 0.0}; - result.hitPosition = VectorAdd( ray.position, camDir ); + Vector3 rayDir = ray.direction; + VectorScale( &rayDir, t ); + result.hit = true; + result.distance = t; + result.hitNormal = (Vector3){ 0.0, 1.0, 0.0}; + result.hitPosition = VectorAdd( ray.position, rayDir ); } } + return result; +} +// Adapted from: +// https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm +RayHitInfo RaycastTriangle( Ray ray, Vector3 a, Vector3 b, Vector3 c ) +{ + Vector3 e1, e2; //Edge1, Edge2 + Vector3 p, q, tv; + float det, inv_det, u, v; + float t; + RayHitInfo result = {0}; + + //Find vectors for two edges sharing V1 + e1 = VectorSubtract( b, a); + e2 = VectorSubtract( c, a); + + //Begin calculating determinant - also used to calculate u parameter + p = VectorCrossProduct( ray.direction, e2); + + //if determinant is near zero, ray lies in plane of triangle or ray is parallel to plane of triangle + det = VectorDotProduct(e1, p); + + //NOT CULLING + if(det > -EPSILON && det < EPSILON) return result; + inv_det = 1.f / det; + + //calculate distance from V1 to ray origin + tv = VectorSubtract( ray.position, a ); + + //Calculate u parameter and test bound + u = VectorDotProduct(tv, p) * inv_det; + + //The intersection lies outside of the triangle + if(u < 0.f || u > 1.f) return result; + + //Prepare to test v parameter + q = VectorCrossProduct( tv, e1 ); + + //Calculate V parameter and test bound + v = VectorDotProduct( ray.direction, q) * inv_det; + + //The intersection lies outside of the triangle + if(v < 0.f || (u + v) > 1.f) return result; + + t = VectorDotProduct(e2, q) * inv_det; + + + if(t > EPSILON) { + // ray hit, get hit point and normal + result.hit = true; + result.distance = t; + result.hit = true; + result.hitNormal = VectorCrossProduct( e1, e2 ); + VectorNormalize( &result.hitNormal ); + Vector3 rayDir = ray.direction; + VectorScale( &rayDir, t ); + result.hitPosition = VectorAdd( ray.position, rayDir ); + } + return result; -} \ No newline at end of file +} + -- cgit v1.2.3 From 658c2806690ace34a0dae6b6ed12d0ea52d2d6e4 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 5 Jan 2017 19:33:05 +0100 Subject: Lattest PR review Function names, code formatting... --- src/models.c | 167 +++++++++++++++++++++++++++++++++++++++++++++------------- src/raylib.h | 21 +++----- src/raymath.h | 25 ++++----- src/shapes.c | 81 ---------------------------- 4 files changed, 149 insertions(+), 145 deletions(-) (limited to 'src') diff --git a/src/models.c b/src/models.c index 41e527dc..0673874b 100644 --- a/src/models.c +++ b/src/models.c @@ -1474,6 +1474,135 @@ bool CheckCollisionRayBox(Ray ray, BoundingBox box) return collision; } +// Get collision info between ray and mesh +RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh) +{ + RayHitInfo result = { 0 }; + + // If mesh doesn't have vertex data on CPU, can't test it. + if (!mesh->vertices) return result; + + // mesh->triangleCount may not be set, vertexCount is more reliable + int triangleCount = mesh->vertexCount/3; + + // Test against all triangles in mesh + for (int i = 0; i < triangleCount; i++) + { + Vector3 a, b, c; + Vector3 *vertdata = (Vector3 *)mesh->vertices; + + if (mesh->indices) + { + a = vertdata[mesh->indices[i*3 + 0]]; + b = vertdata[mesh->indices[i*3 + 1]]; + c = vertdata[mesh->indices[i*3 + 2]]; + } + else + { + a = vertdata[i*3 + 0]; + b = vertdata[i*3 + 1]; + c = vertdata[i*3 + 2]; + } + + RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, a, b, c); + + if (triHitInfo.hit) + { + // Save the closest hit triangle + if ((!result.hit) || (result.distance > triHitInfo.distance)) result = triHitInfo; + } + } + + return result; +} + +// Get collision info between ray and triangle +// NOTE: Based on https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm +RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) +{ + #define EPSILON 0.000001 // A small number + + Vector3 edge1, edge2; + Vector3 p, q, tv; + float det, invDet, u, v, t; + RayHitInfo result = {0}; + + // Find vectors for two edges sharing V1 + edge1 = VectorSubtract(p2, p1); + edge2 = VectorSubtract(p3, p1); + + // Begin calculating determinant - also used to calculate u parameter + p = VectorCrossProduct(ray.direction, edge2); + + // If determinant is near zero, ray lies in plane of triangle or ray is parallel to plane of triangle + det = VectorDotProduct(edge1, p); + + // Avoid culling! + if ((det > -EPSILON) && (det < EPSILON)) return result; + + invDet = 1.0f/det; + + // Calculate distance from V1 to ray origin + tv = VectorSubtract(ray.position, p1); + + // Calculate u parameter and test bound + u = VectorDotProduct(tv, p)*invDet; + + // The intersection lies outside of the triangle + if ((u < 0.0f) || (u > 1.0f)) return result; + + // Prepare to test v parameter + q = VectorCrossProduct(tv, edge1); + + // Calculate V parameter and test bound + v = VectorDotProduct(ray.direction, q)*invDet; + + // The intersection lies outside of the triangle + if ((v < 0.0f) || ((u + v) > 1.0f)) return result; + + t = VectorDotProduct(edge2, q)*invDet; + + if (t > EPSILON) + { + // Ray hit, get hit point and normal + result.hit = true; + result.distance = t; + result.hit = true; + result.hitNormal = VectorCrossProduct(edge1, edge2); + VectorNormalize(&result.hitNormal); + Vector3 rayDir = ray.direction; + VectorScale(&rayDir, t); + result.hitPosition = VectorAdd(ray.position, rayDir); + } + + return result; +} + +// Get collision info between ray and ground plane (Y-normal plane) +RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) +{ + #define EPSILON 0.000001 // A small number + + RayHitInfo result = { 0 }; + + if (fabsf(ray.direction.y) > EPSILON) + { + float t = (ray.position.y - groundHeight)/-ray.direction.y; + + if (t >= 0.0) + { + Vector3 rayDir = ray.direction; + VectorScale(&rayDir, t); + result.hit = true; + result.distance = t; + result.hitNormal = (Vector3){ 0.0, 1.0, 0.0 }; + result.hitPosition = VectorAdd(ray.position, rayDir); + } + } + + return result; +} + // Calculate mesh bounding box limits // NOTE: minVertex and maxVertex should be transformed by model transform matrix (position, scale, rotate) BoundingBox CalculateBoundingBox(Mesh mesh) @@ -1918,41 +2047,3 @@ static Material LoadMTL(const char *fileName) return material; } - -RayHitInfo RaycastMesh( Ray ray, Mesh *mesh ) -{ - RayHitInfo result = {0}; - - // If mesh doesn't have vertex data on CPU, can't test it. - if (!mesh->vertices) { - return result; - } - - // mesh->triangleCount may not be set, vertexCount is more reliable - int triangleCount = mesh->vertexCount / 3; - - // Test against all triangles in mesh - for (int i=0; i < triangleCount; i++) { - Vector3 a, b, c; - Vector3 *vertdata = (Vector3*)mesh->vertices; - if (mesh->indices) { - a = vertdata[ mesh->indices[i*3+0] ]; - b = vertdata[ mesh->indices[i*3+1] ]; - c = vertdata[ mesh->indices[i*3+2] ]; - } else { - a = vertdata[i*3+0]; - b = vertdata[i*3+1]; - c = vertdata[i*3+2]; - } - - RayHitInfo triHitInfo = RaycastTriangle( ray, a, b, c ); - if (triHitInfo.hit) { - // Save the closest hit triangle - if ((!result.hit)||(result.distance > triHitInfo.distance)) { - result = triHitInfo; - } - } - } - - return result; -} diff --git a/src/raylib.h b/src/raylib.h index 7252ba4e..fa4f44e6 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -97,9 +97,6 @@ #define DEG2RAD (PI/180.0f) #define RAD2DEG (180.0f/PI) -// A small number -#define EPSILON 0.000001 - // raylib Config Flags #define FLAG_FULLSCREEN_MODE 1 #define FLAG_RESIZABLE_WINDOW 2 @@ -496,10 +493,10 @@ typedef struct Ray { // Information returned from a raycast typedef struct RayHitInfo { - bool hit; // Did the ray hit something? - float distance; // Distance to nearest hit - Vector3 hitPosition; // Position of nearest hit - Vector3 hitNormal; // Surface normal of hit + bool hit; // Did the ray hit something? + float distance; // Distance to nearest hit + Vector3 hitPosition; // Position of nearest hit + Vector3 hitNormal; // Surface normal of hit } RayHitInfo; // Wave type, defines audio wave data @@ -920,13 +917,9 @@ RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphere RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box - -//------------------------------------------------------------------------------------ -// Ray Casts -//------------------------------------------------------------------------------------ -RLAPI RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ); -RLAPI RayHitInfo RaycastTriangle( Ray ray, Vector3 a, Vector3 b, Vector3 c ); -RLAPI RayHitInfo RaycastMesh( Ray ray, Mesh *mesh ); +RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh +RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) //------------------------------------------------------------------------------------ // Shaders System Functions (Module: rlgl) diff --git a/src/raymath.h b/src/raymath.h index 5871e350..c073b72d 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -130,7 +130,7 @@ RMDEF void VectorTransform(Vector3 *v, Matrix mat); // Transforms a Ve RMDEF Vector3 VectorZero(void); // Return a Vector3 init to zero RMDEF Vector3 VectorMin(Vector3 vec1, Vector3 vec2); // Return min value for each pair of components RMDEF Vector3 VectorMax(Vector3 vec1, Vector3 vec2); // Return max value for each pair of components -RMDEF Vector3 Barycentric(Vector3 p, Vector3 a, Vector3 b, Vector3 c); // Barycentric coords for p in triangle abc +RMDEF Vector3 Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c); // Barycenter coords for p in triangle abc //------------------------------------------------------------------------------------ // Functions Declaration to work with Matrix @@ -383,26 +383,27 @@ RMDEF Vector3 VectorMax(Vector3 vec1, Vector3 vec2) return result; } -// Compute barycentric coordinates (u, v, w) for -// point p with respect to triangle (a, b, c) -// Assumes P is on the plane of the triangle -RMDEF Vector3 Barycentric(Vector3 p, Vector3 a, Vector3 b, Vector3 c) +// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c) +// NOTE: Assumes P is on the plane of the triangle +RMDEF Vector3 Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c) { - //Vector v0 = b - a, v1 = c - a, v2 = p - a; - Vector3 v0 = VectorSubtract( b, a ); - Vector3 v1 = VectorSubtract( c, a ); - Vector3 v2 = VectorSubtract( p, a ); + + Vector3 v0 = VectorSubtract(b, a); + Vector3 v1 = VectorSubtract(c, a); + Vector3 v2 = VectorSubtract(p, a); float d00 = VectorDotProduct(v0, v0); float d01 = VectorDotProduct(v0, v1); float d11 = VectorDotProduct(v1, v1); float d20 = VectorDotProduct(v2, v0); float d21 = VectorDotProduct(v2, v1); - float denom = d00 * d11 - d01 * d01; + + float denom = d00*d11 - d01*d01; Vector3 result; - result.y = (d11 * d20 - d01 * d21) / denom; - result.z = (d00 * d21 - d01 * d20) / denom; + + result.y = (d11*d20 - d01*d21)/denom; + result.z = (d00*d21 - d01*d20)/denom; result.x = 1.0f - (result.z + result.y); return result; diff --git a/src/shapes.c b/src/shapes.c index 74480c83..8c6c4be0 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -534,84 +534,3 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) return retRec; } - - -RayHitInfo RaycastGroundPlane( Ray ray, float groundHeight ) -{ - RayHitInfo result = {0}; - - if (fabs(ray.direction.y) > EPSILON) - { - float t = (ray.position.y - groundHeight) / -ray.direction.y; - if (t >= 0.0) { - Vector3 rayDir = ray.direction; - VectorScale( &rayDir, t ); - result.hit = true; - result.distance = t; - result.hitNormal = (Vector3){ 0.0, 1.0, 0.0}; - result.hitPosition = VectorAdd( ray.position, rayDir ); - } - } - return result; -} -// Adapted from: -// https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm -RayHitInfo RaycastTriangle( Ray ray, Vector3 a, Vector3 b, Vector3 c ) -{ - Vector3 e1, e2; //Edge1, Edge2 - Vector3 p, q, tv; - float det, inv_det, u, v; - float t; - RayHitInfo result = {0}; - - //Find vectors for two edges sharing V1 - e1 = VectorSubtract( b, a); - e2 = VectorSubtract( c, a); - - //Begin calculating determinant - also used to calculate u parameter - p = VectorCrossProduct( ray.direction, e2); - - //if determinant is near zero, ray lies in plane of triangle or ray is parallel to plane of triangle - det = VectorDotProduct(e1, p); - - //NOT CULLING - if(det > -EPSILON && det < EPSILON) return result; - inv_det = 1.f / det; - - //calculate distance from V1 to ray origin - tv = VectorSubtract( ray.position, a ); - - //Calculate u parameter and test bound - u = VectorDotProduct(tv, p) * inv_det; - - //The intersection lies outside of the triangle - if(u < 0.f || u > 1.f) return result; - - //Prepare to test v parameter - q = VectorCrossProduct( tv, e1 ); - - //Calculate V parameter and test bound - v = VectorDotProduct( ray.direction, q) * inv_det; - - //The intersection lies outside of the triangle - if(v < 0.f || (u + v) > 1.f) return result; - - t = VectorDotProduct(e2, q) * inv_det; - - - if(t > EPSILON) { - // ray hit, get hit point and normal - result.hit = true; - result.distance = t; - - result.hit = true; - result.hitNormal = VectorCrossProduct( e1, e2 ); - VectorNormalize( &result.hitNormal ); - Vector3 rayDir = ray.direction; - VectorScale( &rayDir, t ); - result.hitPosition = VectorAdd( ray.position, rayDir ); - } - - return result; -} - -- cgit v1.2.3 From d4f5c4e1332c5ec3c5a1f61c3e6b8f59359ed045 Mon Sep 17 00:00:00 2001 From: "Richard R. Goodwin" Date: Thu, 5 Jan 2017 21:20:28 +0000 Subject: modified: src/core.c --- src/core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index 147010f5..10b1be57 100644 --- a/src/core.c +++ b/src/core.c @@ -121,6 +121,7 @@ // Old device inputs system #define DEFAULT_KEYBOARD_DEV STDIN_FILENO // Standard input #define DEFAULT_MOUSE_DEV "/dev/input/mouse0" // Mouse input + #define DEFAULT_TOUCH_DEV "/dev/input/event4" // Touch input #define DEFAULT_GAMEPAD_DEV "/dev/input/js" // Gamepad input (base dev for all gamepads: js0, js1, ...) // New device input events (evdev) (must be detected) -- cgit v1.2.3 From 21181f8167975d1ffc13ddd154f1731ece208fbe Mon Sep 17 00:00:00 2001 From: "Richard R. Goodwin" Date: Thu, 5 Jan 2017 21:36:40 +0000 Subject: added RPi touch interface --- src/core.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 10b1be57..fdf5d48d 100644 --- a/src/core.c +++ b/src/core.c @@ -121,7 +121,7 @@ // Old device inputs system #define DEFAULT_KEYBOARD_DEV STDIN_FILENO // Standard input #define DEFAULT_MOUSE_DEV "/dev/input/mouse0" // Mouse input - #define DEFAULT_TOUCH_DEV "/dev/input/event4" // Touch input + #define DEFAULT_TOUCH_DEV "/dev/input/event4" // Touch input virtual device (created by ts_uinput) #define DEFAULT_GAMEPAD_DEV "/dev/input/js" // Gamepad input (base dev for all gamepads: js0, js1, ...) // New device input events (evdev) (must be detected) @@ -175,6 +175,11 @@ static int mouseStream = -1; // Mouse device file descriptor static bool mouseReady = false; // Flag to know if mouse is ready static pthread_t mouseThreadId; // Mouse reading thread id +// Touch input variables +static int touchStream = -1; // Touch device file descriptor +static bool touchReady = false; // Flag to know if touch interface is ready +static pthread_t touchThreadId; // Touch reading thread id + // Gamepad input variables static int gamepadStream[MAX_GAMEPADS] = { -1 };// Gamepad device file descriptor static pthread_t gamepadThreadId; // Gamepad reading thread id @@ -302,6 +307,8 @@ static void ProcessKeyboard(void); // Process keyboard even static void RestoreKeyboard(void); // Restore keyboard system static void InitMouse(void); // Mouse initialization (including mouse thread) static void *MouseThread(void *arg); // Mouse reading thread +static void InitTouch(void); // Touch device initialization (including touch thread) +static void *TouchThread(void *arg); // Touch device reading thread static void InitGamepad(void); // Init raw gamepad input static void *GamepadThread(void *arg); // Mouse reading thread #endif @@ -333,6 +340,7 @@ void InitWindow(int width, int height, const char *title) #if defined(PLATFORM_RPI) // Init raw input system InitMouse(); // Mouse init + InitTouch(); // Touch init InitKeyboard(); // Keyboard init InitGamepad(); // Gamepad init #endif @@ -474,6 +482,7 @@ void CloseWindow(void) windowShouldClose = true; // Added to force threads to exit when the close window is called pthread_join(mouseThreadId, NULL); + pthread_join(touchThreadId, NULL); pthread_join(gamepadThreadId, NULL); #endif @@ -2875,6 +2884,55 @@ static void *MouseThread(void *arg) return NULL; } +// Touch initialization (including touch thread) +static void InitTouch(void) +{ + if ((touchStream = open(DEFAULT_TOUCH_DEV, O_RDONLY|O_NONBLOCK)) < 0) + { + TraceLog(WARNING, "Touch device could not be opened, no touchscreen available"); + } + else + { + touchReady = true; + + int error = pthread_create(&touchThreadId, NULL, &TouchThread, NULL); + + if (error != 0) TraceLog(WARNING, "Error creating touch input event thread"); + else TraceLog(INFO, "Touch device initialized successfully"); + } +} + +// Touch reading thread. +// This reads from a Virtual Input Event /dev/input/event4 which is +// created by the ts_uinput daemon. This takes, filters and scales +// raw input from the Touchscreen (which appears in /dev/input/event3) +// based on the Calibration data referenced by tslib. +static void *TouchThread(void *arg) +{ + struct input_event ev; + + while (!windowShouldClose) + { + if (read(touchStream, &ev, sizeof(ev)) == (int)sizeof(ev)) + { + + // if pressure > 0 then simulate left mouse button click + if (ev.type == EV_ABS && ev.code == 24 && ev.value == 0) currentMouseState[0] = 0; + if (ev.type == EV_ABS && ev.code == 24 && ev.value > 0) currentMouseState[0] = 1; + // x & y values supplied by event4 have been scaled & de-jittered using tslib calibration data + if (ev.type == EV_ABS && ev.code == 0) mousePosition.x = ev.value; + if (ev.type == EV_ABS && ev.code == 1) mousePosition.y = ev.value; + + if (mousePosition.x < 0) mousePosition.x = 0; + if (mousePosition.y < 0) mousePosition.y = 0; + + if (mousePosition.x > screenWidth) mousePosition.x = screenWidth; + if (mousePosition.y > screenHeight) mousePosition.y = screenHeight; + } + } + return NULL; +} + // Init gamepad system static void InitGamepad(void) { -- cgit v1.2.3 From fbda9c4180a8043d568bc791d96b0236fcb8219a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 7 Jan 2017 18:12:59 +0100 Subject: Support rRES data loading --- src/audio.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 944d1b9d..989512c0 100644 --- a/src/audio.c +++ b/src/audio.c @@ -219,6 +219,17 @@ Wave LoadWave(const char *fileName) if (strcmp(GetExtension(fileName), "wav") == 0) wave = LoadWAV(fileName); else if (strcmp(GetExtension(fileName), "ogg") == 0) wave = LoadOGG(fileName); else if (strcmp(GetExtension(fileName), "flac") == 0) wave = LoadFLAC(fileName); + else if (strcmp(GetExtension(fileName),"rres") == 0) + { + RRESData rres = LoadResource(fileName); + + // NOTE: Parameters for RRES_WAVE type are: sampleCount, sampleRate, sampleSize, channels + + if (rres.type == RRES_WAVE) wave = LoadWaveEx(rres.data, rres.param1, rres.param2, rres.param3, rres.param4); + else TraceLog(WARNING, "[%s] Resource file does not contain wave data", fileName); + + UnloadResource(rres); + } else TraceLog(WARNING, "[%s] File extension not recognized, it can't be loaded", fileName); return wave; -- cgit v1.2.3 From 07a2c00e842723970ace9eb0154e838b47d3fe82 Mon Sep 17 00:00:00 2001 From: AudioMorphology Date: Sat, 14 Jan 2017 16:18:06 +0000 Subject: modified: core.c --- src/core.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index fdf5d48d..424e5725 100644 --- a/src/core.c +++ b/src/core.c @@ -2910,24 +2910,79 @@ static void InitTouch(void) static void *TouchThread(void *arg) { struct input_event ev; + GestureEvent gestureEvent; while (!windowShouldClose) { if (read(touchStream, &ev, sizeof(ev)) == (int)sizeof(ev)) { - // if pressure > 0 then simulate left mouse button click - if (ev.type == EV_ABS && ev.code == 24 && ev.value == 0) currentMouseState[0] = 0; - if (ev.type == EV_ABS && ev.code == 24 && ev.value > 0) currentMouseState[0] = 1; + if (ev.type == EV_ABS && ev.code == 24 && ev.value == 0 && currentMouseState[0] == 1) + { + currentMouseState[0] = 0; + gestureEvent.touchAction = TOUCH_UP; + gestureEvent.pointCount = 1; + gestureEvent.pointerId[0] = 0; + gestureEvent.pointerId[1] = 1; + gestureEvent.position[0] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[1] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + gestureEvent.position[1].x /= (float)GetScreenWidth(); + gestureEvent.position[1].y /= (float)GetScreenHeight(); + ProcessGestureEvent(gestureEvent); + } + if (ev.type == EV_ABS && ev.code == 24 && ev.value > 0 && currentMouseState[0] == 0) + { + currentMouseState[0] = 1; + gestureEvent.touchAction = TOUCH_DOWN; + gestureEvent.pointCount = 1; + gestureEvent.pointerId[0] = 0; + gestureEvent.pointerId[1] = 1; + gestureEvent.position[0] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[1] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + gestureEvent.position[1].x /= (float)GetScreenWidth(); + gestureEvent.position[1].y /= (float)GetScreenHeight(); + ProcessGestureEvent(gestureEvent); + } // x & y values supplied by event4 have been scaled & de-jittered using tslib calibration data - if (ev.type == EV_ABS && ev.code == 0) mousePosition.x = ev.value; - if (ev.type == EV_ABS && ev.code == 1) mousePosition.y = ev.value; - - if (mousePosition.x < 0) mousePosition.x = 0; - if (mousePosition.y < 0) mousePosition.y = 0; - - if (mousePosition.x > screenWidth) mousePosition.x = screenWidth; - if (mousePosition.y > screenHeight) mousePosition.y = screenHeight; + if (ev.type == EV_ABS && ev.code == 0) + { + mousePosition.x = ev.value; + if (mousePosition.x < 0) mousePosition.x = 0; + if (mousePosition.x > screenWidth) mousePosition.x = screenWidth; + gestureEvent.touchAction = TOUCH_MOVE; + gestureEvent.pointCount = 1; + gestureEvent.pointerId[0] = 0; + gestureEvent.pointerId[1] = 1; + gestureEvent.position[0] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[1] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + gestureEvent.position[1].x /= (float)GetScreenWidth(); + gestureEvent.position[1].y /= (float)GetScreenHeight(); + ProcessGestureEvent(gestureEvent); + } + if (ev.type == EV_ABS && ev.code == 1) + { + mousePosition.y = ev.value; + if (mousePosition.y < 0) mousePosition.y = 0; + if (mousePosition.y > screenHeight) mousePosition.y = screenHeight; + gestureEvent.touchAction = TOUCH_MOVE; + gestureEvent.pointCount = 1; + gestureEvent.pointerId[0] = 0; + gestureEvent.pointerId[1] = 1; + gestureEvent.position[0] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[1] = (Vector2){ mousePosition.x, mousePosition.y }; + gestureEvent.position[0].x /= (float)GetScreenWidth(); + gestureEvent.position[0].y /= (float)GetScreenHeight(); + gestureEvent.position[1].x /= (float)GetScreenWidth(); + gestureEvent.position[1].y /= (float)GetScreenHeight(); + ProcessGestureEvent(gestureEvent); + } + } } return NULL; -- cgit v1.2.3 From 4a158d972d9d110fcb581bc9f6583d05a2dc2544 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 15 Jan 2017 01:09:15 +0100 Subject: Added LoadText() function Actually, renamed ReadTextFile() from rlgl and make it public --- src/raylib.h | 1 + src/rlgl.c | 76 +++++++++++++++++++++++++++++------------------------------- 2 files changed, 38 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index fa4f44e6..a47d3c59 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -925,6 +925,7 @@ RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Shaders System Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 //------------------------------------------------------------------------------------ +RLAPI char *LoadText(const char *fileName); // Load chars array from text file RLAPI Shader LoadShader(char *vsFileName, char *fsFileName); // Load shader from files and bind default locations RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) diff --git a/src/rlgl.c b/src/rlgl.c index 9770b647..bcbca227 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -48,7 +48,7 @@ #include "rlgl.h" -#include // Required for: fopen(), fclose(), fread()... [Used only on ReadTextFile()] +#include // Required for: fopen(), fclose(), fread()... [Used only on LoadText()] #include // Required for: malloc(), free(), rand() #include // Required for: strcmp(), strlen(), strtok() #include // Required for: atan2() @@ -400,8 +400,6 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); static void GetShaderLightsLocations(Shader shader); // Get shader locations for lights (up to MAX_LIGHTS) static void SetShaderLightsValues(Shader shader); // Set shader uniform values for lights - -static char *ReadTextFile(const char *fileName); // Read chars array from text file #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -2423,6 +2421,40 @@ Texture2D GetDefaultTexture(void) return texture; } +// Load text data from file +// NOTE: text chars array should be freed manually +char *LoadText(const char *fileName) +{ + FILE *textFile; + char *text = NULL; + + int count = 0; + + if (fileName != NULL) + { + textFile = fopen(fileName,"rt"); + + if (textFile != NULL) + { + fseek(textFile, 0, SEEK_END); + count = ftell(textFile); + rewind(textFile); + + if (count > 0) + { + text = (char *)malloc(sizeof(char)*(count + 1)); + count = fread(text, sizeof(char), count, textFile); + text[count] = '\0'; + } + + fclose(textFile); + } + else TraceLog(WARNING, "[%s] Text file could not be opened", fileName); + } + + return text; +} + // Load shader from files and bind default locations Shader LoadShader(char *vsFileName, char *fsFileName) { @@ -2430,8 +2462,8 @@ Shader LoadShader(char *vsFileName, char *fsFileName) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Shaders loading from external text file - char *vShaderStr = ReadTextFile(vsFileName); - char *fShaderStr = ReadTextFile(fsFileName); + char *vShaderStr = LoadText(vsFileName); + char *fShaderStr = LoadText(fsFileName); if ((vShaderStr != NULL) && (fShaderStr != NULL)) { @@ -3829,40 +3861,6 @@ static void SetShaderLightsValues(Shader shader) } } -// Read text data from file -// NOTE: text chars array should be freed manually -static char *ReadTextFile(const char *fileName) -{ - FILE *textFile; - char *text = NULL; - - int count = 0; - - if (fileName != NULL) - { - textFile = fopen(fileName,"rt"); - - if (textFile != NULL) - { - fseek(textFile, 0, SEEK_END); - count = ftell(textFile); - rewind(textFile); - - if (count > 0) - { - text = (char *)malloc(sizeof(char)*(count + 1)); - count = fread(text, sizeof(char), count, textFile); - text[count] = '\0'; - } - - fclose(textFile); - } - else TraceLog(WARNING, "[%s] Text file could not be opened", fileName); - } - - return text; -} - // Configure stereo rendering (including distortion shader) with HMD device parameters static void SetStereoConfig(VrDeviceInfo hmd) { -- cgit v1.2.3 From 61f6b0f707f408b89306ff1a6a2d825662ba8311 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 15 Jan 2017 01:10:23 +0100 Subject: Removed GetNextPOT(), review TraceLog() --- src/rlua.h | 9 ------ src/text.c | 7 +++-- src/textures.c | 12 +++++--- src/utils.c | 97 ++++++++++++++++------------------------------------------ src/utils.h | 18 ++--------- 5 files changed, 42 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h index 10a75e3a..e9ed2c3c 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -3232,14 +3232,6 @@ int lua_GetExtension(lua_State* L) return 1; } -int lua_GetNextPOT(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int result = GetNextPOT(arg1); - lua_pushinteger(L, result); - return 1; -} - //---------------------------------------------------------------------------------- // raylib [raymath] module functions - Vector3 math //---------------------------------------------------------------------------------- @@ -3955,7 +3947,6 @@ static luaL_Reg raylib_functions[] = { #endif REG(TraceLog) REG(GetExtension) - REG(GetNextPOT) REG(VectorAdd) REG(VectorSubtract) REG(VectorCrossProduct) diff --git a/src/text.c b/src/text.c index 74d5940b..4510b3af 100644 --- a/src/text.c +++ b/src/text.c @@ -36,7 +36,7 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() #include // Required for: FILE, fopen(), fclose(), fscanf(), feof(), rewind(), fgets() -#include "utils.h" // Required for: GetExtension(), GetNextPOT() +#include "utils.h" // Required for: GetExtension() // Following libs are used on LoadTTF() #define STBTT_STATIC // Define stb_truetype functions static to this module @@ -930,7 +930,10 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int // NOTE: Font texture size is predicted (being as much conservative as possible) // Predictive method consist of supposing same number of chars by line-column (sqrtf) // and a maximum character width of 3/4 of fontSize... it worked ok with all my tests... - int textureSize = GetNextPOT(ceil((float)fontSize*3/4)*ceil(sqrtf((float)numChars))); + + // Calculate next power-of-two value + float guessSize = ceilf((float)fontSize*3/4)*ceilf(sqrtf((float)numChars)); + int textureSize = (int)powf(2, ceilf(logf((float)guessSize)/logf(2))); // Calculate next POT TraceLog(INFO, "TTF spritefont loading: Predicted texture size: %ix%i", textureSize, textureSize); diff --git a/src/textures.c b/src/textures.c index 6538c316..3fa250c2 100644 --- a/src/textures.c +++ b/src/textures.c @@ -758,9 +758,10 @@ void ImageToPOT(Image *image, Color fillColor) { Color *pixels = GetImageData(*image); // Get pixels data - // Just add the required amount of pixels at the right and bottom sides of image... - int potWidth = GetNextPOT(image->width); - int potHeight = GetNextPOT(image->height); + // Calculate next power-of-two values + // NOTE: Just add the required amount of pixels at the right and bottom sides of image... + int potWidth = (int)powf(2, ceilf(logf((float)image->width)/logf(2))); + int potHeight = (int)powf(2, ceilf(logf((float)image->height)/logf(2))); // Check if POT texture generation is required (if texture is not already POT) if ((potWidth != image->width) || (potHeight != image->height)) @@ -1342,8 +1343,9 @@ void ImageColorBrightness(Image *image, int brightness) void GenTextureMipmaps(Texture2D *texture) { #if PLATFORM_WEB - int potWidth = GetNextPOT(texture->width); - int potHeight = GetNextPOT(texture->height); + // Calculate next power-of-two values + int potWidth = (int)powf(2, ceilf(logf((float)texture->width)/logf(2))); + int potHeight = (int)powf(2, ceilf(logf((float)texture->height)/logf(2))); // Check if texture is POT if ((potWidth != texture->width) || (potHeight != texture->height)) diff --git a/src/utils.c b/src/utils.c index 711ffab3..e5e05955 100644 --- a/src/utils.c +++ b/src/utils.c @@ -52,6 +52,7 @@ #define RRES_IMPLEMENTATION #include "rres.h" +//#define NO_TRACELOG // Avoid TraceLog() output (any type) #define DO_NOT_TRACE_DEBUG_MSGS // Avoid DEBUG messages tracing //---------------------------------------------------------------------------------- @@ -74,59 +75,11 @@ static int android_close(void *cookie); //---------------------------------------------------------------------------------- // Module Functions Definition - Utilities //---------------------------------------------------------------------------------- - -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -// Creates a BMP image file from an array of pixel data -void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize) -{ - stbi_write_bmp(fileName, width, height, compSize, imgData); -} - -// Creates a PNG image file from an array of pixel data -void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) -{ - stbi_write_png(fileName, width, height, compSize, imgData, width*compSize); -} -#endif - -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) -// Outputs a trace log message (INFO, ERROR, WARNING) -// NOTE: If a file has been init, output log is written there +// Outputs a trace log message void TraceLog(int msgType, const char *text, ...) { - va_list args; - int traceDebugMsgs = 1; - -#ifdef DO_NOT_TRACE_DEBUG_MSGS - traceDebugMsgs = 0; -#endif - - switch(msgType) - { - case INFO: fprintf(stdout, "INFO: "); break; - case ERROR: fprintf(stdout, "ERROR: "); break; - case WARNING: fprintf(stdout, "WARNING: "); break; - case DEBUG: if (traceDebugMsgs) fprintf(stdout, "DEBUG: "); break; - default: break; - } - - if ((msgType != DEBUG) || ((msgType == DEBUG) && (traceDebugMsgs))) - { - va_start(args, text); - vfprintf(stdout, text, args); - va_end(args); - - fprintf(stdout, "\n"); - } - - if (msgType == ERROR) exit(1); // If ERROR message, exit program -} -#endif - -#if defined(PLATFORM_ANDROID) -void TraceLog(int msgType, const char *text, ...) -{ - static char buffer[100]; +#if !defined(NO_TRACELOG) + static char buffer[128]; int traceDebugMsgs = 1; #ifdef DO_NOT_TRACE_DEBUG_MSGS @@ -146,8 +99,9 @@ void TraceLog(int msgType, const char *text, ...) strcat(buffer, "\n"); va_list args; - va_start(args, buffer); + va_start(args, text); +#if defined(PLATFORM_ANDROID) switch(msgType) { case INFO: __android_log_vprint(ANDROID_LOG_INFO, "raylib", buffer, args); break; @@ -156,12 +110,32 @@ void TraceLog(int msgType, const char *text, ...) case DEBUG: if (traceDebugMsgs) __android_log_vprint(ANDROID_LOG_DEBUG, "raylib", buffer, args); break; default: break; } +#else + if ((msgType != DEBUG) || ((msgType == DEBUG) && (traceDebugMsgs))) vprintf(buffer, args); +#endif va_end(args); - if (msgType == ERROR) exit(1); + if (msgType == ERROR) exit(1); // If ERROR message, exit program + +#endif // NO_TRACELOG +} + +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +// Creates a BMP image file from an array of pixel data +void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize) +{ + stbi_write_bmp(fileName, width, height, compSize, imgData); +} + +// Creates a PNG image file from an array of pixel data +void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) +{ + stbi_write_png(fileName, width, height, compSize, imgData, width*compSize); } +#endif +#if defined(PLATFORM_ANDROID) // Initialize asset manager from android app void InitAssetManager(AAssetManager *manager) { @@ -199,23 +173,6 @@ const char *GetExtension(const char *fileName) return (dot + 1); } -// Calculate next power-of-two value for a given num -int GetNextPOT(int num) -{ - if (num != 0) - { - num--; - num |= (num >> 1); // Or first 2 bits - num |= (num >> 2); // Or next 2 bits - num |= (num >> 4); // Or next 4 bits - num |= (num >> 8); // Or next 8 bits - num |= (num >> 16); // Or next 16 bits - num++; - } - - return num; -} - //---------------------------------------------------------------------------------- // Module specific Functions Definition //---------------------------------------------------------------------------------- diff --git a/src/utils.h b/src/utils.h index e0db51fe..3ffd025c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -43,19 +43,8 @@ //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- -typedef enum { IMAGE = 0, SOUND, MODEL, TEXT, RAW } DataType; - typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; -// One resource info header, every resource includes this header (8 byte) -typedef struct { - unsigned short id; // Resource unique identifier (2 byte) - unsigned char type; // Resource type (1 byte) - unsigned char comp; // Data Compression and Coding (1 byte) - unsigned int size; // Data size in .rres file (compressed or not, only DATA) (4 byte) - unsigned int srcSize; // Source data size (uncompressed, only DATA) -} ResInfoHeader; - #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -68,15 +57,14 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- +void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message +const char *GetExtension(const char *fileName); // Returns extension of a filename + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize); void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); #endif -void TraceLog(int msgType, const char *text, ...); // Outputs a trace log message -const char *GetExtension(const char *fileName); // Returns extension of a filename -int GetNextPOT(int num); // Calculate next power-of-two value for a given num - #if defined(PLATFORM_ANDROID) void InitAssetManager(AAssetManager *manager); // Initialize asset manager from android app FILE *android_fopen(const char *fileName, const char *mode); // Replacement for fopen() -- cgit v1.2.3 From e5a2def57f96567c23072c95afeceeb9e76f7e10 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 15 Jan 2017 01:10:34 +0100 Subject: Code formatting --- src/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 424e5725..4d662a41 100644 --- a/src/core.c +++ b/src/core.c @@ -561,14 +561,14 @@ void HideCursor() { #if defined(PLATFORM_DESKTOP) #ifdef __linux - XColor Col; - const char Nil[] = {0}; + XColor col; + const char nil[] = {0}; - Pixmap Pix = XCreateBitmapFromData(glfwGetX11Display(), glfwGetX11Window(window), Nil, 1, 1); - Cursor Cur = XCreatePixmapCursor(glfwGetX11Display(), Pix, Pix, &Col, &Col, 0, 0); + Pixmap pix = XCreateBitmapFromData(glfwGetX11Display(), glfwGetX11Window(window), nil, 1, 1); + Cursor cur = XCreatePixmapCursor(glfwGetX11Display(), pix, pix, &col, &col, 0, 0); - XDefineCursor(glfwGetX11Display(), glfwGetX11Window(window), Cur); - XFreeCursor(glfwGetX11Display(), Cur); + XDefineCursor(glfwGetX11Display(), glfwGetX11Window(window), cur); + XFreeCursor(glfwGetX11Display(), cur); #else glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); #endif -- cgit v1.2.3 From 53457e466477e3d3d47477d2b319035433386063 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 15 Jan 2017 01:11:38 +0100 Subject: Work on rres file format -IN PROGRESS- --- src/rres.h | 180 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 87 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/rres.h b/src/rres.h index dcf7be3f..700c9ab3 100644 --- a/src/rres.h +++ b/src/rres.h @@ -61,6 +61,7 @@ //---------------------------------------------------------------------------------- #if defined(RRES_STANDALONE) // rRES data returned when reading a resource, it contains all required data for user (24 byte) + // NOTE: Using void *data pointer, so we can load to image.data, wave.data, mesh.*, (unsigned char *) typedef struct { unsigned int type; // Resource type (4 byte) @@ -73,11 +74,14 @@ } RRESData; typedef enum { - RRES_RAW = 0, - RRES_IMAGE, - RRES_WAVE, - RRES_VERTEX, - RRES_TEXT + RRES_TYPE_RAW = 0, + RRES_TYPE_IMAGE, + RRES_TYPE_WAVE, + RRES_TYPE_VERTEX, + RRES_TYPE_TEXT, + RRES_TYPE_FONT_IMAGE, + RRES_TYPE_FONT_DATA, // Character { int value, recX, recY, recWidth, recHeight, offsetX, offsetY, xAdvance } + RRES_TYPE_DIRECTORY } RRESDataType; #endif @@ -133,11 +137,13 @@ typedef struct { unsigned short count; // Number of resources in this file (2 byte) } RRESFileHeader; -// rRES info header, every resource includes this header (12 byte + 16 byte) +// rRES info header, every resource includes this header (16 byte + 16 byte) typedef struct { - unsigned short id; // Resource unique identifier (2 byte) + unsigned int id; // Resource unique identifier (4 byte) unsigned char dataType; // Resource data type (1 byte) unsigned char compType; // Resource data compression type (1 byte) + unsigned char cryptoType; // Resource data encryption type (1 byte) + unsigned char partsCount; // Resource data parts count, used for splitted data (1 byte) unsigned int dataSize; // Resource data size (compressed or not, only DATA) (4 byte) unsigned int uncompSize; // Resource data size (uncompressed, only DATA) (4 byte) @@ -153,11 +159,66 @@ typedef enum { RRES_COMP_DEFLATE, // DEFLATE compression RRES_COMP_LZ4, // LZ4 compression RRES_COMP_LZMA, // LZMA compression - // brotli, zopfli, gzip // Other compression algorythms... + RRES_COMP_BROTLI, // BROTLI compression + // gzip, zopfli, lzo, zstd // Other compression algorythms... } RRESCompressionType; +typedef enum { + RRES_CRYPTO_NONE = 0, // No data encryption + RRES_CRYPTO_XOR, // XOR (128 bit) encryption + RRES_CRYPTO_AES, // RIJNDAEL (128 bit) encryption (AES) + RRES_CRYPTO_TDES, // Triple DES encryption + RRES_CRYPTO_BLOWFISH, // BLOWFISH encryption + RRES_CRYPTO_XTEA, // XTEA encryption + // twofish, RC5, RC6 // Other encryption algorythm... +} RRESEncryptionType; + +typedef enum { + RRES_IM_UNCOMP_GRAYSCALE = 1, // 8 bit per pixel (no alpha) + RRES_IM_UNCOMP_GRAY_ALPHA, // 16 bpp (2 channels) + RRES_IM_UNCOMP_R5G6B5, // 16 bpp + RRES_IM_UNCOMP_R8G8B8, // 24 bpp + RRES_IM_UNCOMP_R5G5B5A1, // 16 bpp (1 bit alpha) + RRES_IM_UNCOMP_R4G4B4A4, // 16 bpp (4 bit alpha) + RRES_IM_UNCOMP_R8G8B8A8, // 32 bpp + RRES_IM_COMP_DXT1_RGB, // 4 bpp (no alpha) + RRES_IM_COMP_DXT1_RGBA, // 4 bpp (1 bit alpha) + RRES_IM_COMP_DXT3_RGBA, // 8 bpp + RRES_IM_COMP_DXT5_RGBA, // 8 bpp + RRES_IM_COMP_ETC1_RGB, // 4 bpp + RRES_IM_COMP_ETC2_RGB, // 4 bpp + RRES_IM_COMP_ETC2_EAC_RGBA, // 8 bpp + RRES_IM_COMP_PVRT_RGB, // 4 bpp + RRES_IM_COMP_PVRT_RGBA, // 4 bpp + RRES_IM_COMP_ASTC_4x4_RGBA, // 8 bpp + RRES_IM_COMP_ASTC_8x8_RGBA // 2 bpp + //... +} RRESImageFormat; + +typedef enum { + RRES_VERT_POSITION, + RRES_VERT_TEXCOORD1, + RRES_VERT_TEXCOORD2, + RRES_VERT_TEXCOORD3, + RRES_VERT_TEXCOORD4, + RRES_VERT_NORMAL, + RRES_VERT_TANGENT, + RRES_VERT_COLOR, + RRES_VERT_INDEX, + //... +} RRESVertexType; + +typedef enum { + RRES_VERT_BYTE, + RRES_VERT_SHORT, + RRES_VERT_INT, + RRES_VERT_HFLOAT, + RRES_VERT_FLOAT, + //... +} RRESVertexFormat; + #if defined(RRES_STANDALONE) -typedef enum { INFO = 0, ERROR, WARNING, DEBUG, OTHER } TraceLogType; +typedef enum { LOG_INFO = 0, LOG_ERROR, LOG_WARNING, LOG_DEBUG, LOG_OTHER } TraceLogType; #endif //---------------------------------------------------------------------------------- @@ -178,61 +239,11 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i // NOTE: Returns uncompressed data with parameters, only first resource found RRESDEF RRESData LoadResource(const char *fileName) { + // Force loading first resource available RRESData rres = { 0 }; - RRESFileHeader fileHeader; - RRESInfoHeader infoHeader; - - FILE *rresFile = fopen(fileName, "rb"); - - if (rresFile == NULL) TraceLog(WARNING, "[%s] rRES raylib resource file could not be opened", fileName); - else - { - // Read rres file info header - fread(&fileHeader.id[0], sizeof(char), 1, rresFile); - fread(&fileHeader.id[1], sizeof(char), 1, rresFile); - fread(&fileHeader.id[2], sizeof(char), 1, rresFile); - fread(&fileHeader.id[3], sizeof(char), 1, rresFile); - fread(&fileHeader.version, sizeof(short), 1, rresFile); - fread(&fileHeader.count, sizeof(short), 1, rresFile); - - // Verify "rRES" identifier - if ((fileHeader.id[0] != 'r') && (fileHeader.id[1] != 'R') && (fileHeader.id[2] != 'E') && (fileHeader.id[3] != 'S')) - { - TraceLog(WARNING, "[%s] This is not a valid raylib resource file", fileName); - } - else - { - // Read first resource info and parameters - fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); - - // Register data type and parameters - rres.type = infoHeader.dataType; - rres.param1 = infoHeader.param1; - rres.param2 = infoHeader.param2; - rres.param3 = infoHeader.param3; - rres.param4 = infoHeader.param4; - - // Read resource data block - void *data = RRES_MALLOC(infoHeader.dataSize); - fread(data, infoHeader.dataSize, 1, rresFile); - - if (infoHeader.compType == RRES_COMP_DEFLATE) - { - void *uncompData = DecompressData(data, infoHeader.dataSize, infoHeader.uncompSize); - - rres.data = uncompData; - - RRES_FREE(data); - } - else rres.data = data; - - if (rres.data != NULL) TraceLog(INFO, "[%s] Resource data loaded successfully", fileName); - } - - fclose(rresFile); - } - + rres = LoadResourceById(fileName, 0); + return rres; } @@ -293,7 +304,9 @@ RRESDEF RRESData LoadResourceById(const char *fileName, int rresId) } else rres.data = data; - if (rres.data != NULL) TraceLog(INFO, "[%s][ID %i] Resource data loaded successfully", fileName, (int)rresId); + if (rres.data != NULL) TraceLog(INFO, "[%s][ID %i] Resource data loaded successfully", fileName, (int)infoHeader.id); + + if (rresId == 0) break; // Break for loop, do not check next resource } else { @@ -302,7 +315,7 @@ RRESDEF RRESData LoadResourceById(const char *fileName, int rresId) } } - if (rres.data == NULL) TraceLog(WARNING, "[%s][ID %i] Requested resource could not be found, wrong id?", fileName, (int)rresId); + if (rres.data == NULL) TraceLog(WARNING, "[%s][ID %i] Requested resource could not be found", fileName, (int)rresId); } fclose(rresFile); @@ -364,7 +377,7 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i #if defined(RRES_STANDALONE) // Outputs a trace log message (INFO, ERROR, WARNING) // NOTE: If a file has been init, output log is written there -void TraceLog(int msgType, const char *text, ...) +void TraceLog(int logType, const char *text, ...) { va_list args; int traceDebugMsgs = 0; @@ -375,14 +388,14 @@ void TraceLog(int msgType, const char *text, ...) switch (msgType) { - case INFO: fprintf(stdout, "INFO: "); break; - case ERROR: fprintf(stdout, "ERROR: "); break; - case WARNING: fprintf(stdout, "WARNING: "); break; - case DEBUG: if (traceDebugMsgs) fprintf(stdout, "DEBUG: "); break; + case LOG_INFO: fprintf(stdout, "INFO: "); break; + case LOG_ERROR: fprintf(stdout, "ERROR: "); break; + case LOG_WARNING: fprintf(stdout, "WARNING: "); break; + case LOG_DEBUG: if (traceDebugMsgs) fprintf(stdout, "DEBUG: "); break; default: break; } - if ((msgType != DEBUG) || ((msgType == DEBUG) && (traceDebugMsgs))) + if ((msgType != LOG_DEBUG) || ((msgType == LOG_DEBUG) && (traceDebugMsgs))) { va_start(args, text); vfprintf(stdout, text, args); @@ -397,33 +410,13 @@ void TraceLog(int msgType, const char *text, ...) #endif // RAYGUI_IMPLEMENTATION - /* -//T LoadResource(const char *rresFileName, int resId); - -// ASSUMPTION: rRES files only contain one resource (solution to id requirement...) - -// Now, rres file check and data loading can be managed inside each function: -Image LoadImage(); // -> Texture2D -Wave LoadWave() // -> Sound, Music -const char *LoadText(); // -> Shader, Material - -// NOTE: RRESData uses void* data pointer, so we can load to image.data, wave.data, mesh.*, (unsigned char *) - -Image LoadImagePro(void *data, int width, int height, int format); -Image LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); - Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData); Mesh LoadMeshEx(rres.param1, rres.data, rres.data + offset, rres.data + offset*2, rres.data + offset*3); -Shader LoadShaderV(const char *vsText, int vsLength); +Shader LoadShader(const char *vsText, int vsLength); Shader LoadShaderV(rres.data, rres.param1); -Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); -Wave LoadWaveEx(rres.data, rres.param1, (int)rres.param2, (int)rres.param3, (int)rres.param4); - -// Max value for an unsigned short: 65535 - // Parameters information depending on resource type (IMAGE, WAVE, MESH, TEXT) // Image data params @@ -431,6 +424,7 @@ int imgWidth, imgHeight; char colorFormat, mipmaps; // Wave data params +int sampleCount, short sampleRate, bps; char channels, reserved; @@ -439,6 +433,6 @@ int vertexCount, reserved; short vertexTypesMask, vertexFormatsMask; // Text data params -int numChars; -char textFormat, language, charsetCode; +int charsCount; +int cultureCode; */ \ No newline at end of file -- cgit v1.2.3 From 6d6659205c04e52b88d5f22eda1722c352f548a9 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 15 Jan 2017 01:25:09 +0100 Subject: Add support for 32-bit PCM sample data --- src/audio.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 989512c0..9dedefba 100644 --- a/src/audio.c +++ b/src/audio.c @@ -21,7 +21,7 @@ * * Some design decisions: * Support only up to two channels: MONO and STEREO (for additional channels, AL_EXT_MCFORMATS) -* Support only the following sample sizes: 8bit PCM and 16bit PCM (for additional size, AL_EXT_FLOAT32) +* Support only the following sample sizes: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) * * Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * XM audio module support (jar_xm) @@ -98,6 +98,15 @@ // In case of music-stalls, just increase this number #define AUDIO_BUFFER_SIZE 4096 // PCM data samples (i.e. 16bit, Mono: 8Kb) +// Support uncompressed PCM data in 32-bit float IEEE format +// NOTE: This definition is included in "AL/alext.h", but some OpenAL implementations +// could not provide the extensions header (Android), so its defined here +#if !defined(AL_EXT_float32) + #define AL_EXT_float32 1 + #define AL_FORMAT_MONO_FLOAT32 0x10010 + #define AL_FORMAT_STEREO_FLOAT32 0x10011 +#endif + //---------------------------------------------------------------------------------- // Types and Structures Definition //---------------------------------------------------------------------------------- @@ -284,7 +293,7 @@ Sound LoadSoundFromWave(Wave wave) { case 8: format = AL_FORMAT_MONO8; break; case 16: format = AL_FORMAT_MONO16; break; - case 32: //format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 + case 32: format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; } } @@ -294,7 +303,7 @@ Sound LoadSoundFromWave(Wave wave) { case 8: format = AL_FORMAT_STEREO8; break; case 16: format = AL_FORMAT_STEREO16; break; - case 32: //format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 + case 32: format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Wave sample size not supported: %i", wave.sampleSize); break; } } @@ -863,7 +872,7 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un { case 8: stream.format = AL_FORMAT_MONO8; break; case 16: stream.format = AL_FORMAT_MONO16; break; - case 32: //stream.format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 + case 32: stream.format = AL_FORMAT_MONO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } } @@ -873,7 +882,7 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un { case 8: stream.format = AL_FORMAT_STEREO8; break; case 16: stream.format = AL_FORMAT_STEREO16; break; - case 32: //stream.format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 + case 32: stream.format = AL_FORMAT_STEREO_FLOAT32; break; // Requires OpenAL extension: AL_EXT_FLOAT32 default: TraceLog(WARNING, "Init audio stream: Sample size not supported: %i", sampleSize); break; } } -- cgit v1.2.3 From 46f95a730a68d50c9d369739af61e60961166721 Mon Sep 17 00:00:00 2001 From: Ray San Date: Wed, 18 Jan 2017 17:04:20 +0100 Subject: Corrected bug on OGG sound loading --- src/audio.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 9dedefba..c70c9004 100644 --- a/src/audio.c +++ b/src/audio.c @@ -608,7 +608,7 @@ Music LoadMusicStream(const char *fileName) // OGG bit rate defaults to 16 bit, it's enough for compressed format music->stream = InitAudioStream(info.sample_rate, 16, info.channels); - music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg); + music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg); // Independent by channel music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_OGG; music->loop = true; // We loop by default @@ -1134,20 +1134,17 @@ static Wave LoadOGG(const char *fileName) wave.sampleRate = info.sample_rate; wave.sampleSize = 16; // 16 bit per sample (short) wave.channels = info.channels; - - int totalSamplesLength = (stb_vorbis_stream_length_in_samples(oggFile)*info.channels); + wave.sampleCount = (int)stb_vorbis_stream_length_in_samples(oggFile); + float totalSeconds = stb_vorbis_stream_length_in_seconds(oggFile); - if (totalSeconds > 10) TraceLog(WARNING, "[%s] Ogg audio lenght is larger than 10 seconds (%f), that's a big file in memory, consider music streaming", fileName, totalSeconds); - int totalSamples = (int)(totalSeconds*info.sample_rate*info.channels); - wave.sampleCount = totalSamples; - - wave.data = (short *)malloc(totalSamplesLength*sizeof(short)); + wave.data = (short *)malloc(wave.sampleCount*wave.channels*sizeof(short)); - int samplesObtained = stb_vorbis_get_samples_short_interleaved(oggFile, info.channels, (short *)wave.data, totalSamplesLength); + // NOTE: Returns the number of samples to process (be careful! we ask for number of shorts!) + int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(oggFile, info.channels, (short *)wave.data, wave.sampleCount*wave.channels); - TraceLog(DEBUG, "[%s] Samples obtained: %i", fileName, samplesObtained); + TraceLog(DEBUG, "[%s] Samples obtained: %i", fileName, numSamplesOgg); TraceLog(INFO, "[%s] OGG file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); -- cgit v1.2.3 From fc7d4cef1833f216a98c13bc2c44f43e67163623 Mon Sep 17 00:00:00 2001 From: Ray San Date: Wed, 18 Jan 2017 17:25:25 +0100 Subject: Stop sound source before unloading --- src/audio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index c70c9004..47a15975 100644 --- a/src/audio.c +++ b/src/audio.c @@ -353,6 +353,8 @@ void UnloadWave(Wave wave) // Unload sound void UnloadSound(Sound sound) { + alSourceStop(sound.source); + alDeleteSources(1, &sound.source); alDeleteBuffers(1, &sound.buffer); -- cgit v1.2.3 From 3b120bd7d936b5e6b730caa60709c6d73865d146 Mon Sep 17 00:00:00 2001 From: Ray San Date: Wed, 18 Jan 2017 19:14:39 +0100 Subject: Some tweaks for consistency --- src/audio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 47a15975..119b057d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -324,7 +324,7 @@ Sound LoadSoundFromWave(Wave wave) ALuint buffer; alGenBuffers(1, &buffer); // Generate pointer to buffer - unsigned int dataSize = wave.sampleCount*wave.sampleSize/8*wave.channels; // Size in bytes + unsigned int dataSize = wave.sampleCount*wave.channels*wave.sampleSize/8; // Size in bytes // Upload sound data to buffer alBufferData(buffer, format, wave.data, dataSize, wave.sampleRate); @@ -345,7 +345,7 @@ Sound LoadSoundFromWave(Wave wave) // Unload wave data void UnloadWave(Wave wave) { - free(wave.data); + if (wave.data != NULL) free(wave.data); TraceLog(INFO, "Unloaded wave data from RAM"); } @@ -374,7 +374,7 @@ void UpdateSound(Sound sound, const void *data, int numSamples) TraceLog(DEBUG, "UpdateSound() : AL_BITS: %i", sampleSize); TraceLog(DEBUG, "UpdateSound() : AL_CHANNELS: %i", channels); - unsigned int dataSize = numSamples*sampleSize/8*channels; // Size of data in bytes + unsigned int dataSize = numSamples*channels*sampleSize/8; // Size of data in bytes alSourceStop(sound.source); // Stop sound alSourcei(sound.source, AL_BUFFER, 0); // Unbind buffer from sound to update -- cgit v1.2.3 From 7cd24d27061cb08f818692961beb1ecb4a74445e Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 18 Jan 2017 23:27:41 +0100 Subject: Updated stb external libraries --- src/external/stb_image.h | 905 +++++++++++++++++++++++++++------------- src/external/stb_image_resize.h | 8 +- src/external/stb_image_write.h | 5 +- src/external/stb_rect_pack.h | 29 +- src/external/stb_truetype.h | 857 ++++++++++++++++++++++++++++++++++--- 5 files changed, 1458 insertions(+), 346 deletions(-) (limited to 'src') diff --git a/src/external/stb_image.h b/src/external/stb_image.h index 5572a880..4d8d0133 100644 --- a/src/external/stb_image.h +++ b/src/external/stb_image.h @@ -1,4 +1,4 @@ -/* stb_image - v2.12 - public domain image loader - http://nothings.org/stb_image.h +/* stb_image - v2.14 - public domain image loader - http://nothings.org/stb_image.h no warranty implied; use at your own risk Do this: @@ -146,6 +146,7 @@ Latest revision history: + 2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 RGB-format JPEG; remove white matting in PSD; @@ -157,21 +158,6 @@ 2.07 (2015-09-13) partial animated GIF support limited 16-bit PSD support minor bugs, code cleanup, and compiler warnings - 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value - 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning - 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit - 2.03 (2015-04-12) additional corruption checking - stbi_set_flip_vertically_on_load - fix NEON support; fix mingw support - 2.02 (2015-01-19) fix incorrect assert, fix warning - 2.01 (2015-01-17) fix various warnings - 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG - 2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD - progressive JPEG - PGM/PPM support - STBI_MALLOC,STBI_REALLOC,STBI_FREE - STBI_NO_*, STBI_ONLY_* - GIF bugfix See end of file for full revision history. @@ -186,9 +172,9 @@ Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG) Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip) Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD) - urraka@github (animated gif) Junggon Kim (PNM comments) + github:urraka (animated gif) Junggon Kim (PNM comments) Daniel Gibson (16-bit TGA) - + socks-the-fox (16-bit TGA) Optimizations & bugfixes Fabian "ryg" Giesen Arseny Kapoulkine @@ -199,13 +185,14 @@ Dave Moore Roy Eltham Hayaki Saito Phil Jordan Won Chun Luke Graham Johan Duparc Nathan Reed the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis - Janez Zemva John Bartholomew Michal Cichon svdijk@github + Janez Zemva John Bartholomew Michal Cichon github:svdijk Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson - Laurent Gomila Cort Stratton Sergio Gonzalez romigrou@github + Laurent Gomila Cort Stratton Sergio Gonzalez github:romigrou Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan - Ryamond Barbiero Paul Du Bois Engin Manap snagar@github - Michaelangel007@github Oriol Ferrer Mesia socks-the-fox - Blazej Dariusz Roszkowski + Ryamond Barbiero Paul Du Bois Engin Manap github:snagar + Michaelangel007@github Oriol Ferrer Mesia Dale Weiler github:Zelex + Philipp Wiesemann Josh Tobin github:rlyeh github:grim210@github + Blazej Dariusz Roszkowski github:sammyhw LICENSE @@ -238,10 +225,10 @@ publish, and distribute this file as you see fit. // stbi_image_free(data) // // Standard parameters: -// int *x -- outputs image width in pixels -// int *y -- outputs image height in pixels -// int *comp -- outputs # of image components in image file -// int req_comp -- if non-zero, # of image components requested in result +// int *x -- outputs image width in pixels +// int *y -- outputs image height in pixels +// int *channels_in_file -- outputs # of image components in image file +// int desired_channels -- if non-zero, # of image components requested in result // // The return value from an image loader is an 'unsigned char *' which points // to the pixel data, or NULL on an allocation failure or if the image is @@ -389,13 +376,13 @@ publish, and distribute this file as you see fit. // -#define STBI_NO_HDR // RaySan: not required by raylib -//#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 - #ifndef STBI_NO_STDIO #include #endif // STBI_NO_STDIO +#define STBI_NO_HDR // RaySan: not required by raylib +//#define STBI_NO_SIMD // RaySan: issues when compiling with GCC 4.7.2 + // NOTE: Added to work with raylib on Android #if defined(PLATFORM_ANDROID) #include "utils.h" // RaySan: Android fopen function map @@ -414,6 +401,7 @@ enum }; typedef unsigned char stbi_uc; +typedef unsigned short stbi_us; #ifdef __cplusplus extern "C" { @@ -441,22 +429,42 @@ typedef struct int (*eof) (void *user); // returns nonzero if we are at end of file/data } stbi_io_callbacks; -STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *comp, int req_comp); -STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *comp, int req_comp); -STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *comp, int req_comp); +//////////////////////////////////// +// +// 8-bits-per-channel interface +// + +STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); +STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels); +STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels); #ifndef STBI_NO_STDIO -STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); +STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); // for stbi_load_from_file, file pointer is left pointing immediately after image #endif +//////////////////////////////////// +// +// 16-bits-per-channel interface +// + +STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); +#ifndef STBI_NO_STDIO +STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); +#endif +// @TODO the other variants + +//////////////////////////////////// +// +// float-per-channel interface +// #ifndef STBI_NO_LINEAR - STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *comp, int req_comp); - STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp); - STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp); + STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); + STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels); + STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels); #ifndef STBI_NO_STDIO - STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *comp, int req_comp); + STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); #endif #endif @@ -574,6 +582,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const ch #include // ptrdiff_t on osx #include #include +#include #if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) #include // ldexp @@ -835,57 +844,70 @@ static void stbi__rewind(stbi__context *s) s->img_buffer_end = s->img_buffer_original_end; } +enum +{ + STBI_ORDER_RGB, + STBI_ORDER_BGR +}; + +typedef struct +{ + int bits_per_channel; + int num_channels; + int channel_order; +} stbi__result_info; + #ifndef STBI_NO_JPEG static int stbi__jpeg_test(stbi__context *s); -static stbi_uc *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PNG static int stbi__png_test(stbi__context *s); -static stbi_uc *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_BMP static int stbi__bmp_test(stbi__context *s); -static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_TGA static int stbi__tga_test(stbi__context *s); -static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PSD static int stbi__psd_test(stbi__context *s); -static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc); static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_HDR static int stbi__hdr_test(stbi__context *s); -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PIC static int stbi__pic_test(stbi__context *s); -static stbi_uc *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_GIF static int stbi__gif_test(stbi__context *s); -static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); #endif #ifndef STBI_NO_PNM static int stbi__pnm_test(stbi__context *s); -static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp); +static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); #endif @@ -908,6 +930,77 @@ static void *stbi__malloc(size_t size) return STBI_MALLOC(size); } +// stb_image uses ints pervasively, including for offset calculations. +// therefore the largest decoded image size we can support with the +// current code, even on 64-bit targets, is INT_MAX. this is not a +// significant limitation for the intended use case. +// +// we do, however, need to make sure our size calculations don't +// overflow. hence a few helper functions for size calculations that +// multiply integers together, making sure that they're non-negative +// and no overflow occurs. + +// return 1 if the sum is valid, 0 on overflow. +// negative terms are considered invalid. +static int stbi__addsizes_valid(int a, int b) +{ + if (b < 0) return 0; + // now 0 <= b <= INT_MAX, hence also + // 0 <= INT_MAX - b <= INTMAX. + // And "a + b <= INT_MAX" (which might overflow) is the + // same as a <= INT_MAX - b (no overflow) + return a <= INT_MAX - b; +} + +// returns 1 if the product is valid, 0 on overflow. +// negative factors are considered invalid. +static int stbi__mul2sizes_valid(int a, int b) +{ + if (a < 0 || b < 0) return 0; + if (b == 0) return 1; // mul-by-0 is always safe + // portable way to check for no overflows in a*b + return a <= INT_MAX/b; +} + +// returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow +static int stbi__mad2sizes_valid(int a, int b, int add) +{ + return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add); +} + +// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow +static int stbi__mad3sizes_valid(int a, int b, int c, int add) +{ + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && + stbi__addsizes_valid(a*b*c, add); +} + +// returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow +static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) +{ + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && + stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add); +} + +// mallocs with size overflow checking +static void *stbi__malloc_mad2(int a, int b, int add) +{ + if (!stbi__mad2sizes_valid(a, b, add)) return NULL; + return stbi__malloc(a*b + add); +} + +static void *stbi__malloc_mad3(int a, int b, int c, int add) +{ + if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL; + return stbi__malloc(a*b*c + add); +} + +static void *stbi__malloc_mad4(int a, int b, int c, int d, int add) +{ + if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL; + return stbi__malloc(a*b*c*d + add); +} + // stbi__err - error // stbi__errpf - error returning pointer to float // stbi__errpuc - error returning pointer to unsigned char @@ -943,33 +1036,38 @@ STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) stbi__vertically_flip_on_load = flag_true_if_should_flip; } -static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) { + memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields + ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed + ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order + ri->num_channels = 0; + #ifndef STBI_NO_JPEG - if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp); + if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_PNG - if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp); + if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_BMP - if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp); + if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_GIF - if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp); + if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_PSD - if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp); + if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc); #endif #ifndef STBI_NO_PIC - if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp); + if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_PNM - if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp); + if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri); #endif #ifndef STBI_NO_HDR if (stbi__hdr_test(s)) { - float *hdr = stbi__hdr_load(s, x,y,comp,req_comp); + float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri); return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); } #endif @@ -977,35 +1075,117 @@ static unsigned char *stbi__load_main(stbi__context *s, int *x, int *y, int *com #ifndef STBI_NO_TGA // test tga last because it's a crappy test! if (stbi__tga_test(s)) - return stbi__tga_load(s,x,y,comp,req_comp); + return stbi__tga_load(s,x,y,comp,req_comp, ri); #endif return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); } -static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int channels) { - unsigned char *result = stbi__load_main(s, x, y, comp, req_comp); + int i; + int img_len = w * h * channels; + stbi_uc *reduced; - if (stbi__vertically_flip_on_load && result != NULL) { + reduced = (stbi_uc *) stbi__malloc(img_len); + if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory"); + + for (i = 0; i < img_len; ++i) + reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling + + STBI_FREE(orig); + return reduced; +} + +static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels) +{ + int i; + int img_len = w * h * channels; + stbi__uint16 *enlarged; + + enlarged = (stbi__uint16 *) stbi__malloc(img_len*2); + if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); + + for (i = 0; i < img_len; ++i) + enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff + + STBI_FREE(orig); + return enlarged; +} + +static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi__result_info ri; + void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8); + + if (result == NULL) + return NULL; + + if (ri.bits_per_channel != 8) { + STBI_ASSERT(ri.bits_per_channel == 16); + result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp); + ri.bits_per_channel = 8; + } + + // @TODO: move stbi__convert_format to here + + if (stbi__vertically_flip_on_load) { int w = *x, h = *y; - int depth = req_comp ? req_comp : *comp; + int channels = req_comp ? req_comp : *comp; int row,col,z; - stbi_uc temp; + stbi_uc *image = (stbi_uc *) result; // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once for (row = 0; row < (h>>1); row++) { for (col = 0; col < w; col++) { - for (z = 0; z < depth; z++) { - temp = result[(row * w + col) * depth + z]; - result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z]; - result[((h - row - 1) * w + col) * depth + z] = temp; + for (z = 0; z < channels; z++) { + stbi_uc temp = image[(row * w + col) * channels + z]; + image[(row * w + col) * channels + z] = image[((h - row - 1) * w + col) * channels + z]; + image[((h - row - 1) * w + col) * channels + z] = temp; } } } } - return result; + return (unsigned char *) result; +} + +static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp) +{ + stbi__result_info ri; + void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16); + + if (result == NULL) + return NULL; + + if (ri.bits_per_channel != 16) { + STBI_ASSERT(ri.bits_per_channel == 8); + result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp); + ri.bits_per_channel = 16; + } + + // @TODO: move stbi__convert_format16 to here + // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision + + if (stbi__vertically_flip_on_load) { + int w = *x, h = *y; + int channels = req_comp ? req_comp : *comp; + int row,col,z; + stbi__uint16 *image = (stbi__uint16 *) result; + + // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once + for (row = 0; row < (h>>1); row++) { + for (col = 0; col < w; col++) { + for (z = 0; z < channels; z++) { + stbi__uint16 temp = image[(row * w + col) * channels + z]; + image[(row * w + col) * channels + z] = image[((h - row - 1) * w + col) * channels + z]; + image[((h - row - 1) * w + col) * channels + z] = temp; + } + } + } + } + + return (stbi__uint16 *) result; } #ifndef STBI_NO_HDR @@ -1061,27 +1241,52 @@ STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req unsigned char *result; stbi__context s; stbi__start_file(&s,f); - result = stbi__load_flip(&s,x,y,comp,req_comp); + result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); if (result) { // need to 'unget' all the characters in the IO buffer fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); } return result; } + +STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp) +{ + stbi__uint16 *result; + stbi__context s; + stbi__start_file(&s,f); + result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp); + if (result) { + // need to 'unget' all the characters in the IO buffer + fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); + } + return result; +} + +STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp) +{ + FILE *f = stbi__fopen(filename, "rb"); + stbi__uint16 *result; + if (!f) return (stbi_us *) stbi__errpuc("can't fopen", "Unable to open file"); + result = stbi_load_from_file_16(f,x,y,comp,req_comp); + fclose(f); + return result; +} + + #endif //!STBI_NO_STDIO STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_mem(&s,buffer,len); - return stbi__load_flip(&s,x,y,comp,req_comp); + return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); } STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) { stbi__context s; stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__load_flip(&s,x,y,comp,req_comp); + return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); } #ifndef STBI_NO_LINEAR @@ -1090,13 +1295,14 @@ static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int unsigned char *data; #ifndef STBI_NO_HDR if (stbi__hdr_test(s)) { - float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp); + stbi__result_info ri; + float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri); if (hdr_data) stbi__float_postprocess(hdr_data,x,y,comp,req_comp); return hdr_data; } #endif - data = stbi__load_flip(s, x, y, comp, req_comp); + data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp); if (data) return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); @@ -1354,7 +1560,7 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r if (req_comp == img_n) return data; STBI_ASSERT(req_comp >= 1 && req_comp <= 4); - good = (unsigned char *) stbi__malloc(req_comp * x * y); + good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0); if (good == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); @@ -1364,26 +1570,75 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r unsigned char *src = data + j * x * img_n ; unsigned char *dest = good + j * x * req_comp; - #define COMBO(a,b) ((a)*8+(b)) - #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + #define STBI__COMBO(a,b) ((a)*8+(b)) + #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) // convert source image with img_n components to one with req_comp components; // avoid switch per pixel, so use switch per scanline and massive macros - switch (COMBO(img_n, req_comp)) { - CASE(1,2) dest[0]=src[0], dest[1]=255; break; - CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; - CASE(2,1) dest[0]=src[0]; break; - CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; - CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; - CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; - CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; - CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break; - CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; - CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; - CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; + switch (STBI__COMBO(img_n, req_comp)) { + STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break; + STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break; + STBI__CASE(2,1) { dest[0]=src[0]; } break; + STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; + STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break; + STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; + STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break; + STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; + STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break; + STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; default: STBI_ASSERT(0); } - #undef CASE + #undef STBI__CASE + } + + STBI_FREE(data); + return good; +} + +static stbi__uint16 stbi__compute_y_16(int r, int g, int b) +{ + return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8); +} + +static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y) +{ + int i,j; + stbi__uint16 *good; + + if (req_comp == img_n) return data; + STBI_ASSERT(req_comp >= 1 && req_comp <= 4); + + good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2); + if (good == NULL) { + STBI_FREE(data); + return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); + } + + for (j=0; j < (int) y; ++j) { + stbi__uint16 *src = data + j * x * img_n ; + stbi__uint16 *dest = good + j * x * req_comp; + + #define STBI__COMBO(a,b) ((a)*8+(b)) + #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + // convert source image with img_n components to one with req_comp components; + // avoid switch per pixel, so use switch per scanline and massive macros + switch (STBI__COMBO(img_n, req_comp)) { + STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break; + STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break; + STBI__CASE(2,1) { dest[0]=src[0]; } break; + STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; + STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break; + STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; + STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break; + STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; + STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break; + STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; + default: STBI_ASSERT(0); + } + #undef STBI__CASE } STBI_FREE(data); @@ -1394,7 +1649,9 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) { int i,k,n; - float *output = (float *) stbi__malloc(x * y * comp * sizeof(float)); + float *output; + if (!data) return NULL; + output = (float *) stbi__malloc_mad4(x, y, comp, sizeof(float), 0); if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); } // compute number of non-alpha components if (comp & 1) n = comp; else n = comp-1; @@ -1414,7 +1671,9 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) { int i,k,n; - stbi_uc *output = (stbi_uc *) stbi__malloc(x * y * comp); + stbi_uc *output; + if (!data) return NULL; + output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0); if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } // compute number of non-alpha components if (comp & 1) n = comp; else n = comp-1; @@ -2709,6 +2968,28 @@ static int stbi__process_scan_header(stbi__jpeg *z) return 1; } +static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why) +{ + int i; + for (i=0; i < ncomp; ++i) { + if (z->img_comp[i].raw_data) { + STBI_FREE(z->img_comp[i].raw_data); + z->img_comp[i].raw_data = NULL; + z->img_comp[i].data = NULL; + } + if (z->img_comp[i].raw_coeff) { + STBI_FREE(z->img_comp[i].raw_coeff); + z->img_comp[i].raw_coeff = 0; + z->img_comp[i].coeff = 0; + } + if (z->img_comp[i].linebuf) { + STBI_FREE(z->img_comp[i].linebuf); + z->img_comp[i].linebuf = NULL; + } + } + return why; +} + static int stbi__process_frame_header(stbi__jpeg *z, int scan) { stbi__context *s = z->s; @@ -2746,7 +3027,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) if (scan != STBI__SCAN_load) return 1; - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); + if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode"); for (i=0; i < s->img_n; ++i) { if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; @@ -2758,6 +3039,7 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) z->img_v_max = v_max; z->img_mcu_w = h_max * 8; z->img_mcu_h = v_max * 8; + // these sizes can't be more than 17 bits z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; @@ -2769,28 +3051,27 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) // the bogus oversized data from using interleaved MCUs and their // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't // discard the extra data until colorspace conversion + // + // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier) + // so these muls can't overflow with 32-bit ints (which we require) z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; - z->img_comp[i].raw_data = stbi__malloc(z->img_comp[i].w2 * z->img_comp[i].h2+15); - - if (z->img_comp[i].raw_data == NULL) { - for(--i; i >= 0; --i) { - STBI_FREE(z->img_comp[i].raw_data); - z->img_comp[i].raw_data = NULL; - } - return stbi__err("outofmem", "Out of memory"); - } + z->img_comp[i].coeff = 0; + z->img_comp[i].raw_coeff = 0; + z->img_comp[i].linebuf = NULL; + z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15); + if (z->img_comp[i].raw_data == NULL) + return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory")); // align blocks for idct using mmx/sse z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); - z->img_comp[i].linebuf = NULL; if (z->progressive) { - z->img_comp[i].coeff_w = (z->img_comp[i].w2 + 7) >> 3; - z->img_comp[i].coeff_h = (z->img_comp[i].h2 + 7) >> 3; - z->img_comp[i].raw_coeff = STBI_MALLOC(z->img_comp[i].coeff_w * z->img_comp[i].coeff_h * 64 * sizeof(short) + 15); + // w2, h2 are multiples of 8 (see above) + z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8; + z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8; + z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15); + if (z->img_comp[i].raw_coeff == NULL) + return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory")); z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); - } else { - z->img_comp[i].coeff = 0; - z->img_comp[i].raw_coeff = 0; } } @@ -3296,23 +3577,7 @@ static void stbi__setup_jpeg(stbi__jpeg *j) // clean up the temporary component buffers static void stbi__cleanup_jpeg(stbi__jpeg *j) { - int i; - for (i=0; i < j->s->img_n; ++i) { - if (j->img_comp[i].raw_data) { - STBI_FREE(j->img_comp[i].raw_data); - j->img_comp[i].raw_data = NULL; - j->img_comp[i].data = NULL; - } - if (j->img_comp[i].raw_coeff) { - STBI_FREE(j->img_comp[i].raw_coeff); - j->img_comp[i].raw_coeff = 0; - j->img_comp[i].coeff = 0; - } - if (j->img_comp[i].linebuf) { - STBI_FREE(j->img_comp[i].linebuf); - j->img_comp[i].linebuf = NULL; - } - } + stbi__free_jpeg_components(j, j->s->img_n, 0); } typedef struct @@ -3376,7 +3641,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } // can't error after this so, this is safe - output = (stbi_uc *) stbi__malloc(n * z->s->img_x * z->s->img_y + 1); + output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1); if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } // now go ahead and resample @@ -3432,7 +3697,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp } } -static unsigned char *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { unsigned char* result; stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); @@ -3729,6 +3994,7 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) int hlit = stbi__zreceive(a,5) + 257; int hdist = stbi__zreceive(a,5) + 1; int hclen = stbi__zreceive(a,4) + 4; + int ntot = hlit + hdist; memset(codelength_sizes, 0, sizeof(codelength_sizes)); for (i=0; i < hclen; ++i) { @@ -3738,27 +4004,29 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; n = 0; - while (n < hlit + hdist) { + while (n < ntot) { int c = stbi__zhuffman_decode(a, &z_codelength); if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); if (c < 16) lencodes[n++] = (stbi_uc) c; - else if (c == 16) { - c = stbi__zreceive(a,2)+3; - memset(lencodes+n, lencodes[n-1], c); - n += c; - } else if (c == 17) { - c = stbi__zreceive(a,3)+3; - memset(lencodes+n, 0, c); - n += c; - } else { - STBI_ASSERT(c == 18); - c = stbi__zreceive(a,7)+11; - memset(lencodes+n, 0, c); + else { + stbi_uc fill = 0; + if (c == 16) { + c = stbi__zreceive(a,2)+3; + if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG"); + fill = lencodes[n-1]; + } else if (c == 17) + c = stbi__zreceive(a,3)+3; + else { + STBI_ASSERT(c == 18); + c = stbi__zreceive(a,7)+11; + } + if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG"); + memset(lencodes+n, fill, c); n += c; } } - if (n != hlit+hdist) return stbi__err("bad codelengths","Corrupt PNG"); + if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG"); if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; return 1; @@ -4024,7 +4292,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r int width = x; STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); - a->out = (stbi_uc *) stbi__malloc(x * y * output_bytes); // extra bytes to write off the end into + a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); @@ -4089,37 +4357,37 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // this is a little gross, so that we don't switch per-pixel or per-component if (depth < 8 || img_n == out_n) { int nk = (width - 1)*filter_bytes; - #define CASE(f) \ + #define STBI__CASE(f) \ case f: \ for (k=0; k < nk; ++k) switch (filter) { // "none" filter turns into a memcpy here; make that explicit. case STBI__F_none: memcpy(cur, raw, nk); break; - CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break; - CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break; - CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break; - CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break; - CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break; + STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; + STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; + STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; + STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; + STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; + STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; } - #undef CASE + #undef STBI__CASE raw += nk; } else { STBI_ASSERT(img_n+1 == out_n); - #define CASE(f) \ + #define STBI__CASE(f) \ case f: \ for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ for (k=0; k < filter_bytes; ++k) switch (filter) { - CASE(STBI__F_none) cur[k] = raw[k]; break; - CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; - CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; - CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; - CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; - CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; + STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break; + STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; + STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; + STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; + STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; + STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; + STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; } - #undef CASE + #undef STBI__CASE // the loop above sets the high byte of the pixels' alpha, but for // 16 bit png files we also need the low byte set. we'll do that here. @@ -4222,13 +4490,15 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) { + int bytes = (depth == 16 ? 2 : 1); + int out_bytes = out_n * bytes; stbi_uc *final; int p; if (!interlaced) return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); // de-interlacing - final = (stbi_uc *) stbi__malloc(a->s->img_x * a->s->img_y * out_n); + final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); for (p=0; p < 7; ++p) { int xorig[] = { 0,4,0,2,0,1,0 }; int yorig[] = { 0,0,4,0,2,0,1 }; @@ -4248,8 +4518,8 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 for (i=0; i < x; ++i) { int out_y = j*yspc[p]+yorig[p]; int out_x = i*xspc[p]+xorig[p]; - memcpy(final + out_y*a->s->img_x*out_n + out_x*out_n, - a->out + (j*x+i)*out_n, out_n); + memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes, + a->out + (j*x+i)*out_bytes, out_bytes); } } STBI_FREE(a->out); @@ -4317,7 +4587,7 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; stbi_uc *p, *temp_out, *orig = a->out; - p = (stbi_uc *) stbi__malloc(pixel_count * pal_img_n); + p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0); if (p == NULL) return stbi__err("outofmem", "Out of memory"); // between here and free(out) below, exitting would leak @@ -4349,26 +4619,6 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int return 1; } -static int stbi__reduce_png(stbi__png *p) -{ - int i; - int img_len = p->s->img_x * p->s->img_y * p->s->img_out_n; - stbi_uc *reduced; - stbi__uint16 *orig = (stbi__uint16*)p->out; - - if (p->depth != 16) return 1; // don't need to do anything if not 16-bit data - - reduced = (stbi_uc *)stbi__malloc(img_len); - if (p == NULL) return stbi__err("outofmem", "Out of memory"); - - for (i = 0; i < img_len; ++i) reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is a decent approx of 16->8 bit scaling - - p->out = reduced; - STBI_FREE(orig); - - return 1; -} - static int stbi__unpremultiply_on_load = 0; static int stbi__de_iphone_flag = 0; @@ -4508,7 +4758,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); has_trans = 1; if (z->depth == 16) { - for (k = 0; k < s->img_n; ++k) tc16[k] = stbi__get16be(s); // copy the values as-is + for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is } else { for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger } @@ -4595,20 +4845,22 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) } } -static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp) +static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri) { - unsigned char *result=NULL; + void *result=NULL; if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { - if (p->depth == 16) { - if (!stbi__reduce_png(p)) { - return result; - } - } + if (p->depth < 8) + ri->bits_per_channel = 8; + else + ri->bits_per_channel = p->depth; result = p->out; p->out = NULL; if (req_comp && req_comp != p->s->img_out_n) { - result = stbi__convert_format(result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); + if (ri->bits_per_channel == 8) + result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); + else + result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); p->s->img_out_n = req_comp; if (result == NULL) return result; } @@ -4623,11 +4875,11 @@ static unsigned char *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req return result; } -static unsigned char *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { stbi__png p; p.s = s; - return stbi__do_png(&p, x,y,comp,req_comp); + return stbi__do_png(&p, x,y,comp,req_comp, ri); } static int stbi__png_test(stbi__context *s) @@ -4815,7 +5067,7 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) } -static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { stbi_uc *out; unsigned int mr=0,mg=0,mb=0,ma=0, all_a; @@ -4823,6 +5075,7 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int int psize=0,i,j,width; int flip_vertically, pad, target; stbi__bmp_data info; + STBI_NOTUSED(ri); info.all_a = 255; if (stbi__bmp_parse_header(s, &info) == NULL) @@ -4851,7 +5104,11 @@ static stbi_uc *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int else target = s->img_n; // if they want monochrome, we'll post-convert - out = (stbi_uc *) stbi__malloc(target * s->img_x * s->img_y); + // sanity-check size + if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) + return stbi__errpuc("too large", "Corrupt BMP"); + + out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); if (info.bpp < 16) { int z=0; @@ -5085,18 +5342,18 @@ errorEnd: } // read 16bit value and convert to 24bit RGB -void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) +static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) { - stbi__uint16 px = stbi__get16le(s); + stbi__uint16 px = (stbi__uint16)stbi__get16le(s); stbi__uint16 fiveBitMask = 31; // we have 3 channels with 5bits each int r = (px >> 10) & fiveBitMask; int g = (px >> 5) & fiveBitMask; int b = px & fiveBitMask; // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later - out[0] = (r * 255)/31; - out[1] = (g * 255)/31; - out[2] = (b * 255)/31; + out[0] = (stbi_uc)((r * 255)/31); + out[1] = (stbi_uc)((g * 255)/31); + out[2] = (stbi_uc)((b * 255)/31); // some people claim that the most significant bit might be used for alpha // (possibly if an alpha-bit is set in the "image descriptor byte") @@ -5104,7 +5361,7 @@ void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) // so let's treat all 15 and 16bit TGAs as RGB with no alpha. } -static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { // read in the TGA header stuff int tga_offset = stbi__get8(s); @@ -5126,10 +5383,11 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int unsigned char *tga_data; unsigned char *tga_palette = NULL; int i, j; - unsigned char raw_data[4]; + unsigned char raw_data[4] = {0}; int RLE_count = 0; int RLE_repeating = 0; int read_next_pixel = 1; + STBI_NOTUSED(ri); // do a tiny bit of precessing if ( tga_image_type >= 8 ) @@ -5151,7 +5409,10 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int *y = tga_height; if (comp) *comp = tga_comp; - tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp ); + if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) + return stbi__errpuc("too large", "Corrupt TGA"); + + tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0); if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); // skip to the data's starting position (offset usually = 0) @@ -5170,7 +5431,7 @@ static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int // any data to skip? (offset usually = 0) stbi__skip(s, tga_palette_start ); // load the palette - tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_comp ); + tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0); if (!tga_palette) { STBI_FREE(tga_data); return stbi__errpuc("outofmem", "Out of memory"); @@ -5306,14 +5567,53 @@ static int stbi__psd_test(stbi__context *s) return r; } -static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount) { - int pixelCount; + int count, nleft, len; + + count = 0; + while ((nleft = pixelCount - count) > 0) { + len = stbi__get8(s); + if (len == 128) { + // No-op. + } else if (len < 128) { + // Copy next len+1 bytes literally. + len++; + if (len > nleft) return 0; // corrupt data + count += len; + while (len) { + *p = stbi__get8(s); + p += 4; + len--; + } + } else if (len > 128) { + stbi_uc val; + // Next -len+1 bytes in the dest are replicated from next source byte. + // (Interpret len as a negative 8-bit int.) + len = 257 - len; + if (len > nleft) return 0; // corrupt data + val = stbi__get8(s); + count += len; + while (len) { + *p = val; + p += 4; + len--; + } + } + } + + return 1; +} + +static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) +{ + int pixelCount; int channelCount, compression; - int channel, i, count, len; + int channel, i; int bitdepth; int w,h; stbi_uc *out; + STBI_NOTUSED(ri); // Check identifier if (stbi__get32be(s) != 0x38425053) // "8BPS" @@ -5370,8 +5670,18 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int if (compression > 1) return stbi__errpuc("bad compression", "PSD has an unknown compression format"); + // Check size + if (!stbi__mad3sizes_valid(4, w, h, 0)) + return stbi__errpuc("too large", "Corrupt PSD"); + // Create the destination image. - out = (stbi_uc *) stbi__malloc(4 * w*h); + + if (!compression && bitdepth == 16 && bpc == 16) { + out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0); + ri->bits_per_channel = 16; + } else + out = (stbi_uc *) stbi__malloc(4 * w*h); + if (!out) return stbi__errpuc("outofmem", "Out of memory"); pixelCount = w*h; @@ -5403,82 +5713,86 @@ static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int *p = (channel == 3 ? 255 : 0); } else { // Read the RLE data. - count = 0; - while (count < pixelCount) { - len = stbi__get8(s); - if (len == 128) { - // No-op. - } else if (len < 128) { - // Copy next len+1 bytes literally. - len++; - count += len; - while (len) { - *p = stbi__get8(s); - p += 4; - len--; - } - } else if (len > 128) { - stbi_uc val; - // Next -len+1 bytes in the dest are replicated from next source byte. - // (Interpret len as a negative 8-bit int.) - len ^= 0x0FF; - len += 2; - val = stbi__get8(s); - count += len; - while (len) { - *p = val; - p += 4; - len--; - } - } + if (!stbi__psd_decode_rle(s, p, pixelCount)) { + STBI_FREE(out); + return stbi__errpuc("corrupt", "bad RLE data"); } } } } else { // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) - // where each channel consists of an 8-bit value for each pixel in the image. + // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image. // Read the data by channel. for (channel = 0; channel < 4; channel++) { - stbi_uc *p; - - p = out + channel; if (channel >= channelCount) { // Fill this channel with default data. - stbi_uc val = channel == 3 ? 255 : 0; - for (i = 0; i < pixelCount; i++, p += 4) - *p = val; - } else { - // Read the data. - if (bitdepth == 16) { - for (i = 0; i < pixelCount; i++, p += 4) - *p = (stbi_uc) (stbi__get16be(s) >> 8); + if (bitdepth == 16 && bpc == 16) { + stbi__uint16 *q = ((stbi__uint16 *) out) + channel; + stbi__uint16 val = channel == 3 ? 65535 : 0; + for (i = 0; i < pixelCount; i++, q += 4) + *q = val; } else { + stbi_uc *p = out+channel; + stbi_uc val = channel == 3 ? 255 : 0; for (i = 0; i < pixelCount; i++, p += 4) - *p = stbi__get8(s); + *p = val; + } + } else { + if (ri->bits_per_channel == 16) { // output bpc + stbi__uint16 *q = ((stbi__uint16 *) out) + channel; + for (i = 0; i < pixelCount; i++, q += 4) + *q = (stbi__uint16) stbi__get16be(s); + } else { + stbi_uc *p = out+channel; + if (bitdepth == 16) { // input bpc + for (i = 0; i < pixelCount; i++, p += 4) + *p = (stbi_uc) (stbi__get16be(s) >> 8); + } else { + for (i = 0; i < pixelCount; i++, p += 4) + *p = stbi__get8(s); + } } } } } + // remove weird white matte from PSD if (channelCount >= 4) { - for (i=0; i < w*h; ++i) { - unsigned char *pixel = out + 4*i; - if (pixel[3] != 0 && pixel[3] != 255) { - // remove weird white matte from PSD - float a = pixel[3] / 255.0f; - float ra = 1.0f / a; - float inv_a = 255.0f * (1 - ra); - pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); - pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); - pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); + if (ri->bits_per_channel == 16) { + for (i=0; i < w*h; ++i) { + stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i; + if (pixel[3] != 0 && pixel[3] != 65535) { + float a = pixel[3] / 65535.0f; + float ra = 1.0f / a; + float inv_a = 65535.0f * (1 - ra); + pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a); + pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a); + pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a); + } + } + } else { + for (i=0; i < w*h; ++i) { + unsigned char *pixel = out + 4*i; + if (pixel[3] != 0 && pixel[3] != 255) { + float a = pixel[3] / 255.0f; + float ra = 1.0f / a; + float inv_a = 255.0f * (1 - ra); + pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); + pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); + pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); + } } } } + // convert to desired output format if (req_comp && req_comp != 4) { - out = stbi__convert_format(out, 4, req_comp, w, h); + if (ri->bits_per_channel == 16) + out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h); + else + out = stbi__convert_format(out, 4, req_comp, w, h); if (out == NULL) return out; // stbi__convert_format frees input on failure } @@ -5662,10 +5976,11 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *c return result; } -static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp) +static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp, stbi__result_info *ri) { stbi_uc *result; int i, x,y; + STBI_NOTUSED(ri); for (i=0; i<92; ++i) stbi__get8(s); @@ -5673,14 +5988,14 @@ static stbi_uc *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int re x = stbi__get16be(s); y = stbi__get16be(s); if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); - if ((1 << 28) / x < y) return stbi__errpuc("too large", "Image too large to decode"); + if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode"); stbi__get32be(s); //skip `ratio' stbi__get16be(s); //skip `fields' stbi__get16be(s); //skip `pad' // intermediate buffer is RGBA - result = (stbi_uc *) stbi__malloc(x*y*4); + result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0); memset(result, 0xff, x*y*4); if (!stbi__pic_load_core(s,x,y,comp, result)) { @@ -5939,8 +6254,11 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i if (g->out == 0 && !stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header + if (!stbi__mad3sizes_valid(g->w, g->h, 4, 0)) + return stbi__errpuc("too large", "GIF too large"); + prev_out = g->out; - g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h); + g->out = (stbi_uc *) stbi__malloc_mad3(4, g->w, g->h, 0); if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory"); switch ((g->eflags & 0x1C) >> 2) { @@ -6047,11 +6365,12 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i STBI_NOTUSED(req_comp); } -static stbi_uc *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { stbi_uc *u = 0; stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); memset(g, 0, sizeof(*g)); + STBI_NOTUSED(ri); u = stbi__gif_load_next(s, g, comp, req_comp); if (u == (stbi_uc *) s) u = 0; // end of animated gif marker @@ -6077,20 +6396,24 @@ static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) // Radiance RGBE HDR loader // originally by Nicolas Schulz #ifndef STBI_NO_HDR -static int stbi__hdr_test_core(stbi__context *s) +static int stbi__hdr_test_core(stbi__context *s, const char *signature) { - const char *signature = "#?RADIANCE\n"; int i; for (i=0; signature[i]; ++i) if (stbi__get8(s) != signature[i]) - return 0; + return 0; + stbi__rewind(s); return 1; } static int stbi__hdr_test(stbi__context* s) { - int r = stbi__hdr_test_core(s); + int r = stbi__hdr_test_core(s, "#?RADIANCE\n"); stbi__rewind(s); + if(!r) { + r = stbi__hdr_test_core(s, "#?RGBE\n"); + stbi__rewind(s); + } return r; } @@ -6144,7 +6467,7 @@ static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp) } } -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { char buffer[STBI__HDR_BUFLEN]; char *token; @@ -6155,10 +6478,12 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re int len; unsigned char count, value; int i, j, k, c1,c2, z; - + const char *headerToken; + STBI_NOTUSED(ri); // Check identifier - if (strcmp(stbi__hdr_gettoken(s,buffer), "#?RADIANCE") != 0) + headerToken = stbi__hdr_gettoken(s,buffer); + if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) return stbi__errpf("not HDR", "Corrupt HDR image"); // Parse header @@ -6187,8 +6512,13 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re if (comp) *comp = 3; if (req_comp == 0) req_comp = 3; + if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) + return stbi__errpf("too large", "HDR image is too large"); + // Read data - hdr_data = (float *) stbi__malloc(height * width * req_comp * sizeof(float)); + hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0); + if (!hdr_data) + return stbi__errpf("outofmem", "Out of memory"); // Load image data // image data is stored as some number of sca @@ -6227,20 +6557,29 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re len <<= 8; len |= stbi__get8(s); if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); } - if (scanline == NULL) scanline = (stbi_uc *) stbi__malloc(width * 4); + if (scanline == NULL) { + scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0); + if (!scanline) { + STBI_FREE(hdr_data); + return stbi__errpf("outofmem", "Out of memory"); + } + } for (k = 0; k < 4; ++k) { + int nleft; i = 0; - while (i < width) { + while ((nleft = width - i) > 0) { count = stbi__get8(s); if (count > 128) { // Run value = stbi__get8(s); count -= 128; + if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = value; } else { // Dump + if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } for (z = 0; z < count; ++z) scanline[i++ * 4 + k] = stbi__get8(s); } @@ -6249,7 +6588,8 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re for (i=0; i < width; ++i) stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); } - STBI_FREE(scanline); + if (scanline) + STBI_FREE(scanline); } return hdr_data; @@ -6427,16 +6767,22 @@ static int stbi__pnm_test(stbi__context *s) return 1; } -static stbi_uc *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp) +static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) { stbi_uc *out; + STBI_NOTUSED(ri); + if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n)) return 0; + *x = s->img_x; *y = s->img_y; *comp = s->img_n; - out = (stbi_uc *) stbi__malloc(s->img_n * s->img_x * s->img_y); + if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0)) + return stbi__errpuc("too large", "PNM too large"); + + out = (stbi_uc *) stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0); if (!out) return stbi__errpuc("outofmem", "Out of memory"); stbi__getn(s, out, s->img_n * s->img_x * s->img_y); @@ -6601,6 +6947,7 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int /* revision history: + 2.13 (2016-11-29) add 16-bit API, only supported for PNG right now 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes 2.11 (2016-04-02) allocate large structures on the stack remove white matting for transparent PSD diff --git a/src/external/stb_image_resize.h b/src/external/stb_image_resize.h index 4cabe540..5214ad6e 100644 --- a/src/external/stb_image_resize.h +++ b/src/external/stb_image_resize.h @@ -1,4 +1,4 @@ -/* stb_image_resize - v0.91 - public domain image resizing +/* stb_image_resize - v0.92 - public domain image resizing by Jorge L Rodriguez (@VinoBS) - 2014 http://github.com/nothings/stb @@ -154,8 +154,10 @@ ADDITIONAL CONTRIBUTORS Sean Barrett: API design, optimizations + Aras Pranckevicius: bugfix REVISIONS + 0.92 (2017-01-02) fix integer overflow on large (>2GB) images 0.91 (2016-04-02) fix warnings; fix handling of subpixel regions 0.90 (2014-09-17) first released version @@ -1239,11 +1241,11 @@ static void stbir__decode_scanline(stbir__info* stbir_info, int n) int type = stbir_info->type; int colorspace = stbir_info->colorspace; int input_w = stbir_info->input_w; - int input_stride_bytes = stbir_info->input_stride_bytes; + size_t input_stride_bytes = stbir_info->input_stride_bytes; float* decode_buffer = stbir__get_decode_buffer(stbir_info); stbir_edge edge_horizontal = stbir_info->edge_horizontal; stbir_edge edge_vertical = stbir_info->edge_vertical; - int in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes; + size_t in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes; const void* input_data = (char *) stbir_info->input_data + in_buffer_row_offset; int max_x = input_w + stbir_info->horizontal_filter_pixel_margin; int decode = STBIR__DECODE(type, colorspace); diff --git a/src/external/stb_image_write.h b/src/external/stb_image_write.h index 4319c0de..ae9180b0 100644 --- a/src/external/stb_image_write.h +++ b/src/external/stb_image_write.h @@ -1,4 +1,4 @@ -/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h +/* stb_image_write - v1.03 - public domain - http://nothings.org/stb/stb_image_write.h writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 no warranty implied; use at your own risk @@ -103,6 +103,7 @@ CREDITS: Jonas Karlsson Filip Wasil Thatcher Ulrich + github:poppolopoppo LICENSE @@ -475,7 +476,6 @@ int stbi_write_tga(char const *filename, int x, int y, int comp, const void *dat // ************************************************************************************************* // Radiance RGBE HDR writer // by Baldur Karlsson -#ifndef STBI_WRITE_NO_STDIO #define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) @@ -630,6 +630,7 @@ int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, i return stbi_write_hdr_core(&s, x, y, comp, (float *) data); } +#ifndef STBI_WRITE_NO_STDIO int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) { stbi__write_context s; diff --git a/src/external/stb_rect_pack.h b/src/external/stb_rect_pack.h index bd1cfc60..c75527da 100644 --- a/src/external/stb_rect_pack.h +++ b/src/external/stb_rect_pack.h @@ -1,4 +1,4 @@ -// stb_rect_pack.h - v0.08 - public domain - rectangle packing +// stb_rect_pack.h - v0.10 - public domain - rectangle packing // Sean Barrett 2014 // // Useful for e.g. packing rectangular textures into an atlas. @@ -32,6 +32,8 @@ // // Version history: // +// 0.10 (2016-10-25) remove cast-away-const to avoid warnings +// 0.09 (2016-08-27) fix compiler warnings // 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) // 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) // 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort @@ -148,7 +150,7 @@ enum { STBRP_HEURISTIC_Skyline_default=0, STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, - STBRP_HEURISTIC_Skyline_BF_sortHeight, + STBRP_HEURISTIC_Skyline_BF_sortHeight }; @@ -198,9 +200,15 @@ struct stbrp_context #define STBRP_ASSERT assert #endif +#ifdef _MSC_VER +#define STBRP__NOTUSED(v) (void)(v) +#else +#define STBRP__NOTUSED(v) (void)sizeof(v) +#endif + enum { - STBRP__INIT_skyline = 1, + STBRP__INIT_skyline = 1 }; STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) @@ -273,6 +281,9 @@ static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0 stbrp_node *node = first; int x1 = x0 + width; int min_y, visited_width, waste_area; + + STBRP__NOTUSED(c); + STBRP_ASSERT(first->x <= x0); #if 0 @@ -500,8 +511,8 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i static int rect_height_compare(const void *a, const void *b) { - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; + const stbrp_rect *p = (const stbrp_rect *) a; + const stbrp_rect *q = (const stbrp_rect *) b; if (p->h > q->h) return -1; if (p->h < q->h) @@ -511,8 +522,8 @@ static int rect_height_compare(const void *a, const void *b) static int rect_width_compare(const void *a, const void *b) { - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; + const stbrp_rect *p = (const stbrp_rect *) a; + const stbrp_rect *q = (const stbrp_rect *) b; if (p->w > q->w) return -1; if (p->w < q->w) @@ -522,8 +533,8 @@ static int rect_width_compare(const void *a, const void *b) static int rect_original_order(const void *a, const void *b) { - stbrp_rect *p = (stbrp_rect *) a; - stbrp_rect *q = (stbrp_rect *) b; + const stbrp_rect *p = (const stbrp_rect *) a; + const stbrp_rect *q = (const stbrp_rect *) b; return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); } diff --git a/src/external/stb_truetype.h b/src/external/stb_truetype.h index d360d609..92b9a875 100644 --- a/src/external/stb_truetype.h +++ b/src/external/stb_truetype.h @@ -1,5 +1,5 @@ -// stb_truetype.h - v1.11 - public domain -// authored from 2009-2015 by Sean Barrett / RAD Game Tools +// stb_truetype.h - v1.14 - public domain +// authored from 2009-2016 by Sean Barrett / RAD Game Tools // // This library processes TrueType files: // parse files @@ -20,10 +20,12 @@ // // Mikko Mononen: compound shape support, more cmap formats // Tor Andersson: kerning, subpixel rendering +// Dougall Johnson: OpenType / Type 2 font handling // // Misc other: // Ryan Gordon // Simon Glass +// github:IntellectualKitty // // Bug/warning reports/fixes: // "Zer" on mollyrocket (with fix) @@ -51,6 +53,8 @@ // // VERSION HISTORY // +// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts, num-fonts-in-TTC function +// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual // 1.11 (2016-04-02) fix unused-variable warning // 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef // 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly @@ -60,12 +64,6 @@ // fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); // fixed an assert() bug in the new rasterizer // replace assert() with STBTT_assert() in new rasterizer -// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) -// also more precise AA rasterizer, except if shapes overlap -// remove need for STBTT_sort -// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC -// 1.04 (2015-04-15) typo in example -// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes // // Full history can be found at the end of this file. // @@ -100,7 +98,8 @@ // // "Load" a font file from a memory buffer (you have to keep the buffer loaded) // stbtt_InitFont() -// stbtt_GetFontOffsetForIndex() -- use for TTC font collections +// stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections +// stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections // // Render a unicode codepoint to a bitmap // stbtt_GetCodepointBitmap() -- allocates and returns a bitmap @@ -458,6 +457,14 @@ int main(int arg, char **argv) extern "C" { #endif +// private structure +typedef struct +{ + unsigned char *data; + int cursor; + int size; +} stbtt__buf; + ////////////////////////////////////////////////////////////////////////////// // // TEXTURE BAKING API @@ -527,7 +534,7 @@ typedef struct stbrp_rect stbrp_rect; STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); // Initializes a packing context stored in the passed-in stbtt_pack_context. // Future calls using this context will pack characters into the bitmap passed -// in here: a 1-channel bitmap that is weight x height. stride_in_bytes is +// in here: a 1-channel bitmap that is width * height. stride_in_bytes is // the distance from one row to the next (or 0 to mean they are packed tightly // together). "padding" is the amount of padding to leave between each // character (normally you want '1' for bitmaps you'll use as textures with @@ -593,9 +600,9 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, stbtt_aligned_quad *q, // output: quad to draw int align_to_integer); -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); // Calling these functions in sequence is roughly equivalent to calling // stbtt_PackFontRanges(). If you more control over the packing of multiple // fonts, or if you want to pack custom data into a font texture, take a look @@ -626,14 +633,19 @@ struct stbtt_pack_context { // // +STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data); +// This function will determine the number of fonts in a font file. TrueType +// collection (.ttc) files may contain multiple fonts, while TrueType font +// (.ttf) files only contain one font. The number of fonts can be used for +// indexing with the previous function where the index is between zero and one +// less than the total fonts. If an error occurs, -1 is returned. + STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index); // Each .ttf/.ttc file may have more than one font. Each font has a sequential // index number starting from 0. Call this function to get the font offset for // a given index; it returns -1 if the index is out of range. A regular .ttf // file will only define one font and it always be at offset 0, so it will -// return '0' for index 0, and -1 for all other indices. You can just skip -// this step if you know it's that kind of font. - +// return '0' for index 0, and -1 for all other indices. // The following structure is defined publically so you can declare one on // the stack or as a global or etc, but you should treat it as opaque. @@ -648,6 +660,13 @@ struct stbtt_fontinfo int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf int index_map; // a cmap mapping for our chosen character encoding int indexToLocFormat; // format needed to map from glyph index to glyph + + stbtt__buf cff; // cff font data + stbtt__buf charstrings; // the charstring index + stbtt__buf gsubrs; // global charstring subroutines index + stbtt__buf subrs; // private charstring subroutines index + stbtt__buf fontdicts; // array of font dicts + stbtt__buf fdselect; // map from glyph to fontdict }; STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset); @@ -725,7 +744,8 @@ STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, in enum { STBTT_vmove=1, STBTT_vline, - STBTT_vcurve + STBTT_vcurve, + STBTT_vcubic }; #endif @@ -734,7 +754,7 @@ STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, in #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file typedef struct { - stbtt_vertex_type x,y,cx,cy; + stbtt_vertex_type x,y,cx,cy,cx1,cy1; unsigned char type,padding; } stbtt_vertex; #endif @@ -956,6 +976,152 @@ typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERS #define STBTT__NOTUSED(v) (void)sizeof(v) #endif +////////////////////////////////////////////////////////////////////////// +// +// stbtt__buf helpers to parse data from file +// + +static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b) +{ + if (b->cursor >= b->size) + return 0; + return b->data[b->cursor++]; +} + +static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b) +{ + if (b->cursor >= b->size) + return 0; + return b->data[b->cursor]; +} + +static void stbtt__buf_seek(stbtt__buf *b, int o) +{ + STBTT_assert(!(o > b->size || o < 0)); + b->cursor = (o > b->size || o < 0) ? b->size : o; +} + +static void stbtt__buf_skip(stbtt__buf *b, int o) +{ + stbtt__buf_seek(b, b->cursor + o); +} + +static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n) +{ + stbtt_uint32 v = 0; + int i; + STBTT_assert(n >= 1 && n <= 4); + for (i = 0; i < n; i++) + v = (v << 8) | stbtt__buf_get8(b); + return v; +} + +static stbtt__buf stbtt__new_buf(const void *p, size_t size) +{ + stbtt__buf r; + STBTT_assert(size < 0x40000000); + r.data = (stbtt_uint8*) p; + r.size = (int) size; + r.cursor = 0; + return r; +} + +#define stbtt__buf_get16(b) stbtt__buf_get((b), 2) +#define stbtt__buf_get32(b) stbtt__buf_get((b), 4) + +static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s) +{ + stbtt__buf r = stbtt__new_buf(NULL, 0); + if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r; + r.data = b->data + o; + r.size = s; + return r; +} + +static stbtt__buf stbtt__cff_get_index(stbtt__buf *b) +{ + int count, start, offsize; + start = b->cursor; + count = stbtt__buf_get16(b); + if (count) { + offsize = stbtt__buf_get8(b); + STBTT_assert(offsize >= 1 && offsize <= 4); + stbtt__buf_skip(b, offsize * count); + stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1); + } + return stbtt__buf_range(b, start, b->cursor - start); +} + +static stbtt_uint32 stbtt__cff_int(stbtt__buf *b) +{ + int b0 = stbtt__buf_get8(b); + if (b0 >= 32 && b0 <= 246) return b0 - 139; + else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108; + else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108; + else if (b0 == 28) return stbtt__buf_get16(b); + else if (b0 == 29) return stbtt__buf_get32(b); + STBTT_assert(0); + return 0; +} + +static void stbtt__cff_skip_operand(stbtt__buf *b) { + int v, b0 = stbtt__buf_peek8(b); + STBTT_assert(b0 >= 28); + if (b0 == 30) { + stbtt__buf_skip(b, 1); + while (b->cursor < b->size) { + v = stbtt__buf_get8(b); + if ((v & 0xF) == 0xF || (v >> 4) == 0xF) + break; + } + } else { + stbtt__cff_int(b); + } +} + +static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key) +{ + stbtt__buf_seek(b, 0); + while (b->cursor < b->size) { + int start = b->cursor, end, op; + while (stbtt__buf_peek8(b) >= 28) + stbtt__cff_skip_operand(b); + end = b->cursor; + op = stbtt__buf_get8(b); + if (op == 12) op = stbtt__buf_get8(b) | 0x100; + if (op == key) return stbtt__buf_range(b, start, end-start); + } + return stbtt__buf_range(b, 0, 0); +} + +static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out) +{ + int i; + stbtt__buf operands = stbtt__dict_get(b, key); + for (i = 0; i < outcount && operands.cursor < operands.size; i++) + out[i] = stbtt__cff_int(&operands); +} + +static int stbtt__cff_index_count(stbtt__buf *b) +{ + stbtt__buf_seek(b, 0); + return stbtt__buf_get16(b); +} + +static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) +{ + int count, offsize, start, end; + stbtt__buf_seek(&b, 0); + count = stbtt__buf_get16(&b); + offsize = stbtt__buf_get8(&b); + STBTT_assert(i >= 0 && i < count); + STBTT_assert(offsize >= 1 && offsize <= 4); + stbtt__buf_skip(&b, i*offsize); + start = stbtt__buf_get(&b, offsize); + end = stbtt__buf_get(&b, offsize); + return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start); +} + ////////////////////////////////////////////////////////////////////////// // // accessors to parse data from file @@ -968,32 +1134,22 @@ typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERS #define ttCHAR(p) (* (stbtt_int8 *) (p)) #define ttFixed(p) ttLONG(p) -#if defined(STB_TRUETYPE_BIGENDIAN) && !defined(ALLOW_UNALIGNED_TRUETYPE) - - #define ttUSHORT(p) (* (stbtt_uint16 *) (p)) - #define ttSHORT(p) (* (stbtt_int16 *) (p)) - #define ttULONG(p) (* (stbtt_uint32 *) (p)) - #define ttLONG(p) (* (stbtt_int32 *) (p)) - -#else - - static stbtt_uint16 ttUSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } - static stbtt_int16 ttSHORT(const stbtt_uint8 *p) { return p[0]*256 + p[1]; } - static stbtt_uint32 ttULONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - static stbtt_int32 ttLONG(const stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - -#endif +static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } +static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } +static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } +static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } #define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) #define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) -static int stbtt__isfont(const stbtt_uint8 *font) +static int stbtt__isfont(stbtt_uint8 *font) { // check the version number if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 + if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts return 0; } @@ -1011,7 +1167,7 @@ static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, return 0; } -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, int index) +static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index) { // if it's just a font, there's only one valid index if (stbtt__isfont(font_collection)) @@ -1030,14 +1186,43 @@ STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *font_collection, return -1; } -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data2, int fontstart) +static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection) +{ + // if it's just a font, there's only one valid font + if (stbtt__isfont(font_collection)) + return 1; + + // check if it's a TTC + if (stbtt_tag(font_collection, "ttcf")) { + // version 1? + if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { + return ttLONG(font_collection+8); + } + } + return 0; +} + +static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict) +{ + stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 }; + stbtt__buf pdict; + stbtt__dict_get_ints(&fontdict, 18, 2, private_loc); + if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0); + pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]); + stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff); + if (!subrsoff) return stbtt__new_buf(NULL, 0); + stbtt__buf_seek(&cff, private_loc[1]+subrsoff); + return stbtt__cff_get_index(&cff); +} + +static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart) { - stbtt_uint8 *data = (stbtt_uint8 *) data2; stbtt_uint32 cmap, t; stbtt_int32 i,numTables; info->data = data; info->fontstart = fontstart; + info->cff = stbtt__new_buf(NULL, 0); cmap = stbtt__find_table(data, fontstart, "cmap"); // required info->loca = stbtt__find_table(data, fontstart, "loca"); // required @@ -1046,8 +1231,61 @@ STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data2, i info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required info->kern = stbtt__find_table(data, fontstart, "kern"); // not required - if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx) + + if (!cmap || !info->head || !info->hhea || !info->hmtx) return 0; + if (info->glyf) { + // required for truetype + if (!info->loca) return 0; + } else { + // initialization for CFF / Type2 fonts (OTF) + stbtt__buf b, topdict, topdictidx; + stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0; + stbtt_uint32 cff; + + cff = stbtt__find_table(data, fontstart, "CFF "); + if (!cff) return 0; + + info->fontdicts = stbtt__new_buf(NULL, 0); + info->fdselect = stbtt__new_buf(NULL, 0); + + // @TODO this should use size from table (not 512MB) + info->cff = stbtt__new_buf(data+cff, 512*1024*1024); + b = info->cff; + + // read the header + stbtt__buf_skip(&b, 2); + stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize + + // @TODO the name INDEX could list multiple fonts, + // but we just use the first one. + stbtt__cff_get_index(&b); // name INDEX + topdictidx = stbtt__cff_get_index(&b); + topdict = stbtt__cff_index_get(topdictidx, 0); + stbtt__cff_get_index(&b); // string INDEX + info->gsubrs = stbtt__cff_get_index(&b); + + stbtt__dict_get_ints(&topdict, 17, 1, &charstrings); + stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype); + stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff); + stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff); + info->subrs = stbtt__get_subrs(b, topdict); + + // we only support Type 2 charstrings + if (cstype != 2) return 0; + if (charstrings == 0) return 0; + + if (fdarrayoff) { + // looks like a CID font + if (!fdselectoff) return 0; + stbtt__buf_seek(&b, fdarrayoff); + info->fontdicts = stbtt__cff_get_index(&b); + info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff); + } + + stbtt__buf_seek(&b, charstrings); + info->charstrings = stbtt__cff_get_index(&b); + } t = stbtt__find_table(data, fontstart, "maxp"); if (t) @@ -1198,6 +1436,8 @@ static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) { int g1,g2; + STBTT_assert(!info->cff.size); + if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format @@ -1212,15 +1452,21 @@ static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) return g1==g2 ? -1 : g1; // if length is 0, return -1 } +static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); + STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) { - int g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 0; + if (info->cff.size) { + stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1); + } else { + int g = stbtt__GetGlyfOffset(info, glyph_index); + if (g < 0) return 0; - if (x0) *x0 = ttSHORT(info->data + g + 2); - if (y0) *y0 = ttSHORT(info->data + g + 4); - if (x1) *x1 = ttSHORT(info->data + g + 6); - if (y1) *y1 = ttSHORT(info->data + g + 8); + if (x0) *x0 = ttSHORT(info->data + g + 2); + if (y0) *y0 = ttSHORT(info->data + g + 4); + if (x1) *x1 = ttSHORT(info->data + g + 6); + if (y1) *y1 = ttSHORT(info->data + g + 8); + } return 1; } @@ -1232,7 +1478,10 @@ STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, i STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) { stbtt_int16 numberOfContours; - int g = stbtt__GetGlyfOffset(info, glyph_index); + int g; + if (info->cff.size) + return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0; + g = stbtt__GetGlyfOffset(info, glyph_index); if (g < 0) return 1; numberOfContours = ttSHORT(info->data + g); return numberOfContours == 0; @@ -1254,7 +1503,7 @@ static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_ return num_vertices; } -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) { stbtt_int16 numberOfContours; stbtt_uint8 *endPtsOfContours; @@ -1480,6 +1729,416 @@ STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, s return num_vertices; } +typedef struct +{ + int bounds; + int started; + float first_x, first_y; + float x, y; + stbtt_int32 min_x, max_x, min_y, max_y; + + stbtt_vertex *pvertices; + int num_vertices; +} stbtt__csctx; + +#define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0} + +static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y) +{ + if (x > c->max_x || !c->started) c->max_x = x; + if (y > c->max_y || !c->started) c->max_y = y; + if (x < c->min_x || !c->started) c->min_x = x; + if (y < c->min_y || !c->started) c->min_y = y; + c->started = 1; +} + +static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1) +{ + if (c->bounds) { + stbtt__track_vertex(c, x, y); + if (type == STBTT_vcubic) { + stbtt__track_vertex(c, cx, cy); + stbtt__track_vertex(c, cx1, cy1); + } + } else { + stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy); + c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1; + c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1; + } + c->num_vertices++; +} + +static void stbtt__csctx_close_shape(stbtt__csctx *ctx) +{ + if (ctx->first_x != ctx->x || ctx->first_y != ctx->y) + stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy) +{ + stbtt__csctx_close_shape(ctx); + ctx->first_x = ctx->x = ctx->x + dx; + ctx->first_y = ctx->y = ctx->y + dy; + stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy) +{ + ctx->x += dx; + ctx->y += dy; + stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); +} + +static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) +{ + float cx1 = ctx->x + dx1; + float cy1 = ctx->y + dy1; + float cx2 = cx1 + dx2; + float cy2 = cy1 + dy2; + ctx->x = cx2 + dx3; + ctx->y = cy2 + dy3; + stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2); +} + +static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n) +{ + int count = stbtt__cff_index_count(&idx); + int bias = 107; + if (count >= 33900) + bias = 32768; + else if (count >= 1240) + bias = 1131; + n += bias; + if (n < 0 || n >= count) + return stbtt__new_buf(NULL, 0); + return stbtt__cff_index_get(idx, n); +} + +static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index) +{ + stbtt__buf fdselect = info->fdselect; + int nranges, start, end, v, fmt, fdselector = -1, i; + + stbtt__buf_seek(&fdselect, 0); + fmt = stbtt__buf_get8(&fdselect); + if (fmt == 0) { + // untested + stbtt__buf_skip(&fdselect, glyph_index); + fdselector = stbtt__buf_get8(&fdselect); + } else if (fmt == 3) { + nranges = stbtt__buf_get16(&fdselect); + start = stbtt__buf_get16(&fdselect); + for (i = 0; i < nranges; i++) { + v = stbtt__buf_get8(&fdselect); + end = stbtt__buf_get16(&fdselect); + if (glyph_index >= start && glyph_index < end) { + fdselector = v; + break; + } + start = end; + } + } + if (fdselector == -1) stbtt__new_buf(NULL, 0); + return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector)); +} + +static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c) +{ + int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0; + int has_subrs = 0, clear_stack; + float s[48]; + stbtt__buf subr_stack[10], subrs = info->subrs, b; + float f; + +#define STBTT__CSERR(s) (0) + + // this currently ignores the initial width value, which isn't needed if we have hmtx + b = stbtt__cff_index_get(info->charstrings, glyph_index); + while (b.cursor < b.size) { + i = 0; + clear_stack = 1; + b0 = stbtt__buf_get8(&b); + switch (b0) { + // @TODO implement hinting + case 0x13: // hintmask + case 0x14: // cntrmask + if (in_header) + maskbits += (sp / 2); // implicit "vstem" + in_header = 0; + stbtt__buf_skip(&b, (maskbits + 7) / 8); + break; + + case 0x01: // hstem + case 0x03: // vstem + case 0x12: // hstemhm + case 0x17: // vstemhm + maskbits += (sp / 2); + break; + + case 0x15: // rmoveto + in_header = 0; + if (sp < 2) return STBTT__CSERR("rmoveto stack"); + stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]); + break; + case 0x04: // vmoveto + in_header = 0; + if (sp < 1) return STBTT__CSERR("vmoveto stack"); + stbtt__csctx_rmove_to(c, 0, s[sp-1]); + break; + case 0x16: // hmoveto + in_header = 0; + if (sp < 1) return STBTT__CSERR("hmoveto stack"); + stbtt__csctx_rmove_to(c, s[sp-1], 0); + break; + + case 0x05: // rlineto + if (sp < 2) return STBTT__CSERR("rlineto stack"); + for (; i + 1 < sp; i += 2) + stbtt__csctx_rline_to(c, s[i], s[i+1]); + break; + + // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical + // starting from a different place. + + case 0x07: // vlineto + if (sp < 1) return STBTT__CSERR("vlineto stack"); + goto vlineto; + case 0x06: // hlineto + if (sp < 1) return STBTT__CSERR("hlineto stack"); + for (;;) { + if (i >= sp) break; + stbtt__csctx_rline_to(c, s[i], 0); + i++; + vlineto: + if (i >= sp) break; + stbtt__csctx_rline_to(c, 0, s[i]); + i++; + } + break; + + case 0x1F: // hvcurveto + if (sp < 4) return STBTT__CSERR("hvcurveto stack"); + goto hvcurveto; + case 0x1E: // vhcurveto + if (sp < 4) return STBTT__CSERR("vhcurveto stack"); + for (;;) { + if (i + 3 >= sp) break; + stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f); + i += 4; + hvcurveto: + if (i + 3 >= sp) break; + stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]); + i += 4; + } + break; + + case 0x08: // rrcurveto + if (sp < 6) return STBTT__CSERR("rcurveline stack"); + for (; i + 5 < sp; i += 6) + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + break; + + case 0x18: // rcurveline + if (sp < 8) return STBTT__CSERR("rcurveline stack"); + for (; i + 5 < sp - 2; i += 6) + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack"); + stbtt__csctx_rline_to(c, s[i], s[i+1]); + break; + + case 0x19: // rlinecurve + if (sp < 8) return STBTT__CSERR("rlinecurve stack"); + for (; i + 1 < sp - 6; i += 2) + stbtt__csctx_rline_to(c, s[i], s[i+1]); + if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack"); + stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); + break; + + case 0x1A: // vvcurveto + case 0x1B: // hhcurveto + if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack"); + f = 0.0; + if (sp & 1) { f = s[i]; i++; } + for (; i + 3 < sp; i += 4) { + if (b0 == 0x1B) + stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0); + else + stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]); + f = 0.0; + } + break; + + case 0x0A: // callsubr + if (!has_subrs) { + if (info->fdselect.size) + subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); + has_subrs = 1; + } + // fallthrough + case 0x1D: // callgsubr + if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); + v = (int) s[--sp]; + if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit"); + subr_stack[subr_stack_height++] = b; + b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v); + if (b.size == 0) return STBTT__CSERR("subr not found"); + b.cursor = 0; + clear_stack = 0; + break; + + case 0x0B: // return + if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr"); + b = subr_stack[--subr_stack_height]; + clear_stack = 0; + break; + + case 0x0E: // endchar + stbtt__csctx_close_shape(c); + return 1; + + case 0x0C: { // two-byte escape + float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6; + float dx, dy; + int b1 = stbtt__buf_get8(&b); + switch (b1) { + // @TODO These "flex" implementations ignore the flex-depth and resolution, + // and always draw beziers. + case 0x22: // hflex + if (sp < 7) return STBTT__CSERR("hflex stack"); + dx1 = s[0]; + dx2 = s[1]; + dy2 = s[2]; + dx3 = s[3]; + dx4 = s[4]; + dx5 = s[5]; + dx6 = s[6]; + stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0); + stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0); + break; + + case 0x23: // flex + if (sp < 13) return STBTT__CSERR("flex stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dy3 = s[5]; + dx4 = s[6]; + dy4 = s[7]; + dx5 = s[8]; + dy5 = s[9]; + dx6 = s[10]; + dy6 = s[11]; + //fd is s[12] + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); + stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); + break; + + case 0x24: // hflex1 + if (sp < 9) return STBTT__CSERR("hflex1 stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dx4 = s[5]; + dx5 = s[6]; + dy5 = s[7]; + dx6 = s[8]; + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0); + stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5)); + break; + + case 0x25: // flex1 + if (sp < 11) return STBTT__CSERR("flex1 stack"); + dx1 = s[0]; + dy1 = s[1]; + dx2 = s[2]; + dy2 = s[3]; + dx3 = s[4]; + dy3 = s[5]; + dx4 = s[6]; + dy4 = s[7]; + dx5 = s[8]; + dy5 = s[9]; + dx6 = dy6 = s[10]; + dx = dx1+dx2+dx3+dx4+dx5; + dy = dy1+dy2+dy3+dy4+dy5; + if (STBTT_fabs(dx) > STBTT_fabs(dy)) + dy6 = -dy; + else + dx6 = -dx; + stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); + stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); + break; + + default: + return STBTT__CSERR("unimplemented"); + } + } break; + + default: + if (b0 != 255 && b0 != 28 && (b0 < 32 || b0 > 254)) + return STBTT__CSERR("reserved operator"); + + // push immediate + if (b0 == 255) { + f = (float)stbtt__buf_get32(&b) / 0x10000; + } else { + stbtt__buf_skip(&b, -1); + f = (float)(stbtt_int16)stbtt__cff_int(&b); + } + if (sp >= 48) return STBTT__CSERR("push stack overflow"); + s[sp++] = f; + clear_stack = 0; + break; + } + if (clear_stack) sp = 0; + } + return STBTT__CSERR("no endchar"); + +#undef STBTT__CSERR +} + +static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + // runs the charstring twice, once to count and once to output (to avoid realloc) + stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1); + stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0); + if (stbtt__run_charstring(info, glyph_index, &count_ctx)) { + *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata); + output_ctx.pvertices = *pvertices; + if (stbtt__run_charstring(info, glyph_index, &output_ctx)) { + STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices); + return output_ctx.num_vertices; + } + } + *pvertices = NULL; + return 0; +} + +static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) +{ + stbtt__csctx c = STBTT__CSCTX_INIT(1); + int r = stbtt__run_charstring(info, glyph_index, &c); + if (x0) { + *x0 = r ? c.min_x : 0; + *y0 = r ? c.min_y : 0; + *x1 = r ? c.max_x : 0; + *y1 = r ? c.max_y : 0; + } + return r ? c.num_vertices : 0; +} + +STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) +{ + if (!info->cff.size) + return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices); + else + return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices); +} + STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) { stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); @@ -2350,6 +3009,48 @@ static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x return 1; } +static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n) +{ + // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough + float dx0 = x1-x0; + float dy0 = y1-y0; + float dx1 = x2-x1; + float dy1 = y2-y1; + float dx2 = x3-x2; + float dy2 = y3-y2; + float dx = x3-x0; + float dy = y3-y0; + float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2)); + float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy); + float flatness_squared = longlen*longlen-shortlen*shortlen; + + if (n > 16) // 65536 segments on one curve better be enough! + return; + + if (flatness_squared > objspace_flatness_squared) { + float x01 = (x0+x1)/2; + float y01 = (y0+y1)/2; + float x12 = (x1+x2)/2; + float y12 = (y1+y2)/2; + float x23 = (x2+x3)/2; + float y23 = (y2+y3)/2; + + float xa = (x01+x12)/2; + float ya = (y01+y12)/2; + float xb = (x12+x23)/2; + float yb = (y12+y23)/2; + + float mx = (xa+xb)/2; + float my = (ya+yb)/2; + + stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1); + stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1); + } else { + stbtt__add_point(points, *num_points,x3,y3); + *num_points = *num_points+1; + } +} + // returns number of contours static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) { @@ -2406,6 +3107,14 @@ static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, objspace_flatness_squared, 0); x = vertices[i].x, y = vertices[i].y; break; + case STBTT_vcubic: + stbtt__tesselate_cubic(points, &num_points, x,y, + vertices[i].cx, vertices[i].cy, + vertices[i].cx1, vertices[i].cy1, + vertices[i].x, vertices[i].y, + objspace_flatness_squared, 0); + x = vertices[i].x, y = vertices[i].y; + break; } } (*contour_lengths)[n] = num_points - start; @@ -2532,7 +3241,7 @@ STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned ch // // This is SUPER-CRAPPY packing to keep source code small -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) +static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) float pixel_height, // height of font in pixels unsigned char *pixels, int pw, int ph, // bitmap to be filled in int first_char, int num_chars, // characters to bake @@ -2862,7 +3571,7 @@ static float stbtt__oversample_shift(int oversample) } // rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) { int i,j,k; @@ -2891,7 +3600,7 @@ STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, stbtt_fon } // rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) +STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) { int i,j,k, return_value = 1; @@ -3060,7 +3769,7 @@ STBTT_DEF void stbtt_GetPackedQuad(stbtt_packedchar *chardata, int pw, int ph, i // // check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 *s1, stbtt_int32 len1, const stbtt_uint8 *s2, stbtt_int32 len2) +static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) { stbtt_int32 i=0; @@ -3099,9 +3808,9 @@ static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(const stbtt_uint8 return i; } -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) { - return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((const stbtt_uint8*) s1, len1, (const stbtt_uint8*) s2, len2); + return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); } // returns results in whatever encoding you request... but note that 2-byte encodings @@ -3157,7 +3866,7 @@ static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, return 1; } else if (matchlen < nlen && name[matchlen] == ' ') { ++matchlen; - if (stbtt_CompareUTF8toUTF16_bigendian((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) + if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) return 1; } } else { @@ -3203,7 +3912,7 @@ static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *nam return 0; } -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const char *name_utf8, stbtt_int32 flags) +static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags) { stbtt_int32 i; for (i=0;;++i) { @@ -3214,11 +3923,53 @@ STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *font_collection, const } } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif + +STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, + float pixel_height, unsigned char *pixels, int pw, int ph, + int first_char, int num_chars, stbtt_bakedchar *chardata) +{ + return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); +} + +STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) +{ + return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); +} + +STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) +{ + return stbtt_GetNumberOfFonts_internal((unsigned char *) data); +} + +STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset) +{ + return stbtt_InitFont_internal(info, (unsigned char *) data, offset); +} + +STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags) +{ + return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags); +} + +STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) +{ + return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2); +} + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + #endif // STB_TRUETYPE_IMPLEMENTATION // FULL VERSION HISTORY // +// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual // 1.11 (2016-04-02) fix unused-variable warning // 1.10 (2016-04-02) allow user-defined fabs() replacement // fix memory leak if fontsize=0.0 -- cgit v1.2.3 From 7586031410c7c3746025ef6c8bc6bee4b73baf1f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 19 Jan 2017 13:18:04 +0100 Subject: Support 32bit wav data --- src/audio.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 119b057d..74a54b04 100644 --- a/src/audio.c +++ b/src/audio.c @@ -459,7 +459,15 @@ void SetSoundPitch(Sound sound, float pitch) void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) { // Format sample rate - if (wave->sampleRate != sampleRate) wave->sampleRate = sampleRate; + // NOTE: Only supported 22050 <--> 44100 + if (wave->sampleRate != sampleRate) + { + // TODO: Resample wave data (upsampling or downsampling) + // NOTE 1: To downsample, you have to drop samples or average them. + // NOTE 2: To upsample, you have to interpolate new samples. + + wave->sampleRate = sampleRate; + } // Format sample size // NOTE: Only supported 8 bit <--> 16 bit <--> 32 bit @@ -1078,23 +1086,23 @@ static Wave LoadWAV(const char *fileName) else { // Allocate memory for data - wave.data = (unsigned char *)malloc(sizeof(unsigned char)*wavData.subChunkSize); + wave.data = malloc(wavData.subChunkSize); // Read in the sound data into the soundData variable - fread(wave.data, wavData.subChunkSize, 1, wavFile); + fread(wave.data, 1, wavData.subChunkSize, wavFile); // Store wave parameters wave.sampleRate = wavFormat.sampleRate; wave.sampleSize = wavFormat.bitsPerSample; wave.channels = wavFormat.numChannels; - // NOTE: Only support up to 16 bit sample sizes - if (wave.sampleSize > 16) + // NOTE: Only support 8 bit, 16 bit and 32 bit sample sizes + if ((wave.sampleSize != 8) && (wave.sampleSize != 16) && (wave.sampleSize != 32)) { - WaveFormat(&wave, wave.sampleRate, 16, wave.channels); TraceLog(WARNING, "[%s] WAV sample size (%ibit) not supported, converted to 16bit", fileName, wave.sampleSize); + WaveFormat(&wave, wave.sampleRate, 16, wave.channels); } - + // NOTE: Only support up to 2 channels (mono, stereo) if (wave.channels > 2) { -- cgit v1.2.3 From f164ec80d6f1ca7afb7aec6a1e525cd67d401c14 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Jan 2017 15:31:56 +0100 Subject: Upload wave collector - GGJ17 game --- src/audio.c | 8 +++++++- src/rlgl.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 74a54b04..3b463df3 100644 --- a/src/audio.c +++ b/src/audio.c @@ -839,7 +839,13 @@ void SetMusicPitch(Music music, float pitch) { alSourcef(music->stream.source, AL_PITCH, pitch); } - +/* +// Set music speed +void SetMusicSpeed(Music music, float pitch) +{ + alSourcef(music->stream.source, AL_PITCH, 0.5f); +} +*/ // Get music time length (in seconds) float GetMusicTimeLength(Music music) { diff --git a/src/rlgl.h b/src/rlgl.h index b7c9df00..9cee39cc 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -97,7 +97,7 @@ // NOTE: This is the maximum amount of lines, triangles and quads per frame, be careful! #define MAX_LINES_BATCH 8192 #define MAX_TRIANGLES_BATCH 4096 - #define MAX_QUADS_BATCH 4096 + #define MAX_QUADS_BATCH 8192 #elif defined(GRAPHICS_API_OPENGL_ES2) // NOTE: Reduce memory sizes for embedded systems (RPI and HTML5) // NOTE: On HTML5 (emscripten) this is allocated on heap, by default it's only 16MB!...just take care... -- cgit v1.2.3 From 825eab37e23658264361c0301e6e6a0dc7822428 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 24 Jan 2017 00:32:16 +0100 Subject: Revert unneeded change --- src/audio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 3b463df3..74a54b04 100644 --- a/src/audio.c +++ b/src/audio.c @@ -839,13 +839,7 @@ void SetMusicPitch(Music music, float pitch) { alSourcef(music->stream.source, AL_PITCH, pitch); } -/* -// Set music speed -void SetMusicSpeed(Music music, float pitch) -{ - alSourcef(music->stream.source, AL_PITCH, 0.5f); -} -*/ + // Get music time length (in seconds) float GetMusicTimeLength(Music music) { -- cgit v1.2.3 From d8edcafe5a28a1b480acfa07714726ffe5b1a2bb Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 25 Jan 2017 11:38:15 +0100 Subject: Wait for events when window is minimized... ...instead of keep polling --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4d662a41..2917d839 100644 --- a/src/core.c +++ b/src/core.c @@ -494,7 +494,7 @@ bool WindowShouldClose(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // While window minimized, stop loop execution - while (windowMinimized) glfwPollEvents(); + while (windowMinimized) glfwWaitEvents(); return (glfwWindowShouldClose(window)); #endif -- cgit v1.2.3 From 3c3a9318ffe34312bc6c08c10a68bae90ac20080 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Thu, 26 Jan 2017 20:58:00 +0100 Subject: Integrate Android build into Makefile --- src/Makefile | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 2e263189..fff3d436 100644 --- a/src/Makefile +++ b/src/Makefile @@ -32,7 +32,7 @@ .PHONY: all clean install unistall # define raylib platform to compile for -# possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB +# possible platforms: PLATFORM_DESKTOP PLATFORM_ANDROID PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP # define YES if you want shared/dynamic version of library instead of static (default) @@ -69,7 +69,24 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) + # path to Android NDK + ANDROID_NDK = $(ANDROID_NDK_HOME) + + # possible Android architectures: ARM ARM64 + ANDROID_ARCH ?= ARM + + # define YES to use clang instead of gcc + ANDROID_LLVM ?= NO + + # standalone Android toolchain install dir + ANDROID_TOOLCHAIN = $(CURDIR)/toolchain +endif + # define raylib graphics api depending on selected platform +ifeq ($(PLATFORM),PLATFORM_ANDROID) + GRAPHICS = GRAPHICS_API_OPENGL_ES2 +endif ifeq ($(PLATFORM),PLATFORM_RPI) # define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used) GRAPHICS = GRAPHICS_API_OPENGL_ES2 @@ -86,12 +103,41 @@ endif # NOTE: makefiles targets require tab indentation # define compiler: gcc for C program, define as g++ for C++ + +# default gcc compiler +CC = gcc + +ifeq ($(PLATFORM),PLATFORM_ANDROID) + ifeq ($(ANDROID_ARCH),ARM) + ifeq ($(ANDROID_LLVM),YES) + CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang + else + CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-gcc + endif + endif + ifeq ($(ANDROID_ARCH),ARM64) + ifeq ($(ANDROID_LLVM),YES) + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang + else + CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-gcc + endif + endif +endif + ifeq ($(PLATFORM),PLATFORM_WEB) # emscripten compiler CC = emcc -else - # default gcc compiler - CC = gcc +endif + +AR = ar + +ifeq ($(PLATFORM),PLATFORM_ANDROID) + ifeq ($(ANDROID_ARCH),ARM) + AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar + endif + ifeq ($(ANDROID_ARCH),ARM64) + AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar + endif endif # define compiler flags: @@ -128,6 +174,15 @@ ifeq ($(PLATFORM),PLATFORM_RPI) INCLUDES = -I. -Iexternal -I/opt/vc/include \ -I/opt/vc/include/interface/vmcs_host/linux \ -I/opt/vc/include/interface/vcos/pthreads +endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) +# STB libraries and others + INCLUDES = -I. -Iexternal +# OpenAL Soft library + INCLUDES += -Iexternal/openal_soft/include +# Android includes + INCLUDES += -I$(ANDROID_TOOLCHAIN)/sysroot/usr/include + INCLUDES += -I$(ANDROID_NDK)/sources/android/native_app_glue else # STB libraries and others INCLUDES = -I. -Iexternal @@ -149,6 +204,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) OUTPUT_PATH = ../release/osx endif endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) + ifeq ($(ANDROID_ARCH),ARM) + OUTPUT_PATH = ../release/android/armeabi-v7a + endif + ifeq ($(ANDROID_ARCH),ARM64) + OUTPUT_PATH = ../release/android/arm64-v8a + endif +endif ifeq ($(PLATFORM),PLATFORM_WEB) OUTPUT_PATH = ../release/html5 endif @@ -164,7 +227,18 @@ OBJS += external/stb_vorbis.o # typing 'make' will invoke the default target entry called 'all', # in this case, the 'default' target entry is raylib -all: raylib +all: toolchain raylib + +# make standalone Android toolchain +toolchain: +ifeq ($(PLATFORM),PLATFORM_ANDROID) + ifeq ($(ANDROID_ARCH),ARM) + $(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN) + endif + ifeq ($(ANDROID_ARCH),ARM64) + $(ANDROID_NDK)/build/tools/make-standalone-toolchain.sh --platform=android-21 --toolchain=aarch64-linux-androideabi-4.9 --use-llvm --install-dir=$(ANDROID_TOOLCHAIN) + endif +endif # compile raylib library raylib: $(OBJS) @@ -184,9 +258,13 @@ else $(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!" endif + ifeq ($(PLATFORM),PLATFORM_ANDROID) + $(CC) -shared -o $(OUTPUT_PATH)/libraylib.so $(OBJS) + @echo "raylib shared library (libraylib.so) generated!" + endif else - # compile raylib static library for desktop platforms. - ar rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) + # compile raylib static library. + $(AR) rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) @echo "libraylib.a generated (static library)!" ifeq ($(SHARED_OPENAL),NO) @echo "expected OpenAL Soft static library linking" @@ -283,5 +361,8 @@ ifeq ($(PLATFORM_OS),WINDOWS) del *.o $(OUTPUT_PATH)/libraylib.a $(OUTPUT_PATH)/libraylib.bc $(OUTPUT_PATH)/libraylib.so external/stb_vorbis.o else rm -f *.o $(OUTPUT_PATH)/libraylib.a $(OUTPUT_PATH)/libraylib.bc $(OUTPUT_PATH)/libraylib.so external/stb_vorbis.o +endif +ifeq ($(PLATFORM),PLATFORM_ANDROID) + rm -rf $(ANDROID_TOOLCHAIN) endif @echo "removed all generated files!" -- cgit v1.2.3 From a1527f56202c4967da80770c7f7609b7906f3977 Mon Sep 17 00:00:00 2001 From: Milan Nikolic Date: Thu, 26 Jan 2017 21:49:18 +0100 Subject: Fix RPi build and add missing directories --- src/Makefile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index fff3d436..4c2278f5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -83,6 +83,10 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) ANDROID_TOOLCHAIN = $(CURDIR)/toolchain endif +ifeq ($(PLATFORM),PLATFORM_RPI) + CROSS_COMPILE ?= NO +endif + # define raylib graphics api depending on selected platform ifeq ($(PLATFORM),PLATFORM_ANDROID) GRAPHICS = GRAPHICS_API_OPENGL_ES2 @@ -124,6 +128,13 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID) endif endif +ifeq ($(PLATFORM),PLATFORM_RPI) + ifeq ($(CROSS_COMPILE),YES) + # rpi compiler + CC = armv6j-hardfloat-linux-gnueabi-gcc + endif +endif + ifeq ($(PLATFORM),PLATFORM_WEB) # emscripten compiler CC = emcc @@ -170,11 +181,6 @@ endif #CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes # define any directories containing required header files -ifeq ($(PLATFORM),PLATFORM_RPI) - INCLUDES = -I. -Iexternal -I/opt/vc/include \ - -I/opt/vc/include/interface/vmcs_host/linux \ - -I/opt/vc/include/interface/vcos/pthreads -endif ifeq ($(PLATFORM),PLATFORM_ANDROID) # STB libraries and others INCLUDES = -I. -Iexternal @@ -191,6 +197,16 @@ else # OpenAL Soft library INCLUDES += -Iexternal/openal_soft/include endif +ifeq ($(PLATFORM),PLATFORM_RPI) +# STB libraries and others + INCLUDES = -I. -Iexternal +# RPi libraries + INCLUDES += -I/opt/vc/include + INCLUDES += -I/opt/vc/include/interface/vmcs_host/linux + INCLUDES += -I/opt/vc/include/interface/vcos/pthreads +# OpenAL Soft library + INCLUDES += -Iexternal/openal_soft/include +endif # define output directory for compiled library ifeq ($(PLATFORM),PLATFORM_DESKTOP) -- cgit v1.2.3 From 37a64df7b9944d1d24872f07a7e713884b33432e Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 27 Jan 2017 23:03:08 +0100 Subject: Move lighting system out of raylib Lighting is implemented as a raylib example now --- src/models.c | 48 --------- src/raylib.h | 26 ----- src/rlgl.c | 275 +------------------------------------------------- src/shader_standard.h | 173 ------------------------------- 4 files changed, 3 insertions(+), 519 deletions(-) delete mode 100644 src/shader_standard.h (limited to 'src') diff --git a/src/models.c b/src/models.c index 0673874b..23c2e6fd 100644 --- a/src/models.c +++ b/src/models.c @@ -574,43 +574,6 @@ void DrawGizmo(Vector3 position) rlPopMatrix(); } - -// Draw light in 3D world -void DrawLight(Light light) -{ - switch (light->type) - { - case LIGHT_POINT: - { - DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); - - DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : GRAY)); - DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : GRAY)); - } break; - case LIGHT_DIRECTIONAL: - { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); - - DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); - } break; - case LIGHT_SPOT: - { - DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY)); - - Vector3 dir = VectorSubtract(light->target, light->position); - VectorNormalize(&dir); - - DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : GRAY)); - - //DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : GRAY)); - DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY)); - } break; - default: break; - } -} - // Load mesh from file Mesh LoadMesh(const char *fileName) { @@ -751,17 +714,6 @@ Material LoadDefaultMaterial(void) return material; } -// Load standard material (uses material attributes and lighting shader) -// NOTE: Standard shader supports multiple maps and lights -Material LoadStandardMaterial(void) -{ - Material material = LoadDefaultMaterial(); - - material.shader = GetStandardShader(); - - return material; -} - // Unload material from memory void UnloadMaterial(Material material) { diff --git a/src/raylib.h b/src/raylib.h index a47d3c59..f8f17eec 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -12,7 +12,6 @@ * Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) * Multiple textures support, including compressed formats and mipmaps generation * Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps -* Materials (diffuse, normal, specular) and Lighting (point, directional, spot) support * Powerful math module for Vector, Matrix and Quaternion operations: [raymath] * Audio loading and playing with streaming support and mixing channels [audio] * VR stereo rendering support with configurable HMD device parameters @@ -466,25 +465,6 @@ typedef struct Model { Material material; // Shader and textures data } Model; -// Light type -typedef struct LightData { - unsigned int id; // Light unique id - bool enabled; // Light enabled - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - - Vector3 position; // Light position - Vector3 target; // Light direction: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Light attenuation radius light intensity reduced with distance (world distance) - - Color diffuse; // Light diffuse color - float intensity; // Light intensity level - - float coneAngle; // Light cone max angle: LIGHT_SPOT -} LightData, *Light; - -// Light types -typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; - // Ray type (useful for raycast) typedef struct Ray { Vector3 position; // Ray position (origin) @@ -876,7 +856,6 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo -RLAPI void DrawLight(Light light); // Draw light in 3D world //DrawTorus(), DrawTeapot() could be useful? //------------------------------------------------------------------------------------ @@ -894,7 +873,6 @@ RLAPI void UnloadModel(Model model); RLAPI Material LoadMaterial(const char *fileName); // Load material from file RLAPI Material LoadMaterialEx(Shader shader, Texture2D diffuse, Color color); // Load material from basic shading data RLAPI Material LoadDefaultMaterial(void); // Load default material (uses default models shader) -RLAPI Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) @@ -930,7 +908,6 @@ RLAPI Shader LoadShader(char *vsFileName, char *fsFileName); // Loa RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) RLAPI Shader GetDefaultShader(void); // Get default shader -RLAPI Shader GetStandardShader(void); // Get standard shader RLAPI Texture2D GetDefaultTexture(void); // Get default texture RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location @@ -946,9 +923,6 @@ RLAPI void EndShaderMode(void); // End RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -RLAPI Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool -RLAPI void DestroyLight(Light light); // Destroy a light and take it out of the list - //------------------------------------------------------------------------------------ // VR experience Functions (Module: rlgl) // NOTE: This functions are useless when using OpenGL 1.1 diff --git a/src/rlgl.c b/src/rlgl.c index bcbca227..8ec867eb 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -22,7 +22,6 @@ * GRAPHICS_API_OPENGL_ES2 - Use OpenGL ES 2.0 backend * * RLGL_STANDALONE - Use rlgl as standalone library (no raylib dependency) -* RLGL_NO_STANDARD_SHADER - Avoid standard shader (shader_standard.h) inclusion * RLGL_NO_DISTORTION_SHADER - Avoid stereo rendering distortion sahder (shader_distortion.h) inclusion * RLGL_OCULUS_SUPPORT - Enable Oculus Rift CV1 functionality * @@ -92,10 +91,6 @@ #include // Required for: va_list, va_start(), vfprintf(), va_end() [Used only on TraceLog()] #endif -#if !defined(GRAPHICS_API_OPENGL_11) && !defined(RLGL_NO_STANDARD_SHADER) - #include "shader_standard.h" // Standard shader to be embedded -#endif - #if !defined(GRAPHICS_API_OPENGL_11) && !defined(RLGL_NO_DISTORTION_SHADER) #include "shader_distortion.h" // Distortion shader to be embedded #endif @@ -118,8 +113,6 @@ #define MAX_DRAWS_BY_TEXTURE 256 // Draws are organized by texture changes #define TEMP_VERTEX_BUFFER_SIZE 4096 // Temporal Vertex Buffer (required for vertex-transformations) // NOTE: Every vertex are 3 floats (12 bytes) - -#define MAX_LIGHTS 8 // Max lights supported by standard shader #ifndef GL_SHADING_LANGUAGE_VERSION #define GL_SHADING_LANGUAGE_VERSION 0x8B8C @@ -305,10 +298,7 @@ static bool useTempBuffer = false; // Shader Programs static Shader defaultShader; // Basic shader, support vertex color and diffuse texture -static Shader standardShader; // Shader with support for lighting and materials - // NOTE: Lazy initialization when GetStandardShader() static Shader currentShader; // Shader to be used on rendering (by default, defaultShader) -static bool standardShaderLoaded = false; // Flag to track if standard shader has been loaded // Extension supported flag: VAO static bool vaoSupported = false; // VAO support (OpenGL ES2 could not support VAO extension) @@ -368,12 +358,6 @@ static unsigned int whiteTexture; static int screenWidth; // Default framebuffer width static int screenHeight; // Default framebuffer height -// Lighting data -static Light lights[MAX_LIGHTS]; // Lights pool -static int lightsCount = 0; // Enabled lights counter -static int lightsLocs[MAX_LIGHTS][8]; // Lights location points in shader: 8 possible points per light: - // enabled, type, position, target, radius, diffuse, intensity, coneAngle - //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- @@ -382,10 +366,8 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShaderStr); // Load custom shader strings and return program id static Shader LoadDefaultShader(void); // Load default shader (just vertex positioning and texture coloring) -static Shader LoadStandardShader(void); // Load standard shader (support materials and lighting) static void LoadDefaultShaderLocations(Shader *shader); // Bind default shader locations (attributes and uniforms) static void UnloadDefaultShader(void); // Unload default shader -static void UnloadStandardShader(void); // Unload standard shader static void LoadDefaultBuffers(void); // Load default internal buffers (lines, triangles, quads) static void UpdateDefaultBuffers(void); // Update default internal buffers (VAOs/VBOs) with vertex data @@ -397,9 +379,6 @@ static void SetStereoConfig(VrDeviceInfo info); // Set internal projection and modelview matrix depending on eyes tracking data static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView); - -static void GetShaderLightsLocations(Shader shader); // Get shader locations for lights (up to MAX_LIGHTS) -static void SetShaderLightsValues(Shader shader); // Set shader uniform values for lights #endif #if defined(RLGL_OCULUS_SUPPORT) @@ -1328,19 +1307,11 @@ void rlglClose(void) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) UnloadDefaultShader(); - UnloadStandardShader(); UnloadDefaultBuffers(); // Delete default white texture glDeleteTextures(1, &whiteTexture); TraceLog(INFO, "[TEX ID %i] Unloaded texture data (base white texture) from VRAM", whiteTexture); - - // Unload lights - if (lightsCount > 0) - { - for (int i = 0; i < lightsCount; i++) free(lights[i]); - lightsCount = 0; - } free(draws); #endif @@ -2003,8 +1974,6 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array - // TODO: Support OpenGL 1.1 lighting system - rlPushMatrix(); rlMultMatrixf(MatrixToFloat(transform)); rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); @@ -2070,10 +2039,6 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Check if glossiness is located in shader and upload value int glossinessLoc = glGetUniformLocation(material.shader.id, "glossiness"); if (glossinessLoc != -1) glUniform1f(glossinessLoc, material.glossiness); - - // Set shader lights values for enabled lights - // NOTE: Lights array location points are obtained on shader loading (if available) - if (lightsCount > 0) SetShaderLightsValues(material.shader); } // Set shader textures (diffuse, normal, specular) @@ -2528,25 +2493,6 @@ Shader GetDefaultShader(void) #endif } -// Get default shader -// NOTE: Inits global variable standardShader -Shader GetStandardShader(void) -{ - Shader shader = { 0 }; - -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (standardShaderLoaded) shader = standardShader; - else - { - // Lazy initialization of standard shader - standardShader = LoadStandardShader(); - shader = standardShader; - } -#endif - - return shader; -} - // Get shader uniform location int GetShaderLocation(Shader shader, const char *uniformName) { @@ -2571,7 +2517,7 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size) else if (size == 4) glUniform4fv(uniformLoc, 1, value); // Shader uniform type: vec4 else TraceLog(WARNING, "Shader value float array size not supported"); - glUseProgram(0); + //glUseProgram(0); // Avoid reseting current shader program, in case other uniforms are set #endif } @@ -2587,7 +2533,7 @@ void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size) else if (size == 4) glUniform4iv(uniformLoc, 1, value); // Shader uniform type: ivec4 else TraceLog(WARNING, "Shader value int array size not supported"); - glUseProgram(0); + //glUseProgram(0); #endif } @@ -2599,7 +2545,7 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) glUniformMatrix4fv(uniformLoc, 1, false, MatrixToFloat(mat)); - glUseProgram(0); + //glUseProgram(0); #endif } @@ -2645,73 +2591,6 @@ void EndBlendMode(void) BeginBlendMode(BLEND_ALPHA); } -// Create a new light, initialize it and add to pool -Light CreateLight(int type, Vector3 position, Color diffuse) -{ - Light light = NULL; - - if (lightsCount < MAX_LIGHTS) - { - // Allocate dynamic memory - light = (Light)malloc(sizeof(LightData)); - - // Initialize light values with generic values - light->id = lightsCount; - light->type = type; - light->enabled = true; - - light->position = position; - light->target = (Vector3){ 0.0f, 0.0f, 0.0f }; - light->intensity = 1.0f; - light->diffuse = diffuse; - - // Add new light to the array - lights[lightsCount] = light; - - // Increase enabled lights count - lightsCount++; - } - else - { - TraceLog(WARNING, "Too many lights, only supported up to %i lights", MAX_LIGHTS); - - // NOTE: Returning latest created light to avoid crashes - light = lights[lightsCount]; - } - -#if defined(GRAPHICS_API_OPENGL_11) - TraceLog(WARNING, "Lighting currently not supported on OpenGL 1.1"); -#endif - - return light; -} - -// Destroy a light and take it out of the list -void DestroyLight(Light light) -{ - if (light != NULL) - { - int lightId = light->id; - - // Free dynamic memory allocation - free(lights[lightId]); - - // Remove *obj from the pointers array - for (int i = lightId; i < lightsCount; i++) - { - // Resort all the following pointers of the array - if ((i + 1) < lightsCount) - { - lights[i] = lights[i + 1]; - lights[i]->id = lights[i + 1]->id; - } - } - - // Decrease enabled physic objects count - lightsCount--; - } -} - // Init VR device (or simulator) // NOTE: If device is not available, it fallbacks to default device (simulator) // NOTE: It modifies the global variable: VrDeviceInfo hmd @@ -3209,39 +3088,6 @@ static Shader LoadDefaultShader(void) return shader; } -// Load standard shader -// NOTE: This shader supports: -// - Up to 3 different maps: diffuse, normal, specular -// - Material properties: colAmbient, colDiffuse, colSpecular, glossiness -// - Up to 8 lights: Point, Directional or Spot -static Shader LoadStandardShader(void) -{ - Shader shader; - -#if !defined(RLGL_NO_STANDARD_SHADER) - // Load standard shader (embeded in standard_shader.h) - shader.id = LoadShaderProgram(vStandardShaderStr, fStandardShaderStr); - - if (shader.id != 0) - { - LoadDefaultShaderLocations(&shader); - TraceLog(INFO, "[SHDR ID %i] Standard shader loaded successfully", shader.id); - - standardShaderLoaded = true; - } - else - { - TraceLog(WARNING, "[SHDR ID %i] Standard shader could not be loaded, using default shader", shader.id); - shader = GetDefaultShader(); - } -#else - shader = GetDefaultShader(); - TraceLog(WARNING, "[SHDR ID %i] Standard shader not available, using default shader", shader.id); -#endif - - return shader; -} - // Get location handlers to for shader attributes and uniforms // NOTE: If any location is not found, loc point becomes -1 static void LoadDefaultShaderLocations(Shader *shader) @@ -3275,9 +3121,6 @@ static void LoadDefaultShaderLocations(Shader *shader) shader->mapTexture2Loc = glGetUniformLocation(shader->id, "texture2"); // TODO: Try to find all expected/recognized shader locations (predefined names, must be documented) - - // Try to get lights location points (if available) - GetShaderLightsLocations(*shader); } // Unload default shader @@ -3292,20 +3135,6 @@ static void UnloadDefaultShader(void) glDeleteProgram(defaultShader.id); } -// Unload standard shader -static void UnloadStandardShader(void) -{ - glUseProgram(0); -#if !defined(RLGL_NO_STANDARD_SHADER) - //glDetachShader(defaultShader, vertexShader); - //glDetachShader(defaultShader, fragmentShader); - //glDeleteShader(vertexShader); // Already deleted on shader compilation - //glDeleteShader(fragmentShader); // Already deleted on shader compilation - glDeleteProgram(standardShader.id); -#endif -} - - // Load default internal buffers (lines, triangles, quads) static void LoadDefaultBuffers(void) { @@ -3763,104 +3592,6 @@ static void UnloadDefaultBuffers(void) free(quads.indices); } -// Get shader locations for lights (up to MAX_LIGHTS) -static void GetShaderLightsLocations(Shader shader) -{ - char locName[32] = "lights[x].\0"; - char locNameUpdated[64]; - - for (int i = 0; i < MAX_LIGHTS; i++) - { - locName[7] = '0' + i; - - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "enabled\0"); - lightsLocs[i][0] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "type\0"); - lightsLocs[i][1] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "position\0"); - lightsLocs[i][2] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "direction\0"); - lightsLocs[i][3] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "radius\0"); - lightsLocs[i][4] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "diffuse\0"); - lightsLocs[i][5] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "intensity\0"); - lightsLocs[i][6] = glGetUniformLocation(shader.id, locNameUpdated); - - locNameUpdated[0] = '\0'; - strcpy(locNameUpdated, locName); - strcat(locNameUpdated, "coneAngle\0"); - lightsLocs[i][7] = glGetUniformLocation(shader.id, locNameUpdated); - } -} - -// Set shader uniform values for lights -// NOTE: It would be far easier with shader UBOs but are not supported on OpenGL ES 2.0 -static void SetShaderLightsValues(Shader shader) -{ - for (int i = 0; i < MAX_LIGHTS; i++) - { - if (i < lightsCount) - { - glUniform1i(lightsLocs[i][0], lights[i]->enabled); - - glUniform1i(lightsLocs[i][1], lights[i]->type); - glUniform4f(lightsLocs[i][5], (float)lights[i]->diffuse.r/255, (float)lights[i]->diffuse.g/255, (float)lights[i]->diffuse.b/255, (float)lights[i]->diffuse.a/255); - glUniform1f(lightsLocs[i][6], lights[i]->intensity); - - switch (lights[i]->type) - { - case LIGHT_POINT: - { - glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - glUniform1f(lightsLocs[i][4], lights[i]->radius); - } break; - case LIGHT_DIRECTIONAL: - { - Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position); - VectorNormalize(&direction); - glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); - } break; - case LIGHT_SPOT: - { - glUniform3f(lightsLocs[i][2], lights[i]->position.x, lights[i]->position.y, lights[i]->position.z); - - Vector3 direction = VectorSubtract(lights[i]->target, lights[i]->position); - VectorNormalize(&direction); - glUniform3f(lightsLocs[i][3], direction.x, direction.y, direction.z); - - glUniform1f(lightsLocs[i][7], lights[i]->coneAngle); - } break; - default: break; - } - } - else - { - glUniform1i(lightsLocs[i][0], 0); // Light disabled - } - } -} - // Configure stereo rendering (including distortion shader) with HMD device parameters static void SetStereoConfig(VrDeviceInfo hmd) { diff --git a/src/shader_standard.h b/src/shader_standard.h deleted file mode 100644 index 995c62ea..00000000 --- a/src/shader_standard.h +++ /dev/null @@ -1,173 +0,0 @@ - -// Vertex shader definition to embed, no external file required -static const char vStandardShaderStr[] = -#if defined(GRAPHICS_API_OPENGL_21) -"#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) -"#version 100 \n" -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -"attribute vec3 vertexPosition; \n" -"attribute vec3 vertexNormal; \n" -"attribute vec2 vertexTexCoord; \n" -"attribute vec4 vertexColor; \n" -"varying vec3 fragPosition; \n" -"varying vec3 fragNormal; \n" -"varying vec2 fragTexCoord; \n" -"varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) -"#version 330 \n" -"in vec3 vertexPosition; \n" -"in vec3 vertexNormal; \n" -"in vec2 vertexTexCoord; \n" -"in vec4 vertexColor; \n" -"out vec3 fragPosition; \n" -"out vec3 fragNormal; \n" -"out vec2 fragTexCoord; \n" -"out vec4 fragColor; \n" -#endif -"uniform mat4 mvpMatrix; \n" -"void main() \n" -"{ \n" -" fragPosition = vertexPosition; \n" -" fragNormal = vertexNormal; \n" -" fragTexCoord = vertexTexCoord; \n" -" fragColor = vertexColor; \n" -" gl_Position = mvpMatrix*vec4(vertexPosition, 1.0); \n" -"} \n"; - -// Fragment shader definition to embed, no external file required -static const char fStandardShaderStr[] = -#if defined(GRAPHICS_API_OPENGL_21) -"#version 120 \n" -#elif defined(GRAPHICS_API_OPENGL_ES2) -"#version 100 \n" -"precision mediump float; \n" // precision required for OpenGL ES2 (WebGL) -#endif -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -"varying vec3 fragPosition; \n" -"varying vec3 fragNormal; \n" -"varying vec2 fragTexCoord; \n" -"varying vec4 fragColor; \n" -#elif defined(GRAPHICS_API_OPENGL_33) -"#version 330 \n" -"in vec3 fragPosition; \n" -"in vec3 fragNormal; \n" -"in vec2 fragTexCoord; \n" -"in vec4 fragColor; \n" -"out vec4 finalColor; \n" -#endif -"uniform sampler2D texture0; \n" -"uniform sampler2D texture1; \n" -"uniform sampler2D texture2; \n" -"uniform vec4 colAmbient; \n" -"uniform vec4 colDiffuse; \n" -"uniform vec4 colSpecular; \n" -"uniform float glossiness; \n" -"uniform int useNormal; \n" -"uniform int useSpecular; \n" -"uniform mat4 modelMatrix; \n" -"uniform vec3 viewDir; \n" -"struct Light { \n" -" int enabled; \n" -" int type; \n" -" vec3 position; \n" -" vec3 direction; \n" -" vec4 diffuse; \n" -" float intensity; \n" -" float radius; \n" -" float coneAngle; }; \n" -"const int maxLights = 8; \n" -"uniform Light lights[maxLights]; \n" -"\n" -"vec3 CalcPointLight(Light l, vec3 n, vec3 v, float s) \n" -"{\n" -" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1));\n" -" vec3 surfaceToLight = l.position - surfacePos;\n" -" float brightness = clamp(float(dot(n, surfaceToLight)/(length(surfaceToLight)*length(n))), 0.0, 1.0);\n" -" float diff = 1.0/dot(surfaceToLight/l.radius, surfaceToLight/l.radius)*brightness*l.intensity;\n" -" float spec = 0.0;\n" -" if (diff > 0.0)\n" -" {\n" -" vec3 h = normalize(-l.direction + v);\n" -" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" -" }\n" -" return (diff*l.diffuse.rgb + spec*colSpecular.rgb);\n" -"}\n" -"\n" -"vec3 CalcDirectionalLight(Light l, vec3 n, vec3 v, float s)\n" -"{\n" -" vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" -" float spec = 0.0;\n" -" if (diff > 0.0)\n" -" {\n" -" vec3 h = normalize(lightDir + v);\n" -" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" -" }\n" -" return (diff*l.intensity*l.diffuse.rgb + spec*colSpecular.rgb);\n" -"}\n" -"\n" -"vec3 CalcSpotLight(Light l, vec3 n, vec3 v, float s)\n" -"{\n" -" vec3 surfacePos = vec3(modelMatrix*vec4(fragPosition, 1.0));\n" -" vec3 lightToSurface = normalize(surfacePos - l.position);\n" -" vec3 lightDir = normalize(-l.direction);\n" -" float diff = clamp(float(dot(n, lightDir)), 0.0, 1.0)*l.intensity;\n" -" float attenuation = clamp(float(dot(n, lightToSurface)), 0.0, 1.0);\n" -" attenuation = dot(lightToSurface, -lightDir);\n" -" float lightToSurfaceAngle = degrees(acos(attenuation));\n" -" if (lightToSurfaceAngle > l.coneAngle) attenuation = 0.0;\n" -" float falloff = (l.coneAngle - lightToSurfaceAngle)/l.coneAngle;\n" -" float diffAttenuation = diff*attenuation;\n" -" float spec = 0.0;\n" -" if (diffAttenuation > 0.0)\n" -" {\n" -" vec3 h = normalize(lightDir + v);\n" -" spec = pow(abs(dot(n, h)), 3.0 + glossiness)*s;\n" -" }\n" -" return (falloff*(diffAttenuation*l.diffuse.rgb + spec*colSpecular.rgb));\n" -"}\n" -"\n" -"void main()\n" -"{\n" -" mat3 normalMatrix = mat3(modelMatrix);\n" -" vec3 normal = normalize(normalMatrix*fragNormal);\n" -" vec3 n = normalize(normal);\n" -" vec3 v = normalize(viewDir);\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" vec4 texelColor = texture2D(texture0, fragTexCoord);\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" vec4 texelColor = texture(texture0, fragTexCoord);\n" -#endif -" vec3 lighting = colAmbient.rgb;\n" -" if (useNormal == 1)\n" -" {\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" n *= texture2D(texture1, fragTexCoord).rgb;\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" n *= texture(texture1, fragTexCoord).rgb;\n" -#endif -" n = normalize(n);\n" -" }\n" -" float spec = 1.0;\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" if (useSpecular == 1) spec = texture2D(texture2, fragTexCoord).r;\n" -#elif defined(GRAPHICS_API_OPENGL_33) -" if (useSpecular == 1) spec = texture(texture2, fragTexCoord).r;\n" -#endif -" for (int i = 0; i < maxLights; i++)\n" -" {\n" -" if (lights[i].enabled == 1)\n" -" {\n" -" if(lights[i].type == 0) lighting += CalcPointLight(lights[i], n, v, spec);\n" -" else if(lights[i].type == 1) lighting += CalcDirectionalLight(lights[i], n, v, spec);\n" -" else if(lights[i].type == 2) lighting += CalcSpotLight(lights[i], n, v, spec);\n" -" }\n" -" }\n" -#if defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_21) -" gl_FragColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" -#elif defined(GRAPHICS_API_OPENGL_33) -" finalColor = vec4(texelColor.rgb*lighting*colDiffuse.rgb, texelColor.a*colDiffuse.a); \n" -#endif -"}\n"; -- cgit v1.2.3 From b681e8c2775bbb467c0f0607afd9840fda25c563 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Jan 2017 00:56:45 +0100 Subject: Implemented Wait() Now program is halted (OS signal call) for required amount of time every frame, so CPU usage drops to zero, instead of using a busy wait loop. --- src/core.c | 66 ++++++++++++++++++++++++++++++++++++++++++++---------------- src/raylib.h | 4 ++-- src/text.c | 21 ++----------------- 3 files changed, 53 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 2917d839..8b97314d 100644 --- a/src/core.c +++ b/src/core.c @@ -67,9 +67,13 @@ #include // Required for: strcmp() //#include // Macros for reporting and retrieving error conditions through error codes +#if defined __linux || defined(PLATFORM_WEB) + #include // Required for: timespec, nanosleep(), select() - POSIX +#endif + #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) - //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 - #include // GLFW3 library: Windows, OpenGL context and Input management + //#define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 + #include // GLFW3 library: Windows, OpenGL context and Input management #ifdef __linux #define GLFW_EXPOSE_NATIVE_X11 // Linux specific definitions for getting @@ -243,7 +247,7 @@ static int dropFilesCount = 0; // Count stored strings static double currentTime, previousTime; // Used to track timmings static double updateTime, drawTime; // Time measures for update and draw -static double frameTime; // Time measure for one frame +static double frameTime = 0.0; // Time measure for one frame static double targetTime = 0.0; // Desired time for one frame, if 0 not applied static char configFlags = 0; // Configuration flags (bit based) @@ -264,6 +268,7 @@ static void InitGraphicsDevice(int width, int height); // Initialize graphics d static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer static double GetTime(void); // Returns time since InitTimer() was run +static void Wait(int ms); // Wait for some milliseconds (stop program execution) static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed static void PollInputEvents(void); // Register user events @@ -313,6 +318,11 @@ static void InitGamepad(void); // Init raw gamepad inpu static void *GamepadThread(void *arg); // Mouse reading thread #endif +#if defined(_WIN32) + // NOTE: We include Sleep() function signature here to avoid windows.h inclusion + void __stdcall Sleep(unsigned long msTimeout); // Required for Delay() +#endif + //---------------------------------------------------------------------------------- // Module Functions Definition - Window and OpenGL Context Functions //---------------------------------------------------------------------------------- @@ -638,15 +648,16 @@ void EndDrawing(void) frameTime = updateTime + drawTime; - double extraTime = 0.0; - - while (frameTime < targetTime) + // Wait for some milliseconds... + if (frameTime < targetTime) { - // Implement a delay + Wait((int)((targetTime - frameTime)*1000)); + currentTime = GetTime(); - extraTime = currentTime - previousTime; + double extraTime = currentTime - previousTime; previousTime = currentTime; - frameTime += extraTime; + + frameTime = updateTime + drawTime + extraTime; } } @@ -780,20 +791,16 @@ void SetTargetFPS(int fps) } // Returns current FPS -float GetFPS(void) +int GetFPS(void) { - return (float)(1.0/frameTime); + return (int)floorf(1.0f/GetFrameTime()); } // Returns time in seconds for one frame float GetFrameTime(void) { - // As we are operate quite a lot with frameTime, - // it could be no stable, so we round it before passing it around - // NOTE: There are still problems with high framerates (>500fps) - double roundedFrameTime = round(frameTime*10000)/10000.0; - - return (float)roundedFrameTime; // Time in seconds to run a frame + // NOTE: We round value to milliseconds + return (roundf(frameTime*1000.0)/1000.0f); } // Converts Color to float array and normalizes @@ -1931,6 +1938,31 @@ static double GetTime(void) #endif } +// Wait for some milliseconds (stop program execution) +static void Wait(int ms) +{ +#if defined _WIN32 + Sleep(ms); +#elif defined __linux || defined(PLATFORM_WEB) + struct timespec req = { 0 }; + time_t sec = (int)(ms/1000); + ms -= (sec*1000); + req.tv_sec=sec; + req.tv_nsec=ms*1000000L; + + // NOTE: Use nanosleep() on Unix platforms... usleep() it's deprecated. + while (nanosleep(&req,&req) == -1) continue; +//#elif defined __APPLE__ + // TODO: +#else + double prevTime = GetTime(); + double nextTime = 0.0; + + // Busy wait loop + while ((nextTime - prevTime) < (double)ms/1000.0) nextTime = GetTime(); +#endif +} + // Get one key state static bool GetKeyStatus(int key) { diff --git a/src/raylib.h b/src/raylib.h index f8f17eec..97130253 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -659,8 +659,8 @@ RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) -RLAPI float GetFPS(void); // Returns current FPS -RLAPI float GetFrameTime(void); // Returns time in seconds for one frame +RLAPI int GetFPS(void); // Returns current FPS (rounded value) +RLAPI float GetFrameTime(void); // Returns time in seconds for one frame (rounded value) RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value RLAPI int GetHexValue(Color color); // Returns hexadecimal value for a Color diff --git a/src/text.c b/src/text.c index 4510b3af..4e163668 100644 --- a/src/text.c +++ b/src/text.c @@ -504,25 +504,8 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i // NOTE: Uses default font void DrawFPS(int posX, int posY) { - // NOTE: We are rendering fps every second for better viewing on high framerates - // TODO: Not working properly on ANDROID and RPI (for high framerates) - - static float fps = 0.0f; - static int counter = 0; - static int refreshRate = 20; - - if (counter < refreshRate) - { - counter++; - } - else - { - fps = GetFPS(); - refreshRate = (int)fps; - counter = 0; - } - - DrawText(FormatText("%2.0f FPS", fps), posX, posY, 20, LIME); + // NOTE: We have rounding errors every frame, so it oscillates a lot + DrawText(FormatText("%2i FPS", GetFPS()), posX, posY, 20, LIME); } //---------------------------------------------------------------------------------- -- cgit v1.2.3 From c85dfd4bc65099924b3ffa4402c24b73b40d35f6 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Jan 2017 23:02:30 +0100 Subject: Remove unecessary spaces... --- src/audio.c | 98 ++++++------ src/core.c | 100 ++++++------ src/models.c | 66 ++++---- src/raylib.h | 26 +-- src/rlgl.c | 488 ++++++++++++++++++++++++++++----------------------------- src/text.c | 60 +++---- src/textures.c | 52 +++--- 7 files changed, 445 insertions(+), 445 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 74a54b04..22da74be 100644 --- a/src/audio.c +++ b/src/audio.c @@ -231,9 +231,9 @@ Wave LoadWave(const char *fileName) else if (strcmp(GetExtension(fileName),"rres") == 0) { RRESData rres = LoadResource(fileName); - + // NOTE: Parameters for RRES_WAVE type are: sampleCount, sampleRate, sampleSize, channels - + if (rres.type == RRES_WAVE) wave = LoadWaveEx(rres.data, rres.param1, rres.param2, rres.param3, rres.param4); else TraceLog(WARNING, "[%s] Resource file does not contain wave data", fileName); @@ -248,18 +248,18 @@ Wave LoadWave(const char *fileName) Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels) { Wave wave; - + wave.data = data; wave.sampleCount = sampleCount; wave.sampleRate = sampleRate; wave.sampleSize = sampleSize; wave.channels = channels; - + // NOTE: Copy wave data to work with, user is responsible of input data to free Wave cwave = WaveCopy(wave); - + WaveFormat(&cwave, sampleRate, sampleSize, channels); - + return cwave; } @@ -268,9 +268,9 @@ Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int Sound LoadSound(const char *fileName) { Wave wave = LoadWave(fileName); - + Sound sound = LoadSoundFromWave(wave); - + UnloadWave(wave); // Sound is loaded, we can unload wave return sound; @@ -354,7 +354,7 @@ void UnloadWave(Wave wave) void UnloadSound(Sound sound) { alSourceStop(sound.source); - + alDeleteSources(1, &sound.source); alDeleteBuffers(1, &sound.buffer); @@ -369,13 +369,13 @@ void UpdateSound(Sound sound, const void *data, int numSamples) alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); alGetBufferi(sound.buffer, AL_BITS, &sampleSize); // It could also be retrieved from sound.format alGetBufferi(sound.buffer, AL_CHANNELS, &channels); // It could also be retrieved from sound.format - + TraceLog(DEBUG, "UpdateSound() : AL_FREQUENCY: %i", sampleRate); TraceLog(DEBUG, "UpdateSound() : AL_BITS: %i", sampleSize); TraceLog(DEBUG, "UpdateSound() : AL_CHANNELS: %i", channels); unsigned int dataSize = numSamples*channels*sampleSize/8; // Size of data in bytes - + alSourceStop(sound.source); // Stop sound alSourcei(sound.source, AL_BUFFER, 0); // Unbind buffer from sound to update //alDeleteBuffers(1, &sound.buffer); // Delete current buffer data @@ -463,18 +463,18 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) if (wave->sampleRate != sampleRate) { // TODO: Resample wave data (upsampling or downsampling) - // NOTE 1: To downsample, you have to drop samples or average them. + // NOTE 1: To downsample, you have to drop samples or average them. // NOTE 2: To upsample, you have to interpolate new samples. - + wave->sampleRate = sampleRate; } - + // Format sample size // NOTE: Only supported 8 bit <--> 16 bit <--> 32 bit if (wave->sampleSize != sampleSize) { void *data = malloc(wave->sampleCount*wave->channels*sampleSize/8); - + for (int i = 0; i < wave->sampleCount; i++) { for (int j = 0; j < wave->channels; j++) @@ -484,30 +484,30 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) if (wave->sampleSize == 16) ((unsigned char *)data)[wave->channels*i + j] = (unsigned char)(((float)(((short *)wave->data)[wave->channels*i + j])/32767.0f)*256); else if (wave->sampleSize == 32) ((unsigned char *)data)[wave->channels*i + j] = (unsigned char)(((float *)wave->data)[wave->channels*i + j]*127.0f + 127); } - else if (sampleSize == 16) + else if (sampleSize == 16) { if (wave->sampleSize == 8) ((short *)data)[wave->channels*i + j] = (short)(((float)(((unsigned char *)wave->data)[wave->channels*i + j] - 127)/256.0f)*32767); else if (wave->sampleSize == 32) ((short *)data)[wave->channels*i + j] = (short)((((float *)wave->data)[wave->channels*i + j])*32767); } - else if (sampleSize == 32) + else if (sampleSize == 32) { if (wave->sampleSize == 8) ((float *)data)[wave->channels*i + j] = (float)(((unsigned char *)wave->data)[wave->channels*i + j] - 127)/256.0f; else if (wave->sampleSize == 16) ((float *)data)[wave->channels*i + j] = (float)(((short *)wave->data)[wave->channels*i + j])/32767.0f; } } } - + wave->sampleSize = sampleSize; free(wave->data); wave->data = data; } - + // Format channels (interlaced mode) // NOTE: Only supported mono <--> stereo if (wave->channels != channels) { void *data = malloc(wave->sampleCount*channels*wave->sampleSize/8); - + if ((wave->channels == 1) && (channels == 2)) // mono ---> stereo (duplicate mono information) { for (int i = 0; i < wave->sampleCount; i++) @@ -529,7 +529,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) else if (wave->sampleSize == 32) ((float *)data)[i] = (((float *)wave->data)[j] + ((float *)wave->data)[j + 1])/2.0f; } } - + // TODO: Add/remove additional interlaced channels wave->channels = channels; @@ -563,15 +563,15 @@ Wave WaveCopy(Wave wave) // NOTE: Security check in case of out-of-range void WaveCrop(Wave *wave, int initSample, int finalSample) { - if ((initSample >= 0) && (initSample < finalSample) && + if ((initSample >= 0) && (initSample < finalSample) && (finalSample > 0) && (finalSample < wave->sampleCount)) { int sampleCount = finalSample - initSample; - + void *data = malloc(sampleCount*wave->channels*wave->sampleSize/8); - + memcpy(data, wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->channels*wave->sampleSize/8); - + free(wave->data); wave->data = data; } @@ -583,7 +583,7 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) float *GetWaveData(Wave wave) { float *samples = (float *)malloc(wave.sampleCount*wave.channels*sizeof(float)); - + for (int i = 0; i < wave.sampleCount; i++) { for (int j = 0; j < wave.channels; j++) @@ -593,7 +593,7 @@ float *GetWaveData(Wave wave) else if (wave.sampleSize == 32) samples[wave.channels*i + j] = ((float *)wave.data)[wave.channels*i + j]; } } - + return samples; } @@ -632,7 +632,7 @@ Music LoadMusicStream(const char *fileName) else if (strcmp(GetExtension(fileName), "flac") == 0) { music->ctxFlac = drflac_open_file(fileName); - + if (music->ctxFlac == NULL) TraceLog(WARNING, "[%s] FLAC audio file could not be opened", fileName); else { @@ -641,7 +641,7 @@ Music LoadMusicStream(const char *fileName) music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_FLAC; music->loop = true; // We loop by default - + TraceLog(DEBUG, "[%s] FLAC total samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] FLAC sample rate: %i", fileName, music->ctxFlac->sampleRate); TraceLog(DEBUG, "[%s] FLAC bits per sample: %i", fileName, music->ctxFlac->bitsPerSample); @@ -728,7 +728,7 @@ void ResumeMusicStream(Music music) void StopMusicStream(Music music) { alSourceStop(music->stream.source); - + switch (music->ctxType) { case MUSIC_AUDIO_OGG: stb_vorbis_seek_start(music->ctxOgg); break; @@ -736,7 +736,7 @@ void StopMusicStream(Music music) case MUSIC_MODULE_MOD: jar_mod_seek_start(&music->ctxMod); break; default: break; } - + music->samplesLeft = music->totalSamples; } @@ -745,14 +745,14 @@ void UpdateMusicStream(Music music) { ALenum state; ALint processed = 0; - + alGetSourcei(music->stream.source, AL_SOURCE_STATE, &state); // Get music stream state alGetSourcei(music->stream.source, AL_BUFFERS_PROCESSED, &processed); // Get processed buffers if (processed > 0) { bool active = true; - + // NOTE: Using dynamic allocation because it could require more than 16KB void *pcm = calloc(AUDIO_BUFFER_SIZE*music->stream.channels*music->stream.sampleSize/8, 1); @@ -764,7 +764,7 @@ void UpdateMusicStream(Music music) { if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; else numSamples = music->samplesLeft; - + // TODO: Really don't like ctxType thingy... switch (music->ctxType) { @@ -784,7 +784,7 @@ void UpdateMusicStream(Music music) case MUSIC_MODULE_MOD: jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); break; default: break; } - + UpdateAudioStream(music->stream, pcm, numSamples); music->samplesLeft -= numSamples; @@ -794,12 +794,12 @@ void UpdateMusicStream(Music music) break; } } - + // This error is registered when UpdateAudioStream() fails if (alGetError() == AL_INVALID_VALUE) TraceLog(WARNING, "OpenAL: Error buffering data..."); // Reset audio stream for looping - if (!active) + if (!active) { StopMusicStream(music); // Stop music (and reset) if (music->loop) PlayMusicStream(music); // Play again @@ -810,7 +810,7 @@ void UpdateMusicStream(Music music) // just make sure to play again on window restore if (state != AL_PLAYING) PlayMusicStream(music); } - + free(pcm); } } @@ -866,7 +866,7 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un stream.sampleRate = sampleRate; stream.sampleSize = sampleSize; - + // Only mono and stereo channels are supported, more channels require AL_EXT_MCFORMATS extension if ((channels > 0) && (channels < 3)) stream.channels = channels; else @@ -910,12 +910,12 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un // Initialize buffer with zeros by default // NOTE: Using dynamic allocation because it requires more than 16KB void *pcm = calloc(AUDIO_BUFFER_SIZE*stream.sampleSize/8*stream.channels, 1); - + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) { alBufferData(stream.buffers[i], stream.format, pcm, AUDIO_BUFFER_SIZE*stream.sampleSize/8*stream.channels, stream.sampleRate); } - + free(pcm); alSourceQueueBuffers(stream.source, MAX_STREAM_BUFFERS, stream.buffers); @@ -1095,7 +1095,7 @@ static Wave LoadWAV(const char *fileName) wave.sampleRate = wavFormat.sampleRate; wave.sampleSize = wavFormat.bitsPerSample; wave.channels = wavFormat.numChannels; - + // NOTE: Only support 8 bit, 16 bit and 32 bit sample sizes if ((wave.sampleSize != 8) && (wave.sampleSize != 16) && (wave.sampleSize != 32)) { @@ -1104,16 +1104,16 @@ static Wave LoadWAV(const char *fileName) } // NOTE: Only support up to 2 channels (mono, stereo) - if (wave.channels > 2) + if (wave.channels > 2) { WaveFormat(&wave, wave.sampleRate, wave.sampleSize, 2); TraceLog(WARNING, "[%s] WAV channels number (%i) not supported, converted to 2 channels", fileName, wave.channels); } - + // NOTE: subChunkSize comes in bytes, we need to translate it to number of samples wave.sampleCount = (wavData.subChunkSize/(wave.sampleSize/8))/wave.channels; - TraceLog(INFO, "[%s] WAV file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); + TraceLog(INFO, "[%s] WAV file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); } } } @@ -1145,7 +1145,7 @@ static Wave LoadOGG(const char *fileName) wave.sampleSize = 16; // 16 bit per sample (short) wave.channels = info.channels; wave.sampleCount = (int)stb_vorbis_stream_length_in_samples(oggFile); - + float totalSeconds = stb_vorbis_stream_length_in_seconds(oggFile); if (totalSeconds > 10) TraceLog(WARNING, "[%s] Ogg audio lenght is larger than 10 seconds (%f), that's a big file in memory, consider music streaming", fileName, totalSeconds); @@ -1173,16 +1173,16 @@ static Wave LoadFLAC(const char *fileName) // Decode an entire FLAC file in one go uint64_t totalSampleCount; wave.data = drflac_open_and_decode_file_s16(fileName, &wave.channels, &wave.sampleRate, &totalSampleCount); - + wave.sampleCount = (int)totalSampleCount/wave.channels; wave.sampleSize = 16; - + // NOTE: Only support up to 2 channels (mono, stereo) if (wave.channels > 2) TraceLog(WARNING, "[%s] FLAC channels number (%i) not supported", fileName, wave.channels); if (wave.data == NULL) TraceLog(WARNING, "[%s] FLAC data could not be loaded", fileName); else TraceLog(INFO, "[%s] FLAC file loaded successfully (%i Hz, %i bit, %s)", fileName, wave.sampleRate, wave.sampleSize, (wave.channels == 1) ? "Mono" : "Stereo"); - + return wave; } diff --git a/src/core.c b/src/core.c index 8b97314d..ea363fce 100644 --- a/src/core.c +++ b/src/core.c @@ -9,7 +9,7 @@ * External libs: * GLFW3 - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX) * raymath - 3D math functionality (Vector3, Matrix, Quaternion) -* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person) +* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person) * gestures - Gestures system for touch-ready devices (or simulated from mouse inputs) * * Module Configuration Flags: @@ -103,7 +103,7 @@ #include // Linux: KDSKBMODE, K_MEDIUMRAM constants definition #include // Linux: Keycodes constants definition (KEY_A, ...) #include // Linux: Joystick support library - + #include "bcm_host.h" // Raspberry Pi VideoCore IV access functions #include "EGL/egl.h" // Khronos EGL library - Native platform display device control functions @@ -488,9 +488,9 @@ void CloseWindow(void) // Wait for mouse and gamepad threads to finish before closing // NOTE: Those threads should already have finished at this point // because they are controlled by windowShouldClose variable - + windowShouldClose = true; // Added to force threads to exit when the close window is called - + pthread_join(mouseThreadId, NULL); pthread_join(touchThreadId, NULL); pthread_join(gamepadThreadId, NULL); @@ -649,14 +649,14 @@ void EndDrawing(void) frameTime = updateTime + drawTime; // Wait for some milliseconds... - if (frameTime < targetTime) + if (frameTime < targetTime) { Wait((int)((targetTime - frameTime)*1000)); - + currentTime = GetTime(); double extraTime = currentTime - previousTime; previousTime = currentTime; - + frameTime = updateTime + drawTime + extraTime; } } @@ -1147,7 +1147,7 @@ bool IsKeyDown(int key) bool IsKeyReleased(int key) { bool released = false; - + if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true; else released = false; @@ -1182,7 +1182,7 @@ void SetExitKey(int key) bool IsGamepadAvailable(int gamepad) { bool result = false; - + #if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true; #endif @@ -1196,7 +1196,7 @@ bool IsGamepadName(int gamepad, const char *name) bool result = false; #if !defined(PLATFORM_ANDROID) - const char *gamepadName = NULL; + const char *gamepadName = NULL; if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad); if ((name != NULL) && (gamepadName != NULL)) result = (strcmp(name, gamepadName) == 0); @@ -1235,7 +1235,7 @@ int GetGamepadAxisCount(int gamepad) float GetGamepadAxisMovement(int gamepad, int axis) { float value = 0; - + #if !defined(PLATFORM_ANDROID) if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) value = gamepadAxisState[gamepad][axis]; #endif @@ -1249,8 +1249,8 @@ bool IsGamepadButtonPressed(int gamepad, int button) bool pressed = false; #if !defined(PLATFORM_ANDROID) - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && + (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 1)) pressed = true; #endif @@ -1274,10 +1274,10 @@ bool IsGamepadButtonDown(int gamepad, int button) bool IsGamepadButtonReleased(int gamepad, int button) { bool released = false; - + #if !defined(PLATFORM_ANDROID) - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && - (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && + (currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) && (currentGamepadState[gamepad][button] == 0)) released = true; #endif @@ -1290,7 +1290,7 @@ bool IsGamepadButtonUp(int gamepad, int button) bool result = false; #if !defined(PLATFORM_ANDROID) - if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && + if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) && (currentGamepadState[gamepad][button] == 0)) result = true; #endif @@ -1503,7 +1503,7 @@ static void InitGraphicsDevice(int width, int height) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window } else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable - + //glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits //glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default) @@ -1941,7 +1941,7 @@ static double GetTime(void) // Wait for some milliseconds (stop program execution) static void Wait(int ms) { -#if defined _WIN32 +#if defined _WIN32 Sleep(ms); #elif defined __linux || defined(PLATFORM_WEB) struct timespec req = { 0 }; @@ -1949,7 +1949,7 @@ static void Wait(int ms) ms -= (sec*1000); req.tv_sec=sec; req.tv_nsec=ms*1000000L; - + // NOTE: Use nanosleep() on Unix platforms... usleep() it's deprecated. while (nanosleep(&req,&req) == -1) continue; //#elif defined __APPLE__ @@ -1999,10 +1999,10 @@ static void PollInputEvents(void) // NOTE: Gestures update must be called every frame to reset gestures correctly // because ProcessGestureEvent() is just called on an event, not every frame UpdateGestures(); - + // Reset last key pressed registered lastKeyPressed = -1; - + #if !defined(PLATFORM_RPI) // Reset last gamepad button/axis registered state lastGamepadButtonPressed = -1; @@ -2018,7 +2018,7 @@ static void PollInputEvents(void) mousePosition.x = (float)mouseX; mousePosition.y = (float)mouseY; - + // Keyboard input polling (automatically managed by GLFW3 through callback) // Register previous keys states @@ -2039,7 +2039,7 @@ static void PollInputEvents(void) if (glfwJoystickPresent(i)) gamepadReady[i] = true; else gamepadReady[i] = false; } - + // Register gamepads buttons events for (int i = 0; i < MAX_GAMEPADS; i++) { @@ -2047,14 +2047,14 @@ static void PollInputEvents(void) { // Register previous gamepad states for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; - + // Get current gamepad state // NOTE: There is no callback available, so we get it manually const unsigned char *buttons; int buttonsCount; buttons = glfwGetJoystickButtons(i, &buttonsCount); - + for (int k = 0; (buttons != NULL) && (k < buttonsCount) && (buttonsCount < MAX_GAMEPAD_BUTTONS); k++) { if (buttons[k] == GLFW_PRESS) @@ -2064,18 +2064,18 @@ static void PollInputEvents(void) } else currentGamepadState[i][k] = 0; } - + // Get current axis state const float *axes; int axisCount = 0; axes = glfwGetJoystickAxes(i, &axisCount); - + for (int k = 0; (axes != NULL) && (k < axisCount) && (k < MAX_GAMEPAD_AXIS); k++) { gamepadAxisState[i][k] = axes[k]; } - + gamepadAxisCount = axisCount; } } @@ -2088,16 +2088,16 @@ static void PollInputEvents(void) #if defined(PLATFORM_WEB) // Get number of gamepads connected int numGamepads = emscripten_get_num_gamepads(); - + for (int i = 0; (i < numGamepads) && (i < MAX_GAMEPADS); i++) { // Register previous gamepad button states for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k]; - + EmscriptenGamepadEvent gamepadState; - + int result = emscripten_get_gamepad_status(i, &gamepadState); - + if (result == EMSCRIPTEN_RESULT_SUCCESS) { // Register buttons data for every connected gamepad @@ -2109,16 +2109,16 @@ static void PollInputEvents(void) lastGamepadButtonPressed = j; } else currentGamepadState[i][j] = 0; - + //printf("Gamepad %d, button %d: Digital: %d, Analog: %g\n", gamepadState.index, j, gamepadState.digitalButton[j], gamepadState.analogButton[j]); } - + // Register axis data for every connected gamepad for (int j = 0; (j < gamepadState.numAxes) && (j < MAX_GAMEPAD_AXIS); j++) { gamepadAxisState[i][j] = gamepadState.axis[j]; } - + gamepadAxisCount = gamepadState.numAxes; } } @@ -2665,16 +2665,16 @@ static EM_BOOL EmscriptenGamepadCallback(int eventType, const EmscriptenGamepadE { /* printf("%s: timeStamp: %g, connected: %d, index: %ld, numAxes: %d, numButtons: %d, id: \"%s\", mapping: \"%s\"\n", - eventType != 0 ? emscripten_event_type_to_string(eventType) : "Gamepad state", + eventType != 0 ? emscripten_event_type_to_string(eventType) : "Gamepad state", gamepadEvent->timestamp, gamepadEvent->connected, gamepadEvent->index, gamepadEvent->numAxes, gamepadEvent->numButtons, gamepadEvent->id, gamepadEvent->mapping); - + for(int i = 0; i < gamepadEvent->numAxes; ++i) printf("Axis %d: %g\n", i, gamepadEvent->axis[i]); for(int i = 0; i < gamepadEvent->numButtons; ++i) printf("Button %d: Digital: %d, Analog: %g\n", i, gamepadEvent->digitalButton[i], gamepadEvent->analogButton[i]); */ - + if ((gamepadEvent->connected) && (gamepadEvent->index < MAX_GAMEPADS)) gamepadReady[gamepadEvent->index] = true; else gamepadReady[gamepadEvent->index] = false; - + // TODO: Test gamepadEvent->index return 0; @@ -2935,7 +2935,7 @@ static void InitTouch(void) } // Touch reading thread. -// This reads from a Virtual Input Event /dev/input/event4 which is +// This reads from a Virtual Input Event /dev/input/event4 which is // created by the ts_uinput daemon. This takes, filters and scales // raw input from the Touchscreen (which appears in /dev/input/event3) // based on the Calibration data referenced by tslib. @@ -2949,7 +2949,7 @@ static void *TouchThread(void *arg) if (read(touchStream, &ev, sizeof(ev)) == (int)sizeof(ev)) { // if pressure > 0 then simulate left mouse button click - if (ev.type == EV_ABS && ev.code == 24 && ev.value == 0 && currentMouseState[0] == 1) + if (ev.type == EV_ABS && ev.code == 24 && ev.value == 0 && currentMouseState[0] == 1) { currentMouseState[0] = 0; gestureEvent.touchAction = TOUCH_UP; @@ -2963,10 +2963,10 @@ static void *TouchThread(void *arg) gestureEvent.position[1].x /= (float)GetScreenWidth(); gestureEvent.position[1].y /= (float)GetScreenHeight(); ProcessGestureEvent(gestureEvent); - } - if (ev.type == EV_ABS && ev.code == 24 && ev.value > 0 && currentMouseState[0] == 0) + } + if (ev.type == EV_ABS && ev.code == 24 && ev.value > 0 && currentMouseState[0] == 0) { - currentMouseState[0] = 1; + currentMouseState[0] = 1; gestureEvent.touchAction = TOUCH_DOWN; gestureEvent.pointCount = 1; gestureEvent.pointerId[0] = 0; @@ -2978,9 +2978,9 @@ static void *TouchThread(void *arg) gestureEvent.position[1].x /= (float)GetScreenWidth(); gestureEvent.position[1].y /= (float)GetScreenHeight(); ProcessGestureEvent(gestureEvent); - } + } // x & y values supplied by event4 have been scaled & de-jittered using tslib calibration data - if (ev.type == EV_ABS && ev.code == 0) + if (ev.type == EV_ABS && ev.code == 0) { mousePosition.x = ev.value; if (mousePosition.x < 0) mousePosition.x = 0; @@ -2997,7 +2997,7 @@ static void *TouchThread(void *arg) gestureEvent.position[1].y /= (float)GetScreenHeight(); ProcessGestureEvent(gestureEvent); } - if (ev.type == EV_ABS && ev.code == 1) + if (ev.type == EV_ABS && ev.code == 1) { mousePosition.y = ev.value; if (mousePosition.y < 0) mousePosition.y = 0; @@ -3014,7 +3014,7 @@ static void *TouchThread(void *arg) gestureEvent.position[1].y /= (float)GetScreenHeight(); ProcessGestureEvent(gestureEvent); } - + } } return NULL; @@ -3084,7 +3084,7 @@ static void *GamepadThread(void *arg) { // 1 - button pressed, 0 - button released currentGamepadState[i][gamepadEvent.number] = (int)gamepadEvent.value; - + if ((int)gamepadEvent.value == 1) lastGamepadButtonPressed = gamepadEvent.number; else lastGamepadButtonPressed = -1; } diff --git a/src/models.c b/src/models.c index 23c2e6fd..43821691 100644 --- a/src/models.c +++ b/src/models.c @@ -584,7 +584,7 @@ Mesh LoadMesh(const char *fileName) if (mesh.vertexCount == 0) TraceLog(WARNING, "Mesh could not be loaded"); else rlglLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh) - + // TODO: Initialize default mesh data in case loading fails, maybe a cube? return mesh; @@ -607,7 +607,7 @@ Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color mesh.indices = NULL; rlglLoadMesh(&mesh, false); // Upload vertex data to GPU (static mesh) - + return mesh; } @@ -668,7 +668,7 @@ Model LoadCubicmap(Image cubicmap) return model; } - + // Unload mesh from memory (RAM and/or VRAM) void UnloadMesh(Mesh *mesh) { @@ -1438,34 +1438,34 @@ RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh) int triangleCount = mesh->vertexCount/3; // Test against all triangles in mesh - for (int i = 0; i < triangleCount; i++) + for (int i = 0; i < triangleCount; i++) { Vector3 a, b, c; Vector3 *vertdata = (Vector3 *)mesh->vertices; - - if (mesh->indices) + + if (mesh->indices) { a = vertdata[mesh->indices[i*3 + 0]]; b = vertdata[mesh->indices[i*3 + 1]]; - c = vertdata[mesh->indices[i*3 + 2]]; - } - else - { + c = vertdata[mesh->indices[i*3 + 2]]; + } + else + { a = vertdata[i*3 + 0]; b = vertdata[i*3 + 1]; c = vertdata[i*3 + 2]; } RayHitInfo triHitInfo = GetCollisionRayTriangle(ray, a, b, c); - - if (triHitInfo.hit) + + if (triHitInfo.hit) { // Save the closest hit triangle if ((!result.hit) || (result.distance > triHitInfo.distance)) result = triHitInfo; } } - return result; + return result; } // Get collision info between ray and triangle @@ -1478,44 +1478,44 @@ RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) Vector3 p, q, tv; float det, invDet, u, v, t; RayHitInfo result = {0}; - + // Find vectors for two edges sharing V1 edge1 = VectorSubtract(p2, p1); edge2 = VectorSubtract(p3, p1); - + // Begin calculating determinant - also used to calculate u parameter p = VectorCrossProduct(ray.direction, edge2); - + // If determinant is near zero, ray lies in plane of triangle or ray is parallel to plane of triangle det = VectorDotProduct(edge1, p); - + // Avoid culling! if ((det > -EPSILON) && (det < EPSILON)) return result; - + invDet = 1.0f/det; - + // Calculate distance from V1 to ray origin tv = VectorSubtract(ray.position, p1); - + // Calculate u parameter and test bound u = VectorDotProduct(tv, p)*invDet; - + // The intersection lies outside of the triangle if ((u < 0.0f) || (u > 1.0f)) return result; - + // Prepare to test v parameter q = VectorCrossProduct(tv, edge1); - + // Calculate V parameter and test bound v = VectorDotProduct(ray.direction, q)*invDet; - + // The intersection lies outside of the triangle if ((v < 0.0f) || ((u + v) > 1.0f)) return result; - + t = VectorDotProduct(edge2, q)*invDet; - - if (t > EPSILON) - { + + if (t > EPSILON) + { // Ray hit, get hit point and normal result.hit = true; result.distance = t; @@ -1523,10 +1523,10 @@ RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) result.hitNormal = VectorCrossProduct(edge1, edge2); VectorNormalize(&result.hitNormal); Vector3 rayDir = ray.direction; - VectorScale(&rayDir, t); + VectorScale(&rayDir, t); result.hitPosition = VectorAdd(ray.position, rayDir); } - + return result; } @@ -1540,8 +1540,8 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) if (fabsf(ray.direction.y) > EPSILON) { float t = (ray.position.y - groundHeight)/-ray.direction.y; - - if (t >= 0.0) + + if (t >= 0.0) { Vector3 rayDir = ray.direction; VectorScale(&rayDir, t); @@ -1551,7 +1551,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) result.hitPosition = VectorAdd(ray.position, rayDir); } } - + return result; } diff --git a/src/raylib.h b/src/raylib.h index 97130253..c1c9ebae 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -593,21 +593,21 @@ typedef enum { // rRES data returned when reading a resource, it contains all required data for user (24 byte) typedef struct { unsigned int type; // Resource type (4 byte) - + unsigned int param1; // Resouce parameter 1 (4 byte) unsigned int param2; // Resouce parameter 2 (4 byte) unsigned int param3; // Resouce parameter 3 (4 byte) unsigned int param4; // Resouce parameter 4 (4 byte) - + void *data; // Resource data pointer (4 byte) } RRESData; -typedef enum { - RRES_RAW = 0, - RRES_IMAGE, - RRES_WAVE, - RRES_VERTEX, - RRES_TEXT +typedef enum { + RRES_RAW = 0, + RRES_IMAGE, + RRES_WAVE, + RRES_VERTEX, + RRES_TEXT } RRESDataType; #ifdef __cplusplus @@ -800,7 +800,7 @@ RLAPI Image ImageText(const char *text, int fontSize, Color color); RLAPI Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing, Color tint); // Create an image from text (custom sprite font) RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) -RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, +RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, SpriteFont font, const char *text, float fontSize, int spacing, Color color); // Draw text (custom sprite font) within an image (destination) RLAPI void ImageFlipVertical(Image *image); // Flip image vertically RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally @@ -876,15 +876,15 @@ RLAPI Material LoadDefaultMaterial(void); RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) -RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) -RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture -RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec RLAPI BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits @@ -892,7 +892,7 @@ RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere -RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, +RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh diff --git a/src/rlgl.c b/src/rlgl.c index 8ec867eb..6c4e5927 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2,10 +2,10 @@ * * rlgl - raylib OpenGL abstraction layer * -* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to -* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). +* rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to +* selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). * -* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal +* When chosing an OpenGL version greater than OpenGL 1.1, rlgl stores vertex data on internal * VBO buffers (and VAOs if available). It requires calling 3 functions: * rlglInit() - Initialize internal buffers and auxiliar resources * rlglDraw() - Process internal buffers and send required draw calls @@ -57,7 +57,7 @@ #endif #if defined(GRAPHICS_API_OPENGL_11) - #ifdef __APPLE__ + #ifdef __APPLE__ #include // OpenGL 1.1 library for OSX #else #include // OpenGL 1.1 library @@ -69,7 +69,7 @@ #endif #if defined(GRAPHICS_API_OPENGL_33) - #ifdef __APPLE__ + #ifdef __APPLE__ #include // OpenGL 3 library for OSX #else #define GLAD_IMPLEMENTATION @@ -168,7 +168,7 @@ #if defined(GRAPHICS_API_OPENGL_ES2) #define glClearDepth glClearDepthf - #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER + #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER #endif @@ -695,7 +695,7 @@ void rlEnd(void) } break; default: break; } - + // NOTE: Depth increment is dependant on rlOrtho(): z-near and z-far values, // as well as depth buffer bit-depth (16bit or 24bit or 32bit) // Correct increment formula would be: depthInc = (zfar - znear)/pow(2, bits) @@ -880,7 +880,7 @@ void rlDisableTexture(void) glDisable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, 0); #else - // NOTE: If quads batch limit is reached, + // NOTE: If quads batch limit is reached, // we force a draw call and next batch starts if (quads.vCounter/4 >= MAX_QUADS_BATCH) rlglDraw(); #endif @@ -982,7 +982,7 @@ void rlDeleteRenderTextures(RenderTexture2D target) if (target.id != 0) glDeleteFramebuffers(1, &target.id); if (target.texture.id != 0) glDeleteTextures(1, &target.texture.id); if (target.depth.id != 0) glDeleteTextures(1, &target.depth.id); - + TraceLog(INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); #endif } @@ -999,7 +999,7 @@ void rlDeleteShader(unsigned int id) void rlDeleteVertexArrays(unsigned int id) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (vaoSupported) + if (vaoSupported) { if (id != 0) glDeleteVertexArrays(1, &id); TraceLog(INFO, "[VAO ID %i] Unloaded model data from VRAM (GPU)", id); @@ -1061,7 +1061,7 @@ void rlglInit(int width, int height) { // Check OpenGL information and capabilities //------------------------------------------------------------------------------ - + // Print current OpenGL and GLSL version TraceLog(INFO, "GPU: Vendor: %s", glGetString(GL_VENDOR)); TraceLog(INFO, "GPU: Renderer: %s", glGetString(GL_RENDERER)); @@ -1072,14 +1072,14 @@ void rlglInit(int width, int height) //int maxTexSize; //glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize); //TraceLog(INFO, "GL_MAX_TEXTURE_SIZE: %i", maxTexSize); - + //GL_MAX_TEXTURE_IMAGE_UNITS //GL_MAX_VIEWPORT_DIMS //int numAuxBuffers; //glGetIntegerv(GL_AUX_BUFFERS, &numAuxBuffers); //TraceLog(INFO, "GL_AUX_BUFFERS: %i", numAuxBuffers); - + //GLint numComp = 0; //GLint format[32] = { 0 }; //glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numComp); @@ -1087,7 +1087,7 @@ void rlglInit(int width, int height) //for (int i = 0; i < numComp; i++) TraceLog(INFO, "Supported compressed format: 0x%x", format[i]); // NOTE: We don't need that much data on screen... right now... - + #if defined(GRAPHICS_API_OPENGL_11) //TraceLog(INFO, "OpenGL 1.1 (or driver default) profile initialized"); #endif @@ -1095,7 +1095,7 @@ void rlglInit(int width, int height) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Get supported extensions list GLint numExt = 0; - + #if defined(GRAPHICS_API_OPENGL_33) // NOTE: On OpenGL 3.3 VAO and NPOT are supported by default @@ -1105,18 +1105,18 @@ void rlglInit(int width, int height) // We get a list of available extensions and we check for some of them (compressed textures) // NOTE: We don't need to check again supported extensions but we do (GLAD already dealt with that) glGetIntegerv(GL_NUM_EXTENSIONS, &numExt); - + #ifdef _MSC_VER const char **extList = malloc(sizeof(const char *)*numExt); #else const char *extList[numExt]; #endif - + for (int i = 0; i < numExt; i++) extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i); - + #elif defined(GRAPHICS_API_OPENGL_ES2) char *extensions = (char *)glGetString(GL_EXTENSIONS); // One big const string - + // NOTE: We have to duplicate string because glGetString() returns a const value // If not duplicated, it fails in some systems (Raspberry Pi) // Equivalent to function: char *strdup(const char *str) @@ -1125,12 +1125,12 @@ void rlglInit(int width, int height) void *newstr = malloc(len); if (newstr == NULL) extensionsDup = NULL; extensionsDup = (char *)memcpy(newstr, extensions, len); - + // NOTE: String could be splitted using strtok() function (string.h) // NOTE: strtok() modifies the received string, it can not be const - + char *extList[512]; // Allocate 512 strings pointers (2 KB) - + extList[numExt] = strtok(extensionsDup, " "); while (extList[numExt] != NULL) @@ -1138,9 +1138,9 @@ void rlglInit(int width, int height) numExt++; extList[numExt] = strtok(NULL, " "); } - + free(extensionsDup); // Duplicated string must be deallocated - + numExt -= 1; #endif @@ -1158,25 +1158,25 @@ void rlglInit(int width, int height) if (strcmp(extList[i], (const char *)"GL_OES_vertex_array_object") == 0) { vaoSupported = true; - - // The extension is supported by our hardware and driver, try to get related functions pointers + + // The extension is supported by our hardware and driver, try to get related functions pointers // NOTE: emscripten does not support VAOs natively, it uses emulation and it reduces overall performance... glGenVertexArrays = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES"); glBindVertexArray = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES"); glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES"); //glIsVertexArray = (PFNGLISVERTEXARRAYOESPROC)eglGetProcAddress("glIsVertexArrayOES"); // NOTE: Fails in WebGL, omitted } - + // Check NPOT textures support // NOTE: Only check on OpenGL ES, OpenGL 3.3 has NPOT textures full support as core feature if (strcmp(extList[i], (const char *)"GL_OES_texture_npot") == 0) npotSupported = true; #endif - + // DDS texture compression support if ((strcmp(extList[i], (const char *)"GL_EXT_texture_compression_s3tc") == 0) || (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_s3tc") == 0) || - (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) texCompDXTSupported = true; - + (strcmp(extList[i], (const char *)"GL_WEBKIT_WEBGL_compressed_texture_s3tc") == 0)) texCompDXTSupported = true; + // ETC1 texture compression support if ((strcmp(extList[i], (const char *)"GL_OES_compressed_ETC1_RGB8_texture") == 0) || (strcmp(extList[i], (const char *)"GL_WEBGL_compressed_texture_etc1") == 0)) texCompETC1Supported = true; @@ -1189,26 +1189,26 @@ void rlglInit(int width, int height) // ASTC texture compression support if (strcmp(extList[i], (const char *)"GL_KHR_texture_compression_astc_hdr") == 0) texCompASTCSupported = true; - + // Anisotropic texture filter support if (strcmp(extList[i], (const char *)"GL_EXT_texture_filter_anisotropic") == 0) { texAnisotropicFilterSupported = true; - glGetFloatv(0x84FF, &maxAnisotropicLevel); // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + glGetFloatv(0x84FF, &maxAnisotropicLevel); // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT } - + // Clamp mirror wrap mode supported if (strcmp(extList[i], (const char *)"GL_EXT_texture_mirror_clamp") == 0) texClampMirrorSupported = true; } - + #ifdef _MSC_VER free(extList); #endif - + #if defined(GRAPHICS_API_OPENGL_ES2) if (vaoSupported) TraceLog(INFO, "[EXTENSION] VAO extension detected, VAO functions initialized successfully"); else TraceLog(WARNING, "[EXTENSION] VAO extension not found, VAO usage not supported"); - + if (npotSupported) TraceLog(INFO, "[EXTENSION] NPOT textures extension detected, full NPOT textures supported"); else TraceLog(WARNING, "[EXTENSION] NPOT textures extension not found, limited NPOT support (no-mipmaps, no-repeat)"); #endif @@ -1218,13 +1218,13 @@ void rlglInit(int width, int height) if (texCompETC2Supported) TraceLog(INFO, "[EXTENSION] ETC2/EAC compressed textures supported"); if (texCompPVRTSupported) TraceLog(INFO, "[EXTENSION] PVRT compressed textures supported"); if (texCompASTCSupported) TraceLog(INFO, "[EXTENSION] ASTC compressed textures supported"); - + if (texAnisotropicFilterSupported) TraceLog(INFO, "[EXTENSION] Anisotropic textures filtering supported (max: %.0fX)", maxAnisotropicLevel); if (texClampMirrorSupported) TraceLog(INFO, "[EXTENSION] Clamp mirror wrap texture mode supported"); // Initialize buffers, default shaders and default textures //---------------------------------------------------------- - + // Init default white texture unsigned char pixels[4] = { 255, 255, 255, 255 }; // 1 pixel RGBA (4 bytes) @@ -1238,7 +1238,7 @@ void rlglInit(int width, int height) currentShader = defaultShader; // Init default vertex arrays buffers (lines, triangles, quads) - LoadDefaultBuffers(); + LoadDefaultBuffers(); // Init temp vertex buffer, used when transformation required (translate, rotate, scale) tempBuffer = (Vector3 *)malloc(sizeof(Vector3)*TEMP_VERTEX_BUFFER_SIZE); @@ -1257,7 +1257,7 @@ void rlglInit(int width, int height) drawsCounter = 1; draws[drawsCounter - 1].textureId = whiteTexture; currentDrawMode = RL_TRIANGLES; // Set default draw mode - + // Init internal matrix stack (emulating OpenGL 1.1) for (int i = 0; i < MATRIX_STACK_SIZE; i++) stack[i] = MatrixIdentity(); @@ -1286,7 +1286,7 @@ void rlglInit(int width, int height) #if defined(GRAPHICS_API_OPENGL_11) // Init state: Color hints (deprecated in OpenGL 3.0+) - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Improve quality of color and texture coordinate interpolation glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation) #endif @@ -1294,7 +1294,7 @@ void rlglInit(int width, int height) glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black) glClearDepth(1.0f); // Set clear depth value (default) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D) - + // Store screen size into global variables screenWidth = width; screenHeight = height; @@ -1308,7 +1308,7 @@ void rlglClose(void) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) UnloadDefaultShader(); UnloadDefaultBuffers(); - + // Delete default white texture glDeleteTextures(1, &whiteTexture); TraceLog(INFO, "[TEX ID %i] Unloaded texture data (base white texture) from VRAM", whiteTexture); @@ -1326,7 +1326,7 @@ void rlglDraw(void) // NOTE: Default buffers upload and draw UpdateDefaultBuffers(); - + if (vrEnabled && vrRendering) DrawDefaultBuffers(2); else DrawDefaultBuffers(1); #endif @@ -1342,7 +1342,7 @@ void rlglLoadExtensions(void *loader) if (!gladLoadGLLoader((GLADloadproc)loader)) TraceLog(WARNING, "GLAD: Cannot load OpenGL extensions"); else TraceLog(INFO, "GLAD: OpenGL extensions loaded successfully"); #endif - + #if defined(GRAPHICS_API_OPENGL_21) #ifndef __APPLE__ if (GLAD_GL_VERSION_2_1) TraceLog(INFO, "OpenGL 2.1 profile supported"); @@ -1363,17 +1363,17 @@ void rlglLoadExtensions(void *loader) Vector3 rlglUnproject(Vector3 source, Matrix proj, Matrix view) { Vector3 result = { 0.0f, 0.0f, 0.0f }; - + // Calculate unproject matrix (multiply projection matrix and view matrix) and invert it Matrix matProjView = MatrixMultiply(proj, view); MatrixInvert(&matProjView); - + // Create quaternion from source point Quaternion quat = { source.x, source.y, source.z, 1.0f }; - + // Multiply quat point by unproject matrix QuaternionTransform(&quat, matProjView); - + // Normalized world points in vectors result.x = quat.x/quat.w; result.y = quat.y/quat.w; @@ -1388,41 +1388,41 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma glBindTexture(GL_TEXTURE_2D, 0); // Free any old binding GLuint id = 0; - + // Check texture format support by OpenGL 1.1 (compressed textures not supported) -#if defined(GRAPHICS_API_OPENGL_11) +#if defined(GRAPHICS_API_OPENGL_11) if (textureFormat >= 8) { TraceLog(WARNING, "OpenGL 1.1 does not support GPU compressed texture formats"); return id; } #endif - + if ((!texCompDXTSupported) && ((textureFormat == COMPRESSED_DXT1_RGB) || (textureFormat == COMPRESSED_DXT1_RGBA) || (textureFormat == COMPRESSED_DXT3_RGBA) || (textureFormat == COMPRESSED_DXT5_RGBA))) { TraceLog(WARNING, "DXT compressed texture format not supported"); return id; } -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if ((!texCompETC1Supported) && (textureFormat == COMPRESSED_ETC1_RGB)) { TraceLog(WARNING, "ETC1 compressed texture format not supported"); return id; } - + if ((!texCompETC2Supported) && ((textureFormat == COMPRESSED_ETC2_RGB) || (textureFormat == COMPRESSED_ETC2_EAC_RGBA))) { TraceLog(WARNING, "ETC2 compressed texture format not supported"); return id; } - + if ((!texCompPVRTSupported) && ((textureFormat == COMPRESSED_PVRT_RGB) || (textureFormat == COMPRESSED_PVRT_RGBA))) { TraceLog(WARNING, "PVRT compressed texture format not supported"); return id; } - + if ((!texCompASTCSupported) && ((textureFormat == COMPRESSED_ASTC_4x4_RGBA) || (textureFormat == COMPRESSED_ASTC_8x8_RGBA))) { TraceLog(WARNING, "ASTC compressed texture format not supported"); @@ -1450,24 +1450,24 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma // GL_RGBA4 GL_RGBA GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_4_4_4_4 // GL_RGBA8 GL_RGBA GL_UNSIGNED_BYTE // GL_RGB8 GL_RGB GL_UNSIGNED_BYTE - + switch (textureFormat) { case UNCOMPRESSED_GRAYSCALE: { glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, (unsigned char *)data); - + // With swizzleMask we define how a one channel texture will be mapped to RGBA // Required GL >= 3.3 or EXT_texture_swizzle/ARB_texture_swizzle GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ONE }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); - + TraceLog(INFO, "[TEX ID %i] Grayscale texture loaded and swizzled", id); } break; case UNCOMPRESSED_GRAY_ALPHA: { glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, width, height, 0, GL_RG, GL_UNSIGNED_BYTE, (unsigned char *)data); - + GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_GREEN }; glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask); } break; @@ -1541,7 +1541,7 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma // Magnification and minification filters glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // Alternative: GL_LINEAR glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // Alternative: GL_LINEAR - + #if defined(GRAPHICS_API_OPENGL_33) if (mipmapCount > 1) { @@ -1551,7 +1551,7 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma #endif // At this point we have the texture loaded in GPU and texture parameters configured - + // NOTE: If mipmaps were not in data, they are not generated automatically // Unbind current texture @@ -1567,15 +1567,15 @@ unsigned int rlglLoadTexture(void *data, int width, int height, int textureForma RenderTexture2D rlglLoadRenderTexture(int width, int height) { RenderTexture2D target; - + target.id = 0; - + target.texture.id = 0; target.texture.width = width; target.texture.height = height; target.texture.format = UNCOMPRESSED_R8G8B8A8; target.texture.mipmaps = 1; - + target.depth.id = 0; target.depth.width = width; target.depth.height = height; @@ -1592,13 +1592,13 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); - + #if defined(GRAPHICS_API_OPENGL_33) #define USE_DEPTH_TEXTURE #else #define USE_DEPTH_RENDERBUFFER #endif - + #if defined(USE_DEPTH_RENDERBUFFER) // Create the renderbuffer that will serve as the depth attachment for the framebuffer. glGenRenderbuffers(1, &target.depth.id); @@ -1634,7 +1634,7 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) if (status != GL_FRAMEBUFFER_COMPLETE) { TraceLog(WARNING, "Framebuffer object could not be created..."); - + switch (status) { case GL_FRAMEBUFFER_UNSUPPORTED: TraceLog(WARNING, "Framebuffer is unsupported"); break; @@ -1645,17 +1645,17 @@ RenderTexture2D rlglLoadRenderTexture(int width, int height) case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: TraceLog(WARNING, "Framebuffer incomplete missing attachment"); break; default: break; } - + glDeleteTextures(1, &target.texture.id); glDeleteTextures(1, &target.depth.id); glDeleteFramebuffers(1, &target.id); } else TraceLog(INFO, "[FBO ID %i] Framebuffer object created successfully", target.id); - + glBindFramebuffer(GL_FRAMEBUFFER, 0); #endif - return target; + return target; } // Update already loaded texture in GPU with new data @@ -1695,11 +1695,11 @@ void rlglUpdateTexture(unsigned int id, int width, int height, int format, const void rlglGenerateMipmaps(Texture2D *texture) { glBindTexture(GL_TEXTURE_2D, texture->id); - + // Check if texture is power-of-two (POT) bool texIsPOT = false; - - if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && + + if (((texture->width > 0) && ((texture->width & (texture->width - 1)) == 0)) && ((texture->height > 0) && ((texture->height & (texture->height - 1)) == 0))) texIsPOT = true; if ((texIsPOT) || (npotSupported)) @@ -1707,7 +1707,7 @@ void rlglGenerateMipmaps(Texture2D *texture) #if defined(GRAPHICS_API_OPENGL_11) // Compute required mipmaps void *data = rlglReadTexturePixels(*texture); - + // NOTE: data size is reallocated to fit mipmaps data // NOTE: CPU mipmap generation only supports RGBA 32bit data int mipmapCount = GenerateMipmaps(data, texture->width, texture->height); @@ -1729,12 +1729,12 @@ void rlglGenerateMipmaps(Texture2D *texture) mipWidth /= 2; mipHeight /= 2; } - + TraceLog(WARNING, "[TEX ID %i] Mipmaps generated manually on CPU side", texture->id); - + // NOTE: Once mipmaps have been generated and data has been uploaded to GPU VRAM, we can discard RAM data free(data); - + texture->mipmaps = mipmapCount + 1; #endif @@ -1745,10 +1745,10 @@ void rlglGenerateMipmaps(Texture2D *texture) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); // Activate Trilinear filtering for mipmaps - + #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) - + texture->mipmaps = 1 + (int)floor(log(MAX(texture->width, texture->height))/log(2)); #endif } @@ -1768,7 +1768,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) mesh->vboId[4] = 0; // Vertex tangents VBO mesh->vboId[5] = 0; // Vertex texcoords2 VBO mesh->vboId[6] = 0; // Vertex indices VBO - + #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) int drawHint = GL_STATIC_DRAW; if (dynamic) drawHint = GL_DYNAMIC_DRAW; @@ -1783,8 +1783,8 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glBindVertexArray(vaoId); } - // NOTE: Attributes must be uploaded considering default locations points - + // NOTE: Attributes must be uploaded considering default locations points + // Enable vertex attributes: position (shader-location = 0) glGenBuffers(1, &vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, vboId[0]); @@ -1814,7 +1814,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glVertexAttrib3f(2, 1.0f, 1.0f, 1.0f); glDisableVertexAttribArray(2); } - + // Default color vertex attribute (shader-location = 3) if (mesh->colors != NULL) { @@ -1830,7 +1830,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glVertexAttrib4f(3, 1.0f, 1.0f, 1.0f, 1.0f); glDisableVertexAttribArray(3); } - + // Default tangent vertex attribute (shader-location = 4) if (mesh->tangents != NULL) { @@ -1846,7 +1846,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glVertexAttrib3f(4, 0.0f, 0.0f, 0.0f); glDisableVertexAttribArray(4); } - + // Default texcoord2 vertex attribute (shader-location = 5) if (mesh->texcoords2 != NULL) { @@ -1862,7 +1862,7 @@ void rlglLoadMesh(Mesh *mesh, bool dynamic) glVertexAttrib2f(5, 0.0f, 0.0f); glDisableVertexAttribArray(5); } - + if (mesh->indices != NULL) { glGenBuffers(1, &vboId[6]); @@ -1900,7 +1900,7 @@ void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) // Activate mesh VAO if (vaoSupported) glBindVertexArray(mesh.vaoId); - + switch (buffer) { case 0: // Update vertices (vertex position) @@ -1908,28 +1908,28 @@ void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[0]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.vertices, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.vertices); - + } break; case 1: // Update texcoords (vertex texture coordinates) { glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[1]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*2*numVertex, mesh.texcoords, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*2*numVertex, mesh.texcoords); - + } break; case 2: // Update normals (vertex normals) { glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[2]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*3*numVertex, mesh.normals, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(float)*3*numVertex, mesh.normals); - + } break; case 3: // Update colors (vertex colors) { glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]); if (numVertex >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, sizeof(float)*4*numVertex, mesh.colors, GL_DYNAMIC_DRAW); else glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(unsigned char)*4*numVertex, mesh.colors); - + } break; case 4: // Update tangents (vertex tangents) { @@ -1945,7 +1945,7 @@ void rlglUpdateMesh(Mesh mesh, int buffer, int numVertex) } break; default: break; } - + // Unbind the current VAO if (vaoSupported) glBindVertexArray(0); @@ -1973,11 +1973,11 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glTexCoordPointer(2, GL_FLOAT, 0, mesh.texcoords); // Pointer to texture coords array if (mesh.normals != NULL) glNormalPointer(GL_FLOAT, 0, mesh.normals); // Pointer to normals array if (mesh.colors != NULL) glColorPointer(4, GL_UNSIGNED_BYTE, 0, mesh.colors); // Pointer to colors array - + rlPushMatrix(); rlMultMatrixf(MatrixToFloat(transform)); rlColor4ub(material.colDiffuse.r, material.colDiffuse.g, material.colDiffuse.b, material.colDiffuse.a); - + if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, mesh.indices); else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); rlPopMatrix(); @@ -1996,13 +1996,13 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if (vrEnabled) eyesCount = 2; glUseProgram(material.shader.id); - + // Upload to shader material.colDiffuse glUniform4f(material.shader.colDiffuseLoc, (float)material.colDiffuse.r/255, (float)material.colDiffuse.g/255, (float)material.colDiffuse.b/255, (float)material.colDiffuse.a/255); - + // Upload to shader material.colAmbient (if available) if (material.shader.colAmbientLoc != -1) glUniform4f(material.shader.colAmbientLoc, (float)material.colAmbient.r/255, (float)material.colAmbient.g/255, (float)material.colAmbient.b/255, (float)material.colAmbient.a/255); - + // Upload to shader material.colSpecular (if available) if (material.shader.colSpecularLoc != -1) glUniform4f(material.shader.colSpecularLoc, (float)material.colSpecular.r/255, (float)material.colSpecular.g/255, (float)material.colSpecular.b/255, (float)material.colSpecular.a/255); @@ -2010,7 +2010,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // That's because Begin3dMode() sets it an no model-drawing function modifies it, all use rlPushMatrix() and rlPopMatrix() Matrix matView = modelview; // View matrix (camera) Matrix matProjection = projection; // Projection matrix (perspective) - + // Calculate model-view matrix combining matModel and matView Matrix matModelView = MatrixMultiply(transform, matView); // Transform to camera-space coordinates @@ -2026,7 +2026,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) Matrix transInvTransform = transform; MatrixTranspose(&transInvTransform); MatrixInvert(&transInvTransform); - + // Send model transformations matrix to shader glUniformMatrix4fv(modelMatrixLoc, 1, false, MatrixToFloat(transInvTransform)); } @@ -2039,7 +2039,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) // Check if glossiness is located in shader and upload value int glossinessLoc = glGetUniformLocation(material.shader.id, "glossiness"); if (glossinessLoc != -1) glUniform1f(glossinessLoc, material.glossiness); - } + } // Set shader textures (diffuse, normal, specular) glActiveTexture(GL_TEXTURE0); @@ -2050,22 +2050,22 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) { // Upload to shader specular map flag glUniform1i(glGetUniformLocation(material.shader.id, "useNormal"), 1); - + glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, material.texNormal.id); glUniform1i(material.shader.mapTexture1Loc, 1); // Normal texture fits in active texture unit 1 } - + if ((material.texSpecular.id != 0) && (material.shader.mapTexture2Loc != -1)) { // Upload to shader specular map flag glUniform1i(glGetUniformLocation(material.shader.id, "useSpecular"), 1); - + glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, material.texSpecular.id); glUniform1i(material.shader.mapTexture2Loc, 2); // Specular texture fits in active texture unit 2 } - + if (vaoSupported) { glBindVertexArray(mesh.vaoId); @@ -2089,7 +2089,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glVertexAttribPointer(material.shader.normalLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(material.shader.normalLoc); } - + // Bind mesh VBO data: vertex colors (shader-location = 3, if available) if (material.shader.colorLoc != -1) { @@ -2107,7 +2107,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glDisableVertexAttribArray(material.shader.colorLoc); } } - + // Bind mesh VBO data: vertex tangents (shader-location = 4, if available) if (material.shader.tangentLoc != -1) { @@ -2115,7 +2115,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glVertexAttribPointer(material.shader.tangentLoc, 3, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(material.shader.tangentLoc); } - + // Bind mesh VBO data: vertex texcoords2 (shader-location = 5, if available) if (material.shader.texcoord2Loc != -1) { @@ -2123,7 +2123,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) glVertexAttribPointer(material.shader.texcoord2Loc, 2, GL_FLOAT, 0, 0, 0); glEnableVertexAttribArray(material.shader.texcoord2Loc); } - + if (mesh.indices != NULL) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } @@ -2142,13 +2142,13 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) if (mesh.indices != NULL) glDrawElements(GL_TRIANGLES, mesh.triangleCount*3, GL_UNSIGNED_SHORT, 0); // Indexed vertices draw else glDrawArrays(GL_TRIANGLES, 0, mesh.vertexCount); } - + if (material.texNormal.id != 0) { glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, 0); } - + if (material.texSpecular.id != 0) { glActiveTexture(GL_TEXTURE2); @@ -2166,7 +2166,7 @@ void rlglDrawMesh(Mesh mesh, Material material, Matrix transform) } glUseProgram(0); // Unbind shader program - + // Restore projection/modelview matrices projection = matProjection; modelview = matView; @@ -2212,7 +2212,7 @@ unsigned char *rlglReadScreenPixels(int width, int height) { // Flip line imgData[((height - 1) - y)*width*4 + x] = screenData[(y*width*4) + x]; - + // Set alpha component value to 255 (no trasparent image retrieval) // NOTE: Alpha value has already been applied to RGB in framebuffer, we don't need it! if (((x + 1)%4) == 0) imgData[((height - 1) - y)*width*4 + x] = 255; @@ -2230,10 +2230,10 @@ unsigned char *rlglReadScreenPixels(int width, int height) void *rlglReadTexturePixels(Texture2D texture) { void *pixels = NULL; - + #if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33) glBindTexture(GL_TEXTURE_2D, texture.id); - + // NOTE: Using texture.id, we can retrieve some texture info (but not on OpenGL ES 2.0) /* int width, height, format; @@ -2242,11 +2242,11 @@ void *rlglReadTexturePixels(Texture2D texture) glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); // Other texture info: GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE */ - + int glFormat = 0, glType = 0; unsigned int size = texture.width*texture.height; - + // NOTE: GL_LUMINANCE and GL_LUMINANCE_ALPHA are removed since OpenGL 3.1 // Must be replaced by GL_RED and GL_RG on Core OpenGL 3.3 @@ -2255,8 +2255,8 @@ void *rlglReadTexturePixels(Texture2D texture) #if defined(GRAPHICS_API_OPENGL_11) case UNCOMPRESSED_GRAYSCALE: pixels = (unsigned char *)malloc(size); glFormat = GL_LUMINANCE; glType = GL_UNSIGNED_BYTE; break; // 8 bit per pixel (no alpha) case UNCOMPRESSED_GRAY_ALPHA: pixels = (unsigned char *)malloc(size*2); glFormat = GL_LUMINANCE_ALPHA; glType = GL_UNSIGNED_BYTE; break; // 16 bpp (2 channels) -#elif defined(GRAPHICS_API_OPENGL_33) - case UNCOMPRESSED_GRAYSCALE: pixels = (unsigned char *)malloc(size); glFormat = GL_RED; glType = GL_UNSIGNED_BYTE; break; +#elif defined(GRAPHICS_API_OPENGL_33) + case UNCOMPRESSED_GRAYSCALE: pixels = (unsigned char *)malloc(size); glFormat = GL_RED; glType = GL_UNSIGNED_BYTE; break; case UNCOMPRESSED_GRAY_ALPHA: pixels = (unsigned char *)malloc(size*2); glFormat = GL_RG; glType = GL_UNSIGNED_BYTE; break; #endif case UNCOMPRESSED_R5G6B5: pixels = (unsigned short *)malloc(size); glFormat = GL_RGB; glType = GL_UNSIGNED_SHORT_5_6_5; break; // 16 bpp @@ -2266,15 +2266,15 @@ void *rlglReadTexturePixels(Texture2D texture) case UNCOMPRESSED_R8G8B8A8: pixels = (unsigned char *)malloc(size*4); glFormat = GL_RGBA; glType = GL_UNSIGNED_BYTE; break; // 32 bpp default: TraceLog(WARNING, "Texture data retrieval, format not suported"); break; } - + // NOTE: Each row written to or read from by OpenGL pixel operations like glGetTexImage are aligned to a 4 byte boundary by default, which may add some padding. - // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. - // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) + // Use glPixelStorei to modify padding with the GL_[UN]PACK_ALIGNMENT setting. + // GL_PACK_ALIGNMENT affects operations that read from OpenGL memory (glReadPixels, glGetTexImage, etc.) // GL_UNPACK_ALIGNMENT affects operations that write to OpenGL memory (glTexImage, etc.) glPixelStorei(GL_PACK_ALIGNMENT, 1); glGetTexImage(GL_TEXTURE_2D, 0, glFormat, glType, pixels); - + glBindTexture(GL_TEXTURE_2D, 0); #endif @@ -2285,7 +2285,7 @@ void *rlglReadTexturePixels(Texture2D texture) // NOTE: Two possible Options: // 1 - Bind texture to color fbo attachment and glReadPixels() // 2 - Create an fbo, activate it, render quad with texture, glReadPixels() - + #define GET_TEXTURE_FBO_OPTION_1 // It works #if defined(GET_TEXTURE_FBO_OPTION_1) @@ -2295,48 +2295,48 @@ void *rlglReadTexturePixels(Texture2D texture) // Attach our texture to FBO -> Texture must be RGB // NOTE: Previoust attached texture is automatically detached glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.id, 0); - + pixels = (unsigned char *)malloc(texture.width*texture.height*4*sizeof(unsigned char)); - + // NOTE: Despite FBO color texture is RGB, we read data as RGBA... reading as RGB doesn't work... o__O glReadPixels(0, 0, texture.width, texture.height, GL_RGBA, GL_UNSIGNED_BYTE, pixels); - + // Re-attach internal FBO color texture before deleting it glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo.texture.id, 0); - + glBindFramebuffer(GL_FRAMEBUFFER, 0); - + #elif defined(GET_TEXTURE_FBO_OPTION_2) // Render texture to fbo glBindFramebuffer(GL_FRAMEBUFFER, fbo.id); - + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepthf(1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glViewport(0, 0, width, height); //glMatrixMode(GL_PROJECTION); //glLoadIdentity(); - rlOrtho(0.0, width, height, 0.0, 0.0, 1.0); + rlOrtho(0.0, width, height, 0.0, 0.0, 1.0); //glMatrixMode(GL_MODELVIEW); //glLoadIdentity(); //glDisable(GL_TEXTURE_2D); //glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); - + Model quad; //quad.mesh = GenMeshQuad(width, height); quad.transform = MatrixIdentity(); quad.shader = defaultShader; - + DrawModel(quad, (Vector3){ 0.0f, 0.0f, 0.0f }, 1.0f, WHITE); - + pixels = (unsigned char *)malloc(texture.width*texture.height*3*sizeof(unsigned char)); - + glReadPixels(0, 0, texture.width, texture.height, GL_RGB, GL_UNSIGNED_BYTE, pixels); // Bind framebuffer 0, which means render to back buffer glBindFramebuffer(GL_FRAMEBUFFER, 0); - + UnloadModel(quad); #endif // GET_TEXTURE_FBO_OPTION @@ -2361,7 +2361,7 @@ void rlglRecordDraw(void) draws[drawsCounter].projection = projection; draws[drawsCounter].modelview = modelview; draws[drawsCounter].vertexCount = currentState.vertexCount; - + drawsCounter++; #endif } @@ -2376,13 +2376,13 @@ void rlglRecordDraw(void) Texture2D GetDefaultTexture(void) { Texture2D texture; - + texture.id = whiteTexture; texture.width = 1; texture.height = 1; texture.mipmaps = 1; texture.format = UNCOMPRESSED_R8G8B8A8; - + return texture; } @@ -2429,24 +2429,24 @@ Shader LoadShader(char *vsFileName, char *fsFileName) // Shaders loading from external text file char *vShaderStr = LoadText(vsFileName); char *fShaderStr = LoadText(fsFileName); - + if ((vShaderStr != NULL) && (fShaderStr != NULL)) { shader.id = LoadShaderProgram(vShaderStr, fShaderStr); // After shader loading, we try to load default location names if (shader.id != 0) LoadDefaultShaderLocations(&shader); - + // Shader strings must be freed free(vShaderStr); free(fShaderStr); } - + if (shader.id == 0) { TraceLog(WARNING, "Custom shader could not be loaded"); shader = defaultShader; - } + } #endif return shader; @@ -2497,9 +2497,9 @@ Shader GetDefaultShader(void) int GetShaderLocation(Shader shader, const char *uniformName) { int location = -1; -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) +#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) location = glGetUniformLocation(shader.id, uniformName); - + if (location == -1) TraceLog(DEBUG, "[SHDR ID %i] Shader location for %s could not be found", shader.id, uniformName); #endif return location; @@ -2516,7 +2516,7 @@ void SetShaderValue(Shader shader, int uniformLoc, float *value, int size) else if (size == 3) glUniform3fv(uniformLoc, 1, value); // Shader uniform type: vec3 else if (size == 4) glUniform4fv(uniformLoc, 1, value); // Shader uniform type: vec4 else TraceLog(WARNING, "Shader value float array size not supported"); - + //glUseProgram(0); // Avoid reseting current shader program, in case other uniforms are set #endif } @@ -2532,7 +2532,7 @@ void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size) else if (size == 3) glUniform3iv(uniformLoc, 1, value); // Shader uniform type: ivec3 else if (size == 4) glUniform4iv(uniformLoc, 1, value); // Shader uniform type: ivec4 else TraceLog(WARNING, "Shader value int array size not supported"); - + //glUseProgram(0); #endif } @@ -2544,7 +2544,7 @@ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat) glUseProgram(shader.id); glUniformMatrix4fv(uniformLoc, 1, false, MatrixToFloat(mat)); - + //glUseProgram(0); #endif } @@ -2572,7 +2572,7 @@ void BeginBlendMode(int mode) if ((blendMode != mode) && (mode < 3)) { rlglDraw(); - + switch (mode) { case BLEND_ALPHA: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); break; @@ -2580,7 +2580,7 @@ void BeginBlendMode(int mode) case BLEND_MULTIPLIED: glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); break; default: break; } - + blendMode = mode; } } @@ -2646,9 +2646,9 @@ void InitVrDevice(int vrDevice) { // Oculus Rift CV1 parameters // NOTE: CV1 represents a complete HMD redesign compared to previous versions, - // new Fresnel-hybrid-asymmetric lenses have been added and, consequently, - // previous parameters (DK2) and distortion shader (DK2) doesn't work any more. - // I just defined a set of parameters for simulator that approximate to CV1 stereo rendering + // new Fresnel-hybrid-asymmetric lenses have been added and, consequently, + // previous parameters (DK2) and distortion shader (DK2) doesn't work any more. + // I just defined a set of parameters for simulator that approximate to CV1 stereo rendering // but result is not the same obtained with Oculus PC SDK. hmd.hResolution = 2160; // HMD horizontal resolution in pixels hmd.vResolution = 1200; // HMD vertical resolution in pixels @@ -2667,17 +2667,17 @@ void InitVrDevice(int vrDevice) hmd.chromaAbCorrection[2] = 1.014f; // HMD chromatic aberration correction parameter 2 hmd.chromaAbCorrection[3] = 0.0f; // HMD chromatic aberration correction parameter 3 } - + // Initialize framebuffer and textures for stereo rendering // NOTE: screen size should match HMD aspect ratio vrConfig.stereoFbo = rlglLoadRenderTexture(screenWidth, screenHeight); - + // Load distortion shader (initialized by default with Oculus Rift CV1 parameters) vrConfig.distortionShader.id = LoadShaderProgram(vDistortionShaderStr, fDistortionShaderStr); if (vrConfig.distortionShader.id != 0) LoadDefaultShaderLocations(&vrConfig.distortionShader); SetStereoConfig(hmd); - + vrSimulator = true; vrEnabled = true; } @@ -2722,9 +2722,9 @@ void ToggleVrMode(void) #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) if (vrDeviceReady || vrSimulator) vrEnabled = !vrEnabled; else vrEnabled = false; - + if (!vrEnabled) - { + { // Reset viewport and default projection-modelview matrices rlViewport(0, 0, screenWidth, screenHeight); projection = MatrixOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f); @@ -2759,15 +2759,15 @@ void BeginVrDrawing(void) rlEnableRenderTexture(vrConfig.stereoFbo.id); } - // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) + // NOTE: If your application is configured to treat the texture as a linear format (e.g. GL_RGBA) // and performs linear-to-gamma conversion in GLSL or does not care about gamma-correction, then: // - Require OculusBuffer format to be OVR_FORMAT_R8G8B8A8_UNORM_SRGB // - Do NOT enable GL_FRAMEBUFFER_SRGB //glEnable(GL_FRAMEBUFFER_SRGB); - + //glViewport(0, 0, buffer.width, buffer.height); // Useful if rendering to separate framebuffers (every eye) rlClearScreenBuffers(); // Clear current framebuffer(s) - + vrRendering = true; #endif } @@ -2786,12 +2786,12 @@ void EndVrDrawing(void) { // Unbind current framebuffer rlDisableRenderTexture(); - + rlClearScreenBuffers(); // Clear current framebuffer // Set viewport to default framebuffer size (screen size) rlViewport(0, 0, screenWidth, screenHeight); - + // Let rlgl reconfigure internal matrices rlMatrixMode(RL_PROJECTION); // Enable internal projection matrix rlLoadIdentity(); // Reset internal projection matrix @@ -2799,7 +2799,7 @@ void EndVrDrawing(void) rlMatrixMode(RL_MODELVIEW); // Enable internal modelview matrix rlLoadIdentity(); // Reset internal modelview matrix - // Draw RenderTexture (stereoFbo) using distortion shader + // Draw RenderTexture (stereoFbo) using distortion shader currentShader = vrConfig.distortionShader; rlEnableTexture(vrConfig.stereoFbo.texture.id); @@ -2836,7 +2836,7 @@ void EndVrDrawing(void) } rlDisableDepthTest(); - + vrRendering = false; #endif } @@ -2867,7 +2867,7 @@ static void LoadCompressedTexture(unsigned char *data, int width, int height, in for (int level = 0; level < mipmapCount && (width || height); level++) { unsigned int size = 0; - + size = ((width + 3)/4)*((height + 3)/4)*blockSize; glCompressedTexImage2D(GL_TEXTURE_2D, level, compressedFormat, width, height, 0, size, data + offset); @@ -2923,7 +2923,7 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glGetShaderInfoLog(vertexShader, maxLength, &length, log); TraceLog(INFO, "%s", log); - + #ifdef _MSC_VER free(log); #endif @@ -2962,7 +2962,7 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glAttachShader(program, vertexShader); glAttachShader(program, fragmentShader); - + // NOTE: Default attribute shader locations must be binded before linking glBindAttribLocation(program, 0, DEFAULT_ATTRIB_POSITION_NAME); glBindAttribLocation(program, 1, DEFAULT_ATTRIB_TEXCOORD_NAME); @@ -2970,11 +2970,11 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glBindAttribLocation(program, 3, DEFAULT_ATTRIB_COLOR_NAME); glBindAttribLocation(program, 4, DEFAULT_ATTRIB_TANGENT_NAME); glBindAttribLocation(program, 5, DEFAULT_ATTRIB_TEXCOORD2_NAME); - + // NOTE: If some attrib name is no found on the shader, it locations becomes -1 - + glLinkProgram(program); - + // NOTE: All uniform variables are intitialised to 0 when a program links glGetProgramiv(program, GL_LINK_STATUS, &success); @@ -2996,7 +2996,7 @@ static unsigned int LoadShaderProgram(const char *vShaderStr, const char *fShade glGetProgramInfoLog(program, maxLength, &length, log); TraceLog(INFO, "%s", log); - + #ifdef _MSC_VER free(log); #endif @@ -3099,7 +3099,7 @@ static void LoadDefaultShaderLocations(Shader *shader) // vertex color location = 3 // vertex tangent location = 4 // vertex texcoord2 location = 5 - + // Get handles to GLSL input attibute locations shader->vertexLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_POSITION_NAME); shader->texcoordLoc = glGetAttribLocation(shader->id, DEFAULT_ATTRIB_TEXCOORD_NAME); @@ -3115,15 +3115,15 @@ static void LoadDefaultShaderLocations(Shader *shader) shader->colDiffuseLoc = glGetUniformLocation(shader->id, "colDiffuse"); shader->colAmbientLoc = glGetUniformLocation(shader->id, "colAmbient"); shader->colSpecularLoc = glGetUniformLocation(shader->id, "colSpecular"); - + shader->mapTexture0Loc = glGetUniformLocation(shader->id, "texture0"); shader->mapTexture1Loc = glGetUniformLocation(shader->id, "texture1"); shader->mapTexture2Loc = glGetUniformLocation(shader->id, "texture2"); - + // TODO: Try to find all expected/recognized shader locations (predefined names, must be documented) } -// Unload default shader +// Unload default shader static void UnloadDefaultShader(void) { glUseProgram(0); @@ -3140,7 +3140,7 @@ static void LoadDefaultBuffers(void) { // [CPU] Allocate and initialize float array buffers to store vertex data (lines, triangles, quads) //-------------------------------------------------------------------------------------------- - + // Lines - Initialize arrays (vertex position and color data) lines.vertices = (float *)malloc(sizeof(float)*3*2*MAX_LINES_BATCH); // 3 float by vertex, 2 vertex by line lines.colors = (unsigned char *)malloc(sizeof(unsigned char)*4*2*MAX_LINES_BATCH); // 4 float by color, 2 colors by line @@ -3202,11 +3202,11 @@ static void LoadDefaultBuffers(void) TraceLog(INFO, "[CPU] Default buffers initialized successfully (lines, triangles, quads)"); //-------------------------------------------------------------------------------------------- - + // [GPU] Upload vertex data and initialize VAOs/VBOs (lines, triangles, quads) // NOTE: Default buffers are linked to use currentShader (defaultShader) //-------------------------------------------------------------------------------------------- - + // Upload and link lines vertex buffers if (vaoSupported) { @@ -3215,7 +3215,7 @@ static void LoadDefaultBuffers(void) glBindVertexArray(lines.vaoId); } - // Lines - Vertex buffers binding and attributes enable + // Lines - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) glGenBuffers(2, &lines.vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, lines.vboId[0]); @@ -3241,7 +3241,7 @@ static void LoadDefaultBuffers(void) glBindVertexArray(triangles.vaoId); } - // Triangles - Vertex buffers binding and attributes enable + // Triangles - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) glGenBuffers(1, &triangles.vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, triangles.vboId[0]); @@ -3267,7 +3267,7 @@ static void LoadDefaultBuffers(void) glBindVertexArray(quads.vaoId); } - // Quads - Vertex buffers binding and attributes enable + // Quads - Vertex buffers binding and attributes enable // Vertex position buffer (shader-location = 0) glGenBuffers(1, &quads.vboId[0]); glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[0]); @@ -3383,7 +3383,7 @@ static void DrawDefaultBuffers(int eyesCount) { Matrix matProjection = projection; Matrix matModelView = modelview; - + for (int eye = 0; eye < eyesCount; eye++) { if (eyesCount == 2) SetStereoView(eye, matProjection, matModelView); @@ -3392,17 +3392,17 @@ static void DrawDefaultBuffers(int eyesCount) if ((lines.vCounter > 0) || (triangles.vCounter > 0) || (quads.vCounter > 0)) { glUseProgram(currentShader.id); - + // Create modelview-projection matrix Matrix matMVP = MatrixMultiply(modelview, projection); glUniformMatrix4fv(currentShader.mvpLoc, 1, false, MatrixToFloat(matMVP)); glUniform4f(currentShader.colDiffuseLoc, 1.0f, 1.0f, 1.0f, 1.0f); glUniform1i(currentShader.mapTexture0Loc, 0); - + // NOTE: Additional map textures not considered for default buffers drawing } - + // Draw lines buffers if (lines.vCounter > 0) { @@ -3486,7 +3486,7 @@ static void DrawDefaultBuffers(int eyesCount) glBindBuffer(GL_ARRAY_BUFFER, quads.vboId[2]); glVertexAttribPointer(currentShader.colorLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0); glEnableVertexAttribArray(currentShader.colorLoc); - + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, quads.vboId[3]); } @@ -3526,7 +3526,7 @@ static void DrawDefaultBuffers(int eyesCount) glUseProgram(0); // Unbind shader program } - + // Reset draws counter drawsCounter = 1; draws[0].textureId = whiteTexture; @@ -3540,10 +3540,10 @@ static void DrawDefaultBuffers(int eyesCount) quads.vCounter = 0; quads.tcCounter = 0; quads.cCounter = 0; - + // Reset depth for next draw currentDepth = -1.0f; - + // Restore projection/modelview matrices projection = matProjection; modelview = matModelView; @@ -3604,34 +3604,34 @@ static void SetStereoConfig(VrDeviceInfo hmd) float rightLensCenter[2] = { 0.75f - lensShift, 0.5f }; float leftScreenCenter[2] = { 0.25f, 0.5f }; float rightScreenCenter[2] = { 0.75f, 0.5f }; - + // Compute distortion scale parameters // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] float lensRadius = fabsf(-1.0f - 4.0f*lensShift); float lensRadiusSq = lensRadius*lensRadius; - float distortionScale = hmd.distortionK[0] + - hmd.distortionK[1]*lensRadiusSq + - hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + + float distortionScale = hmd.distortionK[0] + + hmd.distortionK[1]*lensRadiusSq + + hmd.distortionK[2]*lensRadiusSq*lensRadiusSq + hmd.distortionK[3]*lensRadiusSq*lensRadiusSq*lensRadiusSq; - + TraceLog(DEBUG, "VR: Distortion Scale: %f", distortionScale); - + float normScreenWidth = 0.5f; float normScreenHeight = 1.0f; float scaleIn[2] = { 2.0f/normScreenWidth, 2.0f/normScreenHeight/aspect }; float scale[2] = { normScreenWidth*0.5f/distortionScale, normScreenHeight*0.5f*aspect/distortionScale }; - + TraceLog(DEBUG, "VR: Distortion Shader: LeftLensCenter = { %f, %f }", leftLensCenter[0], leftLensCenter[1]); TraceLog(DEBUG, "VR: Distortion Shader: RightLensCenter = { %f, %f }", rightLensCenter[0], rightLensCenter[1]); TraceLog(DEBUG, "VR: Distortion Shader: Scale = { %f, %f }", scale[0], scale[1]); TraceLog(DEBUG, "VR: Distortion Shader: ScaleIn = { %f, %f }", scaleIn[0], scaleIn[1]); - + // Update distortion shader with lens and distortion-scale parameters SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftLensCenter"), leftLensCenter, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightLensCenter"), rightLensCenter, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "leftScreenCenter"), leftScreenCenter, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "rightScreenCenter"), rightScreenCenter, 2); - + SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scale"), scale, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "scaleIn"), scaleIn, 2); SetShaderValue(vrConfig.distortionShader, GetShaderLocation(vrConfig.distortionShader, "hmdWarpParam"), hmd.distortionK, 4); @@ -3641,24 +3641,24 @@ static void SetStereoConfig(VrDeviceInfo hmd) // ...but with lens distortion it is increased (see Oculus SDK Documentation) //float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale? float fovy = 2.0f*(float)atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG; - + // Compute camera projection matrices float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); vrConfig.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); vrConfig.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); - + // NOTE: Projection matrices must be transposed due to raymath convention MatrixTranspose(&vrConfig.eyesProjection[0]); MatrixTranspose(&vrConfig.eyesProjection[1]); - + // Compute camera transformation matrices - // NOTE: Camera movement might seem more natural if we model the head. - // Our axis of rotation is the base of our head, so we might want to add + // NOTE: Camera movement might seem more natural if we model the head. + // Our axis of rotation is the base of our head, so we might want to add // some y (base of head to eye level) and -z (center of head to eye protrusion) to the camera positions. vrConfig.eyesViewOffset[0] = MatrixTranslate(-hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); vrConfig.eyesViewOffset[1] = MatrixTranslate(hmd.interpupillaryDistance*0.5f, 0.075f, 0.045f); - + // Compute eyes Viewports //vrConfig.eyesViewport[0] = (Rectangle){ 0, 0, hmd.hResolution/2, hmd.vResolution }; //vrConfig.eyesViewport[1] = (Rectangle){ hmd.hResolution/2, 0, hmd.hResolution/2, hmd.vResolution }; @@ -3675,17 +3675,17 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) #if defined(RLGL_OCULUS_SUPPORT) if (vrDeviceReady) { - rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, + rlViewport(layer.eyeLayer.Viewport[eye].Pos.x, layer.eyeLayer.Viewport[eye].Pos.y, layer.eyeLayer.Viewport[eye].Size.w, layer.eyeLayer.Viewport[eye].Size.h); - Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, - layer.eyeLayer.RenderPose[eye].Orientation.y, - layer.eyeLayer.RenderPose[eye].Orientation.z, + Quaternion eyeRenderPose = (Quaternion){ layer.eyeLayer.RenderPose[eye].Orientation.x, + layer.eyeLayer.RenderPose[eye].Orientation.y, + layer.eyeLayer.RenderPose[eye].Orientation.z, layer.eyeLayer.RenderPose[eye].Orientation.w }; QuaternionInvert(&eyeRenderPose); Matrix eyeOrientation = QuaternionToMatrix(eyeRenderPose); - Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, - -layer.eyeLayer.RenderPose[eye].Position.y, + Matrix eyeTranslation = MatrixTranslate(-layer.eyeLayer.RenderPose[eye].Position.x, + -layer.eyeLayer.RenderPose[eye].Position.y, -layer.eyeLayer.RenderPose[eye].Position.z); Matrix eyeView = MatrixMultiply(eyeTranslation, eyeOrientation); // Matrix containing eye-head movement @@ -3701,7 +3701,7 @@ static void SetStereoView(int eye, Matrix matProjection, Matrix matModelView) // Apply view offset to modelview matrix eyeModelView = MatrixMultiply(matModelView, vrConfig.eyesViewOffset[eye]); - + eyeProjection = vrConfig.eyesProjection[eye]; } @@ -3845,7 +3845,7 @@ OCULUSAPI bool InitOculusDevice(void) bool oculusReady = false; ovrResult result = ovr_Initialize(NULL); - + if (OVR_FAILURE(result)) TraceLog(WARNING, "OVR: Could not initialize Oculus device"); else { @@ -3865,24 +3865,24 @@ OCULUSAPI bool InitOculusDevice(void) TraceLog(INFO, "OVR: Product Type: %i", hmdDesc.Type); //TraceLog(INFO, "OVR: Serial Number: %s", hmdDesc.SerialNumber); TraceLog(INFO, "OVR: Resolution: %ix%i", hmdDesc.Resolution.w, hmdDesc.Resolution.h); - + // NOTE: Oculus mirror is set to defined screenWidth and screenHeight... // ...ideally, it should be (hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2) - + // Initialize Oculus Buffers - layer = InitOculusLayer(session); + layer = InitOculusLayer(session); buffer = LoadOculusBuffer(session, layer.width, layer.height); mirror = LoadOculusMirror(session, hmdDesc.Resolution.w/2, hmdDesc.Resolution.h/2); // NOTE: hardcoded... layer.eyeLayer.ColorTexture[0] = buffer.textureChain; //SetOculusLayerTexture(eyeLayer, buffer.textureChain); - + // Recenter OVR tracking origin ovr_RecenterTrackingOrigin(session); - + oculusReady = true; vrEnabled = true; } } - + return oculusReady; } @@ -3903,18 +3903,18 @@ OCULUSAPI void UpdateOculusTracking(Camera *camera) ovrPosef eyePoses[2]; ovr_GetEyePoses(session, frameIndex, ovrTrue, layer.viewScaleDesc.HmdToEyeOffset, eyePoses, &layer.eyeLayer.SensorSampleTime); - + layer.eyeLayer.RenderPose[0] = eyePoses[0]; layer.eyeLayer.RenderPose[1] = eyePoses[1]; - + // TODO: Update external camera with eyePoses data (position, orientation) // NOTE: We can simplify to simple camera if we consider IPD and HMD device configuration again later // it will be useful for the user to draw, lets say, billboards oriented to camera - + // Get session status information ovrSessionStatus sessionStatus; ovr_GetSessionStatus(session, &sessionStatus); - + if (sessionStatus.ShouldQuit) TraceLog(WARNING, "OVR: Session should quit..."); if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(session); //if (sessionStatus.HmdPresent) // HMD is present. @@ -3928,7 +3928,7 @@ OCULUSAPI void BeginOculusDrawing(void) { GLuint currentTexId; int currentIndex; - + ovr_GetTextureSwapChainCurrentIndex(session, buffer.textureChain, ¤tIndex); ovr_GetTextureSwapChainBufferGL(session, buffer.textureChain, currentIndex, ¤tTexId); @@ -3943,9 +3943,9 @@ OCULUSAPI void EndOculusDrawing(void) // Unbind current framebuffer (Oculus buffer) glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - + ovr_CommitTextureSwapChain(session, buffer.textureChain); - + ovrLayerHeader *layers = &layer.eyeLayer.Header; ovr_SubmitFrame(session, frameIndex, &layer.viewScaleDesc, &layers, 1); @@ -3959,7 +3959,7 @@ static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) OculusBuffer buffer; buffer.width = width; buffer.height = height; - + // Create OVR texture chain ovrTextureSwapChainDesc desc = {}; desc.Type = ovrTexture_2D; @@ -3972,12 +3972,12 @@ static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) desc.StaticImage = ovrFalse; ovrResult result = ovr_CreateTextureSwapChainGL(session, &desc, &buffer.textureChain); - + if (!OVR_SUCCESS(result)) TraceLog(WARNING, "OVR: Failed to create swap textures buffer"); int textureCount = 0; ovr_GetTextureSwapChainLength(session, buffer.textureChain, &textureCount); - + if (!OVR_SUCCESS(result) || !textureCount) TraceLog(WARNING, "OVR: Unable to count swap chain textures"); for (int i = 0; i < textureCount; ++i) @@ -3990,9 +3990,9 @@ static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } - + glBindTexture(GL_TEXTURE_2D, 0); - + /* // Setup framebuffer object (using depth texture) glGenFramebuffers(1, &buffer.fboId); @@ -4004,7 +4004,7 @@ static OculusBuffer LoadOculusBuffer(ovrSession session, int width, int height) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, buffer.width, buffer.height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); */ - + // Setup framebuffer object (using depth renderbuffer) glGenFramebuffers(1, &buffer.fboId); glGenRenderbuffers(1, &buffer.depthId); @@ -4037,13 +4037,13 @@ static OculusMirror LoadOculusMirror(ovrSession session, int width, int height) OculusMirror mirror; mirror.width = width; mirror.height = height; - + ovrMirrorTextureDesc mirrorDesc; memset(&mirrorDesc, 0, sizeof(mirrorDesc)); mirrorDesc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; mirrorDesc.Width = mirror.width; mirrorDesc.Height = mirror.height; - + if (!OVR_SUCCESS(ovr_CreateMirrorTextureGL(session, &mirrorDesc, &mirror.texture))) TraceLog(WARNING, "Could not create mirror texture"); glGenFramebuffers(1, &mirror.fboId); @@ -4062,9 +4062,9 @@ static void UnloadOculusMirror(ovrSession session, OculusMirror mirror) static void BlitOculusMirror(ovrSession session, OculusMirror mirror) { GLuint mirrorTextureId; - + ovr_GetMirrorTextureBufferGL(session, mirror.texture, &mirrorTextureId); - + glBindFramebuffer(GL_READ_FRAMEBUFFER, mirror.fboId); glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mirrorTextureId, 0); #if defined(GRAPHICS_API_OPENGL_33) @@ -4078,7 +4078,7 @@ static void BlitOculusMirror(ovrSession session, OculusMirror mirror) static OculusLayer InitOculusLayer(ovrSession session) { OculusLayer layer = { 0 }; - + layer.viewScaleDesc.HmdSpaceToWorldScaleInMeters = 1.0f; memset(&layer.eyeLayer, 0, sizeof(ovrLayerEyeFov)); @@ -4086,7 +4086,7 @@ static OculusLayer InitOculusLayer(ovrSession session) layer.eyeLayer.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; ovrEyeRenderDesc eyeRenderDescs[2]; - + for (int eye = 0; eye < 2; eye++) { eyeRenderDescs[eye] = ovr_GetRenderDesc(session, eye, hmdDesc.DefaultEyeFov[eye]); @@ -4095,7 +4095,7 @@ static OculusLayer InitOculusLayer(ovrSession session) layer.viewScaleDesc.HmdToEyeOffset[eye] = eyeRenderDescs[eye].HmdToEyeOffset; layer.eyeLayer.Fov[eye] = eyeRenderDescs[eye].Fov; - + ovrSizei eyeSize = ovr_GetFovTextureSize(session, eye, layer.eyeLayer.Fov[eye], 1.0f); layer.eyeLayer.Viewport[eye].Size = eyeSize; layer.eyeLayer.Viewport[eye].Pos.x = layer.width; @@ -4104,7 +4104,7 @@ static OculusLayer InitOculusLayer(ovrSession session) layer.height = eyeSize.h; //std::max(renderTargetSize.y, (uint32_t)eyeSize.h); layer.width += eyeSize.w; } - + return layer; } @@ -4112,7 +4112,7 @@ static OculusLayer InitOculusLayer(ovrSession session) static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) { Matrix rmat; - + rmat.m0 = ovrmat.M[0][0]; rmat.m1 = ovrmat.M[1][0]; rmat.m2 = ovrmat.M[2][0]; @@ -4129,9 +4129,9 @@ static Matrix FromOvrMatrix(ovrMatrix4f ovrmat) rmat.m13 = ovrmat.M[1][3]; rmat.m14 = ovrmat.M[2][3]; rmat.m15 = ovrmat.M[3][3]; - + MatrixTranspose(&rmat); - + return rmat; } #endif @@ -4162,7 +4162,7 @@ void TraceLog(int msgType, const char *text, ...) } // Converts Matrix to float array -// NOTE: Returned vector is a transposed version of the Matrix struct, +// NOTE: Returned vector is a transposed version of the Matrix struct, // it should be this way because, despite raymath use OpenGL column-major convention, // Matrix struct memory alignment and variables naming are not coherent float *MatrixToFloat(Matrix mat) diff --git a/src/text.c b/src/text.c index 4e163668..e3d22fbd 100644 --- a/src/text.c +++ b/src/text.c @@ -286,17 +286,17 @@ SpriteFont LoadSpriteFont(const char *fileName) SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars) { SpriteFont spriteFont = { 0 }; - - if (strcmp(GetExtension(fileName),"ttf") == 0) + + if (strcmp(GetExtension(fileName),"ttf") == 0) { if ((fontChars == NULL) || (numChars == 0)) { int totalChars = 95; // Default charset [32..126] - + int *defaultFontChars = (int *)malloc(totalChars*sizeof(int)); - + for (int i = 0; i < totalChars; i++) defaultFontChars[i] = i + 32; // Default first character: SPACE[32] - + spriteFont = LoadTTF(fileName, fontSize, totalChars, defaultFontChars); } else spriteFont = LoadTTF(fileName, fontSize, numChars, fontChars); @@ -353,10 +353,10 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float int textOffsetX = 0; // Offset between characters int textOffsetY = 0; // Required for line break! float scaleFactor; - + unsigned char letter; // Current character int index; // Index position in sprite font - + scaleFactor = fontSize/spriteFont.size; // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly @@ -388,10 +388,10 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float } else index = GetCharIndex(spriteFont, (int)text[i]); - DrawTexturePro(spriteFont.texture, spriteFont.charRecs[index], + DrawTexturePro(spriteFont.texture, spriteFont.charRecs[index], (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor, position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor, - spriteFont.charRecs[index].width*scaleFactor, + spriteFont.charRecs[index].width*scaleFactor, spriteFont.charRecs[index].height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint); if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (int)(spriteFont.charRecs[index].width*scaleFactor + spacing); @@ -476,7 +476,7 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i if (text[i] != '\n') { int index = GetCharIndex(spriteFont, (int)text[i]); - + if (spriteFont.charAdvanceX[index] != 0) textWidth += spriteFont.charAdvanceX[index]; else textWidth += (spriteFont.charRecs[index].width + spriteFont.charOffsets[index].x); } @@ -517,7 +517,7 @@ static int GetCharIndex(SpriteFont font, int letter) #define UNORDERED_CHARSET #if defined(UNORDERED_CHARSET) int index = 0; - + for (int i = 0; i < font.numChars; i++) { if (font.charValues[i] == letter) @@ -526,7 +526,7 @@ static int GetCharIndex(SpriteFont font, int letter) break; } } - + return index; #else return (letter - 32); @@ -607,14 +607,14 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) } TraceLog(DEBUG, "SpriteFont data parsed correctly from image"); - - // NOTE: We need to remove key color borders from image to avoid weird + + // NOTE: We need to remove key color borders from image to avoid weird // artifacts on texture scaling when using FILTER_BILINEAR or FILTER_TRILINEAR for (int i = 0; i < image.height*image.width; i++) if (COLOR_EQUAL(pixels[i], key)) pixels[i] = BLANK; // Create a new image with the processed color data (key color replaced by BLANK) Image fontClear = LoadImageEx(pixels, image.width, image.height); - + free(pixels); // Free pixels array memory // Create spritefont with all data parsed from image @@ -622,7 +622,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) spriteFont.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture spriteFont.numChars = index; - + UnloadImage(fontClear); // Unload processed image once converted to texture // We got tempCharValues and tempCharsRecs populated with chars data @@ -643,7 +643,7 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) } spriteFont.size = spriteFont.charRecs[0].height; - + TraceLog(INFO, "Image file loaded correctly as SpriteFont"); return spriteFont; @@ -853,13 +853,13 @@ static SpriteFont LoadBMFont(const char *fileName) strncat(texPath, texFileName, strlen(texFileName)); TraceLog(DEBUG, "[%s] Font texture loading path: %s", fileName, texPath); - + Image imFont = LoadImage(texPath); - - if (imFont.format == UNCOMPRESSED_GRAYSCALE) + + if (imFont.format == UNCOMPRESSED_GRAYSCALE) { Image imCopy = ImageCopy(imFont); - + for (int i = 0; i < imCopy.width*imCopy.height; i++) ((unsigned char *)imCopy.data)[i] = 0xff; // WHITE pixel ImageAlphaMask(&imCopy, imFont); @@ -867,7 +867,7 @@ static SpriteFont LoadBMFont(const char *fileName) UnloadImage(imCopy); } else font.texture = LoadTextureFromImage(imFont); - + font.size = fontSize; font.numChars = numChars; font.charValues = (int *)malloc(numChars*sizeof(int)); @@ -876,7 +876,7 @@ static SpriteFont LoadBMFont(const char *fileName) font.charAdvanceX = (int *)malloc(numChars*sizeof(int)); UnloadImage(imFont); - + free(texPath); int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; @@ -913,11 +913,11 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int // NOTE: Font texture size is predicted (being as much conservative as possible) // Predictive method consist of supposing same number of chars by line-column (sqrtf) // and a maximum character width of 3/4 of fontSize... it worked ok with all my tests... - + // Calculate next power-of-two value float guessSize = ceilf((float)fontSize*3/4)*ceilf(sqrtf((float)numChars)); int textureSize = (int)powf(2, ceilf(logf((float)guessSize)/logf(2))); // Calculate next POT - + TraceLog(INFO, "TTF spritefont loading: Predicted texture size: %ix%i", textureSize, textureSize); unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); @@ -935,7 +935,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int } fread(ttfBuffer, 1, 1 << 25, ttfFile); - + if (fontChars[0] != 32) TraceLog(WARNING, "TTF spritefont loading: first character is not SPACE(32) character"); // NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image... @@ -945,7 +945,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int //if (result > 0) TraceLog(INFO, "TTF spritefont loading: first unused row of generated bitmap: %i", result); if (result < 0) TraceLog(WARNING, "TTF spritefont loading: Not all the characters fit in the font"); - + free(ttfBuffer); // Convert image data from grayscale to to UNCOMPRESSED_GRAY_ALPHA @@ -966,11 +966,11 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int image.mipmaps = 1; image.format = UNCOMPRESSED_GRAY_ALPHA; image.data = dataGrayAlpha; - + font.texture = LoadTextureFromImage(image); - + //SavePNG("generated_ttf_image.png", (unsigned char *)image.data, image.width, image.height, 2); - + UnloadImage(image); // Unloads dataGrayAlpha font.size = fontSize; diff --git a/src/textures.c b/src/textures.c index 3fa250c2..9d865aa1 100644 --- a/src/textures.c +++ b/src/textures.c @@ -144,9 +144,9 @@ Image LoadImage(const char *fileName) else if (strcmp(GetExtension(fileName),"rres") == 0) { RRESData rres = LoadResource(fileName); - + // NOTE: Parameters for RRES_IMAGE type are: width, height, format, mipmaps - + if (rres.type == RRES_IMAGE) image = LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); else TraceLog(WARNING, "[%s] Resource file does not contain image data", fileName); @@ -197,9 +197,9 @@ Image LoadImagePro(void *data, int width, int height, int format) srcImage.height = height; srcImage.mipmaps = 1; srcImage.format = format; - + Image dstImage = ImageCopy(srcImage); - + return dstImage; } @@ -244,7 +244,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int if (bytes < size) { TraceLog(WARNING, "[%s] RAW image data can not be read, wrong requested format or size", fileName); - + if (image.data != NULL) free(image.data); } else @@ -615,12 +615,12 @@ void ImageAlphaMask(Image *image, Image alphaMask) // Force mask to be Grayscale Image mask = ImageCopy(alphaMask); if (mask.format != UNCOMPRESSED_GRAYSCALE) ImageFormat(&mask, UNCOMPRESSED_GRAYSCALE); - + // In case image is only grayscale, we just add alpha channel if (image->format == UNCOMPRESSED_GRAYSCALE) { ImageFormat(image, UNCOMPRESSED_GRAY_ALPHA); - + // Apply alpha mask to alpha channel for (int i = 0, k = 1; (i < mask.width*mask.height) || (i < image->width*image->height); i++, k += 2) { @@ -955,7 +955,7 @@ void ImageResizeNN(Image *image,int newWidth,int newHeight) void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) { bool cropRequired = false; - + // Security checks to avoid size and rectangle issues (out of bounds) // Check that srcRec is inside src image if (srcRec.x < 0) srcRec.x = 0; @@ -973,15 +973,15 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) TraceLog(WARNING, "Source rectangle height out of bounds, rescaled height: %i", srcRec.height); cropRequired = true; } - + Image srcCopy = ImageCopy(src); // Make a copy of source image to work with it ImageCrop(&srcCopy, srcRec); // Crop source image to desired source rectangle - + // Check that dstRec is inside dst image // TODO: Allow negative position within destination with cropping if (dstRec.x < 0) dstRec.x = 0; if (dstRec.y < 0) dstRec.y = 0; - + // Scale source image in case destination rec size is different than source rec size if ((dstRec.width != srcRec.width) || (dstRec.height != srcRec.height)) { @@ -1001,20 +1001,20 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) TraceLog(WARNING, "Destination rectangle height out of bounds, rescaled height: %i", dstRec.height); cropRequired = true; } - + if (cropRequired) { // Crop destination rectangle if out of bounds Rectangle crop = { 0, 0, dstRec.width, dstRec.height }; ImageCrop(&srcCopy, crop); } - + // Get image data as Color pixels array to work with it Color *dstPixels = GetImageData(*dst); Color *srcPixels = GetImageData(srcCopy); UnloadImage(srcCopy); // Source copy not required any more... - + Color srcCol, dstCol; // Blit pixels, copy source image into destination @@ -1026,13 +1026,13 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec) // Alpha blending implementation dstCol = dstPixels[j*dst->width + i]; srcCol = srcPixels[(j - dstRec.y)*dstRec.width + (i - dstRec.x)]; - + dstCol.r = ((srcCol.a*(srcCol.r - dstCol.r)) >> 8) + dstCol.r; dstCol.g = ((srcCol.a*(srcCol.g - dstCol.g)) >> 8) + dstCol.g; dstCol.b = ((srcCol.a*(srcCol.b - dstCol.b)) >> 8) + dstCol.b; - + dstPixels[j*dst->width + i] = dstCol; - + // TODO: Support other blending options } } @@ -1369,7 +1369,7 @@ void SetTextureFilter(Texture2D texture, int filterMode) { // RL_FILTER_MIP_NEAREST - tex filter: POINT, mipmaps filter: POINT (sharp switching between mipmaps) rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_NEAREST); - + // RL_FILTER_NEAREST - tex filter: POINT (no filter), no mipmaps rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_NEAREST); } @@ -1387,7 +1387,7 @@ void SetTextureFilter(Texture2D texture, int filterMode) // RL_FILTER_LINEAR_MIP_NEAREST - tex filter: BILINEAR, mipmaps filter: POINT (sharp switching between mipmaps) // Alternative: RL_FILTER_NEAREST_MIP_LINEAR - tex filter: POINT, mipmaps filter: BILINEAR (smooth transition between mipmaps) rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR_MIP_NEAREST); - + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); } @@ -1404,14 +1404,14 @@ void SetTextureFilter(Texture2D texture, int filterMode) { // RL_FILTER_MIP_LINEAR - tex filter: BILINEAR, mipmaps filter: BILINEAR (smooth transition between mipmaps) rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_MIP_LINEAR); - + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); } else { TraceLog(WARNING, "[TEX ID %i] No mipmaps available for TRILINEAR texture filtering", texture.id); - + // RL_FILTER_LINEAR - tex filter: BILINEAR, no mipmaps rlTextureParameters(texture.id, RL_TEXTURE_MIN_FILTER, RL_FILTER_LINEAR); rlTextureParameters(texture.id, RL_TEXTURE_MAG_FILTER, RL_FILTER_LINEAR); @@ -2007,19 +2007,19 @@ static Image LoadPVR(const char *fileName) image.mipmaps = pvrHeader.numMipmaps; // Check data format - if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 0)) && (pvrHeader.channelDepth[0] == 8)) + if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 0)) && (pvrHeader.channelDepth[0] == 8)) image.format = UNCOMPRESSED_GRAYSCALE; - else if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 'a')) && ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8))) + else if (((pvrHeader.channels[0] == 'l') && (pvrHeader.channels[1] == 'a')) && ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8))) image.format = UNCOMPRESSED_GRAY_ALPHA; else if ((pvrHeader.channels[0] == 'r') && (pvrHeader.channels[1] == 'g') && (pvrHeader.channels[2] == 'b')) { if (pvrHeader.channels[3] == 'a') { - if ((pvrHeader.channelDepth[0] == 5) && (pvrHeader.channelDepth[1] == 5) && (pvrHeader.channelDepth[2] == 5) && (pvrHeader.channelDepth[3] == 1)) + if ((pvrHeader.channelDepth[0] == 5) && (pvrHeader.channelDepth[1] == 5) && (pvrHeader.channelDepth[2] == 5) && (pvrHeader.channelDepth[3] == 1)) image.format = UNCOMPRESSED_R5G5B5A1; - else if ((pvrHeader.channelDepth[0] == 4) && (pvrHeader.channelDepth[1] == 4) && (pvrHeader.channelDepth[2] == 4) && (pvrHeader.channelDepth[3] == 4)) + else if ((pvrHeader.channelDepth[0] == 4) && (pvrHeader.channelDepth[1] == 4) && (pvrHeader.channelDepth[2] == 4) && (pvrHeader.channelDepth[3] == 4)) image.format = UNCOMPRESSED_R4G4B4A4; - else if ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8) && (pvrHeader.channelDepth[2] == 8) && (pvrHeader.channelDepth[3] == 8)) + else if ((pvrHeader.channelDepth[0] == 8) && (pvrHeader.channelDepth[1] == 8) && (pvrHeader.channelDepth[2] == 8) && (pvrHeader.channelDepth[3] == 8)) image.format = UNCOMPRESSED_R8G8B8A8; } else if (pvrHeader.channels[3] == 0) -- cgit v1.2.3 From 30bb24aa6e80fe8ecc9eddc4efd008ecc89b60f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 29 Jan 2017 22:29:54 +0100 Subject: Updated Gestures enum --- src/gestures.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gestures.h b/src/gestures.h index 19b09269..f4dcb133 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -65,17 +65,17 @@ // Gestures type // NOTE: It could be used as flags to enable only some gestures typedef enum { - GESTURE_NONE = 1, - GESTURE_TAP = 2, - GESTURE_DOUBLETAP = 4, - GESTURE_HOLD = 8, - GESTURE_DRAG = 16, - GESTURE_SWIPE_RIGHT = 32, - GESTURE_SWIPE_LEFT = 64, - GESTURE_SWIPE_UP = 128, - GESTURE_SWIPE_DOWN = 256, - GESTURE_PINCH_IN = 512, - GESTURE_PINCH_OUT = 1024 + GESTURE_NONE = 0, + GESTURE_TAP = 1, + GESTURE_DOUBLETAP = 2, + GESTURE_HOLD = 4, + GESTURE_DRAG = 8, + GESTURE_SWIPE_RIGHT = 16, + GESTURE_SWIPE_LEFT = 32, + GESTURE_SWIPE_UP = 64, + GESTURE_SWIPE_DOWN = 128, + GESTURE_PINCH_IN = 256, + GESTURE_PINCH_OUT = 512 } Gestures; #endif -- cgit v1.2.3 From 495108a2e9a911c88c090f2ddd82391130701031 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 29 Jan 2017 23:08:19 +0100 Subject: Updated raylib version to 1.7 Preparing for next version... still some work left... :P --- src/core.c | 4 ++-- src/raylib.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index ea363fce..4ce32a05 100644 --- a/src/core.c +++ b/src/core.c @@ -330,7 +330,7 @@ static void *GamepadThread(void *arg); // Mouse reading thread // Initialize Window and Graphics Context (OpenGL) void InitWindow(int width, int height, const char *title) { - TraceLog(INFO, "Initializing raylib (v1.6.0)"); + TraceLog(INFO, "Initializing raylib (v1.7.0)"); // Store window title (could be useful...) windowTitle = title; @@ -387,7 +387,7 @@ void InitWindow(int width, int height, const char *title) // Android activity initialization void InitWindow(int width, int height, void *state) { - TraceLog(INFO, "Initializing raylib (v1.6.0)"); + TraceLog(INFO, "Initializing raylib (v1.7.0)"); app_dummy(); diff --git a/src/raylib.h b/src/raylib.h index c1c9ebae..3c84ee72 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib 1.6.0 (www.raylib.com) +* raylib 1.7.0 (www.raylib.com) * * A simple and easy-to-use library to learn videogames programming * -- cgit v1.2.3 From a08117155da1a0a439239ad8801a58b85f528014 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 1 Feb 2017 00:28:28 +0100 Subject: Init memory for screenshot to zero --- src/rlgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rlgl.c b/src/rlgl.c index 6c4e5927..ce17adc3 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2198,7 +2198,7 @@ void rlglUnloadMesh(Mesh *mesh) // Read screen pixel data (color buffer) unsigned char *rlglReadScreenPixels(int width, int height) { - unsigned char *screenData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4); + unsigned char *screenData = (unsigned char *)calloc(width*height*4, sizeof(unsigned char)); // NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); -- cgit v1.2.3 From 1a879ba08efe1877c26a76bfabd43f282d2b2a97 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Feb 2017 02:59:39 +0100 Subject: Refactor SpriteFont struct Now it uses CharInfo data, this way, it's better aligned with the future RRES file format data layout for sprite font characters. --- src/raylib.h | 20 +++-- src/rlua.h | 8 +- src/text.c | 230 ++++++++++++++++++++++++++++++--------------------------- src/textures.c | 4 +- 4 files changed, 141 insertions(+), 121 deletions(-) (limited to 'src') diff --git a/src/raylib.h b/src/raylib.h index 3c84ee72..f5b908db 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -370,15 +370,21 @@ typedef struct RenderTexture2D { Texture2D depth; // Depth buffer attachment texture } RenderTexture2D; +// SpriteFont character info +typedef struct CharInfo { + int value; // Character value (Unicode) + Rectangle rec; // Character rectangle in sprite font + int offsetX; // Character offset X when drawing + int offsetY; // Character offset Y when drawing + int advanceX; // Character advance position X +} CharInfo; + // SpriteFont type, includes texture and charSet array data typedef struct SpriteFont { Texture2D texture; // Font texture - int size; // Base size (default chars height) - int numChars; // Number of characters - int *charValues; // Characters values array - Rectangle *charRecs; // Characters rectangles within the texture - Vector2 *charOffsets; // Characters offsets (on drawing) - int *charAdvanceX; // Characters x advance (on drawing) + int baseSize; // Base size (default chars height) + int charsCount; // Number of characters + CharInfo *chars; // Characters info data } SpriteFont; // Camera type, defines a camera position/orientation in 3d space @@ -825,7 +831,7 @@ RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle dest //------------------------------------------------------------------------------------ RLAPI SpriteFont GetDefaultFont(void); // Get the default SpriteFont RLAPI SpriteFont LoadSpriteFont(const char *fileName); // Load SpriteFont from file into GPU memory (VRAM) -RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load SpriteFont from TTF font file with generation parameters +RLAPI SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load SpriteFont from TTF font file with generation parameters RLAPI void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory (VRAM) RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) diff --git a/src/rlua.h b/src/rlua.h index e9ed2c3c..80dede41 100644 --- a/src/rlua.h +++ b/src/rlua.h @@ -16,7 +16,7 @@ * * The following types: * Image, Texture2D, RenderTexture2D, SpriteFont -* are immutable, and you can only read their non-pointer arguments (e.g. sprfnt.size). +* are immutable, and you can only read their non-pointer arguments (e.g. sprfnt.baseSize). * * All other object types are opaque, that is, you cannot access or * change their fields directly. @@ -293,8 +293,8 @@ static int LuaIndexSpriteFont(lua_State* L) lua_pushinteger(L, img.size); else if (!strcmp(key, "texture")) LuaPush_Texture2D(L, img.texture); - else if (!strcmp(key, "numChars")) - lua_pushinteger(L, img.numChars); + else if (!strcmp(key, "charsCount")) + lua_pushinteger(L, img.charsCount); else return 0; return 1; @@ -2203,7 +2203,7 @@ int lua_LoadSpriteFontTTF(lua_State* L) int arg2 = LuaGetArgument_int(L, 2); int arg3 = LuaGetArgument_int(L, 3); int arg4 = LuaGetArgument_int(L, 4); - //LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); + //LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars); SpriteFont result = LoadSpriteFontTTF(arg1, arg2, arg3, &arg4); LuaPush_SpriteFont(L, result); return 1; diff --git a/src/text.c b/src/text.c index e3d22fbd..af07bb69 100644 --- a/src/text.c +++ b/src/text.c @@ -79,7 +79,7 @@ static int GetCharIndex(SpriteFont font, int letter); static SpriteFont LoadImageFont(Image image, Color key, int firstChar); // Load a Image font file (XNA style) static SpriteFont LoadRBMF(const char *fileName); // Load a rBMF font file (raylib BitMap Font) static SpriteFont LoadBMFont(const char *fileName); // Load a BMFont file (AngelCode font file) -static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load spritefont from TTF data +static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, int *fontChars); // Load spritefont from TTF data extern void LoadDefaultFont(void); extern void UnloadDefaultFont(void); @@ -92,7 +92,7 @@ extern void LoadDefaultFont(void) // NOTE: Using UTF8 encoding table for Unicode U+0000..U+00FF Basic Latin + Latin-1 Supplement // http://www.utf8-chartable.de/unicode-utf8-table.pl - defaultFont.numChars = 224; // Number of chars included in our default font + defaultFont.charsCount = 224; // Number of chars included in our default font // Default font is directly defined here (data generated from a sprite font image) // This way, we reconstruct SpriteFont without creating large global variables @@ -189,29 +189,27 @@ extern void LoadDefaultFont(void) defaultFont.texture = LoadTextureFromImage(image); UnloadImage(image); - // Reconstruct charSet using charsWidth[], charsHeight, charsDivisor, numChars + // Reconstruct charSet using charsWidth[], charsHeight, charsDivisor, charsCount //------------------------------------------------------------------------------ - defaultFont.charValues = (int *)malloc(defaultFont.numChars*sizeof(int)); - defaultFont.charRecs = (Rectangle *)malloc(defaultFont.numChars*sizeof(Rectangle)); // Allocate space for our character rectangle data - // This memory should be freed at end! --> Done on CloseWindow() - - defaultFont.charOffsets = (Vector2 *)malloc(defaultFont.numChars*sizeof(Vector2)); - defaultFont.charAdvanceX = (int *)malloc(defaultFont.numChars*sizeof(int)); + + // Allocate space for our characters info data + // NOTE: This memory should be freed at end! --> CloseWindow() + defaultFont.chars = (CharInfo *)malloc(defaultFont.charsCount*sizeof(CharInfo)); int currentLine = 0; int currentPosX = charsDivisor; int testPosX = charsDivisor; - for (int i = 0; i < defaultFont.numChars; i++) + for (int i = 0; i < defaultFont.charsCount; i++) { - defaultFont.charValues[i] = 32 + i; // First char is 32 + defaultFont.chars[i].value = 32 + i; // First char is 32 - defaultFont.charRecs[i].x = currentPosX; - defaultFont.charRecs[i].y = charsDivisor + currentLine*(charsHeight + charsDivisor); - defaultFont.charRecs[i].width = charsWidth[i]; - defaultFont.charRecs[i].height = charsHeight; + defaultFont.chars[i].rec.x = currentPosX; + defaultFont.chars[i].rec.y = charsDivisor + currentLine*(charsHeight + charsDivisor); + defaultFont.chars[i].rec.width = charsWidth[i]; + defaultFont.chars[i].rec.height = charsHeight; - testPosX += (defaultFont.charRecs[i].width + charsDivisor); + testPosX += (defaultFont.chars[i].rec.width + charsDivisor); if (testPosX >= defaultFont.texture.width) { @@ -219,17 +217,18 @@ extern void LoadDefaultFont(void) currentPosX = 2*charsDivisor + charsWidth[i]; testPosX = currentPosX; - defaultFont.charRecs[i].x = charsDivisor; - defaultFont.charRecs[i].y = charsDivisor + currentLine*(charsHeight + charsDivisor); + defaultFont.chars[i].rec.x = charsDivisor; + defaultFont.chars[i].rec.y = charsDivisor + currentLine*(charsHeight + charsDivisor); } else currentPosX = testPosX; // NOTE: On default font character offsets and xAdvance are not required - defaultFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; - defaultFont.charAdvanceX[i] = 0; + defaultFont.chars[i].offsetX = 0; + defaultFont.chars[i].offsetY = 0; + defaultFont.chars[i].advanceX = 0; } - defaultFont.size = defaultFont.charRecs[0].height; + defaultFont.baseSize = defaultFont.chars[0].rec.height; TraceLog(INFO, "[TEX ID %i] Default font loaded successfully", defaultFont.texture.id); } @@ -237,10 +236,7 @@ extern void LoadDefaultFont(void) extern void UnloadDefaultFont(void) { UnloadTexture(defaultFont.texture); - free(defaultFont.charValues); - free(defaultFont.charRecs); - free(defaultFont.charOffsets); - free(defaultFont.charAdvanceX); + free(defaultFont.chars); } // Get the default font, useful to be used with extended parameters @@ -260,9 +256,35 @@ SpriteFont LoadSpriteFont(const char *fileName) SpriteFont spriteFont = { 0 }; // Check file extension - if (strcmp(GetExtension(fileName),"rbmf") == 0) spriteFont = LoadRBMF(fileName); + if (strcmp(GetExtension(fileName),"rbmf") == 0) spriteFont = LoadRBMF(fileName); // TODO: DELETE... SOON... else if (strcmp(GetExtension(fileName),"ttf") == 0) spriteFont = LoadSpriteFontTTF(fileName, DEFAULT_TTF_FONTSIZE, 0, NULL); else if (strcmp(GetExtension(fileName),"fnt") == 0) spriteFont = LoadBMFont(fileName); + else if (strcmp(GetExtension(fileName),"rres") == 0) + { + // TODO: Read multiple resource blocks from file (RRES_FONT_IMAGE, RRES_FONT_CHARDATA) + RRESData rres = LoadResource(fileName); + + // Load sprite font texture + if (rres.type == RRES_FONT_IMAGE) + { + // NOTE: Parameters for RRES_FONT_IMAGE type are: width, height, format, mipmaps + Image image = LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); + spriteFont.texture = LoadTextureFromImage(image); + UnloadImage(image); + } + + // Load sprite characters data + if (rres.type == RRES_FONT_CHARDATA) + { + // NOTE: Parameters for RRES_FONT_CHARDATA type are: fontSize, charsCount + spriteFont.baseSize = rres.param1; + spriteFont.charsCount = rres.param2; + spriteFont.chars = rres.data; + } + + // TODO: Do not free rres.data memory (chars info data!) + UnloadResource(rres); + } else { Image image = LoadImage(fileName); @@ -283,13 +305,13 @@ SpriteFont LoadSpriteFont(const char *fileName) // Load SpriteFont from TTF font file with generation parameters // NOTE: You can pass an array with desired characters, those characters should be available in the font // if array is NULL, default char set is selected 32..126 -SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars) +SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars) { SpriteFont spriteFont = { 0 }; if (strcmp(GetExtension(fileName),"ttf") == 0) { - if ((fontChars == NULL) || (numChars == 0)) + if ((fontChars == NULL) || (charsCount == 0)) { int totalChars = 95; // Default charset [32..126] @@ -299,7 +321,7 @@ SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, i spriteFont = LoadTTF(fileName, fontSize, totalChars, defaultFontChars); } - else spriteFont = LoadTTF(fileName, fontSize, numChars, fontChars); + else spriteFont = LoadTTF(fileName, fontSize, charsCount, fontChars); } if (spriteFont.texture.id == 0) @@ -318,10 +340,7 @@ void UnloadSpriteFont(SpriteFont spriteFont) if (spriteFont.texture.id != defaultFont.texture.id) { UnloadTexture(spriteFont.texture); - free(spriteFont.charValues); - free(spriteFont.charRecs); - free(spriteFont.charOffsets); - free(spriteFont.charAdvanceX); + free(spriteFont.chars); TraceLog(DEBUG, "Unloaded sprite font data"); } @@ -357,7 +376,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float unsigned char letter; // Current character int index; // Index position in sprite font - scaleFactor = fontSize/spriteFont.size; + scaleFactor = fontSize/spriteFont.baseSize; // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly // written in C code files (codified by default as UTF-8) @@ -367,7 +386,7 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float if ((unsigned char)text[i] == '\n') { // NOTE: Fixed line spacing of 1.5 lines - textOffsetY += (int)((spriteFont.size + spriteFont.size/2)*scaleFactor); + textOffsetY += (int)((spriteFont.baseSize + spriteFont.baseSize/2)*scaleFactor); textOffsetX = 0; } else @@ -388,14 +407,14 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float } else index = GetCharIndex(spriteFont, (int)text[i]); - DrawTexturePro(spriteFont.texture, spriteFont.charRecs[index], - (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor, - position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor, - spriteFont.charRecs[index].width*scaleFactor, - spriteFont.charRecs[index].height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint); + DrawTexturePro(spriteFont.texture, spriteFont.chars[index].rec, + (Rectangle){ position.x + textOffsetX + spriteFont.chars[index].offsetX*scaleFactor, + position.y + textOffsetY + spriteFont.chars[index].offsetY*scaleFactor, + spriteFont.chars[index].rec.width*scaleFactor, + spriteFont.chars[index].rec.height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint); - if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (int)(spriteFont.charRecs[index].width*scaleFactor + spacing); - else textOffsetX += (int)(spriteFont.charAdvanceX[index]*scaleFactor + spacing); + if (spriteFont.chars[index].advanceX == 0) textOffsetX += (int)(spriteFont.chars[index].rec.width*scaleFactor + spacing); + else textOffsetX += (int)(spriteFont.chars[index].advanceX*scaleFactor + spacing); } } } @@ -466,8 +485,8 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i float textWidth = 0; float tempTextWidth = 0; // Used to count longer text line width - float textHeight = (float)spriteFont.size; - float scaleFactor = fontSize/(float)spriteFont.size; + float textHeight = (float)spriteFont.baseSize; + float scaleFactor = fontSize/(float)spriteFont.baseSize; for (int i = 0; i < len; i++) { @@ -477,15 +496,15 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i { int index = GetCharIndex(spriteFont, (int)text[i]); - if (spriteFont.charAdvanceX[index] != 0) textWidth += spriteFont.charAdvanceX[index]; - else textWidth += (spriteFont.charRecs[index].width + spriteFont.charOffsets[index].x); + if (spriteFont.chars[index].advanceX != 0) textWidth += spriteFont.chars[index].advanceX; + else textWidth += (spriteFont.chars[index].rec.width + spriteFont.chars[index].offsetX); } else { if (tempTextWidth < textWidth) tempTextWidth = textWidth; lenCounter = 0; textWidth = 0; - textHeight += ((float)spriteFont.size*1.5f); // NOTE: Fixed line spacing of 1.5 lines + textHeight += ((float)spriteFont.baseSize*1.5f); // NOTE: Fixed line spacing of 1.5 lines } if (tempLen < lenCounter) tempLen = lenCounter; @@ -518,9 +537,9 @@ static int GetCharIndex(SpriteFont font, int letter) #if defined(UNORDERED_CHARSET) int index = 0; - for (int i = 0; i < font.numChars; i++) + for (int i = 0; i < font.charsCount; i++) { - if (font.charValues[i] == letter) + if (font.chars[i].value == letter) { index = i; break; @@ -621,28 +640,26 @@ static SpriteFont LoadImageFont(Image image, Color key, int firstChar) SpriteFont spriteFont = { 0 }; spriteFont.texture = LoadTextureFromImage(fontClear); // Convert processed image to OpenGL texture - spriteFont.numChars = index; + spriteFont.charsCount = index; UnloadImage(fontClear); // Unload processed image once converted to texture // We got tempCharValues and tempCharsRecs populated with chars data // Now we move temp data to sized charValues and charRecs arrays - spriteFont.charRecs = (Rectangle *)malloc(spriteFont.numChars*sizeof(Rectangle)); - spriteFont.charValues = (int *)malloc(spriteFont.numChars*sizeof(int)); - spriteFont.charOffsets = (Vector2 *)malloc(spriteFont.numChars*sizeof(Vector2)); - spriteFont.charAdvanceX = (int *)malloc(spriteFont.numChars*sizeof(int)); + spriteFont.chars = (CharInfo *)malloc(spriteFont.charsCount*sizeof(CharInfo)); - for (int i = 0; i < spriteFont.numChars; i++) + for (int i = 0; i < spriteFont.charsCount; i++) { - spriteFont.charValues[i] = tempCharValues[i]; - spriteFont.charRecs[i] = tempCharRecs[i]; + spriteFont.chars[i].value = tempCharValues[i]; + spriteFont.chars[i].rec = tempCharRecs[i]; // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) - spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; - spriteFont.charAdvanceX[i] = 0; + spriteFont.chars[i].offsetX = 0; + spriteFont.chars[i].offsetY = 0; + spriteFont.chars[i].advanceX = 0; } - spriteFont.size = spriteFont.charRecs[0].height; + spriteFont.baseSize = spriteFont.chars[0].rec.height; TraceLog(INFO, "Image file loaded correctly as SpriteFont"); @@ -672,6 +689,8 @@ static SpriteFont LoadRBMF(const char *fileName) SpriteFont spriteFont = { 0 }; + // REMOVE SOON!!! +/* rbmfInfoHeader rbmfHeader; unsigned int *rbmfFileData = NULL; unsigned char *rbmfCharWidthData = NULL; @@ -737,29 +756,27 @@ static SpriteFont LoadRBMF(const char *fileName) //TraceLog(INFO, "[%s] Starting chars set reconstruction", fileName); // Get characters data using rbmfCharWidthData, rbmfHeader.charHeight, charsDivisor, rbmfHeader.numChars - spriteFont.charValues = (int *)malloc(spriteFont.numChars*sizeof(int)); - spriteFont.charRecs = (Rectangle *)malloc(spriteFont.numChars*sizeof(Rectangle)); - spriteFont.charOffsets = (Vector2 *)malloc(spriteFont.numChars*sizeof(Vector2)); - spriteFont.charAdvanceX = (int *)malloc(spriteFont.numChars*sizeof(int)); + spriteFont.chars = (CharInfo *)malloc(spriteFont.charsCount*sizeof(CharInfo)); int currentLine = 0; int currentPosX = charsDivisor; int testPosX = charsDivisor; - for (int i = 0; i < spriteFont.numChars; i++) + for (int i = 0; i < spriteFont.charsCount; i++) { - spriteFont.charValues[i] = (int)rbmfHeader.firstChar + i; + spriteFont.chars[i].value = (int)rbmfHeader.firstChar + i; - spriteFont.charRecs[i].x = currentPosX; - spriteFont.charRecs[i].y = charsDivisor + currentLine*((int)rbmfHeader.charHeight + charsDivisor); - spriteFont.charRecs[i].width = (int)rbmfCharWidthData[i]; - spriteFont.charRecs[i].height = (int)rbmfHeader.charHeight; + spriteFont.chars[i].rec.x = currentPosX; + spriteFont.chars[i].rec.y = charsDivisor + currentLine*((int)rbmfHeader.charHeight + charsDivisor); + spriteFont.chars[i].rec.width = (int)rbmfCharWidthData[i]; + spriteFont.chars[i].rec.height = (int)rbmfHeader.charHeight; // NOTE: On image based fonts (XNA style), character offsets and xAdvance are not required (set to 0) - spriteFont.charOffsets[i] = (Vector2){ 0.0f, 0.0f }; - spriteFont.charAdvanceX[i] = 0; + spriteFont.chars[i].offsetX = 0; + spriteFont.chars[i].offsetY = 0; + spriteFont.chars[i].advanceX = 0; - testPosX += (spriteFont.charRecs[i].width + charsDivisor); + testPosX += (spriteFont.chars[i].rec.width + charsDivisor); if (testPosX > spriteFont.texture.width) { @@ -767,13 +784,13 @@ static SpriteFont LoadRBMF(const char *fileName) currentPosX = 2*charsDivisor + (int)rbmfCharWidthData[i]; testPosX = currentPosX; - spriteFont.charRecs[i].x = charsDivisor; - spriteFont.charRecs[i].y = charsDivisor + currentLine*(rbmfHeader.charHeight + charsDivisor); + spriteFont.chars[i].rec.x = charsDivisor; + spriteFont.chars[i].rec.y = charsDivisor + currentLine*(rbmfHeader.charHeight + charsDivisor); } else currentPosX = testPosX; } - spriteFont.size = spriteFont.charRecs[0].height; + spriteFont.baseSize = spriteFont.charRecs[0].height; TraceLog(INFO, "[%s] rBMF file loaded correctly as SpriteFont", fileName); } @@ -782,6 +799,7 @@ static SpriteFont LoadRBMF(const char *fileName) free(rbmfFileData); // Now we can free loaded data from RAM memory free(rbmfCharWidthData); +*/ return spriteFont; } @@ -800,7 +818,7 @@ static SpriteFont LoadBMFont(const char *fileName) int fontSize = 0; int texWidth, texHeight; char texFileName[128]; - int numChars = 0; + int charsCount = 0; int base; // Useless data @@ -834,9 +852,9 @@ static SpriteFont LoadBMFont(const char *fileName) fgets(buffer, MAX_BUFFER_SIZE, fntFile); searchPoint = strstr(buffer, "count"); - sscanf(searchPoint, "count=%i", &numChars); + sscanf(searchPoint, "count=%i", &charsCount); - TraceLog(DEBUG, "[%s] Font num chars: %i", fileName, numChars); + TraceLog(DEBUG, "[%s] Font num chars: %i", fileName, charsCount); // Compose correct path using route of .fnt file (fileName) and texFileName char *texPath = NULL; @@ -868,12 +886,9 @@ static SpriteFont LoadBMFont(const char *fileName) } else font.texture = LoadTextureFromImage(imFont); - font.size = fontSize; - font.numChars = numChars; - font.charValues = (int *)malloc(numChars*sizeof(int)); - font.charRecs = (Rectangle *)malloc(numChars*sizeof(Rectangle)); - font.charOffsets = (Vector2 *)malloc(numChars*sizeof(Vector2)); - font.charAdvanceX = (int *)malloc(numChars*sizeof(int)); + font.baseSize = fontSize; + font.charsCount = charsCount; + font.chars = (CharInfo *)malloc(charsCount*sizeof(CharInfo)); UnloadImage(imFont); @@ -881,17 +896,18 @@ static SpriteFont LoadBMFont(const char *fileName) int charId, charX, charY, charWidth, charHeight, charOffsetX, charOffsetY, charAdvanceX; - for (int i = 0; i < numChars; i++) + for (int i = 0; i < charsCount; i++) { fgets(buffer, MAX_BUFFER_SIZE, fntFile); sscanf(buffer, "char id=%i x=%i y=%i width=%i height=%i xoffset=%i yoffset=%i xadvance=%i", &charId, &charX, &charY, &charWidth, &charHeight, &charOffsetX, &charOffsetY, &charAdvanceX); // Save data properly in sprite font - font.charValues[i] = charId; - font.charRecs[i] = (Rectangle){ charX, charY, charWidth, charHeight }; - font.charOffsets[i] = (Vector2){ (float)charOffsetX, (float)charOffsetY }; - font.charAdvanceX[i] = charAdvanceX; + font.chars[i].value = charId; + font.chars[i].rec = (Rectangle){ charX, charY, charWidth, charHeight }; + font.chars[i].offsetX = charOffsetX; + font.chars[i].offsetY = charOffsetY; + font.chars[i].advanceX = charAdvanceX; } fclose(fntFile); @@ -908,21 +924,21 @@ static SpriteFont LoadBMFont(const char *fileName) // Generate a sprite font from TTF file data (font size required) // TODO: Review texture packing method and generation (use oversampling) -static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int *fontChars) +static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, int *fontChars) { // NOTE: Font texture size is predicted (being as much conservative as possible) // Predictive method consist of supposing same number of chars by line-column (sqrtf) // and a maximum character width of 3/4 of fontSize... it worked ok with all my tests... // Calculate next power-of-two value - float guessSize = ceilf((float)fontSize*3/4)*ceilf(sqrtf((float)numChars)); + float guessSize = ceilf((float)fontSize*3/4)*ceilf(sqrtf((float)charsCount)); int textureSize = (int)powf(2, ceilf(logf((float)guessSize)/logf(2))); // Calculate next POT TraceLog(INFO, "TTF spritefont loading: Predicted texture size: %ix%i", textureSize, textureSize); unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); unsigned char *dataBitmap = (unsigned char *)malloc(textureSize*textureSize*sizeof(unsigned char)); // One channel bitmap returned! - stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*numChars); + stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*charsCount); SpriteFont font = { 0 }; @@ -941,7 +957,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int // NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image... // TODO: Replace this function by a proper packing method and support random chars order, // we already receive a list (fontChars) with the ordered expected characters - int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, fontChars[0], numChars, charData); + int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, fontChars[0], charsCount, charData); //if (result > 0) TraceLog(INFO, "TTF spritefont loading: first unused row of generated bitmap: %i", result); if (result < 0) TraceLog(WARNING, "TTF spritefont loading: Not all the characters fit in the font"); @@ -973,24 +989,22 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int numChars, int UnloadImage(image); // Unloads dataGrayAlpha - font.size = fontSize; - font.numChars = numChars; - font.charValues = (int *)malloc(font.numChars*sizeof(int)); - font.charRecs = (Rectangle *)malloc(font.numChars*sizeof(Rectangle)); - font.charOffsets = (Vector2 *)malloc(font.numChars*sizeof(Vector2)); - font.charAdvanceX = (int *)malloc(font.numChars*sizeof(int)); + font.baseSize = fontSize; + font.charsCount = charsCount; + font.chars = (CharInfo *)malloc(font.charsCount*sizeof(CharInfo)); - for (int i = 0; i < font.numChars; i++) + for (int i = 0; i < font.charsCount; i++) { - font.charValues[i] = fontChars[i]; + font.chars[i].value = fontChars[i]; - font.charRecs[i].x = (int)charData[i].x0; - font.charRecs[i].y = (int)charData[i].y0; - font.charRecs[i].width = (int)charData[i].x1 - (int)charData[i].x0; - font.charRecs[i].height = (int)charData[i].y1 - (int)charData[i].y0; + font.chars[i].rec.x = (int)charData[i].x0; + font.chars[i].rec.y = (int)charData[i].y0; + font.chars[i].rec.width = (int)charData[i].x1 - (int)charData[i].x0; + font.chars[i].rec.height = (int)charData[i].y1 - (int)charData[i].y0; - font.charOffsets[i] = (Vector2){ charData[i].xoff, charData[i].yoff }; - font.charAdvanceX[i] = (int)charData[i].xadvance; + font.chars[i].offsetX = charData[i].xoff; + font.chars[i].offsetY = charData[i].yoff; + font.chars[i].advanceX = (int)charData[i].xadvance; } free(charData); diff --git a/src/textures.c b/src/textures.c index 9d865aa1..ce978b6c 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1064,7 +1064,7 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing int length = strlen(text); int posX = 0; - Vector2 imSize = MeasureTextEx(font, text, font.size, spacing); + Vector2 imSize = MeasureTextEx(font, text, font.baseSize, spacing); // NOTE: GetTextureData() not available in OpenGL ES Image imFont = GetTextureData(font.texture); @@ -1080,7 +1080,7 @@ Image ImageTextEx(SpriteFont font, const char *text, float fontSize, int spacing for (int i = 0; i < length; i++) { - Rectangle letterRec = font.charRecs[(int)text[i] - 32]; + Rectangle letterRec = font.chars[(int)text[i] - 32].rec; for (int y = letterRec.y; y < (letterRec.y + letterRec.height); y++) { -- cgit v1.2.3 From c4bd214cf07c68476c4ce972766c24ee54a982f6 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Feb 2017 03:00:35 +0100 Subject: Added function SetWindowIcon() Only DESKTOP platforms (Windows, Linus, OSX) --- src/core.c | 21 ++++++++++++++++++++- src/raylib.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 4ce32a05..04dd0540 100644 --- a/src/core.c +++ b/src/core.c @@ -524,7 +524,7 @@ bool IsWindowMinimized(void) #endif } -// Fullscreen toggle +// Fullscreen toggle (only PLATFORM_DESKTOP) void ToggleFullscreen(void) { #if defined(PLATFORM_DESKTOP) @@ -540,6 +540,25 @@ void ToggleFullscreen(void) #endif } +// Set icon for window (only PLATFORM_DESKTOP) +void SetWindowIcon(Image image) +{ +#if defined(PLATFORM_DESKTOP) + ImageFormat(&image, UNCOMPRESSED_R8G8B8A8); + + GLFWimage icon[1]; + + icon[0].width = image.width; + icon[0].height = image.height; + icon[0].pixels = (unsigned char *)image.data; + + // NOTE: We only support one image icon + glfwSetWindowIcon(window, 1, icon); + + // TODO: Support multi-image icons --> image.mipmaps +#endif +} + // Get current screen width int GetScreenWidth(void) { diff --git a/src/raylib.h b/src/raylib.h index f5b908db..5a1304fc 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -638,6 +638,7 @@ RLAPI void CloseWindow(void); // Close Windo RLAPI bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed RLAPI bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) RLAPI void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP) +RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height -- cgit v1.2.3 From 7bf6a712ccb4abe059bcbb739664ac1cadcf0b22 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Feb 2017 03:15:43 +0100 Subject: Remove rlua from raylib main repo Moved to own repo at https://github.com/raysan5/raylib-lua --- src/rlua.h | 4333 ------------------------------------------------------------ 1 file changed, 4333 deletions(-) delete mode 100644 src/rlua.h (limited to 'src') diff --git a/src/rlua.h b/src/rlua.h deleted file mode 100644 index 80dede41..00000000 --- a/src/rlua.h +++ /dev/null @@ -1,4333 +0,0 @@ -/********************************************************************************************** -* -* rlua - raylib Lua bindings -* -* NOTE 01: -* The following types: -* Color, Vector2, Vector3, Rectangle, Ray, Camera, Camera2D -* are treated as objects with named fields, same as in C. -* -* Lua defines utility functions for creating those objects. -* Usage: -* local cl = Color(255,255,255,255) -* local rec = Rectangle(10, 10, 100, 100) -* local ray = Ray(Vector3(20, 20, 20), Vector3(50, 50, 50)) -* local x2 = rec.x + rec.width -* -* The following types: -* Image, Texture2D, RenderTexture2D, SpriteFont -* are immutable, and you can only read their non-pointer arguments (e.g. sprfnt.baseSize). -* -* All other object types are opaque, that is, you cannot access or -* change their fields directly. -* -* Remember that ALL raylib types have REFERENCE SEMANTICS in Lua. -* There is currently no way to create a copy of an opaque object. -* -* NOTE 02: -* Some raylib functions take a pointer to an array, and the size of that array. -* The equivalent Lua functions take only an array table of the specified type UNLESS -* it's a pointer to a large char array (e.g. for images), then it takes (and potentially returns) -* a Lua string (without the size argument, as Lua strings are sized by default). -* -* NOTE 03: -* Some raylib functions take pointers to objects to modify (e.g. ImageToPOT, etc.) -* In Lua, these functions take values and return a new changed value, instead. -* So, in C: -* ImageToPOT(&img, BLACK); -* In Lua becomes: -* img = ImageToPOT(img, BLACK) -* -* Remember that functions can return multiple values, so: -* UpdateCameraPlayer(&cam, &playerPos); -* Vector3 vec = ResolveCollisionCubicmap(img, mapPos, &playerPos, 5.0); -* becomes: -* cam, playerPos = UpdateCameraPlayer(cam, playerPos) -* vec, playerPos = ResolveCollisionCubicmap(img, mapPos, playerPos, 5) -* -* This is to preserve value semantics of raylib objects. -* -* -* This Lua binding for raylib was originally created by Ghassan Al-Mashareqa (ghassan@ghassan.pl) -* for raylib 1.3 and later on reviewed and updated to raylib 1.6 by Ramon Santamaria. -* -* Copyright (c) 2015-2016 Ghassan Al-Mashareqa and Ramon Santamaria (@raysan5) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -**********************************************************************************************/ - -#pragma once - -#include "raylib.h" - -#define RLUA_STATIC -#ifdef RLUA_STATIC - #define RLUADEF static // Functions just visible to module including this file -#else - #ifdef __cplusplus - #define RLUADEF extern "C" // Functions visible from other files (no name mangling of functions in C++) - #else - #define RLUADEF extern // Functions visible from other files - #endif -#endif - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -// ... - -//---------------------------------------------------------------------------------- -// Module Functions Declaration -//---------------------------------------------------------------------------------- -RLUADEF void InitLuaDevice(void); // Initialize Lua system -RLUADEF void ExecuteLuaCode(const char *code); // Execute raylib Lua code -RLUADEF void ExecuteLuaFile(const char *filename); // Execute raylib Lua script -RLUADEF void CloseLuaDevice(void); // De-initialize Lua system - -/*********************************************************************************** -* -* RLUA IMPLEMENTATION -* -************************************************************************************/ - -#if defined(RLUA_IMPLEMENTATION) - -#include "raylib.h" -#include "utils.h" -#include "raymath.h" - -#include -#include - -#include -#include -#include - -//---------------------------------------------------------------------------------- -// Defines and Macros -//---------------------------------------------------------------------------------- -#define LuaPush_Image(L, img) LuaPushOpaqueTypeWithMetatable(L, img, Image) -#define LuaPush_Texture2D(L, tex) LuaPushOpaqueTypeWithMetatable(L, tex, Texture2D) -#define LuaPush_RenderTexture2D(L, tex) LuaPushOpaqueTypeWithMetatable(L, tex, RenderTexture2D) -#define LuaPush_SpriteFont(L, sf) LuaPushOpaqueTypeWithMetatable(L, sf, SpriteFont) -#define LuaPush_Mesh(L, vd) LuaPushOpaqueType(L, vd) -#define LuaPush_Shader(L, s) LuaPushOpaqueType(L, s) -#define LuaPush_Light(L, light) LuaPushOpaqueTypeWithMetatable(L, light, Light) -#define LuaPush_Sound(L, snd) LuaPushOpaqueType(L, snd) -#define LuaPush_Wave(L, wav) LuaPushOpaqueType(L, wav) -#define LuaPush_Music(L, mus) LuaPushOpaqueType(L, mus) -#define LuaPush_AudioStream(L, aud) LuaPushOpaqueType(L, aud) - -#define LuaGetArgument_string luaL_checkstring -#define LuaGetArgument_ptr (void *)luaL_checkinteger -#define LuaGetArgument_int (int)luaL_checkinteger -#define LuaGetArgument_unsigned (unsigned)luaL_checkinteger -#define LuaGetArgument_char (char)luaL_checkinteger -#define LuaGetArgument_float (float)luaL_checknumber -#define LuaGetArgument_double luaL_checknumber - -#define LuaGetArgument_Image(L, img) *(Image*)LuaGetArgumentOpaqueTypeWithMetatable(L, img, "Image") -#define LuaGetArgument_Texture2D(L, tex) *(Texture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, tex, "Texture2D") -#define LuaGetArgument_RenderTexture2D(L, rtex) *(RenderTexture2D*)LuaGetArgumentOpaqueTypeWithMetatable(L, rtex, "RenderTexture2D") -#define LuaGetArgument_SpriteFont(L, sf) *(SpriteFont*)LuaGetArgumentOpaqueTypeWithMetatable(L, sf, "SpriteFont") -#define LuaGetArgument_Mesh(L, vd) *(Mesh*)LuaGetArgumentOpaqueType(L, vd) -#define LuaGetArgument_Shader(L, s) *(Shader*)LuaGetArgumentOpaqueType(L, s) -#define LuaGetArgument_Light(L, light) *(Light*)LuaGetArgumentOpaqueType(L, light) -#define LuaGetArgument_Sound(L, snd) *(Sound*)LuaGetArgumentOpaqueType(L, snd) -#define LuaGetArgument_Wave(L, wav) *(Wave*)LuaGetArgumentOpaqueType(L, wav) -#define LuaGetArgument_Music(L, mus) *(Music*)LuaGetArgumentOpaqueType(L, mus) -#define LuaGetArgument_AudioStream(L, aud) *(AudioStream*)LuaGetArgumentOpaqueType(L, aud) - -#define LuaPushOpaqueType(L, str) LuaPushOpaque(L, &str, sizeof(str)) -#define LuaPushOpaqueTypeWithMetatable(L, str, meta) LuaPushOpaqueWithMetatable(L, &str, sizeof(str), #meta) - -//---------------------------------------------------------------------------------- -// Global Variables Definition -//---------------------------------------------------------------------------------- -static lua_State* mainLuaState = 0; -static lua_State* L = 0; - -//---------------------------------------------------------------------------------- -// Module specific Functions Declaration -//---------------------------------------------------------------------------------- -static void LuaPush_Color(lua_State* L, Color color); -static void LuaPush_Vector2(lua_State* L, Vector2 vec); -static void LuaPush_Vector3(lua_State* L, Vector3 vec); -static void LuaPush_Quaternion(lua_State* L, Quaternion vec); -static void LuaPush_Matrix(lua_State* L, Matrix *matrix); -static void LuaPush_Rectangle(lua_State* L, Rectangle rect); -static void LuaPush_Model(lua_State* L, Model mdl); -static void LuaPush_Ray(lua_State* L, Ray ray); -static void LuaPush_Camera(lua_State* L, Camera cam); - -static Vector2 LuaGetArgument_Vector2(lua_State* L, int index); -static Vector3 LuaGetArgument_Vector3(lua_State* L, int index); -static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index); -static Color LuaGetArgument_Color(lua_State* L, int index); -static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index); -static Camera LuaGetArgument_Camera(lua_State* L, int index); -static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index); -static Ray LuaGetArgument_Ray(lua_State* L, int index); -static Matrix LuaGetArgument_Matrix(lua_State* L, int index); -static Model LuaGetArgument_Model(lua_State* L, int index); - -//---------------------------------------------------------------------------------- -// rlua Helper Functions -//---------------------------------------------------------------------------------- -static void LuaStartEnum(void) -{ - lua_newtable(L); -} - -static void LuaSetEnum(const char *name, int value) -{ - lua_pushinteger(L, value); - lua_setfield(L, -2, name); -} - -static void LuaSetEnumColor(const char *name, Color color) -{ - LuaPush_Color(L, color); - lua_setfield(L, -2, name); -} - -static void LuaEndEnum(const char *name) -{ - lua_setglobal(L, name); -} - -static void LuaPushOpaque(lua_State* L, void *ptr, size_t size) -{ - void *ud = lua_newuserdata(L, size); - memcpy(ud, ptr, size); -} - -static void LuaPushOpaqueWithMetatable(lua_State* L, void *ptr, size_t size, const char *metatable_name) -{ - void *ud = lua_newuserdata(L, size); - memcpy(ud, ptr, size); - luaL_setmetatable(L, metatable_name); -} - -static void* LuaGetArgumentOpaqueType(lua_State* L, int index) -{ - return lua_touserdata(L, index); -} - -static void* LuaGetArgumentOpaqueTypeWithMetatable(lua_State* L, int index, const char *metatable_name) -{ - return luaL_checkudata(L, index, metatable_name); -} - -//---------------------------------------------------------------------------------- -// LuaIndex* functions -//---------------------------------------------------------------------------------- -static int LuaIndexImage(lua_State* L) -{ - Image img = LuaGetArgument_Image(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "width")) - lua_pushinteger(L, img.width); - else if (!strcmp(key, "height")) - lua_pushinteger(L, img.height); - else if (!strcmp(key, "mipmaps")) - lua_pushinteger(L, img.mipmaps); - else if (!strcmp(key, "format")) - lua_pushinteger(L, img.format); - else - return 0; - return 1; -} - -static int LuaIndexTexture2D(lua_State* L) -{ - Texture2D img = LuaGetArgument_Texture2D(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "width")) - lua_pushinteger(L, img.width); - else if (!strcmp(key, "height")) - lua_pushinteger(L, img.height); - else if (!strcmp(key, "mipmaps")) - lua_pushinteger(L, img.mipmaps); - else if (!strcmp(key, "format")) - lua_pushinteger(L, img.format); - else if (!strcmp(key, "id")) - lua_pushinteger(L, img.id); - else - return 0; - return 1; -} - -static int LuaIndexRenderTexture2D(lua_State* L) -{ - RenderTexture2D img = LuaGetArgument_RenderTexture2D(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "texture")) - LuaPush_Texture2D(L, img.texture); - else if (!strcmp(key, "depth")) - LuaPush_Texture2D(L, img.depth); - else - return 0; - return 1; -} - -static int LuaIndexSpriteFont(lua_State* L) -{ - SpriteFont img = LuaGetArgument_SpriteFont(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "size")) - lua_pushinteger(L, img.size); - else if (!strcmp(key, "texture")) - LuaPush_Texture2D(L, img.texture); - else if (!strcmp(key, "charsCount")) - lua_pushinteger(L, img.charsCount); - else - return 0; - return 1; -} - -static int LuaIndexLight(lua_State* L) -{ - Light light = LuaGetArgument_Light(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "id")) - lua_pushinteger(L, light->id); - else if (!strcmp(key, "enabled")) - lua_pushboolean(L, light->enabled); - else if (!strcmp(key, "type")) - lua_pushinteger(L, light->type); - else if (!strcmp(key, "position")) - LuaPush_Vector3(L, light->position); - else if (!strcmp(key, "target")) - LuaPush_Vector3(L, light->target); - else if (!strcmp(key, "radius")) - lua_pushnumber(L, light->radius); - else if (!strcmp(key, "diffuse")) - LuaPush_Color(L, light->diffuse); - else if (!strcmp(key, "intensity")) - lua_pushnumber(L, light->intensity); - else if (!strcmp(key, "coneAngle")) - lua_pushnumber(L, light->coneAngle); - else - return 0; - return 1; -} - -static int LuaNewIndexLight(lua_State* L) -{ - Light light = LuaGetArgument_Light(L, 1); - const char *key = luaL_checkstring(L, 2); - if (!strcmp(key, "id")) - light->id = LuaGetArgument_int(L, 3); - else if (!strcmp(key, "enabled")) - light->enabled = lua_toboolean(L, 3); - else if (!strcmp(key, "type")) - light->type = LuaGetArgument_int(L, 3); - else if (!strcmp(key, "position")) - light->position = LuaGetArgument_Vector3(L, 3); - else if (!strcmp(key, "target")) - light->target = LuaGetArgument_Vector3(L, 3); - else if (!strcmp(key, "radius")) - light->radius = LuaGetArgument_float(L, 3); - else if (!strcmp(key, "diffuse")) - light->diffuse = LuaGetArgument_Color(L, 3); - else if (!strcmp(key, "intensity")) - light->intensity = LuaGetArgument_float(L, 3); - else if (!strcmp(key, "coneAngle")) - light->coneAngle = LuaGetArgument_float(L, 3); - return 0; -} - -static void LuaBuildOpaqueMetatables(void) -{ - luaL_newmetatable(L, "Image"); - lua_pushcfunction(L, &LuaIndexImage); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); - - luaL_newmetatable(L, "Texture2D"); - lua_pushcfunction(L, &LuaIndexTexture2D); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); - - luaL_newmetatable(L, "RenderTexture2D"); - lua_pushcfunction(L, &LuaIndexRenderTexture2D); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); - - luaL_newmetatable(L, "SpriteFont"); - lua_pushcfunction(L, &LuaIndexSpriteFont); - lua_setfield(L, -2, "__index"); - lua_pop(L, 1); - - luaL_newmetatable(L, "Light"); - lua_pushcfunction(L, &LuaIndexLight); - lua_setfield(L, -2, "__index"); - lua_pushcfunction(L, &LuaNewIndexLight); - lua_setfield(L, -2, "__newindex"); - lua_pop(L, 1); -} - -//---------------------------------------------------------------------------------- -// LuaGetArgument functions -//---------------------------------------------------------------------------------- - -static Vector2 LuaGetArgument_Vector2(lua_State* L, int index) -{ - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector2"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector2"); - float y = (float)lua_tonumber(L, -1); - lua_pop(L, 2); - return (Vector2) { x, y }; -} - -static Vector3 LuaGetArgument_Vector3(lua_State* L, int index) -{ - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Vector3"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Vector3"); - float y = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Vector3"); - float z = (float)lua_tonumber(L, -1); - lua_pop(L, 3); - return (Vector3) { x, y, z }; -} - -static Quaternion LuaGetArgument_Quaternion(lua_State* L, int index) -{ - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Quaternion"); - float x = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Quaternion"); - float y = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "z") == LUA_TNUMBER, index, "Expected Quaternion"); - float z = (float)lua_tonumber(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "w") == LUA_TNUMBER, index, "Expected Quaternion"); - float w = (float)lua_tonumber(L, -1); - lua_pop(L, 4); - return (Quaternion) { x, y, z, w }; -} - -static Color LuaGetArgument_Color(lua_State* L, int index) -{ - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "r") == LUA_TNUMBER, index, "Expected Color"); - unsigned char r = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "g") == LUA_TNUMBER, index, "Expected Color"); - unsigned char g = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "b") == LUA_TNUMBER, index, "Expected Color"); - unsigned char b = (unsigned char)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "a") == LUA_TNUMBER, index, "Expected Color"); - unsigned char a = (unsigned char)lua_tointeger(L, -1); - lua_pop(L, 4); - return (Color) { r, g, b, a }; -} - -static Rectangle LuaGetArgument_Rectangle(lua_State* L, int index) -{ - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "x") == LUA_TNUMBER, index, "Expected Rectangle"); - int x = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "y") == LUA_TNUMBER, index, "Expected Rectangle"); - int y = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "width") == LUA_TNUMBER, index, "Expected Rectangle"); - int w = (int)lua_tointeger(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "height") == LUA_TNUMBER, index, "Expected Rectangle"); - int h = (int)lua_tointeger(L, -1); - lua_pop(L, 4); - return (Rectangle) { x, y, w, h }; -} - -static Camera LuaGetArgument_Camera(lua_State* L, int index) -{ - Camera result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Camera"); - result.position = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera"); - result.target = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "up") == LUA_TTABLE, index, "Expected Camera"); - result.up = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "fovy") == LUA_TNUMBER, index, "Expected Camera"); - result.fovy = LuaGetArgument_float(L, -1); - lua_pop(L, 4); - return result; -} - -static Camera2D LuaGetArgument_Camera2D(lua_State* L, int index) -{ - Camera2D result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "offset") == LUA_TTABLE, index, "Expected Camera2D"); - result.offset = LuaGetArgument_Vector2(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "target") == LUA_TTABLE, index, "Expected Camera2D"); - result.target = LuaGetArgument_Vector2(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "rotation") == LUA_TNUMBER, index, "Expected Camera2D"); - result.rotation = LuaGetArgument_float(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "zoom") == LUA_TNUMBER, index, "Expected Camera2D"); - result.zoom = LuaGetArgument_float(L, -1); - lua_pop(L, 4); - return result; -} - -static BoundingBox LuaGetArgument_BoundingBox(lua_State* L, int index) -{ - BoundingBox result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "min") == LUA_TTABLE, index, "Expected BoundingBox"); - result.min = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "max") == LUA_TTABLE, index, "Expected BoundingBox"); - result.max = LuaGetArgument_Vector3(L, -1); - lua_pop(L, 2); - return result; -} - -static Ray LuaGetArgument_Ray(lua_State* L, int index) -{ - Ray result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "position") == LUA_TTABLE, index, "Expected Ray"); - result.position = LuaGetArgument_Vector3(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "direction") == LUA_TTABLE, index, "Expected Ray"); - result.direction = LuaGetArgument_Vector3(L, -1); - lua_pop(L, 2); - return result; -} - -static Matrix LuaGetArgument_Matrix(lua_State* L, int index) -{ - Matrix result = { 0 }; - float* ptr = &result.m0; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - - for (int i = 0; i < 16; i++) - { - lua_geti(L, index, i+1); - ptr[i] = luaL_checknumber(L, -1); - } - lua_pop(L, 16); - return result; -} - -static Material LuaGetArgument_Material(lua_State* L, int index) -{ - Material result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "shader") == LUA_TUSERDATA, index, "Expected Material"); - result.shader = LuaGetArgument_Shader(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "texDiffuse") == LUA_TUSERDATA, index, "Expected Material"); - result.texDiffuse = LuaGetArgument_Texture2D(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "texNormal") == LUA_TUSERDATA, index, "Expected Material"); - result.texNormal = LuaGetArgument_Texture2D(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "texSpecular") == LUA_TUSERDATA, index, "Expected Material"); - result.texSpecular = LuaGetArgument_Texture2D(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colDiffuse") == LUA_TTABLE, index, "Expected Material"); - result.colDiffuse = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colAmbient") == LUA_TTABLE, index, "Expected Material"); - result.colAmbient = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "colSpecular") == LUA_TTABLE, index, "Expected Material"); - result.colSpecular = LuaGetArgument_Color(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "glossiness") == LUA_TNUMBER, index, "Expected Material"); - result.glossiness = LuaGetArgument_float(L, -1); - lua_pop(L, 8); - return result; -} - -static Model LuaGetArgument_Model(lua_State* L, int index) -{ - Model result; - index = lua_absindex(L, index); // Makes sure we use absolute indices because we push multiple values - luaL_argcheck(L, lua_getfield(L, index, "mesh") == LUA_TUSERDATA, index, "Expected Model"); - result.mesh = LuaGetArgument_Mesh(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "transform") == LUA_TTABLE, index, "Expected Model"); - result.transform = LuaGetArgument_Matrix(L, -1); - luaL_argcheck(L, lua_getfield(L, index, "material") == LUA_TTABLE, index, "Expected Model"); - result.material = LuaGetArgument_Material(L, -1); - lua_pop(L, 3); - return result; -} - -//---------------------------------------------------------------------------------- -// LuaPush functions -//---------------------------------------------------------------------------------- -static void LuaPush_Color(lua_State* L, Color color) -{ - lua_createtable(L, 0, 4); - lua_pushinteger(L, color.r); - lua_setfield(L, -2, "r"); - lua_pushinteger(L, color.g); - lua_setfield(L, -2, "g"); - lua_pushinteger(L, color.b); - lua_setfield(L, -2, "b"); - lua_pushinteger(L, color.a); - lua_setfield(L, -2, "a"); -} - -static void LuaPush_Vector2(lua_State* L, Vector2 vec) -{ - lua_createtable(L, 0, 2); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); -} - -static void LuaPush_Vector3(lua_State* L, Vector3 vec) -{ - lua_createtable(L, 0, 3); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); - lua_pushnumber(L, vec.z); - lua_setfield(L, -2, "z"); -} - -static void LuaPush_Quaternion(lua_State* L, Quaternion vec) -{ - lua_createtable(L, 0, 4); - lua_pushnumber(L, vec.x); - lua_setfield(L, -2, "x"); - lua_pushnumber(L, vec.y); - lua_setfield(L, -2, "y"); - lua_pushnumber(L, vec.z); - lua_setfield(L, -2, "z"); - lua_pushnumber(L, vec.w); - lua_setfield(L, -2, "w"); -} - -static void LuaPush_Matrix(lua_State* L, Matrix *matrix) -{ - int i; - lua_createtable(L, 16, 0); - float* num = (&matrix->m0); - for (i = 0; i < 16; i++) - { - lua_pushnumber(L, num[i]); - lua_rawseti(L, -2, i + 1); - } -} - -static void LuaPush_Rectangle(lua_State* L, Rectangle rect) -{ - lua_createtable(L, 0, 4); - lua_pushinteger(L, rect.x); - lua_setfield(L, -2, "x"); - lua_pushinteger(L, rect.y); - lua_setfield(L, -2, "y"); - lua_pushinteger(L, rect.width); - lua_setfield(L, -2, "width"); - lua_pushinteger(L, rect.height); - lua_setfield(L, -2, "height"); -} - -static void LuaPush_Ray(lua_State* L, Ray ray) -{ - lua_createtable(L, 0, 2); - LuaPush_Vector3(L, ray.position); - lua_setfield(L, -2, "position"); - LuaPush_Vector3(L, ray.direction); - lua_setfield(L, -2, "direction"); -} - -static void LuaPush_BoundingBox(lua_State* L, BoundingBox bb) -{ - lua_createtable(L, 0, 2); - LuaPush_Vector3(L, bb.min); - lua_setfield(L, -2, "min"); - LuaPush_Vector3(L, bb.max); - lua_setfield(L, -2, "max"); -} - -static void LuaPush_Camera(lua_State* L, Camera cam) -{ - lua_createtable(L, 0, 4); - LuaPush_Vector3(L, cam.position); - lua_setfield(L, -2, "position"); - LuaPush_Vector3(L, cam.target); - lua_setfield(L, -2, "target"); - LuaPush_Vector3(L, cam.up); - lua_setfield(L, -2, "up"); - lua_pushnumber(L, cam.fovy); - lua_setfield(L, -2, "fovy"); -} - -static void LuaPush_Camera2D(lua_State* L, Camera2D cam) -{ - lua_createtable(L, 0, 4); - LuaPush_Vector2(L, cam.offset); - lua_setfield(L, -2, "offset"); - LuaPush_Vector2(L, cam.target); - lua_setfield(L, -2, "target"); - lua_pushnumber(L, cam.rotation); - lua_setfield(L, -2, "rotation"); - lua_pushnumber(L, cam.zoom); - lua_setfield(L, -2, "zoom"); -} - -static void LuaPush_Material(lua_State* L, Material mat) -{ - lua_createtable(L, 0, 8); - LuaPush_Shader(L, mat.shader); - lua_setfield(L, -2, "shader"); - LuaPush_Texture2D(L, mat.texDiffuse); - lua_setfield(L, -2, "texDiffuse"); - LuaPush_Texture2D(L, mat.texNormal); - lua_setfield(L, -2, "texNormal"); - LuaPush_Texture2D(L, mat.texSpecular); - lua_setfield(L, -2, "texSpecular"); - LuaPush_Color(L, mat.colDiffuse); - lua_setfield(L, -2, "colDiffuse"); - LuaPush_Color(L, mat.colAmbient); - lua_setfield(L, -2, "colAmbient"); - LuaPush_Color(L, mat.colSpecular); - lua_setfield(L, -2, "colSpecular"); - lua_pushnumber(L, mat.glossiness); - lua_setfield(L, -2, "glossiness"); -} - -static void LuaPush_Model(lua_State* L, Model mdl) -{ - lua_createtable(L, 0, 4); - LuaPush_Mesh(L, mdl.mesh); - lua_setfield(L, -2, "mesh"); - LuaPush_Matrix(L, &mdl.transform); - lua_setfield(L, -2, "transform"); - LuaPush_Material(L, mdl.material); - lua_setfield(L, -2, "material"); -} - -//---------------------------------------------------------------------------------- -// raylib Lua Structure constructors -//---------------------------------------------------------------------------------- -static int lua_Color(lua_State* L) -{ - LuaPush_Color(L, (Color) { (unsigned char)luaL_checkinteger(L, 1), (unsigned char)luaL_checkinteger(L, 2), (unsigned char)luaL_checkinteger(L, 3), (unsigned char)luaL_checkinteger(L, 4) }); - return 1; -} - -static int lua_Vector2(lua_State* L) -{ - LuaPush_Vector2(L, (Vector2) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2) }); - return 1; -} - -static int lua_Vector3(lua_State* L) -{ - LuaPush_Vector3(L, (Vector3) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3) }); - return 1; -} - -static int lua_Quaternion(lua_State* L) -{ - LuaPush_Quaternion(L, (Quaternion) { (float)luaL_checknumber(L, 1), (float)luaL_checknumber(L, 2), (float)luaL_checknumber(L, 3), (float)luaL_checknumber(L, 4) }); - return 1; -} - -static int lua_Rectangle(lua_State* L) -{ - LuaPush_Rectangle(L, (Rectangle) { (int)luaL_checkinteger(L, 1), (int)luaL_checkinteger(L, 2), (int)luaL_checkinteger(L, 3), (int)luaL_checkinteger(L, 4) }); - return 1; -} - -static int lua_Ray(lua_State* L) -{ - Vector2 pos = LuaGetArgument_Vector2(L, 1); - Vector2 dir = LuaGetArgument_Vector2(L, 2); - LuaPush_Ray(L, (Ray) { { pos.x, pos.y }, { dir.x, dir.y } }); - return 1; -} - -static int lua_BoundingBox(lua_State* L) -{ - Vector3 min = LuaGetArgument_Vector3(L, 1); - Vector3 max = LuaGetArgument_Vector3(L, 2); - LuaPush_BoundingBox(L, (BoundingBox) { { min.x, min.y, min.z }, { max.x, max.y, max.z } }); - return 1; -} - -static int lua_Camera(lua_State* L) -{ - Vector3 pos = LuaGetArgument_Vector3(L, 1); - Vector3 tar = LuaGetArgument_Vector3(L, 2); - Vector3 up = LuaGetArgument_Vector3(L, 3); - float fovy = LuaGetArgument_float(L, 4); - LuaPush_Camera(L, (Camera) { { pos.x, pos.y, pos.z }, { tar.x, tar.y, tar.z }, { up.x, up.y, up.z }, fovy }); - return 1; -} - -static int lua_Camera2D(lua_State* L) -{ - Vector2 off = LuaGetArgument_Vector2(L, 1); - Vector2 tar = LuaGetArgument_Vector2(L, 2); - float rot = LuaGetArgument_float(L, 3); - float zoom = LuaGetArgument_float(L, 4); - LuaPush_Camera2D(L, (Camera2D) { { off.x, off.y }, { tar.x, tar.y }, rot, zoom }); - return 1; -} - -/************************************************************************************* -* raylib Lua Functions Bindings -**************************************************************************************/ - -//------------------------------------------------------------------------------------ -// raylib [core] module functions - Window and Graphics Device -//------------------------------------------------------------------------------------ -int lua_InitWindow(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - const char * arg3 = LuaGetArgument_string(L, 3); - InitWindow(arg1, arg2, arg3); - return 0; -} - -int lua_CloseWindow(lua_State* L) -{ - CloseWindow(); - return 0; -} - -int lua_WindowShouldClose(lua_State* L) -{ - bool result = WindowShouldClose(); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsWindowMinimized(lua_State* L) -{ - bool result = IsWindowMinimized(); - lua_pushboolean(L, result); - return 1; -} - -int lua_ToggleFullscreen(lua_State* L) -{ - ToggleFullscreen(); - return 0; -} - -int lua_GetScreenWidth(lua_State* L) -{ - int result = GetScreenWidth(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetScreenHeight(lua_State* L) -{ - int result = GetScreenHeight(); - lua_pushinteger(L, result); - return 1; -} - -int lua_ShowCursor(lua_State* L) -{ - ShowCursor(); - return 0; -} - -int lua_HideCursor(lua_State* L) -{ - HideCursor(); - return 0; -} - -int lua_IsCursorHidden(lua_State* L) -{ - bool result = IsCursorHidden(); - lua_pushboolean(L, result); - return 1; -} - -int lua_EnableCursor(lua_State* L) -{ - EnableCursor(); - return 0; -} - -int lua_DisableCursor(lua_State* L) -{ - DisableCursor(); - return 0; -} - -int lua_ClearBackground(lua_State* L) -{ - Color arg1 = LuaGetArgument_Color(L, 1); - ClearBackground(arg1); - return 0; -} - -int lua_BeginDrawing(lua_State* L) -{ - BeginDrawing(); - return 0; -} - -int lua_EndDrawing(lua_State* L) -{ - EndDrawing(); - return 0; -} - -int lua_Begin2dMode(lua_State* L) -{ - Camera2D arg1 = LuaGetArgument_Camera2D(L, 1); - Begin2dMode(arg1); - return 0; -} - -int lua_End2dMode(lua_State* L) -{ - End2dMode(); - return 0; -} - -int lua_Begin3dMode(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - Begin3dMode(arg1); - return 0; -} - -int lua_End3dMode(lua_State* L) -{ - End3dMode(); - return 0; -} - -int lua_BeginTextureMode(lua_State* L) -{ - RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); - BeginTextureMode(arg1); - return 0; -} - -int lua_EndTextureMode(lua_State* L) -{ - EndTextureMode(); - return 0; -} - -int lua_GetMouseRay(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Camera arg2 = LuaGetArgument_Camera(L, 2); - Ray result = GetMouseRay(arg1, arg2); - LuaPush_Ray(L, result); - return 1; -} - -int lua_GetWorldToScreen(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Camera arg2 = LuaGetArgument_Camera(L, 2); - Vector2 result = GetWorldToScreen(arg1, arg2); - LuaPush_Vector2(L, result); - return 1; -} - -int lua_GetCameraMatrix(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - Matrix result = GetCameraMatrix(arg1); - LuaPush_Matrix(L, &result); - return 1; -} - -#if defined(PLATFORM_WEB) - -static int LuaDrawLoopFunc; - -static void LuaDrawLoop() -{ - lua_rawgeti(L, LUA_REGISTRYINDEX, LuaDrawLoopFunc); - lua_call(L, 0, 0); -} - -int lua_SetDrawingLoop(lua_State* L) -{ - luaL_argcheck(L, lua_isfunction(L, 1), 1, "Loop function expected"); - lua_pushvalue(L, 1); - LuaDrawLoopFunc = luaL_ref(L, LUA_REGISTRYINDEX); - SetDrawingLoop(&LuaDrawLoop); - return 0; -} - -#else - -int lua_SetTargetFPS(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - SetTargetFPS(arg1); - return 0; -} -#endif - -int lua_GetFPS(lua_State* L) -{ - float result = GetFPS(); - lua_pushnumber(L, result); - return 1; -} - -int lua_GetFrameTime(lua_State* L) -{ - float result = GetFrameTime(); - lua_pushnumber(L, result); - return 1; -} - -int lua_GetColor(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - Color result = GetColor(arg1); - LuaPush_Color(L, result); - return 1; -} - -int lua_GetHexValue(lua_State* L) -{ - Color arg1 = LuaGetArgument_Color(L, 1); - int result = GetHexValue(arg1); - lua_pushinteger(L, result); - return 1; -} - -int lua_ColorToFloat(lua_State* L) -{ - Color arg1 = LuaGetArgument_Color(L, 1); - float * result = ColorToFloat(arg1); - lua_createtable(L, 4, 0); - for (int i = 0; i < 4; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; -} - -int lua_VectorToFloat(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float * result = VectorToFloat(arg1); - lua_createtable(L, 3, 0); - for (int i = 0; i < 3; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; -} - -int lua_MatrixToFloat(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float * result = MatrixToFloat(arg1); - lua_createtable(L, 16, 0); - for (int i = 0; i < 16; i++) - { - lua_pushnumber(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; -} - -int lua_GetRandomValue(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int result = GetRandomValue(arg1, arg2); - lua_pushinteger(L, result); - return 1; -} - -int lua_Fade(lua_State* L) -{ - Color arg1 = LuaGetArgument_Color(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color result = Fade(arg1, arg2); - LuaPush_Color(L, result); - return 1; -} - -int lua_SetConfigFlags(lua_State* L) -{ - char arg1 = LuaGetArgument_char(L, 1); - SetConfigFlags(arg1); - return 0; -} - -int lua_ShowLogo(lua_State* L) -{ - ShowLogo(); - return 0; -} - -int lua_IsFileDropped(lua_State* L) -{ - bool result = IsFileDropped(); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetDroppedFiles(lua_State* L) -{ - int count = 0; - char ** result = GetDroppedFiles(&count); - lua_createtable(L, count, 0); - for (int i = 0; i < count; i++) - { - lua_pushstring(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - return 1; -} - -int lua_ClearDroppedFiles(lua_State* L) -{ - ClearDroppedFiles(); - return 0; -} - -int lua_StorageSaveValue(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - StorageSaveValue(arg1, arg2); - return 0; -} - -int lua_StorageLoadValue(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int result = StorageLoadValue(arg1); - lua_pushinteger(L, result); - return 1; -} - -//------------------------------------------------------------------------------------ -// raylib [core] module functions - Input Handling -//------------------------------------------------------------------------------------ -int lua_IsKeyPressed(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyPressed(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsKeyDown(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyDown(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsKeyReleased(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyReleased(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsKeyUp(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsKeyUp(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetKeyPressed(lua_State* L) -{ - int result = GetKeyPressed(); - lua_pushinteger(L, result); - return 1; -} - -int lua_SetExitKey(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - SetExitKey(arg1); - return 0; -} - -int lua_IsGamepadAvailable(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsGamepadAvailable(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsGamepadName(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - bool result = IsGamepadName(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetGamepadName(lua_State* L) -{ - // TODO: Return gamepad name id - - int arg1 = LuaGetArgument_int(L, 1); - const char * result = GetGamepadName(arg1); - //lua_pushboolean(L, result); - return 1; -} - -int lua_IsGamepadButtonPressed(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonPressed(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsGamepadButtonDown(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonDown(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsGamepadButtonReleased(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonReleased(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsGamepadButtonUp(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - bool result = IsGamepadButtonUp(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetGamepadButtonPressed(lua_State* L) -{ - int result = GetGamepadButtonPressed(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetGamepadAxisCount(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int result = GetGamepadAxisCount(arg1); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetGamepadAxisMovement(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float result = GetGamepadAxisMovement(arg1, arg2); - lua_pushnumber(L, result); - return 1; -} - -int lua_IsMouseButtonPressed(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonPressed(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsMouseButtonDown(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonDown(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsMouseButtonReleased(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonReleased(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsMouseButtonUp(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsMouseButtonUp(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetMouseX(lua_State* L) -{ - int result = GetMouseX(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetMouseY(lua_State* L) -{ - int result = GetMouseY(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetMousePosition(lua_State* L) -{ - Vector2 result = GetMousePosition(); - LuaPush_Vector2(L, result); - return 1; -} - -int lua_SetMousePosition(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - SetMousePosition(arg1); - return 0; -} - -int lua_GetMouseWheelMove(lua_State* L) -{ - int result = GetMouseWheelMove(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetTouchX(lua_State* L) -{ - int result = GetTouchX(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetTouchY(lua_State* L) -{ - int result = GetTouchY(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetTouchPosition(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - Vector2 result = GetTouchPosition(arg1); - LuaPush_Vector2(L, result); - return 1; -} - - -#if defined(PLATFORM_ANDROID) -int lua_IsButtonPressed(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonPressed(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsButtonDown(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonDown(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsButtonReleased(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsButtonReleased(arg1); - lua_pushboolean(L, result); - return 1; -} -#endif - -//------------------------------------------------------------------------------------ -// raylib [gestures] module functions - Gestures and Touch Handling -//------------------------------------------------------------------------------------ -int lua_SetGesturesEnabled(lua_State* L) -{ - unsigned arg1 = LuaGetArgument_unsigned(L, 1); - SetGesturesEnabled(arg1); - return 0; -} - -int lua_IsGestureDetected(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - bool result = IsGestureDetected(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetTouchPointsCount(lua_State* L) -{ - int result = GetTouchPointsCount(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetGestureDetected(lua_State* L) -{ - int result = GetGestureDetected(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetGestureHoldDuration(lua_State* L) -{ - int result = GetGestureHoldDuration(); - lua_pushinteger(L, result); - return 1; -} - -int lua_GetGestureDragVector(lua_State* L) -{ - Vector2 result = GetGestureDragVector(); - LuaPush_Vector2(L, result); - return 1; -} - -int lua_GetGestureDragAngle(lua_State* L) -{ - float result = GetGestureDragAngle(); - lua_pushnumber(L, result); - return 1; -} - -int lua_GetGesturePinchVector(lua_State* L) -{ - Vector2 result = GetGesturePinchVector(); - LuaPush_Vector2(L, result); - return 1; -} - -int lua_GetGesturePinchAngle(lua_State* L) -{ - float result = GetGesturePinchAngle(); - lua_pushnumber(L, result); - return 1; -} - -//------------------------------------------------------------------------------------ -// raylib [camera] module functions - Camera System -//------------------------------------------------------------------------------------ -int lua_SetCameraMode(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - SetCameraMode(arg1, arg2); - return 0; -} - -int lua_UpdateCamera(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - UpdateCamera(&arg1); - LuaPush_Camera(L, arg1); - return 1; -} - -int lua_SetCameraPanControl(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - SetCameraPanControl(arg1); - return 0; -} - -int lua_SetCameraAltControl(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - SetCameraAltControl(arg1); - return 0; -} - -int lua_SetCameraSmoothZoomControl(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - SetCameraSmoothZoomControl(arg1); - return 0; -} - -int lua_SetCameraMoveControls(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - int arg6 = LuaGetArgument_int(L, 6); - SetCameraMoveControls(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -//------------------------------------------------------------------------------------ -// raylib [shapes] module functions - Basic Shapes Drawing -//------------------------------------------------------------------------------------ -int lua_DrawPixel(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawPixel(arg1, arg2, arg3); - return 0; -} - -int lua_DrawPixelV(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPixelV(arg1, arg2); - return 0; -} - -int lua_DrawLine(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawLine(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawLineV(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawLineV(arg1, arg2, arg3); - return 0; -} - -int lua_DrawCircle(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawCircle(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawCircleGradient(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCircleGradient(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawCircleV(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawCircleV(arg1, arg2, arg3); - return 0; -} - -int lua_DrawCircleLines(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawCircleLines(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawRectangle(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawRectangle(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawRectangleRec(lua_State* L) -{ - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawRectangleRec(arg1, arg2); - return 0; -} - -int lua_DrawRectangleGradient(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawRectangleGradient(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawRectangleV(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawRectangleV(arg1, arg2, arg3); - return 0; -} - -int lua_DrawRectangleLines(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawRectangleLines(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawTriangle(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTriangle(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawTriangleLines(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTriangleLines(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawPoly(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawPoly(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -#define GET_TABLE(type, name, index) \ - type* name = 0; \ - size_t name##_size = 0; \ - { \ - size_t sz = 0; \ - luaL_checktype(L, index, LUA_TTABLE); \ - lua_pushnil(L); \ - while (lua_next(L, index)) { \ - LuaGetArgument_##type(L, -1); \ - sz++; \ - lua_pop(L, 1); \ - } \ - name = calloc(sz, sizeof(type)); \ - sz = 0; \ - lua_pushnil(L); \ - while (lua_next(L, index)) { \ - name[sz] = LuaGetArgument_##type(L, -1); \ - sz++; \ - lua_pop(L, 1); \ - } \ - lua_pop(L, 1); \ - name##_size = sz; \ - } - - -int lua_DrawPolyEx(lua_State* L) -{ - GET_TABLE(Vector2, arg1, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPolyEx(arg1, arg1_size, arg2); - free(arg1); - return 0; -} - -int lua_DrawPolyExLines(lua_State* L) -{ - GET_TABLE(Vector2, arg1, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawPolyExLines(arg1, arg1_size, arg2); - free(arg1); - return 0; -} - -int lua_CheckCollisionRecs(lua_State* L) -{ - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - bool result = CheckCollisionRecs(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionCircles(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - bool result = CheckCollisionCircles(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionCircleRec(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - bool result = CheckCollisionCircleRec(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; -} - -int lua_GetCollisionRec(lua_State* L) -{ - Rectangle arg1 = LuaGetArgument_Rectangle(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Rectangle result = GetCollisionRec(arg1, arg2); - LuaPush_Rectangle(L, result); - return 1; -} - -int lua_CheckCollisionPointRec(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - bool result = CheckCollisionPointRec(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionPointCircle(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionPointCircle(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionPointTriangle(lua_State* L) -{ - Vector2 arg1 = LuaGetArgument_Vector2(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Vector2 arg4 = LuaGetArgument_Vector2(L, 4); - bool result = CheckCollisionPointTriangle(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; -} - -//------------------------------------------------------------------------------------ -// raylib [textures] module functions - Texture Loading and Drawing -//------------------------------------------------------------------------------------ -int lua_LoadImage(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Image result = LoadImage(arg1); - LuaPush_Image(L, result); - return 1; -} - -int lua_LoadImageEx(lua_State* L) -{ - // TODO: Image LoadImageEx(Color *pixels, int width, int height); - - GET_TABLE(Color, arg1, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - Image result = LoadImageEx(arg1, arg2, arg3); // ISSUE: #3 number expected, got no value - LuaPush_Image(L, result); - free(arg1); - return 1; -} - -int lua_LoadImageRaw(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Image result = LoadImageRaw(arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, result); - return 1; -} - -int lua_LoadImageFromRES(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Image result = LoadImageFromRES(arg1, arg2); - LuaPush_Image(L, result); - return 1; -} - -int lua_LoadTexture(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Texture2D result = LoadTexture(arg1); - LuaPush_Texture2D(L, result); - return 1; -} - -int lua_LoadTextureEx(lua_State* L) -{ - void * arg1 = (char *)LuaGetArgument_string(L, 1); // NOTE: getting argument as string? - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Texture2D result = LoadTextureEx(arg1, arg2, arg3, arg4); - LuaPush_Texture2D(L, result); - return 1; -} - -int lua_LoadTextureFromRES(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Texture2D result = LoadTextureFromRES(arg1, arg2); - LuaPush_Texture2D(L, result); - return 1; -} - -int lua_LoadTextureFromImage(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Texture2D result = LoadTextureFromImage(arg1); - LuaPush_Texture2D(L, result); - return 1; -} - -int lua_LoadRenderTexture(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - RenderTexture2D result = LoadRenderTexture(arg1, arg2); - LuaPush_RenderTexture2D(L, result); - return 1; -} - -int lua_UnloadImage(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - UnloadImage(arg1); - return 0; -} - -int lua_UnloadTexture(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - UnloadTexture(arg1); - return 0; -} - -int lua_UnloadRenderTexture(lua_State* L) -{ - RenderTexture2D arg1 = LuaGetArgument_RenderTexture2D(L, 1); - UnloadRenderTexture(arg1); - return 0; -} - -int lua_GetImageData(lua_State* L) -{ - // TODO: Color *GetImageData(Image image); - - Image arg1 = LuaGetArgument_Image(L, 1); - Color * result = GetImageData(arg1); - lua_createtable(L, arg1.width*arg1.height, 0); - for (int i = 0; i < arg1.width*arg1.height; i++) - { - LuaPush_Color(L, result[i]); - lua_rawseti(L, -2, i + 1); - } - free(result); - return 1; -} - -int lua_GetTextureData(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Image result = GetTextureData(arg1); - LuaPush_Image(L, result); - return 1; -} - -int lua_UpdateTexture(lua_State* L) -{ - // TODO: void UpdateTexture(Texture2D texture, void *pixels); - - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - void * arg2 = (char *)LuaGetArgument_string(L, 2); // NOTE: Getting (void *) as string? - UpdateTexture(arg1, arg2); // ISSUE: #2 string expected, got table -> GetImageData() returns a table! - return 0; -} - -int lua_ImageToPOT(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - ImageToPOT(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageFormat(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - ImageFormat(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageDither(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - ImageDither(&arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageCopy(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Image result = ImageCopy(arg1); - LuaPush_Image(L, result); - return 1; -} - -int lua_ImageCrop(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - ImageCrop(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageResize(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - ImageResize(&arg1, arg2, arg3); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageResizeNN(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - ImageResizeNN(&arg1, arg2, arg3); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageText(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - Image result = ImageText(arg1, arg2, arg3); - LuaPush_Image(L, result); - return 1; -} - -int lua_ImageTextEx(lua_State* L) -{ - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - Image result = ImageTextEx(arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, result); - return 1; -} - -int lua_ImageDraw(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Image arg2 = LuaGetArgument_Image(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Rectangle arg4 = LuaGetArgument_Rectangle(L, 4); - ImageDraw(&arg1, arg2, arg3, arg4); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageDrawText(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - const char * arg3 = LuaGetArgument_string(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - ImageDrawText(&arg1, arg2, arg3, arg4, arg5); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageDrawTextEx(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - SpriteFont arg3 = LuaGetArgument_SpriteFont(L, 3); - const char * arg4 = LuaGetArgument_string(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - int arg6 = LuaGetArgument_int(L, 6); - Color arg7 = LuaGetArgument_Color(L, 7); - ImageDrawTextEx(&arg1, arg2, arg3, arg4, arg5, arg6, arg7); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageFlipVertical(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - ImageFlipVertical(&arg1); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageFlipHorizontal(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - ImageFlipHorizontal(&arg1); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageColorTint(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - ImageColorTint(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageColorInvert(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - ImageColorInvert(&arg1); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageColorGrayscale(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - ImageColorGrayscale(&arg1); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageColorContrast(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - ImageColorContrast(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_ImageColorBrightness(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - ImageColorBrightness(&arg1, arg2); - LuaPush_Image(L, arg1); - return 1; -} - -int lua_GenTextureMipmaps(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - GenTextureMipmaps(&arg1); - LuaPush_Texture2D(L, arg1); - return 1; -} - -int lua_SetTextureFilter(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - SetTextureFilter(arg1, arg2); - return 0; -} - -int lua_SetTextureWrap(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - SetTextureWrap(arg1, arg2); - return 0; -} - -int lua_DrawTexture(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTexture(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawTextureV(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawTextureV(arg1, arg2, arg3); - return 0; -} - -int lua_DrawTextureEx(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawTextureEx(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawTextureRec(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawTextureRec(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawTexturePro(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Rectangle arg2 = LuaGetArgument_Rectangle(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Vector2 arg4 = LuaGetArgument_Vector2(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawTexturePro(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -//------------------------------------------------------------------------------------ -// raylib [text] module functions - Font Loading and Text Drawing -//------------------------------------------------------------------------------------ -int lua_GetDefaultFont(lua_State* L) -{ - SpriteFont result = GetDefaultFont(); - LuaPush_SpriteFont(L, result); - return 1; -} - -int lua_LoadSpriteFont(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - SpriteFont result = LoadSpriteFont(arg1); - LuaPush_SpriteFont(L, result); - return 1; -} - -int lua_LoadSpriteFontTTF(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - //LoadSpriteFontTTF(const char *fileName, int fontSize, int charsCount, int *fontChars); - SpriteFont result = LoadSpriteFontTTF(arg1, arg2, arg3, &arg4); - LuaPush_SpriteFont(L, result); - return 1; -} - -int lua_UnloadSpriteFont(lua_State* L) -{ - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - UnloadSpriteFont(arg1); - return 0; -} - -int lua_DrawText(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawText(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawTextEx(lua_State* L) -{ - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - Vector2 arg3 = LuaGetArgument_Vector2(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawTextEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_MeasureText(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int result = MeasureText(arg1, arg2); - lua_pushinteger(L, result); - return 1; -} - -int lua_MeasureTextEx(lua_State* L) -{ - SpriteFont arg1 = LuaGetArgument_SpriteFont(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Vector2 result = MeasureTextEx(arg1, arg2, arg3, arg4); - LuaPush_Vector2(L, result); - return 1; -} - -int lua_DrawFPS(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - DrawFPS(arg1, arg2); - return 0; -} - -// NOTE: FormatText() can be replaced by Lua function: string.format() -// NOTE: SubText() can be replaced by Lua function: string.sub() - -//------------------------------------------------------------------------------------ -// raylib [models] module functions - Basic 3d Shapes Drawing Functions -//------------------------------------------------------------------------------------ -int lua_DrawLine3D(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawLine3D(arg1, arg2, arg3); - return 0; -} - -int lua_DrawCircle3D(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCircle3D(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawCube(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCube(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawCubeV(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawCubeV(arg1, arg2, arg3); - return 0; -} - -int lua_DrawCubeWires(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawCubeWires(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawCubeTexture(lua_State* L) -{ - Texture2D arg1 = LuaGetArgument_Texture2D(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCubeTexture(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawSphere(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawSphere(arg1, arg2, arg3); - return 0; -} - -int lua_DrawSphereEx(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawSphereEx(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawSphereWires(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawSphereWires(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawCylinder(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCylinder(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawCylinderWires(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawCylinderWires(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawPlane(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector2 arg2 = LuaGetArgument_Vector2(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - DrawPlane(arg1, arg2, arg3); - return 0; -} - -int lua_DrawRay(lua_State* L) -{ - Ray arg1 = LuaGetArgument_Ray(L, 1); - Color arg2 = LuaGetArgument_Color(L, 2); - DrawRay(arg1, arg2); - return 0; -} - -int lua_DrawGrid(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - DrawGrid(arg1, arg2); - return 0; -} - -int lua_DrawGizmo(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - DrawGizmo(arg1); - return 0; -} - -int lua_DrawLight(lua_State* L) -{ - Light arg1 = LuaGetArgument_Light(L, 1); - DrawLight(arg1); - return 0; -} - -//------------------------------------------------------------------------------------ -// raylib [models] module functions -//------------------------------------------------------------------------------------ -int lua_LoadModel(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Model result = LoadModel(arg1); - LuaPush_Model(L, result); - return 1; -} - -int lua_LoadModelEx(lua_State* L) -{ - Mesh arg1 = LuaGetArgument_Mesh(L, 1); - bool arg2 = LuaGetArgument_int(L, 2); - Model result = LoadModelEx(arg1, arg2); - LuaPush_Model(L, result); - return 1; -} - -int lua_LoadModelFromRES(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Model result = LoadModelFromRES(arg1, arg2); - LuaPush_Model(L, result); - return 1; -} - -int lua_LoadHeightmap(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Model result = LoadHeightmap(arg1, arg2); - LuaPush_Model(L, result); - return 1; -} - -int lua_LoadCubicmap(lua_State* L) -{ - Image arg1 = LuaGetArgument_Image(L, 1); - Model result = LoadCubicmap(arg1); - LuaPush_Model(L, result); - return 1; -} - -int lua_UnloadModel(lua_State* L) -{ - Model arg1 = LuaGetArgument_Model(L, 1); - UnloadModel(arg1); - return 0; -} - -// TODO: GenMesh*() functionality (not ready yet on raylib 1.6) - -int lua_LoadMaterial(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Material result = LoadMaterial(arg1); - LuaPush_Material(L, result); - return 1; -} - -int lua_LoadDefaultMaterial(lua_State* L) -{ - Material result = LoadDefaultMaterial(); - LuaPush_Material(L, result); - return 1; -} - -int lua_LoadStandardMaterial(lua_State* L) -{ - Material result = LoadStandardMaterial(); - LuaPush_Material(L, result); - return 1; -} - -int lua_UnloadMaterial(lua_State* L) -{ - Material arg1 = LuaGetArgument_Material(L, 1); - UnloadMaterial(arg1); - return 0; -} - -int lua_DrawModel(lua_State* L) -{ - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawModel(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawModelEx(lua_State* L) -{ - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 arg5 = LuaGetArgument_Vector3(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawModelEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawModelWires(lua_State* L) -{ - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Color arg4 = LuaGetArgument_Color(L, 4); - DrawModelWires(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_DrawModelWiresEx(lua_State* L) -{ - Model arg1 = LuaGetArgument_Model(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Vector3 arg5 = LuaGetArgument_Vector3(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawModelWiresEx(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_DrawBillboard(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - Color arg5 = LuaGetArgument_Color(L, 5); - DrawBillboard(arg1, arg2, arg3, arg4, arg5); - return 0; -} - -int lua_DrawBillboardRec(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - Texture2D arg2 = LuaGetArgument_Texture2D(L, 2); - Rectangle arg3 = LuaGetArgument_Rectangle(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - float arg5 = LuaGetArgument_float(L, 5); - Color arg6 = LuaGetArgument_Color(L, 6); - DrawBillboardRec(arg1, arg2, arg3, arg4, arg5, arg6); - return 0; -} - -int lua_CalculateBoundingBox(lua_State* L) -{ - Mesh arg1 = LuaGetArgument_Mesh(L, 1); - BoundingBox result = CalculateBoundingBox(arg1); - LuaPush_BoundingBox(L, result); - return 1; -} - -int lua_CheckCollisionSpheres(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - float arg4 = LuaGetArgument_float(L, 4); - bool result = CheckCollisionSpheres(arg1, arg2, arg3, arg4); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionBoxes(lua_State* L) -{ - BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); - BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); - bool result = CheckCollisionBoxes(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionBoxSphere(lua_State* L) -{ - BoundingBox arg1 = LuaGetArgument_BoundingBox(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionBoxSphere(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionRaySphere(lua_State* L) -{ - Ray arg1 = LuaGetArgument_Ray(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - bool result = CheckCollisionRaySphere(arg1, arg2, arg3); - lua_pushboolean(L, result); - return 1; -} - -int lua_CheckCollisionRaySphereEx(lua_State* L) -{ - Ray arg1 = LuaGetArgument_Ray(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Vector3 arg4 = LuaGetArgument_Vector3(L, 4); - bool result = CheckCollisionRaySphereEx(arg1, arg2, arg3, &arg4); - lua_pushboolean(L, result); - LuaPush_Vector3(L, arg4); - return 2; -} - -int lua_CheckCollisionRayBox(lua_State* L) -{ - Ray arg1 = LuaGetArgument_Ray(L, 1); - BoundingBox arg2 = LuaGetArgument_BoundingBox(L, 2); - bool result = CheckCollisionRayBox(arg1, arg2); - lua_pushboolean(L, result); - return 1; -} - -//------------------------------------------------------------------------------------ -// raylib [raymath] module functions - Shaders -//------------------------------------------------------------------------------------ -int lua_LoadShader(lua_State* L) -{ - char * arg1 = (char *)LuaGetArgument_string(L, 1); - char * arg2 = (char *)LuaGetArgument_string(L, 2); - Shader result = LoadShader(arg1, arg2); - LuaPush_Shader(L, result); - return 1; -} - -int lua_UnloadShader(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - UnloadShader(arg1); - return 0; -} - -int lua_GetDefaultShader(lua_State* L) -{ - Shader result = GetDefaultShader(); - LuaPush_Shader(L, result); - return 1; -} - -int lua_GetStandardShader(lua_State* L) -{ - Shader result = GetStandardShader(); - LuaPush_Shader(L, result); - return 1; -} - -int lua_GetDefaultTexture(lua_State* L) -{ - Texture2D result = GetDefaultTexture(); - LuaPush_Texture2D(L, result); - return 1; -} - -int lua_GetShaderLocation(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int result = GetShaderLocation(arg1, arg2); - lua_pushinteger(L, result); - return 1; -} - -int lua_SetShaderValue(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - GET_TABLE(float, arg3, 3); - SetShaderValue(arg1, arg2, arg3, arg3_size); - free(arg3); - return 0; -} - -int lua_SetShaderValuei(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - GET_TABLE(int, arg3, 3); - SetShaderValuei(arg1, arg2, arg3, arg3_size); - free(arg3); - return 0; -} - -int lua_SetShaderValueMatrix(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Matrix arg3 = LuaGetArgument_Matrix(L, 3); - SetShaderValueMatrix(arg1, arg2, arg3); - return 0; -} - -int lua_SetMatrixProjection(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - SetMatrixProjection(arg1); - return 0; -} - -int lua_SetMatrixModelview(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - SetMatrixModelview(arg1); - return 0; -} - -int lua_BeginShaderMode(lua_State* L) -{ - Shader arg1 = LuaGetArgument_Shader(L, 1); - BeginShaderMode(arg1); - return 0; -} - -int lua_EndShaderMode(lua_State* L) -{ - EndShaderMode(); - return 0; -} - -int lua_BeginBlendMode(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - BeginBlendMode(arg1); - return 0; -} - -int lua_EndBlendMode(lua_State* L) -{ - EndBlendMode(); - return 0; -} - -int lua_CreateLight(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Color arg3 = LuaGetArgument_Color(L, 3); - Light result = CreateLight(arg1, arg2, arg3); - LuaPush_Light(L, result); - return 1; -} - -int lua_DestroyLight(lua_State* L) -{ - Light arg1 = LuaGetArgument_Light(L, 1); - DestroyLight(arg1); - return 0; -} - - -//------------------------------------------------------------------------------------ -// raylib [rlgl] module functions - VR experience -//------------------------------------------------------------------------------------ -int lua_InitVrDevice(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - InitVrDevice(arg1); - return 0; -} - -int lua_CloseVrDevice(lua_State* L) -{ - CloseVrDevice(); - return 0; -} - -int lua_IsVrDeviceReady(lua_State* L) -{ - bool result = IsVrDeviceReady(); - lua_pushboolean(L, result); - return 1; -} - -int lua_IsVrSimulator(lua_State* L) -{ - bool result = IsVrSimulator(); - lua_pushboolean(L, result); - return 1; -} - -int lua_UpdateVrTracking(lua_State* L) -{ - Camera arg1 = LuaGetArgument_Camera(L, 1); - UpdateVrTracking(&arg1); - LuaPush_Camera(L, arg1); - return 1; -} - -int lua_ToggleVrMode(lua_State* L) -{ - ToggleVrMode(); - return 0; -} - -//------------------------------------------------------------------------------------ -// raylib [audio] module functions - Audio Loading and Playing -//------------------------------------------------------------------------------------ -int lua_InitAudioDevice(lua_State* L) -{ - InitAudioDevice(); - return 0; -} - -int lua_CloseAudioDevice(lua_State* L) -{ - CloseAudioDevice(); - return 0; -} - -int lua_IsAudioDeviceReady(lua_State* L) -{ - bool result = IsAudioDeviceReady(); - lua_pushboolean(L, result); - return 1; -} - -int lua_LoadWave(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Wave result = LoadWave((char *)arg1); - LuaPush_Wave(L, result); - return 1; -} - -int lua_LoadWaveEx(lua_State* L) -{ - // TODO: Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); - - float * arg1 = 0; - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - Wave result = LoadWaveEx(arg1, arg2, arg3, arg4, arg5); - LuaPush_Wave(L, result); - return 1; -} - -int lua_LoadSound(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Sound result = LoadSound((char*)arg1); - LuaPush_Sound(L, result); - return 1; -} - -int lua_LoadSoundFromWave(lua_State* L) -{ - Wave arg1 = LuaGetArgument_Wave(L, 1); - Sound result = LoadSoundFromWave(arg1); - LuaPush_Sound(L, result); - return 1; -} - -int lua_LoadSoundFromRES(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - Sound result = LoadSoundFromRES(arg1, arg2); - LuaPush_Sound(L, result); - return 1; -} - -int lua_UpdateSound(lua_State* L) -{ - // TODO: void UpdateSound(Sound sound, void *data, int numSamples); - - Sound arg1 = LuaGetArgument_Sound(L, 1); - const char * arg2 = LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - UpdateSound(arg1, arg2, arg3); - return 0; -} - -int lua_UnloadWave(lua_State* L) -{ - Wave arg1 = LuaGetArgument_Wave(L, 1); - UnloadWave(arg1); - return 0; -} - -int lua_UnloadSound(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - UnloadSound(arg1); - return 0; -} - -int lua_PlaySound(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - PlaySound(arg1); - return 0; -} - -int lua_PauseSound(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - PauseSound(arg1); - return 0; -} - -int lua_ResumeSound(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - ResumeSound(arg1); - return 0; -} - -int lua_StopSound(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - StopSound(arg1); - return 0; -} - -int lua_IsSoundPlaying(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - bool result = IsSoundPlaying(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_SetSoundVolume(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetSoundVolume(arg1, arg2); - return 0; -} - -int lua_SetSoundPitch(lua_State* L) -{ - Sound arg1 = LuaGetArgument_Sound(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetSoundPitch(arg1, arg2); - return 0; -} - -int lua_WaveFormat(lua_State* L) -{ - Wave arg1 = LuaGetArgument_Wave(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - WaveFormat(&arg1, arg2, arg3, arg4); - return 0; -} - -int lua_WaveCopy(lua_State* L) -{ - Wave arg1 = LuaGetArgument_Wave(L, 1); - Wave result = WaveCopy(arg1); - LuaPush_Wave(L, result); - return 1; -} - -int lua_WaveCrop(lua_State* L) -{ - Wave arg1 = LuaGetArgument_Wave(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - WaveCrop(&arg1, arg2, arg3); - return 0; -} - -int lua_GetWaveData(lua_State* L) -{ - // TODO: float *GetWaveData(Wave wave); - - Wave arg1 = LuaGetArgument_Wave(L, 1); - float * result = GetWaveData(arg1); - //LuaPush_float(L, result); - //lua_pushnumber(L, result); - return 0; -} - -int lua_LoadMusicStream(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - Music result = LoadMusicStream((char *)arg1); - LuaPush_Music(L, result); - return 1; -} - -int lua_UnloadMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - UnloadMusicStream(arg1); - return 0; -} - -int lua_UpdateMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - UpdateMusicStream(arg1); - return 0; -} - -int lua_PlayMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - PlayMusicStream(arg1); - return 0; -} - -int lua_StopMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - StopMusicStream(arg1); - return 0; -} - -int lua_PauseMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - PauseMusicStream(arg1); - return 0; -} - -int lua_ResumeMusicStream(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - ResumeMusicStream(arg1); - return 0; -} - -int lua_IsMusicPlaying(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - bool result = IsMusicPlaying(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_SetMusicVolume(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetMusicVolume(arg1, arg2); - return 0; -} - -int lua_SetMusicPitch(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - SetMusicPitch(arg1, arg2); - return 0; -} - -int lua_GetMusicTimeLength(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - float result = GetMusicTimeLength(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_GetMusicTimePlayed(lua_State* L) -{ - Music arg1 = LuaGetArgument_Music(L, 1); - float result = GetMusicTimePlayed(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_InitAudioStream(lua_State* L) -{ - int arg1 = LuaGetArgument_int(L, 1); - int arg2 = LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - AudioStream result = InitAudioStream(arg1, arg2, arg3); - LuaPush_AudioStream(L, result); - return 1; -} - -int lua_CloseAudioStream(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - CloseAudioStream(arg1); - return 0; -} - -int lua_UpdateAudioStream(lua_State* L) -{ - // TODO: void UpdateAudioStream(AudioStream stream, void *data, int numSamples); - - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - void * arg2 = (char *)LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - UpdateAudioStream(arg1, arg2, arg3); - return 0; -} - -int lua_IsAudioBufferProcessed(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - bool result = IsAudioBufferProcessed(arg1); - lua_pushboolean(L, result); - return 1; -} - -int lua_PlayAudioStream(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - PlayAudioStream(arg1); - return 0; -} - - -int lua_StopAudioStream(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - StopAudioStream(arg1); - return 0; -} - -int lua_PauseAudioStream(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - PauseAudioStream(arg1); - return 0; -} - -int lua_ResumeAudioStream(lua_State* L) -{ - AudioStream arg1 = LuaGetArgument_AudioStream(L, 1); - ResumeAudioStream(arg1); - return 0; -} - -//---------------------------------------------------------------------------------- -// raylib [utils] module functions -//---------------------------------------------------------------------------------- -int lua_DecompressData(lua_State* L) -{ - unsigned char *arg1 = (unsigned char *)LuaGetArgument_string(L, 1); - unsigned arg2 = (unsigned)LuaGetArgument_int(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - unsigned char *result = DecompressData(arg1, arg2, arg3); - lua_pushlstring(L, (const char *)result, arg3); - return 1; -} - -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) -int lua_WriteBitmap(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - WriteBitmap(arg1, arg2, arg3, arg4); - return 0; -} - -int lua_WritePNG(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - unsigned char* arg2 = (unsigned char*)LuaGetArgument_string(L, 2); - int arg3 = LuaGetArgument_int(L, 3); - int arg4 = LuaGetArgument_int(L, 4); - int arg5 = LuaGetArgument_int(L, 5); - WritePNG(arg1, arg2, arg3, arg4, arg5); - return 0; -} -#endif - -int lua_TraceLog(lua_State* L) -{ - int num_args = lua_gettop(L) - 1; - int arg1 = LuaGetArgument_int(L, 1); - - /// type, fmt, args... - - lua_rotate(L, 1, -1); /// fmt, args..., type - lua_pop(L, 1); /// fmt, args... - - lua_getglobal(L, "string"); /// fmt, args..., [string] - lua_getfield(L, 1, "format"); /// fmt, args..., [string], format() - lua_rotate(L, 1, 2); /// [string], format(), fmt, args... - lua_call(L, num_args, 1); /// [string], formatted_string - - TraceLog(arg1, "%s", luaL_checkstring(L,-1)); - return 0; -} - -int lua_GetExtension(lua_State* L) -{ - const char * arg1 = LuaGetArgument_string(L, 1); - const char* result = GetExtension(arg1); - lua_pushstring(L, result); - return 1; -} - -//---------------------------------------------------------------------------------- -// raylib [raymath] module functions - Vector3 math -//---------------------------------------------------------------------------------- -int lua_VectorAdd(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorAdd(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorSubtract(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorSubtract(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorCrossProduct(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorCrossProduct(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorPerpendicular(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 result = VectorPerpendicular(arg1); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorDotProduct(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float result = VectorDotProduct(arg1, arg2); - lua_pushnumber(L, result); - return 1; -} - -int lua_VectorLength(lua_State* L) -{ - const Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float result = VectorLength(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_VectorScale(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - VectorScale(&arg1, arg2); - LuaPush_Vector3(L, arg1); - return 1; -} - -int lua_VectorNegate(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - VectorNegate(&arg1); - LuaPush_Vector3(L, arg1); - return 1; -} - -int lua_VectorNormalize(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - VectorNormalize(&arg1); - LuaPush_Vector3(L, arg1); - return 1; -} - -int lua_VectorDistance(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float result = VectorDistance(arg1, arg2); - lua_pushnumber(L, result); - return 1; -} - -int lua_VectorLerp(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Vector3 result = VectorLerp(arg1, arg2, arg3); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorReflect(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 result = VectorReflect(arg1, arg2); - LuaPush_Vector3(L, result); - return 1; -} - -int lua_VectorTransform(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - VectorTransform(&arg1, arg2); - LuaPush_Vector3(L, arg1); - return 1; -} - -int lua_VectorZero(lua_State* L) -{ - Vector3 result = VectorZero(); - LuaPush_Vector3(L, result); - return 1; -} - -//---------------------------------------------------------------------------------- -// raylib [raymath] module functions - Matrix math -//---------------------------------------------------------------------------------- -int lua_MatrixDeterminant(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float result = MatrixDeterminant(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_MatrixTrace(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - float result = MatrixTrace(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_MatrixTranspose(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixTranspose(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; -} - -int lua_MatrixInvert(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixInvert(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; -} - -int lua_MatrixNormalize(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - MatrixNormalize(&arg1); - LuaPush_Matrix(L, &arg1); - return 1; -} - -int lua_MatrixIdentity(lua_State* L) -{ - Matrix result = MatrixIdentity(); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixAdd(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixAdd(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixSubstract(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixSubstract(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixTranslate(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Matrix result = MatrixTranslate(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixRotate(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Matrix result = MatrixRotate(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixRotateX(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateX(arg1); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixRotateY(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateY(arg1); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixRotateZ(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - Matrix result = MatrixRotateZ(arg1); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixScale(lua_State* L) -{ - float arg1 = LuaGetArgument_float(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Matrix result = MatrixScale(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixMultiply(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - Matrix result = MatrixMultiply(arg1, arg2); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixFrustum(lua_State* L) -{ - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - double arg5 = LuaGetArgument_double(L, 5); - double arg6 = LuaGetArgument_double(L, 6); - Matrix result = MatrixFrustum(arg1, arg2, arg3, arg4, arg5, arg6); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixPerspective(lua_State* L) -{ - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - Matrix result = MatrixPerspective(arg1, arg2, arg3, arg4); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixOrtho(lua_State* L) -{ - double arg1 = LuaGetArgument_double(L, 1); - double arg2 = LuaGetArgument_double(L, 2); - double arg3 = LuaGetArgument_double(L, 3); - double arg4 = LuaGetArgument_double(L, 4); - double arg5 = LuaGetArgument_double(L, 5); - double arg6 = LuaGetArgument_double(L, 6); - Matrix result = MatrixOrtho(arg1, arg2, arg3, arg4, arg5, arg6); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_MatrixLookAt(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - Vector3 arg2 = LuaGetArgument_Vector3(L, 2); - Vector3 arg3 = LuaGetArgument_Vector3(L, 3); - Matrix result = MatrixLookAt(arg1, arg2, arg3); - LuaPush_Matrix(L, &result); - return 1; -} - -//---------------------------------------------------------------------------------- -// raylib [raymath] module functions - Quaternion math -//---------------------------------------------------------------------------------- -int lua_QuaternionLength(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - float result = QuaternionLength(arg1); - lua_pushnumber(L, result); - return 1; -} - -int lua_QuaternionNormalize(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - QuaternionNormalize(&arg1); - LuaPush_Quaternion(L, arg1); - return 1; -} - -int lua_QuaternionMultiply(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); - Quaternion result = QuaternionMultiply(arg1, arg2); - LuaPush_Quaternion(L, result); - return 1; -} - -int lua_QuaternionSlerp(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Quaternion arg2 = LuaGetArgument_Quaternion(L, 2); - float arg3 = LuaGetArgument_float(L, 3); - Quaternion result = QuaternionSlerp(arg1, arg2, arg3); - LuaPush_Quaternion(L, result); - return 1; -} - -int lua_QuaternionFromMatrix(lua_State* L) -{ - Matrix arg1 = LuaGetArgument_Matrix(L, 1); - Quaternion result = QuaternionFromMatrix(arg1); - LuaPush_Quaternion(L, result); - return 1; -} - -int lua_QuaternionToMatrix(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Matrix result = QuaternionToMatrix(arg1); - LuaPush_Matrix(L, &result); - return 1; -} - -int lua_QuaternionFromAxisAngle(lua_State* L) -{ - Vector3 arg1 = LuaGetArgument_Vector3(L, 1); - float arg2 = LuaGetArgument_float(L, 2); - Quaternion result = QuaternionFromAxisAngle(arg1, arg2); - LuaPush_Quaternion(L, result); - return 1; -} - -int lua_QuaternionToAxisAngle(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Vector3 arg2; - float arg3 = 0; - QuaternionToAxisAngle(arg1, &arg2, &arg3); - LuaPush_Vector3(L, arg2); - lua_pushnumber(L, arg3); - return 2; -} - -int lua_QuaternionTransform(lua_State* L) -{ - Quaternion arg1 = LuaGetArgument_Quaternion(L, 1); - Matrix arg2 = LuaGetArgument_Matrix(L, 2); - QuaternionTransform(&arg1, arg2); - LuaPush_Quaternion(L, arg1); - return 1; -} - - -//---------------------------------------------------------------------------------- -// Functions Registering -//---------------------------------------------------------------------------------- -#define REG(name) { #name, lua_##name }, - -// raylib Functions (and data types) list -static luaL_Reg raylib_functions[] = { - - // Register non-opaque data types - REG(Color) - REG(Vector2) - REG(Vector3) - //REG(Matrix) - REG(Quaternion) - REG(Rectangle) - REG(Ray) - REG(Camera) - REG(Camera2D) - REG(BoundingBox) - //REG(Material) - - // Register functions - REG(InitWindow) - REG(CloseWindow) - REG(WindowShouldClose) - REG(IsWindowMinimized) - REG(ToggleFullscreen) - REG(GetScreenWidth) - REG(GetScreenHeight) - - REG(ShowCursor) - REG(HideCursor) - REG(IsCursorHidden) - REG(EnableCursor) - REG(DisableCursor) - - REG(ClearBackground) - REG(BeginDrawing) - REG(EndDrawing) - REG(Begin2dMode) - REG(End2dMode) - REG(Begin3dMode) - REG(End3dMode) - REG(BeginTextureMode) - REG(EndTextureMode) - - REG(GetMouseRay) - REG(GetWorldToScreen) - REG(GetCameraMatrix) - -#if defined(PLATFORM_WEB) - REG(SetDrawingLoop) -#else - REG(SetTargetFPS) -#endif - REG(GetFPS) - REG(GetFrameTime) - - REG(GetColor) - REG(GetHexValue) - REG(ColorToFloat) - REG(VectorToFloat) - REG(MatrixToFloat) - REG(GetRandomValue) - REG(Fade) - REG(SetConfigFlags) - REG(ShowLogo) - - REG(IsFileDropped) - REG(GetDroppedFiles) - REG(ClearDroppedFiles) - REG(StorageSaveValue) - REG(StorageLoadValue) - - REG(IsKeyPressed) - REG(IsKeyDown) - REG(IsKeyReleased) - REG(IsKeyUp) - REG(GetKeyPressed) - REG(SetExitKey) - - REG(IsGamepadAvailable) - REG(IsGamepadName) - REG(GetGamepadName) - REG(IsGamepadButtonPressed) - REG(IsGamepadButtonDown) - REG(IsGamepadButtonReleased) - REG(IsGamepadButtonUp) - REG(GetGamepadButtonPressed) - REG(GetGamepadAxisCount) - REG(GetGamepadAxisMovement) - - REG(IsMouseButtonPressed) - REG(IsMouseButtonDown) - REG(IsMouseButtonReleased) - REG(IsMouseButtonUp) - REG(GetMouseX) - REG(GetMouseY) - REG(GetMousePosition) - REG(SetMousePosition) - REG(GetMouseWheelMove) - REG(GetTouchX) - REG(GetTouchY) - REG(GetTouchPosition) - -#if defined(PLATFORM_ANDROID) - REG(IsButtonPressed) - REG(IsButtonDown) - REG(IsButtonReleased) -#endif - - REG(SetGesturesEnabled) - REG(IsGestureDetected) - REG(GetGestureDetected) - REG(GetTouchPointsCount) - REG(GetGestureHoldDuration) - REG(GetGestureDragVector) - REG(GetGestureDragAngle) - REG(GetGesturePinchVector) - REG(GetGesturePinchAngle) - - REG(SetCameraMode) - REG(UpdateCamera) - REG(SetCameraPanControl) - REG(SetCameraAltControl) - REG(SetCameraSmoothZoomControl) - REG(SetCameraMoveControls) - - REG(DrawPixel) - REG(DrawPixelV) - REG(DrawLine) - REG(DrawLineV) - REG(DrawCircle) - REG(DrawCircleGradient) - REG(DrawCircleV) - REG(DrawCircleLines) - REG(DrawRectangle) - REG(DrawRectangleRec) - REG(DrawRectangleGradient) - REG(DrawRectangleV) - REG(DrawRectangleLines) - REG(DrawTriangle) - REG(DrawTriangleLines) - REG(DrawPoly) - REG(DrawPolyEx) - REG(DrawPolyExLines) - - REG(CheckCollisionRecs) - REG(CheckCollisionCircles) - REG(CheckCollisionCircleRec) - REG(GetCollisionRec) - REG(CheckCollisionPointRec) - REG(CheckCollisionPointCircle) - REG(CheckCollisionPointTriangle) - - REG(LoadImage) - REG(LoadImageEx) - REG(LoadImageRaw) - REG(LoadImageFromRES) - REG(LoadTexture) - REG(LoadTextureEx) - REG(LoadTextureFromRES) - REG(LoadTextureFromImage) - REG(LoadRenderTexture) - REG(UnloadImage) - REG(UnloadTexture) - REG(UnloadRenderTexture) - REG(GetImageData) - REG(GetTextureData) - REG(UpdateTexture) - REG(ImageToPOT) - REG(ImageFormat) - REG(ImageDither) - REG(ImageCopy) - REG(ImageCrop) - REG(ImageResize) - REG(ImageResizeNN) - REG(ImageText) - REG(ImageTextEx) - REG(ImageDraw) - REG(ImageDrawText) - REG(ImageDrawTextEx) - REG(ImageFlipVertical) - REG(ImageFlipHorizontal) - REG(ImageColorTint) - REG(ImageColorInvert) - REG(ImageColorGrayscale) - REG(ImageColorContrast) - REG(ImageColorBrightness) - REG(GenTextureMipmaps) - REG(SetTextureFilter) - REG(SetTextureWrap) - - REG(DrawTexture) - REG(DrawTextureV) - REG(DrawTextureEx) - REG(DrawTextureRec) - REG(DrawTexturePro) - - REG(GetDefaultFont) - REG(LoadSpriteFont) - REG(LoadSpriteFontTTF) - REG(UnloadSpriteFont) - REG(DrawText) - REG(DrawTextEx) - REG(MeasureText) - REG(MeasureTextEx) - REG(DrawFPS) - - REG(DrawLine3D) - REG(DrawCircle3D) - REG(DrawCube) - REG(DrawCubeV) - REG(DrawCubeWires) - REG(DrawCubeTexture) - REG(DrawSphere) - REG(DrawSphereEx) - REG(DrawSphereWires) - REG(DrawCylinder) - REG(DrawCylinderWires) - REG(DrawPlane) - REG(DrawRay) - REG(DrawGrid) - REG(DrawGizmo) - REG(DrawLight) - - REG(LoadModel) - REG(LoadModelEx) - REG(LoadModelFromRES) - REG(LoadHeightmap) - REG(LoadCubicmap) - REG(UnloadModel) - REG(LoadMaterial) - REG(LoadDefaultMaterial) - REG(LoadStandardMaterial) - REG(UnloadMaterial) - //REG(GenMesh*) // Not ready yet... - - REG(DrawModel) - REG(DrawModelEx) - REG(DrawModelWires) - REG(DrawModelWiresEx) - REG(DrawBillboard) - REG(DrawBillboardRec) - REG(CalculateBoundingBox) - REG(CheckCollisionSpheres) - REG(CheckCollisionBoxes) - REG(CheckCollisionBoxSphere) - REG(CheckCollisionRaySphere) - REG(CheckCollisionRaySphereEx) - REG(CheckCollisionRayBox) - - REG(LoadShader) - REG(UnloadShader) - REG(GetDefaultShader) - REG(GetStandardShader) - REG(GetDefaultTexture) - REG(GetShaderLocation) - REG(SetShaderValue) - REG(SetShaderValuei) - REG(SetShaderValueMatrix) - REG(SetMatrixProjection) - REG(SetMatrixModelview) - REG(BeginShaderMode) - REG(EndShaderMode) - REG(BeginBlendMode) - REG(EndBlendMode) - REG(CreateLight) - REG(DestroyLight) - - REG(InitVrDevice) - REG(CloseVrDevice) - REG(IsVrDeviceReady) - REG(IsVrSimulator) - REG(UpdateVrTracking) - REG(ToggleVrMode) - - REG(InitAudioDevice) - REG(CloseAudioDevice) - REG(IsAudioDeviceReady) - REG(LoadWave) - REG(LoadWaveEx) - REG(LoadSound) - REG(LoadSoundFromWave) - REG(LoadSoundFromRES) - REG(UpdateSound) - REG(UnloadWave) - REG(UnloadSound) - REG(PlaySound) - REG(PauseSound) - REG(ResumeSound) - REG(StopSound) - REG(IsSoundPlaying) - REG(SetSoundVolume) - REG(SetSoundPitch) - REG(WaveFormat) - REG(WaveCopy) - REG(WaveCrop) - REG(GetWaveData) - - REG(LoadMusicStream) - REG(UnloadMusicStream) - REG(UpdateMusicStream) - REG(PlayMusicStream) - REG(StopMusicStream) - REG(PauseMusicStream) - REG(ResumeMusicStream) - REG(IsMusicPlaying) - REG(SetMusicVolume) - REG(SetMusicPitch) - REG(GetMusicTimeLength) - REG(GetMusicTimePlayed) - - REG(InitAudioStream) - REG(UpdateAudioStream) - REG(CloseAudioStream) - REG(IsAudioBufferProcessed) - REG(PlayAudioStream) - REG(PauseAudioStream) - REG(ResumeAudioStream) - REG(StopAudioStream) - - /// Math and util - REG(DecompressData) -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) - REG(WriteBitmap) - REG(WritePNG) -#endif - REG(TraceLog) - REG(GetExtension) - REG(VectorAdd) - REG(VectorSubtract) - REG(VectorCrossProduct) - REG(VectorPerpendicular) - REG(VectorDotProduct) - REG(VectorLength) - REG(VectorScale) - REG(VectorNegate) - REG(VectorNormalize) - REG(VectorDistance) - REG(VectorLerp) - REG(VectorReflect) - REG(VectorTransform) - REG(VectorZero) - REG(MatrixDeterminant) - REG(MatrixTrace) - REG(MatrixTranspose) - REG(MatrixInvert) - REG(MatrixNormalize) - REG(MatrixIdentity) - REG(MatrixAdd) - REG(MatrixSubstract) - REG(MatrixTranslate) - REG(MatrixRotate) - REG(MatrixRotateX) - REG(MatrixRotateY) - REG(MatrixRotateZ) - REG(MatrixScale) - REG(MatrixMultiply) - REG(MatrixFrustum) - REG(MatrixPerspective) - REG(MatrixOrtho) - REG(MatrixLookAt) - REG(QuaternionLength) - REG(QuaternionNormalize) - REG(QuaternionMultiply) - REG(QuaternionSlerp) - REG(QuaternionFromMatrix) - REG(QuaternionToMatrix) - REG(QuaternionFromAxisAngle) - REG(QuaternionToAxisAngle) - REG(QuaternionTransform) - - {NULL, NULL} // sentinel: end signal -}; - -// Register raylib functionality -static void LuaRegisterRayLib(const char *opt_table) -{ - if (opt_table) lua_createtable(L, 0, sizeof(raylib_functions)/sizeof(raylib_functions[0])); - else lua_pushglobaltable(L); - - luaL_setfuncs(L, raylib_functions, 0); -} - -//---------------------------------------------------------------------------------- -// raylib Lua API -//---------------------------------------------------------------------------------- - -// Initialize Lua system -RLUADEF void InitLuaDevice(void) -{ - mainLuaState = luaL_newstate(); - L = mainLuaState; - - LuaStartEnum(); - LuaSetEnum("FULLSCREEN_MODE", 1); - LuaSetEnum("SHOW_LOGO", 2); - LuaSetEnum("SHOW_MOUSE_CURSOR", 4); - LuaSetEnum("CENTERED_MODE", 8); - LuaSetEnum("MSAA_4X_HINT", 16); - LuaSetEnum("VSYNC_HINT", 32); - LuaEndEnum("FLAG"); - - LuaStartEnum(); - LuaSetEnum("SPACE", 32); - LuaSetEnum("ESCAPE", 256); - LuaSetEnum("ENTER", 257); - LuaSetEnum("BACKSPACE", 259); - LuaSetEnum("RIGHT", 262); - LuaSetEnum("LEFT", 263); - LuaSetEnum("DOWN", 264); - LuaSetEnum("UP", 265); - LuaSetEnum("F1", 290); - LuaSetEnum("F2", 291); - LuaSetEnum("F3", 292); - LuaSetEnum("F4", 293); - LuaSetEnum("F5", 294); - LuaSetEnum("F6", 295); - LuaSetEnum("F7", 296); - LuaSetEnum("F8", 297); - LuaSetEnum("F9", 298); - LuaSetEnum("F10", 299); - LuaSetEnum("LEFT_SHIFT", 340); - LuaSetEnum("LEFT_CONTROL", 341); - LuaSetEnum("LEFT_ALT", 342); - LuaSetEnum("RIGHT_SHIFT", 344); - LuaSetEnum("RIGHT_CONTROL", 345); - LuaSetEnum("RIGHT_ALT", 346); - LuaSetEnum("ZERO", 48); - LuaSetEnum("ONE", 49); - LuaSetEnum("TWO", 50); - LuaSetEnum("THREE", 51); - LuaSetEnum("FOUR", 52); - LuaSetEnum("FIVE", 53); - LuaSetEnum("SIX", 54); - LuaSetEnum("SEVEN", 55); - LuaSetEnum("EIGHT", 56); - LuaSetEnum("NINE", 57); - LuaSetEnum("A", 65); - LuaSetEnum("B", 66); - LuaSetEnum("C", 67); - LuaSetEnum("D", 68); - LuaSetEnum("E", 69); - LuaSetEnum("F", 70); - LuaSetEnum("G", 71); - LuaSetEnum("H", 72); - LuaSetEnum("I", 73); - LuaSetEnum("J", 74); - LuaSetEnum("K", 75); - LuaSetEnum("L", 76); - LuaSetEnum("M", 77); - LuaSetEnum("N", 78); - LuaSetEnum("O", 79); - LuaSetEnum("P", 80); - LuaSetEnum("Q", 81); - LuaSetEnum("R", 82); - LuaSetEnum("S", 83); - LuaSetEnum("T", 84); - LuaSetEnum("U", 85); - LuaSetEnum("V", 86); - LuaSetEnum("W", 87); - LuaSetEnum("X", 88); - LuaSetEnum("Y", 89); - LuaSetEnum("Z", 90); - LuaEndEnum("KEY"); - - LuaStartEnum(); - LuaSetEnum("LEFT_BUTTON", 0); - LuaSetEnum("RIGHT_BUTTON", 1); - LuaSetEnum("MIDDLE_BUTTON", 2); - LuaEndEnum("MOUSE"); - - LuaStartEnum(); - LuaSetEnum("PLAYER1", 0); - LuaSetEnum("PLAYER2", 1); - LuaSetEnum("PLAYER3", 2); - LuaSetEnum("PLAYER4", 3); - - LuaSetEnum("PS3_BUTTON_TRIANGLE", 0); - LuaSetEnum("PS3_BUTTON_CIRCLE", 1); - LuaSetEnum("PS3_BUTTON_CROSS", 2); - LuaSetEnum("PS3_BUTTON_SQUARE", 3); - LuaSetEnum("PS3_BUTTON_L1", 6); - LuaSetEnum("PS3_BUTTON_R1", 7); - LuaSetEnum("PS3_BUTTON_L2", 4); - LuaSetEnum("PS3_BUTTON_R2", 5); - LuaSetEnum("PS3_BUTTON_START", 8); - LuaSetEnum("PS3_BUTTON_SELECT", 9); - LuaSetEnum("PS3_BUTTON_UP", 24); - LuaSetEnum("PS3_BUTTON_RIGHT", 25); - LuaSetEnum("PS3_BUTTON_DOWN", 26); - LuaSetEnum("PS3_BUTTON_LEFT", 27); - LuaSetEnum("PS3_BUTTON_PS", 12); - LuaSetEnum("PS3_AXIS_LEFT_X", 0); - LuaSetEnum("PS3_AXIS_LEFT_Y", 1); - LuaSetEnum("PS3_AXIS_RIGHT_X", 2); - LuaSetEnum("PS3_AXIS_RIGHT_Y", 5); - LuaSetEnum("PS3_AXIS_L2", 3); // [1..-1] (pressure-level) - LuaSetEnum("PS3_AXIS_R2", 4); // [1..-1] (pressure-level) - -// Xbox360 USB Controller Buttons - LuaSetEnum("XBOX_BUTTON_A", 0); - LuaSetEnum("XBOX_BUTTON_B", 1); - LuaSetEnum("XBOX_BUTTON_X", 2); - LuaSetEnum("XBOX_BUTTON_Y", 3); - LuaSetEnum("XBOX_BUTTON_LB", 4); - LuaSetEnum("XBOX_BUTTON_RB", 5); - LuaSetEnum("XBOX_BUTTON_SELECT", 6); - LuaSetEnum("XBOX_BUTTON_START", 7); - LuaSetEnum("XBOX_BUTTON_UP", 10); - LuaSetEnum("XBOX_BUTTON_RIGHT", 11); - LuaSetEnum("XBOX_BUTTON_DOWN", 12); - LuaSetEnum("XBOX_BUTTON_LEFT", 13); - LuaSetEnum("XBOX_BUTTON_HOME", 8); -#if defined(PLATFORM_RPI) - LuaSetEnum("XBOX_AXIS_LEFT_X", 0); // [-1..1] (left->right) - LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); // [-1..1] (up->down) - LuaSetEnum("XBOX_AXIS_RIGHT_X", 3); // [-1..1] (left->right) - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 4); // [-1..1] (up->down) - LuaSetEnum("XBOX_AXIS_LT", 2); // [-1..1] (pressure-level) - LuaSetEnum("XBOX_AXIS_RT", 5); // [-1..1] (pressure-level) -#else - LuaSetEnum("XBOX_AXIS_LEFT_X", 0); // [-1..1] (left->right) - LuaSetEnum("XBOX_AXIS_LEFT_Y", 1); // [1..-1] (up->down) - LuaSetEnum("XBOX_AXIS_RIGHT_X", 2); // [-1..1] (left->right) - LuaSetEnum("XBOX_AXIS_RIGHT_Y", 3); // [1..-1] (up->down) - LuaSetEnum("XBOX_AXIS_LT", 4); // [-1..1] (pressure-level) - LuaSetEnum("XBOX_AXIS_RT", 5); // [-1..1] (pressure-level) -#endif - LuaEndEnum("GAMEPAD"); - - lua_pushglobaltable(L); - LuaSetEnumColor("LIGHTGRAY", LIGHTGRAY); - LuaSetEnumColor("GRAY", GRAY); - LuaSetEnumColor("DARKGRAY", DARKGRAY); - LuaSetEnumColor("YELLOW", YELLOW); - LuaSetEnumColor("GOLD", GOLD); - LuaSetEnumColor("ORANGE", ORANGE); - LuaSetEnumColor("PINK", PINK); - LuaSetEnumColor("RED", RED); - LuaSetEnumColor("MAROON", MAROON); - LuaSetEnumColor("GREEN", GREEN); - LuaSetEnumColor("LIME", LIME); - LuaSetEnumColor("DARKGREEN", DARKGREEN); - LuaSetEnumColor("SKYBLUE", SKYBLUE); - LuaSetEnumColor("BLUE", BLUE); - LuaSetEnumColor("DARKBLUE", DARKBLUE); - LuaSetEnumColor("PURPLE", PURPLE); - LuaSetEnumColor("VIOLET", VIOLET); - LuaSetEnumColor("DARKPURPLE", DARKPURPLE); - LuaSetEnumColor("BEIGE", BEIGE); - LuaSetEnumColor("BROWN", BROWN); - LuaSetEnumColor("DARKBROWN", DARKBROWN); - LuaSetEnumColor("WHITE", WHITE); - LuaSetEnumColor("BLACK", BLACK); - LuaSetEnumColor("BLANK", BLANK); - LuaSetEnumColor("MAGENTA", MAGENTA); - LuaSetEnumColor("RAYWHITE", RAYWHITE); - lua_pop(L, 1); - - LuaStartEnum(); - LuaSetEnum("UNCOMPRESSED_GRAYSCALE", UNCOMPRESSED_GRAYSCALE); - LuaSetEnum("UNCOMPRESSED_GRAY_ALPHA", UNCOMPRESSED_GRAY_ALPHA); - LuaSetEnum("UNCOMPRESSED_R5G6B5", UNCOMPRESSED_R5G6B5); - LuaSetEnum("UNCOMPRESSED_R8G8B8", UNCOMPRESSED_R8G8B8); - LuaSetEnum("UNCOMPRESSED_R5G5B5A1", UNCOMPRESSED_R5G5B5A1); - LuaSetEnum("UNCOMPRESSED_R4G4B4A4", UNCOMPRESSED_R4G4B4A4); - LuaSetEnum("UNCOMPRESSED_R8G8B8A8", UNCOMPRESSED_R8G8B8A8); - LuaSetEnum("COMPRESSED_DXT1_RGB", COMPRESSED_DXT1_RGB); - LuaSetEnum("COMPRESSED_DXT1_RGBA", COMPRESSED_DXT1_RGBA); - LuaSetEnum("COMPRESSED_DXT3_RGBA", COMPRESSED_DXT3_RGBA); - LuaSetEnum("COMPRESSED_DXT5_RGBA", COMPRESSED_DXT5_RGBA); - LuaSetEnum("COMPRESSED_ETC1_RGB", COMPRESSED_ETC1_RGB); - LuaSetEnum("COMPRESSED_ETC2_RGB", COMPRESSED_ETC2_RGB); - LuaSetEnum("COMPRESSED_ETC2_EAC_RGBA", COMPRESSED_ETC2_EAC_RGBA); - LuaSetEnum("COMPRESSED_PVRT_RGB", COMPRESSED_PVRT_RGB); - LuaSetEnum("COMPRESSED_PVRT_RGBA", COMPRESSED_PVRT_RGBA); - LuaSetEnum("COMPRESSED_ASTC_4x4_RGBA", COMPRESSED_ASTC_4x4_RGBA); - LuaSetEnum("COMPRESSED_ASTC_8x8_RGBA", COMPRESSED_ASTC_8x8_RGBA); - LuaEndEnum("TextureFormat"); - - LuaStartEnum(); - LuaSetEnum("ALPHA", BLEND_ALPHA); - LuaSetEnum("ADDITIVE", BLEND_ADDITIVE); - LuaSetEnum("MULTIPLIED", BLEND_MULTIPLIED); - LuaEndEnum("BlendMode"); - - LuaStartEnum(); - LuaSetEnum("POINT", LIGHT_POINT); - LuaSetEnum("DIRECTIONAL", LIGHT_DIRECTIONAL); - LuaSetEnum("SPOT", LIGHT_SPOT); - LuaEndEnum("LightType"); - - LuaStartEnum(); - LuaSetEnum("POINT", FILTER_POINT); - LuaSetEnum("BILINEAR", FILTER_BILINEAR); - LuaSetEnum("TRILINEAR", FILTER_TRILINEAR); - LuaSetEnum("ANISOTROPIC_4X", FILTER_ANISOTROPIC_4X); - LuaSetEnum("ANISOTROPIC_8X", FILTER_ANISOTROPIC_8X); - LuaSetEnum("ANISOTROPIC_16X", FILTER_ANISOTROPIC_16X); - LuaEndEnum("TextureFilter"); - - LuaStartEnum(); - LuaSetEnum("NONE", GESTURE_NONE); - LuaSetEnum("TAP", GESTURE_TAP); - LuaSetEnum("DOUBLETAP", GESTURE_DOUBLETAP); - LuaSetEnum("HOLD", GESTURE_HOLD); - LuaSetEnum("DRAG", GESTURE_DRAG); - LuaSetEnum("SWIPE_RIGHT", GESTURE_SWIPE_RIGHT); - LuaSetEnum("SWIPE_LEFT", GESTURE_SWIPE_LEFT); - LuaSetEnum("SWIPE_UP", GESTURE_SWIPE_UP); - LuaSetEnum("SWIPE_DOWN", GESTURE_SWIPE_DOWN); - LuaSetEnum("PINCH_IN", GESTURE_PINCH_IN); - LuaSetEnum("PINCH_OUT", GESTURE_PINCH_OUT); - LuaEndEnum("Gestures"); - - LuaStartEnum(); - LuaSetEnum("CUSTOM", CAMERA_CUSTOM); - LuaSetEnum("FREE", CAMERA_FREE); - LuaSetEnum("ORBITAL", CAMERA_ORBITAL); - LuaSetEnum("FIRST_PERSON", CAMERA_FIRST_PERSON); - LuaSetEnum("THIRD_PERSON", CAMERA_THIRD_PERSON); - LuaEndEnum("CameraMode"); - - LuaStartEnum(); - LuaSetEnum("DEFAULT_DEVICE", HMD_DEFAULT_DEVICE); - LuaSetEnum("OCULUS_RIFT_DK2", HMD_OCULUS_RIFT_DK2); - LuaSetEnum("OCULUS_RIFT_CV1", HMD_OCULUS_RIFT_CV1); - LuaSetEnum("VALVE_HTC_VIVE", HMD_VALVE_HTC_VIVE); - LuaSetEnum("SAMSUNG_GEAR_VR", HMD_SAMSUNG_GEAR_VR); - LuaSetEnum("GOOGLE_CARDBOARD", HMD_GOOGLE_CARDBOARD); - LuaSetEnum("SONY_PLAYSTATION_VR", HMD_SONY_PLAYSTATION_VR); - LuaSetEnum("RAZER_OSVR", HMD_RAZER_OSVR); - LuaSetEnum("FOVE_VR", HMD_FOVE_VR); - LuaEndEnum("VrDevice"); - - lua_pushglobaltable(L); - LuaSetEnum("INFO", INFO); - LuaSetEnum("ERROR", ERROR); - LuaSetEnum("WARNING", WARNING); - LuaSetEnum("DEBUG", DEBUG); - LuaSetEnum("OTHER", OTHER); - lua_pop(L, 1); - - lua_pushboolean(L, true); -#if defined(PLATFORM_DESKTOP) - lua_setglobal(L, "PLATFORM_DESKTOP"); -#elif defined(PLATFORM_ANDROID) - lua_setglobal(L, "PLATFORM_ANDROID"); -#elif defined(PLATFORM_RPI) - lua_setglobal(L, "PLATFORM_RPI"); -#elif defined(PLATFORM_WEB) - lua_setglobal(L, "PLATFORM_WEB"); -#endif - - luaL_openlibs(L); - LuaBuildOpaqueMetatables(); - - LuaRegisterRayLib(0); -} - -// De-initialize Lua system -RLUADEF void CloseLuaDevice(void) -{ - if (mainLuaState) - { - lua_close(mainLuaState); - mainLuaState = 0; - L = 0; - } -} - -// Execute raylib Lua code -RLUADEF void ExecuteLuaCode(const char *code) -{ - if (!mainLuaState) - { - TraceLog(WARNING, "Lua device not initialized"); - return; - } - - int result = luaL_dostring(L, code); - - switch (result) - { - case LUA_OK: break; - case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); break; - case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); break; - default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); break; - } -} - -// Execute raylib Lua script -RLUADEF void ExecuteLuaFile(const char *filename) -{ - if (!mainLuaState) - { - TraceLog(WARNING, "Lua device not initialized"); - return; - } - - int result = luaL_dofile(L, filename); - - switch (result) - { - case LUA_OK: break; - case LUA_ERRRUN: TraceLog(ERROR, "Lua Runtime Error: %s", lua_tostring(L, -1)); - case LUA_ERRMEM: TraceLog(ERROR, "Lua Memory Error: %s", lua_tostring(L, -1)); - default: TraceLog(ERROR, "Lua Error: %s", lua_tostring(L, -1)); - } -} - -#endif // RLUA_IMPLEMENTATION -- cgit v1.2.3 From 734776b923c6cc3a9f64acab7577e604ecd9602e Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Feb 2017 00:44:21 +0100 Subject: Commented code for review --- src/text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/text.c b/src/text.c index af07bb69..206d06ff 100644 --- a/src/text.c +++ b/src/text.c @@ -265,6 +265,7 @@ SpriteFont LoadSpriteFont(const char *fileName) RRESData rres = LoadResource(fileName); // Load sprite font texture + /* if (rres.type == RRES_FONT_IMAGE) { // NOTE: Parameters for RRES_FONT_IMAGE type are: width, height, format, mipmaps @@ -281,6 +282,7 @@ SpriteFont LoadSpriteFont(const char *fileName) spriteFont.charsCount = rres.param2; spriteFont.chars = rres.data; } + */ // TODO: Do not free rres.data memory (chars info data!) UnloadResource(rres); -- cgit v1.2.3 From ac6b4d3830b1ed1a1446ecb57009456306ef008d Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Feb 2017 00:44:54 +0100 Subject: Added audio function: SetMasterVolume() --- src/audio.c | 33 ++++++++++++++++++++++----------- src/raylib.h | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 22da74be..e669eceb 100644 --- a/src/audio.c +++ b/src/audio.c @@ -177,9 +177,11 @@ void InitAudioDevice(void) TraceLog(INFO, "Audio device and context initialized successfully: %s", alcGetString(device, ALC_DEVICE_SPECIFIER)); // Listener definition (just for 2D) - alListener3f(AL_POSITION, 0, 0, 0); - alListener3f(AL_VELOCITY, 0, 0, 0); - alListener3f(AL_ORIENTATION, 0, 0, -1); + alListener3f(AL_POSITION, 0.0f, 0.0f, 0.0f); + alListener3f(AL_VELOCITY, 0.0f, 0.0f, 0.0f); + alListener3f(AL_ORIENTATION, 0.0f, 0.0f, -1.0f); + + alListenerf(AL_GAIN, 1.0f); } } } @@ -216,6 +218,15 @@ bool IsAudioDeviceReady(void) } } +// Set master volume (listener) +void SetMasterVolume(float volume) +{ + if (volume < 0.0f) volume = 0.0f; + else if (volume > 1.0f) volume = 1.0f; + + alListenerf(AL_GAIN, volume); +} + //---------------------------------------------------------------------------------- // Module Functions Definition - Sounds loading and playing (.WAV) //---------------------------------------------------------------------------------- @@ -313,10 +324,10 @@ Sound LoadSoundFromWave(Wave wave) ALuint source; alGenSources(1, &source); // Generate pointer to audio source - alSourcef(source, AL_PITCH, 1); - alSourcef(source, AL_GAIN, 1); - alSource3f(source, AL_POSITION, 0, 0, 0); - alSource3f(source, AL_VELOCITY, 0, 0, 0); + alSourcef(source, AL_PITCH, 1.0f); + alSourcef(source, AL_GAIN, 1.0f); + alSource3f(source, AL_POSITION, 0.0f, 0.0f, 0.0f); + alSource3f(source, AL_VELOCITY, 0.0f, 0.0f, 0.0f); alSourcei(source, AL_LOOPING, AL_FALSE); // Convert loaded data to OpenAL buffer @@ -899,10 +910,10 @@ AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, un // Create an audio source alGenSources(1, &stream.source); - alSourcef(stream.source, AL_PITCH, 1); - alSourcef(stream.source, AL_GAIN, 1); - alSource3f(stream.source, AL_POSITION, 0, 0, 0); - alSource3f(stream.source, AL_VELOCITY, 0, 0, 0); + alSourcef(stream.source, AL_PITCH, 1.0f); + alSourcef(stream.source, AL_GAIN, 1.0f); + alSource3f(stream.source, AL_POSITION, 0.0f, 0.0f, 0.0f); + alSource3f(stream.source, AL_VELOCITY, 0.0f, 0.0f, 0.0f); // Create Buffers (double buffering) alGenBuffers(MAX_STREAM_BUFFERS, stream.buffers); diff --git a/src/raylib.h b/src/raylib.h index 5a1304fc..85cad6c3 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -947,6 +947,7 @@ RLAPI void ToggleVrMode(void); // Enable/Disable VR experienc RLAPI void InitAudioDevice(void); // Initialize audio device and context RLAPI void CloseAudioDevice(void); // Close the audio device and context RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +RLAPI void SetMasterVolume(float volume); // Set master volume (listener) RLAPI Wave LoadWave(const char *fileName); // Load wave data from file RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data -- cgit v1.2.3 From f2f05a734d4999ffdc19629c838f46914650bbd0 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Feb 2017 01:03:58 +0100 Subject: Added audio function: SetMusicLoopCount() Useful to set number of repeats for a music, needs to be tested... --- src/audio.c | 27 ++++++++++++++++++++------- src/raylib.h | 1 + 2 files changed, 21 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index e669eceb..5a5b008f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -123,7 +123,7 @@ typedef struct MusicData { AudioStream stream; // Audio stream (double buffering) - bool loop; // Repeat music after finish (loop) + int loopCount; // Loops count (times music repeats), -1 means infinite loop unsigned int totalSamples; // Total number of samples unsigned int samplesLeft; // Number of samples left to end } MusicData; @@ -632,7 +632,7 @@ Music LoadMusicStream(const char *fileName) music->totalSamples = (unsigned int)stb_vorbis_stream_length_in_samples(music->ctxOgg); // Independent by channel music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_OGG; - music->loop = true; // We loop by default + music->loopCount = -1; // Infinite loop by default TraceLog(DEBUG, "[%s] FLAC total samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] OGG sample rate: %i", fileName, info.sample_rate); @@ -651,7 +651,7 @@ Music LoadMusicStream(const char *fileName) music->totalSamples = (unsigned int)music->ctxFlac->totalSampleCount/music->ctxFlac->channels; music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_FLAC; - music->loop = true; // We loop by default + music->loopCount = -1; // Infinite loop by default TraceLog(DEBUG, "[%s] FLAC total samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] FLAC sample rate: %i", fileName, music->ctxFlac->sampleRate); @@ -665,14 +665,14 @@ Music LoadMusicStream(const char *fileName) if (!result) // XM context created successfully { - jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops + jar_xm_set_max_loop_count(music->ctxXm, 0); // Set infinite number of loops // NOTE: Only stereo is supported for XM music->stream = InitAudioStream(48000, 16, 2); music->totalSamples = (unsigned int)jar_xm_get_remaining_samples(music->ctxXm); music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_MODULE_XM; - music->loop = true; + music->loopCount = -1; // Infinite loop by default TraceLog(DEBUG, "[%s] XM number of samples: %i", fileName, music->totalSamples); TraceLog(DEBUG, "[%s] XM track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); @@ -689,7 +689,7 @@ Music LoadMusicStream(const char *fileName) music->totalSamples = (unsigned int)jar_mod_max_samples(&music->ctxMod); music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_MODULE_MOD; - music->loop = true; + music->loopCount = -1; // Infinite loop by default TraceLog(DEBUG, "[%s] MOD number of samples: %i", fileName, music->samplesLeft); TraceLog(DEBUG, "[%s] MOD track length: %11.6f sec", fileName, (float)music->totalSamples/48000.0f); @@ -813,7 +813,13 @@ void UpdateMusicStream(Music music) if (!active) { StopMusicStream(music); // Stop music (and reset) - if (music->loop) PlayMusicStream(music); // Play again + + // Decrease loopCount to stop when required + if (music->loopCount > 0) + { + music->loopCount--; // Decrease loop count + PlayMusicStream(music); // Play again + } } else { @@ -851,6 +857,13 @@ void SetMusicPitch(Music music, float pitch) alSourcef(music->stream.source, AL_PITCH, pitch); } +// Set music loop count (loop repeats) +// NOTE: If set to -1, means infinite loop +void SetMusicLoopCount(Music music, float count); +{ + music->loopCount = count; +} + // Get music time length (in seconds) float GetMusicTimeLength(Music music) { diff --git a/src/raylib.h b/src/raylib.h index 85cad6c3..907ef1e9 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -977,6 +977,7 @@ RLAPI void ResumeMusicStream(Music music); // Resume RLAPI bool IsMusicPlaying(Music music); // Check if music is playing RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI void SetMusicLoopCount(Music music, float count); // Set music loop count (loop repeats) RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) -- cgit v1.2.3 From 836c1636a2b5d7779c69cbb633a9ac690d54ef90 Mon Sep 17 00:00:00 2001 From: Ray San Date: Wed, 8 Feb 2017 20:02:40 +0100 Subject: Remove lighting system from rlgl standalone header --- src/audio.c | 2 +- src/audio.h | 2 ++ src/rlgl.h | 22 ---------------------- 3 files changed, 3 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 5a5b008f..adbe4f4f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -859,7 +859,7 @@ void SetMusicPitch(Music music, float pitch) // Set music loop count (loop repeats) // NOTE: If set to -1, means infinite loop -void SetMusicLoopCount(Music music, float count); +void SetMusicLoopCount(Music music, float count) { music->loopCount = count; } diff --git a/src/audio.h b/src/audio.h index 6f0c235a..05ba1a1d 100644 --- a/src/audio.h +++ b/src/audio.h @@ -109,6 +109,7 @@ extern "C" { // Prevents name mangling of functions void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +void SetMasterVolume(float volume); // Set master volume (listener) Wave LoadWave(const char *fileName); // Load wave data from file Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data @@ -138,6 +139,7 @@ void ResumeMusicStream(Music music); // Resume playin bool IsMusicPlaying(Music music); // Check if music is playing void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +void SetMusicLoopCount(Music music, float count); // Set music loop count (loop repeats) float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) diff --git a/src/rlgl.h b/src/rlgl.h index 9cee39cc..41f671e6 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -251,25 +251,6 @@ typedef unsigned char byte; float fovy; // Camera field-of-view apperture in Y (degrees) } Camera; - // Light type - typedef struct LightData { - unsigned int id; // Light unique id - bool enabled; // Light enabled - int type; // Light type: LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT - - Vector3 position; // Light position - Vector3 target; // Light target: LIGHT_DIRECTIONAL and LIGHT_SPOT (cone direction target) - float radius; // Light attenuation radius light intensity reduced with distance (world distance) - - Color diffuse; // Light diffuse color - float intensity; // Light intensity level - - float coneAngle; // Light cone max angle: LIGHT_SPOT - } LightData, *Light; - - // Light types - typedef enum { LIGHT_POINT, LIGHT_DIRECTIONAL, LIGHT_SPOT } LightType; - // Texture parameters: filter mode // NOTE 1: Filtering considers mipmaps if available in the texture // NOTE 2: Filter is accordingly set for minification and magnification @@ -415,9 +396,6 @@ void EndShaderMode(void); // End custo void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) void EndBlendMode(void); // End blending mode (reset to default: alpha blending) -Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool -void DestroyLight(Light light); // Destroy a light and take it out of the list - void TraceLog(int msgType, const char *text, ...); float *MatrixToFloat(Matrix mat); -- cgit v1.2.3 From b4988777ef60b312632602d7591ab508f0c90ab2 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 9 Feb 2017 22:19:48 +0100 Subject: [audio] Renamed variable --- src/audio.c | 29 +++++++++++++++-------------- src/audio.h | 4 ++-- src/raylib.h | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index adbe4f4f..720233e0 100644 --- a/src/audio.c +++ b/src/audio.c @@ -374,7 +374,7 @@ void UnloadSound(Sound sound) // Update sound buffer with new data // NOTE: data must match sound.format -void UpdateSound(Sound sound, const void *data, int numSamples) +void UpdateSound(Sound sound, const void *data, int samplesCount) { ALint sampleRate, sampleSize, channels; alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate); @@ -385,7 +385,7 @@ void UpdateSound(Sound sound, const void *data, int numSamples) TraceLog(DEBUG, "UpdateSound() : AL_BITS: %i", sampleSize); TraceLog(DEBUG, "UpdateSound() : AL_CHANNELS: %i", channels); - unsigned int dataSize = numSamples*channels*sampleSize/8; // Size of data in bytes + unsigned int dataSize = samplesCount*channels*sampleSize/8; // Size of data in bytes alSourceStop(sound.source); // Stop sound alSourcei(sound.source, AL_BUFFER, 0); // Unbind buffer from sound to update @@ -752,6 +752,7 @@ void StopMusicStream(Music music) } // Update (re-fill) music buffers if data already processed +// TODO: Make sure buffers are ready for update... check music state void UpdateMusicStream(Music music) { ALenum state; @@ -768,13 +769,13 @@ void UpdateMusicStream(Music music) void *pcm = calloc(AUDIO_BUFFER_SIZE*music->stream.channels*music->stream.sampleSize/8, 1); int numBuffersToProcess = processed; - int numSamples = 0; // Total size of data steamed in L+R samples for xm floats, - // individual L or R for ogg shorts + int samplesCount = 0; // Total size of data steamed in L+R samples for xm floats, + //individual L or R for ogg shorts for (int i = 0; i < numBuffersToProcess; i++) { - if (music->samplesLeft >= AUDIO_BUFFER_SIZE) numSamples = AUDIO_BUFFER_SIZE; - else numSamples = music->samplesLeft; + if (music->samplesLeft >= AUDIO_BUFFER_SIZE) samplesCount = AUDIO_BUFFER_SIZE; + else samplesCount = music->samplesLeft; // TODO: Really don't like ctxType thingy... switch (music->ctxType) @@ -782,22 +783,22 @@ void UpdateMusicStream(Music music) case MUSIC_AUDIO_OGG: { // NOTE: Returns the number of samples to process (be careful! we ask for number of shorts!) - int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, (short *)pcm, numSamples*music->stream.channels); + int numSamplesOgg = stb_vorbis_get_samples_short_interleaved(music->ctxOgg, music->stream.channels, (short *)pcm, samplesCount*music->stream.channels); } break; case MUSIC_AUDIO_FLAC: { // NOTE: Returns the number of samples to process - unsigned int numSamplesFlac = (unsigned int)drflac_read_s16(music->ctxFlac, numSamples*music->stream.channels, (short *)pcm); + unsigned int numSamplesFlac = (unsigned int)drflac_read_s16(music->ctxFlac, samplesCount*music->stream.channels, (short *)pcm); } break; - case MUSIC_MODULE_XM: jar_xm_generate_samples_16bit(music->ctxXm, pcm, numSamples); break; - case MUSIC_MODULE_MOD: jar_mod_fillbuffer(&music->ctxMod, pcm, numSamples, 0); break; + case MUSIC_MODULE_XM: jar_xm_generate_samples_16bit(music->ctxXm, pcm, samplesCount); break; + case MUSIC_MODULE_MOD: jar_mod_fillbuffer(&music->ctxMod, pcm, samplesCount, 0); break; default: break; } - UpdateAudioStream(music->stream, pcm, numSamples); - music->samplesLeft -= numSamples; + UpdateAudioStream(music->stream, pcm, samplesCount); + music->samplesLeft -= samplesCount; if (music->samplesLeft <= 0) { @@ -976,7 +977,7 @@ void CloseAudioStream(AudioStream stream) // Update audio stream buffers with data // NOTE: Only updates one buffer per call -void UpdateAudioStream(AudioStream stream, const void *data, int numSamples) +void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount) { ALuint buffer = 0; alSourceUnqueueBuffers(stream.source, 1, &buffer); @@ -984,7 +985,7 @@ void UpdateAudioStream(AudioStream stream, const void *data, int numSamples) // Check if any buffer was available for unqueue if (alGetError() != AL_INVALID_VALUE) { - alBufferData(buffer, stream.format, data, numSamples*stream.channels*stream.sampleSize/8, stream.sampleRate); + alBufferData(buffer, stream.format, data, samplesCount*stream.channels*stream.sampleSize/8, stream.sampleRate); alSourceQueueBuffers(stream.source, 1, &buffer); } } diff --git a/src/audio.h b/src/audio.h index 05ba1a1d..99b58e15 100644 --- a/src/audio.h +++ b/src/audio.h @@ -115,7 +115,7 @@ Wave LoadWave(const char *fileName); // Load wave dat Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data Sound LoadSound(const char *fileName); // Load sound from file Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data +void UpdateSound(Sound sound, const void *data, int samplesCount); // Update sound buffer with new data void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound void PlaySound(Sound sound); // Play a sound @@ -146,7 +146,7 @@ float GetMusicTimePlayed(Music music); // Get current m AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) -void UpdateAudioStream(AudioStream stream, void *data, int numSamples); // Update audio stream buffers with data +void UpdateAudioStream(AudioStream stream, void *data, int samplesCount); // Update audio stream buffers with data void CloseAudioStream(AudioStream stream); // Close audio stream and free memory bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill void PlayAudioStream(AudioStream stream); // Play audio stream diff --git a/src/raylib.h b/src/raylib.h index 907ef1e9..a5849180 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -953,7 +953,7 @@ RLAPI Wave LoadWave(const char *fileName); // Load wa RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data -RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data +RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound RLAPI void PlaySound(Sound sound); // Play a sound @@ -984,7 +984,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) -RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int numSamples); // Update audio stream buffers with data +RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream -- cgit v1.2.3 From afcd748fdf2d4f379f7a3be1706c1d6cd2ff504d Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Feb 2017 23:17:56 +0100 Subject: Reviewed fread() usage around the code --- src/audio.c | 2 +- src/core.c | 4 ++-- src/text.c | 7 +++++-- src/textures.c | 22 ++++++++++++---------- 4 files changed, 20 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 720233e0..eb5e65d6 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1114,7 +1114,7 @@ static Wave LoadWAV(const char *fileName) wave.data = malloc(wavData.subChunkSize); // Read in the sound data into the soundData variable - fread(wave.data, 1, wavData.subChunkSize, wavFile); + fread(wave.data, wavData.subChunkSize, 1, wavFile); // Store wave parameters wave.sampleRate = wavFormat.sampleRate; diff --git a/src/core.c b/src/core.c index 04dd0540..28f73345 100644 --- a/src/core.c +++ b/src/core.c @@ -1025,14 +1025,14 @@ int StorageLoadValue(int position) { // Get file size fseek(storageFile, 0, SEEK_END); - int fileSize = ftell(storageFile); // Size in bytes + int fileSize = ftell(storageFile); // Size in bytes rewind(storageFile); if (fileSize < (position*4)) TraceLog(WARNING, "Storage position could not be found"); else { fseek(storageFile, (position*4), SEEK_SET); - fread(&value, 1, 4, storageFile); + fread(&value, 4, 1, storageFile); // Read 1 element of 4 bytes size } fclose(storageFile); diff --git a/src/text.c b/src/text.c index 206d06ff..4deae25c 100644 --- a/src/text.c +++ b/src/text.c @@ -928,6 +928,8 @@ static SpriteFont LoadBMFont(const char *fileName) // TODO: Review texture packing method and generation (use oversampling) static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, int *fontChars) { + #define MAX_TTF_SIZE 16 // Maximum ttf file size in MB + // NOTE: Font texture size is predicted (being as much conservative as possible) // Predictive method consist of supposing same number of chars by line-column (sqrtf) // and a maximum character width of 3/4 of fontSize... it worked ok with all my tests... @@ -938,7 +940,7 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, in TraceLog(INFO, "TTF spritefont loading: Predicted texture size: %ix%i", textureSize, textureSize); - unsigned char *ttfBuffer = (unsigned char *)malloc(1 << 25); + unsigned char *ttfBuffer = (unsigned char *)malloc(MAX_TTF_SIZE*1024*1024); unsigned char *dataBitmap = (unsigned char *)malloc(textureSize*textureSize*sizeof(unsigned char)); // One channel bitmap returned! stbtt_bakedchar *charData = (stbtt_bakedchar *)malloc(sizeof(stbtt_bakedchar)*charsCount); @@ -952,7 +954,8 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, in return font; } - fread(ttfBuffer, 1, 1 << 25, ttfFile); + // NOTE: We try reading up to 16 MB of elements of 1 byte + fread(ttfBuffer, 1, MAX_TTF_SIZE*1024*1024, ttfFile); if (fontChars[0] != 32) TraceLog(WARNING, "TTF spritefont loading: first character is not SPACE(32) character"); diff --git a/src/textures.c b/src/textures.c index ce978b6c..5b2e4775 100644 --- a/src/textures.c +++ b/src/textures.c @@ -238,7 +238,9 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int default: TraceLog(WARNING, "Image format not suported"); break; } - int bytes = fread(image.data, size, 1, rawFile); + // NOTE: fread() returns num read elements instead of bytes, + // to get bytes we need to read (1 byte size, elements) instead of (x byte size, 1 element) + int bytes = fread(image.data, 1, size, rawFile); // Check if data has been read successfully if (bytes < size) @@ -1591,7 +1593,7 @@ static Image LoadDDS(const char *fileName) // Verify the type of file char filecode[4]; - fread(filecode, 1, 4, ddsFile); + fread(filecode, 4, 1, ddsFile); if (strncmp(filecode, "DDS ", 4) != 0) { @@ -1690,17 +1692,17 @@ static Image LoadDDS(const char *fileName) } else if (((ddsHeader.ddspf.flags == 0x04) || (ddsHeader.ddspf.flags == 0x05)) && (ddsHeader.ddspf.fourCC > 0)) // Compressed { - int bufsize; + int size; // DDS image data size // Calculate data size, including all mipmaps - if (ddsHeader.mipmapCount > 1) bufsize = ddsHeader.pitchOrLinearSize*2; - else bufsize = ddsHeader.pitchOrLinearSize; + if (ddsHeader.mipmapCount > 1) size = ddsHeader.pitchOrLinearSize*2; + else size = ddsHeader.pitchOrLinearSize; TraceLog(DEBUG, "Pitch or linear size: %i", ddsHeader.pitchOrLinearSize); - image.data = (unsigned char*)malloc(bufsize*sizeof(unsigned char)); + image.data = (unsigned char*)malloc(size*sizeof(unsigned char)); - fread(image.data, 1, bufsize, ddsFile); + fread(image.data, size, 1, ddsFile); image.mipmaps = ddsHeader.mipmapCount; @@ -1803,7 +1805,7 @@ static Image LoadPKM(const char *fileName) image.data = (unsigned char*)malloc(size*sizeof(unsigned char)); - fread(image.data, 1, size, pkmFile); + fread(image.data, size, 1, pkmFile); if (pkmHeader.format == 0) image.format = COMPRESSED_ETC1_RGB; else if (pkmHeader.format == 1) image.format = COMPRESSED_ETC2_RGB; @@ -1888,7 +1890,7 @@ static Image LoadKTX(const char *fileName) if (ktxHeader.keyValueDataSize > 0) { - for (int i = 0; i < ktxHeader.keyValueDataSize; i++) fread(&unused, 1, 1, ktxFile); + for (int i = 0; i < ktxHeader.keyValueDataSize; i++) fread(&unused, sizeof(unsigned char), 1, ktxFile); } int dataSize; @@ -1896,7 +1898,7 @@ static Image LoadKTX(const char *fileName) image.data = (unsigned char*)malloc(dataSize*sizeof(unsigned char)); - fread(image.data, 1, dataSize, ktxFile); + fread(image.data, dataSize, 1, ktxFile); if (ktxHeader.glInternalFormat == 0x8D64) image.format = COMPRESSED_ETC1_RGB; else if (ktxHeader.glInternalFormat == 0x9274) image.format = COMPRESSED_ETC2_RGB; -- cgit v1.2.3 From 05f039f85fb43f9ae4598747a4d9c6770ec5774b Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 11 Feb 2017 23:34:41 +0100 Subject: Corrected issue with OpenAL being 'keg only' on OSX Also reviewed issue with stdbool when compiling with clang --- src/audio.c | 13 +++++++++---- src/external/jar_mod.h | 3 +-- src/raylib.h | 10 +++------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index eb5e65d6..58699035 100644 --- a/src/audio.c +++ b/src/audio.c @@ -59,9 +59,14 @@ #include "utils.h" // Required for: fopen() Android mapping, TraceLog() #endif -#include "AL/al.h" // OpenAL basic header -#include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) -//#include "AL/alext.h" // OpenAL extensions header, required for AL_EXT_FLOAT32 and AL_EXT_MCFORMATS +#ifdef __APPLE__ + #include "OpenAL/al.h" // OpenAL basic header + #include "OpenAL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) +#else + #include "AL/al.h" // OpenAL basic header + #include "AL/alc.h" // OpenAL context header (like OpenGL, OpenAL requires a context to work) + //#include "AL/alext.h" // OpenAL extensions header, required for AL_EXT_FLOAT32 and AL_EXT_MCFORMATS +#endif // OpenAL extension: AL_EXT_FLOAT32 - Support for 32bit float samples // OpenAL extension: AL_EXT_MCFORMATS - Support for multi-channel formats (Quad, 5.1, 6.1, 7.1) @@ -1252,4 +1257,4 @@ void TraceLog(int msgType, const char *text, ...) if (msgType == ERROR) exit(1); // If ERROR message, exit program } -#endif \ No newline at end of file +#endif diff --git a/src/external/jar_mod.h b/src/external/jar_mod.h index bee9f6ee..c17130a6 100644 --- a/src/external/jar_mod.h +++ b/src/external/jar_mod.h @@ -83,8 +83,7 @@ #include #include -#include - +//#include #ifdef __cplusplus diff --git a/src/raylib.h b/src/raylib.h index a5849180..800ab2be 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -296,13 +296,9 @@ //---------------------------------------------------------------------------------- #ifndef __cplusplus // Boolean type - #ifndef __APPLE__ - #if !defined(_STDBOOL_H) - typedef enum { false, true } bool; - #define _STDBOOL_H - #endif - #else - #include + #if !defined(_STDBOOL_H) + typedef enum { false, true } bool; + #define _STDBOOL_H #endif #endif -- cgit v1.2.3 From 4cb3e4a240d342a08a97cb4659c18c34d8dccdc8 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 15 Feb 2017 10:44:59 +0100 Subject: Support resources divided in multiple parts Every part is a resource itself, they are loaded in an array --- src/rres.h | 105 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 50 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/rres.h b/src/rres.h index 700c9ab3..32f0ab6b 100644 --- a/src/rres.h +++ b/src/rres.h @@ -83,6 +83,8 @@ RRES_TYPE_FONT_DATA, // Character { int value, recX, recY, recWidth, recHeight, offsetX, offsetY, xAdvance } RRES_TYPE_DIRECTORY } RRESDataType; + + typedef struct RRESData *RRES; #endif //---------------------------------------------------------------------------------- @@ -93,9 +95,9 @@ //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -RRESDEF RRESData LoadResource(const char *rresFileName); -RRESDEF RRESData LoadResourceById(const char *rresFileName, int rresId); -RRESDEF void UnloadResource(RRESData rres); +//RRESDEF RRESData LoadResourceData(const char *rresFileName, int rresId, int part); +RRESDEF RRES LoadResource(const char *rresFileName, int rresId); +RRESDEF void UnloadResource(RRESData *rres); #endif // RRES_H @@ -235,24 +237,12 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i // Module Functions Definition //---------------------------------------------------------------------------------- -// Load resource from file (only one) -// NOTE: Returns uncompressed data with parameters, only first resource found -RRESDEF RRESData LoadResource(const char *fileName) -{ - // Force loading first resource available - RRESData rres = { 0 }; - - rres = LoadResourceById(fileName, 0); - - return rres; -} - -// Load resource from file by id +// Load resource from file by id (could be multiple parts) // NOTE: Returns uncompressed data with parameters, search resource by id -RRESDEF RRESData LoadResourceById(const char *fileName, int rresId) +RRESDEF RRES LoadResource(const char *fileName, int rresId) { - RRESData rres = { 0 }; - + RRES rres; + RRESFileHeader fileHeader; RRESInfoHeader infoHeader; @@ -280,33 +270,42 @@ RRESDEF RRESData LoadResourceById(const char *fileName, int rresId) { // Read resource info and parameters fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); - + + rres = (RRES)malloc(sizeof(RRESData)*infoHeader.partsCount) + if (infoHeader.id == rresId) { - // Register data type and parameters - rres.type = infoHeader.dataType; - rres.param1 = infoHeader.param1; - rres.param2 = infoHeader.param2; - rres.param3 = infoHeader.param3; - rres.param4 = infoHeader.param4; - - // Read resource data block - void *data = RRES_MALLOC(infoHeader.dataSize); - fread(data, infoHeader.dataSize, 1, rresFile); - - if (infoHeader.compType == RRES_COMP_DEFLATE) + // Load all required resources parts + for (int k = 0; k < infoHeader.partsCount; k++) { - void *uncompData = DecompressData(data, infoHeader.dataSize, infoHeader.uncompSize); + // TODO: Verify again that rresId is the same in every part - rres.data = uncompData; + // Register data type and parameters + rres[k].type = infoHeader.dataType; + rres[k].param1 = infoHeader.param1; + rres[k].param2 = infoHeader.param2; + rres[k].param3 = infoHeader.param3; + rres[k].param4 = infoHeader.param4; + + // Read resource data block + void *data = RRES_MALLOC(infoHeader.dataSize); + fread(data, infoHeader.dataSize, 1, rresFile); + + if (infoHeader.compType == RRES_COMP_DEFLATE) + { + void *uncompData = DecompressData(data, infoHeader.dataSize, infoHeader.uncompSize); + + rres[k].data = uncompData; + + RRES_FREE(data); + } + else rres[k].data = data; + + if (rres[k].data != NULL) TraceLog(INFO, "[%s][ID %i] Resource data loaded successfully", fileName, (int)infoHeader.id); - RRES_FREE(data); + // Read next part + fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); } - else rres.data = data; - - if (rres.data != NULL) TraceLog(INFO, "[%s][ID %i] Resource data loaded successfully", fileName, (int)infoHeader.id); - - if (rresId == 0) break; // Break for loop, do not check next resource } else { @@ -372,7 +371,6 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i return uncompData; } - // Some required functions for rres standalone module version #if defined(RRES_STANDALONE) // Outputs a trace log message (INFO, ERROR, WARNING) @@ -417,22 +415,19 @@ Mesh LoadMeshEx(rres.param1, rres.data, rres.data + offset, rres.data + offset*2 Shader LoadShader(const char *vsText, int vsLength); Shader LoadShaderV(rres.data, rres.param1); -// Parameters information depending on resource type (IMAGE, WAVE, MESH, TEXT) +// Parameters information depending on resource type -// Image data params -int imgWidth, imgHeight; -char colorFormat, mipmaps; +// RRES_TYPE_IMAGE params: imgWidth, imgHeight, format, mipmaps; +// RRES_TYPE_WAVE params: sampleCount, sampleRate, sampleSize, channels; +// RRES_TYPE_FONT_IMAGE params: imgWidth, imgHeight, format, mipmaps; +// RRES_TYPE_FONT_DATA params: charsCount, baseSize +// RRES_TYPE_VERTEX params: vertexCount, vertexType, vertexFormat // Use masks instead? +// RRES_TYPE_TEXT params: charsCount, cultureCode +// RRES_TYPE_DIRECTORY params: fileCount, directoryCount -// Wave data params -int sampleCount, -short sampleRate, bps; -char channels, reserved; +// SpriteFont = RRES_TYPE_FONT_IMAGE chunk + RRES_TYPE_FONT_DATA chunk +// Mesh = multiple RRES_TYPE_VERTEX chunks -// Mesh data params -int vertexCount, reserved; -short vertexTypesMask, vertexFormatsMask; +Ref: RIFF file-format: http://www.johnloomis.org/cpe102/asgn/asgn1/riff.html -// Text data params -int charsCount; -int cultureCode; */ \ No newline at end of file -- cgit v1.2.3 From 177af272f0713ee42bdb32201b1fff3aa75e345f Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 16 Feb 2017 00:19:03 +0100 Subject: Added function DrawRectanglePro() --- src/shapes.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/shapes.c b/src/shapes.c index 8c6c4be0..83b80182 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -4,11 +4,17 @@ * * Basic functions to draw 2d Shapes and check collisions * -* External libs: +* DEPENDENCIES: * rlgl - raylib OpenGL abstraction layer * -* Module Configuration Flags: -* ... +* CONFIGURATION: +* +* #define SUPPORT_QUADS_ONLY +* + #define SUPPORT_TRIANGLES_ONLY +* +* +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * @@ -190,6 +196,29 @@ void DrawRectangleRec(Rectangle rec, Color color) DrawRectangle(rec.x, rec.y, rec.width, rec.height, color); } +void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color) +{ + rlEnableTexture(GetDefaultTexture().id); + + rlPushMatrix(); + rlTranslatef((float)rec.x, (float)rec.y, 0); + rlRotatef(rotation, 0, 0, 1); + rlTranslatef(-origin.x, -origin.y, 0); + + rlBegin(RL_QUADS); + rlColor4ub(color.r, color.g, color.b, color.a); + rlNormal3f(0.0f, 0.0f, 1.0f); // Normal vector pointing towards viewer + + rlVertex2f(0.0f, 0.0f); + rlVertex2f(0.0f, (float)rec.height); + rlVertex2f((float)rec.width, (float)rec.height); + rlVertex2f((float)rec.width, 0.0f); + rlEnd(); + rlPopMatrix(); + + rlDisableTexture(); +} + // Draw a gradient-filled rectangle // NOTE: Gradient goes from bottom (color1) to top (color2) void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2) -- cgit v1.2.3 From 1c364cc5074fe8abb482ed9985705eeb249b93ae Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 16 Feb 2017 00:19:30 +0100 Subject: Review rres loading to support multiple parts --- src/rres.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/rres.h b/src/rres.h index 32f0ab6b..bed28723 100644 --- a/src/rres.h +++ b/src/rres.h @@ -62,7 +62,7 @@ #if defined(RRES_STANDALONE) // rRES data returned when reading a resource, it contains all required data for user (24 byte) // NOTE: Using void *data pointer, so we can load to image.data, wave.data, mesh.*, (unsigned char *) - typedef struct { + typedef struct RRESData { unsigned int type; // Resource type (4 byte) unsigned int param1; // Resouce parameter 1 (4 byte) @@ -73,6 +73,7 @@ void *data; // Resource data pointer (4 byte) } RRESData; + // RRESData type typedef enum { RRES_TYPE_RAW = 0, RRES_TYPE_IMAGE, @@ -84,6 +85,7 @@ RRES_TYPE_DIRECTORY } RRESDataType; + // RRES type (pointer to RRESData array) typedef struct RRESData *RRES; #endif @@ -96,8 +98,8 @@ // Module Functions Declaration //---------------------------------------------------------------------------------- //RRESDEF RRESData LoadResourceData(const char *rresFileName, int rresId, int part); -RRESDEF RRES LoadResource(const char *rresFileName, int rresId); -RRESDEF void UnloadResource(RRESData *rres); +RRESDEF RRES LoadResource(const char *fileName, int rresId); +RRESDEF void UnloadResource(RRES rres); #endif // RRES_H @@ -242,7 +244,7 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i RRESDEF RRES LoadResource(const char *fileName, int rresId) { RRES rres; - + RRESFileHeader fileHeader; RRESInfoHeader infoHeader; @@ -271,7 +273,7 @@ RRESDEF RRES LoadResource(const char *fileName, int rresId) // Read resource info and parameters fread(&infoHeader, sizeof(RRESInfoHeader), 1, rresFile); - rres = (RRES)malloc(sizeof(RRESData)*infoHeader.partsCount) + rres = (RRES)malloc(sizeof(RRESData)*infoHeader.partsCount); if (infoHeader.id == rresId) { @@ -314,7 +316,7 @@ RRESDEF RRES LoadResource(const char *fileName, int rresId) } } - if (rres.data == NULL) TraceLog(WARNING, "[%s][ID %i] Requested resource could not be found", fileName, (int)rresId); + if (rres[0].data == NULL) TraceLog(WARNING, "[%s][ID %i] Requested resource could not be found", fileName, (int)rresId); } fclose(rresFile); @@ -323,9 +325,9 @@ RRESDEF RRES LoadResource(const char *fileName, int rresId) return rres; } -RRESDEF void UnloadResource(RRESData rres) +RRESDEF void UnloadResource(RRES rres) { - if (rres.data != NULL) free(rres.data); + if (rres[0].data != NULL) free(rres[0].data); } //---------------------------------------------------------------------------------- -- cgit v1.2.3 From 05cff44d0a9af5bcb41ddd0baa6b7693f6ac116b Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 16 Feb 2017 00:50:02 +0100 Subject: Improved modules description -IN PROGRESS- Working in modules configuration flags... --- src/audio.c | 56 +++++++++++++++++++++++++++++++++++++------------------- src/audio.h | 4 +++- src/camera.h | 14 +++++++++++--- src/core.c | 55 +++++++++++++++++++++++++++++++++++++------------------ src/gestures.h | 17 +++++++++++++---- src/models.c | 13 +++++++------ src/physac.h | 15 +++++++++------ src/raylib.h | 44 +++++++++++++++++++++++++++----------------- src/raymath.h | 25 +++++++++++++------------ src/rlgl.c | 46 ++++++++++++++++++++++++++++++++++++---------- src/rres.h | 18 +++++++++++------- src/shapes.c | 11 ++++------- src/text.c | 36 +++++++++++++++++++++--------------- src/textures.c | 35 +++++++++++++++++++++++++++-------- src/utils.c | 19 +++++++++++++------ 15 files changed, 269 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 58699035..690a41eb 100644 --- a/src/audio.c +++ b/src/audio.c @@ -3,32 +3,50 @@ * raylib.audio * * This module provides basic functionality to work with audio: -* Manage audio device (init/close) -* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) -* Play/Stop/Pause/Resume loaded audio -* Manage mixing channels -* Manage raw audio context +* Manage audio device (init/close) +* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) +* Play/Stop/Pause/Resume loaded audio +* Manage mixing channels +* Manage raw audio context * -* External libs: +* NOTES: +* +* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS) +* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) +* +* CONFIGURATION: +* +* #define AUDIO_STANDALONE +* If defined, the module can be used as standalone library (independently of raylib). +* Required types and functions are defined in the same module. +* +* #define SUPPORT_FILEFORMAT_WAV / SUPPORT_LOAD_WAV / ENABLE_LOAD_WAV +* #define SUPPORT_FILEFORMAT_OGG +* #define SUPPORT_FILEFORMAT_XM +* #define SUPPORT_FILEFORMAT_MOD +* #define SUPPORT_FILEFORMAT_FLAC +* Selected desired fileformats to be supported for loading. Some of those formats are +* supported by default, to remove support, just comment unrequired #define in this module +* +* #define SUPPORT_RAW_AUDIO_BUFFERS +* +* DEPENDENCIES: * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) * stb_vorbis - OGG audio files loading (http://www.nothings.org/stb_vorbis/) * jar_xm - XM module file loading * jar_mod - MOD audio file loading * dr_flac - FLAC audio file loading * -* Module Configuration Flags: -* AUDIO_STANDALONE - Use this module as standalone library (independently of raylib) -* -* Some design decisions: -* Support only up to two channels: MONO and STEREO (for additional channels, AL_EXT_MCFORMATS) -* Support only the following sample sizes: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) +* CONTRIBUTORS: * * Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: -* XM audio module support (jar_xm) -* MOD audio module support (jar_mod) -* Mixing channels support -* Raw audio context support +* XM audio module support (jar_xm) +* MOD audio module support (jar_mod) +* Mixing channels support +* Raw audio context support +* * +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * @@ -246,11 +264,11 @@ Wave LoadWave(const char *fileName) else if (strcmp(GetExtension(fileName), "flac") == 0) wave = LoadFLAC(fileName); else if (strcmp(GetExtension(fileName),"rres") == 0) { - RRESData rres = LoadResource(fileName); + RRES rres = LoadResource(fileName, 0); - // NOTE: Parameters for RRES_WAVE type are: sampleCount, sampleRate, sampleSize, channels + // NOTE: Parameters for RRES_TYPE_WAVE are: sampleCount, sampleRate, sampleSize, channels - if (rres.type == RRES_WAVE) wave = LoadWaveEx(rres.data, rres.param1, rres.param2, rres.param3, rres.param4); + if (rres[0].type == RRES_TYPE_WAVE) wave = LoadWaveEx(rres[0].data, rres[0].param1, rres[0].param2, rres[0].param3, rres[0].param4); else TraceLog(WARNING, "[%s] Resource file does not contain wave data", fileName); UnloadResource(rres); diff --git a/src/audio.h b/src/audio.h index 99b58e15..01ed9f72 100644 --- a/src/audio.h +++ b/src/audio.h @@ -9,7 +9,7 @@ * Manage mixing channels * Manage raw audio context * -* External libs: +* DEPENDENCIES: * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) * stb_vorbis - OGG audio files loading (http://www.nothings.org/stb_vorbis/) * jar_xm - XM module file loading @@ -23,6 +23,8 @@ * Raw audio context support * * +* LICENSE: zlib/libpng +* * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event diff --git a/src/camera.h b/src/camera.h index cf542288..87ba1942 100644 --- a/src/camera.h +++ b/src/camera.h @@ -2,6 +2,10 @@ * * raylib Camera System - Camera Modes Setup and Control Functions * +* NOTE: Memory footprint of this library is aproximately 52 bytes (global variables) +* +* CONFIGURATION: +* * #define CAMERA_IMPLEMENTATION * Generates the implementation of the library into the included file. * If not defined, the library is in header only mode and can be included in other headers @@ -11,10 +15,14 @@ * If defined, the library can be used as standalone as a camera system but some * functions must be redefined to manage inputs accordingly. * -* NOTE: Memory footprint of this library is aproximately 52 bytes (global variables) +* CONTRIBUTORS: +* Marc Palau: Initial implementation (2014) +* Ramon Santamaria: Supervision, review, update and maintenance +* +* +* LICENSE: zlib/libpng * -* Initial design by Marc Palau (2014) -* Reviewed by Ramon Santamaria (2015-2016) +* Copyright (c) 2015-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/core.c b/src/core.c index 28f73345..9d40edcc 100644 --- a/src/core.c +++ b/src/core.c @@ -1,27 +1,46 @@ /********************************************************************************************** * -* raylib.core -* -* Basic functions to manage windows, OpenGL context and input on multiple platforms +* raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms * * The following platforms are supported: Windows, Linux, Mac (OSX), Android, Raspberry Pi, HTML5, Oculus Rift CV1 * -* External libs: +* CONFIGURATION: +* +* #define PLATFORM_DESKTOP +* Windowing and input system configured for desktop platforms: Windows, Linux, OSX (managed by GLFW3 library) +* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it +* +* #define PLATFORM_ANDROID +* Windowing and input system configured for Android device, app activity managed internally in this module. +* NOTE: OpenGL ES 2.0 is required and graphic device is managed by EGL +* +* #define PLATFORM_RPI +* Windowing and input system configured for Raspberry Pi (tested on Raspbian), graphic device is managed by EGL +* and inputs are processed is raw mode, reading from /dev/input/ +* +* #define PLATFORM_WEB +* Windowing and input system configured for HTML5 (run on browser), code converted from C to asm.js +* using emscripten compiler. OpenGL ES 2.0 required for direct translation to WebGL equivalent code. +* +* #define LOAD_DEFAULT_FONT (defined by default) +* Default font is loaded on window initialization to be available for the user to render simple text. +* NOTE: If enabled, uses external module functions to load default raylib font (module: text) +* +* #define INCLUDE_CAMERA_SYSTEM / SUPPORT_CAMERA_SYSTEM +* +* #define INCLUDE_GESTURES_SYSTEM / SUPPORT_GESTURES_SYSTEM +* +* #define SUPPORT_MOUSE_GESTURES +* Mouse gestures are directly mapped like touches and processed by gestures system. +* +* DEPENDENCIES: * GLFW3 - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX) * raymath - 3D math functionality (Vector3, Matrix, Quaternion) * camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person) * gestures - Gestures system for touch-ready devices (or simulated from mouse inputs) * -* Module Configuration Flags: -* PLATFORM_DESKTOP - Windows, Linux, Mac (OSX) -* PLATFORM_ANDROID - Android (only OpenGL ES 2.0 devices), graphic device is managed by EGL and input system by Android activity. -* PLATFORM_RPI - Rapsberry Pi (tested on Raspbian), graphic device is managed by EGL and input system is coded in raw mode. -* PLATFORM_WEB - HTML5 (using emscripten compiler) -* -* RL_LOAD_DEFAULT_FONT - Use external module functions to load default raylib font (module: text) -* -* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for render mirror - View [rlgl] module to enable it * +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * @@ -140,7 +159,7 @@ #define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad) #define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad) -#define RL_LOAD_DEFAULT_FONT // Load default font on window initialization (module: text) +#define LOAD_DEFAULT_FONT // Load default font on window initialization (module: text) //---------------------------------------------------------------------------------- // Types and Structures Definition @@ -256,7 +275,7 @@ static bool showLogo = false; // Track if showing logo at init is //---------------------------------------------------------------------------------- // Other Modules Functions Declaration (required by core) //---------------------------------------------------------------------------------- -#if defined(RL_LOAD_DEFAULT_FONT) +#if defined(LOAD_DEFAULT_FONT) extern void LoadDefaultFont(void); // [Module: text] Loads default font on InitWindow() extern void UnloadDefaultFont(void); // [Module: text] Unloads default font from GPU memory #endif @@ -338,7 +357,7 @@ void InitWindow(int width, int height, const char *title) // Init graphics device (display device and OpenGL context) InitGraphicsDevice(width, height); -#if defined(RL_LOAD_DEFAULT_FONT) +#if defined(LOAD_DEFAULT_FONT) // Load default font // NOTE: External function (defined in module: text) LoadDefaultFont(); @@ -450,7 +469,7 @@ void InitWindow(int width, int height, void *state) // Close Window and Terminate Context void CloseWindow(void) { -#if defined(RL_LOAD_DEFAULT_FONT) +#if defined(LOAD_DEFAULT_FONT) UnloadDefaultFont(); #endif @@ -2410,7 +2429,7 @@ static void AndroidCommandCallback(struct android_app *app, int32_t cmd) // Init graphics device (display device and OpenGL context) InitGraphicsDevice(screenWidth, screenHeight); - #if defined(RL_LOAD_DEFAULT_FONT) + #if defined(LOAD_DEFAULT_FONT) // Load default font // NOTE: External function (defined in module: text) LoadDefaultFont(); diff --git a/src/gestures.h b/src/gestures.h index f4dcb133..99f49d2a 100644 --- a/src/gestures.h +++ b/src/gestures.h @@ -2,6 +2,10 @@ * * raylib Gestures System - Gestures Processing based on input gesture events (touch/mouse) * +* NOTE: Memory footprint of this library is aproximately 128 bytes (global variables) +* +* CONFIGURATION: +* * #define GESTURES_IMPLEMENTATION * Generates the implementation of the library into the included file. * If not defined, the library is in header only mode and can be included in other headers @@ -11,11 +15,16 @@ * If defined, the library can be used as standalone to process gesture events with * no external dependencies. * -* NOTE: Memory footprint of this library is aproximately 128 bytes +* CONTRIBUTORS: +* Marc Palau: Initial implementation (2014) +* Albert Martos: Complete redesign and testing (2015) +* Ian Eito: Complete redesign and testing (2015) +* Ramon Santamaria: Supervision, review, update and maintenance +* +* +* LICENSE: zlib/libpng * -* Initial design by Marc Palau (2014) -* Redesigned by Albert Martos and Ian Eito (2015) -* Reviewed by Ramon Santamaria (2015-2016) +* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. diff --git a/src/models.c b/src/models.c index 43821691..bef19e10 100644 --- a/src/models.c +++ b/src/models.c @@ -1,14 +1,15 @@ /********************************************************************************************** * -* raylib.models +* raylib.models - Basic functions to draw 3d shapes and 3d models * -* Basic functions to draw 3d shapes and load/draw 3d models (.OBJ) +* CONFIGURATION: * -* External libs: -* rlgl - raylib OpenGL abstraction layer +* #define SUPPORT_FILEFORMAT_OBJ / SUPPORT_LOAD_OBJ * -* Module Configuration Flags: -* ... +* #define SUPPORT_FILEFORMAT_MTL +* +* +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * diff --git a/src/physac.h b/src/physac.h index d958c701..cb0e3f3c 100644 --- a/src/physac.h +++ b/src/physac.h @@ -1,11 +1,13 @@ /********************************************************************************************** * -* Physac - 2D Physics library for videogames +* Physac v1.0 - 2D Physics library for videogames * -* Description: Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop -* to simluate physics. A physics step contains the following phases: get collision information, apply dynamics, -* collision solving and position correction. It uses a very simple struct for physic bodies with a position vector -* to be used in any 3D rendering API. +* DESCRIPTION: +* +* Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop +* to simluate physics. A physics step contains the following phases: get collision information, +* apply dynamics, collision solving and position correction. It uses a very simple struct for physic +* bodies with a position vector to be used in any 3D rendering API. * * CONFIGURATION: * @@ -37,7 +39,8 @@ * Otherwise it will include stdlib.h and use the C standard library malloc()/free() function. * * VERY THANKS TO: -* - Ramón Santamaria (@raysan5) +* Ramón Santamaria (@raysan5) +* * * LICENSE: zlib/libpng * diff --git a/src/raylib.h b/src/raylib.h index 800ab2be..3ff0d28f 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,10 +1,10 @@ /********************************************************************************************** * -* raylib 1.7.0 (www.raylib.com) +* raylib v1.7.0 (www.raylib.com) * * A simple and easy-to-use library to learn videogames programming * -* Features: +* FEATURES: * Library written in plain C code (C99) * Uses PascalCase/camelCase notation * Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) @@ -20,7 +20,13 @@ * Minimal external dependencies (GLFW3, OpenGL, OpenAL) * Complete binding for Lua [rlua] * -* External libs: +* NOTES: +* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) +* One custom default font could be loaded automatically when InitWindow() [core] +* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads +* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) +* +* DEPENDENCIES: * GLFW3 (www.glfw.org) for window/context management and input [core] * GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] * stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] @@ -33,13 +39,8 @@ * OpenAL Soft for audio device/context management [audio] * tinfl for data decompression (DEFLATE algorithm) [utils] * -* Some design decisions: -* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) -* One custom default font could be loaded automatically when InitWindow() [core] -* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads -* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) * -* -- LICENSE -- +* LICENSE: zlib/libpng * * raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, * BSD-like license that allows static linking with closed source software: @@ -592,8 +593,9 @@ typedef enum { HMD_FOVE_VR, } VrDevice; -// rRES data returned when reading a resource, it contains all required data for user (24 byte) -typedef struct { +// rRES data returned when reading a resource, +// it contains all required data for user (24 byte) +typedef struct RRESData { unsigned int type; // Resource type (4 byte) unsigned int param1; // Resouce parameter 1 (4 byte) @@ -604,14 +606,21 @@ typedef struct { void *data; // Resource data pointer (4 byte) } RRESData; -typedef enum { - RRES_RAW = 0, - RRES_IMAGE, - RRES_WAVE, - RRES_VERTEX, - RRES_TEXT +// RRESData type +typedef enum { + RRES_TYPE_RAW = 0, + RRES_TYPE_IMAGE, + RRES_TYPE_WAVE, + RRES_TYPE_VERTEX, + RRES_TYPE_TEXT, + RRES_TYPE_FONT_IMAGE, + RRES_TYPE_FONT_CHARDATA, // CharInfo data array + RRES_TYPE_DIRECTORY } RRESDataType; +// RRES type (pointer to RRESData array) +typedef struct RRESData *RRES; + #ifdef __cplusplus extern "C" { // Prevents name mangling of functions #endif @@ -758,6 +767,7 @@ RLAPI void DrawCircleV(Vector2 center, float radius, Color color); RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline diff --git a/src/raymath.h b/src/raymath.h index c073b72d..a2263f19 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -1,22 +1,23 @@ /********************************************************************************************** * -* raymath (header only file) +* raymath v1.0 - Some useful functions to work with Vector3, Matrix and Quaternions * -* Some useful functions to work with Vector3, Matrix and Quaternions +* CONFIGURATION: * -* You must: -* #define RAYMATH_IMPLEMENTATION -* before you include this file in *only one* C or C++ file to create the implementation. +* #define RAYMATH_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. * -* Example: -* #define RAYMATH_IMPLEMENTATION -* #include "raymath.h" +* #define RAYMATH_EXTERN_INLINE +* Inlines all functions code, so it runs faster. This requires lots of memory on system. +* +* #define RAYMATH_STANDALONE +* Avoid raylib.h header inclusion in this file. +* Vector3 and Matrix data types are defined internally in raymath module. * -* You can also use: -* #define RAYMATH_EXTERN_INLINE // Inlines all functions code, so it runs faster. -* // This requires lots of memory on system. -* #define RAYMATH_STANDALONE // Not dependent on raylib.h structs: Vector3, Matrix. * +* LICENSE: zlib/libpng * * Copyright (c) 2015 Ramon Santamaria (@raysan5) * diff --git a/src/rlgl.c b/src/rlgl.c index ce17adc3..ffc9d741 100644 --- a/src/rlgl.c +++ b/src/rlgl.c @@ -2,6 +2,8 @@ * * rlgl - raylib OpenGL abstraction layer * +* DESCRIPTION: +* * rlgl allows usage of OpenGL 1.1 style functions (rlVertex) that are internally mapped to * selected OpenGL version (1.1, 2.1, 3.3 Core, ES 2.0). * @@ -11,20 +13,44 @@ * rlglDraw() - Process internal buffers and send required draw calls * rlglClose() - De-initialize internal buffers data and other auxiliar resources * -* External libs: +* CONFIGURATION: +* +* #define GRAPHICS_API_OPENGL_11 +* Use OpenGL 1.1 backend +* +* #define GRAPHICS_API_OPENGL_21 +* Use OpenGL 2.1 backend +* +* #define GRAPHICS_API_OPENGL_33 +* Use OpenGL 3.3 Core profile backend +* +* #define GRAPHICS_API_OPENGL_ES2 +* Use OpenGL ES 2.0 backend +* +* #define RLGL_STANDALONE +* Use rlgl as standalone library (no raylib dependency) +* +* #define RLGL_NO_DISTORTION_SHADER +* Avoid stereo rendering distortion sahder (shader_distortion.h) inclusion +* +* #define SUPPORT_SHADER_DEFAULT / ENABLE_SHADER_DEFAULT +* +* #define SUPPORT_SHADER_DISTORTION +* +* +* #define SUPPORT_OCULUS_RIFT_CV1 / RLGL_OCULUS_SUPPORT +* Enable Oculus Rift CV1 functionality +* +* #define SUPPORT_STEREO_RENDERING +* +* #define RLGL_NO_DEFAULT_SHADER +* +* DEPENDENCIES: * raymath - 3D math functionality (Vector3, Matrix, Quaternion) * GLAD - OpenGL extensions loading (OpenGL 3.3 Core only) * -* Module Configuration Flags: -* GRAPHICS_API_OPENGL_11 - Use OpenGL 1.1 backend -* GRAPHICS_API_OPENGL_21 - Use OpenGL 2.1 backend -* GRAPHICS_API_OPENGL_33 - Use OpenGL 3.3 Core profile backend -* GRAPHICS_API_OPENGL_ES2 - Use OpenGL ES 2.0 backend -* -* RLGL_STANDALONE - Use rlgl as standalone library (no raylib dependency) -* RLGL_NO_DISTORTION_SHADER - Avoid stereo rendering distortion sahder (shader_distortion.h) inclusion -* RLGL_OCULUS_SUPPORT - Enable Oculus Rift CV1 functionality * +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * diff --git a/src/rres.h b/src/rres.h index bed28723..362da10d 100644 --- a/src/rres.h +++ b/src/rres.h @@ -4,14 +4,18 @@ * * Basic functions to load/save rRES resource files * -* External libs: -* tinfl - DEFLATE decompression functions +* CONFIGURATION: +* +* #define RREM_IMPLEMENTATION +* Generates the implementation of the library into the included file. +* If not defined, the library is in header only mode and can be included in other headers +* or source files without problems. But only ONE file should hold the implementation. * -* Module Configuration Flags: +* DEPENDENCIES: +* tinfl - DEFLATE decompression functions * -* #define RREM_IMPLEMENTATION -* Generates the implementation of the library into the included file. * +* LICENSE: zlib/libpng * * Copyright (c) 2016-2017 Ramon Santamaria (@raysan5) * @@ -81,7 +85,7 @@ RRES_TYPE_VERTEX, RRES_TYPE_TEXT, RRES_TYPE_FONT_IMAGE, - RRES_TYPE_FONT_DATA, // Character { int value, recX, recY, recWidth, recHeight, offsetX, offsetY, xAdvance } + RRES_TYPE_FONT_CHARDATA, // Character { int value, recX, recY, recWidth, recHeight, offsetX, offsetY, xAdvance } RRES_TYPE_DIRECTORY } RRESDataType; @@ -243,7 +247,7 @@ static void *DecompressData(const unsigned char *data, unsigned long compSize, i // NOTE: Returns uncompressed data with parameters, search resource by id RRESDEF RRES LoadResource(const char *fileName, int rresId) { - RRES rres; + RRES rres = { 0 }; RRESFileHeader fileHeader; RRESInfoHeader infoHeader; diff --git a/src/shapes.c b/src/shapes.c index 83b80182..a42b0551 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -1,17 +1,14 @@ /********************************************************************************************** * -* raylib.shapes -* -* Basic functions to draw 2d Shapes and check collisions -* -* DEPENDENCIES: -* rlgl - raylib OpenGL abstraction layer +* raylib.shapes - Basic functions to draw 2d Shapes and check collisions * * CONFIGURATION: * * #define SUPPORT_QUADS_ONLY +* Draw shapes using only QUADS, vertex are accumulated in QUADS arrays (like textures) * - #define SUPPORT_TRIANGLES_ONLY +* #define SUPPORT_TRIANGLES_ONLY +* Draw shapes using only TRIANGLES, vertex are accumulated in TRIANGLES arrays * * * LICENSE: zlib/libpng diff --git a/src/text.c b/src/text.c index 4deae25c..6f18b391 100644 --- a/src/text.c +++ b/src/text.c @@ -1,14 +1,22 @@ /********************************************************************************************** * -* raylib.text +* raylib.text - Basic functions to load SpriteFonts and draw Text * -* Basic functions to load SpriteFonts and draw Text +* CONFIGURATION: * -* External libs: +* #define SUPPORT_FILEFORMAT_FNT +* #define SUPPORT_FILEFORMAT_TTF / INCLUDE_STB_TRUETYPE +* #define SUPPORT_FILEFORMAT_IMAGE_FONT +* Selected desired fileformats to be supported for loading. Some of those formats are +* supported by default, to remove support, just comment unrequired #define in this module +* +* #define INCLUDE_DEFAULT_FONT / SUPPORT_DEFAULT_FONT +* +* DEPENDENCIES: * stb_truetype - Load TTF file and rasterize characters data * -* Module Configuration Flags: -* ... +* +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * @@ -262,30 +270,28 @@ SpriteFont LoadSpriteFont(const char *fileName) else if (strcmp(GetExtension(fileName),"rres") == 0) { // TODO: Read multiple resource blocks from file (RRES_FONT_IMAGE, RRES_FONT_CHARDATA) - RRESData rres = LoadResource(fileName); + RRES rres = LoadResource(fileName, 0); // Load sprite font texture - /* - if (rres.type == RRES_FONT_IMAGE) + if (rres[0].type == RRES_TYPE_FONT_IMAGE) { // NOTE: Parameters for RRES_FONT_IMAGE type are: width, height, format, mipmaps - Image image = LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); + Image image = LoadImagePro(rres[0].data, rres[0].param1, rres[0].param2, rres[0].param3); spriteFont.texture = LoadTextureFromImage(image); UnloadImage(image); } // Load sprite characters data - if (rres.type == RRES_FONT_CHARDATA) + if (rres[1].type == RRES_TYPE_FONT_CHARDATA) { // NOTE: Parameters for RRES_FONT_CHARDATA type are: fontSize, charsCount - spriteFont.baseSize = rres.param1; - spriteFont.charsCount = rres.param2; - spriteFont.chars = rres.data; + spriteFont.baseSize = rres[1].param1; + spriteFont.charsCount = rres[1].param2; + spriteFont.chars = rres[1].data; } - */ // TODO: Do not free rres.data memory (chars info data!) - UnloadResource(rres); + //UnloadResource(rres[0]); } else { diff --git a/src/textures.c b/src/textures.c index 5b2e4775..7db3bf56 100644 --- a/src/textures.c +++ b/src/textures.c @@ -1,16 +1,35 @@ /********************************************************************************************** * -* raylib.textures +* raylib.textures - Basic functions to load and draw Textures (2d) * -* Basic functions to load and draw Textures (2d) +* CONFIGURATION: * -* External libs: +* #define SUPPORT_STB_IMAGE / INCLUDE_STB_IMAGE +* +* #define SUPPORT_FILEFORMAT_BMP / SUPPORT_LOAD_BMP +* #define SUPPORT_FILEFORMAT_PNG / SUPPORT_LOAD_PNG +* #define SUPPORT_FILEFORMAT_TGA +* #define SUPPORT_FILEFORMAT_JPG / ENABLE_LOAD_JPG +* #define SUPPORT_FILEFORMAT_GIF +* #define SUPPORT_FILEFORMAT_HDR +* #define SUPPORT_FILEFORMAT_DDS / ENABLE_LOAD_DDS +* #define SUPPORT_FILEFORMAT_PKM +* #define SUPPORT_FILEFORMAT_KTX +* #define SUPPORT_FILEFORMAT_PVR +* #define SUPPORT_FILEFORMAT_ASTC +* Selected desired fileformats to be supported for loading. Some of those formats are +* supported by default, to remove support, just comment unrequired #define in this module +* +* #define SUPPORT_IMAGE_RESIZE / INCLUDE_STB_IMAGE_RESIZE +* #define SUPPORT_IMAGE_MANIPULATION +* +* DEPENDENCIES: * stb_image - Multiple image formats loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) * NOTE: stb_image has been slightly modified to support Android platform. * stb_image_resize - Multiple image resize algorythms * -* Module Configuration Flags: -* ... +* +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * @@ -143,11 +162,11 @@ Image LoadImage(const char *fileName) else if (strcmp(GetExtension(fileName),"astc") == 0) image = LoadASTC(fileName); else if (strcmp(GetExtension(fileName),"rres") == 0) { - RRESData rres = LoadResource(fileName); + RRES rres = LoadResource(fileName, 0); - // NOTE: Parameters for RRES_IMAGE type are: width, height, format, mipmaps + // NOTE: Parameters for RRES_TYPE_IMAGE are: width, height, format, mipmaps - if (rres.type == RRES_IMAGE) image = LoadImagePro(rres.data, rres.param1, rres.param2, rres.param3); + if (rres[0].type == RRES_TYPE_IMAGE) image = LoadImagePro(rres[0].data, rres[0].param1, rres[0].param2, rres[0].param3); else TraceLog(WARNING, "[%s] Resource file does not contain image data", fileName); UnloadResource(rres); diff --git a/src/utils.c b/src/utils.c index e5e05955..9a2a723a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,16 +1,23 @@ /********************************************************************************************** * -* raylib.utils +* raylib.utils - Some common utility functions * -* Some utility functions +* CONFIGURATION: * -* External libs: -* tinfl - zlib DEFLATE algorithm decompression +* #define SUPPORT_SAVE_PNG +* Enable saving PNG fileformat +* NOTE: Requires stb_image_write library +* +* #define SUPPORT_SAVE_BMP +* +* #define DO_NOT_TRACE_DEBUG_MSGS +* Avoid showing DEBUG TraceLog() messages +* +* DEPENDENCIES: * stb_image_write - PNG writting functions * -* Module Configuration Flags: -* DO_NOT_TRACE_DEBUG_MSGS - Avoid showing DEBUG TraceLog() messages * +* LICENSE: zlib/libpng * * Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) * -- cgit v1.2.3 From de103ecc5e4890c3a830245c9ca3283ed2d739dd Mon Sep 17 00:00:00 2001 From: bugcaptor Date: Thu, 2 Mar 2017 10:07:09 +0900 Subject: fix for audio.c(607): error C2036: 'void *': unknown size in Visual Studio 2015. --- src/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 690a41eb..128781a4 100644 --- a/src/audio.c +++ b/src/audio.c @@ -604,7 +604,7 @@ void WaveCrop(Wave *wave, int initSample, int finalSample) void *data = malloc(sampleCount*wave->channels*wave->sampleSize/8); - memcpy(data, wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->channels*wave->sampleSize/8); + memcpy(data, (unsigned char*)wave->data + (initSample*wave->channels*wave->sampleSize/8), sampleCount*wave->channels*wave->sampleSize/8); free(wave->data); wave->data = data; -- cgit v1.2.3 From 9cfaa81a7e7741f03db1f9579aa0b49bee42cdd7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Mar 2017 10:55:29 +0100 Subject: Added some flags and functions to manage window - SetWindowPosition(int x, int y); - SetWindowMonitor(int monitor); --- src/core.c | 46 +++++++++++++++++++++++++++++++++++----------- src/raylib.h | 17 ++++++++++------- 2 files changed, 45 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 9d40edcc..6ea54862 100644 --- a/src/core.c +++ b/src/core.c @@ -578,6 +578,26 @@ void SetWindowIcon(Image image) #endif } +// Set window position on screen (windowed mode) +void SetWindowPosition(int x, int y) +{ + glfwSetWindowPos(window, x, y); +} + +// Set monitor for the current window (fullscreen mode) +void SetWindowMonitor(int monitor) +{ + int monitorCount; + GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); + + if ((monitor >= 0) && (monitor < monitorCount)) + { + glfwSetWindowMonitor(window, monitors[monitor], 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE); + TraceLog(INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor])); + } + else TraceLog(WARNING, "Selected monitor not found"); +} + // Get current screen width int GetScreenWidth(void) { @@ -1536,13 +1556,23 @@ static void InitGraphicsDevice(int width, int height) glfwDefaultWindowHints(); // Set default windows hints - if (configFlags & FLAG_RESIZABLE_WINDOW) + // Check some Window creation flags + if (configFlags & FLAG_WINDOW_RESIZABLE) glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window + else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable + + if (configFlags & FLAG_WINDOW_DECORATED) glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window + + if (configFlags & FLAG_WINDOW_TRANSPARENT) { - glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // Resizable window + // TODO: Enable transparent window (not ready yet on GLFW 3.2) } - else glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); // Avoid window being resizable - //glfwWindowHint(GLFW_DECORATED, GL_TRUE); // Border and buttons on Window + if (configFlags & FLAG_MSAA_4X_HINT) + { + glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 + TraceLog(INFO, "Trying to enable MSAA x4"); + } + //glfwWindowHint(GLFW_RED_BITS, 8); // Framebuffer red color component bits //glfwWindowHint(GLFW_DEPTH_BITS, 16); // Depthbuffer bits (24 by default) //glfwWindowHint(GLFW_REFRESH_RATE, 0); // Refresh rate for fullscreen window @@ -1551,13 +1581,7 @@ static void InitGraphicsDevice(int width, int height) // NOTE: When asking for an OpenGL context version, most drivers provide highest supported version // with forward compatibility to older OpenGL versions. - // For example, if using OpenGL 1.1, driver can provide a 3.3 context fordward compatible. - - if (configFlags & FLAG_MSAA_4X_HINT) - { - glfwWindowHint(GLFW_SAMPLES, 4); // Enables multisampling x4 (MSAA), default is 0 - TraceLog(INFO, "Trying to enable MSAA x4"); - } + // For example, if using OpenGL 1.1, driver can provide a 4.3 context forward compatible. // Check selection OpenGL version if (rlGetVersion() == OPENGL_21) diff --git a/src/raylib.h b/src/raylib.h index 3ff0d28f..ab7d7027 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -98,13 +98,14 @@ #define RAD2DEG (180.0f/PI) // raylib Config Flags -#define FLAG_FULLSCREEN_MODE 1 -#define FLAG_RESIZABLE_WINDOW 2 -#define FLAG_SHOW_LOGO 4 -#define FLAG_SHOW_MOUSE_CURSOR 8 -#define FLAG_CENTERED_MODE 16 -#define FLAG_MSAA_4X_HINT 32 -#define FLAG_VSYNC_HINT 64 +#define FLAG_SHOW_LOGO 1 +#define FLAG_SHOW_MOUSE_CURSOR 2 +#define FLAG_FULLSCREEN_MODE 4 +#define FLAG_WINDOW_RESIZABLE 8 +#define FLAG_WINDOW_DECORATED 16 +#define FLAG_WINDOW_TRANSPARENT 32 +#define FLAG_MSAA_4X_HINT 64 +#define FLAG_VSYNC_HINT 128 // Keyboard Function Keys #define KEY_SPACE 32 @@ -644,6 +645,8 @@ RLAPI bool WindowShouldClose(void); // Detect if K RLAPI bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) RLAPI void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP) RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) RLAPI int GetScreenWidth(void); // Get current screen width RLAPI int GetScreenHeight(void); // Get current screen height -- cgit v1.2.3 From 203d1a154eb5b78fc5f56e9dead04c3a89bcd39e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Mar 2017 10:55:58 +0100 Subject: Clear music buffers on stop --- src/audio.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index 128781a4..659ead0f 100644 --- a/src/audio.c +++ b/src/audio.c @@ -762,7 +762,18 @@ void ResumeMusicStream(Music music) void StopMusicStream(Music music) { alSourceStop(music->stream.source); + + // Clear stream buffers + void *pcm = calloc(AUDIO_BUFFER_SIZE*music->stream.sampleSize/8*music->stream.channels, 1); + for (int i = 0; i < MAX_STREAM_BUFFERS; i++) + { + alBufferData(music->stream.buffers[i], music->stream.format, pcm, AUDIO_BUFFER_SIZE*music->stream.sampleSize/8*music->stream.channels, music->stream.sampleRate); + } + + free(pcm); + + // Restart music context switch (music->ctxType) { case MUSIC_AUDIO_OGG: stb_vorbis_seek_start(music->ctxOgg); break; -- cgit v1.2.3 From d1c9afd1d8ae4ae3e075b117fff7a5a77f3c4d60 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 5 Mar 2017 19:17:00 +0100 Subject: Work on timming functions... It seems Sleep() behaves weird on my computer, disabled by default returning to the busy wait loop... also re-implemented DrawFPS() to avoid frame blitting... --- src/core.c | 63 +++++++++++++++++++++++++++++++++--------------------------- src/raylib.h | 19 +++++++++--------- src/text.c | 16 ++++++++++++++- 3 files changed, 59 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 6ea54862..a3b5f486 100644 --- a/src/core.c +++ b/src/core.c @@ -88,6 +88,8 @@ #if defined __linux || defined(PLATFORM_WEB) #include // Required for: timespec, nanosleep(), select() - POSIX +#elif defined __APPLE__ + #include // Required for: usleep() #endif #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) @@ -287,7 +289,7 @@ static void InitGraphicsDevice(int width, int height); // Initialize graphics d static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer static double GetTime(void); // Returns time since InitTimer() was run -static void Wait(int ms); // Wait for some milliseconds (stop program execution) +static void Wait(float ms); // Wait for some milliseconds (stop program execution) static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed static void PollInputEvents(void); // Register user events @@ -339,7 +341,7 @@ static void *GamepadThread(void *arg); // Mouse reading thread #if defined(_WIN32) // NOTE: We include Sleep() function signature here to avoid windows.h inclusion - void __stdcall Sleep(unsigned long msTimeout); // Required for Delay() + void __stdcall Sleep(unsigned long msTimeout); // Required for Wait() #endif //---------------------------------------------------------------------------------- @@ -703,19 +705,19 @@ void EndDrawing(void) currentTime = GetTime(); drawTime = currentTime - previousTime; previousTime = currentTime; - + frameTime = updateTime + drawTime; // Wait for some milliseconds... if (frameTime < targetTime) { - Wait((int)((targetTime - frameTime)*1000)); + Wait((targetTime - frameTime)*1000.0f); currentTime = GetTime(); double extraTime = currentTime - previousTime; previousTime = currentTime; - frameTime = updateTime + drawTime + extraTime; + frameTime += extraTime; } } @@ -851,14 +853,14 @@ void SetTargetFPS(int fps) // Returns current FPS int GetFPS(void) { - return (int)floorf(1.0f/GetFrameTime()); + return (int)(1.0f/GetFrameTime()); } // Returns time in seconds for one frame float GetFrameTime(void) { // NOTE: We round value to milliseconds - return (roundf(frameTime*1000.0)/1000.0f); + return (float)frameTime; } // Converts Color to float array and normalizes @@ -1688,7 +1690,10 @@ static void InitGraphicsDevice(int width, int height) #endif glfwMakeContextCurrent(window); - glfwSwapInterval(0); // Disable VSync by default + + // Try to disable GPU V-Sync by default, set framerate using SetTargetFPS() + // NOTE: V-Sync can be enabled by graphic driver configuration + glfwSwapInterval(0); #if defined(PLATFORM_DESKTOP) // Load OpenGL 3.3 extensions @@ -1696,9 +1701,8 @@ static void InitGraphicsDevice(int width, int height) rlglLoadExtensions(glfwGetProcAddress); #endif - // Enables GPU v-sync, so frames are not limited to screen refresh rate (60Hz -> 60 FPS) - // If not set, swap interval uses GPU v-sync configuration - // Framerate can be setup using SetTargetFPS() + // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) + // NOTE: V-Sync can be enabled by graphic driver configuration if (configFlags & FLAG_VSYNC_HINT) { glfwSwapInterval(1); @@ -2001,27 +2005,30 @@ static double GetTime(void) } // Wait for some milliseconds (stop program execution) -static void Wait(int ms) -{ -#if defined _WIN32 - Sleep(ms); -#elif defined __linux || defined(PLATFORM_WEB) - struct timespec req = { 0 }; - time_t sec = (int)(ms/1000); - ms -= (sec*1000); - req.tv_sec=sec; - req.tv_nsec=ms*1000000L; - - // NOTE: Use nanosleep() on Unix platforms... usleep() it's deprecated. - while (nanosleep(&req,&req) == -1) continue; -//#elif defined __APPLE__ - // TODO: -#else +static void Wait(float ms) +{ +#define SUPPORT_BUSY_WAIT_LOOP +#if defined(SUPPORT_BUSY_WAIT_LOOP) double prevTime = GetTime(); double nextTime = 0.0; // Busy wait loop - while ((nextTime - prevTime) < (double)ms/1000.0) nextTime = GetTime(); + while ((nextTime - prevTime) < ms/1000.0f) nextTime = GetTime(); +#else + #if defined _WIN32 + Sleep(ms); + #elif defined __linux || defined(PLATFORM_WEB) + struct timespec req = { 0 }; + time_t sec = (int)(ms/1000.0f); + ms -= (sec*1000); + req.tv_sec = sec; + req.tv_nsec = ms*1000000L; + + // NOTE: Use nanosleep() on Unix platforms... usleep() it's deprecated. + while (nanosleep(&req, &req) == -1) continue; + #elif defined __APPLE__ + usleep(ms*1000.0f); + #endif #endif } diff --git a/src/raylib.h b/src/raylib.h index ab7d7027..beda833c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -98,14 +98,13 @@ #define RAD2DEG (180.0f/PI) // raylib Config Flags -#define FLAG_SHOW_LOGO 1 -#define FLAG_SHOW_MOUSE_CURSOR 2 -#define FLAG_FULLSCREEN_MODE 4 -#define FLAG_WINDOW_RESIZABLE 8 -#define FLAG_WINDOW_DECORATED 16 -#define FLAG_WINDOW_TRANSPARENT 32 -#define FLAG_MSAA_4X_HINT 64 -#define FLAG_VSYNC_HINT 128 +#define FLAG_SHOW_LOGO 1 // Set this flag to show raylib logo at startup +#define FLAG_FULLSCREEN_MODE 2 // Set this flag to run program in fullscreen +#define FLAG_WINDOW_RESIZABLE 4 // Set this flag to allow resizable window +#define FLAG_WINDOW_DECORATED 8 // Set this flag to show window decoration (frame and buttons) +#define FLAG_WINDOW_TRANSPARENT 16 // Set this flag to allow transparent window +#define FLAG_MSAA_4X_HINT 32 // Set this flag to try enabling MSAA 4X +#define FLAG_VSYNC_HINT 64 // Set this flag to try enabling V-Sync on GPU // Keyboard Function Keys #define KEY_SPACE 32 @@ -674,8 +673,8 @@ RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) -RLAPI int GetFPS(void); // Returns current FPS (rounded value) -RLAPI float GetFrameTime(void); // Returns time in seconds for one frame (rounded value) +RLAPI int GetFPS(void); // Returns current FPS +RLAPI float GetFrameTime(void); // Returns time in seconds for one frame RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value RLAPI int GetHexValue(Color color); // Returns hexadecimal value for a Color diff --git a/src/text.c b/src/text.c index 6f18b391..18ebf482 100644 --- a/src/text.c +++ b/src/text.c @@ -531,8 +531,22 @@ Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, float fontSize, i // NOTE: Uses default font void DrawFPS(int posX, int posY) { + // NOTE: We are rendering fps every second for better viewing on high framerates + + static int fps = 0; + static int counter = 0; + static int refreshRate = 20; + + if (counter < refreshRate) counter++; + else + { + fps = GetFPS(); + refreshRate = fps; + counter = 0; + } + // NOTE: We have rounding errors every frame, so it oscillates a lot - DrawText(FormatText("%2i FPS", GetFPS()), posX, posY, 20, LIME); + DrawText(FormatText("%2i FPS", fps), posX, posY, 20, LIME); } //---------------------------------------------------------------------------------- -- cgit v1.2.3